From 1cb6b6469ba9d5330cdb76e4034905e24ba9ba74 Mon Sep 17 00:00:00 2001 From: qianlishi Date: Thu, 12 Jan 2023 15:55:20 +0800 Subject: [PATCH] =?UTF-8?q?=E6=9B=B4=E6=96=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- report-ui/src/mixins/queryform.js | 8 +- report-ui/src/utils/screen.js | 17 ++ .../designer/widget/bar/widgetBarchart.vue | 22 +-- .../widget/barline/widgetBarlinechart.vue | 154 ++++++++++-------- .../designer/widget/form/widgetSelect.vue | 2 +- 5 files changed, 112 insertions(+), 91 deletions(-) diff --git a/report-ui/src/mixins/queryform.js b/report-ui/src/mixins/queryform.js index 08d34140..ebf64a23 100644 --- a/report-ui/src/mixins/queryform.js +++ b/report-ui/src/mixins/queryform.js @@ -1,6 +1,5 @@ import miment from 'miment' -import {getData} from '@/api/bigscreen' - +import { getData } from '@/api/bigscreen' export default { data() { return { @@ -59,6 +58,7 @@ export default { }, computed: {}, created() { + }, mounted() { }, @@ -96,7 +96,7 @@ export default { // 查询echarts 数据 queryEchartsData(params) { return new Promise(async (resolve) => { - const {code, data} = await getData(params); + const { code, data } = await getData(params); if (code != 200) return const analysisData = this.analysisChartsData(params, data); resolve(analysisData) @@ -277,7 +277,7 @@ export default { // 字段名 const radarField = []; let nameField; - for(const key in chartProperties) { + for (const key in chartProperties) { if (chartProperties[key] == 'radar') { radarField.push(key) } diff --git a/report-ui/src/utils/screen.js b/report-ui/src/utils/screen.js index 68ce161d..af449527 100644 --- a/report-ui/src/utils/screen.js +++ b/report-ui/src/utils/screen.js @@ -1,3 +1,5 @@ +import { eventBus } from "@/utils/eventBus"; + export function setAssChartData(widgets, options) { const selectOptions = options.filter(item => item.uuid).map(item => { return { @@ -14,4 +16,19 @@ export function setAssChartData(widgets, options) { } }) }) +} + +export function eventBusParams(optionsSetup, optionsData, callback) { + eventBus.$on("eventParams", (formParams) => { + const uuid = optionsSetup.uuid; + if (formParams.assChart.includes(uuid)) { + const contextData = optionsData.dynamicData.contextData; + for (const key in contextData) { + if (formParams.hasOwnProperty(key)) { + contextData[key] = formParams[key]; + } + } + callback(optionsData.dynamicData, optionsSetup) + } + }); } \ No newline at end of file diff --git a/report-ui/src/views/bigscreenDesigner/designer/widget/bar/widgetBarchart.vue b/report-ui/src/views/bigscreenDesigner/designer/widget/bar/widgetBarchart.vue index aa8b1dbe..4dfe5eab 100644 --- a/report-ui/src/views/bigscreenDesigner/designer/widget/bar/widgetBarchart.vue +++ b/report-ui/src/views/bigscreenDesigner/designer/widget/bar/widgetBarchart.vue @@ -5,7 +5,7 @@ diff --git a/report-ui/src/views/bigscreenDesigner/designer/widget/form/widgetSelect.vue b/report-ui/src/views/bigscreenDesigner/designer/widget/form/widgetSelect.vue index 05741d7a..d1b57a8d 100644 --- a/report-ui/src/views/bigscreenDesigner/designer/widget/form/widgetSelect.vue +++ b/report-ui/src/views/bigscreenDesigner/designer/widget/form/widgetSelect.vue @@ -65,7 +65,7 @@ export default { const params = {}; params[optionsSetup.field] = event; params["assChart"] = optionsSetup.assChart; - eventBus.$emit("params", params); + eventBus.$emit("eventParams", params); }, }, };