feat--词云图被联动

qianming 1 year ago
parent e853c62fac
commit 0c428eaf1e

@ -1,16 +1,19 @@
<template> <template>
<div :style="styleObj"> <div :style="styleObj">
<v-chart :options="options" autoresize /> <v-chart ref="myVChart" :options="options" autoresize />
</div> </div>
</template> </template>
<script> <script>
import wordCloud from "../../../../../../static/wordCloud/echarts-wordcloud.min.js"; import wordCloud from "../../../../../../static/wordCloud/echarts-wordcloud.min.js";
import { targetWidgetLinkageLogic } from "@/views/bigscreenDesigner/designer/linkageLogic";
export default { export default {
name: "widgetWordCloud", name: "widgetWordCloud",
components: {}, components: {},
props: { props: {
value: Object, value: Object,
ispreview: Boolean, ispreview: Boolean,
flagInter: null,
}, },
data() { data() {
return { return {
@ -67,6 +70,9 @@ export default {
background: this.optionsSetup.background, background: this.optionsSetup.background,
}; };
}, },
allComponentLinkage() {
return this.$store.state.designer.allComponentLinkage;
},
}, },
watch: { watch: {
value: { value: {
@ -86,6 +92,7 @@ export default {
this.optionsCollapse = this.value.setup; this.optionsCollapse = this.value.setup;
this.optionsSetup = this.value.setup; this.optionsSetup = this.value.setup;
this.editorOptions(); this.editorOptions();
targetWidgetLinkageLogic(this); // -
}, },
methods: { methods: {
// options // options
@ -148,8 +155,25 @@ export default {
this.options.tooltip = tooltip; this.options.tooltip = tooltip;
}, },
// //
setOptionsData() { setOptionsData(e, paramsConfig) {
const optionsData = this.optionsData; // or 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" optionsData.dataType == "staticData"
? this.staticDataFn(optionsData.staticData) ? this.staticDataFn(optionsData.staticData)
: this.dynamicDataFn(optionsData.dynamicData, optionsData.refreshTime); : this.dynamicDataFn(optionsData.dynamicData, optionsData.refreshTime);

Loading…
Cancel
Save