From 12d171dc51facdbef208bbf917381ed9d731424e Mon Sep 17 00:00:00 2001 From: ko1234 Date: Fri, 1 Nov 2024 16:56:31 +0800 Subject: [PATCH] =?UTF-8?q?=E7=B3=BB=E7=B5=B1=E7=9B=A3=E6=8E=A7=E5=B0=8F?= =?UTF-8?q?=E8=A6=96=E7=AA=97=E7=9A=84cog=E3=80=81img=20|=20=E8=A8=AD?= =?UTF-8?q?=E5=82=99=E7=AE=A1=E7=90=86=E9=80=A3=E7=B5=90=E5=9C=96=E8=B3=87?= =?UTF-8?q?=E7=AE=A1=E7=90=86=E7=9A=84=E5=9C=96=E7=89=87=20|=20=E6=A8=93?= =?UTF-8?q?=E5=B1=A4=E6=96=B0=E5=A2=9E=E3=80=81=E7=B7=A8=E8=BC=AF=E3=80=81?= =?UTF-8?q?=E5=88=AA=E9=99=A4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/components/chart/EffectScatter.vue | 23 +++-- src/components/customUI/Menu.vue | 2 +- src/components/customUI/Pagination.vue | 2 +- src/hooks/forge/useForgeSprite.js | 2 +- .../AssetManagement/components/AssetTable.vue | 25 ++++- .../AssetTableModalLeftInfoGraph.vue | 47 +++++++-- .../components/AssetTableModalRightInfo.vue | 96 ++++++++++--------- src/views/system/System.vue | 67 ++++++++++--- .../system/components/SystemInfoModalCog.vue | 72 +++++++++++++- .../components/SystemInfoModalImage.vue | 28 +++++- 10 files changed, 274 insertions(+), 90 deletions(-) diff --git a/src/components/chart/EffectScatter.vue b/src/components/chart/EffectScatter.vue index 3893e4e..2ac30af 100644 --- a/src/components/chart/EffectScatter.vue +++ b/src/components/chart/EffectScatter.vue @@ -10,7 +10,7 @@ const props = defineProps({ svg: Object, getCoordinate: { type: Function, - default: null + default: null, }, }); @@ -22,7 +22,7 @@ async function updateSvg(svg, option) { if (!chart.value && dom.value && svg) { init(); } else { - clear() + clear(); } axios.get(svg.path).then(({ data }) => { echarts.registerMap(svg.full_name, { svg: data }); @@ -30,24 +30,33 @@ async function updateSvg(svg, option) { if (props.getCoordinate) { chart.value.getZr().on("click", function (params) { var pixelPoint = [params.offsetX, params.offsetY]; - var dataPoint = chart.value.convertFromPixel({ geoIndex: 0 }, pixelPoint); + var dataPoint = chart.value.convertFromPixel( + { geoIndex: 0 }, + pixelPoint + ); currentClickPosition.value = dataPoint; props.getCoordinate(dataPoint); + const updatedData = option.series.data + .filter( + (point) => !(point.itemStyle && point.itemStyle.color === "#0000FF") + ) + .concat({ + value: dataPoint, // 當前座標值 + itemStyle: { color: "#0000FF" }, // 設為藍色 + }); chart.value.setOption({ series: { - data: [dataPoint], + data: updatedData, }, }); - }); } - }); console.log("updateSvg", svg.path); } function clear() { - chart.value.clear() + chart.value.clear(); } function init() { diff --git a/src/components/customUI/Menu.vue b/src/components/customUI/Menu.vue index 157fae1..054a6a3 100644 --- a/src/components/customUI/Menu.vue +++ b/src/components/customUI/Menu.vue @@ -21,7 +21,7 @@ const props = defineProps({ /> -
+
{{ item.name }}
  • diff --git a/src/components/customUI/Pagination.vue b/src/components/customUI/Pagination.vue index c7cb3fb..d95ed64 100644 --- a/src/components/customUI/Pagination.vue +++ b/src/components/customUI/Pagination.vue @@ -123,7 +123,7 @@ const pageInput = computed(() => { {{ dataSource.length }} {{ $t("table.in_otal") }} diff --git a/src/hooks/forge/useForgeSprite.js b/src/hooks/forge/useForgeSprite.js index 6a6678c..f992e70 100644 --- a/src/hooks/forge/useForgeSprite.js +++ b/src/hooks/forge/useForgeSprite.js @@ -35,7 +35,7 @@ export default function useForgeSprite() { console.log("onSpriteClicked", event.target); console.log("onSpriteClicked", data); // modalContent.value = data; - debugger; + // debugger; if (data) { getCurrentInfoModalData( event, diff --git a/src/views/AssetManagement/components/AssetTable.vue b/src/views/AssetManagement/components/AssetTable.vue index 7709b6e..4944c82 100644 --- a/src/views/AssetManagement/components/AssetTable.vue +++ b/src/views/AssetManagement/components/AssetTable.vue @@ -1,6 +1,6 @@