修改编辑运行图路基问题
This commit is contained in:
parent
b9014f4118
commit
a565e1f204
@ -116,16 +116,7 @@ export default {
|
||||
arriveConfigList: []
|
||||
// parkSectionCodeList
|
||||
};
|
||||
let length = resp.data.parkSectionCodeList.length;
|
||||
if ( length >= 4) {
|
||||
if (resp.data.parkSectionCodeList[0].stationCode == resp.data.parkSectionCodeList[1].stationCode) {
|
||||
resp.data.parkSectionCodeList.shift();
|
||||
}
|
||||
length = resp.data.parkSectionCodeList.length;
|
||||
if (resp.data.parkSectionCodeList[length - 1].stationCode == resp.data.parkSectionCodeList[length - 2].stationCode) {
|
||||
resp.data.parkSectionCodeList.pop();
|
||||
}
|
||||
}
|
||||
|
||||
const newstationTimeList = [];
|
||||
let current = {};
|
||||
trainInfo.stationTimeList.forEach((stationTime, index)=>{
|
||||
|
@ -194,8 +194,17 @@
|
||||
{{ formatName(scope.row.endSectionCode) }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="remarks" :label="$t('planMonitor.modifying.description')" :width="315" />
|
||||
<!-- <el-table-column :width="40" /> -->
|
||||
<el-table-column prop="routingType" label="交路类型">
|
||||
<template slot-scope="scope">
|
||||
{{ routingTypeMap[scope.row.routingType] }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="类别" width="240">
|
||||
<template slot-scope="scope">
|
||||
{{ `${frontMap[String(scope.row.startTbFront)]} - ${frontMap[String(scope.row.endTbFront)]}` }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="remarks" width="auto" :label="this.$t('planMonitor.description')" />
|
||||
</el-table>
|
||||
</el-row>
|
||||
<el-row style=" margin-bottom: 5px;margin-top: 10px;">
|
||||
@ -252,6 +261,7 @@
|
||||
</template>
|
||||
<script>
|
||||
import { getRoutingBySDTNumber, updatePlanTrip, getMapStationRunUser, getStationStopTime } from '@/api/runplan';
|
||||
import { getRunplanConfig } from '@/api/jmap/mapdraft';
|
||||
import { formatTime, formatName } from '@/utils/runPlan';
|
||||
|
||||
export default {
|
||||
@ -302,13 +312,25 @@ export default {
|
||||
// defaultStopTimeList: [{ value: '', label: this.$t('planMonitor.modifying.default') }],
|
||||
// defaultSpeedLevelList: [{ value: '', label: this.$t('planMonitor.modifying.default') }],
|
||||
// serialNumberList: [],
|
||||
reentryData: {},
|
||||
defaultSpeedLevelList: [
|
||||
{ value: 'l1', label: '等级一' },
|
||||
{ value: 'l2', label: '等级二' },
|
||||
{ value: 'l3', label: '等级三'},
|
||||
{ value: 'l4', label: '等级四' },
|
||||
{ value: 'l5', label: '等级五' }
|
||||
]
|
||||
],
|
||||
routingTypeMap: {
|
||||
OUTBOUND: '出库',
|
||||
INBOUND: '入库',
|
||||
LOOP: '环路'
|
||||
},
|
||||
frontMap: {
|
||||
'true': '折返轨(站前)',
|
||||
'false': '折返轨(站后)',
|
||||
'undefined': '转换轨',
|
||||
'null': '转换轨'
|
||||
}
|
||||
};
|
||||
},
|
||||
computed: {
|
||||
@ -408,7 +430,13 @@ export default {
|
||||
this.serviceNumber = params.serviceNumber;
|
||||
this.planId = this.$route.query.planId;
|
||||
this.PlanConvert = this.$theme.loadPlanConvert(lineCode);
|
||||
|
||||
if (mapId) {
|
||||
getRunplanConfig(mapId).then(resp => {
|
||||
const data = resp.data;
|
||||
this.reentryData = data.config.reentryData;
|
||||
});
|
||||
|
||||
getMapStationRunUser(mapId).then(resp => {
|
||||
const list = resp.data.list;
|
||||
list.forEach(elem => {
|
||||
@ -456,7 +484,6 @@ export default {
|
||||
};
|
||||
this.routingList = [];
|
||||
getRoutingBySDTNumber(model).then(resp => { // 根据车次号查询交路
|
||||
// const routingObj = resp.data;
|
||||
const editData = this.$store.state.runPlan.editData[this.serviceNumber];
|
||||
if (editData) {
|
||||
const trainInfo = editData.trainMap[this.tripNumber];
|
||||
@ -468,28 +495,15 @@ export default {
|
||||
endSectionCode:resp.data.endSectionCode,
|
||||
startSectionCode:resp.data.startSectionCode
|
||||
});
|
||||
let length = resp.data.parkSectionCodeList.length;
|
||||
if ( length >= 4) {
|
||||
if (resp.data.parkSectionCodeList[0].stationCode == resp.data.parkSectionCodeList[1].stationCode) {
|
||||
resp.data.parkSectionCodeList.shift();
|
||||
}
|
||||
length = resp.data.parkSectionCodeList.length;
|
||||
if (resp.data.parkSectionCodeList[length - 1].stationCode == resp.data.parkSectionCodeList[length - 2].stationCode) {
|
||||
resp.data.parkSectionCodeList.pop();
|
||||
}
|
||||
}
|
||||
|
||||
this.editModel = {
|
||||
tripNumber: this.tripNumber,
|
||||
// startStationCode: resp.data.startStationCode,
|
||||
startTime: formatTime(trainInfo.stationTimeList[1].secondTime + 7200),
|
||||
// endStationCode: resp.data.endStationCode,
|
||||
endTime: formatTime(trainInfo.stationTimeList[lastIndex].secondTime + 7200),
|
||||
routingCode : resp.data.code,
|
||||
// endSectionCode:resp.data.endSectionCode,
|
||||
// startSectionCode:resp.data.startSectionCode,
|
||||
arriveConfigList: []
|
||||
// parkSectionCodeList
|
||||
};
|
||||
|
||||
const newstationTimeList = [];
|
||||
let current = {};
|
||||
trainInfo.stationTimeList.forEach((stationTime, index)=>{
|
||||
@ -502,11 +516,11 @@ export default {
|
||||
newstationTimeList.push(current);
|
||||
}
|
||||
});
|
||||
|
||||
newstationTimeList.forEach((newstationTime, index)=>{
|
||||
const newModel = {
|
||||
sectionCode:resp.data.parkSectionCodeList[index].sectionCode,
|
||||
stationCode:newstationTime.stationCode,
|
||||
// speedLevel:'默认',
|
||||
arriveTime: formatTime(newstationTime.arriveTime + 7200),
|
||||
departureTime: formatTime(newstationTime.departureTime + 7200),
|
||||
stopTime:newstationTime.departureTime - newstationTime.arriveTime
|
||||
@ -525,32 +539,34 @@ export default {
|
||||
},
|
||||
initRunlevel(paramData) {
|
||||
const speedLevelData = this.stopStationMap[[paramData.arriveConfigList[0].sectionCode, paramData.arriveConfigList[1].sectionCode].toString()];
|
||||
switch (paramData.arriveConfigList[0].speedLevelTime) {
|
||||
case speedLevelData.l1: {
|
||||
this.defaultSpeedLevel = 'l1';
|
||||
break;
|
||||
}
|
||||
case speedLevelData.l2: {
|
||||
this.defaultSpeedLevel = 'l2';
|
||||
break;
|
||||
}
|
||||
case speedLevelData.l3: {
|
||||
this.defaultSpeedLevel = 'l3';
|
||||
break;
|
||||
}
|
||||
case speedLevelData.l4: {
|
||||
this.defaultSpeedLevel = 'l4';
|
||||
break;
|
||||
}
|
||||
case speedLevelData.l5: {
|
||||
this.defaultSpeedLevel = 'l5';
|
||||
break;
|
||||
}
|
||||
default: {
|
||||
this.defaultSpeedLevel = 'l1';
|
||||
break;
|
||||
}
|
||||
}
|
||||
if (speedLevelData) {
|
||||
switch (paramData.arriveConfigList[0].speedLevelTime) {
|
||||
case speedLevelData.l1: {
|
||||
this.defaultSpeedLevel = 'l1';
|
||||
break;
|
||||
}
|
||||
case speedLevelData.l2: {
|
||||
this.defaultSpeedLevel = 'l2';
|
||||
break;
|
||||
}
|
||||
case speedLevelData.l3: {
|
||||
this.defaultSpeedLevel = 'l3';
|
||||
break;
|
||||
}
|
||||
case speedLevelData.l4: {
|
||||
this.defaultSpeedLevel = 'l4';
|
||||
break;
|
||||
}
|
||||
case speedLevelData.l5: {
|
||||
this.defaultSpeedLevel = 'l5';
|
||||
break;
|
||||
}
|
||||
default: {
|
||||
this.defaultSpeedLevel = 'l1';
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
// changeStopTime(indexs, time) {
|
||||
// let tempTime = this.computedTimeByString(this.editModel.startTime) / 1000;
|
||||
@ -625,9 +641,6 @@ export default {
|
||||
} else {
|
||||
// 直接修改
|
||||
updatePlanTrip(this.buildModel()).then(resp => {
|
||||
// this.$emit('dispatchOperate', {
|
||||
// dialogName: 'openRunPlan', operate: 'loadRunPlanData', params: Object.assign({refresh: true}, this.$route.query)
|
||||
// });
|
||||
this.$emit('refresh');
|
||||
this.$message.success(this.$t('planMonitor.modifying.modifyTaskSuccess'));
|
||||
}).catch(() => {
|
||||
|
82
src/views/planMonitor/newEditTool/config/index.vue
Normal file
82
src/views/planMonitor/newEditTool/config/index.vue
Normal file
@ -0,0 +1,82 @@
|
||||
<template>
|
||||
<el-dialog title="参数配置" :visible.sync="dialogShow" custom-class="content-route" width="100%" :fullscreen="true" top="0px" :before-close="close" :z-index="2000" :append-to-body="true">
|
||||
<div class="content-box">
|
||||
<jlmap-visual ref="jlmapVisual" @onMenu="onContextmenu" @onSelect="clickEvent" />
|
||||
<div style="width: 29%;float: right;" :style="{height: $store.state.app.height-54+'px' }" />
|
||||
</div>
|
||||
</el-dialog>
|
||||
</template>
|
||||
<script>
|
||||
import JlmapVisual from '@/views/newMap/jlmapNew/index';
|
||||
import { loadMapDataById } from '@/utils/loaddata';
|
||||
export default {
|
||||
name: 'RunplanParams',
|
||||
components: {
|
||||
JlmapVisual
|
||||
},
|
||||
props:{
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
dialogShow: false
|
||||
};
|
||||
},
|
||||
methods:{
|
||||
async doShow() {
|
||||
this.dialogShow = true;
|
||||
await this.setWindowSize();
|
||||
this.loadInitPage();
|
||||
},
|
||||
setWindowSize() {
|
||||
this.$nextTick(() => {
|
||||
const width = this.$store.state.app.width * 0.7;
|
||||
const height = this.$store.state.app.height - 54;
|
||||
this.$store.dispatch('config/resize', { width, height });
|
||||
});
|
||||
},
|
||||
loadInitPage() {
|
||||
this.$store.dispatch('training/changeMode', { mode: null });
|
||||
loadMapDataById(this.$route.query.mapId, 'mapPreview');
|
||||
},
|
||||
clickEvent(em) {
|
||||
const device = this.getDeviceByEm(em);
|
||||
this.deviceHighLight(this.oldDevice, false);
|
||||
this.deviceHighLight(device, true);
|
||||
this.oldDevice = device;
|
||||
this.setSelected(device);
|
||||
},
|
||||
onContextmenu() {
|
||||
|
||||
},
|
||||
close() {
|
||||
this.dialogShow = false;
|
||||
},
|
||||
// 获取设备数据
|
||||
getDeviceByEm(em) {
|
||||
var device = this.$store.getters['map/getDeviceByCode'](em.deviceCode) || null;
|
||||
if (device) {
|
||||
device._viewVal = em.val;
|
||||
}
|
||||
return device;
|
||||
},
|
||||
// 高亮设备
|
||||
deviceHighLight(device, flag) {
|
||||
if (device && device.instance && typeof device.instance.drawSelected === 'function' ) {
|
||||
if (device._type === 'Section' && device.type === '04') {
|
||||
device.relevanceSectionList.forEach(item => {
|
||||
const sectionModel = this.$store.getters['map/getDeviceByCode'](item);
|
||||
sectionModel && sectionModel.instance.drawSelected(flag);
|
||||
});
|
||||
} else if (device._type === 'Section' && device.type === '01' && device.logicSectionCodeList && device.logicSectionCodeList.length) {
|
||||
device.logicSectionCodeList.forEach(item => {
|
||||
const sectionModel = this.$store.getters['map/getDeviceByCode'](item);
|
||||
sectionModel && sectionModel.instance.drawSelected(flag);
|
||||
});
|
||||
} else {
|
||||
device.instance.drawSelected(flag);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
};
|
||||
</script>
|
@ -3,22 +3,20 @@
|
||||
<menu-bar
|
||||
ref="menuBar"
|
||||
:plan-convert="PlanConvert"
|
||||
:run-plan-list="runPlanList"
|
||||
:load-run-plan-id="loadRunPlanId"
|
||||
:load-run-plan-name="loadRunPlanName"
|
||||
@doClose="doClose"
|
||||
@refresh="refresh"
|
||||
@dispatchDialog="dispatchDialog"
|
||||
@loadingRunPlan="loadingRunPlan"
|
||||
@refresh="refreshRunPlanList"
|
||||
@checkIsLoadRunPlan="checkIsLoadRunPlan"
|
||||
@modifyRunPlanName="modifyRunPlanName"
|
||||
/>
|
||||
<schedule
|
||||
ref="schedule"
|
||||
v-loading="runplanLoading"
|
||||
:plan-convert="PlanConvert"
|
||||
:load-run-plan-id="loadRunPlanId"
|
||||
:load-run-plan-name="loadRunPlanName"
|
||||
:max-height="height"
|
||||
:max-width="width"
|
||||
/>
|
||||
<status-bar ref="statusBar" :load-run-plan-id="loadRunPlanId" @dispatchDialog="dispatchDialog" @showTrain="showTrain" @refresh="refresh" />
|
||||
<parameter ref="parameter" />
|
||||
@ -26,31 +24,27 @@
|
||||
<add-planning-train ref="addPlanningTrain" :load-run-plan-id="loadRunPlanId" @dispatchDialog="dispatchDialog" />
|
||||
<edit-planning-train
|
||||
ref="editPlanningTrain"
|
||||
:load-run-plan-id="loadRunPlanId"
|
||||
@dispatchDialog="dispatchDialog"
|
||||
@dispatchOperate="dispatchOperate"
|
||||
@refresh="refresh"
|
||||
/>
|
||||
<edit-smooth-run-time ref="editSmoothRunTime" @dispatchDialog="dispatchDialog" />
|
||||
<add-smooth-run-time ref="addSmoothRunTime" @dispatchDialog="dispatchDialog" />
|
||||
<duplicate-train ref="duplicateTrain" :load-run-plan-id="loadRunPlanId" @dispatchDialog="dispatchDialog" @dispatchOperate="dispatchOperate" @refresh="refresh" />
|
||||
<duplicate-train ref="duplicateTrain" @dispatchDialog="dispatchDialog" @dispatchOperate="dispatchOperate" @refresh="refresh" />
|
||||
<move-planing-train ref="movePlaningTrain" :load-run-plan-id="loadRunPlanId" @dispatchDialog="dispatchDialog" @dispatchOperate="dispatchOperate" @refresh="refresh" />
|
||||
<modifying-routing ref="modifyingRouting" @dispatchDialog="dispatchDialog" />
|
||||
<modifying-begin-time ref="modifyingBeginTime" />
|
||||
|
||||
<systerm-out ref="systermOut" />
|
||||
<add-task ref="addTask" :load-run-plan-id="loadRunPlanId" @dispatchOperate="dispatchOperate" @refresh="refresh" />
|
||||
<delete-task ref="deleteTask" :load-run-plan-id="loadRunPlanId" @dispatchOperate="dispatchOperate" @refresh="refresh" />
|
||||
<add-task ref="addTask" @dispatchOperate="dispatchOperate" @refresh="refresh" />
|
||||
<delete-task ref="deleteTask" @dispatchOperate="dispatchOperate" @refresh="refresh" />
|
||||
<modifying-task ref="modifyingTask" :load-run-plan-id="loadRunPlanId" @dispatchOperate="dispatchOperate" @refresh="refresh" />
|
||||
|
||||
<edit-station-between-time ref="editStationBetweenTime" />
|
||||
|
||||
<modifying-station-interval-time ref="modifyingStationIntervalTime" />
|
||||
<modifying-station-stop-time ref="modifyingStationStopTime" />
|
||||
<populating-generic-data ref="populatingGenericData" :load-run-plan-id="loadRunPlanId" />
|
||||
<create-empty-plan ref="createEmptyPlan" @refresh="refreshRunPlanList" />
|
||||
<edit-plan-name ref="editPlan" @renewal="refreshRunPlanName" />
|
||||
<gernarate-plan ref="gernaratePlanTrain" />
|
||||
<modifying-station-stop-time ref="modifyingStationStopTime" />
|
||||
</div>
|
||||
</template>
|
||||
|
||||
@ -64,7 +58,6 @@ import AddPlanningTrain from './menus/addPlanningTrain';
|
||||
import EditPlanningTrain from './menus/editPlanningTrain';
|
||||
import EditPlanName from './menus/editPlanName';
|
||||
import DuplicateTrain from './menus/duplicateTrain';
|
||||
import MovePlaningTrain from './menus/movePlaningTrain';
|
||||
import SystermOut from './menus/systermOut';
|
||||
import AddTask from './menus/addTask';
|
||||
import DeleteTask from './menus/deleteTask';
|
||||
@ -72,18 +65,13 @@ import ModifyingTask from './menus/modifyingTask';
|
||||
import ModifyingRouting from './menus/modifyingRouting';
|
||||
import ModifyingBeginTime from './menus/modifyingBeginTime';
|
||||
import EditStationBetweenTime from './menus/editStationBetweenTime';
|
||||
import AddSmoothRunTime from './menus/addSmoothRunTime';
|
||||
import EditSmoothRunTime from './menus/editSmoothRunTime';
|
||||
// import ModifyingStationIntervalTime from './menus/modifyingStationIntervalTime';
|
||||
// import PopulatingGenericData from './menus/populatingGenericData';
|
||||
import PopulatingGenericData from '../editTool/menus/populatingGenericData';
|
||||
import CreateEmptyPlan from './menus/createEmptyPlan';
|
||||
import GernaratePlan from '../editTool/menus/gernaratePlanTrain';
|
||||
import ModifyingStationStopTime from '../editTool/menus/modifyingStationStopTime';
|
||||
import ModifyingStationIntervalTime from '../editTool/menus/modifyingStationIntervalTime';
|
||||
import GernaratePlan from './menus/gernaratePlanTrain';
|
||||
import MovePlaningTrain from './menus/movePlaningTrain';
|
||||
import ModifyingStationIntervalTime from './menus/modifyingStationIntervalTime';
|
||||
import ModifyingStationStopTime from './menus/modifyingStationStopTime';
|
||||
import PopulatingGenericData from './menus/populatingGenericData';
|
||||
import { deletePlanService } from '@/api/runplan';
|
||||
import { checkLoginLine } from '@/api/login';
|
||||
import { getRpListByMapId } from '@/api/runplan';
|
||||
import { loadMapDataById } from '@/utils/loaddata';
|
||||
|
||||
export default {
|
||||
@ -105,13 +93,12 @@ export default {
|
||||
ModifyingRouting,
|
||||
ModifyingBeginTime,
|
||||
EditStationBetweenTime,
|
||||
AddSmoothRunTime,
|
||||
EditSmoothRunTime,
|
||||
// AddSmoothRunTime,
|
||||
// EditSmoothRunTime,
|
||||
ModifyingStationIntervalTime,
|
||||
CreateEmptyPlan,
|
||||
ModifyingStationStopTime,
|
||||
EditPlanName,
|
||||
GernaratePlan,
|
||||
ModifyingStationStopTime,
|
||||
MovePlaningTrain
|
||||
},
|
||||
data() {
|
||||
@ -120,18 +107,19 @@ export default {
|
||||
timeDemon: null,
|
||||
runPlanList: [],
|
||||
loadRunPlanId: '',
|
||||
loadRunPlanName: ''
|
||||
loadRunPlanName: '',
|
||||
runplanLoading:false
|
||||
};
|
||||
},
|
||||
computed: {
|
||||
lineCode() {
|
||||
return this.$route.query.lineCode;
|
||||
},
|
||||
width() {
|
||||
return this.$store.state.app.width;
|
||||
},
|
||||
height() {
|
||||
return this.$store.state.app.height;
|
||||
return this.$route.query.lineCode || '02';
|
||||
}
|
||||
},
|
||||
watch: {
|
||||
'$store.state.map.mapDataLoadedCount': function (val) {
|
||||
this.loadRunPlanId = this.$route.query.planId;
|
||||
this.runplanLoading = false;
|
||||
}
|
||||
},
|
||||
created() {
|
||||
@ -141,6 +129,7 @@ export default {
|
||||
this.timeDemon = setInterval(() => {
|
||||
checkLoginLine();
|
||||
}, 5000 * 60);
|
||||
this.loadRunPlanName = this.$route.query.planName;
|
||||
if (this.$route.query.mapId) {
|
||||
this.refreshRunPlanList(true);
|
||||
await this.loadMap();
|
||||
@ -166,6 +155,11 @@ export default {
|
||||
}
|
||||
});
|
||||
},
|
||||
async loadMap() {
|
||||
this.runplanLoading = true;
|
||||
// 加载地图数据
|
||||
loadMapDataById(this.$route.query.mapId, 'parse');
|
||||
},
|
||||
handleConfirm(params) {
|
||||
if (params.operate == 'AddPlanningTrain') {
|
||||
// 添加计划
|
||||
@ -173,13 +167,14 @@ export default {
|
||||
} else if (params.operate == 'DeletePlanningTrain') {
|
||||
// 删除计划
|
||||
const model = {
|
||||
planId: this.loadRunPlanId,
|
||||
planId: this.$route.query.planId,
|
||||
serviceNumber: params.serviceNumber
|
||||
};
|
||||
deletePlanService(model).then(resp => {
|
||||
this.$message.success(this.$t('tip.deletePlanSuccessfully'));
|
||||
this.$store.dispatch('runPlan/setDraftSelected', {});
|
||||
this.$store.dispatch('runPlan/setSelected', {});
|
||||
this.$store.dispatch('runPlan/refresh');
|
||||
// this.$refs.openRunPlan.loadRunPlanData(Object.assign({refresh: true}, this.$route.query));
|
||||
}).catch(() => {
|
||||
this.$messageBox(this.$t('tip.deletePlanFailed'));
|
||||
});
|
||||
@ -193,37 +188,19 @@ export default {
|
||||
refresh() {
|
||||
this.$store.dispatch('runPlan/refresh');
|
||||
},
|
||||
async loadMap() {
|
||||
this.runplanLoading = true;
|
||||
// 加载地图数据
|
||||
loadMapDataById(this.$route.query.mapId, 'parse');
|
||||
},
|
||||
refreshRunPlanList(planId) {
|
||||
getRpListByMapId(this.$route.query.mapId).then(resp => {
|
||||
this.runPlanList = resp.data || [];
|
||||
if (planId && this.runPlanList.length) {
|
||||
this.runPlanList.forEach(item => {
|
||||
if (item.id === planId) {
|
||||
this.loadRunPlanId = item.id;
|
||||
this.loadRunPlanName = item.name;
|
||||
}
|
||||
});
|
||||
} else {
|
||||
this.loadRunPlanId = '';
|
||||
this.loadRunPlanName = '';
|
||||
}
|
||||
}).catch(() => {
|
||||
this.$message.error('获取草稿运行图列表失败');
|
||||
});
|
||||
refreshRunPlanList(firstLoad) {
|
||||
|
||||
},
|
||||
doClose() {
|
||||
// this.$emit('doClose');
|
||||
window.close();
|
||||
this.$emit('doClose');
|
||||
},
|
||||
loadingRunPlan(param) {
|
||||
this.loadRunPlanId = param.planId;
|
||||
this.loadRunPlanName = param.planName;
|
||||
},
|
||||
checkIsLoadRunPlan(planId) {
|
||||
this.refreshRunPlanList(planId === this.loadRunPlanId);
|
||||
},
|
||||
modifyRunPlanName() {
|
||||
if (this.loadRunPlanId && this.loadRunPlanName) {
|
||||
this.$refs.editPlan.doShow({id: this.loadRunPlanId, name: this.loadRunPlanName});
|
||||
@ -233,7 +210,7 @@ export default {
|
||||
},
|
||||
refreshRunPlanName(name) {
|
||||
this.$refs.schedule.refreshRunPlanName(name);
|
||||
this.refreshRunPlanList();
|
||||
this.$router.replace({ path: this.$route.path, query: { ...this.$route.query, planName: name }});
|
||||
}
|
||||
}
|
||||
};
|
||||
@ -274,298 +251,4 @@ export default {
|
||||
.planEdit__tool {
|
||||
overflow: hidden !important;
|
||||
}
|
||||
|
||||
/* .planEdit__tool .el-dialog {
|
||||
overflow: hidden !important;
|
||||
background: rgba(202, 221, 253, 0.88);;
|
||||
box-shadow: 1px hsla(240, 0%, 100%, 0.5) inset;
|
||||
border: 2px solid #727375;
|
||||
border-radius: 4px;
|
||||
color: #000;
|
||||
font-size: 14px;
|
||||
}
|
||||
|
||||
.planEdit__tool .el-dialog .el-dialog__header {
|
||||
height: 30px;
|
||||
padding: 5px;
|
||||
}
|
||||
|
||||
.planEdit__tool .el-dialog .el-dialog__footer {
|
||||
background: #ECE9D8;
|
||||
opacity: 1;
|
||||
}
|
||||
|
||||
.planEdit__tool .el-dialog .el-dialog__body {
|
||||
padding-top: 10px;
|
||||
padding-bottom: 10px;
|
||||
padding-left: 5px;
|
||||
padding-right: 5px;
|
||||
margin: 0px 3px 3px 3px;
|
||||
border: 2px solid rgba(120, 121, 123, 0.5);
|
||||
box-shadow: 1px hsla(240, 0%, 100%, 0.5) inset;
|
||||
color: #000;
|
||||
background: #ECE9D8;
|
||||
opacity: 1;
|
||||
}
|
||||
|
||||
.planEdit__tool .el-dialog .el-dialog__title {
|
||||
font-size: 16px;
|
||||
}
|
||||
|
||||
.planEdit__tool .el-dialog .el-dialog__headerbtn {
|
||||
background: -webkit-linear-gradient(#CD98A0, #C27D6E, #B63022, #C68770);
|
||||
background: -o-linear-gradient(#CD98A0, #C27D6E, #B63022, #C68770);
|
||||
background: -moz-linear-gradient(#CD98A0, #C27D6E, #B63022, #C68770);
|
||||
background: linear-gradient(#CD98A0, #C27D6E, #B63022, #C68770);
|
||||
border: 1px solid white;
|
||||
border-radius: 4px;
|
||||
top: 0px;
|
||||
right: 3px;
|
||||
line-height: 26px;
|
||||
width: 26px;
|
||||
}
|
||||
|
||||
.planEdit__tool .el-dialog .el-dialog__headerbtn .el-icon-close:before {
|
||||
font-size: 16px;
|
||||
}
|
||||
|
||||
.planEdit__tool .el-dialog .el-dialog__headerbtn .el-dialog__close {
|
||||
color: #fff;
|
||||
}
|
||||
|
||||
.planEdit__tool .el-dialog .el-tabs--top {
|
||||
border: 2px outset #FEFEFD;
|
||||
border-radius: 4px;
|
||||
}
|
||||
|
||||
.planEdit__tool .el-dialog .el-tabs__item {
|
||||
height: 30px;
|
||||
line-height: 30px;
|
||||
text-align: center;
|
||||
color: #000 !important;
|
||||
border-right: 2px outset #fff;
|
||||
padding-left: 10px !important;
|
||||
padding-right: 10px !important;
|
||||
}
|
||||
|
||||
.planEdit__tool .el-dialog .el-tab-pane {
|
||||
margin: 10px !important;
|
||||
}
|
||||
|
||||
.planEdit__tool .el-dialog .el-tabs--card>.el-tabs__header .el-tabs__item.is-active {
|
||||
border-bottom: none
|
||||
}
|
||||
|
||||
.planEdit__tool .el-dialog .el-tabs--card>.el-tabs__header .el-tabs__item:not(.is-active) {
|
||||
border-bottom: 2px inset #fff
|
||||
}
|
||||
|
||||
.planEdit__tool .el-dialog .el-form {
|
||||
background: #ECE9D8 !important;
|
||||
}
|
||||
|
||||
.planEdit__tool .el-dialog .el-card {
|
||||
background: #ECE9D8 !important;
|
||||
}
|
||||
|
||||
.planEdit__tool .el-dialog .el-button {
|
||||
height: 32px;
|
||||
line-height: 32px;
|
||||
padding: 0px;
|
||||
width: 80px;
|
||||
border: 2px outset #E2E2E2;
|
||||
border-radius: 0px !important;
|
||||
color: #000;
|
||||
background: #ECE9D8;
|
||||
}
|
||||
|
||||
.planEdit__tool .el-dialog .expand {
|
||||
width: 120px;
|
||||
}
|
||||
|
||||
.planEdit__tool .el-dialog .el-button:focus span {
|
||||
border: 1px dashed gray;
|
||||
}
|
||||
|
||||
.planEdit__tool .el-dialog .el-button:active {
|
||||
border: 2px inset #E2E2E2;
|
||||
}
|
||||
|
||||
.planEdit__tool .el-dialog .el-button:disabled {
|
||||
border: 2px inset #E2E2E2;
|
||||
}
|
||||
|
||||
.planEdit__tool .el-dialog .el-button:disabled span {
|
||||
border: 0px;
|
||||
}
|
||||
|
||||
.planEdit__tool .el-dialog .button-group {
|
||||
margin-top: 10px;
|
||||
}
|
||||
|
||||
.planEdit__tool .el-dialog .el-input {
|
||||
border: 2px inset #E9E9E9;
|
||||
}
|
||||
|
||||
.planEdit__tool .el-dialog .el-input .el-input__inner {
|
||||
color: #000;
|
||||
background: #fff !important;
|
||||
border: 0px;
|
||||
border-radius: 0px !important;
|
||||
box-sizing: border-box;
|
||||
}
|
||||
|
||||
.planEdit__tool .el-dialog .el-input.is-disabled .el-input__inner {
|
||||
background: #F0F0F0 !important;
|
||||
}
|
||||
|
||||
.planEdit__tool .el-dialog .el-textarea {
|
||||
border: 2px inset #E9E9E9;
|
||||
border-radius: 0px;
|
||||
}
|
||||
|
||||
.planEdit__tool .el-dialog .el-textarea .el-textarea__inner {
|
||||
color: #000;
|
||||
background: #fff !important;
|
||||
border: 0px;
|
||||
border-radius: 0px !important;
|
||||
box-sizing: border-box;
|
||||
}
|
||||
|
||||
.planEdit__tool .el-dialog .el-textarea.is-disabled .el-textarea__inner {
|
||||
background: #F0F0F0 !important;
|
||||
}
|
||||
|
||||
.planEdit__tool .el-dialog .el-table {
|
||||
border: 2px inset #E9E9E9;
|
||||
color: #000 !important;
|
||||
}
|
||||
|
||||
.planEdit__tool .el-dialog .el-table .cell {
|
||||
line-height: unset !important;
|
||||
}
|
||||
|
||||
.planEdit__tool .el-dialog .el-table th.is-leaf {
|
||||
background: #ECE9D8 !important;
|
||||
border-right: 1px solid #BDBDBD !important;
|
||||
border-bottom: 1px solid #BDBDBD !important;
|
||||
color: #000 !important;
|
||||
height: 20px !important;
|
||||
padding: 0px;
|
||||
}
|
||||
|
||||
.planEdit__tool .el-dialog .el-table tr td {
|
||||
height: 20px !important;
|
||||
padding: 0px;
|
||||
}
|
||||
|
||||
.planEdit__tool .el-dialog .el-table .el-table__empty-text {
|
||||
top: 15px !important;
|
||||
}
|
||||
|
||||
.planEdit__tool .el-dialog .current-row>td {
|
||||
background: #316AC5 !important;
|
||||
color: #fff !important;
|
||||
}
|
||||
|
||||
.planEdit__tool .el-dialog .el-checkbox__inner {
|
||||
border: 1px inset #dcdfe6 !important;
|
||||
}
|
||||
|
||||
.planEdit__tool .el-dialog .el-checkbox__label {
|
||||
color: #000 !important;
|
||||
}
|
||||
|
||||
.planEdit__tool .el-dialog .el-checkbox.is-disabled .el-checkbox__inner {
|
||||
background: #E6E6E6 !important;
|
||||
}
|
||||
|
||||
.planEdit__tool .el-dialog .el-checkbox.is-disabled .el-checkbox__label {
|
||||
color: #C5C9CC !important;
|
||||
}
|
||||
|
||||
.planEdit__tool .el-dialog .el-checkbox__input.is-checked .el-checkbox__inner {
|
||||
background: #fff !important;
|
||||
border: 1px inset #dcdfe6 !important;
|
||||
}
|
||||
|
||||
.planEdit__tool .el-dialog .el-checkbox__input.is-checked .el-checkbox__inner::after {
|
||||
position: absolute;
|
||||
-webkit-box-sizing: content-box;
|
||||
box-sizing: content-box;
|
||||
content: "";
|
||||
border: 1px solid #000;
|
||||
border-left: 0;
|
||||
border-top: 0;
|
||||
height: 7px;
|
||||
left: 4px;
|
||||
top: 1px;
|
||||
}
|
||||
|
||||
.planEdit__tool .el-dialog .el-radio__inner {
|
||||
border: 1px inset #dcdfe6 !important;
|
||||
}
|
||||
|
||||
.planEdit__tool .el-dialog .el-radio__label {
|
||||
color: #000 !important;
|
||||
}
|
||||
|
||||
.planEdit__tool .el-dialog .el-radio__input.is-checked .el-radio__inner {
|
||||
background: #fff !important;
|
||||
border: 1px inset #dcdfe6 !important;
|
||||
}
|
||||
|
||||
.planEdit__tool .el-dialog .el-radio__input.is-checked .el-radio__inner::after {
|
||||
width: 4px;
|
||||
height: 4px;
|
||||
border-radius: 100%;
|
||||
background-color: #000 !important;
|
||||
position: absolute;
|
||||
left: 50%;
|
||||
top: 50%;
|
||||
}
|
||||
|
||||
.planEdit__tool .el-dialog .el-radio.is-disabled .el-radio__inner {
|
||||
background: #E6E6E6 !important;
|
||||
}
|
||||
|
||||
.planEdit__tool .el-dialog .el-radio.is-disabled .el-radio__label {
|
||||
color: #C5C9CC !important;
|
||||
}
|
||||
|
||||
.planEdit__tool .el-dialog .base-label {
|
||||
background: rgba(0, 0, 0, x);
|
||||
position: relative;
|
||||
left: -15px;
|
||||
top: -18px;
|
||||
}
|
||||
|
||||
.planEdit__tool .el-dialog .el-form-item label {
|
||||
font-weight: normal !important;
|
||||
color: #000 !important;
|
||||
}
|
||||
|
||||
.planEdit__tool .el-dialog .context {
|
||||
height: 100px;
|
||||
border: 2px inset #E2E2E2;
|
||||
overflow-y: scroll;
|
||||
}
|
||||
|
||||
.planEdit__tool .el-dialog .table {
|
||||
margin-top: 10px;
|
||||
}
|
||||
|
||||
.planEdit__tool .el-dialog .notice {
|
||||
margin-left: 62px;
|
||||
line-height: 30px;
|
||||
}
|
||||
|
||||
.planEdit__tool .el-dialog .button-group {
|
||||
margin-top: 10px;
|
||||
}
|
||||
|
||||
.planEdit__tool .el-dialog .el-tree__empty-block {
|
||||
background: #E9E9E9 !important;
|
||||
color: #000 !important;
|
||||
} */
|
||||
</style>
|
||||
|
@ -37,11 +37,9 @@
|
||||
<div class="menu-li-block" :disabled="child.disabled">
|
||||
<span class="menu-li-text">
|
||||
<span class="label">{{ child.title }}</span>
|
||||
<i v-if="j!==classB" class="el-icon-arrow-right" style="float: right;height: 30px;line-height: 30px;" />
|
||||
<i v-if="j===classB" class="el-icon-arrow-left" style="float: right;height: 30px;line-height: 30px;" />
|
||||
</span>
|
||||
</div>
|
||||
<ul class="menu-ul" :class="{'children-active' :j==classB}" style="padding-left: 2px;">
|
||||
<ul class="menu-ul" :class="{'active' :j==classB}">
|
||||
<template v-for="(grandchild,k) in child.children">
|
||||
<li v-if="grandchild.type === 'separator'" :key="k" class="menu-separator">
|
||||
<span class="separator"> </span>
|
||||
@ -112,30 +110,18 @@
|
||||
<span class="nav-li-text">{{ dispaly?'关闭':$t('global.back') }}</span>
|
||||
</div>
|
||||
</div>
|
||||
<el-dialog
|
||||
title="运行图发布"
|
||||
:visible.sync="publishVisible"
|
||||
width="30%"
|
||||
center
|
||||
:modal="false"
|
||||
:before-close="handleClose"
|
||||
>
|
||||
<el-input v-model="publishName"><template slot="prepend">运行图名称:</template></el-input>
|
||||
<span slot="footer" class="dialog-footer">
|
||||
<el-button @click="publishVisible = false">取 消</el-button>
|
||||
<el-button type="primary" @click="confirmPublish">确 定</el-button>
|
||||
</span>
|
||||
</el-dialog>
|
||||
<route-map ref="routeMap" />
|
||||
</div>
|
||||
</template>
|
||||
<script>
|
||||
import { mapGetters } from 'vuex';
|
||||
import { planEffectiveCheck, clearPlaningData } from '@/api/runplan';
|
||||
import routeMap from './routingoperate/routeMap';
|
||||
// import RunplanParams from './config/index';
|
||||
import { planEffectiveCheck, runPlanNotify, clearPlaningData } from '@/api/runplan';
|
||||
import { launchFullscreen } from '@/utils/screen';
|
||||
import { UrlConfig } from '@/scripts/ConstDic';
|
||||
import { EventBus } from '@/scripts/event-bus';
|
||||
import { publishRunPlanAllUser } from '@/api/designPlatform';
|
||||
import routeMap from '../editTool/routingoperate/routeMap';
|
||||
import { deleteRunPlan } from '@/api/runplan';
|
||||
import { publishRunPlan, deleteRunPlan } from '@/api/designPlatform';
|
||||
|
||||
export default {
|
||||
name: 'PlanMenuBar',
|
||||
@ -147,23 +133,11 @@ export default {
|
||||
return { };
|
||||
}
|
||||
},
|
||||
runPlanList: {
|
||||
type: Array,
|
||||
default: function() {
|
||||
return [];
|
||||
}
|
||||
},
|
||||
loadRunPlanId: {
|
||||
type: String,
|
||||
default: function() {
|
||||
return '';
|
||||
}
|
||||
},
|
||||
loadRunPlanName: {
|
||||
type: String,
|
||||
default: function() {
|
||||
return '';
|
||||
}
|
||||
}
|
||||
},
|
||||
data() {
|
||||
@ -175,32 +149,18 @@ export default {
|
||||
tempClassB: -1,
|
||||
menus: [],
|
||||
loading: null,
|
||||
publishName: '',
|
||||
publishVisible: false,
|
||||
menuBase: [
|
||||
{
|
||||
title: this.$t('planMonitor.file'),
|
||||
children: [
|
||||
{
|
||||
title: '创建',
|
||||
click: this.newRunPlan
|
||||
},
|
||||
{
|
||||
title: '打开',
|
||||
children: []
|
||||
},
|
||||
{
|
||||
title: '删除',
|
||||
click: this.deleteRunPlanOperate
|
||||
},
|
||||
{
|
||||
title: '重命名',
|
||||
click: this.modifyRunPlanName
|
||||
},
|
||||
{
|
||||
title: '发布',
|
||||
click: this.publishRunPlan
|
||||
}
|
||||
// {
|
||||
// title: '创建运行图',
|
||||
// click: this.newRunPlan
|
||||
// }
|
||||
]
|
||||
},
|
||||
{
|
||||
@ -284,9 +244,44 @@ export default {
|
||||
{
|
||||
title: this.$t('planMonitor.validityCheck'),
|
||||
click: this.handlePlanEffectiveCheck
|
||||
},
|
||||
{
|
||||
title: this.$t('planMonitor.testRunningDiagram'),
|
||||
click: this.handleTestRunPlan
|
||||
}
|
||||
]
|
||||
}
|
||||
// {
|
||||
// title: this.$t('planMonitor.modify'),
|
||||
// children: [
|
||||
// // {
|
||||
// // title: '计划参数',
|
||||
// // click: this.handleParameter,
|
||||
// // },
|
||||
// // {
|
||||
// // title: '打印参数',
|
||||
// // click: this.undeveloped,
|
||||
// // },
|
||||
// // {
|
||||
// // type: 'separator'
|
||||
// // },
|
||||
// // {
|
||||
// // type: 'separator'
|
||||
// // },
|
||||
// // {
|
||||
// // title: '修改交路',
|
||||
// // click: this.handleModifyingRouting,
|
||||
// // },
|
||||
// // {
|
||||
// // title: '修改开始时间',
|
||||
// // click: this.handleModifyingStartTime,
|
||||
// // },
|
||||
// // {
|
||||
// // title: '快速增加任务',
|
||||
// // click: this.undeveloped,
|
||||
// // }
|
||||
// ]
|
||||
// }
|
||||
]
|
||||
};
|
||||
},
|
||||
@ -316,8 +311,8 @@ export default {
|
||||
this.classB = this.tempClassB;
|
||||
}
|
||||
},
|
||||
runPlanList() {
|
||||
this.initMenu();
|
||||
'$route.query.planId': function () {
|
||||
this.menus = this.menuConvert(this.menuBase);
|
||||
}
|
||||
},
|
||||
created() {
|
||||
@ -333,12 +328,11 @@ export default {
|
||||
methods: {
|
||||
back() {
|
||||
// this.$router.push({ path: `${UrlConfig.plan.detail}/${this.$route.query.mapId}` });
|
||||
// if (this.dispaly) {
|
||||
// this.$emit('doClose');
|
||||
// } else {
|
||||
// this.$router.go(-1);
|
||||
// }
|
||||
this.$emit('doClose');
|
||||
if (this.dispaly) {
|
||||
this.$emit('doClose');
|
||||
} else {
|
||||
this.$router.go(-1);
|
||||
}
|
||||
},
|
||||
menuConvert(menuBase) {
|
||||
const menus = [];
|
||||
@ -359,19 +353,6 @@ export default {
|
||||
return menus;
|
||||
},
|
||||
initMenu() {
|
||||
const menuLoading = [];
|
||||
this.runPlanList.forEach(item => {
|
||||
menuLoading.push({title: item.name, planId:item.id, planName: item.name, click: this.loadingRunPlan});
|
||||
});
|
||||
this.menuBase.forEach(item => {
|
||||
if (item.title === this.$t('planMonitor.file')) {
|
||||
item.children.forEach(elem => {
|
||||
if (elem.title === '打开') {
|
||||
elem.children = menuLoading;
|
||||
}
|
||||
});
|
||||
}
|
||||
});
|
||||
this.menus = this.menuConvert(this.menuBase);
|
||||
this.clickEvent();
|
||||
this.closeMenu();
|
||||
@ -400,7 +381,6 @@ export default {
|
||||
},
|
||||
hookClick(item, event) {
|
||||
this.closeMenu();
|
||||
// launchFullscreen();
|
||||
if (!item.disabled) {
|
||||
setTimeout(() => {
|
||||
if (item && typeof item.click == 'function') {
|
||||
@ -453,52 +433,15 @@ export default {
|
||||
},
|
||||
// 填充计划运行图
|
||||
populatingGenericData() {
|
||||
if (this.loadRunPlanId) {
|
||||
this.$emit('dispatchDialog', { name: 'populatingGenericData', params: {} });
|
||||
} else {
|
||||
this.$messageBox(this.$t('tip.selectARunGraphFirst'));
|
||||
}
|
||||
},
|
||||
// 清除数据
|
||||
handleClearData() {
|
||||
this.$confirm('本操作将清除本运行图数据!', '提示', {
|
||||
confirmButtonText: '确定',
|
||||
cancelButtonText: '取消',
|
||||
center: true
|
||||
}).then(() => {
|
||||
clearPlaningData(this.loadRunPlanId).then(resp => {
|
||||
console.log('清除数据成功!');
|
||||
this.$emit('refresh', this.loadRunPlanId);
|
||||
}).catch(() => {
|
||||
this.$message.error('清除数据失败!');
|
||||
});
|
||||
}).catch(() => {
|
||||
console.error('清除数据失败!');
|
||||
});
|
||||
},
|
||||
newRunPlan() {
|
||||
this.$emit('dispatchDialog', { name: 'createEmptyPlan', params: {}});
|
||||
this.$emit('dispatchDialog', { name: 'populatingGenericData', params: {} });
|
||||
},
|
||||
// newRunPlan() {
|
||||
// this.$emit('dispatchDialog', { name: 'createEmptyPlan', params: {}});
|
||||
// },
|
||||
// 自动生成
|
||||
handleAutoGenerate() {
|
||||
this.$emit('dispatchDialog', { name: 'editSmoothRunTime', params: {} });
|
||||
},
|
||||
// 停站时间
|
||||
handleDwellTime() {
|
||||
if (this.loadRunPlanId) {
|
||||
this.$emit('dispatchDialog', { name: 'modifyingStationStopTime', params: {} });
|
||||
} else {
|
||||
this.$messageBox(this.$t('tip.selectARunGraphFirst'));
|
||||
}
|
||||
},
|
||||
// 运行等级
|
||||
handleRoutingLevel() {
|
||||
if (this.loadRunPlanId) {
|
||||
this.$emit('dispatchDialog', { name: 'modifyingStationIntervalTime', params: {} });
|
||||
} else {
|
||||
this.$messageBox(this.$t('tip.selectARunGraphFirst'));
|
||||
}
|
||||
},
|
||||
// 交路设置
|
||||
handleRoutingSettings() {
|
||||
this.$refs.routeMap.doShow('routeMap');
|
||||
@ -507,18 +450,23 @@ export default {
|
||||
handleRunplanParams() {
|
||||
this.$refs.routeMap.doShow('runplanParams');
|
||||
},
|
||||
// 停站时间
|
||||
handleDwellTime() {
|
||||
this.$emit('dispatchDialog', { name: 'modifyingStationStopTime', params: {} });
|
||||
},
|
||||
// 运行等级
|
||||
handleRoutingLevel() {
|
||||
this.$emit('dispatchDialog', { name: 'modifyingStationIntervalTime', params: {} });
|
||||
},
|
||||
// 生成计划
|
||||
handleGernaratePlanningTrain() {
|
||||
if (this.loadRunPlanId) {
|
||||
this.$emit('dispatchDialog', { name: 'gernaratePlanTrain', params: {} });
|
||||
} else {
|
||||
this.$messageBox(this.$t('tip.selectARunGraphFirst'));
|
||||
}
|
||||
this.$emit('dispatchDialog', { name: 'gernaratePlanTrain', params: {} });
|
||||
},
|
||||
// 校验运行图
|
||||
handlePlanEffectiveCheck() {
|
||||
if (this.loadRunPlanId) {
|
||||
planEffectiveCheck(this.loadRunPlanId).then(resp => {
|
||||
const planId = this.$route.query.planId;
|
||||
if (planId) {
|
||||
planEffectiveCheck(planId).then(resp => {
|
||||
this.$emit('dispatchDialog', {
|
||||
name: 'systermOut',
|
||||
params: {
|
||||
@ -533,21 +481,57 @@ export default {
|
||||
this.$messageBox(this.$t('tip.selectARunGraphFirst'));
|
||||
}
|
||||
},
|
||||
// 测试运行图
|
||||
async handleTestRunPlan() {
|
||||
const data = { planId: this.$route.query.planId || this.loadRunPlanId };
|
||||
runPlanNotify(data).then(resp => {
|
||||
if (resp.data) {
|
||||
const query = {
|
||||
prdType: '01', group: resp.data, mapId: this.$route.query.mapId, planId: this.$route.query.planId
|
||||
};
|
||||
// this.$router.push({ path: `${UrlConfig.display}/plan`, query: query });
|
||||
this.$router.push({ path: UrlConfig.design.testRunPlan, query: query });
|
||||
launchFullscreen();
|
||||
} else {
|
||||
this.$messageBox(this.$t('error.checkTheValidityFirst'));
|
||||
}
|
||||
}).catch(error => {
|
||||
this.$messageBox(this.$t('tip.createSimulationFaild') + this.$t('global.colon') + error.message);
|
||||
});
|
||||
},
|
||||
// 计划参数
|
||||
handleParameter() {
|
||||
this.$emit('dispatchDialog', { name: 'parameter', params: {} });
|
||||
},
|
||||
// 添加计划
|
||||
handleAddPlanningTrain() {
|
||||
if (this.loadRunPlanId) {
|
||||
const planId = this.$route.query.planId || this.loadRunPlanId;
|
||||
if (planId) {
|
||||
this.$emit('dispatchDialog', { name: 'addPlanningTrain', params: {} });
|
||||
} else {
|
||||
this.$messageBox(this.$t('tip.selectARunGraphFirst'));
|
||||
}
|
||||
},
|
||||
// 清除数据
|
||||
handleClearData() {
|
||||
this.$confirm('本操作将清除本运行图数据!', '提示', {
|
||||
confirmButtonText: '确定',
|
||||
cancelButtonText: '取消',
|
||||
center: true
|
||||
}).then(() => {
|
||||
clearPlaningData(this.$route.query.planId).then(resp => {
|
||||
console.log('清除数据成功!');
|
||||
this.$emit('refresh');
|
||||
}).catch(() => {
|
||||
this.$message.error('清除数据失败!');
|
||||
});
|
||||
}).catch(() => {
|
||||
console.error('清除数据失败!');
|
||||
});
|
||||
},
|
||||
// 删除计划
|
||||
handleDeletePlanningTrain() {
|
||||
const serviceNumber = this.$store.state.runPlan.draftSelected.serviceNumber;
|
||||
const serviceNumber = this.$store.state.runPlan.selected.serviceNumber;
|
||||
if (serviceNumber) {
|
||||
this.$emit('dispatchDialog', {
|
||||
name: 'offLine', params: {
|
||||
@ -565,7 +549,7 @@ export default {
|
||||
},
|
||||
// 修改计划
|
||||
handleEditPlanningTrain() {
|
||||
const serviceNumber = this.$store.state.runPlan.draftSelected.serviceNumber;
|
||||
const serviceNumber = this.$store.state.runPlan.selected.serviceNumber;
|
||||
if (serviceNumber) {
|
||||
this.$emit('dispatchDialog', { name: 'editPlanningTrain', params: { serviceNumber } });
|
||||
} else {
|
||||
@ -574,7 +558,7 @@ export default {
|
||||
},
|
||||
// 移动计划
|
||||
handleMovePlanningTrain() {
|
||||
const serviceNumber = this.$store.state.runPlan.draftSelected.serviceNumber;
|
||||
const serviceNumber = this.$store.state.runPlan.selected.serviceNumber;
|
||||
if (serviceNumber) {
|
||||
this.$emit('dispatchDialog', { name: 'movePlaningTrain', params: { serviceNumber } });
|
||||
} else {
|
||||
@ -583,7 +567,7 @@ export default {
|
||||
},
|
||||
// 复制计划
|
||||
handleDuplicateTrain() {
|
||||
const serviceNumber = this.$store.state.runPlan.draftSelected.serviceNumber;
|
||||
const serviceNumber = this.$store.state.runPlan.selected.serviceNumber;
|
||||
if (serviceNumber) {
|
||||
this.$emit('dispatchDialog', { name: 'duplicateTrain', params: { serviceNumber } });
|
||||
} else {
|
||||
@ -592,7 +576,7 @@ export default {
|
||||
},
|
||||
// 添加任务
|
||||
handleAddTask() {
|
||||
const params = this.$store.state.runPlan.draftSelected;
|
||||
const params = this.$store.state.runPlan.selected;
|
||||
if (params.serviceNumber && params.tripNumber) {
|
||||
this.$emit('dispatchDialog', { name: 'addTask', params });
|
||||
} else {
|
||||
@ -601,7 +585,7 @@ export default {
|
||||
},
|
||||
// 删除任务
|
||||
handleDeleteTask() {
|
||||
const params = this.$store.state.runPlan.draftSelected;
|
||||
const params = this.$store.state.runPlan.selected;
|
||||
if (params.serviceNumber && params.tripNumber) {
|
||||
this.$emit('dispatchDialog', { name: 'deleteTask', params });
|
||||
} else {
|
||||
@ -610,7 +594,7 @@ export default {
|
||||
},
|
||||
// 修改任务
|
||||
handleModifyingTask() {
|
||||
const params = this.$store.state.runPlan.draftSelected;
|
||||
const params = this.$store.state.runPlan.selected;
|
||||
if (params.serviceNumber && params.tripNumber) {
|
||||
this.$emit('dispatchDialog', { name: 'modifyingTask', params });
|
||||
} else {
|
||||
@ -622,54 +606,49 @@ export default {
|
||||
},
|
||||
// 修改交路
|
||||
handleModifyingRouting() {
|
||||
const params = this.$store.state.runPlan.draftSelected;
|
||||
const params = this.$store.state.runPlan.selected;
|
||||
this.$emit('dispatchDialog', { name: 'modifyingRouting', params });
|
||||
},
|
||||
// 修改开始时间
|
||||
handleModifyingStartTime() {
|
||||
const params = this.$store.state.runPlan.draftSelected;
|
||||
const params = this.$store.state.runPlan.selected;
|
||||
this.$emit('dispatchDialog', { name: 'modifyingBeginTime', params });
|
||||
},
|
||||
loadingRunPlan(param) {
|
||||
this.$emit('loadingRunPlan', param);
|
||||
},
|
||||
deleteRunPlanOperate() {
|
||||
deleteRunPlanOperate(param) {
|
||||
// 删除运行图
|
||||
if (this.loadRunPlanId) {
|
||||
this.$confirm(this.$t('planMonitor.openRunPlan.confirmDeleteRunPlan'), this.$t('tip.hint'), {
|
||||
confirmButtonText: this.$t('tip.confirm'),
|
||||
cancelButtonText: this.$t('tip.cancel'),
|
||||
type: 'warning'
|
||||
}).then(() => {
|
||||
deleteRunPlan(this.loadRunPlanId).then(Response => {
|
||||
this.$message.success(this.$t('planMonitor.openRunPlan.deleteSuccess'));
|
||||
this.$emit('refresh');
|
||||
}).catch(() => {
|
||||
this.$messageBox(this.$t('tip.deleteOperationGraphFailed'));
|
||||
});
|
||||
}).catch(() => { });
|
||||
} else {
|
||||
this.$message.error('请先打开运行图!');
|
||||
}
|
||||
},
|
||||
publishRunPlan() {
|
||||
if (this.loadRunPlanId) {
|
||||
this.publishVisible = true;
|
||||
this.publishName = this.loadRunPlanName;
|
||||
} else {
|
||||
this.$message.error('请先打开运行图!');
|
||||
}
|
||||
},
|
||||
handleClose() {
|
||||
this.publishVisible = false;
|
||||
},
|
||||
confirmPublish() {
|
||||
publishRunPlanAllUser(this.loadRunPlanId, this.publishName || this.loadRunPlanName).then(resp => {
|
||||
this.$message.success(this.$t('tip.publishRunPlanSuccess'));
|
||||
this.publishVisible = false;
|
||||
this.$confirm(this.$t('planMonitor.openRunPlan.confirmDeleteRunPlan'), this.$t('tip.hint'), {
|
||||
confirmButtonText: this.$t('tip.confirm'),
|
||||
cancelButtonText: this.$t('tip.cancel'),
|
||||
type: 'warning'
|
||||
}).then(() => {
|
||||
deleteRunPlan(param.planId).then(Response => {
|
||||
this.$message.success(this.$t('planMonitor.openRunPlan.deleteSuccess'));
|
||||
this.$emit('checkIsLoadRunPlan', param.planId);
|
||||
}).catch(() => {
|
||||
this.$messageBox(this.$t('tip.deleteOperationGraphFailed'));
|
||||
});
|
||||
}).catch(() => {
|
||||
this.$messageBox(this.$t('tip.publishRunPlanFail'));
|
||||
this.publishVisible = false;
|
||||
this.$message.error('删除运行图失败!');
|
||||
});
|
||||
},
|
||||
publishRunPlan(param) {
|
||||
this.$confirm(this.$t('tip.publishRunPlanTips'), this.$t('tip.hint'), {
|
||||
confirmButtonText: this.$t('tip.confirm'),
|
||||
cancelButtonText: this.$t('tip.cancel'),
|
||||
type: 'warning'
|
||||
}).then(() => {
|
||||
publishRunPlan(param.planId, {runPlanName: param.planName}).then(resp => {
|
||||
if (resp.data.length <= 0) {
|
||||
this.$message.success(this.$t('tip.publishRunPlanSuccess'));
|
||||
} else {
|
||||
this.$messageBox(`${this.$t('tip.publishRunPlanFail')}: ${resp.data[0]}`);
|
||||
}
|
||||
}).catch(() => {
|
||||
this.$messageBox(this.$t('tip.publishRunPlanFail'));
|
||||
});
|
||||
});
|
||||
}
|
||||
}
|
||||
@ -761,11 +740,7 @@ export default {
|
||||
left: 0;
|
||||
display: block !important;
|
||||
}
|
||||
.children-active {
|
||||
position: relative;
|
||||
left: 160px;
|
||||
display: block !important;
|
||||
}
|
||||
|
||||
.menu-ul-text {
|
||||
font-size: 14px;
|
||||
letter-spacing: 0;
|
||||
|
@ -10,12 +10,6 @@
|
||||
:modal="false"
|
||||
: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="10" :offset="1">
|
||||
<el-input v-model="serviceNumber" size="mini" maxlength="3" minlength="2" />
|
||||
</el-col>
|
||||
</el-row> -->
|
||||
<el-form ref="form" :rules="rules" :model="formModel" label-width="100px" size="medium" @submit.native.prevent>
|
||||
<el-form-item prop="serviceNumber" :label="$t('planMonitor.serviceNumber2')+$t('global.colon')" :required="true">
|
||||
<el-input v-model="formModel.serviceNumber" type="text" size="mini" maxlength="3" minlength="2" />
|
||||
@ -77,7 +71,7 @@ export default {
|
||||
} else {
|
||||
const serviceNumberList = Object.keys(this.$store.state.runPlan.editData);
|
||||
if (serviceNumberList.includes(value)) {
|
||||
// new Error('该服务号已存在');
|
||||
// new Error('该服务号已存在')
|
||||
return callback();
|
||||
} else {
|
||||
return callback();
|
||||
@ -110,31 +104,33 @@ export default {
|
||||
}
|
||||
},
|
||||
handleCommit() {
|
||||
if (this.$route.query.planId || this.loadRunPlanId) {
|
||||
checkServiceNumberExist({ planId: this.$route.query.planId || this.loadRunPlanId, serviceNumber: this.formModel.serviceNumber }).then(resp => {
|
||||
if (resp.data) {
|
||||
this.$emit('dispatchDialog', {
|
||||
name: 'offLine',
|
||||
params: {
|
||||
type: 'warning',
|
||||
operate: 'AddPlanningTrain',
|
||||
width: 460,
|
||||
message: this.$t('tip.serviceNumberExistHint')
|
||||
}
|
||||
});
|
||||
this.$refs.form.validate(() => {
|
||||
if (this.$route.query.planId || this.loadRunPlanId) {
|
||||
checkServiceNumberExist({ planId: this.$route.query.planId || this.loadRunPlanId, serviceNumber: this.formModel.serviceNumber }).then(resp => {
|
||||
if (resp.data) {
|
||||
this.$emit('dispatchDialog', {
|
||||
name: 'offLine',
|
||||
params: {
|
||||
type: 'warning',
|
||||
operate: 'AddPlanningTrain',
|
||||
width: 460,
|
||||
message: this.$t('tip.serviceNumberExistHint')
|
||||
}
|
||||
});
|
||||
|
||||
this.doClose();
|
||||
} else {
|
||||
this.handleConfirm(true);
|
||||
}
|
||||
});
|
||||
// if (this.serviceNumber.length >= 2 && this.serviceNumber.length <= 3) {
|
||||
// } else {
|
||||
// this.$messageBox('长度在二到三位');
|
||||
// }
|
||||
} else {
|
||||
this.$messageBox(this.$t('tip.chooseToOpenTheRunGraph'));
|
||||
}
|
||||
this.doClose();
|
||||
} else {
|
||||
this.handleConfirm(true);
|
||||
}
|
||||
});
|
||||
} else {
|
||||
this.$messageBox(this.$t('tip.chooseToOpenTheRunGraph'));
|
||||
}
|
||||
});
|
||||
// if (this.serviceNumber.length >= 2 && this.serviceNumber.length <= 3) {
|
||||
// } else {
|
||||
// this.$messageBox('长度在二到三位');
|
||||
// }
|
||||
},
|
||||
handleConfirm(isNew = false) {
|
||||
this.doClose();
|
||||
@ -151,9 +147,6 @@ export default {
|
||||
.el-input {
|
||||
width: 120px;
|
||||
}
|
||||
.el-button+.el-button{
|
||||
margin-left: 10px !important;
|
||||
}
|
||||
}
|
||||
.add-planning-train{
|
||||
/deep/ {
|
||||
|
@ -13,7 +13,7 @@
|
||||
<div style="margin: 10px;">
|
||||
<el-row>
|
||||
<el-col :span="9" :offset="1">
|
||||
<span>{{$t('global.startTime')+$t('global.colon')}}</span>
|
||||
<span>{{ $t('global.startTime')+$t('global.colon') }}</span>
|
||||
</el-col>
|
||||
<el-col :span="14">
|
||||
<el-time-picker v-model="model.startTime" />
|
||||
@ -21,7 +21,7 @@
|
||||
</el-row>
|
||||
<el-row>
|
||||
<el-col :span="9" :offset="1">
|
||||
<span>{{$t('global.endTime')+$t('global.colon')}}</span>
|
||||
<span>{{ $t('global.endTime')+$t('global.colon') }}</span>
|
||||
</el-col>
|
||||
<el-col :span="14">
|
||||
<el-time-picker v-model="model.endTime" />
|
||||
@ -29,16 +29,16 @@
|
||||
</el-row>
|
||||
<el-row>
|
||||
<el-col :span="9" :offset="1">
|
||||
<span>{{$t('planMonitor.trainRunningTimeInterval')+$t('global.colon')}}</span>
|
||||
<span>{{ $t('planMonitor.trainRunningTimeInterval')+$t('global.colon') }}</span>
|
||||
</el-col>
|
||||
<el-col :span="14">
|
||||
<el-input v-model="model.runInterval" :placeholder="this.$t('rules.pleaseEnterContent')" />
|
||||
<span>{{$t('global.colon')}}</span>
|
||||
<span>{{ $t('global.colon') }}</span>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<el-row>
|
||||
<el-col :span="9" :offset="1">
|
||||
<span>{{$t('planMonitor.sizeOfTheLoopTrainProportion')+$t('global.colon')}}</span>
|
||||
<span>{{ $t('planMonitor.sizeOfTheLoopTrainProportion')+$t('global.colon') }}</span>
|
||||
</el-col>
|
||||
<el-col :span="14">
|
||||
<el-select v-model="model.scale" :placeholder="this.$t('global.choose')">
|
||||
@ -48,28 +48,28 @@
|
||||
</el-row>
|
||||
<el-row>
|
||||
<el-col :span="9" :offset="1">
|
||||
<span>{{$t('planMonitor.applicationRouteSelection')+$t('global.colon')}}</span>
|
||||
<span>{{ $t('planMonitor.applicationRouteSelection')+$t('global.colon') }}</span>
|
||||
</el-col>
|
||||
<el-col :span="14">
|
||||
<el-radio-group v-model="model.direction">
|
||||
<el-radio :label="0">{{$t('planMonitor.bothway')}}</el-radio>
|
||||
<el-radio :label="1">{{$t('planMonitor.up')}}</el-radio>
|
||||
<el-radio :label="2">{{$t('planMonitor.down')}}</el-radio>
|
||||
<el-radio :label="0">{{ $t('planMonitor.bothway') }}</el-radio>
|
||||
<el-radio :label="1">{{ $t('planMonitor.up') }}</el-radio>
|
||||
<el-radio :label="2">{{ $t('planMonitor.down') }}</el-radio>
|
||||
</el-radio-group>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<el-row style="margin-top: 20px">
|
||||
<el-table :data="model.smoothList" border :height="240">
|
||||
<el-table-column prop="startTime" :label="this.$t('global.startTime')" />
|
||||
<el-table-column prop="stopTime" :label="this.$t('global.endTime')"/>
|
||||
<el-table-column prop="stopTime" :label="this.$t('global.endTime')" />
|
||||
<el-table-column prop="runInterval" :label="this.$t('planMonitor.runningInterval')" />
|
||||
<el-table-column prop="scale" :label="this.$t('planMonitor.distributionRatio')" />
|
||||
</el-table>
|
||||
</el-row>
|
||||
</div>
|
||||
<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>
|
||||
@ -77,38 +77,38 @@
|
||||
<script>
|
||||
|
||||
export default {
|
||||
name: 'AddSmoothRunTime',
|
||||
components: {
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
dialogShow: false,
|
||||
loading: false,
|
||||
model: {
|
||||
useSame: false,
|
||||
smoothList: []
|
||||
},
|
||||
scaleList: []
|
||||
};
|
||||
},
|
||||
computed: {
|
||||
title() {
|
||||
return this.$t('planMonitor.addASmoothRunningTime');
|
||||
}
|
||||
},
|
||||
mounted() {
|
||||
},
|
||||
methods: {
|
||||
doShow() {
|
||||
this.dialogShow = true;
|
||||
},
|
||||
doClose() {
|
||||
this.loading = false;
|
||||
this.dialogShow = false;
|
||||
},
|
||||
handleCommit() {
|
||||
}
|
||||
}
|
||||
name: 'AddSmoothRunTime',
|
||||
components: {
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
dialogShow: false,
|
||||
loading: false,
|
||||
model: {
|
||||
useSame: false,
|
||||
smoothList: []
|
||||
},
|
||||
scaleList: []
|
||||
};
|
||||
},
|
||||
computed: {
|
||||
title() {
|
||||
return this.$t('planMonitor.addASmoothRunningTime');
|
||||
}
|
||||
},
|
||||
mounted() {
|
||||
},
|
||||
methods: {
|
||||
doShow() {
|
||||
this.dialogShow = true;
|
||||
},
|
||||
doClose() {
|
||||
this.loading = false;
|
||||
this.dialogShow = false;
|
||||
},
|
||||
handleCommit() {
|
||||
}
|
||||
}
|
||||
};
|
||||
</script>
|
||||
<style rel="stylesheet/scss" lang="scss" scoped>
|
||||
|
@ -54,6 +54,7 @@
|
||||
</el-select> -->
|
||||
<!-- </el-col> -->
|
||||
<el-col :span="3" style="margin-left:10px;height: 28px;line-height: 28px;">
|
||||
<!-- {{ $t('planMonitor.defaultRunLevel') }} -->
|
||||
<span>运行等级</span>
|
||||
</el-col>
|
||||
<el-col :span="5">
|
||||
@ -111,7 +112,17 @@
|
||||
{{ formatName(scope.row.endSectionCode) }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="remarks" :label="this.$t('planMonitor.description')" width="315" />
|
||||
<el-table-column prop="routingType" label="交路类型">
|
||||
<template slot-scope="scope">
|
||||
{{ routingTypeMap[scope.row.routingType] }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="类别" width="240">
|
||||
<template slot-scope="scope">
|
||||
{{ `${frontMap[String(scope.row.startTbFront)]} - ${frontMap[String(scope.row.endTbFront)]}` }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="remarks" width="auto" :label="this.$t('planMonitor.description')" />
|
||||
</el-table>
|
||||
</el-row>
|
||||
<el-row style=" margin-bottom: 5px;margin-top: 10px;">
|
||||
@ -170,20 +181,13 @@
|
||||
|
||||
<script>
|
||||
import { listUserRoutingData, addPlanTrip, getMapStationRunUser, getStationStopTime } from '@/api/runplan';
|
||||
import { getRunplanConfig } from '@/api/jmap/mapdraft';
|
||||
import { formatTime, formatName } from '@/utils/runPlan';
|
||||
|
||||
export default {
|
||||
name: 'AddTask',
|
||||
components: {
|
||||
},
|
||||
props: {
|
||||
loadRunPlanId: {
|
||||
type: String,
|
||||
default() {
|
||||
return '';
|
||||
}
|
||||
}
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
dialogShow: false,
|
||||
@ -198,6 +202,7 @@ export default {
|
||||
endStationFilters:[],
|
||||
// defaultStopTime: '30',
|
||||
defaultSpeedLevel: 'l1',
|
||||
reentryData: {},
|
||||
addModel: {
|
||||
// forward: false,
|
||||
routingCode: '',
|
||||
@ -210,6 +215,10 @@ export default {
|
||||
planId: '',
|
||||
serviceNumber: ''
|
||||
},
|
||||
frontModel: {
|
||||
startTbFront: false,
|
||||
endTbFront: false
|
||||
},
|
||||
tripNumberList: [{ value: '', label: this.$t('planMonitor.automatic') }],
|
||||
// defaultStopTimeList: [{ value: '30', label: this.$t('planMonitor.default') }, { value: '0', label: '0' }],
|
||||
defaultSpeedLevelList: [
|
||||
@ -218,7 +227,18 @@ export default {
|
||||
{ value: 'l3', label: '等级三'},
|
||||
{ value: 'l4', label: '等级四' },
|
||||
{ value: 'l5', label: '等级五' }
|
||||
]
|
||||
],
|
||||
routingTypeMap: {
|
||||
OUTBOUND: '出库',
|
||||
INBOUND: '入库',
|
||||
LOOP: '环路'
|
||||
},
|
||||
frontMap: {
|
||||
'true': '折返轨(站前)',
|
||||
'false': '折返轨(站后)',
|
||||
'undefined': '转换轨',
|
||||
'null': '转换轨'
|
||||
}
|
||||
};
|
||||
},
|
||||
computed: {
|
||||
@ -235,9 +255,6 @@ export default {
|
||||
'addModel.startTime': function () {
|
||||
this.computedDetailList();
|
||||
},
|
||||
// 'defaultStopTime': function () {
|
||||
// this.computedDetailList('defaultStopTime');
|
||||
// },
|
||||
'defaultSpeedLevel': function () {
|
||||
this.computedDetailList('defaultSpeedLevel');
|
||||
}
|
||||
@ -246,13 +263,18 @@ export default {
|
||||
loadInitData(params) {
|
||||
this.isPlan = params.isPlan;
|
||||
this.addModel.serviceNumber = params.serviceNumber;
|
||||
this.addModel.planId = this.loadRunPlanId;
|
||||
this.addModel.planId = this.$route.query.planId;
|
||||
this.addModel.arriveConfigList = [];
|
||||
const planId = this.loadRunPlanId;
|
||||
if (planId) {
|
||||
const mapId = this.$route.query.mapId;
|
||||
listUserRoutingData(mapId).then(resp => {
|
||||
this.routingList = resp.data;
|
||||
const mapId = this.$route.query.mapId;
|
||||
|
||||
if (mapId) {
|
||||
getRunplanConfig(mapId).then(resp => {
|
||||
const data = resp.data;
|
||||
this.reentryData = data.config.reentryData;
|
||||
});
|
||||
|
||||
listUserRoutingData(mapId).then(resp => {
|
||||
this.routingList = resp.data;
|
||||
const startStationFilterMap = {};
|
||||
const endStationFilterMap = {};
|
||||
this.routingList.forEach(routing=>{
|
||||
@ -262,26 +284,11 @@ export default {
|
||||
if (!endStationFilterMap[routing.endStationCode]) {
|
||||
endStationFilterMap[routing.endStationCode] = {text:formatName(routing.endStationCode), value:routing.endStationCode};
|
||||
}
|
||||
let length = routing.parkSectionCodeList.length;
|
||||
if ( length >= 4) {
|
||||
if (routing.parkSectionCodeList[0].stationCode == routing.parkSectionCodeList[1].stationCode) {
|
||||
// routing.startSectionCode = routing.parkSectionCodeList[1].sectionCode;
|
||||
routing.parkSectionCodeList.shift();
|
||||
}
|
||||
length = routing.parkSectionCodeList.length;
|
||||
if (routing.parkSectionCodeList[length - 1].stationCode == routing.parkSectionCodeList[length - 2].stationCode) {
|
||||
// routing.endSectionCode = routing.parkSectionCodeList[length - 2].sectionCode;
|
||||
routing.parkSectionCodeList.pop();
|
||||
}
|
||||
}
|
||||
});
|
||||
this.startStationFilters = Object.values(startStationFilterMap);
|
||||
this.endStationFilters = Object.values(endStationFilterMap);
|
||||
});
|
||||
}
|
||||
|
||||
const mapId = this.$route.query.mapId;
|
||||
if (mapId) {
|
||||
getMapStationRunUser(mapId).then(resp =>{
|
||||
const list = resp.data.list;
|
||||
list.forEach(elem => {
|
||||
@ -293,18 +300,6 @@ export default {
|
||||
this.stopTimeMap[element.stationCode] = {parkingTime:element.parkingTime};
|
||||
});
|
||||
});
|
||||
// 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();
|
||||
// }
|
||||
// });
|
||||
// }
|
||||
// });
|
||||
// }
|
||||
});
|
||||
}
|
||||
},
|
||||
@ -332,8 +327,13 @@ export default {
|
||||
},
|
||||
compuntedRunTime(list, index, runLevel) {
|
||||
let runTime = 0;
|
||||
if (index < list.length - 1) {
|
||||
const stopStationObj = this.stopStationMap[[list[index].sectionCode, list[index + 1].sectionCode].toString()];
|
||||
|
||||
if ((index == 0 || index == list.length-1) && String(this.frontModel.startTbFront) != 'undefined') {
|
||||
return 0
|
||||
}
|
||||
|
||||
if (index < list.length - 1) {
|
||||
const stopStationObj = this.stopStationMap[[list[index].sectionCode, list[index + 1].sectionCode].toString()];
|
||||
if (stopStationObj) {
|
||||
if (stopStationObj.runPlanLevelVO) {
|
||||
runTime = parseInt(stopStationObj.runPlanLevelVO[runLevel]);
|
||||
@ -344,101 +344,49 @@ export default {
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return runTime;
|
||||
},
|
||||
// changeSpeedLevelTime(indexs, speedLevelTime) {
|
||||
// const arriveConfigList = Object.assign([], this.addModel.arriveConfigList);
|
||||
// let tempTime = this.computedTimeByString(this.addModel.startTime) / 1000;
|
||||
// arriveConfigList.forEach((elem, index) => {
|
||||
// elem.arriveTime = index ? formatTime(tempTime) : '';
|
||||
// if (index == indexs) { elem.speedLevelTime = speedLevelTime ? Number(speedLevelTime) : 0; }
|
||||
// elem.arriveTime = index ? formatTime(tempTime) : '';
|
||||
// if (index > 0) {
|
||||
// elem.departureTime = index == arriveConfigList.length - 1 ? '' : formatTime(tempTime + elem.stopTime);
|
||||
// } else {
|
||||
// elem.departureTime = formatTime(tempTime);
|
||||
// }
|
||||
// const realRunlevel = elem.speedLevelTime;
|
||||
// if (index > 0) {
|
||||
// tempTime = tempTime + elem.stopTime + realRunlevel;
|
||||
// } else {
|
||||
// tempTime = tempTime + realRunlevel;
|
||||
// }
|
||||
// });
|
||||
// this.addModel.arriveConfigList = arriveConfigList;
|
||||
// this.addModel.endTime = formatTime(tempTime - this.addModel.arriveConfigList[this.addModel.arriveConfigList.length - 1].stopTime);
|
||||
// },
|
||||
// changeStopTime(indexs, time) {
|
||||
// let tempTime = this.computedTimeByString(this.addModel.startTime) / 1000;
|
||||
// // const runLevel = this.defaultSpeedLevel || 'l3'; // 默认等级三
|
||||
// const arriveConfigList = Object.assign([], this.addModel.arriveConfigList);
|
||||
// arriveConfigList.forEach((elem, index) => {
|
||||
// if (index == indexs) { elem.stopTime = time ? Number(time) : 0; }
|
||||
// elem.arriveTime = index ? formatTime(tempTime) : '';
|
||||
// // const runLevelObj = this.defaultSpeedLevelList.find(speedLevel=>{ return speedLevel.value == runLevel; });
|
||||
// // elem.speedLevel = this.defaultSpeedLevel == 'l3' ? `${this.$t('planMonitor.default')}(${runLevelObj.label})` : runLevelObj.label;
|
||||
// if (index > 0) {
|
||||
// elem.departureTime = index == arriveConfigList.length - 1 ? '' : formatTime(tempTime + elem.stopTime);
|
||||
// } else {
|
||||
// elem.departureTime = formatTime(tempTime);
|
||||
// }
|
||||
// const realRunlevel = elem.speedLevelTime;
|
||||
// if (index > 0) {
|
||||
// tempTime = tempTime + elem.stopTime + realRunlevel;
|
||||
// } else {
|
||||
// tempTime = tempTime + realRunlevel;
|
||||
// }
|
||||
// });
|
||||
// this.addModel.arriveConfigList = arriveConfigList;
|
||||
// this.addModel.endTime = formatTime(tempTime - this.addModel.arriveConfigList[this.addModel.arriveConfigList.length - 1].stopTime);
|
||||
// },
|
||||
computedDetailList(type = null) {
|
||||
if (this.addModel.routingCode) {
|
||||
const list = Object.assign([], this.addModel.arriveConfigList);
|
||||
let tempTime = this.computedTimeByString(this.addModel.startTime) / 1000;
|
||||
const list = Object.assign([], this.addModel.arriveConfigList);
|
||||
const runLevel = this.defaultSpeedLevel || 'l1'; // 默认等级三
|
||||
|
||||
list.forEach((elem, index) => {
|
||||
// type == 'defaultStopTime' ||
|
||||
if (type == 'routingCode') {
|
||||
// elem.stopTime = parseInt(this.defaultStopTime);
|
||||
if (this.stopTimeMap[elem.stationCode]) {
|
||||
// if (index == 0 || index == list.length - 1) {
|
||||
// elem.stopTime = 0;
|
||||
// } else {
|
||||
elem.stopTime = this.stopTimeMap[elem.stationCode].parkingTime;
|
||||
// }
|
||||
} else {
|
||||
elem.stopTime = 0;
|
||||
}
|
||||
}
|
||||
// elem.arriveTime = index ? formatTime(tempTime) : '';
|
||||
if (index) {
|
||||
elem.arriveTime = formatTime(tempTime);
|
||||
} else {
|
||||
const time = tempTime || this.computedTimeByString('23:59:59') / 1000 + 1;
|
||||
elem.arriveTime = formatTime(time - elem.stopTime);
|
||||
}
|
||||
if (index > 0) {
|
||||
elem.departureTime = formatTime(tempTime + elem.stopTime);
|
||||
// elem.departureTime = index == list.length - 1 ? '' : formatTime(tempTime + elem.stopTime);
|
||||
} else {
|
||||
elem.departureTime = formatTime(tempTime);
|
||||
}
|
||||
const runLevelObj = this.defaultSpeedLevelList.find(speedLevel=>{ return speedLevel.value == runLevel; });
|
||||
// if (!elem.speedLevelTime || type == 'defaultSpeedLevel') {
|
||||
const realRunlevel = this.compuntedRunTime(list, index, runLevel);
|
||||
elem.speedLevelTime = realRunlevel;
|
||||
// }
|
||||
// this.defaultSpeedLevel == 'l1' ? `(${runLevelObj.label})` : runLevelObj.label
|
||||
elem.speedLevel = runLevelObj.label;
|
||||
// elem.speedLevelTime = realRunlevel;
|
||||
if (index > 0) {
|
||||
tempTime = tempTime + elem.stopTime + elem.speedLevelTime;
|
||||
} else {
|
||||
tempTime = tempTime + elem.speedLevelTime;
|
||||
if (type == 'routingCode') {
|
||||
if (index == 0 || index == list.length - 1) {
|
||||
elem.stopTime = 0;
|
||||
} else if (this.stopTimeMap[elem.stationCode]) {
|
||||
elem.stopTime = this.stopTimeMap[elem.stationCode].parkingTime;
|
||||
} else {
|
||||
elem.stopTime = 0;
|
||||
}
|
||||
}
|
||||
|
||||
tempTime = tempTime? tempTime: this.computedTimeByString('23:59:59') / 1000 + 1;
|
||||
elem.arriveTime = formatTime(tempTime)
|
||||
elem.departureTime = formatTime(tempTime + elem.stopTime);
|
||||
|
||||
const runLevelObj = this.defaultSpeedLevelList.find(speedLevel=>{ return speedLevel.value == runLevel; });
|
||||
const realRunlevel = this.compuntedRunTime(list, index, runLevel);
|
||||
|
||||
elem.speedLevelTime = realRunlevel;
|
||||
elem.speedLevel = runLevelObj.label;
|
||||
|
||||
|
||||
let fronTime = 0;
|
||||
if (index == 0 &&
|
||||
String(this.frontModel.startTbFront) == 'false') {
|
||||
fronTime = this.reentryData[elem.stationCode].tbTo
|
||||
} else if (index == list.length - 2 &&
|
||||
String(this.frontModel.endTbFront) == 'false') {
|
||||
fronTime = this.reentryData[list[index+1].stationCode].tbTo
|
||||
}
|
||||
|
||||
tempTime = tempTime + fronTime + elem.stopTime + elem.speedLevelTime;
|
||||
});
|
||||
|
||||
this.addModel.endTime = formatTime(tempTime - list[list.length - 1].stopTime);
|
||||
}
|
||||
},
|
||||
@ -453,6 +401,9 @@ export default {
|
||||
this.addModel.endSectionCode = row.endSectionCode;
|
||||
this.addModel.startSectionCode = row.startSectionCode;
|
||||
this.addModel.routingCode = row.code;
|
||||
this.frontModel.startTbFront = row.startTbFront;
|
||||
this.frontModel.endTbFront = row.endTbFront;
|
||||
console.log(row);
|
||||
this.computedDetailList('routingCode');
|
||||
},
|
||||
handleCommit() {
|
||||
@ -486,9 +437,6 @@ export default {
|
||||
.el-row {
|
||||
margin-bottom: 5px !important;
|
||||
}
|
||||
.el-button+.el-button{
|
||||
margin-left: 10px !important;
|
||||
}
|
||||
}
|
||||
|
||||
.add-task{
|
||||
|
@ -40,7 +40,7 @@
|
||||
</el-form>
|
||||
</el-row>
|
||||
</el-tab-pane>
|
||||
<el-tab-pane v-if="$route.path.includes('device')" label="导入运行图" name="three">
|
||||
<el-tab-pane label="导入运行图" name="three">
|
||||
<el-row>
|
||||
<el-button type="text" class="uploadDemo">
|
||||
<input
|
||||
@ -153,7 +153,7 @@ export default {
|
||||
if (valid) {
|
||||
this.loading = true;
|
||||
createEmptyPlan(this.newModel).then(resp => {
|
||||
this.$emit('refresh', resp.data);
|
||||
this.$emit('refresh');
|
||||
this.$message.success(this.$t('tip.createAnEmptyRunGraphSuccessfully'));
|
||||
this.doClose();
|
||||
}).catch((error) => {
|
||||
@ -168,7 +168,7 @@ export default {
|
||||
this.loading = true;
|
||||
postCreatePlan(this.pullModel).then(resp => {
|
||||
this.$message.success(this.$t('tip.createARunGraphSuccessfully'));
|
||||
this.$emit('refresh', resp.data);
|
||||
this.$emit('refresh');
|
||||
this.doClose();
|
||||
}).catch((error) => {
|
||||
this.$messageBox(this.$t('error.createOperationGraphFailed') + this.$t('global.colon') + error.message);
|
||||
@ -215,30 +215,31 @@ export default {
|
||||
});
|
||||
}
|
||||
if (wb) {
|
||||
let jsonData = [];
|
||||
for (const index in wb.Sheets) {
|
||||
jsonData = that.planConvert.importData(wb.Sheets[index], jsonData);
|
||||
}
|
||||
if (jsonData.length) {
|
||||
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();
|
||||
if (response && response.code == 200) {
|
||||
that.$message.success(that.$t('tip.importOperationGraphSuccessfully'));
|
||||
that.$emit('refresh');
|
||||
// this.$emit('dispatchDialog', { name: 'openRunPlan', params: {type: 'add'} });
|
||||
}
|
||||
}).catch(error => {
|
||||
that.loadingDig.close();
|
||||
that.$message.warning(`${that.$t('tip.importRunGraphFailed')} ${error.message}`);
|
||||
});
|
||||
try {
|
||||
let jsonData = [];
|
||||
for (const index in wb.Sheets) {
|
||||
jsonData = that.planConvert.importData(wb.Sheets[index], jsonData);
|
||||
}
|
||||
} else {
|
||||
|
||||
// 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();
|
||||
if (response && response.code == 200) {
|
||||
that.$message.success(that.$t('tip.importOperationGraphSuccessfully'));
|
||||
that.$emit('refresh');
|
||||
// this.$emit('dispatchDialog', { name: 'openRunPlan', params: {type: 'add'} });
|
||||
}
|
||||
}).catch(error => {
|
||||
that.loadingDig.close();
|
||||
that.$message.warning(`${that.$t('tip.importRunGraphFailed')} ${error.message}`);
|
||||
});
|
||||
// }
|
||||
} catch (error) {
|
||||
that.loadingDig.close();
|
||||
that.$message.warning(that.$t('tip.parseRunGraphFailed'));
|
||||
that.$message.warning(`${that.$t('tip.parseRunGraphFailed')} ${error.message}`);
|
||||
}
|
||||
}
|
||||
};
|
||||
|
@ -30,14 +30,6 @@ export default {
|
||||
name: 'DeleteTask',
|
||||
components: {
|
||||
},
|
||||
props: {
|
||||
loadRunPlanId: {
|
||||
type: String,
|
||||
default() {
|
||||
return '';
|
||||
}
|
||||
}
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
dialogShow: false,
|
||||
@ -61,9 +53,10 @@ export default {
|
||||
methods: {
|
||||
doShow(params) {
|
||||
this.isPlan = params.isPlan;
|
||||
this.model.routingCode = params.routingCode;
|
||||
this.model.taskIndex = params.taskIndex;
|
||||
this.model.tripNumber = params.tripNumber;
|
||||
this.model.serviceNumber = params.serviceNumber;
|
||||
this.model.routingCode = params.routingCode;
|
||||
this.dialogShow = true;
|
||||
},
|
||||
doClose() {
|
||||
@ -77,13 +70,13 @@ export default {
|
||||
} else {
|
||||
// 直接删除任务
|
||||
const model = {
|
||||
planId: this.loadRunPlanId,
|
||||
planId: this.$route.query.planId,
|
||||
SDTNumber: `${this.model.serviceNumber}${this.model.tripNumber}`,
|
||||
deleteBefore: this.model.deleteBefore
|
||||
};
|
||||
|
||||
deletePlanTrip(model).then(resp => {
|
||||
this.$store.dispatch('runPlan/setDraftSelected', {});
|
||||
this.$store.dispatch('runPlan/setSelected', {});
|
||||
this.$emit('refresh');
|
||||
// this.$emit('dispatchOperate', {
|
||||
// dialogName: 'openRunPlan', operate: 'loadRunPlanData', params: Object.assign({refresh: true}, this.$route.query)
|
||||
@ -105,9 +98,6 @@ export default {
|
||||
.el-row {
|
||||
margin: 10px;
|
||||
}
|
||||
.el-button+.el-button{
|
||||
margin-left: 10px !important;
|
||||
}
|
||||
}
|
||||
.delete-task{
|
||||
/deep/ {
|
||||
|
@ -43,14 +43,6 @@ export default {
|
||||
name: 'DuplicateTrain',
|
||||
components: {
|
||||
},
|
||||
props: {
|
||||
loadRunPlanId: {
|
||||
type: String,
|
||||
default() {
|
||||
return '';
|
||||
}
|
||||
}
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
dialogShow: false,
|
||||
@ -80,10 +72,13 @@ export default {
|
||||
this.dialogShow = false;
|
||||
},
|
||||
handleCommit() {
|
||||
this.model['planId'] = this.loadRunPlanId;
|
||||
this.model['planId'] = this.$route.query.planId;
|
||||
this.model['serviceNumber'] = this.model.serviceNumber;
|
||||
this.doClose();
|
||||
duplicateService(this.model).then(resp => {
|
||||
// this.$emit('dispatchOperate', {
|
||||
// dialogName: 'openRunPlan', operate: 'loadRunPlanData', params: Object.assign({refresh: true}, this.$route.query)
|
||||
// });
|
||||
this.$emit('refresh');
|
||||
this.$message.success(this.$t('tip.duplicatePlanSuccessful'));
|
||||
}).catch((error) => {
|
||||
|
@ -66,14 +66,6 @@ import { addPlanService, updatePlanService, getRoutingBySDTNumber } from '@/api/
|
||||
|
||||
export default {
|
||||
name: 'EditPlanningTrain',
|
||||
props: {
|
||||
loadRunPlanId: {
|
||||
type: String,
|
||||
default() {
|
||||
return '';
|
||||
}
|
||||
}
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
dialogShow: false,
|
||||
@ -107,7 +99,7 @@ export default {
|
||||
const trainInfo = editData.trainMap[tripNumber];
|
||||
const lastIndex = trainInfo.stationTimeList.length - 1;
|
||||
const model = {
|
||||
planId: this.loadRunPlanId,
|
||||
planId: this.$route.query.planId,
|
||||
SDTNumber: `${this.model.serviceNumber}${tripNumber}`
|
||||
};
|
||||
getRoutingBySDTNumber(model).then(resp => {
|
||||
@ -124,16 +116,7 @@ export default {
|
||||
arriveConfigList: []
|
||||
// parkSectionCodeList
|
||||
};
|
||||
let length = resp.data.parkSectionCodeList.length;
|
||||
if ( length >= 4) {
|
||||
if (resp.data.parkSectionCodeList[0].stationCode == resp.data.parkSectionCodeList[1].stationCode) {
|
||||
resp.data.parkSectionCodeList.shift();
|
||||
}
|
||||
length = resp.data.parkSectionCodeList.length;
|
||||
if (resp.data.parkSectionCodeList[length - 1].stationCode == resp.data.parkSectionCodeList[length - 2].stationCode) {
|
||||
resp.data.parkSectionCodeList.pop();
|
||||
}
|
||||
}
|
||||
|
||||
const newstationTimeList = [];
|
||||
let current = {};
|
||||
trainInfo.stationTimeList.forEach((stationTime, index)=>{
|
||||
@ -173,11 +156,11 @@ export default {
|
||||
},
|
||||
loadInitData(params) {
|
||||
this.isNew = params.isNew;
|
||||
this.model.planId = this.loadRunPlanId;
|
||||
this.model.planId = this.$route.query.planId;
|
||||
this.model.serviceNumber = params.serviceNumber;
|
||||
this.model.tripConfigList = [];
|
||||
if (!this.isNew) {
|
||||
const editData = this.$store.state.runPlan.draftEditData[params.serviceNumber];
|
||||
const editData = this.$store.state.runPlan.editData[params.serviceNumber];
|
||||
if (editData) {
|
||||
const tripNumberList = Object.keys(editData.trainMap).sort((a, b) => { return editData.trainMap[a].oldIndex - editData.trainMap[b].oldIndex; });
|
||||
if (tripNumberList.length > 0) {
|
||||
@ -310,9 +293,8 @@ export default {
|
||||
this.model.tripConfigList.map(each=>{
|
||||
each.startTime = each.arriveConfigList[0].arriveTime;
|
||||
each.endTime = each.arriveConfigList[each.arriveConfigList.length - 1].departureTime;
|
||||
console.log(each, 11111111)
|
||||
});
|
||||
updatePlanService(this.loadRunPlanId, this.model.serviceNumber, this.model).then(() => {
|
||||
updatePlanService(this.$route.query.planId, this.model.serviceNumber, this.model).then(() => {
|
||||
this.$emit('refresh');
|
||||
// this.$emit('dispatchOperate', {
|
||||
// dialogName: 'openRunPlan', operate: 'loadRunPlanData', params: Object.assign({refresh: true}, this.$route.query)
|
||||
@ -337,7 +319,7 @@ export default {
|
||||
display: block !important;
|
||||
height: 36px !important;
|
||||
width: 140px !important;
|
||||
margin: 50px 15px !important;
|
||||
margin: 50px 15px;
|
||||
border: 1px solid black !important;
|
||||
font-weight: bold !important;
|
||||
}
|
||||
@ -346,9 +328,7 @@ export default {
|
||||
.el-row {
|
||||
margin-left: 10px;
|
||||
}
|
||||
.el-button+.el-button{
|
||||
margin-left: 10px !important;
|
||||
}
|
||||
|
||||
.el-input.is-disabled .el-input__inner {
|
||||
height: 20px !important;
|
||||
line-height: 20px !important;
|
||||
|
@ -13,14 +13,14 @@
|
||||
<div style="margin: 10px;">
|
||||
<div style="border: 1px solid #B9B5A7">
|
||||
<el-row>
|
||||
<span style="position: relative; top: -8px; left: 20px">{{$t('planMonitor.editSmoothRun.trainProportion')}}</span>
|
||||
<span style="position: relative; top: -8px; left: 20px">{{ $t('planMonitor.editSmoothRun.trainProportion') }}</span>
|
||||
<el-col :offset="1">
|
||||
<el-checkbox v-model="model.useSame">{{$t('planMonitor.editSmoothRun.allTheLoopTrainProportion')}}</el-checkbox>
|
||||
<el-checkbox v-model="model.useSame">{{ $t('planMonitor.editSmoothRun.allTheLoopTrainProportion') }}</el-checkbox>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<el-row>
|
||||
<el-col :span="9" :offset="1">
|
||||
<span>{{$t('planMonitor.editSmoothRun.sizeOfTheLoopTrainProportion')}}</span>
|
||||
<span>{{ $t('planMonitor.editSmoothRun.sizeOfTheLoopTrainProportion') }}</span>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-select v-model="model.scale" :placeholder="$t('planMonitor.editSmoothRun.pleaseSelect')">
|
||||
@ -43,14 +43,14 @@
|
||||
</el-table>
|
||||
</el-row>
|
||||
<el-row type="flex" justify="center" class="button-group">
|
||||
<el-button @click="handleAdd">{{$t('planMonitor.editSmoothRun.add')}}</el-button>
|
||||
<el-button @click="handleDelete">{{$t('planMonitor.editSmoothRun.delete')}}</el-button>
|
||||
<el-button @click="handleEdit">{{$t('planMonitor.editSmoothRun.modify')}}</el-button>
|
||||
<el-button @click="handleAdd">{{ $t('planMonitor.editSmoothRun.add') }}</el-button>
|
||||
<el-button @click="handleDelete">{{ $t('planMonitor.editSmoothRun.delete') }}</el-button>
|
||||
<el-button @click="handleEdit">{{ $t('planMonitor.editSmoothRun.modify') }}</el-button>
|
||||
</el-row>
|
||||
</div>
|
||||
<el-row type="flex" justify="center" class="button-group">
|
||||
<el-button style="padding: 0px; margin: 0px 30px" @click="handleCommit">{{$t('global.confirm')}}</el-button>
|
||||
<el-button style="padding: 0px; margin: 0px 30px" @click="doClose">{{$t('global.cancel')}}</el-button>
|
||||
<el-button style="padding: 0px; margin: 0px 30px" @click="handleCommit">{{ $t('global.confirm') }}</el-button>
|
||||
<el-button style="padding: 0px; margin: 0px 30px" @click="doClose">{{ $t('global.cancel') }}</el-button>
|
||||
</el-row>
|
||||
</el-dialog>
|
||||
</template>
|
||||
@ -58,47 +58,47 @@
|
||||
<script>
|
||||
|
||||
export default {
|
||||
name: 'EditSmoothRunTime',
|
||||
components: {
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
dialogShow: false,
|
||||
loading: false,
|
||||
model: {
|
||||
useSame: false,
|
||||
smoothList: []
|
||||
},
|
||||
scaleList: []
|
||||
};
|
||||
},
|
||||
computed: {
|
||||
title() {
|
||||
return this.$t('planMonitor.editSmoothRun.editSmoothRunTime');
|
||||
}
|
||||
},
|
||||
mounted() {
|
||||
},
|
||||
methods: {
|
||||
doShow() {
|
||||
this.dialogShow = true;
|
||||
},
|
||||
doClose() {
|
||||
this.loading = false;
|
||||
this.dialogShow = false;
|
||||
},
|
||||
handleAdd() {
|
||||
this.$emit('dispatchDialog', { name: 'addSmoothRunTime', params: {} });
|
||||
},
|
||||
handleDelete() {
|
||||
this.$emit('dispatchDialog', { name: 'addSmoothRunTime', params: {} });
|
||||
},
|
||||
handleEdit() {
|
||||
name: 'EditSmoothRunTime',
|
||||
components: {
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
dialogShow: false,
|
||||
loading: false,
|
||||
model: {
|
||||
useSame: false,
|
||||
smoothList: []
|
||||
},
|
||||
scaleList: []
|
||||
};
|
||||
},
|
||||
computed: {
|
||||
title() {
|
||||
return this.$t('planMonitor.editSmoothRun.editSmoothRunTime');
|
||||
}
|
||||
},
|
||||
mounted() {
|
||||
},
|
||||
methods: {
|
||||
doShow() {
|
||||
this.dialogShow = true;
|
||||
},
|
||||
doClose() {
|
||||
this.loading = false;
|
||||
this.dialogShow = false;
|
||||
},
|
||||
handleAdd() {
|
||||
this.$emit('dispatchDialog', { name: 'addSmoothRunTime', params: {} });
|
||||
},
|
||||
handleDelete() {
|
||||
this.$emit('dispatchDialog', { name: 'addSmoothRunTime', params: {} });
|
||||
},
|
||||
handleEdit() {
|
||||
|
||||
},
|
||||
handleCommit() {
|
||||
}
|
||||
}
|
||||
},
|
||||
handleCommit() {
|
||||
}
|
||||
}
|
||||
};
|
||||
</script>
|
||||
<style rel="stylesheet/scss" lang="scss" scoped>
|
||||
|
232
src/views/planMonitor/newEditTool/menus/gernaratePlanTrain.vue
Normal file
232
src/views/planMonitor/newEditTool/menus/gernaratePlanTrain.vue
Normal file
@ -0,0 +1,232 @@
|
||||
<template>
|
||||
<el-dialog
|
||||
v-dialogDrag
|
||||
class="planEdit__tool gernarate-plan-train"
|
||||
:title="title"
|
||||
:visible.sync="dialogShow"
|
||||
width="500px"
|
||||
:before-close="doClose"
|
||||
:z-index="2000"
|
||||
:modal="false"
|
||||
top="10vh"
|
||||
:close-on-click-modal="false"
|
||||
>
|
||||
<data-form ref="dataform" :form="form" :form-model="formModel" :rules="rules" />
|
||||
<span slot="footer" class="dialog-footer">
|
||||
<el-button size="small" @click="doClose">{{ $t('global.cancel') }}</el-button>
|
||||
<el-button type="primary" size="small" :loading="loading" @click="handleCommit">{{ $t('global.confirm') }}</el-button>
|
||||
</span>
|
||||
</el-dialog>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import { generatePlanTrain, listUserRoutingData } from '@/api/runplan';
|
||||
export default {
|
||||
props: {
|
||||
loadRunPlanId: {
|
||||
type: String,
|
||||
default() {
|
||||
return '';
|
||||
}
|
||||
}
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
dialogShow: false,
|
||||
routingList: [],
|
||||
loading: false,
|
||||
runLevelList: [
|
||||
{ value: 1, label: '等级一' },
|
||||
{ value: 2, label: '等级二' },
|
||||
{ value: 3, label: '等级三'},
|
||||
{ value: 4, label: '等级四' },
|
||||
{ value: 5, label: '等级五' }
|
||||
],
|
||||
formModel: {
|
||||
gernarateType:'01',
|
||||
serviceNumber:'', // 服务号
|
||||
beginTime: '', // 开始时间
|
||||
overTime: '', // 结束时间
|
||||
runLevel:'', // 运行等级
|
||||
departureInterval:180, // 发车间隔
|
||||
// reentryTime:120, // 折返时间
|
||||
inboundRouting:'', // 回库交路code
|
||||
outboundRouting:'', // 出库交路code
|
||||
runningRouting1: '', // 环路code1
|
||||
runningRouting2: '' // 环路code2
|
||||
},
|
||||
|
||||
rules: {
|
||||
serviceNumber:[
|
||||
{required: true, validator: this.validateServiceNumber, trigger: 'blur'},
|
||||
// {required: true, validator: this.validateServiceNumber, trigger: 'change'}
|
||||
{required: true, validator: this.validateServiceNo, trigger: 'change'}
|
||||
],
|
||||
beginTime: [
|
||||
{ required: true, message: '请填写开始时间', trigger: 'blur' }
|
||||
],
|
||||
overTime: [
|
||||
{ required: true, message: '请填写结束时间', trigger: 'blur' }
|
||||
],
|
||||
runLevel: [
|
||||
{ required: true, message: '请选择运行等级', trigger: 'change' }
|
||||
],
|
||||
departureInterval:[
|
||||
{ required: true, message: '请填写发车间隔', trigger: 'blur' }
|
||||
],
|
||||
// reentryTime:[
|
||||
// { required: true, message: '请填写折返时间', trigger: 'blur' }
|
||||
// ],
|
||||
inboundRouting: [
|
||||
{ required: true, message: '请选择回库交路', trigger: 'change' }
|
||||
],
|
||||
outboundRouting: [
|
||||
{ required: true, message: '请选择出库交路', trigger: 'change' }
|
||||
],
|
||||
runningRouting1: [
|
||||
// message: '请选择环路',
|
||||
{ required: true, validator: this.validateRunningRouting, trigger: 'change' },
|
||||
{ required: true, validator: this.validateRunningRouting, trigger: 'blur' }
|
||||
],
|
||||
runningRouting2: [
|
||||
{ required: true, validator: this.validateRunningRouting, trigger: 'change' },
|
||||
{ required: true, validator: this.validateRunningRouting, trigger: 'blur' }
|
||||
]
|
||||
}
|
||||
};
|
||||
},
|
||||
computed: {
|
||||
title() {
|
||||
return '生成计划';
|
||||
},
|
||||
form() {
|
||||
return {
|
||||
labelWidth: '100px',
|
||||
size:'small',
|
||||
items: [
|
||||
{ prop: 'gernarateType', label: '生成类型', type: 'checkBox', children: [
|
||||
{ name: '单条服务', value: '01' },
|
||||
{ name: '多条服务', value: '02' }
|
||||
] },
|
||||
{ prop: 'serviceNumber', label: '服务号', type: 'text', rightWidth:true, maxlength:3, show:this.formModel.gernarateType == '01'},
|
||||
{ prop: 'beginTime', label: '开始时间', type: 'timePicker', selectableRange:'02:00:00-23:59:59'},
|
||||
{ prop: 'overTime', label: '结束时间', type: 'timePicker', selectableRange:'02:00:00-23:59:59'},
|
||||
{ prop: 'runLevel', label: '运行等级', type: 'select', options: this.runLevelList },
|
||||
{ prop: 'departureInterval', label: '发车间隔', type: 'number', show:this.formModel.gernarateType == '02', min:0, step:1, precisionFlag:true, precision:0, message:'s'},
|
||||
// { prop: 'reentryTime', label: '折返时间', type: 'number', min:120, step:1, precisionFlag:true, precision:0, message:'s' },
|
||||
{ prop: 'outboundRouting', label: '出库交路', type: 'select', options: this.covertRouting('OUTBOUND'), noDataText:'请先设置交路'},
|
||||
{ prop: 'runningRouting1', label: '环路交路1', type: 'select', show:true, options: this.covertRouting('LOOP'), noDataText:'请先设置交路', change:true, onChange:this.changeRoute2 },
|
||||
{ prop: 'runningRouting2', label: '环路交路2', type: 'select', show:true, options: this.covertRouting('LOOP'), noDataText:'请先设置交路', change:true, onChange:this.changeRoute1},
|
||||
{ prop: 'inboundRouting', label: '入库交路', type: 'select', options: this.covertRouting('INBOUND'), noDataText:'请先设置交路'}
|
||||
]
|
||||
};
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
doShow(params) {
|
||||
this.loading = false;
|
||||
const mapId = this.$route.query.mapId;
|
||||
if (mapId) {
|
||||
listUserRoutingData(mapId).then(response => {
|
||||
this.routingList = response.data.map(elem => { return { value: elem.code, label: elem.name, routingType:elem.routingType }; });
|
||||
}).catch(() => {
|
||||
this.$messageBox(`获取交路列表失败`);
|
||||
});
|
||||
}
|
||||
this.dialogShow = true;
|
||||
},
|
||||
validateServiceNumber(rule, value, callback) {
|
||||
if (typeof value == 'string' && value.trim().length == 0) {
|
||||
return callback(new Error('请填写服务号'));
|
||||
} else {
|
||||
let newValue = parseInt(value);
|
||||
if (newValue) {
|
||||
if (newValue > 0 & newValue < 9) {
|
||||
newValue = '00' + newValue;
|
||||
} else if (newValue > 10 & newValue < 99) {
|
||||
newValue = '0' + newValue;
|
||||
}
|
||||
this.formModel.serviceNumber = newValue;
|
||||
const serviceNumberList = Object.keys(this.$store.state.runPlan.editData);
|
||||
if (serviceNumberList.includes(value)) {
|
||||
return callback(new Error('该服务号已存在'));
|
||||
} else {
|
||||
return callback();
|
||||
}
|
||||
} else {
|
||||
this.formModel.serviceNumber = '';
|
||||
}
|
||||
|
||||
}
|
||||
},
|
||||
validateServiceNo(rule, value, callback) {
|
||||
if (typeof value == 'string' && value.trim().length == 0) {
|
||||
return callback(new Error('请填写服务号'));
|
||||
} else {
|
||||
const serviceNumberList = Object.keys(this.$store.state.runPlan.editData);
|
||||
if (serviceNumberList.includes(value)) {
|
||||
return callback(new Error('该服务号已存在'));
|
||||
} else {
|
||||
return callback();
|
||||
}
|
||||
}
|
||||
},
|
||||
validateRunningRouting(rule, value, callback) {
|
||||
if (value.trim().length == 0) {
|
||||
return callback(new Error('请选择环路'));
|
||||
} else {
|
||||
if (this.formModel.runningRouting1 == this.formModel.runningRouting2) {
|
||||
return callback(new Error('环路交路1和环路交路2不能相同'));
|
||||
} else {
|
||||
return callback();
|
||||
}
|
||||
}
|
||||
},
|
||||
changeRoute2() {
|
||||
this.changeRoute('runningRouting2');
|
||||
},
|
||||
changeRoute1() {
|
||||
this.changeRoute('runningRouting1');
|
||||
},
|
||||
changeRoute(runningRouting) {
|
||||
if (this.formModel[runningRouting]) { this.$refs.dataform.validateField([runningRouting]); }
|
||||
},
|
||||
doClose() {
|
||||
this.loading = false;
|
||||
this.$refs.dataform.resetForm();
|
||||
this.dialogShow = false;
|
||||
},
|
||||
covertRouting(routingType) {
|
||||
return this.routingList.filter(route=>{ return route.routingType == routingType; });
|
||||
},
|
||||
handleCommit() {
|
||||
this.$refs.dataform.validateForm(() => {
|
||||
if (this.formModel.overTime <= this.formModel.beginTime) {
|
||||
this.$messageBox('结束时间必须大于开始时间');
|
||||
return false;
|
||||
}
|
||||
const formModel = Object.assign({}, this.formModel);
|
||||
if (formModel.gernarateType == '01') {
|
||||
delete formModel.departureInterval;
|
||||
} else {
|
||||
delete formModel.serviceNumber;
|
||||
}
|
||||
delete formModel.gernarateType;
|
||||
this.loading = true;
|
||||
generatePlanTrain(this.$route.query.planId || this.loadRunPlanId, formModel).then(res => {
|
||||
this.loading = false;
|
||||
this.doClose();
|
||||
this.$refs.dataform.resetForm();
|
||||
this.$store.dispatch('runPlan/refresh');
|
||||
}).catch(error => {
|
||||
console.log(error);
|
||||
// this.doClose();
|
||||
this.$messageBox(error.message);
|
||||
});
|
||||
});
|
||||
}
|
||||
}
|
||||
};
|
||||
</script>
|
||||
<style rel="stylesheet/scss" lang="scss" scoped>
|
||||
</style>
|
@ -33,14 +33,6 @@
|
||||
import { updateTripNumber, updateServiceNumber } from '@/api/runplan';
|
||||
export default {
|
||||
name:'ModifyService',
|
||||
props: {
|
||||
loadRunPlanId: {
|
||||
type: String,
|
||||
default() {
|
||||
return '';
|
||||
}
|
||||
}
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
dialogShow:false,
|
||||
@ -75,7 +67,7 @@ export default {
|
||||
if (this.isModifyServiceNumber) {
|
||||
const result = /^\d{2,}$/.test(this.serviceNumber);
|
||||
if (this.serviceNumber && result) {
|
||||
updateServiceNumber(this.loadRunPlanId, this.oldServiceNumber, this.serviceNumber).then(res=>{
|
||||
updateServiceNumber(this.$route.query.planId, this.oldServiceNumber, this.serviceNumber).then(res=>{
|
||||
this.$message.success('修改计划号成功');
|
||||
// this.$emit('refresh');
|
||||
this.dialogShow = false;
|
||||
@ -91,7 +83,7 @@ export default {
|
||||
const result = /^\d{2,}$/.test(this.tripNumber);
|
||||
if (this.tripNumber && result) {
|
||||
const SDTNumber = this.oldServiceNumber + this.oldTripNumber;
|
||||
updateTripNumber(this.loadRunPlanId, SDTNumber, this.tripNumber).then(res=>{
|
||||
updateTripNumber(this.$route.query.planId, SDTNumber, this.tripNumber).then(res=>{
|
||||
this.$message.success('修改车次号成功');
|
||||
// this.$emit('refresh');
|
||||
this.dialogShow = false;
|
||||
|
@ -10,6 +10,38 @@
|
||||
:modal="false"
|
||||
:close-on-click-modal="false"
|
||||
>
|
||||
<el-row :gutter="15">
|
||||
<el-form ref="form" :model="form" label-width="60px" size="mini">
|
||||
<el-col :span="4">
|
||||
<el-form-item label="等级一:">
|
||||
<el-input v-model="form.level1" @blur="handleBlur(form.level1, '1')" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="4">
|
||||
<el-form-item label="等级二:">
|
||||
<el-input v-model="form.level2" @blur="handleBlur(form.level2, '2')" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="4">
|
||||
<el-form-item label="等级三:">
|
||||
<el-input v-model="form.level3" @blur="handleBlur(form.level3, '3')" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="4">
|
||||
<el-form-item label="等级四:">
|
||||
<el-input v-model="form.level4" @blur="handleBlur(form.level4, '4')" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="4">
|
||||
<el-form-item label="等级五:">
|
||||
<el-input v-model="form.level5" @blur="handleBlur(form.level5, '5')" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="4">
|
||||
<div style="line-height: 29px; font-size: 15px;">速度单位: (Km/h)</div>
|
||||
</el-col>
|
||||
</el-form>
|
||||
</el-row>
|
||||
<el-row>
|
||||
<el-table :data="stationIntervalData" border style="width: 100%" height="320">
|
||||
<el-table-column prop="startStationCode" :label="$t('planMonitor.modifying.startingStation')" width="120">
|
||||
@ -17,7 +49,7 @@
|
||||
<span style="margin-left: 10px">{{ formatName(scope.row.startStationCode) }}</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="startSectionCode" :label="$t('planMonitor.modifying.startSection')">
|
||||
<el-table-column prop="startSectionCode" :label="$t('planMonitor.modifying.startSection')" width="120">
|
||||
<template slot-scope="scope">
|
||||
<span style="margin-left: 10px">{{ formatName(scope.row.startSectionCode) }}</span>
|
||||
</template>
|
||||
@ -27,72 +59,61 @@
|
||||
<span style="margin-left: 10px">{{ formatName(scope.row.endStationCode) }}</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="endSectionCode" :label="$t('planMonitor.modifying.endSection')">
|
||||
<el-table-column prop="endSectionCode" :label="$t('planMonitor.modifying.endSection')" width="120">
|
||||
<template slot-scope="scope">
|
||||
<span style="margin-left: 10px">{{ formatName(scope.row.endSectionCode) }}</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="directionCode" :label="$t('planMonitor.modifying.direction')" width="60">
|
||||
<el-table-column prop="right" :label="$t('planMonitor.modifying.direction')" width="60">
|
||||
<template slot-scope="scope">
|
||||
<span style="margin-left: 10px">{{ scope.row.right?'右行':'左行' }}</span>
|
||||
<span style="margin-left: 10px">{{ scope.row.right?'上行':'下行' }}</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="distance" :label="$t('planMonitor.modifying.distance')" width="65">
|
||||
<el-table-column prop="distance" :label="$t('planMonitor.modifying.distance')" width="85">
|
||||
<template slot-scope="scope">
|
||||
<span style="margin-left: 10px">{{ scope.row.distance/100 }}</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="runPlanLevelVO" :label="$t('planMonitor.updateStation.level1')" width="70">
|
||||
<template slot-scope="scope">
|
||||
<span
|
||||
style="margin-left: 10px"
|
||||
:style="{color: scope.row.isEditStatus? 'red': 'black'}"
|
||||
>{{ scope.row.l1 || '' }}</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="runPlanLevelVO" :label="$t('planMonitor.updateStation.level2')" width="70">
|
||||
<template slot-scope="scope">
|
||||
<span
|
||||
style="margin-left: 10px"
|
||||
:style="{color: scope.row.isEditStatus? 'red': 'black'}"
|
||||
>{{ scope.row.l2 || '' }}</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="runPlanLevelVO" :label="$t('planMonitor.updateStation.level3')" width="70">
|
||||
<template slot-scope="scope">
|
||||
<span
|
||||
style="margin-left: 10px"
|
||||
:style="{color: scope.row.isEditStatus? 'red': 'black'}"
|
||||
>{{ scope.row.l3 || '' }}</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="runPlanLevelVO" :label="$t('planMonitor.updateStation.level4')" width="70">
|
||||
<template slot-scope="scope">
|
||||
<span
|
||||
style="margin-left: 10px"
|
||||
:style="{color: scope.row.isEditStatus? 'red': 'black'}"
|
||||
>{{ scope.row.l4 || '' }}</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="runPlanLevelVO" :label="$t('planMonitor.updateStation.level5')" width="70">
|
||||
<template slot-scope="scope">
|
||||
<span
|
||||
style="margin-left: 10px"
|
||||
:style="{color: scope.row.isEditStatus?'red': 'black'}"
|
||||
>{{ scope.row.l5 || '' }}</span>
|
||||
<span style="margin-left: 10px">{{ scope.row.distance }}</span>
|
||||
<!-- <el-input v-model="scope.row.distance" class="input_text_box" /> -->
|
||||
</template>
|
||||
</el-table-column>
|
||||
<div>
|
||||
<el-table-column prop="l1" :label="$t('planMonitor.updateStation.level1')" width="70">
|
||||
<template slot-scope="scope">
|
||||
<el-input v-model="scope.row.l1" class="input_text_box" />
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="l2" :label="$t('planMonitor.updateStation.level2')" width="70">
|
||||
<template slot-scope="scope">
|
||||
<el-input v-model="scope.row.l2" class="input_text_box" />
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="l3" :label="$t('planMonitor.updateStation.level3')" width="70">
|
||||
<template slot-scope="scope">
|
||||
<el-input v-model="scope.row.l3" class="input_text_box" />
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="l2" :label="$t('planMonitor.updateStation.level4')" width="70">
|
||||
<template slot-scope="scope">
|
||||
<el-input v-model="scope.row.l4" class="input_text_box" />
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="l2" :label="$t('planMonitor.updateStation.level5')" width="70">
|
||||
<template slot-scope="scope">
|
||||
<el-input v-model="scope.row.l5" class="input_text_box" />
|
||||
</template>
|
||||
</el-table-column>
|
||||
</div>
|
||||
</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 @click="handleStationDistance">更新距离</el-button>
|
||||
<el-button @click="doClose">关闭</el-button>
|
||||
<el-button @click="handleStationTime">更新</el-button>
|
||||
</div>
|
||||
</el-dialog>
|
||||
</template>
|
||||
<script>
|
||||
import { formatName } from '@/utils/runPlan';
|
||||
import { getMapStationRun } from '@/api/runplan';
|
||||
import { setStationRunning, getMapStationRunUser, updateRunlevelDistance } from '@/api/runplan';
|
||||
|
||||
export default {
|
||||
name: 'ModifyingStationIntervalTime',
|
||||
@ -102,37 +123,94 @@ export default {
|
||||
return {
|
||||
dialogShow: false,
|
||||
loading: false,
|
||||
DirectionCodeMap: {},
|
||||
stationIntervalData: [],
|
||||
params: {}
|
||||
params: {},
|
||||
form: {
|
||||
level1: '',
|
||||
level2: '',
|
||||
level3: '',
|
||||
level4: '',
|
||||
level5: ''
|
||||
}
|
||||
};
|
||||
},
|
||||
computed: {
|
||||
title() {
|
||||
return this.$t('planMonitor.modifying.modifyRunLevel');
|
||||
},
|
||||
isNewMap() {
|
||||
return this.$route.path.includes('displayNew');
|
||||
}
|
||||
},
|
||||
mounted() {
|
||||
this.loadInitData();
|
||||
// this.loadInitData();
|
||||
},
|
||||
methods: {
|
||||
formatName(code) {
|
||||
return formatName(code);
|
||||
},
|
||||
loadInitData() {
|
||||
this.stationIntervalData = [];
|
||||
this.DirectionCodeMap = {};
|
||||
this.$ConstSelect.DirectionCodeList.forEach(elem => {
|
||||
this.DirectionCodeMap[elem.value] = elem.label;
|
||||
});
|
||||
if (this.$route.query.lineCode) {
|
||||
getMapStationRun(this.$route.query.mapId).then(resp =>{
|
||||
const list = resp.data;
|
||||
list.forEach(elem => {
|
||||
elem.isEditStatus = false;
|
||||
});
|
||||
getMapStationRunUser(this.$route.query.mapId).then(resp =>{
|
||||
const list = resp.data.list;
|
||||
this.stationIntervalData = [];
|
||||
this.stationIntervalData = list;
|
||||
this.form.level1 = '';
|
||||
this.form.level2 = '';
|
||||
this.form.level3 = '';
|
||||
this.form.level4 = '';
|
||||
this.form.level5 = '';
|
||||
|
||||
});
|
||||
}
|
||||
},
|
||||
handleBlur(limit, level) {
|
||||
if (limit) {
|
||||
this.stationIntervalData.forEach(item => {
|
||||
if (level == '1') {
|
||||
item.l1 = Math.round(item.distance / (this.form.level1 / 3.6));
|
||||
} else if (level == '2') {
|
||||
item.l2 = Math.round(item.distance / (this.form.level2 / 3.6));
|
||||
} else if (level == '3') {
|
||||
item.l3 = Math.round(item.distance / (this.form.level3 / 3.6));
|
||||
} else if (level == '4') {
|
||||
item.l4 = Math.round(item.distance / (this.form.level4 / 3.6));
|
||||
} else if (level == '5') {
|
||||
item.l5 = Math.round(item.distance / (this.form.level5 / 3.6));
|
||||
}
|
||||
});
|
||||
}
|
||||
},
|
||||
handleStationTime() {
|
||||
setStationRunning(this.$route.query.mapId, this.stationIntervalData).then(resp => {
|
||||
this.$message.success(this.$t('planMonitor.modifying.modifySuccess'));
|
||||
}).catch((error) => {
|
||||
this.$messageBox(this.$t('planMonitor.modifying.modifyFailed') + ': ' + error.message);
|
||||
});
|
||||
},
|
||||
handleStationDistance() {
|
||||
updateRunlevelDistance(this.$route.query.mapId).then(resp => {
|
||||
if (resp.data) {
|
||||
this.$message.success('更新成功');
|
||||
const list = resp.data;
|
||||
const stationIntervalData = [];
|
||||
this.stationIntervalData.forEach(station=>{
|
||||
if (list[station.id]) {
|
||||
const tempStation = Object.assign({}, station);
|
||||
tempStation.distance = list[station.id];
|
||||
stationIntervalData.push(tempStation);
|
||||
}
|
||||
});
|
||||
this.stationIntervalData = stationIntervalData;
|
||||
} else {
|
||||
this.$messageBox('更新失败:数据为空');
|
||||
}
|
||||
}).catch((error) => {
|
||||
this.$messageBox('更新失败: ' + error.message);
|
||||
});
|
||||
},
|
||||
doShow(params) {
|
||||
this.params = params || {};
|
||||
this.loadInitData();
|
||||
@ -142,23 +220,27 @@ export default {
|
||||
this.loading = false;
|
||||
this.dialogShow = false;
|
||||
}
|
||||
// handleSave() {
|
||||
// const data = [];
|
||||
// this.stationIntervalData.forEach(elem => {
|
||||
// data.push(elem.runPlanLevelVO);
|
||||
// });
|
||||
// setStationRunning(this.$route.query.mapId, data).then(resp => {
|
||||
// this.stationIntervalData.forEach(elem => {
|
||||
// elem.isEditStatus = false;
|
||||
// });
|
||||
// this.$message.success(this.$t('planMonitor.modifying.modifySuccess'));
|
||||
// }).catch(() => {
|
||||
// this.$messageBox(this.$t('planMonitor.modifying.modifyFailed'));
|
||||
// });
|
||||
// }
|
||||
}
|
||||
};
|
||||
</script>
|
||||
<style rel="stylesheet/scss" lang="scss" scoped>
|
||||
@import "src/styles/mixin.scss";
|
||||
@import "src/styles/mixin.scss";
|
||||
.planEdit__tool {
|
||||
/deep/{
|
||||
.el-dialog__body{
|
||||
padding-top: 0;
|
||||
}
|
||||
.el-form-item--mini.el-form-item, .el-form-item--small.el-form-item{
|
||||
margin-bottom: 8px;
|
||||
}
|
||||
}
|
||||
}
|
||||
.input_text_box{
|
||||
/deep/{
|
||||
.el-input__inner{
|
||||
padding: 0;
|
||||
text-align: center;
|
||||
}
|
||||
}
|
||||
}
|
||||
</style>
|
||||
|
@ -0,0 +1,134 @@
|
||||
<template>
|
||||
<el-dialog
|
||||
v-dialogDrag
|
||||
class="planEdit__tool add-planning-train"
|
||||
:title="title"
|
||||
:visible.sync="dialogShow"
|
||||
width="600px"
|
||||
:before-close="doClose"
|
||||
:z-index="2000"
|
||||
:modal="false"
|
||||
:close-on-click-modal="false"
|
||||
>
|
||||
<el-row>
|
||||
<el-table :data="stationIntervalData" border style="width: 100%" height="320">
|
||||
<el-table-column prop="startStationCode" label="车站名称">
|
||||
<template slot-scope="scope">
|
||||
<span style="margin-left: 10px">{{ formatName(scope.row.stationCode) }}</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="startSectionCode" label="区段名称">
|
||||
<template slot-scope="scope">
|
||||
<span style="margin-left: 10px">{{ formatName(scope.row.sectionCode) }}</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="right" label="所属站台">
|
||||
<template slot-scope="scope">
|
||||
<!-- ?'上行站台':'下行站台' -->
|
||||
<span style="margin-left: 10px">{{ formatSelect(scope.row.sectionCode) }}</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="parkingTime" label="停站时间" width="90">
|
||||
<template slot-scope="scope">
|
||||
<el-input v-model="scope.row.parkingTime" class="input_text_box" />
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
</el-row>
|
||||
<div class="button-group" style="text-align: center; margin-top: 10px;">
|
||||
<el-button @click="doClose">关闭</el-button>
|
||||
<el-button @click="handleStationTime">更新</el-button>
|
||||
</div>
|
||||
</el-dialog>
|
||||
</template>
|
||||
<script>
|
||||
import { formatName } from '@/utils/runPlan';
|
||||
import { setStationStopTime, getStationStopTime } from '@/api/runplan';
|
||||
|
||||
export default {
|
||||
name: 'ModifyingStationIntervalTime',
|
||||
components: {
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
dialogShow: false,
|
||||
loading: false,
|
||||
DirectionCodeMap: {},
|
||||
stationIntervalData: [],
|
||||
params: {}
|
||||
};
|
||||
},
|
||||
computed: {
|
||||
title() {
|
||||
return this.$t('planMonitor.modifying.modifyStopTime');
|
||||
}
|
||||
},
|
||||
mounted() {
|
||||
// this.loadInitData();
|
||||
},
|
||||
methods: {
|
||||
formatName(code) {
|
||||
return formatName(code);
|
||||
},
|
||||
formatSelect(code) {
|
||||
const device = this.$store.state.map.map && this.$store.state.map.map.stationStandList.find(ele => ele.standTrackCode == code);
|
||||
console.log(device.right);
|
||||
if (device) {
|
||||
return device.right ? '上行站台' : '下行站台';
|
||||
}
|
||||
return '';
|
||||
},
|
||||
loadInitData() {
|
||||
this.DirectionCodeMap = {};
|
||||
this.$ConstSelect.DirectionCodeList.forEach(elem => {
|
||||
this.DirectionCodeMap[elem.value] = elem.label;
|
||||
});
|
||||
|
||||
this.stationIntervalData = [];
|
||||
if (this.$route.query.lineCode) {
|
||||
getStationStopTime(this.$route.query.mapId).then(resp =>{
|
||||
const list = resp.data.list;
|
||||
this.stationIntervalData = list;
|
||||
});
|
||||
}
|
||||
},
|
||||
handleStationTime() {
|
||||
setStationStopTime(this.$route.query.mapId, this.stationIntervalData).then(resp => {
|
||||
this.$message.success(this.$t('planMonitor.modifying.modifySuccess'));
|
||||
}).catch(() => {
|
||||
this.$messageBox(this.$t('planMonitor.modifying.modifyFailed'));
|
||||
});
|
||||
},
|
||||
doShow(params) {
|
||||
this.params = params || {};
|
||||
this.loadInitData();
|
||||
this.dialogShow = true;
|
||||
},
|
||||
doClose() {
|
||||
this.loading = false;
|
||||
this.dialogShow = false;
|
||||
}
|
||||
}
|
||||
};
|
||||
</script>
|
||||
<style rel="stylesheet/scss" lang="scss" scoped>
|
||||
@import "src/styles/mixin.scss";
|
||||
.planEdit__tool {
|
||||
/deep/{
|
||||
.el-dialog__body{
|
||||
padding-top: 0;
|
||||
}
|
||||
.el-form-item--mini.el-form-item, .el-form-item--small.el-form-item{
|
||||
margin-bottom: 8px;
|
||||
}
|
||||
}
|
||||
}
|
||||
.input_text_box{
|
||||
/deep/{
|
||||
.el-input__inner{
|
||||
padding: 0;
|
||||
text-align: center;
|
||||
}
|
||||
}
|
||||
}
|
||||
</style>
|
@ -145,8 +145,8 @@
|
||||
:placeholder="$t('planMonitor.modifying.selectTime')"
|
||||
value-format="HH:mm:ss"
|
||||
size="mini"
|
||||
:clearable="false"
|
||||
:picker-options="{selectableRange:'02:00:00-23:59:59'}"
|
||||
:clearable="false"
|
||||
/>
|
||||
</el-col>
|
||||
</el-row>
|
||||
@ -194,8 +194,17 @@
|
||||
{{ formatName(scope.row.endSectionCode) }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="remarks" :label="$t('planMonitor.modifying.description')" :width="315" />
|
||||
<!-- <el-table-column :width="40" /> -->
|
||||
<el-table-column prop="routingType" label="交路类型">
|
||||
<template slot-scope="scope">
|
||||
{{ routingTypeMap[scope.row.routingType] }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="类别" width="240">
|
||||
<template slot-scope="scope">
|
||||
{{ `${frontMap[String(scope.row.startTbFront)]} - ${frontMap[String(scope.row.endTbFront)]}` }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="remarks" width="auto" :label="this.$t('planMonitor.description')" />
|
||||
</el-table>
|
||||
</el-row>
|
||||
<el-row style=" margin-bottom: 5px;margin-top: 10px;">
|
||||
@ -252,6 +261,7 @@
|
||||
</template>
|
||||
<script>
|
||||
import { getRoutingBySDTNumber, updatePlanTrip, getMapStationRunUser, getStationStopTime } from '@/api/runplan';
|
||||
import { getRunplanConfig } from '@/api/jmap/mapdraft';
|
||||
import { formatTime, formatName } from '@/utils/runPlan';
|
||||
|
||||
export default {
|
||||
@ -302,13 +312,25 @@ export default {
|
||||
// defaultStopTimeList: [{ value: '', label: this.$t('planMonitor.modifying.default') }],
|
||||
// defaultSpeedLevelList: [{ value: '', label: this.$t('planMonitor.modifying.default') }],
|
||||
// serialNumberList: [],
|
||||
reentryData: {},
|
||||
defaultSpeedLevelList: [
|
||||
{ value: 'l1', label: '等级一' },
|
||||
{ value: 'l2', label: '等级二' },
|
||||
{ value: 'l3', label: '等级三'},
|
||||
{ value: 'l4', label: '等级四' },
|
||||
{ value: 'l5', label: '等级五' }
|
||||
]
|
||||
],
|
||||
routingTypeMap: {
|
||||
OUTBOUND: '出库',
|
||||
INBOUND: '入库',
|
||||
LOOP: '环路'
|
||||
},
|
||||
frontMap: {
|
||||
'true': '折返轨(站前)',
|
||||
'false': '折返轨(站后)',
|
||||
'undefined': '转换轨',
|
||||
'null': '转换轨'
|
||||
}
|
||||
};
|
||||
},
|
||||
computed: {
|
||||
@ -406,9 +428,15 @@ export default {
|
||||
this.isPlan = params.isPlan;
|
||||
this.tripNumber = params.tripNumber;
|
||||
this.serviceNumber = params.serviceNumber;
|
||||
this.planId = this.loadRunPlanId;
|
||||
this.planId = this.$route.query.planId;
|
||||
this.PlanConvert = this.$theme.loadPlanConvert(lineCode);
|
||||
|
||||
if (mapId) {
|
||||
getRunplanConfig(mapId).then(resp => {
|
||||
const data = resp.data;
|
||||
this.reentryData = data.config.reentryData;
|
||||
});
|
||||
|
||||
getMapStationRunUser(mapId).then(resp => {
|
||||
const list = resp.data.list;
|
||||
list.forEach(elem => {
|
||||
@ -451,13 +479,12 @@ export default {
|
||||
this.computedDetailList();
|
||||
} else {
|
||||
const model = {
|
||||
planId: this.loadRunPlanId,
|
||||
planId: this.$route.query.planId || this.loadRunPlanId,
|
||||
SDTNumber: `${this.serviceNumber}${this.tripNumber}`
|
||||
};
|
||||
this.routingList = [];
|
||||
getRoutingBySDTNumber(model).then(resp => { // 根据车次号查询交路
|
||||
// const routingObj = resp.data;
|
||||
const editData = this.$store.state.runPlan.draftEditData[this.serviceNumber];
|
||||
const editData = this.$store.state.runPlan.editData[this.serviceNumber];
|
||||
if (editData) {
|
||||
const trainInfo = editData.trainMap[this.tripNumber];
|
||||
const lastIndex = trainInfo.stationTimeList.length - 1;
|
||||
@ -468,28 +495,15 @@ export default {
|
||||
endSectionCode:resp.data.endSectionCode,
|
||||
startSectionCode:resp.data.startSectionCode
|
||||
});
|
||||
let length = resp.data.parkSectionCodeList.length;
|
||||
if ( length >= 4) {
|
||||
if (resp.data.parkSectionCodeList[0].stationCode == resp.data.parkSectionCodeList[1].stationCode) {
|
||||
resp.data.parkSectionCodeList.shift();
|
||||
}
|
||||
length = resp.data.parkSectionCodeList.length;
|
||||
if (resp.data.parkSectionCodeList[length - 1].stationCode == resp.data.parkSectionCodeList[length - 2].stationCode) {
|
||||
resp.data.parkSectionCodeList.pop();
|
||||
}
|
||||
}
|
||||
|
||||
this.editModel = {
|
||||
tripNumber: this.tripNumber,
|
||||
// startStationCode: resp.data.startStationCode,
|
||||
startTime: formatTime(trainInfo.stationTimeList[1].secondTime + 7200),
|
||||
// endStationCode: resp.data.endStationCode,
|
||||
endTime: formatTime(trainInfo.stationTimeList[lastIndex].secondTime + 7200),
|
||||
routingCode : resp.data.code,
|
||||
// endSectionCode:resp.data.endSectionCode,
|
||||
// startSectionCode:resp.data.startSectionCode,
|
||||
arriveConfigList: []
|
||||
// parkSectionCodeList
|
||||
};
|
||||
|
||||
const newstationTimeList = [];
|
||||
let current = {};
|
||||
trainInfo.stationTimeList.forEach((stationTime, index)=>{
|
||||
@ -502,11 +516,11 @@ export default {
|
||||
newstationTimeList.push(current);
|
||||
}
|
||||
});
|
||||
|
||||
newstationTimeList.forEach((newstationTime, index)=>{
|
||||
const newModel = {
|
||||
sectionCode:resp.data.parkSectionCodeList[index].sectionCode,
|
||||
stationCode:newstationTime.stationCode,
|
||||
// speedLevel:'默认',
|
||||
arriveTime: formatTime(newstationTime.arriveTime + 7200),
|
||||
departureTime: formatTime(newstationTime.departureTime + 7200),
|
||||
stopTime:newstationTime.departureTime - newstationTime.arriveTime
|
||||
@ -525,32 +539,34 @@ export default {
|
||||
},
|
||||
initRunlevel(paramData) {
|
||||
const speedLevelData = this.stopStationMap[[paramData.arriveConfigList[0].sectionCode, paramData.arriveConfigList[1].sectionCode].toString()];
|
||||
switch (paramData.arriveConfigList[0].speedLevelTime) {
|
||||
case speedLevelData.l1: {
|
||||
this.defaultSpeedLevel = 'l1';
|
||||
break;
|
||||
}
|
||||
case speedLevelData.l2: {
|
||||
this.defaultSpeedLevel = 'l2';
|
||||
break;
|
||||
}
|
||||
case speedLevelData.l3: {
|
||||
this.defaultSpeedLevel = 'l3';
|
||||
break;
|
||||
}
|
||||
case speedLevelData.l4: {
|
||||
this.defaultSpeedLevel = 'l4';
|
||||
break;
|
||||
}
|
||||
case speedLevelData.l5: {
|
||||
this.defaultSpeedLevel = 'l5';
|
||||
break;
|
||||
}
|
||||
default: {
|
||||
this.defaultSpeedLevel = 'l1';
|
||||
break;
|
||||
}
|
||||
}
|
||||
if (speedLevelData) {
|
||||
switch (paramData.arriveConfigList[0].speedLevelTime) {
|
||||
case speedLevelData.l1: {
|
||||
this.defaultSpeedLevel = 'l1';
|
||||
break;
|
||||
}
|
||||
case speedLevelData.l2: {
|
||||
this.defaultSpeedLevel = 'l2';
|
||||
break;
|
||||
}
|
||||
case speedLevelData.l3: {
|
||||
this.defaultSpeedLevel = 'l3';
|
||||
break;
|
||||
}
|
||||
case speedLevelData.l4: {
|
||||
this.defaultSpeedLevel = 'l4';
|
||||
break;
|
||||
}
|
||||
case speedLevelData.l5: {
|
||||
this.defaultSpeedLevel = 'l5';
|
||||
break;
|
||||
}
|
||||
default: {
|
||||
this.defaultSpeedLevel = 'l1';
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
// changeStopTime(indexs, time) {
|
||||
// let tempTime = this.computedTimeByString(this.editModel.startTime) / 1000;
|
||||
@ -607,7 +623,7 @@ export default {
|
||||
},
|
||||
buildModel() {
|
||||
return {
|
||||
planId: this.loadRunPlanId,
|
||||
planId: this.$route.query.planId || this.loadRunPlanId,
|
||||
routingCode: this.editModel.routingCode,
|
||||
tripNumber: this.tripNumber,
|
||||
// startTime: this.editModel.startTime,
|
||||
@ -625,9 +641,6 @@ export default {
|
||||
} else {
|
||||
// 直接修改
|
||||
updatePlanTrip(this.buildModel()).then(resp => {
|
||||
// this.$emit('dispatchOperate', {
|
||||
// dialogName: 'openRunPlan', operate: 'loadRunPlanData', params: Object.assign({refresh: true}, this.$route.query)
|
||||
// });
|
||||
this.$emit('refresh');
|
||||
this.$message.success(this.$t('planMonitor.modifying.modifyTaskSuccess'));
|
||||
}).catch(() => {
|
||||
@ -650,9 +663,6 @@ export default {
|
||||
.el-row {
|
||||
margin-bottom: 5px !important;
|
||||
}
|
||||
.el-button+.el-button{
|
||||
margin-left: 10px !important;
|
||||
}
|
||||
}
|
||||
.add-task{
|
||||
/deep/ {
|
||||
|
@ -58,7 +58,7 @@ export default {
|
||||
},
|
||||
computed: {
|
||||
title() {
|
||||
return this.$t('planMonitor.duplicateTrain');
|
||||
return '平移列车';
|
||||
}
|
||||
},
|
||||
mounted() {
|
||||
@ -73,17 +73,17 @@ export default {
|
||||
this.dialogShow = false;
|
||||
},
|
||||
handleCommit() {
|
||||
this.model['planId'] = this.loadRunPlanId;
|
||||
this.model['planId'] = this.$route.query.planId || this.loadRunPlanId;
|
||||
this.model['serviceNumber'] = this.model.serviceNumber;
|
||||
this.doClose();
|
||||
movePlaningService(this.model).then(resp => {
|
||||
this.$emit('refresh');
|
||||
this.$message.success(this.$t('tip.duplicatePlanSuccessful'));
|
||||
this.$message.success('平移列车成功!');
|
||||
}).catch((error) => {
|
||||
if (error.code === 500001) {
|
||||
this.$messageBox(this.$t('tip.duplicatePlanFailed') + this.$t('tip.duplicatePlanFailedTips'));
|
||||
this.$messageBox('平移列车失败' + this.$t('tip.duplicatePlanFailedTips'));
|
||||
} else {
|
||||
this.$messageBox(this.$t('tip.duplicatePlanFailed'));
|
||||
this.$messageBox('平移列车失败!');
|
||||
}
|
||||
|
||||
});
|
||||
|
@ -34,13 +34,11 @@ export default {
|
||||
return {
|
||||
dialogShow: false,
|
||||
loading: false,
|
||||
params: {}
|
||||
params: {},
|
||||
title:this.$t('planMonitor.updateStation.deletePlanCar')
|
||||
};
|
||||
},
|
||||
computed: {
|
||||
title() {
|
||||
return this.$t('planMonitor.updateStation.deletePlanCar');
|
||||
},
|
||||
width() {
|
||||
if (this.params.width) {
|
||||
return this.params.width;
|
||||
@ -53,6 +51,11 @@ export default {
|
||||
},
|
||||
methods: {
|
||||
doShow(params) {
|
||||
if (params.operate == 'AddPlanningTrain') {
|
||||
this.title = this.$t('planMonitor.addPlanTrain');
|
||||
} else {
|
||||
this.title = this.$t('planMonitor.updateStation.deletePlanCar');
|
||||
}
|
||||
this.params = params || {};
|
||||
this.dialogShow = true;
|
||||
},
|
||||
|
183
src/views/planMonitor/newEditTool/menus/openRunPlan.vue
Normal file
183
src/views/planMonitor/newEditTool/menus/openRunPlan.vue
Normal file
@ -0,0 +1,183 @@
|
||||
<template>
|
||||
<div>
|
||||
<el-dialog
|
||||
v-dialogDrag
|
||||
class="planEdit__tool open-runplan"
|
||||
:title="title"
|
||||
:visible.sync="show"
|
||||
width="800px"
|
||||
:before-close="doClose"
|
||||
:z-index="2000"
|
||||
:modal="true"
|
||||
:close-on-click-modal="false"
|
||||
>
|
||||
<el-table :data="runPlanList" height="350" border style="width: 100%">
|
||||
<el-table-column prop="name" label="运行图名称" />
|
||||
<el-table-column prop="createTime" label="创建日期" width="180" />
|
||||
<el-table-column label="操作">
|
||||
<template slot-scope="scope">
|
||||
<el-button size="mini" class="button_box" @click="handleConfirm(scope.row)">加载</el-button>
|
||||
<el-button size="mini" class="button_box" @click="handleEdit(scope.row)">修改名称</el-button>
|
||||
<el-button size="mini" class="button_box" type="danger" @click="handleDelete(scope.row)">删除</el-button>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
<!-- <el-scrollbar wrap-class="scrollbar-wrapper" :style="{height: height+'px'}">
|
||||
<el-tree
|
||||
ref="tree"
|
||||
class="filter-tree"
|
||||
:data="runPlanList"
|
||||
:props="defaultProps"
|
||||
highlight-current
|
||||
default-expand-all
|
||||
:style="{height: height-20+'px'}"
|
||||
@node-click="handleNodeClick"
|
||||
/>
|
||||
</el-scrollbar> -->
|
||||
<!-- <el-row type="flex" justify="center" class="button-group">
|
||||
<el-button v-if="type == 'add'" type="primary" @click="handleConfirm">选择运行图</el-button>
|
||||
<el-button v-if="type == 'delete'" type="primary" @click="handleDelete">删除</el-button>
|
||||
<el-button v-if="type == 'edit'" type="primary" @click="handleEdit">修改</el-button>
|
||||
<el-button @click="dialogShow = false">取 消</el-button>
|
||||
</el-row> -->
|
||||
</el-dialog>
|
||||
<edit-plan-name ref="editPlan" @renewal="getRunPlanList" />
|
||||
</div>
|
||||
</template>
|
||||
<script>
|
||||
import { getRpListByMapId, deleteRunPlan } from '@/api/runplan';
|
||||
import { UrlConfig } from '@/scripts/ConstDic';
|
||||
import EditPlanName from './editPlanName';
|
||||
|
||||
export default {
|
||||
name: 'OpenRunPlan',
|
||||
components: {
|
||||
EditPlanName
|
||||
},
|
||||
props: {
|
||||
skinCode: {
|
||||
type: String,
|
||||
required: true
|
||||
}
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
dialogShow: false,
|
||||
loading: false,
|
||||
height: 260,
|
||||
// planId: '',
|
||||
// planName: '',
|
||||
type: 'add',
|
||||
// defaultShowKeys: [],
|
||||
runPlanList: [],
|
||||
runPlanDict: {}
|
||||
// defaultProps: {
|
||||
// label: 'name'
|
||||
// }
|
||||
};
|
||||
},
|
||||
computed: {
|
||||
show() {
|
||||
return this.dialogShow;
|
||||
},
|
||||
title() {
|
||||
return this.$t('planMonitor.openRunPlan.runPlanList');
|
||||
}
|
||||
},
|
||||
mounted() {
|
||||
this.loadRunPlanData({
|
||||
planId: this.$route.query.planId,
|
||||
skinCode: this.$route.query.skinCode,
|
||||
planName: this.$route.query.planName
|
||||
});
|
||||
},
|
||||
methods: {
|
||||
// handleNodeClick(data) {
|
||||
// this.planId = data.id;
|
||||
// this.planName = data.name;
|
||||
// },
|
||||
loadRunPlanData({ refresh, planId, skinCode, planName }) {
|
||||
if (refresh) {
|
||||
this.$store.dispatch('runPlan/refresh');
|
||||
} else {
|
||||
const query = { skinCode: skinCode, mapId: this.$route.query.mapId, planId: planId, planName: planName };
|
||||
this.$router.push({ path: `${UrlConfig.plan.tool}`, query: query });
|
||||
}
|
||||
},
|
||||
getRunPlanList() {
|
||||
getRpListByMapId(this.$route.query.mapId).then((resp) => {
|
||||
this.runPlanList = resp.data;
|
||||
this.runPlanList.forEach(elem => {
|
||||
this.runPlanDict[elem.id] = elem.name;
|
||||
});
|
||||
this.dialogShow = true;
|
||||
}).catch(() => {
|
||||
this.$messageBox(this.$t('planMonitor.openRunPlan.getRunPlanListFail'));
|
||||
});
|
||||
},
|
||||
doShow(data) {
|
||||
this.type = data.type || 'add';
|
||||
this.getRunPlanList();
|
||||
},
|
||||
doClose() {
|
||||
this.dialogShow = false;
|
||||
// this.planId = '';
|
||||
// this.planName = '';
|
||||
},
|
||||
// 跳转到对应运行图
|
||||
handleConfirm(row) {
|
||||
this.loadRunPlanData({
|
||||
planId: row.id,
|
||||
skinCode: this.$route.query.skinCode,
|
||||
planName: row.name
|
||||
});
|
||||
this.doClose();
|
||||
},
|
||||
// 删除运行图
|
||||
handleDelete(row) {
|
||||
this.$confirm(this.$t('planMonitor.openRunPlan.confirmDeleteRunPlan'), this.$t('tip.hint'), {
|
||||
confirmButtonText: this.$t('tip.confirm'),
|
||||
cancelButtonText: this.$t('tip.cancel'),
|
||||
type: 'warning'
|
||||
}).then(() => {
|
||||
deleteRunPlan(row.id).then(Response => {
|
||||
this.$message.success(this.$t('planMonitor.openRunPlan.deleteSuccess'));
|
||||
if (row.id === this.$route.query.planId) {
|
||||
const query = { skinCode: this.$route.query.skinCode, mapId: this.$route.query.mapId };
|
||||
this.$router.push({ path: `${UrlConfig.plan.tool}`, query: query });
|
||||
}
|
||||
this.doClose();
|
||||
}).catch(() => {
|
||||
this.$messageBox(this.$t('tip.deleteOperationGraphFailed'));
|
||||
});
|
||||
}).catch(() => { });
|
||||
},
|
||||
// 修改运行图名称
|
||||
handleEdit(row) {
|
||||
if (row.id && row.name) {
|
||||
this.$refs.editPlan.doShow({id: row.id, name: row.name});
|
||||
} else {
|
||||
this.$message.info(this.$t('planMonitor.openRunPlan.pleaseSelectRunplan'));
|
||||
}
|
||||
}
|
||||
}
|
||||
};
|
||||
</script>
|
||||
|
||||
<style rel="stylesheet/scss" lang="scss" scoped>
|
||||
/deep/ {
|
||||
.el-button {
|
||||
margin-left: 40px !important;
|
||||
margin-right: 40px !important;
|
||||
}
|
||||
|
||||
.el-tree {
|
||||
margin: 10px !important;
|
||||
// background: #ECE9D8 !important;
|
||||
}
|
||||
}
|
||||
.button_box{
|
||||
float: left;
|
||||
margin: 0 2px!important;
|
||||
}
|
||||
</style>
|
@ -21,50 +21,50 @@
|
||||
</el-form-item>
|
||||
<el-form-item :label="this.$t('planMonitor.minimumTrainInterval')+this.$t('global.colon')" prop="minInterval">
|
||||
<el-input-number v-model="model.minInterval" controls-position="right" />
|
||||
<span>{{$t('global.second')}}</span>
|
||||
<span>{{ $t('global.second') }}</span>
|
||||
</el-form-item>
|
||||
<el-form-item :label="this.$t('planMonitor.maximumTrainInterval')+this.$t('global.colon')" prop="maxInterval">
|
||||
<el-input-number v-model="model.maxInterval" controls-position="right" />
|
||||
<span>{{$t('global.second')}}</span>
|
||||
<span>{{ $t('global.second') }}</span>
|
||||
</el-form-item>
|
||||
<el-form-item :label="this.$t('planMonitor.trainGeneratesInitialLabel')+this.$t('global.colon')" prop="beginServiceNumber">
|
||||
<el-input-number v-model="model.beginServiceNumber" controls-position="right" />
|
||||
</el-form-item>
|
||||
<el-form-item :label="this.$t('planMonitor.minimumTurnbackTime')+this.$t('global.colon')" prop="minReentryTime">
|
||||
<el-input-number v-model="model.minReentryTime" controls-position="right" />
|
||||
<span>{{$t('global.second')}}</span>
|
||||
<span>{{ $t('global.second') }}</span>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
export default {
|
||||
name: 'BaseParameter',
|
||||
components: {
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
model: {
|
||||
planName: '',
|
||||
auxIconDesc: '',
|
||||
upBeginTripNumber: 0,
|
||||
upBeginTrain: 0,
|
||||
minInterval: 0,
|
||||
maxInterval: 0,
|
||||
beginServiceNumber: 0,
|
||||
minReentryTime: 0
|
||||
}
|
||||
};
|
||||
},
|
||||
computed: {
|
||||
rules() {
|
||||
return {};
|
||||
}
|
||||
},
|
||||
mounted() {
|
||||
},
|
||||
methods: {
|
||||
}
|
||||
name: 'BaseParameter',
|
||||
components: {
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
model: {
|
||||
planName: '',
|
||||
auxIconDesc: '',
|
||||
upBeginTripNumber: 0,
|
||||
upBeginTrain: 0,
|
||||
minInterval: 0,
|
||||
maxInterval: 0,
|
||||
beginServiceNumber: 0,
|
||||
minReentryTime: 0
|
||||
}
|
||||
};
|
||||
},
|
||||
computed: {
|
||||
rules() {
|
||||
return {};
|
||||
}
|
||||
},
|
||||
mounted() {
|
||||
},
|
||||
methods: {
|
||||
}
|
||||
};
|
||||
</script>
|
||||
<style rel="stylesheet/scss" lang="scss" scoped>
|
||||
|
@ -7,28 +7,28 @@
|
||||
</el-table>
|
||||
</el-col>
|
||||
<el-col :span="10" :offset="1">
|
||||
<el-button style="margin-top: 20px" @click="handleModifyingStationProperty">{{$t('planMonitor.modifyAttribute')}}</el-button>
|
||||
<el-button style="margin-top: 20px" @click="handleModifyingStationProperty">{{ $t('planMonitor.modifyAttribute') }}</el-button>
|
||||
</el-col>
|
||||
</el-row>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
export default {
|
||||
name: 'BaseStation',
|
||||
components: {
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
stationData: []
|
||||
};
|
||||
},
|
||||
mounted() {
|
||||
},
|
||||
methods: {
|
||||
handleModifyingStationProperty() {
|
||||
this.$emit('dispatchDialog', { name: 'modifyingStationProperty', params: {} });
|
||||
}
|
||||
}
|
||||
name: 'BaseStation',
|
||||
components: {
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
stationData: []
|
||||
};
|
||||
},
|
||||
mounted() {
|
||||
},
|
||||
methods: {
|
||||
handleModifyingStationProperty() {
|
||||
this.$emit('dispatchDialog', { name: 'modifyingStationProperty', params: {} });
|
||||
}
|
||||
}
|
||||
};
|
||||
</script>
|
||||
<style rel="stylesheet/scss" lang="scss" scoped>
|
||||
|
@ -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>
|
||||
@ -20,33 +20,33 @@
|
||||
<script>
|
||||
|
||||
export default {
|
||||
name: 'QuickLoopsIncrease',
|
||||
components: {
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
dialogShow: false,
|
||||
loading: false
|
||||
};
|
||||
},
|
||||
computed: {
|
||||
title() {
|
||||
return this.$t('planMonitor.updateStation.quicklyAddLoop');
|
||||
}
|
||||
},
|
||||
mounted() {
|
||||
},
|
||||
methods: {
|
||||
doShow() {
|
||||
this.dialogShow = true;
|
||||
},
|
||||
doClose() {
|
||||
this.loading = false;
|
||||
this.dialogShow = false;
|
||||
},
|
||||
handleCommit() {
|
||||
}
|
||||
}
|
||||
name: 'QuickLoopsIncrease',
|
||||
components: {
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
dialogShow: false,
|
||||
loading: false
|
||||
};
|
||||
},
|
||||
computed: {
|
||||
title() {
|
||||
return this.$t('planMonitor.updateStation.quicklyAddLoop');
|
||||
}
|
||||
},
|
||||
mounted() {
|
||||
},
|
||||
methods: {
|
||||
doShow() {
|
||||
this.dialogShow = true;
|
||||
},
|
||||
doClose() {
|
||||
this.loading = false;
|
||||
this.dialogShow = false;
|
||||
},
|
||||
handleCommit() {
|
||||
}
|
||||
}
|
||||
};
|
||||
</script>
|
||||
<style rel="stylesheet/scss" lang="scss" scoped>
|
||||
|
@ -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>
|
||||
@ -20,33 +20,33 @@
|
||||
<script>
|
||||
|
||||
export default {
|
||||
name: 'QuickTaskIncrease',
|
||||
components: {
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
dialogShow: false,
|
||||
loading: false
|
||||
};
|
||||
},
|
||||
computed: {
|
||||
title() {
|
||||
return this.$t('planMonitor.updateStation.quicklyAddTask');
|
||||
}
|
||||
},
|
||||
mounted() {
|
||||
},
|
||||
methods: {
|
||||
doShow() {
|
||||
this.dialogShow = true;
|
||||
},
|
||||
doClose() {
|
||||
this.loading = false;
|
||||
this.dialogShow = false;
|
||||
},
|
||||
handleCommit() {
|
||||
}
|
||||
}
|
||||
name: 'QuickTaskIncrease',
|
||||
components: {
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
dialogShow: false,
|
||||
loading: false
|
||||
};
|
||||
},
|
||||
computed: {
|
||||
title() {
|
||||
return this.$t('planMonitor.updateStation.quicklyAddTask');
|
||||
}
|
||||
},
|
||||
mounted() {
|
||||
},
|
||||
methods: {
|
||||
doShow() {
|
||||
this.dialogShow = true;
|
||||
},
|
||||
doClose() {
|
||||
this.loading = false;
|
||||
this.dialogShow = false;
|
||||
},
|
||||
handleCommit() {
|
||||
}
|
||||
}
|
||||
};
|
||||
</script>
|
||||
<style rel="stylesheet/scss" lang="scss" scoped>
|
||||
|
@ -20,33 +20,33 @@
|
||||
<script>
|
||||
|
||||
export default {
|
||||
name: 'RoutingSelection',
|
||||
components: {
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
dialogShow: false,
|
||||
loading: false
|
||||
};
|
||||
},
|
||||
computed: {
|
||||
title() {
|
||||
return this.$t('planMonitor.updateStation.routeSelect');
|
||||
}
|
||||
},
|
||||
mounted() {
|
||||
},
|
||||
methods: {
|
||||
doShow() {
|
||||
this.dialogShow = true;
|
||||
},
|
||||
doClose() {
|
||||
this.loading = false;
|
||||
this.dialogShow = false;
|
||||
},
|
||||
handleCommit() {
|
||||
}
|
||||
}
|
||||
name: 'RoutingSelection',
|
||||
components: {
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
dialogShow: false,
|
||||
loading: false
|
||||
};
|
||||
},
|
||||
computed: {
|
||||
title() {
|
||||
return this.$t('planMonitor.updateStation.routeSelect');
|
||||
}
|
||||
},
|
||||
mounted() {
|
||||
},
|
||||
methods: {
|
||||
doShow() {
|
||||
this.dialogShow = true;
|
||||
},
|
||||
doClose() {
|
||||
this.loading = false;
|
||||
this.dialogShow = false;
|
||||
},
|
||||
handleCommit() {
|
||||
}
|
||||
}
|
||||
};
|
||||
</script>
|
||||
<style rel="stylesheet/scss" lang="scss" scoped>
|
||||
|
@ -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>
|
||||
@ -20,33 +20,33 @@
|
||||
<script>
|
||||
|
||||
export default {
|
||||
name: 'SelectDeleteRoute',
|
||||
components: {
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
dialogShow: false,
|
||||
loading: false
|
||||
};
|
||||
},
|
||||
computed: {
|
||||
title() {
|
||||
return this.$t('planMonitor.updateStation.selectDeleteRoute');
|
||||
}
|
||||
},
|
||||
mounted() {
|
||||
},
|
||||
methods: {
|
||||
doShow() {
|
||||
this.dialogShow = true;
|
||||
},
|
||||
doClose() {
|
||||
this.loading = false;
|
||||
this.dialogShow = false;
|
||||
},
|
||||
handleCommit() {
|
||||
}
|
||||
}
|
||||
name: 'SelectDeleteRoute',
|
||||
components: {
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
dialogShow: false,
|
||||
loading: false
|
||||
};
|
||||
},
|
||||
computed: {
|
||||
title() {
|
||||
return this.$t('planMonitor.updateStation.selectDeleteRoute');
|
||||
}
|
||||
},
|
||||
mounted() {
|
||||
},
|
||||
methods: {
|
||||
doShow() {
|
||||
this.dialogShow = true;
|
||||
},
|
||||
doClose() {
|
||||
this.loading = false;
|
||||
this.dialogShow = false;
|
||||
},
|
||||
handleCommit() {
|
||||
}
|
||||
}
|
||||
};
|
||||
</script>
|
||||
<style rel="stylesheet/scss" lang="scss" scoped>
|
||||
|
@ -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>
|
||||
@ -20,33 +20,33 @@
|
||||
<script>
|
||||
|
||||
export default {
|
||||
name: 'SelectPrintArea',
|
||||
components: {
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
dialogShow: false,
|
||||
loading: false
|
||||
};
|
||||
},
|
||||
computed: {
|
||||
title() {
|
||||
return this.$t('planMonitor.updateStation.selectPrintArea');
|
||||
}
|
||||
},
|
||||
mounted() {
|
||||
},
|
||||
methods: {
|
||||
doShow() {
|
||||
this.dialogShow = true;
|
||||
},
|
||||
doClose() {
|
||||
this.loading = false;
|
||||
this.dialogShow = false;
|
||||
},
|
||||
handleCommit() {
|
||||
}
|
||||
}
|
||||
name: 'SelectPrintArea',
|
||||
components: {
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
dialogShow: false,
|
||||
loading: false
|
||||
};
|
||||
},
|
||||
computed: {
|
||||
title() {
|
||||
return this.$t('planMonitor.updateStation.selectPrintArea');
|
||||
}
|
||||
},
|
||||
mounted() {
|
||||
},
|
||||
methods: {
|
||||
doShow() {
|
||||
this.dialogShow = true;
|
||||
},
|
||||
doClose() {
|
||||
this.loading = false;
|
||||
this.dialogShow = false;
|
||||
},
|
||||
handleCommit() {
|
||||
}
|
||||
}
|
||||
};
|
||||
</script>
|
||||
<style rel="stylesheet/scss" lang="scss" scoped>
|
||||
|
@ -0,0 +1,114 @@
|
||||
<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-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>
|
||||
</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>
|
||||
</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>
|
||||
</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>
|
||||
</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>
|
||||
</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-row>
|
||||
</el-dialog>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
export default {
|
||||
name: 'UpdateStationIntervalTime',
|
||||
components: {
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
dialogShow: false,
|
||||
loading: false,
|
||||
editModel: {},
|
||||
runPlanLevelVO: {}
|
||||
};
|
||||
},
|
||||
computed: {
|
||||
title() {
|
||||
return this.$t('planMonitor.updateStation.updateData');
|
||||
},
|
||||
rules() {
|
||||
return {
|
||||
level1: [
|
||||
{ required: true, message: this.$t('planMonitor.updateStation.pleaseInputLevel1'), trigger: 'blur' }
|
||||
],
|
||||
level2: [
|
||||
{ required: true, message: this.$t('planMonitor.updateStation.pleaseInputLevel2'), trigger: 'blur' }
|
||||
],
|
||||
level3: [
|
||||
{ required: true, message: this.$t('planMonitor.updateStation.pleaseInputLevel3'), trigger: 'blur' }
|
||||
],
|
||||
level4: [
|
||||
{ required: true, message: this.$t('planMonitor.updateStation.pleaseInputLevel4'), trigger: 'blur' }
|
||||
],
|
||||
level5: [
|
||||
{ required: true, message: this.$t('planMonitor.updateStation.pleaseInputLevel5'), trigger: 'blur' }
|
||||
]
|
||||
};
|
||||
}
|
||||
},
|
||||
mounted() {
|
||||
},
|
||||
methods: {
|
||||
doShow(params) {
|
||||
this.editModel = params || {};
|
||||
this.runPlanLevelVO = Object.assign({}, this.editModel.runPlanLevelVO || {});
|
||||
this.dialogShow = true;
|
||||
},
|
||||
doClose() {
|
||||
this.loading = false;
|
||||
this.dialogShow = false;
|
||||
},
|
||||
handleCommit() {
|
||||
this.$refs['form'].validate((valid) => {
|
||||
if (valid) {
|
||||
const model = {
|
||||
level1: this.runPlanLevelVO.level1,
|
||||
level2: this.runPlanLevelVO.level2,
|
||||
level3: this.runPlanLevelVO.level3,
|
||||
level4: this.runPlanLevelVO.level4,
|
||||
level5: this.runPlanLevelVO.level5,
|
||||
stationRunningId: this.runPlanLevelVO.stationRunningId
|
||||
};
|
||||
this.$emit('handleConfirm', model);
|
||||
this.doClose();
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
};
|
||||
</script>
|
||||
<style rel="stylesheet/scss" lang="scss" scoped>
|
||||
@import "src/styles/mixin.scss";
|
||||
|
||||
/deep/ {
|
||||
.el-input {
|
||||
width: 120px;
|
||||
}
|
||||
|
||||
.el-input-number {
|
||||
width: 120px;
|
||||
}
|
||||
}
|
||||
</style>
|
62
src/views/planMonitor/newEditTool/routingoperate/preview.vue
Normal file
62
src/views/planMonitor/newEditTool/routingoperate/preview.vue
Normal file
@ -0,0 +1,62 @@
|
||||
<template>
|
||||
<el-dialog
|
||||
v-dialogDrag
|
||||
:title="title"
|
||||
:visible.sync="show"
|
||||
width="30%"
|
||||
:before-close="doClose"
|
||||
center
|
||||
append-to-body
|
||||
>
|
||||
<el-table :data="data" border style="width: 100%">
|
||||
<template v-for="(item, index) in form">
|
||||
<el-table-column :key="index" :label="item.label">
|
||||
<template slot-scope="scope">
|
||||
<template v-if="item.type === 'select'">
|
||||
<el-tooltip effect="dark" :content="item.options[scope.row[item.prop]]" placement="top">
|
||||
<span>{{ item.options[scope.row[item.prop]] }}</span>
|
||||
</el-tooltip>
|
||||
</template>
|
||||
<template v-if="item.type === 'text'">
|
||||
<el-tooltip effect="dark" :content="scope.row[item.prop]" placement="top">
|
||||
<span>{{ scope.row[item.prop] }}</span>
|
||||
</el-tooltip>
|
||||
</template>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</template>
|
||||
</el-table>
|
||||
</el-dialog>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
export default {
|
||||
name: 'DictionaryDetailEdit',
|
||||
data() {
|
||||
return {
|
||||
show: false,
|
||||
title: '',
|
||||
name: '',
|
||||
form: [],
|
||||
data: []
|
||||
};
|
||||
},
|
||||
methods: {
|
||||
doShow(fieldList, dataList) {
|
||||
if (fieldList.model) {
|
||||
const items = fieldList.model.items;
|
||||
if (items) {
|
||||
this.form = items;
|
||||
this.name = fieldList.name;
|
||||
this.data = dataList;
|
||||
this.title = fieldList.title;
|
||||
}
|
||||
this.show = true;
|
||||
}
|
||||
},
|
||||
doClose(done) {
|
||||
this.show = false;
|
||||
}
|
||||
}
|
||||
};
|
||||
</script>
|
700
src/views/planMonitor/newEditTool/routingoperate/routeConfig.vue
Normal file
700
src/views/planMonitor/newEditTool/routingoperate/routeConfig.vue
Normal file
@ -0,0 +1,700 @@
|
||||
<template>
|
||||
<div class="routeConfig">
|
||||
<div>
|
||||
<div class="clearfix" style="padding-right: 20px;">
|
||||
<el-button type="text" class="mapEdit_box" @click="previewRouteEvent">{{ $t('map.preview') }}</el-button>
|
||||
<el-button type="text" class="mapEdit_box" @click="createRouteEvent">{{ $t('map.newConstruction') }}</el-button>
|
||||
</div>
|
||||
<el-form ref="form" :model="addModel" :rules="rules" label-width="120px" size="mini">
|
||||
<div class="definition">
|
||||
<el-form-item :label="$t('map.routingName')" prop="name">
|
||||
<el-input v-model="addModel.name" />
|
||||
</el-form-item>
|
||||
<el-form-item :label="$t('map.startStationCodeColon')" prop="startStationCode">
|
||||
<el-select v-model="addModel.startStationCode" clearable :filterable="true" disabled @change="changeStartStation">
|
||||
<el-option
|
||||
v-for="item in filterStationList"
|
||||
:key="item.code"
|
||||
:label="item.name"
|
||||
:value="item.code"
|
||||
/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item :label="$t('map.startSectionColon')" prop="startSectionCode">
|
||||
<el-select v-model="addModel.startSectionCode" clearable :filterable="true" :disabled="editShow" @change="changeStartSection">
|
||||
<el-option
|
||||
v-for="item in filterStartSectionList"
|
||||
:key="item.code"
|
||||
:label="item.name"
|
||||
:value="item.code"
|
||||
/>
|
||||
</el-select>
|
||||
<el-button
|
||||
:disabled="editShow"
|
||||
:type=" field === 'startSectionCode' ? 'danger' : 'primary'"
|
||||
@click="hover('startSectionCode')"
|
||||
>{{ $t('map.activate') }}</el-button>
|
||||
</el-form-item>
|
||||
<el-form-item :label="$t('map.endStationColon')" prop="endStationCode">
|
||||
<el-select v-model="addModel.endStationCode" :filterable="true" disabled @change="changeEndStation">
|
||||
<el-option
|
||||
v-for="item in filterStationList"
|
||||
:key="item.code"
|
||||
:label="item.name"
|
||||
:value="item.code"
|
||||
/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item :label="$t('map.endSectionColon')" prop="endSectionCode">
|
||||
<el-select v-model="addModel.endSectionCode" :filterable="true" clearable :disabled="editShow || !isStartSelected" @change="changeEndSection">
|
||||
<el-option
|
||||
v-for="item in filterEndSectionList"
|
||||
:key="item.code"
|
||||
:label="item.name"
|
||||
:value="item.code"
|
||||
/>
|
||||
</el-select>
|
||||
<el-button
|
||||
:disabled="editShow || !isStartSelected"
|
||||
:type=" field === 'endSectionCode' ? 'danger' : 'primary'"
|
||||
@click="hover('endSectionCode')"
|
||||
>{{ $t('map.activate') }}</el-button>
|
||||
</el-form-item>
|
||||
<el-form-item :label="$t('map.destinationCode')" prop="destinationCode" :disabled="editShow">
|
||||
<el-input v-model="addModel.destinationCode" />
|
||||
</el-form-item>
|
||||
<el-form-item :label="$t('map.routingDirection')" prop="directionCode">
|
||||
<el-select v-model="addModel.right" clearable :filterable="true" :placeholder="$t('map.pleaseSelect')">
|
||||
<el-option
|
||||
v-for="item in DirectionCodeList"
|
||||
:key="item.value"
|
||||
:label="item.label"
|
||||
:value="item.value"
|
||||
/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item :label="$t('map.remarksColon')" prop="remarks">
|
||||
<el-input v-model="addModel.remarks" type="textarea" :rows="4" :placeholder="$t('map.pleaseSelect')" />
|
||||
</el-form-item>
|
||||
<el-form-item :label="$t('map.trafficSegmentData')" prop="parkSectionCodeList">
|
||||
<el-button type="primary" size="small" :loading="generating" style="margin-bottom:10px" @click.native.prevent="generateParkSection">生成交路区段</el-button>
|
||||
<el-table
|
||||
:data="addModel.parkSectionCodeList"
|
||||
border
|
||||
style="width:97%"
|
||||
height="300"
|
||||
class="el-parkSectionCode-table"
|
||||
>
|
||||
<el-table-column prop="sectionCode" :label="$t('map.stationName')">
|
||||
<template slot-scope="scope">
|
||||
<span>{{ formatName(scope.row.stationCode) }}</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="sectionCode" :label="$t('map.sectionName')">
|
||||
<template slot-scope="scope">
|
||||
<span>{{ formatName(scope.row.sectionCode) }}</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column :label="$t('map.operation')" width="50">
|
||||
<template slot-scope="scope">
|
||||
<el-button
|
||||
v-show="scope.$index!=0&&scope.$index!=addModel.parkSectionCodeList.length-1"
|
||||
type="text"
|
||||
size="small"
|
||||
@click.native.prevent="deleteSection(addModel.parkSectionCodeList, scope.$index)"
|
||||
>
|
||||
{{ $t('map.remove') }}
|
||||
</el-button>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
<div style="margin-top:10px;">
|
||||
<span>车站:</span>
|
||||
<el-select v-model="stationCode" clearable :filterable="true" :placeholder="$t('map.pleaseSelect')">
|
||||
<el-option
|
||||
v-for="item in filterStationList"
|
||||
:key="item.code"
|
||||
:label="`${item.name}(${item.code})`"
|
||||
:value="item.code"
|
||||
/>
|
||||
</el-select>
|
||||
<el-button
|
||||
:disabled="!allowSelect"
|
||||
:type="field === 'routingStation' ? 'danger' : 'primary'"
|
||||
@click="hover('routingStation')"
|
||||
>{{ $t('map.activate') }}</el-button>
|
||||
</div>
|
||||
<div style="margin-top:10px;">
|
||||
<span>区段:</span>
|
||||
<el-select v-model="sectionCode" clearable :filterable="true" :placeholder="$t('map.pleaseSelect')">
|
||||
<el-option
|
||||
v-for="item in filterStandSection"
|
||||
:key="item.code"
|
||||
:label="`${item.name}(${item.code})`"
|
||||
:value="item.code"
|
||||
/>
|
||||
</el-select>
|
||||
<el-button
|
||||
:type=" field === 'routingSection' ? 'danger' : 'primary'"
|
||||
:disabled="!allowSelect"
|
||||
@click="hover('routingSection')"
|
||||
>{{ $t('map.activate') }}</el-button>
|
||||
<el-button
|
||||
type="primary"
|
||||
:disabled="!allowSelect"
|
||||
@click="pushSection({stationCode: stationCode, sectionCode: sectionCode},'center')"
|
||||
>
|
||||
{{ $t('map.add') }}
|
||||
</el-button>
|
||||
</div>
|
||||
</el-form-item>
|
||||
<el-form-item>
|
||||
<el-button-group style="padding-bottom:10px">
|
||||
<el-button v-if="isSave" type="primary" size="small" :loading="loading" @click="save">{{ $t('map.save') }}
|
||||
</el-button>
|
||||
<el-button v-else type="warning" size="small" :loading="loading" @click="update">{{ $t('map.updata') }}
|
||||
</el-button>
|
||||
</el-button-group>
|
||||
</el-form-item>
|
||||
</div>
|
||||
</el-form>
|
||||
</div>
|
||||
<route-operate ref="routeOperate" @routingSelected="routingSelected" />
|
||||
</div>
|
||||
</template>
|
||||
<script>
|
||||
import RouteOperate from './routeOperate';
|
||||
import { setUID } from '@/jmapNew/utils/Uid';
|
||||
import { addRoutingData, updateRoutingData, gernateRoutingSectionInRunplan } from '@/api/jmap/mapdraft';
|
||||
import { mapGetters } from 'vuex';
|
||||
import { formatName } from '@/utils/runPlan';
|
||||
import Sortable from 'sortablejs';
|
||||
export default {
|
||||
name:'RouteConfig',
|
||||
components: {
|
||||
RouteOperate
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
field: '',
|
||||
editShow: false,
|
||||
isSave: true,
|
||||
isStartSelected:false,
|
||||
allowSelect:false,
|
||||
loading: false,
|
||||
generating:false,
|
||||
stationCode: '',
|
||||
sectionCode: '',
|
||||
DirectionCodeList: [{label: '右行', value: true}, {label: '左行', value: false}],
|
||||
oldStartSectionCode: '',
|
||||
oldEndSectionCode: '',
|
||||
addModel: {
|
||||
name: '',
|
||||
mapId: '',
|
||||
code: '',
|
||||
// withLoop:false,
|
||||
right: true,
|
||||
destinationCode: '',
|
||||
startStationCode: '',
|
||||
startSectionCode: '',
|
||||
endStationCode: '',
|
||||
endSectionCode: '',
|
||||
remarks: '',
|
||||
userId: '',
|
||||
parkSectionCodeList: []
|
||||
},
|
||||
rules: {
|
||||
name: [
|
||||
{ required: true, message: '请输入交路名称', trigger: 'change' }
|
||||
],
|
||||
startStationCode: [
|
||||
{ required: true, message: '请选择起始站', trigger: 'change' }
|
||||
],
|
||||
startSectionCode: [
|
||||
{ required: true, message: '请选择起始区段', trigger: 'change' }
|
||||
],
|
||||
endStationCode: [
|
||||
{ required: true, message: '请选择终到站', trigger: 'change' }
|
||||
],
|
||||
endSectionCode: [
|
||||
{ required: true, message: '请选择终到区段', trigger: 'change' }
|
||||
]
|
||||
},
|
||||
oldsection: []
|
||||
};
|
||||
},
|
||||
computed: {
|
||||
...mapGetters('map', [
|
||||
'sectionList',
|
||||
'stationList'
|
||||
]),
|
||||
filterStartSectionList() {
|
||||
if (this.sectionList) {
|
||||
return this.sectionList.filter(elem => { return elem.reentryTrack || elem.transferTrack; });
|
||||
} else {
|
||||
return [];
|
||||
}
|
||||
},
|
||||
filterEndSectionList() {
|
||||
if (this.sectionList) {
|
||||
return this.sectionList.filter(elem => { return elem.reentryTrack || elem.transferTrack; });
|
||||
} else {
|
||||
return [];
|
||||
}
|
||||
},
|
||||
filterStandSection() {
|
||||
if (this.sectionList) {
|
||||
return this.sectionList.filter(elem => { return elem.standTrack; });
|
||||
} else {
|
||||
return [];
|
||||
}
|
||||
},
|
||||
filterStationList() {
|
||||
if (this.stationList) {
|
||||
return this.stationList.filter(elem => { return true; });
|
||||
} else {
|
||||
return [];
|
||||
}
|
||||
},
|
||||
routeName: {
|
||||
get() {
|
||||
var name = '';
|
||||
if (this.isSave) {
|
||||
let begStation = ''; let endStation = '';
|
||||
let begSection = ''; let endSection = '';
|
||||
if (this.stationList) {
|
||||
this.stationList.forEach(elem => {
|
||||
if (elem.code === this.addModel.startStationCode) begStation = elem.name;
|
||||
if (elem.code === this.addModel.endStationCode) endStation = elem.name;
|
||||
});
|
||||
}
|
||||
if (this.sectionList) {
|
||||
this.sectionList.forEach(elem => {
|
||||
if (elem.code === this.addModel.startSectionCode) begSection = '(' + elem.name + ')';
|
||||
if (elem.code === this.addModel.endSectionCode) endSection = '(' + elem.name + ')';
|
||||
});
|
||||
}
|
||||
name = begStation + begSection + '-' + endStation + endSection;
|
||||
}
|
||||
return name;
|
||||
}
|
||||
|
||||
}
|
||||
},
|
||||
watch: {
|
||||
mapInfo(val) {
|
||||
if (val) {
|
||||
this.addModel.mapId = val.id;
|
||||
}
|
||||
},
|
||||
'addModel.parkSectionCodeList':function(val, old) {
|
||||
if (val.length > 0) {
|
||||
this.changeSectionSelected(val, true);
|
||||
}
|
||||
},
|
||||
routeName(val, old) {
|
||||
if (val) {
|
||||
this.addModel.name = val;
|
||||
}
|
||||
},
|
||||
sectionCode(val) {
|
||||
val && this.changeBelongSection(val);
|
||||
}
|
||||
},
|
||||
mounted() {
|
||||
this.rowDrop();
|
||||
},
|
||||
methods:{
|
||||
previewRouteEvent() {
|
||||
this.$refs.routeOperate.doShow();
|
||||
},
|
||||
createRouteEvent() {
|
||||
this.clear();
|
||||
},
|
||||
routingSelected(data) {
|
||||
this.editData(data);
|
||||
},
|
||||
editData(data) {
|
||||
this.isSave = false;
|
||||
this.allowSelect = true;
|
||||
this.isStartSelected = true;
|
||||
this.editShow = true;
|
||||
this.addModel = data;
|
||||
},
|
||||
clear() {
|
||||
if (this.$refs && this.$refs.form) {
|
||||
this.changeSectionSelected(this.addModel.parkSectionCodeList, false);
|
||||
delete this.addModel.id;
|
||||
this.$refs.form.resetFields();
|
||||
this.addModel.mapId = this.$route.query.mapId;
|
||||
this.addModel.parkSectionCodeList = [];
|
||||
this.addModel.code = '';
|
||||
this.stationCode = '';
|
||||
this.sectionCode = '';
|
||||
this.isSave = true;
|
||||
this.allowSelect = false;
|
||||
this.isStartSelected = false;
|
||||
this.editShow = false;
|
||||
this.field = '';
|
||||
}
|
||||
},
|
||||
setSelected(selected) {
|
||||
if (selected._type.toUpperCase() === 'Station'.toUpperCase() && this.field.toUpperCase() === 'startStationCode'.toUpperCase()) {
|
||||
this.addModel.startStationCode = selected.code;
|
||||
this.judgeAllowSelected();
|
||||
this.addStartSectionData(true);
|
||||
|
||||
} else if (selected._type.toUpperCase() === 'Station'.toUpperCase() && this.field.toUpperCase() === 'endStationCode'.toUpperCase()) {
|
||||
this.addModel.endStationCode = selected.code;
|
||||
this.judgeAllowSelected();
|
||||
this.addEndSectionData(true);
|
||||
} else if (selected._type.toUpperCase() === 'Section'.toUpperCase() && this.field.toUpperCase() === 'startSectionCode'.toUpperCase()) {
|
||||
if (selected.code != this.addModel.endSectionCode && (selected.reentryTrack || selected.transferTrack)) {
|
||||
this.popSection(this.addModel, 'startSectionCode');
|
||||
if (selected.belongStation) {
|
||||
this.addModel.startStationCode = selected.belongStation;
|
||||
}
|
||||
this.addModel.startSectionCode = selected.code;
|
||||
this.judgeAllowSelected();
|
||||
this.addStartSectionData(false);
|
||||
this.oldStartSectionCode = selected.code;
|
||||
} else {
|
||||
this.$message.error('请选择正确的起始区段');
|
||||
}
|
||||
} else if (selected._type.toUpperCase() === 'Section'.toUpperCase() && this.field.toUpperCase() === 'endSectionCode'.toUpperCase()) {
|
||||
if (selected.code != this.addModel.startSectionCode && (selected.reentryTrack || selected.transferTrack)) {
|
||||
this.popSection(this.addModel, 'endSectionCode');
|
||||
if (this.addModel.startSectionCode == selected.code) {
|
||||
this.$message.error('起始区段和终到区段不能相同');
|
||||
return false;
|
||||
}
|
||||
if (selected.belongStation) {
|
||||
this.addModel.endStationCode = selected.belongStation;
|
||||
}
|
||||
this.addModel.endSectionCode = selected.code;
|
||||
this.judgeAllowSelected();
|
||||
this.addEndSectionData(false);
|
||||
this.oldEndSectionCode = selected.code;
|
||||
this.addModel.destinationCode = selected.destinationCode || '';
|
||||
} else {
|
||||
this.$message.error('请选择正确的终到区段');
|
||||
}
|
||||
} else if (selected._type.toUpperCase() === 'Section'.toUpperCase() && this.field.toUpperCase() == 'routingSection'.toUpperCase()) {
|
||||
if (selected.standTrack) {
|
||||
this.sectionCode = selected.code;
|
||||
} else {
|
||||
this.$message.error('请选择正确的区段');
|
||||
}
|
||||
} else if (selected._type.toUpperCase() === 'Station'.toUpperCase() && this.field.toUpperCase() == 'routingStation'.toUpperCase()) {
|
||||
this.stationCode = selected.code;
|
||||
}
|
||||
},
|
||||
changeBelongSection(code) {
|
||||
const section = this.$store.getters['map/getDeviceByCode'](code);
|
||||
if (section && section.belongStation) {
|
||||
this.stationCode = section.belongStation;
|
||||
}
|
||||
},
|
||||
changeSectionSelected(selectedList, flag) {
|
||||
if (this.oldsection && this.oldsection.length > 0) {
|
||||
this.oldsection.forEach((section)=>{
|
||||
section.instance.drawBatchSelected(section, '');
|
||||
});
|
||||
}
|
||||
|
||||
this.oldsection = [];
|
||||
if (this.addModel.parkSectionCodeList && this.addModel.parkSectionCodeList.length > 0) {
|
||||
if (flag) {
|
||||
selectedList.forEach(each=>{
|
||||
const section = this.$store.getters['map/getDeviceByCode'](each.sectionCode);
|
||||
const list = section.logicSectionCodeList;
|
||||
if (list && list.length > 0) {
|
||||
list.forEach(logicSectionCode=>{
|
||||
const logicSection = this.$store.getters['map/getDeviceByCode'](logicSectionCode);
|
||||
logicSection.instance.drawBatchSelected(logicSection, 'routingSection');
|
||||
this.oldsection && this.oldsection.push(logicSection);
|
||||
});
|
||||
} else {
|
||||
section.instance.drawBatchSelected(section, 'routingSection');
|
||||
this.oldsection && this.oldsection.push(section);
|
||||
}
|
||||
});
|
||||
} else {
|
||||
selectedList.forEach(each=>{
|
||||
const section = this.$store.getters['map/getDeviceByCode'](each.sectionCode);
|
||||
const list = section.logicSectionCodeList;
|
||||
if (list && list.length > 0) {
|
||||
list.forEach(logicSectionCode=>{
|
||||
const logicSection = this.$store.getters['map/getDeviceByCode'](logicSectionCode);
|
||||
logicSection.instance.drawBatchSelected(section, '');
|
||||
});
|
||||
} else {
|
||||
section.instance.drawBatchSelected(section, '');
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
},
|
||||
changeStartStation(code, code2) {
|
||||
this.judgeAllowSelected();
|
||||
this.addStartSectionData(true);
|
||||
},
|
||||
changeStartSection(code) {
|
||||
if (code) {
|
||||
if (this.addModel.endSectionCode != code) {
|
||||
const section = this.$store.getters['map/getDeviceByCode'](code);
|
||||
if (section &&
|
||||
section.belongStation) {
|
||||
this.addModel.startStationCode = section.belongStation;
|
||||
}
|
||||
this.popSection({startSectionCode: this.oldStartSectionCode}, 'startSectionCode');
|
||||
this.judgeAllowSelected();
|
||||
this.addStartSectionData(false);
|
||||
this.oldStartSectionCode = code;
|
||||
} else {
|
||||
this.addModel.startSectionCode = this.oldStartSectionCode;
|
||||
this.$message.error('请选择正确的起始区段');
|
||||
}
|
||||
} else {
|
||||
this.popSection({startSectionCode: this.oldStartSectionCode}, 'startSectionCode');
|
||||
this.addModel.startStationCode = '';
|
||||
this.addModel.startSectionCode = '';
|
||||
this.oldStartSectionCode = '';
|
||||
}
|
||||
},
|
||||
changeEndStation() {
|
||||
this.judgeAllowSelected();
|
||||
this.addEndSectionData(true);
|
||||
},
|
||||
changeEndSection(code) {
|
||||
if (code) {
|
||||
if (this.addModel.startSectionCode != code) {
|
||||
const section = this.$store.getters['map/getDeviceByCode'](code);
|
||||
if (section &&
|
||||
section.belongStation) {
|
||||
this.addModel.endStationCode = section.belongStation;
|
||||
}
|
||||
this.addModel.destinationCode = section.destinationCode || '';
|
||||
this.popSection({endSectionCode: this.oldEndSectionCode}, 'endSectionCode');
|
||||
this.judgeAllowSelected();
|
||||
this.addEndSectionData(false);
|
||||
this.oldEndSectionCode = code;
|
||||
} else {
|
||||
this.addModel.endSectionCode = this.oldEndSectionCode;
|
||||
this.$message.error('请选择正确的终到区段');
|
||||
}
|
||||
} else {
|
||||
this.popSection({endSectionCode: this.oldEndSectionCode}, 'endSectionCode');
|
||||
this.addModel.endStationCode = '';
|
||||
this.addModel.endSectionCode = '';
|
||||
this.oldEndSectionCode = '';
|
||||
}
|
||||
},
|
||||
judgeAllowSelected() {
|
||||
if (this.addModel.startStationCode != '' && this.addModel.startSectionCode != '' && this.addModel.endStationCode != '' && this.addModel.endSectionCode != '') {
|
||||
this.allowSelect = true;
|
||||
} else {
|
||||
this.allowSelect = false;
|
||||
}
|
||||
},
|
||||
addStartSectionData(isStation) {
|
||||
if (this.addModel.startStationCode != '' && this.addModel.startSectionCode != '') {
|
||||
this.isStartSelected = true;
|
||||
this.pushSection({stationCode: this.addModel.startStationCode, sectionCode: this.addModel.startSectionCode}, 'top', isStation);
|
||||
}
|
||||
},
|
||||
addEndSectionData(isStation) {
|
||||
if (this.addModel.endStationCode != '' && this.addModel.endSectionCode != '') {
|
||||
this.pushSection({stationCode: this.addModel.endStationCode, sectionCode: this.addModel.endSectionCode}, 'bottom', isStation);
|
||||
}
|
||||
},
|
||||
buildModel(code) {
|
||||
const model = Object.assign({}, this.addModel);
|
||||
model['mapId'] = this.$route.query.mapId;
|
||||
model['userId'] = this.$store.state.user.id;
|
||||
if (code) { model['code'] = code; }
|
||||
return model;
|
||||
},
|
||||
update() {
|
||||
this.$refs.form.validate((valid) => {
|
||||
if (valid) {
|
||||
this.loading = true;
|
||||
const data = this.buildModel();
|
||||
// delete data.withLoop;
|
||||
updateRoutingData(data).then(resp => {
|
||||
this.$message.success(this.$t('tip.pathUpdataSuccessful'));
|
||||
this.loading = false;
|
||||
this.clear();
|
||||
}).catch((error) => {
|
||||
this.$messageBox(this.$t('tip.pathUpdataFailed') + ':' + error.message);
|
||||
this.loading = false;
|
||||
});
|
||||
|
||||
}
|
||||
});
|
||||
},
|
||||
save() {
|
||||
this.$refs.form.validate((valid) => {
|
||||
if (valid) {
|
||||
this.loading = true;
|
||||
addRoutingData(this.buildModel(setUID('Routing'))).then(resp => {
|
||||
this.$message.success(this.$t('tip.pathCreationSuccessful'));
|
||||
this.loading = false;
|
||||
this.clear();
|
||||
}).catch((error) => {
|
||||
this.$messageBox(this.$t('tip.createRoutingFailed') + ':' + error.message);
|
||||
this.loading = false;
|
||||
});
|
||||
}
|
||||
});
|
||||
},
|
||||
formatName(code) {
|
||||
return formatName(code);
|
||||
},
|
||||
deleteSection(list, index) {
|
||||
const data = list.splice(index, 1);
|
||||
if (data.length > 0) {
|
||||
const section = this.$store.getters['map/getDeviceByCode'](data[0].sectionCode);
|
||||
section.instance.drawBatchSelected(section, '');
|
||||
}
|
||||
},
|
||||
hover(field) {
|
||||
this.field = field === this.field ? '' : field;
|
||||
},
|
||||
// 行拖拽
|
||||
rowDrop() {
|
||||
const that = this;
|
||||
const tbody = document.querySelector('.el-parkSectionCode-table tbody', {filter:'.ignoreDrag'});
|
||||
if (tbody) {
|
||||
Sortable.create(tbody, {
|
||||
onEnd({ newIndex, oldIndex }) {
|
||||
const length = that.addModel.parkSectionCodeList.length - 1;
|
||||
if (newIndex != 0 && oldIndex != 0 && newIndex != length && oldIndex != length) {
|
||||
that.addModel.parkSectionCodeList.splice(newIndex, 0, that.addModel.parkSectionCodeList.splice(oldIndex, 1)[0]);
|
||||
const newArray = that.addModel.parkSectionCodeList.slice(0);
|
||||
that.addModel.parkSectionCodeList = [];
|
||||
that.$nextTick(function () {
|
||||
that.addModel.parkSectionCodeList = newArray;
|
||||
});
|
||||
} else {
|
||||
const newArray = that.addModel.parkSectionCodeList.slice(0);
|
||||
that.addModel.parkSectionCodeList = [];
|
||||
that.$nextTick(function () {
|
||||
that.addModel.parkSectionCodeList = newArray;
|
||||
});
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
},
|
||||
pushSection(data, type, isStation) {
|
||||
const list = this.addModel.parkSectionCodeList;
|
||||
if (data && data.stationCode && data.sectionCode) {
|
||||
const index = list.findIndex(elem => { return elem.sectionCode == data.sectionCode; });
|
||||
switch (type) {
|
||||
case 'center': {
|
||||
if (index < 0) {
|
||||
list.splice(list.length - 1, 0, data);
|
||||
} else {
|
||||
this.$messageBox('该区段已经在交路区段中存在');
|
||||
}
|
||||
break;
|
||||
}
|
||||
case 'top': {
|
||||
if (isStation) {
|
||||
if (list.find(el => { el.sectionCode == this.addModel.startSectionCode; })) {
|
||||
list.splice(0, 1, data);
|
||||
} else {
|
||||
list.unshift(data);
|
||||
}
|
||||
} else {
|
||||
if (index < 0) {
|
||||
if (list.find(el => { el.sectionCode == this.addModel.startSectionCode; })) {
|
||||
list.splice(0, 1, data);
|
||||
} else {
|
||||
list.unshift(data);
|
||||
}
|
||||
} else {
|
||||
if (index == list.length - 1 && list.length >= 2) {
|
||||
this.addModel.startSectionCode = list[0].sectionCode;
|
||||
this.addModel.startStationCode = list[0].stationCode;
|
||||
this.$messageBox('起始区段和终到区段不能相同');
|
||||
} else if (index != list.length - 1 && index != 0) {
|
||||
this.$messageBox('该区段已经在交路区段中存在');
|
||||
}
|
||||
}
|
||||
}
|
||||
break;
|
||||
}
|
||||
case 'bottom': {
|
||||
if (isStation) {
|
||||
if (list.find(el => { el.sectionCode == this.addModel.endSectionCode; })) {
|
||||
list.splice(list.length - 1, 1, data);
|
||||
} else {
|
||||
list.push(data);
|
||||
}
|
||||
} else {
|
||||
if (index < 0) {
|
||||
if (list.find(el => { el.sectionCode == this.addModel.endSectionCode; })) {
|
||||
list.splice(list.length - 1, 1, data);
|
||||
} else {
|
||||
list.push(data);
|
||||
}
|
||||
} else {
|
||||
if (index == 0 && list.length >= 2) {
|
||||
this.addModel.endSectionCode = list[list.length - 1].sectionCode;
|
||||
this.addModel.endStationCode = list[list.length - 1].stationCode;
|
||||
this.$messageBox('起始区段和终到区段不能相同');
|
||||
} else if (index != list.length - 1 && index != 0) {
|
||||
this.$messageBox('该区段已经在交路区段中存在');
|
||||
}
|
||||
}
|
||||
}
|
||||
break;
|
||||
}
|
||||
default: {
|
||||
if (index < 0) {
|
||||
list.splice(list.length - 1, 0, data);
|
||||
} else {
|
||||
this.$messageBox(this.$t('tip.routeSameID'));
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
this.sectionCode = '';
|
||||
this.stationCode = '';
|
||||
}
|
||||
},
|
||||
popSection(data, type) {
|
||||
const list = this.addModel.parkSectionCodeList;
|
||||
const index = list.findIndex(el => { return el.sectionCode == data[type]; });
|
||||
if (index >= 0) {
|
||||
this.deleteSection(list, index);
|
||||
}
|
||||
},
|
||||
generateParkSection() {
|
||||
this.$refs.form.validate((valid) => {
|
||||
if (valid) {
|
||||
this.generating = true;
|
||||
gernateRoutingSectionInRunplan(this.buildModel(setUID('Routing'))).then(resp => {
|
||||
this.generating = false;
|
||||
if (resp.data.parkSectionCodeList && resp.data.parkSectionCodeList.length > 2) {
|
||||
this.addModel.parkSectionCodeList = resp.data.parkSectionCodeList;
|
||||
}
|
||||
}).catch((error) => {
|
||||
this.$messageBox('生成交路区段数据失败: ' + error.message);
|
||||
this.generating = false;
|
||||
});
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
};
|
||||
</script>
|
||||
<style lang="scss" scoped>
|
||||
.mapEdit_box{
|
||||
float: right;
|
||||
padding: 3px 0;
|
||||
margin-right: 5px;
|
||||
}
|
||||
</style>
|
180
src/views/planMonitor/newEditTool/routingoperate/routeMap.vue
Normal file
180
src/views/planMonitor/newEditTool/routingoperate/routeMap.vue
Normal file
@ -0,0 +1,180 @@
|
||||
<template>
|
||||
<el-dialog :title="title" :visible.sync="dialogShow" custom-class="content-route" width="100%" :fullscreen="true" top="0px" :before-close="close" :z-index="2000" :append-to-body="true">
|
||||
<div class="content-box">
|
||||
<jlmap-visual ref="jlmapVisual" @onMenu="onContextmenu" @onSelect="clickEvent" />
|
||||
<!-- :style="{height: $store.state.app.height-54+'px' }" -->
|
||||
<div class="routeMap">
|
||||
<route-config v-if="type=='routeMap'" ref="routeConfig" />
|
||||
<runplan-config v-if="type=='runplanParams'" ref="runPlanConfig" />
|
||||
</div>
|
||||
</div>
|
||||
</el-dialog>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import JlmapVisual from '@/views/newMap/jlmapNew/index';
|
||||
import { loadMapDataById } from '@/utils/loaddata';
|
||||
import { EventBus } from '@/scripts/event-bus';
|
||||
import RouteConfig from './routeConfig';
|
||||
import RunplanConfig from './runplanConfig';
|
||||
|
||||
export default {
|
||||
name: 'RouteMap',
|
||||
components: {
|
||||
JlmapVisual,
|
||||
RouteConfig,
|
||||
RunplanConfig
|
||||
},
|
||||
props:{
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
type:'',
|
||||
title:'',
|
||||
dialogShow: false,
|
||||
oldDevice: null,
|
||||
oldsection:[],
|
||||
isFirst:true
|
||||
};
|
||||
},
|
||||
watch: {
|
||||
'$store.state.app.width': function(val) {
|
||||
this.setWindowSize();
|
||||
},
|
||||
'$store.state.app.windowSizeCount': function() {
|
||||
this.setWindowSize();
|
||||
}
|
||||
},
|
||||
mounted() {
|
||||
},
|
||||
methods: {
|
||||
async doShow(type) {
|
||||
this.type = type;
|
||||
if (this.type == 'routeMap') {
|
||||
this.title = '交路配置';
|
||||
} else if (this.type == 'runplanParams') {
|
||||
this.title = '参数配置';
|
||||
|
||||
}
|
||||
this.dialogShow = true;
|
||||
await this.setWindowSize();
|
||||
if (this.isFirst) {
|
||||
this.loadInitPage();
|
||||
}
|
||||
this.isFirst = false;
|
||||
if (this.type == 'runplanParams') { this.$refs.runPlanConfig.doShow(); }
|
||||
},
|
||||
// 获取设备数据
|
||||
getDeviceByEm(em) {
|
||||
var device = this.$store.getters['map/getDeviceByCode'](em.deviceCode) || null;
|
||||
if (device) {
|
||||
device._viewVal = em.val;
|
||||
}
|
||||
return device;
|
||||
},
|
||||
// 高亮设备
|
||||
deviceHighLight(device, flag) {
|
||||
if (device && device.instance && typeof device.instance.drawSelected === 'function' ) {
|
||||
if (device._type === 'Section' && device.type === '04') {
|
||||
device.relevanceSectionList.forEach(item => {
|
||||
const sectionModel = this.$store.getters['map/getDeviceByCode'](item);
|
||||
sectionModel && sectionModel.instance.drawSelected(flag);
|
||||
});
|
||||
} else if (device._type === 'Section' && device.type === '01' && device.logicSectionCodeList && device.logicSectionCodeList.length) {
|
||||
device.logicSectionCodeList.forEach(item => {
|
||||
const sectionModel = this.$store.getters['map/getDeviceByCode'](item);
|
||||
sectionModel && sectionModel.instance.drawSelected(flag);
|
||||
});
|
||||
} else {
|
||||
device.instance.drawSelected(flag);
|
||||
}
|
||||
}
|
||||
},
|
||||
clickEvent(em) {
|
||||
const device = this.getDeviceByEm(em);
|
||||
this.deviceHighLight(this.oldDevice, false);
|
||||
this.deviceHighLight(device, true);
|
||||
this.oldDevice = device;
|
||||
this.setSelected(device);
|
||||
},
|
||||
setWindowSize() {
|
||||
this.$nextTick(() => {
|
||||
const width = this.$store.state.app.width * 0.7;
|
||||
const height = this.$store.state.app.height - 54;
|
||||
this.$store.dispatch('config/resize', { width, height });
|
||||
});
|
||||
},
|
||||
loadInitPage() {
|
||||
this.$store.dispatch('training/changeMode', { mode: null });
|
||||
loadMapDataById(this.$route.query.mapId, 'preview');
|
||||
},
|
||||
endViewLoading(isSuccess) {
|
||||
if (!isSuccess) {
|
||||
this.$store.dispatch('map/mapClear');
|
||||
}
|
||||
|
||||
this.$nextTick(() => {
|
||||
EventBus.$emit('viewLoading', false);
|
||||
});
|
||||
},
|
||||
setSelected(selected) {
|
||||
if (selected) {
|
||||
if (this.type == 'routeMap') { this.$refs.routeConfig.setSelected(selected); }
|
||||
// if (this.type == 'runplanParams') { this.$refs.runPlanConfig.setSelected(selected); }
|
||||
}
|
||||
},
|
||||
// batchSectionListFocus(flag) {
|
||||
// this.changeSectionSelected(this.addModel.parkSectionCodeList, flag);
|
||||
// },
|
||||
onContextmenu() {
|
||||
|
||||
},
|
||||
close() {
|
||||
this.dialogShow = false;
|
||||
if (this.type == 'routeMap') { this.$refs.routeConfig.createRouteEvent(); }
|
||||
// if (this.type == 'runplanParams') { this.$refs.runPlanConfig.clear(); }
|
||||
}
|
||||
}
|
||||
};
|
||||
</script>
|
||||
|
||||
<style lang="scss" scope>
|
||||
.content-route{
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
/deep/ {
|
||||
.el-dialog__body{
|
||||
width: 100%;
|
||||
height:100%;
|
||||
flex:1;
|
||||
padding: 0;
|
||||
overflow: hidden;
|
||||
}
|
||||
}
|
||||
}
|
||||
.content-box{
|
||||
display:flex;
|
||||
height:100%;
|
||||
}
|
||||
.routeMap{
|
||||
height:100%;
|
||||
overflow:auto;
|
||||
width: 29%;
|
||||
flex:1;
|
||||
&::-webkit-scrollbar {
|
||||
width: 4px;
|
||||
}
|
||||
|
||||
&::-webkit-scrollbar-thumb {
|
||||
border-radius: 10px;
|
||||
background: #c3c3c3;
|
||||
}
|
||||
|
||||
&::-webkit-scrollbar-track {
|
||||
border-radius: 0;
|
||||
background: #f0f0f0;
|
||||
|
||||
}
|
||||
}
|
||||
</style>
|
||||
|
@ -0,0 +1,289 @@
|
||||
<template>
|
||||
<el-dialog v-dialogDrag title="交路列表" :visible.sync="show" width="85%" :before-do-close="doClose" append-to-body>
|
||||
<div>
|
||||
<QueryListPage
|
||||
ref="queryListPage"
|
||||
:pager-config="pagerConfig"
|
||||
:query-form="queryForm"
|
||||
:query-list="queryList"
|
||||
/>
|
||||
</div>
|
||||
<pre-view-field ref="previewField" />
|
||||
</el-dialog>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import { mapGetters } from 'vuex';
|
||||
import { listMap } from '@/api/jmap/mapdraft';
|
||||
import { listRoutingData, deleteRoutingData, getRoutingData } from '@/api/jmap/mapdraft';
|
||||
import PreViewField from './preview';
|
||||
|
||||
export default {
|
||||
name: 'RouteDetail',
|
||||
components: {
|
||||
PreViewField
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
show: false,
|
||||
mapList: [],
|
||||
pagerConfig: {
|
||||
pageSize: 'pageSize',
|
||||
pageIndex: 'pageNum'
|
||||
},
|
||||
queryForm: {
|
||||
labelWidth: '120px',
|
||||
queryObject: {
|
||||
startStationCode: {
|
||||
type: 'select',
|
||||
label: this.$t('map.startStation'),
|
||||
config: {
|
||||
data: []
|
||||
}
|
||||
},
|
||||
endStationCode: {
|
||||
type: 'select',
|
||||
label: this.$t('map.endStation'),
|
||||
config: {
|
||||
data: []
|
||||
}
|
||||
},
|
||||
startSectionCode: {
|
||||
type: 'select',
|
||||
label: '起始区段',
|
||||
config: {
|
||||
data: []
|
||||
}
|
||||
},
|
||||
endSectionCode: {
|
||||
type: 'select',
|
||||
label: '终到区段',
|
||||
config: {
|
||||
data: []
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
queryList: {
|
||||
query: this.queryFunction,
|
||||
afterQuery: this.afterQuery,
|
||||
selectCheckShow: false,
|
||||
indexShow: true,
|
||||
columns: [
|
||||
{
|
||||
title: this.$t('map.routingCode'),
|
||||
prop: 'code'
|
||||
},
|
||||
{
|
||||
title: this.$t('map.startStation'),
|
||||
prop: 'startStationCode'
|
||||
|
||||
},
|
||||
{
|
||||
title: '起始区段',
|
||||
prop: 'startSectionCode'
|
||||
},
|
||||
{
|
||||
title: this.$t('map.endStation'),
|
||||
prop: 'endStationCode'
|
||||
},
|
||||
{
|
||||
title: '终到区段',
|
||||
prop: 'endSectionCode'
|
||||
},
|
||||
{
|
||||
title: this.$t('map.routingDirection'),
|
||||
prop: 'right',
|
||||
type: 'tag',
|
||||
columnValue: (row) => { if (row.right) { return '右行'; } else { return '左行'; } },
|
||||
tagType: (row) => { if (row.right) { return 'primary'; } else { return 'success'; } }
|
||||
},
|
||||
{
|
||||
title: this.$t('map.destination'),
|
||||
prop: 'destinationCode'
|
||||
},
|
||||
{
|
||||
title: this.$t('map.remarks'),
|
||||
prop: 'remarks'
|
||||
},
|
||||
{
|
||||
type: 'button',
|
||||
title: this.$t('map.sectionData'),
|
||||
buttons: [
|
||||
{
|
||||
name: this.$t('map.preview'),
|
||||
handleClick: this.sectionDetail
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
type: 'button',
|
||||
title: this.$t('map.operation'),
|
||||
width: '300',
|
||||
buttons: [
|
||||
{
|
||||
name: this.$t('map.compile'),
|
||||
handleClick: this.editObj
|
||||
},
|
||||
{
|
||||
name: this.$t('map.deleteObj'),
|
||||
handleClick: this.deleteObj,
|
||||
type: 'danger'
|
||||
}
|
||||
// {
|
||||
// name: '生成站间运行数据',
|
||||
// handleClick: this.generateData,
|
||||
// type: 'danger'
|
||||
// }
|
||||
]
|
||||
}
|
||||
]
|
||||
}
|
||||
};
|
||||
},
|
||||
computed: {
|
||||
...mapGetters('map', [
|
||||
'sectionList',
|
||||
'stationList'
|
||||
])
|
||||
},
|
||||
mounted() {
|
||||
this.acquireMapList();
|
||||
this.initQueryObject();
|
||||
},
|
||||
methods: {
|
||||
doShow() {
|
||||
this.show = true;
|
||||
this.reloadTable();
|
||||
},
|
||||
initQueryObject() {
|
||||
const stationList = [];
|
||||
if (this.stationList && this.stationList.length) {
|
||||
this.stationList.forEach(elem => {
|
||||
stationList.push({ label: this.formatName(elem.code), value: elem.code });
|
||||
});
|
||||
this.queryForm.queryObject.startStationCode.config.data = stationList;
|
||||
this.queryForm.queryObject.endStationCode.config.data = stationList;
|
||||
}
|
||||
const sectionList = [];
|
||||
if (this.sectionList && this.sectionList.length) {
|
||||
this.sectionList.forEach(elem => {
|
||||
if (elem.standTrack || elem.reentryTrack || elem.transferTrack) {
|
||||
sectionList.push({ label: this.formatName(elem.code), value: elem.code });
|
||||
}
|
||||
});
|
||||
this.queryForm.queryObject.startSectionCode.config.data = sectionList;
|
||||
this.queryForm.queryObject.endSectionCode.config.data = sectionList;
|
||||
}
|
||||
},
|
||||
doClose() {
|
||||
this.show = false;
|
||||
},
|
||||
formatName(code) {
|
||||
let name = '';
|
||||
const device = this.$store.getters['map/getDeviceByCode'](code);
|
||||
if (device) {
|
||||
name = device.name;
|
||||
}
|
||||
|
||||
return name;
|
||||
},
|
||||
queryFunction(params) {
|
||||
if (this.$route.query.mapId) {
|
||||
return listRoutingData(this.$route.query.mapId, params);
|
||||
}
|
||||
},
|
||||
acquireMapList() {
|
||||
// 地图名称列表
|
||||
listMap({drawWay: true}).then(response => {
|
||||
this.mapList = response.data;
|
||||
});
|
||||
},
|
||||
afterQuery(data) {
|
||||
if (data && data.list) {
|
||||
const that = this;
|
||||
const list = data.list;
|
||||
if (list) {
|
||||
list.map(elem => {
|
||||
that.$convertSpecifiedField(elem, that.mapList, 'id', 'name', ['mapId']);
|
||||
elem.startStationCode = that.formatName(elem.startStationCode);
|
||||
elem.startSectionCode = that.formatName(elem.startSectionCode);
|
||||
elem.endStationCode = that.formatName(elem.endStationCode);
|
||||
elem.endSectionCode = that.formatName(elem.endSectionCode);
|
||||
});
|
||||
}
|
||||
}
|
||||
return data;
|
||||
},
|
||||
editObj(index, row) {
|
||||
getRoutingData(row.id).then(response => {
|
||||
const data = Object.assign({ code: response.data.id }, response.data);
|
||||
this.$emit('routingSelected', data);
|
||||
this.doClose();
|
||||
});
|
||||
},
|
||||
deleteObj(index, row) {
|
||||
if (this.$route.query.mapId && row) {
|
||||
this.$confirm('是否确认删除交路', this.$t('global.tips'), {
|
||||
confirmButtonText: this.$t('global.confirm'),
|
||||
cancelButtonText: this.$t('global.cancel'),
|
||||
type: 'warning'
|
||||
}).then(() => {
|
||||
// 删除
|
||||
deleteRoutingData(row.id).then(response => {
|
||||
this.$message.success(this.$t('map.successfullyDelete'));
|
||||
this.reloadTable();
|
||||
}).catch(() => {
|
||||
this.$messageBox(this.$t('map.failDelete'));
|
||||
});
|
||||
}).catch();
|
||||
}
|
||||
},
|
||||
// generateData(index, row) {
|
||||
// if (this.$route.query.mapId && row) {
|
||||
// // 根据地图交路区段生成站间运行等级
|
||||
// generateStationRunData(row.id).then(response => {
|
||||
// this.$message.success(this.$t('map.generateStationRunDataSuccess'));
|
||||
// // 站间运行数据生成成功
|
||||
// this.reloadTable();
|
||||
// }).catch((error) => {
|
||||
// // 站间运行数据生成失败
|
||||
// this.$messageBox(this.$t('map.generateStationRunDataFailed') + ': ' + error.message);
|
||||
// });
|
||||
// }
|
||||
// },
|
||||
sectionDetail(index, row) {
|
||||
const sectionDict = {};
|
||||
const stationDict = {};
|
||||
this.sectionList.forEach(elem => { sectionDict[elem.code] = elem.name; });
|
||||
this.stationList.forEach(elem => { stationDict[elem.code] = elem.name; });
|
||||
|
||||
const fieldList = {
|
||||
id: row.id,
|
||||
mapId: this.$route.params.mapId,
|
||||
title: '区段列表',
|
||||
name: row.name,
|
||||
model: {
|
||||
field: 'parkSectionCodeList',
|
||||
items: [
|
||||
{ prop: 'stationCode', label: this.$t('map.stationCodeClomn'), type: 'text' },
|
||||
{
|
||||
prop: 'stationCode', label: '车站名称', type: 'select', options: stationDict
|
||||
},
|
||||
{ prop: 'sectionCode', label: this.$t('map.blockCodingClomn'), type: 'text' },
|
||||
{
|
||||
prop: 'sectionCode', label: this.$t('map.sectionName'), type: 'select', options: sectionDict
|
||||
}
|
||||
]
|
||||
}
|
||||
};
|
||||
this.$refs.previewField.doShow(fieldList, row.parkSectionCodeList);
|
||||
},
|
||||
reloadTable() {
|
||||
if (this.queryList && this.queryList.reload) {
|
||||
this.queryList.reload();
|
||||
}
|
||||
}
|
||||
}
|
||||
};
|
||||
</script>
|
@ -0,0 +1,192 @@
|
||||
<template>
|
||||
<div class="runPlanConfig">
|
||||
<div class="reentryConfig">折返配置 (单位:秒)</div>
|
||||
<div class="reentryConfigTable">
|
||||
<el-table
|
||||
:data="reentryDataList"
|
||||
border
|
||||
style="width:100%"
|
||||
height="430"
|
||||
class="el-parkSectionCode-table"
|
||||
>
|
||||
<el-table-column prop="stationCode" :label="$t('map.stationName')">
|
||||
<template slot-scope="scope">
|
||||
<span>{{ scope.row.stationName }}</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="站前折返">
|
||||
<template slot-scope="scope">
|
||||
<!-- v-if="scope.row.reentryData.tbFrom" -->
|
||||
<el-input-number
|
||||
v-model="scope.row.reentryData.tbFront"
|
||||
:style="{width: '80px'}"
|
||||
:min="1"
|
||||
size="mini"
|
||||
:controls="false"
|
||||
:precision="0"
|
||||
:step="1"
|
||||
/>
|
||||
<!-- <el-button v-else type="primary" size="small" @click="add(scope.row)">添加</el-button> -->
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="站后折返">
|
||||
<template slot-scope="scope">
|
||||
<el-input-number
|
||||
v-model="scope.row.reentryData.tbBack"
|
||||
:style="{width: '80px'}"
|
||||
:min="1"
|
||||
size="mini"
|
||||
:precision="0"
|
||||
:controls="false"
|
||||
:step="1"
|
||||
/>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="从股道到折返">
|
||||
<template slot-scope="scope">
|
||||
<el-input-number
|
||||
v-model="scope.row.reentryData.tbFrom"
|
||||
:style="{width: '80px'}"
|
||||
:min="1"
|
||||
size="mini"
|
||||
:controls="false"
|
||||
:precision="0"
|
||||
:step="1"
|
||||
/>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="从折返到股道">
|
||||
<template slot-scope="scope">
|
||||
<el-input-number
|
||||
v-model="scope.row.reentryData.tbTo"
|
||||
:style="{width: '80px'}"
|
||||
:min="1"
|
||||
size="mini"
|
||||
:controls="false"
|
||||
:precision="0"
|
||||
:step="1"
|
||||
/>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
<el-button-group style="padding:10px">
|
||||
<el-button type="primary" size="small" :loading="loading" @click="save">{{ $t('map.save') }}
|
||||
</el-button>
|
||||
</el-button-group>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
<script>
|
||||
import { mapGetters } from 'vuex';
|
||||
import { addRunplanConfig, getRunplanConfig } from '@/api/jmap/mapdraft';
|
||||
export default {
|
||||
name:'RunPlanConfig',
|
||||
data() {
|
||||
return {
|
||||
reentryDataList:[],
|
||||
stationList:{},
|
||||
sectionCode:'',
|
||||
field:'',
|
||||
loading:false
|
||||
};
|
||||
},
|
||||
computed: {
|
||||
...mapGetters('map', [
|
||||
'sectionList'
|
||||
])
|
||||
},
|
||||
mounted() {
|
||||
if (this.sectionList) {
|
||||
const reentrySections = this.sectionList.filter(elem => { return elem.reentryTrack; });
|
||||
const stationList = {};
|
||||
reentrySections.forEach(each=>{
|
||||
if (each.belongStation) {
|
||||
const station = this.$store.getters['map/getDeviceByCode'](each.belongStation);
|
||||
if (!stationList[each.belongStation]) {
|
||||
stationList[each.belongStation] = {code:each.belongStation, stationName:station.name,
|
||||
reentryData:{tbFront:undefined, tbBack:undefined, tbFrom:undefined, tbTo:undefined}};
|
||||
}
|
||||
}
|
||||
});
|
||||
this.reentryDataList = Object.values(stationList);
|
||||
this.stationList = stationList;
|
||||
}
|
||||
},
|
||||
methods:{
|
||||
doShow() {
|
||||
this.loading = false;
|
||||
getRunplanConfig(this.$route.query.mapId).then(resp => {
|
||||
if (resp.data && resp.data.config && resp.data.config.reentryData) {
|
||||
const reentryData = resp.data.config.reentryData;
|
||||
const keys = Object.keys(reentryData);
|
||||
keys.forEach(each=>{
|
||||
this.stationList[each].reentryData = reentryData[each];
|
||||
});
|
||||
const newData = Object.values(this.stationList);
|
||||
this.reentryDataList = [...newData || []];
|
||||
}
|
||||
});
|
||||
},
|
||||
save() {
|
||||
const tbBackList = [];
|
||||
const reentryData = {};
|
||||
this.reentryDataList.forEach(each=>{
|
||||
if (each.reentryData.tbFront || (each.reentryData.tbBack && each.reentryData.tbFrom && each.reentryData.tbTo)) {
|
||||
const temp = Object.assign({}, each.reentryData);
|
||||
if (!(each.reentryData.tbFront && (each.reentryData.tbBack && each.reentryData.tbFrom && each.reentryData.tbTo))) {
|
||||
if (each.reentryData.tbFront) {
|
||||
temp.tbBack = null;
|
||||
temp.tbFrom = null;
|
||||
temp.tbTo = null;
|
||||
} else {
|
||||
temp.tbFront = null;
|
||||
}
|
||||
}
|
||||
reentryData[each.code] = temp;
|
||||
} else {
|
||||
if (each.reentryData.tbBack || each.reentryData.tbFrom || each.reentryData.tbTo) {
|
||||
tbBackList.push(each.stationName);
|
||||
}
|
||||
}
|
||||
});
|
||||
if (tbBackList.length > 0) {
|
||||
this.$messageBox('请设置【' + reentryData.toString() + '】站后折返信息');
|
||||
return;
|
||||
} else if (Object.keys(reentryData).length == 0) {
|
||||
// JSON.stringify(reentryData) == '{}'
|
||||
this.$messageBox('请填写折返配置信息');
|
||||
return;
|
||||
}
|
||||
addRunplanConfig(this.$route.query.mapId, {'reentryData':reentryData}).then(resp => {
|
||||
this.$message.success('折返配置成功');
|
||||
this.loading = false;
|
||||
}).catch((error) => {
|
||||
this.$messageBox('折返配置失败' + ':' + error.message);
|
||||
this.loading = false;
|
||||
});
|
||||
}
|
||||
}
|
||||
};
|
||||
</script>
|
||||
<style lang="scss">
|
||||
.reentryConfigTable{
|
||||
margin-top: 10px;
|
||||
}
|
||||
.runPlanConfig{padding:15px 20px}
|
||||
// .reentryConfigTable .el-table--scrollable-y .el-table__body-wrapper{
|
||||
// &::-webkit-scrollbar {
|
||||
// width: 4px;
|
||||
// }
|
||||
|
||||
// &::-webkit-scrollbar-thumb {
|
||||
// border-radius: 10px;
|
||||
// background: #c3c3c3;
|
||||
// }
|
||||
|
||||
// &::-webkit-scrollbar-track {
|
||||
// border-radius: 0;
|
||||
// background: #f0f0f0;
|
||||
|
||||
// }
|
||||
// }
|
||||
</style>
|
@ -1,5 +1,5 @@
|
||||
<template>
|
||||
<div id="PlanSchedule">
|
||||
<div id="PlanSchedule" v-loading="runplanLoading">
|
||||
<div class="left">
|
||||
<div :id="runPlanId" />
|
||||
</div>
|
||||
@ -8,16 +8,17 @@
|
||||
ref="serviceTable"
|
||||
class="data_table_box"
|
||||
:config="serviceNumberConfig"
|
||||
@touch="scheduleTouch"
|
||||
/>
|
||||
<!-- @touch="scheduleTouch" -->
|
||||
<data-table
|
||||
ref="tripTable"
|
||||
style="margin-top: 3px;"
|
||||
class="data_table_box"
|
||||
:config="tripNumberConfig"
|
||||
@touch="trainNumTouch"
|
||||
/>
|
||||
<!-- @touch="trainNumTouch" -->
|
||||
</div>
|
||||
<modify-service ref="modifyService" :load-run-plan-id="loadRunPlanId" />
|
||||
<modify-service ref="modifyService" />
|
||||
</div>
|
||||
</template>
|
||||
|
||||
@ -26,6 +27,9 @@ import ModifyService from './menus/modifyService';
|
||||
import { mapGetters } from 'vuex';
|
||||
import { timeFormat } from '@/utils/date';
|
||||
import { getStationList, queryRunPlan } from '@/api/runplan';
|
||||
import {getRpDetailByUserMapId, getUserMapDetailByMapId} from '@/api/designPlatform';
|
||||
import { getPublishMapInfo } from '@/api/jmap/map';
|
||||
import {getMapDetail} from '@/api/jmap/mapdraft';
|
||||
import DataTable from './menus/components/dataTable';
|
||||
import echarts from 'echarts';
|
||||
|
||||
@ -40,14 +44,6 @@ export default {
|
||||
type: Object,
|
||||
required: true
|
||||
},
|
||||
maxWidth: {
|
||||
type: Number,
|
||||
required: true
|
||||
},
|
||||
maxHeight: {
|
||||
type: Number,
|
||||
required: true
|
||||
},
|
||||
loadRunPlanId: {
|
||||
type: String,
|
||||
default() {
|
||||
@ -65,9 +61,11 @@ export default {
|
||||
return {
|
||||
top: 0,
|
||||
height: 0,
|
||||
mapName: '',
|
||||
runPlanId: 'plan-tool',
|
||||
myChart: null,
|
||||
showTrain: false,
|
||||
runplanLoading:false,
|
||||
serviceNumberConfig: {
|
||||
data: [],
|
||||
title: this.$t('planMonitor.serviceNumber'),
|
||||
@ -100,8 +98,8 @@ export default {
|
||||
}
|
||||
]
|
||||
},
|
||||
realData: {},
|
||||
kmRangeCoordMap: {},
|
||||
// realData: {},
|
||||
// kmRangeCoordMap: {},
|
||||
option: {
|
||||
title: { // 标题
|
||||
text: '',
|
||||
@ -221,41 +219,50 @@ export default {
|
||||
}
|
||||
]
|
||||
},
|
||||
absoluteTime: 2 * 3600,
|
||||
indexKmRangeMap: {},
|
||||
// absoluteTime: 2 * 3600,
|
||||
// indexKmRangeMap: {},
|
||||
stationsObj: {}
|
||||
};
|
||||
},
|
||||
computed: {
|
||||
...mapGetters('runPlan', [
|
||||
'draftStations'
|
||||
])
|
||||
},
|
||||
watch: {
|
||||
'stations'
|
||||
]),
|
||||
planId() {
|
||||
return this.$route.query.planId;
|
||||
},
|
||||
maxWidth() {
|
||||
this.setPosition();
|
||||
return this.$store.state.app.width;
|
||||
},
|
||||
maxHeight() {
|
||||
this.setPosition();
|
||||
},
|
||||
return this.$store.state.app.height;
|
||||
}
|
||||
},
|
||||
watch: {
|
||||
'$store.state.runPlan.planSizeCount': function () {
|
||||
this.reSize({ width: this.$store.state.runPlan.width, height: this.$store.state.runPlan.height });
|
||||
},
|
||||
'$store.state.runPlan.refreshCount': function() {
|
||||
this.loadChartPage();
|
||||
},
|
||||
$route() {
|
||||
this.$nextTick(() => {
|
||||
this.loadChartPage();
|
||||
});
|
||||
},
|
||||
// $route() {
|
||||
// this.$nextTick(() => {
|
||||
// this.loadChartPage();
|
||||
// });
|
||||
// },
|
||||
loadRunPlanId() {
|
||||
this.loadChartPage();
|
||||
},
|
||||
'maxWidth':function () {
|
||||
this.setPosition();
|
||||
},
|
||||
'maxHeight':function () {
|
||||
this.setPosition();
|
||||
}
|
||||
},
|
||||
mounted() {
|
||||
this.setPosition();
|
||||
this.loadChartPage();
|
||||
// this.loadChartPage();
|
||||
},
|
||||
beforeDestroy() {
|
||||
this.destroy();
|
||||
@ -264,19 +271,31 @@ export default {
|
||||
displayTrain() {
|
||||
this.showTrain = !this.showTrain;
|
||||
},
|
||||
serviceNumberModify(row) {
|
||||
if (row) {
|
||||
this.$refs.modifyService.doShow({serviceNumber:row.serviceNumber});
|
||||
}
|
||||
},
|
||||
tripNumberModify(row) {
|
||||
if (row) {
|
||||
this.$refs.modifyService.doShow({serviceNumber:this.$store.state.runPlan.selected.serviceNumber, tripNumber:row.tripNumber});
|
||||
}
|
||||
},
|
||||
serviceNumberChange(row) {
|
||||
let serviceNumber = null;
|
||||
let serviceObj = {};
|
||||
if (row) {
|
||||
serviceNumber = row.serviceNumber;
|
||||
serviceObj = this.$store.state.runPlan.draftEditData[row.serviceNumber] || {};
|
||||
serviceObj = this.$store.state.runPlan.editData[row.serviceNumber] || {};
|
||||
|
||||
const op = this.myChart.getOption();
|
||||
op.series.forEach((item, index) => {
|
||||
item.lineStyle.color = '#000';
|
||||
item.lineStyle.width = 0.5;
|
||||
switch (item.name) {
|
||||
case serviceNumber: {
|
||||
item.lineStyle.color = 'red';
|
||||
item.lineStyle.width = 1;
|
||||
break;
|
||||
}
|
||||
case 'trainLabel': {
|
||||
@ -287,11 +306,11 @@ export default {
|
||||
});
|
||||
this.myChart.setOption(op, true);
|
||||
}
|
||||
this.$store.dispatch('runPlan/setDraftSelected', { serviceNumber: serviceNumber, tripNumber: null });
|
||||
this.$store.dispatch('runPlan/setSelected', { serviceNumber: serviceNumber, tripNumber: null });
|
||||
this.analyticalTripNumber(serviceObj.trainMap || {});
|
||||
},
|
||||
tripNumberChange(row) {
|
||||
const serviceNumber = this.$store.state.runPlan.draftSelected.serviceNumber;
|
||||
const serviceNumber = this.$store.state.runPlan.selected.serviceNumber;
|
||||
let tripNumber = null;
|
||||
if (row) {
|
||||
const data = [];
|
||||
@ -308,6 +327,8 @@ export default {
|
||||
data.push(nor);
|
||||
}
|
||||
});
|
||||
// item.lineStyle.color = '#000';
|
||||
item.lineStyle.width = 0.5;
|
||||
break;
|
||||
}
|
||||
case 'trainLabel': {
|
||||
@ -320,7 +341,8 @@ export default {
|
||||
op.series.push({
|
||||
name: 'trainLabel',
|
||||
lineStyle: {
|
||||
color: 'green'
|
||||
color: 'green',
|
||||
width:2
|
||||
},
|
||||
type: 'line',
|
||||
data: data
|
||||
@ -330,14 +352,17 @@ export default {
|
||||
}, 50);
|
||||
|
||||
}
|
||||
this.$store.dispatch('runPlan/setDraftSelected', { serviceNumber: serviceNumber, tripNumber: tripNumber });
|
||||
this.$store.dispatch('runPlan/setSelected', { serviceNumber: serviceNumber, tripNumber: tripNumber });
|
||||
},
|
||||
async analyticalServiceNumber(data) {
|
||||
this.serviceNumberConfig.data = Object.keys(data || {})
|
||||
.sort((a, b) => { return data[a].oldIndex - data[b].oldIndex; })
|
||||
.sort((a, b) => { return parseInt(data[a].serviceNumber) - parseInt(data[b].serviceNumber); })
|
||||
.map(serviceNumber => { return { serviceNumber }; });
|
||||
},
|
||||
async analyticalTripNumber(data) {
|
||||
// this.tripNumberConfig.data = Object.keys(data || {})
|
||||
// .sort((a, b) => { return data[a].tripNumber - data[b].tripNumber; })
|
||||
// .map(tripNumber => { return { tripNumber }; });
|
||||
this.tripNumberConfig.data = Object.keys(data || {})
|
||||
.sort((a, b) => { return data[a].oldIndex - data[b].oldIndex; })
|
||||
.map(tripNumber => { return { tripNumber }; });
|
||||
@ -345,7 +370,6 @@ export default {
|
||||
async setPosition() {
|
||||
this.$nextTick(() => {
|
||||
let top = 3;
|
||||
const width = this.maxWidth;
|
||||
let height = this.maxHeight;
|
||||
|
||||
const titleBar = document.getElementById('PlanTitleBar');
|
||||
@ -370,8 +394,7 @@ export default {
|
||||
}
|
||||
|
||||
height = height - top;
|
||||
this.$store.dispatch('runPlan/resize', { width, height:height - 20 });
|
||||
|
||||
this.$store.dispatch('runPlan/resize', { width:this.maxWidth, height });
|
||||
if (this.top != top) {
|
||||
this.top = top;
|
||||
}
|
||||
@ -381,51 +404,106 @@ export default {
|
||||
}
|
||||
});
|
||||
},
|
||||
serviceNumberModify(row) {
|
||||
if (row) {
|
||||
this.$refs.modifyService.doShow({serviceNumber:row.serviceNumber});
|
||||
}
|
||||
},
|
||||
tripNumberModify(row) {
|
||||
if (row) {
|
||||
this.$refs.modifyService.doShow({serviceNumber:this.$store.state.runPlan.draftSelected.serviceNumber, tripNumber:row.tripNumber});
|
||||
}
|
||||
},
|
||||
async loadChartPage() {
|
||||
try {
|
||||
this.$store.dispatch('runPlan/draftClear').then(() => {
|
||||
// this.loadInitChart().then(() => {
|
||||
if (/^\/plan\/usertool/.test(this.$route.fullPath)) {
|
||||
getUserMapDetailByMapId(this.$route.query.mapId).then(resp => {
|
||||
this.mapName = `${resp.data.name} (${this.$route.query.planName || this.loadRunPlanName || ''})`;
|
||||
});
|
||||
} else {
|
||||
getPublishMapInfo(this.$route.query.mapId).then(resp => {
|
||||
this.mapName = `${resp.data.name} (${this.$route.query.planName || this.loadRunPlanName || ''})`;
|
||||
});
|
||||
}
|
||||
|
||||
this.$store.dispatch('runPlan/clear').then(() => {
|
||||
if (this.$route.query.mapId) {
|
||||
getStationList(this.$route.query.mapId).then(resp => {
|
||||
this.$store.dispatch('runPlan/setDraftStations', resp.data).then(() => {
|
||||
this.loadInitData();
|
||||
if (this.loadRunPlanId) {
|
||||
this.myChart && this.myChart.showLoading();
|
||||
queryRunPlan(this.loadRunPlanId).then(rest => {
|
||||
this.$store.dispatch('runPlan/setDraftPlanData', rest.data).then(() => {
|
||||
this.analyticalServiceNumber(this.$store.state.runPlan.draftEditData);
|
||||
this.loadChartData();
|
||||
this.myChart && this.myChart.hideLoading();
|
||||
if (/^\/plan\/usertool/.test(this.$route.fullPath)) {
|
||||
this.runplanLoading = true;
|
||||
getMapDetail(this.$route.query.mapId).then(response => {
|
||||
const res = response.data;
|
||||
const stationList = res.stationList.sort((a, b)=>{ return a.kmRange - b.kmRange; });
|
||||
this.$store.dispatch('runPlan/setStations', stationList).then(() => {
|
||||
this.loadInitData();
|
||||
if (this.planId || this.loadRunPlanId) {
|
||||
getRpDetailByUserMapId(this.planId || this.loadRunPlanId).then(rest => {
|
||||
this.$store.dispatch('runPlan/setPlanData', rest.data).then(() => {
|
||||
this.analyticalServiceNumber(this.$store.state.runPlan.editData);
|
||||
this.loadChartData();
|
||||
this.runplanLoading = false;
|
||||
});
|
||||
}).catch(() => {
|
||||
this.runplanLoading = false;
|
||||
this.$messageBox(this.$t('error.obtainOperationGraphFailed'));
|
||||
});
|
||||
}).catch(() => {
|
||||
this.myChart && this.myChart.hideLoading();
|
||||
this.$messageBox(this.$t('error.obtainOperationGraphFailed'));
|
||||
});
|
||||
} else {
|
||||
// this.clearCanvas();
|
||||
this.$store.dispatch('runPlan/setDraftPlanData', {serviceNumberDataList: []}).then(()=> {
|
||||
this.analyticalServiceNumber(this.$store.state.runPlan.draftEditData);
|
||||
this.loadChartData();
|
||||
this.myChart && this.myChart.hideLoading();
|
||||
});
|
||||
}
|
||||
}
|
||||
});
|
||||
// });
|
||||
});
|
||||
}).catch(() => {
|
||||
this.$messageBox(this.$t('tip.requestingStationDataFailed'));
|
||||
this.$store.dispatch('runPlan/setDraftStations', []);
|
||||
});
|
||||
} else {
|
||||
this.runplanLoading = true;
|
||||
getStationList(this.$route.query.mapId).then(resp => {
|
||||
this.$store.dispatch('runPlan/setStations', resp.data).then(() => {
|
||||
this.loadInitData();
|
||||
if (this.planId || this.loadRunPlanId) {
|
||||
queryRunPlan(this.planId || this.loadRunPlanId).then(rest => {
|
||||
this.$store.dispatch('runPlan/setPlanData', rest.data).then(() => {
|
||||
this.analyticalServiceNumber(this.$store.state.runPlan.editData);
|
||||
this.loadChartData();
|
||||
this.runplanLoading = false;
|
||||
});
|
||||
}).catch(() => {
|
||||
this.runplanLoading = false;
|
||||
this.$messageBox(this.$t('error.obtainOperationGraphFailed'));
|
||||
});
|
||||
|
||||
} else {
|
||||
this.clearCanvas();
|
||||
}
|
||||
});
|
||||
}).catch(() => {
|
||||
this.$messageBox(this.$t('tip.requestingStationDataFailed'));
|
||||
this.$store.dispatch('runPlan/setStations', []);
|
||||
});
|
||||
}
|
||||
// getStationList(this.$route.query.mapId).then(resp => {
|
||||
// this.$store.dispatch('runPlan/setStations', resp.data).then(() => {
|
||||
// this.loadInitData();
|
||||
// if (this.planId) {
|
||||
// this.myChart && this.myChart.showLoading();
|
||||
// if (/^\/plan\/usertool/.test(this.$route.fullPath)) {
|
||||
// getRpDetailByUserMapId(this.planId).then(rest => {
|
||||
// this.$store.dispatch('runPlan/setPlanData', rest.data).then(() => {
|
||||
// this.analyticalServiceNumber(this.$store.state.runPlan.editData);
|
||||
// this.loadChartData();
|
||||
// this.myChart && this.myChart.hideLoading();
|
||||
// });
|
||||
// }).catch(() => {
|
||||
// this.myChart && this.myChart.hideLoading();
|
||||
// this.$messageBox(this.$t('error.obtainOperationGraphFailed'));
|
||||
// });
|
||||
// } else {
|
||||
// queryRunPlan(this.planId).then(rest => {
|
||||
// this.$store.dispatch('runPlan/setPlanData', rest.data).then(() => {
|
||||
// this.analyticalServiceNumber(this.$store.state.runPlan.editData);
|
||||
// this.loadChartData();
|
||||
// this.myChart && this.myChart.hideLoading();
|
||||
// });
|
||||
// }).catch(() => {
|
||||
// this.myChart && this.myChart.hideLoading();
|
||||
// this.$messageBox(this.$t('error.obtainOperationGraphFailed'));
|
||||
// });
|
||||
// }
|
||||
|
||||
// } else {
|
||||
// this.clearCanvas();
|
||||
// }
|
||||
// });
|
||||
// }).catch(() => {
|
||||
// this.$messageBox(this.$t('tip.requestingStationDataFailed'));
|
||||
// this.$store.dispatch('runPlan/setStations', []);
|
||||
// });
|
||||
}
|
||||
// });
|
||||
});
|
||||
} catch (error) {
|
||||
this.$messageBox(this.$t('error.loadingOperationGraphFailed'));
|
||||
@ -433,8 +511,9 @@ export default {
|
||||
},
|
||||
async loadChartData() {
|
||||
try {
|
||||
const stations = this.$store.state.runPlan.draftStations;
|
||||
const planData = this.$store.state.runPlan.draftPlanData;
|
||||
// let option={};
|
||||
const stations = this.$store.state.runPlan.stations;
|
||||
const planData = this.$store.state.runPlan.planData;
|
||||
this.stationsObj = {};
|
||||
stations.forEach(item => {
|
||||
this.stationsObj[Math.floor(item.kmRange)] = item;
|
||||
@ -443,9 +522,9 @@ export default {
|
||||
this.viewDisabled = true;
|
||||
|
||||
this.option.series = [];
|
||||
this.kmRangeCoordMap = this.planConvert.convertStationsToMap(stations);
|
||||
this.pushModels(this.option.series, [this.planConvert.initializeYaxis(this.draftStations)]);
|
||||
this.pushModels(this.option.series, this.planConvert.convertDataToModels(planData, stations, this.kmRangeCoordMap, { width: 0.5, color: '#000' }));
|
||||
const kmRangeCoordMap = this.planConvert.convertStationsToMap(stations);
|
||||
this.pushModels(this.option.series, [this.planConvert.initializeYaxis(this.stations)]);
|
||||
this.pushModels(this.option.series, this.planConvert.convertDataToModels(planData, stations, kmRangeCoordMap, { width: 0.5, color: '#000' }));
|
||||
await this.loadInitChart();
|
||||
|
||||
this.viewDisabled = false;
|
||||
@ -467,7 +546,6 @@ export default {
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
return series;
|
||||
},
|
||||
popModels(series, models) {
|
||||
@ -479,7 +557,6 @@ export default {
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
return series;
|
||||
},
|
||||
loadInitChart() {
|
||||
@ -488,8 +565,11 @@ export default {
|
||||
if (this.myChart && this.myChart.isDisposed) {
|
||||
this.myChart.clear();
|
||||
}
|
||||
this.option.title.text = this.loadRunPlanName;
|
||||
if (this.$route.query.planName || this.$route.query.prdType === '05') {
|
||||
this.option.title.text = this.mapName;
|
||||
}
|
||||
this.myChart = echarts.init(document.getElementById(this.runPlanId));
|
||||
// this.option;
|
||||
this.myChart.setOption(this.option);
|
||||
this.reSize({ width: this.$store.state.runPlan.width, height: this.$store.state.runPlan.height });
|
||||
resolve(true);
|
||||
@ -498,19 +578,31 @@ export default {
|
||||
}
|
||||
});
|
||||
},
|
||||
refreshRunPlanName(name) {
|
||||
getPublishMapInfo(this.$route.query.mapId).then(resp => {
|
||||
this.mapName = `${resp.data.name} (${name})`;
|
||||
this.myChart.setOption({
|
||||
title: {
|
||||
text: this.mapName,
|
||||
left: 'center', // 居中对齐
|
||||
top: '10px'
|
||||
}
|
||||
});
|
||||
});
|
||||
},
|
||||
clearCanvas() {
|
||||
this.option.series = [];
|
||||
this.option.title.text = '';
|
||||
if (this.myChart) {
|
||||
this.myChart.clear();
|
||||
}
|
||||
this.myChart && this.myChart.setOption(this.option);
|
||||
this.myChart.setOption(this.option);
|
||||
},
|
||||
xAxisPointFormat(params) {
|
||||
return timeFormat(params.value);
|
||||
},
|
||||
yAxisPointFormat(params) {
|
||||
return this.planConvert.computedFormatYAxis(this.draftStations, params);
|
||||
return this.planConvert.computedFormatYAxis(this.stations, params);
|
||||
},
|
||||
xAxisLableFormat(value, index) {
|
||||
if (value % 60 === 0) {
|
||||
@ -540,16 +632,16 @@ export default {
|
||||
},
|
||||
yAxisInit() {
|
||||
if (Object.keys(this.planConvert).length) {
|
||||
this.pushModels(this.option.series, [this.planConvert.initializeYaxis(this.draftStations)]);
|
||||
this.option.yAxis.min = this.planConvert.computedYaxisMinValue(this.draftStations);
|
||||
this.option.yAxis.max = this.planConvert.computedYaxisMaxValue(this.draftStations);
|
||||
this.pushModels(this.option.series, [this.planConvert.initializeYaxis(this.stations)]);
|
||||
this.option.yAxis.min = this.planConvert.computedYaxisMinValue(this.stations);
|
||||
this.option.yAxis.max = this.planConvert.computedYaxisMaxValue(this.stations);
|
||||
}
|
||||
},
|
||||
axisTooltip(param) {
|
||||
let data = '';
|
||||
const arr = [];
|
||||
param.forEach(item => {
|
||||
const station = this.$store.getters['map/getDeviceByCode'](item.data[2]);
|
||||
const station = this.stationsObj[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]}`);
|
||||
if (this.$route.query.lineCode == '06' || this.$route.query.lineCode == '08') {
|
||||
@ -591,7 +683,7 @@ export default {
|
||||
// }
|
||||
// });
|
||||
// this.myChart.setOption(op);
|
||||
// this.$store.dispatch('runPlan/setDraftSelected', model);
|
||||
// this.$store.dispatch('runPlan/setSelected', model);
|
||||
// },
|
||||
reSize(opt) {
|
||||
if (this.myChart) {
|
||||
@ -607,13 +699,13 @@ export default {
|
||||
this.myChart.dispose();
|
||||
this.myChart = null;
|
||||
}
|
||||
},
|
||||
scheduleTouch() {
|
||||
|
||||
},
|
||||
trainNumTouch() {
|
||||
|
||||
}
|
||||
// scheduleTouch() {
|
||||
|
||||
// },
|
||||
// trainNumTouch() {
|
||||
|
||||
// }
|
||||
}
|
||||
};
|
||||
</script>
|
||||
|
@ -1,11 +1,9 @@
|
||||
<template>
|
||||
<div class="PlanStatusBar">
|
||||
<ul class="ul-box">
|
||||
<!-- v-if="isNotUser" -->
|
||||
<!-- v-if="isNotUser" -->
|
||||
<div class="li_plan" @click="showTrain">{{ $t('planMonitor.serviceAndTripNumber') }}</div>
|
||||
<div class="li_plan" @click="handleGernaratePlanningTrain">{{ $t('planMonitor.gerneratePlan') }}</div>
|
||||
|
||||
<!-- <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="handleMovePlanningTrain">移动计划</div>
|
||||
@ -14,19 +12,18 @@
|
||||
<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="handleClearData">清除数据</div>
|
||||
<!-- </ul> -->
|
||||
</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="handleTestRunPlan">{{ $t('planMonitor.testRunning') }}</div>
|
||||
</ul>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import { planEffectiveCheck, clearPlaningData } from '@/api/runplan';
|
||||
// import { launchFullscreen } from '@/utils/screen';
|
||||
// import { UrlConfig } from '@/scripts/ConstDic';
|
||||
import { planEffectiveCheck, runPlanNotify, clearPlaningData } from '@/api/runplan';
|
||||
import { launchFullscreen } from '@/utils/screen';
|
||||
import { UrlConfig } from '@/scripts/ConstDic';
|
||||
|
||||
export default {
|
||||
name: 'PlanStatusBar',
|
||||
@ -46,28 +43,37 @@ export default {
|
||||
watch: {
|
||||
|
||||
},
|
||||
// created() {
|
||||
// if (/^\/plan\/usertool/.test(this.$route.fullPath)) {
|
||||
// this.isNotUser = false;
|
||||
// } else {
|
||||
// this.isNotUser = true;
|
||||
// }
|
||||
// },
|
||||
created() {
|
||||
// if (/^\/plan\/usertool/.test(this.$route.fullPath)) {
|
||||
// this.isNotUser = false;
|
||||
// } else {
|
||||
// this.isNotUser = true;
|
||||
// }
|
||||
},
|
||||
methods: {
|
||||
showTrain() {
|
||||
this.$emit('showTrain');
|
||||
},
|
||||
// 添加计划
|
||||
handleAddPlanningTrain() {
|
||||
if (this.loadRunPlanId) {
|
||||
const planId = this.$route.query.planId || this.loadRunPlanId;
|
||||
if (planId) {
|
||||
this.$emit('dispatchDialog', { name: 'addPlanningTrain', params: {} });
|
||||
} else {
|
||||
this.$messageBox(this.$t('tip.selectARunGraphFirst'));
|
||||
}
|
||||
},
|
||||
handleGernaratePlanningTrain() {
|
||||
const planId = this.$route.query.planId || this.loadRunPlanId;
|
||||
if (planId) {
|
||||
this.$emit('dispatchDialog', { name: 'gernaratePlanTrain', params: {} });
|
||||
} else {
|
||||
this.$messageBox(this.$t('tip.selectARunGraphFirst'));
|
||||
}
|
||||
},
|
||||
// 删除计划
|
||||
handleDeletePlanningTrain() {
|
||||
const serviceNumber = this.$store.state.runPlan.draftSelected.serviceNumber;
|
||||
const serviceNumber = this.$store.state.runPlan.selected.serviceNumber;
|
||||
if (serviceNumber) {
|
||||
this.$emit('dispatchDialog', {
|
||||
name: 'offLine', params: {
|
||||
@ -83,26 +89,26 @@ export default {
|
||||
this.$messageBox(this.$t('tip.selectAPlan'));
|
||||
}
|
||||
},
|
||||
// 复制计划
|
||||
handleDuplicateTrain() {
|
||||
const serviceNumber = this.$store.state.runPlan.draftSelected.serviceNumber;
|
||||
if (serviceNumber) {
|
||||
this.$emit('dispatchDialog', { name: 'duplicateTrain', params: { serviceNumber } });
|
||||
} else {
|
||||
this.$messageBox(this.$t('tip.selectAPlan'));
|
||||
}
|
||||
},
|
||||
handleMovePlanningTrain() {
|
||||
const serviceNumber = this.$store.state.runPlan.draftSelected.serviceNumber;
|
||||
const serviceNumber = this.$store.state.runPlan.selected.serviceNumber;
|
||||
if (serviceNumber) {
|
||||
this.$emit('dispatchDialog', { name: 'movePlaningTrain', params: { serviceNumber } });
|
||||
} else {
|
||||
this.$messageBox(this.$t('tip.selectAPlan'));
|
||||
}
|
||||
},
|
||||
// 复制计划
|
||||
handleDuplicateTrain() {
|
||||
const serviceNumber = this.$store.state.runPlan.selected.serviceNumber;
|
||||
if (serviceNumber) {
|
||||
this.$emit('dispatchDialog', { name: 'duplicateTrain', params: { serviceNumber } });
|
||||
} else {
|
||||
this.$messageBox(this.$t('tip.selectAPlan'));
|
||||
}
|
||||
},
|
||||
// 添加任务
|
||||
handleAddTask() {
|
||||
const params = this.$store.state.runPlan.draftSelected;
|
||||
const params = this.$store.state.runPlan.selected;
|
||||
if (params.serviceNumber && params.tripNumber) {
|
||||
this.$emit('dispatchDialog', { name: 'addTask', params });
|
||||
} else {
|
||||
@ -111,13 +117,22 @@ export default {
|
||||
},
|
||||
// 删除任务
|
||||
handleDeleteTask() {
|
||||
const params = this.$store.state.runPlan.draftSelected;
|
||||
const params = this.$store.state.runPlan.selected;
|
||||
if (params.serviceNumber && params.tripNumber) {
|
||||
this.$emit('dispatchDialog', { name: 'deleteTask', params });
|
||||
} else {
|
||||
this.$messageBox(this.$t('tip.selectATrain'));
|
||||
}
|
||||
},
|
||||
// 修改任务
|
||||
handleModifyingTask() {
|
||||
const params = this.$store.state.runPlan.selected;
|
||||
if (params.serviceNumber && params.tripNumber) {
|
||||
this.$emit('dispatchDialog', { name: 'modifyingTask', params });
|
||||
} else {
|
||||
this.$messageBox(this.$t('tip.selectATrain'));
|
||||
}
|
||||
},
|
||||
// 清除数据
|
||||
handleClearData() {
|
||||
this.$confirm('本操作将清除本运行图数据!', '提示', {
|
||||
@ -125,9 +140,9 @@ export default {
|
||||
cancelButtonText: '取消',
|
||||
center: true
|
||||
}).then(() => {
|
||||
clearPlaningData(this.loadRunPlanId).then(resp => {
|
||||
clearPlaningData(this.$route.query.planId).then(resp => {
|
||||
console.log('清除数据成功!');
|
||||
this.$emit('refresh', this.loadRunPlanId);
|
||||
this.$emit('refresh');
|
||||
}).catch(() => {
|
||||
this.$message.error('清除数据失败!');
|
||||
});
|
||||
@ -135,23 +150,14 @@ export default {
|
||||
console.error('清除数据失败!');
|
||||
});
|
||||
},
|
||||
// 修改任务
|
||||
handleModifyingTask() {
|
||||
const params = this.$store.state.runPlan.draftSelected;
|
||||
if (params.serviceNumber && params.tripNumber) {
|
||||
this.$emit('dispatchDialog', { name: 'modifyingTask', params });
|
||||
} else {
|
||||
this.$messageBox(this.$t('tip.selectATrain'));
|
||||
}
|
||||
},
|
||||
|
||||
// 校验运行图
|
||||
handlePlanEffectiveCheck() {
|
||||
if (this.loadRunPlanId) {
|
||||
const planId = this.$route.query.planId;
|
||||
if (planId) {
|
||||
if (/^\/plan\/usertool/.test(this.$route.fullPath)) {
|
||||
this.$messageBox(' 功能待完善');
|
||||
} else {
|
||||
planEffectiveCheck(this.loadRunPlanId).then(resp => {
|
||||
planEffectiveCheck(planId).then(resp => {
|
||||
this.$emit('dispatchDialog', {
|
||||
name: 'systermOut',
|
||||
params: {
|
||||
@ -163,39 +169,34 @@ export default {
|
||||
this.$messageBox(error.message + ' ' + this.$t('tip.runGraphVerificationFailed'));
|
||||
});
|
||||
}
|
||||
|
||||
} else {
|
||||
this.$messageBox(this.$t('tip.selectARunGraphFirst'));
|
||||
}
|
||||
},
|
||||
handleGernaratePlanningTrain() {
|
||||
const planId = this.$route.query.planId || this.loadRunPlanId;
|
||||
if (planId) {
|
||||
this.$emit('dispatchDialog', { name: 'gernaratePlanTrain', params: {} });
|
||||
} else {
|
||||
this.$messageBox(this.$t('tip.selectARunGraphFirst'));
|
||||
}
|
||||
}
|
||||
// 测试运行图
|
||||
// async handleTestRunPlan() {
|
||||
// const data = { planId: this.$route.query.planId };
|
||||
// if (/^\/plan\/usertool/.test(this.$route.fullPath)) {
|
||||
// this.$messageBox(' 功能待完善');
|
||||
// } else {
|
||||
// runPlanNotify(data).then(resp => {
|
||||
// if (resp.data) {
|
||||
// const query = {
|
||||
// prdType: '01', group: resp.data, mapId: this.$route.query.mapId, planId: this.$route.query.planId
|
||||
// };
|
||||
// this.$router.push({ path: `${UrlConfig.display}/plan`, query: query });
|
||||
// launchFullscreen();
|
||||
// } else {
|
||||
// this.$messageBox(this.$t('error.checkTheValidityFirst'));
|
||||
// }
|
||||
// }).catch(error => {
|
||||
// this.$messageBox(this.$t('tip.createSimulationFaild') + this.$t('global.colon') + error.message);
|
||||
// });
|
||||
// }
|
||||
// }
|
||||
async handleTestRunPlan() {
|
||||
const data = { planId: this.$route.query.planId };
|
||||
if (/^\/plan\/usertool/.test(this.$route.fullPath)) {
|
||||
this.$messageBox(' 功能待完善');
|
||||
} else {
|
||||
runPlanNotify(data).then(resp => {
|
||||
if (resp.data) {
|
||||
const query = {
|
||||
prdType: '01', group: resp.data, mapId: this.$route.query.mapId, planId: this.$route.query.planId
|
||||
};
|
||||
// this.$router.push({ path: `${UrlConfig.display}/plan`, query: query });
|
||||
this.$router.push({ path: UrlConfig.design.testRunPlan, query: query });
|
||||
launchFullscreen();
|
||||
} else {
|
||||
this.$messageBox(this.$t('error.checkTheValidityFirst'));
|
||||
}
|
||||
}).catch(error => {
|
||||
this.$messageBox(this.$t('tip.createSimulationFaild') + this.$t('global.colon') + error.message);
|
||||
});
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
};
|
||||
</script>
|
||||
|
Loading…
Reference in New Issue
Block a user