调整宁波线路现地操作
This commit is contained in:
parent
af960cc011
commit
467a9cf982
@ -794,7 +794,7 @@ export default class Section extends Group {
|
||||
/** 空闲锁闭或者叫进路锁闭 */
|
||||
model.routeLock && this.routeLock();
|
||||
/** 轨道封锁 */
|
||||
// model.blockade = 1;
|
||||
model.blockade = 1;
|
||||
model.blockade && this.block();
|
||||
/** 非CBTC车占用 */
|
||||
model.nctOccupied && this.unCommunicationOccupied();
|
||||
|
@ -419,8 +419,10 @@ export default class Switch extends Group {
|
||||
this.setLossAction(true);
|
||||
}
|
||||
/** 道岔单锁 */
|
||||
model.singleLock = 1;
|
||||
model.singleLock && this.setMonolock();
|
||||
/** 道岔封锁 */
|
||||
// model.blockade = 1;
|
||||
model.blockade && this.block();
|
||||
/** 区段切除*/
|
||||
model.cutOff && this.setSwitchCutOff();
|
||||
|
@ -1,168 +0,0 @@
|
||||
<template>
|
||||
<el-dialog class="ningbo-01__systerm confirm-control" :title="title" :visible.sync="show" width="360px"
|
||||
:before-close="doClose" :zIndex="2000" :modal="false" :close-on-click-modal="false" append-to-body v-dialogDrag>
|
||||
<div class="context">
|
||||
<template v-for="(message, index) in messages">
|
||||
<span :key="index">{{message}}</span>
|
||||
</template>
|
||||
</div>
|
||||
<el-row justify="center" class="button-group">
|
||||
<el-col :span="10" :offset="2">
|
||||
<el-button :id="domIdConfirm" type="primary" :loading="loading" @click="commit">确定</el-button>
|
||||
</el-col>
|
||||
<el-col :span="8" :offset="4">
|
||||
<el-button :id="domIdCancel" @click="cancel">取 消</el-button>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<notice-info ref="noticeInfo"></notice-info>
|
||||
</el-dialog>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import { MapDeviceType, OperationEvent } from '@/scripts/ConstDic';
|
||||
import NoticeInfo from './childDialog/noticeInfo'
|
||||
|
||||
export default {
|
||||
name: 'ConfirmTrain',
|
||||
data() {
|
||||
return {
|
||||
dialogShow: false,
|
||||
loading: false,
|
||||
operate: {},
|
||||
messages: '',
|
||||
operation: null
|
||||
}
|
||||
},
|
||||
components: {
|
||||
NoticeInfo
|
||||
},
|
||||
computed: {
|
||||
show() {
|
||||
return this.dialogShow && !this.$store.state.menuOperation.break;
|
||||
},
|
||||
title() {
|
||||
if (this.operation === OperationEvent.Train.addTrainId.menu.operation) {
|
||||
return '添加列车识别号';
|
||||
} else if (this.operation === OperationEvent.Train.editTrainId.menu.operation) {
|
||||
return '修改列车识别号';
|
||||
} else if (this.operation === OperationEvent.Train.delTrainId.menu.operation) {
|
||||
return '删除列车识别号';
|
||||
} else if (this.operation === OperationEvent.Train.moveTrainId.menu.operation) {
|
||||
return '移动列车识别号';
|
||||
} else if (this.operation === OperationEvent.Train.switchTrainId.menu.operation) {
|
||||
return '交换列车识别号';
|
||||
} else if (this.operation === OperationEvent.Train.editTrainNo.menu.operation) {
|
||||
return '修改车组号'
|
||||
}
|
||||
},
|
||||
domIdCancel() {
|
||||
return this.dialogShow ? OperationEvent.Command.cancel.menu.domId : '';
|
||||
},
|
||||
domIdConfirm() {
|
||||
if (this.dialogShow) {
|
||||
if (this.operation === OperationEvent.Train.addTrainId.menu.operation) {
|
||||
/** 添加列车识别号*/
|
||||
return OperationEvent.Train.addTrainId.confirm.domId
|
||||
} else if (this.operation === OperationEvent.Train.editTrainId.menu.operation) {
|
||||
/** 修改列车识别号*/
|
||||
return OperationEvent.Train.editTrainId.confirm.domId
|
||||
} else if (this.operation === OperationEvent.Train.delTrainId.menu.operation) {
|
||||
/** 删除列车识别号*/
|
||||
return OperationEvent.Train.delTrainId.confirm.domId
|
||||
} else if (this.operation === OperationEvent.Train.moveTrainId.menu.operation) {
|
||||
/** 移动列车识别号*/
|
||||
return OperationEvent.Train.moveTrainId.confirm.domId
|
||||
} else if (this.operation === OperationEvent.Train.switchTrainId.menu.operation) {
|
||||
/** 交换列车识别号*/
|
||||
return OperationEvent.Train.switchTrainId.confirm.domId
|
||||
} else if (this.operation === OperationEvent.Train.editTrainNo.menu.operation) {
|
||||
/** 修改车组号*/
|
||||
return OperationEvent.Train.editTrainNo.confirm.domId
|
||||
}
|
||||
}
|
||||
},
|
||||
},
|
||||
mounted() {
|
||||
this.$nextTick(() => {
|
||||
this.$store.dispatch('training/tipReload');
|
||||
})
|
||||
},
|
||||
methods: {
|
||||
doShow(operate) {
|
||||
if (!this.dialogShow) {
|
||||
this.loading = false;
|
||||
this.operate = operate || {};
|
||||
this.messages = operate.messages;
|
||||
this.operation = operate.operation;
|
||||
}
|
||||
|
||||
this.dialogShow = true;
|
||||
this.$nextTick(function () {
|
||||
this.$store.dispatch('training/emitTipFresh');
|
||||
});
|
||||
},
|
||||
doClose() {
|
||||
this.loading = false;
|
||||
this.dialogShow = false;
|
||||
this.$store.dispatch('map/setTrainWindowShow', false);
|
||||
this.$store.dispatch('training/emitTipFresh');
|
||||
},
|
||||
commit() {
|
||||
if (this.operation === OperationEvent.Train.addTrainId.menu.operation) {
|
||||
this.routeSetting();
|
||||
} else if (this.operation === OperationEvent.Train.editTrainId.menu.operation) {
|
||||
this.routeSetting();
|
||||
} else if (this.operation === OperationEvent.Train.delTrainId.menu.operation) {
|
||||
this.routeSetting();
|
||||
} else if (this.operation === OperationEvent.Train.moveTrainId.menu.operation) {
|
||||
this.routeSetting();
|
||||
} else if (this.operation === OperationEvent.Train.switchTrainId.menu.operation) {
|
||||
this.routeSetting();
|
||||
} else if (this.operation === OperationEvent.Train.editTrainNo.menu.operation) {
|
||||
this.routeSetting();
|
||||
}
|
||||
},
|
||||
//进路设置
|
||||
routeSetting() {
|
||||
let operate = {
|
||||
send: true,
|
||||
type: this.operate.type,
|
||||
operation: OperationEvent.Train.addTrainId.confirm.operation,
|
||||
}
|
||||
|
||||
this.loading = true;
|
||||
this.$store.dispatch('training/next', operate).then(({ valid }) => {
|
||||
this.loading = false;
|
||||
if (valid) {
|
||||
this.doClose();
|
||||
}
|
||||
}).catch((error) => {
|
||||
this.loading = false;
|
||||
this.doClose();
|
||||
this.$refs.noticeInfo.doShow(operate);
|
||||
})
|
||||
},
|
||||
cancel() {
|
||||
let operate = {
|
||||
type: this.operate.type,
|
||||
operation: OperationEvent.Command.cancel.menu.operation,
|
||||
}
|
||||
|
||||
this.$store.dispatch('training/next', operate).then(({ valid }) => {
|
||||
if (valid) {
|
||||
this.doClose();
|
||||
}
|
||||
}).catch(error => {
|
||||
this.doClose();
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
</script>
|
||||
<style>
|
||||
.confirm-control .context {
|
||||
padding-bottom: 40px !important;
|
||||
border: 1px solid lightgray;
|
||||
}
|
||||
</style>
|
@ -1,438 +0,0 @@
|
||||
<template>
|
||||
<div>
|
||||
<el-dialog v-dialogDrag class="ningbo-01__systerm route-cmd-control" :title="title" :visible.sync="show" width="800px" :before-close="doClose" :z-index="2000" :modal="false" :close-on-click-modal="false">
|
||||
<div style="padding: 10px 20px; border: 1px solid lightgray;">
|
||||
<span class="base-label">命令信息</span>
|
||||
<el-form label-position="center" size="mini">
|
||||
<el-row>
|
||||
<el-col :span="8">
|
||||
<el-form-item label="类型" label-width="40px">
|
||||
<el-select v-model="operation" size="small" disabled>
|
||||
<el-option
|
||||
v-for="option in typeList"
|
||||
:key="option.code"
|
||||
:label="option.name"
|
||||
:value="option.code"
|
||||
/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="8">
|
||||
<el-form-item label="车站名称" label-width="80px">
|
||||
<el-input v-model="stationName" size="small" disabled />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="8">
|
||||
<el-form-item label="信号机名称" label-width="100px">
|
||||
<el-input v-model="signalName" size="small" disabled />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
</el-form>
|
||||
</div>
|
||||
<el-table
|
||||
ref="tempData"
|
||||
class="table"
|
||||
:data="tempData"
|
||||
border
|
||||
style="width: 100%"
|
||||
size="mini"
|
||||
highlight-current-row
|
||||
height="200"
|
||||
>
|
||||
<el-table-column prop="order" :width="50" label="序号" />
|
||||
<el-table-column prop="date" :width="160" label="时间" />
|
||||
<el-table-column prop="context" :width="180" label="执行过程" />
|
||||
<el-table-column prop="result" label="执行结果" />
|
||||
</el-table>
|
||||
<span class="notice">{{ message }}</span>
|
||||
<el-row class="button-group">
|
||||
<el-col :span="2" :offset="2">
|
||||
<el-button :id="domIdCommand" type="primary" :disabled="cmdDisabled[0]" @click="command">下达<span
|
||||
v-show="timeCountCommand>0"
|
||||
>({{ timeCountCommand }})</span></el-button>
|
||||
</el-col>
|
||||
<el-col :span="2" :offset="2">
|
||||
<el-button :id="domIdConfirm1" type="primary" :disabled="cmdDisabled[1]" @click="confirm1">确认1
|
||||
</el-button>
|
||||
</el-col>
|
||||
<el-col :span="2" :offset="2">
|
||||
<el-button :id="domIdConfirm2" type="primary" :disabled="cmdDisabled[2]" @click="confirm2">确认2<span
|
||||
v-show="timeCountConfirm>0"
|
||||
>({{ timeCountConfirm }})</span></el-button>
|
||||
</el-col>
|
||||
<el-col :span="2" :offset="2">
|
||||
<el-button :id="domIdStop" type="primary" :disabled="stpDisabled" @click="stop">中止</el-button>
|
||||
</el-col>
|
||||
<el-col :span="2" :offset="2">
|
||||
<el-button :id="domIdClose" @click="close">关闭</el-button>
|
||||
</el-col>
|
||||
</el-row>
|
||||
</el-dialog>
|
||||
<confirm-signal-unlock ref="confirmSignalUnlock" @setOperate="getOperate" />
|
||||
</div>
|
||||
</template>
|
||||
<script>
|
||||
import { MapDeviceType, OperationEvent } from '@/scripts/ConstDic';
|
||||
import { now } from '@/utils/date';
|
||||
import ConfirmSignalUnlock from './childDialog/confirmSignalUnlock';
|
||||
|
||||
export default {
|
||||
name: 'RouteCmdControl',
|
||||
components: {
|
||||
ConfirmSignalUnlock
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
dialogShow: false,
|
||||
backOperate: '',
|
||||
selected: '',
|
||||
order: 0,
|
||||
row: null,
|
||||
timer: null,
|
||||
operation: '',
|
||||
cmdDisabled: [true, true, true],
|
||||
stpDisabled: true,
|
||||
tempData: [],
|
||||
message: '',
|
||||
timeCountCommand: -1,
|
||||
timeCountConfirm: -1,
|
||||
stationName: '',
|
||||
signalName: ''
|
||||
};
|
||||
},
|
||||
computed: {
|
||||
typeList() {
|
||||
return [
|
||||
{ code: OperationEvent.Signal.unlock.menu.operation, name: '信号解封' },
|
||||
{ code: OperationEvent.Signal.guide.menu.operation, name: '办理引导进路' }
|
||||
];
|
||||
},
|
||||
show() {
|
||||
return this.dialogShow && !this.$store.state.menuOperation.break;
|
||||
},
|
||||
domIdCommand() {
|
||||
if (this.dialogShow) {
|
||||
if (this.operation == OperationEvent.Signal.unlock.menu.operation) {
|
||||
/** 信号解封*/
|
||||
return OperationEvent.Signal.unlock.order.domId;
|
||||
} else if (this.operation == OperationEvent.Signal.guide.menu.operation) {
|
||||
/** 办理引导进路*/
|
||||
return OperationEvent.Signal.guide.order.domId;
|
||||
}
|
||||
}
|
||||
},
|
||||
domIdConfirm1() {
|
||||
if (this.dialogShow) {
|
||||
if (this.operation == OperationEvent.Signal.unlock.menu.operation) {
|
||||
/** 信号解封*/
|
||||
return OperationEvent.Signal.unlock.confirm1.domId;
|
||||
} else if (this.operation == OperationEvent.Signal.guide.menu.operation) {
|
||||
/** 办理引导进路*/
|
||||
return OperationEvent.Signal.guide.confirm1.domId;
|
||||
}
|
||||
}
|
||||
},
|
||||
domIdConfirm2() {
|
||||
if (this.dialogShow) {
|
||||
if (this.operation == OperationEvent.Signal.unlock.menu.operation) {
|
||||
/** 信号解封*/
|
||||
return OperationEvent.Signal.unlock.confirm2.domId;
|
||||
} else if (this.operation == OperationEvent.Signal.guide.menu.operation) {
|
||||
/** 办理引导进路*/
|
||||
return OperationEvent.Signal.guide.confirm2.domId;
|
||||
}
|
||||
}
|
||||
},
|
||||
domIdStop() {
|
||||
if (this.dialogShow) {
|
||||
if (this.operation == OperationEvent.Signal.unlock.menu.operation) {
|
||||
/** 信号解封*/
|
||||
return OperationEvent.Signal.unlock.stop.domId;
|
||||
} else if (this.operation == OperationEvent.Signal.guide.menu.operation) {
|
||||
/** 办理引导进路*/
|
||||
return OperationEvent.Signal.guide.stop.domId;
|
||||
}
|
||||
}
|
||||
},
|
||||
domIdClose() {
|
||||
if (this.dialogShow) {
|
||||
return OperationEvent.Command.close.menu.domId;
|
||||
}
|
||||
},
|
||||
title() {
|
||||
if (this.dialogShow) {
|
||||
if (this.operation == OperationEvent.Signal.unlock.menu.operation) {
|
||||
return '信号解封';
|
||||
} else if (this.operation == OperationEvent.Signal.guide.menu.operation) {
|
||||
return '办理引导进路';
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
watch: {
|
||||
cmdDisabled: {
|
||||
handler(val, oldVal) {
|
||||
this.stpDisabled = true;
|
||||
val.forEach((elem, index) => {
|
||||
// 在确定1之前的操作才可以终止
|
||||
if (elem == false && index >= 1 && index <= 2) {
|
||||
this.stpDisabled = false;
|
||||
}
|
||||
});
|
||||
},
|
||||
deep: true
|
||||
}
|
||||
},
|
||||
mounted() {
|
||||
this.$nextTick(() => {
|
||||
this.$store.dispatch('training/tipReload');
|
||||
});
|
||||
this.timer = setInterval(() => {
|
||||
if (!this.$store.state.menuOperation.break) {
|
||||
if (this.timeCountCommand > 0) {
|
||||
this.timeCountCommand--;
|
||||
} else if (this.timeCountCommand == 0) {
|
||||
this.setButtonEnable({ step: 0 });
|
||||
this.timeCountCommand = -1;
|
||||
}
|
||||
if (this.timeCountConfirm > 0) {
|
||||
this.timeCountConfirm--;
|
||||
} else if (this.timeCountConfirm == 0) {
|
||||
this.setButtonEnable({ step: 0 });
|
||||
this.timeCountConfirm = -1;
|
||||
}
|
||||
}
|
||||
}, 1000);
|
||||
},
|
||||
beforeDestroy() {
|
||||
clearInterval(this.timer);
|
||||
this.timer = null;
|
||||
},
|
||||
methods: {
|
||||
doShow(operate, selected) {
|
||||
this.selected = selected;
|
||||
if (!this.dialogShow) {
|
||||
this.signalName = '';
|
||||
this.stationName = '';
|
||||
if (selected && selected._type.toUpperCase() === 'Signal'.toUpperCase()) {
|
||||
this.signalName = selected.name;
|
||||
const station = this.$store.getters['map/getDeviceByCode'](selected.stationCode);
|
||||
if (station) {
|
||||
this.stationName = station.name;
|
||||
}
|
||||
}
|
||||
|
||||
this.order = 0;
|
||||
this.operation = operate.operation;
|
||||
|
||||
this.tempData = [];
|
||||
this.timeCountCommand = -1;
|
||||
this.timeCountConfirm = -1;
|
||||
this.cmdDisabled = [false, true, true];
|
||||
}
|
||||
this.dialogShow = true;
|
||||
this.stpDisabled = true;
|
||||
this.setMessage('请点击“下达”按钮,下达命令!');
|
||||
this.$nextTick(function () {
|
||||
this.$store.dispatch('training/emitTipFresh');
|
||||
});
|
||||
},
|
||||
doClose() {
|
||||
this.dialogShow = false;
|
||||
this.$store.dispatch('training/emitTipFresh');
|
||||
this.mouseCancelState(this.selected);
|
||||
},
|
||||
command() {
|
||||
if (this.operation == OperationEvent.Signal.unlock.menu.operation) {
|
||||
/** 第一步带弹框处理*/
|
||||
this.commandHasPopUp();
|
||||
} else if (this.operation == OperationEvent.Signal.guide.menu.operation) {
|
||||
/** 第一步不带弹框处理*/
|
||||
this.commandNoPopUp();
|
||||
}
|
||||
},
|
||||
commandHasPopUp() {
|
||||
const operate = {
|
||||
type: MapDeviceType.Signal.type
|
||||
};
|
||||
|
||||
if (this.operation == OperationEvent.Signal.unlock.menu.operation) {
|
||||
/** 信号解封*/
|
||||
operate.operation = OperationEvent.Signal.unlock.order.operation;
|
||||
}
|
||||
|
||||
this.setMessage('请点击“确认1”按钮,确认命令!');
|
||||
this.writeRecord({ order: ++this.order, date: now(), context: '点击下达命令', result: '' });
|
||||
this.$store.dispatch('training/nextNew', operate).then(({ valid }) => {
|
||||
if (valid) {
|
||||
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
|
||||
if (this.operation == OperationEvent.Signal.unlock.menu.operation) {
|
||||
this.$refs.confirmSignalUnlock.doShow(operate, this.selected);
|
||||
}
|
||||
}
|
||||
});
|
||||
},
|
||||
commandNoPopUp() {
|
||||
const operate = {
|
||||
type: MapDeviceType.Signal.type
|
||||
};
|
||||
|
||||
if (this.operation == OperationEvent.Signal.guide.menu.operation) {
|
||||
/** 办理引导进路*/
|
||||
operate.operation = OperationEvent.Signal.guide.order.operation;
|
||||
}
|
||||
|
||||
this.setMessage('请点击“确认1”按钮,确认命令!');
|
||||
this.writeRecord({ order: ++this.order, date: now(), context: '点击下达命令', result: '' });
|
||||
this.$store.dispatch('training/nextNew', operate).then(({ valid }) => {
|
||||
if (valid) {
|
||||
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
|
||||
this.setButtonEnable({ step: 1 });
|
||||
this.editRecord({ order: this.order, date: now(), context: '点击下达命令', result: '执行成功' });
|
||||
} else {
|
||||
this.editRecord({ order: this.order, date: now(), context: '点击下达命令', result: '执行失败' });
|
||||
}
|
||||
}).catch(() => {
|
||||
this.editRecord({ order: this.order, date: now(), context: '点击下达命令', result: '执行异常' });
|
||||
});
|
||||
},
|
||||
confirm1() {
|
||||
const operate = {
|
||||
type: MapDeviceType.Signal.type
|
||||
};
|
||||
|
||||
if (this.operation == OperationEvent.Signal.unlock.menu.operation) {
|
||||
/** 信号解封*/
|
||||
operate.operation = OperationEvent.Signal.unlock.confirm1.operation;
|
||||
} else if (this.operation == OperationEvent.Signal.guide.menu.operation) {
|
||||
/** 办理引导进路*/
|
||||
operate.operation = OperationEvent.Signal.guide.confirm1.operation;
|
||||
}
|
||||
|
||||
this.setMessage('请点击“确认2”按钮,确认命令!');
|
||||
this.writeRecord({ order: ++this.order, date: now(), context: '点击确认1', result: '' });
|
||||
this.$store.dispatch('training/nextNew', operate).then(({ valid }) => {
|
||||
if (valid) {
|
||||
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
|
||||
this.timeCountCommand = -1;
|
||||
this.timeCountConfirm = 10;
|
||||
this.setButtonEnable({ step: 2 });
|
||||
this.editRecord({ order: this.order, date: now(), context: '点击确认1', result: '执行成功' });
|
||||
} else {
|
||||
this.editRecord({ order: this.order, date: now(), context: '点击确认1', result: '执行失败' });
|
||||
}
|
||||
}).catch(() => {
|
||||
this.editRecord({ order: this.order, date: now(), context: '点击确认1', result: '执行异常' });
|
||||
});
|
||||
},
|
||||
confirm2() {
|
||||
const operate = {
|
||||
send: true,
|
||||
type: MapDeviceType.Signal.type
|
||||
};
|
||||
|
||||
if (this.operation == OperationEvent.Signal.unlock.menu.operation) {
|
||||
/** 信号解封*/
|
||||
operate.operation = OperationEvent.Signal.unlock.confirm2.operation;
|
||||
} else if (this.operation == OperationEvent.Signal.guide.menu.operation) {
|
||||
/** 办理引导进路*/
|
||||
operate.operation = OperationEvent.Signal.guide.confirm2.operation;
|
||||
}
|
||||
this.setMessage('');
|
||||
this.writeRecord({ order: ++this.order, date: now(), context: '点击确认2', result: '' });
|
||||
this.$store.dispatch('training/nextNew', operate).then(({ valid }) => {
|
||||
this.timeCountCommand = -1;
|
||||
this.timeCountConfirm = -1;
|
||||
this.setButtonEnable({ step: -1 });
|
||||
if (valid) {
|
||||
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
|
||||
this.editRecord({ order: this.order, date: now(), context: '点击确认2', result: '执行成功' });
|
||||
} else {
|
||||
this.editRecord({ order: this.order, date: now(), context: '点击确认2', result: '执行失败' });
|
||||
}
|
||||
}).catch(() => {
|
||||
this.timeCountCommand = -1;
|
||||
this.timeCountConfirm = -1;
|
||||
this.setButtonEnable({ step: -1 });
|
||||
this.editRecord({ order: this.order, date: now(), context: '点击确认2', result: '执行异常' });
|
||||
});
|
||||
},
|
||||
stop() {
|
||||
const operate = {
|
||||
type: MapDeviceType.Signal.type
|
||||
};
|
||||
|
||||
if (this.operation == OperationEvent.Signal.unlock.menu.operation) {
|
||||
/** 信号解封*/
|
||||
operate.operation = OperationEvent.Signal.unlock.stop.operation;
|
||||
} else if (this.operation == OperationEvent.Signal.guide.menu.operation) {
|
||||
/** 办理引导进路*/
|
||||
operate.operation = OperationEvent.Signal.guide.stop.operation;
|
||||
}
|
||||
|
||||
this.writeRecord({ order: ++this.order, date: now(), context: '点击终止', result: '' });
|
||||
this.$store.dispatch('training/nextNew', operate).then(({ valid }) => {
|
||||
if (valid) {
|
||||
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
|
||||
this.setButtonEnable({ step: 0 });
|
||||
this.editRecord({ order: this.order, date: now(), context: '点击终止', result: '执行成功' });
|
||||
} else {
|
||||
this.editRecord({ order: this.order, date: now(), context: '点击终止', result: '执行失败' });
|
||||
}
|
||||
}).catch(error => {
|
||||
this.editRecord({ order: this.order, date: now(), context: '点击终止', result: '执行异常' });
|
||||
});
|
||||
},
|
||||
close() {
|
||||
const operate = {
|
||||
type: MapDeviceType.Signal.type,
|
||||
operation: OperationEvent.Command.close.menu.operation
|
||||
};
|
||||
|
||||
this.$store.dispatch('training/nextNew', operate).then(({ valid }) => {
|
||||
if (valid) {
|
||||
this.doClose();
|
||||
}
|
||||
}).catch(error => {
|
||||
this.doClose();
|
||||
});
|
||||
},
|
||||
getOperate(operate) {
|
||||
/** 弹框返回值处理*/
|
||||
if (this.operation == OperationEvent.Signal.unlock.menu.operation) {
|
||||
/** 信号解封*/
|
||||
this.backOperate = operate;
|
||||
this.setButtonEnable(operate);
|
||||
if (operate.success) {
|
||||
this.timeCountCommand = 30;
|
||||
this.editRecord({ order: this.order, date: now(), context: '点击下达命令', result: '确认成功' });
|
||||
} else {
|
||||
this.editRecord({ order: this.order, date: now(), context: '点击下达命令', result: '取消成功' });
|
||||
}
|
||||
}
|
||||
},
|
||||
setButtonEnable(param) {
|
||||
this.cmdDisabled = [true, true, true];
|
||||
if (param && param.step >= 0) {
|
||||
this.cmdDisabled[param.step] = false;
|
||||
}
|
||||
},
|
||||
setMessage(message) {
|
||||
this.message = message;
|
||||
},
|
||||
writeRecord(param) {
|
||||
this.tempData.push(param);
|
||||
},
|
||||
editRecord(param) {
|
||||
this.tempData.forEach(elem => {
|
||||
if (elem.order == param.order) {
|
||||
for (var prop in param) {
|
||||
elem[prop] = param[prop];
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
};
|
||||
</script>
|
@ -1,337 +0,0 @@
|
||||
<template>
|
||||
<el-dialog v-dialogDrag :z-index="2000" class="ningbo-01__systerm alxe-effective" :title="title" :visible.sync="show" width="420px" :before-close="doClose" :modal="false" :close-on-click-modal="false">
|
||||
<div style="padding: 10px 20px;border: 1px solid lightgray;">
|
||||
<span class="base-label">准备</span>
|
||||
<div style="margin-top: -10px">
|
||||
<el-row type="flex" justify="left">
|
||||
<el-col :span="18">区段设备</el-col>
|
||||
</el-row>
|
||||
<el-row type="flex" justify="left">
|
||||
<el-col :span="18">
|
||||
<el-input v-model="model.sectionName" :type="type" size="mini" :disabled="true" />
|
||||
</el-col>
|
||||
<el-col :span="4" :offset="1">
|
||||
<el-button :id="domIdConfirm1" size="mini" :disabled="type==='password'" @click="commitOnce">确认</el-button>
|
||||
</el-col>
|
||||
</el-row>
|
||||
</div>
|
||||
</div>
|
||||
<div style="padding: 10px 20px;border: 1px solid lightgray;margin-top: 10px">
|
||||
<span class="base-label">确认</span>
|
||||
<div style="margin-top: -10px">
|
||||
<el-row type="flex" justify="left">
|
||||
<el-col :span="18">区段</el-col>
|
||||
</el-row>
|
||||
<el-row type="flex" justify="left">
|
||||
<el-col :span="18">
|
||||
<el-select :id="domIdChoose2" v-model="model.confirmSectionName" filterable size="mini" :disabled="type==='text'" @change="sectionSelectChange">
|
||||
<el-option v-for="(option,index) in randomSectionList" :key="index" :label="option.name" :value="option.name" />
|
||||
</el-select>
|
||||
</el-col>
|
||||
<el-col :span="4" :offset="1">
|
||||
<el-button :id="domIdConfirm2" size="mini" :loading="loading" :disabled="type==='text'" @click="commit">确认</el-button>
|
||||
</el-col>
|
||||
</el-row>
|
||||
</div>
|
||||
</div>
|
||||
<el-row type="flex" justify="left" style="margin-top:20px;margin-bottom: 10px;">
|
||||
<el-col :span="6" :offset="1">操作倒计时</el-col>
|
||||
<el-col :span="16">
|
||||
<el-input v-model="model.time" size="mini" :readonly="true" />
|
||||
</el-col>
|
||||
</el-row>
|
||||
<el-row>
|
||||
<el-col :offset="1">状态</el-col>
|
||||
</el-row>
|
||||
<el-row>
|
||||
<el-col :offset="1" :span="23">
|
||||
<el-input v-model="model.status" type="textarea" :rows="2" placeholder />
|
||||
</el-col>
|
||||
</el-row>
|
||||
<el-row class="botton-group" style="margin-top:20px">
|
||||
<el-col :span="4" :offset="10">
|
||||
<el-button :id="domIdCancel" @click="cancel">关闭</el-button>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<notice-info ref="noticeInfo" />
|
||||
<popup-alarm ref="popupAlarm" />
|
||||
</el-dialog>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import { mapGetters } from 'vuex';
|
||||
import NoticeInfo from './childDialog/childDialog/noticeInfo';
|
||||
import PopupAlarm from './childDialog/popupAlarm';
|
||||
import { OperationEvent } from '@/scripts/cmdPlugin/OperationHandler';
|
||||
import CMD from '@/scripts/cmdPlugin/CommandEnum';
|
||||
|
||||
export default {
|
||||
name: 'AlxeEffective',
|
||||
components: {
|
||||
NoticeInfo,
|
||||
PopupAlarm
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
dialogShow: false,
|
||||
loading: false,
|
||||
type: 'text',
|
||||
timeout: 1000,
|
||||
timenum: 30,
|
||||
stepNum: 0,
|
||||
task: null,
|
||||
model: {
|
||||
sectionName: '',
|
||||
confirmSectionName: '',
|
||||
status: '',
|
||||
time: 0
|
||||
},
|
||||
selected: null,
|
||||
operate: null,
|
||||
operation: '',
|
||||
randomSectionList: []
|
||||
};
|
||||
},
|
||||
computed: {
|
||||
...mapGetters('map', ['stationList', 'sectionList']),
|
||||
show() {
|
||||
return this.dialogShow && !this.$store.state.menuOperation.break;
|
||||
},
|
||||
domIdConfirm1() {
|
||||
if (this.operation == OperationEvent.Section.fault.menu.operation) {
|
||||
return OperationEvent.Section.fault.confirm1.domId;
|
||||
} else if (this.operation == OperationEvent.Section.unlock.menu.operation) {
|
||||
return OperationEvent.Section.unlock.confirm1.domId;
|
||||
}
|
||||
return '';
|
||||
},
|
||||
domIdConfirm2() {
|
||||
if (this.operation == OperationEvent.Section.fault.menu.operation) {
|
||||
return OperationEvent.Section.fault.confirm2.domId;
|
||||
} else if (this.operation == OperationEvent.Section.unlock.menu.operation) {
|
||||
return OperationEvent.Section.unlock.confirm2.domId;
|
||||
}
|
||||
return '';
|
||||
},
|
||||
domIdChoose2() {
|
||||
if (this.operation == OperationEvent.Section.fault.menu.operation) {
|
||||
return OperationEvent.Section.fault.choose2.domId;
|
||||
} else if (this.operation == OperationEvent.Section.unlock.menu.operation) {
|
||||
return OperationEvent.Section.unlock.choose2.domId;
|
||||
}
|
||||
return '';
|
||||
},
|
||||
domIdCancel() {
|
||||
return this.dialogShow ? OperationEvent.Command.cancel.menu.domId : '';
|
||||
},
|
||||
title() {
|
||||
if (this.operation == OperationEvent.Section.fault.menu.operation) {
|
||||
return '区故解';
|
||||
} else if (this.operation == OperationEvent.Section.unlock.menu.operation) {
|
||||
return '解除封锁';
|
||||
}
|
||||
return '';
|
||||
}
|
||||
},
|
||||
watch: {
|
||||
'model.sectionName': function(name) {
|
||||
const index = Math.floor(Math.random(1) * 5);
|
||||
for (var i = 0; i < 5; i++) {
|
||||
if (i == index) {
|
||||
this.randomSectionList.push({ name });
|
||||
} else {
|
||||
const section = this.sectionList[
|
||||
Math.floor(Math.random(1) * this.sectionList.length)
|
||||
];
|
||||
if (section.type != '02') {
|
||||
if (
|
||||
this.randomSectionList.findIndex(it => {
|
||||
return it.name == section.name;
|
||||
}) < 0
|
||||
) {
|
||||
this.randomSectionList.push({ name: section.name });
|
||||
} else {
|
||||
i--;
|
||||
}
|
||||
} else {
|
||||
i--;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
mounted() {
|
||||
this.$nextTick(() => {
|
||||
this.$store.dispatch('training/tipReload');
|
||||
});
|
||||
},
|
||||
methods: {
|
||||
stopTask() {
|
||||
if (this.task) {
|
||||
clearInterval(this.task);
|
||||
this.task = null;
|
||||
}
|
||||
|
||||
if (this.stepNum < 3) {
|
||||
this.$store.dispatch('training/backSteps', this.stepNum);
|
||||
this.$store.dispatch('training/emitTipFresh');
|
||||
this.model.name = '';
|
||||
this.model.time = '';
|
||||
this.type = 'text';
|
||||
}
|
||||
},
|
||||
doShow(operate, selected) {
|
||||
this.selected = selected;
|
||||
this.operate = operate || {};
|
||||
this.operation = operate.operation;
|
||||
this.status = '';
|
||||
this.model.sectionName = '';
|
||||
this.model.confirmSectionName = '';
|
||||
if (selected) {
|
||||
if (selected && selected._type.toUpperCase() === 'Section'.toUpperCase()) {
|
||||
if (selected.isSwitchSection) {
|
||||
const section = this.$store.getters['map/getDeviceByCode'](selected.parentCode);
|
||||
if (section) {
|
||||
this.model.sectionName = section.name;
|
||||
}
|
||||
} else {
|
||||
const section = this.$store.getters['map/getDeviceByCode'](selected.parentCode);
|
||||
if (section) {
|
||||
this.model.sectionName = section.name;
|
||||
this.model.sectionName = `${section.name}-${selected.name}`;
|
||||
} else {
|
||||
this.model.sectionName = `${selected.name}`;
|
||||
}
|
||||
}
|
||||
} else if (selected._type.toUpperCase() === 'Switch'.toUpperCase()) {
|
||||
const section = this.$store.getters['map/getDeviceByCode'](selected.switchSectionCode);
|
||||
if (section) {
|
||||
this.model.sectionName = section.name;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
this.stepNum = 0;
|
||||
this.loading = false;
|
||||
this.dialogShow = true;
|
||||
this.stopTask();
|
||||
this.$nextTick(function() {
|
||||
this.$store.dispatch('training/emitTipFresh');
|
||||
});
|
||||
},
|
||||
doClose() {
|
||||
this.dialogShow = false;
|
||||
this.$store.dispatch('training/emitTipFresh');
|
||||
this.mouseCancelState(this.selected);
|
||||
},
|
||||
waitSelectEvent() {
|
||||
if (!this.$store.state.menuOperation.break) {
|
||||
this.model.time -= 1;
|
||||
if (this.model.time <= 0) {
|
||||
this.stopTask();
|
||||
}
|
||||
}
|
||||
},
|
||||
commitOnce() {
|
||||
this.stepNum = 1;
|
||||
const operate = {
|
||||
operation: ''
|
||||
};
|
||||
|
||||
if (this.operation == OperationEvent.Section.fault.menu.operation) {
|
||||
operate.operation = OperationEvent.Section.fault.confirm1.operation;
|
||||
} else if (this.operation == OperationEvent.Section.unlock.menu.operation) {
|
||||
operate.operation = OperationEvent.Section.unlock.confirm1.operation;
|
||||
}
|
||||
|
||||
this.$store.dispatch('training/nextNew', operate).then(({ valid }) => {
|
||||
if (valid) {
|
||||
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
|
||||
this.type = 'password';
|
||||
this.model.time = this.timenum;
|
||||
this.task = setInterval(this.waitSelectEvent, this.timeout);
|
||||
}
|
||||
});
|
||||
},
|
||||
sectionSelectChange() {
|
||||
if (this.model.confirmSectionName === this.model.sectionName) {
|
||||
this.stepNum = 2;
|
||||
} else {
|
||||
this.model.time = 0;
|
||||
}
|
||||
|
||||
const operate = {
|
||||
operation: ''
|
||||
};
|
||||
|
||||
if (this.operation == OperationEvent.Section.fault.menu.operation) {
|
||||
operate.operation = OperationEvent.Section.fault.choose2.operation;
|
||||
} else if (this.operation == OperationEvent.Section.unlock.menu.operation) {
|
||||
operate.operation = OperationEvent.Section.unlock.choose2.operation;
|
||||
}
|
||||
|
||||
this.$store.dispatch('training/nextNew', operate).then(({ valid }) => {
|
||||
this.$store.dispatch('menuOperation/handleBreakFlag', {
|
||||
break: true
|
||||
});
|
||||
});
|
||||
},
|
||||
commit() {
|
||||
const operate = {
|
||||
over: true,
|
||||
operation: '',
|
||||
cmdType: ''
|
||||
};
|
||||
|
||||
if (this.operation == OperationEvent.Section.fault.menu.operation) {
|
||||
operate.operation = OperationEvent.Section.fault.confirm2.operation;
|
||||
operate.cmdType = CMD.Section.CMD_SECTION_FAULT_UNLOCK;
|
||||
} else if (this.operation == OperationEvent.Section.unlock.menu.operation) {
|
||||
operate.operation = OperationEvent.Section.unlock.confirm2.operation;
|
||||
operate.cmdType = CMD.Section.CMD_SECTION_UNBLOCK;
|
||||
}
|
||||
|
||||
this.model.status = '';
|
||||
if (this.model.sectionName == this.model.confirmSectionName) {
|
||||
this.stepNum = 3;
|
||||
this.loading = true;
|
||||
this.$store.dispatch('training/nextNew', operate).then(({ valid }) => {
|
||||
this.loading = false;
|
||||
if (valid) {
|
||||
this.type = 'text';
|
||||
this.stopTask();
|
||||
this.doClose();
|
||||
// this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
|
||||
// this.$refs.popupAlarm.doShow(Object.assign(this.operate, {val: operate.val}), [`区段 ${this.model.sectionName}报告恢复计轴有效`]);
|
||||
}
|
||||
}).catch(() => {
|
||||
this.$refs.noticeInfo.doShow(operate);
|
||||
});
|
||||
} else {
|
||||
this.model.status = '区段选择错误';
|
||||
}
|
||||
},
|
||||
cancel() {
|
||||
const operate = {
|
||||
operation: OperationEvent.Command.cancel.menu.operation
|
||||
};
|
||||
|
||||
this.$store
|
||||
.dispatch('training/nextNew', operate)
|
||||
.then(({ valid }) => {
|
||||
if (valid) {
|
||||
this.doClose();
|
||||
}
|
||||
})
|
||||
.catch(() => {
|
||||
this.doClose();
|
||||
});
|
||||
}
|
||||
}
|
||||
};
|
||||
</script>
|
||||
<style rel="stylesheet/scss" lang="scss" scoped>
|
||||
.alxe-effective .context {
|
||||
height: 80px !important;
|
||||
}
|
||||
</style>
|
@ -22,7 +22,7 @@
|
||||
<el-input v-model="sectionName" size="small" disabled />
|
||||
</el-col>
|
||||
</el-row>
|
||||
<el-row style="margin-top: 10px;">
|
||||
<el-row style="margin-top: 10px;" v-if="isShow">
|
||||
<el-col :span="11">
|
||||
<el-radio v-model="radio" label="1" :disabled="radio == 2" style="display: block; text-align: center;">
|
||||
激活</el-radio>
|
||||
@ -61,6 +61,7 @@ export default {
|
||||
loading: false,
|
||||
selected: null,
|
||||
operation: '',
|
||||
isShow: false,
|
||||
stationName: '',
|
||||
sectionName: '',
|
||||
radio: ''
|
||||
@ -113,11 +114,13 @@ export default {
|
||||
}
|
||||
}
|
||||
this.operation = operate.operation || '';
|
||||
|
||||
this.isShow = false;
|
||||
if (this.operation == OperationEvent.Section.split.menu.operation) {
|
||||
this.radio = '2';
|
||||
this.isShow = true;
|
||||
} else if (this.operation == OperationEvent.Section.active.menu.operation) {
|
||||
this.radio = '1';
|
||||
this.isShow = true;
|
||||
}
|
||||
}
|
||||
this.dialogShow = true;
|
||||
@ -147,10 +150,33 @@ export default {
|
||||
lock() {
|
||||
const operate = {
|
||||
over: true,
|
||||
operation: OperationEvent.Section.lock.menu.operation,
|
||||
operation: this.operation,
|
||||
cmdType: CMD.Section.CMD_SECTION_BLOCK
|
||||
};
|
||||
|
||||
this.sendCommand(operate);
|
||||
},
|
||||
// 轨道区段切除
|
||||
split() {
|
||||
const operate = {
|
||||
over: true,
|
||||
operation: this.operation,
|
||||
cmdType: CMD.Section.CMD_SECTION_CUT_OFF
|
||||
};
|
||||
|
||||
this.sendCommand(operate);
|
||||
},
|
||||
// 轨道区段激活
|
||||
active() {
|
||||
const operate = {
|
||||
over: true,
|
||||
operation: this.operation,
|
||||
cmdType: CMD.Section.CMD_SECTION_ACTIVE
|
||||
};
|
||||
|
||||
this.sendCommand(operate);
|
||||
},
|
||||
sendCommand(operate) {
|
||||
this.loading = true;
|
||||
this.$store.dispatch('training/nextNew', operate).then(({ valid }) => {
|
||||
this.loading = false;
|
||||
@ -163,46 +189,6 @@ export default {
|
||||
this.$refs.noticeInfo.doShow(operate, error.message);
|
||||
});
|
||||
},
|
||||
// 轨道区段切除
|
||||
split() {
|
||||
const operate = {
|
||||
over: true,
|
||||
operation: OperationEvent.Section.split.menu.operation,
|
||||
cmdType: CMD.Section.CMD_SECTION_CUT_OFF
|
||||
};
|
||||
|
||||
this.loading = true;
|
||||
this.$store.dispatch('training/nextNew', operate).then(({ valid }) => {
|
||||
this.loading = false;
|
||||
if (valid) {
|
||||
this.doClose();
|
||||
}
|
||||
}).catch(() => {
|
||||
this.loading = false;
|
||||
this.doClose();
|
||||
this.$refs.noticeInfo.doShow(operate);
|
||||
});
|
||||
},
|
||||
// 轨道区段激活
|
||||
active() {
|
||||
const operate = {
|
||||
over: true,
|
||||
operation: OperationEvent.Section.active.menu.operation,
|
||||
cmdType: CMD.Section.CMD_SECTION_ACTIVE
|
||||
};
|
||||
|
||||
this.loading = true;
|
||||
this.$store.dispatch('training/nextNew', operate).then(({ valid }) => {
|
||||
this.loading = false;
|
||||
if (valid) {
|
||||
this.doClose();
|
||||
}
|
||||
}).catch(() => {
|
||||
this.loading = false;
|
||||
this.doClose();
|
||||
this.$refs.noticeInfo.doShow(operate);
|
||||
});
|
||||
},
|
||||
cancel() {
|
||||
const operate = {
|
||||
operation: OperationEvent.Command.cancel.menu.operation
|
||||
|
318
src/jmapNew/theme/ningbo_01/menus/dialog/sectionUnLock.vue
Normal file
318
src/jmapNew/theme/ningbo_01/menus/dialog/sectionUnLock.vue
Normal file
@ -0,0 +1,318 @@
|
||||
<template>
|
||||
<el-dialog
|
||||
v-dialogDrag
|
||||
class="ningbo-01__systerm stand-detain-train"
|
||||
:title="title"
|
||||
:visible.sync="show"
|
||||
width="380px"
|
||||
:before-close="doClose"
|
||||
:z-index="2000"
|
||||
:modal="false"
|
||||
:close-on-click-modal="false"
|
||||
>
|
||||
<div class="content cotnent_body">
|
||||
<span class="base-label" style="left: 2px;">操作</span>
|
||||
<div style="overflow: hidden;">
|
||||
<div>操作设备</div>
|
||||
<el-col :span="11">
|
||||
<el-input :value="messageText1" placeholder="" size="mini" disabled />
|
||||
</el-col>
|
||||
<el-col :span="8" :offset="1">
|
||||
<el-button :id="confirmId1" class="status_btn" :disabled="disabledConfirm1" @click="confirm1">确认
|
||||
</el-button>
|
||||
</el-col>
|
||||
</div>
|
||||
</div>
|
||||
<div class="content cotnent_body">
|
||||
<span class="base-label" style="left: 2px;">确认</span>
|
||||
<div style="overflow: hidden;">
|
||||
<div>操作设备</div>
|
||||
<el-col :span="11">
|
||||
<el-select :id="domIdChoose" v-model="messageText2" filterable size="mini" :disabled="disabledConfirm2" @change="SelectChange">
|
||||
<el-option v-for="option in sectionList" :key="option.code" :label="option.name" :value="option.name" />
|
||||
</el-select>
|
||||
</el-col>
|
||||
<el-col :span="8" :offset="1">
|
||||
<el-button :id="confirmId2" class="status_btn" :disabled="disabledConfirm2" @click="confirm2">确认
|
||||
</el-button>
|
||||
</el-col>
|
||||
</div>
|
||||
</div>
|
||||
<div class="body_cont">
|
||||
<el-col :span="7">
|
||||
<div class="text">操作倒计时</div>
|
||||
</el-col>
|
||||
<el-col :span="17">
|
||||
<div style="border: 2px inset #E9E9E9; height: 30px; width: 100%;">
|
||||
{{ timeCountConfirm == -1 ? '' : timeCountConfirm }}</div>
|
||||
</el-col>
|
||||
</div>
|
||||
<div class="body_cont">
|
||||
<div class="status_text">状态</div>
|
||||
<div class="textarea_content" />
|
||||
</div>
|
||||
|
||||
<el-button :id="domIdConfirm" class="close_btn" type="primary" @click="commit">关闭</el-button>
|
||||
<notice-info ref="noticeInfo" />
|
||||
</el-dialog>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import { mapGetters } from 'vuex';
|
||||
import NoticeInfo from './childDialog/childDialog/noticeInfo';
|
||||
import { OperationEvent } from '@/scripts/cmdPlugin/OperationHandler';
|
||||
import CMD from '@/scripts/cmdPlugin/CommandEnum';
|
||||
|
||||
export default {
|
||||
name: 'StandDetainTrain',
|
||||
components: {
|
||||
NoticeInfo
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
dialogShow: false,
|
||||
selected: null,
|
||||
operation: null,
|
||||
|
||||
messageText1: '',
|
||||
messageText2: '',
|
||||
timeCountConfirm: -1,
|
||||
disabledConfirm1: false,
|
||||
disabledConfirm2: true
|
||||
};
|
||||
},
|
||||
computed: {
|
||||
...mapGetters('map', [
|
||||
'sectionList'
|
||||
]),
|
||||
show() {
|
||||
return this.dialogShow && !this.$store.state.menuOperation.break;
|
||||
},
|
||||
domIdChoose() {
|
||||
return this.dialogShow ? OperationEvent.Section.unlock.choose.domId : '';
|
||||
},
|
||||
confirmId1() {
|
||||
return this.dialogShow ? OperationEvent.Section.unlock.confirm1.domId : '';
|
||||
},
|
||||
confirmId2() {
|
||||
return this.dialogShow ? OperationEvent.Section.unlock.confirm2.domId : '';
|
||||
},
|
||||
domIdConfirm() {
|
||||
return this.dialogShow ? OperationEvent.Section.unlock.confirm.domId : '';
|
||||
},
|
||||
title() {
|
||||
if (this.operation == OperationEvent.Section.unlock.menu.operation) {
|
||||
return '解除封锁';
|
||||
} else if (this.operation == OperationEvent.Section.fault.menu.operation) {
|
||||
return '区故解';
|
||||
}
|
||||
return '';
|
||||
}
|
||||
},
|
||||
mounted() {
|
||||
this.$nextTick(() => {
|
||||
this.$store.dispatch('training/tipReload');
|
||||
});
|
||||
this.timer = setInterval(() => {
|
||||
if (this.timeCountConfirm > 0) {
|
||||
this.timeCountConfirm--;
|
||||
} else if (this.timeCountConfirm == 0) { // 关闭会话
|
||||
this.timeCountConfirm = -1;
|
||||
this.disabledConfirm2 = true;
|
||||
}
|
||||
}, 1000);
|
||||
},
|
||||
methods: {
|
||||
doShow(operate, selected) {
|
||||
this.selected = selected;
|
||||
if (!this.dialogShow) {
|
||||
this.messageText1 = selected.name;
|
||||
|
||||
this.operation = operate.operation;
|
||||
}
|
||||
this.dialogShow = true;
|
||||
this.$nextTick(function () {
|
||||
this.$store.dispatch('training/emitTipFresh');
|
||||
});
|
||||
},
|
||||
doClose() {
|
||||
this.dialogShow = false;
|
||||
this.$store.dispatch('training/emitTipFresh');
|
||||
this.mouseCancelState(this.selected);
|
||||
},
|
||||
|
||||
SelectChange() {
|
||||
const operate = {
|
||||
operation: '',
|
||||
val: this.messageText2
|
||||
};
|
||||
|
||||
if (this.operation == OperationEvent.Section.unlock.menu.operation) {
|
||||
operate.operation = OperationEvent.Section.unlock.choose.operation;
|
||||
} else if (this.operation == OperationEvent.Section.fault.menu.operation) {
|
||||
operate.operation = OperationEvent.Section.fault.choose.operation;
|
||||
}
|
||||
|
||||
this.$store.dispatch('training/nextNew', operate).then(({ valid }) => {
|
||||
if (valid) {
|
||||
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
|
||||
}
|
||||
}).catch((error) => {
|
||||
this.$refs.noticeInfo.doShow(operate, error.message);
|
||||
});
|
||||
},
|
||||
|
||||
confirm1() {
|
||||
const operate = {
|
||||
operation: ''
|
||||
};
|
||||
|
||||
if (this.operation == OperationEvent.Section.unlock.menu.operation) {
|
||||
operate.operation = OperationEvent.Section.unlock.confirm1.operation;
|
||||
} else if (this.operation == OperationEvent.Section.fault.menu.operation) {
|
||||
operate.operation = OperationEvent.Section.fault.confirm1.operation;
|
||||
}
|
||||
|
||||
this.$store.dispatch('training/nextNew', operate).then(({ valid }) => {
|
||||
if (valid) {
|
||||
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
|
||||
this.messageText1 = '*****';
|
||||
this.messageText2 = '';
|
||||
this.disabledConfirm1 = true;
|
||||
this.disabledConfirm2 = false;
|
||||
this.timeCountConfirm = 60; // 倒计时
|
||||
}
|
||||
}).catch((error) => {
|
||||
this.$refs.noticeInfo.doShow(operate, error.message);
|
||||
});
|
||||
},
|
||||
confirm2() {
|
||||
const operate = {
|
||||
operation: '',
|
||||
cmdType: ''
|
||||
};
|
||||
|
||||
if (this.operation == OperationEvent.Section.unlock.menu.operation) {
|
||||
operate.operation = OperationEvent.Section.unlock.confirm2.operation;
|
||||
operate.cmdType = CMD.Section.CMD_SECTION_UNBLOCK
|
||||
} else if (this.operation == OperationEvent.Section.fault.menu.operation) {
|
||||
operate.operation = OperationEvent.Section.fault.confirm2.operation;
|
||||
operate.cmdType = CMD.Section.CMD_SECTION_FAULT_UNLOCK
|
||||
}
|
||||
|
||||
this.$store.dispatch('training/nextNew', operate).then(({ valid }) => {
|
||||
if (valid) {
|
||||
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
|
||||
this.messageText2 = '*****';
|
||||
this.disabledConfirm2 = true;
|
||||
this.timeCountConfirm = -1;
|
||||
}
|
||||
}).catch((error) => {
|
||||
this.$refs.noticeInfo.doShow(operate, error.message);
|
||||
});
|
||||
},
|
||||
commit() {
|
||||
const operate = {
|
||||
over: true,
|
||||
operation: '',
|
||||
};
|
||||
|
||||
if (this.operation == OperationEvent.Section.unlock.menu.operation) {
|
||||
operate.operation = OperationEvent.Section.unlock.confirm.operation;
|
||||
} else if (this.operation == OperationEvent.Section.fault.menu.operation) {
|
||||
operate.operation = OperationEvent.Section.fault.confirm.operation;
|
||||
}
|
||||
|
||||
this.$store.dispatch('training/nextNew', operate).then(({ valid }) => {
|
||||
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
|
||||
this.doClose();
|
||||
}).catch((error) => {
|
||||
this.doClose();
|
||||
this.$refs.noticeInfo.doShow(operate, error.message);
|
||||
});
|
||||
}
|
||||
}
|
||||
};
|
||||
</script>
|
||||
<style scoped lang="scss">
|
||||
.stand-detain-train {
|
||||
|
||||
.content {
|
||||
width: 100%;
|
||||
border: 1px solid lightgray;
|
||||
padding: 18px 5px;
|
||||
position: relative;
|
||||
height: 80px !important;
|
||||
|
||||
.base-label {
|
||||
position: absolute;
|
||||
top: -8px;
|
||||
left: 20px;
|
||||
background-color: #F0F0F0;
|
||||
padding: 0 5px;
|
||||
}
|
||||
|
||||
.el-button {
|
||||
width: 100%;
|
||||
line-height: 28px;
|
||||
}
|
||||
|
||||
.status_btn {
|
||||
width: 110px;
|
||||
margin: 15px auto 0;
|
||||
display: block;
|
||||
}
|
||||
|
||||
}
|
||||
.head_content {
|
||||
height: 110px;
|
||||
margin-bottom: 10px;
|
||||
}
|
||||
|
||||
.cotnent_body {
|
||||
margin-bottom: 10px;
|
||||
|
||||
.text {
|
||||
line-height: 30px;
|
||||
text-align: center;
|
||||
font-size: 15px;
|
||||
}
|
||||
|
||||
.status_btn {
|
||||
width: 80px;
|
||||
margin: 0 auto
|
||||
}
|
||||
}
|
||||
|
||||
.close_btn {
|
||||
margin: 0 auto;
|
||||
width: 80px;
|
||||
display: block;
|
||||
}
|
||||
|
||||
.body_cont {
|
||||
margin-bottom: 10px;
|
||||
padding: 0 3px;
|
||||
overflow: hidden;
|
||||
|
||||
.text {
|
||||
line-height: 30px;
|
||||
text-align: center;
|
||||
font-size: 15px;
|
||||
}
|
||||
|
||||
.status_text {
|
||||
margin-bottom: 3px;
|
||||
font-size: 14px;
|
||||
padding-left: 8px;
|
||||
}
|
||||
|
||||
.textarea_content {
|
||||
height: 85px;
|
||||
width: 100%;
|
||||
border: 2px solid #E9E9E9;
|
||||
box-shadow: 2px 2px #959595 inset;
|
||||
}
|
||||
}
|
||||
}
|
||||
</style>
|
@ -1,897 +0,0 @@
|
||||
<template>
|
||||
<div>
|
||||
<el-dialog
|
||||
v-dialogDrag
|
||||
class="ningbo-01__systerm section-cmd-speed"
|
||||
:title="title"
|
||||
:visible.sync="show"
|
||||
width="800px"
|
||||
:before-close="doClose"
|
||||
:z-index="2000"
|
||||
:modal="false"
|
||||
:close-on-click-modal="false"
|
||||
>
|
||||
<div style="padding: 10px 20px 2px; margin-bottom: 25px; border: 1px solid lightgray;">
|
||||
<span class="base-label">会话管理</span>
|
||||
<el-form label-position="center" size="mini" style="margin-top: -15px;">
|
||||
<el-row>
|
||||
<el-col :span="3">
|
||||
<el-button type="primary" style="width: 110px; line-height: 26px;" @click="commit">查询会话状态
|
||||
</el-button>
|
||||
</el-col>
|
||||
<el-col :span="11" :offset="1">
|
||||
<el-input v-model="dialogueStatus" size="mini" disabled />
|
||||
</el-col>
|
||||
<el-col :span="3" :offset="1">
|
||||
<el-button
|
||||
:id="openConversationId"
|
||||
type="primary"
|
||||
style="width: 110px; line-height: 26px;"
|
||||
:disabled="!isOpenMessage"
|
||||
@click="openMessage('open')"
|
||||
>打开会话
|
||||
</el-button>
|
||||
</el-col>
|
||||
<el-col :span="3" :offset="1">
|
||||
<el-button
|
||||
:id="closeConversationId"
|
||||
type="primary"
|
||||
style="width: 110px; line-height: 26px;"
|
||||
:disabled="isOpenMessage"
|
||||
@click="openMessage('close')"
|
||||
>关闭会话
|
||||
</el-button>
|
||||
</el-col>
|
||||
</el-row>
|
||||
</el-form>
|
||||
</div>
|
||||
<div style="margin-bottom: 15px;">
|
||||
<el-row>
|
||||
<el-col :span="15">
|
||||
<div style="padding: 12px 8px 8px; height: 170px; border: 1px solid lightgray;">
|
||||
<div style="float: left; width: 20%; padding: 25px 8px 0;">
|
||||
<div style="margin-bottom: 5px;">限速数值</div>
|
||||
<el-select
|
||||
:id="firstLimitSpeedId"
|
||||
v-model="firstScetion.speed"
|
||||
size="mini"
|
||||
:disabled="spdDisabled"
|
||||
placeholder=""
|
||||
@change="changeSelect(firstScetion.speed, '1')"
|
||||
>
|
||||
<el-option
|
||||
v-for="item in speedList"
|
||||
:key="item.value"
|
||||
:label="item.name"
|
||||
:value="item.value"
|
||||
/>
|
||||
</el-select>
|
||||
</div>
|
||||
<div
|
||||
style="float: left; width: 29%; margin-left: 1%; border: 1px solid lightgray; padding:8px;"
|
||||
>
|
||||
<span class="base-label" style="left: 0px;">起点</span>
|
||||
<div style="margin-bottom: 5px;">区间选择</div>
|
||||
<el-select
|
||||
:id="firstStartSectionId"
|
||||
v-model="firstScetion.startSection"
|
||||
size="mini"
|
||||
:disabled="spdDisabled"
|
||||
placeholder=""
|
||||
@change="changeSelect(firstScetion.startSection, '2')"
|
||||
>
|
||||
<el-option
|
||||
v-for="item in regionList"
|
||||
:key="item.value"
|
||||
:label="item.label"
|
||||
:value="item.value"
|
||||
/>
|
||||
</el-select>
|
||||
<div style="margin-bottom: 5px;margin-top: 5px;">公里标数值(m)</div>
|
||||
<el-input
|
||||
:id="firstStartvalueId"
|
||||
v-model="firstScetion.startValue"
|
||||
:min="0"
|
||||
size="mini"
|
||||
:disabled="spdDisabled"
|
||||
@blur="changeSelect(firstScetion.startValue, '3')"
|
||||
/>
|
||||
</div>
|
||||
<div
|
||||
style="float: left; width: 29%; margin-left: 1%; border: 1px solid lightgray; padding:8px;"
|
||||
>
|
||||
<span class="base-label" style="left: 0px;">终点</span>
|
||||
<div style="margin-bottom: 5px;">区间选择</div>
|
||||
<el-select
|
||||
:id="firstEndSectionId"
|
||||
v-model="firstScetion.endSection"
|
||||
size="mini"
|
||||
:disabled="spdDisabled"
|
||||
placeholder=""
|
||||
@change="changeSelect(firstScetion.endSection, '4')"
|
||||
>
|
||||
<el-option
|
||||
v-for="item in regionList"
|
||||
:key="item.value"
|
||||
:label="item.label"
|
||||
:value="item.value"
|
||||
/>
|
||||
</el-select>
|
||||
<div style="margin-bottom: 5px; margin-top: 5px;">公里标数值(m)</div>
|
||||
<el-input
|
||||
:id="firstEndvalueId"
|
||||
v-model="firstScetion.endValue"
|
||||
:min="0"
|
||||
size="mini"
|
||||
:disabled="spdDisabled"
|
||||
@blur="changeSelect(firstScetion.endValue, '5')"
|
||||
/>
|
||||
</div>
|
||||
<div style="float: left; width: 20%; padding:8px;">
|
||||
<el-button
|
||||
:id="firstCheckId"
|
||||
type="primary"
|
||||
style="width: 90px; margin: 18px 0 20px; line-height: 26px;"
|
||||
:disabled="spdDisabled"
|
||||
@click="CheckEquipment"
|
||||
>查看设备
|
||||
</el-button>
|
||||
<el-button
|
||||
:id="firstComfirmId"
|
||||
type="primary"
|
||||
style="width: 90px; margin: 0; line-height: 26px;"
|
||||
:disabled="firstDisabled"
|
||||
@click="Confirmed"
|
||||
>首次确认
|
||||
</el-button>
|
||||
</div>
|
||||
</div>
|
||||
</el-col>
|
||||
<el-col :span="9">
|
||||
<div style="padding: 8px; height: 170px; border: 1px solid lightgray; margin-left: 10px;">
|
||||
<span class="base-label" style="left: 4px; background: #f0f0f0;">设备列表:</span>
|
||||
<div style="height: 100%; margin-top: -14px; border: 2px inset #E9E9E9; overflow-y: auto">
|
||||
<div v-for="(item,i) in equipmentText" :key="i">
|
||||
{{ item.name }}: {{ item.text }}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</el-col>
|
||||
</el-row>
|
||||
</div>
|
||||
<div style="margin-bottom: 15px;">
|
||||
<el-row>
|
||||
<el-col :span="15">
|
||||
<div style="padding: 12px 8px 8px; height: 170px; border: 1px solid lightgray;">
|
||||
<div style="float: left; width: 20%; padding: 25px 8px 0;">
|
||||
<div style="margin-bottom: 5px;">限速数值</div>
|
||||
<el-select
|
||||
:id="secondLimitSpeedId"
|
||||
v-model="secondScetion.speed"
|
||||
size="mini"
|
||||
:disabled="stpDisabled"
|
||||
placeholder=""
|
||||
@change="changeSelect(secondScetion.speed, '6')"
|
||||
>
|
||||
<el-option
|
||||
v-for="item in speedList"
|
||||
:key="item.value"
|
||||
:label="item.name"
|
||||
:value="item.value"
|
||||
/>
|
||||
</el-select>
|
||||
</div>
|
||||
<div
|
||||
style="float: left; width: 29%; margin-left: 1%; border: 1px solid lightgray; padding:8px;"
|
||||
>
|
||||
<span class="base-label" style="left: 0px;">起点</span>
|
||||
<div style="margin-bottom: 5px;">区间选择</div>
|
||||
<el-select
|
||||
:id="secondStartSectionId"
|
||||
v-model="secondScetion.startSection"
|
||||
size="mini"
|
||||
:disabled="stpDisabled"
|
||||
placeholder=""
|
||||
@change="changeSelect(secondScetion.startSection, '7')"
|
||||
>
|
||||
<el-option
|
||||
v-for="item in regionList"
|
||||
:key="item.value"
|
||||
:label="item.label"
|
||||
:value="item.value"
|
||||
/>
|
||||
</el-select>
|
||||
<div style="margin-bottom: 5px;margin-top: 5px;">公里标数值(m)</div>
|
||||
<el-select
|
||||
:id="secondStartvalueId"
|
||||
v-model="secondScetion.startValue"
|
||||
size="mini"
|
||||
:disabled="stpDisabled"
|
||||
placeholder=""
|
||||
@change="changeSelect(secondScetion.startValue, '8')"
|
||||
>
|
||||
<el-option
|
||||
v-for="item in startSectionList"
|
||||
:key="item.value"
|
||||
:label="item.label"
|
||||
:value="item.value"
|
||||
/>
|
||||
</el-select>
|
||||
</div>
|
||||
<div
|
||||
style="float: left; width: 29%; margin-left: 1%; border: 1px solid lightgray; padding:8px;"
|
||||
>
|
||||
<span class="base-label" style="left: 0px;">终点</span>
|
||||
<div style="margin-bottom: 5px;">区间选择</div>
|
||||
<el-select
|
||||
:id="secondEndSectionId"
|
||||
v-model="secondScetion.endSection"
|
||||
size="mini"
|
||||
:disabled="stpDisabled"
|
||||
placeholder=""
|
||||
@change="changeSelect(secondScetion.endSection, '9')"
|
||||
>
|
||||
<el-option
|
||||
v-for="item in regionList"
|
||||
:key="item.value"
|
||||
:label="item.label"
|
||||
:value="item.value"
|
||||
/>
|
||||
</el-select>
|
||||
<div style="margin-bottom: 5px; margin-top: 5px;">公里标数值(m)</div>
|
||||
<el-select
|
||||
:id="secondEndvalueId"
|
||||
v-model="secondScetion.endValue"
|
||||
size="mini"
|
||||
:disabled="stpDisabled"
|
||||
placeholder=""
|
||||
@change="changeSelect(secondScetion.endValue, '10')"
|
||||
>
|
||||
<el-option
|
||||
v-for="item in endSectionList"
|
||||
:key="item.value"
|
||||
:label="item.label"
|
||||
:value="item.value"
|
||||
/>
|
||||
</el-select>
|
||||
</div>
|
||||
<div style="float: left; width: 20%; padding:8px;">
|
||||
<el-button
|
||||
:id="secondCheckId"
|
||||
type="primary"
|
||||
style="width: 90px; margin: 18px 0 20px; line-height: 26px;"
|
||||
@click="CheckSecondEquipment"
|
||||
>查看设备
|
||||
</el-button>
|
||||
<el-button
|
||||
:id="secondComfirmId"
|
||||
type="primary"
|
||||
style="width: 90px; margin: 0; line-height: 26px;"
|
||||
:disabled="secondDisabled"
|
||||
@click="confirm"
|
||||
>确认发送
|
||||
</el-button>
|
||||
</div>
|
||||
</div>
|
||||
</el-col>
|
||||
<el-col :span="9">
|
||||
<div style="padding: 8px; height: 170px; border: 1px solid lightgray; margin-left: 10px;">
|
||||
<span class="base-label" style="left: 4px; background: #f0f0f0;">设备列表:</span>
|
||||
<div style="height: 100%; margin-top: -14px; border: 2px inset #E9E9E9; overflow-y: auto">
|
||||
<div v-for="(item,i) in equipmentText1" :key="i">
|
||||
{{ item.name }}: {{ item.text }}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</el-col>
|
||||
</el-row>
|
||||
</div>
|
||||
<el-row>
|
||||
<el-col :span="5">
|
||||
<div style="float: left; height: 30px; line-height: 30px; margin-right:10px;">操作倒计时</div>
|
||||
<div style="border: 2px inset #E9E9E9; height: 30px; width: 45px;float: left;">
|
||||
{{ timeCountConfirm == -1 ? '' : timeCountConfirm }}</div>
|
||||
</el-col>
|
||||
<el-col :span="19">
|
||||
<div style="float: left; height: 30px; line-height: 30px; margin-right:10px;">状态</div>
|
||||
<div style="border: 2px inset #E9E9E9; height: 30px; width: calc(100% - 38px);float: left;">
|
||||
{{ messageStatus }}</div>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<el-row class="button-group">
|
||||
<el-button :id="domIdClose" style="margin: 0px auto; display: block;" @click="close">关闭</el-button>
|
||||
</el-row>
|
||||
</el-dialog>
|
||||
<confirm-tip ref="ConfirmTip" @close="closeMessage" />
|
||||
</div>
|
||||
</template>
|
||||
<script>
|
||||
import { OperationEvent } from '@/scripts/ConstDic';
|
||||
// import { now } from '@/utils/date';
|
||||
import ConfirmTip from './childDialog/confirmTip';
|
||||
import { sendCommand } from '@/api/jmap/training';
|
||||
import router from '@/router';
|
||||
|
||||
export default {
|
||||
name: 'SectionCmdSpeed',
|
||||
components: {
|
||||
ConfirmTip
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
dialogShow: false,
|
||||
selected: '',
|
||||
order: 0,
|
||||
code: '',
|
||||
row: null,
|
||||
timer: null,
|
||||
type: '',
|
||||
operation: '',
|
||||
spdDisabled: true,
|
||||
firstDisabled: true,
|
||||
secondDisabled: true,
|
||||
stpDisabled: true,
|
||||
timeCountCommand: -1,
|
||||
timeCountConfirm: -1,
|
||||
equipmentText: [],
|
||||
equipmentText1: [],
|
||||
maxSpeed: 85,
|
||||
speedSpace: 5,
|
||||
stationName: '111',
|
||||
name: '',
|
||||
speed: '',
|
||||
regionList: [],
|
||||
startSectionList: [],
|
||||
endSectionList: [],
|
||||
sectionList: [
|
||||
{
|
||||
value: 'up',
|
||||
name: '上行'
|
||||
},
|
||||
{
|
||||
value: 'down',
|
||||
name: '下行'
|
||||
}
|
||||
],
|
||||
messageStatus: '请先打开会话!',
|
||||
dialogueStatus: '会话已关闭',
|
||||
isOpenMessage: true,
|
||||
codeText: '',
|
||||
firstScetion: {
|
||||
speed: '',
|
||||
startSection: '',
|
||||
endSection: '',
|
||||
startValue: '',
|
||||
endValue: ''
|
||||
},
|
||||
firstShow: false,
|
||||
copyScetion: {
|
||||
speed: '',
|
||||
startSection: '',
|
||||
endSection: '',
|
||||
startValue: '',
|
||||
endValue: ''
|
||||
},
|
||||
secondScetion: {
|
||||
speed: '',
|
||||
startSection: '',
|
||||
endSection: '',
|
||||
startValue: '',
|
||||
endValue: ''
|
||||
}
|
||||
};
|
||||
},
|
||||
computed: {
|
||||
speedList() {
|
||||
const list = [{ value: -1, name: '无限速' }];
|
||||
for (var i = 5; i * this.speedSpace <= this.maxSpeed; i++) {
|
||||
list.push({ value: String(i * this.speedSpace), name: String(i * this.speedSpace) });
|
||||
}
|
||||
return list;
|
||||
},
|
||||
title() {
|
||||
return this.dialogShow ? '公里标输入临时限速' : '';
|
||||
},
|
||||
show() {
|
||||
return this.dialogShow && !this.$store.state.menuOperation.break;
|
||||
},
|
||||
openConversationId() {
|
||||
return this.dialogShow ? OperationEvent.Section.setLimitSpeed.openConversation.domId : '';
|
||||
},
|
||||
closeConversationId() {
|
||||
return this.dialogShow ? OperationEvent.Section.setLimitSpeed.closeConversation.domId : '';
|
||||
},
|
||||
firstLimitSpeedId() {
|
||||
return this.dialogShow ? OperationEvent.Section.setLimitSpeed.firstLimitSpeed.domId : '';
|
||||
},
|
||||
firstStartSectionId() {
|
||||
return this.dialogShow ? OperationEvent.Section.setLimitSpeed.firstStartSection.domId : '';
|
||||
},
|
||||
firstStartvalueId() {
|
||||
return this.dialogShow ? OperationEvent.Section.setLimitSpeed.firstStartvalue.domId : '';
|
||||
},
|
||||
firstEndSectionId() {
|
||||
return this.dialogShow ? OperationEvent.Section.setLimitSpeed.firstEndSection.domId : '';
|
||||
},
|
||||
firstEndvalueId() {
|
||||
return this.dialogShow ? OperationEvent.Section.setLimitSpeed.firstEndvalue.domId : '';
|
||||
},
|
||||
firstCheckId() {
|
||||
return this.dialogShow ? OperationEvent.Section.setLimitSpeed.firstCheck.domId : '';
|
||||
},
|
||||
firstComfirmId() {
|
||||
return this.dialogShow ? OperationEvent.Section.setLimitSpeed.firstComfirm.domId : '';
|
||||
},
|
||||
secondLimitSpeedId() {
|
||||
return this.dialogShow ? OperationEvent.Section.setLimitSpeed.secondLimitSpeed.domId : '';
|
||||
},
|
||||
secondStartSectionId() {
|
||||
return this.dialogShow ? OperationEvent.Section.setLimitSpeed.secondStartSection.domId : '';
|
||||
},
|
||||
secondStartvalueId() {
|
||||
return this.dialogShow ? OperationEvent.Section.setLimitSpeed.secondStartvalue.domId : '';
|
||||
},
|
||||
secondEndSectionId() {
|
||||
return this.dialogShow ? OperationEvent.Section.setLimitSpeed.secondEndSection.domId : '';
|
||||
},
|
||||
secondEndvalueId() {
|
||||
return this.dialogShow ? OperationEvent.Section.setLimitSpeed.secondEndvalue.domId : '';
|
||||
},
|
||||
secondCheckId() {
|
||||
return this.dialogShow ? OperationEvent.Section.setLimitSpeed.secondCheck.domId : '';
|
||||
},
|
||||
secondComfirmId() {
|
||||
return this.dialogShow ? OperationEvent.Section.confirmLimit.menu.domId : '';
|
||||
},
|
||||
domIdClose() {
|
||||
return this.dialogShow ? OperationEvent.Section.setLimitSpeed.domIdClose.domId : '';
|
||||
}
|
||||
},
|
||||
watch: {
|
||||
'timeCountCommand': function (val) {
|
||||
if (val <= 0) {
|
||||
this.dialogueStatus = `会话已关闭`;
|
||||
// this.openMessage('close');
|
||||
this.isOpenMessage = true;
|
||||
this.spdDisabled = true;
|
||||
this.firstDisabled = true;
|
||||
this.secondDisabled = true;
|
||||
this.messageStatus = '请先打开会话!';
|
||||
this.timeCountCommand = -1;
|
||||
if (this.speed) {
|
||||
this.messageStatus = '会话关闭成功';
|
||||
}
|
||||
this.equipmentText = [];
|
||||
this.equipmentText1 = [];
|
||||
this.firstScetion = {
|
||||
speed: '',
|
||||
startSection: '',
|
||||
endSection: '',
|
||||
startValue: '',
|
||||
endValue: ''
|
||||
};
|
||||
this.secondScetion = {
|
||||
speed: '',
|
||||
startSection: '',
|
||||
endSection: '',
|
||||
startValue: '',
|
||||
endValue: ''
|
||||
};
|
||||
} else {
|
||||
this.dialogueStatus = `会话打开,剩余时间${val}秒`;
|
||||
}
|
||||
},
|
||||
firstScetion: {
|
||||
handler: function (val) {
|
||||
if (val.speed && val.startSection && val.endSection && val.startValue != '' && val.endValue != '') {
|
||||
this.firstShow = true;
|
||||
} else {
|
||||
this.firstShow = false;
|
||||
}
|
||||
},
|
||||
deep: true
|
||||
}
|
||||
},
|
||||
mounted() {
|
||||
this.$nextTick(() => {
|
||||
this.$store.dispatch('training/tipReload');
|
||||
});
|
||||
this.regionList = this.$ConstSelect.RegionTypeList;
|
||||
this.timer = setInterval(() => {
|
||||
if (this.timeCountCommand > 0) {
|
||||
this.timeCountCommand--;
|
||||
} else if (this.timeCountCommand == 0) { // 关闭会话
|
||||
this.isOpenMessage = true;
|
||||
this.timeCountCommand = -1;
|
||||
}
|
||||
if (this.timeCountConfirm > 0) {
|
||||
this.timeCountConfirm--;
|
||||
} else if (this.timeCountConfirm == 0) { // 关闭会话
|
||||
this.timeCountConfirm = -1;
|
||||
}
|
||||
}, 1000);
|
||||
},
|
||||
beforeDestroy() {
|
||||
clearInterval(this.timer);
|
||||
this.timer = null;
|
||||
},
|
||||
methods: {
|
||||
doShow(operate, selected, tempData) {
|
||||
this.selected = selected;
|
||||
if (!this.dialogShow) {
|
||||
this.name = '';
|
||||
if (selected) {
|
||||
this.timeCountCommand = -1; // 倒计时
|
||||
this.order = 0;
|
||||
this.type = operate.type;
|
||||
this.operation = operate.operation;
|
||||
this.code = operate.code;
|
||||
}
|
||||
}
|
||||
this.dialogShow = true;
|
||||
this.$nextTick(function () {
|
||||
this.$store.dispatch('training/emitTipFresh');
|
||||
});
|
||||
},
|
||||
doClose() {
|
||||
this.secondScetion = {
|
||||
speed: '',
|
||||
startSection: '',
|
||||
endSection: '',
|
||||
startValue: '',
|
||||
endValue: ''
|
||||
};
|
||||
this.firstScetion = {
|
||||
speed: '',
|
||||
startSection: '',
|
||||
endSection: '',
|
||||
startValue: '',
|
||||
endValue: ''
|
||||
};
|
||||
this.speed = 0;
|
||||
this.dialogShow = false;
|
||||
this.$store.dispatch('training/emitTipFresh');
|
||||
this.mouseCancelState(this.selected);
|
||||
},
|
||||
openMessage(state) {
|
||||
if (state == 'open') { // 打开会话
|
||||
const operate = {
|
||||
type: this.type,
|
||||
operation: OperationEvent.Section.setLimitSpeed.openConversation.operation
|
||||
};
|
||||
this.$store.dispatch('training/next', operate).then(({ valid }) => {
|
||||
if (valid) {
|
||||
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
|
||||
this.isOpenMessage = false;
|
||||
this.spdDisabled = false;
|
||||
this.messageStatus = '会话打开成功';
|
||||
this.speed = 1;
|
||||
this.timeCountCommand = 120;
|
||||
}
|
||||
}).catch(error => {
|
||||
console.log(error);
|
||||
});
|
||||
} else { // 关闭会话
|
||||
const operate = {
|
||||
type: this.type,
|
||||
operation: OperationEvent.Section.setLimitSpeed.closeConversation.operation
|
||||
};
|
||||
this.$store.dispatch('training/next', operate).then(({ valid }) => {
|
||||
if (valid) {
|
||||
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
|
||||
this.isOpenMessage = true;
|
||||
this.spdDisabled = true;
|
||||
this.firstDisabled = true;
|
||||
this.secondDisabled = true;
|
||||
this.messageStatus = '请先打开会话!';
|
||||
this.timeCountCommand = -1;
|
||||
this.startSectionList = [];
|
||||
this.endSectionList = [];
|
||||
if (this.speed) {
|
||||
this.messageStatus = '会话关闭成功';
|
||||
}
|
||||
}
|
||||
}).catch(error => {
|
||||
console.log(error);
|
||||
});
|
||||
}
|
||||
},
|
||||
CheckEquipment() { // 第一次确认设备
|
||||
if (this.firstShow) {
|
||||
const value = `${this.firstScetion.speed}::${this.firstScetion.startSection}::${this.firstScetion.startValue}::${this.firstScetion.endSection}::${this.firstScetion.endValue}`;
|
||||
const operate = {
|
||||
send: true,
|
||||
val: value,
|
||||
type: this.type,
|
||||
operation: OperationEvent.Section.setLimitSpeed.firstCheck.operation
|
||||
};
|
||||
|
||||
this.$store.dispatch('training/next', operate).then(({ valid, response }) => {
|
||||
if (valid) {
|
||||
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
|
||||
this.firstDisabled = false; // 运行首次发送
|
||||
this.getEquipmentList(response.data);
|
||||
this.copyScetion = {
|
||||
speed: this.firstScetion.speed,
|
||||
startSection: this.firstScetion.startSection,
|
||||
endSection: this.firstScetion.endSection,
|
||||
startValue: this.firstScetion.startValue,
|
||||
endValue: this.firstScetion.endValue
|
||||
};
|
||||
this.startSectionList = [];
|
||||
this.endSectionList = [];
|
||||
for (let index = 0; index < 4; index++) {
|
||||
const starData = {
|
||||
value: Number(this.firstScetion.startValue) + index,
|
||||
label: Number(this.firstScetion.startValue) + index
|
||||
};
|
||||
this.startSectionList.push(starData);
|
||||
const endData = {
|
||||
value: Number(this.firstScetion.endValue) + index,
|
||||
label: Number(this.firstScetion.endValue) + index
|
||||
};
|
||||
this.endSectionList.push(endData);
|
||||
}
|
||||
}
|
||||
}).catch(error => {
|
||||
console.log(error);
|
||||
});
|
||||
}
|
||||
},
|
||||
getEquipmentList(list) {
|
||||
this.equipmentText = [];
|
||||
const stationStand = [];
|
||||
const stationText = [];
|
||||
this.codeText = '';
|
||||
const arr = [];
|
||||
list.forEach(ele => {
|
||||
if (stationStand.indexOf(ele.stationCode) == -1) {
|
||||
stationStand.push(ele.stationCode);
|
||||
const text = this.getTextName(ele);
|
||||
stationText.push(text);
|
||||
} else {
|
||||
const index = stationStand.indexOf(ele.stationCode);
|
||||
const text = this.getTextName(ele);
|
||||
stationText[index] += text;
|
||||
}
|
||||
arr.push(ele.code);
|
||||
});
|
||||
this.codeText = arr.join('::');
|
||||
stationStand.forEach((item, index) => {
|
||||
const stationStandName = this.$store.getters['map/getDeviceByCode'](item);
|
||||
const data = {
|
||||
text: stationText[index],
|
||||
name: stationStandName.name
|
||||
};
|
||||
this.equipmentText.push(data);
|
||||
});
|
||||
},
|
||||
getTextName(ele) {
|
||||
if (ele.switchSectionType) {
|
||||
switch (ele.switchSectionType) {
|
||||
case '01':
|
||||
return `${ele.name}(主), `;
|
||||
case '02':
|
||||
return `${ele.name}(定), `;
|
||||
case '03':
|
||||
return `${ele.name}(反), `;
|
||||
}
|
||||
} else if (ele.parentName) {
|
||||
return `${ele.parentName}-${ele.name}, `;
|
||||
} else {
|
||||
return `${ele.name}, `;
|
||||
}
|
||||
|
||||
return '';
|
||||
},
|
||||
CheckSecondEquipment() { // 二次查看设备
|
||||
if (this.secondScetion.speed == this.copyScetion.speed && this.secondScetion.startSection == this.copyScetion.startSection && this.secondScetion.endSection == this.copyScetion.endSection && this.secondScetion.startValue == this.copyScetion.startValue && this.secondScetion.endValue == this.copyScetion.endValue) {
|
||||
const operate = {
|
||||
type: this.type,
|
||||
operation: OperationEvent.Section.setLimitSpeed.secondCheck.operation
|
||||
};
|
||||
this.$store.dispatch('training/next', operate).then(({ valid }) => {
|
||||
if (valid) {
|
||||
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
|
||||
this.equipmentText1 = this.equipmentText;
|
||||
this.secondDisabled = false; // 第二次确认发送
|
||||
}
|
||||
}).catch(error => {
|
||||
console.log(error);
|
||||
});
|
||||
} else {
|
||||
this.firstScetion = {
|
||||
speed: this.copyScetion.speed,
|
||||
startSection: this.copyScetion.startSection,
|
||||
endSection: this.copyScetion.endSection,
|
||||
startValue: this.copyScetion.startValue,
|
||||
endValue: this.copyScetion.endValue
|
||||
};
|
||||
this.firstDisabled = true;
|
||||
this.secondScetion = {
|
||||
speed: '',
|
||||
startSection: '',
|
||||
endSection: '',
|
||||
startValue: '',
|
||||
endValue: ''
|
||||
};
|
||||
this.spdDisabled = false;
|
||||
this.equipmentText = [];
|
||||
this.stpDisabled = true;
|
||||
this.timeCountConfirm = -1;
|
||||
const operate = {
|
||||
message: `两次值不一致`
|
||||
};
|
||||
this.$refs.ConfirmTip.doShow(operate);
|
||||
}
|
||||
},
|
||||
changeSelect(value, val) {
|
||||
const operate = {
|
||||
type: this.type,
|
||||
operation: '',
|
||||
val: value
|
||||
};
|
||||
|
||||
switch (val) {
|
||||
case '1':
|
||||
operate.operation = OperationEvent.Section.setLimitSpeed.firstLimitSpeed.operation;
|
||||
break;
|
||||
case '2':
|
||||
operate.operation = OperationEvent.Section.setLimitSpeed.firstStartSection.operation;
|
||||
break;
|
||||
case '3':
|
||||
operate.operation = OperationEvent.Section.setLimitSpeed.firstStartvalue.operation;
|
||||
break;
|
||||
case '4':
|
||||
operate.operation = OperationEvent.Section.setLimitSpeed.firstEndSection.operation;
|
||||
break;
|
||||
case '5':
|
||||
operate.operation = OperationEvent.Section.setLimitSpeed.firstEndvalue.operation;
|
||||
break;
|
||||
case '6':
|
||||
operate.operation = OperationEvent.Section.setLimitSpeed.secondLimitSpeed.operation;
|
||||
break;
|
||||
case '7':
|
||||
operate.operation = OperationEvent.Section.setLimitSpeed.secondStartSection.operation;
|
||||
break;
|
||||
case '8':
|
||||
operate.operation = OperationEvent.Section.setLimitSpeed.secondStartvalue.operation;
|
||||
break;
|
||||
case '9':
|
||||
operate.operation = OperationEvent.Section.setLimitSpeed.secondEndSection.operation;
|
||||
break;
|
||||
case '10':
|
||||
operate.operation = OperationEvent.Section.setLimitSpeed.secondEndvalue.operation;
|
||||
break;
|
||||
}
|
||||
|
||||
this.$store.dispatch('training/next', operate).then(({ valid }) => {
|
||||
if (valid) {
|
||||
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
|
||||
}
|
||||
}).catch(error => {
|
||||
console.log(error);
|
||||
});
|
||||
},
|
||||
|
||||
Confirmed() { // 第一次确认
|
||||
const operate = {
|
||||
type: this.type,
|
||||
operation: OperationEvent.Section.setLimitSpeed.firstComfirm.operation
|
||||
};
|
||||
this.$store.dispatch('training/next', operate).then(({ valid }) => {
|
||||
if (valid) {
|
||||
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
|
||||
this.spdDisabled = true;
|
||||
this.stpDisabled = false;
|
||||
this.firstDisabled = true;
|
||||
this.messageStatus = '收到Confirm request消息';
|
||||
this.timeCountConfirm = 60; // 倒计时
|
||||
this.firstScetion = {
|
||||
speed: '',
|
||||
startSection: '',
|
||||
endSection: '',
|
||||
startValue: '***',
|
||||
endValue: '***'
|
||||
};
|
||||
}
|
||||
}).catch(error => {
|
||||
console.log(error);
|
||||
});
|
||||
},
|
||||
|
||||
confirm() { // 第二次确认
|
||||
// let value = `${this.secondScetion.speed}::${this.codeText}`;
|
||||
const value = `${this.secondScetion.speed}::${this.secondScetion.startSection}::${this.secondScetion.startValue}::${this.secondScetion.endSection}::${this.secondScetion.endValue}`;
|
||||
const operate = {
|
||||
send: true,
|
||||
val: value,
|
||||
type: this.type,
|
||||
code: this.code,
|
||||
operation: OperationEvent.Section.confirmLimit.menu.operation
|
||||
};
|
||||
this.$store.dispatch('training/next', operate).then(({ valid }) => {
|
||||
if (valid) {
|
||||
const group = router.currentRoute.query.group;
|
||||
const command = this.handleMenuConfirmLimit(operate);
|
||||
sendCommand(group, command).then((response) => {
|
||||
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
|
||||
this.timeCountConfirm = -1;
|
||||
this.stpDisabled = true;
|
||||
this.messageStatus = '临时限速设置成功';
|
||||
}).catch(error => {
|
||||
const operate = {
|
||||
message: error.message
|
||||
};
|
||||
this.$refs.ConfirmTip.doShow(operate);
|
||||
console.log(error);
|
||||
});
|
||||
}
|
||||
}).catch(error => {
|
||||
const operate = {
|
||||
message: error.message
|
||||
};
|
||||
this.$refs.ConfirmTip.doShow(operate);
|
||||
console.log(error);
|
||||
});
|
||||
},
|
||||
|
||||
close() { // 设置成功 关闭弹窗
|
||||
const operate = {
|
||||
type: this.type,
|
||||
operation: OperationEvent.Section.setLimitSpeed.domIdClose.operation
|
||||
};
|
||||
this.$store.dispatch('training/next', operate).then(({ valid }) => {
|
||||
if (valid) {
|
||||
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
|
||||
if (this.isOpenMessage) {
|
||||
this.doClose();
|
||||
} else {
|
||||
const operate = {
|
||||
message: `是否关闭会话,并关闭窗口`,
|
||||
confirmId: OperationEvent.Section.setLimitSpeed.close.domId
|
||||
};
|
||||
this.$refs.ConfirmTip.doShow(operate);
|
||||
}
|
||||
}
|
||||
}).catch(() => {
|
||||
this.doClose();
|
||||
});
|
||||
},
|
||||
commit() {
|
||||
|
||||
},
|
||||
closeMessage() {
|
||||
const operate = {
|
||||
type: this.type,
|
||||
operation: OperationEvent.Section.setLimitSpeed.close.operation
|
||||
};
|
||||
|
||||
this.$store.dispatch('training/next', operate).then(({ valid }) => {
|
||||
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
|
||||
this.$refs.ConfirmTip.doClose();
|
||||
this.isOpenMessage = true;
|
||||
this.spdDisabled = true;
|
||||
this.firstDisabled = true;
|
||||
this.secondDisabled = true;
|
||||
this.timeCountCommand = -1;
|
||||
this.startSectionList = [];
|
||||
this.endSectionList = [];
|
||||
this.doClose();
|
||||
}).catch(error => {
|
||||
console.log(error);
|
||||
});
|
||||
},
|
||||
// 处理右键菜单 确认临时限速
|
||||
handleMenuConfirmLimit(operate) {
|
||||
return {
|
||||
type: operate.type,
|
||||
code: operate.code,
|
||||
over: true,
|
||||
operation: OperationEvent.Section.confirmLimit.event,
|
||||
val: operate.val
|
||||
};
|
||||
}
|
||||
}
|
||||
};
|
||||
</script>
|
@ -1,322 +0,0 @@
|
||||
<template>
|
||||
<el-dialog v-dialogDrag :z-index="2000" class="ningbo-01__systerm alxe-effective" :title="title" :visible.sync="show" width="420px" :before-close="doClose" :modal="false" :close-on-click-modal="false">
|
||||
<div style="padding: 10px 20px;border: 1px solid lightgray;">
|
||||
<span class="base-label">准备</span>
|
||||
<div style="margin-top: -10px">
|
||||
<el-row type="flex" justify="left">
|
||||
<el-col :span="18">操作设备</el-col>
|
||||
</el-row>
|
||||
<el-row type="flex" justify="left">
|
||||
<el-col :span="18">
|
||||
<el-input v-model="model.switchName" :type="type" size="mini" :disabled="true" />
|
||||
</el-col>
|
||||
<el-col :span="4" :offset="1">
|
||||
<el-button :id="domIdConfirm1" size="mini" :disabled="type==='password'" @click="commitOnce">确认</el-button>
|
||||
</el-col>
|
||||
</el-row>
|
||||
</div>
|
||||
</div>
|
||||
<div style="padding: 10px 20px;border: 1px solid lightgray;margin-top: 10px">
|
||||
<span class="base-label">确认</span>
|
||||
<div style="margin-top: -10px">
|
||||
<el-row type="flex" justify="left">
|
||||
<el-col :span="18">操作设备</el-col>
|
||||
</el-row>
|
||||
<el-row type="flex" justify="left">
|
||||
<el-col :span="18">
|
||||
<el-select :id="domIdChoose2" v-model="model.confirmSwitchName" filterable size="mini" :disabled="type==='text'" @change="sectionSelectChange">
|
||||
<el-option v-for="(option,index) in randomSectionList" :key="index" :label="option.name" :value="option.name" />
|
||||
</el-select>
|
||||
</el-col>
|
||||
<el-col :span="4" :offset="1">
|
||||
<el-button :id="domIdConfirm2" size="mini" :loading="loading" :disabled="type==='text'" @click="commit">确认</el-button>
|
||||
</el-col>
|
||||
</el-row>
|
||||
</div>
|
||||
</div>
|
||||
<el-row type="flex" justify="left" style="margin-top:20px;margin-bottom: 10px;">
|
||||
<el-col :span="6" :offset="1">操作倒计时</el-col>
|
||||
<el-col :span="16">
|
||||
<el-input v-model="model.time" size="mini" :readonly="true" />
|
||||
</el-col>
|
||||
</el-row>
|
||||
<el-row>
|
||||
<el-col :offset="1">状态</el-col>
|
||||
</el-row>
|
||||
<el-row>
|
||||
<el-col :offset="1" :span="23">
|
||||
<el-input v-model="model.status" type="textarea" :rows="2" placeholder />
|
||||
</el-col>
|
||||
</el-row>
|
||||
<el-row class="botton-group" style="margin-top:20px">
|
||||
<el-col :span="4" :offset="10">
|
||||
<el-button :id="domIdCancel" @click="cancel">关闭</el-button>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<notice-info ref="noticeInfo" />
|
||||
<popup-alarm ref="popupAlarm" />
|
||||
</el-dialog>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import { mapGetters } from 'vuex';
|
||||
import NoticeInfo from './childDialog/childDialog/noticeInfo';
|
||||
import PopupAlarm from './childDialog/popupAlarm';
|
||||
import { OperationEvent } from '@/scripts/cmdPlugin/OperationHandler';
|
||||
import CMD from '@/scripts/cmdPlugin/CommandEnum';
|
||||
|
||||
export default {
|
||||
name: 'AlxeEffective',
|
||||
components: {
|
||||
NoticeInfo,
|
||||
PopupAlarm
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
dialogShow: false,
|
||||
loading: false,
|
||||
type: 'text',
|
||||
timeout: 1000,
|
||||
timenum: 30,
|
||||
stepNum: 0,
|
||||
task: null,
|
||||
model: {
|
||||
switchName: '',
|
||||
confirmSwitchName: '',
|
||||
status: '',
|
||||
time: 0
|
||||
},
|
||||
selected: null,
|
||||
operate: null,
|
||||
operation: '',
|
||||
randomSectionList: []
|
||||
};
|
||||
},
|
||||
computed: {
|
||||
...mapGetters('map', ['stationList', 'switchList']),
|
||||
show() {
|
||||
return this.dialogShow && !this.$store.state.menuOperation.break;
|
||||
},
|
||||
domIdConfirm1() {
|
||||
if (this.operation == OperationEvent.Switch.unlock.menu.operation) {
|
||||
return OperationEvent.Switch.unlock.confirm1.domId;
|
||||
} else if (this.operation == OperationEvent.Switch.unblock.menu.operation) {
|
||||
return OperationEvent.Switch.unblock.confirm1.domId;
|
||||
}
|
||||
return '';
|
||||
},
|
||||
domIdConfirm2() {
|
||||
if (this.operation == OperationEvent.Switch.unlock.menu.operation) {
|
||||
return OperationEvent.Switch.unlock.confirm2.domId;
|
||||
} else if (this.operation == OperationEvent.Switch.unblock.menu.operation) {
|
||||
return OperationEvent.Switch.unblock.confirm2.domId;
|
||||
}
|
||||
return '';
|
||||
},
|
||||
domIdChoose2() {
|
||||
if (this.operation == OperationEvent.Switch.unlock.menu.operation) {
|
||||
return OperationEvent.Switch.unlock.choose2.domId;
|
||||
} else if (this.operation == OperationEvent.Switch.unblock.menu.operation) {
|
||||
return OperationEvent.Switch.unblock.choose2.domId;
|
||||
}
|
||||
return '';
|
||||
},
|
||||
domIdCancel() {
|
||||
return this.dialogShow ? OperationEvent.Command.cancel.menu.domId : '';
|
||||
},
|
||||
title() {
|
||||
if (this.operation == OperationEvent.Switch.unlock.menu.operation) {
|
||||
return '区故解';
|
||||
} else if (this.operation == OperationEvent.Switch.unblock.menu.operation) {
|
||||
return '解除封锁';
|
||||
}
|
||||
return '';
|
||||
}
|
||||
},
|
||||
watch: {
|
||||
'model.switchName': function(name) {
|
||||
const index = Math.floor(Math.random(1) * 5);
|
||||
for (var i = 0; i < 5; i++) {
|
||||
if (i == index) {
|
||||
this.randomSectionList.push({ name });
|
||||
} else {
|
||||
const section = this.switchList[
|
||||
Math.floor(Math.random(1) * this.switchList.length)
|
||||
];
|
||||
if (section.type != '02') {
|
||||
if (
|
||||
this.randomSectionList.findIndex(it => {
|
||||
return it.name == section.name;
|
||||
}) < 0
|
||||
) {
|
||||
this.randomSectionList.push({ name: section.name });
|
||||
} else {
|
||||
i--;
|
||||
}
|
||||
} else {
|
||||
i--;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
mounted() {
|
||||
this.$nextTick(() => {
|
||||
this.$store.dispatch('training/tipReload');
|
||||
});
|
||||
},
|
||||
methods: {
|
||||
stopTask() {
|
||||
if (this.task) {
|
||||
clearInterval(this.task);
|
||||
this.task = null;
|
||||
}
|
||||
|
||||
if (this.stepNum < 3) {
|
||||
this.$store.dispatch('training/backSteps', this.stepNum);
|
||||
this.$store.dispatch('training/emitTipFresh');
|
||||
this.model.name = '';
|
||||
this.model.time = '';
|
||||
this.type = 'text';
|
||||
}
|
||||
},
|
||||
doShow(operate, selected) {
|
||||
this.selected = selected;
|
||||
this.operate = operate || {};
|
||||
this.operation = operate.operation;
|
||||
this.status = '';
|
||||
this.model.switchName = '';
|
||||
this.model.confirmSwitchName = '';
|
||||
if (selected) {
|
||||
if (selected._type.toUpperCase() === 'Switch'.toUpperCase()) {
|
||||
const section = this.$store.getters['map/getDeviceByCode'](selected.code);
|
||||
if (section) {
|
||||
this.model.switchName = section.name;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
this.stepNum = 0;
|
||||
this.loading = false;
|
||||
this.dialogShow = true;
|
||||
this.stopTask();
|
||||
this.$nextTick(function() {
|
||||
this.$store.dispatch('training/emitTipFresh');
|
||||
});
|
||||
},
|
||||
doClose() {
|
||||
this.dialogShow = false;
|
||||
this.$store.dispatch('training/emitTipFresh');
|
||||
this.mouseCancelState(this.selected);
|
||||
},
|
||||
waitSelectEvent() {
|
||||
if (!this.$store.state.menuOperation.break) {
|
||||
this.model.time -= 1;
|
||||
if (this.model.time <= 0) {
|
||||
this.stopTask();
|
||||
}
|
||||
}
|
||||
},
|
||||
commitOnce() {
|
||||
this.stepNum = 1;
|
||||
const operate = {
|
||||
operation: ''
|
||||
};
|
||||
|
||||
if (this.operation == OperationEvent.Switch.unlock.menu.operation) {
|
||||
operate.operation = OperationEvent.Switch.unlock.confirm1.operation;
|
||||
} else if (this.operation == OperationEvent.Switch.unblock.menu.operation) {
|
||||
operate.operation = OperationEvent.Switch.unblock.confirm1.operation;
|
||||
}
|
||||
|
||||
this.$store.dispatch('training/nextNew', operate).then(({ valid }) => {
|
||||
if (valid) {
|
||||
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
|
||||
this.type = 'password';
|
||||
this.model.time = this.timenum;
|
||||
this.task = setInterval(this.waitSelectEvent, this.timeout);
|
||||
}
|
||||
});
|
||||
},
|
||||
sectionSelectChange() {
|
||||
if (this.model.confirmSwitchName === this.model.switchName) {
|
||||
this.stepNum = 2;
|
||||
} else {
|
||||
this.model.time = 0;
|
||||
}
|
||||
|
||||
const operate = {
|
||||
operation: ''
|
||||
};
|
||||
|
||||
if (this.operation == OperationEvent.Switch.unlock.menu.operation) {
|
||||
operate.operation = OperationEvent.Switch.unlock.choose2.operation;
|
||||
} else if (this.operation == OperationEvent.Switch.unblock.menu.operation) {
|
||||
operate.operation = OperationEvent.Switch.unblock.choose2.operation;
|
||||
}
|
||||
|
||||
this.$store.dispatch('training/nextNew', operate).then(({ valid }) => {
|
||||
this.$store.dispatch('menuOperation/handleBreakFlag', {
|
||||
break: true
|
||||
});
|
||||
});
|
||||
},
|
||||
commit() {
|
||||
const operate = {
|
||||
over: true,
|
||||
operation: '',
|
||||
cmdType: ''
|
||||
};
|
||||
|
||||
if (this.operation == OperationEvent.Switch.unlock.menu.operation) {
|
||||
operate.operation = OperationEvent.Switch.unlock.confirm2.operation;
|
||||
operate.cmdType = CMD.Switch.CMD_SWITCH_SINGLE_UNLOCK; // 解锁
|
||||
} else if (this.operation == OperationEvent.Switch.unblock.menu.operation) {
|
||||
operate.operation = OperationEvent.Switch.unblock.confirm2.operation;
|
||||
operate.cmdType = CMD.Switch.CMD_SWITCH_UNBLOCK; // 解封
|
||||
}
|
||||
|
||||
this.model.status = '';
|
||||
if (this.model.switchName == this.model.confirmSwitchName) {
|
||||
this.stepNum = 3;
|
||||
this.loading = true;
|
||||
this.$store.dispatch('training/nextNew', operate).then(({ valid }) => {
|
||||
this.loading = false;
|
||||
if (valid) {
|
||||
this.type = 'text';
|
||||
this.stopTask();
|
||||
this.doClose();
|
||||
// this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
|
||||
// this.$refs.popupAlarm.doShow(Object.assign(this.operate, {val: operate.val}), [`区段 ${this.model.switchName}报告恢复计轴有效`]);
|
||||
}
|
||||
}).catch(() => {
|
||||
this.$refs.noticeInfo.doShow(operate);
|
||||
});
|
||||
} else {
|
||||
this.model.status = '区段选择错误';
|
||||
}
|
||||
},
|
||||
cancel() {
|
||||
const operate = {
|
||||
operation: OperationEvent.Command.cancel.menu.operation
|
||||
};
|
||||
|
||||
this.$store
|
||||
.dispatch('training/nextNew', operate)
|
||||
.then(({ valid }) => {
|
||||
if (valid) {
|
||||
this.doClose();
|
||||
}
|
||||
})
|
||||
.catch(() => {
|
||||
this.doClose();
|
||||
});
|
||||
}
|
||||
}
|
||||
};
|
||||
</script>
|
||||
<style rel="stylesheet/scss" lang="scss" scoped>
|
||||
.alxe-effective .context {
|
||||
height: 80px !important;
|
||||
}
|
||||
</style>
|
317
src/jmapNew/theme/ningbo_01/menus/dialog/switchUnLock.vue
Normal file
317
src/jmapNew/theme/ningbo_01/menus/dialog/switchUnLock.vue
Normal file
@ -0,0 +1,317 @@
|
||||
<template>
|
||||
<el-dialog
|
||||
v-dialogDrag
|
||||
class="ningbo-01__systerm stand-detain-train"
|
||||
:title="title"
|
||||
:visible.sync="show"
|
||||
width="380px"
|
||||
:before-close="doClose"
|
||||
:z-index="2000"
|
||||
:modal="false"
|
||||
:close-on-click-modal="false"
|
||||
>
|
||||
<div class="content cotnent_body">
|
||||
<span class="base-label" style="left: 2px;">操作</span>
|
||||
<div style="overflow: hidden;">
|
||||
<div>道岔</div>
|
||||
<el-col :span="11">
|
||||
<el-input :value="messageText1" placeholder="" size="mini" disabled />
|
||||
</el-col>
|
||||
<el-col :span="8" :offset="1">
|
||||
<el-button :id="confirmId1" class="status_btn" :disabled="disabledConfirm1" @click="confirm1">确认
|
||||
</el-button>
|
||||
</el-col>
|
||||
</div>
|
||||
</div>
|
||||
<div class="content cotnent_body">
|
||||
<span class="base-label" style="left: 2px;">确认</span>
|
||||
<div style="overflow: hidden;">
|
||||
<div>道岔</div>
|
||||
<el-col :span="11">
|
||||
<el-select :id="domIdChoose" v-model="messageText2" filterable size="mini" :disabled="disabledConfirm2" @change="SelectChange">
|
||||
<el-option v-for="option in switchList" :key="option.code" :label="option.name" :value="option.name" />
|
||||
</el-select>
|
||||
</el-col>
|
||||
<el-col :span="8" :offset="1">
|
||||
<el-button :id="confirmId2" class="status_btn" :disabled="disabledConfirm2" @click="confirm2">确认
|
||||
</el-button>
|
||||
</el-col>
|
||||
</div>
|
||||
</div>
|
||||
<div class="body_cont">
|
||||
<el-col :span="7">
|
||||
<div class="text">操作倒计时</div>
|
||||
</el-col>
|
||||
<el-col :span="17">
|
||||
<div style="border: 2px inset #E9E9E9; height: 30px; width: 100%;">
|
||||
{{ timeCountConfirm == -1 ? '' : timeCountConfirm }}</div>
|
||||
</el-col>
|
||||
</div>
|
||||
<div class="body_cont">
|
||||
<div class="status_text">状态</div>
|
||||
<div class="textarea_content" />
|
||||
</div>
|
||||
|
||||
<el-button :id="domIdConfirm" class="close_btn" type="primary" @click="commit">关闭</el-button>
|
||||
<notice-info ref="noticeInfo" />
|
||||
</el-dialog>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import { mapGetters } from 'vuex';
|
||||
import NoticeInfo from './childDialog/childDialog/noticeInfo';
|
||||
import { OperationEvent } from '@/scripts/cmdPlugin/OperationHandler';
|
||||
import CMD from '@/scripts/cmdPlugin/CommandEnum';
|
||||
|
||||
export default {
|
||||
name: 'StandDetainTrain',
|
||||
components: {
|
||||
NoticeInfo
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
dialogShow: false,
|
||||
selected: null,
|
||||
operation: null,
|
||||
|
||||
messageText1: '',
|
||||
messageText2: '',
|
||||
timeCountConfirm: -1,
|
||||
disabledConfirm1: false,
|
||||
disabledConfirm2: true
|
||||
};
|
||||
},
|
||||
computed: {
|
||||
...mapGetters('map', [
|
||||
'switchList'
|
||||
]),
|
||||
show() {
|
||||
return this.dialogShow && !this.$store.state.menuOperation.break;
|
||||
},
|
||||
domIdChoose() {
|
||||
return this.dialogShow ? OperationEvent.Switch.unlock.choose.domId : '';
|
||||
},
|
||||
confirmId1() {
|
||||
return this.dialogShow ? OperationEvent.Switch.unlock.confirm1.domId : '';
|
||||
},
|
||||
confirmId2() {
|
||||
return this.dialogShow ? OperationEvent.Switch.unlock.confirm2.domId : '';
|
||||
},
|
||||
domIdConfirm() {
|
||||
return this.dialogShow ? OperationEvent.Switch.unlock.confirm.domId : '';
|
||||
},
|
||||
title() {
|
||||
if (this.operation == OperationEvent.Switch.unlock.menu.operation) {
|
||||
return '道岔单解'
|
||||
} else if (this.operation == OperationEvent.Switch.unblock.menu.operation) {
|
||||
return '解除封锁'
|
||||
}
|
||||
return '';
|
||||
}
|
||||
},
|
||||
mounted() {
|
||||
this.$nextTick(() => {
|
||||
this.$store.dispatch('training/tipReload');
|
||||
});
|
||||
this.timer = setInterval(() => {
|
||||
if (this.timeCountConfirm > 0) {
|
||||
this.timeCountConfirm--;
|
||||
} else if (this.timeCountConfirm == 0) { // 关闭会话
|
||||
this.timeCountConfirm = -1;
|
||||
this.disabledConfirm2 = true;
|
||||
}
|
||||
}, 1000);
|
||||
},
|
||||
methods: {
|
||||
doShow(operate, selected) {
|
||||
this.selected = selected;
|
||||
if (!this.dialogShow) {
|
||||
this.messageText1 = selected.name;
|
||||
|
||||
this.operation = operate.operation;
|
||||
}
|
||||
this.dialogShow = true;
|
||||
this.$nextTick(function () {
|
||||
this.$store.dispatch('training/emitTipFresh');
|
||||
});
|
||||
},
|
||||
doClose() {
|
||||
this.dialogShow = false;
|
||||
this.$store.dispatch('training/emitTipFresh');
|
||||
this.mouseCancelState(this.selected);
|
||||
},
|
||||
|
||||
SelectChange() {
|
||||
const operate = {
|
||||
operation: '',
|
||||
val: this.messageText2
|
||||
};
|
||||
|
||||
if (this.operation == OperationEvent.Switch.unlock.menu.operation) {
|
||||
operate.operation = OperationEvent.Switch.unlock.choose.operation
|
||||
} else if (this.operation == OperationEvent.Switch.unblock.menu.operation) {
|
||||
operate.operation = OperationEvent.Switch.unblock.choose.operation
|
||||
}
|
||||
|
||||
this.$store.dispatch('training/nextNew', operate).then(({ valid }) => {
|
||||
if (valid) {
|
||||
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
|
||||
}
|
||||
}).catch((error) => {
|
||||
this.$refs.noticeInfo.doShow(operate, error.message);
|
||||
});
|
||||
},
|
||||
|
||||
confirm1() {
|
||||
const operate = {
|
||||
operation: ''
|
||||
};
|
||||
|
||||
if (this.operation == OperationEvent.Switch.unlock.menu.operation) {
|
||||
operate.operation = OperationEvent.Switch.unlock.confirm1.operation
|
||||
} else if (this.operation == OperationEvent.Switch.unblock.menu.operation) {
|
||||
operate.operation = OperationEvent.Switch.unblock.confirm1.operation
|
||||
}
|
||||
|
||||
this.$store.dispatch('training/nextNew', operate).then(({ valid }) => {
|
||||
if (valid) {
|
||||
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
|
||||
this.messageText1 = '*****';
|
||||
this.messageText2 = '';
|
||||
this.disabledConfirm1 = true;
|
||||
this.disabledConfirm2 = false;
|
||||
this.timeCountConfirm = 60; // 倒计时
|
||||
}
|
||||
}).catch((error) => {
|
||||
this.$refs.noticeInfo.doShow(operate, error.message);
|
||||
});
|
||||
},
|
||||
confirm2() {
|
||||
const operate = {
|
||||
operation: '',
|
||||
cmdType: ''
|
||||
};
|
||||
if (this.operation == OperationEvent.Switch.unlock.menu.operation) {
|
||||
operate.operation = OperationEvent.Switch.unlock.confirm2.operation;
|
||||
operate.cmdType = CMD.Switch.CMD_SWITCH_SINGLE_UNLOCK;
|
||||
} else if (this.operation == OperationEvent.Switch.unblock.menu.operation) {
|
||||
operate.operation = OperationEvent.Switch.unblock.confirm2.operation;
|
||||
operate.cmdType = CMD.Switch.CMD_SWITCH_UNBLOCK;
|
||||
}
|
||||
|
||||
this.$store.dispatch('training/nextNew', operate).then(({ valid }) => {
|
||||
if (valid) {
|
||||
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
|
||||
this.messageText2 = '*****';
|
||||
this.disabledConfirm2 = true;
|
||||
this.timeCountConfirm = -1;
|
||||
}
|
||||
}).catch((error) => {
|
||||
this.$refs.noticeInfo.doShow(operate, error.message);
|
||||
});
|
||||
},
|
||||
commit() {
|
||||
const operate = {
|
||||
over: true,
|
||||
operation: '',
|
||||
};
|
||||
|
||||
if (this.operation == OperationEvent.Switch.unlock.menu.operation) {
|
||||
operate.operation = OperationEvent.Switch.unlock.confirm.operation
|
||||
} else if (this.operation == OperationEvent.Switch.unblock.menu.operation) {
|
||||
operate.operation = OperationEvent.Switch.unblock.confirm.operation
|
||||
}
|
||||
|
||||
this.$store.dispatch('training/nextNew', operate).then(({ valid }) => {
|
||||
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
|
||||
this.doClose();
|
||||
}).catch((error) => {
|
||||
this.doClose();
|
||||
this.$refs.noticeInfo.doShow(operate, error.message);
|
||||
});
|
||||
}
|
||||
}
|
||||
};
|
||||
</script>
|
||||
<style scoped lang="scss">
|
||||
.stand-detain-train {
|
||||
|
||||
.content {
|
||||
width: 100%;
|
||||
border: 1px solid lightgray;
|
||||
padding: 18px 5px;
|
||||
position: relative;
|
||||
height: 80px !important;
|
||||
|
||||
.base-label {
|
||||
position: absolute;
|
||||
top: -8px;
|
||||
left: 20px;
|
||||
background-color: #F0F0F0;
|
||||
padding: 0 5px;
|
||||
}
|
||||
|
||||
.el-button {
|
||||
width: 100%;
|
||||
line-height: 28px;
|
||||
}
|
||||
|
||||
.status_btn {
|
||||
width: 110px;
|
||||
margin: 15px auto 0;
|
||||
display: block;
|
||||
}
|
||||
|
||||
}
|
||||
.head_content {
|
||||
height: 110px;
|
||||
margin-bottom: 10px;
|
||||
}
|
||||
|
||||
.cotnent_body {
|
||||
margin-bottom: 10px;
|
||||
|
||||
.text {
|
||||
line-height: 30px;
|
||||
text-align: center;
|
||||
font-size: 15px;
|
||||
}
|
||||
|
||||
.status_btn {
|
||||
width: 80px;
|
||||
margin: 0 auto
|
||||
}
|
||||
}
|
||||
|
||||
.close_btn {
|
||||
margin: 0 auto;
|
||||
width: 80px;
|
||||
display: block;
|
||||
}
|
||||
|
||||
.body_cont {
|
||||
margin-bottom: 10px;
|
||||
padding: 0 3px;
|
||||
overflow: hidden;
|
||||
|
||||
.text {
|
||||
line-height: 30px;
|
||||
text-align: center;
|
||||
font-size: 15px;
|
||||
}
|
||||
|
||||
.status_text {
|
||||
margin-bottom: 3px;
|
||||
font-size: 14px;
|
||||
padding-left: 8px;
|
||||
}
|
||||
|
||||
.textarea_content {
|
||||
height: 85px;
|
||||
width: 100%;
|
||||
border: 2px solid #E9E9E9;
|
||||
box-shadow: 2px 2px #959595 inset;
|
||||
}
|
||||
}
|
||||
}
|
||||
</style>
|
@ -1,154 +0,0 @@
|
||||
<template>
|
||||
<el-dialog
|
||||
v-dialogDrag
|
||||
class="ningbo-01__systerm route-create"
|
||||
:title="title"
|
||||
:visible.sync="show"
|
||||
width="580px"
|
||||
label-position="top"
|
||||
:before-close="doClose"
|
||||
:z-index="2000"
|
||||
:modal="false"
|
||||
:close-on-click-modal="false"
|
||||
>
|
||||
<div style="padding: 10px 20px; border: 1px solid lightgray;">
|
||||
<el-form size="small" label-width="100px">
|
||||
<el-form-item label="列车:" prop="trainCode">
|
||||
<el-select v-model="trainCode" filterable placeholder="列车">
|
||||
<el-option
|
||||
v-for="item in trainList"
|
||||
:key="item.code"
|
||||
:label="item.groupNumber"
|
||||
:value="item.code"
|
||||
/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="列车方向:" prop="direction">
|
||||
<el-select v-model="direction" filterable placeholder="列车方向">
|
||||
<el-option v-for="no in directionList" :key="no.value" :label="no.label" :value="no.value" />
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
<el-row>
|
||||
<el-col style="text-align: right;">
|
||||
<el-button :id="domIdConfirm" type="primary" :loading="loading" @click="commit">确定</el-button>
|
||||
<el-button :id="domIdCancel" @click="cancel">取 消</el-button>
|
||||
</el-col>
|
||||
</el-row>
|
||||
</div>
|
||||
<notice-info ref="noticeInfo" />
|
||||
</el-dialog>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import { mapGetters } from 'vuex';
|
||||
import { MapDeviceType, OperationEvent } from '@/scripts/ConstDic';
|
||||
import NoticeInfo from './childDialog/childDialog/noticeInfo';
|
||||
|
||||
export default {
|
||||
name: 'RouteCreate',
|
||||
components: {
|
||||
NoticeInfo
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
dialogShow: false,
|
||||
loading: false,
|
||||
trainList: [],
|
||||
trainNoList: [],
|
||||
directionList: [
|
||||
{
|
||||
value: '2',
|
||||
label: '上行'
|
||||
},
|
||||
{
|
||||
value: '1',
|
||||
label: '下行'
|
||||
}
|
||||
],
|
||||
trainCode: '',
|
||||
tripNumber: '',
|
||||
direction: '',
|
||||
selected: null
|
||||
};
|
||||
},
|
||||
computed: {
|
||||
...mapGetters('map', [
|
||||
'map'
|
||||
]),
|
||||
show() {
|
||||
return this.dialogShow && !this.$store.state.menuOperation.break;
|
||||
},
|
||||
domIdCancel() {
|
||||
return this.dialogShow ? OperationEvent.Command.cancel.menu.domId : '';
|
||||
},
|
||||
domIdConfirm() {
|
||||
return OperationEvent.Section.newtrain.menu.domId;
|
||||
},
|
||||
title() {
|
||||
return '设置列车';
|
||||
}
|
||||
},
|
||||
mounted() {
|
||||
this.$nextTick(() => {
|
||||
this.$store.dispatch('training/tipReload');
|
||||
});
|
||||
},
|
||||
methods: {
|
||||
loadInitData(map) {
|
||||
},
|
||||
doShow(operate, selected) {
|
||||
this.dialogShow = true;
|
||||
this.selected = selected;
|
||||
|
||||
/** 加载列车数据*/
|
||||
this.loadInitData(this.map);
|
||||
|
||||
this.$nextTick(function () {
|
||||
this.$store.dispatch('training/emitTipFresh');
|
||||
});
|
||||
},
|
||||
doClose() {
|
||||
this.trainCode = '';
|
||||
this.direction = '';
|
||||
this.loading = false;
|
||||
this.dialogShow = false;
|
||||
this.$store.dispatch('training/emitTipFresh');
|
||||
this.mouseCancelState(this.selected);
|
||||
},
|
||||
commit() {
|
||||
const operate = {
|
||||
send: true,
|
||||
type: MapDeviceType.Section.type,
|
||||
operation: OperationEvent.Section.newtrain.menu.operation,
|
||||
val: '' + this.direction + '::' + this.trainCode
|
||||
};
|
||||
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() {
|
||||
const operate = {
|
||||
type: MapDeviceType.Section.type,
|
||||
operation: OperationEvent.Command.cancel.menu.operation
|
||||
};
|
||||
|
||||
this.$store.dispatch('training/next', operate).then(({ valid }) => {
|
||||
if (valid) {
|
||||
this.doClose();
|
||||
}
|
||||
}).catch(error => {
|
||||
this.doClose();
|
||||
});
|
||||
}
|
||||
}
|
||||
};
|
||||
</script>
|
@ -2,10 +2,8 @@
|
||||
<div>
|
||||
<pop-menu ref="popMenu" :menu="menu" />
|
||||
<section-control ref="sectionControl" />
|
||||
<section-cmd-control ref="sectionCmdControl" />
|
||||
<section-un-lock ref="sectionUnLock" />
|
||||
<speed-limit-control ref="speedLimitControl" />
|
||||
<speed-cmd-control ref="speedCmdControl" />
|
||||
<train-create ref="trainCreate" />
|
||||
<alxe-effective ref="alxeEffective" />
|
||||
<notice-info ref="noticeInfo" />
|
||||
</div>
|
||||
@ -14,10 +12,8 @@
|
||||
<script>
|
||||
import PopMenu from '@/components/PopMenu';
|
||||
import SectionControl from './dialog/sectionControl';
|
||||
import SectionCmdControl from './dialog/sectionCmdControl';
|
||||
import SpeedCmdControl from './dialog/speedCmdControl';
|
||||
import SectionUnLock from './dialog/sectionUnLock';
|
||||
import SpeedLimitControl from './dialog/speedLimitControl';
|
||||
import TrainCreate from './dialog/trainCreate';
|
||||
import AlxeEffective from './dialog/alxeEffective';
|
||||
import NoticeInfo from './dialog/childDialog/childDialog/noticeInfo';
|
||||
import { mapGetters } from 'vuex';
|
||||
@ -31,10 +27,8 @@ export default {
|
||||
components: {
|
||||
PopMenu,
|
||||
SectionControl,
|
||||
SectionCmdControl,
|
||||
SectionUnLock,
|
||||
SpeedLimitControl,
|
||||
SpeedCmdControl,
|
||||
TrainCreate,
|
||||
AlxeEffective,
|
||||
NoticeInfo
|
||||
},
|
||||
@ -190,7 +184,7 @@ export default {
|
||||
this.$store.dispatch('training/nextNew', operate).then(({ valid }) => {
|
||||
if (valid) {
|
||||
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
|
||||
this.$refs.sectionCmdControl.doShow(operate, this.selected);
|
||||
this.$refs.sectionUnLock.doShow(operate, this.selected);
|
||||
}
|
||||
});
|
||||
},
|
||||
@ -245,7 +239,7 @@ export default {
|
||||
}
|
||||
});
|
||||
},
|
||||
// 区段解锁
|
||||
// 区段封锁
|
||||
lock() {
|
||||
const operate = {
|
||||
start: true,
|
||||
@ -262,7 +256,7 @@ export default {
|
||||
}
|
||||
});
|
||||
},
|
||||
// 区段封锁
|
||||
// 区段解锁
|
||||
unlock() {
|
||||
const operate = {
|
||||
start: true,
|
||||
@ -275,7 +269,7 @@ export default {
|
||||
this.$store.dispatch('training/nextNew', operate).then(({ valid }) => {
|
||||
if (valid) {
|
||||
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
|
||||
this.$refs.sectionCmdControl.doShow(operate, this.selected);
|
||||
this.$refs.sectionUnLock.doShow(operate, this.selected);
|
||||
}
|
||||
});
|
||||
},
|
||||
|
@ -5,7 +5,6 @@
|
||||
<route-lock ref="routeLock" />
|
||||
<route-un-lock ref="routeUnLock" />
|
||||
<route-control ref="routeControl" />
|
||||
<route-cmd-control ref="routeCmdControl" />
|
||||
<route-hand-control ref="routeHandControl" />
|
||||
<route-detail ref="routeDetail" />
|
||||
<router-command ref="routerCommand" />
|
||||
@ -19,7 +18,6 @@ import RouteControl from './dialog/routeControl';
|
||||
import RouteSelection from './dialog/routeSelection';
|
||||
import RouteLock from './dialog/routeLock';
|
||||
import RouteUnLock from './dialog/routeUnLock';
|
||||
import RouteCmdControl from './dialog/routeCmdControl';
|
||||
import RouteHandControl from './dialog/routeHandControl';
|
||||
import RouterCommand from './dialog/routerCommand';
|
||||
import RouteDetail from './dialog/routeDetail';
|
||||
@ -40,7 +38,6 @@ export default {
|
||||
RouteSelection,
|
||||
RouteLock,
|
||||
RouteUnLock,
|
||||
RouteCmdControl,
|
||||
RouteHandControl,
|
||||
RouteDetail,
|
||||
RouterCommand,
|
||||
|
@ -1,10 +1,8 @@
|
||||
<template>
|
||||
<div>
|
||||
<pop-menu ref="popMenu" :menu="menu" />
|
||||
<!-- <section-control ref="sectionControl" /> -->
|
||||
<switch-control ref="switchControl" />
|
||||
<switch-cmd-control ref="switchCmdControl" />
|
||||
<!-- <speed-cmd-control ref="speedCmdControl" /> -->
|
||||
<switch-un-lock ref="switchUnLock" />
|
||||
<speed-limit-control ref="speedLimitControl" />
|
||||
<alxe-effective ref="alxeEffective" />
|
||||
<notice-info ref="noticeInfo" />
|
||||
@ -13,10 +11,8 @@
|
||||
|
||||
<script>
|
||||
import PopMenu from '@/components/PopMenu';
|
||||
// import SectionControl from './dialog/sectionControl';
|
||||
import SwitchControl from './dialog/switchControl';
|
||||
import SwitchCmdControl from './dialog/switchCmdControl';
|
||||
// import SpeedCmdControl from './dialog/speedCmdControl';
|
||||
import SwitchUnLock from './dialog/switchUnLock';
|
||||
import SpeedLimitControl from './dialog/speedLimitControl';
|
||||
import AlxeEffective from './dialog/alxeEffective';
|
||||
import NoticeInfo from './dialog/childDialog/childDialog/noticeInfo';
|
||||
@ -31,11 +27,9 @@ export default {
|
||||
name: 'SwitchMenu',
|
||||
components: {
|
||||
PopMenu,
|
||||
// SectionControl,
|
||||
SwitchControl,
|
||||
SwitchCmdControl,
|
||||
SwitchUnLock,
|
||||
SpeedLimitControl,
|
||||
// SpeedCmdControl,
|
||||
AlxeEffective,
|
||||
NoticeInfo
|
||||
},
|
||||
@ -297,7 +291,7 @@ export default {
|
||||
this.$store.dispatch('training/nextNew', operate).then(({ valid }) => {
|
||||
if (valid) {
|
||||
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
|
||||
this.$refs.switchCmdControl.doShow(operate, this.selected);
|
||||
this.$refs.switchUnLock.doShow(operate, this.selected);
|
||||
}
|
||||
});
|
||||
},
|
||||
@ -331,7 +325,7 @@ export default {
|
||||
this.$store.dispatch('training/nextNew', operate).then(({ valid }) => {
|
||||
if (valid) {
|
||||
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
|
||||
this.$refs.switchCmdControl.doShow(operate, this.selected);
|
||||
this.$refs.switchUnLock.doShow(operate, this.selected);
|
||||
}
|
||||
});
|
||||
},
|
||||
|
@ -286,6 +286,10 @@ export const OperationEvent = {
|
||||
stop: {
|
||||
operation: '1045',
|
||||
domId: '_Tips-Switch-Unlock-Stop'
|
||||
},
|
||||
choose: {
|
||||
operation: '1046',
|
||||
domId: '_Tips-Switch-Unlock-Choose'
|
||||
}
|
||||
},
|
||||
// 道岔封闭
|
||||
@ -324,6 +328,10 @@ export const OperationEvent = {
|
||||
stop: {
|
||||
operation: '1065',
|
||||
domId: '_Tips-Switch-Unblock-Stop'
|
||||
},
|
||||
choose: {
|
||||
operation: '1066',
|
||||
domId: '_Tips-Switch-Unblock-Choose'
|
||||
}
|
||||
},
|
||||
// 转动
|
||||
@ -959,6 +967,10 @@ export const OperationEvent = {
|
||||
stop: {
|
||||
operation: '4027',
|
||||
domId: '_Tips-Section-Fault-Stop'
|
||||
},
|
||||
choose: {
|
||||
operation: '4028',
|
||||
domId: '_Tips-Section-Fault-Choose'
|
||||
}
|
||||
},
|
||||
// 封锁
|
||||
@ -993,6 +1005,10 @@ export const OperationEvent = {
|
||||
stop: {
|
||||
operation: '4045',
|
||||
domId: '_Tips-Section-Unlock-Stop'
|
||||
},
|
||||
choose: {
|
||||
operation: '4046',
|
||||
domId: '_Tips-Section-Unlock-Choose'
|
||||
}
|
||||
},
|
||||
// 切除
|
||||
|
@ -3,14 +3,14 @@ export function getBaseUrl() {
|
||||
let BASE_API;
|
||||
if (process.env.NODE_ENV === 'development') {
|
||||
// BASE_API = 'https://joylink.club/jlcloud';
|
||||
// BASE_API = 'https://test.joylink.club/jlcloud';
|
||||
BASE_API = 'https://test.joylink.club/jlcloud';
|
||||
// BASE_API = 'http://192.168.3.5:9000'; // 袁琪
|
||||
// BASE_API = 'http://192.168.3.6:9000'; // 旭强
|
||||
// BASE_API = 'http://192.168.3.41:9000'; // 张赛
|
||||
// BASE_API = 'http://192.168.3.82:9000'; // 杜康
|
||||
// BASE_API = 'http://b29z135112.zicp.vip';
|
||||
// BASE_API = 'http://2925963m2a.zicp.vip'; // 杜康
|
||||
BASE_API = 'http://2i38984j47.qicp.vip'; // 张赛
|
||||
// BASE_API = 'http://2i38984j47.qicp.vip'; // 张赛
|
||||
} else {
|
||||
BASE_API = process.env.VUE_APP_BASE_API;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user