riku
2024-08-12 65124213af664a68ad88ce7f6dcb133116d7702f
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
/**
 * 设备安装位置信息管理
 */
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,
      });
    },
  },
});