index.vue 3.35 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 56 57
import { rules } from './const';
import { cableTypeEnum, saveParam, selectEquipByType } from '../api';

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

<style lang="scss" scoped>
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 134
.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;
    }
  }
135 136
}
</style>