Merge branch 'test' of https://git.code.tencent.com/lian-cbtc/jl-client into test
This commit is contained in:
commit
1adc1101fe
@ -15,120 +15,232 @@ export default {
|
|||||||
beginRow: 1,
|
beginRow: 1,
|
||||||
beginCol: 0,
|
beginCol: 0,
|
||||||
// fieldNum: 10,
|
// fieldNum: 10,
|
||||||
columns: {
|
trainId: '车次号',
|
||||||
'默认上行折返轨': { key: 'upTrack', formatter: (val) => { return val; } },
|
columns: ['备注', '车次号']
|
||||||
'默认下行折返轨': { key: 'downTrack', formatter: (val) => { return val; } }
|
// beginRow: 1,
|
||||||
}
|
// beginCol: 0,
|
||||||
|
// // fieldNum: 10,
|
||||||
|
// columns: {
|
||||||
|
// '默认上行折返轨': { key: 'upTrack', formatter: (val) => { return val; } },
|
||||||
|
// '默认下行折返轨': { key: 'downTrack', formatter: (val) => { return val; } }
|
||||||
|
// }
|
||||||
},
|
},
|
||||||
|
|
||||||
|
// /** 解析exal数据转换为Json后台数据*/
|
||||||
|
// importData(Sheet, JsonData) {
|
||||||
|
// const dataList = convertSheetToList(Sheet, true);
|
||||||
|
// const needList = Object.keys(this.ExcelConfig.columns);
|
||||||
|
// const tripObj = { upTrack: '', downTrack: '' };
|
||||||
|
// if (dataList && dataList.length && dataList[1] && dataList[0]) {
|
||||||
|
// const tIndex = dataList.findIndex(it => { return it[0]; });
|
||||||
|
// if (dataList[0][0] == needList[0] && dataList[1][0] == needList[1]) {
|
||||||
|
// for (var colIndex = this.ExcelConfig.beginCol; colIndex < dataList.length; colIndex += 1) {
|
||||||
|
// var isContinue = true;
|
||||||
|
|
||||||
|
// for (var rowIndex = this.ExcelConfig.beginRow; isContinue; rowIndex += 1) {
|
||||||
|
// isContinue = false;
|
||||||
|
|
||||||
|
// var title = dataList[colIndex][0];
|
||||||
|
// var value = dataList[colIndex][rowIndex];
|
||||||
|
|
||||||
|
// if (title && value) {
|
||||||
|
// // 数据列解析
|
||||||
|
// isContinue = true;
|
||||||
|
// var titleStr = `${title}`.replace(/\s*/g, '');
|
||||||
|
// var valueStr = `${value}`.replace(/\s*/g, '');
|
||||||
|
|
||||||
|
// // 取需要的字段
|
||||||
|
// if (needList.findIndex(elem => { return elem == titleStr; }) >= 0) {
|
||||||
|
// tripObj[this.ExcelConfig.columns[titleStr].key] = this.ExcelConfig.columns[titleStr].formatter(valueStr);
|
||||||
|
// }
|
||||||
|
// }
|
||||||
|
|
||||||
|
// }
|
||||||
|
// }
|
||||||
|
// } else {
|
||||||
|
// /** 解析二维数组为json对象*/
|
||||||
|
// const reg0 = /^[↑|↓|¡|ü|ý|]+(.*)/; // ↑|↓
|
||||||
|
// const reg1 = /^([▼|▲|¡ø|¨]+)\s*(\d+:\d+:\d+)/; // ▲ 06:10:00
|
||||||
|
// const reg2 = /^(\d+:\d+:\d+)\s*([▼|▲|¡ø|¨]+)/; // 06:10:00 ▲
|
||||||
|
// const reg3 = /^(\d+:\d+:\d+)\s*(\d+:\d+:\d+|)/; // 06:10:00 06:12:00
|
||||||
|
// const reg4 = /[▼|▲|¡|ø|¨|]+/; // ▲
|
||||||
|
|
||||||
|
// dataList.forEach((elem, i) => {
|
||||||
|
// var begin = -1;
|
||||||
|
// /** 跳过名称所在的行*/
|
||||||
|
// if (i != tIndex && elem && elem.length > 0) {
|
||||||
|
// elem.forEach((item, j) => {
|
||||||
|
// /** 过滤空值*/
|
||||||
|
// if (item) {
|
||||||
|
// var value = `${item}`.trim();
|
||||||
|
// var title = `${dataList[tIndex][j]}`.replace(/\s*/g, '');
|
||||||
|
// /** 匹配到开始位置或者结束位置*/
|
||||||
|
// if (reg0.test(value)) {
|
||||||
|
// if (begin == -1) {
|
||||||
|
// begin = value; // 设置初始索引
|
||||||
|
// JsonData.push({
|
||||||
|
// code: reg0.exec(value)[1],
|
||||||
|
// arrivalList: []
|
||||||
|
// });
|
||||||
|
// } else if (begin === value) {
|
||||||
|
// begin = -1; // 清空初始索引
|
||||||
|
// }
|
||||||
|
// } else if (begin !== -1) {
|
||||||
|
// /** 匹配到中间位置*/
|
||||||
|
// var begTime, endTime;
|
||||||
|
// var runFlag = JsonData[JsonData.length - 1].code[2];
|
||||||
|
// var stationName = title.replace(/\s/, '');
|
||||||
|
// var need = false;
|
||||||
|
// var flag = false;
|
||||||
|
// if (reg1.test(value)) {
|
||||||
|
// /** 含有特殊字符的时间格式*/
|
||||||
|
// [, begTime, endTime] = reg1.exec(value);
|
||||||
|
|
||||||
|
// begTime = reg4.test(begTime) ? '' : begTime;
|
||||||
|
// endTime = reg4.test(endTime) ? '' : endTime;
|
||||||
|
|
||||||
|
// /** 下行方向时间互换*/
|
||||||
|
// if (runFlag === '2') {
|
||||||
|
// [begTime, endTime] = [endTime, begTime];
|
||||||
|
// }
|
||||||
|
|
||||||
|
// /** 设置标志*/
|
||||||
|
// [need, flag] = [true, true];
|
||||||
|
// } else if (reg2.test(value)) {
|
||||||
|
// /** 含有特殊字符的时间格式*/
|
||||||
|
// [, begTime, endTime] = reg2.exec(value);
|
||||||
|
|
||||||
|
// begTime = reg4.test(begTime) ? '' : begTime;
|
||||||
|
// endTime = reg4.test(endTime) ? '' : endTime;
|
||||||
|
|
||||||
|
// /** 下行方向时间互换*/
|
||||||
|
// if (runFlag === '2') {
|
||||||
|
// [begTime, endTime] = [endTime, begTime];
|
||||||
|
// }
|
||||||
|
|
||||||
|
// /** 设置标志*/
|
||||||
|
// [need, flag] = [true, true];
|
||||||
|
// } else if (reg3.test(value)) {
|
||||||
|
// /** 正常时间格式*/
|
||||||
|
// [, begTime, endTime] = reg3.exec(value);
|
||||||
|
|
||||||
|
// /** 如果只存在一个数据时,则开始和结束设置一样*/
|
||||||
|
// endTime = endTime || begTime;
|
||||||
|
|
||||||
|
// /** 下行方向时间互换*/
|
||||||
|
// if (runFlag === '2') {
|
||||||
|
// [begTime, endTime] = [endTime, begTime];
|
||||||
|
// }
|
||||||
|
|
||||||
|
// /** 设置标志*/
|
||||||
|
// [need, flag] = [true, false];
|
||||||
|
// }
|
||||||
|
|
||||||
|
// /** 添加json数据*/
|
||||||
|
// if (need) { // 储存非空 数据
|
||||||
|
// var stationObj = {
|
||||||
|
// stationName: stationName
|
||||||
|
// };
|
||||||
|
|
||||||
|
// if (begTime) { stationObj['arriveTime'] = prefixTime(begTime); }
|
||||||
|
// if (endTime) { stationObj['departureTime'] = prefixTime(endTime); }
|
||||||
|
// if (flag) { stationObj['flag'] = flag; } // 是否转换轨
|
||||||
|
// JsonData[JsonData.length - 1].arrivalList.push(stationObj);
|
||||||
|
// }
|
||||||
|
// }
|
||||||
|
// }
|
||||||
|
// });
|
||||||
|
// }
|
||||||
|
// });
|
||||||
|
// }
|
||||||
|
// }
|
||||||
|
// JsonData.forEach(item => {
|
||||||
|
// item['upTrack'] = tripObj.upTrack;
|
||||||
|
// item['downTrack'] = tripObj.downTrack;
|
||||||
|
// });
|
||||||
|
|
||||||
|
// return JsonData;
|
||||||
|
// },
|
||||||
/** 解析exal数据转换为Json后台数据*/
|
/** 解析exal数据转换为Json后台数据*/
|
||||||
importData(Sheet, JsonData) {
|
importData(Sheet, JsonData) {
|
||||||
const dataList = convertSheetToList(Sheet, true);
|
const dataList = convertSheetToList(Sheet, true);
|
||||||
const needList = Object.keys(this.ExcelConfig.columns);
|
|
||||||
const tripObj = { upTrack: '', downTrack: '' };
|
|
||||||
if (dataList && dataList.length && dataList[1] && dataList[0]) {
|
if (dataList && dataList.length && dataList[1] && dataList[0]) {
|
||||||
const tIndex = dataList.findIndex(it => { return it[0]; });
|
const tIndex = 8; // 设置不用过滤行数
|
||||||
if (dataList[0][0] == needList[0] && dataList[1][0] == needList[1]) {
|
/** 解析二维数组为json对象*/
|
||||||
for (var colIndex = this.ExcelConfig.beginCol; colIndex < dataList.length; colIndex += 1) {
|
const reg3 = /^(\d+:\d+:\d+|)/; // 06:12:00
|
||||||
var isContinue = true;
|
const reg4 = /[▼|▲|¡|ø|¨|]+/; // ▲
|
||||||
|
dataList.forEach((elem, i) => {
|
||||||
for (var rowIndex = this.ExcelConfig.beginRow; isContinue; rowIndex += 1) {
|
var begin = -1;
|
||||||
isContinue = false;
|
/** 跳过名称所在的行*/
|
||||||
|
if (i != tIndex && elem && elem.length > 0) {
|
||||||
var title = dataList[colIndex][0];
|
let flag = false;
|
||||||
var value = dataList[colIndex][rowIndex];
|
let param = { begTime: '', endTime: '' };
|
||||||
|
if (i > tIndex) { elem.reverse(); }
|
||||||
if (title && value) {
|
let interval = 1;
|
||||||
// 数据列解析
|
for (let j = 0; j < elem.length;) {
|
||||||
isContinue = true;
|
const item = elem[j];
|
||||||
var titleStr = `${title}`.replace(/\s*/g, '');
|
let title = '';
|
||||||
var valueStr = `${value}`.replace(/\s*/g, '');
|
var value = `${item}`.trim();
|
||||||
|
if (i > tIndex) { // 上行线
|
||||||
// 取需要的字段
|
title = `${dataList[tIndex][dataList[tIndex].length - j - 1]}`.replace(/\s*/g, '');
|
||||||
if (needList.findIndex(elem => { return elem == titleStr; }) >= 0) {
|
if (title == 'undefined') {
|
||||||
tripObj[this.ExcelConfig.columns[titleStr].key] = this.ExcelConfig.columns[titleStr].formatter(valueStr);
|
title = `${dataList[tIndex][dataList[tIndex].length - j - 2]}`.replace(/\s*/g, '');
|
||||||
|
}
|
||||||
|
} else { // 下行线
|
||||||
|
title = `${dataList[tIndex][j]}`.replace(/\s*/g, '');
|
||||||
|
if (title == 'undefined') {
|
||||||
|
title = `${dataList[tIndex][j - 1]}`.replace(/\s*/g, '');
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
/** 匹配到开始位置或者结束位置*/
|
||||||
}
|
if (title == this.ExcelConfig.trainId && value != 'undefined') {
|
||||||
} else {
|
if (begin == -1) {
|
||||||
/** 解析二维数组为json对象*/
|
interval = 2;
|
||||||
const reg0 = /^[↑|↓|¡|ü|ý|]+(.*)/; // ↑|↓
|
flag = true;
|
||||||
const reg1 = /^([▼|▲|¡ø|¨]+)\s*(\d+:\d+:\d+)/; // ▲ 06:10:00
|
begin = value; // 设置初始索引
|
||||||
const reg2 = /^(\d+:\d+:\d+)\s*([▼|▲|¡ø|¨]+)/; // 06:10:00 ▲
|
JsonData.push({
|
||||||
const reg3 = /^(\d+:\d+:\d+)\s*(\d+:\d+:\d+|)/; // 06:10:00 06:12:00
|
code: value,
|
||||||
const reg4 = /[▼|▲|¡|ø|¨|]+/; // ▲
|
destinationCode: '',
|
||||||
|
arrivalList: []
|
||||||
dataList.forEach((elem, i) => {
|
});
|
||||||
var begin = -1;
|
} else if (flag) {
|
||||||
/** 跳过名称所在的行*/
|
interval = 1;
|
||||||
if (i != tIndex && elem && elem.length > 0) {
|
begin = -1; // 清空初始索引
|
||||||
elem.forEach((item, j) => {
|
JsonData[JsonData.length - 1].destinationCode = value;
|
||||||
/** 过滤空值*/
|
flag = false;
|
||||||
if (item) {
|
}
|
||||||
var value = `${item}`.trim();
|
} else if (title == this.ExcelConfig.columns[0]) {
|
||||||
var title = `${dataList[tIndex][j]}`.replace(/\s*/g, '');
|
interval = 1;
|
||||||
/** 匹配到开始位置或者结束位置*/
|
} else if (begin !== -1) {
|
||||||
if (reg0.test(value)) {
|
const item1 = `${elem[j]}`.trim();
|
||||||
if (begin == -1) {
|
const item2 = `${elem[j + 1]}`.trim();
|
||||||
begin = value; // 设置初始索引
|
if (item1 != 'undefined' || item2 != 'undefined') {
|
||||||
JsonData.push({
|
/** 匹配到中间位置*/
|
||||||
code: reg0.exec(value)[1],
|
var stationName = title.replace(/\s/, '');
|
||||||
arrivalList: []
|
const flag = reg3.test(item1) || reg3.test(item2);
|
||||||
});
|
if (this.ExcelConfig.columns.indexOf(stationName) == -1 && flag) {
|
||||||
} else if (begin === value) {
|
let need = false;
|
||||||
begin = -1; // 清空初始索引
|
if (value.split(':')[0] == '24') { // 24:XX:XX 类似这种数据 变24为00
|
||||||
|
const arr = value.split(':');
|
||||||
|
arr[0] = '00';
|
||||||
|
value = arr.join(':');
|
||||||
|
}
|
||||||
|
const item1 = elem[j] ? `${elem[j]}`.trim() : '';
|
||||||
|
const item2 = elem[j + 1] ? `${elem[j + 1]}`.trim() : '';
|
||||||
|
if (item1 && item2) {
|
||||||
|
param.begTime = item1;
|
||||||
|
param.endTime = item2;
|
||||||
|
} else if (item1 && !item2) {
|
||||||
|
param.begTime = item1;
|
||||||
|
param.endTime = item1;
|
||||||
|
} else if (!item1 && item2) {
|
||||||
|
param.begTime = item2;
|
||||||
|
param.endTime = item2;
|
||||||
}
|
}
|
||||||
} else if (begin !== -1) {
|
|
||||||
/** 匹配到中间位置*/
|
|
||||||
var begTime, endTime;
|
|
||||||
var runFlag = JsonData[JsonData.length - 1].code[2];
|
|
||||||
var stationName = title.replace(/\s/, '');
|
|
||||||
var need = false;
|
|
||||||
var flag = false;
|
|
||||||
if (reg1.test(value)) {
|
|
||||||
/** 含有特殊字符的时间格式*/
|
|
||||||
[, begTime, endTime] = reg1.exec(value);
|
|
||||||
|
|
||||||
begTime = reg4.test(begTime) ? '' : begTime;
|
if (param.begTime && param.endTime) {
|
||||||
endTime = reg4.test(endTime) ? '' : endTime;
|
need = true;
|
||||||
|
|
||||||
/** 下行方向时间互换*/
|
|
||||||
if (runFlag === '2') {
|
|
||||||
[begTime, endTime] = [endTime, begTime];
|
|
||||||
}
|
|
||||||
|
|
||||||
/** 设置标志*/
|
|
||||||
[need, flag] = [true, true];
|
|
||||||
} else if (reg2.test(value)) {
|
|
||||||
/** 含有特殊字符的时间格式*/
|
|
||||||
[, begTime, endTime] = reg2.exec(value);
|
|
||||||
|
|
||||||
begTime = reg4.test(begTime) ? '' : begTime;
|
|
||||||
endTime = reg4.test(endTime) ? '' : endTime;
|
|
||||||
|
|
||||||
/** 下行方向时间互换*/
|
|
||||||
if (runFlag === '2') {
|
|
||||||
[begTime, endTime] = [endTime, begTime];
|
|
||||||
}
|
|
||||||
|
|
||||||
/** 设置标志*/
|
|
||||||
[need, flag] = [true, true];
|
|
||||||
} else if (reg3.test(value)) {
|
|
||||||
/** 正常时间格式*/
|
|
||||||
[, begTime, endTime] = reg3.exec(value);
|
|
||||||
|
|
||||||
/** 如果只存在一个数据时,则开始和结束设置一样*/
|
|
||||||
endTime = endTime || begTime;
|
|
||||||
|
|
||||||
/** 下行方向时间互换*/
|
|
||||||
if (runFlag === '2') {
|
|
||||||
[begTime, endTime] = [endTime, begTime];
|
|
||||||
}
|
|
||||||
|
|
||||||
/** 设置标志*/
|
|
||||||
[need, flag] = [true, false];
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/** 添加json数据*/
|
/** 添加json数据*/
|
||||||
@ -136,25 +248,32 @@ export default {
|
|||||||
var stationObj = {
|
var stationObj = {
|
||||||
stationName: stationName
|
stationName: stationName
|
||||||
};
|
};
|
||||||
|
if (reg4.test(param.begTime)) {
|
||||||
if (begTime) { stationObj['arriveTime'] = prefixTime(begTime); }
|
param.begTime = '';
|
||||||
if (endTime) { stationObj['departureTime'] = prefixTime(endTime); }
|
}
|
||||||
if (flag) { stationObj['flag'] = flag; } // 是否转换轨
|
if (reg4.test(param.endTime)) {
|
||||||
|
param.endTime = '';
|
||||||
|
}
|
||||||
|
stationObj['arriveTime'] = prefixTime(param.begTime);
|
||||||
|
stationObj['departureTime'] = prefixTime(param.endTime);
|
||||||
JsonData[JsonData.length - 1].arrivalList.push(stationObj);
|
JsonData[JsonData.length - 1].arrivalList.push(stationObj);
|
||||||
|
param = { begTime: '', endTime: '' };
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
});
|
}
|
||||||
|
j = j + interval;
|
||||||
}
|
}
|
||||||
});
|
}
|
||||||
}
|
});
|
||||||
}
|
}
|
||||||
JsonData.forEach(item => {
|
const arr = [];
|
||||||
item['upTrack'] = tripObj.upTrack;
|
JsonData.forEach((item, i) => {
|
||||||
item['downTrack'] = tripObj.downTrack;
|
if (item.code) {
|
||||||
|
arr.push(item);
|
||||||
|
}
|
||||||
});
|
});
|
||||||
|
return arr;
|
||||||
return JsonData;
|
|
||||||
},
|
},
|
||||||
|
|
||||||
/** 将后台数据解析成图表*/
|
/** 将后台数据解析成图表*/
|
||||||
|
@ -9,6 +9,7 @@
|
|||||||
v-model="startTime"
|
v-model="startTime"
|
||||||
size="small"
|
size="small"
|
||||||
type="datetime"
|
type="datetime"
|
||||||
|
value-format="yyyy-MM-dd HH:mm:ss"
|
||||||
placeholder="选择日期时间"
|
placeholder="选择日期时间"
|
||||||
/>
|
/>
|
||||||
</el-col>
|
</el-col>
|
||||||
@ -18,6 +19,7 @@
|
|||||||
v-model="endTime"
|
v-model="endTime"
|
||||||
size="small"
|
size="small"
|
||||||
type="datetime"
|
type="datetime"
|
||||||
|
value-format="yyyy-MM-dd HH:mm:ss"
|
||||||
placeholder="选择日期时间"
|
placeholder="选择日期时间"
|
||||||
/>
|
/>
|
||||||
</el-col>
|
</el-col>
|
||||||
@ -76,7 +78,7 @@
|
|||||||
<el-table-column prop="confirmTime" label="确认时间" width="150px" />
|
<el-table-column prop="confirmTime" label="确认时间" width="150px" />
|
||||||
<el-table-column prop="recover" label="恢复">
|
<el-table-column prop="recover" label="恢复">
|
||||||
<template slot-scope="scope">
|
<template slot-scope="scope">
|
||||||
<span>{{ scope.row.recover? 'Y':'N' }}</span>
|
<span>{{ scope.row.recovered? 'Y':'N' }}</span>
|
||||||
</template>
|
</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
<el-table-column prop="address" label="恢复时间" />
|
<el-table-column prop="address" label="恢复时间" />
|
||||||
|
@ -7,6 +7,7 @@
|
|||||||
v-model="startTime"
|
v-model="startTime"
|
||||||
size="small"
|
size="small"
|
||||||
type="datetime"
|
type="datetime"
|
||||||
|
value-format="yyyy-MM-dd HH:mm:ss"
|
||||||
placeholder="选择日期时间"
|
placeholder="选择日期时间"
|
||||||
/>
|
/>
|
||||||
<div style="display: inline-block;margin-right: 5px;margin-left: 10px;">结束时间:</div>
|
<div style="display: inline-block;margin-right: 5px;margin-left: 10px;">结束时间:</div>
|
||||||
@ -14,6 +15,7 @@
|
|||||||
v-model="endTime"
|
v-model="endTime"
|
||||||
size="small"
|
size="small"
|
||||||
type="datetime"
|
type="datetime"
|
||||||
|
value-format="yyyy-MM-dd HH:mm:ss"
|
||||||
placeholder="选择日期时间"
|
placeholder="选择日期时间"
|
||||||
/>
|
/>
|
||||||
<el-button style="margin-left: 10px;" @click="queryData">查询</el-button>
|
<el-button style="margin-left: 10px;" @click="queryData">查询</el-button>
|
||||||
@ -35,7 +37,7 @@
|
|||||||
<el-table-column prop="description" label="故障描述" />
|
<el-table-column prop="description" label="故障描述" />
|
||||||
<el-table-column prop="recover" label="已恢复">
|
<el-table-column prop="recover" label="已恢复">
|
||||||
<template slot-scope="scope">
|
<template slot-scope="scope">
|
||||||
<el-checkbox v-model="scope.row.recover" />
|
<el-checkbox v-model="scope.row.recovered" />
|
||||||
</template>
|
</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
<el-table-column prop="address" label="恢复时间" />
|
<el-table-column prop="address" label="恢复时间" />
|
||||||
|
@ -222,13 +222,13 @@ export default {
|
|||||||
|
|
||||||
/** 计算折返点*/
|
/** 计算折返点*/
|
||||||
elem.right = elem.tripNumber[0] == '2';
|
elem.right = elem.tripNumber[0] == '2';
|
||||||
var nextPoint = [parseInt(elem.secondTime), this.getCoordYByElem(stations, kmRangeCoordMap, elem, false), elem.right];
|
var nextPoint = [parseInt(elem.secondTime), this.getCoordYByElem(stations, kmRangeCoordMap, elem, false), elem.tripNumber, elem.right];
|
||||||
if (serie.data.length > 0) {
|
if (serie.data.length > 0) {
|
||||||
var lastPoint = serie.data[serie.data.length - 1];
|
var lastPoint = serie.data[serie.data.length - 1];
|
||||||
if (lastPoint[2] !== nextPoint[2]) {
|
if (lastPoint[2] !== nextPoint[2]) {
|
||||||
var num = this.computedReentryNumber(elem.tripNumber);
|
var num = this.computedReentryNumber(elem.tripNumber);
|
||||||
serie.data.push([lastPoint[0], this.getYvalueByDirectionCode(lastPoint[1], lastPoint[2], num), lastPoint[2]]);
|
serie.data.push([lastPoint[0], this.getYvalueByDirectionCode(lastPoint[1], lastPoint[3], num), lastPoint[3]]);
|
||||||
serie.data.push([nextPoint[0], this.getYvalueByDirectionCode(nextPoint[1], lastPoint[2], num), lastPoint[2]]);
|
serie.data.push([nextPoint[0], this.getYvalueByDirectionCode(nextPoint[1], lastPoint[3], num), lastPoint[3]]);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -236,6 +236,14 @@
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
<div class="form_box">
|
||||||
|
<div class="title">单位:</div>
|
||||||
|
<div class="content_box_info">
|
||||||
|
<div v-show="companyShow" class="show_box">
|
||||||
|
<span>{{ handleCompany(userInfo.companyId) }}</span>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
<div v-if="!wmOpenId" class="form_box">
|
<div v-if="!wmOpenId" class="form_box">
|
||||||
<div class="title">绑定微信:</div>
|
<div class="title">绑定微信:</div>
|
||||||
<div class="content_box_info">
|
<div class="content_box_info">
|
||||||
@ -278,6 +286,7 @@ import QrcodeVue from 'qrcode.vue';
|
|||||||
import { setInterval, clearInterval } from 'timers';
|
import { setInterval, clearInterval } from 'timers';
|
||||||
import { checkLoginStatus } from '@/api/login';
|
import { checkLoginStatus } from '@/api/login';
|
||||||
import { getSessionStorage } from '@/utils/auth';
|
import { getSessionStorage } from '@/utils/auth';
|
||||||
|
import { getCompanyList } from '@/api/company';
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
components: { QrcodeVue },
|
components: { QrcodeVue },
|
||||||
@ -296,14 +305,16 @@ export default {
|
|||||||
nickname: '',
|
nickname: '',
|
||||||
mobile: '',
|
mobile: '',
|
||||||
email: '',
|
email: '',
|
||||||
passWord: ''
|
passWord: '',
|
||||||
|
companyId: ''
|
||||||
},
|
},
|
||||||
editInfo: {
|
editInfo: {
|
||||||
name: '',
|
name: '',
|
||||||
nickname: '',
|
nickname: '',
|
||||||
mobile: '',
|
mobile: '',
|
||||||
email: '',
|
email: '',
|
||||||
passWord: ''
|
passWord: '',
|
||||||
|
companyId: ''
|
||||||
},
|
},
|
||||||
nationCode: '86',
|
nationCode: '86',
|
||||||
nameShow: true,
|
nameShow: true,
|
||||||
@ -311,6 +322,7 @@ export default {
|
|||||||
mobileShow: true,
|
mobileShow: true,
|
||||||
emailShow: true,
|
emailShow: true,
|
||||||
passwordShow: true,
|
passwordShow: true,
|
||||||
|
companyShow: true,
|
||||||
mobileCode: null,
|
mobileCode: null,
|
||||||
emailCode: null,
|
emailCode: null,
|
||||||
passWordCode: null,
|
passWordCode: null,
|
||||||
@ -340,7 +352,8 @@ export default {
|
|||||||
nationCodeInit: '86', // 默认国际地区
|
nationCodeInit: '86', // 默认国际地区
|
||||||
loginClient: 'LianKeTang',
|
loginClient: 'LianKeTang',
|
||||||
project:'',
|
project:'',
|
||||||
wmOpenId: ''
|
wmOpenId: '',
|
||||||
|
companyList: []
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
computed: {
|
computed: {
|
||||||
@ -372,7 +385,8 @@ export default {
|
|||||||
nickname: user.nickname,
|
nickname: user.nickname,
|
||||||
mobile: user.mobile,
|
mobile: user.mobile,
|
||||||
email: user.email,
|
email: user.email,
|
||||||
passWord: ''
|
passWord: '',
|
||||||
|
companyId: user.companyId
|
||||||
};
|
};
|
||||||
this.wmOpenId = user.wmOpenId || '';
|
this.wmOpenId = user.wmOpenId || '';
|
||||||
this.oldPassWord = user.password;
|
this.oldPassWord = user.password;
|
||||||
@ -384,6 +398,11 @@ export default {
|
|||||||
.catch(error => {
|
.catch(error => {
|
||||||
console.log(error, '请求个人信息失败');
|
console.log(error, '请求个人信息失败');
|
||||||
});
|
});
|
||||||
|
getCompanyList().then(resp => {
|
||||||
|
this.companyList = resp.data;
|
||||||
|
}).catch((error) => {
|
||||||
|
console.log(error, '获取公司列表信息失败');
|
||||||
|
});
|
||||||
},
|
},
|
||||||
doClose() {
|
doClose() {
|
||||||
this.visible = false;
|
this.visible = false;
|
||||||
@ -394,6 +413,10 @@ export default {
|
|||||||
this.editInfo.name = this.userInfo.name;
|
this.editInfo.name = this.userInfo.name;
|
||||||
this.nameShow = !this.nameShow;
|
this.nameShow = !this.nameShow;
|
||||||
},
|
},
|
||||||
|
switcherCompany() {
|
||||||
|
this.editInfo.companyId = this.userInfo.companyId;
|
||||||
|
this.companyShow = !this.companyShow;
|
||||||
|
},
|
||||||
async saveName() {
|
async saveName() {
|
||||||
if (this.editInfo.name) {
|
if (this.editInfo.name) {
|
||||||
try {
|
try {
|
||||||
@ -406,7 +429,16 @@ export default {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
async saveCompany() {
|
||||||
|
try {
|
||||||
|
await getUserinfoName(this.info.id, this.editInfo.name);
|
||||||
|
this.userInfo.name = this.editInfo.name;
|
||||||
|
this.nameShow = !this.nameShow;
|
||||||
|
this.$store.commit('SET_NAME', this.editInfo.name);
|
||||||
|
} catch (error) {
|
||||||
|
console.log(error, '错误');
|
||||||
|
}
|
||||||
|
},
|
||||||
switcherNickname() {
|
switcherNickname() {
|
||||||
this.editInfo.nickname = this.userInfo.nickname;
|
this.editInfo.nickname = this.userInfo.nickname;
|
||||||
this.nickNameShow = !this.nickNameShow;
|
this.nickNameShow = !this.nickNameShow;
|
||||||
@ -426,7 +458,15 @@ export default {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
handleCompany(companyId) {
|
||||||
|
let name = '';
|
||||||
|
this.companyList.forEach(item => {
|
||||||
|
if (item.id == companyId) {
|
||||||
|
name = item.name;
|
||||||
|
}
|
||||||
|
});
|
||||||
|
return name;
|
||||||
|
},
|
||||||
switcherMobile() {
|
switcherMobile() {
|
||||||
// this.editInfo.mobile = this.userInfo.mobile;
|
// this.editInfo.mobile = this.userInfo.mobile;
|
||||||
this.mobileShow = !this.mobileShow;
|
this.mobileShow = !this.mobileShow;
|
||||||
|
@ -2,8 +2,8 @@ export function getBaseUrl() {
|
|||||||
let BASE_API;
|
let BASE_API;
|
||||||
if (process.env.NODE_ENV === 'development') {
|
if (process.env.NODE_ENV === 'development') {
|
||||||
// BASE_API = 'https://joylink.club/jlcloud';
|
// 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.8.107:9000'; // 袁琪
|
// BASE_API = 'http://192.168.8.107:9000'; // 袁琪
|
||||||
// BASE_API = 'http://192.168.8.144:9000'; // 旭强
|
// BASE_API = 'http://192.168.8.144:9000'; // 旭强
|
||||||
// BASE_API = 'http://192.168.3.175:9000'; // 张赛
|
// BASE_API = 'http://192.168.3.175:9000'; // 张赛
|
||||||
// BASE_API = 'http://192.168.8.110:9000'; // 杜康
|
// BASE_API = 'http://192.168.8.110:9000'; // 杜康
|
||||||
|
@ -271,7 +271,9 @@ export default {
|
|||||||
this.formModel.operationScore = row.operationScore;
|
this.formModel.operationScore = row.operationScore;
|
||||||
this.formModel.scriptId = row.scriptId;
|
this.formModel.scriptId = row.scriptId;
|
||||||
getScriptByIdNew(row.scriptId).then(res=>{
|
getScriptByIdNew(row.scriptId).then(res=>{
|
||||||
this.actionList = res.data.actionList;
|
this.actionList = res.data.actionList.filter(action=>{
|
||||||
|
return action.type != 'Exit_Conversation' && action.type != 'Accept_Conversation_Invitation';
|
||||||
|
});
|
||||||
getCompetitionPracticalSceneById(row.id).then(response=>{
|
getCompetitionPracticalSceneById(row.id).then(response=>{
|
||||||
const commandEvaluationRuleVOs = {};
|
const commandEvaluationRuleVOs = {};
|
||||||
if (response.data.commandEvaluationRuleVOs) {
|
if (response.data.commandEvaluationRuleVOs) {
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
<template>
|
<template>
|
||||||
<div>
|
<div>
|
||||||
<el-dialog v-dialogDrag title="场景列表" :visible.sync="dialogVisible" width="800px" center>
|
<el-dialog v-dialogDrag title="场景列表" :visible.sync="dialogVisible" width="900px" center>
|
||||||
<el-tabs v-model="activeName" type="card" style="height: 500px;">
|
<el-tabs v-model="activeName" type="card" style="height: 500px;">
|
||||||
<el-tab-pane label="主场景列表" name="first">
|
<el-tab-pane label="主场景列表" name="first">
|
||||||
<el-table :data="mainSceneData" border :span-method="objectSpanMethod" stripe :cell-style="{padding: '8px 0'}">
|
<el-table :data="mainSceneData" border :span-method="objectSpanMethod" stripe :cell-style="{padding: '8px 0'}">
|
||||||
|
@ -58,12 +58,34 @@ export const operateEnum = {
|
|||||||
// }
|
// }
|
||||||
},
|
},
|
||||||
ControlConvertMenu:{
|
ControlConvertMenu:{
|
||||||
|
type:'控制模式',
|
||||||
CM_Apply_For_Station_Control:{
|
CM_Apply_For_Station_Control:{
|
||||||
code:'stationCodes',
|
code:'stationCodes',
|
||||||
isList:true,
|
isList:true,
|
||||||
isDevice:true,
|
isDevice:true,
|
||||||
name:'车站列表',
|
name:'车站列表',
|
||||||
function:getStationNameById
|
function:getStationNameById
|
||||||
|
},
|
||||||
|
CM_Reply_Station_Control:{
|
||||||
|
code:'replyVOList',
|
||||||
|
name:'车站列表',
|
||||||
|
isList:true,
|
||||||
|
isDevice:true,
|
||||||
|
function:getStationResultById
|
||||||
|
},
|
||||||
|
CM_Reply_Center_Control:{
|
||||||
|
code:'replyVOList',
|
||||||
|
name:'车站列表',
|
||||||
|
isList:true,
|
||||||
|
isDevice:true,
|
||||||
|
function:getStationResultById
|
||||||
|
},
|
||||||
|
CM_Apply_For_Center_Control:{
|
||||||
|
code:'stationCodes',
|
||||||
|
isList:true,
|
||||||
|
isDevice:true,
|
||||||
|
name:'车站列表',
|
||||||
|
function:getStationNameById
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
Stand:{
|
Stand:{
|
||||||
@ -125,7 +147,7 @@ export const operateEnum = {
|
|||||||
params:[
|
params:[
|
||||||
{
|
{
|
||||||
code:'open',
|
code:'open',
|
||||||
name:'',
|
name:'状态',
|
||||||
result:[
|
result:[
|
||||||
{data:true, name:'开', judge:'='},
|
{data:true, name:'开', judge:'='},
|
||||||
{data:false, name:'关', judge:'='}
|
{data:false, name:'关', judge:'='}
|
||||||
@ -133,13 +155,17 @@ export const operateEnum = {
|
|||||||
},
|
},
|
||||||
{
|
{
|
||||||
code:'right',
|
code:'right',
|
||||||
name:'',
|
name:' 方向',
|
||||||
result:[
|
result:[
|
||||||
{data:true, name:'左门', judge:'='},
|
{data:true, name:'左门', judge:'='},
|
||||||
{data:false, name:'右门', judge:'='}
|
{data:false, name:'右门', judge:'='}
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
|
},
|
||||||
|
Driver_Drive_Mode_Change:{
|
||||||
|
code:'driveMode',
|
||||||
|
name:'模式为'
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
TrainWindow:{
|
TrainWindow:{
|
||||||
@ -233,31 +259,57 @@ export function covertOperate(operationType, operationParamMap) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
function covertOperation(deviceType, operationParamMap, operationType) {
|
function covertDeviceName(deviceInfo, deviceType) {
|
||||||
let deviceName = '';
|
let deviceName = '';
|
||||||
|
const device = store.getters['map/getDeviceByCode'](deviceInfo);
|
||||||
|
if (device._type == 'StationStand') {
|
||||||
|
const station = store.getters['map/getDeviceByCode'](device.stationCode);
|
||||||
|
deviceName += '车站-' + station.name + '/';
|
||||||
|
}
|
||||||
|
if (device._type == 'Section') {
|
||||||
|
if (device.parentCode && device.type == '02') {
|
||||||
|
const parentSection = store.getters['map/getDeviceByCode'](device.parentCode);
|
||||||
|
deviceName += operateEnum[deviceType].type + ' ' + parentSection.name + '-' + device.name;
|
||||||
|
} else {
|
||||||
|
deviceName += operateEnum[deviceType].type + device.name;
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
let deviceNameIn = '';
|
||||||
|
if (device.name) {
|
||||||
|
deviceNameIn = device.name;
|
||||||
|
} else {
|
||||||
|
deviceNameIn = '(车组号:' + device.groupNumber + ')';
|
||||||
|
}
|
||||||
|
deviceName += operateEnum[deviceType].type + ' ' + deviceNameIn;
|
||||||
|
}
|
||||||
|
return deviceName;
|
||||||
|
}
|
||||||
|
|
||||||
|
function covertOperation(deviceType, operationParamMap, operationType) {
|
||||||
|
let deviceName = '【';
|
||||||
let paramName = '';
|
let paramName = '';
|
||||||
if (operateEnum[deviceType].code) {
|
if (operateEnum[deviceType].code) {
|
||||||
const device = store.getters['map/getDeviceByCode'](operationParamMap[operateEnum[deviceType].code]);
|
const deviceInfo = operationParamMap[operateEnum[deviceType].code];
|
||||||
if (device._type == 'StationStand') {
|
if (deviceInfo) {
|
||||||
const station = store.getters['map/getDeviceByCode'](device.stationCode);
|
deviceName += covertDeviceName(deviceInfo, deviceType);
|
||||||
deviceName += '【车站-' + station.name + '】/';
|
|
||||||
}
|
|
||||||
if (device._type == 'Section') {
|
|
||||||
if (device.parentCode && device.type == '02') {
|
|
||||||
const parentSection = store.getters['map/getDeviceByCode'](device.parentCode);
|
|
||||||
deviceName += '【' + operateEnum[deviceType].type + ' ' + parentSection.name + '-' + device.name + '】';
|
|
||||||
} else {
|
|
||||||
deviceName += '【' + operateEnum[deviceType].type + device.name + '】';
|
|
||||||
}
|
|
||||||
} else {
|
} else {
|
||||||
let deviceNameIn = '';
|
const deviceCode = operationParamMap[operateEnum[deviceType][operationType].code];
|
||||||
if (device.name) {
|
const device = store.getters['map/routeList'].find(route=>{ return route.code == deviceCode; });
|
||||||
deviceNameIn = device.name;
|
deviceName += covertDeviceName(device.startSignalCode, deviceType);
|
||||||
} else {
|
|
||||||
deviceNameIn = '(车组号:' + device.groupNumber + ')';
|
|
||||||
}
|
|
||||||
deviceName += '【' + operateEnum[deviceType].type + ' ' + deviceNameIn + '】';
|
|
||||||
}
|
}
|
||||||
|
// if (deviceInfo instanceof Array) {
|
||||||
|
// deviceInfo.forEach((each, index)=>{
|
||||||
|
// deviceName = +covertDeviceName(each, deviceType);
|
||||||
|
// if (index != deviceInfo.length - 1) {
|
||||||
|
// deviceName += ',';
|
||||||
|
// }
|
||||||
|
// });
|
||||||
|
// } else {
|
||||||
|
|
||||||
|
// }
|
||||||
|
deviceName += '】';
|
||||||
|
} else if (operateEnum[deviceType].type) {
|
||||||
|
deviceName += operateEnum[deviceType].type + '】';
|
||||||
}
|
}
|
||||||
const paramInfo = operateEnum[deviceType][operationType];
|
const paramInfo = operateEnum[deviceType][operationType];
|
||||||
if (paramInfo) {
|
if (paramInfo) {
|
||||||
@ -340,4 +392,10 @@ function getStationNameById(stationId) {
|
|||||||
const station = store.getters['map/getDeviceByCode'](stationId);
|
const station = store.getters['map/getDeviceByCode'](stationId);
|
||||||
return station.name;
|
return station.name;
|
||||||
}
|
}
|
||||||
|
function getStationResultById(stationResult) {
|
||||||
|
const station = store.getters['map/getDeviceByCode'](stationResult.stationCode);
|
||||||
|
let param = '不同意';
|
||||||
|
if (stationResult.agree) { param = '同意'; }
|
||||||
|
return station.name + ' ' + param;
|
||||||
|
}
|
||||||
|
|
||||||
|
@ -418,7 +418,7 @@ export default {
|
|||||||
map.stationStandList.forEach(stationStand => {
|
map.stationStandList.forEach(stationStand => {
|
||||||
const section = this.$store.getters['map/getDeviceByCode'](stationStand.standTrackCode);
|
const section = this.$store.getters['map/getDeviceByCode'](stationStand.standTrackCode);
|
||||||
const list = [];
|
const list = [];
|
||||||
section.points.forEach(point => {
|
section && section.points.forEach(point => {
|
||||||
list.push(point.x);
|
list.push(point.x);
|
||||||
});
|
});
|
||||||
if (stationStand.position.x > Math.max(...list) || stationStand.position.x < Math.min(...list)) {
|
if (stationStand.position.x > Math.max(...list) || stationStand.position.x < Math.min(...list)) {
|
||||||
|
@ -140,7 +140,7 @@
|
|||||||
<template v-for="(sectionUnit, j) in formModel[item.prop]">
|
<template v-for="(sectionUnit, j) in formModel[item.prop]">
|
||||||
<div :key="j" style="border: 1px solid #CCCCCC; border-radius: 5px;padding: 2px;padding-top: 10px;">
|
<div :key="j" style="border: 1px solid #CCCCCC; border-radius: 5px;padding: 2px;padding-top: 10px;">
|
||||||
<el-form-item label="左端区段" :prop="'sectionUnitList[' + j + '].leftCode'" label-width="70px">
|
<el-form-item label="左端区段" :prop="'sectionUnitList[' + j + '].leftCode'" label-width="70px">
|
||||||
<el-select v-model="sectionUnit.leftCode" filterable placeholder="请选择" style="width: 115px;">
|
<el-select v-model="sectionUnit.leftCode" filterable placeholder="请选择" clearable style="width: 115px;">
|
||||||
<el-option
|
<el-option
|
||||||
v-for="elem in item.options"
|
v-for="elem in item.options"
|
||||||
:key="elem.code"
|
:key="elem.code"
|
||||||
@ -154,7 +154,7 @@
|
|||||||
>{{ $t('map.activate') }}</el-button>
|
>{{ $t('map.activate') }}</el-button>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item label="右端区段" :prop="'sectionUnitList[' + j + '].rightCode'" label-width="70px">
|
<el-form-item label="右端区段" :prop="'sectionUnitList[' + j + '].rightCode'" label-width="70px">
|
||||||
<el-select v-model="sectionUnit.rightCode" filterable placeholder="请选择" style="width: 115px;">
|
<el-select v-model="sectionUnit.rightCode" filterable placeholder="请选择" clearable style="width: 115px;">
|
||||||
<el-option
|
<el-option
|
||||||
v-for="elem in item.options"
|
v-for="elem in item.options"
|
||||||
:key="elem.code"
|
:key="elem.code"
|
||||||
|
@ -198,7 +198,7 @@ export default {
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
addSectionUnit(i) {
|
addSectionUnit(i) {
|
||||||
this.editModel.sectionUnitList.splice(i+1, 0, {leftCode: '', rightCode: ''});
|
this.editModel.sectionUnitList.splice(i + 1, 0, {leftCode: '', rightCode: ''});
|
||||||
},
|
},
|
||||||
delSectionUnit(i) {
|
delSectionUnit(i) {
|
||||||
this.editModel.sectionUnitList.splice(i, 1);
|
this.editModel.sectionUnitList.splice(i, 1);
|
||||||
@ -239,6 +239,9 @@ export default {
|
|||||||
this.activeName = 'first';
|
this.activeName = 'first';
|
||||||
this.initEditModel();
|
this.initEditModel();
|
||||||
this.editModel = deepAssign(this.editModel, selected);
|
this.editModel = deepAssign(this.editModel, selected);
|
||||||
|
if (!this.editModel.sectionUnitList) {
|
||||||
|
this.editModel.sectionUnitList = [{leftCode: '', rightCode: ''}];
|
||||||
|
}
|
||||||
} else if (selected && selected._type.toUpperCase() === 'Section'.toUpperCase() && this.field === 'leftSectionCode' && this.activeName === 'first') {
|
} else if (selected && selected._type.toUpperCase() === 'Section'.toUpperCase() && this.field === 'leftSectionCode' && this.activeName === 'first') {
|
||||||
this.editModel.leftSectionCode = selected.code;
|
this.editModel.leftSectionCode = selected.code;
|
||||||
} else if (selected && selected._type.toUpperCase() === 'Section'.toUpperCase() && this.field === 'leftSectionCode' && this.activeName === 'second') {
|
} else if (selected && selected._type.toUpperCase() === 'Section'.toUpperCase() && this.field === 'leftSectionCode' && this.activeName === 'second') {
|
||||||
@ -300,7 +303,29 @@ export default {
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
updateMapModel(data) {
|
updateMapModel(data) {
|
||||||
this.$emit('updateMapModel', data);
|
const list = [];
|
||||||
|
let msg = '';
|
||||||
|
if (data.sectionUnitList && data.sectionUnitList.length) {
|
||||||
|
data.sectionUnitList.forEach(item => {
|
||||||
|
if (item.leftCode && item.rightCode) {
|
||||||
|
list.push(item);
|
||||||
|
} else if (item.leftCode && !item.rightCode) {
|
||||||
|
msg = '完善或清除填写过的额外单元信息';
|
||||||
|
} else if (!item.leftCode && item.rightCode) {
|
||||||
|
msg = '完善或清除填写过的额外单元信息';
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
if (msg) {
|
||||||
|
this.$message.error(msg);
|
||||||
|
} else {
|
||||||
|
if (list.length) {
|
||||||
|
data.sectionUnitList = list;
|
||||||
|
} else {
|
||||||
|
delete data.sectionUnitList;
|
||||||
|
}
|
||||||
|
this.$emit('updateMapModel', data);
|
||||||
|
}
|
||||||
},
|
},
|
||||||
deleteObj() {
|
deleteObj() {
|
||||||
this.$refs.dataform.deleteObj();
|
this.$refs.dataform.deleteObj();
|
||||||
|
@ -220,22 +220,22 @@ export default {
|
|||||||
jsonData = that.planConvert.importData(wb.Sheets[index], jsonData);
|
jsonData = that.planConvert.importData(wb.Sheets[index], jsonData);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (that.$route.query.lineCode == '02' && !jsonData[0].downTrack && !jsonData[0].upTrack) {
|
// if (that.$route.query.lineCode == '02' && !jsonData[0].downTrack && !jsonData[0].upTrack) {
|
||||||
|
// that.loadingDig.close();
|
||||||
|
// that.$message.warning(`运行图暂无默认上行折返轨或默认下行折返轨,请输入`);
|
||||||
|
// } else {
|
||||||
|
importRunPlan({ mapId: that.$route.params.mapId || that.$route.query.mapId || '02', runPlanList: jsonData }).then(response => {
|
||||||
that.loadingDig.close();
|
that.loadingDig.close();
|
||||||
that.$message.warning(`运行图暂无默认上行折返轨或默认下行折返轨,请输入`);
|
if (response && response.code == 200) {
|
||||||
} else {
|
that.$message.success(that.$t('tip.importOperationGraphSuccessfully'));
|
||||||
importRunPlan({ mapId: that.$route.params.mapId || that.$route.query.mapId || '02', runPlanList: jsonData }).then(response => {
|
that.$emit('refresh');
|
||||||
that.loadingDig.close();
|
|
||||||
if (response && response.code == 200) {
|
|
||||||
that.$message.success(that.$t('tip.importOperationGraphSuccessfully'));
|
|
||||||
that.$emit('refresh');
|
|
||||||
// this.$emit('dispatchDialog', { name: 'openRunPlan', params: {type: 'add'} });
|
// this.$emit('dispatchDialog', { name: 'openRunPlan', params: {type: 'add'} });
|
||||||
}
|
}
|
||||||
}).catch(error => {
|
}).catch(error => {
|
||||||
that.loadingDig.close();
|
that.loadingDig.close();
|
||||||
that.$message.warning(`${that.$t('tip.importRunGraphFailed')} ${error.message}`);
|
that.$message.warning(`${that.$t('tip.importRunGraphFailed')} ${error.message}`);
|
||||||
});
|
});
|
||||||
}
|
// }
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
that.loadingDig.close();
|
that.loadingDig.close();
|
||||||
that.$message.warning(`${that.$t('tip.parseRunGraphFailed')} ${error.message}`);
|
that.$message.warning(`${that.$t('tip.parseRunGraphFailed')} ${error.message}`);
|
||||||
|
@ -2,7 +2,7 @@
|
|||||||
<el-dialog v-dialogDrag :title="title" :visible.sync="dialogVisible" width="710px" :before-close="handleClose" center :close-on-click-modal="false">
|
<el-dialog v-dialogDrag :title="title" :visible.sync="dialogVisible" width="710px" :before-close="handleClose" center :close-on-click-modal="false">
|
||||||
<el-form ref="form" :model="formModel" label-width="100px" :inline="true">
|
<el-form ref="form" :model="formModel" label-width="100px" :inline="true">
|
||||||
<el-form-item v-if="!isProject" label="单位">
|
<el-form-item v-if="!isProject" label="单位">
|
||||||
<el-select v-model="formModel.companyId" placeholder="请选择单位" clearable size="small" style="width: 400px;" :disabled="update">
|
<el-select v-model="formModel.companyId" placeholder="请选择单位" clearable size="small" style="width: 400px;" :disabled="update" @change="selectQuestion">
|
||||||
<el-option
|
<el-option
|
||||||
v-for="item in companyList"
|
v-for="item in companyList"
|
||||||
:key="item.id"
|
:key="item.id"
|
||||||
@ -45,7 +45,7 @@
|
|||||||
<div style="width: 100%;text-align: center;">{{ `共${totalNum}题,${totalScore}分` }}</div>
|
<div style="width: 100%;text-align: center;">{{ `共${totalNum}题,${totalScore}分` }}</div>
|
||||||
<span slot="footer" class="dialog-footer">
|
<span slot="footer" class="dialog-footer">
|
||||||
<el-button type="primary" @click="doSave">{{ update? '修改' : $t('global.confirm') }}</el-button>
|
<el-button type="primary" @click="doSave">{{ update? '修改' : $t('global.confirm') }}</el-button>
|
||||||
<el-button @click="dialogVisible = false">{{ $t('global.cancel') }}</el-button>
|
<el-button @click="handleClose">{{ $t('global.cancel') }}</el-button>
|
||||||
</span>
|
</span>
|
||||||
</el-dialog>
|
</el-dialog>
|
||||||
</template>
|
</template>
|
||||||
@ -80,11 +80,11 @@ export default {
|
|||||||
answerPoint: 0
|
answerPoint: 0
|
||||||
},
|
},
|
||||||
questionNum: {
|
questionNum: {
|
||||||
select: 0,
|
select: 999,
|
||||||
judge: 0,
|
judge: 999,
|
||||||
multi: 0,
|
multi: 999,
|
||||||
fill:0,
|
fill:999,
|
||||||
answer: 0
|
answer: 999
|
||||||
},
|
},
|
||||||
update: false
|
update: false
|
||||||
};
|
};
|
||||||
@ -106,36 +106,46 @@ export default {
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
watch: {
|
watch: {
|
||||||
'formModel.companyId' () {
|
|
||||||
this.selectQuestion();
|
|
||||||
}
|
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
selectQuestion() {
|
async selectQuestion() {
|
||||||
selectQuestionTypeNum(this.formModel.companyId || '').then(resp => {
|
const questionNumTem = {
|
||||||
resp.data.forEach(item => {
|
|
||||||
this.questionNum[item.type] = item.num;
|
|
||||||
});
|
|
||||||
});
|
|
||||||
},
|
|
||||||
doShow(data) {
|
|
||||||
// console.log(this.companyList);
|
|
||||||
this.dialogVisible = true;
|
|
||||||
this.update = false;
|
|
||||||
this.questionNum = {
|
|
||||||
select: 0,
|
select: 0,
|
||||||
judge: 0,
|
judge: 0,
|
||||||
multi: 0,
|
multi: 0,
|
||||||
fill:0,
|
fill:0,
|
||||||
answer: 0
|
answer: 0
|
||||||
};
|
};
|
||||||
|
const resp = await selectQuestionTypeNum(this.formModel.companyId || '');
|
||||||
|
(resp.data || []).forEach(item => {
|
||||||
|
questionNumTem[item.type] = item.num;
|
||||||
|
});
|
||||||
|
this.questionNum = questionNumTem;
|
||||||
|
},
|
||||||
|
async doShow(data) {
|
||||||
|
this.dialogVisible = true;
|
||||||
|
this.update = false;
|
||||||
if (data) {
|
if (data) {
|
||||||
this.update = true;
|
this.update = true;
|
||||||
this.formModel.id = data.id;
|
this.formModel.id = data.id;
|
||||||
this.formModel.companyId = data.companyId;
|
this.formModel.companyId = data.companyId;
|
||||||
|
const questionNumTem = {
|
||||||
|
select: 0,
|
||||||
|
judge: 0,
|
||||||
|
multi: 0,
|
||||||
|
fill:0,
|
||||||
|
answer: 0
|
||||||
|
};
|
||||||
|
const resp = await selectQuestionTypeNum(this.formModel.companyId || '');
|
||||||
|
(resp.data || []).forEach(item => {
|
||||||
|
questionNumTem[item.type] = item.num;
|
||||||
|
});
|
||||||
|
this.questionNum = questionNumTem;
|
||||||
data.rules.forEach(item => {
|
data.rules.forEach(item => {
|
||||||
|
|
||||||
if (item.type === 'judge') {
|
if (item.type === 'judge') {
|
||||||
this.formModel.judgeNum = item.num;
|
this.formModel.judgeNum = item.num;
|
||||||
|
console.log(this.formModel.judgeNum, item.num);
|
||||||
this.formModel.judgePoint = item.point;
|
this.formModel.judgePoint = item.point;
|
||||||
} else if (item.type === 'select') {
|
} else if (item.type === 'select') {
|
||||||
this.formModel.selectNum = item.num;
|
this.formModel.selectNum = item.num;
|
||||||
@ -145,13 +155,25 @@ export default {
|
|||||||
this.formModel.multiPoint = item.point;
|
this.formModel.multiPoint = item.point;
|
||||||
} else if (item.type === 'fill') {
|
} else if (item.type === 'fill') {
|
||||||
this.formModel.fillNum = item.num;
|
this.formModel.fillNum = item.num;
|
||||||
this.formModel.fillNum = item.point;
|
this.formModel.fillPoint = item.point;
|
||||||
} else if (item.type === 'answer') {
|
} else if (item.type === 'answer') {
|
||||||
this.formModel.answerNum = item.num;
|
this.formModel.answerNum = item.num;
|
||||||
this.formModel.answerPoint = item.point;
|
this.formModel.answerPoint = item.point;
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
} else {
|
} else {
|
||||||
|
const questionNumTem = {
|
||||||
|
select: 0,
|
||||||
|
judge: 0,
|
||||||
|
multi: 0,
|
||||||
|
fill:0,
|
||||||
|
answer: 0
|
||||||
|
};
|
||||||
|
const resp = await selectQuestionTypeNum(this.formModel.companyId || '');
|
||||||
|
(resp.data || []).forEach(item => {
|
||||||
|
questionNumTem[item.type] = item.num;
|
||||||
|
});
|
||||||
|
this.questionNum = questionNumTem;
|
||||||
this.formModel = {
|
this.formModel = {
|
||||||
id: '',
|
id: '',
|
||||||
companyId: '',
|
companyId: '',
|
||||||
@ -170,6 +192,27 @@ export default {
|
|||||||
},
|
},
|
||||||
handleClose() {
|
handleClose() {
|
||||||
this.dialogVisible = false;
|
this.dialogVisible = false;
|
||||||
|
this.formModel = {
|
||||||
|
id: '',
|
||||||
|
companyId: '',
|
||||||
|
judgeNum: 0,
|
||||||
|
judgePoint: 0,
|
||||||
|
selectNum: 0,
|
||||||
|
selectPoint: 0,
|
||||||
|
multiNum: 0,
|
||||||
|
multiPoint: 0,
|
||||||
|
fillNum: 0,
|
||||||
|
fillPoint: 0,
|
||||||
|
answerNum: 0,
|
||||||
|
answerPoint: 0
|
||||||
|
};
|
||||||
|
this.questionNum = {
|
||||||
|
select: 999,
|
||||||
|
judge: 999,
|
||||||
|
multi: 999,
|
||||||
|
fill:999,
|
||||||
|
answer: 999
|
||||||
|
};
|
||||||
},
|
},
|
||||||
doSave() {
|
doSave() {
|
||||||
const params = {
|
const params = {
|
||||||
|
@ -13,7 +13,7 @@
|
|||||||
>添加</el-button>
|
>添加</el-button>
|
||||||
<el-button
|
<el-button
|
||||||
size="mini"
|
size="mini"
|
||||||
type="danger"
|
type="success"
|
||||||
@click="handlerBack"
|
@click="handlerBack"
|
||||||
>返回</el-button>
|
>返回</el-button>
|
||||||
</div>
|
</div>
|
||||||
@ -87,6 +87,7 @@
|
|||||||
<template slot-scope="scope">
|
<template slot-scope="scope">
|
||||||
<el-button
|
<el-button
|
||||||
size="mini"
|
size="mini"
|
||||||
|
type="primary"
|
||||||
@click="handleUpdate(scope.$index, scope.row)"
|
@click="handleUpdate(scope.$index, scope.row)"
|
||||||
>编辑</el-button>
|
>编辑</el-button>
|
||||||
<el-button
|
<el-button
|
||||||
|
Loading…
Reference in New Issue
Block a user