|
|
|
@ -5,8 +5,10 @@
|
|
|
|
|
</template>
|
|
|
|
|
|
|
|
|
|
<script>
|
|
|
|
|
import { originWidgetLinkageLogic, targetWidgetLinkageLogic } from '@/views/bigscreenDesigner/designer/linkageLogic'
|
|
|
|
|
import { eventBusParams } from "@/utils/screen";
|
|
|
|
|
import {
|
|
|
|
|
originWidgetLinkageLogic,
|
|
|
|
|
targetWidgetLinkageLogic,
|
|
|
|
|
} from "@/views/bigscreenDesigner/designer/linkageLogic";
|
|
|
|
|
export default {
|
|
|
|
|
name: "WidgetLinechart",
|
|
|
|
|
components: {},
|
|
|
|
@ -15,7 +17,7 @@ export default {
|
|
|
|
|
ispreview: Boolean,
|
|
|
|
|
widgetIndex: {
|
|
|
|
|
type: Number,
|
|
|
|
|
default: 0
|
|
|
|
|
default: 0,
|
|
|
|
|
}, // 当前组件,在工作区变量widgetInWorkbench中的索引
|
|
|
|
|
},
|
|
|
|
|
data() {
|
|
|
|
@ -82,8 +84,8 @@ export default {
|
|
|
|
|
};
|
|
|
|
|
},
|
|
|
|
|
allComponentLinkage() {
|
|
|
|
|
return this.$store.state.designer.allComponentLinkage
|
|
|
|
|
}
|
|
|
|
|
return this.$store.state.designer.allComponentLinkage;
|
|
|
|
|
},
|
|
|
|
|
},
|
|
|
|
|
watch: {
|
|
|
|
|
value: {
|
|
|
|
@ -103,16 +105,8 @@ export default {
|
|
|
|
|
this.optionsCollapse = this.value.collapse;
|
|
|
|
|
this.optionsSetup = this.value.setup;
|
|
|
|
|
this.editorOptions();
|
|
|
|
|
targetWidgetLinkageLogic(this) // 联动-目标组件逻辑
|
|
|
|
|
originWidgetLinkageLogic(this) // 联动-源组件逻辑
|
|
|
|
|
eventBusParams(
|
|
|
|
|
this.optionsSetup,
|
|
|
|
|
this.optionsData,
|
|
|
|
|
(dynamicData, optionsSetup) => {
|
|
|
|
|
console.log("dynamicData", dynamicData);
|
|
|
|
|
this.getEchartData(dynamicData, optionsSetup);
|
|
|
|
|
}
|
|
|
|
|
);
|
|
|
|
|
targetWidgetLinkageLogic(this); // 联动-目标组件逻辑
|
|
|
|
|
originWidgetLinkageLogic(this); // 联动-源组件逻辑
|
|
|
|
|
},
|
|
|
|
|
methods: {
|
|
|
|
|
// 修改图标options属性
|
|
|
|
@ -311,16 +305,20 @@ export default {
|
|
|
|
|
// 处理数据
|
|
|
|
|
setOptionsData(e, paramsConfig) {
|
|
|
|
|
const optionsData = this.optionsData; // 数据类型 静态 or 动态
|
|
|
|
|
optionsData.dynamicData = optionsData.dynamicData || {} // 兼容 dynamicData undefined
|
|
|
|
|
const myDynamicData = optionsData.dynamicData
|
|
|
|
|
clearInterval(this.flagInter) // 不管咋,先干掉上一次的定时任务,避免多跑
|
|
|
|
|
if (e && optionsData.dataType !== 'staticData' && Object.keys(myDynamicData.contextData).length) {
|
|
|
|
|
const keyArr = Object.keys(myDynamicData.contextData)
|
|
|
|
|
paramsConfig.forEach(conf => {
|
|
|
|
|
optionsData.dynamicData = optionsData.dynamicData || {}; // 兼容 dynamicData undefined
|
|
|
|
|
const myDynamicData = optionsData.dynamicData;
|
|
|
|
|
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]
|
|
|
|
|
myDynamicData.contextData[conf.targetKey] = e[conf.originKey];
|
|
|
|
|
}
|
|
|
|
|
})
|
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
optionsData.dataType == "staticData"
|
|
|
|
|
? this.staticDataFn(optionsData.staticData)
|
|
|
|
|