|
@@ -40,12 +40,15 @@
|
|
<script>
|
|
<script>
|
|
import vue from "vue";
|
|
import vue from "vue";
|
|
import VueSuperSlide from "vue-superslide";
|
|
import VueSuperSlide from "vue-superslide";
|
|
|
|
+import { targetWidgetLinkageLogic } from "@/views/bigscreenDesigner/designer/linkageLogic";
|
|
|
|
|
|
vue.use(VueSuperSlide);
|
|
vue.use(VueSuperSlide);
|
|
export default {
|
|
export default {
|
|
|
|
+ name: 'widgetTable',
|
|
|
|
+ components: {},
|
|
props: {
|
|
props: {
|
|
value: Object,
|
|
value: Object,
|
|
- ispreview: Boolean
|
|
|
|
|
|
+ ispreview: Boolean,
|
|
},
|
|
},
|
|
data() {
|
|
data() {
|
|
return {
|
|
return {
|
|
@@ -64,7 +67,8 @@ export default {
|
|
list: [],
|
|
list: [],
|
|
optionsSetUp: {},
|
|
optionsSetUp: {},
|
|
optionsPosition: {},
|
|
optionsPosition: {},
|
|
- optionsData: {}
|
|
|
|
|
|
+ optionsData: {},
|
|
|
|
+ flagInter: null,
|
|
};
|
|
};
|
|
},
|
|
},
|
|
computed: {
|
|
computed: {
|
|
@@ -80,6 +84,9 @@ export default {
|
|
background: this.optionsSetUp.tableBgColor
|
|
background: this.optionsSetUp.tableBgColor
|
|
};
|
|
};
|
|
},
|
|
},
|
|
|
|
+ allComponentLinkage() {
|
|
|
|
+ return this.$store.state.designer.allComponentLinkage;
|
|
|
|
+ },
|
|
headerTableStlye() {
|
|
headerTableStlye() {
|
|
const headStyle = this.optionsSetUp;
|
|
const headStyle = this.optionsSetUp;
|
|
return {
|
|
return {
|
|
@@ -122,12 +129,13 @@ export default {
|
|
this.optionsPosition = this.value.position;
|
|
this.optionsPosition = this.value.position;
|
|
this.optionsData = this.value.data;
|
|
this.optionsData = this.value.data;
|
|
this.initData();
|
|
this.initData();
|
|
|
|
+ targetWidgetLinkageLogic(this); // 联动-目标组件逻辑
|
|
},
|
|
},
|
|
methods: {
|
|
methods: {
|
|
initData() {
|
|
initData() {
|
|
this.handlerRollFn();
|
|
this.handlerRollFn();
|
|
this.handlerHead();
|
|
this.handlerHead();
|
|
- this.handlerData();
|
|
|
|
|
|
+ this.setOptionsData();
|
|
this.visConfig();
|
|
this.visConfig();
|
|
},
|
|
},
|
|
visConfig() {
|
|
visConfig() {
|
|
@@ -148,8 +156,25 @@ export default {
|
|
const head = this.optionsSetUp.dynamicAddTable;
|
|
const head = this.optionsSetUp.dynamicAddTable;
|
|
this.header = head;
|
|
this.header = head;
|
|
},
|
|
},
|
|
- handlerData() {
|
|
|
|
|
|
+ setOptionsData(e, paramsConfig) {
|
|
const tableData = this.optionsData;
|
|
const tableData = this.optionsData;
|
|
|
|
+ tableData.dynamicData = tableData.dynamicData || {}; // 兼容 dynamicData undefined
|
|
|
|
+
|
|
|
|
+ const myDynamicData = tableData.dynamicData;
|
|
|
|
+ clearInterval(this.flagInter); // 不管咋,先干掉上一次的定时任务,避免多跑
|
|
|
|
+ if (
|
|
|
|
+ e &&
|
|
|
|
+ tableData.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];
|
|
|
|
+ }
|
|
|
|
+ });
|
|
|
|
+ }
|
|
|
|
+
|
|
tableData.dataType == "staticData"
|
|
tableData.dataType == "staticData"
|
|
? this.handlerStaticData(tableData.staticData)
|
|
? this.handlerStaticData(tableData.staticData)
|
|
: this.handlerDynamicData(tableData.dynamicData, tableData.refreshTime);
|
|
: this.handlerDynamicData(tableData.dynamicData, tableData.refreshTime);
|