|
|
@ -1,5 +1,6 @@
|
|
|
|
import miment from 'miment'
|
|
|
|
import miment from 'miment'
|
|
|
|
import {getData} from '@/api/bigscreen'
|
|
|
|
import {getData} from '@/api/bigscreen'
|
|
|
|
|
|
|
|
|
|
|
|
export default {
|
|
|
|
export default {
|
|
|
|
data() {
|
|
|
|
data() {
|
|
|
|
return {
|
|
|
|
return {
|
|
|
@ -56,8 +57,7 @@ export default {
|
|
|
|
},
|
|
|
|
},
|
|
|
|
}
|
|
|
|
}
|
|
|
|
},
|
|
|
|
},
|
|
|
|
computed: {
|
|
|
|
computed: {},
|
|
|
|
},
|
|
|
|
|
|
|
|
created() {
|
|
|
|
created() {
|
|
|
|
},
|
|
|
|
},
|
|
|
|
mounted() {
|
|
|
|
mounted() {
|
|
|
@ -104,8 +104,10 @@ export default {
|
|
|
|
},
|
|
|
|
},
|
|
|
|
// 解析不同图标的数据
|
|
|
|
// 解析不同图标的数据
|
|
|
|
analysisChartsData(params, data) {
|
|
|
|
analysisChartsData(params, data) {
|
|
|
|
// widget-barchart 柱线图、widget-linechart 折线图、 widget-barlinechart 柱线图、widget-piechart 饼图、widget-hollow-piechart 空心饼图
|
|
|
|
// widget-barchart 柱线图、widget-linechart 折线图、 widget-barlinechart 柱线图
|
|
|
|
// widget-funnel 漏斗图 widget-gauge 仪表盘
|
|
|
|
// widget-piechart 饼图、widget-hollow-piechart 空心饼图、widget-funnel 漏斗图
|
|
|
|
|
|
|
|
// widget-gauge 仪表盘
|
|
|
|
|
|
|
|
// widget-text 文本框
|
|
|
|
const chartType = params.chartType
|
|
|
|
const chartType = params.chartType
|
|
|
|
if (
|
|
|
|
if (
|
|
|
|
chartType == "widget-barchart" ||
|
|
|
|
chartType == "widget-barchart" ||
|
|
|
@ -121,7 +123,10 @@ export default {
|
|
|
|
return this.piechartFn(params.chartProperties, data);
|
|
|
|
return this.piechartFn(params.chartProperties, data);
|
|
|
|
} else if (chartType == "widget-gauge") {
|
|
|
|
} else if (chartType == "widget-gauge") {
|
|
|
|
return this.gaugeFn(params.chartProperties, data);
|
|
|
|
return this.gaugeFn(params.chartProperties, data);
|
|
|
|
|
|
|
|
} else if (chartType == "widget-text") {
|
|
|
|
|
|
|
|
return this.text(params.chartProperties, data)
|
|
|
|
} else {
|
|
|
|
} else {
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
},
|
|
|
|
},
|
|
|
|
// 柱状图、折线图、折柱图
|
|
|
|
// 柱状图、折线图、折柱图
|
|
|
@ -192,6 +197,23 @@ export default {
|
|
|
|
return ananysicData[0];
|
|
|
|
return ananysicData[0];
|
|
|
|
}
|
|
|
|
}
|
|
|
|
},
|
|
|
|
},
|
|
|
|
|
|
|
|
text(chartProperties, data) {
|
|
|
|
|
|
|
|
debugger
|
|
|
|
|
|
|
|
const ananysicData = [];
|
|
|
|
|
|
|
|
for (let i = 0; i < data.length; i++) {
|
|
|
|
|
|
|
|
const obj = {};
|
|
|
|
|
|
|
|
for (const key in chartProperties) {
|
|
|
|
|
|
|
|
const value = chartProperties[key];
|
|
|
|
|
|
|
|
if (value === "name") {
|
|
|
|
|
|
|
|
//obj["name"] = data[i][key];
|
|
|
|
|
|
|
|
} else {
|
|
|
|
|
|
|
|
obj["value"] = data[i][key];
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
ananysicData.push(obj);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
return ananysicData;
|
|
|
|
|
|
|
|
},
|
|
|
|
watch: {
|
|
|
|
watch: {
|
|
|
|
'selectInput.keyname'(newVal, oldVal) {
|
|
|
|
'selectInput.keyname'(newVal, oldVal) {
|
|
|
|
this.resetForm(this.params)
|
|
|
|
this.resetForm(this.params)
|
|
|
|