|  |  | @ -191,7 +191,7 @@ | 
			
		
	
		
			
				
					|  |  |  | <script> | 
			
		
	
		
			
				
					|  |  |  | import { parseTime } from '@/utils/index.js' | 
			
		
	
		
			
				
					|  |  |  | import { ReqDeviceList} from '@/api/device/deviceList.js' | 
			
		
	
		
			
				
					|  |  |  | import { reqUrgentMessage, reqQueryMessage } from '@/api/publish/urgentMessage' | 
			
		
	
		
			
				
					|  |  |  | import {reqUrgentMessage,reqQueryMessage,reqEditMessage} from '@/api/publish/urgentMessage' | 
			
		
	
		
			
				
					|  |  |  | export default { | 
			
		
	
		
			
				
					|  |  |  |   name: 'UrgentMessage', | 
			
		
	
		
			
				
					|  |  |  |   filters: { | 
			
		
	
	
		
			
				
					|  |  | @ -213,7 +213,7 @@ export default { | 
			
		
	
		
			
				
					|  |  |  |         notice_device:null, | 
			
		
	
		
			
				
					|  |  |  |         notice_devices:[], | 
			
		
	
		
			
				
					|  |  |  |         notice_id:'' ,//紧急通知的id | 
			
		
	
		
			
				
					|  |  |  |         orga_id: '133221333123111' | 
			
		
	
		
			
				
					|  |  |  |         orga_id:'133221333123111', | 
			
		
	
		
			
				
					|  |  |  |       }, | 
			
		
	
		
			
				
					|  |  |  |       queryInfo:{ | 
			
		
	
		
			
				
					|  |  |  |          notice_name:'', | 
			
		
	
	
		
			
				
					|  |  | @ -244,11 +244,13 @@ export default { | 
			
		
	
		
			
				
					|  |  |  |     getUrgentMessage(){ | 
			
		
	
		
			
				
					|  |  |  |        const params=this.queryInfo | 
			
		
	
		
			
				
					|  |  |  |        reqUrgentMessage(params).then(res=>{ | 
			
		
	
		
			
				
					|  |  |  |          | 
			
		
	
		
			
				
					|  |  |  |          if(res.code==200){ | 
			
		
	
		
			
				
					|  |  |  |            this.urgentMessage=res.data.content | 
			
		
	
		
			
				
					|  |  |  |             // console.log( this.urgentMessage) | 
			
		
	
		
			
				
					|  |  |  |          } | 
			
		
	
		
			
				
					|  |  |  |        }) | 
			
		
	
		
			
				
					|  |  |  | 
 | 
			
		
	
		
			
				
					|  |  |  |     }, | 
			
		
	
		
			
				
					|  |  |  |     // 获取设备列表的信息 | 
			
		
	
		
			
				
					|  |  |  |     getDevice(){ | 
			
		
	
	
		
			
				
					|  |  | @ -260,6 +262,7 @@ export default { | 
			
		
	
		
			
				
					|  |  |  |             return this.$message.error('获取设备列表失败!') | 
			
		
	
		
			
				
					|  |  |  |          } | 
			
		
	
		
			
				
					|  |  |  |       }) | 
			
		
	
		
			
				
					|  |  |  | 
 | 
			
		
	
		
			
				
					|  |  |  |     }, | 
			
		
	
		
			
				
					|  |  |  |     isStopHandle(index, row) { | 
			
		
	
		
			
				
					|  |  |  |       if(row.is_state ==1){ | 
			
		
	
	
		
			
				
					|  |  | @ -300,14 +303,26 @@ export default { | 
			
		
	
		
			
				
					|  |  |  |             }else{ | 
			
		
	
		
			
				
					|  |  |  |                 this.form.context_speed_name='3s' | 
			
		
	
		
			
				
					|  |  |  |             } | 
			
		
	
		
			
				
					|  |  |  |              | 
			
		
	
		
			
				
					|  |  |  |         } | 
			
		
	
		
			
				
					|  |  |  |       }) | 
			
		
	
		
			
				
					|  |  |  |     }, | 
			
		
	
		
			
				
					|  |  |  |     submit(){ | 
			
		
	
		
			
				
					|  |  |  |       console.log('submit--') | 
			
		
	
		
			
				
					|  |  |  |       console.log(this.form.notice_device) | 
			
		
	
		
			
				
					|  |  |  |       console.log(this.form.notice_devices) | 
			
		
	
		
			
				
					|  |  |  |       console.log('----submit') | 
			
		
	
		
			
				
					|  |  |  |        const params={ | 
			
		
	
		
			
				
					|  |  |  |          context:this.form.context, | 
			
		
	
		
			
				
					|  |  |  |          context_color:this.form.context_color, | 
			
		
	
		
			
				
					|  |  |  |         context_position: this.form.context_position, | 
			
		
	
		
			
				
					|  |  |  |         context_size:this.form.context_size, | 
			
		
	
		
			
				
					|  |  |  |         context_speed:this.form.context_speed, | 
			
		
	
		
			
				
					|  |  |  |         notice_device:this.form.notice_device, | 
			
		
	
		
			
				
					|  |  |  |         notice_devices:this.form.notice_devices, | 
			
		
	
		
			
				
					|  |  |  |          notice_id:this.form.notice_id, | 
			
		
	
		
			
				
					|  |  |  |          orga_id:'133221333123111' | 
			
		
	
		
			
				
					|  |  |  |        } | 
			
		
	
		
			
				
					|  |  |  |        reqEditMessage(params).then(res=>{ | 
			
		
	
		
			
				
					|  |  |  |          console.log(params) | 
			
		
	
		
			
				
					|  |  |  |          console.log(res) | 
			
		
	
		
			
				
					|  |  |  |        }) | 
			
		
	
		
			
				
					|  |  |  |     }, | 
			
		
	
		
			
				
					|  |  |  |     // 所有设备和部分设备的切换数据处理 | 
			
		
	
		
			
				
					|  |  |  |     clearCheckbox(){ | 
			
		
	
	
		
			
				
					|  |  | @ -348,28 +363,16 @@ export default { | 
			
		
	
		
			
				
					|  |  |  |     // 添加设备 | 
			
		
	
		
			
				
					|  |  |  |     tagHandle(tag) {     | 
			
		
	
		
			
				
					|  |  |  |       this.form.notice_devices.push({deviceId:tag.device_id}) | 
			
		
	
		
			
				
					|  |  |  |       console.log('添加选中前----') | 
			
		
	
		
			
				
					|  |  |  |       console.log(this.deviceTags) | 
			
		
	
		
			
				
					|  |  |  |       if(this.deviceTags.length==0){ | 
			
		
	
		
			
				
					|  |  |  |         this.deviceTags.push(tag) | 
			
		
	
		
			
				
					|  |  |  |       }else{ | 
			
		
	
		
			
				
					|  |  |  |         const current = this.deviceTags.find((item) => { | 
			
		
	
		
			
				
					|  |  |  |           return item.device_id == tag.device_id | 
			
		
	
		
			
				
					|  |  |  |         }) | 
			
		
	
		
			
				
					|  |  |  |         const current = this.deviceTags &&this.deviceTags.some((item) => item.device_name == tag.device_name ) | 
			
		
	
		
			
				
					|  |  |  |        // 查找是否存在相同的 | 
			
		
	
		
			
				
					|  |  |  |       console.log('current', current) | 
			
		
	
		
			
				
					|  |  |  |       if (!current) { | 
			
		
	
		
			
				
					|  |  |  |         // console.log('没有相同的') | 
			
		
	
		
			
				
					|  |  |  |         this.deviceTags.push(tag)   | 
			
		
	
		
			
				
					|  |  |  |         } else { | 
			
		
	
		
			
				
					|  |  |  |           console.log('有相同的') | 
			
		
	
		
			
				
					|  |  |  |       }    | 
			
		
	
		
			
				
					|  |  |  |     }       | 
			
		
	
		
			
				
					|  |  |  |       // } else { | 
			
		
	
		
			
				
					|  |  |  |       //   console.log('有相同的') | 
			
		
	
		
			
				
					|  |  |  |       // } | 
			
		
	
		
			
				
					|  |  |  |       console.log('添加选中后----') | 
			
		
	
		
			
				
					|  |  |  |       console.log(this.deviceTags) | 
			
		
	
		
			
				
					|  |  |  |   }, | 
			
		
	
		
			
				
					|  |  |  |     // 单独删除某一个设备 | 
			
		
	
		
			
				
					|  |  |  |     handleClose(tag) { | 
			
		
	
	
		
			
				
					|  |  | @ -379,7 +382,7 @@ export default { | 
			
		
	
		
			
				
					|  |  |  |     // 清空设备 | 
			
		
	
		
			
				
					|  |  |  |     clearDevice() { | 
			
		
	
		
			
				
					|  |  |  |       this.deviceTags = [] | 
			
		
	
		
			
				
					|  |  |  |     } | 
			
		
	
		
			
				
					|  |  |  |     }, | 
			
		
	
		
			
				
					|  |  |  |   } | 
			
		
	
		
			
				
					|  |  |  | } | 
			
		
	
		
			
				
					|  |  |  | </script> | 
			
		
	
	
		
			
				
					|  |  | 
 |