| | |
| | | <equipment-layout :dataList="dataList" :equipmentId="selectEquementId" :node="selectEquement"></equipment-layout> |
| | | </a-tab-pane> |
| | | <a-tab-pane key="2" tab="列表" force-render> |
| | | <equipment-list :dataSource="dataList"></equipment-list> |
| | | <equipment-list :dataSource="dataList" @editEquipmentStatus="editEquipmentStatus"></equipment-list> |
| | | </a-tab-pane> |
| | | </a-tabs> |
| | | </div> |
| | |
| | | workNumber: 0, |
| | | allNumber: 0, |
| | | url: { |
| | | list: '/mdc/mdcEquipment/queryEquipmentMonitorList' |
| | | list: '/mdc/mdcEquipment/queryEquipmentMonitorList', |
| | | updateEquipmentStatus:'/mdc/mdcEquipment/updateEquipmentStatus' |
| | | }, |
| | | param:{}, |
| | | timer:null, |
| | | timerzhun:null |
| | | } |
| | |
| | | // setInterval(this.equipmentStatistics(), 5*1000); |
| | | }, |
| | | methods: { |
| | | equipmentStatistics(param) { |
| | | equipmentStatistics(param,resopnse={key:false}) { |
| | | getAction(this.url.list, param).then((res) => { |
| | | this.dataList = [] |
| | | if (res.success) { |
| | |
| | | this.dataList = res.result |
| | | // console.log(this.dataList) |
| | | this.allNumber = this.dataList.length |
| | | if(resopnse.key){ |
| | | this.$notification.success({ |
| | | key:'equipmentStatus', |
| | | message: '消息', |
| | | description: resopnse.message, |
| | | }); |
| | | } |
| | | for (let i = 0; i < this.dataList.length; i++) { |
| | | let item = this.dataList[i] |
| | | switch (item.oporationDict) { |
| | |
| | | this.selectEquement = val.equipmentId |
| | | clearInterval(this.timer); |
| | | this.timer = null |
| | | let param = {} |
| | | if (!val.equipmentId) { |
| | | param.key = val.key |
| | | this.param.key=val.key |
| | | clearInterval(this.timerzhun); |
| | | this.timerzhun = null |
| | | this.equipmentStatistics(param) |
| | | this.equipmentStatistics(this.param) |
| | | this.timer = setInterval(() => { |
| | | setTimeout( this.equipmentStatistics(param),0) |
| | | setTimeout( this.equipmentStatistics(this.param),0) |
| | | },1000*10) |
| | | }else{ |
| | | param.key = val.parentId |
| | | this.param.key=val.parentId |
| | | clearInterval(this.timerzhun); |
| | | this.timerzhun = null |
| | | this.equipmentStatistics(param) |
| | | this.equipmentStatistics(this.param) |
| | | this.timer = setInterval(() => { |
| | | setTimeout( this.equipmentStatistics(param),0) |
| | | setTimeout( this.equipmentStatistics(this.param),0) |
| | | },1000*10) |
| | | } |
| | | }, |
| | | |
| | | /** |
| | | * 单击状态反馈后触发 |
| | | * @param record |
| | | */ |
| | | editEquipmentStatus(record){ |
| | | console.log('子组件record',record.id) |
| | | const _this=this |
| | | this.$notification.info({ |
| | | key:'equipmentStatus', |
| | | message: '消息', |
| | | description: '反馈中...', |
| | | }); |
| | | getAction(this.url.updateEquipmentStatus,{id:record.id}) |
| | | .then(res=>{ |
| | | if(res.success) { |
| | | _this.equipmentStatistics(this.param,{key:true,message:res.message}) |
| | | }else{ |
| | | this.$notification.warning({ |
| | | message:'消息', |
| | | description:res.message |
| | | }); |
| | | } |
| | | }) |
| | | .catch(err=>{ |
| | | this.$notification.error({ |
| | | message:'消息', |
| | | description:err.message |
| | | }); |
| | | }) |
| | | } |
| | | }, |
| | | mounted(){ |