|
@@ -1,6 +1,6 @@
|
|
<template>
|
|
<template>
|
|
<div :style="styleObj">
|
|
<div :style="styleObj">
|
|
- <v-chart ref="myVChart" :option="options" autoresize/>
|
|
|
|
|
|
+ <v-chart v-if="vChartVisible" ref="myVChart" :option="options" autoresize/>
|
|
</div>
|
|
</div>
|
|
</template>
|
|
</template>
|
|
|
|
|
|
@@ -8,7 +8,7 @@
|
|
import {targetWidgetLinkageLogic} from "@/views/bigscreenDesigner/designer/linkageLogic";
|
|
import {targetWidgetLinkageLogic} from "@/views/bigscreenDesigner/designer/linkageLogic";
|
|
|
|
|
|
export default {
|
|
export default {
|
|
- name: "WidgetBarStackchart",
|
|
|
|
|
|
+ name: "WidgetLineStackChart",
|
|
components: {},
|
|
components: {},
|
|
props: {
|
|
props: {
|
|
value: Object,
|
|
value: Object,
|
|
@@ -16,6 +16,7 @@ export default {
|
|
},
|
|
},
|
|
data() {
|
|
data() {
|
|
return {
|
|
return {
|
|
|
|
+ vChartVisible: true,
|
|
options: {
|
|
options: {
|
|
grid: {},
|
|
grid: {},
|
|
legend: {
|
|
legend: {
|
|
@@ -336,7 +337,7 @@ export default {
|
|
const series = this.options.series;
|
|
const series = this.options.series;
|
|
const legendName = optionsSetup.legendName;
|
|
const legendName = optionsSetup.legendName;
|
|
// 图例没有手动写则显示原值,写了则显示新值
|
|
// 图例没有手动写则显示原值,写了则显示新值
|
|
- if (null == legendName || legendName == "") {
|
|
|
|
|
|
+ if (null == legendName || legendName === "") {
|
|
for (let i = 0; i < name.length; i++) {
|
|
for (let i = 0; i < name.length; i++) {
|
|
series[i].name = name[i];
|
|
series[i].name = name[i];
|
|
}
|
|
}
|
|
@@ -383,7 +384,7 @@ export default {
|
|
});
|
|
});
|
|
}
|
|
}
|
|
// 联动接收者逻辑结束
|
|
// 联动接收者逻辑结束
|
|
- optionsData.dataType == "staticData"
|
|
|
|
|
|
+ optionsData.dataType === "staticData"
|
|
? this.staticDataFn(optionsData.staticData, optionsSetup)
|
|
? this.staticDataFn(optionsData.staticData, optionsSetup)
|
|
: this.dynamicDataFn(
|
|
: this.dynamicDataFn(
|
|
optionsData.dynamicData,
|
|
optionsData.dynamicData,
|
|
@@ -423,8 +424,8 @@ export default {
|
|
const data = new Array(xAxisList.length).fill(0);
|
|
const data = new Array(xAxisList.length).fill(0);
|
|
for (const j in xAxisList) {
|
|
for (const j in xAxisList) {
|
|
for (const k in val) {
|
|
for (const k in val) {
|
|
- if (val[k].name == yAxisList[i]) {
|
|
|
|
- if (val[k].axis == xAxisList[j]) {
|
|
|
|
|
|
+ if (val[k].name === yAxisList[i]) {
|
|
|
|
+ if (val[k].axis === xAxisList[j]) {
|
|
data[j] = val[k].data;
|
|
data[j] = val[k].data;
|
|
}
|
|
}
|
|
}
|
|
}
|
|
@@ -548,7 +549,7 @@ export default {
|
|
const series = [];
|
|
const series = [];
|
|
const legendName = [];
|
|
const legendName = [];
|
|
for (const i in val.series) {
|
|
for (const i in val.series) {
|
|
- if (val.series[i].type == "line") {
|
|
|
|
|
|
+ if (val.series[i].type === "line") {
|
|
series.push({
|
|
series.push({
|
|
name: val.series[i].name,
|
|
name: val.series[i].name,
|
|
type: "line",
|
|
type: "line",
|
|
@@ -618,6 +619,10 @@ export default {
|
|
this.options.series = series;
|
|
this.options.series = series;
|
|
this.options.legend["data"] = legendName;
|
|
this.options.legend["data"] = legendName;
|
|
this.setOptionsLegendName(legendName);
|
|
this.setOptionsLegendName(legendName);
|
|
|
|
+ this.vChartVisible = false
|
|
|
|
+ this.$nextTick(() => {
|
|
|
|
+ this.vChartVisible = true
|
|
|
|
+ })
|
|
},
|
|
},
|
|
},
|
|
},
|
|
};
|
|
};
|