desc: 调整琏计划导入excel, 样式, 流程

This commit is contained in:
zyy 2019-09-23 13:37:11 +08:00
parent bdfd65eadb
commit 01c97f45ae
27 changed files with 297 additions and 235 deletions

View File

@ -227,5 +227,7 @@ export default {
startTime: 'Start time',
endTime: 'End time',
editPlanningTrain: 'Edit planning train',
runGraphName: 'Run graph name'
runGraphName: 'Run graph name',
tipOperationTime: '请先设置区段站间运行时间, 【文件】-> 【修改站间运行时间】',
serverTrainNum: '表号车次号'
};

View File

@ -230,5 +230,7 @@ export default {
task: '任务',
startTime: '起始时间',
endTime: '终到时间',
editPlanningTrain: '编辑计划车'
editPlanningTrain: '编辑计划车',
tipOperationTime: '请先设置区段站间运行时间, 【文件】-> 【修改站间运行时间】',
serverTrainNum: '表号车次号'
};

View File

@ -137,8 +137,9 @@ export default {
lastPoint = train.stationTimeList[idx - 1];
nextPoint = service.tripNumberDataList[j + 1].stationTimeList[1];
num = this.computedReentryNumber(train.tripNumber);
opt.data.push([lastPoint.secondTime, this.getCoordYByElem(stations, kmRangeCoordMap, lastPoint, train.directionCode, true, num), lastPoint.stationCode]);
opt.data.push([nextPoint.secondTime, this.getCoordYByElem(stations, kmRangeCoordMap, nextPoint, train.directionCode, true, num), nextPoint.stationCode]);
const aa = `${train.directionCode}${train.tripNumber}`;
opt.data.push([lastPoint.secondTime, this.getCoordYByElem(stations, kmRangeCoordMap, lastPoint, train.directionCode, true, num), lastPoint.stationCode, aa]);
opt.data.push([nextPoint.secondTime, this.getCoordYByElem(stations, kmRangeCoordMap, nextPoint, train.directionCode, true, num), nextPoint.stationCode, aa]);
}
/** 如果是备用车,按车次添加线*/

View File

@ -122,7 +122,6 @@
import XLSX from 'xlsx';
import { mapGetters } from 'vuex';
import { importRunPlan } from '@/api/runplan';
import { importData } from '../planConvert';
import { launchFullscreen } from '@/utils/screen';
import { EventBus } from '@/scripts/event-bus';

View File

@ -118,8 +118,9 @@ export default {
lastPoint = train.stationTimeList[idx - 1];
nextPoint = service.tripNumberDataList[j + 1].stationTimeList[1];
num = this.computedReentryNumber(train.tripNumber);
opt.data.push([lastPoint.secondTime, this.getCoordYByElem(stations, kmRangeCoordMap, lastPoint, train.directionCode, true, num), lastPoint.stationCode]);
opt.data.push([nextPoint.secondTime, this.getCoordYByElem(stations, kmRangeCoordMap, nextPoint, train.directionCode, true, num), nextPoint.stationCode]);
const aa = `${train.directionCode}${train.tripNumber}`;
opt.data.push([lastPoint.secondTime, this.getCoordYByElem(stations, kmRangeCoordMap, lastPoint, train.directionCode, true, num), lastPoint.stationCode, aa]);
opt.data.push([nextPoint.secondTime, this.getCoordYByElem(stations, kmRangeCoordMap, nextPoint, train.directionCode, true, num), nextPoint.stationCode, aa]);
}
/** 如果是备用车,按车次添加线*/

View File

@ -122,7 +122,6 @@
import XLSX from 'xlsx';
import { mapGetters } from 'vuex';
import { importRunPlan } from '@/api/runplan';
import { importData } from '../planConvert';
import { launchFullscreen } from '@/utils/screen';
import { EventBus } from '@/scripts/event-bus';

View File

@ -122,7 +122,6 @@
import XLSX from 'xlsx';
import { mapGetters } from 'vuex';
import { importRunPlan } from '@/api/runplan';
import { importData } from '../planConvert';
import { launchFullscreen } from '@/utils/screen';
import { EventBus } from '@/scripts/event-bus';

View File

