Commit 7ee72fa2 by 李君

优化

1 parent 901a1b10
......@@ -5,17 +5,17 @@
<el-form :model="addForm" label-width="100px" status-icon :rules="rules" ref="addForm">
<!-- 区域名称 -->
<p class="itemTitle">{{$t('button.alarmRules')}}</p>
<el-form-item >
<!-- <el-form-item >
<el-checkbox v-model="addForm.queueLengthSwitch">{{$t('table.queueLengthAlert')}}</el-checkbox>
<el-checkbox v-model="addForm.waitTimeSwitch">{{$t('table.waitTimeAlert')}}</el-checkbox>
</el-form-item>
<el-form-item :label="$t('table.alarmPensonNum')" prop="name" v-if="addForm.queueLengthSwitch">
</el-form-item> -->
<el-form-item :label="$t('table.alarmPensonNum')" prop="alarmPensonNum">
<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 :label="$t('table.waitingTime')" prop="code" v-if="addForm.waitTimeSwitch">
<el-form-item :label="$t('table.waitingTime')" prop="waitingTime">
<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 :label="$t('table.alarmCycle')" prop="counterType">
<el-form-item :label="$t('table.alarmCycle')" prop="alarmInterval">
<el-input-number v-model="addForm.alarmInterval" :min="0" :controls = 'false' :precision = '0'></el-input-number> {{$t('format.minute')}}
</el-form-item>
<p class="info">{{$t('message.alarmInfo')}}</p>
......@@ -48,16 +48,21 @@ export default {
}],
isAdd:true,
rules: {
// name: [{
// required: true,
// message: this.$t('pholder.input'),
// trigger: 'blur'
// }],
// code:[{
// required: true,
// message: this.$t('pholder.input'),
// trigger: 'blur'
// }],
alarmPensonNum: [{
required: true,
message: this.$t('pholder.input'),
trigger: 'blur'
}],
waitingTime:[{
required: true,
message: this.$t('pholder.input'),
trigger: 'blur'
}],
alarmInterval:[{
required: true,
message: this.$t('pholder.input'),
trigger: 'blur'
}],
}
}
},
......@@ -66,9 +71,9 @@ export default {
this.addForm = {
mallId: '',
areaId:"",
queueLengthSwitch:false,
// queueLengthSwitch:false,
queueLengthThreshold:'',
waitTimeSwitch:false,
// waitTimeSwitch:false,
waitTimeThreshold:'',
alarmInterval:'',
sendEmail:'',
......@@ -76,8 +81,8 @@ export default {
if(data && data.length>0){
this.isAdd = false;
this.addForm = Object.assign({},data[0]);
this.addForm.queueLengthSwitch = data[0].queueLengthSwitch==1?true:false;
this.addForm.waitTimeSwitch = data[0].waitTimeSwitch==1?true:false;
// this.addForm.queueLengthSwitch = data[0].queueLengthSwitch==1?true:false;
// this.addForm.waitTimeSwitch = data[0].waitTimeSwitch==1?true:false;
let arr = data[0].sendEmail.split(";")
this.alarmReceiverList = []
for (var i = 0; i < arr.length; i++) {
......@@ -108,8 +113,8 @@ export default {
this.addForm.sendEmail = arr.join(';')
this.$refs[formName].validate((valid) => {
if (valid) {
this.addForm.queueLengthSwitch = this.addForm.queueLengthSwitch?'1':'0'
this.addForm.waitTimeSwitch = this.addForm.waitTimeSwitch?'1':'0'
this.addForm.queueLengthSwitch = 1
this.addForm.waitTimeSwitch = 1
if(this.isAdd){
this.$api.queueManagementApi.addAlarmRules(this.addForm)
.then((res) => {
......
......@@ -18,12 +18,12 @@
<el-option v-for="item in channelListData" :key="item.id" :label="item.name" :value="item.id" />
</el-select>
</el-form-item>
<el-form-item :label="$t('table.alarmType')">
<<!-- el-form-item :label="$t('table.alarmType')">
<el-select v-model="searchForm.messageType" clearable :placeholder="$t('pholder.selectLane')">
<el-option :label="$t('pholder.all')" value="" />
<el-option v-for="item in messageTypetData" :key="item.id" :label="item.name" :value="item.id" />
</el-select>
</el-form-item>
</el-form-item> -->
<el-form-item :label="$t('table.date')">
<el-date-picker
v-model="searchForm.countDate"
......@@ -52,11 +52,11 @@
header-row-class-name="manage-tab-head"
>
<el-table-column :label="$t('table.order')" align="center" type="index" width="100"></el-table-column>
<el-table-column :label="$t('table.alarmType')" align="center" prop="messageType" width="160">
<!-- <el-table-column :label="$t('table.alarmType')" align="center" prop="messageType" width="160">
<template slot-scope="scope">
<span>{{scope.row.messageType==0?$t('table.queueLengthAlert'):$t('table.waitTimeAlert')}}</span>
</template>
</el-table-column>
</el-table-column> -->
<el-table-column :label="$t('table.laneName')" width="160" align="center" prop="cashierChannelId" :formatter="landFormat"></el-table-column>
<el-table-column :label="$t('table.messageContent')" align="center" prop="messageContent" show-overflow-tooltip></el-table-column>
<el-table-column :label="$t('table.sentDate')" align="center" prop="createTime" width="160"></el-table-column>
......@@ -108,7 +108,7 @@
mallId: '',
cashierAreaId: '',
cashierChannelId: '',
messageType:'',
// messageType:'',
countDate: [new Date(),new Date()],
},
messageTypetData:[{
......@@ -234,7 +234,7 @@
mallId: this.searchForm.mallId,
cashierAreaId: this.searchForm.cashierAreaId,
cashierChannelId: this.searchForm.cashierChannelId,
messageType: this.searchForm.messageType,
// messageType: this.searchForm.messageType,
startDate: moment(this.searchForm.countDate[0]).format('YYYY-MM-DD'),
endDate:moment(this.searchForm.countDate[1]).format('YYYY-MM-DD'),
pageNum: this.currentPage,
......
......@@ -116,12 +116,9 @@
<div class="tabel_title">
<!-- <span>{{$t('home.queuingmonitoring')}}</span> -->
<span>Queue Monitoring</span>
<div class="lenged">
<div class="lenged" v-if="!(JSON.stringify(ruleObj) =='{}')">
<p>
<small>{{safeingNum}}~{{warningNum}}</small><small class="colorBox colorBox_yellow"></small>
</p>
<p>
<small>>{{warningNum}}</small><small class="colorBox colorBox_red"></small>
<small>Customers in Queue >{{ruleObj.queueLengthThreshold}} & AVG.Waiting > {{ruleObj.waitTimeThreshold}}min</small><small class="colorBox colorBox_red"></small>
</p>
</div>
<div class="openBtn" @click="openDialog('table')">
......@@ -271,6 +268,7 @@
export default {
data() {
return {
ruleObj:{},
dialogShow:false,
openDialogType:'',
laneName:'',
......@@ -462,6 +460,22 @@
}
},
methods: {
// 报警规则
getRules(){
this.$api.queueManagementApi.getAlarmRulesList({
mallId: this.searchForm.mallId,
areaId: this.searchForm.cashierAreaId,
pageNum: 1,
pageSize: 999999
}).then(res => {
let result = res.data;
if (result.code == 200) {
if(result.data.list && result.data.list.length>0){
this.ruleObj = result.data.list[0]
}
}
})
},
openDialog(type){
this.dialogShow = true;
this.openDialogType = type;
......@@ -638,9 +652,10 @@
this.searchForm.cashierAreaId = result.data.list[0].id
this.areaListData = result.data.list;
this.areaOneObj = result.data.list[0]
this.warningNum = result.data.list[0].warnNum
this.safeingNum = result.data.list[0].safeNum
// this.warningNum = result.data.list[0].warnNum
// this.safeingNum = result.data.list[0].safeNum
// this.getChannelList()
this.getRules();
this.pic = new Image();
this.pic.src =this.areaListData[0] && window._vionConfig.picUrl + this.areaListData[0].pic;
this.pic.onload = () => {
......@@ -654,6 +669,7 @@
})
},
areaChange(val){
this.getRules();
this.areaOneObj = this.areaListData.find(item=> item.id==val);
this.pic = new Image();
this.pic.src =this.areaOneObj && window._vionConfig.picUrl + this.areaOneObj.pic;
......@@ -661,7 +677,9 @@
this.drawCirlce();
};
// this.getChannelList()
setTimeout(()=>{
this.searchFun()
},500)
},
// 通道
// getChannelList() {
......@@ -778,12 +796,8 @@
});
},
tableRowClassName: function({ row, rowIndex }) {
if (row.customersInQueue > this.warningNum) {
if ((row.customersInQueue > this.ruleObj.queueLengthThreshold)&&(row.averageWaitingTime > (this.ruleObj.waitTimeThreshold * 60))) {
return 'danger-row';
}else if(row.customersInQueue >this.safeingNum && row.customersInQueue <= this.warningNum){
return 'warn-row';
}else{
return 'safe-row';
}
},
// 表格点击触发
......
......@@ -75,12 +75,12 @@
<!-- <span>{{$t('home.queuingmonitoring')}}</span> -->
<span>Queue Monitoring</span>
<div class="lenged" v-if="!(JSON.stringify(ruleObj) =='{}')">
<p v-if="ruleObj.queueLengthSwitch==1">
<small>>{{ruleObj.queueLengthThreshold}}</small><small class="colorBox colorBox_red"></small>
<p>
<small>Customers in Queue >{{ruleObj.queueLengthThreshold}} & AVG.Waiting > {{ruleObj.waitTimeThreshold}}min</small><small class="colorBox colorBox_red"></small>
</p>
<p v-if="ruleObj.waitTimeSwitch==1">
<!-- <p>
<small>>{{ruleObj.waitTimeThreshold}}min</small><small class="colorBox colorBox_red"></small>
</p>
</p> -->
</div>
<div class="openBtn" @click="openDialog('table')">
<img src="../../../assets/sacle.png" >
......@@ -714,14 +714,9 @@ export default {
this.getCustomersOverview()
},
tableRowClassName: function({ row, rowIndex }) {
if(this.ruleObj.queueLengthSwitch ==1 || this.ruleObj.waitTimeSwitch ==1){
if (row.customersInQueue > this.ruleObj.queueLengthThreshold) {
return 'danger-row';
}
if (row.averageWaitingTime > (this.ruleObj.waitTimeThreshold * 60)) {
if ((row.customersInQueue > this.ruleObj.queueLengthThreshold)&&(row.averageWaitingTime > (this.ruleObj.waitTimeThreshold * 60))) {
return 'danger-row';
}
}
},
// 表格点击触发
handleCurrentChange(row) {
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!