/** * 设备安装位置信息管理 */ export const useDeviceLocation = Behavior({ data: { showNewLocation: false, newLocation: {}, deviceLocationList: [], }, methods: { onAddLocation() { this.setData({ showNewLocation: true, newLocation: {}, }); }, saveNewLocation(e) { const { deviceLocationList } = this.data; deviceLocationList.push(e.detail); debugger this.setData({ showNewLocation: false, deviceLocationList, }); }, cancelNewLocation() { this.setData({ showNewLocation: false, }); }, }, });