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 158e38b..8dc2c20 100644 --- a/src/views/sysworkflow/lowcodepage/appPage/appPageForm/echatesUnit/chart/bar.vue +++ b/src/views/sysworkflow/lowcodepage/appPage/appPageForm/echatesUnit/chart/bar.vue @@ -7,6 +7,8 @@ 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 props = withDefaults( defineProps<{ @@ -36,18 +38,23 @@ var myChart = ref(); const drawPictures = () => { if (props.uuid && props.uuid != "") { myChart.value = echarts.init(document.getElementById(props.uuid) as HTMLDivElement); - analyzeChartData({ tableKey: props.tableKey, chartId: props.uuid }).then((data) => { - console.log("火兔", data); + analyzeChartData({ + tableKey: props.tableKey, + chartId: props.uuid, + setConfig: controlData.value, + }).then((data) => { + console.log("火1111111兔", data); if (data.code == 0) { let optVal = data.data; - optVal.grid = { - left: "2%", - right: "2%", - bottom: "15%", - top: "15%", - containLabel: true, - }; + // optVal.grid = { + // left: "2%", + // right: "2%", + // bottom: "15%", + // top: "15%", + // containLabel: true, + // }; myChart.value.setOption(optVal); + myChart.value.resize(); } else { myChart.value.setOption({ grid: { @@ -77,6 +84,7 @@ const drawPictures = () => { }, ], }); + myChart.value.resize(); } }); // myChart.value.setOption({ @@ -111,6 +119,10 @@ const drawPictures = () => { // myChart.value.resize(); } }; +//获取当前激活的项目 +const controlData = computed(() => { + return store.controlAttr; +}); watch( () => props.kuandu, (val: any) => { @@ -120,7 +132,7 @@ watch( { deep: true } ); watch( - () => props.data, + () => controlData.value, (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 692e731..f08f20a 100644 --- a/src/views/sysworkflow/lowcodepage/appPage/appPageForm/echatesUnit/chart/barRace.vue +++ b/src/views/sysworkflow/lowcodepage/appPage/appPageForm/echatesUnit/chart/barRace.vue @@ -78,6 +78,7 @@ const drawPictures = () => { series: seriesList, }; myChart.value.setOption(optionData); + myChart.value.resize(); } else { myChart.value.setOption({ grid: { @@ -110,6 +111,7 @@ const drawPictures = () => { }, ], }); + myChart.value.resize(); } }); 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 82e0234..1c5ac2a 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,11 @@ const drawPie = () => { myChartPie.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, + etConfig: controlData.value, + }).then((data) => { console.log("火兔", data); if (data.code == 0) { let optVal = data.data; @@ -46,6 +50,7 @@ const drawPie = () => { containLabel: true, }; myChartPie.value.setOption(optVal); + myChartPie.value.resize(); } else { myChartPie.value.setOption({ grid: { @@ -80,6 +85,7 @@ const drawPie = () => { }, ], }); + myChartPie.value.resize(); } }); diff --git a/src/views/sysworkflow/lowcodepage/appPage/appPageForm/echatesUnit/chart/pie.vue b/src/views/sysworkflow/lowcodepage/appPage/appPageForm/echatesUnit/chart/pie.vue index fcc8ccd..3d8412c 100644 --- a/src/views/sysworkflow/lowcodepage/appPage/appPageForm/echatesUnit/chart/pie.vue +++ b/src/views/sysworkflow/lowcodepage/appPage/appPageForm/echatesUnit/chart/pie.vue @@ -34,7 +34,11 @@ const drawPie = () => { myChartPie.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, + etConfig: controlData.value, + }).then((data) => { console.log("火兔---->1", data); if (data.code == 0) { let optionData = { @@ -92,6 +96,7 @@ const drawPie = () => { }; console.log("火兔---->2", optionData); myChartPie.value.setOption(optionData); + myChartPie.value.resize(); } else { myChartPie.value.setOption({ legend: { diff --git a/src/views/sysworkflow/lowcodepage/appPage/appPageForm/echatesUnit/chart/radar.vue b/src/views/sysworkflow/lowcodepage/appPage/appPageForm/echatesUnit/chart/radar.vue index fb1fcef..77b83ff 100644 --- a/src/views/sysworkflow/lowcodepage/appPage/appPageForm/echatesUnit/chart/radar.vue +++ b/src/views/sysworkflow/lowcodepage/appPage/appPageForm/echatesUnit/chart/radar.vue @@ -34,7 +34,11 @@ const drawRadar = () => { myChartPie.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, + etConfig: controlData.value, + }).then((data) => { console.log("画图雷达---->1", data); if (data.code == 0) { let radMap = data.data; @@ -58,6 +62,7 @@ const drawRadar = () => { ], }; myChartPie.value.setOption(optionData); + myChartPie.value.resize(); } else { myChartPie.value.setOption({ grid: { diff --git a/src/views/sysworkflow/lowcodepage/appPage/appPageForm/echatesUnit/chart/target.vue b/src/views/sysworkflow/lowcodepage/appPage/appPageForm/echatesUnit/chart/target.vue index b05f8b4..f50aba4 100644 --- a/src/views/sysworkflow/lowcodepage/appPage/appPageForm/echatesUnit/chart/target.vue +++ b/src/views/sysworkflow/lowcodepage/appPage/appPageForm/echatesUnit/chart/target.vue @@ -27,7 +27,11 @@ const listAry = ref([]); */ const getTargetData = () => { if (props.uuid && props.uuid != "") { - analyzeChartData({ tableKey: props.tableKey, chartId: props.uuid }).then((data) => { + analyzeChartData({ + tableKey: props.tableKey, + chartId: props.uuid, + etConfig: controlData.value, + }).then((data) => { console.log("获取指标数据---->1", data); listAry.value = data.data; }); diff --git a/src/views/sysworkflow/lowcodepage/appPage/appPageForm/echatesUnit/winBox/dimMea.vue b/src/views/sysworkflow/lowcodepage/appPage/appPageForm/echatesUnit/winBox/dimMea.vue index 60baddc..3c1c646 100644 --- a/src/views/sysworkflow/lowcodepage/appPage/appPageForm/echatesUnit/winBox/dimMea.vue +++ b/src/views/sysworkflow/lowcodepage/appPage/appPageForm/echatesUnit/winBox/dimMea.vue @@ -636,7 +636,7 @@ const duliangBianhua = () => { :title="drawTitle" direction="rtl" :before-close="handleClose" - >{{ controlData.type }}--->{{ props.dimMeaType }} + >