riku
2025-04-27 f46786f11c5c08ead7501a82e5a71430ad69b782
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
import dayjs from 'dayjs';
 
/**
 * 筛选条件相关信息获取逻辑
 * 包括时间、行政区划
 */
export const useOptions = Behavior({
  data: {
    time: '',
  },
  methods: {
    setLocation(e) {
      const {
        provinceText: provinceName,
        cityText: cityName,
        districtText: districtName,
        townText: townName,
        provinceValue: provinceCode,
        cityValue: cityCode,
        districtValue: districtCode,
        townValue: townCode,
        locationValue,
      } = e.detail;
      this.setData({
        location: {
          provinceName,
          cityName,
          districtName,
          townName,
          provinceCode,
          cityCode,
          districtCode,
          townCode,
          locationValue,
        },
      });
    },
    initLocation(e) {
      this.setLocation(e);
      this.init();
    },
    // 行政区划切换时,获取新的线上监管信息以及线下巡查监管信息
    onLocationChange(e) {
      this.setLocation(e);
      this._startLoad();
    },
 
    // 时间更改
    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();
    },
  },
});