界面调整

This commit is contained in:
ival 2019-08-19 09:15:25 +08:00
parent 44aa6442f0
commit 54425befb2

View File

@ -28,7 +28,7 @@ export default {
return {
option: {
backgroundColor: '#F0F2F5',
title: {
title: [{
text: '',
subtext: '',
subtextStyle: {
@ -37,42 +37,69 @@ export default {
y: 10,
left: 'center',
textAlign: 'center'
},
}, {
top: '12%',
left: '25%',
text: '',
textStyle: {
fontSize: 14,
fontWeight: 'normal'
}
}, {
top: '35%',
left: '25%',
text: '',
textStyle: {
fontSize: 14,
fontWeight: 'normal'
}
}, {
top: '58%',
left: '25%',
text: '',
textStyle: {
fontSize: 14,
fontWeight: 'normal'
}
}],
tooltip: {
},
grid: [{
top: '12%',
top: '15%',
width: '45%',
bottom: '70%',
bottom: '68%',
left: 10,
containLabel: true
},{
top: '40%',
}, {
top: '38%',
width: '45%',
bottom: '42%',
bottom: '45%',
left: 10,
containLabel: true
},{
top: '65%',
}, {
top: '62%',
width: '45%',
bottom: '10%',
bottom: '7%',
left: 10,
containLabel: true
}],
xAxis: [{
type: 'value',
show: false,
minInterval: 1
minInterval: 1,
name: '权限(个)'
}, {
type: 'value',
show: false,
gridIndex: 1,
minInterval: 1
minInterval: 1,
name: '权限(个)'
}, {
type: 'value',
show: false,
gridIndex: 2,
minInterval: 1
minInterval: 1,
name: '权限(个)'
}],
yAxis: [{
type: 'category',
@ -141,7 +168,7 @@ export default {
}, {
type: 'pie',
radius: [0, '70%'],
center: ['73%', '52%'],
center: ['75%', '52%'],
tooltip: {
formatter: params => { return `${params.marker} ${params.name}: ${params.percent}%`; }
},
@ -195,11 +222,11 @@ export default {
var lessonMap = {
'ATS现地工作站-课程权限': 0,
'ATS行调工作站-课程权限': 0,
'ATS行调工作站-课程权限': 0
};
var examMap = {
'ATS现地工作站-考试权限': 0,
'ATS行调工作站-考试权限': 0,
'ATS行调工作站-考试权限': 0
};
var simulationMap = {
'ATS现地工作站-仿真权限': 0,
@ -226,8 +253,11 @@ export default {
const values = [...Object.values(lessonMap), ...Object.values(examMap), ...Object.values(simulationMap)];
const sum = values.reduce((total, num) => total + num);
this.option.title.text = `剩余权限分布图(${mapName}`;
this.option.title.subtext = `权限总计${sum}`;
this.option.title[0].text = `剩余权限分布图(${mapName}`;
this.option.title[0].subtext = `权限总计${sum}`;
this.option.title[1].text = `课程权限`;
this.option.title[2].text = `考试权限`;
this.option.title[3].text = `仿真权限`;
this.option.xAxis[0].show = this.option.xAxis[1].show = this.option.xAxis[2].show = true;
this.option.yAxis[0].show = this.option.yAxis[1].show = this.option.yAxis[2].show = true;
@ -241,10 +271,13 @@ export default {
this.option.yAxis[2].data = Object.keys(simulationMap);
this.option.series[2].data = Object.values(simulationMap);
this.option.series[3].data = keys.map((name,index) => { return {name, value: values[index]}; });
this.option.series[3].data = keys.map((name, index) => { return {name, value: values[index]}; });
} else {
this.option.title.text = `剩余权限分布图(暂无地图线路数据)`;
this.option.title.subtext = `权限总计0个`;
this.option.title[0].text = `剩余权限分布图(暂无地图线路数据)`;
this.option.title[0].subtext = `权限总计0个`;
this.option.title[1].text = ``;
this.option.title[2].text = ``;
this.option.title[3].text = ``;
this.option.xAxis[0].show = this.option.xAxis[1].show = this.option.xAxis[2].show = false;
this.option.yAxis[0].show = this.option.yAxis[1].show = this.option.yAxis[2].show = false;
this.option.yAxis[0].data = this.option.yAxis[1].data = this.option.yAxis[2].data = [];