修改主页表信息

This commit is contained in:
ival 2019-08-21 09:14:54 +08:00
parent 72f1c63e22
commit d8e7965ffd
2 changed files with 41 additions and 160 deletions

View File

@ -3,9 +3,9 @@ export function getBaseUrl() {
let BASE_API;
if (process.env.NODE_ENV === 'development') {
// BASE_API = 'https://joylink.club/jlcloud';
// BASE_API = 'https://test.joylink.club/jlcloud';
BASE_API = 'https://test.joylink.club/jlcloud';
// BASE_API = 'http://192.168.3.5:9000'; // 袁琪
BASE_API = 'http://192.168.3.6:9000'; // 旭强
// BASE_API = 'http://192.168.3.6:9000'; // 旭强
// BASE_API = 'http://192.168.3.4:9000' // 琰培
} else {
BASE_API = process.env.VUE_APP_BASE_API;

View File

@ -28,7 +28,7 @@ export default {
return {
option: {
backgroundColor: '#F0F2F5',
title: [{
title: {
text: '',
subtext: '',
subtextStyle: {
@ -37,106 +37,34 @@ 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: '15%',
width: '45%',
bottom: '68%',
left: 10,
containLabel: true
}, {
top: '38%',
width: '45%',
bottom: '45%',
left: 10,
containLabel: true
}, {
top: '62%',
width: '45%',
bottom: '7%',
left: 10,
top: '17%',
width: '50%',
bottom: '5%',
left: 50,
containLabel: true
}],
xAxis: [{
type: 'value',
show: false,
minInterval: 1,
name: '权限(个)'
}, {
type: 'value',
show: false,
gridIndex: 1,
minInterval: 1,
name: '权限(个)'
}, {
type: 'value',
show: false,
gridIndex: 2,
minInterval: 1,
name: '权限(个)'
}],
yAxis: [{
xAxis: {
type: 'category',
show: false,
axisLabel: {
interval: 0,
rotate: 30
rotate: 60
},
splitLine: {
show: false
},
data: []
}, {
type: 'category',
},
yAxis: {
type: 'value',
show: false,
gridIndex: 1,
axisLabel: {
interval: 0,
rotate: 30
minInterval: 1,
name: '权限(个)'
},
splitLine: {
show: false
},
data: []
}, {
type: 'category',
show: false,
gridIndex: 2,
axisLabel: {
interval: 0,
rotate: 30
},
splitLine: {
show: false
},
data: []
}],
series: [{
type: 'bar',
z: 3,
@ -145,26 +73,6 @@ export default {
formatter: params => { return `${params.marker} ${params.name}: ${params.value}`; }
},
data: []
}, {
type: 'bar',
z: 3,
xAxisIndex: 1,
yAxisIndex: 1,
barWidth: 10,
tooltip: {
formatter: params => { return `${params.marker} ${params.name}: ${params.value}`; }
},
data: []
}, {
type: 'bar',
z: 3,
xAxisIndex: 2,
yAxisIndex: 2,
barWidth: 10,
tooltip: {
formatter: params => { return `${params.marker} ${params.name}: ${params.value}`; }
},
data: []
}, {
type: 'pie',
radius: [0, '70%'],
@ -211,77 +119,50 @@ export default {
},
async loadExamData(mapName) {
if (mapName) {
var permissionMap = {};
var permissionDict = {};
var permissionList = await this.$Dictionary.permissionType();
if (permissionList) {
(permissionList ||[]).forEach(elem => {
permissionMap[elem.code] = elem.name;
permissionDict[elem.code] = elem.name;
});
}
var lessonMap = {
var permissionMap = {
'ATS现地工作站-课程权限': 0,
'ATS行调工作站-课程权限': 0
};
var examMap = {
'ATS行调工作站-课程权限': 0,
'ATS现地工作站-考试权限': 0,
'ATS行调工作站-考试权限': 0
};
var simulationMap = {
'ATS行调工作站-考试权限': 0,
'ATS现地工作站-仿真权限': 0,
'ATS行调工作站-仿真权限': 0,
'综合演练云平台-仿真权限': 0,
'司机模拟驾驶系统-仿真权限': 0,
'大屏系统权限': 0
};
(this.permissionList.filter(elem => { return elem.mapName == mapName; })|| []).forEach(elem => {
switch (elem.type) {
case '01':
lessonMap[`${elem.mapProductName}-${permissionMap[elem.type]}`] = elem.remains;
break;
case '02':
examMap[`${elem.mapProductName}-${permissionMap[elem.type]}`] = elem.remains;
break;
case '03':
simulationMap[`${elem.mapProductName}-${permissionMap[elem.type]}`] = elem.remains;
break;
}
permissionMap[`${elem.mapProductName}-${permissionDict[elem.type]}`] = elem.remains;
});
const keys = [...Object.keys(lessonMap), ...Object.keys(examMap), ...Object.keys(simulationMap)];
const values = [...Object.values(lessonMap), ...Object.values(examMap), ...Object.values(simulationMap)];
const keys = Object.keys(permissionMap);
const values = Object.values(permissionMap);
const sum = values.reduce((total, num) => total + num);
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.title.text = `剩余权限分布图(${mapName}`;
this.option.title.subtext = `权限总计${sum}`;
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;
this.option.xAxis.show = true;
this.option.yAxis.show = true;
this.option.yAxis[0].data = Object.keys(lessonMap);
this.option.series[0].data = Object.values(lessonMap);
this.option.xAxis.data = keys;
this.option.yAxis[1].data = Object.keys(examMap);
this.option.series[1].data = Object.values(examMap);
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[0].data = values;
this.option.series[1].data = keys.map(name => { return {name, value: permissionMap[name]}; });
} else {
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 = [];
this.option.series[0].data = this.option.series[1].data = this.option.series[2].data = [];
this.option.title.text = `剩余权限分布图(暂无地图线路数据)`;
this.option.title.subtext = `权限总计0个`;
this.option.xAxis.show = false;
this.option.yAxis.show = false;
this.option.xAxis.data = [];
this.option.series[0].data = [];
this.option.series[1].data = [];
}
this.chart.setOption(this.option);