修改主页配置

This commit is contained in:
ival 2019-08-16 18:59:19 +08:00
parent 9648263a88
commit c99394ea51

View File

@ -77,6 +77,36 @@ export default {
formatter: params => { return `${params.marker} ${params.name}: ${params.value}`; }
},
data: []
}, {
type: 'bar',
stack: 'chart',
z: 3,
label: {
normal: {
show: true,
position: 'right'
}
},
barWidth: 30,
tooltip: {
formatter: params => { return `${params.marker} ${params.name}: ${params.value}`; }
},
data: []
}, {
type: 'bar',
stack: 'chart',
z: 3,
label: {
normal: {
show: true,
position: 'right'
}
},
barWidth: 30,
tooltip: {
formatter: params => { return `${params.marker} ${params.name}: ${params.value}`; }
},
data: []
}, {
type: 'pie',
radius: [0, '70%'],
@ -123,17 +153,28 @@ export default {
},
async loadExamData(mapName) {
if (mapName) {
var data = {};
var permissionType = {};
var list = await this.$Dictionary.permissionType();
if (list) {
(list ||[]).forEach(elem => {
permissionType[elem.code] = elem.name;
var data = {
'ATS现地工作站-课程权限': 0,
'ATS现地工作站-考试权限': 0,
'ATS现地工作站-仿真权限': 0,
'ATS行调工作站-课程权限': 0,
'ATS行调工作站-考试权限': 0,
'ATS行调工作站-仿真权限': 0,
'综合演练云平台-仿真权限': 0,
'司机模拟驾驶系统-仿真权限': 0,
'大屏系统权限': 0
};
var permissionMap = {};
var permissionList = await this.$Dictionary.permissionType();
if (permissionList) {
(permissionList ||[]).forEach(elem => {
permissionMap[elem.code] = elem.name;
});
}
(this.permissionList.filter(elem => { return elem.mapName == mapName; })|| []).forEach(elem => {
data[`${elem.mapProductName}-${permissionType[elem.type]}`] = elem.remains;
data[`${elem.mapProductName}-${permissionMap[elem.type]}`] = elem.remains;
});
const keys = Object.keys(data);
@ -144,8 +185,9 @@ export default {
this.option.xAxis.show = true;
this.option.yAxis.show = true;
this.option.yAxis.data = keys;
// ['ATS', 'ATS', '', '', ''];
this.option.series[0].data = values;
this.option.series[1].data = keys.map(name => { return {name, value: data[name]}; });
this.option.series[3].data = keys.map(name => { return {name, value: data[name]}; });
} else {
this.option.xAxis.show = false;
this.option.yAxis.show = false;