feat--仪表盘被联动

qianming 1 year ago
parent 3703ece9ed
commit 349e3f3a66

@ -162,18 +162,6 @@ export const widgetPiePercentage = {
value: '#173164'
},
]
},
{
name: '组件联动',
list: [
{
type: 'componentLinkage',
label: '',
name: 'componentLinkage',
required: false,
value: []
}
]
}
],
],

@ -1,11 +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 {targetWidgetLinkageLogic} from "@/views/bigscreenDesigner/designer/linkageLogic";
export default {
name: "WidgetGauge",
@ -13,6 +14,7 @@ export default {
props: {
value: Object,
ispreview: Boolean,
flagInter: null,
},
data() {
return {
@ -139,6 +141,9 @@ export default {
background: this.optionsSetup.background,
};
},
allComponentLinkage() {
return this.$store.state.designer.allComponentLinkage;
},
},
watch: {
value: {
@ -159,6 +164,9 @@ export default {
this.optionsSetup = this.value.setup;
this.editorOptions();
},
mounted() {
targetWidgetLinkageLogic(this);
},
methods: {
editorOptions() {
this.setOptions();
@ -268,8 +276,25 @@ export default {
series[0].detail = detail;
}
},
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);

Loading…
Cancel
Save