福州道岔&列车操作
This commit is contained in:
parent
2e5b07d7e2
commit
db98a53907
@ -296,7 +296,7 @@ export default {
|
||||
this.timer = null;
|
||||
},
|
||||
methods: {
|
||||
doShow(operate, selected, tempData) {
|
||||
doShow(operate, selected) {
|
||||
if (!this.dialogShow) {
|
||||
this.name = '';
|
||||
this.stationName = '';
|
||||
|
@ -302,7 +302,7 @@ export default {
|
||||
},
|
||||
commandNoPopUp() {
|
||||
const operate = {
|
||||
|
||||
operation: ''
|
||||
};
|
||||
|
||||
if (this.operation == OperationEvent.Switch.unlock.menu.operation) {
|
||||
@ -321,7 +321,7 @@ export default {
|
||||
|
||||
this.setMessage(this.$t('tip.firstConfirmTip'));
|
||||
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) {
|
||||
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
|
||||
this.setButtonEnable({ step: 1 });
|
||||
@ -335,7 +335,7 @@ export default {
|
||||
},
|
||||
confirm1() {
|
||||
const operate = {
|
||||
|
||||
operation: ''
|
||||
};
|
||||
|
||||
if (this.operation == OperationEvent.Switch.unlock.menu.operation) {
|
||||
@ -354,7 +354,7 @@ export default {
|
||||
|
||||
this.setMessage(this.$t('tip.secondConfirmTip'));
|
||||
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) {
|
||||
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
|
||||
this.timeCountCommand = -1;
|
||||
@ -392,7 +392,7 @@ export default {
|
||||
}
|
||||
this.setMessage('');
|
||||
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.timeCountConfirm = -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.$store.dispatch('training/next', operate).then(({ valid }) => {
|
||||
this.$store.dispatch('training/nextNew', operate).then(({ valid }) => {
|
||||
if (valid) {
|
||||
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
|
||||
this.setButtonEnable({ step: 0 });
|
||||
@ -444,8 +444,7 @@ export default {
|
||||
const operate = {
|
||||
operation: OperationEvent.Command.close.menu.operation
|
||||
};
|
||||
|
||||
this.$store.dispatch('training/next', operate).then(({ valid }) => {
|
||||
this.$store.dispatch('training/nextNew', operate).then(({ valid }) => {
|
||||
if (valid) {
|
||||
this.doClose();
|
||||
}
|
||||
|
@ -49,6 +49,7 @@ import { OperationEvent } from '@/scripts/cmdPlugin/OperationHandler';
|
||||
import OperationHandler from '@/scripts/cmdPlugin/OperationHandler';
|
||||
import NoticeInfo from './childDialog/childDialog/noticeInfo';
|
||||
import CMD from '@/scripts/cmdPlugin/CommandEnum';
|
||||
import { menuOperate, commitOperate } from '../utils/menuOperate';
|
||||
|
||||
export default {
|
||||
name: 'SwitchControl',
|
||||
@ -153,133 +154,52 @@ export default {
|
||||
},
|
||||
// 道岔单锁
|
||||
lock() {
|
||||
const operate = {
|
||||
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);
|
||||
});
|
||||
this.sendCommand(menuOperate.Switch.lock);
|
||||
},
|
||||
// 道岔封锁
|
||||
block() {
|
||||
const operate = {
|
||||
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);
|
||||
});
|
||||
this.sendCommand(menuOperate.Switch.block);
|
||||
},
|
||||
// 道岔转动
|
||||
turnout(operation) {
|
||||
const operate = {
|
||||
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);
|
||||
});
|
||||
turnout() {
|
||||
this.sendCommand(menuOperate.Switch.turnout);
|
||||
},
|
||||
// 道岔强扮
|
||||
turnoutForce() {
|
||||
const operate = {
|
||||
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);
|
||||
});
|
||||
this.sendCommand(menuOperate.Switch.turnoutForce);
|
||||
},
|
||||
// 区段切除
|
||||
split() {
|
||||
const operate = {
|
||||
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);
|
||||
});
|
||||
this.sendCommand(menuOperate.Switch.split);
|
||||
},
|
||||
// 区段激活
|
||||
active() {
|
||||
const operate = {
|
||||
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);
|
||||
});
|
||||
this.sendCommand(menuOperate.Switch.active);
|
||||
},
|
||||
cancel() {
|
||||
const operate = {
|
||||
operation: OperationEvent.Command.cancel.menu.operation
|
||||
};
|
||||
|
||||
this.$store.dispatch('training/next', operate).then(({ valid }) => {
|
||||
this.$store.dispatch('training/nextNew', operate).then(({ valid }) => {
|
||||
if (valid) {
|
||||
this.doClose();
|
||||
}
|
||||
}).catch(() => {
|
||||
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);
|
||||
});
|
||||
}
|
||||
}
|
||||
};
|
||||
|
@ -17,42 +17,41 @@
|
||||
/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item prop="trainType" label-width="0px">
|
||||
<el-form-item prop="type" label-width="0px">
|
||||
<el-radio-group
|
||||
:id="domIdTrainType"
|
||||
v-model="formModel.trainType"
|
||||
style="margin-left: 15px;"
|
||||
v-model="formModel.type"
|
||||
style="margin-left: 45px;"
|
||||
@change="trainTypeChange"
|
||||
>
|
||||
<el-radio :label="'01'">{{ $t('menu.planTrain') }}</el-radio>
|
||||
<el-radio :label="'02'">{{ $t('menu.headCodeTrain') }}</el-radio>
|
||||
<el-radio :label="'03'" style="margin-top:5px;">{{ $t('menu.artificialTrain') }}</el-radio>
|
||||
<el-radio :label="'PLAN'">{{ $t('menu.planTrain') }}</el-radio>
|
||||
<el-radio :label="'HEAD'">{{ $t('menu.headCodeTrain') }}</el-radio>
|
||||
<el-radio :label="'MANUAL'" style="margin-top:5px;">{{ $t('menu.artificialTrain') }}</el-radio>
|
||||
</el-radio-group>
|
||||
</el-form-item>
|
||||
<el-form-item v-if="formModel.trainType == '01'" prop="serviceNumber">
|
||||
<span slot="label">{{ $t('menu.serviceNumber') }}</span>
|
||||
<el-form-item v-if="formModel.type == 'PLAN'|| formModel.type == 'HEAD'" prop="serviceNumber">
|
||||
<span slot="label">{{ $t('menu.serviceNumber') + ':' }}</span>
|
||||
<el-input
|
||||
:id="domIdServerNo"
|
||||
v-model="formModel.serviceNumber"
|
||||
:disabled="serverNoIsDisabled"
|
||||
/>
|
||||
</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
|
||||
:id="domIdTrainNo"
|
||||
v-model="formModel.tripNumber"
|
||||
:disabled="trainNoIsDisabled"
|
||||
maxlength="4"
|
||||
/>
|
||||
</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
|
||||
:id="domIdTargetCode"
|
||||
v-model="formModel.targetCode"
|
||||
:disabled="targetCodeIsDisabled"
|
||||
v-model="formModel.destinationCode"
|
||||
:disabled="formModel.type !== 'HEAD'"
|
||||
/>
|
||||
</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
|
||||
:id="domIdTrainNumber"
|
||||
v-model="formModel.category"
|
||||
@ -70,7 +69,7 @@
|
||||
</el-form>
|
||||
<el-row justify="center" class="button-group">
|
||||
<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 :span="8" :offset="4">
|
||||
<el-button :id="domIdCancel" @click="cancel">{{ $t('global.cancel') }}</el-button>
|
||||
@ -84,10 +83,11 @@
|
||||
<script>
|
||||
import { mapGetters } from 'vuex';
|
||||
import { OperationEvent } from '@/scripts/cmdPlugin/OperationHandler';
|
||||
import CMD from '@/scripts/cmdPlugin/CommandEnum';
|
||||
import ConfirmTrain from './childDialog/confirmTrain';
|
||||
import NoticeInfo from './childDialog/childDialog/noticeInfo';
|
||||
import Handler from '@/scripts/cmdPlugin/Handler';
|
||||
import { menuOperate, commitOperate } from '../utils/menuOperate';
|
||||
import {getTrainDetailBytripNumber} from '@/api/simulation';
|
||||
|
||||
export default {
|
||||
name: 'TrainControl',
|
||||
@ -98,32 +98,29 @@ export default {
|
||||
data() {
|
||||
return {
|
||||
trainList: [],
|
||||
categoryList: [
|
||||
{ name: 'MM', value: '01' }
|
||||
],
|
||||
serviceNumber:'',
|
||||
formModel: {
|
||||
tripNumber: '',
|
||||
groupNumber: '',
|
||||
trainType: '01',
|
||||
type: 'PLAN',
|
||||
serviceNumber: '',
|
||||
targetCode: '',
|
||||
destinationCode: '',
|
||||
category: 'MM'
|
||||
},
|
||||
|
||||
categoryList: [
|
||||
{ name: 'MM', value: '01' }
|
||||
],
|
||||
rules: {
|
||||
groupNumber: [
|
||||
{ required: true, message: this.$t('rules.selectGroupNumber'), trigger: 'change' }
|
||||
],
|
||||
trainType: [
|
||||
type: [
|
||||
{ required: true, message: this.$t('rules.selectATrainType'), trigger: 'change' }
|
||||
],
|
||||
serviceNumber: [
|
||||
{ required: true, message: this.$t('rules.enterTheServiceNumber'), trigger: 'blur' }
|
||||
],
|
||||
tripNumber: [
|
||||
{ required: true, message: this.$t('rules.enterTheTripNumber'), trigger: 'blur' }
|
||||
],
|
||||
targetCode: [
|
||||
destinationCode: [
|
||||
{ required: true, message: this.$t('rules.enterTheTargetCode'), trigger: 'blur' }
|
||||
]
|
||||
},
|
||||
@ -137,27 +134,15 @@ export default {
|
||||
...mapGetters('map', [
|
||||
'map'
|
||||
]),
|
||||
trainNoIsDisabled() {
|
||||
return false;
|
||||
},
|
||||
serverNoIsDisabled() {
|
||||
return true;
|
||||
},
|
||||
targetCodeIsDisabled() {
|
||||
return true;
|
||||
},
|
||||
trainNumberIsDisabled() {
|
||||
if (this.operation != OperationEvent.Train.addTrainId.menu.operation) {
|
||||
return true;
|
||||
}
|
||||
return '';
|
||||
},
|
||||
// trainTypeIsDisabled() {
|
||||
// if (this.operation != OperationEvent.Train.addTrainId.menu.operation) {
|
||||
// return true;
|
||||
// }
|
||||
// return '';
|
||||
// },
|
||||
show() {
|
||||
return this.dialogShow && !this.$store.state.menuOperation.break;
|
||||
},
|
||||
@ -243,12 +228,6 @@ export default {
|
||||
return this.$t('menu.menuTrain.editTrainId');
|
||||
}
|
||||
return '';
|
||||
},
|
||||
istargetCode() {
|
||||
if (this.formModel.serviceNumber && this.formModel.targetCode) {
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
},
|
||||
watch: {
|
||||
@ -259,7 +238,7 @@ export default {
|
||||
this.formModel = {
|
||||
groupNumber: this.formModel.groupNumber,
|
||||
tripNumber: val,
|
||||
trainType: this.formModel.trainType,
|
||||
type: this.formModel.type,
|
||||
serviceNumber: '',
|
||||
targetCode: '',
|
||||
category: 'MM'
|
||||
@ -280,15 +259,15 @@ export default {
|
||||
this.operation = operate.operation;
|
||||
}
|
||||
const model = this.$store.getters['map/getDeviceByCode'](selected.code);
|
||||
this.serviceNumber = model.serviceNumber;
|
||||
this.formModel = {
|
||||
groupNumber: model.groupNumber,
|
||||
tripNumber: `${model.directionCode}${model.tripNumber}`,
|
||||
trainType: model.type,
|
||||
tripNumber: model.tripNumber,
|
||||
type: model.type ? model.type : 'PLAN',
|
||||
serviceNumber: model.serviceNumber,
|
||||
targetCode: model.targetCode,
|
||||
destinationCode: model.destinationCode,
|
||||
category: 'MM'
|
||||
};
|
||||
|
||||
/** 加载列车数据*/
|
||||
this.loadInitData(this.map);
|
||||
this.dialogShow = true;
|
||||
@ -304,37 +283,37 @@ export default {
|
||||
},
|
||||
trainNumberChange(groupNumber) {
|
||||
const operate = {
|
||||
|
||||
val: `${groupNumber}`,
|
||||
groupNumber: groupNumber,
|
||||
operation: ''
|
||||
};
|
||||
|
||||
if (this.operation == OperationEvent.Train.addTrainId.menu.operation) {
|
||||
operate.operation = OperationEvent.Train.addTrainId.trainNumberChange.operation;
|
||||
} else if (this.operation == OperationEvent.Train.editTrainId.menu.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) {
|
||||
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
|
||||
}
|
||||
});
|
||||
},
|
||||
trainTypeChange(trainType) {
|
||||
if (trainType === 'HEAD') {
|
||||
this.formModel.serviceNumber = '';
|
||||
} else if (trainType === 'PLAN' && this.serviceNumber) {
|
||||
this.formModel.serviceNumber = this.serviceNumber;
|
||||
}
|
||||
const operate = {
|
||||
|
||||
val: `${trainType}`,
|
||||
type: trainType,
|
||||
operation: ''
|
||||
};
|
||||
|
||||
if (this.operation == OperationEvent.Train.addTrainId.menu.operation) {
|
||||
operate.operation = OperationEvent.Train.addTrainId.trainTypeChange.operation;
|
||||
} else if (this.operation == OperationEvent.Train.editTrainId.menu.operation) {
|
||||
operate.operation = OperationEvent.Train.editTrainId.trainTypeChange.operation;
|
||||
}
|
||||
|
||||
this.$store.dispatch('training/next', operate).then(({ valid }) => {
|
||||
this.$store.dispatch('training/nextNew', operate).then(({ valid }) => {
|
||||
if (valid) {
|
||||
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
|
||||
}
|
||||
@ -342,42 +321,26 @@ export default {
|
||||
},
|
||||
trainNoChange(tripNumber) {
|
||||
const operate = {
|
||||
send: true,
|
||||
|
||||
val: tripNumber,
|
||||
tripNumber: tripNumber,
|
||||
operation: ''
|
||||
};
|
||||
|
||||
if (this.operation == OperationEvent.Train.addTrainId.menu.operation) {
|
||||
operate.operation = OperationEvent.Train.addTrainId.trainNoChange.operation;
|
||||
operate.cmdType = CMD.Train.addTrainId;
|
||||
} else if (this.operation == OperationEvent.Train.editTrainId.menu.operation) {
|
||||
operate.operation = OperationEvent.Train.editTrainId.trainNoChange.operation;
|
||||
operate.cmdType = CMD.Train.editTrainId;
|
||||
}
|
||||
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 (response.data) {
|
||||
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'
|
||||
};
|
||||
}
|
||||
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
|
||||
}
|
||||
});
|
||||
},
|
||||
@ -394,28 +357,30 @@ export default {
|
||||
addTrainId() {
|
||||
this.$refs['form'].validate((valid) => {
|
||||
if (valid) {
|
||||
const model = this.formModel;
|
||||
const operate = {
|
||||
send: true,
|
||||
|
||||
operation: OperationEvent.Train.addTrainId.menu.operation,
|
||||
cmdType: CMD.Train.CMD_ADD_TRAIN_ID,
|
||||
messages: [this.$t('tip.addTrainIdTip')],
|
||||
val: `${model.groupNumber}::${model.trainType}::${model.serviceNumber}::${model.tripNumber}::${model.targetCode}`
|
||||
const params = {
|
||||
groupNumber: this.formModel.groupNumber,
|
||||
type: this.formModel.type,
|
||||
serviceNumber: '',
|
||||
tripNumber: '',
|
||||
destinationCode: ''
|
||||
};
|
||||
|
||||
this.loading = true;
|
||||
this.$store.dispatch('training/next', operate).then(({ valid }) => {
|
||||
if (this.formModel.type === 'PLAN') {
|
||||
params.serviceNumber = this.formModel.serviceNumber;
|
||||
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;
|
||||
if (valid) {
|
||||
this.doClose();
|
||||
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
|
||||
this.$refs.confirmTrain.doShow(operate);
|
||||
}
|
||||
}).catch(() => {
|
||||
this.loading = false;
|
||||
this.doClose();
|
||||
this.$refs.noticeInfo.doShow(operate);
|
||||
this.$refs.noticeInfo.doShow();
|
||||
});
|
||||
} else {
|
||||
return false;
|
||||
@ -426,27 +391,30 @@ export default {
|
||||
editTrainId() {
|
||||
this.$refs['form'].validate((valid) => {
|
||||
if (valid) {
|
||||
const operate = {
|
||||
send: true,
|
||||
|
||||
operation: OperationEvent.Train.editTrainId.menu.operation,
|
||||
cmdType: CMD.Train.CMD_EDIT_TRAIN_ID,
|
||||
messages: [this.$t('tip.editTrainIdTip')],
|
||||
val: `${this.formModel.trainType}::${this.formModel.tripNumber}`
|
||||
const params = {
|
||||
groupNumber: this.formModel.groupNumber,
|
||||
type: this.formModel.type,
|
||||
serviceNumber: '',
|
||||
tripNumber: '',
|
||||
destinationCode: ''
|
||||
};
|
||||
|
||||
this.loading = true;
|
||||
this.$store.dispatch('training/next', operate).then(({ valid }) => {
|
||||
if (this.formModel.type === 'PLAN') {
|
||||
params.serviceNumber = this.formModel.serviceNumber;
|
||||
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;
|
||||
if (valid) {
|
||||
this.doClose();
|
||||
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
|
||||
this.$refs.confirmTrain.doShow(operate);
|
||||
}
|
||||
}).catch(() => {
|
||||
this.loading = false;
|
||||
this.doClose();
|
||||
this.$refs.noticeInfo.doShow(operate);
|
||||
this.$refs.noticeInfo.doShow();
|
||||
});
|
||||
} else {
|
||||
return false;
|
||||
@ -455,11 +423,11 @@ export default {
|
||||
},
|
||||
cancel() {
|
||||
const operate = {
|
||||
|
||||
|
||||
operation: OperationEvent.Command.cancel.menu.operation
|
||||
};
|
||||
|
||||
this.$store.dispatch('training/next', operate).then(({ valid }) => {
|
||||
this.$store.dispatch('training/nextNew', operate).then(({ valid }) => {
|
||||
if (valid) {
|
||||
this.doClose();
|
||||
}
|
||||
|
@ -49,60 +49,54 @@ export default {
|
||||
menuNormal: {
|
||||
Local: [],
|
||||
Center: [
|
||||
// {
|
||||
// label: this.$t('menu.menuTrain.addTrainId'),
|
||||
// handler: this.addTrainId,
|
||||
// auth: { station: true, center: true },
|
||||
// cmdType:CMD.Train.CMD_SWITCH_REMOVE_FAULT
|
||||
// },
|
||||
// {
|
||||
// label: this.$t('menu.menuTrain.deleteTrainId'),
|
||||
// handler: this.delTrainId,
|
||||
// auth: { station: true, center: true },
|
||||
// cmdType:CMD.Train.CMD_SWITCH_REMOVE_FAULT
|
||||
// },
|
||||
// {
|
||||
// label: this.$t('menu.menuTrain.editTrainId'),
|
||||
// handler: this.editTrainId,
|
||||
// auth: { station: true, center: true },
|
||||
// cmdType:CMD.Train.CMD_SWITCH_REMOVE_FAULT
|
||||
// },
|
||||
// {
|
||||
// label: this.$t('menu.menuTrain.editTrainNo'),
|
||||
// handler: this.editTrainNo,
|
||||
// auth: { station: true, center: true },
|
||||
// cmdType:CMD.Train.CMD_SWITCH_REMOVE_FAULT
|
||||
// },
|
||||
// {
|
||||
// label: this.$t('menu.menuTrain.moveTrainId'),
|
||||
// handler: this.moveTrainId,
|
||||
// auth: { station: true, center: true },
|
||||
// cmdType:CMD.Train.CMD_SWITCH_REMOVE_FAULT
|
||||
// },
|
||||
// {
|
||||
// label: this.$t('menu.menuTrain.switchTrainId'),
|
||||
// handler: this.switchTrainId,
|
||||
// auth: { station: true, center: true },
|
||||
// cmdType:CMD.Train.CMD_SWITCH_REMOVE_FAULT
|
||||
// }
|
||||
{
|
||||
label: this.$t('menu.menuTrain.addTrainId'),
|
||||
handler: this.undeveloped,
|
||||
cmdType: CMD.TrainWindow.CMD_TRAIN_UPDATE_TYPE
|
||||
},
|
||||
{
|
||||
label: this.$t('menu.menuTrain.deleteTrainId'),
|
||||
handler: this.undeveloped,
|
||||
cmdType: CMD.TrainWindow.CMD_TRAIN_UPDATE_TYPE
|
||||
},
|
||||
{
|
||||
label: this.$t('menu.menuTrain.editTrainId'),
|
||||
handler: this.editTrainId,
|
||||
cmdType: CMD.TrainWindow.CMD_TRAIN_UPDATE_TYPE
|
||||
},
|
||||
{
|
||||
label: this.$t('menu.menuTrain.editTrainNo'),
|
||||
handler: this.undeveloped,
|
||||
cmdType: CMD.TrainWindow.CMD_TRAIN_UPDATE_TYPE
|
||||
},
|
||||
{
|
||||
label: this.$t('menu.menuTrain.moveTrainId'),
|
||||
handler: this.undeveloped,
|
||||
cmdType: CMD.TrainWindow.CMD_TRAIN_UPDATE_TYPE
|
||||
},
|
||||
{
|
||||
label: this.$t('menu.menuTrain.switchTrainId'),
|
||||
handler: this.undeveloped,
|
||||
cmdType: CMD.TrainWindow.CMD_TRAIN_UPDATE_TYPE
|
||||
}
|
||||
]
|
||||
},
|
||||
menuForce: [
|
||||
{
|
||||
label: this.$t('menu.menuTrain.setCommunicationFault'),
|
||||
handler: this.setStoppage,
|
||||
handler: this.undeveloped,
|
||||
cmdType:CMD.Train.CMD_TRAIN_ADD_FAULT
|
||||
},
|
||||
{
|
||||
label: this.$t('menu.menuTrain.cancelCommunicationFault'),
|
||||
handler: this.cancelStoppage,
|
||||
handler: this.undeveloped,
|
||||
cmdType:CMD.Train.CMD_TRAIN_REMOVE_FAULT
|
||||
}
|
||||
],
|
||||
menuSpeed: [
|
||||
{
|
||||
label: this.$t('menu.menuTrain.confirmRunToFrontStation'),
|
||||
handler: this.limitSpeed,
|
||||
handler: this.undeveloped,
|
||||
cmdType:CMD.Train.CMD_TRAIN_MANUAL_LIMIT_DRIVE
|
||||
}
|
||||
]
|
||||
@ -133,6 +127,14 @@ export default {
|
||||
self.doClose();
|
||||
};
|
||||
},
|
||||
undeveloped() {
|
||||
this.doClose();
|
||||
this.$alert('实现中......', '提示', {
|
||||
confirmButtonText: '确定',
|
||||
callback: action => {
|
||||
}
|
||||
});
|
||||
},
|
||||
initMenu() {
|
||||
// 编辑模式菜单列表
|
||||
// this.menu = MenuContextHandler.menuFiltration(this.menuNormal);
|
||||
@ -145,8 +147,6 @@ export default {
|
||||
if (this.operatemode === OperateMode.FAULT) {
|
||||
this.menu = [...this.menuForce, ...this.menuSpeed];
|
||||
}
|
||||
|
||||
// this.menu = MenuContextHandler.covert(this.menu);
|
||||
},
|
||||
doShow(point) {
|
||||
this.clickEvent();
|
||||
@ -164,45 +164,44 @@ export default {
|
||||
},
|
||||
// 设置故障
|
||||
setStoppage() {
|
||||
const step = {
|
||||
start: true,
|
||||
|
||||
operation: OperationEvent.Train.stoppage.menu.operation,
|
||||
cmdType: CMD.Train.CMD_STOPPAGE,
|
||||
param: {
|
||||
code: this.selected.code
|
||||
}
|
||||
};
|
||||
this.$store.dispatch('training/next', step).then(({ valid }) => {
|
||||
if (valid) {
|
||||
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
|
||||
} else {
|
||||
this.$refs.noticeInfo.doShow(step);
|
||||
}
|
||||
}).catch(() => {
|
||||
this.$refs.noticeInfo.doShow(step);
|
||||
});
|
||||
// const step = {
|
||||
// start: true,
|
||||
// operation: OperationEvent.Train.stoppage.menu.operation,
|
||||
// cmdType: CMD.Train.CMD_STOPPAGE,
|
||||
// param: {
|
||||
// code: this.selected.code
|
||||
// }
|
||||
// };
|
||||
// this.$store.dispatch('training/next', step).then(({ valid }) => {
|
||||
// if (valid) {
|
||||
// this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
|
||||
// } else {
|
||||
// this.$refs.noticeInfo.doShow(step);
|
||||
// }
|
||||
// }).catch(() => {
|
||||
// this.$refs.noticeInfo.doShow(step);
|
||||
// });
|
||||
},
|
||||
// 取消故障
|
||||
cancelStoppage() {
|
||||
const step = {
|
||||
start: true,
|
||||
|
||||
operation: OperationEvent.Train.cancelStoppage.menu.operation,
|
||||
cmdType: CMD.Train.CMD_CANCEL_STOPPAGE,
|
||||
param: {
|
||||
code: this.selected.code
|
||||
}
|
||||
};
|
||||
this.$store.dispatch('training/next', step).then(({ valid }) => {
|
||||
if (valid) {
|
||||
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
|
||||
} else {
|
||||
this.$refs.noticeInfo.doShow(step);
|
||||
}
|
||||
}).catch(() => {
|
||||
this.$refs.noticeInfo.doShow(step);
|
||||
});
|
||||
// const step = {
|
||||
// start: true,
|
||||
//
|
||||
// operation: OperationEvent.Train.cancelStoppage.menu.operation,
|
||||
// cmdType: CMD.Train.CMD_CANCEL_STOPPAGE,
|
||||
// param: {
|
||||
// code: this.selected.code
|
||||
// }
|
||||
// };
|
||||
// this.$store.dispatch('training/next', step).then(({ valid }) => {
|
||||
// if (valid) {
|
||||
// this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
|
||||
// } else {
|
||||
// this.$refs.noticeInfo.doShow(step);
|
||||
// }
|
||||
// }).catch(() => {
|
||||
// this.$refs.noticeInfo.doShow(step);
|
||||
// });
|
||||
},
|
||||
// 限速行驶
|
||||
limitSpeed() {
|
||||
@ -263,13 +262,12 @@ export default {
|
||||
editTrainId() {
|
||||
const step = {
|
||||
start: true,
|
||||
|
||||
operation: OperationEvent.Train.editTrainId.menu.operation,
|
||||
param: {
|
||||
code: this.selected.code
|
||||
}
|
||||
};
|
||||
this.$store.dispatch('training/next', step).then(({ valid }) => {
|
||||
this.$store.dispatch('training/nextNew', step).then(({ valid }) => {
|
||||
if (valid) {
|
||||
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
|
||||
this.$refs.trainControl.doShow(step, this.selected);
|
||||
|
@ -163,6 +163,11 @@ export const menuOperate = {
|
||||
operation: OperationEvent.Switch.turnout.menu.operation,
|
||||
cmdType:CMD.Switch.CMD_SWITCH_TURN
|
||||
},
|
||||
fault: {
|
||||
// 故障解锁
|
||||
operation: OperationEvent.Switch.fault.menu.operation,
|
||||
cmdType: CMD.Switch.CMD_SWITCH_FAULT_UNLOCK
|
||||
},
|
||||
split:{
|
||||
// 区段切除
|
||||
operation: OperationEvent.Switch.split.menu.operation,
|
||||
@ -178,6 +183,11 @@ export const menuOperate = {
|
||||
operation: OperationEvent.Switch.setSpeed.menu.operation,
|
||||
cmdType:CMD.Switch.CMD_SWITCH_SET_LIMIT_SPEED
|
||||
},
|
||||
cancelSpeed: {
|
||||
// 取消临时限速
|
||||
operation: OperationEvent.Switch.cancelSpeed.menu.operation,
|
||||
cmdType:CMD.Switch.CMD_SWITCH_CANCEL_LIMIT_SPEED
|
||||
},
|
||||
alxeEffective:{
|
||||
// 确认计轴有效
|
||||
operation: OperationEvent.Switch.alxeEffective.menu.operation,
|
||||
@ -282,6 +292,16 @@ export const menuOperate = {
|
||||
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: {
|
||||
setFault: {
|
||||
operation: OperationEvent.MixinCommand.stoppage.menu.operation,
|
||||
|
@ -186,7 +186,7 @@ export const menuOperate = {
|
||||
cancelSpeed: {
|
||||
// 取消临时限速
|
||||
operation: OperationEvent.Switch.cancelSpeed.menu.operation,
|
||||
cmdType:CMD.Switch.CMD_CANCEL_SPEED
|
||||
cmdType:CMD.Switch.CMD_SWITCH_CANCEL_LIMIT_SPEED
|
||||
},
|
||||
alxeEffective:{
|
||||
// 确认计轴有效
|
||||
|
Loading…
Reference in New Issue
Block a user