From 7db9a07af359d14b7bdc03ebf477ac3aabe7944c Mon Sep 17 00:00:00 2001 From: dev01 Date: Thu, 17 Nov 2022 22:14:46 +0800 Subject: [PATCH] =?UTF-8?q?[Frontend]=E7=B3=BB=E7=B5=B1=E7=9B=A3=E6=8E=A7?= =?UTF-8?q?=20=E5=B9=B3=E9=9D=A2=E5=9C=96=E6=94=BE=E5=A4=A7=E6=B2=92?= =?UTF-8?q?=E6=9C=89=E5=91=88=E7=8F=BEicon=E5=95=8F=E9=A1=8C=E8=A7=A3?= =?UTF-8?q?=E6=B1=BA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Frontend/_sysMonFloor.html | 93 ++++++++++++++++++++------------------ 1 file changed, 49 insertions(+), 44 deletions(-) diff --git a/Frontend/_sysMonFloor.html b/Frontend/_sysMonFloor.html index 05356d6..e77d534 100644 --- a/Frontend/_sysMonFloor.html +++ b/Frontend/_sysMonFloor.html @@ -46,7 +46,7 @@ //}); //currentData = selected_floor_objs[0].device; - + currentData = $.map(devList, function (item) { //資料處理 @@ -142,14 +142,14 @@ if (svg == undefined || svg == null) { return; } - + echarts.registerMap('floor_svg', { svg: svg }); option = { // animationDurationUpdate: 1500, tooltip: { formatter: function (params) { - console.log("23",params) + console.log("23", params) if (params.data.device_node_guid != undefined && params.data.device_node_guid != null && params.data.device_node_guid != "") { return `名稱:${params.data.device_node_full_name}
Guid:${params.data.device_node_guid}` @@ -295,7 +295,7 @@ var dataPoint = floChart.convertFromPixel({ geoIndex: 0 }, pixelPoint); console.log(dataPoint); - + temp_device_on_floor_map = [{ device_guid: selected_temp_device.device_guid, @@ -307,7 +307,7 @@ }]; - + // currentData.push([dataPoint[0], dataPoint[1], 1]); @@ -364,7 +364,7 @@ }); - + } //訂閱設備的回傳值,並塞到全域變數 @@ -406,8 +406,8 @@ // 重設平面圖設備資料 function resetData() { - - const scatter_symbol_convertData = function (data) { //正常、關閉排除CCVT(圓點) + + const scatter_symbol_convertData = function (data,zoom) { //正常、關閉排除CCVT(圓點) let res = [], temp = []; data.forEach(function (item, index) { if (global_emergency_alarm_device_number != undefined @@ -529,7 +529,7 @@ } } } - + item.zoom = zoom; temp.push(item); } } @@ -564,7 +564,10 @@ if (item.selected) { obj.symbolSize = 60 } - + console.log(item.zoom) + if (item.zoom > 8) { + obj.symbolSize = 10 + } res.push(obj); }); @@ -573,35 +576,35 @@ const scatter_icon_convertData = function (data) { //正常、關閉(icon) let res = [], temp = []; - + data.forEach(function (item, index) { if (global_emergency_alarm_device_number != undefined && global_emergency_alarm_device_number != null) { if (global_emergency_alarm_device_number.findIndex(x => x.device_number == item.device_number) < 0 && item.device_system_category_layer3 != "C") { //如果有子節點,則只針對子節點操作 - //if (item.device_nodes != undefined && item.device_nodes != null && item.device_nodes.length > 0) { - // item.device_nodes.forEach(function (item_node, item_node_index) { - let item_node = {}; + if (item.device_nodes != undefined && item.device_nodes != null && item.device_nodes.length > 0) { + item.device_nodes.forEach(function (item_node, item_node_index) { + //添加父節點相關資訊 item_node.device_system_category_layer3 = item.device_system_category_layer3; item_node.device_normal_color = item.device_normal_color; - item_node.device_image_url = item.device_image_url; + item_node.device_image = item.device_image; temp.push(item_node); - // }); - //} else { - // temp.push(item) - //} + }); + } else { + temp.push(item) + } } } }); - // let temp = data.filter(function (item, index) { - // if (global_emergency_alarm_device_number != undefined && global_emergency_alarm_device_number != null) { - // return global_emergency_alarm_device_number.findIndex(x => x.device_number == item.device_number) < 0 && item.device_system_category_layer3 != "C"; - // } else { - // return []; - // } - // }); + temp = data.filter(function (item, index) { + if (global_emergency_alarm_device_number != undefined && global_emergency_alarm_device_number != null) { + return global_emergency_alarm_device_number.findIndex(x => x.device_number == item.device_number) < 0 && item.device_system_category_layer3 != "C"; + } else { + return []; + } + }); temp.map(function (item) { @@ -613,7 +616,7 @@ device_node_full_name: item.device_node_full_name ? item.device_node_full_name : null, device_system_category_layer3: item.device_system_category_layer3 ? item.device_system_category_layer3 : null, status: item.status, - symbol: 'image://' + item.device_image_url, + symbol: 'image://' + baseImgUrl + "/upload/device_icon/" + item.device_image, value: item.value, deviceItems: item.deviceItems, deviceURL: item.deviceURL @@ -689,30 +692,30 @@ && global_emergency_alarm_device_number != null) { if (global_emergency_alarm_device_number.findIndex(x => x.device_number == item.device_number) > -1 && item.device_system_category_layer3 != "C") { //如果有子節點,則只針對子節點操作 - //if (item.device_nodes != undefined && item.device_nodes != null && item.device_nodes.length > 0) { - // item.device_nodes.forEach(function (item_node, item_node_index) { - let item_node = {}; + if (item.device_nodes != undefined && item.device_nodes != null && item.device_nodes.length > 0) { + item.device_nodes.forEach(function (item_node, item_node_index) { + //添加父節點相關資訊 item_node.device_system_category_layer3 = item.device_system_category_layer3; item_node.device_error_color = item.device_error_color; - item_node.device_image_url = item.device_image_url; + item_node.device_image = item.device_image; temp.push(item_node); - // }); - //} else { - // temp.push(item) - //} + }); + } else { + temp.push(item) + } } } }); - // if (global_emergency_alarm_device_number != undefined && global_emergency_alarm_device_number != null) { - // temp = data.filter(function (item, index) { - // return global_emergency_alarm_device_number.findIndex(x => x.device_number == item.device_number) > -1 && item.device_system_category_layer3 != "C"; - // }); - // } + if (global_emergency_alarm_device_number != undefined && global_emergency_alarm_device_number != null) { + temp = data.filter(function (item, index) { + return global_emergency_alarm_device_number.findIndex(x => x.device_number == item.device_number) > -1 && item.device_system_category_layer3 != "C"; + }); + } temp.map(function (item) { - + var obj = { device_guid: item.device_guid, device_number: item.device_number, @@ -721,7 +724,7 @@ device_node_full_name: item.device_node_full_name ? item.device_node_full_name : null, device_system_category_layer3: item.device_system_category_layer3 ? item.device_system_category_layer3 : null, status: item.status, - symbol: 'image://' + item.device_image_url, + symbol: 'image://' + baseImgUrl + "/upload/device_icon/" + item.device_image, value: item.value, deviceItems: item.deviceItems, deviceURL: item.deviceURL @@ -785,11 +788,13 @@ }] }); } else { - + floChart.setOption({ series: [{ symbolOffset: [10, 10], - data: scatter_symbol_convertData(currentData) //正常、關閉(圓點) + + data: scatter_symbol_convertData(currentData, zoom), //正常、關閉(圓點) + }, { data: scatter_icon_convertData(currentData) //正常、關閉(icon) }, {