Commit eaf7f71e by 李君

优化

1 parent e0213921
...@@ -4,7 +4,7 @@ ...@@ -4,7 +4,7 @@
:close-on-click-modal="false" v-if="addDialogVisible" @close="addDialogClose()"> :close-on-click-modal="false" v-if="addDialogVisible" @close="addDialogClose()">
<el-form :model="addForm" label-width="100px" status-icon :rules="rules" ref="addForm"> <el-form :model="addForm" label-width="100px" status-icon :rules="rules" ref="addForm">
<div class="inlineBlock" v-for="item in counterTypeData" :key="item.id"> <div class="inlineBlock" v-for="item in counterTypeData" :key="item.id">
<template v-if="item.key != '2'"> <template v-if="channelConfig.includes(item.key)">
<p class="itemTitle" style="font-weight: 900">{{item.text}}</p> <p class="itemTitle" style="font-weight: 900">{{item.text}}</p>
{{$t('message.queuelengthmorethan')}} {{$t('message.queuelengthmorethan')}}
<el-input-number v-model="item.queueLengthThreshold" :min="0" :controls = 'false' :precision = '0'></el-input-number> {{$t('format.perNum')}}, <el-input-number v-model="item.queueLengthThreshold" :min="0" :controls = 'false' :precision = '0'></el-input-number> {{$t('format.perNum')}},
...@@ -70,10 +70,12 @@ export default { ...@@ -70,10 +70,12 @@ export default {
message: this.$t('pholder.input'), message: this.$t('pholder.input'),
trigger: 'blur' trigger: 'blur'
}], }],
} },
channelConfig:[]
} }
}, },
mounted() { mounted() {
this.channelConfig = window._vionConfig.channelConfig
this.getCounterType() this.getCounterType()
}, },
methods: { methods: {
...@@ -94,6 +96,7 @@ export default { ...@@ -94,6 +96,7 @@ export default {
email:arr[i] email:arr[i]
}) })
} }
console.log(this.counterTypeData)
this.addForm.alarmInterval = data[0].channelRules[0].alarmInterval this.addForm.alarmInterval = data[0].channelRules[0].alarmInterval
data[0].channelRules.forEach(itemR=>{ data[0].channelRules.forEach(itemR=>{
this.counterTypeData.forEach(item=>{ this.counterTypeData.forEach(item=>{
...@@ -145,7 +148,7 @@ export default { ...@@ -145,7 +148,7 @@ export default {
if (valid) { if (valid) {
let channelRules = [] let channelRules = []
for (let item of this.counterTypeData) { for (let item of this.counterTypeData) {
if(item.key != 4){ if( this.channelConfig.includes(item.key)){
if(item.queueLengthThreshold !== ''&&item.queueLengthThreshold !== ''&&item.queueLengthThreshold !== ''&&item.trolleyThreshold !== ''){ if(item.queueLengthThreshold !== ''&&item.queueLengthThreshold !== ''&&item.queueLengthThreshold !== ''&&item.trolleyThreshold !== ''){
channelRules.push({ channelRules.push({
queueLengthThreshold:item.queueLengthThreshold, queueLengthThreshold:item.queueLengthThreshold,
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!