This commit is contained in:
zyy 2020-06-16 15:02:00 +08:00
commit 53823aea04
7 changed files with 211 additions and 306 deletions

View File

@ -296,7 +296,7 @@ export default {
this.timer = null; this.timer = null;
}, },
methods: { methods: {
doShow(operate, selected, tempData) { doShow(operate, selected) {
if (!this.dialogShow) { if (!this.dialogShow) {
this.name = ''; this.name = '';
this.stationName = ''; this.stationName = '';

View File

@ -302,7 +302,7 @@ export default {
}, },
commandNoPopUp() { commandNoPopUp() {
const operate = { const operate = {
operation: ''
}; };
if (this.operation == OperationEvent.Switch.unlock.menu.operation) { if (this.operation == OperationEvent.Switch.unlock.menu.operation) {
@ -321,7 +321,7 @@ export default {
this.setMessage(this.$t('tip.firstConfirmTip')); this.setMessage(this.$t('tip.firstConfirmTip'));
this.writeRecord({ order: ++this.order, date: now(), context: this.$t('menu.clickReleaseCommand'), result: '' }); this.writeRecord({ order: ++this.order, date: now(), context: this.$t('menu.clickReleaseCommand'), result: '' });
this.$store.dispatch('training/next', operate).then(({ valid }) => { this.$store.dispatch('training/nextNew', operate).then(({ valid }) => {
if (valid) { if (valid) {
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true }); this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
this.setButtonEnable({ step: 1 }); this.setButtonEnable({ step: 1 });
@ -335,7 +335,7 @@ export default {
}, },
confirm1() { confirm1() {
const operate = { const operate = {
operation: ''
}; };
if (this.operation == OperationEvent.Switch.unlock.menu.operation) { if (this.operation == OperationEvent.Switch.unlock.menu.operation) {
@ -354,7 +354,7 @@ export default {
this.setMessage(this.$t('tip.secondConfirmTip')); this.setMessage(this.$t('tip.secondConfirmTip'));
this.writeRecord({ order: ++this.order, date: now(), context: this.$t('menu.clickFirstConfirm'), result: '' }); this.writeRecord({ order: ++this.order, date: now(), context: this.$t('menu.clickFirstConfirm'), result: '' });
this.$store.dispatch('training/next', operate).then(({ valid }) => { this.$store.dispatch('training/nextNew', operate).then(({ valid }) => {
if (valid) { if (valid) {
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true }); this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
this.timeCountCommand = -1; this.timeCountCommand = -1;
@ -392,7 +392,7 @@ export default {
} }
this.setMessage(''); this.setMessage('');
this.writeRecord({ order: ++this.order, date: now(), context: this.$t('menu.clickSecondConfirm'), result: '' }); this.writeRecord({ order: ++this.order, date: now(), context: this.$t('menu.clickSecondConfirm'), result: '' });
this.$store.dispatch('training/next', operate).then(({ valid }) => { this.$store.dispatch('training/nextNew', operate).then(({ valid }) => {
this.timeCountCommand = -1; this.timeCountCommand = -1;
this.timeCountConfirm = -1; this.timeCountConfirm = -1;
this.setButtonEnable({ step: -1 }); this.setButtonEnable({ step: -1 });
@ -428,7 +428,7 @@ export default {
} }
this.writeRecord({ order: ++this.order, date: now(), context: this.$t('menu.clickSuspend'), result: '' }); this.writeRecord({ order: ++this.order, date: now(), context: this.$t('menu.clickSuspend'), result: '' });
this.$store.dispatch('training/next', operate).then(({ valid }) => { this.$store.dispatch('training/nextNew', operate).then(({ valid }) => {
if (valid) { if (valid) {
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true }); this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
this.setButtonEnable({ step: 0 }); this.setButtonEnable({ step: 0 });
@ -444,8 +444,7 @@ export default {
const operate = { const operate = {
operation: OperationEvent.Command.close.menu.operation operation: OperationEvent.Command.close.menu.operation
}; };
this.$store.dispatch('training/nextNew', operate).then(({ valid }) => {
this.$store.dispatch('training/next', operate).then(({ valid }) => {
if (valid) { if (valid) {
this.doClose(); this.doClose();
} }

View File

@ -49,6 +49,7 @@ import { OperationEvent } from '@/scripts/cmdPlugin/OperationHandler';
import OperationHandler from '@/scripts/cmdPlugin/OperationHandler'; import OperationHandler from '@/scripts/cmdPlugin/OperationHandler';
import NoticeInfo from './childDialog/childDialog/noticeInfo'; import NoticeInfo from './childDialog/childDialog/noticeInfo';
import CMD from '@/scripts/cmdPlugin/CommandEnum'; import CMD from '@/scripts/cmdPlugin/CommandEnum';
import { menuOperate, commitOperate } from '../utils/menuOperate';
export default { export default {
name: 'SwitchControl', name: 'SwitchControl',
@ -153,133 +154,52 @@ export default {
}, },
// //
lock() { lock() {
const operate = { this.sendCommand(menuOperate.Switch.lock);
over: true,
operation: OperationEvent.Switch.lock.menu.operation,
cmdType: CMD.Switch.CMD_SWITCH_SINGLE_LOCK
};
this.loading = true;
this.$store.dispatch('training/next', operate).then(({ valid }) => {
this.loading = false;
if (valid) {
this.doClose();
}
}).catch(() => {
this.loading = false;
this.doClose();
this.$refs.noticeInfo.doShow(operate);
});
}, },
// //
block() { block() {
const operate = { this.sendCommand(menuOperate.Switch.block);
over: true,
operation: OperationEvent.Switch.block.menu.operation,
cmdType: CMD.Switch.CMD_SWITCH_BLOCK
};
this.loading = true;
this.$store.dispatch('training/next', operate).then(({ valid }) => {
this.loading = false;
if (valid) {
this.doClose();
}
}).catch(() => {
this.loading = false;
this.doClose();
this.$refs.noticeInfo.doShow(operate);
});
}, },
// //
turnout(operation) { turnout() {
const operate = { this.sendCommand(menuOperate.Switch.turnout);
over: true,
operation: OperationEvent.Switch.turnout.menu.operation,
cmdType: CMD.Switch.CMD_SWITCH_TURN
};
this.loading = true;
this.$store.dispatch('training/next', operate).then(({ valid }) => {
this.loading = false;
if (valid) {
this.doClose();
}
}).catch(() => {
this.loading = false;
this.doClose();
this.$refs.noticeInfo.doShow(operate);
});
}, },
// //
turnoutForce() { turnoutForce() {
const operate = { this.sendCommand(menuOperate.Switch.turnoutForce);
over: true,
operation: OperationEvent.Switch.turnoutForce.menu.operation,
cmdType: CMD.Switch.CMD_SWITCH_FORCE_TURN
};
this.loading = true;
this.$store.dispatch('training/next', operate).then(({ valid }) => {
this.loading = false;
if (valid) {
this.doClose();
}
}).catch(() => {
this.loading = false;
this.doClose();
this.$refs.noticeInfo.doShow(operate);
});
}, },
// //
split() { split() {
const operate = { this.sendCommand(menuOperate.Switch.split);
over: true,
operation: OperationEvent.Switch.split.menu.operation,
cmdType: CMD.Switch.CMD_SWITCH_CUT_OFF
};
this.loading = true;
this.$store.dispatch('training/next', operate).then(({ valid }) => {
this.loading = false;
if (valid) {
this.doClose();
}
}).catch(() => {
this.loading = false;
this.doClose();
this.$refs.noticeInfo.doShow(operate);
});
}, },
// //
active() { active() {
const operate = { this.sendCommand(menuOperate.Switch.active);
over: true,
operation: OperationEvent.Switch.active.menu.operation,
cmdType: CMD.Switch.CMD_SWITCH_ACTIVE
};
this.loading = true;
this.$store.dispatch('training/next', operate).then(({ valid }) => {
this.loading = false;
if (valid) {
this.doClose();
}
}).catch(() => {
this.loading = false;
this.doClose();
this.$refs.noticeInfo.doShow(operate);
});
}, },
cancel() { cancel() {
const operate = { const operate = {
operation: OperationEvent.Command.cancel.menu.operation operation: OperationEvent.Command.cancel.menu.operation
}; };
this.$store.dispatch('training/nextNew', operate).then(({ valid }) => {
this.$store.dispatch('training/next', operate).then(({ valid }) => {
if (valid) { if (valid) {
this.doClose(); this.doClose();
} }
}).catch(() => { }).catch(() => {
this.doClose(); this.doClose();
}); });
},
sendCommand(operate) { //
this.loading = true;
commitOperate(operate, {}, 2).then(({valid})=>{
this.loading = false;
if (valid) {
this.doClose();
}
}).catch((error) => {
this.loading = false;
this.doClose();
this.$refs.noticeInfo.doShow(error.message);
});
} }
} }
}; };

View File

@ -17,42 +17,41 @@
/> />
</el-select> </el-select>
</el-form-item> </el-form-item>
<el-form-item prop="trainType" label-width="0px"> <el-form-item prop="type" label-width="0px">
<el-radio-group <el-radio-group
:id="domIdTrainType" :id="domIdTrainType"
v-model="formModel.trainType" v-model="formModel.type"
style="margin-left: 15px;" style="margin-left: 45px;"
@change="trainTypeChange" @change="trainTypeChange"
> >
<el-radio :label="'01'">{{ $t('menu.planTrain') }}</el-radio> <el-radio :label="'PLAN'">{{ $t('menu.planTrain') }}</el-radio>
<el-radio :label="'02'">{{ $t('menu.headCodeTrain') }}</el-radio> <el-radio :label="'HEAD'">{{ $t('menu.headCodeTrain') }}</el-radio>
<el-radio :label="'03'" style="margin-top:5px;">{{ $t('menu.artificialTrain') }}</el-radio> <el-radio :label="'MANUAL'" style="margin-top:5px;">{{ $t('menu.artificialTrain') }}</el-radio>
</el-radio-group> </el-radio-group>
</el-form-item> </el-form-item>
<el-form-item v-if="formModel.trainType == '01'" prop="serviceNumber"> <el-form-item v-if="formModel.type == 'PLAN'|| formModel.type == 'HEAD'" prop="serviceNumber">
<span slot="label">{{ $t('menu.serviceNumber') }}</span> <span slot="label">{{ $t('menu.serviceNumber') + '' }}</span>
<el-input <el-input
:id="domIdServerNo" :id="domIdServerNo"
v-model="formModel.serviceNumber" v-model="formModel.serviceNumber"
:disabled="serverNoIsDisabled" :disabled="serverNoIsDisabled"
/> />
</el-form-item> </el-form-item>
<el-form-item v-if="formModel.trainType == '01'" :label="this.$t('menu.tripNumber')+this.$t('global.colon')" prop="tripNumber"> <el-form-item v-if="formModel.type == 'PLAN'" :label="this.$t('menu.tripNumber')+this.$t('global.colon')" prop="tripNumber">
<el-input <el-input
:id="domIdTrainNo" :id="domIdTrainNo"
v-model="formModel.tripNumber" v-model="formModel.tripNumber"
:disabled="trainNoIsDisabled"
maxlength="4" maxlength="4"
/> />
</el-form-item> </el-form-item>
<el-form-item v-if="formModel.trainType == '01'" :label="this.$t('menu.targetCode')+this.$t('global.colon')" prop="targetCode"> <el-form-item v-if="formModel.type == 'PLAN' || formModel.type == 'HEAD'" :label="this.$t('menu.targetCode')+this.$t('global.colon')" prop="destinationCode">
<el-input <el-input
:id="domIdTargetCode" :id="domIdTargetCode"
v-model="formModel.targetCode" v-model="formModel.destinationCode"
:disabled="targetCodeIsDisabled" :disabled="formModel.type !== 'HEAD'"
/> />
</el-form-item> </el-form-item>
<el-form-item v-if="formModel.trainType == '03'" :label="this.$t('menu.category')+this.$t('global.colon')" prop="category"> <el-form-item v-if="formModel.type == 'MANUAL'" :label="this.$t('menu.category')+this.$t('global.colon')" prop="category">
<el-select <el-select
:id="domIdTrainNumber" :id="domIdTrainNumber"
v-model="formModel.category" v-model="formModel.category"
@ -70,7 +69,7 @@
</el-form> </el-form>
<el-row justify="center" class="button-group"> <el-row justify="center" class="button-group">
<el-col :span="10" :offset="2"> <el-col :span="10" :offset="2">
<el-button :id="domIdConfirm" type="primary" :loading="loading" :disabled="istargetCode" @click="commit">{{ $t('global.confirm') }}</el-button> <el-button :id="domIdConfirm" type="primary" :loading="loading" @click="commit">{{ $t('global.confirm') }}</el-button>
</el-col> </el-col>
<el-col :span="8" :offset="4"> <el-col :span="8" :offset="4">
<el-button :id="domIdCancel" @click="cancel">{{ $t('global.cancel') }}</el-button> <el-button :id="domIdCancel" @click="cancel">{{ $t('global.cancel') }}</el-button>
@ -84,10 +83,11 @@
<script> <script>
import { mapGetters } from 'vuex'; import { mapGetters } from 'vuex';
import { OperationEvent } from '@/scripts/cmdPlugin/OperationHandler'; import { OperationEvent } from '@/scripts/cmdPlugin/OperationHandler';
import CMD from '@/scripts/cmdPlugin/CommandEnum';
import ConfirmTrain from './childDialog/confirmTrain'; import ConfirmTrain from './childDialog/confirmTrain';
import NoticeInfo from './childDialog/childDialog/noticeInfo'; import NoticeInfo from './childDialog/childDialog/noticeInfo';
import Handler from '@/scripts/cmdPlugin/Handler'; import Handler from '@/scripts/cmdPlugin/Handler';
import { menuOperate, commitOperate } from '../utils/menuOperate';
import {getTrainDetailBytripNumber} from '@/api/simulation';
export default { export default {
name: 'TrainControl', name: 'TrainControl',
@ -98,32 +98,29 @@ export default {
data() { data() {
return { return {
trainList: [], trainList: [],
categoryList: [ serviceNumber:'',
{ name: 'MM', value: '01' }
],
formModel: { formModel: {
tripNumber: '', tripNumber: '',
groupNumber: '', groupNumber: '',
trainType: '01', type: 'PLAN',
serviceNumber: '', serviceNumber: '',
targetCode: '', destinationCode: '',
category: 'MM' category: 'MM'
}, },
categoryList: [
{ name: 'MM', value: '01' }
],
rules: { rules: {
groupNumber: [ groupNumber: [
{ required: true, message: this.$t('rules.selectGroupNumber'), trigger: 'change' } { required: true, message: this.$t('rules.selectGroupNumber'), trigger: 'change' }
], ],
trainType: [ type: [
{ required: true, message: this.$t('rules.selectATrainType'), trigger: 'change' } { required: true, message: this.$t('rules.selectATrainType'), trigger: 'change' }
], ],
serviceNumber: [
{ required: true, message: this.$t('rules.enterTheServiceNumber'), trigger: 'blur' }
],
tripNumber: [ tripNumber: [
{ required: true, message: this.$t('rules.enterTheTripNumber'), trigger: 'blur' } { required: true, message: this.$t('rules.enterTheTripNumber'), trigger: 'blur' }
], ],
targetCode: [ destinationCode: [
{ required: true, message: this.$t('rules.enterTheTargetCode'), trigger: 'blur' } { required: true, message: this.$t('rules.enterTheTargetCode'), trigger: 'blur' }
] ]
}, },
@ -137,27 +134,15 @@ export default {
...mapGetters('map', [ ...mapGetters('map', [
'map' 'map'
]), ]),
trainNoIsDisabled() {
return false;
},
serverNoIsDisabled() { serverNoIsDisabled() {
return true; return true;
}, },
targetCodeIsDisabled() {
return true;
},
trainNumberIsDisabled() { trainNumberIsDisabled() {
if (this.operation != OperationEvent.Train.addTrainId.menu.operation) { if (this.operation != OperationEvent.Train.addTrainId.menu.operation) {
return true; return true;
} }
return ''; return '';
}, },
// trainTypeIsDisabled() {
// if (this.operation != OperationEvent.Train.addTrainId.menu.operation) {
// return true;
// }
// return '';
// },
show() { show() {
return this.dialogShow && !this.$store.state.menuOperation.break; return this.dialogShow && !this.$store.state.menuOperation.break;
}, },
@ -243,12 +228,6 @@ export default {
return this.$t('menu.menuTrain.editTrainId'); return this.$t('menu.menuTrain.editTrainId');
} }
return ''; return '';
},
istargetCode() {
if (this.formModel.serviceNumber && this.formModel.targetCode) {
return false;
}
return true;
} }
}, },
watch: { watch: {
@ -259,7 +238,7 @@ export default {
this.formModel = { this.formModel = {
groupNumber: this.formModel.groupNumber, groupNumber: this.formModel.groupNumber,
tripNumber: val, tripNumber: val,
trainType: this.formModel.trainType, type: this.formModel.type,
serviceNumber: '', serviceNumber: '',
targetCode: '', targetCode: '',
category: 'MM' category: 'MM'
@ -280,15 +259,15 @@ export default {
this.operation = operate.operation; this.operation = operate.operation;
} }
const model = this.$store.getters['map/getDeviceByCode'](selected.code); const model = this.$store.getters['map/getDeviceByCode'](selected.code);
this.serviceNumber = model.serviceNumber;
this.formModel = { this.formModel = {
groupNumber: model.groupNumber, groupNumber: model.groupNumber,
tripNumber: `${model.directionCode}${model.tripNumber}`, tripNumber: model.tripNumber,
trainType: model.type, type: model.type ? model.type : 'PLAN',
serviceNumber: model.serviceNumber, serviceNumber: model.serviceNumber,
targetCode: model.targetCode, destinationCode: model.destinationCode,
category: 'MM' category: 'MM'
}; };
/** 加载列车数据*/ /** 加载列车数据*/
this.loadInitData(this.map); this.loadInitData(this.map);
this.dialogShow = true; this.dialogShow = true;
@ -304,37 +283,37 @@ export default {
}, },
trainNumberChange(groupNumber) { trainNumberChange(groupNumber) {
const operate = { const operate = {
groupNumber: groupNumber,
val: `${groupNumber}`,
operation: '' operation: ''
}; };
if (this.operation == OperationEvent.Train.addTrainId.menu.operation) { if (this.operation == OperationEvent.Train.addTrainId.menu.operation) {
operate.operation = OperationEvent.Train.addTrainId.trainNumberChange.operation; operate.operation = OperationEvent.Train.addTrainId.trainNumberChange.operation;
} else if (this.operation == OperationEvent.Train.editTrainId.menu.operation) { } else if (this.operation == OperationEvent.Train.editTrainId.menu.operation) {
operate.operation = OperationEvent.Train.editTrainId.trainNumberChange.operation; operate.operation = OperationEvent.Train.editTrainId.trainNumberChange.operation;
} }
this.$store.dispatch('training/next', operate).then(({ valid }) => { this.$store.dispatch('training/nextNew', operate).then(({ valid }) => {
if (valid) { if (valid) {
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true }); this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
} }
}); });
}, },
trainTypeChange(trainType) { trainTypeChange(trainType) {
if (trainType === 'HEAD') {
this.formModel.serviceNumber = '';
} else if (trainType === 'PLAN' && this.serviceNumber) {
this.formModel.serviceNumber = this.serviceNumber;
}
const operate = { const operate = {
type: trainType,
val: `${trainType}`,
operation: '' operation: ''
}; };
if (this.operation == OperationEvent.Train.addTrainId.menu.operation) { if (this.operation == OperationEvent.Train.addTrainId.menu.operation) {
operate.operation = OperationEvent.Train.addTrainId.trainTypeChange.operation; operate.operation = OperationEvent.Train.addTrainId.trainTypeChange.operation;
} else if (this.operation == OperationEvent.Train.editTrainId.menu.operation) { } else if (this.operation == OperationEvent.Train.editTrainId.menu.operation) {
operate.operation = OperationEvent.Train.editTrainId.trainTypeChange.operation; operate.operation = OperationEvent.Train.editTrainId.trainTypeChange.operation;
} }
this.$store.dispatch('training/nextNew', operate).then(({ valid }) => {
this.$store.dispatch('training/next', operate).then(({ valid }) => {
if (valid) { if (valid) {
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true }); this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
} }
@ -342,42 +321,26 @@ export default {
}, },
trainNoChange(tripNumber) { trainNoChange(tripNumber) {
const operate = { const operate = {
send: true, tripNumber: tripNumber,
val: tripNumber,
operation: '' operation: ''
}; };
if (this.operation == OperationEvent.Train.addTrainId.menu.operation) { if (this.operation == OperationEvent.Train.addTrainId.menu.operation) {
operate.operation = OperationEvent.Train.addTrainId.trainNoChange.operation; operate.operation = OperationEvent.Train.addTrainId.trainNoChange.operation;
operate.cmdType = CMD.Train.addTrainId;
} else if (this.operation == OperationEvent.Train.editTrainId.menu.operation) { } else if (this.operation == OperationEvent.Train.editTrainId.menu.operation) {
operate.operation = OperationEvent.Train.editTrainId.trainNoChange.operation; operate.operation = OperationEvent.Train.editTrainId.trainNoChange.operation;
operate.cmdType = CMD.Train.editTrainId;
} }
Handler.undo(1); Handler.undo(1);
this.$store.dispatch('training/next', operate).then(({ valid, response }) => { getTrainDetailBytripNumber(this.$route.query.group, {tripNumber:tripNumber}).then(resp => {
if (resp.data) {
this.formModel.serviceNumber = resp.data.serviceNumber;
this.formModel.destinationCode = resp.data.destinationCode;
}
}).catch(() => {
this.$message.error('获取列车信息失败!');
});
this.$store.dispatch('training/nextNew', operate).then(({ valid }) => {
if (valid) { if (valid) {
if (response.data) { this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
this.formModel = {
groupNumber: this.formModel.groupNumber,
tripNumber: tripNumber,
trainType: this.formModel.trainType,
serviceNumber: response.data.serviceNumber,
targetCode: response.data.targetCode,
category: 'MM'
};
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
} else {
this.formModel = {
groupNumber: this.formModel.groupNumber,
tripNumber: tripNumber,
trainType: this.formModel.trainType,
serviceNumber: '',
targetCode: '',
category: 'MM'
};
}
} }
}); });
}, },
@ -394,28 +357,30 @@ export default {
addTrainId() { addTrainId() {
this.$refs['form'].validate((valid) => { this.$refs['form'].validate((valid) => {
if (valid) { if (valid) {
const model = this.formModel; const params = {
const operate = { groupNumber: this.formModel.groupNumber,
send: true, type: this.formModel.type,
serviceNumber: '',
operation: OperationEvent.Train.addTrainId.menu.operation, tripNumber: '',
cmdType: CMD.Train.CMD_ADD_TRAIN_ID, destinationCode: ''
messages: [this.$t('tip.addTrainIdTip')],
val: `${model.groupNumber}::${model.trainType}::${model.serviceNumber}::${model.tripNumber}::${model.targetCode}`
}; };
if (this.formModel.type === 'PLAN') {
this.loading = true; params.serviceNumber = this.formModel.serviceNumber;
this.$store.dispatch('training/next', operate).then(({ valid }) => { params.tripNumber = this.formModel.tripNumber;
params.destinationCode = this.formModel.destinationCode;
} else if (this.formModel.type === 'HEAD') {
params.tripNumber = this.formModel.tripNumber;
params.destinationCode = this.formModel.destinationCode;
}
commitOperate(menuOperate.TrainWindow.addTrainId, params, 2).then(({valid})=>{
this.loading = false; this.loading = false;
if (valid) { if (valid) {
this.doClose(); this.doClose();
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
this.$refs.confirmTrain.doShow(operate);
} }
}).catch(() => { }).catch(() => {
this.loading = false; this.loading = false;
this.doClose(); this.doClose();
this.$refs.noticeInfo.doShow(operate); this.$refs.noticeInfo.doShow();
}); });
} else { } else {
return false; return false;
@ -426,27 +391,30 @@ export default {
editTrainId() { editTrainId() {
this.$refs['form'].validate((valid) => { this.$refs['form'].validate((valid) => {
if (valid) { if (valid) {
const operate = { const params = {
send: true, groupNumber: this.formModel.groupNumber,
type: this.formModel.type,
operation: OperationEvent.Train.editTrainId.menu.operation, serviceNumber: '',
cmdType: CMD.Train.CMD_EDIT_TRAIN_ID, tripNumber: '',
messages: [this.$t('tip.editTrainIdTip')], destinationCode: ''
val: `${this.formModel.trainType}::${this.formModel.tripNumber}`
}; };
if (this.formModel.type === 'PLAN') {
this.loading = true; params.serviceNumber = this.formModel.serviceNumber;
this.$store.dispatch('training/next', operate).then(({ valid }) => { params.tripNumber = this.formModel.tripNumber;
params.destinationCode = this.formModel.destinationCode;
} else if (this.formModel.type === 'HEAD') {
params.tripNumber = this.formModel.tripNumber;
params.destinationCode = this.formModel.destinationCode;
}
commitOperate(menuOperate.TrainWindow.editTrainId, params, 2).then(({valid})=>{
this.loading = false; this.loading = false;
if (valid) { if (valid) {
this.doClose(); this.doClose();
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
this.$refs.confirmTrain.doShow(operate);
} }
}).catch(() => { }).catch(() => {
this.loading = false; this.loading = false;
this.doClose(); this.doClose();
this.$refs.noticeInfo.doShow(operate); this.$refs.noticeInfo.doShow();
}); });
} else { } else {
return false; return false;
@ -455,11 +423,11 @@ export default {
}, },
cancel() { cancel() {
const operate = { const operate = {
operation: OperationEvent.Command.cancel.menu.operation operation: OperationEvent.Command.cancel.menu.operation
}; };
this.$store.dispatch('training/next', operate).then(({ valid }) => { this.$store.dispatch('training/nextNew', operate).then(({ valid }) => {
if (valid) { if (valid) {
this.doClose(); this.doClose();
} }

View File

@ -49,60 +49,54 @@ export default {
menuNormal: { menuNormal: {
Local: [], Local: [],
Center: [ Center: [
// { {
// label: this.$t('menu.menuTrain.addTrainId'), label: this.$t('menu.menuTrain.addTrainId'),
// handler: this.addTrainId, handler: this.undeveloped,
// auth: { station: true, center: true }, cmdType: CMD.TrainWindow.CMD_TRAIN_UPDATE_TYPE
// cmdType:CMD.Train.CMD_SWITCH_REMOVE_FAULT },
// }, {
// { label: this.$t('menu.menuTrain.deleteTrainId'),
// label: this.$t('menu.menuTrain.deleteTrainId'), handler: this.undeveloped,
// handler: this.delTrainId, cmdType: CMD.TrainWindow.CMD_TRAIN_UPDATE_TYPE
// auth: { station: true, center: true }, },
// cmdType:CMD.Train.CMD_SWITCH_REMOVE_FAULT {
// }, label: this.$t('menu.menuTrain.editTrainId'),
// { handler: this.editTrainId,
// label: this.$t('menu.menuTrain.editTrainId'), cmdType: CMD.TrainWindow.CMD_TRAIN_UPDATE_TYPE
// handler: this.editTrainId, },
// auth: { station: true, center: true }, {
// cmdType:CMD.Train.CMD_SWITCH_REMOVE_FAULT label: this.$t('menu.menuTrain.editTrainNo'),
// }, handler: this.undeveloped,
// { cmdType: CMD.TrainWindow.CMD_TRAIN_UPDATE_TYPE
// label: this.$t('menu.menuTrain.editTrainNo'), },
// handler: this.editTrainNo, {
// auth: { station: true, center: true }, label: this.$t('menu.menuTrain.moveTrainId'),
// cmdType:CMD.Train.CMD_SWITCH_REMOVE_FAULT handler: this.undeveloped,
// }, cmdType: CMD.TrainWindow.CMD_TRAIN_UPDATE_TYPE
// { },
// label: this.$t('menu.menuTrain.moveTrainId'), {
// handler: this.moveTrainId, label: this.$t('menu.menuTrain.switchTrainId'),
// auth: { station: true, center: true }, handler: this.undeveloped,
// cmdType:CMD.Train.CMD_SWITCH_REMOVE_FAULT cmdType: CMD.TrainWindow.CMD_TRAIN_UPDATE_TYPE
// }, }
// {
// label: this.$t('menu.menuTrain.switchTrainId'),
// handler: this.switchTrainId,
// auth: { station: true, center: true },
// cmdType:CMD.Train.CMD_SWITCH_REMOVE_FAULT
// }
] ]
}, },
menuForce: [ menuForce: [
{ {
label: this.$t('menu.menuTrain.setCommunicationFault'), label: this.$t('menu.menuTrain.setCommunicationFault'),
handler: this.setStoppage, handler: this.undeveloped,
cmdType:CMD.Train.CMD_TRAIN_ADD_FAULT cmdType:CMD.Train.CMD_TRAIN_ADD_FAULT
}, },
{ {
label: this.$t('menu.menuTrain.cancelCommunicationFault'), label: this.$t('menu.menuTrain.cancelCommunicationFault'),
handler: this.cancelStoppage, handler: this.undeveloped,
cmdType:CMD.Train.CMD_TRAIN_REMOVE_FAULT cmdType:CMD.Train.CMD_TRAIN_REMOVE_FAULT
} }
], ],
menuSpeed: [ menuSpeed: [
{ {
label: this.$t('menu.menuTrain.confirmRunToFrontStation'), label: this.$t('menu.menuTrain.confirmRunToFrontStation'),
handler: this.limitSpeed, handler: this.undeveloped,
cmdType:CMD.Train.CMD_TRAIN_MANUAL_LIMIT_DRIVE cmdType:CMD.Train.CMD_TRAIN_MANUAL_LIMIT_DRIVE
} }
] ]
@ -133,6 +127,14 @@ export default {
self.doClose(); self.doClose();
}; };
}, },
undeveloped() {
this.doClose();
this.$alert('实现中......', '提示', {
confirmButtonText: '确定',
callback: action => {
}
});
},
initMenu() { initMenu() {
// //
// this.menu = MenuContextHandler.menuFiltration(this.menuNormal); // this.menu = MenuContextHandler.menuFiltration(this.menuNormal);
@ -145,8 +147,6 @@ export default {
if (this.operatemode === OperateMode.FAULT) { if (this.operatemode === OperateMode.FAULT) {
this.menu = [...this.menuForce, ...this.menuSpeed]; this.menu = [...this.menuForce, ...this.menuSpeed];
} }
// this.menu = MenuContextHandler.covert(this.menu);
}, },
doShow(point) { doShow(point) {
this.clickEvent(); this.clickEvent();
@ -164,45 +164,44 @@ export default {
}, },
// //
setStoppage() { setStoppage() {
const step = { // const step = {
start: true, // start: true,
// operation: OperationEvent.Train.stoppage.menu.operation,
operation: OperationEvent.Train.stoppage.menu.operation, // cmdType: CMD.Train.CMD_STOPPAGE,
cmdType: CMD.Train.CMD_STOPPAGE, // param: {
param: { // code: this.selected.code
code: this.selected.code // }
} // };
}; // this.$store.dispatch('training/next', step).then(({ valid }) => {
this.$store.dispatch('training/next', step).then(({ valid }) => { // if (valid) {
if (valid) { // this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true }); // } else {
} else { // this.$refs.noticeInfo.doShow(step);
this.$refs.noticeInfo.doShow(step); // }
} // }).catch(() => {
}).catch(() => { // this.$refs.noticeInfo.doShow(step);
this.$refs.noticeInfo.doShow(step); // });
});
}, },
// //
cancelStoppage() { cancelStoppage() {
const step = { // const step = {
start: true, // start: true,
//
operation: OperationEvent.Train.cancelStoppage.menu.operation, // operation: OperationEvent.Train.cancelStoppage.menu.operation,
cmdType: CMD.Train.CMD_CANCEL_STOPPAGE, // cmdType: CMD.Train.CMD_CANCEL_STOPPAGE,
param: { // param: {
code: this.selected.code // code: this.selected.code
} // }
}; // };
this.$store.dispatch('training/next', step).then(({ valid }) => { // this.$store.dispatch('training/next', step).then(({ valid }) => {
if (valid) { // if (valid) {
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true }); // this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
} else { // } else {
this.$refs.noticeInfo.doShow(step); // this.$refs.noticeInfo.doShow(step);
} // }
}).catch(() => { // }).catch(() => {
this.$refs.noticeInfo.doShow(step); // this.$refs.noticeInfo.doShow(step);
}); // });
}, },
// //
limitSpeed() { limitSpeed() {
@ -263,13 +262,12 @@ export default {
editTrainId() { editTrainId() {
const step = { const step = {
start: true, start: true,
operation: OperationEvent.Train.editTrainId.menu.operation, operation: OperationEvent.Train.editTrainId.menu.operation,
param: { param: {
code: this.selected.code code: this.selected.code
} }
}; };
this.$store.dispatch('training/next', step).then(({ valid }) => { this.$store.dispatch('training/nextNew', step).then(({ valid }) => {
if (valid) { if (valid) {
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true }); this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
this.$refs.trainControl.doShow(step, this.selected); this.$refs.trainControl.doShow(step, this.selected);

View File

@ -163,6 +163,11 @@ export const menuOperate = {
operation: OperationEvent.Switch.turnout.menu.operation, operation: OperationEvent.Switch.turnout.menu.operation,
cmdType:CMD.Switch.CMD_SWITCH_TURN cmdType:CMD.Switch.CMD_SWITCH_TURN
}, },
fault: {
// 故障解锁
operation: OperationEvent.Switch.fault.menu.operation,
cmdType: CMD.Switch.CMD_SWITCH_FAULT_UNLOCK
},
split:{ split:{
// 区段切除 // 区段切除
operation: OperationEvent.Switch.split.menu.operation, operation: OperationEvent.Switch.split.menu.operation,
@ -178,6 +183,11 @@ export const menuOperate = {
operation: OperationEvent.Switch.setSpeed.menu.operation, operation: OperationEvent.Switch.setSpeed.menu.operation,
cmdType:CMD.Switch.CMD_SWITCH_SET_LIMIT_SPEED cmdType:CMD.Switch.CMD_SWITCH_SET_LIMIT_SPEED
}, },
cancelSpeed: {
// 取消临时限速
operation: OperationEvent.Switch.cancelSpeed.menu.operation,
cmdType:CMD.Switch.CMD_SWITCH_CANCEL_LIMIT_SPEED
},
alxeEffective:{ alxeEffective:{
// 确认计轴有效 // 确认计轴有效
operation: OperationEvent.Switch.alxeEffective.menu.operation, operation: OperationEvent.Switch.alxeEffective.menu.operation,
@ -282,6 +292,16 @@ export const menuOperate = {
cmdType:CMD.ControlConvertMenu.CMD_CM_EMERGENCY_STATION_CONTROL cmdType:CMD.ControlConvertMenu.CMD_CM_EMERGENCY_STATION_CONTROL
} }
}, },
TrainWindow: {
editTrainId: {
operation: OperationEvent.Train.editTrainId.menu.operation,
cmdType: CMD.TrainWindow.CMD_TRAIN_UPDATE_TYPE
},
addTrainId: {
operation: OperationEvent.Train.addTrainId.menu.operation,
cmdType: ''
}
},
Common: { Common: {
setFault: { setFault: {
operation: OperationEvent.MixinCommand.stoppage.menu.operation, operation: OperationEvent.MixinCommand.stoppage.menu.operation,

View File

@ -186,7 +186,7 @@ export const menuOperate = {
cancelSpeed: { cancelSpeed: {
// 取消临时限速 // 取消临时限速
operation: OperationEvent.Switch.cancelSpeed.menu.operation, operation: OperationEvent.Switch.cancelSpeed.menu.operation,
cmdType:CMD.Switch.CMD_CANCEL_SPEED cmdType:CMD.Switch.CMD_SWITCH_CANCEL_LIMIT_SPEED
}, },
alxeEffective:{ alxeEffective:{
// 确认计轴有效 // 确认计轴有效