大铁项目 增加 批量修改股道指令 代码调整
This commit is contained in:
parent
ffcd9faab8
commit
3167b551b9
@ -538,6 +538,11 @@ export const menuOperate = {
|
||||
modifyTrackSection:{
|
||||
operation: OperationEvent.CTCCommand.modifyTrackSection.menu.operation,
|
||||
cmdType: CMD.CTC.CTC_MODIFY_TRACK_SECTION
|
||||
},
|
||||
// 批量修改股道
|
||||
batchModifyTrackSection:{
|
||||
operation: OperationEvent.CTCCommand.batchModifyTrackSection.menu.operation,
|
||||
cmdType: CMD.CTC.CTC_BATCH_MODIFY_RUN_PLAN
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -135,9 +135,7 @@ export default {
|
||||
tableData2:[],
|
||||
addModel:{
|
||||
stationCode:'',
|
||||
runPlanCode:'',
|
||||
arriveSectionCode:'',
|
||||
departSectionCode:'',
|
||||
planParamList:[],
|
||||
force:1
|
||||
}
|
||||
};
|
||||
@ -158,6 +156,7 @@ export default {
|
||||
},
|
||||
methods:{
|
||||
doShow(tableData, activeDepartRunPlan, activeArriveRunPlan, filterSectionList) {
|
||||
this.tableData1 = [];
|
||||
tableData.forEach(element => {
|
||||
if (element.arriveRunPlan && element.arriveRunPlan.sectionCode) {
|
||||
const sectionObj = filterSectionList.find(section=>{ return section.code == element.arriveRunPlan.sectionCode; }) || {name:''};
|
||||
@ -173,15 +172,21 @@ export default {
|
||||
this.addModel.stationCode = this.$store.state.training.roleDeviceCode;
|
||||
const activeDepartRunPlanList = Object.values(activeDepartRunPlan).filter(activeDepart=>{ return activeDepart.changeSectionCode && activeDepart.changeSectionCode != activeDepart.sectionCode; });
|
||||
if (activeDepartRunPlanList.length > 0) {
|
||||
const depart = activeDepartRunPlanList[0];
|
||||
this.addModel.runPlanCode = depart.code;
|
||||
this.addModel.departSectionCode = depart.changeSectionCode;
|
||||
activeDepartRunPlanList.forEach(depart=>{
|
||||
this.addModel.planParamList.push({
|
||||
runPlanCode:depart.code,
|
||||
departSectionCode:depart.changeSectionCode
|
||||
});
|
||||
});
|
||||
}
|
||||
const activeArriveRunPlanList = Object.values(activeArriveRunPlan).filter(activeArrive=>{ return activeArrive.changeSectionCode && activeArrive.changeSectionCode != activeArrive.sectionCode; });
|
||||
if (activeArriveRunPlanList.length > 0) {
|
||||
const arrive = activeArriveRunPlanList[0];
|
||||
this.addModel.runPlanCode = arrive.code;
|
||||
this.addModel.arriveSectionCode = arrive.changeSectionCode;
|
||||
activeArriveRunPlanList.forEach(arrive=>{
|
||||
this.addModel.planParamList.push({
|
||||
runPlanCode:arrive.code,
|
||||
arriveSectionCode:arrive.changeSectionCode
|
||||
});
|
||||
});
|
||||
}
|
||||
this.dialogShow = true;
|
||||
this.$nextTick(function () {
|
||||
@ -194,14 +199,13 @@ export default {
|
||||
this.$store.dispatch('training/emitTipFresh');
|
||||
},
|
||||
commit() {
|
||||
if (this.addModel.runPlanCode) {
|
||||
// CTC_MODIFY_TRACK_SECTION
|
||||
if (this.addModel.planParamList.length > 0) {
|
||||
const params = this.addModel;
|
||||
this.loading = true;
|
||||
commitOperate(menuOperate.CTC.modifyTrackSection, params, 3).then(({valid})=>{
|
||||
commitOperate(menuOperate.CTC.batchModifyTrackSection, params, 3).then(({valid})=>{
|
||||
this.loading = false;
|
||||
if (valid) {
|
||||
this.$emit('closeDialog');
|
||||
this.$emit('closeFlash');
|
||||
this.doClose();
|
||||
}
|
||||
}).catch(() => {
|
||||
|
@ -75,8 +75,11 @@
|
||||
:data="tableData"
|
||||
border
|
||||
height="695"
|
||||
highlight-current-row
|
||||
style="width: 100%;border:1px #ccc solid"
|
||||
@cell-click="selectedTripNumber"
|
||||
>
|
||||
<!-- @row-click="selected" -->
|
||||
<el-table-column
|
||||
prop="tripNumber"
|
||||
label=""
|
||||
@ -439,7 +442,8 @@
|
||||
</div>
|
||||
|
||||
</div>
|
||||
<send-runplan ref="sendRunplan" @closeDialog="closeDialog" />
|
||||
<send-runplan ref="sendRunplan" @closeFlash="closeFlash" />
|
||||
<!-- -->
|
||||
</div>
|
||||
</template>
|
||||
<script>
|
||||
@ -480,7 +484,9 @@ export default {
|
||||
tableData:[],
|
||||
filterSectionList:[],
|
||||
activeDepartRunPlan:{},
|
||||
activeArriveRunPlan:{}
|
||||
activeArriveRunPlan:{},
|
||||
// radioSelected:''
|
||||
currentRow:null
|
||||
};
|
||||
},
|
||||
computed: {
|
||||
@ -501,7 +507,7 @@ export default {
|
||||
this.filterSectionList = this.sectionList.filter(section=>{
|
||||
return section.standTrack && section.belongStation == this.$store.state.training.roleDeviceCode;
|
||||
});
|
||||
const railCtcRunplanInitMsg = this.$store.state.socket.railCtcRunplanInitMsg;
|
||||
const railCtcRunplanInitMsg = JSON.parse(JSON.stringify(this.$store.state.socket.railCtcRunplanInitMsg));
|
||||
this.tableData = Object.values(railCtcRunplanInitMsg).filter(data=>{
|
||||
if (data.departRunPlan) {
|
||||
data.departRunPlan.planTime = data.departRunPlan.planTime.split(':').splice(0, 2).join(':');
|
||||
@ -560,9 +566,17 @@ export default {
|
||||
// * @param force 是否强制 0:不强制。1:强制
|
||||
},
|
||||
closeDialog() {
|
||||
this.closeFlash();
|
||||
this.doClose();
|
||||
},
|
||||
closeFlash() {
|
||||
const sendRunplan = document.getElementById('sendRunplan').className;
|
||||
document.getElementById('sendRunplan').className = sendRunplan.replace('active', '');
|
||||
this.doClose();
|
||||
},
|
||||
selectedTripNumber(row, column, cell, event) {
|
||||
// if (column.property == 'tripNumber') {
|
||||
// this.$refs.singleTable.setCurrentRow(row);
|
||||
// }
|
||||
}
|
||||
}
|
||||
};
|
||||
|
@ -389,6 +389,7 @@ export default {
|
||||
CTC_ASSIST_PRESS_BLOCK:{value: 'ASSIST_PRESS_BLOCK', label: '阻塞'},
|
||||
CTC_ASSIST_PRESS_RESTORE:{value: 'ASSIST_PRESS_RESTORE', label: '复原'},
|
||||
CTC_ASSIST_PRESS_ACCIDENT:{value: 'ASSIST_PRESS_ACCIDENT', label: '事故'},
|
||||
CTC_MODIFY_TRACK_SECTION:{value: 'CTC_MODIFY_TRACK_SECTION', label: '修改股道'}
|
||||
CTC_MODIFY_TRACK_SECTION:{value: 'CTC_MODIFY_TRACK_SECTION', label: '修改股道'},
|
||||
CTC_BATCH_MODIFY_RUN_PLAN:{value: 'CTC_BATCH_MODIFY_RUN_PLAN', label: '批量修改股道'}
|
||||
}
|
||||
};
|
||||
|
@ -3672,6 +3672,12 @@ export const OperationEvent = {
|
||||
operation: '1110',
|
||||
domId: '_Tips-CTC-modifyTrackSection-Menu{TOP}'
|
||||
}
|
||||
},
|
||||
batchModifyTrackSection:{
|
||||
menu: {
|
||||
operation: '1111',
|
||||
domId: '_Tips-CTC-batchModifyTrackSection-Menu{TOP}'
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -1,4 +1,5 @@
|
||||
import store from '@/store/index';
|
||||
import { copyAssign } from '@/utils/index';
|
||||
import { Notification } from 'element-ui';
|
||||
|
||||
function handleSockInfo(state, msg, type) {
|
||||
@ -211,6 +212,11 @@ function handle(state, data) {
|
||||
state.railCtcRunplanInitMsg[element.code] = element;
|
||||
});
|
||||
break;
|
||||
case 'SIMULATION_CTC_RUN_PLAN_CHANGE':
|
||||
msg.forEach(element => {
|
||||
state.railCtcRunplanInitMsg[element.code] = copyAssign(state.railCtcRunplanInitMsg[element.code], element);
|
||||
});
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -185,6 +185,18 @@ export function segmentsIntr(a, b, c, d) {
|
||||
return { x: a.x + dx, y: a.y + dy };
|
||||
}
|
||||
|
||||
export function copyAssign(...param) {
|
||||
const result = Object.assign({}, ...param);
|
||||
for (const item of param) {
|
||||
for (const [idx, val] of Object.entries(item)) {
|
||||
if (typeof val === 'object') {
|
||||
result[idx] = copyAssign(result[idx], val);
|
||||
}
|
||||
}
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
// export function deepAssign(obj, item) {
|
||||
// function * colneData(item) {
|
||||
// for (const keys in item) {
|
||||
|
Loading…
Reference in New Issue
Block a user