From 1f20b21f93c68eb61cf800cde5d6ad5beed08f9e Mon Sep 17 00:00:00 2001 From: herenshan112 Date: Sat, 26 Jul 2025 08:39:20 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E5=86=B2=E7=AA=81=E6=95=B0?= =?UTF-8?q?=E6=8D=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../appPageForm/echatesUnit/chart/bar.vue | 4 +-- .../appPageForm/echatesUnit/chart/barRace.vue | 26 +++++++++++++++---- .../appPageForm/echatesUnit/chart/line.vue | 10 +++---- .../appPageForm/echatesUnit/chart/pie.vue | 2 +- .../appPageForm/echatesUnit/chart/radar.vue | 2 +- .../appPageForm/echatesUnit/chart/target.vue | 2 +- .../appPageForm/echatesUnit/container.vue | 3 ++- 7 files changed, 33 insertions(+), 16 deletions(-) diff --git a/src/views/sysworkflow/lowcodepage/appPage/appPageForm/echatesUnit/chart/bar.vue b/src/views/sysworkflow/lowcodepage/appPage/appPageForm/echatesUnit/chart/bar.vue index f188556..727ab61 100644 --- a/src/views/sysworkflow/lowcodepage/appPage/appPageForm/echatesUnit/chart/bar.vue +++ b/src/views/sysworkflow/lowcodepage/appPage/appPageForm/echatesUnit/chart/bar.vue @@ -41,7 +41,7 @@ const drawPictures = () => { analyzeChartData({ tableKey: props.tableKey, chartId: props.uuid, - setConfig: controlData.value, + setConfig: props.data, }).then((data) => { console.log("火1111111兔", data); if (data.code == 0 && data.data != null) { @@ -132,7 +132,7 @@ watch( { deep: true } ); watch( - () => controlData.value, + () => props.data, (val: any) => { console.log("画图完毕--改变-->", val); drawPictures(); diff --git a/src/views/sysworkflow/lowcodepage/appPage/appPageForm/echatesUnit/chart/barRace.vue b/src/views/sysworkflow/lowcodepage/appPage/appPageForm/echatesUnit/chart/barRace.vue index 2cec10d..0c5f3ea 100644 --- a/src/views/sysworkflow/lowcodepage/appPage/appPageForm/echatesUnit/chart/barRace.vue +++ b/src/views/sysworkflow/lowcodepage/appPage/appPageForm/echatesUnit/chart/barRace.vue @@ -7,7 +7,12 @@ import { analyzeChartData } from "@/api/chart/index"; import { echatsViews } from "@/api/DesignForm/types"; import * as echarts from "echarts"; - +import { useDesignEchartsStore } from "@/store/DesignForm/designForm"; +const store = useDesignEchartsStore() as any; //自定义表单存储器 +//获取当前激活的项目 +const controlData = computed(() => { + return store.controlAttr; +}); const props = withDefaults( defineProps<{ uuid: string; @@ -29,10 +34,14 @@ var myChart = ref(); @ 时间: 2025-06-26 11:34:21 @ 功能: 画图 */ -const drawPictures = () => { +const drawBarracetures = () => { if (props.uuid && props.uuid != "") { myChart.value = echarts.init(document.getElementById(props.uuid) as HTMLDivElement); - analyzeChartData({ tableKey: props.tableKey, chartId: props.uuid }).then((data) => { + analyzeChartData({ + tableKey: props.tableKey, + chartId: props.uuid, + setConfig: props.data, + }).then((data) => { console.log("画图排行榜---->1", data); if (data.code == 0 && data.data != null) { let radMap = data.data; @@ -131,10 +140,17 @@ const searBut = (val: string) => { } return false; }; - +watch( + () => props.data, + (val: any) => { + console.log("画图完毕--改变-->", val); + drawBarracetures(); + }, + { deep: true } +); onMounted(() => { nextTick(() => { - drawPictures(); + drawBarracetures(); }); }); diff --git a/src/views/sysworkflow/lowcodepage/appPage/appPageForm/echatesUnit/chart/line.vue b/src/views/sysworkflow/lowcodepage/appPage/appPageForm/echatesUnit/chart/line.vue index 8e35837..6b57cd7 100644 --- a/src/views/sysworkflow/lowcodepage/appPage/appPageForm/echatesUnit/chart/line.vue +++ b/src/views/sysworkflow/lowcodepage/appPage/appPageForm/echatesUnit/chart/line.vue @@ -34,7 +34,7 @@ var myChartPie = ref(); @ 时间: 2025-06-26 11:34:21 @ 功能: 画图 */ -const drawPie = () => { +const drawLine = () => { if (props.uuid && props.uuid != "") { myChartPie.value = echarts.init( document.getElementById(props.uuid) as HTMLDivElement @@ -42,7 +42,7 @@ const drawPie = () => { analyzeChartData({ tableKey: props.tableKey, chartId: props.uuid, - etConfig: controlData.value, + setConfig: props.data, }).then((data) => { console.log("火兔", data); if (data.code == 0 && data.data != null) { @@ -114,13 +114,13 @@ watch( () => props.data, (val: any) => { console.log("画图完毕--改变-->", val); - drawPie(); + drawLine(); }, { deep: true } ); onMounted(() => { nextTick(() => { - drawPie(); + drawLine(); }); }); @@ -229,7 +229,7 @@ onMounted(() => {