qianlishi 4 年之前
父節點
當前提交
ce6efacbbb

+ 2 - 1
report-ui/src/mixins/queryform.js

@@ -108,6 +108,7 @@ export default {
       // widget-piechart 饼图、widget-hollow-piechart 空心饼图、widget-funnel 漏斗图
       // widget-gauge 仪表盘
       // widget-text 文本框
+      // widge-table 表格(数据不要转)
       const chartType = params.chartType
       if (
         chartType == "widget-barchart" ||
@@ -126,7 +127,7 @@ export default {
       } else if (chartType == "widget-text") {
         return this.widgettext(params.chartProperties, data)
       } else {
-
+        return data
       }
     },
     // 柱状图、折线图、折柱图

+ 1 - 0
report-ui/src/views/report/bigscreen/designer/form/dynamicForm.vue

@@ -150,6 +150,7 @@
           <dynamic-add-table
             v-if="item.type == 'dynamic-add-table' && inputShow[item.name]"
             v-model="formData[item.name]"
+            :chart-type="item.chartType"
             @change="changed($event, item.name)"
           />
         </div>

+ 1 - 1
report-ui/src/views/report/bigscreen/designer/tools.js

@@ -1105,7 +1105,7 @@ const widgetTools = [
           placeholder: 'px',
           relactiveDom: 'dataType',
           relactiveDomValue: 'dynamicData',
-          chartType: 'widget-barchart',
+          chartType: 'widget-table',
           value: '',
         },
       ],

+ 21 - 2
report-ui/src/views/report/bigscreen/designer/widget/widgetTable.vue

@@ -129,13 +129,29 @@ export default {
       console.log(tableData);
       tableData.dataType == "staticData"
         ? this.handlerStaticData(tableData.staticData)
-        : this.handlerDymaicData();
+        : this.handlerDymaicData(tableData.dynamicData, tableData.refreshTime);
     },
     handlerStaticData(data) {
       console.log(data);
       this.list = data;
     },
-    handlerDymaicData() {},
+    handlerDymaicData(data, refreshTime) {
+      if (!data) return;
+      if (this.ispreview) {
+        this.getEchartData(data);
+        this.flagInter = setInterval(() => {
+          this.getEchartData(data);
+        }, refreshTime);
+      } else {
+        this.getEchartData(data);
+      }
+    },
+    getEchartData(val) {
+      const data = this.queryEchartsData(val);
+      data.then(res => {
+        this.list = res;
+      });
+    },
     // vue hack 之强制刷新组件
     hackResetFun() {
       this.hackReset = false;
@@ -174,6 +190,9 @@ export default {
   line-height: 50px;
   width: 100%;
 }
+.txtScroll-top .bd {
+  width: 100%;
+}
 .txtScroll-top .infoList li {
   height: 50px;
   line-height: 50px;