|  |  |  | 
|---|
|  |  |  | const areaInfo = await getAreaModuleBycode(this.code) | 
|---|
|  |  |  | if(areaInfo&&areaInfo.areaModuleItems){ | 
|---|
|  |  |  | let areaModuleItems=areaInfo.areaModuleItems | 
|---|
|  |  |  | this.totalElements = areaModuleItems.areaConfigNum === 0 ? 1000 : areaModuleItems.areaConfigNum; | 
|---|
|  |  |  | if(areaModuleItems.areaConfigNum){ | 
|---|
|  |  |  | this.totalElements = areaModuleItems.areaConfigNum; | 
|---|
|  |  |  | } | 
|---|
|  |  |  |  | 
|---|
|  |  |  | this.areaUrl =areaModuleItems.url | 
|---|
|  |  |  | } | 
|---|
|  |  |  |  | 
|---|
|  |  |  | 
|---|
|  |  |  |  | 
|---|
|  |  |  | // 点击增加 | 
|---|
|  |  |  | handleClickToAddItem(index,item){ | 
|---|
|  |  |  | debugger; | 
|---|
|  |  |  | // this.cur_device_info = item.deviceInfo | 
|---|
|  |  |  | // this.cur_device_info.areaRow=item.row | 
|---|
|  |  |  | // this.cur_device_info.areaCell=item.cell | 
|---|
|  |  |  |  | 
|---|
|  |  |  | this.cur_item=item | 
|---|
|  |  |  | // 如果存在设备的话则直接返回 | 
|---|
|  |  |  | if(item?.deviceInfo?.id) return; | 
|---|
|  |  |  | 
|---|
|  |  |  | showDeviceInfo(index, item,event) { | 
|---|
|  |  |  | this.isDragging = false; | 
|---|
|  |  |  | event.stopPropagation(); // 阻止事件冒泡 | 
|---|
|  |  |  | if(item.deviceInfo){ | 
|---|
|  |  |  | // 如果点击的是同一个元素,则切换显示状态 | 
|---|
|  |  |  | if (this.selectedIndex === index) { | 
|---|
|  |  |  | this.show_device_info = !this.show_device_info; | 
|---|
|  |  |  | } else { | 
|---|
|  |  |  | // 切换到新元素,自动关闭之前的 | 
|---|
|  |  |  | this.selectedIndex = index; | 
|---|
|  |  |  | this.show_device_info = true; | 
|---|
|  |  |  | this.cur_device_info = item.deviceInfo; | 
|---|
|  |  |  | this.show_device_info = !this.show_device_info; | 
|---|
|  |  |  | } else { | 
|---|
|  |  |  | // 切换到新元素,自动关闭之前的 | 
|---|
|  |  |  | this.selectedIndex = index; | 
|---|
|  |  |  | this.show_device_info = true; | 
|---|
|  |  |  | this.cur_device_info = item.deviceInfo; | 
|---|
|  |  |  | } | 
|---|
|  |  |  | } | 
|---|
|  |  |  | }, | 
|---|
|  |  |  | }, | 
|---|