From c6fe59094e96e3ec49d27cee5916c79572b3d3b7 Mon Sep 17 00:00:00 2001 From: qianlishi Date: Fri, 28 Apr 2023 13:37:57 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../designer/linkageLogic.js | 16 +++++---- .../tools/configure/form/widget-form-time.js | 22 +++++++----- .../tools/configure/form/widget-input.js | 8 ----- .../tools/configure/form/widget-select.js | 8 ----- .../bigscreenDesigner/designer/tools/main.js | 10 +++--- .../designer/widget/bar/widgetBarchart.vue | 36 +++++++++++-------- .../designer/widget/form/widgetFormTime.vue | 11 +++--- .../designer/widget/form/widgetSelect.vue | 28 ++++++++++----- .../designer/widget/line/widgetLinechart.vue | 4 +++ 9 files changed, 78 insertions(+), 65 deletions(-) diff --git a/report-ui/src/views/bigscreenDesigner/designer/linkageLogic.js b/report-ui/src/views/bigscreenDesigner/designer/linkageLogic.js index b00bf3f6..185fb6b9 100644 --- a/report-ui/src/views/bigscreenDesigner/designer/linkageLogic.js +++ b/report-ui/src/views/bigscreenDesigner/designer/linkageLogic.js @@ -1,8 +1,8 @@ /* * @Author: chengsl * @Date: 2023-02-24 09:40:13 - * @LastEditors: chengsl - * @LastEditTime: 2023-02-24 13:12:24 + * @LastEditors: qianlishi qianlishi@anji-plus.com + * @LastEditTime: 2023-03-24 14:01:08 * @Description: 各联动组件的参数配置 参数paramsKey的值具体封装时再改 */ import { eventBus as bus } from "@/utils/eventBus"; @@ -30,11 +30,11 @@ export const lickageParamsConfig = [ }, ] -export const getOneConfigByCode = function(code) { +export const getOneConfigByCode = function (code) { return lickageParamsConfig.find(item => { return item.code === code }) } -export const getOneConfigByName = function(name) { +export const getOneConfigByName = function (name) { return lickageParamsConfig.find(item => { return item.name === name }) } @@ -47,20 +47,22 @@ export const getOneConfigByName = function(name) { * 1、v-chart 需添加 ref="myVChart" 以获取实例 * 2、 发消息发过去的对象 待封装配置动态兼容 */ -export const originWidgetLinkageLogic = function(self, isActiveClick = false, buttonConfig = {}) { +export const originWidgetLinkageLogic = function (self, isActiveClick = false, buttonConfig = {}) { // if (self.allComponentLinkage && self.allComponentLinkage.length && self.allComponentLinkage[self.widgetIndex].index !== -1 && self.allComponentLinkage[self.widgetIndex].linkageArr.length) { if (self.optionsSetup.componentLinkage && self.optionsSetup.componentLinkage.length) { if (isActiveClick) { // 主动触发 self.allComponentLinkage[self.widgetIndex].linkageArr.forEach(item => { + console.log(item) console.log(`bus_${item.originId}_${item.targetId}`, ' -联动逻辑点击-发送消息', buttonConfig) bus.$emit(`bus_${item.originId}_${item.targetId}`, buttonConfig.currentData) }) } else { // chart 组件 - self.$refs.myVChart.chart.on('click', function(params) { + self.$refs.myVChart.chart.on('click', function (params) { self.allComponentLinkage[self.widgetIndex].linkageArr.forEach(item => { console.log(`bus_${item.originId}_${item.targetId}`, ' -联动逻辑点击-发送消息', params) let message = {} const widgetConfigTemp = getOneConfigByCode(self.value.widgetCode) + console.log('widgetConfigTemp', widgetConfigTemp) if (widgetConfigTemp && widgetConfigTemp.paramsKey.length) { // 动态加载各组件的参数来封装 widgetConfigTemp.paramsKey.forEach(key => { message[key] = params[key] @@ -99,7 +101,7 @@ export const originWidgetLinkageLogic = function(self, isActiveClick = false, bu * @param self 组件实例对象 this * @returns */ -export const targetWidgetLinkageLogic = function(self) { +export const targetWidgetLinkageLogic = function (self) { const busEvents = [] // 有无有关联的组件 if (!self.allComponentLinkage || !self.allComponentLinkage.length) return diff --git a/report-ui/src/views/bigscreenDesigner/designer/tools/configure/form/widget-form-time.js b/report-ui/src/views/bigscreenDesigner/designer/tools/configure/form/widget-form-time.js index 5de9ded1..52d4d0a8 100644 --- a/report-ui/src/views/bigscreenDesigner/designer/tools/configure/form/widget-form-time.js +++ b/report-ui/src/views/bigscreenDesigner/designer/tools/configure/form/widget-form-time.js @@ -18,14 +18,6 @@ export const widgetFormTime = { placeholder: '', value: '时间筛选器', }, - { - type: 'el-input-text', - label: '字段属性值', - name: 'field', - required: false, - placeholder: '请输入', - value: '', - }, { type: 'vue-color', label: '字体颜色', @@ -54,7 +46,19 @@ export const widgetFormTime = { { code: 'focus', name: 'focus' }, ], value: 'change', - } + }, + [{ + name: '组件联动', + list: [ + { + type: 'componentLinkage', + label: '', + name: 'componentLinkage', + required: false, + value: [] + } + ] + }] ], data: [ { 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 f9fd4167..69d34436 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 @@ -14,14 +14,6 @@ export const widgetInput = { placeholder: '', value: '输入框', }, - { - type: 'el-input-text', - label: '字段属性值', - name: 'field', - required: false, - placeholder: '请输入', - value: '', - }, { type: 'vue-color', label: '字体颜色', diff --git a/report-ui/src/views/bigscreenDesigner/designer/tools/configure/form/widget-select.js b/report-ui/src/views/bigscreenDesigner/designer/tools/configure/form/widget-select.js index 76e47bb9..0f04e938 100644 --- a/report-ui/src/views/bigscreenDesigner/designer/tools/configure/form/widget-select.js +++ b/report-ui/src/views/bigscreenDesigner/designer/tools/configure/form/widget-select.js @@ -22,14 +22,6 @@ export const widgetSelect = { placeholder: '', value: '下拉框', }, - { - type: 'el-input-text', - label: '字段属性值', - name: 'field', - required: false, - placeholder: '请输入', - value: '', - }, { type: 'vue-color', label: '字体颜色', diff --git a/report-ui/src/views/bigscreenDesigner/designer/tools/main.js b/report-ui/src/views/bigscreenDesigner/designer/tools/main.js index a0532f86..d5bcd5e4 100644 --- a/report-ui/src/views/bigscreenDesigner/designer/tools/main.js +++ b/report-ui/src/views/bigscreenDesigner/designer/tools/main.js @@ -4,7 +4,7 @@ * @Author: qianlishi * @Date: 2021-08-29 07:46:46 * @LastEditors: qianlishi qianlishi@anji-plus.com - * @LastEditTime: 2023-03-06 16:03:17 + * @LastEditTime: 2023-04-19 09:22:37 */ import { widgetText } from "./configure/texts/widget-text" @@ -39,10 +39,10 @@ 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" +import { widgetScaleVertical } from "./configure/scaleCharts/widget-scale-vertical"; +import { widgetScaleHorizontal } from "./configure/scaleCharts/widget-scale-horizontal" export const widgetTool = [ // type=html类型的组件 @@ -80,6 +80,6 @@ export const widgetTool = [ widgetScaleVertical, widgetScaleHorizontal, widgetSelect, - widgetInput, + // widgetInput, widgetFormTime ] 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 9b11110b..e0011f61 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,10 @@