增加iscs系统,调整成都一号线运行图导入

This commit is contained in:
zyy 2020-01-17 15:31:58 +08:00
parent d4b352d4ba
commit e4b20395c4
8 changed files with 166 additions and 36 deletions

View File

@ -73,5 +73,6 @@ export default {
commandDictionary: 'Command dictionary',
configLine: 'Line management',
deviceManage: 'Device management',
iscsDraw: 'Iscs Draw'
iscsDraw: 'Iscs Draw',
iscsSystem: 'Iscs System'
};

View File

@ -74,5 +74,6 @@ export default {
commandDictionary: '指令字典',
configLine: '线路管理',
deviceManage: '设备管理',
iscsDraw: 'Iscs绘制'
iscsDraw: 'Iscs绘制',
iscsSystem: 'Iscs系统'
};

View File

@ -14,10 +14,10 @@ export default {
ExcelConfig: {
beginRow: 1,
beginCol: 0,
fieldNum: 8,
fieldNum: 10,
sepField: '车次',
columns: {
'车站名': { key: 'stationName', formatter: (val) => { return val; } },
'车站名': { key: 'stationName', formatter: (val) => { return val; } },
'到点': { key: 'arriveTime', formatter: (val) => { return val; } },
'发点': { key: 'departureTime', formatter: (val) => { return val; } }
}
@ -25,31 +25,40 @@ export default {
/** 解析exal数据转换为Json后台数据*/
importData(Sheet, JsonData) {
var dataList = convertSheetToList(Sheet, false);
var dataList = convertSheetToList(Sheet, true);
var needList = Object.keys(this.ExcelConfig.columns);
if (dataList && dataList.length) {
for (var rowIndex = this.ExcelConfig.beginRow; rowIndex < dataList.length; rowIndex += 1) {
for (var colIndex = this.ExcelConfig.beginCol; colIndex < dataList[this.ExcelConfig.beginCol].length; colIndex += this.ExcelConfig.fieldNum + 1) {
var tripNew, tripObj;
var stationObj = {};
tripNew = tripObj = { code: '', arrivalList: [] };
if (dataList && dataList.length) {
for (var colIndex = this.ExcelConfig.beginCol; colIndex < dataList.length; colIndex += this.ExcelConfig.fieldNum + 1) {
var isContinue = true;
var tripObj = { code: '', arrivalList: [] };
for (var rowIndex = this.ExcelConfig.beginRow; isContinue; rowIndex += 1) {
isContinue = false;
var stationObj = {};
for (var index = 0; index < this.ExcelConfig.fieldNum; index += 1) {
var title = dataList[0][colIndex + index];
var value = dataList[rowIndex][colIndex + index];
if (dataList[colIndex + index]) {
var title = dataList[colIndex + index][0];
var value = dataList[colIndex + index][rowIndex];
if (title && value) {
// 数据列解析
isContinue = true;
var titleStr = `${title}`.trim();
var valueStr = `${value}`.trim();
if (titleStr.includes(this.ExcelConfig.sepField)) {
tripObj.code = valueStr;
JsonData.forEach(elem => {
if (elem.code == valueStr) {
tripObj = elem;
return;
if (titleStr == this.ExcelConfig.sepField) {
if (tripObj.code) {
const length = tripObj.arrivalList.length;
if (length == 1) {
tripObj.arrivalList[0]['flag'] = true;
}
JsonData.push(tripObj);
tripObj = { code: valueStr, arrivalList: [] };
} else {
tripObj.code = valueStr;
}
});
}
// 取需要的字段
@ -58,11 +67,21 @@ export default {
}
}
}
tripObj.arrivalList.push(stationObj);
if (tripObj.code && tripObj == tripNew) {
JsonData.push(tripObj);
}
// 添加字段值
if (Object.keys(stationObj).length) {
tripObj.arrivalList.push(stationObj);
}
}
// 添加最后那条没有车次的记录
if (tripObj.code) {
const length = tripObj.arrivalList.length;
if (length) {
tripObj.arrivalList[length - 1]['flag'] = true;
}
JsonData.push(tripObj);
}
}
}
@ -78,6 +97,7 @@ export default {
/** 按服务遍历数据*/
data.serviceNumberDataList.forEach((service) => {
/** 按车次遍历数据*/
var isBackup = true;
var opt = { name: '', markPointData: [], data: [] };
if (service.tripNumberDataList && service.tripNumberDataList.length) {
service.tripNumberDataList.forEach((train, j) => {
@ -132,10 +152,12 @@ export default {
opt = { name: '', markPointData: [], data: [] };
}
}
isBackup = train.backup;
});
// 不是备用车,按服务添加线
if (!service.backup) {
if (!isBackup) {
/** 创建一条完成的服务数据*/
var model = createSeriesModel(opt, Object.assign({ color: hexColor.toCreate() }, lineStyle));
if (model) {
@ -249,11 +271,11 @@ export default {
/** 格式化y轴数据*/
computedFormatYAxis(stations, params) {
var yText = '0m';
var yText = '';
stations.forEach(elem => {
if (elem.kmRange < parseInt(params.value) / this.CoordMultiple - this.EdgeHeight) {
yText = Math.floor(elem.kmRange) + 'm';
yText = elem.kmRange + 'm';
}
});

View File

@ -39,6 +39,7 @@ const News = () => import('@/views/system/news/index');
const CommandDictionary = () => import('@/views/system/commandDictionary/index');
const CommandDictionaryDetail = () => import('@/views/system/commandDictionary/edit');
const configLine = () => import('@/views/system/configLine/index');
// const IscsSystem = () => import('@/views/system/iscsSystem/index');
const Mapedit = () => import('@/views/mapdraft/index');
@ -783,6 +784,20 @@ export const asyncRouter = [
}
]
},
// {
// path: 'iscs/system',
// component: IscsSystem,
// meta: {
// i18n: 'router.iscsSystem'
// },
// children: [
// {
// path: 'edit/:id/:mode',
// component: IscsDraw,
// hidden: true
// }
// ]
// },
{
path: 'dictionary',
component: Dictionary,

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.41:9000'; // 张赛
// BASE_API = 'http://192.168.3.82:9000'; // 杜康
} else {

View File

@ -0,0 +1,26 @@
<template>
<div class="bottom-box">
111
</div>
</template>
<script>
export default {
data() {
return {
mes: '1111'
};
}
};
</script>
<style lang="scss" scoped>
.bottom-box{
width: 100%;
height: 95px;
background-color: #ACACAC;
position: absolute;
bottom: 0;
left: 0;
}
</style>

View File

@ -0,0 +1,39 @@
<template>
<div class="iscs-system-box">
<top-nav />
<div class="content-box">
1111
</div>
<bottom />
</div>
</template>
<script>
import TopNav from './nav.vue';
import bottom from './bottom.vue';
export default {
components: {
TopNav,
bottom
},
data() {
return {
mes: '1111'
};
}
};
</script>
<style lang="scss" scoped>
.iscs-system-box{
position: relative;
height: 100%;
}
.content-box{
width: 100%;
height: 100%;
padding: 95px 0;
background: green;
}
</style>

View File

@ -0,0 +1,26 @@
<template>
<div class="nav-box">
111
</div>
</template>
<script>
export default {
data() {
return {
mes: '1111'
};
}
};
</script>
<style lang="scss" scoped>
.nav-box{
width: 100%;
height: 95px;
background-color: #ACACAC;
position: absolute;
top: 0;
left: 0;
}
</style>