@ -10,108 +10,149 @@ export default {
/** 偏移时间*/
TranslationTime: 60 * 60 * 2,
/** excel解析配置*/
ExcelConfig: {
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);
if (dataList && dataList.length) {
const needList = Object.keys(this.ExcelConfig.columns);
const tripObj = { upTrack: '', downTrack: '' };
if (dataList && dataList.length) {
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;
/** 解析二维数组为json对象*/
const reg0 = /^[↑|↓|¡|ü|ý|]+(.*)/;
const reg1 = /^([▼|▲|¡ø|¨‹]+)\s*(\d+:\d+:\d+)/;
const reg2 = /^(\d+:\d+:\d+)\s*([▼|▲|¡ø|¨‹]+)/;
const reg3 = /^(\d+:\d+:\d+)\s*(\d+:\d+:\d+|)/;
const reg4 = /[▼|▲|¡|ø|¨|‹]+/;
for (var rowIndex = this.ExcelConfig.beginRow; isContinue; rowIndex += 1) {
isContinue = false;
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]}`.trim();
/** 匹配到开始位置或者结束位置*/
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);
var title = dataList[colIndex][0];
var value = dataList[colIndex][rowIndex];
begTime = reg4.test(begTime) ? '' : begTime;
endTime = reg4.test(endTime) ? '' : endTime;
if (title && value) {
// 数据列解析
isContinue = true;
var titleStr = `${title}`.replace(/\s*/g, '');
var valueStr = `${value}`.replace(/\s*/g, '');
/** 下行方向时间互换*/
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);
}
// 取需要的字段
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;
},
@ -154,8 +195,9 @@ export default {
if (!train.backup && train.reentry && service.tripNumberDataList[j + 1] && service.tripNumberDataList[j + 1].stationTimeList) {
lastPoint = train.stationTimeList[idx];
nextPoint = service.tripNumberDataList[j + 1].stationTimeList[0];
opt.data.push([lastPoint.secondTime, this.getCoordYByElem(stations, kmRangeCoordMap, lastPoint, train.directionCode, true), lastPoint.stationCode]);
opt.data.push([nextPoint.secondTime, this.getCoordYByElem(stations, kmRangeCoordMap, lastPoint, train.directionCode, true), lastPoint.stationCode]);
const aa = `${train.directionCode}${train.tripNumber}`;
opt.data.push([lastPoint.secondTime, this.getCoordYByElem(stations, kmRangeCoordMap, lastPoint, train.directionCode, true), lastPoint.stationCode, aa, '折返轨']);
opt.data.push([nextPoint.secondTime, this.getCoordYByElem(stations, kmRangeCoordMap, lastPoint, train.directionCode, true), lastPoint.stationCode, aa, '折返轨']);
}
/** 如果是备用车,按车次添加线*/

View File

@ -122,7 +122,6 @@
import XLSX from 'xlsx';
import { mapGetters } from 'vuex';
import { importRunPlan } from '@/api/runplan';
import { importData } from '../planConvert';
import { launchFullscreen } from '@/utils/screen';
import { EventBus } from '@/scripts/event-bus';

View File

@ -230,14 +230,12 @@ function s2ab(s) {
export function export_table_to_excel(id) {
var theTable = document.getElementById(id);
console.log('a')
var oo = generateArray(theTable);
var ranges = oo[1];
/* original data */
var data = oo[0];
var ws_name = "SheetJS";
console.log(data);
var wb = new Workbook(), ws = sheet_from_array_of_arrays(data);

View File

@ -128,10 +128,6 @@ export default {
}
},
watch: {
// ruleList(list) {
// console.log(list, 1111);
// this.reloadTable();
// }
},
mounted() {
this.loadInitData();

View File

@ -39,7 +39,6 @@ export default {
},
methods: {
qrCodeShow(data) { //
console.log(data);
this.url = data.url;
},
turnback() {

View File

@ -448,13 +448,13 @@ export default {
}).catch(error => {
that.loading.close();
that.refresh();
that.$message.warning(this.$t('tip.importRunGraphFailed') + error.message);
that.$message.warning(that.$t('tip.importRunGraphFailed') + error.message);
});
} catch (error) {
that.loading.close();
that.refresh();
that.$message.warning(this.$t('tip.parseRunGraphFailed') + error.message);
that.$message.warning(that.$t('tip.parseRunGraphFailed') + error.message);
}
}
};

View File

@ -11,14 +11,14 @@
:close-on-click-modal="false"
>
<el-row>
<el-col :span="6" :offset="2" style="height: 30px; line-height: 30px;">{{$t('planMonitor.serviceNumber2')+$t('global.colon')}}</el-col>
<el-col :span="6" :offset="2" style="height: 30px; line-height: 30px;">{{ $t('planMonitor.serviceNumber2')+$t('global.colon') }}</el-col>
<el-col :span="10" :offset="1">
<el-input v-model="serviceNumber" size="mini" />
</el-col>
</el-row>
<span slot="footer" class="dialog-footer">
<el-button size="medium" @click="doClose">{{$t('global.cancel')}}</el-button>
<el-button type="primary" size="medium" @click="handleCommit">{{$t('global.confirm')}}</el-button>
<el-button size="medium" @click="doClose">{{ $t('global.cancel') }}</el-button>
<el-button type="primary" size="medium" @click="handleCommit">{{ $t('global.confirm') }}</el-button>
</span>
</el-dialog>
</template>

View File

@ -4,18 +4,19 @@
class="planEdit__tool add-task"
:title="title"
:visible.sync="dialogShow"
width="780px"
width="880px"
:before-close="doClose"
:z-index="2000"
top="50px"
:modal="false"
:close-on-click-modal="false"
>
<el-row>
<el-col :span="3" style="height: 28px;line-height: 28px;">
<el-radio v-model="addModel.addToFront" :label="true">{{$t('planMonitor.addToTheFront')}}</el-radio>
<el-radio v-model="addModel.addToFront" :label="true">{{ $t('planMonitor.addToTheFront') }}</el-radio>
</el-col>
<el-col :span="4" style="margin-left: 10px;height: 28px;line-height: 28px;">
<span>{{$t('planMonitor.tripNumber')+$t('global.colon')}}</span>
<el-col :span="3" style="margin-left: 10px;height: 28px;line-height: 28px;">
<span>{{ $t('planMonitor.tripNumber')+$t('global.colon') }}</span>
</el-col>
<el-col :span="5">
<el-select v-model="addModel.tripNumber" size="mini" :placeholder="this.$t('global.choose')">
@ -27,8 +28,8 @@
/>
</el-select>
</el-col>
<el-col :span="4" style="margin-left: 20px;height: 28px;line-height: 28px;">
<span>{{$t('global.startTime')+$t('global.colon')}}</span>
<el-col :span="3" style="margin-left: 20px;height: 28px;line-height: 28px;">
<span>{{ $t('global.startTime')+$t('global.colon') }}</span>
</el-col>
<el-col :span="5">
<el-time-picker v-model="addModel.startTime" size="mini" value-format="HH:mm:ss" :clearable="false" />
@ -36,10 +37,10 @@
</el-row>
<el-row style="margin-top: 5px;height: 28px;line-height: 28px;">
<el-col :span="3">
<el-radio v-model="addModel.addToFront" :label="false">{{$t('planMonitor.addToTheEnd')}}</el-radio>
<el-radio v-model="addModel.addToFront" :label="false">{{ $t('planMonitor.addToTheEnd') }}</el-radio>
</el-col>
<el-col :span="4" style="margin-left: 10px;height: 28px;line-height: 28px;">
<span>{{$t('planMonitor.defaultStopTime')+$t('global.colon')}}</span>
<el-col :span="3" style="margin-left: 10px;height: 28px;line-height: 28px;">
<span>{{ $t('planMonitor.defaultStopTime') }}</span>
</el-col>
<el-col :span="5">
<el-select v-model="addModel.defaultStopTime" size="mini" :placeholder="this.$t('global.choose')">
@ -51,8 +52,8 @@
/>
</el-select>
</el-col>
<el-col :span="4" style="margin-left: 20px;height: 28px;line-height: 28px;">
<span>{{$t('planMonitor.defaultRunLevel')+$t('global.colon')}}</span>
<el-col :span="3" style="margin-left: 20px;height: 28px;line-height: 28px;">
<span>{{ $t('planMonitor.defaultRunLevel') }}</span>
</el-col>
<el-col :span="5">
<el-select v-model="addModel.defaultSpeedLevel" size="mini" :placeholder="this.$t('global.choose')">
@ -67,14 +68,14 @@
</el-row>
<el-row style="margin-bottom: 5px;">
{{$t('planMonitor.crossRailway')+$t('global.colon')}}
{{ $t('planMonitor.crossRailway')+$t('global.colon') }}
</el-row>
<el-row>
<el-table
:data="addModel.routingList"
border
highlight-current-row
:height="180"
:height="280"
@row-click="handleClick"
>
<el-table-column prop="startStationCode" :label="this.$t('planMonitor.startingStation')">
@ -82,7 +83,7 @@
{{ formatName(scope.row.startStationCode) }}
</template>
</el-table-column>
<el-table-column prop="startSectionCode" :label="this.$t('planMonitor.startingSection')">
<el-table-column prop="startSectionCode" :label="this.$t('planMonitor.startingSection')" width="95">
<template slot-scope="scope">
{{ formatName(scope.row.startSectionCode) }}
</template>
@ -92,16 +93,16 @@
{{ formatName(scope.row.endStationCode) }}
</template>
</el-table-column>
<el-table-column prop="endSectionCode" :label="this.$t('planMonitor.endingSection')">
<el-table-column prop="endSectionCode" :label="this.$t('planMonitor.endingSection')" width="95">
<template slot-scope="scope">
{{ formatName(scope.row.endSectionCode) }}
</template>
</el-table-column>
<el-table-column prop="remarks" :label="this.$t('planMonitor.description')" />
<el-table-column prop="remarks" :label="this.$t('planMonitor.description')" width="315" />
</el-table>
</el-row>
<el-row style=" margin-bottom: 5px;margin-top: 10px;">
{{$t('global.details')+$t('global.colon')}}
{{ $t('global.details')+$t('global.colon') }}
</el-row>
<el-row>
<el-table :data="addModel.arriveConfigList" border :height="180">
@ -116,19 +117,23 @@
</template>
</el-table-column>
<el-table-column prop="arriveTime" :label="this.$t('planMonitor.arriveTime')" />
<el-table-column prop="stopTime" :label="this.$t('planMonitor.stopTime')" />
<el-table-column prop="stopTime" :label="this.$t('planMonitor.stopTime')">
<template slot-scope="scope">
<el-input v-model="scope.row.stopTime" placeholder="请输入时间" size="mini" @change="changeStopTime(scope.$index, scope.row.stopTime)" />
</template>
</el-table-column>
<el-table-column prop="departureTime" :label="this.$t('planMonitor.departureTime')" />
<el-table-column prop="speedLevel" :label="this.$t('planMonitor.runLevel')" />
</el-table>
</el-row>
<el-row>
<el-col :offset="16">
<el-checkbox v-model="showDefault">{{$t('planMonitor.showDefaultStopTimeAndRunLevel')}}</el-checkbox>
<el-checkbox v-model="showDefault">{{ $t('planMonitor.showDefaultStopTimeAndRunLevel') }}</el-checkbox>
</el-col>
</el-row>
<span slot="footer" class="dialog-footer">
<el-button size="medium" @click="doClose">{{$t('global.cancel')}}</el-button>
<el-button type="primary" size="medium" @click="handleCommit">{{$t('global.confirm')}}</el-button>
<el-button size="medium" @click="doClose">{{ $t('global.cancel') }}</el-button>
<el-button type="primary" size="medium" @click="handleCommit">{{ $t('global.confirm') }}</el-button>
</span>
</el-dialog>
</template>
@ -163,14 +168,14 @@ export default {
planId: '',
tripNumber: '',
serviceNumber: '',
defaultStopTime: '',
defaultSpeedLevel: '',
defaultStopTime: '30',
defaultSpeedLevel: 'level3',
routingList: [],
arriveConfigList: []
},
tripNumberList: [{ value: '', label: this.$t('planMonitor.automatic') }],
defaultStopTimeList: [{ value: '', label: this.$t('planMonitor.default') }],
defaultSpeedLevelList: [{ value: '', label: this.$t('planMonitor.default') }]
defaultStopTimeList: [{ value: '30', label: this.$t('planMonitor.default') }, { value: '0', label: '0' }],
defaultSpeedLevelList: [{ value: 'level3', label: this.$t('planMonitor.default') }]
};
},
computed: {
@ -208,11 +213,24 @@ export default {
const skinCode = this.$route.query.skinCode;
if (skinCode) {
getStationRunning(skinCode).then(resp => {
getStationRunning(skinCode).then(resp => { //
const list = resp.data;
list.forEach(elem => {
this.stopStationMap[[elem.startSectionCode, elem.endSectionCode].toString()] = elem;
});
if (list && list.length) {
list.forEach(elem => {
if (!elem.runPlanLevelVO) {
this.$alert(`${this.$t('planMonitor.tipOperationTime')}`, {
confirmButtonText: this.$t('global.confirm'),
callback: action => {
this.doClose();
}
});
}
});
}
});
}
},
@ -247,33 +265,37 @@ export default {
return runTime;
},
changeStopTime(indexs, time) {
let tempTime = this.computedTimeByString(this.addModel.startTime) / 1000 - 30;
const runLevel = this.addModel.defaultSpeedLevel || 'level3'; //
this.addModel.arriveConfigList.forEach((elem, index) => {
if (indexs == index) {
elem.stopTime = time ? Number(time) : 0;
}
elem.arriveTime = index ? formatTime(tempTime) : '';
elem.departureTime = index == this.addModel.arriveConfigList.length - 1 ? '' : formatTime(tempTime + elem.stopTime);
elem.speedLevel = this.addModel.defaultSpeedLevel == 'level3' ? this.$t('planMonitor.default') : '';
tempTime = tempTime + elem.stopTime + this.compuntedRunTime(this.addModel.arriveConfigList, index, runLevel);
});
this.addModel.endTime = formatTime(tempTime - this.addModel.arriveConfigList[this.addModel.arriveConfigList.length - 1].stopTime);
},
computedDetailList() {
if (this.addModel.routingCode) {
querySectionListByRouting({ planId: this.$route.query.planId, routingCode: this.addModel.routingCode }).then(resp => {
const list = resp.data;
const waitTime = this.addModel.defaultStopTime || 30; //
const waitTime = Number(this.addModel.defaultStopTime) || 0; //
let tempTime = this.computedTimeByString(this.addModel.startTime) / 1000 - 30;
const runLevel = this.addModel.defaultSpeedLevel || 'level3'; //
list.forEach((elem, index) => {
elem.arriveTime = index ? formatTime(tempTime) : '';
elem.departureTime = index == list.length - 1 ? '' : formatTime(tempTime + waitTime);
elem.stopTime = this.addModel.defaultSpeedLevel || this.$t('planMonitor.default');
elem.speedLevel = this.addModel.defaultStopTime || this.$t('planMonitor.default');
elem.speedLevel = this.addModel.defaultSpeedLevel == 'level3' ? this.$t('planMonitor.default') : '';
elem.stopTime = this.addModel.defaultStopTime != '0' ? 30 : 0;
tempTime = tempTime + waitTime + this.compuntedRunTime(list, index, runLevel);
});
// let startSection = this.$store.getters['map/getDeviceByCode'](this.addModel.startSectionCode);
// if (startSection && startSection.isReentryTrack) {
// list.shift();
// }
// let endSection = this.$store.getters['map/getDeviceByCode'](this.addModel.endSectionCode);
// if (endSection && endSection.isReentryTrack) {
// list.pop();
// }
this.addModel.arriveConfigList = list;
this.addModel.endTime = formatTime(tempTime - waitTime);
this.addModel.endTime = formatTime(tempTime - list[list.length - 1].stopTime);
});
}
},

View File

@ -230,16 +230,16 @@ export default {
importRunPlan({ skinCode: that.$route.query.skinCode || '02', runPlanList: jsonData }).then(response => {
that.loadingDig.close();
that.$message.success(this.$t('tip.importOperationGraphSuccessfully'));
that.$message.success(that.$t('tip.importOperationGraphSuccessfully'));
// this.$emit('dispatchDialog', { name: 'openRunPlan', params: {type: 'add'} });
}).catch(error => {
that.loadingDig.close();
that.$message.warning(`${this.$t('tip.importRunGraphFailed')} ${error.message}`);
that.$message.warning(`${that.$t('tip.importRunGraphFailed')} ${error.message}`);
});
} catch (error) {
that.loadingDig.close();
that.$message.warning(`${this.$t('tip.parseRunGraphFailed')} ${error.message}`);
that.$message.warning(`${that.$t('tip.parseRunGraphFailed')} ${error.message}`);
}
}
};

View File

@ -11,26 +11,20 @@
:close-on-click-modal="false"
>
<el-row>
<el-col :span="3">{{$t('planMonitor.serviceNumber')+$t('global.colon')}}</el-col>
<el-col :span="3">{{ $t('planMonitor.serviceNumber')+$t('global.colon') }}</el-col>
<el-col :span="4">
<el-input v-model="model.serviceNumber" disabled size="mini" />
</el-col>
<el-col :span="4" :offset="1">
<el-checkbox v-model="model.debugTrain">{{$t('planMonitor.commissioningTrain')}}</el-checkbox>
<el-checkbox v-model="model.debugTrain">{{ $t('planMonitor.commissioningTrain') }}</el-checkbox>
</el-col>
</el-row>
<el-row style="margin-top: 5px">
{{$t('planMonitor.task')}}
{{ $t('planMonitor.task') }}
</el-row>
<el-row>
<div style=" float: left; width: 78%">
<el-table
:data="model.tripConfigList"
highlight-current-row
border
:height="380"
@current-change="handleCurrentChange"
>
<el-table :data="model.tripConfigList" highlight-current-row border :height="380" @current-change="handleCurrentChange">
<el-table-column prop="beginStationCode" :label="this.$t('planMonitor.startingStation')">
<template slot-scope="scope">
{{ formatName(scope.row.startStationCode) }}
@ -55,12 +49,12 @@
</el-table>
</div>
<div style="float: right; width: 22%">
<el-button class="view-button" :disabled="disabled" @click="handleEditTask">{{$t('planMonitor.modifyTask')}}</el-button>
<el-button class="view-button" :disabled="disabled" @click="handleEditTask">{{ $t('planMonitor.modifyTask') }}</el-button>
<el-button class="view-button" :disabled="disabled" @click="handleAddTask">
{{$t('planMonitor.addTask')}}
{{ $t('planMonitor.addTask') }}
</el-button>
<el-button class="view-button" :disabled="disabled" @click="handleDeleteTask">{{$t('planMonitor.deleteTask')}}</el-button>
<el-button class="view-button" :disabled="disabled" @click="handleCommit">{{$t('global.confirm')}}</el-button>
<el-button class="view-button" :disabled="disabled" @click="handleDeleteTask">{{ $t('planMonitor.deleteTask') }}</el-button>
<el-button class="view-button" :disabled="disabled" @click="handleCommit">{{ $t('global.confirm') }}</el-button>
</div>
</el-row>
</el-dialog>
@ -119,7 +113,6 @@ export default {
endTime: formatTime(trainInfo.stationTimeList[lastIndex].secondTime),
arriveConfigList: []
};
// console.log(editData.trainMap[tripNumber]);
this.model.tripConfigList.push(taskObj);
});
}

View File

@ -84,14 +84,14 @@
</el-table-column>
<el-table-column :label="$t('planMonitor.modifying.operation')" width="100">
<template slot-scope="scope">
<el-button type="text" size="small" @click="handleUpdate(scope.row)">{{$t('planMonitor.modifying.edit')}}</el-button>
<el-button type="text" size="small" @click="handleUpdate(scope.row)">{{ $t('planMonitor.modifying.edit') }}</el-button>
</template>
</el-table-column>
</el-table>
</el-row>
<div class="button-group" style="text-align: center; margin-top: 10px;">
<el-button type="primary" @click="handleSave">{{$t('planMonitor.modifying.save')}}</el-button>
<el-button @click="doClose">{{$t('planMonitor.modifying.cancelAndQuit')}}</el-button>
<el-button type="primary" @click="handleSave">{{ $t('planMonitor.modifying.save') }}</el-button>
<el-button @click="doClose">{{ $t('planMonitor.modifying.cancelAndQuit') }}</el-button>
</div>
<update-station-interval-time ref="updateStationIntervalTime" @handleConfirm="handleConfirm" />
</el-dialog>
@ -121,7 +121,7 @@ export default {
level5: 22
}
};
},
},
computed: {
title() {
return this.$t('planMonitor.modifying.modifyRunLevel');

View File

@ -7,6 +7,7 @@
width="1000px"
:before-close="doClose"
:z-index="2000"
top="50px"
:modal="false"
:close-on-click-modal="false"
>
@ -135,7 +136,7 @@
<el-col :span="5" class="lineHeight">
<el-row>
<el-col :span="9" :offset="2">
<span>{{ $t('planMonitor.modifying.startTime') }}</span>
<span>{{ $t('planMonitor.modifying.startTime') }}</span>
</el-col>
<el-col :span="13">
<el-time-picker
@ -183,15 +184,15 @@
</template>
</el-table-column>
<el-table-column prop="endSectionCode" :label="$t('planMonitor.modifying.endSection')" />
<el-table-column prop="remarks" :label="$t('planMonitor.modifying.description')" :width="280" />
<el-table-column :width="40" />
<el-table-column prop="remarks" :label="$t('planMonitor.modifying.description')" :width="315" />
<!-- <el-table-column :width="40" /> -->
</el-table>
</el-row>
<el-row style=" margin-bottom: 5px;margin-top: 10px;">
{{ $t('planMonitor.modifying.detail') }}
</el-row>
<el-row>
<el-table :data="editModel.arriveConfigList" border :height="180">
<el-table :data="editModel.arriveConfigList" border :height="260">
<el-table-column prop="stationCode" :label="$t('planMonitor.modifying.station')">
<template slot-scope="scope">
{{ formatName(scope.row.stationCode) }}
@ -298,7 +299,13 @@ export default {
if (stopStationObj.runPlanLevelVO) {
runTime = parseInt(stopStationObj.runPlanLevelVO[runLevel]);
} else {
this.$messageBox(`${this.$t('planMonitor.modifying.setMessageTip1')} ${stopStationObj.startSectionCode} ${this.$t('planMonitor.modifying.setMessageTip2')} ${stopStationObj.endSectionCode} ${this.$t('planMonitor.modifying.setMessageTip3')}`);
// this.$messageBox(`${this.$t('planMonitor.modifying.setMessageTip1')} ${stopStationObj.startSectionCode} ${this.$t('planMonitor.modifying.setMessageTip2')} ${stopStationObj.endSectionCode} ${this.$t('planMonitor.modifying.setMessageTip3')}`);
this.$alert(`${this.$t('planMonitor.tipOperationTime')}`, {
confirmButtonText: this.$t('global.confirm'),
callback: action => {
this.doClose();
}
});
}
}
}
@ -369,7 +376,7 @@ export default {
};
this.editModel.routingList = [];
getRoutingBySDTNumber(model).then(resp => {
getRoutingBySDTNumber(model).then(resp => { //
const routingObj = resp.data;
this.editModel.routingCode = routingObj.code;
this.editModel.routingList.push(routingObj);

View File

@ -18,8 +18,8 @@
</el-col>
</el-row>
<span slot="footer" class="dialog-footer">
<el-button size="medium" @click="doClose">{{$t('global.cancel')}}</el-button>
<el-button type="primary" size="medium" @click="handleCommit">{{$t('global.confirm')}}</el-button>
<el-button size="medium" @click="doClose">{{ $t('global.cancel') }}</el-button>
<el-button type="primary" size="medium" @click="handleCommit">{{ $t('global.confirm') }}</el-button>
</span>
</el-dialog>
</template>
@ -39,7 +39,7 @@ export default {
},
computed: {
title() {
return this.$t('planMonitor.updateStation.deletePlanCar');
return this.$t('planMonitor.updateStation.deletePlanCar');
},
width() {
if (this.params.width) {

View File

@ -11,8 +11,8 @@
:close-on-click-modal="false"
>
<el-row type="flex" justify="center" class="button-group">
<el-button @click="handleCommit">{{$t('global.confirm')}}</el-button>
<el-button @click="doClose">{{$t('global.cancel')}}</el-button>
<el-button @click="handleCommit">{{ $t('global.confirm') }}</el-button>
<el-button @click="doClose">{{ $t('global.cancel') }}</el-button>
</el-row>
</el-dialog>
</template>

View File

@ -12,8 +12,8 @@
>
<el-input v-model="context" type="textarea" :rows="10" readonly />
<span slot="footer" class="dialog-footer">
<el-button size="medium" @click="doClose">{{$t('global.cancel')}}</el-button>
<el-button type="primary" size="medium" @click="handleCommit">{{$t('global.confirm')}}</el-button>
<el-button size="medium" @click="doClose">{{ $t('global.cancel') }}</el-button>
<el-button type="primary" size="medium" @click="handleCommit">{{ $t('global.confirm') }}</el-button>
</span>
</el-dialog>
</template>

View File

@ -1,42 +1,32 @@
<template>
<el-dialog
v-dialogDrag
class="planEdit__tool update-station-interval-time"
:title="title"
:visible.sync="dialogShow"
width="420px"
:before-close="doClose"
:z-index="2000"
:modal="false"
:close-on-click-modal="false"
>
<el-dialog v-dialogDrag class="planEdit__tool update-station-interval-time" :title="title" :visible.sync="dialogShow" width="420px" :before-close="doClose" :z-index="2000" :modal="false" :close-on-click-modal="false">
<el-row>
<el-form ref="form" :model="runPlanLevelVO" label-width="140px" size="mini" :rules="rules">
<el-form-item :label="$t('planMonitor.updateStation.level1')" prop="level1">
<el-input-number v-model="runPlanLevelVO.level1" :min="1" />
<span>{{$t('global.second')}}</span>
<span>{{ $t('global.second') }}</span>
</el-form-item>
<el-form-item :label="$t('planMonitor.updateStation.level2')" prop="level2">
<el-input-number v-model="runPlanLevelVO.level2" :min="1" />
<span>{{$t('global.second')}}</span>
<span>{{ $t('global.second') }}</span>
</el-form-item>
<el-form-item :label="$t('planMonitor.updateStation.level3')" prop="level3">
<el-input-number v-model="runPlanLevelVO.level3" :min="1" />
<span>{{$t('global.second')}}</span>
<span>{{ $t('global.second') }}</span>
</el-form-item>
<el-form-item :label="$t('planMonitor.updateStation.level4')" prop="level4">
<el-input-number v-model="runPlanLevelVO.level4" :min="1" />
<span>{{$t('global.second')}}</span>
<span>{{ $t('global.second') }}</span>
</el-form-item>
<el-form-item :label="$t('planMonitor.updateStation.level5')" prop="level5">
<el-input-number v-model="runPlanLevelVO.level5" :min="1" />
<span>{{$t('global.second')}}</span>
<span>{{ $t('global.second') }}</span>
</el-form-item>
</el-form>
</el-row>
<el-row type="flex" justify="center" class="button-group">
<el-button @click="handleCommit">{{$t('global.confirm')}}</el-button>
<el-button @click="doClose">{{$t('global.cancel')}}</el-button>
<el-button @click="handleCommit">{{ $t('global.confirm') }}</el-button>
<el-button @click="doClose">{{ $t('global.cancel') }}</el-button>
</el-row>
</el-dialog>
</template>

View File

@ -118,13 +118,19 @@ export default {
}
},
tooltip: {
trigger: 'axis',
axisPointer: {
trigger: 'item',
// trigger: 'item',
type: 'cross',
snap: true
snap: true,
axis: 'x'
},
formatter: this.axisTooltip,
borderWidth: 1
borderWidth: 1,
position: function (pt) {
const data = pt[0] + 10;
return [data, '20%'];
}
},
xAxis: [
{
@ -521,13 +527,23 @@ export default {
}
},
axisTooltip(param) {
const station = this.stations[Math.floor((param.data[1] - this.planConvert.EdgeHeight) / this.planConvert.CoordMultiple)] || { name: '', kmRange: '' };
return [
`Point Data <hr size=1 style="margin: 3px 0">`,
`${this.$t('planMonitor.stationName')}${station.name}<br>`,
`${this.$t('planMonitor.stationKilometerMark')}${station.kmRange} km <br>`,
`${this.$t('planMonitor.arriveTime')}${timeFormat(param.data[0] + this.planConvert.TranslationTime)} (${param.data[0]})<br>`
].join('');
let data = '';
const arr = [];
param.forEach(item => {
const station = this.stations[Math.floor((item.data[1] - this.planConvert.EdgeHeight) / this.planConvert.CoordMultiple)] || { name: '', kmRange: '' };
if (!arr.includes(`${item.data[0]}${item.data[1]}`)) {
arr.push(`${item.data[0]}${item.data[1]}`);
const list = [
`${this.$t('planMonitor.stationName')}${station.name}<br>`,
`${this.$t('planMonitor.stationKilometerMark')}${station.kmRange} km <br>`,
`${this.$t('planMonitor.arriveTime')}${timeFormat(item.data[0] + this.planConvert.TranslationTime)}<br>`,
`${this.$t('planMonitor.serverTrainNum')}: ${item.seriesName}${item.data[3]}(${item.data[3][0] == '2' ? '上行' : '下行'})`,
`<hr size=1 style="margin: 3px 0">`
];
data += list.join('');
}
});
return data;
},
// mouseClick(params) {
// const model = {

View File

@ -1,19 +1,19 @@
<template>
<div class="PlanStatusBar">
<ul class="ul-box">
<div class="li_plan" @click="showTrain">{{$t('planMonitor.serviceAndTripNumber')}}</div>
<div class="li_plan" @click="showTrain">{{ $t('planMonitor.serviceAndTripNumber') }}</div>
</ul>
<ul class="ul-box">
<div class="li_plan" @click="handleAddPlanningTrain">{{$t('planMonitor.addPlan')}}</div>
<div class="li_plan" @click="handleDeletePlanningTrain">{{$t('planMonitor.deletePlan')}}</div>
<div class="li_plan" @click="handleDuplicateTrain">{{$t('planMonitor.duplicatePlan')}}</div>
<div class="li_plan" @click="handleAddTask">{{$t('planMonitor.addTask')}}</div>
<div class="li_plan" @click="handleDeleteTask">{{$t('planMonitor.deleteTask')}}</div>
<div class="li_plan" @click="handleModifyingTask">{{$t('planMonitor.modifyTask')}}</div>
<div class="li_plan" @click="handleAddPlanningTrain">{{ $t('planMonitor.addPlan') }}</div>
<div class="li_plan" @click="handleDeletePlanningTrain">{{ $t('planMonitor.deletePlan') }}</div>
<div class="li_plan" @click="handleDuplicateTrain">{{ $t('planMonitor.duplicatePlan') }}</div>
<div class="li_plan" @click="handleAddTask">{{ $t('planMonitor.addTask') }}</div>
<div class="li_plan" @click="handleDeleteTask">{{ $t('planMonitor.deleteTask') }}</div>
<div class="li_plan" @click="handleModifyingTask">{{ $t('planMonitor.modifyTask') }}</div>
</ul>
<ul class="ul-box tool">
<div class="li_plan" @click="handlePlanEffectiveCheck">{{$t('planMonitor.validityCheck')}}</div>
<div class="li_plan" @click="handleTestRunPlan">{{$t('planMonitor.testRunning')}}</div>
<div class="li_plan" @click="handlePlanEffectiveCheck">{{ $t('planMonitor.validityCheck') }}</div>
<div class="li_plan" @click="handleTestRunPlan">{{ $t('planMonitor.testRunning') }}</div>
</ul>
</div>
</template>

View File

@ -6,7 +6,7 @@
v-model="form.course"
:placeholder="$t('publish.selectTypeScope')"
:disabled="editOk"
style="width:240px;"
style="width:240px;"
@change="changeCourse(form.course)"
>
<el-option
@ -41,10 +41,10 @@
placeholder=""
style="width: calc(100% - 280px); float: left; margin-right: 10px;"
/>
<span style="width: 190px; float: left;">{{$t('publish.allNumberTipOne')}} {{ topicNum }} {{$t('publish.allNumberTipTwo')}}</span>
<span style="width: 190px; float: left;">{{ $t('publish.allNumberTipOne') }} {{ topicNum }} {{ $t('publish.allNumberTipTwo') }}</span>
</el-form-item>
<el-form-item :label="$t('publish.scorePerQuestion')" prop="mark">
<el-input v-model="form.mark" placeholder="" style="width:240px"/>
<el-input v-model="form.mark" placeholder="" style="width:240px" />
</el-form-item>
</el-form>
<div slot="footer" class="dialog-footer">
@ -239,9 +239,7 @@ export default {
this.typeList = [];
await getDetailList('training_type').then(res => {
this.typeList = res.data;
}).catch(() => {
// console.log('' + error.message);
});
}).catch((error) => { console.log(error.message); });
},
async changeCourse(val) {
const param = {
@ -250,13 +248,13 @@ export default {
operateType: ''
};
this.operationTypeList = this.trainingOperateTypeMap[val];
if(this.operationTypeList){
if (this.operationTypeList) {
this.operationTypeList.forEach(item => {
item.disabled = false;
this.changeOperationDisabled(); //
});
}
this.form.operateType="";
this.form.operateType='';
const resp = await getLessonTypeNum(param);
if (resp.code == 200) {
this.topicNum = resp.data;

View File

@ -3,7 +3,6 @@ var update = null
function timedCount(){
onmessage = (e) => {
// console.log(e.data);
if(e.data.type){
for(let i=e.data.body.length-1;i>=0;i--){