riku
2024-08-14 f2a0ea849099f49a3d2a9c7e5c44d033df22468f
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
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
import dayjs from 'dayjs';
 
/**
 * 筛选条件相关信息获取逻辑
 * 包括场景类型、行政区划
 */
export const useOptions = Behavior({
  data: {
    sceneTypeText: '',
    sceneTypeValue: [],
    time:'',
  },
  methods: {
    setScene(e) {
      const { sceneText: sceneTypeText, sceneValue: sceneTypeValue } = e.detail;
      this.setData({ sceneTypeText, sceneTypeValue });
    },
    initScene(e) {
      this.setScene(e);
      this.init();
    },
    // 场景类型切换时,同时获取新的线上监管信息
    onScenePickerConfirm(e) {
      this.setScene(e);
      this.fetchSupervision();
      this.fetchInspection();
    },
 
    setLocation(e) {
      const {
        provinceText: provinceName,
        cityText: cityName,
        districtText: districtName,
        townText: townName,
        provinceValue: provinceCode,
        cityValue: cityCode,
        districtValue: districtCode,
        townValue: townCode,
        locationValue,
      } = e.detail;
      this.setData({
        provinceName,
        cityName,
        districtName,
        townName,
        provinceCode,
        cityCode,
        districtCode,
        townCode,
        locationValue,
      });
    },
    initLocation(e) {
      this.setLocation(e);
      this.init();
    },
    // 行政区划切换时,获取新的线上监管信息以及线下巡查监管信息
    onLocationChange(e) {
      this.setLocation(e);
      this.fetchSupervision();
      this.fetchInspection();
    },
 
    // 时间更改
    setTimeValue(e) {
      const { timeValue } = e.detail;
      const p = dayjs(timeValue).format('YYYY-MM-DD HH:mm:ss');
      this.setData({
        time: p,
      });
    },
    initTime(e) {
      this.setTimeValue(e);
      this.init();
    },
    onTimePickerConfirm(e) {
      this.setTimeValue(e);
      this._startLoad();
    },
  },
});