|
|
@ -5,8 +5,7 @@
|
|
|
|
</template>
|
|
|
|
</template>
|
|
|
|
|
|
|
|
|
|
|
|
<script>
|
|
|
|
<script>
|
|
|
|
import { targetWidgetLinkageLogic } from '@/views/bigscreenDesigner/designer/linkageLogic'
|
|
|
|
import { targetWidgetLinkageLogic } from "@/views/bigscreenDesigner/designer/linkageLogic";
|
|
|
|
import { eventBusParams } from "@/utils/screen";
|
|
|
|
|
|
|
|
let per = 60;
|
|
|
|
let per = 60;
|
|
|
|
export default {
|
|
|
|
export default {
|
|
|
|
name: "widgetPiePercentageChart", //百分比图参考:https://www.makeapie.com/editor.html?c=xFkzKG-bpl
|
|
|
|
name: "widgetPiePercentageChart", //百分比图参考:https://www.makeapie.com/editor.html?c=xFkzKG-bpl
|
|
|
@ -16,7 +15,7 @@ export default {
|
|
|
|
ispreview: Boolean,
|
|
|
|
ispreview: Boolean,
|
|
|
|
widgetIndex: {
|
|
|
|
widgetIndex: {
|
|
|
|
type: Number,
|
|
|
|
type: Number,
|
|
|
|
default: 0
|
|
|
|
default: 0,
|
|
|
|
}, // 当前组件,在工作区变量widgetInWorkbench中的索引
|
|
|
|
}, // 当前组件,在工作区变量widgetInWorkbench中的索引
|
|
|
|
},
|
|
|
|
},
|
|
|
|
data() {
|
|
|
|
data() {
|
|
|
@ -331,8 +330,8 @@ export default {
|
|
|
|
};
|
|
|
|
};
|
|
|
|
},
|
|
|
|
},
|
|
|
|
allComponentLinkage() {
|
|
|
|
allComponentLinkage() {
|
|
|
|
return this.$store.state.designer.allComponentLinkage
|
|
|
|
return this.$store.state.designer.allComponentLinkage;
|
|
|
|
}
|
|
|
|
},
|
|
|
|
},
|
|
|
|
},
|
|
|
|
watch: {
|
|
|
|
watch: {
|
|
|
|
value: {
|
|
|
|
value: {
|
|
|
@ -352,21 +351,13 @@ export default {
|
|
|
|
this.optionsCollapse = this.value.collapse;
|
|
|
|
this.optionsCollapse = this.value.collapse;
|
|
|
|
this.optionsSetup = this.value.setup;
|
|
|
|
this.optionsSetup = this.value.setup;
|
|
|
|
this.editorOptions();
|
|
|
|
this.editorOptions();
|
|
|
|
eventBusParams(
|
|
|
|
|
|
|
|
this.optionsSetup,
|
|
|
|
|
|
|
|
this.optionsData,
|
|
|
|
|
|
|
|
(dynamicData, optionsSetup) => {
|
|
|
|
|
|
|
|
console.log("dynamicData", dynamicData);
|
|
|
|
|
|
|
|
this.getEchartData(dynamicData, optionsSetup);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
);
|
|
|
|
|
|
|
|
},
|
|
|
|
},
|
|
|
|
mounted() {
|
|
|
|
mounted() {
|
|
|
|
/* setInterval(() => {
|
|
|
|
/* setInterval(() => {
|
|
|
|
this.angle = this.angle + 3
|
|
|
|
this.angle = this.angle + 3
|
|
|
|
myChart.setOption(options,true)
|
|
|
|
myChart.setOption(options,true)
|
|
|
|
}, 1000);*/
|
|
|
|
}, 1000);*/
|
|
|
|
targetWidgetLinkageLogic(this) // 联动-目标组件逻辑
|
|
|
|
targetWidgetLinkageLogic(this); // 联动-目标组件逻辑
|
|
|
|
},
|
|
|
|
},
|
|
|
|
methods: {
|
|
|
|
methods: {
|
|
|
|
//轴point设置
|
|
|
|
//轴point设置
|
|
|
@ -448,17 +439,21 @@ export default {
|
|
|
|
// 数据解析
|
|
|
|
// 数据解析
|
|
|
|
setOptionsData(e, paramsConfig) {
|
|
|
|
setOptionsData(e, paramsConfig) {
|
|
|
|
const optionsData = this.optionsData; // 数据类型 静态 or 动态
|
|
|
|
const optionsData = this.optionsData; // 数据类型 静态 or 动态
|
|
|
|
optionsData.dynamicData = optionsData.dynamicData || {} // 兼容 dynamicData undefined
|
|
|
|
optionsData.dynamicData = optionsData.dynamicData || {}; // 兼容 dynamicData undefined
|
|
|
|
|
|
|
|
|
|
|
|
const myDynamicData = optionsData.dynamicData
|
|
|
|
const myDynamicData = optionsData.dynamicData;
|
|
|
|
clearInterval(this.flagInter) // 不管咋,先干掉上一次的定时任务,避免多跑
|
|
|
|
clearInterval(this.flagInter); // 不管咋,先干掉上一次的定时任务,避免多跑
|
|
|
|
if (e && optionsData.dataType !== 'staticData' && Object.keys(myDynamicData.contextData).length) {
|
|
|
|
if (
|
|
|
|
const keyArr = Object.keys(myDynamicData.contextData)
|
|
|
|
e &&
|
|
|
|
paramsConfig.forEach(conf => {
|
|
|
|
optionsData.dataType !== "staticData" &&
|
|
|
|
|
|
|
|
Object.keys(myDynamicData.contextData).length
|
|
|
|
|
|
|
|
) {
|
|
|
|
|
|
|
|
const keyArr = Object.keys(myDynamicData.contextData);
|
|
|
|
|
|
|
|
paramsConfig.forEach((conf) => {
|
|
|
|
if (keyArr.includes(conf.targetKey)) {
|
|
|
|
if (keyArr.includes(conf.targetKey)) {
|
|
|
|
myDynamicData.contextData[conf.targetKey] = e[conf.originKey]
|
|
|
|
myDynamicData.contextData[conf.targetKey] = e[conf.originKey];
|
|
|
|
}
|
|
|
|
}
|
|
|
|
})
|
|
|
|
});
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
optionsData.dataType == "staticData"
|
|
|
|
optionsData.dataType == "staticData"
|
|
|
|