hejianhao
2025-04-16 dab2d210ca06c1faa514c6388fbd5de1ab355360
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
<template>
  <div class="early-warning-container">
    <span class="fc-999"
      >说明:异常预警配置,以检测到无人员活动小时数为标准,超过以下小时数无人员活动,自动通知社区工作人员。</span
    >
    <div class="mr-t-30">
      <span>白天:</span>
      <el-input-number
        v-model="trigger"
        class="iw-15"
        size="mini"
        :min="0"
        :max="9999"
        label=""
      ></el-input-number>
      <span class="fz-7">&nbsp;小时</span>
    </div>
    <el-button class="mr-t-30" type="primary" size="mini" @click="submitForm"
      >提 交</el-button>
    <el-button class="mr-t-30" type="primary" size="mini" @click="$router.go(-1)" 
      >返 回</el-button>
  </div>
</template>
 
<script>
export default {
  data() {
    return {
      trigger: 0,
      earlyData: {},
      info_id: null,
    };
  },
  mounted() {
    this.getEarlyData();
  },
  methods: {
    getEarlyData() {
      this.$api.get("comPropertyAlarmSetting", {}, (res) => {
        if (res) {
          this.trigger = res.triggerTime;
          this.info_id = res.id;
        } else {
          this.trigger = 0;
          this.info_id = null;
        }
      });
    },
    submitForm() {
      const data = {
        triggerTime: this.trigger,
      };
      if (this.info_id) {
        data.id = this.info_id;
      }
      this.$api.post("comPropertyAlarmSetting", data, (res) => {
          demo.toast("配置成功");
      });
    },
  },
};
</script>
 
<style scoped>
.early-warning-container {
  padding-top: 30px;
}
.iw-15 {
  width: 150px;
}
</style>