index.vue 3.34 KB
Newer Older
1 2
<template>
  <div class="parameter">
3 4 5 6 7 8
    <div class="content">
      <div class="content-title">
        温馨提示:告警门限参数设置,数据如无异常,请勿修改告警门限参数!
      </div>
      <el-form
        ref="form"
yanzhongrong's avatar
yanzhongrong committed
9
        :model="form"
10 11 12 13
        :rules="rules"
        label-width="200px"
        class="content-form"
      >
yanzhongrong's avatar
yanzhongrong committed
14
        <el-form-item label="漏缆型号:" prop="equipType">
15
          <el-select
yanzhongrong's avatar
yanzhongrong committed
16
            v-model="form.equipType"
17 18 19
            style="width: 100%"
            filterable
            placeholder="请选择漏缆型号"
yanzhongrong's avatar
yanzhongrong committed
20
            @change="checkMode"
21 22
          >
            <el-option
yanzhongrong's avatar
yanzhongrong committed
23 24 25 26
              v-for="item in equipTypeList"
              :key="item.leakyCableMode"
              :label="item.leakyCableMode"
              :value="item.leakyCableMode"
27 28 29
            />
          </el-select>
        </el-form-item>
yanzhongrong's avatar
yanzhongrong committed
30 31
        <el-form-item label="一般告警门限:" prop="normalAlarmLimit">
          <el-input v-model="form.normalAlarmLimit" placeholder="请输入一般告警门限" />
32
        </el-form-item>
yanzhongrong's avatar
yanzhongrong committed
33 34
        <el-form-item label="重要告警门限:" prop="majorAlarmLimit">
          <el-input v-model="form.majorAlarmLimit" placeholder="请输入重要告警门限" />
35
        </el-form-item>
yanzhongrong's avatar
yanzhongrong committed
36 37
        <el-form-item label="紧急告警门限:" prop="emergAlarmLimit">
          <el-input v-model="form.emergAlarmLimit" placeholder="请输入紧急告警门限" />
38 39
        </el-form-item>
      </el-form>
40
    </div>
41 42 43 44 45 46 47 48 49
    <div class="footer">
      <div class="footer-btn">
        <el-button
          type="primary"
          :loading="loading"
          @click="submit"
        >确认修改</el-button>
      </div>
      <div class="footer-tips">当前未修改漏缆告警门限参数</div>
50 51 52 53 54
    </div>
  </div>
</template>

<script>
yanzhongrong's avatar
yanzhongrong committed
55
import { rules } from './const'
yanzhongrong's avatar
yanzhongrong committed
56
import { cableTypeEnum, saveParam, selectEquipByType } from '../api'
57 58 59 60
export default {
  data() {
    return {
      loading: false,
yanzhongrong's avatar
yanzhongrong committed
61 62 63 64 65
      form: {
        equipType: '',
        normalAlarmLimit: '',
        majorAlarmLimit: '',
        emergAlarmLimit: ''
66
      },
yanzhongrong's avatar
yanzhongrong committed
67 68
      rules,
      equipTypeList: []
69 70
    }
  },
yanzhongrong's avatar
yanzhongrong committed
71 72 73
  mounted() {
    this.getLeakyCablel()
  },
74 75 76 77
  methods: {
    submit() {
      this.$refs.form.validate((valid) => {
        if (valid) {
yanzhongrong's avatar
yanzhongrong committed
78 79 80
          saveParam(this.form).then(res => {
            this.$message.success('操作成功')
          })
81 82
        }
      })
yanzhongrong's avatar
yanzhongrong committed
83 84 85 86 87 88 89
    },
    getLeakyCablel() {
      cableTypeEnum().then(res => {
        let list = res || []
        this.equipTypeList = list
      })
    },
yanzhongrong's avatar
yanzhongrong committed
90 91 92 93 94
    checkMode(data) {
      selectEquipByType({equipType:data}).then(res => {
        this.form = res
      })
    },
95 96 97 98 99
  }
}
</script>

<style lang="scss" scoped>
100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133
.parameter {
  padding: 10px;
  .content {
    border: 1px solid #e3e3e3;
    border-radius: 10px;
    .content-title {
      width: 100%;
      height: 60px;
      background: rgba(226, 235, 255, 0.39);
      line-height: 60px;
      font-size: 18px;
      color: #333;
      font-weight: 500;
      text-align: center;
      border-bottom: 1px solid #e3e3e3;
    }
    .content-form {
      margin: 0 auto;
      padding: 20px 0;
      width: 600px;
    }
  }
  .footer {
    text-align: center;
    padding-top: 50px;
    .footer-btn {
      margin-bottom: 50px;
    }
    .footer-tips {
      color: #1E64F6;
      font-weight: 500;
      font-size: 18px;
    }
  }
134
}
135

136
</style>