|
|
|
@ -1,12 +1,12 @@
|
|
|
|
|
<template>
|
|
|
|
|
<div :style="styleObj">
|
|
|
|
|
<v-chart :options="options" autoresize/>
|
|
|
|
|
<v-chart ref="myVChart" :options="options" autoresize/>
|
|
|
|
|
</div>
|
|
|
|
|
</template>
|
|
|
|
|
|
|
|
|
|
<script>
|
|
|
|
|
import echarts from "echarts";
|
|
|
|
|
import {eventBusParams} from "@/utils/screen";
|
|
|
|
|
import { targetWidgetLinkageLogic } from "@/views/bigscreenDesigner/designer/linkageLogic";
|
|
|
|
|
|
|
|
|
|
let scale = [];
|
|
|
|
|
let max;
|
|
|
|
@ -19,6 +19,7 @@ export default {
|
|
|
|
|
props: {
|
|
|
|
|
value: Object,
|
|
|
|
|
ispreview: Boolean,
|
|
|
|
|
flagInter: null,
|
|
|
|
|
},
|
|
|
|
|
data() {
|
|
|
|
|
return {
|
|
|
|
@ -206,6 +207,9 @@ export default {
|
|
|
|
|
background: this.optionsSetup.background,
|
|
|
|
|
};
|
|
|
|
|
},
|
|
|
|
|
allComponentLinkage() {
|
|
|
|
|
return this.$store.state.designer.allComponentLinkage;
|
|
|
|
|
},
|
|
|
|
|
},
|
|
|
|
|
watch: {
|
|
|
|
|
value: {
|
|
|
|
@ -225,13 +229,7 @@ export default {
|
|
|
|
|
this.optionsCollapse = this.value.collapse;
|
|
|
|
|
this.optionsSetup = this.value.setup;
|
|
|
|
|
this.editorOptions();
|
|
|
|
|
eventBusParams(
|
|
|
|
|
this.optionsSetup,
|
|
|
|
|
this.optionsData,
|
|
|
|
|
(dynamicData, optionsSetup) => {
|
|
|
|
|
this.getEchartData(dynamicData, optionsSetup);
|
|
|
|
|
}
|
|
|
|
|
);
|
|
|
|
|
targetWidgetLinkageLogic(this); // 联动-目标组件逻辑
|
|
|
|
|
},
|
|
|
|
|
methods: {
|
|
|
|
|
// 修改图标options属性
|
|
|
|
@ -448,8 +446,24 @@ export default {
|
|
|
|
|
};
|
|
|
|
|
this.options.grid = grid;
|
|
|
|
|
},
|
|
|
|
|
setOptionsData() {
|
|
|
|
|
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) => {
|
|
|
|
|
if (keyArr.includes(conf.targetKey)) {
|
|
|
|
|
myDynamicData.contextData[conf.targetKey] = e[conf.originKey];
|
|
|
|
|
}
|
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
optionsData.dataType == "staticData"
|
|
|
|
|
? this.staticDataFn(optionsData.staticData)
|
|
|
|
|
: this.dynamicDataFn(optionsData.dynamicData, optionsData.refreshTime);
|
|
|
|
|