You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
39 lines
900 B
39 lines
900 B
// import lineChart from '../../utils/chart/lineChart';
|
|
// import { pieChart, homePanelChart } from '../../utils/chart/pieChart';
|
|
// import { barChart } from '../../utils/chart/barChart';
|
|
import chartMap from "@/utils/chart";
|
|
|
|
// eslint-disable-next-line
|
|
Component({
|
|
properties: {
|
|
simpleChart: Boolean,
|
|
chartData: {
|
|
type: Array,
|
|
observer: function (val) {
|
|
this.setData({
|
|
opts: [],
|
|
});
|
|
const opts = val.map((item, idx) => {
|
|
const onInit = chartMap[item.config.chartType] && chartMap[item.config.chartType](item)
|
|
return {
|
|
key: `c${item.key || idx}`,
|
|
config: item.config,
|
|
onInit,
|
|
};
|
|
});
|
|
|
|
this.setData({
|
|
opts
|
|
});
|
|
},
|
|
},
|
|
},
|
|
/**
|
|
* 页面的初始数据
|
|
*/
|
|
data: {
|
|
opts: [],
|
|
},
|
|
attached: function () {},
|
|
methods: {},
|
|
});
|