|  | @ -12,12 +12,12 @@ | 
		
	
		
			
				|  |  |           <el-table-column type="selection" width="55" /> |  |  |           <el-table-column type="selection" width="55" /> | 
		
	
		
			
				|  |  |           <!-- prop="name"  --> |  |  |           <!-- prop="name"  --> | 
		
	
		
			
				|  |  |           <el-table-column label="序号" type="index" align="center" width="50" /> |  |  |           <el-table-column label="序号" type="index" align="center" width="50" /> | 
		
	
		
			
				|  |  |           <el-table-column label="发布内容" align="center" prop="context" width="400"> |  |  |  | 
		
	
		
			
				|  |  |  |  |  |           <el-table-column label="发布内容" align="center" prop="context" width="400" > | 
		
	
		
			
				|  |  |             <template slot-scope="{row}"> |  |  |             <template slot-scope="{row}"> | 
		
	
		
			
				|  |  |               <div>{{ row.context }}</div> |  |  |  | 
		
	
		
			
				|  |  |  |  |  |               <div>{{row.context}}</div> | 
		
	
		
			
				|  |  |             </template> |  |  |             </template> | 
		
	
		
			
				|  |  |           </el-table-column> |  |  |           </el-table-column> | 
		
	
		
			
				|  |  |           <el-table-column label="通知时间" align="center" prop="create_time"> |  |  |  | 
		
	
		
			
				|  |  |  |  |  |           <el-table-column label="通知时间" align="center" prop="create_time" > | 
		
	
		
			
				|  |  |              <template slot-scope="{row}">           |  |  |              <template slot-scope="{row}">           | 
		
	
		
			
				|  |  |             <div>{{ row.create_time | parseTime }}</div> |  |  |             <div>{{ row.create_time | parseTime }}</div> | 
		
	
		
			
				|  |  |           </template> |  |  |           </template> | 
		
	
	
		
			
				|  | @ -131,8 +131,8 @@ | 
		
	
		
			
				|  |  |             ]" |  |  |             ]" | 
		
	
		
			
				|  |  |           > |  |  |           > | 
		
	
		
			
				|  |  |             <el-radio-group v-model="form.notice_device" @change="clearCheckbox()"> |  |  |             <el-radio-group v-model="form.notice_device" @change="clearCheckbox()"> | 
		
	
		
			
				|  |  |               <el-radio :label="1" value="all">所有设备</el-radio> |  |  |  | 
		
	
		
			
				|  |  |               <el-radio :label="2" value="other">部分设备<i v-if="form.notice_device === 2" class="radio_tip" @click="addDeviceTag()">添加</i></el-radio> |  |  |  | 
		
	
		
			
				|  |  |  |  |  |               <el-radio :label="1" value="all" >所有设备</el-radio> | 
		
	
		
			
				|  |  |  |  |  |               <el-radio :label="2"  value= "other" >部分设备<i v-if="form.notice_device === 2" class="radio_tip" @click="addDeviceTag()">添加</i></el-radio> | 
		
	
		
			
				|  |  |             </el-radio-group> |  |  |             </el-radio-group> | 
		
	
		
			
				|  |  |           </el-form-item> |  |  |           </el-form-item> | 
		
	
		
			
				|  |  |           <div v-if="form.notice_device === 1" class="select_all_tip">所有设备都将被发送</div> |  |  |           <div v-if="form.notice_device === 1" class="select_all_tip">所有设备都将被发送</div> | 
		
	
	
		
			
				|  | @ -152,7 +152,7 @@ | 
		
	
		
			
				|  |  |               context_color="#cbe3ff" |  |  |               context_color="#cbe3ff" | 
		
	
		
			
				|  |  |               @close="handleClose(tag)" |  |  |               @close="handleClose(tag)" | 
		
	
		
			
				|  |  |             > |  |  |             > | 
		
	
		
			
				|  |  |               {{ tag.device_name }} |  |  |  | 
		
	
		
			
				|  |  |  |  |  |               {{ tag.device_name}} | 
		
	
		
			
				|  |  |             </el-tag> |  |  |             </el-tag> | 
		
	
		
			
				|  |  |           </div> |  |  |           </div> | 
		
	
		
			
				|  |  |         </el-form> |  |  |         </el-form> | 
		
	
	
		
			
				|  | @ -190,8 +190,8 @@ | 
		
	
		
			
				|  |  | 
 |  |  | 
 | 
		
	
		
			
				|  |  | <script> |  |  | <script> | 
		
	
		
			
				|  |  | import { parseTime } from '@/utils/index.js' |  |  | import { parseTime } from '@/utils/index.js' | 
		
	
		
			
				|  |  | import { ReqDeviceList } from '@/api/device/deviceList.js' |  |  |  | 
		
	
		
			
				|  |  | import { reqUrgentMessage, reqQueryMessage } from '@/api/publish/urgentMessage' |  |  |  | 
		
	
		
			
				|  |  |  |  |  | import { ReqDeviceList} from '@/api/device/deviceList.js' | 
		
	
		
			
				|  |  |  |  |  | import {reqUrgentMessage,reqQueryMessage,reqEditMessage} from '@/api/publish/urgentMessage' | 
		
	
		
			
				|  |  | export default { |  |  | export default { | 
		
	
		
			
				|  |  |   name: 'UrgentMessage', |  |  |   name: 'UrgentMessage', | 
		
	
		
			
				|  |  |   filters: { |  |  |   filters: { | 
		
	
	
		
			
				|  | @ -201,25 +201,25 @@ export default { | 
		
	
		
			
				|  |  |   }, |  |  |   }, | 
		
	
		
			
				|  |  |   data() { |  |  |   data() { | 
		
	
		
			
				|  |  |     return { |  |  |     return { | 
		
	
		
			
				|  |  |       form: { |  |  |  | 
		
	
		
			
				|  |  |         context_color: '#ff0000', // 文本的颜色 |  |  |  | 
		
	
		
			
				|  |  |         context: '', // 文本的内容 |  |  |  | 
		
	
		
			
				|  |  |         context_position: null, // 文本的位置 |  |  |  | 
		
	
		
			
				|  |  |         context_position_name: null, |  |  |  | 
		
	
		
			
				|  |  |         context_speed_name: null, |  |  |  | 
		
	
		
			
				|  |  |         context_speed: null, // 文本的速度 |  |  |  | 
		
	
		
			
				|  |  |         context_size: null, // 文字的大小 |  |  |  | 
		
	
		
			
				|  |  |  |  |  |        form :{ | 
		
	
		
			
				|  |  |  |  |  |         context_color: '#ff0000',//文本的颜色 | 
		
	
		
			
				|  |  |  |  |  |         context: '', //文本的内容 | 
		
	
		
			
				|  |  |  |  |  |         context_position: null, //文本的位置 | 
		
	
		
			
				|  |  |  |  |  |         context_position_name:null, | 
		
	
		
			
				|  |  |  |  |  |         context_speed_name:null, | 
		
	
		
			
				|  |  |  |  |  |         context_speed: null,  //文本的速度 | 
		
	
		
			
				|  |  |  |  |  |         context_size:null,//文字的大小 | 
		
	
		
			
				|  |  |         // create_by:'', //发布人 |  |  |         // create_by:'', //发布人 | 
		
	
		
			
				|  |  |         notice_device: null, |  |  |  | 
		
	
		
			
				|  |  |         notice_devices: [], |  |  |  | 
		
	
		
			
				|  |  |         notice_id: '', // 紧急通知的id |  |  |  | 
		
	
		
			
				|  |  |         orga_id: '133221333123111' |  |  |  | 
		
	
		
			
				|  |  |  |  |  |         notice_device:null, | 
		
	
		
			
				|  |  |  |  |  |         notice_devices:[], | 
		
	
		
			
				|  |  |  |  |  |         notice_id:'' ,//紧急通知的id | 
		
	
		
			
				|  |  |  |  |  |         orga_id:'133221333123111', | 
		
	
		
			
				|  |  |       }, |  |  |       }, | 
		
	
		
			
				|  |  |       queryInfo: { |  |  |  | 
		
	
		
			
				|  |  |         notice_name: '', |  |  |  | 
		
	
		
			
				|  |  |         orga_id: '133221333123111', |  |  |  | 
		
	
		
			
				|  |  |         page: 1, |  |  |  | 
		
	
		
			
				|  |  |         size: 3 |  |  |  | 
		
	
		
			
				|  |  |  |  |  |       queryInfo:{ | 
		
	
		
			
				|  |  |  |  |  |          notice_name:'', | 
		
	
		
			
				|  |  |  |  |  |          orga_id:'133221333123111', | 
		
	
		
			
				|  |  |  |  |  |          page:1, | 
		
	
		
			
				|  |  |  |  |  |          size:3 | 
		
	
		
			
				|  |  |       }, |  |  |       }, | 
		
	
		
			
				|  |  |       messageVisible: false, |  |  |       messageVisible: false, | 
		
	
		
			
				|  |  |       selectDeviceVisible: false, |  |  |       selectDeviceVisible: false, | 
		
	
	
		
			
				|  | @ -232,40 +232,43 @@ export default { | 
		
	
		
			
				|  |  |       // newArr:[], |  |  |       // newArr:[], | 
		
	
		
			
				|  |  |       deviceTags: [], |  |  |       deviceTags: [], | 
		
	
		
			
				|  |  |       // 紧急通知列表 |  |  |       // 紧急通知列表 | 
		
	
		
			
				|  |  |       urgentMessage: [] |  |  |  | 
		
	
		
			
				|  |  |  |  |  |       urgentMessage:[] | 
		
	
		
			
				|  |  |     } |  |  |     } | 
		
	
		
			
				|  |  |   }, |  |  |   }, | 
		
	
		
			
				|  |  |   mounted() { |  |  |  | 
		
	
		
			
				|  |  |  |  |  |   mounted(){ | 
		
	
		
			
				|  |  |     this.getUrgentMessage() |  |  |     this.getUrgentMessage() | 
		
	
		
			
				|  |  |     this.getDevice() |  |  |     this.getDevice() | 
		
	
		
			
				|  |  |   }, |  |  |   }, | 
		
	
		
			
				|  |  |   methods: { |  |  |   methods: { | 
		
	
		
			
				|  |  |     // 获取紧急通知的列表 |  |  |     // 获取紧急通知的列表 | 
		
	
		
			
				|  |  |     getUrgentMessage() { |  |  |  | 
		
	
		
			
				|  |  |       const params = this.queryInfo |  |  |  | 
		
	
		
			
				|  |  |       reqUrgentMessage(params).then(res => { |  |  |  | 
		
	
		
			
				|  |  |         if (res.code == 200) { |  |  |  | 
		
	
		
			
				|  |  |           this.urgentMessage = res.data.content |  |  |  | 
		
	
		
			
				|  |  |  |  |  |     getUrgentMessage(){ | 
		
	
		
			
				|  |  |  |  |  |        const params=this.queryInfo | 
		
	
		
			
				|  |  |  |  |  |        reqUrgentMessage(params).then(res=>{ | 
		
	
		
			
				|  |  |  |  |  |          | 
		
	
		
			
				|  |  |  |  |  |          if(res.code==200){ | 
		
	
		
			
				|  |  |  |  |  |            this.urgentMessage=res.data.content | 
		
	
		
			
				|  |  |             // console.log( this.urgentMessage) |  |  |             // console.log( this.urgentMessage) | 
		
	
		
			
				|  |  |          } |  |  |          } | 
		
	
		
			
				|  |  |        }) |  |  |        }) | 
		
	
		
			
				|  |  |  |  |  | 
 | 
		
	
		
			
				|  |  |     }, |  |  |     }, | 
		
	
		
			
				|  |  |     // 获取设备列表的信息 |  |  |     // 获取设备列表的信息 | 
		
	
		
			
				|  |  |     getDevice() { |  |  |  | 
		
	
		
			
				|  |  |  |  |  |     getDevice(){ | 
		
	
		
			
				|  |  |       const params = this.queryInfo |  |  |       const params = this.queryInfo | 
		
	
		
			
				|  |  |       ReqDeviceList(params).then(res => { |  |  |       ReqDeviceList(params).then(res => { | 
		
	
		
			
				|  |  |         if (res.code == 200) { |  |  |  | 
		
	
		
			
				|  |  |           this.deviceList = res.data.content |  |  |  | 
		
	
		
			
				|  |  |         } else { |  |  |  | 
		
	
		
			
				|  |  |  |  |  |          if(res.code==200) { | 
		
	
		
			
				|  |  |  |  |  |             this.deviceList=res.data.content       | 
		
	
		
			
				|  |  |  |  |  |          }else{ | 
		
	
		
			
				|  |  |             return this.$message.error('获取设备列表失败!') |  |  |             return this.$message.error('获取设备列表失败!') | 
		
	
		
			
				|  |  |          } |  |  |          } | 
		
	
		
			
				|  |  |       }) |  |  |       }) | 
		
	
		
			
				|  |  |  |  |  | 
 | 
		
	
		
			
				|  |  |     }, |  |  |     }, | 
		
	
		
			
				|  |  |     isStopHandle(index, row) { |  |  |     isStopHandle(index, row) { | 
		
	
		
			
				|  |  |       if (row.is_state == 1) { |  |  |  | 
		
	
		
			
				|  |  |         row.is_state = 2 |  |  |  | 
		
	
		
			
				|  |  |       } else { |  |  |  | 
		
	
		
			
				|  |  |         row.is_state = 1 |  |  |  | 
		
	
		
			
				|  |  |  |  |  |       if(row.is_state ==1){ | 
		
	
		
			
				|  |  |  |  |  |         row.is_state=2 | 
		
	
		
			
				|  |  |  |  |  |       }else{ | 
		
	
		
			
				|  |  |  |  |  |         row.is_state=1 | 
		
	
		
			
				|  |  |       } |  |  |       } | 
		
	
		
			
				|  |  |     }, |  |  |     }, | 
		
	
		
			
				|  |  |     // 编辑 |  |  |     // 编辑 | 
		
	
	
		
			
				|  | @ -273,48 +276,60 @@ export default { | 
		
	
		
			
				|  |  |       console.log(row) |  |  |       console.log(row) | 
		
	
		
			
				|  |  |       this.messageVisible = true |  |  |       this.messageVisible = true | 
		
	
		
			
				|  |  |       // 根据id查询返回的紧急通知的数据 |  |  |       // 根据id查询返回的紧急通知的数据 | 
		
	
		
			
				|  |  |       const params = { |  |  |  | 
		
	
		
			
				|  |  |         notice_id: row.notice_id |  |  |  | 
		
	
		
			
				|  |  |  |  |  |       const params ={ | 
		
	
		
			
				|  |  |  |  |  |          notice_id:row.notice_id | 
		
	
		
			
				|  |  |       } |  |  |       } | 
		
	
		
			
				|  |  |       reqQueryMessage(params).then(res => { |  |  |  | 
		
	
		
			
				|  |  |  |  |  |       reqQueryMessage(params).then(res=>{     | 
		
	
		
			
				|  |  |         console.log(res)   |  |  |         console.log(res)   | 
		
	
		
			
				|  |  |         if (res.code == 200) { |  |  |  | 
		
	
		
			
				|  |  |           this.form.notice_device = res.data.notice.noticeDevice |  |  |  | 
		
	
		
			
				|  |  |           this.form.context_color = res.data.notice.contextColor |  |  |  | 
		
	
		
			
				|  |  |           this.form.context = res.data.notice.context |  |  |  | 
		
	
		
			
				|  |  |           this.form.context_position = res.data.notice.contextPosition |  |  |  | 
		
	
		
			
				|  |  |           this.form.context_size = res.data.notice.contextSize |  |  |  | 
		
	
		
			
				|  |  |  |  |  |         if(res.code==200) { | 
		
	
		
			
				|  |  |  |  |  |          this.form.notice_device=res.data.notice.noticeDevice | 
		
	
		
			
				|  |  |  |  |  |          this.form.context_color=res.data.notice.contextColor | 
		
	
		
			
				|  |  |  |  |  |          this.form.context=res.data.notice.context | 
		
	
		
			
				|  |  |  |  |  |          this.form.context_position=res.data.notice.contextPosition | 
		
	
		
			
				|  |  |  |  |  |          this.form.context_size=res.data.notice.contextSize       | 
		
	
		
			
				|  |  |             //  判断文字位置 |  |  |             //  判断文字位置 | 
		
	
		
			
				|  |  |           if (this.form.context_position == 1) { |  |  |  | 
		
	
		
			
				|  |  |             this.form.context_position_name = '顶部' |  |  |  | 
		
	
		
			
				|  |  |           } else if (this.form.context_position == 2) { |  |  |  | 
		
	
		
			
				|  |  |             this.form.context_position_name = '中部' |  |  |  | 
		
	
		
			
				|  |  |           } else { |  |  |  | 
		
	
		
			
				|  |  |             this.form.context_position_name = '底部' |  |  |  | 
		
	
		
			
				|  |  |  |  |  |               if( this.form.context_position==1){ | 
		
	
		
			
				|  |  |  |  |  |                 this.form.context_position_name='顶部' | 
		
	
		
			
				|  |  |  |  |  |               }else if( this.form.context_position==2){ | 
		
	
		
			
				|  |  |  |  |  |                 this.form.context_position_name='中部' | 
		
	
		
			
				|  |  |  |  |  |               }else{ | 
		
	
		
			
				|  |  |  |  |  |                 this.form.context_position_name='底部' | 
		
	
		
			
				|  |  |               }   |  |  |               }   | 
		
	
		
			
				|  |  |             // 判断速度 |  |  |             // 判断速度 | 
		
	
		
			
				|  |  |           if (this.form.context_speed == 0) { |  |  |  | 
		
	
		
			
				|  |  |             this.form.context_speed_name = '1s' |  |  |  | 
		
	
		
			
				|  |  |           } else if (this.form.context_speed == 1) { |  |  |  | 
		
	
		
			
				|  |  |             this.form.context_speed_name = '2s' |  |  |  | 
		
	
		
			
				|  |  |           } else { |  |  |  | 
		
	
		
			
				|  |  |             this.form.context_speed_name = '3s' |  |  |  | 
		
	
		
			
				|  |  |  |  |  |               if(this.form.context_speed==0){ | 
		
	
		
			
				|  |  |  |  |  |               this.form.context_speed_name='1s' | 
		
	
		
			
				|  |  |  |  |  |             }else if(this.form.context_speed==1){ | 
		
	
		
			
				|  |  |  |  |  |                 this.form.context_speed_name='2s' | 
		
	
		
			
				|  |  |  |  |  |             }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') |  |  |  | 
		
	
		
			
				|  |  |  |  |  |     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() { |  |  |  | 
		
	
		
			
				|  |  |       if (this.form.notice_device == 1) { |  |  |  | 
		
	
		
			
				|  |  |         this.form.notice_devices = [] |  |  |  | 
		
	
		
			
				|  |  |       } else { |  |  |  | 
		
	
		
			
				|  |  |         this.form.AllDevice = this.deviceList |  |  |  | 
		
	
		
			
				|  |  |  |  |  |     clearCheckbox(){ | 
		
	
		
			
				|  |  |  |  |  |       if(this.form.notice_device==1){ | 
		
	
		
			
				|  |  |  |  |  |         this.form.notice_devices=[] | 
		
	
		
			
				|  |  |  |  |  |       }else{ | 
		
	
		
			
				|  |  |  |  |  |         this.form.AllDevice=this.deviceList | 
		
	
		
			
				|  |  |       } |  |  |       } | 
		
	
		
			
				|  |  |     }, |  |  |     }, | 
		
	
		
			
				|  |  |     handleSelectionChange(val) { |  |  |     handleSelectionChange(val) { | 
		
	
	
		
			
				|  | @ -331,45 +346,33 @@ export default { | 
		
	
		
			
				|  |  |       console.log(this.form.context_color) |  |  |       console.log(this.form.context_color) | 
		
	
		
			
				|  |  |     }, |  |  |     }, | 
		
	
		
			
				|  |  |     // 改变文字的位置 |  |  |     // 改变文字的位置 | 
		
	
		
			
				|  |  |     selectPosition(selVal) { |  |  |  | 
		
	
		
			
				|  |  |  |  |  |     selectPosition(selVal){ | 
		
	
		
			
				|  |  |       // console.log(selVal) |  |  |       // console.log(selVal) | 
		
	
		
			
				|  |  |       this.form.context_position = selVal.key |  |  |  | 
		
	
		
			
				|  |  |       this.form.context_position_name = selVal.name |  |  |  | 
		
	
		
			
				|  |  |  |  |  |       this.form.context_position=selVal.key | 
		
	
		
			
				|  |  |  |  |  |       this.form.context_position_name=selVal.name | 
		
	
		
			
				|  |  |     }, |  |  |     }, | 
		
	
		
			
				|  |  |     // 速度 |  |  |     // 速度 | 
		
	
		
			
				|  |  |     selectSpeed(selVal) { |  |  |  | 
		
	
		
			
				|  |  |       this.form.context_speed = selVal.key |  |  |  | 
		
	
		
			
				|  |  |       this.form.context_speed_name = selVal.name |  |  |  | 
		
	
		
			
				|  |  |  |  |  |     selectSpeed(selVal){ | 
		
	
		
			
				|  |  |  |  |  |        this.form.context_speed=selVal.key | 
		
	
		
			
				|  |  |  |  |  |        this.form.context_speed_name=selVal.name | 
		
	
		
			
				|  |  |     }, |  |  |     }, | 
		
	
		
			
				|  |  |     // 添加设备的对话框 |  |  |  | 
		
	
		
			
				|  |  |  |  |  |     //添加设备的对话框 | 
		
	
		
			
				|  |  |     addDeviceTag() { |  |  |     addDeviceTag() { | 
		
	
		
			
				|  |  |       this.selectDeviceVisible = true |  |  |       this.selectDeviceVisible = true | 
		
	
		
			
				|  |  |     }, |  |  |     }, | 
		
	
		
			
				|  |  |     // 添加设备 |  |  |     // 添加设备 | 
		
	
		
			
				|  |  |     tagHandle(tag) {     |  |  |     tagHandle(tag) {     | 
		
	
		
			
				|  |  |       this.form.notice_devices.push({ deviceId: tag.device_id }) |  |  |  | 
		
	
		
			
				|  |  |       console.log('添加选中前----') |  |  |  | 
		
	
		
			
				|  |  |       console.log(this.deviceTags) |  |  |  | 
		
	
		
			
				|  |  |       if (this.deviceTags.length == 0) { |  |  |  | 
		
	
		
			
				|  |  |  |  |  |       this.form.notice_devices.push({deviceId:tag.device_id}) | 
		
	
		
			
				|  |  |  |  |  |       if(this.deviceTags.length==0){ | 
		
	
		
			
				|  |  |         this.deviceTags.push(tag) |  |  |         this.deviceTags.push(tag) | 
		
	
		
			
				|  |  |       } else { |  |  |  | 
		
	
		
			
				|  |  |         const current = this.deviceTags.find((item) => { |  |  |  | 
		
	
		
			
				|  |  |           return item.device_id == tag.device_id |  |  |  | 
		
	
		
			
				|  |  |         }) |  |  |  | 
		
	
		
			
				|  |  |  |  |  |       }else{ | 
		
	
		
			
				|  |  |  |  |  |         const current = this.deviceTags &&this.deviceTags.some((item) => item.device_name == tag.device_name ) | 
		
	
		
			
				|  |  |        // 查找是否存在相同的 |  |  |        // 查找是否存在相同的 | 
		
	
		
			
				|  |  |       console.log('current', current) |  |  |       console.log('current', current) | 
		
	
		
			
				|  |  |       if (!current) { |  |  |       if (!current) { | 
		
	
		
			
				|  |  |         // console.log('没有相同的') |  |  |  | 
		
	
		
			
				|  |  |         this.deviceTags.push(tag)   |  |  |         this.deviceTags.push(tag)   | 
		
	
		
			
				|  |  |         } else { |  |  |  | 
		
	
		
			
				|  |  |           console.log('有相同的') |  |  |  | 
		
	
		
			
				|  |  |       }    |  |  |       }    | 
		
	
		
			
				|  |  |     }       |  |  |     }       | 
		
	
		
			
				|  |  |       // } else { |  |  |  | 
		
	
		
			
				|  |  |       //   console.log('有相同的') |  |  |  | 
		
	
		
			
				|  |  |       // } |  |  |  | 
		
	
		
			
				|  |  |       console.log('添加选中后----') |  |  |  | 
		
	
		
			
				|  |  |       console.log(this.deviceTags) |  |  |  | 
		
	
		
			
				|  |  |   }, |  |  |   }, | 
		
	
		
			
				|  |  |     // 单独删除某一个设备 |  |  |     // 单独删除某一个设备 | 
		
	
		
			
				|  |  |     handleClose(tag) { |  |  |     handleClose(tag) { | 
		
	
	
		
			
				|  | @ -379,7 +382,7 @@ export default { | 
		
	
		
			
				|  |  |     // 清空设备 |  |  |     // 清空设备 | 
		
	
		
			
				|  |  |     clearDevice() { |  |  |     clearDevice() { | 
		
	
		
			
				|  |  |       this.deviceTags = [] |  |  |       this.deviceTags = [] | 
		
	
		
			
				|  |  |     } |  |  |  | 
		
	
		
			
				|  |  |  |  |  |     }, | 
		
	
		
			
				|  |  |   } |  |  |   } | 
		
	
		
			
				|  |  | } |  |  | } | 
		
	
		
			
				|  |  | </script> |  |  | </script> | 
		
	
	
		
			
				|  | 
 |