Browse Source

大屏组件-文本框组件增加“拼接内容”配置项

qianming 6 months ago
parent
commit
b4e280539b

+ 8 - 0
report-ui/src/views/bigscreenDesigner/designer/tools/configure/texts/widget-marquee.js

@@ -31,6 +31,14 @@ export const widgetMarquee = {
         placeholder: '',
         value: '滚动文本',
       },
+      {
+        type: 'el-input-text',
+        label: '拼接内容',
+        name: 'joinText',
+        required: false,
+        placeholder: '',
+        value: "",
+      },
       {
         type: 'el-input-number',
         label: '字体字号',

+ 8 - 0
report-ui/src/views/bigscreenDesigner/designer/tools/configure/texts/widget-text.js

@@ -31,6 +31,14 @@ export const widgetText = {
         placeholder: '',
         value: '文本框',
       },
+      {
+        type: 'el-input-text',
+        label: '拼接内容',
+        name: 'joinText',
+        required: false,
+        placeholder: '',
+        value: "",
+      },
       {
         type: 'el-input-number',
         label: '字体字号',

+ 4 - 1
report-ui/src/views/bigscreenDesigner/designer/widget/form/widgetSelect.vue

@@ -84,7 +84,7 @@ export default {
     },
     setOptions() {
       const optionsData = this.optionsData;
-      return optionsData.dataType == "staticData"
+      return optionsData.dataType === "staticData"
         ? this.staticData(optionsData.staticData)
         : this.dynamicDataFn(optionsData.dynamicData, optionsData.refreshTime);
     },
@@ -128,6 +128,9 @@ export default {
         color: inherit;
         &::placeholder {
           color: inherit;
+          font-size: 16px;
+          font-weight: normal;
+          font-family: sans-serif;
         }
       }
     }

+ 7 - 3
report-ui/src/views/bigscreenDesigner/designer/widget/texts/widgetMarquee.vue

@@ -19,6 +19,8 @@ export default {
   data() {
     return {
       options: {},
+      optionsData: {},
+      optionsSetup: {},
       flagInter: null,
     };
   },
@@ -31,7 +33,7 @@ export default {
         position: this.ispreview ? "absolute" : "static",
         color: this.transStyle.color,
         "font-weight": this.transStyle.fontWeight,
-        text: this.transStyle.text,
+        text:  this.transStyle.joinText === "" ? this.transStyle.text : this.transStyle.text + this.transStyle.joinText,
         "font-size": this.transStyle.fontSize + "px",
         "letter-spacing": this.transStyle.letterSpacing + "em",
         background: this.transStyle.background,
@@ -57,6 +59,7 @@ export default {
       handler(val) {
         this.options = val;
         this.optionsData = val.data;
+        this.optionsSetup = val.setup;
         this.setOptionsData();
       },
       deep: true
@@ -65,6 +68,7 @@ export default {
   mounted() {
     this.options = this.value;
     this.optionsData = this.value.data;
+    this.optionsSetup = this.value.setup;
     targetWidgetLinkageLogic(this); // 联动-目标组件逻辑
     this.setOptionsData();
   },
@@ -89,7 +93,7 @@ export default {
         });
       }
       // 联动接收者逻辑结束
-      if (optionsData.dataType == "dynamicData") {
+      if (optionsData.dataType === "dynamicData") {
         this.dynamicDataFn(optionsData.dynamicData, optionsData.refreshTime);
       } else {};
     },
@@ -107,7 +111,7 @@ export default {
     getEchartData(val) {
       const data = this.queryEchartsData(val);
       data.then(res => {
-        this.styleColor.text = res[0].value;
+        this.styleColor.text = this.optionsSetup.joinText === "" ? res[0].value : res[0].value + this.optionsSetup.joinText;
         this.$forceUpdate();
       });
     }

+ 6 - 3
report-ui/src/views/bigscreenDesigner/designer/widget/texts/widgetText.vue

@@ -21,6 +21,7 @@ export default {
     return {
       options: {},
       optionsData: {},
+      optionsSetup: {},
       flagInter: null,
     };
   },
@@ -33,7 +34,7 @@ export default {
         position: this.ispreview ? "absolute" : "static",
         color: this.transStyle.color,
         "font-weight": this.transStyle.fontWeight,
-        text: this.transStyle.text,
+        text:  this.transStyle.joinText === "" ? this.transStyle.text : this.transStyle.text + this.transStyle.joinText,
         "font-size": this.transStyle.fontSize + "px",
         "letter-spacing": this.transStyle.letterSpacing + "em",
         background: this.transStyle.background,
@@ -55,6 +56,7 @@ export default {
       handler(val) {
         this.options = val;
         this.optionsData = val.data;
+        this.optionsSetup = val.setup;
         this.setOptionsData();
       },
       deep: true
@@ -63,6 +65,7 @@ export default {
   mounted() {
     this.options = this.value;
     this.optionsData = this.value.data;
+    this.optionsSetup = this.value.setup;
     targetWidgetLinkageLogic(this); // 联动-目标组件逻辑
     this.setOptionsData();
   },
@@ -87,7 +90,7 @@ export default {
         });
       }
       // 联动接收者逻辑结束
-      if (optionsData.dataType == "dynamicData") {
+      if (optionsData.dataType === "dynamicData") {
         this.dynamicDataFn(optionsData.dynamicData, optionsData.refreshTime);
       } else {};
     },
@@ -105,7 +108,7 @@ export default {
     getEchartData(val) {
       const data = this.queryEchartsData(val);
       data.then(res => {
-        this.styleColor.text = res[0].value;
+        this.styleColor.text = this.optionsSetup.joinText === "" ? res[0].value : res[0].value + this.optionsSetup.joinText;
         this.$forceUpdate();
       });
     }