From 633718bc345c17b63b66d88dcdd6a024ce8c3894 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E8=83=A1=E6=9D=B0?= Date: Tue, 27 Jun 2023 15:53:13 +0800 Subject: [PATCH 1/2] =?UTF-8?q?Table=E6=94=AF=E6=8C=81=E8=81=94=E5=8A=A8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../designer/widget/texts/widgetTable.vue | 44 +++++++++++++++++++ 1 file changed, 44 insertions(+) diff --git a/report-ui/src/views/bigscreenDesigner/designer/widget/texts/widgetTable.vue b/report-ui/src/views/bigscreenDesigner/designer/widget/texts/widgetTable.vue index fc2afd72..1c14394f 100644 --- a/report-ui/src/views/bigscreenDesigner/designer/widget/texts/widgetTable.vue +++ b/report-ui/src/views/bigscreenDesigner/designer/widget/texts/widgetTable.vue @@ -41,6 +41,8 @@ import vue from "vue"; import VueSuperSlide from "vue-superslide"; +import {targetWidgetLinkageLogic} from "@/views/bigscreenDesigner/designer/linkageLogic"; + vue.use(VueSuperSlide); export default { props: { @@ -79,6 +81,10 @@ export default { top: allStyle.top + "px", background: this.optionsSetUp.tableBgColor }; + + }, + allComponentLinkage() { + return this.$store.state.designer.allComponentLinkage; }, headerTableStlye() { const headStyle = this.optionsSetUp; @@ -122,6 +128,7 @@ export default { this.optionsPosition = this.value.position; this.optionsData = this.value.data; this.initData(); + targetWidgetLinkageLogic(this); // 联动-目标组件逻辑 }, methods: { initData() { @@ -129,6 +136,7 @@ export default { this.handlerHead(); this.handlerData(); this.visConfig(); + this.setOptionsData(); }, visConfig() { this.options.vis = this.optionsSetUp.vis; @@ -209,7 +217,43 @@ export default { styleJson["width"] = this.optionsSetUp.dynamicAddTable[index].width; } return styleJson; + }, + // 数据解析 + setOptionsData(e, paramsConfig) { + const optionsData = this.optionsData; // 数据类型 静态 or 动态 + // 联动接收者逻辑开始 + optionsData.dynamicData = optionsData.dynamicData || {}; // 兼容 dynamicData undefined + const myDynamicData = optionsData.dynamicData; + console.log(this.optionsData) + clearInterval(this.flagInter); // 不管咋,先干掉上一次的定时任务,避免多跑 + if ( + e && + optionsData.dataType !== "staticData" && + Object.keys(myDynamicData.contextData).length + ) { + const keyArr = Object.keys(myDynamicData.contextData); + paramsConfig.forEach((conf) => { + if (keyArr.includes(conf.targetKey)) { + myDynamicData.contextData[conf.targetKey] = e[conf.originKey]; } + }); + } + // 联动接收者逻辑结束 + optionsData.dataType == "staticData" + ? this.staticDataFn(optionsData.staticData) + : this.dynamicDataFn(optionsData.dynamicData, optionsData.refreshTime); + }, + dynamicDataFn(val, refreshTime) { + if (!val) return; + if (this.ispreview) { + this.getEchartData(val); + this.flagInter = setInterval(() => { + this.getEchartData(val); + }, refreshTime); + } else { + this.getEchartData(val); + } + }, } }; -- Gitee From 0cff90d64d4a9c83ea024dc8c0c59a67c5c1c22d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E8=83=A1=E6=9D=B0?= Date: Tue, 27 Jun 2023 15:56:17 +0800 Subject: [PATCH 2/2] =?UTF-8?q?=E6=B7=BB=E5=8A=A0input=E6=A1=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../designer/linkageLogic.js | 5 ++++ .../tools/configure/form/widget-input.js | 13 ++++++++++ .../bigscreenDesigner/designer/tools/main.js | 4 +-- .../designer/widget/form/widgetInput.vue | 26 ++++++++++++++----- .../designer/widget/temp.vue | 2 +- .../designer/widget/widget.vue | 2 +- 6 files changed, 41 insertions(+), 11 deletions(-) diff --git a/report-ui/src/views/bigscreenDesigner/designer/linkageLogic.js b/report-ui/src/views/bigscreenDesigner/designer/linkageLogic.js index 7dea1d9d..6a754a61 100644 --- a/report-ui/src/views/bigscreenDesigner/designer/linkageLogic.js +++ b/report-ui/src/views/bigscreenDesigner/designer/linkageLogic.js @@ -17,6 +17,11 @@ export const lickageParamsConfig = [ code: 'widget-select', paramsKey: ['label','value'] }, + { + name: '输入框', + code: 'widget-input', + paramsKey: ['value'] + }, { name: '时间筛选器', code: 'widget-form-time', diff --git a/report-ui/src/views/bigscreenDesigner/designer/tools/configure/form/widget-input.js b/report-ui/src/views/bigscreenDesigner/designer/tools/configure/form/widget-input.js index db9854bd..cc2b7cc6 100644 --- a/report-ui/src/views/bigscreenDesigner/designer/tools/configure/form/widget-input.js +++ b/report-ui/src/views/bigscreenDesigner/designer/tools/configure/form/widget-input.js @@ -43,7 +43,20 @@ export const widgetInput = { ], value: 'change', }*/ + [{ + name: '组件联动', + list: [ + { + type: 'componentLinkage', + label: '', + name: 'componentLinkage', + required: false, + value: [] + } + ] + }] ], + data: [], position: [ { type: 'el-input-number', diff --git a/report-ui/src/views/bigscreenDesigner/designer/tools/main.js b/report-ui/src/views/bigscreenDesigner/designer/tools/main.js index c307dda2..b879335c 100644 --- a/report-ui/src/views/bigscreenDesigner/designer/tools/main.js +++ b/report-ui/src/views/bigscreenDesigner/designer/tools/main.js @@ -39,7 +39,7 @@ import { widgetHeatmap } from "./configure/heatmap/widget-heatmap"; import { widgetRadar } from "./configure/radarCharts/widget-radar"; import { widgetBarLineStack } from "./configure/barlineCharts/widget-bar-line-stack"; import { widgetSelect } from "./configure/form/widget-select"; -// import { widgetInput } from "./configure/form/widget-input"; +import { widgetInput } from "./configure/form/widget-input"; import { widgetFormTime } from "./configure/form/widget-form-time"; import { widgetScaleVertical } from "./configure/scaleCharts/widget-scale-vertical"; import { widgetScaleHorizontal } from "./configure/scaleCharts/widget-scale-horizontal" @@ -85,7 +85,7 @@ export const widgetTool = [ widgetScaleVertical, widgetScaleHorizontal, widgetSelect, - // widgetInput, + widgetInput, widgetFormTime, widgetBarDoubleYaxis, ] diff --git a/report-ui/src/views/bigscreenDesigner/designer/widget/form/widgetInput.vue b/report-ui/src/views/bigscreenDesigner/designer/widget/form/widgetInput.vue index 7e392d35..e5f903c1 100644 --- a/report-ui/src/views/bigscreenDesigner/designer/widget/form/widgetInput.vue +++ b/report-ui/src/views/bigscreenDesigner/designer/widget/form/widgetInput.vue @@ -8,13 +8,19 @@ />