Commit 70189ac8 by 李君

优化

1 parent 9cd88bda
...@@ -9,10 +9,10 @@ ...@@ -9,10 +9,10 @@
<el-checkbox v-model="addForm.queueLengthSwitch">{{$t('table.queueLengthAlert')}}</el-checkbox> <el-checkbox v-model="addForm.queueLengthSwitch">{{$t('table.queueLengthAlert')}}</el-checkbox>
<el-checkbox v-model="addForm.waitTimeSwitch">{{$t('table.waitTimeAlert')}}</el-checkbox> <el-checkbox v-model="addForm.waitTimeSwitch">{{$t('table.waitTimeAlert')}}</el-checkbox>
</el-form-item> --> </el-form-item> -->
<el-form-item :label="$t('table.alarmPensonNum')" prop="alarmPensonNum"> <el-form-item :label="$t('table.alarmPensonNum')" prop="queueLengthThreshold">
<el-input-number v-model="addForm.queueLengthThreshold" :min="0" :controls = 'false' :precision = '0'></el-input-number> {{$t('format.perNum')}} <el-input-number v-model="addForm.queueLengthThreshold" :min="0" :controls = 'false' :precision = '0'></el-input-number> {{$t('format.perNum')}}
</el-form-item> </el-form-item>
<el-form-item :label="$t('table.waitingTime')" prop="waitingTime"> <el-form-item :label="$t('table.waitingTime')" prop="waitTimeThreshold">
<el-input-number v-model="addForm.waitTimeThreshold" :min="0" :controls = 'false' :precision = '0'></el-input-number> {{$t('format.minute')}} <el-input-number v-model="addForm.waitTimeThreshold" :min="0" :controls = 'false' :precision = '0'></el-input-number> {{$t('format.minute')}}
</el-form-item> </el-form-item>
<el-form-item :label="$t('table.alarmCycle')" prop="alarmInterval"> <el-form-item :label="$t('table.alarmCycle')" prop="alarmInterval">
...@@ -48,12 +48,12 @@ export default { ...@@ -48,12 +48,12 @@ export default {
}], }],
isAdd:true, isAdd:true,
rules: { rules: {
alarmPensonNum: [{ queueLengthThreshold: [{
required: true, required: true,
message: this.$t('pholder.input'), message: this.$t('pholder.input'),
trigger: 'blur' trigger: 'blur'
}], }],
waitingTime:[{ waitTimeThreshold:[{
required: true, required: true,
message: this.$t('pholder.input'), message: this.$t('pholder.input'),
trigger: 'blur' trigger: 'blur'
...@@ -112,6 +112,7 @@ export default { ...@@ -112,6 +112,7 @@ export default {
} }
this.addForm.sendEmail = arr.join(';') this.addForm.sendEmail = arr.join(';')
this.$refs[formName].validate((valid) => { this.$refs[formName].validate((valid) => {
console.log(valid)
if (valid) { if (valid) {
this.addForm.queueLengthSwitch = 1 this.addForm.queueLengthSwitch = 1
this.addForm.waitTimeSwitch = 1 this.addForm.waitTimeSwitch = 1
......
...@@ -755,10 +755,12 @@ ...@@ -755,10 +755,12 @@
let red = data.red ? data.red : []; let red = data.red ? data.red : [];
let green = data.green ? data.green : []; let green = data.green ? data.green : [];
let blue = data.blue ? data.blue : []; let blue = data.blue ? data.blue : [];
let orange = data.orange ? data.orange : [];
this.dataList = [ this.dataList = [
...red.map((item) => ({ ...item, status: 1 })), ...red.map((item) => ({ ...item, status: 1 })),
...green.map((item) => ({ ...item, status: 0 })), ...green.map((item) => ({ ...item, status: 0 })),
...blue.map((item) => ({ ...item, status: 2 })), ...blue.map((item) => ({ ...item, status: 2 })),
...orange.map((item) => ({ ...item, status: 3 })),
]; ];
this.drawCirlce(); this.drawCirlce();
} }
...@@ -781,6 +783,8 @@ ...@@ -781,6 +783,8 @@
this.ctx.fillStyle = "red"; this.ctx.fillStyle = "red";
}else if(item.status == 2){ }else if(item.status == 2){
this.ctx.fillStyle = "blue"; this.ctx.fillStyle = "blue";
}else if(item.status == 3){
this.ctx.fillStyle = "orange";
} else { } else {
this.ctx.fillStyle = "green"; this.ctx.fillStyle = "green";
} }
......
...@@ -605,10 +605,12 @@ export default { ...@@ -605,10 +605,12 @@ export default {
let red = data.red ? data.red : []; let red = data.red ? data.red : [];
let green = data.green ? data.green : []; let green = data.green ? data.green : [];
let blue = data.blue ? data.blue : []; let blue = data.blue ? data.blue : [];
let orange = data.orange ? data.orange : [];
this.dataList = [ this.dataList = [
...red.map((item) => ({ ...item, status: 1 })), ...red.map((item) => ({ ...item, status: 1 })),
...green.map((item) => ({ ...item, status: 0 })), ...green.map((item) => ({ ...item, status: 0 })),
...blue.map((item) => ({ ...item, status: 2 })), ...blue.map((item) => ({ ...item, status: 2 })),
...orange.map((item) => ({ ...item, status: 3 })),
]; ];
this.drawCirlce(); this.drawCirlce();
...@@ -755,6 +757,8 @@ export default { ...@@ -755,6 +757,8 @@ export default {
this.ctx.fillStyle = "red"; this.ctx.fillStyle = "red";
}else if(item.status == 2){ }else if(item.status == 2){
this.ctx.fillStyle = "blue"; this.ctx.fillStyle = "blue";
}else if(item.status == 3){
this.ctx.fillStyle = "orange";
} else { } else {
this.ctx.fillStyle = "green"; this.ctx.fillStyle = "green";
} }
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!