修改福州线国际化导致的操作问题以及eslint的问题
This commit is contained in:
parent
39d3ee757a
commit
a789f301c3
@ -1,72 +1,81 @@
|
||||
<template>
|
||||
<el-dialog class="fuzhou-01__systerm notice-info" :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 in messages">
|
||||
<span>{{message}}</span><br>
|
||||
</template>
|
||||
</div>
|
||||
<el-row justify="center" class="button-group">
|
||||
<el-col :span="10" :offset="8">
|
||||
<el-button :id="domIdSure" type="primary" @click="commit">{{$t('global.confirm')}}</el-button>
|
||||
</el-col>
|
||||
</el-row>
|
||||
</span>
|
||||
</el-dialog>
|
||||
<el-dialog
|
||||
v-dialogDrag
|
||||
class="fuzhou-01__systerm notice-info"
|
||||
:title="title"
|
||||
:visible.sync="show"
|
||||
width="360px"
|
||||
:before-close="doClose"
|
||||
:z-index="2000"
|
||||
:modal="false"
|
||||
:close-on-click-modal="false"
|
||||
append-to-body
|
||||
>
|
||||
<div class="context">
|
||||
<template v-for="(message,index) in messages">
|
||||
<div :key="index">{{ message }}</div>
|
||||
</template>
|
||||
</div>
|
||||
<el-row justify="center" class="button-group">
|
||||
<el-col :span="10" :offset="8">
|
||||
<el-button :id="domIdSure" type="primary" @click="commit">{{ $t('global.confirm') }}</el-button>
|
||||
</el-col>
|
||||
</el-row>
|
||||
</el-dialog>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import { MapDeviceType, OperationEvent } from '@/scripts/ConstDic';
|
||||
import { OperationEvent } from '@/scripts/ConstDic';
|
||||
|
||||
export default {
|
||||
name: 'NoticeInfo',
|
||||
data() {
|
||||
return {
|
||||
dialogShow: false,
|
||||
messages: [this.$t('tip.commandFailed')],
|
||||
operate: null
|
||||
}
|
||||
},
|
||||
computed: {
|
||||
show() {
|
||||
return this.dialogShow && !this.$store.state.menuOperation.break;
|
||||
},
|
||||
title() {
|
||||
return this.$t('tip.hint');
|
||||
},
|
||||
domIdSure() {
|
||||
return this.dialogShow ? OperationEvent.Command.close.notice.domId : '';
|
||||
}
|
||||
},
|
||||
mounted() {
|
||||
this.$nextTick(() => {
|
||||
this.$store.dispatch('training/tipReload');
|
||||
})
|
||||
},
|
||||
methods: {
|
||||
doShow(operate, messages) {
|
||||
this.operate = operate || {};
|
||||
this.dialogShow = true;
|
||||
this.messages = [this.$t('tip.commandFailed')];
|
||||
if (messages) {
|
||||
this.messages = messages;
|
||||
}
|
||||
this.$nextTick(function () {
|
||||
this.$store.dispatch('training/emitTipFresh');
|
||||
});
|
||||
},
|
||||
doClose() {
|
||||
this.dialogShow = false;
|
||||
this.$store.dispatch('training/emitTipFresh');
|
||||
},
|
||||
commit() {
|
||||
this.doClose();
|
||||
},
|
||||
cancel() {
|
||||
this.doClose();
|
||||
}
|
||||
}
|
||||
}
|
||||
export default {
|
||||
name: 'NoticeInfo',
|
||||
data() {
|
||||
return {
|
||||
dialogShow: false,
|
||||
messages: [this.$t('tip.commandFailed')],
|
||||
operate: null
|
||||
};
|
||||
},
|
||||
computed: {
|
||||
show() {
|
||||
return this.dialogShow && !this.$store.state.menuOperation.break;
|
||||
},
|
||||
title() {
|
||||
return this.$t('tip.hint');
|
||||
},
|
||||
domIdSure() {
|
||||
return this.dialogShow ? OperationEvent.Command.close.notice.domId : '';
|
||||
}
|
||||
},
|
||||
mounted() {
|
||||
this.$nextTick(() => {
|
||||
this.$store.dispatch('training/tipReload');
|
||||
});
|
||||
},
|
||||
methods: {
|
||||
doShow(operate, messages) {
|
||||
this.operate = operate || {};
|
||||
this.dialogShow = true;
|
||||
this.messages = [this.$t('tip.commandFailed')];
|
||||
if (messages) {
|
||||
this.messages = messages;
|
||||
}
|
||||
this.$nextTick(function () {
|
||||
this.$store.dispatch('training/emitTipFresh');
|
||||
});
|
||||
},
|
||||
doClose() {
|
||||
this.dialogShow = false;
|
||||
this.$store.dispatch('training/emitTipFresh');
|
||||
},
|
||||
commit() {
|
||||
this.doClose();
|
||||
},
|
||||
cancel() {
|
||||
this.doClose();
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
</script>
|
||||
<style>
|
||||
|
@ -1,355 +1,367 @@
|
||||
<template>
|
||||
<el-dialog class="fuzhou-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 in messages">
|
||||
<span>{{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">{{$t('global.confirm')}}</el-button>
|
||||
</el-col>
|
||||
<el-col :span="8" :offset="4">
|
||||
<el-button :id="domIdCancel" @click="cancel">{{$t('global.cancel')}}</el-button>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<notice-info ref="noticeInfo"></notice-info>
|
||||
</el-dialog>
|
||||
<el-dialog
|
||||
v-dialogDrag
|
||||
class="fuzhou-01__systerm confirm-control"
|
||||
:title="title"
|
||||
:visible.sync="show"
|
||||
width="360px"
|
||||
:before-close="doClose"
|
||||
:z-index="2000"
|
||||
:modal="false"
|
||||
:close-on-click-modal="false"
|
||||
append-to-body
|
||||
>
|
||||
<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">{{ $t('global.confirm') }}</el-button>
|
||||
</el-col>
|
||||
<el-col :span="8" :offset="4">
|
||||
<el-button :id="domIdCancel" @click="cancel">{{ $t('global.cancel') }}</el-button>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<notice-info ref="noticeInfo" />
|
||||
</el-dialog>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import { MapDeviceType, OperationEvent } from '@/scripts/ConstDic';
|
||||
import NoticeInfo from './childDialog/noticeInfo'
|
||||
import { MapDeviceType, OperationEvent } from '@/scripts/ConstDic';
|
||||
import NoticeInfo from './childDialog/noticeInfo';
|
||||
|
||||
export default {
|
||||
name: 'ConfirmControl',
|
||||
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.Signal.arrangementRoute.menu.operation) {
|
||||
return this.$t('menu.accessSetting');
|
||||
} else if (this.operation === OperationEvent.Signal.signalClose.menu.operation) {
|
||||
return this.$t('menu.menuSignal.signalOff');
|
||||
} else if (this.operation === OperationEvent.Signal.reopenSignal.menu.operation) {
|
||||
return this.$t('menu.menuSignal.signalReopen');
|
||||
} else if (this.operation === OperationEvent.Signal.cancelTrainRoute.menu.operation) {
|
||||
return this.$t('menu.cancelTheWay');
|
||||
} else if (this.operation === OperationEvent.Signal.humanControl.menu.operation) {
|
||||
return this.$t('menu.approachManualControl');
|
||||
} else if (this.operation === OperationEvent.Signal.atsAutoControl.menu.operation) {
|
||||
return this.$t('menu.accessToATSAutomaticControl');
|
||||
} else if (this.operation === OperationEvent.StationStand.setRunLevel.menu.operation) {
|
||||
return this.$t('menu.menuStationStand.setRunLevel');
|
||||
} else if (this.operation === OperationEvent.StationStand.setStopTime.menu.operation) {
|
||||
return this.$t('menu.stopTime');
|
||||
} else if (this.operation === OperationEvent.StationStand.setBackStrategy.menu.operation) {
|
||||
return this.$t('menu.setSwitchbackStrategy');
|
||||
}
|
||||
},
|
||||
domIdCancel() {
|
||||
return this.dialogShow ? OperationEvent.Command.cancel.menu.domId : '';
|
||||
},
|
||||
domIdConfirm() {
|
||||
if (this.dialogShow) {
|
||||
if (this.operation === OperationEvent.Signal.arrangementRoute.menu.operation) {
|
||||
/** 进路设置*/
|
||||
return OperationEvent.Signal.arrangementRoute.confirm.domId
|
||||
} else if (this.operation === OperationEvent.Signal.signalClose.menu.operation) {
|
||||
/** 信号关灯*/
|
||||
return OperationEvent.Signal.signalClose.confirm.domId;
|
||||
} else if (this.operation === OperationEvent.Signal.reopenSignal.menu.operation) {
|
||||
/** 信号重开*/
|
||||
return OperationEvent.Signal.reopenSignal.confirm.domId;
|
||||
} else if (this.operation === OperationEvent.Signal.cancelTrainRoute.menu.operation) {
|
||||
/** 取消进路*/
|
||||
return OperationEvent.Signal.cancelTrainRoute.confirm.domId;
|
||||
} else if (this.operation === OperationEvent.Signal.humanControl.menu.operation) {
|
||||
/** 进路交人工控*/
|
||||
return OperationEvent.Signal.humanControl.confirm.domId;
|
||||
} else if (this.operation === OperationEvent.Signal.atsAutoControl.menu.operation) {
|
||||
/** 进路交ATS自动控*/
|
||||
return OperationEvent.Signal.atsAutoControl.confirm.domId;
|
||||
} else if (this.operation === OperationEvent.StationStand.setRunLevel.menu.operation) {
|
||||
/** 设置运行等级*/
|
||||
return OperationEvent.StationStand.setRunLevel.confirm.domId;
|
||||
} else if (this.operation === OperationEvent.StationStand.setStopTime.menu.operation) {
|
||||
/** 设置停站时间*/
|
||||
return OperationEvent.StationStand.setStopTime.confirm.domId;
|
||||
} else if (this.operation === OperationEvent.StationStand.setBackStrategy.menu.operation) {
|
||||
/** 设置折返策略*/
|
||||
return OperationEvent.StationStand.setBackStrategy.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;
|
||||
}
|
||||
export default {
|
||||
name: 'ConfirmControl',
|
||||
components: {
|
||||
NoticeInfo
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
dialogShow: false,
|
||||
loading: false,
|
||||
operate: {},
|
||||
messages: '',
|
||||
operation: null
|
||||
};
|
||||
},
|
||||
computed: {
|
||||
show() {
|
||||
return this.dialogShow && !this.$store.state.menuOperation.break;
|
||||
},
|
||||
title() {
|
||||
if (this.operation === OperationEvent.Signal.arrangementRoute.menu.operation) {
|
||||
return this.$t('menu.accessSetting');
|
||||
} else if (this.operation === OperationEvent.Signal.signalClose.menu.operation) {
|
||||
return this.$t('menu.menuSignal.signalOff');
|
||||
} else if (this.operation === OperationEvent.Signal.reopenSignal.menu.operation) {
|
||||
return this.$t('menu.menuSignal.signalReopen');
|
||||
} else if (this.operation === OperationEvent.Signal.cancelTrainRoute.menu.operation) {
|
||||
return this.$t('menu.cancelTheWay');
|
||||
} else if (this.operation === OperationEvent.Signal.humanControl.menu.operation) {
|
||||
return this.$t('menu.approachManualControl');
|
||||
} else if (this.operation === OperationEvent.Signal.atsAutoControl.menu.operation) {
|
||||
return this.$t('menu.accessToATSAutomaticControl');
|
||||
} else if (this.operation === OperationEvent.StationStand.setRunLevel.menu.operation) {
|
||||
return this.$t('menu.menuStationStand.setRunLevel');
|
||||
} else if (this.operation === OperationEvent.StationStand.setStopTime.menu.operation) {
|
||||
return this.$t('menu.stopTime');
|
||||
} else if (this.operation === OperationEvent.StationStand.setBackStrategy.menu.operation) {
|
||||
return this.$t('menu.setSwitchbackStrategy');
|
||||
}
|
||||
return '';
|
||||
},
|
||||
domIdCancel() {
|
||||
return this.dialogShow ? OperationEvent.Command.cancel.menu.domId : '';
|
||||
},
|
||||
domIdConfirm() {
|
||||
if (this.dialogShow) {
|
||||
if (this.operation === OperationEvent.Signal.arrangementRoute.menu.operation) {
|
||||
/** 进路设置*/
|
||||
return OperationEvent.Signal.arrangementRoute.confirm.domId;
|
||||
} else if (this.operation === OperationEvent.Signal.signalClose.menu.operation) {
|
||||
/** 信号关灯*/
|
||||
return OperationEvent.Signal.signalClose.confirm.domId;
|
||||
} else if (this.operation === OperationEvent.Signal.reopenSignal.menu.operation) {
|
||||
/** 信号重开*/
|
||||
return OperationEvent.Signal.reopenSignal.confirm.domId;
|
||||
} else if (this.operation === OperationEvent.Signal.cancelTrainRoute.menu.operation) {
|
||||
/** 取消进路*/
|
||||
return OperationEvent.Signal.cancelTrainRoute.confirm.domId;
|
||||
} else if (this.operation === OperationEvent.Signal.humanControl.menu.operation) {
|
||||
/** 进路交人工控*/
|
||||
return OperationEvent.Signal.humanControl.confirm.domId;
|
||||
} else if (this.operation === OperationEvent.Signal.atsAutoControl.menu.operation) {
|
||||
/** 进路交ATS自动控*/
|
||||
return OperationEvent.Signal.atsAutoControl.confirm.domId;
|
||||
} else if (this.operation === OperationEvent.StationStand.setRunLevel.menu.operation) {
|
||||
/** 设置运行等级*/
|
||||
return OperationEvent.StationStand.setRunLevel.confirm.domId;
|
||||
} else if (this.operation === OperationEvent.StationStand.setStopTime.menu.operation) {
|
||||
/** 设置停站时间*/
|
||||
return OperationEvent.StationStand.setStopTime.confirm.domId;
|
||||
} else if (this.operation === OperationEvent.StationStand.setBackStrategy.menu.operation) {
|
||||
/** 设置折返策略*/
|
||||
return OperationEvent.StationStand.setBackStrategy.confirm.domId;
|
||||
}
|
||||
}
|
||||
return '';
|
||||
}
|
||||
},
|
||||
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('training/emitTipFresh');
|
||||
},
|
||||
commit() {
|
||||
if (this.operation === OperationEvent.Signal.arrangementRoute.menu.operation) {
|
||||
/** 进路设置*/
|
||||
this.routeSetting();
|
||||
} else if (this.operation === OperationEvent.Signal.signalClose.menu.operation) {
|
||||
/** 信号关灯*/
|
||||
this.signalClose();
|
||||
} else if (this.operation === OperationEvent.Signal.reopenSignal.menu.operation) {
|
||||
/** 信号重开*/
|
||||
this.reopenSignal();
|
||||
} else if (this.operation === OperationEvent.Signal.cancelTrainRoute.menu.operation) {
|
||||
/** 取消进路*/
|
||||
this.cancelTrainRoute();
|
||||
} else if (this.operation === OperationEvent.Signal.humanControl.menu.operation) {
|
||||
/** 进路交人工控*/
|
||||
this.humanControl();
|
||||
} else if (this.operation === OperationEvent.Signal.atsAutoControl.menu.operation) {
|
||||
/** 进路交ATS自动控*/
|
||||
this.atsAutoControl();
|
||||
} else if (this.operation === OperationEvent.StationStand.setRunLevel.menu.operation) {
|
||||
/** 设置运行等级*/
|
||||
this.setRunLevel();
|
||||
} else if (this.operation === OperationEvent.StationStand.setStopTime.menu.operation) {
|
||||
/** 停站时间*/
|
||||
this.setStopTime();
|
||||
} else if (this.operation === OperationEvent.StationStand.setBackStrategy.menu.operation) {
|
||||
/** 设置折返策略*/
|
||||
this.setBackStrategy();
|
||||
}
|
||||
},
|
||||
//进路设置
|
||||
routeSetting() {
|
||||
let operate = {
|
||||
send: true,
|
||||
type: this.operate.type,
|
||||
operation: OperationEvent.Signal.arrangementRoute.confirm.operation,
|
||||
}
|
||||
this.dialogShow = true;
|
||||
this.$nextTick(function () {
|
||||
this.$store.dispatch('training/emitTipFresh');
|
||||
});
|
||||
},
|
||||
doClose() {
|
||||
this.loading = false;
|
||||
this.dialogShow = false;
|
||||
this.$store.dispatch('training/emitTipFresh');
|
||||
},
|
||||
commit() {
|
||||
if (this.operation === OperationEvent.Signal.arrangementRoute.menu.operation) {
|
||||
/** 进路设置*/
|
||||
this.routeSetting();
|
||||
} else if (this.operation === OperationEvent.Signal.signalClose.menu.operation) {
|
||||
/** 信号关灯*/
|
||||
this.signalClose();
|
||||
} else if (this.operation === OperationEvent.Signal.reopenSignal.menu.operation) {
|
||||
/** 信号重开*/
|
||||
this.reopenSignal();
|
||||
} else if (this.operation === OperationEvent.Signal.cancelTrainRoute.menu.operation) {
|
||||
/** 取消进路*/
|
||||
this.cancelTrainRoute();
|
||||
} else if (this.operation === OperationEvent.Signal.humanControl.menu.operation) {
|
||||
/** 进路交人工控*/
|
||||
this.humanControl();
|
||||
} else if (this.operation === OperationEvent.Signal.atsAutoControl.menu.operation) {
|
||||
/** 进路交ATS自动控*/
|
||||
this.atsAutoControl();
|
||||
} else if (this.operation === OperationEvent.StationStand.setRunLevel.menu.operation) {
|
||||
/** 设置运行等级*/
|
||||
this.setRunLevel();
|
||||
} else if (this.operation === OperationEvent.StationStand.setStopTime.menu.operation) {
|
||||
/** 停站时间*/
|
||||
this.setStopTime();
|
||||
} else if (this.operation === OperationEvent.StationStand.setBackStrategy.menu.operation) {
|
||||
/** 设置折返策略*/
|
||||
this.setBackStrategy();
|
||||
}
|
||||
},
|
||||
// 进路设置
|
||||
routeSetting() {
|
||||
const operate = {
|
||||
send: true,
|
||||
type: this.operate.type,
|
||||
operation: OperationEvent.Signal.arrangementRoute.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);
|
||||
})
|
||||
},
|
||||
//信号关灯
|
||||
signalClose() {
|
||||
let operate = {
|
||||
send: true,
|
||||
type: this.operate.type,
|
||||
operation: OperationEvent.Signal.signalClose.confirm.operation
|
||||
}
|
||||
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);
|
||||
});
|
||||
},
|
||||
// 信号关灯
|
||||
signalClose() {
|
||||
const operate = {
|
||||
send: true,
|
||||
type: this.operate.type,
|
||||
operation: OperationEvent.Signal.signalClose.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);
|
||||
})
|
||||
},
|
||||
//信号重开
|
||||
reopenSignal() {
|
||||
let operate = {
|
||||
send: true,
|
||||
type: this.operate.type,
|
||||
operation: OperationEvent.Signal.reopenSignal.confirm.operation
|
||||
}
|
||||
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);
|
||||
});
|
||||
},
|
||||
// 信号重开
|
||||
reopenSignal() {
|
||||
const operate = {
|
||||
send: true,
|
||||
type: this.operate.type,
|
||||
operation: OperationEvent.Signal.reopenSignal.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);
|
||||
})
|
||||
},
|
||||
//取消进路
|
||||
cancelTrainRoute() {
|
||||
let operate = {
|
||||
send: true,
|
||||
type: this.operate.type,
|
||||
operation: OperationEvent.Signal.cancelTrainRoute.confirm.operation
|
||||
}
|
||||
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);
|
||||
});
|
||||
},
|
||||
// 取消进路
|
||||
cancelTrainRoute() {
|
||||
const operate = {
|
||||
send: true,
|
||||
type: this.operate.type,
|
||||
operation: OperationEvent.Signal.cancelTrainRoute.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);
|
||||
})
|
||||
},
|
||||
//进路交人工控
|
||||
humanControl() {
|
||||
let operate = {
|
||||
send: true,
|
||||
type: MapDeviceType.Signal.type,
|
||||
operation: OperationEvent.Signal.humanControl.menu.operation,
|
||||
}
|
||||
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);
|
||||
});
|
||||
},
|
||||
// 进路交人工控
|
||||
humanControl() {
|
||||
const operate = {
|
||||
send: true,
|
||||
type: MapDeviceType.Signal.type,
|
||||
operation: OperationEvent.Signal.humanControl.menu.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);
|
||||
});
|
||||
},
|
||||
//进路交ATS自动控
|
||||
atsAutoControl() {
|
||||
let operate = {
|
||||
send: true,
|
||||
type: MapDeviceType.Signal.type,
|
||||
operation: OperationEvent.Signal.atsAutoControl.menu.operation,
|
||||
}
|
||||
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);
|
||||
});
|
||||
},
|
||||
// 进路交ATS自动控
|
||||
atsAutoControl() {
|
||||
const operate = {
|
||||
send: true,
|
||||
type: MapDeviceType.Signal.type,
|
||||
operation: OperationEvent.Signal.atsAutoControl.menu.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);
|
||||
});
|
||||
},
|
||||
//设置运行等级
|
||||
setRunLevel() {
|
||||
let operate = {
|
||||
send: true,
|
||||
type: this.operate.type,
|
||||
operation: OperationEvent.StationStand.setRunLevel.confirm.operation,
|
||||
val: this.operate.val
|
||||
}
|
||||
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);
|
||||
});
|
||||
},
|
||||
// 设置运行等级
|
||||
setRunLevel() {
|
||||
const operate = {
|
||||
send: true,
|
||||
type: this.operate.type,
|
||||
operation: OperationEvent.StationStand.setRunLevel.confirm.operation,
|
||||
val: this.operate.val
|
||||
};
|
||||
|
||||
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);
|
||||
})
|
||||
},
|
||||
//停站时间
|
||||
setStopTime() {
|
||||
let operate = {
|
||||
send: true,
|
||||
type: this.operate.type,
|
||||
operation: OperationEvent.StationStand.setStopTime.confirm.operation,
|
||||
val: this.operate.val,
|
||||
}
|
||||
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);
|
||||
});
|
||||
},
|
||||
// 停站时间
|
||||
setStopTime() {
|
||||
const operate = {
|
||||
send: true,
|
||||
type: this.operate.type,
|
||||
operation: OperationEvent.StationStand.setStopTime.confirm.operation,
|
||||
val: this.operate.val
|
||||
};
|
||||
|
||||
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);
|
||||
})
|
||||
},
|
||||
//设置折返策略
|
||||
setBackStrategy() {
|
||||
let operate = {
|
||||
send: true,
|
||||
type: this.operate.type,
|
||||
operation: OperationEvent.StationStand.setBackStrategy.confirm.operation,
|
||||
val: this.operate.val,
|
||||
}
|
||||
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);
|
||||
});
|
||||
},
|
||||
// 设置折返策略
|
||||
setBackStrategy() {
|
||||
const operate = {
|
||||
send: true,
|
||||
type: this.operate.type,
|
||||
operation: OperationEvent.StationStand.setBackStrategy.confirm.operation,
|
||||
val: this.operate.val
|
||||
};
|
||||
|
||||
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.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: 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();
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
this.$store.dispatch('training/next', operate).then(({ valid }) => {
|
||||
if (valid) {
|
||||
this.doClose();
|
||||
}
|
||||
}).catch(() => {
|
||||
this.doClose();
|
||||
});
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
</script>
|
||||
<style>
|
||||
|
@ -1,148 +1,160 @@
|
||||
<template>
|
||||
<el-dialog class="fuzhou-01__systerm confirm-control-speed" :title="title" :visible.sync="show" width="540px"
|
||||
:before-close="doClose" :zIndex="2000" :modal="false" :close-on-click-modal="false" append-to-body v-dialogDrag>
|
||||
<div style="height: 60px; padding-left: 20px">
|
||||
<span style="font-size: 18px">{{message}}</span>
|
||||
</div>
|
||||
<el-row justify="center" class="button-group">
|
||||
<el-col :span="6" :offset="6">
|
||||
<el-button :id="domIdConfirm" type="primary" :loading="loading" @click="commit">{{$t('global.confirm')}}</el-button>
|
||||
</el-col>
|
||||
<el-col :span="10" :offset="2">
|
||||
<el-button :id="domIdCancel" @click="cancel">{{$t('global.cancel')}}</el-button>
|
||||
</el-col>
|
||||
</el-row>
|
||||
</el-dialog>
|
||||
<el-dialog
|
||||
v-dialogDrag
|
||||
class="fuzhou-01__systerm confirm-control-speed"
|
||||
:title="title"
|
||||
:visible.sync="show"
|
||||
width="540px"
|
||||
:before-close="doClose"
|
||||
:z-index="2000"
|
||||
:modal="false"
|
||||
:close-on-click-modal="false"
|
||||
append-to-body
|
||||
>
|
||||
<div style="height: 60px; padding-left: 20px">
|
||||
<span style="font-size: 18px">{{ message }}</span>
|
||||
</div>
|
||||
<el-row justify="center" class="button-group">
|
||||
<el-col :span="6" :offset="6">
|
||||
<el-button :id="domIdConfirm" type="primary" :loading="loading" @click="commit">{{ $t('global.confirm') }}</el-button>
|
||||
</el-col>
|
||||
<el-col :span="10" :offset="2">
|
||||
<el-button :id="domIdCancel" @click="cancel">{{ $t('global.cancel') }}</el-button>
|
||||
</el-col>
|
||||
</el-row>
|
||||
</el-dialog>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import { MapDeviceType, OperationEvent } from '@/scripts/ConstDic';
|
||||
import { OperationEvent } from '@/scripts/ConstDic';
|
||||
|
||||
export default {
|
||||
name: 'ConfirmControlSpeed',
|
||||
data() {
|
||||
return {
|
||||
dialogShow: false,
|
||||
loading: false,
|
||||
type: '',
|
||||
operation: '',
|
||||
message: '',
|
||||
}
|
||||
},
|
||||
computed: {
|
||||
show() {
|
||||
return this.dialogShow && !this.$store.state.menuOperation.break;
|
||||
},
|
||||
title() {
|
||||
if (this.dialogShow) {
|
||||
if (this.operation === OperationEvent.Section.setSpeed.order.operation) {
|
||||
return this.$t('menu.menuSection.sectionSetSpeedLimit');
|
||||
} else if (this.operation === OperationEvent.Section.cancelSpeed.order.operation) {
|
||||
return this.$t('menu.menuSection.sectionCancelSpeedLimit');
|
||||
} else if (this.operation === OperationEvent.Switch.setSpeed.order.operation) {
|
||||
return this.$t('menu.switchSettingSpeedLimit');
|
||||
} else if (this.operation === OperationEvent.Switch.cancelSpeed.order.operation) {
|
||||
return this.$t('menu.menuSection.sectionCancelSpeedLimit');
|
||||
}
|
||||
}
|
||||
},
|
||||
domIdCancel() {
|
||||
return this.dialogShow ? OperationEvent.Command.cancel.menu.domId : '';
|
||||
},
|
||||
domIdConfirm() {
|
||||
if (this.dialogShow) {
|
||||
if (this.operation === OperationEvent.Section.setSpeed.order.operation) {
|
||||
/** 区段设置限速*/
|
||||
return OperationEvent.Section.setSpeed.confirm.domId;
|
||||
} else if (this.operation === OperationEvent.Section.cancelSpeed.order.operation) {
|
||||
/** 区段取消限速*/
|
||||
return OperationEvent.Section.cancelSpeed.confirm.domId;
|
||||
} else if (this.operation === OperationEvent.Switch.setSpeed.order.operation) {
|
||||
/** 道岔设置限速*/
|
||||
return OperationEvent.Switch.setSpeed.confirm.domId;
|
||||
} else if (this.operation === OperationEvent.Switch.cancelSpeed.order.operation) {
|
||||
/** 道岔取消限速*/
|
||||
return OperationEvent.Switch.cancelSpeed.confirm.domId;
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
mounted() {
|
||||
this.$nextTick(() => {
|
||||
this.$store.dispatch('training/tipReload');
|
||||
})
|
||||
},
|
||||
methods: {
|
||||
doShow(operate) {
|
||||
if (!this.dialogShow) {
|
||||
this.type = operate.type;
|
||||
this.operation = operate.operation;
|
||||
this.message = operate.message;
|
||||
}
|
||||
export default {
|
||||
name: 'ConfirmControlSpeed',
|
||||
data() {
|
||||
return {
|
||||
dialogShow: false,
|
||||
loading: false,
|
||||
type: '',
|
||||
operation: '',
|
||||
message: ''
|
||||
};
|
||||
},
|
||||
computed: {
|
||||
show() {
|
||||
return this.dialogShow && !this.$store.state.menuOperation.break;
|
||||
},
|
||||
title() {
|
||||
if (this.dialogShow) {
|
||||
if (this.operation === OperationEvent.Section.setSpeed.order.operation) {
|
||||
return this.$t('menu.menuSection.sectionSetSpeedLimit');
|
||||
} else if (this.operation === OperationEvent.Section.cancelSpeed.order.operation) {
|
||||
return this.$t('menu.menuSection.sectionCancelSpeedLimit');
|
||||
} else if (this.operation === OperationEvent.Switch.setSpeed.order.operation) {
|
||||
return this.$t('menu.switchSettingSpeedLimit');
|
||||
} else if (this.operation === OperationEvent.Switch.cancelSpeed.order.operation) {
|
||||
return this.$t('menu.menuSection.sectionCancelSpeedLimit');
|
||||
}
|
||||
}
|
||||
return '';
|
||||
},
|
||||
domIdCancel() {
|
||||
return this.dialogShow ? OperationEvent.Command.cancel.menu.domId : '';
|
||||
},
|
||||
domIdConfirm() {
|
||||
if (this.dialogShow) {
|
||||
if (this.operation === OperationEvent.Section.setSpeed.order.operation) {
|
||||
/** 区段设置限速*/
|
||||
return OperationEvent.Section.setSpeed.confirm.domId;
|
||||
} else if (this.operation === OperationEvent.Section.cancelSpeed.order.operation) {
|
||||
/** 区段取消限速*/
|
||||
return OperationEvent.Section.cancelSpeed.confirm.domId;
|
||||
} else if (this.operation === OperationEvent.Switch.setSpeed.order.operation) {
|
||||
/** 道岔设置限速*/
|
||||
return OperationEvent.Switch.setSpeed.confirm.domId;
|
||||
} else if (this.operation === OperationEvent.Switch.cancelSpeed.order.operation) {
|
||||
/** 道岔取消限速*/
|
||||
return OperationEvent.Switch.cancelSpeed.confirm.domId;
|
||||
}
|
||||
}
|
||||
return '';
|
||||
}
|
||||
},
|
||||
mounted() {
|
||||
this.$nextTick(() => {
|
||||
this.$store.dispatch('training/tipReload');
|
||||
});
|
||||
},
|
||||
methods: {
|
||||
doShow(operate) {
|
||||
if (!this.dialogShow) {
|
||||
this.type = operate.type;
|
||||
this.operation = operate.operation;
|
||||
this.message = operate.message;
|
||||
}
|
||||
|
||||
this.loading = false;
|
||||
this.dialogShow = true;
|
||||
this.$nextTick(function () {
|
||||
this.$store.dispatch('training/emitTipFresh');
|
||||
});
|
||||
},
|
||||
doClose() {
|
||||
this.loading = false;
|
||||
this.dialogShow = false;
|
||||
this.$store.dispatch('training/emitTipFresh');
|
||||
},
|
||||
commit() {
|
||||
let operate = {
|
||||
type: this.type
|
||||
}
|
||||
this.loading = false;
|
||||
this.dialogShow = true;
|
||||
this.$nextTick(function () {
|
||||
this.$store.dispatch('training/emitTipFresh');
|
||||
});
|
||||
},
|
||||
doClose() {
|
||||
this.loading = false;
|
||||
this.dialogShow = false;
|
||||
this.$store.dispatch('training/emitTipFresh');
|
||||
},
|
||||
commit() {
|
||||
const operate = {
|
||||
type: this.type
|
||||
};
|
||||
|
||||
if (this.operation === OperationEvent.Section.setSpeed.order.operation) {
|
||||
/** 区段设置限速*/
|
||||
operate.operation = OperationEvent.Section.setSpeed.confirm.operation;
|
||||
} else if (this.operation === OperationEvent.Section.cancelSpeed.order.operation) {
|
||||
/** 区段取消限速*/
|
||||
operate.operation = OperationEvent.Section.cancelSpeed.confirm.operation;
|
||||
} else if (this.operation === OperationEvent.Switch.setSpeed.order.operation) {
|
||||
/** 道岔设置限速*/
|
||||
operate.operation = OperationEvent.Switch.setSpeed.confirm.operation;
|
||||
} else if (this.operation === OperationEvent.Switch.cancelSpeed.order.operation) {
|
||||
/** 道岔取消限速*/
|
||||
operate.operation = OperationEvent.Switch.cancelSpeed.confirm.operation;
|
||||
}
|
||||
if (this.operation === OperationEvent.Section.setSpeed.order.operation) {
|
||||
/** 区段设置限速*/
|
||||
operate.operation = OperationEvent.Section.setSpeed.confirm.operation;
|
||||
} else if (this.operation === OperationEvent.Section.cancelSpeed.order.operation) {
|
||||
/** 区段取消限速*/
|
||||
operate.operation = OperationEvent.Section.cancelSpeed.confirm.operation;
|
||||
} else if (this.operation === OperationEvent.Switch.setSpeed.order.operation) {
|
||||
/** 道岔设置限速*/
|
||||
operate.operation = OperationEvent.Switch.setSpeed.confirm.operation;
|
||||
} else if (this.operation === OperationEvent.Switch.cancelSpeed.order.operation) {
|
||||
/** 道岔取消限速*/
|
||||
operate.operation = OperationEvent.Switch.cancelSpeed.confirm.operation;
|
||||
}
|
||||
|
||||
this.loading = true;
|
||||
this.$store.dispatch('training/next', operate).then(({ valid }) => {
|
||||
this.loading = false;
|
||||
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
|
||||
if (valid) {
|
||||
this.$emit('setOperate', { step: 1, success: true });
|
||||
this.doClose();
|
||||
}
|
||||
}).catch((error) => {
|
||||
this.loading = false;
|
||||
this.$emit('setOperate', { step: 0, success: false });
|
||||
this.doClose();
|
||||
})
|
||||
},
|
||||
cancel() {
|
||||
let operate = {
|
||||
type: this.type,
|
||||
operation: OperationEvent.Command.cancel.menu.operation,
|
||||
}
|
||||
this.loading = true;
|
||||
this.$store.dispatch('training/next', operate).then(({ valid }) => {
|
||||
this.loading = false;
|
||||
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
|
||||
if (valid) {
|
||||
this.$emit('setOperate', { step: 1, success: true });
|
||||
this.doClose();
|
||||
}
|
||||
}).catch(() => {
|
||||
this.loading = false;
|
||||
this.$emit('setOperate', { step: 0, success: false });
|
||||
this.doClose();
|
||||
});
|
||||
},
|
||||
cancel() {
|
||||
const operate = {
|
||||
type: this.type,
|
||||
operation: OperationEvent.Command.cancel.menu.operation
|
||||
};
|
||||
|
||||
this.$store.dispatch('training/next', operate).then(({ valid }) => {
|
||||
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
|
||||
if (valid) {
|
||||
this.$emit('setOperate', { step: 0, success: false });
|
||||
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
|
||||
this.doClose();
|
||||
}
|
||||
}).catch(error => {
|
||||
this.doClose();
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
this.$store.dispatch('training/next', operate).then(({ valid }) => {
|
||||
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
|
||||
if (valid) {
|
||||
this.$emit('setOperate', { step: 0, success: false });
|
||||
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
|
||||
this.doClose();
|
||||
}
|
||||
}).catch(() => {
|
||||
this.doClose();
|
||||
});
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
</script>
|
||||
<style>
|
||||
|
@ -1,113 +1,123 @@
|
||||
<template>
|
||||
<el-dialog class="fuzhou-01__systerm route-unlock-confirm" :title="title" :visible.sync="show" width="500px"
|
||||
:before-close="doClose" :zIndex="2000" :modal="false" :close-on-click-modal="false" append-to-body v-dialogDrag>
|
||||
<div style="height: 60px; padding-left: 20px">
|
||||
<span>{{$t('menu.in')}}{{stationName}}【{{signalName}}】{{$t('menu.signalConfirmed')}}</span>
|
||||
</div>
|
||||
<el-row justify="center" class="button-group">
|
||||
<el-col :span="6" :offset="6">
|
||||
<el-button :id="domIdConfirm" type="primary" :loading="loading" @click="commit">{{$t('global.confirm')}}</el-button>
|
||||
</el-col>
|
||||
<el-col :span="10" :offset="2">
|
||||
<el-button :id="domIdCancel" @click="cancel">{{$t('global.cancel')}}</el-button>
|
||||
</el-col>
|
||||
</el-row>
|
||||
</el-dialog>
|
||||
<el-dialog
|
||||
v-dialogDrag
|
||||
class="fuzhou-01__systerm route-unlock-confirm"
|
||||
:title="title"
|
||||
:visible.sync="show"
|
||||
width="500px"
|
||||
:before-close="doClose"
|
||||
:z-index="2000"
|
||||
:modal="false"
|
||||
:close-on-click-modal="false"
|
||||
append-to-body
|
||||
>
|
||||
<div style="height: 60px; padding-left: 20px">
|
||||
<span>{{ $t('menu.in') }}{{ stationName }}【{{ signalName }}】{{ $t('menu.signalConfirmed') }}</span>
|
||||
</div>
|
||||
<el-row justify="center" class="button-group">
|
||||
<el-col :span="6" :offset="6">
|
||||
<el-button :id="domIdConfirm" type="primary" :loading="loading" @click="commit">{{ $t('global.confirm') }}</el-button>
|
||||
</el-col>
|
||||
<el-col :span="10" :offset="2">
|
||||
<el-button :id="domIdCancel" @click="cancel">{{ $t('global.cancel') }}</el-button>
|
||||
</el-col>
|
||||
</el-row>
|
||||
</el-dialog>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import { MapDeviceType, OperationEvent } from '@/scripts/ConstDic';
|
||||
import { MapDeviceType, OperationEvent } from '@/scripts/ConstDic';
|
||||
|
||||
export default {
|
||||
name: 'RouteUnlockConfirm',
|
||||
data() {
|
||||
return {
|
||||
dialogShow: false,
|
||||
loading: false,
|
||||
signalName: '',
|
||||
stationName: ''
|
||||
}
|
||||
},
|
||||
computed: {
|
||||
show() {
|
||||
return this.dialogShow && !this.$store.state.menuOperation.break;
|
||||
},
|
||||
title() {
|
||||
return this.$t('menu.signalDeblocking')
|
||||
},
|
||||
domIdCancel() {
|
||||
return this.dialogShow ? OperationEvent.Command.cancel.menu.domId : '';
|
||||
},
|
||||
domIdConfirm() {
|
||||
return this.dialogShow ? OperationEvent.Signal.unlock.confirm.domId : '';
|
||||
}
|
||||
},
|
||||
mounted() {
|
||||
this.$nextTick(() => {
|
||||
this.$store.dispatch('training/tipReload');
|
||||
})
|
||||
},
|
||||
methods: {
|
||||
doShow(operate, selected) {
|
||||
this.stationName = ''
|
||||
this.signalName = '';
|
||||
if (selected) {
|
||||
this.signalName = selected.name;
|
||||
let station = this.$store.getters['map/getDeviceByCode'](selected.stationCode);
|
||||
if (station) {
|
||||
this.stationName = station.name;
|
||||
}
|
||||
}
|
||||
export default {
|
||||
name: 'RouteUnlockConfirm',
|
||||
data() {
|
||||
return {
|
||||
dialogShow: false,
|
||||
loading: false,
|
||||
signalName: '',
|
||||
stationName: ''
|
||||
};
|
||||
},
|
||||
computed: {
|
||||
show() {
|
||||
return this.dialogShow && !this.$store.state.menuOperation.break;
|
||||
},
|
||||
title() {
|
||||
return this.$t('menu.signalDeblocking');
|
||||
},
|
||||
domIdCancel() {
|
||||
return this.dialogShow ? OperationEvent.Command.cancel.menu.domId : '';
|
||||
},
|
||||
domIdConfirm() {
|
||||
return this.dialogShow ? OperationEvent.Signal.unlock.confirm.domId : '';
|
||||
}
|
||||
},
|
||||
mounted() {
|
||||
this.$nextTick(() => {
|
||||
this.$store.dispatch('training/tipReload');
|
||||
});
|
||||
},
|
||||
methods: {
|
||||
doShow(operate, selected) {
|
||||
this.stationName = '';
|
||||
this.signalName = '';
|
||||
if (selected) {
|
||||
this.signalName = selected.name;
|
||||
const station = this.$store.getters['map/getDeviceByCode'](selected.stationCode);
|
||||
if (station) {
|
||||
this.stationName = station.name;
|
||||
}
|
||||
}
|
||||
|
||||
this.loading = false;
|
||||
this.dialogShow = true;
|
||||
this.$nextTick(function () {
|
||||
this.$store.dispatch('training/emitTipFresh');
|
||||
});
|
||||
},
|
||||
doClose() {
|
||||
this.loading = false;
|
||||
this.dialogShow = false;
|
||||
this.$store.dispatch('training/emitTipFresh');
|
||||
},
|
||||
commit() {
|
||||
let operate = {
|
||||
type: MapDeviceType.Signal.type,
|
||||
operation: OperationEvent.Signal.unlock.confirm.operation
|
||||
}
|
||||
this.loading = false;
|
||||
this.dialogShow = true;
|
||||
this.$nextTick(function () {
|
||||
this.$store.dispatch('training/emitTipFresh');
|
||||
});
|
||||
},
|
||||
doClose() {
|
||||
this.loading = false;
|
||||
this.dialogShow = false;
|
||||
this.$store.dispatch('training/emitTipFresh');
|
||||
},
|
||||
commit() {
|
||||
const operate = {
|
||||
type: MapDeviceType.Signal.type,
|
||||
operation: OperationEvent.Signal.unlock.confirm.operation
|
||||
};
|
||||
|
||||
this.loading = true;
|
||||
this.$store.dispatch('training/next', operate).then(({ valid }) => {
|
||||
this.loading = false;
|
||||
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
|
||||
if (valid) {
|
||||
this.$emit('setOperate', { step: 1, success: true });
|
||||
this.doClose();
|
||||
}
|
||||
}).catch((error) => {
|
||||
this.loading = false;
|
||||
this.$emit('setOperate', { step: 0, success: false });
|
||||
this.doClose();
|
||||
})
|
||||
},
|
||||
cancel() {
|
||||
let operate = {
|
||||
type: MapDeviceType.Signal.type,
|
||||
operation: OperationEvent.Command.cancel.menu.operation,
|
||||
}
|
||||
this.loading = true;
|
||||
this.$store.dispatch('training/next', operate).then(({ valid }) => {
|
||||
this.loading = false;
|
||||
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
|
||||
if (valid) {
|
||||
this.$emit('setOperate', { step: 1, success: true });
|
||||
this.doClose();
|
||||
}
|
||||
}).catch(() => {
|
||||
this.loading = false;
|
||||
this.$emit('setOperate', { step: 0, success: false });
|
||||
this.doClose();
|
||||
});
|
||||
},
|
||||
cancel() {
|
||||
const operate = {
|
||||
type: MapDeviceType.Signal.type,
|
||||
operation: OperationEvent.Command.cancel.menu.operation
|
||||
};
|
||||
|
||||
this.$store.dispatch('training/next', operate).then(({ valid }) => {
|
||||
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
|
||||
if (valid) {
|
||||
this.$emit('setOperate', { step: 0, success: false });
|
||||
this.doClose();
|
||||
}
|
||||
}).catch(error => {
|
||||
this.doClose();
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
this.$store.dispatch('training/next', operate).then(({ valid }) => {
|
||||
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
|
||||
if (valid) {
|
||||
this.$emit('setOperate', { step: 0, success: false });
|
||||
this.doClose();
|
||||
}
|
||||
}).catch(() => {
|
||||
this.doClose();
|
||||
});
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
</script>
|
||||
<style>
|
||||
|
@ -1,163 +1,175 @@
|
||||
<template>
|
||||
<el-dialog class="fuzhou-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 in messages">
|
||||
<span>{{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">{{$t('global.confirm')}}</el-button>
|
||||
</el-col>
|
||||
<el-col :span="8" :offset="4">
|
||||
<el-button :id="domIdCancel" @click="cancel">{{$t('global.cancel')}}</el-button>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<notice-info ref="noticeInfo"></notice-info>
|
||||
</el-dialog>
|
||||
<el-dialog
|
||||
v-dialogDrag
|
||||
class="fuzhou-01__systerm confirm-control"
|
||||
:title="title"
|
||||
:visible.sync="show"
|
||||
width="360px"
|
||||
:before-close="doClose"
|
||||
:z-index="2000"
|
||||
:modal="false"
|
||||
:close-on-click-modal="false"
|
||||
append-to-body
|
||||
>
|
||||
<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">{{ $t('global.confirm') }}</el-button>
|
||||
</el-col>
|
||||
<el-col :span="8" :offset="4">
|
||||
<el-button :id="domIdCancel" @click="cancel">{{ $t('global.cancel') }}</el-button>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<notice-info ref="noticeInfo" />
|
||||
</el-dialog>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import { MapDeviceType, OperationEvent } from '@/scripts/ConstDic';
|
||||
import NoticeInfo from './childDialog/noticeInfo'
|
||||
import { 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 this.$t('menu.menuTrain.addTrainId');
|
||||
} else if (this.operation === OperationEvent.Train.editTrainId.menu.operation) {
|
||||
return this.$t('menu.menuTrain.editTrainId');
|
||||
} else if (this.operation === OperationEvent.Train.delTrainId.menu.operation) {
|
||||
return this.$t('menu.menuTrain.deleteTrainId');
|
||||
} else if (this.operation === OperationEvent.Train.moveTrainId.menu.operation) {
|
||||
return this.$t('menu.menuTrain.moveTrainId');
|
||||
} else if (this.operation === OperationEvent.Train.switchTrainId.menu.operation) {
|
||||
return this.$t('menu.menuTrain.switchTrainId');
|
||||
} else if (this.operation === OperationEvent.Train.editTrainNo.menu.operation) {
|
||||
return this.$t('menu.menuTrain.editTrainNo');
|
||||
}
|
||||
},
|
||||
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;
|
||||
}
|
||||
export default {
|
||||
name: 'ConfirmTrain',
|
||||
components: {
|
||||
NoticeInfo
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
dialogShow: false,
|
||||
loading: false,
|
||||
operate: {},
|
||||
messages: '',
|
||||
operation: null
|
||||
};
|
||||
},
|
||||
computed: {
|
||||
show() {
|
||||
return this.dialogShow && !this.$store.state.menuOperation.break;
|
||||
},
|
||||
title() {
|
||||
if (this.operation === OperationEvent.Train.addTrainId.menu.operation) {
|
||||
return this.$t('menu.menuTrain.addTrainId');
|
||||
} else if (this.operation === OperationEvent.Train.editTrainId.menu.operation) {
|
||||
return this.$t('menu.menuTrain.editTrainId');
|
||||
} else if (this.operation === OperationEvent.Train.delTrainId.menu.operation) {
|
||||
return this.$t('menu.menuTrain.deleteTrainId');
|
||||
} else if (this.operation === OperationEvent.Train.moveTrainId.menu.operation) {
|
||||
return this.$t('menu.menuTrain.moveTrainId');
|
||||
} else if (this.operation === OperationEvent.Train.switchTrainId.menu.operation) {
|
||||
return this.$t('menu.menuTrain.switchTrainId');
|
||||
} else if (this.operation === OperationEvent.Train.editTrainNo.menu.operation) {
|
||||
return this.$t('menu.menuTrain.editTrainNo');
|
||||
}
|
||||
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;
|
||||
}
|
||||
}
|
||||
return '';
|
||||
}
|
||||
},
|
||||
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.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() {
|
||||
const 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.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: 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();
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
this.$store.dispatch('training/next', operate).then(({ valid }) => {
|
||||
if (valid) {
|
||||
this.doClose();
|
||||
}
|
||||
}).catch(() => {
|
||||
this.doClose();
|
||||
});
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
</script>
|
||||
<style>
|
||||
|
@ -1,430 +1,453 @@
|
||||
<template>
|
||||
<div>
|
||||
<el-dialog class="fuzhou-01__systerm route-cmd-control" :title="title" :visible.sync="show" width="840px"
|
||||
:before-close="doClose" :zIndex="2000" :modal="false" :close-on-click-modal="false" v-dialogDrag>
|
||||
<div style="padding: 10px 20px; border: 1px solid lightgray;">
|
||||
<span class="base-label">{{$t('menu.commandInformation')}}</span>
|
||||
<el-form label-position="center" size="mini">
|
||||
<el-row>
|
||||
<el-col :span="8">
|
||||
<el-form-item :label="this.$t('menu.type')" 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-option>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="8">
|
||||
<el-form-item :label="this.$t('menu.stationName')" label-width="80px">
|
||||
<el-input v-model="stationName" size="small" disabled></el-input>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="8">
|
||||
<el-form-item :label="this.$t('menu.signalName')" label-width="100px">
|
||||
<el-input v-model="signalName" size="small" disabled></el-input>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
</el-form>
|
||||
</div>
|
||||
<el-table class="table" ref="tempData" :data="tempData" border style="width: 100%" size="mini"
|
||||
highlight-current-row height="200">
|
||||
<el-table-column prop="order" :width="110" :label="this.$t('menu.serialNumber2')">
|
||||
</el-table-column>
|
||||
<el-table-column prop="date" :width="160" :label="this.$t('menu.time')">
|
||||
</el-table-column>
|
||||
<el-table-column prop="context" :width="180" :label="this.$t('menu.implementationProcess')">
|
||||
</el-table-column>
|
||||
<el-table-column prop="result" :label="this.$t('menu.executionResult')">
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
<span class="notice">{{message}}</span>
|
||||
<el-row class="button-group">
|
||||
<el-col :span="2" :offset="3">
|
||||
<el-button :id="domIdCommand" type="primary" :disabled="cmdDisabled[0]" @click="command">{{$t('menu.release')}}<span
|
||||
v-show="timeCountCommand>0">({{timeCountCommand}})</span></el-button>
|
||||
</el-col>
|
||||
<el-col :span="2" :offset="1">
|
||||
<el-button :id="domIdConfirm1" style="width:120px;" type="primary" :disabled="cmdDisabled[1]" @click="confirm1">{{$t('menu.firstConfirm')}}
|
||||
</el-button>
|
||||
</el-col>
|
||||
<el-col :span="2" :offset="2">
|
||||
<el-button :id="domIdConfirm2" type="primary" style="width:120px;" :disabled="cmdDisabled[2]" @click="confirm2">{{$t('menu.secondConfirm')}}<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">{{$t('menu.suspend')}}</el-button>
|
||||
</el-col>
|
||||
<el-col :span="2" :offset="1">
|
||||
<el-button :id="domIdClose" @click="close">{{$t('global.close')}}</el-button>
|
||||
</el-col>
|
||||
</el-row>
|
||||
</el-dialog>
|
||||
<confirm-signal-unlock ref="confirmSignalUnlock" @setOperate="getOperate"></confirm-signal-unlock>
|
||||
</div>
|
||||
<div>
|
||||
<el-dialog
|
||||
v-dialogDrag
|
||||
class="fuzhou-01__systerm route-cmd-control"
|
||||
:title="title"
|
||||
:visible.sync="show"
|
||||
width="840px"
|
||||
: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">{{ $t('menu.commandInformation') }}</span>
|
||||
<el-form label-position="center" size="mini">
|
||||
<el-row>
|
||||
<el-col :span="8">
|
||||
<el-form-item :label="this.$t('menu.type')" 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="this.$t('menu.stationName')" label-width="80px">
|
||||
<el-input v-model="stationName" size="small" disabled />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="8">
|
||||
<el-form-item :label="this.$t('menu.signalName')" 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="110" :label="this.$t('menu.serialNumber2')" />
|
||||
<el-table-column prop="date" :width="160" :label="this.$t('menu.time')" />
|
||||
<el-table-column prop="context" :width="180" :label="this.$t('menu.implementationProcess')" />
|
||||
<el-table-column prop="result" :label="this.$t('menu.executionResult')" />
|
||||
</el-table>
|
||||
<span class="notice">{{ message }}</span>
|
||||
<el-row class="button-group">
|
||||
<el-col :span="2" :offset="3">
|
||||
<el-button :id="domIdCommand" type="primary" :disabled="cmdDisabled[0]" @click="command">{{ $t('menu.release') }}<span
|
||||
v-show="timeCountCommand>0"
|
||||
>({{ timeCountCommand }})</span></el-button>
|
||||
</el-col>
|
||||
<el-col :span="2" :offset="1">
|
||||
<el-button :id="domIdConfirm1" style="width:120px;" type="primary" :disabled="cmdDisabled[1]" @click="confirm1">{{ $t('menu.firstConfirm') }}
|
||||
</el-button>
|
||||
</el-col>
|
||||
<el-col :span="2" :offset="2">
|
||||
<el-button :id="domIdConfirm2" type="primary" style="width:120px;" :disabled="cmdDisabled[2]" @click="confirm2">{{ $t('menu.secondConfirm') }}<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">{{ $t('menu.suspend') }}</el-button>
|
||||
</el-col>
|
||||
<el-col :span="2" :offset="1">
|
||||
<el-button :id="domIdClose" @click="close">{{ $t('global.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';
|
||||
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: this.$t('menu.menuSignal.signalDeblock') },
|
||||
{ code: OperationEvent.Signal.guide.menu.operation, name: this.$t('menu.menuSignal.guideRouteHandle') }
|
||||
]
|
||||
},
|
||||
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 && 1 <= index && 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) {
|
||||
if (!this.dialogShow) {
|
||||
this.signalName = '';
|
||||
this.stationName = '';
|
||||
if (selected && selected._type.toUpperCase() === 'Signal'.toUpperCase()) {
|
||||
this.signalName = selected.name
|
||||
let station = this.$store.getters['map/getDeviceByCode'](selected.stationCode);
|
||||
if (station) {
|
||||
this.stationName = station.name;
|
||||
}
|
||||
this.selected = selected;
|
||||
}
|
||||
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: this.$t('menu.menuSignal.signalDeblock') },
|
||||
{ code: OperationEvent.Signal.guide.menu.operation, name: this.$t('menu.menuSignal.guideRouteHandle') }
|
||||
];
|
||||
},
|
||||
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;
|
||||
}
|
||||
}
|
||||
return '';
|
||||
},
|
||||
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;
|
||||
}
|
||||
}
|
||||
return '';
|
||||
},
|
||||
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;
|
||||
}
|
||||
}
|
||||
return '';
|
||||
},
|
||||
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;
|
||||
}
|
||||
}
|
||||
return '';
|
||||
},
|
||||
domIdClose() {
|
||||
if (this.dialogShow) {
|
||||
return OperationEvent.Command.close.menu.domId;
|
||||
}
|
||||
return '';
|
||||
},
|
||||
title() {
|
||||
if (this.dialogShow) {
|
||||
if (this.operation == OperationEvent.Signal.unlock.menu.operation) {
|
||||
return '信号解封';
|
||||
} else if (this.operation == OperationEvent.Signal.guide.menu.operation) {
|
||||
return '办理引导进路';
|
||||
}
|
||||
}
|
||||
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) {
|
||||
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.selected = selected;
|
||||
}
|
||||
|
||||
this.order = 0;
|
||||
this.operation = operate.operation;
|
||||
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.$t('tip.releaseTip'));
|
||||
this.$nextTick(function () {
|
||||
this.$store.dispatch('training/emitTipFresh');
|
||||
});
|
||||
},
|
||||
doClose() {
|
||||
this.dialogShow = false;
|
||||
this.$store.dispatch('training/emitTipFresh');
|
||||
},
|
||||
command() {
|
||||
if (this.operation == OperationEvent.Signal.unlock.menu.operation) {
|
||||
/** 第一步带弹框处理*/
|
||||
this.commandHasPopUp();
|
||||
} else if (this.operation == OperationEvent.Signal.guide.menu.operation) {
|
||||
/** 第一步不带弹框处理*/
|
||||
this.commandNoPopUp();
|
||||
}
|
||||
},
|
||||
commandHasPopUp() {
|
||||
let operate = {
|
||||
type: MapDeviceType.Signal.type,
|
||||
}
|
||||
this.tempData = [];
|
||||
this.timeCountCommand = -1;
|
||||
this.timeCountConfirm = -1;
|
||||
this.cmdDisabled = [false, true, true];
|
||||
}
|
||||
this.dialogShow = true;
|
||||
this.stpDisabled = true;
|
||||
this.setMessage(this.$t('tip.releaseTip'));
|
||||
this.$nextTick(function () {
|
||||
this.$store.dispatch('training/emitTipFresh');
|
||||
});
|
||||
},
|
||||
doClose() {
|
||||
this.dialogShow = false;
|
||||
this.$store.dispatch('training/emitTipFresh');
|
||||
},
|
||||
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
|
||||
}
|
||||
if (this.operation == OperationEvent.Signal.unlock.menu.operation) {
|
||||
/** 信号解封*/
|
||||
operate.operation = OperationEvent.Signal.unlock.order.operation;
|
||||
}
|
||||
|
||||
this.setMessage(this.$t('tip.firstConfirmTip'));
|
||||
this.writeRecord({ order: ++this.order, date: now(), context: this.$t('menu.clickReleaseCommand'), result: '' });
|
||||
this.$store.dispatch('training/next', operate).then(({ valid }) => {
|
||||
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() {
|
||||
let operate = {
|
||||
type: MapDeviceType.Signal.type
|
||||
}
|
||||
this.setMessage(this.$t('tip.firstConfirmTip'));
|
||||
this.writeRecord({ order: ++this.order, date: now(), context: this.$t('menu.clickReleaseCommand'), result: '' });
|
||||
this.$store.dispatch('training/next', operate).then(({ valid }) => {
|
||||
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
|
||||
}
|
||||
if (this.operation == OperationEvent.Signal.guide.menu.operation) {
|
||||
/** 办理引导进路*/
|
||||
operate.operation = OperationEvent.Signal.guide.order.operation;
|
||||
}
|
||||
|
||||
this.setMessage(this.$t('tip.firstConfirmTip'));
|
||||
this.writeRecord({ order: ++this.order, date: now(), context: this.$t('menu.clickReleaseCommand'), result: '' });
|
||||
this.$store.dispatch('training/next', operate).then(({ valid }) => {
|
||||
if (valid) {
|
||||
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
|
||||
this.setButtonEnable({ step: 1 });
|
||||
this.editRecord({ order: this.order, date: now(), context: this.$t('menu.clickReleaseCommand'), result: this.$t('tip.executionSucceed') });
|
||||
} else {
|
||||
this.editRecord({ order: this.order, date: now(), context: this.$t('menu.clickReleaseCommand'), result: this.$t('tip.executionFailed') });
|
||||
}
|
||||
}).catch(() => {
|
||||
this.editRecord({ order: this.order, date: now(), context: this.$t('menu.clickReleaseCommand'), result: this.$t('tip.executionException') });
|
||||
})
|
||||
},
|
||||
confirm1() {
|
||||
let operate = {
|
||||
type: MapDeviceType.Signal.type,
|
||||
}
|
||||
this.setMessage(this.$t('tip.firstConfirmTip'));
|
||||
this.writeRecord({ order: ++this.order, date: now(), context: this.$t('menu.clickReleaseCommand'), result: '' });
|
||||
this.$store.dispatch('training/next', operate).then(({ valid }) => {
|
||||
if (valid) {
|
||||
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
|
||||
this.setButtonEnable({ step: 1 });
|
||||
this.editRecord({ order: this.order, date: now(), context: this.$t('menu.clickReleaseCommand'), result: this.$t('tip.executionSucceed') });
|
||||
} else {
|
||||
this.editRecord({ order: this.order, date: now(), context: this.$t('menu.clickReleaseCommand'), result: this.$t('tip.executionFailed') });
|
||||
}
|
||||
}).catch(() => {
|
||||
this.editRecord({ order: this.order, date: now(), context: this.$t('menu.clickReleaseCommand'), result: this.$t('tip.executionException') });
|
||||
});
|
||||
},
|
||||
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;
|
||||
}
|
||||
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(this.$t('tip.secondConfirmTip'));
|
||||
this.writeRecord({ order: ++this.order, date: now(), context: this.$t('menu.clickFirstConfirm'), result: '' });
|
||||
this.$store.dispatch('training/next', operate).then(({ valid }) => {
|
||||
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: this.$t('menu.clickFirstConfirm'), result: this.$t('tip.executionSucceed') });
|
||||
} else {
|
||||
this.editRecord({ order: this.order, date: now(), context: this.$t('menu.clickFirstConfirm'), result: this.$t('tip.executionFailed') });
|
||||
}
|
||||
}).catch(() => {
|
||||
this.editRecord({ order: this.order, date: now(), context: this.$t('menu.clickFirstConfirm'), result: this.$t('tip.executionException') });
|
||||
})
|
||||
},
|
||||
confirm2() {
|
||||
let operate = {
|
||||
send: true,
|
||||
type: MapDeviceType.Signal.type
|
||||
}
|
||||
this.setMessage(this.$t('tip.secondConfirmTip'));
|
||||
this.writeRecord({ order: ++this.order, date: now(), context: this.$t('menu.clickFirstConfirm'), result: '' });
|
||||
this.$store.dispatch('training/next', operate).then(({ valid }) => {
|
||||
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: this.$t('menu.clickFirstConfirm'), result: this.$t('tip.executionSucceed') });
|
||||
} else {
|
||||
this.editRecord({ order: this.order, date: now(), context: this.$t('menu.clickFirstConfirm'), result: this.$t('tip.executionFailed') });
|
||||
}
|
||||
}).catch(() => {
|
||||
this.editRecord({ order: this.order, date: now(), context: this.$t('menu.clickFirstConfirm'), result: this.$t('tip.executionException') });
|
||||
});
|
||||
},
|
||||
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: this.$t('menu.clickSecondConfirm'), result: '' });
|
||||
this.$store.dispatch('training/next', 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: this.$t('menu.clickSecondConfirm'), result: this.$t('tip.executionSucceed') });
|
||||
} else {
|
||||
this.editRecord({ order: this.order, date: now(), context: this.$t('menu.clickSecondConfirm'), result: this.$t('tip.executionFailed') });
|
||||
}
|
||||
}).catch(() => {
|
||||
this.timeCountCommand = -1;
|
||||
this.timeCountConfirm = -1;
|
||||
this.setButtonEnable({ step: -1 });
|
||||
this.editRecord({ order: this.order, date: now(), context: this.$t('menu.clickSecondConfirm'), result: this.$t('tip.executionException') });
|
||||
})
|
||||
},
|
||||
stop() {
|
||||
let operate = {
|
||||
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: this.$t('menu.clickSecondConfirm'), result: '' });
|
||||
this.$store.dispatch('training/next', 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: this.$t('menu.clickSecondConfirm'), result: this.$t('tip.executionSucceed') });
|
||||
} else {
|
||||
this.editRecord({ order: this.order, date: now(), context: this.$t('menu.clickSecondConfirm'), result: this.$t('tip.executionFailed') });
|
||||
}
|
||||
}).catch(() => {
|
||||
this.timeCountCommand = -1;
|
||||
this.timeCountConfirm = -1;
|
||||
this.setButtonEnable({ step: -1 });
|
||||
this.editRecord({ order: this.order, date: now(), context: this.$t('menu.clickSecondConfirm'), result: this.$t('tip.executionException') });
|
||||
});
|
||||
},
|
||||
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;
|
||||
}
|
||||
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: this.$t('menu.clickSuspend'), result: '' });
|
||||
this.$store.dispatch('training/next', operate).then(({ valid }) => {
|
||||
if (valid) {
|
||||
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
|
||||
this.setButtonEnable({ step: 0 });
|
||||
this.editRecord({ order: this.order, date: now(), context: this.$t('menu.clickSuspend'), result: this.$t('tip.executionSucceed') });
|
||||
} else {
|
||||
this.editRecord({ order: this.order, date: now(), context: this.$t('menu.clickSuspend'), result: this.$t('tip.executionFailed') });
|
||||
}
|
||||
}).catch(() => {
|
||||
this.editRecord({ order: this.order, date: now(), context: this.$t('menu.clickSuspend'), result: this.$t('tip.executionException') });
|
||||
});
|
||||
},
|
||||
close() {
|
||||
const operate = {
|
||||
type: MapDeviceType.Signal.type,
|
||||
operation: OperationEvent.Command.close.menu.operation
|
||||
};
|
||||
|
||||
this.writeRecord({ order: ++this.order, date: now(), context: this.$t('menu.clickSuspend'), result: '' });
|
||||
this.$store.dispatch('training/next', operate).then(({ valid }) => {
|
||||
if (valid) {
|
||||
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
|
||||
this.setButtonEnable({ step: 0 });
|
||||
this.editRecord({ order: this.order, date: now(), context: this.$t('menu.clickSuspend'), result: this.$t('tip.executionSucceed') });
|
||||
} else {
|
||||
this.editRecord({ order: this.order, date: now(), context: this.$t('menu.clickSuspend'), result: this.$t('tip.executionFailed') });
|
||||
}
|
||||
}).catch(error => {
|
||||
this.editRecord({ order: this.order, date: now(), context: this.$t('menu.clickSuspend'), result: this.$t('tip.executionException') });
|
||||
})
|
||||
},
|
||||
close() {
|
||||
let operate = {
|
||||
type: MapDeviceType.Signal.type,
|
||||
operation: OperationEvent.Command.close.menu.operation,
|
||||
}
|
||||
|
||||
this.$store.dispatch('training/next', 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: this.$t('menu.clickReleaseCommand'), result: this.$t('tip.confirmedSuccess') });
|
||||
} else {
|
||||
this.editRecord({ order: this.order, date: now(), context: this.$t('menu.clickReleaseCommand'), result: this.$t('tip.cancelSuccess') });
|
||||
}
|
||||
}
|
||||
},
|
||||
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];
|
||||
}
|
||||
}
|
||||
})
|
||||
}
|
||||
}
|
||||
}
|
||||
this.$store.dispatch('training/next', operate).then(({ valid }) => {
|
||||
if (valid) {
|
||||
this.doClose();
|
||||
}
|
||||
}).catch(() => {
|
||||
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: this.$t('menu.clickReleaseCommand'), result: this.$t('tip.confirmedSuccess') });
|
||||
} else {
|
||||
this.editRecord({ order: this.order, date: now(), context: this.$t('menu.clickReleaseCommand'), result: this.$t('tip.cancelSuccess') });
|
||||
}
|
||||
}
|
||||
},
|
||||
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,325 +1,332 @@
|
||||
<template>
|
||||
<el-dialog class="fuzhou-01__systerm signal-control" :title="title" :visible.sync="show" width="300px"
|
||||
:before-close="doClose" :zIndex="2000" :modal="false" :close-on-click-modal="false" v-dialogDrag>
|
||||
<el-row class="header">
|
||||
<el-col :span="11"><span>{{$t('menu.stationName')}}</span></el-col>
|
||||
<el-col :span="11" :offset="2"><span>{{$t('menu.signal')}}</span></el-col>
|
||||
</el-row>
|
||||
<el-row>
|
||||
<el-col :span="11">
|
||||
<el-input v-model="stationName" size="small" disabled></el-input>
|
||||
</el-col>
|
||||
<el-col :span="11" :offset="2">
|
||||
<el-input v-model="signalName" size="small" disabled></el-input>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<el-row justify="center" class="button-group">
|
||||
<el-col :span="10" :offset="2">
|
||||
<el-button :id="domIdConfirm" type="primary" :loading="loading" @click="commit">{{$t('menu.confirm')}}</el-button>
|
||||
</el-col>
|
||||
<el-col :span="8" :offset="4">
|
||||
<el-button :id="domIdCancel" @click="cancel">{{$t('menu.cancel')}}</el-button>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<confirm-control ref="confirmControl"></confirm-control>
|
||||
<notice-info ref="noticeInfo"></notice-info>
|
||||
</el-dialog>
|
||||
<el-dialog
|
||||
v-dialogDrag
|
||||
class="fuzhou-01__systerm signal-control"
|
||||
:title="title"
|
||||
:visible.sync="show"
|
||||
width="300px"
|
||||
:before-close="doClose"
|
||||
:z-index="2000"
|
||||
:modal="false"
|
||||
:close-on-click-modal="false"
|
||||
>
|
||||
<el-row class="header">
|
||||
<el-col :span="11"><span>{{ $t('menu.stationName') }}</span></el-col>
|
||||
<el-col :span="11" :offset="2"><span>{{ $t('menu.signal') }}</span></el-col>
|
||||
</el-row>
|
||||
<el-row>
|
||||
<el-col :span="11">
|
||||
<el-input v-model="stationName" size="small" disabled />
|
||||
</el-col>
|
||||
<el-col :span="11" :offset="2">
|
||||
<el-input v-model="signalName" size="small" disabled />
|
||||
</el-col>
|
||||
</el-row>
|
||||
<el-row justify="center" class="button-group">
|
||||
<el-col :span="10" :offset="2">
|
||||
<el-button :id="domIdConfirm" type="primary" :loading="loading" @click="commit">{{ $t('menu.confirm') }}</el-button>
|
||||
</el-col>
|
||||
<el-col :span="8" :offset="4">
|
||||
<el-button :id="domIdCancel" @click="cancel">{{ $t('menu.cancel') }}</el-button>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<confirm-control ref="confirmControl" />
|
||||
<notice-info ref="noticeInfo" />
|
||||
</el-dialog>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import { MapDeviceType, OperationEvent, getDomIdByOperation } from '@/scripts/ConstDic';
|
||||
import ConfirmControl from './childDialog/confirmControl';
|
||||
import NoticeInfo from './childDialog/childDialog/noticeInfo'
|
||||
import { MapDeviceType, OperationEvent, getDomIdByOperation } from '@/scripts/ConstDic';
|
||||
import ConfirmControl from './childDialog/confirmControl';
|
||||
import NoticeInfo from './childDialog/childDialog/noticeInfo';
|
||||
|
||||
export default {
|
||||
name: 'RouteControl',
|
||||
components: {
|
||||
ConfirmControl,
|
||||
NoticeInfo
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
dialogShow: false,
|
||||
loading: false,
|
||||
selected: null,
|
||||
operation: null,
|
||||
stationName: '',
|
||||
signalName: ''
|
||||
export default {
|
||||
name: 'RouteControl',
|
||||
components: {
|
||||
ConfirmControl,
|
||||
NoticeInfo
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
dialogShow: false,
|
||||
loading: false,
|
||||
selected: null,
|
||||
operation: null,
|
||||
stationName: '',
|
||||
signalName: ''
|
||||
|
||||
}
|
||||
},
|
||||
computed: {
|
||||
show() {
|
||||
return this.dialogShow && !this.$store.state.menuOperation.break;
|
||||
},
|
||||
domIdCancel() {
|
||||
return this.dialogShow ? OperationEvent.Command.close.menu.domId : '';
|
||||
},
|
||||
domIdConfirm() {
|
||||
return this.dialogShow ? getDomIdByOperation(this.operation) : '';
|
||||
},
|
||||
title() {
|
||||
if (this.operation == OperationEvent.Signal.cancelTrainRoute.menu.operation) {
|
||||
return this.$t('menu.menuSignal.cancelTheTrainApproach');
|
||||
} else if (this.operation == OperationEvent.Signal.signalClose.menu.operation) {
|
||||
return this.$t('menu.menuSignal.signalOff');
|
||||
} else if (this.operation == OperationEvent.Signal.reopenSignal.menu.operation) {
|
||||
return this.$t('menu.menuSignal.reopenTrainSignal');
|
||||
} else if (this.operation == OperationEvent.Signal.setAutoInterlock.menu.operation) {
|
||||
return this.$t('menu.menuSignal.setInterlockAutoRoute');
|
||||
} else if (this.operation == OperationEvent.Signal.cancelAutoInterlock.menu.operation) {
|
||||
return this.$t('menu.menuSignal.cancelInterlockAutoRoute');
|
||||
} else if (this.operation == OperationEvent.Signal.setAutoTrigger.menu.operation) {
|
||||
return this.$t('menu.menuSignal.setInterlockAutoTrigger');
|
||||
} else if (this.operation == OperationEvent.Signal.cancelAutoTrigger.menu.operation) {
|
||||
return this.$t('menu.menuSignal.cancelInterlockAutoTrigger');
|
||||
}
|
||||
}
|
||||
},
|
||||
mounted() {
|
||||
this.$nextTick(() => {
|
||||
this.$store.dispatch('training/tipReload');
|
||||
})
|
||||
},
|
||||
methods: {
|
||||
doShow(operate, selected) {
|
||||
if (!this.dialogShow) {
|
||||
this.signalName = '';
|
||||
this.stationName = '';
|
||||
if (selected && selected._type.toUpperCase() === 'Signal'.toUpperCase()) {
|
||||
this.signalName = selected.name
|
||||
let station = this.$store.getters['map/getDeviceByCode'](selected.stationCode);
|
||||
if (station) {
|
||||
this.stationName = station.name;
|
||||
}
|
||||
}
|
||||
this.selected = selected;
|
||||
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('training/emitTipFresh');
|
||||
},
|
||||
commit() {
|
||||
if (this.operation == OperationEvent.Signal.cancelTrainRoute.menu.operation) {
|
||||
/** 取消列车进路*/
|
||||
this.cancelTrainRoute();
|
||||
} else if (this.operation == OperationEvent.Signal.signalClose.menu.operation) {
|
||||
/** 信号关灯*/
|
||||
this.signalClose();
|
||||
} else if (this.operation == OperationEvent.Signal.reopenSignal.menu.operation) {
|
||||
/** 信号重开*/
|
||||
this.reopenSignal();
|
||||
} else if (this.operation == OperationEvent.Signal.setAutoInterlock.menu.operation) {
|
||||
/** 设置联锁自动进路*/
|
||||
this.setAutoInterlock();
|
||||
} else if (this.operation == OperationEvent.Signal.cancelAutoInterlock.menu.operation) {
|
||||
/** 取消联锁自动进路*/
|
||||
this.cancelAutoInterlock();
|
||||
} else if (this.operation == OperationEvent.Signal.setAutoTrigger.menu.operation) {
|
||||
/** 设置联锁自动触发*/
|
||||
this.setAutoTrigger();
|
||||
} else if (this.operation == OperationEvent.Signal.cancelAutoTrigger.menu.operation) {
|
||||
/** 取消联锁自动触发*/
|
||||
this.cancelAutoTrigger();
|
||||
}
|
||||
},
|
||||
//取消列车进路
|
||||
cancelTrainRoute() {
|
||||
if (this.$store.state.training.prdType == '01') {
|
||||
/** 现地工作站*/
|
||||
this.cancelTrainRouteByLocal();
|
||||
} else if (this.$store.state.training.prdType == '02') {
|
||||
/** 行调工作站*/
|
||||
this.cancelTrainRouteByCentral();
|
||||
}
|
||||
},
|
||||
//现地工作站取消进路
|
||||
cancelTrainRouteByLocal() {
|
||||
let operate = {
|
||||
send: true,
|
||||
type: MapDeviceType.Signal.type,
|
||||
operation: OperationEvent.Signal.cancelTrainRoute.menu.operation
|
||||
}
|
||||
};
|
||||
},
|
||||
computed: {
|
||||
show() {
|
||||
return this.dialogShow && !this.$store.state.menuOperation.break;
|
||||
},
|
||||
domIdCancel() {
|
||||
return this.dialogShow ? OperationEvent.Command.close.menu.domId : '';
|
||||
},
|
||||
domIdConfirm() {
|
||||
return this.dialogShow ? getDomIdByOperation(this.operation) : '';
|
||||
},
|
||||
title() {
|
||||
if (this.operation == OperationEvent.Signal.cancelTrainRoute.menu.operation) {
|
||||
return this.$t('menu.menuSignal.cancelTheTrainApproach');
|
||||
} else if (this.operation == OperationEvent.Signal.signalClose.menu.operation) {
|
||||
return this.$t('menu.menuSignal.signalOff');
|
||||
} else if (this.operation == OperationEvent.Signal.reopenSignal.menu.operation) {
|
||||
return this.$t('menu.menuSignal.reopenTrainSignal');
|
||||
} else if (this.operation == OperationEvent.Signal.setAutoInterlock.menu.operation) {
|
||||
return this.$t('menu.menuSignal.setInterlockAutoRoute');
|
||||
} else if (this.operation == OperationEvent.Signal.cancelAutoInterlock.menu.operation) {
|
||||
return this.$t('menu.menuSignal.cancelInterlockAutoRoute');
|
||||
} else if (this.operation == OperationEvent.Signal.setAutoTrigger.menu.operation) {
|
||||
return this.$t('menu.menuSignal.setInterlockAutoTrigger');
|
||||
} else if (this.operation == OperationEvent.Signal.cancelAutoTrigger.menu.operation) {
|
||||
return this.$t('menu.menuSignal.cancelInterlockAutoTrigger');
|
||||
}
|
||||
return '';
|
||||
}
|
||||
},
|
||||
mounted() {
|
||||
this.$nextTick(() => {
|
||||
this.$store.dispatch('training/tipReload');
|
||||
});
|
||||
},
|
||||
methods: {
|
||||
doShow(operate, 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.selected = selected;
|
||||
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('training/emitTipFresh');
|
||||
},
|
||||
commit() {
|
||||
if (this.operation == OperationEvent.Signal.cancelTrainRoute.menu.operation) {
|
||||
/** 取消列车进路*/
|
||||
this.cancelTrainRoute();
|
||||
} else if (this.operation == OperationEvent.Signal.signalClose.menu.operation) {
|
||||
/** 信号关灯*/
|
||||
this.signalClose();
|
||||
} else if (this.operation == OperationEvent.Signal.reopenSignal.menu.operation) {
|
||||
/** 信号重开*/
|
||||
this.reopenSignal();
|
||||
} else if (this.operation == OperationEvent.Signal.setAutoInterlock.menu.operation) {
|
||||
/** 设置联锁自动进路*/
|
||||
this.setAutoInterlock();
|
||||
} else if (this.operation == OperationEvent.Signal.cancelAutoInterlock.menu.operation) {
|
||||
/** 取消联锁自动进路*/
|
||||
this.cancelAutoInterlock();
|
||||
} else if (this.operation == OperationEvent.Signal.setAutoTrigger.menu.operation) {
|
||||
/** 设置联锁自动触发*/
|
||||
this.setAutoTrigger();
|
||||
} else if (this.operation == OperationEvent.Signal.cancelAutoTrigger.menu.operation) {
|
||||
/** 取消联锁自动触发*/
|
||||
this.cancelAutoTrigger();
|
||||
}
|
||||
},
|
||||
// 取消列车进路
|
||||
cancelTrainRoute() {
|
||||
if (this.$store.state.training.prdType == '01') {
|
||||
/** 现地工作站*/
|
||||
this.cancelTrainRouteByLocal();
|
||||
} else if (this.$store.state.training.prdType == '02') {
|
||||
/** 行调工作站*/
|
||||
this.cancelTrainRouteByCentral();
|
||||
}
|
||||
},
|
||||
// 现地工作站取消进路
|
||||
cancelTrainRouteByLocal() {
|
||||
const operate = {
|
||||
send: true,
|
||||
type: MapDeviceType.Signal.type,
|
||||
operation: OperationEvent.Signal.cancelTrainRoute.menu.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);
|
||||
});
|
||||
},
|
||||
//行调工作站取消进路
|
||||
cancelTrainRouteByCentral() {
|
||||
let operate = {
|
||||
type: MapDeviceType.Signal.type,
|
||||
operation: OperationEvent.Signal.cancelTrainRoute.menu.operation,
|
||||
messages: [this.$t('tip.signalModeToManualModeTipPrefix') + this.signalName + this.$t('tip.signalModeToManualModeTipSuffix')]
|
||||
}
|
||||
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);
|
||||
});
|
||||
},
|
||||
// 行调工作站取消进路
|
||||
cancelTrainRouteByCentral() {
|
||||
const operate = {
|
||||
type: MapDeviceType.Signal.type,
|
||||
operation: OperationEvent.Signal.cancelTrainRoute.menu.operation,
|
||||
messages: [this.$t('tip.signalModeToManualModeTipPrefix') + this.signalName + this.$t('tip.signalModeToManualModeTipSuffix')]
|
||||
};
|
||||
|
||||
this.loading = true;
|
||||
this.$store.dispatch('training/next', operate).then(({ valid }) => {
|
||||
this.loading = false;
|
||||
if (valid) {
|
||||
this.doClose();
|
||||
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
|
||||
this.$refs.confirmControl.doShow(operate, this.selected);
|
||||
}
|
||||
}).catch(error => {
|
||||
this.loading = false;
|
||||
});
|
||||
},
|
||||
//信号关灯
|
||||
signalClose() {
|
||||
let operate = {
|
||||
type: MapDeviceType.Signal.type,
|
||||
operation: OperationEvent.Signal.signalClose.menu.operation,
|
||||
messages: [this.$t('menu.menuSignal.signalOff') + this.$t('global.colon') + this.signalName],
|
||||
}
|
||||
this.loading = true;
|
||||
this.$store.dispatch('training/next', operate).then(({ valid }) => {
|
||||
this.loading = false;
|
||||
if (valid) {
|
||||
this.doClose();
|
||||
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
|
||||
this.$refs.confirmControl.doShow(operate, this.selected);
|
||||
}
|
||||
}).catch(() => {
|
||||
this.loading = false;
|
||||
});
|
||||
},
|
||||
// 信号关灯
|
||||
signalClose() {
|
||||
const operate = {
|
||||
type: MapDeviceType.Signal.type,
|
||||
operation: OperationEvent.Signal.signalClose.menu.operation,
|
||||
messages: [this.$t('menu.menuSignal.signalOff') + this.$t('global.colon') + this.signalName]
|
||||
};
|
||||
|
||||
this.loading = true;
|
||||
this.$store.dispatch('training/next', operate).then(({ valid }) => {
|
||||
this.loading = false;
|
||||
if (valid) {
|
||||
this.doClose();
|
||||
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
|
||||
this.$refs.confirmControl.doShow(operate);
|
||||
}
|
||||
}).catch(error => {
|
||||
this.loading = false;
|
||||
});
|
||||
},
|
||||
//信号重开
|
||||
reopenSignal() {
|
||||
let operate = {
|
||||
type: MapDeviceType.Signal.type,
|
||||
operation: OperationEvent.Signal.reopenSignal.menu.operation,
|
||||
messages: [this.$t('menu.menuSignal.signalReopen') + this.$t('global.colon') + this.signalName],
|
||||
}
|
||||
this.loading = true;
|
||||
this.$store.dispatch('training/next', operate).then(({ valid }) => {
|
||||
this.loading = false;
|
||||
if (valid) {
|
||||
this.doClose();
|
||||
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
|
||||
this.$refs.confirmControl.doShow(operate);
|
||||
}
|
||||
}).catch(() => {
|
||||
this.loading = false;
|
||||
});
|
||||
},
|
||||
// 信号重开
|
||||
reopenSignal() {
|
||||
const operate = {
|
||||
type: MapDeviceType.Signal.type,
|
||||
operation: OperationEvent.Signal.reopenSignal.menu.operation,
|
||||
messages: [this.$t('menu.menuSignal.signalReopen') + this.$t('global.colon') + this.signalName]
|
||||
};
|
||||
|
||||
this.loading = true;
|
||||
this.$store.dispatch('training/next', operate).then(({ valid }) => {
|
||||
this.loading = false;
|
||||
if (valid) {
|
||||
this.doClose();
|
||||
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
|
||||
this.$refs.confirmControl.doShow(operate);
|
||||
}
|
||||
}).catch(error => {
|
||||
this.loading = false;
|
||||
});
|
||||
},
|
||||
//设置联锁自动进路
|
||||
setAutoInterlock() {
|
||||
let operate = {
|
||||
send: true,
|
||||
type: MapDeviceType.Signal.type,
|
||||
operation: OperationEvent.Signal.setAutoInterlock.menu.operation
|
||||
}
|
||||
this.loading = true;
|
||||
this.$store.dispatch('training/next', operate).then(({ valid }) => {
|
||||
this.loading = false;
|
||||
if (valid) {
|
||||
this.doClose();
|
||||
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
|
||||
this.$refs.confirmControl.doShow(operate);
|
||||
}
|
||||
}).catch(() => {
|
||||
this.loading = false;
|
||||
});
|
||||
},
|
||||
// 设置联锁自动进路
|
||||
setAutoInterlock() {
|
||||
const operate = {
|
||||
send: true,
|
||||
type: MapDeviceType.Signal.type,
|
||||
operation: OperationEvent.Signal.setAutoInterlock.menu.operation
|
||||
};
|
||||
|
||||
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);
|
||||
});
|
||||
},
|
||||
// 取消联锁自动进路
|
||||
cancelAutoInterlock() {
|
||||
const operate = {
|
||||
send: true,
|
||||
type: MapDeviceType.Signal.type,
|
||||
operation: OperationEvent.Signal.cancelAutoInterlock.menu.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);
|
||||
});
|
||||
},
|
||||
//取消联锁自动进路
|
||||
cancelAutoInterlock() {
|
||||
let operate = {
|
||||
send: true,
|
||||
type: MapDeviceType.Signal.type,
|
||||
operation: OperationEvent.Signal.cancelAutoInterlock.menu.operation
|
||||
}
|
||||
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);
|
||||
});
|
||||
},
|
||||
// 设置联锁自动触发
|
||||
setAutoTrigger() {
|
||||
const operate = {
|
||||
send: true,
|
||||
type: MapDeviceType.Signal.type,
|
||||
operation: OperationEvent.Signal.setAutoTrigger.menu.operation
|
||||
};
|
||||
|
||||
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);
|
||||
});
|
||||
},
|
||||
// 取消联锁自动触发
|
||||
cancelAutoTrigger() {
|
||||
const operate = {
|
||||
send: true,
|
||||
type: MapDeviceType.Signal.type,
|
||||
operation: OperationEvent.Signal.cancelAutoTrigger.menu.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);
|
||||
});
|
||||
},
|
||||
//设置联锁自动触发
|
||||
setAutoTrigger() {
|
||||
let operate = {
|
||||
send: true,
|
||||
type: MapDeviceType.Signal.type,
|
||||
operation: OperationEvent.Signal.setAutoTrigger.menu.operation
|
||||
}
|
||||
this.doClose();
|
||||
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.Signal.type,
|
||||
operation: OperationEvent.Command.close.menu.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);
|
||||
});
|
||||
},
|
||||
//取消联锁自动触发
|
||||
cancelAutoTrigger() {
|
||||
let operate = {
|
||||
send: true,
|
||||
type: MapDeviceType.Signal.type,
|
||||
operation: OperationEvent.Signal.cancelAutoTrigger.menu.operation
|
||||
}
|
||||
|
||||
this.doClose();
|
||||
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: MapDeviceType.Signal.type,
|
||||
operation: OperationEvent.Command.close.menu.operation,
|
||||
}
|
||||
|
||||
this.$store.dispatch('training/next', operate).then(({ valid }) => {
|
||||
if (valid) {
|
||||
this.doClose();
|
||||
}
|
||||
}).catch(error => {
|
||||
this.doClose();
|
||||
this.$refs.noticeInfo.doShow(operate);
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
this.$store.dispatch('training/next', operate).then(({ valid }) => {
|
||||
if (valid) {
|
||||
this.doClose();
|
||||
}
|
||||
}).catch(() => {
|
||||
this.doClose();
|
||||
this.$refs.noticeInfo.doShow(operate);
|
||||
});
|
||||
}
|
||||
}
|
||||
};
|
||||
</script>
|
||||
|
@ -1,149 +1,165 @@
|
||||
<template>
|
||||
<div>
|
||||
<el-dialog class="fuzhou-01__systerm route-detail" :title="title" :visible.sync="show" width="340px"
|
||||
:before-close="doClose" :zIndex="2000" :modal="false" :close-on-click-modal="false" v-dialogDrag>
|
||||
<el-row class="header">
|
||||
<el-col :span="10"><span>{{$t('menu.stationName')}}</span></el-col>
|
||||
<el-col :span="10" :offset="2"><span>{{$t('menu.startSignal')}}</span></el-col>
|
||||
</el-row>
|
||||
<el-row>
|
||||
<el-col :span="10">
|
||||
<el-input v-model="stationName" size="small" disabled></el-input>
|
||||
</el-col>
|
||||
<el-col :span="10" :offset="2">
|
||||
<el-input v-model="signalName" size="small" disabled></el-input>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<div class="table">
|
||||
<span>{{$t('menu.routeList')}}</span>
|
||||
<el-table ref="tempTable" :data="tempData" border style="width: 100%" size="mini" highlight-current-row
|
||||
:height="140">
|
||||
<el-table-column :label="this.$t('menu.route')">
|
||||
<template slot-scope="scope">
|
||||
<span>{{scope.row.name}}</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="status" :label="this.$t('menu.controlState')" width="180">
|
||||
<template slot-scope="scope">
|
||||
<span v-if="scope.row.controlType == '01'">{{$t('menu.automatic')}}</span>
|
||||
<span v-else>{{$t('menu.artificial')}}</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
</div>
|
||||
<el-row justify="center" class="button-group">
|
||||
<el-col :span="10" :offset="2">
|
||||
<el-button :id="domIdConfirm" type="primary" :loading="loading" @click="commit">{{$t('global.confirm')}}</el-button>
|
||||
</el-col>
|
||||
<el-col :span="8" :offset="4">
|
||||
<el-button :id="domIdCancel" @click="cancel">{{$t('global.cancel')}}</el-button>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<notice-info ref="noticeInfo"></notice-info>
|
||||
</el-dialog>
|
||||
</div>
|
||||
<div>
|
||||
<el-dialog
|
||||
v-dialogDrag
|
||||
class="fuzhou-01__systerm route-detail"
|
||||
:title="title"
|
||||
:visible.sync="show"
|
||||
width="340px"
|
||||
:before-close="doClose"
|
||||
:z-index="2000"
|
||||
:modal="false"
|
||||
:close-on-click-modal="false"
|
||||
>
|
||||
<el-row class="header">
|
||||
<el-col :span="10"><span>{{ $t('menu.stationName') }}</span></el-col>
|
||||
<el-col :span="10" :offset="2"><span>{{ $t('menu.startSignal') }}</span></el-col>
|
||||
</el-row>
|
||||
<el-row>
|
||||
<el-col :span="10">
|
||||
<el-input v-model="stationName" size="small" disabled />
|
||||
</el-col>
|
||||
<el-col :span="10" :offset="2">
|
||||
<el-input v-model="signalName" size="small" disabled />
|
||||
</el-col>
|
||||
</el-row>
|
||||
<div class="table">
|
||||
<span>{{ $t('menu.routeList') }}</span>
|
||||
<el-table
|
||||
ref="tempTable"
|
||||
:data="tempData"
|
||||
border
|
||||
style="width: 100%"
|
||||
size="mini"
|
||||
highlight-current-row
|
||||
:height="140"
|
||||
>
|
||||
<el-table-column :label="this.$t('menu.route')">
|
||||
<template slot-scope="scope">
|
||||
<span>{{ scope.row.name }}</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="status" :label="this.$t('menu.controlState')" width="180">
|
||||
<template slot-scope="scope">
|
||||
<span v-if="scope.row.controlType == '01'">{{ $t('menu.automatic') }}</span>
|
||||
<span v-else>{{ $t('menu.artificial') }}</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
</div>
|
||||
<el-row justify="center" class="button-group">
|
||||
<el-col :span="10" :offset="2">
|
||||
<el-button :id="domIdConfirm" type="primary" :loading="loading" @click="commit">{{ $t('global.confirm') }}</el-button>
|
||||
</el-col>
|
||||
<el-col :span="8" :offset="4">
|
||||
<el-button :id="domIdCancel" @click="cancel">{{ $t('global.cancel') }}</el-button>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<notice-info ref="noticeInfo" />
|
||||
</el-dialog>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import { mapGetters } from 'vuex';
|
||||
import { MapDeviceType, OperationEvent } from '@/scripts/ConstDic';
|
||||
import NoticeInfo from './childDialog/childDialog/noticeInfo'
|
||||
import { mapGetters } from 'vuex';
|
||||
import { MapDeviceType, OperationEvent } from '@/scripts/ConstDic';
|
||||
import NoticeInfo from './childDialog/childDialog/noticeInfo';
|
||||
|
||||
export default {
|
||||
name: 'RouteDetail',
|
||||
components: {
|
||||
NoticeInfo
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
dialogShow: false,
|
||||
loading: false,
|
||||
tempData: [],
|
||||
stationName: '',
|
||||
signalName: '',
|
||||
}
|
||||
},
|
||||
computed: {
|
||||
...mapGetters('map', [
|
||||
'signalList'
|
||||
]),
|
||||
show() {
|
||||
return this.dialogShow && !this.$store.state.menuOperation.break;
|
||||
},
|
||||
domIdCancel() {
|
||||
return this.dialogShow ? OperationEvent.Command.cancel.menu.domId : '';
|
||||
},
|
||||
domIdConfirm() {
|
||||
return this.dialogShow ? OperationEvent.Signal.detail.menu.domId : '';
|
||||
},
|
||||
title() {
|
||||
return this.$t('menu.queryAccessControlMode');
|
||||
}
|
||||
},
|
||||
mounted() {
|
||||
this.$nextTick(() => {
|
||||
this.$store.dispatch('training/tipReload');
|
||||
})
|
||||
},
|
||||
methods: {
|
||||
doShow(operate, selected, tempData) {
|
||||
//如果不是因为断点激活则需要,初始化菜单初始值
|
||||
if (!this.dialogShow) {
|
||||
this.signalName = '';
|
||||
this.stationName = '';
|
||||
if (selected && selected._type.toUpperCase() === 'Signal'.toUpperCase()) {
|
||||
this.signalName = selected.name
|
||||
let station = this.$store.getters['map/getDeviceByCode'](selected.stationCode);
|
||||
if (station) {
|
||||
this.stationName = station.name;
|
||||
}
|
||||
}
|
||||
this.tempData = tempData || [];
|
||||
}
|
||||
export default {
|
||||
name: 'RouteDetail',
|
||||
components: {
|
||||
NoticeInfo
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
dialogShow: false,
|
||||
loading: false,
|
||||
tempData: [],
|
||||
stationName: '',
|
||||
signalName: ''
|
||||
};
|
||||
},
|
||||
computed: {
|
||||
...mapGetters('map', [
|
||||
'signalList'
|
||||
]),
|
||||
show() {
|
||||
return this.dialogShow && !this.$store.state.menuOperation.break;
|
||||
},
|
||||
domIdCancel() {
|
||||
return this.dialogShow ? OperationEvent.Command.cancel.menu.domId : '';
|
||||
},
|
||||
domIdConfirm() {
|
||||
return this.dialogShow ? OperationEvent.Signal.detail.menu.domId : '';
|
||||
},
|
||||
title() {
|
||||
return this.$t('menu.queryAccessControlMode');
|
||||
}
|
||||
},
|
||||
mounted() {
|
||||
this.$nextTick(() => {
|
||||
this.$store.dispatch('training/tipReload');
|
||||
});
|
||||
},
|
||||
methods: {
|
||||
doShow(operate, selected, tempData) {
|
||||
// 如果不是因为断点激活则需要,初始化菜单初始值
|
||||
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.tempData = tempData || [];
|
||||
}
|
||||
|
||||
this.dialogShow = true;
|
||||
this.$nextTick(function () {
|
||||
this.$store.dispatch('training/emitTipFresh');
|
||||
});
|
||||
},
|
||||
doClose() {
|
||||
this.loading = false;
|
||||
this.dialogShow = false;
|
||||
this.$store.dispatch('training/emitTipFresh');
|
||||
},
|
||||
commit() {
|
||||
let operate = {
|
||||
send: true,
|
||||
type: MapDeviceType.Signal.type,
|
||||
operation: OperationEvent.Signal.detail.menu.operation
|
||||
}
|
||||
this.dialogShow = true;
|
||||
this.$nextTick(function () {
|
||||
this.$store.dispatch('training/emitTipFresh');
|
||||
});
|
||||
},
|
||||
doClose() {
|
||||
this.loading = false;
|
||||
this.dialogShow = false;
|
||||
this.$store.dispatch('training/emitTipFresh');
|
||||
},
|
||||
commit() {
|
||||
const operate = {
|
||||
send: true,
|
||||
type: MapDeviceType.Signal.type,
|
||||
operation: OperationEvent.Signal.detail.menu.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: MapDeviceType.Signal.type,
|
||||
operation: OperationEvent.Command.cancel.menu.operation,
|
||||
}
|
||||
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.Signal.type,
|
||||
operation: OperationEvent.Command.cancel.menu.operation
|
||||
};
|
||||
|
||||
this.$store.dispatch('training/next', operate).then(({ valid }) => {
|
||||
if (valid) {
|
||||
this.doClose();
|
||||
}
|
||||
}).catch(error => {
|
||||
this.doClose();
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
this.$store.dispatch('training/next', operate).then(({ valid }) => {
|
||||
if (valid) {
|
||||
this.doClose();
|
||||
}
|
||||
}).catch(() => {
|
||||
this.doClose();
|
||||
});
|
||||
}
|
||||
}
|
||||
};
|
||||
</script>
|
||||
|
@ -1,293 +1,317 @@
|
||||
<template>
|
||||
<div>
|
||||
<el-dialog class="fuzhou-01__systerm route-hand-control" :title="title" :visible.sync="show" width="360px"
|
||||
:before-close="doClose" :zIndex="2000" :modal="false" :close-on-click-modal="false" v-dialogDrag>
|
||||
<el-row class="header">
|
||||
<el-col :span="10"><span>{{$t('menu.stationName')}}</span></el-col>
|
||||
<el-col :span="10" :offset="2"><span>{{$t('menu.startSignal')}}</span></el-col>
|
||||
</el-row>
|
||||
<el-row>
|
||||
<el-col :span="10">
|
||||
<el-input v-model="stationName" size="small" disabled></el-input>
|
||||
</el-col>
|
||||
<el-col :span="10" :offset="2">
|
||||
<el-input v-model="signalName" size="small" disabled></el-input>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<div class="table">
|
||||
<span>{{$t('menu.routeList')}}</span>
|
||||
<el-table ref="tempTable" :data="tempData" border style="width: 100%" size="mini" highlight-current-row
|
||||
:height="140">
|
||||
<el-table-column prop="name" :label="this.$t('menu.route')" :id="domIdChoose" style="margin-left:30px">
|
||||
<template slot-scope="scope">
|
||||
<el-checkbox v-model="scope.row.check" :disabled="scope.row.disabled"> </el-checkbox>
|
||||
<span :style="{color: scope.row.disabled ? '#CBCBCB':'unset'}">{{scope.row.name}}</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="controlType" :label="this.$t('menu.controlState')" :width="80">
|
||||
<template slot-scope="scope">
|
||||
<span :style="{color: scope.row.disabled ? '#CBCBCB':'unset'}">
|
||||
<span v-if="scope.row.controlType == '01'">{{$t('menu.automatic2')}}</span>
|
||||
<span v-else>{{$t('menu.artificial')}}</span>
|
||||
</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="conflictCheck" :label="this.$t('menu.conflictCheck')" :width="80">
|
||||
<template slot-scope="scope">
|
||||
<span
|
||||
:style="{color: scope.row.disabled ? '#CBCBCB':'unset'}">{{scope.row.conflictCheck}}</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
</div>
|
||||
<el-row justify="center" class="button-group">
|
||||
<el-col :span="10" :offset="2">
|
||||
<el-button :id="domIdConfirm" type="primary" :disabled="commitDisabled" :loading="loading"
|
||||
@click="commit">{{$t('global.confirm')}}</el-button>
|
||||
</el-col>
|
||||
<el-col :span="8" :offset="4">
|
||||
<el-button :id="domIdCancel" @click="cancel">{{$t('global.cancel')}}</el-button>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<confirm-control ref="confirmControl"></confirm-control>
|
||||
<notice-info ref="noticeInfo"></notice-info>
|
||||
</el-dialog>
|
||||
</div>
|
||||
<div>
|
||||
<el-dialog
|
||||
v-dialogDrag
|
||||
class="fuzhou-01__systerm route-hand-control"
|
||||
:title="title"
|
||||
:visible.sync="show"
|
||||
width="360px"
|
||||
:before-close="doClose"
|
||||
:z-index="2000"
|
||||
:modal="false"
|
||||
:close-on-click-modal="false"
|
||||
>
|
||||
<el-row class="header">
|
||||
<el-col :span="10"><span>{{ $t('menu.stationName') }}</span></el-col>
|
||||
<el-col :span="10" :offset="2"><span>{{ $t('menu.startSignal') }}</span></el-col>
|
||||
</el-row>
|
||||
<el-row>
|
||||
<el-col :span="10">
|
||||
<el-input v-model="stationName" size="small" disabled />
|
||||
</el-col>
|
||||
<el-col :span="10" :offset="2">
|
||||
<el-input v-model="signalName" size="small" disabled />
|
||||
</el-col>
|
||||
</el-row>
|
||||
<div class="table">
|
||||
<span>{{ $t('menu.routeList') }}</span>
|
||||
<el-table
|
||||
ref="tempTable"
|
||||
:data="tempData"
|
||||
border
|
||||
style="width: 100%"
|
||||
size="mini"
|
||||
highlight-current-row
|
||||
:height="140"
|
||||
>
|
||||
<el-table-column :id="domIdChoose" prop="name" :label="this.$t('menu.route')" style="margin-left:30px">
|
||||
<template slot-scope="scope">
|
||||
<el-checkbox v-model="scope.row.check" :disabled="scope.row.disabled" />
|
||||
<span :style="{color: scope.row.disabled ? '#CBCBCB':'unset'}">{{ scope.row.name }}</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="controlType" :label="this.$t('menu.controlState')" :width="80">
|
||||
<template slot-scope="scope">
|
||||
<span :style="{color: scope.row.disabled ? '#CBCBCB':'unset'}">
|
||||
<span v-if="scope.row.controlType == '01'">{{ $t('menu.automatic2') }}</span>
|
||||
<span v-else>{{ $t('menu.artificial') }}</span>
|
||||
</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="conflictCheck" :label="this.$t('menu.conflictCheck')" :width="80">
|
||||
<template slot-scope="scope">
|
||||
<span
|
||||
:style="{color: scope.row.disabled ? '#CBCBCB':'unset'}"
|
||||
>{{ scope.row.conflictCheck }}</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
</div>
|
||||
<el-row justify="center" class="button-group">
|
||||
<el-col :span="10" :offset="2">
|
||||
<el-button
|
||||
:id="domIdConfirm"
|
||||
type="primary"
|
||||
:disabled="commitDisabled"
|
||||
:loading="loading"
|
||||
@click="commit"
|
||||
>{{ $t('global.confirm') }}</el-button>
|
||||
</el-col>
|
||||
<el-col :span="8" :offset="4">
|
||||
<el-button :id="domIdCancel" @click="cancel">{{ $t('global.cancel') }}</el-button>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<confirm-control ref="confirmControl" />
|
||||
<notice-info ref="noticeInfo" />
|
||||
</el-dialog>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import { mapGetters } from 'vuex';
|
||||
import { MapDeviceType, OperationEvent, getDomIdByOperation } from '@/scripts/ConstDic';
|
||||
import ConfirmControl from './childDialog/confirmControl';
|
||||
import NoticeInfo from './childDialog/childDialog/noticeInfo'
|
||||
import { mapGetters } from 'vuex';
|
||||
import { MapDeviceType, OperationEvent, getDomIdByOperation } from '@/scripts/ConstDic';
|
||||
import ConfirmControl from './childDialog/confirmControl';
|
||||
import NoticeInfo from './childDialog/childDialog/noticeInfo';
|
||||
|
||||
export default {
|
||||
name: 'RouteHandControl',
|
||||
components: {
|
||||
ConfirmControl,
|
||||
NoticeInfo
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
dialogShow: false,
|
||||
loading: false,
|
||||
tempData: [],
|
||||
operation: null,
|
||||
selection: [],
|
||||
stationName: '',
|
||||
signalName: '',
|
||||
}
|
||||
},
|
||||
computed: {
|
||||
...mapGetters('map', [
|
||||
'signalList'
|
||||
]),
|
||||
show() {
|
||||
return this.dialogShow && !this.$store.state.menuOperation.break;
|
||||
},
|
||||
domIdCancel() {
|
||||
return this.dialogShow ? OperationEvent.Command.cancel.menu.domId : '';
|
||||
},
|
||||
domIdChoose() {
|
||||
if (this.dialogShow) {
|
||||
if (this.operation == OperationEvent.Signal.humanControl.menu.operation) {
|
||||
return OperationEvent.Signal.humanControl.choose.domId;
|
||||
} else if (this.operation == OperationEvent.Signal.atsAutoControl.menu.operation) {
|
||||
return OperationEvent.Signal.atsAutoControl.choose.domId;
|
||||
}
|
||||
}
|
||||
},
|
||||
domIdConfirm() {
|
||||
return this.dialogShow ? getDomIdByOperation(this.operation) : '';
|
||||
},
|
||||
title() {
|
||||
if (this.operation == OperationEvent.Signal.humanControl.menu.operation) {
|
||||
return this.$t('menu.menuSignal.humanControl');
|
||||
} else if (this.operation == OperationEvent.Signal.atsAutoControl.menu.operation) {
|
||||
return this.$t('menu.menuSignal.atsAutoControl');
|
||||
}
|
||||
},
|
||||
commitDisabled() {
|
||||
let disabled = true;
|
||||
if (this.selection && this.selection.length) {
|
||||
disabled = false;
|
||||
}
|
||||
export default {
|
||||
name: 'RouteHandControl',
|
||||
components: {
|
||||
ConfirmControl,
|
||||
NoticeInfo
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
dialogShow: false,
|
||||
loading: false,
|
||||
tempData: [],
|
||||
operation: null,
|
||||
selection: [],
|
||||
stationName: '',
|
||||
signalName: ''
|
||||
};
|
||||
},
|
||||
computed: {
|
||||
...mapGetters('map', [
|
||||
'signalList'
|
||||
]),
|
||||
show() {
|
||||
return this.dialogShow && !this.$store.state.menuOperation.break;
|
||||
},
|
||||
domIdCancel() {
|
||||
return this.dialogShow ? OperationEvent.Command.cancel.menu.domId : '';
|
||||
},
|
||||
domIdChoose() {
|
||||
if (this.dialogShow) {
|
||||
if (this.operation == OperationEvent.Signal.humanControl.menu.operation) {
|
||||
return OperationEvent.Signal.humanControl.choose.domId;
|
||||
} else if (this.operation == OperationEvent.Signal.atsAutoControl.menu.operation) {
|
||||
return OperationEvent.Signal.atsAutoControl.choose.domId;
|
||||
}
|
||||
}
|
||||
return '';
|
||||
},
|
||||
domIdConfirm() {
|
||||
return this.dialogShow ? getDomIdByOperation(this.operation) : '';
|
||||
},
|
||||
title() {
|
||||
if (this.operation == OperationEvent.Signal.humanControl.menu.operation) {
|
||||
return this.$t('menu.menuSignal.humanControl');
|
||||
} else if (this.operation == OperationEvent.Signal.atsAutoControl.menu.operation) {
|
||||
return this.$t('menu.menuSignal.atsAutoControl');
|
||||
}
|
||||
return '';
|
||||
},
|
||||
commitDisabled() {
|
||||
let disabled = true;
|
||||
if (this.selection && this.selection.length) {
|
||||
disabled = false;
|
||||
}
|
||||
|
||||
return disabled;
|
||||
}
|
||||
},
|
||||
watch: {
|
||||
//深度数据状态
|
||||
tempData: {
|
||||
handler(val, oldVal) {
|
||||
this.checkTableDataSelction(val);
|
||||
},
|
||||
deep: true
|
||||
}
|
||||
},
|
||||
mounted() {
|
||||
this.$nextTick(() => {
|
||||
this.$store.dispatch('training/tipReload');
|
||||
})
|
||||
},
|
||||
methods: {
|
||||
doShow(operate, selected, tempData) {
|
||||
//如果不是断点激活,而是第一次显示则初始化
|
||||
if (!this.dialogShow) {
|
||||
this.signalName = '';
|
||||
this.stationName = '';
|
||||
if (selected && selected._type.toUpperCase() === 'Signal'.toUpperCase()) {
|
||||
this.signalName = selected.name
|
||||
let station = this.$store.getters['map/getDeviceByCode'](selected.stationCode);
|
||||
if (station) {
|
||||
this.stationName = station.name;
|
||||
}
|
||||
}
|
||||
return disabled;
|
||||
}
|
||||
},
|
||||
watch: {
|
||||
// 深度数据状态
|
||||
tempData: {
|
||||
handler(val, oldVal) {
|
||||
this.checkTableDataSelction(val);
|
||||
},
|
||||
deep: true
|
||||
}
|
||||
},
|
||||
mounted() {
|
||||
this.$nextTick(() => {
|
||||
this.$store.dispatch('training/tipReload');
|
||||
});
|
||||
},
|
||||
methods: {
|
||||
doShow(operate, selected, tempData) {
|
||||
// 如果不是断点激活,而是第一次显示则初始化
|
||||
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;
|
||||
}
|
||||
}
|
||||
|
||||
if (tempData && tempData.length > 0) {
|
||||
tempData.forEach(elem => {
|
||||
elem.check = false;
|
||||
elem.disabled = false;
|
||||
//设置禁用状态
|
||||
if (operate.operation === OperationEvent.Signal.humanControl.menu.operation &&
|
||||
if (tempData && tempData.length > 0) {
|
||||
tempData.forEach(elem => {
|
||||
elem.check = false;
|
||||
elem.disabled = false;
|
||||
// 设置禁用状态
|
||||
if (operate.operation === OperationEvent.Signal.humanControl.menu.operation &&
|
||||
elem.controlType != '01') {
|
||||
elem.disabled = true;
|
||||
} if (operate.operation === OperationEvent.Signal.atsAutoControl.menu.operation &&
|
||||
elem.disabled = true;
|
||||
} if (operate.operation === OperationEvent.Signal.atsAutoControl.menu.operation &&
|
||||
elem.controlType == '01') {
|
||||
elem.disabled = true
|
||||
}
|
||||
})
|
||||
}
|
||||
elem.disabled = true;
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
this.tempData = tempData || [];
|
||||
this.operation = operate.operation;
|
||||
}
|
||||
this.dialogShow = true;
|
||||
this.$nextTick(function () {
|
||||
this.$store.dispatch('training/emitTipFresh');
|
||||
});
|
||||
},
|
||||
doClose() {
|
||||
this.loading = false;
|
||||
this.dialogShow = false;
|
||||
this.$refs.tempTable.setCurrentRow();
|
||||
this.$store.dispatch('training/emitTipFresh');
|
||||
},
|
||||
checkTableDataSelction(data) {
|
||||
let selection = [];
|
||||
if (data && data.length > 0) {
|
||||
data.forEach(row => {
|
||||
if (row.check && !row.disabled) {
|
||||
selection.push(row);
|
||||
}
|
||||
})
|
||||
}
|
||||
this.tempData = tempData || [];
|
||||
this.operation = operate.operation;
|
||||
}
|
||||
this.dialogShow = true;
|
||||
this.$nextTick(function () {
|
||||
this.$store.dispatch('training/emitTipFresh');
|
||||
});
|
||||
},
|
||||
doClose() {
|
||||
this.loading = false;
|
||||
this.dialogShow = false;
|
||||
this.$refs.tempTable.setCurrentRow();
|
||||
this.$store.dispatch('training/emitTipFresh');
|
||||
},
|
||||
checkTableDataSelction(data) {
|
||||
const selection = [];
|
||||
if (data && data.length > 0) {
|
||||
data.forEach(row => {
|
||||
if (row.check && !row.disabled) {
|
||||
selection.push(row);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
if (JSON.stringify(selection) !== JSON.stringify(this.selection)) {
|
||||
this.handleChooseChange(selection);
|
||||
this.selection = selection;
|
||||
}
|
||||
},
|
||||
serializeCodeListWithSeparator(sep) {
|
||||
let codeList = [];
|
||||
if (this.selection && this.selection.length) {
|
||||
this.selection.forEach(elem => {
|
||||
codeList.push(elem.code);
|
||||
})
|
||||
}
|
||||
return codeList.join(sep);
|
||||
},
|
||||
handleChooseChange(selection) {
|
||||
this.selection = selection;
|
||||
if (selection && selection.length) {
|
||||
let operate = {
|
||||
repeat: true,
|
||||
type: MapDeviceType.Signal.type,
|
||||
operation: '',
|
||||
val: this.serializeCodeListWithSeparator('::'),
|
||||
selection: selection
|
||||
}
|
||||
if (JSON.stringify(selection) !== JSON.stringify(this.selection)) {
|
||||
this.handleChooseChange(selection);
|
||||
this.selection = selection;
|
||||
}
|
||||
},
|
||||
serializeCodeListWithSeparator(sep) {
|
||||
const codeList = [];
|
||||
if (this.selection && this.selection.length) {
|
||||
this.selection.forEach(elem => {
|
||||
codeList.push(elem.code);
|
||||
});
|
||||
}
|
||||
return codeList.join(sep);
|
||||
},
|
||||
handleChooseChange(selection) {
|
||||
this.selection = selection;
|
||||
if (selection && selection.length) {
|
||||
const operate = {
|
||||
repeat: true,
|
||||
type: MapDeviceType.Signal.type,
|
||||
operation: '',
|
||||
val: this.serializeCodeListWithSeparator('::'),
|
||||
selection: selection
|
||||
};
|
||||
|
||||
if (this.operation == OperationEvent.Signal.humanControl.menu.operation) {
|
||||
/** 自排关*/
|
||||
operate.operation = OperationEvent.Signal.humanControl.choose.operation
|
||||
} else if (this.operation == OperationEvent.Signal.atsAutoControl.menu.operation) {
|
||||
/** 自排开*/
|
||||
operate.operation = OperationEvent.Signal.atsAutoControl.choose.operation
|
||||
}
|
||||
if (this.operation == OperationEvent.Signal.humanControl.menu.operation) {
|
||||
/** 自排关*/
|
||||
operate.operation = OperationEvent.Signal.humanControl.choose.operation;
|
||||
} else if (this.operation == OperationEvent.Signal.atsAutoControl.menu.operation) {
|
||||
/** 自排开*/
|
||||
operate.operation = OperationEvent.Signal.atsAutoControl.choose.operation;
|
||||
}
|
||||
|
||||
this.$store.dispatch('training/next', operate).then(({ valid }) => {
|
||||
if (valid) {
|
||||
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
|
||||
}
|
||||
})
|
||||
} else if (!selection) {
|
||||
this.$messageBox(this.$t('tip.selectAPieceOfData'));
|
||||
}
|
||||
},
|
||||
commit() {
|
||||
if (this.operation == OperationEvent.Signal.humanControl.menu.operation) {
|
||||
/** 自排关*/
|
||||
this.humanControl();
|
||||
} else if (this.operation == OperationEvent.Signal.atsAutoControl.menu.operation) {
|
||||
/** 自排开*/
|
||||
this.atsAutoControl();
|
||||
}
|
||||
},
|
||||
//自排关
|
||||
humanControl() {
|
||||
let operate = {
|
||||
send: true,
|
||||
type: MapDeviceType.Signal.type,
|
||||
operation: OperationEvent.Signal.humanControl.menu.operation,
|
||||
}
|
||||
this.$store.dispatch('training/next', operate).then(({ valid }) => {
|
||||
if (valid) {
|
||||
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
|
||||
}
|
||||
});
|
||||
} else if (!selection) {
|
||||
this.$messageBox(this.$t('tip.selectAPieceOfData'));
|
||||
}
|
||||
},
|
||||
commit() {
|
||||
if (this.operation == OperationEvent.Signal.humanControl.menu.operation) {
|
||||
/** 自排关*/
|
||||
this.humanControl();
|
||||
} else if (this.operation == OperationEvent.Signal.atsAutoControl.menu.operation) {
|
||||
/** 自排开*/
|
||||
this.atsAutoControl();
|
||||
}
|
||||
},
|
||||
// 自排关
|
||||
humanControl() {
|
||||
const operate = {
|
||||
send: true,
|
||||
type: MapDeviceType.Signal.type,
|
||||
operation: OperationEvent.Signal.humanControl.menu.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);
|
||||
});
|
||||
},
|
||||
//自排开
|
||||
atsAutoControl() {
|
||||
let operate = {
|
||||
send: true,
|
||||
type: MapDeviceType.Signal.type,
|
||||
operation: OperationEvent.Signal.atsAutoControl.menu.operation,
|
||||
}
|
||||
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);
|
||||
});
|
||||
},
|
||||
// 自排开
|
||||
atsAutoControl() {
|
||||
const operate = {
|
||||
send: true,
|
||||
type: MapDeviceType.Signal.type,
|
||||
operation: OperationEvent.Signal.atsAutoControl.menu.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: MapDeviceType.Signal.type,
|
||||
operation: OperationEvent.Command.cancel.menu.operation,
|
||||
}
|
||||
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.Signal.type,
|
||||
operation: OperationEvent.Command.cancel.menu.operation
|
||||
};
|
||||
|
||||
this.$store.dispatch('training/next', operate).then(({ valid }) => {
|
||||
if (valid) {
|
||||
this.doClose();
|
||||
}
|
||||
}).catch(error => {
|
||||
this.doClose();
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
this.$store.dispatch('training/next', operate).then(({ valid }) => {
|
||||
if (valid) {
|
||||
this.doClose();
|
||||
}
|
||||
}).catch(() => {
|
||||
this.doClose();
|
||||
});
|
||||
}
|
||||
}
|
||||
};
|
||||
</script>
|
||||
|
@ -12,8 +12,8 @@
|
||||
:close-on-click-modal="false"
|
||||
>
|
||||
<el-row class="header">
|
||||
<el-col :span="10"><span>{{$t('menu.stationName')}}</span></el-col>
|
||||
<el-col :span="10" :offset="2"><span>{{$t('menu.signalName')}}</span></el-col>
|
||||
<el-col :span="10"><span>{{ $t('menu.stationName') }}</span></el-col>
|
||||
<el-col :span="10" :offset="2"><span>{{ $t('menu.signalName') }}</span></el-col>
|
||||
</el-row>
|
||||
<el-row>
|
||||
<el-col :span="10">
|
||||
@ -24,7 +24,7 @@
|
||||
</el-col>
|
||||
</el-row>
|
||||
<div class="table">
|
||||
<span>{{$t('menu.listOfSignalButtons')}}</span>
|
||||
<span>{{ $t('menu.listOfSignalButtons') }}</span>
|
||||
<el-table
|
||||
ref="table"
|
||||
:data="tempData"
|
||||
@ -40,10 +40,10 @@
|
||||
</div>
|
||||
<el-row justify="center" class="button-group">
|
||||
<el-col :span="10" :offset="2">
|
||||
<el-button :id="domIdConfirm" type="primary" :loading="loading" @click="commit">{{$t('global.confirm')}}</el-button>
|
||||
<el-button :id="domIdConfirm" type="primary" :loading="loading" @click="commit">{{ $t('global.confirm') }}</el-button>
|
||||
</el-col>
|
||||
<el-col :span="8" :offset="4">
|
||||
<el-button :id="domIdCancel" @click="cancel">{{$t('global.cancel')}}</el-button>
|
||||
<el-button :id="domIdCancel" @click="cancel">{{ $t('global.cancel') }}</el-button>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<notice-info ref="noticeInfo" />
|
||||
|
@ -11,8 +11,8 @@
|
||||
:close-on-click-modal="false"
|
||||
>
|
||||
<el-row class="header">
|
||||
<el-col :span="8"><span>{{$t('menu.stationName')}}</span></el-col>
|
||||
<el-col :span="8" :offset="2"><span>{{$t('menu.startSignal')}}</span></el-col>
|
||||
<el-col :span="8"><span>{{ $t('menu.stationName') }}</span></el-col>
|
||||
<el-col :span="8" :offset="2"><span>{{ $t('menu.startSignal') }}</span></el-col>
|
||||
</el-row>
|
||||
<el-row>
|
||||
<el-col :span="8">
|
||||
@ -40,8 +40,8 @@
|
||||
</el-table-column>
|
||||
<el-table-column prop="canSetting" :label="this.$t('global.status')" :width="100">
|
||||
<template slot-scope="scope">
|
||||
<span v-if="scope.row.canSetting">{{$t('menu.allowSelection')}}</span>
|
||||
<span v-else>{{$t('menu.notAllowSelection')}}</span>
|
||||
<span v-if="scope.row.canSetting">{{ $t('menu.allowSelection') }}</span>
|
||||
<span v-else>{{ $t('menu.notAllowSelection') }}</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
@ -57,10 +57,10 @@
|
||||
:loading="loading"
|
||||
:disabled="commitDisabled"
|
||||
@click="commit"
|
||||
>{{$t('global.confirm')}}</el-button>
|
||||
>{{ $t('global.confirm') }}</el-button>
|
||||
</el-col>
|
||||
<el-col :span="8" :offset="4">
|
||||
<el-button :id="domIdCancel" @click="cancel">{{$t('global.cancel')}}</el-button>
|
||||
<el-button :id="domIdCancel" @click="cancel">{{ $t('global.cancel') }}</el-button>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<confirm-control ref="confirmControl" />
|
||||
|
@ -1,433 +1,457 @@
|
||||
<template>
|
||||
<div>
|
||||
<el-dialog class="fuzhou-01__systerm section-cmd-control" :title="title" :visible.sync="show" width="840px"
|
||||
:before-close="doClose" :zIndex="2000" :modal="false" :close-on-click-modal="false" v-dialogDrag>
|
||||
<div style="padding: 10px 20px; border: 1px solid lightgray;">
|
||||
<span class="base-label">{{$t('menu.commandInformation')}}</span>
|
||||
<el-form label-position="center" size="mini">
|
||||
<el-row>
|
||||
<el-col :span="8">
|
||||
<el-form-item :label="this.$t('global.status')" 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-option>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="8">
|
||||
<el-form-item :label="this.$t('menu.stationName')" label-width="80px">
|
||||
<el-input v-model="stationName" size="small" disabled></el-input>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="8">
|
||||
<el-form-item :label="this.$t('menu.sectionName')" label-width="100px">
|
||||
<el-input v-model="sectionName" size="small" disabled></el-input>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
</el-form>
|
||||
</div>
|
||||
<el-table class="table" ref="tempData" :data="tempData" border style="width: 100%" size="mini"
|
||||
highlight-current-row height="200">
|
||||
<el-table-column prop="order" :width="110" :label="this.$t('menu.serialNumber2')">
|
||||
</el-table-column>
|
||||
<el-table-column prop="date" :width="160" :label="this.$t('menu.time')">
|
||||
</el-table-column>
|
||||
<el-table-column prop="context" :width="180" :label="this.$t('menu.implementationProcess')">
|
||||
</el-table-column>
|
||||
<el-table-column prop="result" :label="this.$t('menu.executionResult')">
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
<span class="notice">{{message}}</span>
|
||||
<el-row class="button-group">
|
||||
<el-col :span="2" :offset="3">
|
||||
<el-button :id="domIdCommand" type="primary" :disabled="cmdDisabled[0]" @click="command">{{$t('menu.release')}}<span
|
||||
v-show="timeCountCommand>0">({{timeCountCommand}})</span></el-button>
|
||||
</el-col>
|
||||
<el-col :span="2" :offset="1">
|
||||
<el-button :id="domIdConfirm1" type="primary" style="width:120px;" :disabled="cmdDisabled[1]" @click="confirm1">{{$t('menu.firstConfirm')}}
|
||||
</el-button>
|
||||
</el-col>
|
||||
<el-col :span="2" :offset="2">
|
||||
<el-button :id="domIdConfirm2" type="primary" style="width:120px;" :disabled="cmdDisabled[2]" @click="confirm2">{{$t('menu.secondConfirm')}}<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">{{$t('menu.suspend')}}</el-button>
|
||||
</el-col>
|
||||
<el-col :span="2" :offset="1">
|
||||
<el-button :id="domIdClose" @click="close">{{$t('global.close')}}</el-button>
|
||||
</el-col>
|
||||
</el-row>
|
||||
</el-dialog>
|
||||
</div>
|
||||
<div>
|
||||
<el-dialog
|
||||
v-dialogDrag
|
||||
class="fuzhou-01__systerm section-cmd-control"
|
||||
:title="title"
|
||||
:visible.sync="show"
|
||||
width="840px"
|
||||
: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">{{ $t('menu.commandInformation') }}</span>
|
||||
<el-form label-position="center" size="mini">
|
||||
<el-row>
|
||||
<el-col :span="8">
|
||||
<el-form-item :label="this.$t('global.status')" 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="this.$t('menu.stationName')" label-width="80px">
|
||||
<el-input v-model="stationName" size="small" disabled />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="8">
|
||||
<el-form-item :label="this.$t('menu.sectionName')" label-width="100px">
|
||||
<el-input v-model="sectionName" 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="110" :label="this.$t('menu.serialNumber2')" />
|
||||
<el-table-column prop="date" :width="160" :label="this.$t('menu.time')" />
|
||||
<el-table-column prop="context" :width="180" :label="this.$t('menu.implementationProcess')" />
|
||||
<el-table-column prop="result" :label="this.$t('menu.executionResult')" />
|
||||
</el-table>
|
||||
<span class="notice">{{ message }}</span>
|
||||
<el-row class="button-group">
|
||||
<el-col :span="2" :offset="3">
|
||||
<el-button :id="domIdCommand" type="primary" :disabled="cmdDisabled[0]" @click="command">{{ $t('menu.release') }}<span
|
||||
v-show="timeCountCommand>0"
|
||||
>({{ timeCountCommand }})</span></el-button>
|
||||
</el-col>
|
||||
<el-col :span="2" :offset="1">
|
||||
<el-button :id="domIdConfirm1" type="primary" style="width:120px;" :disabled="cmdDisabled[1]" @click="confirm1">{{ $t('menu.firstConfirm') }}
|
||||
</el-button>
|
||||
</el-col>
|
||||
<el-col :span="2" :offset="2">
|
||||
<el-button :id="domIdConfirm2" type="primary" style="width:120px;" :disabled="cmdDisabled[2]" @click="confirm2">{{ $t('menu.secondConfirm') }}<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">{{ $t('menu.suspend') }}</el-button>
|
||||
</el-col>
|
||||
<el-col :span="2" :offset="1">
|
||||
<el-button :id="domIdClose" @click="close">{{ $t('global.close') }}</el-button>
|
||||
</el-col>
|
||||
</el-row>
|
||||
</el-dialog>
|
||||
</div>
|
||||
</template>
|
||||
<script>
|
||||
import { MapDeviceType, OperationEvent } from '@/scripts/ConstDic';
|
||||
import { now } from '@/utils/date';
|
||||
import { MapDeviceType, OperationEvent } from '@/scripts/ConstDic';
|
||||
import { now } from '@/utils/date';
|
||||
|
||||
export default {
|
||||
name: 'SectionCmdControl',
|
||||
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: '',
|
||||
sectionName: ''
|
||||
}
|
||||
},
|
||||
computed: {
|
||||
typeList() {
|
||||
return [
|
||||
{ code: OperationEvent.Section.unlock.menu.operation, name: this.$t('menu.menuSection.sectionUnblock') },
|
||||
{ code: OperationEvent.Section.fault.menu.operation, name: this.$t('menu.menuSection.sectionFaultUnlock') },
|
||||
{ code: OperationEvent.Section.axlePreReset.menu.operation, name: this.$t('menu.menuSection.sectionAxisPreReset') },
|
||||
]
|
||||
},
|
||||
show() {
|
||||
return this.dialogShow && !this.$store.state.menuOperation.break;
|
||||
},
|
||||
domIdCommand() {
|
||||
if (this.dialogShow) {
|
||||
if (this.operation == OperationEvent.Section.unlock.menu.operation) {
|
||||
/** 区段解封*/
|
||||
return OperationEvent.Section.unlock.order.domId;
|
||||
} else if (this.operation == OperationEvent.Section.fault.menu.operation) {
|
||||
/** 区段故障解锁*/
|
||||
return OperationEvent.Section.fault.order.domId;
|
||||
} else if (this.operation == OperationEvent.Section.axlePreReset.menu.operation) {
|
||||
/** 区段计轴预复位*/
|
||||
return OperationEvent.Section.axlePreReset.order.domId;
|
||||
}
|
||||
}
|
||||
},
|
||||
domIdConfirm1() {
|
||||
if (this.dialogShow) {
|
||||
if (this.operation == OperationEvent.Section.unlock.menu.operation) {
|
||||
/** 区段解封*/
|
||||
return OperationEvent.Section.unlock.confirm1.domId;
|
||||
} else if (this.operation == OperationEvent.Section.fault.menu.operation) {
|
||||
/** 区段故障解锁*/
|
||||
return OperationEvent.Section.fault.confirm1.domId;
|
||||
} else if (this.operation == OperationEvent.Section.axlePreReset.menu.operation) {
|
||||
/** 区段计轴预复位*/
|
||||
return OperationEvent.Section.axlePreReset.confirm1.domId;
|
||||
}
|
||||
}
|
||||
},
|
||||
domIdConfirm2() {
|
||||
if (this.dialogShow) {
|
||||
if (this.operation == OperationEvent.Section.unlock.menu.operation) {
|
||||
/** 区段解封*/
|
||||
return OperationEvent.Section.unlock.confirm2.domId;
|
||||
} else if (this.operation == OperationEvent.Section.fault.menu.operation) {
|
||||
/** 区段故障解锁*/
|
||||
return OperationEvent.Section.fault.confirm2.domId;
|
||||
} else if (this.operation == OperationEvent.Section.axlePreReset.menu.operation) {
|
||||
/** 区段计轴预复位*/
|
||||
return OperationEvent.Section.axlePreReset.confirm2.domId;
|
||||
}
|
||||
}
|
||||
},
|
||||
domIdStop() {
|
||||
if (this.dialogShow) {
|
||||
if (this.operation == OperationEvent.Section.unlock.menu.operation) {
|
||||
/** 区段解封*/
|
||||
return OperationEvent.Section.unlock.stop.domId;
|
||||
} else if (this.operation == OperationEvent.Section.fault.menu.operation) {
|
||||
/** 区段故障解锁*/
|
||||
return OperationEvent.Section.fault.stop.domId;
|
||||
} else if (this.operation == OperationEvent.Section.axlePreReset.menu.operation) {
|
||||
/** 区段计轴预复位*/
|
||||
return OperationEvent.Section.axlePreReset.stop.domId;
|
||||
}
|
||||
}
|
||||
},
|
||||
domIdClose() {
|
||||
if (this.dialogShow) {
|
||||
return OperationEvent.Command.close.menu.domId;
|
||||
}
|
||||
},
|
||||
title() {
|
||||
if (this.dialogShow) {
|
||||
if (this.operation == OperationEvent.Section.unlock.menu.operation) {
|
||||
return this.$t('menu.menuSection.sectionUnblock');
|
||||
} else if (this.operation == OperationEvent.Section.fault.menu.operation) {
|
||||
return this.$t('menu.menuSection.sectionFaultUnlock');
|
||||
} else if (this.operation == OperationEvent.Section.axlePreReset.menu.operation) {
|
||||
return this.$t('menu.menuSection.sectionAxisPreReset');
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
watch: {
|
||||
cmdDisabled: {
|
||||
handler(val, oldVal) {
|
||||
this.stpDisabled = true;
|
||||
val.forEach((elem, index) => {
|
||||
// 在确定1之前的操作才可以终止
|
||||
if (elem == false && 1 <= index && 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) {
|
||||
if (!this.dialogShow) {
|
||||
this.sectionName = '';
|
||||
this.stationName = '';
|
||||
if (selected && selected._type.toUpperCase() === 'Section'.toUpperCase()) {
|
||||
if (selected.type === '02') {
|
||||
let section = this.$store.getters['map/getDeviceByCode'](selected.parentCode);
|
||||
if (section) {
|
||||
this.sectionName += section.name
|
||||
}
|
||||
}
|
||||
this.sectionName += selected.name
|
||||
export default {
|
||||
name: 'SectionCmdControl',
|
||||
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: '',
|
||||
sectionName: ''
|
||||
};
|
||||
},
|
||||
computed: {
|
||||
typeList() {
|
||||
return [
|
||||
{ code: OperationEvent.Section.unlock.menu.operation, name: this.$t('menu.menuSection.sectionUnblock') },
|
||||
{ code: OperationEvent.Section.fault.menu.operation, name: this.$t('menu.menuSection.sectionFaultUnlock') },
|
||||
{ code: OperationEvent.Section.axlePreReset.menu.operation, name: this.$t('menu.menuSection.sectionAxisPreReset') }
|
||||
];
|
||||
},
|
||||
show() {
|
||||
return this.dialogShow && !this.$store.state.menuOperation.break;
|
||||
},
|
||||
domIdCommand() {
|
||||
if (this.dialogShow) {
|
||||
if (this.operation == OperationEvent.Section.unlock.menu.operation) {
|
||||
/** 区段解封*/
|
||||
return OperationEvent.Section.unlock.order.domId;
|
||||
} else if (this.operation == OperationEvent.Section.fault.menu.operation) {
|
||||
/** 区段故障解锁*/
|
||||
return OperationEvent.Section.fault.order.domId;
|
||||
} else if (this.operation == OperationEvent.Section.axlePreReset.menu.operation) {
|
||||
/** 区段计轴预复位*/
|
||||
return OperationEvent.Section.axlePreReset.order.domId;
|
||||
}
|
||||
}
|
||||
return '';
|
||||
},
|
||||
domIdConfirm1() {
|
||||
if (this.dialogShow) {
|
||||
if (this.operation == OperationEvent.Section.unlock.menu.operation) {
|
||||
/** 区段解封*/
|
||||
return OperationEvent.Section.unlock.confirm1.domId;
|
||||
} else if (this.operation == OperationEvent.Section.fault.menu.operation) {
|
||||
/** 区段故障解锁*/
|
||||
return OperationEvent.Section.fault.confirm1.domId;
|
||||
} else if (this.operation == OperationEvent.Section.axlePreReset.menu.operation) {
|
||||
/** 区段计轴预复位*/
|
||||
return OperationEvent.Section.axlePreReset.confirm1.domId;
|
||||
}
|
||||
}
|
||||
return '';
|
||||
},
|
||||
domIdConfirm2() {
|
||||
if (this.dialogShow) {
|
||||
if (this.operation == OperationEvent.Section.unlock.menu.operation) {
|
||||
/** 区段解封*/
|
||||
return OperationEvent.Section.unlock.confirm2.domId;
|
||||
} else if (this.operation == OperationEvent.Section.fault.menu.operation) {
|
||||
/** 区段故障解锁*/
|
||||
return OperationEvent.Section.fault.confirm2.domId;
|
||||
} else if (this.operation == OperationEvent.Section.axlePreReset.menu.operation) {
|
||||
/** 区段计轴预复位*/
|
||||
return OperationEvent.Section.axlePreReset.confirm2.domId;
|
||||
}
|
||||
}
|
||||
return '';
|
||||
},
|
||||
domIdStop() {
|
||||
if (this.dialogShow) {
|
||||
if (this.operation == OperationEvent.Section.unlock.menu.operation) {
|
||||
/** 区段解封*/
|
||||
return OperationEvent.Section.unlock.stop.domId;
|
||||
} else if (this.operation == OperationEvent.Section.fault.menu.operation) {
|
||||
/** 区段故障解锁*/
|
||||
return OperationEvent.Section.fault.stop.domId;
|
||||
} else if (this.operation == OperationEvent.Section.axlePreReset.menu.operation) {
|
||||
/** 区段计轴预复位*/
|
||||
return OperationEvent.Section.axlePreReset.stop.domId;
|
||||
}
|
||||
}
|
||||
return '';
|
||||
},
|
||||
domIdClose() {
|
||||
if (this.dialogShow) {
|
||||
return OperationEvent.Command.close.menu.domId;
|
||||
}
|
||||
return '';
|
||||
},
|
||||
title() {
|
||||
if (this.dialogShow) {
|
||||
if (this.operation == OperationEvent.Section.unlock.menu.operation) {
|
||||
return this.$t('menu.menuSection.sectionUnblock');
|
||||
} else if (this.operation == OperationEvent.Section.fault.menu.operation) {
|
||||
return this.$t('menu.menuSection.sectionFaultUnlock');
|
||||
} else if (this.operation == OperationEvent.Section.axlePreReset.menu.operation) {
|
||||
return this.$t('menu.menuSection.sectionAxisPreReset');
|
||||
}
|
||||
}
|
||||
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) {
|
||||
if (!this.dialogShow) {
|
||||
this.sectionName = '';
|
||||
this.stationName = '';
|
||||
if (selected && selected._type.toUpperCase() === 'Section'.toUpperCase()) {
|
||||
if (selected.type === '02') {
|
||||
const section = this.$store.getters['map/getDeviceByCode'](selected.parentCode);
|
||||
if (section) {
|
||||
this.sectionName += section.name;
|
||||
}
|
||||
}
|
||||
this.sectionName += selected.name;
|
||||
|
||||
let station = this.$store.getters['map/getDeviceByCode'](selected.stationCode);
|
||||
if (station) {
|
||||
this.stationName = station.name;
|
||||
}
|
||||
this.selected = selected;
|
||||
}
|
||||
const station = this.$store.getters['map/getDeviceByCode'](selected.stationCode);
|
||||
if (station) {
|
||||
this.stationName = station.name;
|
||||
}
|
||||
this.selected = selected;
|
||||
}
|
||||
|
||||
this.order = 0;
|
||||
this.operation = operate.operation || '';
|
||||
this.dialogShow = true;
|
||||
this.tempData = [];
|
||||
this.timeCountCommand = -1;
|
||||
this.timeCountConfirm = -1;
|
||||
this.cmdDisabled = [false, true, true];
|
||||
}
|
||||
this.stpDisabled = true;
|
||||
this.setMessage(this.$t('tip.releaseTip'));
|
||||
this.$nextTick(function () {
|
||||
this.$store.dispatch('training/emitTipFresh');
|
||||
});
|
||||
},
|
||||
doClose() {
|
||||
this.dialogShow = false;
|
||||
this.$store.dispatch('training/emitTipFresh');
|
||||
},
|
||||
command() {
|
||||
if (this.operation == OperationEvent.Section.fault.menu.operation ||
|
||||
this.order = 0;
|
||||
this.operation = operate.operation || '';
|
||||
this.dialogShow = true;
|
||||
this.tempData = [];
|
||||
this.timeCountCommand = -1;
|
||||
this.timeCountConfirm = -1;
|
||||
this.cmdDisabled = [false, true, true];
|
||||
}
|
||||
this.stpDisabled = true;
|
||||
this.setMessage(this.$t('tip.releaseTip'));
|
||||
this.$nextTick(function () {
|
||||
this.$store.dispatch('training/emitTipFresh');
|
||||
});
|
||||
},
|
||||
doClose() {
|
||||
this.dialogShow = false;
|
||||
this.$store.dispatch('training/emitTipFresh');
|
||||
},
|
||||
command() {
|
||||
if (this.operation == OperationEvent.Section.fault.menu.operation ||
|
||||
this.operation == OperationEvent.Section.unlock.menu.operation ||
|
||||
this.operation == OperationEvent.Section.cancelSpeed.menu.operation ||
|
||||
this.operation == OperationEvent.Section.axlePreReset.menu.operation) {
|
||||
/** 第一步不带弹框处理*/
|
||||
this.commandNoPopUp();
|
||||
} else {
|
||||
/** 第一步带弹框处理*/
|
||||
this.commandHasPopUp();
|
||||
}
|
||||
},
|
||||
commandHasPopUp() {
|
||||
},
|
||||
commandNoPopUp() {
|
||||
let operate = {
|
||||
type: MapDeviceType.Section.type
|
||||
}
|
||||
/** 第一步不带弹框处理*/
|
||||
this.commandNoPopUp();
|
||||
} else {
|
||||
/** 第一步带弹框处理*/
|
||||
this.commandHasPopUp();
|
||||
}
|
||||
},
|
||||
commandHasPopUp() {
|
||||
},
|
||||
commandNoPopUp() {
|
||||
const operate = {
|
||||
type: MapDeviceType.Section.type
|
||||
};
|
||||
|
||||
if (this.operation == OperationEvent.Section.unlock.menu.operation) {
|
||||
/** 区段解封*/
|
||||
operate.operation = OperationEvent.Section.unlock.order.operation
|
||||
} else if (this.operation == OperationEvent.Section.fault.menu.operation) {
|
||||
/** 区段故障解锁*/
|
||||
operate.operation = OperationEvent.Section.fault.order.operation
|
||||
} else if (this.operation == OperationEvent.Section.axlePreReset.menu.operation) {
|
||||
/** 区段计轴预复位*/
|
||||
operate.operation = OperationEvent.Section.axlePreReset.order.operation
|
||||
}
|
||||
if (this.operation == OperationEvent.Section.unlock.menu.operation) {
|
||||
/** 区段解封*/
|
||||
operate.operation = OperationEvent.Section.unlock.order.operation;
|
||||
} else if (this.operation == OperationEvent.Section.fault.menu.operation) {
|
||||
/** 区段故障解锁*/
|
||||
operate.operation = OperationEvent.Section.fault.order.operation;
|
||||
} else if (this.operation == OperationEvent.Section.axlePreReset.menu.operation) {
|
||||
/** 区段计轴预复位*/
|
||||
operate.operation = OperationEvent.Section.axlePreReset.order.operation;
|
||||
}
|
||||
|
||||
this.setMessage(this.$t('tip.firstConfirmTip'));
|
||||
this.writeRecord({ order: ++this.order, date: now(), context: this.$t('menu.clickReleaseCommand'), result: '' });
|
||||
this.$store.dispatch('training/next', operate).then(({ valid }) => {
|
||||
if (valid) {
|
||||
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
|
||||
this.setButtonEnable({ step: 1 });
|
||||
this.editRecord({ order: this.order, date: now(), context: this.$t('menu.clickReleaseCommand'), result: this.$t('tip.executionSucceed') });
|
||||
} else {
|
||||
this.editRecord({ order: this.order, date: now(), context: this.$t('menu.clickReleaseCommand'), result: this.$t('tip.executionFailed') });
|
||||
}
|
||||
}).catch(() => {
|
||||
this.editRecord({ order: this.order, date: now(), context: this.$t('menu.clickReleaseCommand'), result: this.$t('tip.executionException') });
|
||||
})
|
||||
},
|
||||
confirm1() {
|
||||
let operate = {
|
||||
type: MapDeviceType.Section.type,
|
||||
}
|
||||
this.setMessage(this.$t('tip.firstConfirmTip'));
|
||||
this.writeRecord({ order: ++this.order, date: now(), context: this.$t('menu.clickReleaseCommand'), result: '' });
|
||||
this.$store.dispatch('training/next', operate).then(({ valid }) => {
|
||||
if (valid) {
|
||||
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
|
||||
this.setButtonEnable({ step: 1 });
|
||||
this.editRecord({ order: this.order, date: now(), context: this.$t('menu.clickReleaseCommand'), result: this.$t('tip.executionSucceed') });
|
||||
} else {
|
||||
this.editRecord({ order: this.order, date: now(), context: this.$t('menu.clickReleaseCommand'), result: this.$t('tip.executionFailed') });
|
||||
}
|
||||
}).catch(() => {
|
||||
this.editRecord({ order: this.order, date: now(), context: this.$t('menu.clickReleaseCommand'), result: this.$t('tip.executionException') });
|
||||
});
|
||||
},
|
||||
confirm1() {
|
||||
const operate = {
|
||||
type: MapDeviceType.Section.type
|
||||
};
|
||||
|
||||
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;
|
||||
} else if (this.operation == OperationEvent.Section.axlePreReset.menu.operation) {
|
||||
/** 区段计轴预复位*/
|
||||
operate.operation = OperationEvent.Section.axlePreReset.confirm1.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;
|
||||
} else if (this.operation == OperationEvent.Section.axlePreReset.menu.operation) {
|
||||
/** 区段计轴预复位*/
|
||||
operate.operation = OperationEvent.Section.axlePreReset.confirm1.operation;
|
||||
}
|
||||
|
||||
this.setMessage(this.$t('tip.secondConfirmTip'));
|
||||
this.writeRecord({ order: ++this.order, date: now(), context: this.$t('menu.clickFirstConfirm'), result: '' });
|
||||
this.$store.dispatch('training/next', operate).then(({ valid }) => {
|
||||
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: this.$t('menu.clickFirstConfirm'), result: this.$t('tip.executionSucceed') });
|
||||
} else {
|
||||
this.editRecord({ order: this.order, date: now(), context: this.$t('menu.clickFirstConfirm'), result: this.$t('tip.executionFailed') });
|
||||
}
|
||||
}).catch(() => {
|
||||
this.editRecord({ order: this.order, date: now(), context: this.$t('menu.clickFirstConfirm'), result: this.$t('tip.executionException') });
|
||||
})
|
||||
},
|
||||
confirm2() {
|
||||
let operate = {
|
||||
send: true,
|
||||
type: MapDeviceType.Section.type
|
||||
}
|
||||
this.setMessage(this.$t('tip.secondConfirmTip'));
|
||||
this.writeRecord({ order: ++this.order, date: now(), context: this.$t('menu.clickFirstConfirm'), result: '' });
|
||||
this.$store.dispatch('training/next', operate).then(({ valid }) => {
|
||||
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: this.$t('menu.clickFirstConfirm'), result: this.$t('tip.executionSucceed') });
|
||||
} else {
|
||||
this.editRecord({ order: this.order, date: now(), context: this.$t('menu.clickFirstConfirm'), result: this.$t('tip.executionFailed') });
|
||||
}
|
||||
}).catch(() => {
|
||||
this.editRecord({ order: this.order, date: now(), context: this.$t('menu.clickFirstConfirm'), result: this.$t('tip.executionException') });
|
||||
});
|
||||
},
|
||||
confirm2() {
|
||||
const operate = {
|
||||
send: true,
|
||||
type: MapDeviceType.Section.type
|
||||
};
|
||||
|
||||
if (this.operation == OperationEvent.Section.unlock.menu.operation) {
|
||||
/** 区段解封*/
|
||||
operate.operation = OperationEvent.Section.unlock.confirm2.operation;
|
||||
} else if (this.operation == OperationEvent.Section.fault.menu.operation) {
|
||||
/** 区段故障解锁*/
|
||||
operate.operation = OperationEvent.Section.fault.confirm2.operation;
|
||||
} else if (this.operation == OperationEvent.Section.axlePreReset.menu.operation) {
|
||||
/** 区段计轴预复位*/
|
||||
operate.operation = OperationEvent.Section.axlePreReset.confirm2.operation;
|
||||
}
|
||||
this.setMessage('');
|
||||
this.writeRecord({ order: ++this.order, date: now(), context: this.$t('menu.clickSecondConfirm'), result: '' });
|
||||
this.$store.dispatch('training/next', 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: this.$t('menu.clickSecondConfirm'), result: this.$t('tip.executionSucceed') });
|
||||
} else {
|
||||
this.editRecord({ order: this.order, date: now(), context: this.$t('menu.clickSecondConfirm'), result: this.$t('tip.executionFailed') });
|
||||
}
|
||||
}).catch(() => {
|
||||
this.timeCountCommand = -1;
|
||||
this.timeCountConfirm = -1;
|
||||
this.setButtonEnable({ step: -1 });
|
||||
this.editRecord({ order: this.order, date: now(), context: this.$t('menu.clickSecondConfirm'), result: this.$t('tip.executionException') });
|
||||
})
|
||||
},
|
||||
stop() {
|
||||
let operate = {
|
||||
type: MapDeviceType.Section.type,
|
||||
}
|
||||
if (this.operation == OperationEvent.Section.unlock.menu.operation) {
|
||||
/** 区段解封*/
|
||||
operate.operation = OperationEvent.Section.unlock.confirm2.operation;
|
||||
} else if (this.operation == OperationEvent.Section.fault.menu.operation) {
|
||||
/** 区段故障解锁*/
|
||||
operate.operation = OperationEvent.Section.fault.confirm2.operation;
|
||||
} else if (this.operation == OperationEvent.Section.axlePreReset.menu.operation) {
|
||||
/** 区段计轴预复位*/
|
||||
operate.operation = OperationEvent.Section.axlePreReset.confirm2.operation;
|
||||
}
|
||||
this.setMessage('');
|
||||
this.writeRecord({ order: ++this.order, date: now(), context: this.$t('menu.clickSecondConfirm'), result: '' });
|
||||
this.$store.dispatch('training/next', 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: this.$t('menu.clickSecondConfirm'), result: this.$t('tip.executionSucceed') });
|
||||
} else {
|
||||
this.editRecord({ order: this.order, date: now(), context: this.$t('menu.clickSecondConfirm'), result: this.$t('tip.executionFailed') });
|
||||
}
|
||||
}).catch(() => {
|
||||
this.timeCountCommand = -1;
|
||||
this.timeCountConfirm = -1;
|
||||
this.setButtonEnable({ step: -1 });
|
||||
this.editRecord({ order: this.order, date: now(), context: this.$t('menu.clickSecondConfirm'), result: this.$t('tip.executionException') });
|
||||
});
|
||||
},
|
||||
stop() {
|
||||
const operate = {
|
||||
type: MapDeviceType.Section.type
|
||||
};
|
||||
|
||||
if (this.operation == OperationEvent.Section.unlock.menu.operation) {
|
||||
/** 区段解封*/
|
||||
operate.operation = OperationEvent.Section.unlock.stop.operation;
|
||||
} else if (this.operation == OperationEvent.Section.fault.menu.operation) {
|
||||
/** 区段故障解锁*/
|
||||
operate.operation = OperationEvent.Section.fault.stop.operation;
|
||||
} else if (this.operation == OperationEvent.Section.axlePreReset.menu.operation) {
|
||||
/** 区段计轴预复位*/
|
||||
operate.operation = OperationEvent.Section.axlePreReset.stop.operation;
|
||||
}
|
||||
if (this.operation == OperationEvent.Section.unlock.menu.operation) {
|
||||
/** 区段解封*/
|
||||
operate.operation = OperationEvent.Section.unlock.stop.operation;
|
||||
} else if (this.operation == OperationEvent.Section.fault.menu.operation) {
|
||||
/** 区段故障解锁*/
|
||||
operate.operation = OperationEvent.Section.fault.stop.operation;
|
||||
} else if (this.operation == OperationEvent.Section.axlePreReset.menu.operation) {
|
||||
/** 区段计轴预复位*/
|
||||
operate.operation = OperationEvent.Section.axlePreReset.stop.operation;
|
||||
}
|
||||
|
||||
this.writeRecord({ order: ++this.order, date: now(), context: this.$t('menu.clickSuspend'), result: '' });
|
||||
this.$store.dispatch('training/next', operate).then(({ valid }) => {
|
||||
if (valid) {
|
||||
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
|
||||
this.setButtonEnable({ step: 0 });
|
||||
this.editRecord({ order: this.order, date: now(), context: this.$t('menu.clickSuspend'), result: this.$t('tip.executionSucceed') });
|
||||
} else {
|
||||
this.editRecord({ order: this.order, date: now(), context: this.$t('menu.clickSuspend'), result: this.$t('tip.executionFailed') });
|
||||
}
|
||||
}).catch(error => {
|
||||
this.editRecord({ order: this.order, date: now(), context: this.$t('menu.clickSuspend'), result: this.$t('tip.executionException') });
|
||||
})
|
||||
},
|
||||
close() {
|
||||
let operate = {
|
||||
type: MapDeviceType.Section.type,
|
||||
operation: OperationEvent.Command.close.menu.operation,
|
||||
}
|
||||
this.writeRecord({ order: ++this.order, date: now(), context: this.$t('menu.clickSuspend'), result: '' });
|
||||
this.$store.dispatch('training/next', operate).then(({ valid }) => {
|
||||
if (valid) {
|
||||
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
|
||||
this.setButtonEnable({ step: 0 });
|
||||
this.editRecord({ order: this.order, date: now(), context: this.$t('menu.clickSuspend'), result: this.$t('tip.executionSucceed') });
|
||||
} else {
|
||||
this.editRecord({ order: this.order, date: now(), context: this.$t('menu.clickSuspend'), result: this.$t('tip.executionFailed') });
|
||||
}
|
||||
}).catch(() => {
|
||||
this.editRecord({ order: this.order, date: now(), context: this.$t('menu.clickSuspend'), result: this.$t('tip.executionException') });
|
||||
});
|
||||
},
|
||||
close() {
|
||||
const operate = {
|
||||
type: MapDeviceType.Section.type,
|
||||
operation: OperationEvent.Command.close.menu.operation
|
||||
};
|
||||
|
||||
this.$store.dispatch('training/next', operate).then(({ valid }) => {
|
||||
if (valid) {
|
||||
this.doClose();
|
||||
}
|
||||
}).catch(error => {
|
||||
this.doClose();
|
||||
});
|
||||
},
|
||||
getOperate(operate) {
|
||||
/** 弹框返回值处理*/
|
||||
},
|
||||
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];
|
||||
}
|
||||
}
|
||||
})
|
||||
}
|
||||
}
|
||||
}
|
||||
this.$store.dispatch('training/next', operate).then(({ valid }) => {
|
||||
if (valid) {
|
||||
this.doClose();
|
||||
}
|
||||
}).catch(() => {
|
||||
this.doClose();
|
||||
});
|
||||
},
|
||||
getOperate(operate) {
|
||||
/** 弹框返回值处理*/
|
||||
},
|
||||
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,190 +1,200 @@
|
||||
<template>
|
||||
<el-dialog class="fuzhou-01__systerm section-control" :title="title" :visible.sync="show" width="300px"
|
||||
:before-close="doClose" :zIndex="2000" :modal="false" :close-on-click-modal="false" v-dialogDrag>
|
||||
<el-row class="header">
|
||||
<el-col :span="11"><span>{{$t('menu.stationName')}}</span></el-col>
|
||||
<el-col :span="11" :offset="2"><span>{{$t('menu.section')}}</span></el-col>
|
||||
</el-row>
|
||||
<el-row>
|
||||
<el-col :span="11">
|
||||
<el-input v-model="stationName" size="small" disabled></el-input>
|
||||
</el-col>
|
||||
<el-col :span="11" :offset="2">
|
||||
<el-input v-model="sectionName" size="small" disabled></el-input>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<el-row justify="center" class="button-group">
|
||||
<el-col :span="10" :offset="2">
|
||||
<el-button :id="domIdConfirm" type="primary" :loading="loading" @click="commit">{{$t('global.confirm')}}</el-button>
|
||||
</el-col>
|
||||
<el-col :span="8" :offset="4">
|
||||
<el-button :id="domIdCancel" @click="cancel">{{$t('global.cancel')}}</el-button>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<notice-info ref="noticeInfo"></notice-info>
|
||||
</el-dialog>
|
||||
<el-dialog
|
||||
v-dialogDrag
|
||||
class="fuzhou-01__systerm section-control"
|
||||
:title="title"
|
||||
:visible.sync="show"
|
||||
width="300px"
|
||||
:before-close="doClose"
|
||||
:z-index="2000"
|
||||
:modal="false"
|
||||
:close-on-click-modal="false"
|
||||
>
|
||||
<el-row class="header">
|
||||
<el-col :span="11"><span>{{ $t('menu.stationName') }}</span></el-col>
|
||||
<el-col :span="11" :offset="2"><span>{{ $t('menu.section') }}</span></el-col>
|
||||
</el-row>
|
||||
<el-row>
|
||||
<el-col :span="11">
|
||||
<el-input v-model="stationName" size="small" disabled />
|
||||
</el-col>
|
||||
<el-col :span="11" :offset="2">
|
||||
<el-input v-model="sectionName" size="small" disabled />
|
||||
</el-col>
|
||||
</el-row>
|
||||
<el-row justify="center" class="button-group">
|
||||
<el-col :span="10" :offset="2">
|
||||
<el-button :id="domIdConfirm" type="primary" :loading="loading" @click="commit">{{ $t('global.confirm') }}</el-button>
|
||||
</el-col>
|
||||
<el-col :span="8" :offset="4">
|
||||
<el-button :id="domIdCancel" @click="cancel">{{ $t('global.cancel') }}</el-button>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<notice-info ref="noticeInfo" />
|
||||
</el-dialog>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import { MapDeviceType, OperationEvent, getDomIdByOperation } from '@/scripts/ConstDic';
|
||||
import NoticeInfo from './childDialog/childDialog/noticeInfo'
|
||||
import { MapDeviceType, OperationEvent, getDomIdByOperation } from '@/scripts/ConstDic';
|
||||
import NoticeInfo from './childDialog/childDialog/noticeInfo';
|
||||
|
||||
export default {
|
||||
name: 'SectionControl',
|
||||
components: {
|
||||
NoticeInfo
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
dialogShow: false,
|
||||
loading: false,
|
||||
operation: '',
|
||||
stationName: '',
|
||||
sectionName: '',
|
||||
}
|
||||
},
|
||||
computed: {
|
||||
show() {
|
||||
return this.dialogShow && !this.$store.state.menuOperation.break;
|
||||
},
|
||||
domIdCancel() {
|
||||
return this.dialogShow ? OperationEvent.Command.cancel.menu.domId : '';
|
||||
},
|
||||
domIdConfirm() {
|
||||
return this.dialogShow ? getDomIdByOperation(this.operation) : '';
|
||||
},
|
||||
title() {
|
||||
if (this.operation == OperationEvent.Section.lock.menu.operation) {
|
||||
return this.$t('menu.menuSection.sectionBlockade');
|
||||
} else if (this.operation == OperationEvent.Section.split.menu.operation) {
|
||||
return this.$t('menu.menuSection.orbitalSectionResection');
|
||||
} else if (this.operation == OperationEvent.Section.active.menu.operation) {
|
||||
return this.$t('menu.menuSection.orbitalSectionActive');
|
||||
}
|
||||
}
|
||||
},
|
||||
mounted() {
|
||||
this.$nextTick(() => {
|
||||
this.$store.dispatch('training/tipReload');
|
||||
})
|
||||
},
|
||||
methods: {
|
||||
doShow(operate, selected) {
|
||||
if (!this.dialogShow) {
|
||||
this.sectionName = '';
|
||||
this.stationName = '';
|
||||
if (selected && selected._type.toUpperCase() === 'Section'.toUpperCase()) {
|
||||
if (selected.type === '02') {
|
||||
let section = this.$store.getters['map/getDeviceByCode'](selected.parentCode);
|
||||
if (section) {
|
||||
this.sectionName += section.name
|
||||
}
|
||||
}
|
||||
this.sectionName += selected.name
|
||||
export default {
|
||||
name: 'SectionControl',
|
||||
components: {
|
||||
NoticeInfo
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
dialogShow: false,
|
||||
loading: false,
|
||||
operation: '',
|
||||
stationName: '',
|
||||
sectionName: ''
|
||||
};
|
||||
},
|
||||
computed: {
|
||||
show() {
|
||||
return this.dialogShow && !this.$store.state.menuOperation.break;
|
||||
},
|
||||
domIdCancel() {
|
||||
return this.dialogShow ? OperationEvent.Command.cancel.menu.domId : '';
|
||||
},
|
||||
domIdConfirm() {
|
||||
return this.dialogShow ? getDomIdByOperation(this.operation) : '';
|
||||
},
|
||||
title() {
|
||||
if (this.operation == OperationEvent.Section.lock.menu.operation) {
|
||||
return this.$t('menu.menuSection.sectionBlockade');
|
||||
} else if (this.operation == OperationEvent.Section.split.menu.operation) {
|
||||
return this.$t('menu.menuSection.orbitalSectionResection');
|
||||
} else if (this.operation == OperationEvent.Section.active.menu.operation) {
|
||||
return this.$t('menu.menuSection.orbitalSectionActive');
|
||||
}
|
||||
return '';
|
||||
}
|
||||
},
|
||||
mounted() {
|
||||
this.$nextTick(() => {
|
||||
this.$store.dispatch('training/tipReload');
|
||||
});
|
||||
},
|
||||
methods: {
|
||||
doShow(operate, selected) {
|
||||
if (!this.dialogShow) {
|
||||
this.sectionName = '';
|
||||
this.stationName = '';
|
||||
if (selected && selected._type.toUpperCase() === 'Section'.toUpperCase()) {
|
||||
if (selected.type === '02') {
|
||||
const section = this.$store.getters['map/getDeviceByCode'](selected.parentCode);
|
||||
if (section) {
|
||||
this.sectionName += section.name;
|
||||
}
|
||||
}
|
||||
this.sectionName += selected.name;
|
||||
|
||||
let station = this.$store.getters['map/getDeviceByCode'](selected.stationCode);
|
||||
if (station) {
|
||||
this.stationName = station.name;
|
||||
}
|
||||
}
|
||||
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('training/emitTipFresh');
|
||||
},
|
||||
commit() {
|
||||
if (this.operation == OperationEvent.Section.lock.menu.operation) {
|
||||
/** 区段封锁*/
|
||||
this.lock();
|
||||
} else if (this.operation == OperationEvent.Section.split.menu.operation) {
|
||||
/** 轨道区段切除*/
|
||||
this.split();
|
||||
} else if (this.operation == OperationEvent.Section.active.menu.operation) {
|
||||
/** 轨道区段激活*/
|
||||
this.active();
|
||||
}
|
||||
},
|
||||
//道岔单锁
|
||||
lock() {
|
||||
let operate = {
|
||||
send: true,
|
||||
type: MapDeviceType.Section.type,
|
||||
operation: OperationEvent.Section.lock.menu.operation,
|
||||
}
|
||||
const station = this.$store.getters['map/getDeviceByCode'](selected.stationCode);
|
||||
if (station) {
|
||||
this.stationName = station.name;
|
||||
}
|
||||
}
|
||||
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('training/emitTipFresh');
|
||||
},
|
||||
commit() {
|
||||
if (this.operation == OperationEvent.Section.lock.menu.operation) {
|
||||
/** 区段封锁*/
|
||||
this.lock();
|
||||
} else if (this.operation == OperationEvent.Section.split.menu.operation) {
|
||||
/** 轨道区段切除*/
|
||||
this.split();
|
||||
} else if (this.operation == OperationEvent.Section.active.menu.operation) {
|
||||
/** 轨道区段激活*/
|
||||
this.active();
|
||||
}
|
||||
},
|
||||
// 道岔单锁
|
||||
lock() {
|
||||
const operate = {
|
||||
send: true,
|
||||
type: MapDeviceType.Section.type,
|
||||
operation: OperationEvent.Section.lock.menu.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);
|
||||
});
|
||||
},
|
||||
//轨道区段切除
|
||||
split() {
|
||||
let operate = {
|
||||
send: true,
|
||||
type: MapDeviceType.Section.type,
|
||||
operation: OperationEvent.Section.split.menu.operation,
|
||||
}
|
||||
this.loading = true;
|
||||
this.$store.dispatch('training/next', operate).then(({ valid }) => {
|
||||
this.loading = false;
|
||||
if (valid) {
|
||||
this.doClose();
|
||||
}
|
||||
}).catch(() => {
|
||||
this.loading = false;
|
||||
this.doClose();
|
||||
this.$refs.noticeInfo.doShow(operate);
|
||||
});
|
||||
},
|
||||
// 轨道区段切除
|
||||
split() {
|
||||
const operate = {
|
||||
send: true,
|
||||
type: MapDeviceType.Section.type,
|
||||
operation: OperationEvent.Section.split.menu.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);
|
||||
});
|
||||
},
|
||||
//轨道区段激活
|
||||
active() {
|
||||
let operate = {
|
||||
send: true,
|
||||
type: MapDeviceType.Section.type,
|
||||
operation: OperationEvent.Section.active.menu.operation,
|
||||
}
|
||||
this.loading = true;
|
||||
this.$store.dispatch('training/next', operate).then(({ valid }) => {
|
||||
this.loading = false;
|
||||
if (valid) {
|
||||
this.doClose();
|
||||
}
|
||||
}).catch(() => {
|
||||
this.loading = false;
|
||||
this.doClose();
|
||||
this.$refs.noticeInfo.doShow(operate);
|
||||
});
|
||||
},
|
||||
// 轨道区段激活
|
||||
active() {
|
||||
const operate = {
|
||||
send: true,
|
||||
type: MapDeviceType.Section.type,
|
||||
operation: OperationEvent.Section.active.menu.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: MapDeviceType.Section.type,
|
||||
operation: OperationEvent.Command.cancel.menu.operation,
|
||||
}
|
||||
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();
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
this.$store.dispatch('training/next', operate).then(({ valid }) => {
|
||||
if (valid) {
|
||||
this.doClose();
|
||||
}
|
||||
}).catch(() => {
|
||||
this.doClose();
|
||||
});
|
||||
}
|
||||
}
|
||||
};
|
||||
</script>
|
||||
|
@ -12,7 +12,7 @@
|
||||
:close-on-click-modal="false"
|
||||
>
|
||||
<div style="padding: 10px 20px; border: 1px solid lightgray;">
|
||||
<span class="base-label">{{$t('menu.commandInformation')}}</span>
|
||||
<span class="base-label">{{ $t('menu.commandInformation') }}</span>
|
||||
<el-form label-position="center" size="mini">
|
||||
<el-row>
|
||||
<el-col :span="6">
|
||||
@ -71,24 +71,24 @@
|
||||
<span class="notice">{{ message }}</span>
|
||||
<el-row class="button-group">
|
||||
<el-col :span="2" :offset="3">
|
||||
<el-button :id="domIdCommand" type="primary" :disabled="cmdDisabled[0]" @click="command">{{$t('menu.release')}}<span
|
||||
<el-button :id="domIdCommand" type="primary" :disabled="cmdDisabled[0]" @click="command">{{ $t('menu.release') }}<span
|
||||
v-show="timeCountCommand>0"
|
||||
>({{ timeCountCommand }})</span></el-button>
|
||||
</el-col>
|
||||
<el-col :span="2" :offset="1">
|
||||
<el-button :id="domIdConfirm1" type="primary" style="width:120px;" :disabled="cmdDisabled[1]" @click="confirm1">{{$t('menu.firstConfirm')}}
|
||||
<el-button :id="domIdConfirm1" type="primary" style="width:120px;" :disabled="cmdDisabled[1]" @click="confirm1">{{ $t('menu.firstConfirm') }}
|
||||
</el-button>
|
||||
</el-col>
|
||||
<el-col :span="2" :offset="2">
|
||||
<el-button :id="domIdConfirm2" type="primary" style="width:120px;" :disabled="cmdDisabled[2]" @click="confirm2">{{$t('menu.secondConfirm')}}<span
|
||||
<el-button :id="domIdConfirm2" type="primary" style="width:120px;" :disabled="cmdDisabled[2]" @click="confirm2">{{ $t('menu.secondConfirm') }}<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">{{$t('menu.suspend')}}</el-button>
|
||||
<el-button :id="domIdStop" type="primary" :disabled="stpDisabled" @click="stop">{{ $t('menu.suspend') }}</el-button>
|
||||
</el-col>
|
||||
<el-col :span="2" :offset="1">
|
||||
<el-button :id="domIdClose" @click="close">{{$t('global.close')}}</el-button>
|
||||
<el-button :id="domIdClose" @click="close">{{ $t('global.close') }}</el-button>
|
||||
</el-col>
|
||||
</el-row>
|
||||
</el-dialog>
|
||||
|
@ -1,228 +1,251 @@
|
||||
<template>
|
||||
<el-dialog class="fuzhou-01__systerm stand-run-level" :title="title" :visible.sync="show" width="500px"
|
||||
:before-close="doClose" :zIndex="2000" :modal="false" :close-on-click-modal="false" v-dialogDrag>
|
||||
<el-row class="header">
|
||||
<el-col :span="10"><span>{{$t('menu.stationName')}}</span></el-col>
|
||||
<el-col :span="10" :offset="2"><span>{{$t('menu.stationStandStatus')}}</span></el-col>
|
||||
</el-row>
|
||||
<el-row>
|
||||
<el-col :span="10">
|
||||
<el-input v-model="stationName" size="small" disabled></el-input>
|
||||
</el-col>
|
||||
<el-col :span="10" :offset="2">
|
||||
<div style="height: 32px;">
|
||||
<el-radio v-model="standStatus" label="02" style="line-height: 32px;"
|
||||
:style="{color: standStatus == '02' ? '' : 'red'}" disabled>{{$t('menu.upDirection')}}</el-radio>
|
||||
<el-radio v-model="standStatus" label="01" style="line-height: 32px;"
|
||||
:style="{color: standStatus == '01' ? '' : 'red'}" disabled>{{$t('menu.downDirection')}}</el-radio>
|
||||
</div>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<div class="table">
|
||||
<span>{{$t('menu.stationStandStatus')}}</span>
|
||||
<el-table ref="tempData" :data="tempData" border style="width: 100%; height: 170px;" size="mini">
|
||||
<el-table-column prop="name" :width="170" :label="this.$t('menu.switchbackStation')">
|
||||
</el-table-column>
|
||||
<el-table-column prop="station" :label="this.$t('menu.switchbackPlatform')">
|
||||
</el-table-column>
|
||||
<el-table-column prop="strategy" :label="this.$t('menu.switchbackStrategy')">
|
||||
<template slot-scope="scope">
|
||||
<el-select v-model="scope.row.strategy" size="mini" @change="strategySelectChange"
|
||||
:id='domIdChoose'>
|
||||
<el-option v-for="item in strategyList" :key="item.value" :label="item.label"
|
||||
:value="item.value">
|
||||
</el-option>
|
||||
</el-select>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
<el-dialog
|
||||
v-dialogDrag
|
||||
class="fuzhou-01__systerm stand-run-level"
|
||||
:title="title"
|
||||
:visible.sync="show"
|
||||
width="500px"
|
||||
:before-close="doClose"
|
||||
:z-index="2000"
|
||||
:modal="false"
|
||||
:close-on-click-modal="false"
|
||||
>
|
||||
<el-row class="header">
|
||||
<el-col :span="10"><span>{{ $t('menu.stationName') }}</span></el-col>
|
||||
<el-col :span="10" :offset="2"><span>{{ $t('menu.stationStandStatus') }}</span></el-col>
|
||||
</el-row>
|
||||
<el-row>
|
||||
<el-col :span="10">
|
||||
<el-input v-model="stationName" size="small" disabled />
|
||||
</el-col>
|
||||
<el-col :span="10" :offset="2">
|
||||
<div style="height: 32px;">
|
||||
<el-radio
|
||||
v-model="standStatus"
|
||||
label="02"
|
||||
style="line-height: 32px;"
|
||||
:style="{color: standStatus == '02' ? '' : 'red'}"
|
||||
disabled
|
||||
>{{ $t('menu.upDirection') }}</el-radio>
|
||||
<el-radio
|
||||
v-model="standStatus"
|
||||
label="01"
|
||||
style="line-height: 32px;"
|
||||
:style="{color: standStatus == '01' ? '' : 'red'}"
|
||||
disabled
|
||||
>{{ $t('menu.downDirection') }}</el-radio>
|
||||
</div>
|
||||
<el-row class="button-group">
|
||||
<span v-if="isSelect && tempData.length">{{$t('menu.switchbackStrategyTip')}}</span>
|
||||
<span v-if="isConfirm && tempData.length">{{$t('menu.setSwitchbackStrategyTipPrefix') + tempData[0].name + $t('menu.setSwitchbackStrategyTipSuffix')}}</span>
|
||||
</el-row>
|
||||
<el-row justify="center" class="button-group">
|
||||
<el-col :span="10" :offset="2">
|
||||
<el-button :id="domIdConfirm" type="primary" :loading="loading" :disabled="!isConfirm" @click="commit">
|
||||
{{$t('global.confirm')}}</el-button>
|
||||
</el-col>
|
||||
<el-col :span="8" :offset="4">
|
||||
<el-button :id="domIdCancel" @click="cancel">{{$t('global.cancel')}}</el-button>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<confirm-control ref="confirmControl"></confirm-control>
|
||||
<notice-info ref="noticeInfo"></notice-info>
|
||||
</el-dialog>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<div class="table">
|
||||
<span>{{ $t('menu.stationStandStatus') }}</span>
|
||||
<el-table ref="tempData" :data="tempData" border style="width: 100%; height: 170px;" size="mini">
|
||||
<el-table-column prop="name" :width="170" :label="this.$t('menu.switchbackStation')" />
|
||||
<el-table-column prop="station" :label="this.$t('menu.switchbackPlatform')" />
|
||||
<el-table-column prop="strategy" :label="this.$t('menu.switchbackStrategy')">
|
||||
<template slot-scope="scope">
|
||||
<el-select
|
||||
:id="domIdChoose"
|
||||
v-model="scope.row.strategy"
|
||||
size="mini"
|
||||
@change="strategySelectChange"
|
||||
>
|
||||
<el-option
|
||||
v-for="item in strategyList"
|
||||
:key="item.value"
|
||||
:label="item.label"
|
||||
:value="item.value"
|
||||
/>
|
||||
</el-select>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
</div>
|
||||
<el-row class="button-group">
|
||||
<span v-if="isSelect && tempData.length">{{ $t('menu.switchbackStrategyTip') }}</span>
|
||||
<span v-if="isConfirm && tempData.length">{{ $t('menu.setSwitchbackStrategyTipPrefix') + tempData[0].name + $t('menu.setSwitchbackStrategyTipSuffix') }}</span>
|
||||
</el-row>
|
||||
<el-row justify="center" class="button-group">
|
||||
<el-col :span="10" :offset="2">
|
||||
<el-button :id="domIdConfirm" type="primary" :loading="loading" :disabled="!isConfirm" @click="commit">
|
||||
{{ $t('global.confirm') }}</el-button>
|
||||
</el-col>
|
||||
<el-col :span="8" :offset="4">
|
||||
<el-button :id="domIdCancel" @click="cancel">{{ $t('global.cancel') }}</el-button>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<confirm-control ref="confirmControl" />
|
||||
<notice-info ref="noticeInfo" />
|
||||
</el-dialog>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import ConfirmControl from './childDialog/confirmControl';
|
||||
import NoticeInfo from './childDialog/childDialog/noticeInfo'
|
||||
import { MapDeviceType, OperationEvent } from '@/scripts/ConstDic';
|
||||
import { mapGetters } from 'vuex';
|
||||
import ConfirmControl from './childDialog/confirmControl';
|
||||
import NoticeInfo from './childDialog/childDialog/noticeInfo';
|
||||
import { MapDeviceType, OperationEvent } from '@/scripts/ConstDic';
|
||||
import { mapGetters } from 'vuex';
|
||||
|
||||
export default {
|
||||
name: 'StandBackStrategy',
|
||||
components: {
|
||||
ConfirmControl,
|
||||
NoticeInfo
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
dialogShow: false,
|
||||
loading: false,
|
||||
tempData: [],
|
||||
strategyList: [
|
||||
{
|
||||
value: '01',
|
||||
label: this.$t('menu.noSwitchback')
|
||||
},
|
||||
{
|
||||
value: '02',
|
||||
label: this.$t('menu.noOneSwitchback')
|
||||
},
|
||||
{
|
||||
value: '03',
|
||||
label: this.$t('menu.automaticChange')
|
||||
},
|
||||
{
|
||||
value: '04',
|
||||
label: this.$t('menu.default')
|
||||
},
|
||||
],
|
||||
stationName: '',
|
||||
standStatus: '',
|
||||
selection: [],
|
||||
isSelect: true,
|
||||
isConfirm: false,
|
||||
strategy: '',
|
||||
}
|
||||
},
|
||||
computed: {
|
||||
...mapGetters('map', [
|
||||
'stationList',
|
||||
]),
|
||||
show() {
|
||||
return this.dialogShow && !this.$store.state.menuOperation.break;
|
||||
},
|
||||
domIdCancel() {
|
||||
return this.dialogShow ? OperationEvent.Command.cancel.menu.domId : '';
|
||||
},
|
||||
domIdConfirm() {
|
||||
return this.dialogShow ? OperationEvent.StationStand.setBackStrategy.menu.domId : '';
|
||||
},
|
||||
domIdChoose() {
|
||||
return this.dialogShow ? OperationEvent.StationStand.setBackStrategy.choose.domId : '';
|
||||
},
|
||||
title() {
|
||||
return this.$t('menu.setSwitchbackStrategy');
|
||||
}
|
||||
},
|
||||
mounted() {
|
||||
this.$nextTick(() => {
|
||||
this.$store.dispatch('training/tipReload');
|
||||
})
|
||||
},
|
||||
methods: {
|
||||
loadInitData(selected, opts) {
|
||||
this.tempData = [];
|
||||
let stationList = [...this.stationList];
|
||||
let station = this.stationList.find(n => n.code == selected.stationCode)
|
||||
this.tempData.push({ name: station.name, station: selected.name, strategy: opts.reentryStrategy });
|
||||
},
|
||||
doShow(operate, selected, opts) {
|
||||
if (!this.dialogShow) {
|
||||
this.standStatus = '';
|
||||
this.stationName = '';
|
||||
if (selected && selected._type.toUpperCase() === 'StationStand'.toUpperCase()) {
|
||||
this.standStatus = selected.direction;
|
||||
let station = this.$store.getters['map/getDeviceByCode'](selected.stationCode);
|
||||
if (station) {
|
||||
this.stationName = station.name;
|
||||
}
|
||||
}
|
||||
this.loadInitData(selected, opts);
|
||||
}
|
||||
export default {
|
||||
name: 'StandBackStrategy',
|
||||
components: {
|
||||
ConfirmControl,
|
||||
NoticeInfo
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
dialogShow: false,
|
||||
loading: false,
|
||||
tempData: [],
|
||||
strategyList: [
|
||||
{
|
||||
value: '01',
|
||||
label: this.$t('menu.noSwitchback')
|
||||
},
|
||||
{
|
||||
value: '02',
|
||||
label: this.$t('menu.noOneSwitchback')
|
||||
},
|
||||
{
|
||||
value: '03',
|
||||
label: this.$t('menu.automaticChange')
|
||||
},
|
||||
{
|
||||
value: '04',
|
||||
label: this.$t('menu.default')
|
||||
}
|
||||
],
|
||||
stationName: '',
|
||||
standStatus: '',
|
||||
selection: [],
|
||||
isSelect: true,
|
||||
isConfirm: false,
|
||||
strategy: ''
|
||||
};
|
||||
},
|
||||
computed: {
|
||||
...mapGetters('map', [
|
||||
'stationList'
|
||||
]),
|
||||
show() {
|
||||
return this.dialogShow && !this.$store.state.menuOperation.break;
|
||||
},
|
||||
domIdCancel() {
|
||||
return this.dialogShow ? OperationEvent.Command.cancel.menu.domId : '';
|
||||
},
|
||||
domIdConfirm() {
|
||||
return this.dialogShow ? OperationEvent.StationStand.setBackStrategy.menu.domId : '';
|
||||
},
|
||||
domIdChoose() {
|
||||
return this.dialogShow ? OperationEvent.StationStand.setBackStrategy.choose.domId : '';
|
||||
},
|
||||
title() {
|
||||
return this.$t('menu.setSwitchbackStrategy');
|
||||
}
|
||||
},
|
||||
mounted() {
|
||||
this.$nextTick(() => {
|
||||
this.$store.dispatch('training/tipReload');
|
||||
});
|
||||
},
|
||||
methods: {
|
||||
loadInitData(selected, opts) {
|
||||
this.tempData = [];
|
||||
const station = this.stationList.find(n => n.code == selected.stationCode);
|
||||
this.tempData.push({ name: station.name, station: selected.name, strategy: opts.reentryStrategy });
|
||||
},
|
||||
doShow(operate, selected, opts) {
|
||||
if (!this.dialogShow) {
|
||||
this.standStatus = '';
|
||||
this.stationName = '';
|
||||
if (selected && selected._type.toUpperCase() === 'StationStand'.toUpperCase()) {
|
||||
this.standStatus = selected.direction;
|
||||
const station = this.$store.getters['map/getDeviceByCode'](selected.stationCode);
|
||||
if (station) {
|
||||
this.stationName = station.name;
|
||||
}
|
||||
}
|
||||
this.loadInitData(selected, opts);
|
||||
}
|
||||
|
||||
this.dialogShow = true;
|
||||
this.$nextTick(function () {
|
||||
this.$store.dispatch('training/emitTipFresh');
|
||||
});
|
||||
},
|
||||
checkTableDataSelction(data) {
|
||||
let selection = [];
|
||||
if (data && data.length > 0) {
|
||||
data.forEach(row => {
|
||||
if (row.check && !row.disabled) {
|
||||
selection.push(row);
|
||||
}
|
||||
})
|
||||
}
|
||||
this.dialogShow = true;
|
||||
this.$nextTick(function () {
|
||||
this.$store.dispatch('training/emitTipFresh');
|
||||
});
|
||||
},
|
||||
checkTableDataSelction(data) {
|
||||
const selection = [];
|
||||
if (data && data.length > 0) {
|
||||
data.forEach(row => {
|
||||
if (row.check && !row.disabled) {
|
||||
selection.push(row);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
this.disabledSend = selection.length ? false : true;
|
||||
if (JSON.stringify(selection) !== JSON.stringify(this.selection)) {
|
||||
this.selection = selection;
|
||||
}
|
||||
},
|
||||
strategySelectChange(strategy) {
|
||||
let operate = {
|
||||
type: MapDeviceType.StationStand.type,
|
||||
operation: OperationEvent.StationStand.setBackStrategy.choose.operation,
|
||||
val: `${strategy}`,
|
||||
}
|
||||
this.disabledSend = !selection.length;
|
||||
if (JSON.stringify(selection) !== JSON.stringify(this.selection)) {
|
||||
this.selection = selection;
|
||||
}
|
||||
},
|
||||
strategySelectChange(strategy) {
|
||||
const operate = {
|
||||
type: MapDeviceType.StationStand.type,
|
||||
operation: OperationEvent.StationStand.setBackStrategy.choose.operation,
|
||||
val: `${strategy}`
|
||||
};
|
||||
|
||||
this.strategy = strategy;
|
||||
this.isSelect = false;
|
||||
this.isConfirm = true;
|
||||
this.$store.dispatch('training/next', operate).then(({ valid }) => {
|
||||
if (valid) {
|
||||
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
|
||||
}
|
||||
})
|
||||
},
|
||||
doClose() {
|
||||
this.loading = false;
|
||||
this.dialogShow = false;
|
||||
this.$store.dispatch('training/emitTipFresh');
|
||||
},
|
||||
commit() {
|
||||
if (this.isConfirm) {
|
||||
let operate = {
|
||||
send: true,
|
||||
type: MapDeviceType.StationStand.type,
|
||||
operation: OperationEvent.StationStand.setBackStrategy.menu.operation,
|
||||
val: `${this.strategy}`
|
||||
}
|
||||
this.strategy = strategy;
|
||||
this.isSelect = false;
|
||||
this.isConfirm = true;
|
||||
this.$store.dispatch('training/next', operate).then(({ valid }) => {
|
||||
if (valid) {
|
||||
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
|
||||
}
|
||||
});
|
||||
},
|
||||
doClose() {
|
||||
this.loading = false;
|
||||
this.dialogShow = false;
|
||||
this.$store.dispatch('training/emitTipFresh');
|
||||
},
|
||||
commit() {
|
||||
if (this.isConfirm) {
|
||||
const operate = {
|
||||
send: true,
|
||||
type: MapDeviceType.StationStand.type,
|
||||
operation: OperationEvent.StationStand.setBackStrategy.menu.operation,
|
||||
val: `${this.strategy}`
|
||||
};
|
||||
|
||||
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);
|
||||
})
|
||||
} else {
|
||||
this.doClose();
|
||||
}
|
||||
},
|
||||
cancel() {
|
||||
let operate = {
|
||||
type: MapDeviceType.StationStand.type,
|
||||
operation: OperationEvent.Command.cancel.menu.operation,
|
||||
}
|
||||
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);
|
||||
});
|
||||
} else {
|
||||
this.doClose();
|
||||
}
|
||||
},
|
||||
cancel() {
|
||||
const operate = {
|
||||
type: MapDeviceType.StationStand.type,
|
||||
operation: OperationEvent.Command.cancel.menu.operation
|
||||
};
|
||||
|
||||
this.$store.dispatch('training/next', operate).then(({ valid }) => {
|
||||
if (valid) {
|
||||
this.doClose();
|
||||
}
|
||||
}).catch(error => {
|
||||
this.doClose();
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
this.$store.dispatch('training/next', operate).then(({ valid }) => {
|
||||
if (valid) {
|
||||
this.doClose();
|
||||
}
|
||||
}).catch(() => {
|
||||
this.doClose();
|
||||
});
|
||||
}
|
||||
}
|
||||
};
|
||||
</script>
|
||||
|
@ -1,257 +1,267 @@
|
||||
<template>
|
||||
<el-dialog class="fuzhou-01__systerm stand-detain-train" :title="title" :visible.sync="show" width="320px"
|
||||
:before-close="doClose" :zIndex="2000" :modal="false" :close-on-click-modal="false" v-dialogDrag>
|
||||
<div class="context">
|
||||
<span>{{preContext}}{{standName}}</span>
|
||||
</div>
|
||||
<el-row class="button-group">
|
||||
<el-col :span="10" :offset="2">
|
||||
<el-button :id="domIdConfirm" type="primary" :loading="loading" @click="commit">{{$t('global.confirm')}}</el-button>
|
||||
</el-col>
|
||||
<el-col :span="8" :offset="4">
|
||||
<el-button :id="domIdCancel" @click="cancel">{{$t('global.cancel')}}</el-button>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<notice-info ref="noticeInfo"></notice-info>
|
||||
</el-dialog>
|
||||
<el-dialog
|
||||
v-dialogDrag
|
||||
class="fuzhou-01__systerm stand-detain-train"
|
||||
:title="title"
|
||||
:visible.sync="show"
|
||||
width="320px"
|
||||
:before-close="doClose"
|
||||
:z-index="2000"
|
||||
:modal="false"
|
||||
:close-on-click-modal="false"
|
||||
>
|
||||
<div class="context">
|
||||
<span>{{ preContext }}{{ standName }}</span>
|
||||
</div>
|
||||
<el-row class="button-group">
|
||||
<el-col :span="10" :offset="2">
|
||||
<el-button :id="domIdConfirm" type="primary" :loading="loading" @click="commit">{{ $t('global.confirm') }}</el-button>
|
||||
</el-col>
|
||||
<el-col :span="8" :offset="4">
|
||||
<el-button :id="domIdCancel" @click="cancel">{{ $t('global.cancel') }}</el-button>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<notice-info ref="noticeInfo" />
|
||||
</el-dialog>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import { MapDeviceType, OperationEvent, getDomIdByOperation } from '@/scripts/ConstDic';
|
||||
import NoticeInfo from './childDialog/childDialog/noticeInfo'
|
||||
import { MapDeviceType, OperationEvent, getDomIdByOperation } from '@/scripts/ConstDic';
|
||||
import NoticeInfo from './childDialog/childDialog/noticeInfo';
|
||||
|
||||
export default {
|
||||
name: 'StandDetainTrain',
|
||||
components: {
|
||||
NoticeInfo
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
dialogShow: false,
|
||||
loading: false,
|
||||
standName: '',
|
||||
selected: null,
|
||||
operation: null
|
||||
}
|
||||
},
|
||||
computed: {
|
||||
show() {
|
||||
return this.dialogShow && !this.$store.state.menuOperation.break;
|
||||
},
|
||||
domIdCancel() {
|
||||
return this.dialogShow ? OperationEvent.Command.cancel.menu.domId : '';
|
||||
},
|
||||
domIdConfirm() {
|
||||
return this.dialogShow ? getDomIdByOperation(this.operation) : '';
|
||||
},
|
||||
title() {
|
||||
if (this.operation == OperationEvent.StationStand.setDetainTrain.menu.operation) {
|
||||
return this.$t('menu.menuStationStand.detainTrain');
|
||||
} else if (this.operation == OperationEvent.StationStand.cancelDetainTrain.menu.operation) {
|
||||
return this.$t('menu.menuStationStand.cancelDetainTrain');
|
||||
} else if (this.operation == OperationEvent.StationStand.cancelDetainTrainForce.menu.operation) {
|
||||
return this.$t('menu.menuStationStand.cancelDetainTrainForce');
|
||||
} else if (this.operation == OperationEvent.StationStand.earlyDeparture.menu.operation) {
|
||||
return this.$t('menu.menuStationStand.earlyDeparture');
|
||||
} else if (this.operation == OperationEvent.StationStand.setJumpStop.menu.operation) {
|
||||
return this.$t('menu.menuStationStand.setJumpStop');
|
||||
} else if (this.operation == OperationEvent.StationStand.cancelJumpStop.menu.operation) {
|
||||
return this.$t('menu.menuStationStand.cancelJumpStop');
|
||||
}
|
||||
},
|
||||
preContext() {
|
||||
return this.title + ':';
|
||||
}
|
||||
},
|
||||
mounted() {
|
||||
this.$nextTick(() => {
|
||||
this.$store.dispatch('training/tipReload');
|
||||
})
|
||||
},
|
||||
methods: {
|
||||
doShow(operate, selected) {
|
||||
if (!this.dialogShow) {
|
||||
this.standName = '';
|
||||
if (selected) {
|
||||
this.standName = selected.name;
|
||||
}
|
||||
export default {
|
||||
name: 'StandDetainTrain',
|
||||
components: {
|
||||
NoticeInfo
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
dialogShow: false,
|
||||
loading: false,
|
||||
standName: '',
|
||||
selected: null,
|
||||
operation: null
|
||||
};
|
||||
},
|
||||
computed: {
|
||||
show() {
|
||||
return this.dialogShow && !this.$store.state.menuOperation.break;
|
||||
},
|
||||
domIdCancel() {
|
||||
return this.dialogShow ? OperationEvent.Command.cancel.menu.domId : '';
|
||||
},
|
||||
domIdConfirm() {
|
||||
return this.dialogShow ? getDomIdByOperation(this.operation) : '';
|
||||
},
|
||||
title() {
|
||||
if (this.operation == OperationEvent.StationStand.setDetainTrain.menu.operation) {
|
||||
return this.$t('menu.menuStationStand.detainTrain');
|
||||
} else if (this.operation == OperationEvent.StationStand.cancelDetainTrain.menu.operation) {
|
||||
return this.$t('menu.menuStationStand.cancelDetainTrain');
|
||||
} else if (this.operation == OperationEvent.StationStand.cancelDetainTrainForce.menu.operation) {
|
||||
return this.$t('menu.menuStationStand.cancelDetainTrainForce');
|
||||
} else if (this.operation == OperationEvent.StationStand.earlyDeparture.menu.operation) {
|
||||
return this.$t('menu.menuStationStand.earlyDeparture');
|
||||
} else if (this.operation == OperationEvent.StationStand.setJumpStop.menu.operation) {
|
||||
return this.$t('menu.menuStationStand.setJumpStop');
|
||||
} else if (this.operation == OperationEvent.StationStand.cancelJumpStop.menu.operation) {
|
||||
return this.$t('menu.menuStationStand.cancelJumpStop');
|
||||
}
|
||||
return '';
|
||||
},
|
||||
preContext() {
|
||||
return this.title + ':';
|
||||
}
|
||||
},
|
||||
mounted() {
|
||||
this.$nextTick(() => {
|
||||
this.$store.dispatch('training/tipReload');
|
||||
});
|
||||
},
|
||||
methods: {
|
||||
doShow(operate, selected) {
|
||||
if (!this.dialogShow) {
|
||||
this.standName = '';
|
||||
if (selected) {
|
||||
this.standName = selected.name;
|
||||
}
|
||||
|
||||
this.selected = selected;
|
||||
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('training/emitTipFresh');
|
||||
},
|
||||
commit() {
|
||||
if (this.operation == OperationEvent.StationStand.setDetainTrain.menu.operation) {
|
||||
/** 设置扣车*/
|
||||
this.setDetainTrain();
|
||||
} else if (this.operation == OperationEvent.StationStand.cancelDetainTrain.menu.operation) {
|
||||
/** 取消扣车*/
|
||||
this.cancelDetainTrain();
|
||||
} else if (this.operation == OperationEvent.StationStand.cancelDetainTrainForce.menu.operation) {
|
||||
/** 强制取消扣车*/
|
||||
this.cancelDetainTrainForce();
|
||||
} else if (this.operation == OperationEvent.StationStand.earlyDeparture.menu.operation) {
|
||||
/** 提前发车*/
|
||||
this.earlyDeparture();
|
||||
} else if (this.operation == OperationEvent.StationStand.setJumpStop.menu.operation) {
|
||||
/** 设置跳停*/
|
||||
this.setJumpStop();
|
||||
} else if (this.operation == OperationEvent.StationStand.cancelJumpStop.menu.operation) {
|
||||
/** 取消跳停*/
|
||||
this.cancelJumpStop();
|
||||
}
|
||||
},
|
||||
//设置扣车
|
||||
setDetainTrain() {
|
||||
let operate = {
|
||||
send: true,
|
||||
type: MapDeviceType.StationStand.type,
|
||||
operation: OperationEvent.StationStand.setDetainTrain.menu.operation,
|
||||
}
|
||||
this.selected = selected;
|
||||
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('training/emitTipFresh');
|
||||
},
|
||||
commit() {
|
||||
if (this.operation == OperationEvent.StationStand.setDetainTrain.menu.operation) {
|
||||
/** 设置扣车*/
|
||||
this.setDetainTrain();
|
||||
} else if (this.operation == OperationEvent.StationStand.cancelDetainTrain.menu.operation) {
|
||||
/** 取消扣车*/
|
||||
this.cancelDetainTrain();
|
||||
} else if (this.operation == OperationEvent.StationStand.cancelDetainTrainForce.menu.operation) {
|
||||
/** 强制取消扣车*/
|
||||
this.cancelDetainTrainForce();
|
||||
} else if (this.operation == OperationEvent.StationStand.earlyDeparture.menu.operation) {
|
||||
/** 提前发车*/
|
||||
this.earlyDeparture();
|
||||
} else if (this.operation == OperationEvent.StationStand.setJumpStop.menu.operation) {
|
||||
/** 设置跳停*/
|
||||
this.setJumpStop();
|
||||
} else if (this.operation == OperationEvent.StationStand.cancelJumpStop.menu.operation) {
|
||||
/** 取消跳停*/
|
||||
this.cancelJumpStop();
|
||||
}
|
||||
},
|
||||
// 设置扣车
|
||||
setDetainTrain() {
|
||||
const operate = {
|
||||
send: true,
|
||||
type: MapDeviceType.StationStand.type,
|
||||
operation: OperationEvent.StationStand.setDetainTrain.menu.operation
|
||||
};
|
||||
|
||||
this.loading = true;
|
||||
this.$store.dispatch('training/next', operate).then(({ valid }) => {
|
||||
this.loading = false;
|
||||
this.doClose();
|
||||
if (!valid) {
|
||||
this.$refs.noticeInfo.doShow(operate);
|
||||
}
|
||||
}).catch(error => {
|
||||
this.loading = false;
|
||||
this.doClose();
|
||||
this.$refs.noticeInfo.doShow(operate);
|
||||
})
|
||||
},
|
||||
//取消扣车
|
||||
cancelDetainTrain() {
|
||||
let operate = {
|
||||
send: true,
|
||||
type: MapDeviceType.StationStand.type,
|
||||
operation: OperationEvent.StationStand.cancelDetainTrain.menu.operation,
|
||||
}
|
||||
this.loading = true;
|
||||
this.$store.dispatch('training/next', operate).then(({ valid }) => {
|
||||
this.loading = false;
|
||||
this.doClose();
|
||||
if (!valid) {
|
||||
this.$refs.noticeInfo.doShow(operate);
|
||||
}
|
||||
}).catch(() => {
|
||||
this.loading = false;
|
||||
this.doClose();
|
||||
this.$refs.noticeInfo.doShow(operate);
|
||||
});
|
||||
},
|
||||
// 取消扣车
|
||||
cancelDetainTrain() {
|
||||
const operate = {
|
||||
send: true,
|
||||
type: MapDeviceType.StationStand.type,
|
||||
operation: OperationEvent.StationStand.cancelDetainTrain.menu.operation
|
||||
};
|
||||
|
||||
this.loading = true;
|
||||
this.$store.dispatch('training/next', operate).then(({ valid }) => {
|
||||
this.loading = false;
|
||||
this.doClose();
|
||||
if (!valid) {
|
||||
this.$refs.noticeInfo.doShow(operate);
|
||||
}
|
||||
}).catch(error => {
|
||||
this.loading = false;
|
||||
this.doClose();
|
||||
this.$refs.noticeInfo.doShow(operate);
|
||||
})
|
||||
},
|
||||
//强制取消扣车
|
||||
cancelDetainTrainForce() {
|
||||
let operate = {
|
||||
send: true,
|
||||
type: MapDeviceType.StationStand.type,
|
||||
operation: OperationEvent.StationStand.cancelDetainTrainForce.menu.operation,
|
||||
}
|
||||
this.loading = true;
|
||||
this.$store.dispatch('training/next', operate).then(({ valid }) => {
|
||||
this.loading = false;
|
||||
this.doClose();
|
||||
if (!valid) {
|
||||
this.$refs.noticeInfo.doShow(operate);
|
||||
}
|
||||
}).catch(() => {
|
||||
this.loading = false;
|
||||
this.doClose();
|
||||
this.$refs.noticeInfo.doShow(operate);
|
||||
});
|
||||
},
|
||||
// 强制取消扣车
|
||||
cancelDetainTrainForce() {
|
||||
const operate = {
|
||||
send: true,
|
||||
type: MapDeviceType.StationStand.type,
|
||||
operation: OperationEvent.StationStand.cancelDetainTrainForce.menu.operation
|
||||
};
|
||||
|
||||
this.loading = true;
|
||||
this.$store.dispatch('training/next', operate).then(({ valid }) => {
|
||||
this.loading = false;
|
||||
this.doClose();
|
||||
if (!valid) {
|
||||
this.$refs.noticeInfo.doShow(operate);
|
||||
}
|
||||
}).catch(error => {
|
||||
this.loading = false;
|
||||
this.doClose();
|
||||
this.$refs.noticeInfo.doShow(operate);
|
||||
})
|
||||
},
|
||||
//提前发车
|
||||
earlyDeparture() {
|
||||
let operate = {
|
||||
send: true,
|
||||
type: MapDeviceType.StationStand.type,
|
||||
operation: OperationEvent.StationStand.earlyDeparture.menu.operation,
|
||||
}
|
||||
this.loading = true;
|
||||
this.$store.dispatch('training/next', operate).then(({ valid }) => {
|
||||
this.loading = false;
|
||||
this.doClose();
|
||||
if (!valid) {
|
||||
this.$refs.noticeInfo.doShow(operate);
|
||||
}
|
||||
}).catch(() => {
|
||||
this.loading = false;
|
||||
this.doClose();
|
||||
this.$refs.noticeInfo.doShow(operate);
|
||||
});
|
||||
},
|
||||
// 提前发车
|
||||
earlyDeparture() {
|
||||
const operate = {
|
||||
send: true,
|
||||
type: MapDeviceType.StationStand.type,
|
||||
operation: OperationEvent.StationStand.earlyDeparture.menu.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);
|
||||
})
|
||||
},
|
||||
//设置跳停
|
||||
setJumpStop() {
|
||||
let operate = {
|
||||
send: true,
|
||||
type: MapDeviceType.StationStand.type,
|
||||
operation: OperationEvent.StationStand.setJumpStop.menu.operation,
|
||||
val: this.selected.direction //站台的上下行方向, 01:下行 /02:上行
|
||||
}
|
||||
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);
|
||||
});
|
||||
},
|
||||
// 设置跳停
|
||||
setJumpStop() {
|
||||
const operate = {
|
||||
send: true,
|
||||
type: MapDeviceType.StationStand.type,
|
||||
operation: OperationEvent.StationStand.setJumpStop.menu.operation,
|
||||
val: this.selected.direction // 站台的上下行方向, 01:下行 /02:上行
|
||||
};
|
||||
|
||||
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);
|
||||
})
|
||||
},
|
||||
//取消跳停
|
||||
cancelJumpStop() {
|
||||
let operate = {
|
||||
send: true,
|
||||
type: MapDeviceType.StationStand.type,
|
||||
operation: OperationEvent.StationStand.cancelJumpStop.menu.operation,
|
||||
val: this.selected.direction //站台的上下行方向, 01:下行 /02:上行
|
||||
}
|
||||
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);
|
||||
});
|
||||
},
|
||||
// 取消跳停
|
||||
cancelJumpStop() {
|
||||
const operate = {
|
||||
send: true,
|
||||
type: MapDeviceType.StationStand.type,
|
||||
operation: OperationEvent.StationStand.cancelJumpStop.menu.operation,
|
||||
val: this.selected.direction // 站台的上下行方向, 01:下行 /02:上行
|
||||
};
|
||||
|
||||
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: MapDeviceType.StationStand.type,
|
||||
operation: OperationEvent.Command.cancel.menu.operation,
|
||||
}
|
||||
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.StationStand.type,
|
||||
operation: OperationEvent.Command.cancel.menu.operation
|
||||
};
|
||||
|
||||
this.loading = false;
|
||||
this.$store.dispatch('training/next', operate).then(({ valid }) => {
|
||||
if (valid) {
|
||||
this.doClose();
|
||||
}
|
||||
}).catch(error => {
|
||||
this.doClose();
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
this.loading = false;
|
||||
this.$store.dispatch('training/next', operate).then(({ valid }) => {
|
||||
if (valid) {
|
||||
this.doClose();
|
||||
}
|
||||
}).catch(() => {
|
||||
this.doClose();
|
||||
});
|
||||
}
|
||||
}
|
||||
};
|
||||
</script>
|
||||
<style>
|
||||
.stand-detain-train .context {
|
||||
|
@ -1,173 +1,179 @@
|
||||
<template>
|
||||
<el-dialog class="fuzhou-01__systerm stand-detail" :title="title" :visible.sync="show" width="400px"
|
||||
:before-close="doClose" :zIndex="2000" :modal="false" :close-on-click-modal="false" v-dialogDrag>
|
||||
<el-row class="header">
|
||||
<el-col :span="10"><span>{{$t('menu.stationName')}}</span></el-col>
|
||||
<el-col :span="10" :offset="2"><span>{{$t('menu.platform')}}</span></el-col>
|
||||
</el-row>
|
||||
<el-row>
|
||||
<el-col :span="10">
|
||||
<el-input v-model="stationName" size="small" disabled></el-input>
|
||||
</el-col>
|
||||
<el-col :span="10" :offset="2">
|
||||
<el-input v-model="standName" size="small" disabled></el-input>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<div class="table">
|
||||
<span>{{$t('menu.stationStandStatus')}}</span>
|
||||
<el-table ref="tempData" :data="tempData" border style="width: 100%" size="mini" highlight-current-row>
|
||||
<el-table-column prop="item" :width="140" :label="this.$t('menu.item')">
|
||||
</el-table-column>
|
||||
<el-table-column prop="status" :label="this.$t('global.status')">
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
</div>
|
||||
<el-row justify="center" class="button-group">
|
||||
<el-col :span="10" :offset="2">
|
||||
<el-button :id="domIdConfirm" type="primary" :loading="loading" @click="commit">{{$t('global.confirm')}}</el-button>
|
||||
</el-col>
|
||||
<el-col :span="8" :offset="4">
|
||||
<el-button :id="domIdCancel" @click="cancel">{{$t('global.cancel')}}</el-button>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<notice-info ref="noticeInfo"></notice-info>
|
||||
</el-dialog>
|
||||
<el-dialog
|
||||
v-dialogDrag
|
||||
class="fuzhou-01__systerm stand-detail"
|
||||
:title="title"
|
||||
:visible.sync="show"
|
||||
width="400px"
|
||||
:before-close="doClose"
|
||||
:z-index="2000"
|
||||
:modal="false"
|
||||
:close-on-click-modal="false"
|
||||
>
|
||||
<el-row class="header">
|
||||
<el-col :span="10"><span>{{ $t('menu.stationName') }}</span></el-col>
|
||||
<el-col :span="10" :offset="2"><span>{{ $t('menu.platform') }}</span></el-col>
|
||||
</el-row>
|
||||
<el-row>
|
||||
<el-col :span="10">
|
||||
<el-input v-model="stationName" size="small" disabled />
|
||||
</el-col>
|
||||
<el-col :span="10" :offset="2">
|
||||
<el-input v-model="standName" size="small" disabled />
|
||||
</el-col>
|
||||
</el-row>
|
||||
<div class="table">
|
||||
<span>{{ $t('menu.stationStandStatus') }}</span>
|
||||
<el-table ref="tempData" :data="tempData" border style="width: 100%" size="mini" highlight-current-row>
|
||||
<el-table-column prop="item" :width="140" :label="this.$t('menu.item')" />
|
||||
<el-table-column prop="status" :label="this.$t('global.status')" />
|
||||
</el-table>
|
||||
</div>
|
||||
<el-row justify="center" class="button-group">
|
||||
<el-col :span="10" :offset="2">
|
||||
<el-button :id="domIdConfirm" type="primary" :loading="loading" @click="commit">{{ $t('global.confirm') }}</el-button>
|
||||
</el-col>
|
||||
<el-col :span="8" :offset="4">
|
||||
<el-button :id="domIdCancel" @click="cancel">{{ $t('global.cancel') }}</el-button>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<notice-info ref="noticeInfo" />
|
||||
</el-dialog>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import { MapDeviceType, OperationEvent } from '@/scripts/ConstDic';
|
||||
import NoticeInfo from './childDialog/childDialog/noticeInfo';
|
||||
import { mapGetters } from 'vuex';
|
||||
import { MapDeviceType, OperationEvent } from '@/scripts/ConstDic';
|
||||
import NoticeInfo from './childDialog/childDialog/noticeInfo';
|
||||
import { mapGetters } from 'vuex';
|
||||
|
||||
export default {
|
||||
name: 'StandDetail',
|
||||
components: {
|
||||
NoticeInfo
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
dialogShow: false,
|
||||
loading: false,
|
||||
tempData: [],
|
||||
stationName: '',
|
||||
standName: '',
|
||||
strategyMap: {
|
||||
'01': this.$t('menu.noSwitchback'),
|
||||
'02': this.$t('menu.noOneSwitchback'),
|
||||
'03': this.$t('menu.automaticChange'),
|
||||
'04': this.$t('menu.default')
|
||||
}
|
||||
}
|
||||
},
|
||||
computed: {
|
||||
...mapGetters('map', [
|
||||
'stationList',
|
||||
]),
|
||||
show() {
|
||||
return this.dialogShow && !this.$store.state.menuOperation.break;
|
||||
},
|
||||
domIdCancel() {
|
||||
return this.dialogShow ? OperationEvent.Command.cancel.menu.domId : '';
|
||||
},
|
||||
domIdConfirm() {
|
||||
return this.dialogShow ? OperationEvent.Command.close.confirm.domId : '';
|
||||
},
|
||||
title() {
|
||||
return this.$t('menu.menuStationStand.getStationStandStatus');
|
||||
}
|
||||
},
|
||||
mounted() {
|
||||
this.$nextTick(() => {
|
||||
this.$store.dispatch('training/tipReload');
|
||||
})
|
||||
},
|
||||
methods: {
|
||||
loadInitData(selected, opts) {
|
||||
this.tempData = [];
|
||||
export default {
|
||||
name: 'StandDetail',
|
||||
components: {
|
||||
NoticeInfo
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
dialogShow: false,
|
||||
loading: false,
|
||||
tempData: [],
|
||||
stationName: '',
|
||||
standName: '',
|
||||
strategyMap: {
|
||||
'01': this.$t('menu.noSwitchback'),
|
||||
'02': this.$t('menu.noOneSwitchback'),
|
||||
'03': this.$t('menu.automaticChange'),
|
||||
'04': this.$t('menu.default')
|
||||
}
|
||||
};
|
||||
},
|
||||
computed: {
|
||||
...mapGetters('map', [
|
||||
'stationList'
|
||||
]),
|
||||
show() {
|
||||
return this.dialogShow && !this.$store.state.menuOperation.break;
|
||||
},
|
||||
domIdCancel() {
|
||||
return this.dialogShow ? OperationEvent.Command.cancel.menu.domId : '';
|
||||
},
|
||||
domIdConfirm() {
|
||||
return this.dialogShow ? OperationEvent.Command.close.confirm.domId : '';
|
||||
},
|
||||
title() {
|
||||
return this.$t('menu.menuStationStand.getStationStandStatus');
|
||||
}
|
||||
},
|
||||
mounted() {
|
||||
this.$nextTick(() => {
|
||||
this.$store.dispatch('training/tipReload');
|
||||
});
|
||||
},
|
||||
methods: {
|
||||
loadInitData(selected, opts) {
|
||||
this.tempData = [];
|
||||
|
||||
let stationList = this.stationList.slice();
|
||||
let index = this.stationList.findIndex(n => n.code == selected.stationCode);
|
||||
let stationStand, station;
|
||||
if (selected.direction == '01') { // 下行
|
||||
//下行时,此站不是最后一站
|
||||
if (index != 0) {
|
||||
stationStand = this.$store.getters['map/getDeviceByCode'](this.stationList[index - 1].code);
|
||||
station = this.$store.getters['map/getDeviceByCode'](stationStand.stationCode);
|
||||
}
|
||||
} else {
|
||||
//上行时,此站不是最后一站
|
||||
if (index != this.stationList.length - 1) {
|
||||
stationStand = this.$store.getters['map/getDeviceByCode'](this.stationList[index + 1].code);
|
||||
station = this.$store.getters['map/getDeviceByCode'](stationStand.stationCode);
|
||||
}
|
||||
}
|
||||
const index = this.stationList.findIndex(n => n.code == selected.stationCode);
|
||||
let stationStand, station;
|
||||
if (selected.direction == '01') { // 下行
|
||||
// 下行时,此站不是最后一站
|
||||
if (index != 0) {
|
||||
stationStand = this.$store.getters['map/getDeviceByCode'](this.stationList[index - 1].code);
|
||||
station = this.$store.getters['map/getDeviceByCode'](stationStand.stationCode);
|
||||
}
|
||||
} else {
|
||||
// 上行时,此站不是最后一站
|
||||
if (index != this.stationList.length - 1) {
|
||||
stationStand = this.$store.getters['map/getDeviceByCode'](this.stationList[index + 1].code);
|
||||
station = this.$store.getters['map/getDeviceByCode'](stationStand.stationCode);
|
||||
}
|
||||
}
|
||||
|
||||
/** 01: 未设置扣车 02: 车站扣车 03: 中心扣车 04: 中心+车站扣车*/
|
||||
this.tempData.push({ item: this.$t('menu.stationDetainTrain'), status: opts.holdStatus == '02' || opts.holdStatus == '04' ? this.$t('menu.hasBeenSet') : this.$t('menu.notSet') });
|
||||
this.tempData.push({ item: this.$t('menu.centerDetainTrain'), status: opts.holdStatus == '03' || opts.holdStatus == '04' ? this.$t('menu.hasBeenSet') : this.$t('menu.notSet') });
|
||||
this.tempData.push({ item: this.$t('menu.stopTime'), status: opts.parkingTime != -1 ? opts.parkingTime : this.$t('menu.automatic2') });
|
||||
if (!stationStand || !station) {
|
||||
this.tempData.push({ item: this.$t('menu.runLevel'), status: this.$t('menu.automatic2') });
|
||||
} else {
|
||||
this.tempData.push({ item: this.$t('menu.runLevel'), status: opts.intervalRunTime > 0 ? this.$t('menu.to')+station.name+stationStand.name+ this.$t('global.colon') + this.$t('menu.artificial') : this.$t('menu.to')+station.name+stationStand.name+ this.$t('menu.automatic2') });
|
||||
}
|
||||
this.tempData.push({ item: this.$t('menu.jumpStop'), status: opts.jumpStopStatus != '01' ? this.$t('menu.hasBeenSet') : this.$t('menu.notSet') });
|
||||
this.tempData.push({ item: this.$t('menu.downSwitchbackStrategy'), status: this.strategyMap[opts.reentryStrategy] ? this.strategyMap[opts.reentryStrategy] : this.$t('menu.default') });
|
||||
},
|
||||
doShow(operate, selected, opts) {
|
||||
if (!this.dialogShow) {
|
||||
this.standName = '';
|
||||
this.stationName = '';
|
||||
if (selected && selected._type.toUpperCase() === 'StationStand'.toUpperCase()) {
|
||||
this.standName = selected.name;
|
||||
let station = this.$store.getters['map/getDeviceByCode'](selected.stationCode);
|
||||
if (station) {
|
||||
this.stationName = station.name;
|
||||
}
|
||||
}
|
||||
this.loadInitData(selected, opts);
|
||||
}
|
||||
this.dialogShow = true;
|
||||
this.$nextTick(function () {
|
||||
this.$store.dispatch('training/emitTipFresh');
|
||||
});
|
||||
},
|
||||
doClose() {
|
||||
this.loading = false;
|
||||
this.dialogShow = false;
|
||||
this.$store.dispatch('training/emitTipFresh');
|
||||
},
|
||||
commit() {
|
||||
let operate = {
|
||||
type: MapDeviceType.StationStand.type,
|
||||
operation: OperationEvent.Command.close.confirm.operation,
|
||||
}
|
||||
/** 01: 未设置扣车 02: 车站扣车 03: 中心扣车 04: 中心+车站扣车*/
|
||||
this.tempData.push({ item: this.$t('menu.stationDetainTrain'), status: opts.holdStatus == '02' || opts.holdStatus == '04' ? this.$t('menu.hasBeenSet') : this.$t('menu.notSet') });
|
||||
this.tempData.push({ item: this.$t('menu.centerDetainTrain'), status: opts.holdStatus == '03' || opts.holdStatus == '04' ? this.$t('menu.hasBeenSet') : this.$t('menu.notSet') });
|
||||
this.tempData.push({ item: this.$t('menu.stopTime'), status: opts.parkingTime != -1 ? opts.parkingTime : this.$t('menu.automatic2') });
|
||||
if (!stationStand || !station) {
|
||||
this.tempData.push({ item: this.$t('menu.runLevel'), status: this.$t('menu.automatic2') });
|
||||
} else {
|
||||
this.tempData.push({ item: this.$t('menu.runLevel'), status: opts.intervalRunTime > 0 ? this.$t('menu.to')+station.name+stationStand.name+ this.$t('global.colon') + this.$t('menu.artificial') : this.$t('menu.to')+station.name+stationStand.name+ this.$t('menu.automatic2') });
|
||||
}
|
||||
this.tempData.push({ item: this.$t('menu.jumpStop'), status: opts.jumpStopStatus != '01' ? this.$t('menu.hasBeenSet') : this.$t('menu.notSet') });
|
||||
this.tempData.push({ item: this.$t('menu.downSwitchbackStrategy'), status: this.strategyMap[opts.reentryStrategy] ? this.strategyMap[opts.reentryStrategy] : this.$t('menu.default') });
|
||||
},
|
||||
doShow(operate, selected, opts) {
|
||||
if (!this.dialogShow) {
|
||||
this.standName = '';
|
||||
this.stationName = '';
|
||||
if (selected && selected._type.toUpperCase() === 'StationStand'.toUpperCase()) {
|
||||
this.standName = selected.name;
|
||||
const station = this.$store.getters['map/getDeviceByCode'](selected.stationCode);
|
||||
if (station) {
|
||||
this.stationName = station.name;
|
||||
}
|
||||
}
|
||||
this.loadInitData(selected, opts);
|
||||
}
|
||||
this.dialogShow = true;
|
||||
this.$nextTick(function () {
|
||||
this.$store.dispatch('training/emitTipFresh');
|
||||
});
|
||||
},
|
||||
doClose() {
|
||||
this.loading = false;
|
||||
this.dialogShow = false;
|
||||
this.$store.dispatch('training/emitTipFresh');
|
||||
},
|
||||
commit() {
|
||||
const operate = {
|
||||
type: MapDeviceType.StationStand.type,
|
||||
operation: OperationEvent.Command.close.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();
|
||||
})
|
||||
},
|
||||
cancel() {
|
||||
let operate = {
|
||||
type: MapDeviceType.StationStand.type,
|
||||
operation: OperationEvent.Command.cancel.menu.operation,
|
||||
}
|
||||
this.loading = true;
|
||||
this.$store.dispatch('training/next', operate).then(({ valid }) => {
|
||||
this.loading = false;
|
||||
if (valid) {
|
||||
this.doClose();
|
||||
}
|
||||
}).catch(() => {
|
||||
this.loading = false;
|
||||
this.doClose();
|
||||
});
|
||||
},
|
||||
cancel() {
|
||||
const operate = {
|
||||
type: MapDeviceType.StationStand.type,
|
||||
operation: OperationEvent.Command.cancel.menu.operation
|
||||
};
|
||||
|
||||
this.$store.dispatch('training/next', operate).then(({ valid }) => {
|
||||
if (valid) {
|
||||
this.doClose();
|
||||
}
|
||||
}).catch(error => {
|
||||
this.doClose();
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
this.$store.dispatch('training/next', operate).then(({ valid }) => {
|
||||
if (valid) {
|
||||
this.doClose();
|
||||
}
|
||||
}).catch(() => {
|
||||
this.doClose();
|
||||
});
|
||||
}
|
||||
}
|
||||
};
|
||||
</script>
|
||||
|
@ -11,21 +11,21 @@
|
||||
:close-on-click-modal="false"
|
||||
>
|
||||
<el-radio-group style="padding: 10px 20px; border: 1px double lightgray;width:100%;">
|
||||
<span class="base-label" style="font-size:14px;">{{$t('menu.range')}}</span>
|
||||
<span class="base-label" style="font-size:14px;">{{ $t('menu.range') }}</span>
|
||||
<el-row>
|
||||
<el-radio-group v-model="upDown" @change="choose" style="width:100%;">
|
||||
<el-radio-group v-model="upDown" style="width:100%;" @change="choose">
|
||||
<el-col :span="11">
|
||||
<el-radio :id="upDown == '01' ? domIdChoose : ''" label="02">{{$t('menu.uplinkBroadly')}}</el-radio>
|
||||
<el-radio :id="upDown == '01' ? domIdChoose : ''" label="02">{{ $t('menu.uplinkBroadly') }}</el-radio>
|
||||
</el-col>
|
||||
<el-col :span="11" :offset="1">
|
||||
<el-radio :id="upDown == '02' ? domIdChoose : ''" label="01">{{$t('menu.downlinkBroadly')}}</el-radio>
|
||||
<el-radio :id="upDown == '02' ? domIdChoose : ''" label="01">{{ $t('menu.downlinkBroadly') }}</el-radio>
|
||||
</el-col>
|
||||
</el-radio-group>
|
||||
</el-row>
|
||||
</el-radio-group>
|
||||
|
||||
<div class="table">
|
||||
<span>{{$t('menu.detainTrainStationList')}}</span>
|
||||
<span>{{ $t('menu.detainTrainStationList') }}</span>
|
||||
<el-table
|
||||
ref="tempData"
|
||||
:data="tempData"
|
||||
@ -42,11 +42,11 @@
|
||||
</div>
|
||||
<el-row justify="center" class="button-group">
|
||||
<el-col :span="10" :offset="2">
|
||||
<el-button :id="domIdConfirm" type="primary" :loading="loading" :disabled="disabled" @click="commit">{{$t('global.confirm')}}
|
||||
<el-button :id="domIdConfirm" type="primary" :loading="loading" :disabled="disabled" @click="commit">{{ $t('global.confirm') }}
|
||||
</el-button>
|
||||
</el-col>
|
||||
<el-col :span="8" :offset="4">
|
||||
<el-button :id="domIdCancel" @click="cancel">{{$t('global.cancel')}}</el-button>
|
||||
<el-button :id="domIdCancel" @click="cancel">{{ $t('global.cancel') }}</el-button>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<notice-info ref="noticeInfo" />
|
||||
|
@ -1,260 +1,269 @@
|
||||
<template>
|
||||
<el-dialog class="fuzhou-01__systerm stand-run-level" :title="title" :visible.sync="show" width="500px"
|
||||
:before-close="doClose" :zIndex="2000" :modal="false" :close-on-click-modal="false" v-dialogDrag>
|
||||
<el-row class="header">
|
||||
<el-col :span="10"><span>{{$t('menu.stationName')}}</span></el-col>
|
||||
<el-col :span="10" :offset="2"><span>{{$t('menu.platform')}}</span></el-col>
|
||||
</el-row>
|
||||
<el-row>
|
||||
<el-col :span="10">
|
||||
<el-input v-model="stationName" size="small" disabled></el-input>
|
||||
</el-col>
|
||||
<el-col :span="10" :offset="2">
|
||||
<el-input v-model="standName" size="small" disabled></el-input>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<div class="table">
|
||||
<span>{{$t('menu.stationStandStatus')}}</span>
|
||||
<el-table ref="tempData" :data="tempData" border style="width: 100%; height: 170px;" size="mini">
|
||||
<el-table-column prop="name" :width="210" :label="this.$t('menu.nextPlatform')">
|
||||
</el-table-column>
|
||||
<el-table-column prop="time" :label="this.$t('menu.intervalRunningTime')">
|
||||
<template slot-scope="scope">
|
||||
<el-select v-model="scope.row.time" size="mini" @change="timeSelectChange" :id='domIdChoose'>
|
||||
<el-option v-for="item in timeList" :key="item.value" :label="item.label"
|
||||
:value="item.value">
|
||||
</el-option>
|
||||
</el-select>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="check" :label="this.$t('menu.alwaysEffective')">
|
||||
<template slot-scope="scope">
|
||||
<el-checkbox ref="check" v-model="scope.row.check" @change="checkChange" :id='domIdCheck'>
|
||||
</el-checkbox>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
</div>
|
||||
<el-row class="button-group">
|
||||
<span v-if="isSelect && tempData.length">{{ $t('menu.setRunLevelTip') }}</span>
|
||||
<span v-if="isConfirm && tempData.length">{{ $t('menu.setRunLevelStationTip') + tempData[0].name}}</span>
|
||||
</el-row>
|
||||
<el-row justify="center" class="button-group">
|
||||
<el-col :span="10" :offset="2">
|
||||
<el-button :id="domIdConfirm" type="primary" :loading="loading" :disabled="!isConfirm" @click="commit">
|
||||
{{$t('global.confirm')}}</el-button>
|
||||
</el-col>
|
||||
<el-col :span="8" :offset="4">
|
||||
<el-button :id="domIdCancel" @click="cancel">{{$t('global.cancel')}}</el-button>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<confirm-control ref="confirmControl"></confirm-control>
|
||||
</el-dialog>
|
||||
<el-dialog
|
||||
v-dialogDrag
|
||||
class="fuzhou-01__systerm stand-run-level"
|
||||
:title="title"
|
||||
:visible.sync="show"
|
||||
width="500px"
|
||||
:before-close="doClose"
|
||||
:z-index="2000"
|
||||
:modal="false"
|
||||
:close-on-click-modal="false"
|
||||
>
|
||||
<el-row class="header">
|
||||
<el-col :span="10"><span>{{ $t('menu.stationName') }}</span></el-col>
|
||||
<el-col :span="10" :offset="2"><span>{{ $t('menu.platform') }}</span></el-col>
|
||||
</el-row>
|
||||
<el-row>
|
||||
<el-col :span="10">
|
||||
<el-input v-model="stationName" size="small" disabled />
|
||||
</el-col>
|
||||
<el-col :span="10" :offset="2">
|
||||
<el-input v-model="standName" size="small" disabled />
|
||||
</el-col>
|
||||
</el-row>
|
||||
<div class="table">
|
||||
<span>{{ $t('menu.stationStandStatus') }}</span>
|
||||
<el-table ref="tempData" :data="tempData" border style="width: 100%; height: 170px;" size="mini">
|
||||
<el-table-column prop="name" :width="210" :label="this.$t('menu.nextPlatform')" />
|
||||
<el-table-column prop="time" :label="this.$t('menu.intervalRunningTime')">
|
||||
<template slot-scope="scope">
|
||||
<el-select :id="domIdChoose" v-model="scope.row.time" size="mini" @change="timeSelectChange">
|
||||
<el-option
|
||||
v-for="item in timeList"
|
||||
:key="item.value"
|
||||
:label="item.label"
|
||||
:value="item.value"
|
||||
/>
|
||||
</el-select>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="check" :label="this.$t('menu.alwaysEffective')">
|
||||
<template slot-scope="scope">
|
||||
<el-checkbox :id="domIdCheck" ref="check" v-model="scope.row.check" @change="checkChange" />
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
</div>
|
||||
<el-row class="button-group">
|
||||
<span v-if="isSelect && tempData.length">{{ $t('menu.setRunLevelTip') }}</span>
|
||||
<span v-if="isConfirm && tempData.length">{{ $t('menu.setRunLevelStationTip') + tempData[0].name }}</span>
|
||||
</el-row>
|
||||
<el-row justify="center" class="button-group">
|
||||
<el-col :span="10" :offset="2">
|
||||
<el-button :id="domIdConfirm" type="primary" :loading="loading" :disabled="!isConfirm" @click="commit">
|
||||
{{ $t('global.confirm') }}</el-button>
|
||||
</el-col>
|
||||
<el-col :span="8" :offset="4">
|
||||
<el-button :id="domIdCancel" @click="cancel">{{ $t('global.cancel') }}</el-button>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<confirm-control ref="confirmControl" />
|
||||
</el-dialog>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import { MapDeviceType, OperationEvent } from '@/scripts/ConstDic';
|
||||
import ConfirmControl from './childDialog/confirmControl';
|
||||
import { mapGetters } from 'vuex';
|
||||
import { MapDeviceType, OperationEvent } from '@/scripts/ConstDic';
|
||||
import ConfirmControl from './childDialog/confirmControl';
|
||||
import { mapGetters } from 'vuex';
|
||||
|
||||
export default {
|
||||
name: 'StandRunLevel',
|
||||
components: {
|
||||
ConfirmControl
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
dialogShow: false,
|
||||
loading: false,
|
||||
tempData: [],
|
||||
maxRunLevel: 300,
|
||||
stationName: '',
|
||||
standName: '',
|
||||
selection: [],
|
||||
isSelect: true,
|
||||
isConfirm: false,
|
||||
time: ''
|
||||
}
|
||||
},
|
||||
watch: {
|
||||
//深度数据状态
|
||||
tempData: {
|
||||
handler(val, oldVal) {
|
||||
this.checkTableDataSelction(val);
|
||||
},
|
||||
deep: true
|
||||
}
|
||||
},
|
||||
computed: {
|
||||
...mapGetters('map', [
|
||||
'stationList',
|
||||
'stationStandList'
|
||||
]),
|
||||
show() {
|
||||
return this.dialogShow && !this.$store.state.menuOperation.break;
|
||||
},
|
||||
domIdCancel() {
|
||||
return this.dialogShow ? OperationEvent.Command.cancel.menu.domId : '';
|
||||
},
|
||||
domIdConfirm() {
|
||||
return this.dialogShow ? OperationEvent.StationStand.setRunLevel.menu.domId : '';
|
||||
},
|
||||
domIdChoose() {
|
||||
return this.dialogShow ? OperationEvent.StationStand.setRunLevel.choose.domId : '';
|
||||
},
|
||||
domIdCheck() {
|
||||
return this.dialogShow ? OperationEvent.StationStand.setRunLevel.check.domId : '';
|
||||
},
|
||||
title() {
|
||||
return this.$t('menu.menuStationStand.setRunLevel');
|
||||
},
|
||||
timeList() {
|
||||
let list = [
|
||||
{ value: 0, label: this.$t('menu.automatic2') },
|
||||
{ value: 1, label: '1' }
|
||||
];
|
||||
for (var i = 60; i <= this.maxRunLevel; i++) {
|
||||
list.push({ value: i, label: `${i}` })
|
||||
}
|
||||
export default {
|
||||
name: 'StandRunLevel',
|
||||
components: {
|
||||
ConfirmControl
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
dialogShow: false,
|
||||
loading: false,
|
||||
tempData: [],
|
||||
maxRunLevel: 300,
|
||||
stationName: '',
|
||||
standName: '',
|
||||
selection: [],
|
||||
isSelect: true,
|
||||
isConfirm: false,
|
||||
time: ''
|
||||
};
|
||||
},
|
||||
watch: {
|
||||
// 深度数据状态
|
||||
tempData: {
|
||||
handler(val, oldVal) {
|
||||
this.checkTableDataSelction(val);
|
||||
},
|
||||
deep: true
|
||||
}
|
||||
},
|
||||
computed: {
|
||||
...mapGetters('map', [
|
||||
'stationList',
|
||||
'stationStandList'
|
||||
]),
|
||||
show() {
|
||||
return this.dialogShow && !this.$store.state.menuOperation.break;
|
||||
},
|
||||
domIdCancel() {
|
||||
return this.dialogShow ? OperationEvent.Command.cancel.menu.domId : '';
|
||||
},
|
||||
domIdConfirm() {
|
||||
return this.dialogShow ? OperationEvent.StationStand.setRunLevel.menu.domId : '';
|
||||
},
|
||||
domIdChoose() {
|
||||
return this.dialogShow ? OperationEvent.StationStand.setRunLevel.choose.domId : '';
|
||||
},
|
||||
domIdCheck() {
|
||||
return this.dialogShow ? OperationEvent.StationStand.setRunLevel.check.domId : '';
|
||||
},
|
||||
title() {
|
||||
return this.$t('menu.menuStationStand.setRunLevel');
|
||||
},
|
||||
timeList() {
|
||||
const list = [
|
||||
{ value: 0, label: this.$t('menu.automatic2') },
|
||||
{ value: 1, label: '1' }
|
||||
];
|
||||
for (var i = 60; i <= this.maxRunLevel; i++) {
|
||||
list.push({ value: i, label: `${i}` });
|
||||
}
|
||||
|
||||
return list;
|
||||
}
|
||||
},
|
||||
mounted() {
|
||||
this.$nextTick(() => {
|
||||
this.$store.dispatch('training/tipReload');
|
||||
})
|
||||
},
|
||||
methods: {
|
||||
loadInitData(selected, opts) {
|
||||
this.tempData = [];
|
||||
let stationList = this.stationList.slice();
|
||||
let index = this.stationList.findIndex(n => n.code == selected.stationCode)
|
||||
if (selected.direction == '01') { // 下行
|
||||
//下行时,此站不是最后一站
|
||||
if (index != 0) {
|
||||
let stationStand = this.$store.getters['map/getDeviceByCode'](this.stationStandList[index + 1].code);
|
||||
let station = this.$store.getters['map/getDeviceByCode'](stationStand.stationCode);
|
||||
this.tempData.push({ name: `${stationStand.name}(${station.name})`, time: opts.intervalRunTime ? opts.intervalRunTime : 0, check: opts.intervalRunTimeValidStatus });
|
||||
}
|
||||
} else {
|
||||
//上行时,此站不是最后一站
|
||||
if (index != this.stationList.length) {
|
||||
let stationStand = this.$store.getters['map/getDeviceByCode'](this.stationStandList[index + 1].code);
|
||||
let station = this.$store.getters['map/getDeviceByCode'](stationStand.stationCode);
|
||||
this.tempData.push({ name: `${stationStand.name}(${station.name})`, time: opts.intervalRunTime ? opts.intervalRunTime : 0, check: opts.intervalRunTimeValidStatus });
|
||||
}
|
||||
}
|
||||
},
|
||||
doShow(operate, selected, opts) {
|
||||
//如果不是断点激活窗口,而是第一次显示窗口时,需要初始化窗口数据
|
||||
if (!this.dialogShow) {
|
||||
this.standName = '';
|
||||
this.stationName = '';
|
||||
if (selected && selected._type.toUpperCase() === 'StationStand'.toUpperCase()) {
|
||||
this.standName = selected.name;
|
||||
let station = this.$store.getters['map/getDeviceByCode'](selected.stationCode);
|
||||
if (station) {
|
||||
this.stationName = station.name;
|
||||
}
|
||||
}
|
||||
this.loadInitData(selected, opts);
|
||||
}
|
||||
return list;
|
||||
}
|
||||
},
|
||||
mounted() {
|
||||
this.$nextTick(() => {
|
||||
this.$store.dispatch('training/tipReload');
|
||||
});
|
||||
},
|
||||
methods: {
|
||||
loadInitData(selected, opts) {
|
||||
this.tempData = [];
|
||||
const index = this.stationList.findIndex(n => n.code == selected.stationCode);
|
||||
if (selected.direction == '01') { // 下行
|
||||
// 下行时,此站不是最后一站
|
||||
if (index != 0) {
|
||||
const stationStand = this.$store.getters['map/getDeviceByCode'](this.stationStandList[index + 1].code);
|
||||
const station = this.$store.getters['map/getDeviceByCode'](stationStand.stationCode);
|
||||
this.tempData.push({ name: `${stationStand.name}(${station.name})`, time: opts.intervalRunTime ? opts.intervalRunTime : 0, check: opts.intervalRunTimeValidStatus });
|
||||
}
|
||||
} else {
|
||||
// 上行时,此站不是最后一站
|
||||
if (index != this.stationList.length) {
|
||||
const stationStand = this.$store.getters['map/getDeviceByCode'](this.stationStandList[index + 1].code);
|
||||
const station = this.$store.getters['map/getDeviceByCode'](stationStand.stationCode);
|
||||
this.tempData.push({ name: `${stationStand.name}(${station.name})`, time: opts.intervalRunTime ? opts.intervalRunTime : 0, check: opts.intervalRunTimeValidStatus });
|
||||
}
|
||||
}
|
||||
},
|
||||
doShow(operate, selected, opts) {
|
||||
// 如果不是断点激活窗口,而是第一次显示窗口时,需要初始化窗口数据
|
||||
if (!this.dialogShow) {
|
||||
this.standName = '';
|
||||
this.stationName = '';
|
||||
if (selected && selected._type.toUpperCase() === 'StationStand'.toUpperCase()) {
|
||||
this.standName = selected.name;
|
||||
const station = this.$store.getters['map/getDeviceByCode'](selected.stationCode);
|
||||
if (station) {
|
||||
this.stationName = station.name;
|
||||
}
|
||||
}
|
||||
this.loadInitData(selected, opts);
|
||||
}
|
||||
|
||||
this.dialogShow = true;
|
||||
this.$nextTick(function () {
|
||||
this.$store.dispatch('training/emitTipFresh');
|
||||
});
|
||||
},
|
||||
checkTableDataSelction(data) {
|
||||
let selection = [];
|
||||
if (data && data.length > 0) {
|
||||
data.forEach(row => {
|
||||
if (row.check && !row.disabled) {
|
||||
selection.push(row);
|
||||
}
|
||||
})
|
||||
}
|
||||
this.dialogShow = true;
|
||||
this.$nextTick(function () {
|
||||
this.$store.dispatch('training/emitTipFresh');
|
||||
});
|
||||
},
|
||||
checkTableDataSelction(data) {
|
||||
const selection = [];
|
||||
if (data && data.length > 0) {
|
||||
data.forEach(row => {
|
||||
if (row.check && !row.disabled) {
|
||||
selection.push(row);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
this.disabledSend = selection.length ? false : true;
|
||||
if (JSON.stringify(selection) !== JSON.stringify(this.selection)) {
|
||||
this.selection = selection;
|
||||
}
|
||||
},
|
||||
timeSelectChange(time) {
|
||||
let operate = {
|
||||
type: MapDeviceType.StationStand.type,
|
||||
operation: OperationEvent.StationStand.setRunLevel.choose.operation,
|
||||
val: time.toString(),
|
||||
}
|
||||
this.disabledSend = !selection.length;
|
||||
if (JSON.stringify(selection) !== JSON.stringify(this.selection)) {
|
||||
this.selection = selection;
|
||||
}
|
||||
},
|
||||
timeSelectChange(time) {
|
||||
const operate = {
|
||||
type: MapDeviceType.StationStand.type,
|
||||
operation: OperationEvent.StationStand.setRunLevel.choose.operation,
|
||||
val: time.toString()
|
||||
};
|
||||
|
||||
this.time = time.toString();
|
||||
this.isSelect = false;
|
||||
this.isConfirm = true;
|
||||
this.$store.dispatch('training/next', operate).then(({ valid }) => {
|
||||
if (valid) {
|
||||
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
|
||||
}
|
||||
})
|
||||
},
|
||||
checkChange(check) {
|
||||
let operate = {
|
||||
type: MapDeviceType.StationStand.type,
|
||||
operation: OperationEvent.StationStand.setRunLevel.check.operation,
|
||||
val: check.toString(),
|
||||
}
|
||||
this.time = time.toString();
|
||||
this.isSelect = false;
|
||||
this.isConfirm = true;
|
||||
this.$store.dispatch('training/next', operate).then(({ valid }) => {
|
||||
if (valid) {
|
||||
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
|
||||
}
|
||||
});
|
||||
},
|
||||
checkChange(check) {
|
||||
const operate = {
|
||||
type: MapDeviceType.StationStand.type,
|
||||
operation: OperationEvent.StationStand.setRunLevel.check.operation,
|
||||
val: check.toString()
|
||||
};
|
||||
|
||||
this.$store.dispatch('training/next', operate).then(({ valid }) => {
|
||||
if (valid) {
|
||||
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
|
||||
}
|
||||
})
|
||||
},
|
||||
doClose() {
|
||||
this.loading = false;
|
||||
this.dialogShow = false;
|
||||
this.$store.dispatch('training/emitTipFresh');
|
||||
},
|
||||
commit() {
|
||||
if (this.isConfirm) {
|
||||
let forver = this.tempData[0].check ? true : false;
|
||||
let operate = {
|
||||
type: MapDeviceType.StationStand.type,
|
||||
operation: OperationEvent.StationStand.setRunLevel.menu.operation,
|
||||
messages: [ `${this.$t('menu.menuStationStand.setRunLevel')}${this.$t('global.colon')}${this.tempData[0].name}-${this.standName},${this.tempData[0].time == 0 ? this.$t('menu.runTimeAutomatically') : `${this.$t('menu.runningTimeIs')}${this.tempData[0].time}s`},${this.$t('menu.effectiveFrequencyIs')}${this.tempData[0].check ? this.$t('menu.alwaysEffective') : this.$t('menu.onceEffective')}`],
|
||||
val: [this.time, forver].join('::'),
|
||||
}
|
||||
this.$store.dispatch('training/next', operate).then(({ valid }) => {
|
||||
if (valid) {
|
||||
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
|
||||
}
|
||||
});
|
||||
},
|
||||
doClose() {
|
||||
this.loading = false;
|
||||
this.dialogShow = false;
|
||||
this.$store.dispatch('training/emitTipFresh');
|
||||
},
|
||||
commit() {
|
||||
if (this.isConfirm) {
|
||||
const forver = !!this.tempData[0].check;
|
||||
const operate = {
|
||||
type: MapDeviceType.StationStand.type,
|
||||
operation: OperationEvent.StationStand.setRunLevel.menu.operation,
|
||||
messages: [`${this.$t('menu.menuStationStand.setRunLevel')}${this.$t('global.colon')}${this.tempData[0].name}-${this.standName},${this.tempData[0].time == 0 ? this.$t('menu.runTimeAutomatically') : `${this.$t('menu.runningTimeIs')}${this.tempData[0].time}s`},${this.$t('menu.effectiveFrequencyIs')}${this.tempData[0].check ? this.$t('menu.alwaysEffective') : this.$t('menu.onceEffective')}`],
|
||||
val: [this.time, forver].join('::')
|
||||
};
|
||||
|
||||
this.loading = true;
|
||||
this.$store.dispatch('training/next', operate).then(({ valid }) => {
|
||||
this.loading = false;
|
||||
if (valid) {
|
||||
this.doClose();
|
||||
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
|
||||
this.$refs.confirmControl.doShow(operate);
|
||||
}
|
||||
}).catch((error) => {
|
||||
this.loading = false;
|
||||
this.doClose();
|
||||
})
|
||||
} else {
|
||||
this.doClose();
|
||||
}
|
||||
},
|
||||
cancel() {
|
||||
let operate = {
|
||||
type: MapDeviceType.StationStand.type,
|
||||
operation: OperationEvent.Command.cancel.menu.operation,
|
||||
}
|
||||
this.loading = true;
|
||||
this.$store.dispatch('training/next', operate).then(({ valid }) => {
|
||||
this.loading = false;
|
||||
if (valid) {
|
||||
this.doClose();
|
||||
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
|
||||
this.$refs.confirmControl.doShow(operate);
|
||||
}
|
||||
}).catch(() => {
|
||||
this.loading = false;
|
||||
this.doClose();
|
||||
});
|
||||
} else {
|
||||
this.doClose();
|
||||
}
|
||||
},
|
||||
cancel() {
|
||||
const operate = {
|
||||
type: MapDeviceType.StationStand.type,
|
||||
operation: OperationEvent.Command.cancel.menu.operation
|
||||
};
|
||||
|
||||
this.$store.dispatch('training/next', operate).then(({ valid }) => {
|
||||
if (valid) {
|
||||
this.doClose();
|
||||
}
|
||||
}).catch(error => {
|
||||
this.doClose();
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
this.$store.dispatch('training/next', operate).then(({ valid }) => {
|
||||
if (valid) {
|
||||
this.doClose();
|
||||
}
|
||||
}).catch(() => {
|
||||
this.doClose();
|
||||
});
|
||||
}
|
||||
}
|
||||
};
|
||||
</script>
|
||||
|
@ -1,239 +1,255 @@
|
||||
<template>
|
||||
<el-dialog class="fuzhou-01__systerm stand-stop-time" :title="title" :visible.sync="show" width="390px"
|
||||
:before-close="doClose" :zIndex="2000" :modal="false" :close-on-click-modal="false" v-dialogDrag>
|
||||
<el-row class="header">
|
||||
<el-col :span="11"><span>{{$t('menu.stationName')}}</span></el-col>
|
||||
<el-col :span="11" :offset="2"><span>{{$t('menu.platformName')}}</span></el-col>
|
||||
</el-row>
|
||||
<el-row>
|
||||
<el-col :span="11">
|
||||
<el-input v-model="stationName" size="small" disabled></el-input>
|
||||
</el-col>
|
||||
<el-col :span="11" :offset="2">
|
||||
<el-input v-model="standName" size="small" disabled></el-input>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<div style="padding: 10px 15px; border: 1px double lightgray; margin: 20px 0px; height: 60px;">
|
||||
<span class="base-label">{{$t('menu.controlMode')}}</span>
|
||||
<div style=" position: relative; top:-10px;">
|
||||
<el-radio-group v-model="control" @change='chooseControl'>
|
||||
<el-radio label="01" :id="control === '01'? '': domIdChoose1">{{$t('menu.automatic2')}}</el-radio>
|
||||
<el-radio label="02" :id="control === '02'? '': domIdChoose1">{{$t('menu.artificial')}}</el-radio>
|
||||
</el-radio-group>
|
||||
<el-input-number v-model="time" @change="inputTime" :disabled="disabledInput" :id="domIdInput"
|
||||
controls-position="right" :min="0" size="mini" style="width: 130px; padding-left:30px">
|
||||
</el-input-number>{{$t('global.second')}}
|
||||
</div>
|
||||
</div>
|
||||
<div style="padding: 0px 15px; height: 30px;">
|
||||
<div style=" position: relative; top:-5px;">
|
||||
<el-radio-group v-model="direction">
|
||||
<el-radio label="02" :disabled="disabledUp">{{$t('menu.upDirection')}}</el-radio>
|
||||
<el-radio label="01" :disabled="disabledDown">{{$t('menu.downDirection')}}</el-radio>
|
||||
</el-radio-group>
|
||||
</div>
|
||||
</div>
|
||||
<div style="padding: 10px 15px; border: 1px double lightgray; height: 60px;">
|
||||
<span class="base-label">{{$t('menu.effectiveNumber')}}</span>
|
||||
<div style=" position: relative; top:-10px;">
|
||||
<el-radio-group v-model="effective" @change="chooseEffective" :disabled="disabledTime">
|
||||
<el-radio :label="false" :id="effective === false? '': domIdChoose2">{{$t('menu.onceEffective')}}</el-radio>
|
||||
<el-radio :label="true" :id="effective === true? '': domIdChoose2">{{$t('menu.alwaysEffective')}}</el-radio>
|
||||
</el-radio-group>
|
||||
</div>
|
||||
</div>
|
||||
<el-row justify="center" class="button-group">
|
||||
<el-col :span="10" :offset="2">
|
||||
<el-button :id="domIdConfirm" type="primary" :loading="loading" @click="commit">{{$t('global.confirm')}}</el-button>
|
||||
</el-col>
|
||||
<el-col :span="8" :offset="4">
|
||||
<el-button :id="domIdCancel" @click="cancel">{{$t('global.cancel')}}</el-button>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<confirm-control ref="confirmControl"></confirm-control>
|
||||
<notice-info ref="noticeInfo"></notice-info>
|
||||
</el-dialog>
|
||||
<el-dialog
|
||||
v-dialogDrag
|
||||
class="fuzhou-01__systerm stand-stop-time"
|
||||
:title="title"
|
||||
:visible.sync="show"
|
||||
width="390px"
|
||||
:before-close="doClose"
|
||||
:z-index="2000"
|
||||
:modal="false"
|
||||
:close-on-click-modal="false"
|
||||
>
|
||||
<el-row class="header">
|
||||
<el-col :span="11"><span>{{ $t('menu.stationName') }}</span></el-col>
|
||||
<el-col :span="11" :offset="2"><span>{{ $t('menu.platformName') }}</span></el-col>
|
||||
</el-row>
|
||||
<el-row>
|
||||
<el-col :span="11">
|
||||
<el-input v-model="stationName" size="small" disabled />
|
||||
</el-col>
|
||||
<el-col :span="11" :offset="2">
|
||||
<el-input v-model="standName" size="small" disabled />
|
||||
</el-col>
|
||||
</el-row>
|
||||
<div style="padding: 10px 15px; border: 1px double lightgray; margin: 20px 0px; height: 60px;">
|
||||
<span class="base-label">{{ $t('menu.controlMode') }}</span>
|
||||
<div style=" position: relative; top:-10px;">
|
||||
<el-radio-group v-model="control" @change="chooseControl">
|
||||
<el-radio :id="control === '01'? '': domIdChoose1" label="01">{{ $t('menu.automatic2') }}</el-radio>
|
||||
<el-radio :id="control === '02'? '': domIdChoose1" label="02">{{ $t('menu.artificial') }}</el-radio>
|
||||
</el-radio-group>
|
||||
<el-input-number
|
||||
:id="domIdInput"
|
||||
v-model="time"
|
||||
:disabled="disabledInput"
|
||||
controls-position="right"
|
||||
:min="0"
|
||||
size="mini"
|
||||
style="width: 130px; padding-left:30px"
|
||||
@change="inputTime"
|
||||
/>{{ $t('global.second') }}
|
||||
</div>
|
||||
</div>
|
||||
<div style="padding: 0px 15px; height: 30px;">
|
||||
<div style=" position: relative; top:-5px;">
|
||||
<el-radio-group v-model="direction">
|
||||
<el-radio label="02" :disabled="disabledUp">{{ $t('menu.upDirection') }}</el-radio>
|
||||
<el-radio label="01" :disabled="disabledDown">{{ $t('menu.downDirection') }}</el-radio>
|
||||
</el-radio-group>
|
||||
</div>
|
||||
</div>
|
||||
<div style="padding: 10px 15px; border: 1px double lightgray; height: 60px;">
|
||||
<span class="base-label">{{ $t('menu.effectiveNumber') }}</span>
|
||||
<div style=" position: relative; top:-10px;">
|
||||
<el-radio-group v-model="effective" :disabled="disabledTime" @change="chooseEffective">
|
||||
<el-radio :id="effective === false? '': domIdChoose2" :label="false">{{ $t('menu.onceEffective') }}</el-radio>
|
||||
<el-radio :id="effective === true? '': domIdChoose2" :label="true">{{ $t('menu.alwaysEffective') }}</el-radio>
|
||||
</el-radio-group>
|
||||
</div>
|
||||
</div>
|
||||
<el-row justify="center" class="button-group">
|
||||
<el-col :span="10" :offset="2">
|
||||
<el-button :id="domIdConfirm" type="primary" :loading="loading" @click="commit">{{ $t('global.confirm') }}</el-button>
|
||||
</el-col>
|
||||
<el-col :span="8" :offset="4">
|
||||
<el-button :id="domIdCancel" @click="cancel">{{ $t('global.cancel') }}</el-button>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<confirm-control ref="confirmControl" />
|
||||
<notice-info ref="noticeInfo" />
|
||||
</el-dialog>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import { MapDeviceType, OperationEvent } from '@/scripts/ConstDic';
|
||||
import ConfirmControl from './childDialog/confirmControl';
|
||||
import NoticeInfo from './childDialog/childDialog/noticeInfo'
|
||||
import { MapDeviceType, OperationEvent } from '@/scripts/ConstDic';
|
||||
import ConfirmControl from './childDialog/confirmControl';
|
||||
import NoticeInfo from './childDialog/childDialog/noticeInfo';
|
||||
|
||||
export default {
|
||||
name: 'StandStopTime',
|
||||
components: {
|
||||
ConfirmControl,
|
||||
NoticeInfo
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
dialogShow: false,
|
||||
loading: false,
|
||||
time: 0,
|
||||
control: '01',
|
||||
direction: '01',
|
||||
effective: false,
|
||||
selected: null,
|
||||
standName: '',
|
||||
stationName: '',
|
||||
}
|
||||
},
|
||||
computed: {
|
||||
show() {
|
||||
return this.dialogShow && !this.$store.state.menuOperation.break;
|
||||
},
|
||||
domIdCancel() {
|
||||
return this.dialogShow ? OperationEvent.Command.close.menu.domId : '';
|
||||
},
|
||||
domIdConfirm() {
|
||||
return this.dialogShow ? OperationEvent.StationStand.setStopTime.menu.domId : '';
|
||||
},
|
||||
domIdChoose1() {
|
||||
return this.dialogShow ? OperationEvent.StationStand.setStopTime.choose1.domId : '';
|
||||
},
|
||||
domIdChoose2() {
|
||||
return this.dialogShow ? OperationEvent.StationStand.setStopTime.choose2.domId : '';
|
||||
},
|
||||
domIdInput() {
|
||||
return this.dialogShow ? OperationEvent.StationStand.setStopTime.input.domId : '';
|
||||
},
|
||||
disabledUp() {
|
||||
if (this.selected) {
|
||||
return this.selected.direction !== '02'
|
||||
}
|
||||
return true;
|
||||
},
|
||||
disabledDown() {
|
||||
if (this.selected) {
|
||||
return this.selected.direction !== '01'
|
||||
}
|
||||
return true;
|
||||
},
|
||||
disabledInput() {
|
||||
return this.control === '01'; //如果是自动则不可以设置
|
||||
},
|
||||
disabledTime() {
|
||||
return this.control === '01'; //如果是自动则不可以设置
|
||||
},
|
||||
title() {
|
||||
return this.$t('menu.stopTime');
|
||||
}
|
||||
},
|
||||
mounted() {
|
||||
this.$nextTick(() => {
|
||||
this.$store.dispatch('training/tipReload');
|
||||
})
|
||||
},
|
||||
methods: {
|
||||
doShow(operate, selected, tempDate) {
|
||||
//如果不是断点激活,则需要对初始值进行初始化
|
||||
if (!this.dialogShow) {
|
||||
this.standName = '';
|
||||
this.stationName = '';
|
||||
if (selected && selected._type.toUpperCase() === 'StationStand'.toUpperCase()) {
|
||||
this.standName = selected.name;
|
||||
let station = this.$store.getters['map/getDeviceByCode'](selected.stationCode);
|
||||
if (station) {
|
||||
this.stationName = station.name;
|
||||
}
|
||||
}
|
||||
export default {
|
||||
name: 'StandStopTime',
|
||||
components: {
|
||||
ConfirmControl,
|
||||
NoticeInfo
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
dialogShow: false,
|
||||
loading: false,
|
||||
time: 0,
|
||||
control: '01',
|
||||
direction: '01',
|
||||
effective: false,
|
||||
selected: null,
|
||||
standName: '',
|
||||
stationName: ''
|
||||
};
|
||||
},
|
||||
computed: {
|
||||
show() {
|
||||
return this.dialogShow && !this.$store.state.menuOperation.break;
|
||||
},
|
||||
domIdCancel() {
|
||||
return this.dialogShow ? OperationEvent.Command.close.menu.domId : '';
|
||||
},
|
||||
domIdConfirm() {
|
||||
return this.dialogShow ? OperationEvent.StationStand.setStopTime.menu.domId : '';
|
||||
},
|
||||
domIdChoose1() {
|
||||
return this.dialogShow ? OperationEvent.StationStand.setStopTime.choose1.domId : '';
|
||||
},
|
||||
domIdChoose2() {
|
||||
return this.dialogShow ? OperationEvent.StationStand.setStopTime.choose2.domId : '';
|
||||
},
|
||||
domIdInput() {
|
||||
return this.dialogShow ? OperationEvent.StationStand.setStopTime.input.domId : '';
|
||||
},
|
||||
disabledUp() {
|
||||
if (this.selected) {
|
||||
return this.selected.direction !== '02';
|
||||
}
|
||||
return true;
|
||||
},
|
||||
disabledDown() {
|
||||
if (this.selected) {
|
||||
return this.selected.direction !== '01';
|
||||
}
|
||||
return true;
|
||||
},
|
||||
disabledInput() {
|
||||
return this.control === '01'; // 如果是自动则不可以设置
|
||||
},
|
||||
disabledTime() {
|
||||
return this.control === '01'; // 如果是自动则不可以设置
|
||||
},
|
||||
title() {
|
||||
return this.$t('menu.stopTime');
|
||||
}
|
||||
},
|
||||
mounted() {
|
||||
this.$nextTick(() => {
|
||||
this.$store.dispatch('training/tipReload');
|
||||
});
|
||||
},
|
||||
methods: {
|
||||
doShow(operate, selected, tempDate) {
|
||||
// 如果不是断点激活,则需要对初始值进行初始化
|
||||
if (!this.dialogShow) {
|
||||
this.standName = '';
|
||||
this.stationName = '';
|
||||
if (selected && selected._type.toUpperCase() === 'StationStand'.toUpperCase()) {
|
||||
this.standName = selected.name;
|
||||
const station = this.$store.getters['map/getDeviceByCode'](selected.stationCode);
|
||||
if (station) {
|
||||
this.stationName = station.name;
|
||||
}
|
||||
}
|
||||
|
||||
this.control = Number(tempDate.parkingTime) === -1 ? '01' : '02';
|
||||
this.time = Number(tempDate.parkingTime) === -1 ? 15 : Number(tempDate.parkingTime);
|
||||
this.effective = tempDate.parkingValidStatus ? true : false;
|
||||
this.direction = selected.direction;
|
||||
this.selected = selected || {};
|
||||
}
|
||||
this.dialogShow = true;
|
||||
this.$nextTick(function () {
|
||||
this.$store.dispatch('training/emitTipFresh');
|
||||
});
|
||||
},
|
||||
doClose() {
|
||||
this.loading = false;
|
||||
this.dialogShow = false;
|
||||
this.$store.dispatch('training/emitTipFresh');
|
||||
},
|
||||
chooseControl(control) {
|
||||
/** 自动时的默认时间*/
|
||||
if (control == '01') {
|
||||
this.inputTime = 15;
|
||||
this.effective = true;
|
||||
}
|
||||
this.control = Number(tempDate.parkingTime) === -1 ? '01' : '02';
|
||||
this.time = Number(tempDate.parkingTime) === -1 ? 15 : Number(tempDate.parkingTime);
|
||||
this.effective = !!tempDate.parkingValidStatus;
|
||||
this.direction = selected.direction;
|
||||
this.selected = selected || {};
|
||||
}
|
||||
this.dialogShow = true;
|
||||
this.$nextTick(function () {
|
||||
this.$store.dispatch('training/emitTipFresh');
|
||||
});
|
||||
},
|
||||
doClose() {
|
||||
this.loading = false;
|
||||
this.dialogShow = false;
|
||||
this.$store.dispatch('training/emitTipFresh');
|
||||
},
|
||||
chooseControl(control) {
|
||||
/** 自动时的默认时间*/
|
||||
if (control == '01') {
|
||||
this.inputTime = 15;
|
||||
this.effective = true;
|
||||
}
|
||||
|
||||
let operate = {
|
||||
type: MapDeviceType.StationStand.type,
|
||||
operation: OperationEvent.StationStand.setStopTime.choose1.operation,
|
||||
val: `${control}`
|
||||
}
|
||||
const operate = {
|
||||
type: MapDeviceType.StationStand.type,
|
||||
operation: OperationEvent.StationStand.setStopTime.choose1.operation,
|
||||
val: `${control}`
|
||||
};
|
||||
|
||||
this.$store.dispatch('training/next', operate).then(({ valid }) => {
|
||||
if (valid) {
|
||||
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
|
||||
}
|
||||
})
|
||||
},
|
||||
chooseEffective(effective) {
|
||||
let operate = {
|
||||
type: MapDeviceType.StationStand.type,
|
||||
operation: OperationEvent.StationStand.setStopTime.choose2.operation,
|
||||
val: `${effective}`
|
||||
}
|
||||
this.$store.dispatch('training/next', operate).then(({ valid }) => {
|
||||
if (valid) {
|
||||
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
|
||||
}
|
||||
});
|
||||
},
|
||||
chooseEffective(effective) {
|
||||
const operate = {
|
||||
type: MapDeviceType.StationStand.type,
|
||||
operation: OperationEvent.StationStand.setStopTime.choose2.operation,
|
||||
val: `${effective}`
|
||||
};
|
||||
|
||||
this.$store.dispatch('training/next', operate).then(({ valid }) => {
|
||||
if (valid) {
|
||||
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
|
||||
}
|
||||
})
|
||||
},
|
||||
inputTime(time) {
|
||||
let operate = {
|
||||
repeat: true,
|
||||
type: MapDeviceType.StationStand.type,
|
||||
operation: OperationEvent.StationStand.setStopTime.input.operation,
|
||||
val: `${time}`
|
||||
}
|
||||
this.$store.dispatch('training/next', operate).then(({ valid }) => {
|
||||
if (valid) {
|
||||
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
|
||||
}
|
||||
});
|
||||
},
|
||||
inputTime(time) {
|
||||
const operate = {
|
||||
repeat: true,
|
||||
type: MapDeviceType.StationStand.type,
|
||||
operation: OperationEvent.StationStand.setStopTime.input.operation,
|
||||
val: `${time}`
|
||||
};
|
||||
|
||||
this.$store.dispatch('training/next', operate).then(({ valid }) => {
|
||||
if (valid) {
|
||||
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
|
||||
}
|
||||
})
|
||||
},
|
||||
commit() {
|
||||
let operate = {
|
||||
type: MapDeviceType.StationStand.type,
|
||||
operation: OperationEvent.StationStand.setStopTime.menu.operation,
|
||||
val: [`${this.control}`, this.time, this.effective].join('::'),
|
||||
messages: [`${this.$t('menu.stopTime') + this.$t('global.colon') + this.stationName} - ${this.standName}, ${this.$t('menu.stopTimeIs')}${this.control == '01' ? this.$t('menu.automatic2') : this.time + this.$t('global.second')}, ${this.$t('menu.effectiveFrequencyIs')}${this.effective == false ? this.$t('menu.alwaysEffective') : this.$t('menu.onceEffective')}`]
|
||||
}
|
||||
this.$store.dispatch('training/next', operate).then(({ valid }) => {
|
||||
if (valid) {
|
||||
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
|
||||
}
|
||||
});
|
||||
},
|
||||
commit() {
|
||||
const operate = {
|
||||
type: MapDeviceType.StationStand.type,
|
||||
operation: OperationEvent.StationStand.setStopTime.menu.operation,
|
||||
val: [`${this.control}`, this.time, this.effective].join('::'),
|
||||
messages: [`${this.$t('menu.stopTime') + this.$t('global.colon') + this.stationName} - ${this.standName}, ${this.$t('menu.stopTimeIs')}${this.control == '01' ? this.$t('menu.automatic2') : this.time + this.$t('global.second')}, ${this.$t('menu.effectiveFrequencyIs')}${this.effective == false ? this.$t('menu.alwaysEffective') : this.$t('menu.onceEffective')}`]
|
||||
};
|
||||
|
||||
this.loading = true;
|
||||
this.$store.dispatch('training/next', operate).then(({ valid }) => {
|
||||
this.loading = false;
|
||||
if (valid) {
|
||||
this.doClose();
|
||||
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
|
||||
this.$refs.confirmControl.doShow(operate);
|
||||
}
|
||||
}).catch(error => {
|
||||
this.loading = false;
|
||||
this.doClose();
|
||||
})
|
||||
},
|
||||
cancel() {
|
||||
let operate = {
|
||||
type: MapDeviceType.StationStand.type,
|
||||
operation: OperationEvent.Command.close.menu.operation,
|
||||
}
|
||||
this.loading = true;
|
||||
this.$store.dispatch('training/next', operate).then(({ valid }) => {
|
||||
this.loading = false;
|
||||
if (valid) {
|
||||
this.doClose();
|
||||
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
|
||||
this.$refs.confirmControl.doShow(operate);
|
||||
}
|
||||
}).catch(() => {
|
||||
this.loading = false;
|
||||
this.doClose();
|
||||
});
|
||||
},
|
||||
cancel() {
|
||||
const operate = {
|
||||
type: MapDeviceType.StationStand.type,
|
||||
operation: OperationEvent.Command.close.menu.operation
|
||||
};
|
||||
|
||||
this.$store.dispatch('training/next', operate).then(({ valid }) => {
|
||||
if (valid) {
|
||||
this.doClose();
|
||||
}
|
||||
}).catch(error => { this.doClose(); });
|
||||
}
|
||||
}
|
||||
}
|
||||
this.$store.dispatch('training/next', operate).then(({ valid }) => {
|
||||
if (valid) {
|
||||
this.doClose();
|
||||
}
|
||||
}).catch(() => { this.doClose(); });
|
||||
}
|
||||
}
|
||||
};
|
||||
</script>
|
||||
|
@ -1,385 +1,409 @@
|
||||
<template>
|
||||
<div>
|
||||
<el-dialog class="fuzhou-01__systerm station-cmd-control" :title="title" :visible.sync="show" width="840px"
|
||||
:before-close="doClose" :zIndex="2000" :modal="false" :close-on-click-modal="false" v-dialogDrag>
|
||||
<div style="padding: 10px 20px; border: 1px solid lightgray;">
|
||||
<span class="base-label">{{$t('menu.commandInformation')}}</span>
|
||||
<el-form label-position="center" size="mini">
|
||||
<el-row>
|
||||
<el-col :span="11">
|
||||
<el-form-item :label="this.$t('menu.type')" label-width="40px">
|
||||
<el-select v-model="operation" size="small" disabled style="width:230px">
|
||||
<el-option v-for="option in typeList" :key="option.code" :label="option.name"
|
||||
:value="option.code">
|
||||
</el-option>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="11">
|
||||
<el-form-item :label="this.$t('menu.stationName')" label-width="100px">
|
||||
<el-input v-model="stationName" size="small" disabled></el-input>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
</el-form>
|
||||
</div>
|
||||
<el-table class="table" ref="tempData" :data="tempData" border style="width: 100%" size="mini"
|
||||
highlight-current-row height="200">
|
||||
<el-table-column prop="order" :width="110" :label="this.$t('menu.serialNumber2')">
|
||||
</el-table-column>
|
||||
<el-table-column prop="date" :width="160" :label="this.$t('menu.time')">
|
||||
</el-table-column>
|
||||
<el-table-column prop="context" :width="180" :label="this.$t('menu.implementationProcess')">
|
||||
</el-table-column>
|
||||
<el-table-column prop="result" :label="this.$t('menu.executionResult')">
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
<span class="notice">{{message}}</span>
|
||||
<el-row class="button-group">
|
||||
<el-col :span="2" :offset="3">
|
||||
<el-button :id="domIdCommand" type="primary" :disabled="cmdDisabled[0]" @click="command">{{$t('menu.release')}}<span
|
||||
v-show="timeCountCommand>0">({{timeCountCommand}})</span></el-button>
|
||||
</el-col>
|
||||
<el-col :span="2" :offset="1">
|
||||
<el-button :id="domIdConfirm1" type="primary" style="width:120px;" :disabled="cmdDisabled[1]" @click="confirm1">{{$t('menu.firstConfirm')}}
|
||||
</el-button>
|
||||
</el-col>
|
||||
<el-col :span="2" :offset="2">
|
||||
<el-button :id="domIdConfirm2" type="primary" style="width:120px;" :disabled="cmdDisabled[2]" @click="confirm2">{{$t('menu.secondConfirm')}}<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">{{$t('menu.suspend')}}</el-button>
|
||||
</el-col>
|
||||
<el-col :span="2" :offset="1">
|
||||
<el-button :id="domIdClose" @click="close">{{$t('global.close')}}</el-button>
|
||||
</el-col>
|
||||
</el-row>
|
||||
</el-dialog>
|
||||
</div>
|
||||
<div>
|
||||
<el-dialog
|
||||
v-dialogDrag
|
||||
class="fuzhou-01__systerm station-cmd-control"
|
||||
:title="title"
|
||||
:visible.sync="show"
|
||||
width="840px"
|
||||
: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">{{ $t('menu.commandInformation') }}</span>
|
||||
<el-form label-position="center" size="mini">
|
||||
<el-row>
|
||||
<el-col :span="11">
|
||||
<el-form-item :label="this.$t('menu.type')" label-width="40px">
|
||||
<el-select v-model="operation" size="small" disabled style="width:230px">
|
||||
<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="11">
|
||||
<el-form-item :label="this.$t('menu.stationName')" label-width="100px">
|
||||
<el-input v-model="stationName" 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="110" :label="this.$t('menu.serialNumber2')" />
|
||||
<el-table-column prop="date" :width="160" :label="this.$t('menu.time')" />
|
||||
<el-table-column prop="context" :width="180" :label="this.$t('menu.implementationProcess')" />
|
||||
<el-table-column prop="result" :label="this.$t('menu.executionResult')" />
|
||||
</el-table>
|
||||
<span class="notice">{{ message }}</span>
|
||||
<el-row class="button-group">
|
||||
<el-col :span="2" :offset="3">
|
||||
<el-button :id="domIdCommand" type="primary" :disabled="cmdDisabled[0]" @click="command">{{ $t('menu.release') }}<span
|
||||
v-show="timeCountCommand>0"
|
||||
>({{ timeCountCommand }})</span></el-button>
|
||||
</el-col>
|
||||
<el-col :span="2" :offset="1">
|
||||
<el-button :id="domIdConfirm1" type="primary" style="width:120px;" :disabled="cmdDisabled[1]" @click="confirm1">{{ $t('menu.firstConfirm') }}
|
||||
</el-button>
|
||||
</el-col>
|
||||
<el-col :span="2" :offset="2">
|
||||
<el-button :id="domIdConfirm2" type="primary" style="width:120px;" :disabled="cmdDisabled[2]" @click="confirm2">{{ $t('menu.secondConfirm') }}<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">{{ $t('menu.suspend') }}</el-button>
|
||||
</el-col>
|
||||
<el-col :span="2" :offset="1">
|
||||
<el-button :id="domIdClose" @click="close">{{ $t('global.close') }}</el-button>
|
||||
</el-col>
|
||||
</el-row>
|
||||
</el-dialog>
|
||||
</div>
|
||||
</template>
|
||||
<script>
|
||||
import { MapDeviceType, OperationEvent } from '@/scripts/ConstDic';
|
||||
import { now } from '@/utils/date';
|
||||
import { MapDeviceType, OperationEvent } from '@/scripts/ConstDic';
|
||||
import { now } from '@/utils/date';
|
||||
|
||||
export default {
|
||||
name: 'StationCmdControl',
|
||||
data() {
|
||||
return {
|
||||
dialogShow: false,
|
||||
backOperate: '',
|
||||
order: 0,
|
||||
row: null,
|
||||
timer: null,
|
||||
operation: '',
|
||||
cmdDisabled: [true, true, true],
|
||||
stpDisabled: true,
|
||||
tempData: [],
|
||||
message: '',
|
||||
timeCountCommand: -1,
|
||||
timeCountConfirm: -1,
|
||||
stationName: ''
|
||||
}
|
||||
},
|
||||
computed: {
|
||||
typeList() {
|
||||
return [
|
||||
{ code: OperationEvent.Station.powerUnLock.menu.operation, name: this.$t('menu.menuStation.powerUnLock') },
|
||||
{ code: OperationEvent.Station.execKeyOperationTest.menu.operation, name: this.$t('menu.menuStation.execKeyOperationTest') }
|
||||
]
|
||||
},
|
||||
show() {
|
||||
return this.dialogShow && !this.$store.state.menuOperation.break;
|
||||
},
|
||||
domIdCommand() {
|
||||
if (this.dialogShow) {
|
||||
if (this.operation == OperationEvent.Station.powerUnLock.menu.operation) {
|
||||
/** 上电解锁*/
|
||||
return OperationEvent.Station.powerUnLock.order.domId;
|
||||
} else if (this.operation == OperationEvent.Station.execKeyOperationTest.menu.operation) {
|
||||
/** 执行关键操作测试*/
|
||||
return OperationEvent.Station.execKeyOperationTest.order.domId;
|
||||
}
|
||||
}
|
||||
},
|
||||
domIdConfirm1() {
|
||||
if (this.dialogShow) {
|
||||
if (this.operation == OperationEvent.Station.powerUnLock.menu.operation) {
|
||||
/** 上电解锁*/
|
||||
return OperationEvent.Station.powerUnLock.confirm1.domId;
|
||||
} else if (this.operation == OperationEvent.Station.execKeyOperationTest.menu.operation) {
|
||||
/** 执行关键操作测试*/
|
||||
return OperationEvent.Station.execKeyOperationTest.confirm1.domId;
|
||||
}
|
||||
}
|
||||
},
|
||||
domIdConfirm2() {
|
||||
if (this.dialogShow) {
|
||||
if (this.operation == OperationEvent.Station.powerUnLock.menu.operation) {
|
||||
/** 上电解锁*/
|
||||
return OperationEvent.Station.powerUnLock.confirm2.domId;
|
||||
} else if (this.operation == OperationEvent.Station.execKeyOperationTest.menu.operation) {
|
||||
/** 执行关键操作测试*/
|
||||
return OperationEvent.Station.execKeyOperationTest.confirm2.domId;
|
||||
}
|
||||
}
|
||||
},
|
||||
domIdStop() {
|
||||
if (this.dialogShow) {
|
||||
if (this.operation == OperationEvent.Station.powerUnLock.menu.operation) {
|
||||
/** 上电解锁*/
|
||||
return OperationEvent.Station.powerUnLock.stop.domId;
|
||||
} else if (this.operation == OperationEvent.Station.execKeyOperationTest.menu.operation) {
|
||||
/** 执行关键操作测试*/
|
||||
return OperationEvent.Station.execKeyOperationTest.stop.domId;
|
||||
}
|
||||
}
|
||||
},
|
||||
domIdClose() {
|
||||
if (this.dialogShow) {
|
||||
return OperationEvent.Command.close.menu.domId;
|
||||
}
|
||||
},
|
||||
title() {
|
||||
if (this.dialogShow) {
|
||||
if (this.operation == OperationEvent.Station.powerUnLock.menu.operation) {
|
||||
return this.$t('menu.signalDeblocking');
|
||||
} else if (this.operation == OperationEvent.Station.execKeyOperationTest.menu.operation) {
|
||||
return this.$t('menu.menuStation.execKeyOperationTest');
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
watch: {
|
||||
cmdDisabled: {
|
||||
handler(val, oldVal) {
|
||||
this.stpDisabled = true;
|
||||
val.forEach((elem, index) => {
|
||||
// 在确定1之前的操作才可以终止
|
||||
if (elem == false && 1 <= index && 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) {
|
||||
if (!this.dialogShow) {
|
||||
this.stationName = '';
|
||||
if (selected && selected._type.toUpperCase() === 'Station'.toUpperCase()) {
|
||||
this.stationName = selected.name
|
||||
}
|
||||
export default {
|
||||
name: 'StationCmdControl',
|
||||
data() {
|
||||
return {
|
||||
dialogShow: false,
|
||||
backOperate: '',
|
||||
order: 0,
|
||||
row: null,
|
||||
timer: null,
|
||||
operation: '',
|
||||
cmdDisabled: [true, true, true],
|
||||
stpDisabled: true,
|
||||
tempData: [],
|
||||
message: '',
|
||||
timeCountCommand: -1,
|
||||
timeCountConfirm: -1,
|
||||
stationName: ''
|
||||
};
|
||||
},
|
||||
computed: {
|
||||
typeList() {
|
||||
return [
|
||||
{ code: OperationEvent.Station.powerUnLock.menu.operation, name: this.$t('menu.menuStation.powerUnLock') },
|
||||
{ code: OperationEvent.Station.execKeyOperationTest.menu.operation, name: this.$t('menu.menuStation.execKeyOperationTest') }
|
||||
];
|
||||
},
|
||||
show() {
|
||||
return this.dialogShow && !this.$store.state.menuOperation.break;
|
||||
},
|
||||
domIdCommand() {
|
||||
if (this.dialogShow) {
|
||||
if (this.operation == OperationEvent.Station.powerUnLock.menu.operation) {
|
||||
/** 上电解锁*/
|
||||
return OperationEvent.Station.powerUnLock.order.domId;
|
||||
} else if (this.operation == OperationEvent.Station.execKeyOperationTest.menu.operation) {
|
||||
/** 执行关键操作测试*/
|
||||
return OperationEvent.Station.execKeyOperationTest.order.domId;
|
||||
}
|
||||
}
|
||||
return '';
|
||||
},
|
||||
domIdConfirm1() {
|
||||
if (this.dialogShow) {
|
||||
if (this.operation == OperationEvent.Station.powerUnLock.menu.operation) {
|
||||
/** 上电解锁*/
|
||||
return OperationEvent.Station.powerUnLock.confirm1.domId;
|
||||
} else if (this.operation == OperationEvent.Station.execKeyOperationTest.menu.operation) {
|
||||
/** 执行关键操作测试*/
|
||||
return OperationEvent.Station.execKeyOperationTest.confirm1.domId;
|
||||
}
|
||||
}
|
||||
return '';
|
||||
},
|
||||
domIdConfirm2() {
|
||||
if (this.dialogShow) {
|
||||
if (this.operation == OperationEvent.Station.powerUnLock.menu.operation) {
|
||||
/** 上电解锁*/
|
||||
return OperationEvent.Station.powerUnLock.confirm2.domId;
|
||||
} else if (this.operation == OperationEvent.Station.execKeyOperationTest.menu.operation) {
|
||||
/** 执行关键操作测试*/
|
||||
return OperationEvent.Station.execKeyOperationTest.confirm2.domId;
|
||||
}
|
||||
}
|
||||
return '';
|
||||
},
|
||||
domIdStop() {
|
||||
if (this.dialogShow) {
|
||||
if (this.operation == OperationEvent.Station.powerUnLock.menu.operation) {
|
||||
/** 上电解锁*/
|
||||
return OperationEvent.Station.powerUnLock.stop.domId;
|
||||
} else if (this.operation == OperationEvent.Station.execKeyOperationTest.menu.operation) {
|
||||
/** 执行关键操作测试*/
|
||||
return OperationEvent.Station.execKeyOperationTest.stop.domId;
|
||||
}
|
||||
}
|
||||
return '';
|
||||
},
|
||||
domIdClose() {
|
||||
if (this.dialogShow) {
|
||||
return OperationEvent.Command.close.menu.domId;
|
||||
}
|
||||
return '';
|
||||
},
|
||||
title() {
|
||||
if (this.dialogShow) {
|
||||
if (this.operation == OperationEvent.Station.powerUnLock.menu.operation) {
|
||||
return this.$t('menu.signalDeblocking');
|
||||
} else if (this.operation == OperationEvent.Station.execKeyOperationTest.menu.operation) {
|
||||
return this.$t('menu.menuStation.execKeyOperationTest');
|
||||
}
|
||||
}
|
||||
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) {
|
||||
if (!this.dialogShow) {
|
||||
this.stationName = '';
|
||||
if (selected && selected._type.toUpperCase() === 'Station'.toUpperCase()) {
|
||||
this.stationName = selected.name;
|
||||
}
|
||||
|
||||
this.order = 0;
|
||||
this.operation = operate.operation;
|
||||
this.tempData = [];
|
||||
this.timeCountCommand = -1;
|
||||
this.timeCountConfirm = -1;
|
||||
this.cmdDisabled = [false, true, true];
|
||||
}
|
||||
this.stpDisabled = true;
|
||||
this.dialogShow = true;
|
||||
this.setMessage(this.$t('tip.releaseTip'));
|
||||
this.$nextTick(function () {
|
||||
this.$store.dispatch('training/emitTipFresh');
|
||||
});
|
||||
},
|
||||
doClose() {
|
||||
this.dialogShow = false;
|
||||
this.$store.dispatch('training/emitTipFresh');
|
||||
},
|
||||
command() {
|
||||
if (this.operation == OperationEvent.Station.powerUnLock.menu.operation ||
|
||||
this.order = 0;
|
||||
this.operation = operate.operation;
|
||||
this.tempData = [];
|
||||
this.timeCountCommand = -1;
|
||||
this.timeCountConfirm = -1;
|
||||
this.cmdDisabled = [false, true, true];
|
||||
}
|
||||
this.stpDisabled = true;
|
||||
this.dialogShow = true;
|
||||
this.setMessage(this.$t('tip.releaseTip'));
|
||||
this.$nextTick(function () {
|
||||
this.$store.dispatch('training/emitTipFresh');
|
||||
});
|
||||
},
|
||||
doClose() {
|
||||
this.dialogShow = false;
|
||||
this.$store.dispatch('training/emitTipFresh');
|
||||
},
|
||||
command() {
|
||||
if (this.operation == OperationEvent.Station.powerUnLock.menu.operation ||
|
||||
this.operation == OperationEvent.Station.execKeyOperationTest.menu.operation) {
|
||||
/** 第一步不带弹框处理*/
|
||||
this.commandNoPopUp();
|
||||
} else {
|
||||
/** 第一步带弹框处理*/
|
||||
this.commandHasPopUp();
|
||||
}
|
||||
},
|
||||
commandHasPopUp() {
|
||||
},
|
||||
commandNoPopUp() {
|
||||
let operate = {
|
||||
type: MapDeviceType.Station.type
|
||||
}
|
||||
/** 第一步不带弹框处理*/
|
||||
this.commandNoPopUp();
|
||||
} else {
|
||||
/** 第一步带弹框处理*/
|
||||
this.commandHasPopUp();
|
||||
}
|
||||
},
|
||||
commandHasPopUp() {
|
||||
},
|
||||
commandNoPopUp() {
|
||||
const operate = {
|
||||
type: MapDeviceType.Station.type
|
||||
};
|
||||
|
||||
if (this.operation == OperationEvent.Station.powerUnLock.menu.operation) {
|
||||
/** 上电解锁*/
|
||||
operate.operation = OperationEvent.Station.powerUnLock.order.operation
|
||||
} else if (this.operation == OperationEvent.Station.execKeyOperationTest.menu.operation) {
|
||||
/** 执行关键操作测试*/
|
||||
operate.operation = OperationEvent.Station.execKeyOperationTest.order.operation
|
||||
}
|
||||
if (this.operation == OperationEvent.Station.powerUnLock.menu.operation) {
|
||||
/** 上电解锁*/
|
||||
operate.operation = OperationEvent.Station.powerUnLock.order.operation;
|
||||
} else if (this.operation == OperationEvent.Station.execKeyOperationTest.menu.operation) {
|
||||
/** 执行关键操作测试*/
|
||||
operate.operation = OperationEvent.Station.execKeyOperationTest.order.operation;
|
||||
}
|
||||
|
||||
this.setMessage(this.$t('tip.firstConfirmTip'));
|
||||
this.writeRecord({ order: ++this.order, date: now(), context: this.$t('menu.clickReleaseCommand'), result: '' });
|
||||
this.$store.dispatch('training/next', operate).then(({ valid }) => {
|
||||
if (valid) {
|
||||
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
|
||||
this.setButtonEnable({ step: 1 });
|
||||
this.editRecord({ order: this.order, date: now(), context: this.$t('menu.clickReleaseCommand'), result: this.$t('tip.executionSucceed') });
|
||||
} else {
|
||||
this.editRecord({ order: this.order, date: now(), context: this.$t('menu.clickReleaseCommand'), result: this.$t('tip.executionFailed') });
|
||||
}
|
||||
}).catch(() => {
|
||||
this.editRecord({ order: this.order, date: now(), context: this.$t('menu.clickReleaseCommand'), result: this.$t('tip.executionException') });
|
||||
})
|
||||
},
|
||||
confirm1() {
|
||||
let operate = {
|
||||
type: MapDeviceType.Station.type,
|
||||
}
|
||||
this.setMessage(this.$t('tip.firstConfirmTip'));
|
||||
this.writeRecord({ order: ++this.order, date: now(), context: this.$t('menu.clickReleaseCommand'), result: '' });
|
||||
this.$store.dispatch('training/next', operate).then(({ valid }) => {
|
||||
if (valid) {
|
||||
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
|
||||
this.setButtonEnable({ step: 1 });
|
||||
this.editRecord({ order: this.order, date: now(), context: this.$t('menu.clickReleaseCommand'), result: this.$t('tip.executionSucceed') });
|
||||
} else {
|
||||
this.editRecord({ order: this.order, date: now(), context: this.$t('menu.clickReleaseCommand'), result: this.$t('tip.executionFailed') });
|
||||
}
|
||||
}).catch(() => {
|
||||
this.editRecord({ order: this.order, date: now(), context: this.$t('menu.clickReleaseCommand'), result: this.$t('tip.executionException') });
|
||||
});
|
||||
},
|
||||
confirm1() {
|
||||
const operate = {
|
||||
type: MapDeviceType.Station.type
|
||||
};
|
||||
|
||||
if (this.operation == OperationEvent.Station.powerUnLock.menu.operation) {
|
||||
/** 上电解锁*/
|
||||
operate.operation = OperationEvent.Station.powerUnLock.confirm1.operation;
|
||||
} else if (this.operation == OperationEvent.Station.execKeyOperationTest.menu.operation) {
|
||||
/** 执行关键操作测试*/
|
||||
operate.operation = OperationEvent.Station.execKeyOperationTest.confirm1.operation;
|
||||
}
|
||||
if (this.operation == OperationEvent.Station.powerUnLock.menu.operation) {
|
||||
/** 上电解锁*/
|
||||
operate.operation = OperationEvent.Station.powerUnLock.confirm1.operation;
|
||||
} else if (this.operation == OperationEvent.Station.execKeyOperationTest.menu.operation) {
|
||||
/** 执行关键操作测试*/
|
||||
operate.operation = OperationEvent.Station.execKeyOperationTest.confirm1.operation;
|
||||
}
|
||||
|
||||
this.setMessage(this.$t('tip.secondConfirmTip'));
|
||||
this.writeRecord({ order: ++this.order, date: now(), context: this.$t('menu.clickFirstConfirm'), result: '' });
|
||||
this.$store.dispatch('training/next', operate).then(({ valid }) => {
|
||||
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: this.$t('menu.clickFirstConfirm'), result: this.$t('tip.executionSucceed') });
|
||||
} else {
|
||||
this.editRecord({ order: this.order, date: now(), context: this.$t('menu.clickFirstConfirm'), result: this.$t('tip.executionFailed') });
|
||||
}
|
||||
}).catch(() => {
|
||||
this.editRecord({ order: this.order, date: now(), context: this.$t('menu.clickFirstConfirm'), result: this.$t('tip.executionException') });
|
||||
})
|
||||
},
|
||||
confirm2() {
|
||||
let operate = {
|
||||
send: true,
|
||||
type: MapDeviceType.Station.type
|
||||
}
|
||||
this.setMessage(this.$t('tip.secondConfirmTip'));
|
||||
this.writeRecord({ order: ++this.order, date: now(), context: this.$t('menu.clickFirstConfirm'), result: '' });
|
||||
this.$store.dispatch('training/next', operate).then(({ valid }) => {
|
||||
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: this.$t('menu.clickFirstConfirm'), result: this.$t('tip.executionSucceed') });
|
||||
} else {
|
||||
this.editRecord({ order: this.order, date: now(), context: this.$t('menu.clickFirstConfirm'), result: this.$t('tip.executionFailed') });
|
||||
}
|
||||
}).catch(() => {
|
||||
this.editRecord({ order: this.order, date: now(), context: this.$t('menu.clickFirstConfirm'), result: this.$t('tip.executionException') });
|
||||
});
|
||||
},
|
||||
confirm2() {
|
||||
const operate = {
|
||||
send: true,
|
||||
type: MapDeviceType.Station.type
|
||||
};
|
||||
|
||||
if (this.operation == OperationEvent.Station.powerUnLock.menu.operation) {
|
||||
/** 上电解锁*/
|
||||
operate.operation = OperationEvent.Station.powerUnLock.confirm2.operation;
|
||||
} else if (this.operation == OperationEvent.Station.execKeyOperationTest.menu.operation) {
|
||||
/** 执行关键操作测试*/
|
||||
operate.operation = OperationEvent.Station.execKeyOperationTest.confirm2.operation;
|
||||
}
|
||||
if (this.operation == OperationEvent.Station.powerUnLock.menu.operation) {
|
||||
/** 上电解锁*/
|
||||
operate.operation = OperationEvent.Station.powerUnLock.confirm2.operation;
|
||||
} else if (this.operation == OperationEvent.Station.execKeyOperationTest.menu.operation) {
|
||||
/** 执行关键操作测试*/
|
||||
operate.operation = OperationEvent.Station.execKeyOperationTest.confirm2.operation;
|
||||
}
|
||||
|
||||
this.setMessage('');
|
||||
this.writeRecord({ order: ++this.order, date: now(), context: this.$t('menu.clickSecondConfirm'), result: '' });
|
||||
this.$store.dispatch('training/next', 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: this.$t('menu.clickSecondConfirm'), result: this.$t('tip.executionSucceed') });
|
||||
} else {
|
||||
this.editRecord({ order: this.order, date: now(), context: this.$t('menu.clickSecondConfirm'), result: this.$t('tip.executionFailed') });
|
||||
}
|
||||
}).catch(() => {
|
||||
this.timeCountCommand = -1;
|
||||
this.timeCountConfirm = -1;
|
||||
this.setButtonEnable({ step: -1 });
|
||||
this.editRecord({ order: this.order, date: now(), context: this.$t('menu.clickSecondConfirm'), result: this.$t('tip.executionException') });
|
||||
})
|
||||
},
|
||||
stop() {
|
||||
let operate = {
|
||||
type: MapDeviceType.Station.type,
|
||||
}
|
||||
this.setMessage('');
|
||||
this.writeRecord({ order: ++this.order, date: now(), context: this.$t('menu.clickSecondConfirm'), result: '' });
|
||||
this.$store.dispatch('training/next', 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: this.$t('menu.clickSecondConfirm'), result: this.$t('tip.executionSucceed') });
|
||||
} else {
|
||||
this.editRecord({ order: this.order, date: now(), context: this.$t('menu.clickSecondConfirm'), result: this.$t('tip.executionFailed') });
|
||||
}
|
||||
}).catch(() => {
|
||||
this.timeCountCommand = -1;
|
||||
this.timeCountConfirm = -1;
|
||||
this.setButtonEnable({ step: -1 });
|
||||
this.editRecord({ order: this.order, date: now(), context: this.$t('menu.clickSecondConfirm'), result: this.$t('tip.executionException') });
|
||||
});
|
||||
},
|
||||
stop() {
|
||||
const operate = {
|
||||
type: MapDeviceType.Station.type
|
||||
};
|
||||
|
||||
if (this.operation == OperationEvent.Station.powerUnLock.menu.operation) {
|
||||
/** 上电解锁*/
|
||||
operate.operation = OperationEvent.Station.powerUnLock.stop.operation;
|
||||
} else if (this.operation == OperationEvent.Station.execKeyOperationTest.menu.operation) {
|
||||
/** 执行关键操作测试*/
|
||||
operate.operation = OperationEvent.Station.execKeyOperationTest.stop.operation;
|
||||
}
|
||||
if (this.operation == OperationEvent.Station.powerUnLock.menu.operation) {
|
||||
/** 上电解锁*/
|
||||
operate.operation = OperationEvent.Station.powerUnLock.stop.operation;
|
||||
} else if (this.operation == OperationEvent.Station.execKeyOperationTest.menu.operation) {
|
||||
/** 执行关键操作测试*/
|
||||
operate.operation = OperationEvent.Station.execKeyOperationTest.stop.operation;
|
||||
}
|
||||
|
||||
this.writeRecord({ order: ++this.order, date: now(), context: this.$t('menu.clickSuspend'), result: '' });
|
||||
this.$store.dispatch('training/next', operate).then(({ valid }) => {
|
||||
if (valid) {
|
||||
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
|
||||
this.setButtonEnable({ step: 0 });
|
||||
this.editRecord({ order: this.order, date: now(), context: this.$t('menu.clickSuspend'), result: this.$t('tip.executionSucceed') });
|
||||
} else {
|
||||
this.editRecord({ order: this.order, date: now(), context: this.$t('menu.clickSuspend'), result: this.$t('tip.executionFailed') });
|
||||
}
|
||||
}).catch(error => {
|
||||
this.editRecord({ order: this.order, date: now(), context: this.$t('menu.clickSuspend'), result: this.$t('tip.executionException') });
|
||||
})
|
||||
},
|
||||
close() {
|
||||
let operate = {
|
||||
type: MapDeviceType.Station.type,
|
||||
operation: OperationEvent.Command.close.menu.operation,
|
||||
}
|
||||
this.writeRecord({ order: ++this.order, date: now(), context: this.$t('menu.clickSuspend'), result: '' });
|
||||
this.$store.dispatch('training/next', operate).then(({ valid }) => {
|
||||
if (valid) {
|
||||
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
|
||||
this.setButtonEnable({ step: 0 });
|
||||
this.editRecord({ order: this.order, date: now(), context: this.$t('menu.clickSuspend'), result: this.$t('tip.executionSucceed') });
|
||||
} else {
|
||||
this.editRecord({ order: this.order, date: now(), context: this.$t('menu.clickSuspend'), result: this.$t('tip.executionFailed') });
|
||||
}
|
||||
}).catch(() => {
|
||||
this.editRecord({ order: this.order, date: now(), context: this.$t('menu.clickSuspend'), result: this.$t('tip.executionException') });
|
||||
});
|
||||
},
|
||||
close() {
|
||||
const operate = {
|
||||
type: MapDeviceType.Station.type,
|
||||
operation: OperationEvent.Command.close.menu.operation
|
||||
};
|
||||
|
||||
this.$store.dispatch('training/next', operate).then(({ valid }) => {
|
||||
if (valid) {
|
||||
this.doClose();
|
||||
}
|
||||
}).catch(error => {
|
||||
this.doClose();
|
||||
});
|
||||
},
|
||||
getOperate(operate) {
|
||||
/** 弹框返回值处理*/
|
||||
},
|
||||
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];
|
||||
}
|
||||
}
|
||||
})
|
||||
}
|
||||
}
|
||||
}
|
||||
this.$store.dispatch('training/next', operate).then(({ valid }) => {
|
||||
if (valid) {
|
||||
this.doClose();
|
||||
}
|
||||
}).catch(() => {
|
||||
this.doClose();
|
||||
});
|
||||
},
|
||||
getOperate(operate) {
|
||||
/** 弹框返回值处理*/
|
||||
},
|
||||
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,109 +1,119 @@
|
||||
<template>
|
||||
<el-dialog class="fuzhou-01__systerm station-human-control-all" :title="title" :visible.sync="show" width="430px"
|
||||
:before-close="doClose" :zIndex="2000" :modal="false" :close-on-click-modal="false" append-to-body v-dialogDrag>
|
||||
<div class="context">
|
||||
<span>{{title}}</span>
|
||||
</div>
|
||||
<el-row justify="center" class="button-group">
|
||||
<el-col :span="10" :offset="2">
|
||||
<el-button :id="domIdConfirm" type="primary" :loading="loading" @click="commit">{{$t('global.confirm')}}</el-button>
|
||||
</el-col>
|
||||
<el-col :span="8" :offset="4">
|
||||
<el-button :id="domIdCancel" @click="cancel">{{$t('global.cancel')}}</el-button>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<notice-info ref="noticeInfo"></notice-info>
|
||||
</el-dialog>
|
||||
<el-dialog
|
||||
v-dialogDrag
|
||||
class="fuzhou-01__systerm station-human-control-all"
|
||||
:title="title"
|
||||
:visible.sync="show"
|
||||
width="430px"
|
||||
:before-close="doClose"
|
||||
:z-index="2000"
|
||||
:modal="false"
|
||||
:close-on-click-modal="false"
|
||||
append-to-body
|
||||
>
|
||||
<div class="context">
|
||||
<span>{{ title }}</span>
|
||||
</div>
|
||||
<el-row justify="center" class="button-group">
|
||||
<el-col :span="10" :offset="2">
|
||||
<el-button :id="domIdConfirm" type="primary" :loading="loading" @click="commit">{{ $t('global.confirm') }}</el-button>
|
||||
</el-col>
|
||||
<el-col :span="8" :offset="4">
|
||||
<el-button :id="domIdCancel" @click="cancel">{{ $t('global.cancel') }}</el-button>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<notice-info ref="noticeInfo" />
|
||||
</el-dialog>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import { MapDeviceType, OperationEvent } from '@/scripts/ConstDic';
|
||||
import NoticeInfo from './childDialog/childDialog/noticeInfo'
|
||||
import { MapDeviceType, OperationEvent } from '@/scripts/ConstDic';
|
||||
import NoticeInfo from './childDialog/childDialog/noticeInfo';
|
||||
|
||||
export default {
|
||||
name: 'StationHumanControlAll',
|
||||
data() {
|
||||
return {
|
||||
dialogShow: false,
|
||||
loading: false,
|
||||
operation: null
|
||||
}
|
||||
},
|
||||
components: {
|
||||
NoticeInfo
|
||||
},
|
||||
computed: {
|
||||
show() {
|
||||
return this.dialogShow && !this.$store.state.menuOperation.break;
|
||||
},
|
||||
title() {
|
||||
return this.$t('menu.fullConcentrationStationAccessManualControl');
|
||||
},
|
||||
domIdCancel() {
|
||||
return this.dialogShow ? OperationEvent.Command.cancel.menu.domId : '';
|
||||
},
|
||||
domIdConfirm() {
|
||||
return this.dialogShow ? OperationEvent.Station.humanControlALL.menu.domId : '';
|
||||
},
|
||||
},
|
||||
mounted() {
|
||||
this.$nextTick(() => {
|
||||
this.$store.dispatch('training/tipReload');
|
||||
})
|
||||
},
|
||||
methods: {
|
||||
doShow(operate) {
|
||||
if (!this.dialogShow) {
|
||||
this.loading = false;
|
||||
this.operation = operate.operation;
|
||||
}
|
||||
export default {
|
||||
name: 'StationHumanControlAll',
|
||||
components: {
|
||||
NoticeInfo
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
dialogShow: false,
|
||||
loading: false,
|
||||
operation: null
|
||||
};
|
||||
},
|
||||
computed: {
|
||||
show() {
|
||||
return this.dialogShow && !this.$store.state.menuOperation.break;
|
||||
},
|
||||
title() {
|
||||
return this.$t('menu.fullConcentrationStationAccessManualControl');
|
||||
},
|
||||
domIdCancel() {
|
||||
return this.dialogShow ? OperationEvent.Command.cancel.menu.domId : '';
|
||||
},
|
||||
domIdConfirm() {
|
||||
return this.dialogShow ? OperationEvent.Station.humanControlALL.menu.domId : '';
|
||||
}
|
||||
},
|
||||
mounted() {
|
||||
this.$nextTick(() => {
|
||||
this.$store.dispatch('training/tipReload');
|
||||
});
|
||||
},
|
||||
methods: {
|
||||
doShow(operate) {
|
||||
if (!this.dialogShow) {
|
||||
this.loading = false;
|
||||
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('training/emitTipFresh');
|
||||
},
|
||||
commit() {
|
||||
let operate = {
|
||||
send: true,
|
||||
type: MapDeviceType.Station.type,
|
||||
label: MapDeviceType.Station.label,
|
||||
operation: OperationEvent.Station.humanControlALL.menu.operation
|
||||
};
|
||||
this.dialogShow = true;
|
||||
this.$nextTick(function () {
|
||||
this.$store.dispatch('training/emitTipFresh');
|
||||
});
|
||||
},
|
||||
doClose() {
|
||||
this.loading = false;
|
||||
this.dialogShow = false;
|
||||
this.$store.dispatch('training/emitTipFresh');
|
||||
},
|
||||
commit() {
|
||||
const operate = {
|
||||
send: true,
|
||||
type: MapDeviceType.Station.type,
|
||||
label: MapDeviceType.Station.label,
|
||||
operation: OperationEvent.Station.humanControlALL.menu.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: MapDeviceType.Station.type,
|
||||
operation: OperationEvent.Command.cancel.menu.operation,
|
||||
}
|
||||
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.Station.type,
|
||||
operation: OperationEvent.Command.cancel.menu.operation
|
||||
};
|
||||
|
||||
this.$store.dispatch('training/next', operate).then(({ valid }) => {
|
||||
if (valid) {
|
||||
this.doClose();
|
||||
}
|
||||
}).catch(error => {
|
||||
this.doClose();
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
this.$store.dispatch('training/next', operate).then(({ valid }) => {
|
||||
if (valid) {
|
||||
this.doClose();
|
||||
}
|
||||
}).catch(() => {
|
||||
this.doClose();
|
||||
});
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
</script>
|
||||
<style>
|
||||
|
@ -1,129 +1,138 @@
|
||||
<template>
|
||||
<el-dialog class="fuzhou-01__systerm station-set-route-control-all" :title="title" :visible.sync="show"
|
||||
width="450px" :before-close="doClose" :zIndex="2000" :modal="false" :close-on-click-modal="false" append-to-body
|
||||
v-dialogDrag>
|
||||
<div style="padding: 0px 10px">
|
||||
<el-form size="small" label-width="110px" label-position="left" ref="form">
|
||||
<el-form-item :label="this.$t('menu.concentratedStationName')" prop="stationName">
|
||||
<el-input v-model="stationName" size="small" disabled></el-input>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
<el-radio-group v-model="mode">
|
||||
<el-row>
|
||||
<el-radio :label="true">{{$t('menu.checkConflict')}}</el-radio>
|
||||
</el-row>
|
||||
<el-row style="margin-top: 20px">
|
||||
<el-radio :label="false">{{$t('menu.notCheckConflict')}}</el-radio>
|
||||
</el-row>
|
||||
</el-radio-group>
|
||||
</div>
|
||||
<el-row justify="center" class="button-group">
|
||||
<el-col :span="10" :offset="2">
|
||||
<el-button :id="domIdConfirm" type="primary" :loading="loading" @click="commit">{{$t('global.confirm')}}</el-button>
|
||||
</el-col>
|
||||
<el-col :span="8" :offset="4">
|
||||
<el-button :id="domIdCancel" @click="cancel">{{$t('global.cancel')}}</el-button>
|
||||
</el-col>
|
||||
<el-dialog
|
||||
v-dialogDrag
|
||||
class="fuzhou-01__systerm station-set-route-control-all"
|
||||
:title="title"
|
||||
:visible.sync="show"
|
||||
width="450px"
|
||||
:before-close="doClose"
|
||||
:z-index="2000"
|
||||
:modal="false"
|
||||
:close-on-click-modal="false"
|
||||
append-to-body
|
||||
>
|
||||
<div style="padding: 0px 10px">
|
||||
<el-form ref="form" size="small" label-width="110px" label-position="left">
|
||||
<el-form-item :label="this.$t('menu.concentratedStationName')" prop="stationName">
|
||||
<el-input v-model="stationName" size="small" disabled />
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
<el-radio-group v-model="mode">
|
||||
<el-row>
|
||||
<el-radio :label="true">{{ $t('menu.checkConflict') }}</el-radio>
|
||||
</el-row>
|
||||
<notice-info ref="noticeInfo"></notice-info>
|
||||
</el-dialog>
|
||||
<el-row style="margin-top: 20px">
|
||||
<el-radio :label="false">{{ $t('menu.notCheckConflict') }}</el-radio>
|
||||
</el-row>
|
||||
</el-radio-group>
|
||||
</div>
|
||||
<el-row justify="center" class="button-group">
|
||||
<el-col :span="10" :offset="2">
|
||||
<el-button :id="domIdConfirm" type="primary" :loading="loading" @click="commit">{{ $t('global.confirm') }}</el-button>
|
||||
</el-col>
|
||||
<el-col :span="8" :offset="4">
|
||||
<el-button :id="domIdCancel" @click="cancel">{{ $t('global.cancel') }}</el-button>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<notice-info ref="noticeInfo" />
|
||||
</el-dialog>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import { MapDeviceType, OperationEvent } from '@/scripts/ConstDic';
|
||||
import NoticeInfo from './childDialog/childDialog/noticeInfo'
|
||||
import { MapDeviceType, OperationEvent } from '@/scripts/ConstDic';
|
||||
import NoticeInfo from './childDialog/childDialog/noticeInfo';
|
||||
|
||||
export default {
|
||||
name: 'StationSetRouteControlAll',
|
||||
data() {
|
||||
return {
|
||||
dialogShow: false,
|
||||
loading: false,
|
||||
operation: null,
|
||||
stationName: '',
|
||||
mode: true,
|
||||
}
|
||||
},
|
||||
components: {
|
||||
NoticeInfo
|
||||
},
|
||||
computed: {
|
||||
show() {
|
||||
return this.dialogShow && !this.$store.state.menuOperation.break;
|
||||
},
|
||||
title() {
|
||||
return this.$t('menu.fullConcentrationStationSettingAccessControlMode');
|
||||
},
|
||||
domIdCancel() {
|
||||
return this.dialogShow ? OperationEvent.Command.cancel.menu.domId : '';
|
||||
},
|
||||
domIdConfirm() {
|
||||
return this.dialogShow ? OperationEvent.Station.atsAutoControlALL.menu.domId : '';
|
||||
},
|
||||
},
|
||||
mounted() {
|
||||
this.$nextTick(() => {
|
||||
this.$store.dispatch('training/tipReload');
|
||||
})
|
||||
},
|
||||
methods: {
|
||||
doShow(operate, selected) {
|
||||
if (!this.dialogShow) {
|
||||
this.loading = false;
|
||||
this.operation = operate.operation;
|
||||
this.stationName = '';
|
||||
if (selected) {
|
||||
this.stationName = selected.name;
|
||||
}
|
||||
}
|
||||
export default {
|
||||
name: 'StationSetRouteControlAll',
|
||||
components: {
|
||||
NoticeInfo
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
dialogShow: false,
|
||||
loading: false,
|
||||
operation: null,
|
||||
stationName: '',
|
||||
mode: true
|
||||
};
|
||||
},
|
||||
computed: {
|
||||
show() {
|
||||
return this.dialogShow && !this.$store.state.menuOperation.break;
|
||||
},
|
||||
title() {
|
||||
return this.$t('menu.fullConcentrationStationSettingAccessControlMode');
|
||||
},
|
||||
domIdCancel() {
|
||||
return this.dialogShow ? OperationEvent.Command.cancel.menu.domId : '';
|
||||
},
|
||||
domIdConfirm() {
|
||||
return this.dialogShow ? OperationEvent.Station.atsAutoControlALL.menu.domId : '';
|
||||
}
|
||||
},
|
||||
mounted() {
|
||||
this.$nextTick(() => {
|
||||
this.$store.dispatch('training/tipReload');
|
||||
});
|
||||
},
|
||||
methods: {
|
||||
doShow(operate, selected) {
|
||||
if (!this.dialogShow) {
|
||||
this.loading = false;
|
||||
this.operation = operate.operation;
|
||||
this.stationName = '';
|
||||
if (selected) {
|
||||
this.stationName = selected.name;
|
||||
}
|
||||
}
|
||||
|
||||
this.dialogShow = true;
|
||||
this.$nextTick(function () {
|
||||
this.$store.dispatch('training/emitTipFresh');
|
||||
});
|
||||
},
|
||||
doClose() {
|
||||
this.loading = false;
|
||||
this.dialogShow = false;
|
||||
this.$store.dispatch('training/emitTipFresh');
|
||||
},
|
||||
commit() {
|
||||
let operate = {
|
||||
send: true,
|
||||
type: MapDeviceType.Station.type,
|
||||
label: MapDeviceType.Station.label,
|
||||
operation: OperationEvent.Station.atsAutoControlALL.menu.operation,
|
||||
val: this.mode
|
||||
};
|
||||
this.dialogShow = true;
|
||||
this.$nextTick(function () {
|
||||
this.$store.dispatch('training/emitTipFresh');
|
||||
});
|
||||
},
|
||||
doClose() {
|
||||
this.loading = false;
|
||||
this.dialogShow = false;
|
||||
this.$store.dispatch('training/emitTipFresh');
|
||||
},
|
||||
commit() {
|
||||
const operate = {
|
||||
send: true,
|
||||
type: MapDeviceType.Station.type,
|
||||
label: MapDeviceType.Station.label,
|
||||
operation: OperationEvent.Station.atsAutoControlALL.menu.operation,
|
||||
val: this.mode
|
||||
};
|
||||
|
||||
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: MapDeviceType.Station.type,
|
||||
operation: OperationEvent.Command.cancel.menu.operation,
|
||||
}
|
||||
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.Station.type,
|
||||
operation: OperationEvent.Command.cancel.menu.operation
|
||||
};
|
||||
|
||||
this.$store.dispatch('training/next', operate).then(({ valid }) => {
|
||||
if (valid) {
|
||||
this.doClose();
|
||||
}
|
||||
}).catch(error => {
|
||||
this.doClose();
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
this.$store.dispatch('training/next', operate).then(({ valid }) => {
|
||||
if (valid) {
|
||||
this.doClose();
|
||||
}
|
||||
}).catch(() => {
|
||||
this.doClose();
|
||||
});
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
</script>
|
||||
<style>
|
||||
|
@ -1,457 +1,481 @@
|
||||
<template>
|
||||
<div>
|
||||
<el-dialog class="fuzhou-01__systerm switch-cmd-control" :title="title" :visible.sync="show" width="840px"
|
||||
:before-close="doClose" :zIndex="2000" :modal="false" :close-on-click-modal="false" v-dialogDrag>
|
||||
<div style="padding: 10px 20px; border: 1px solid lightgray;">
|
||||
<span class="base-label">{{$t('menu.commandInformation')}}</span>
|
||||
<el-form label-position="center" size="mini">
|
||||
<el-row>
|
||||
<el-col :span="8">
|
||||
<el-form-item :label="this.$t('menu.type')" 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-option>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="8">
|
||||
<el-form-item :label="this.$t('menu.stationName')" label-width="80px">
|
||||
<el-input v-model="stationName" size="small" disabled></el-input>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="8">
|
||||
<el-form-item :label="this.$t('menu.switchName')" label-width="80px">
|
||||
<el-input v-model="switchName" size="small" disabled></el-input>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
</el-form>
|
||||
</div>
|
||||
<el-table class="table" ref="tempData" :data="tempData" border style="width: 100%" size="mini"
|
||||
highlight-current-row height="200">
|
||||
<el-table-column prop="order" :width="110" :label="this.$t('menu.serialNumber2')">
|
||||
</el-table-column>
|
||||
<el-table-column prop="date" :width="160" :label="this.$t('menu.time')">
|
||||
</el-table-column>
|
||||
<el-table-column prop="context" :width="180" :label="this.$t('menu.implementationProcess')">
|
||||
</el-table-column>
|
||||
<el-table-column prop="result" :label="this.$t('menu.executionResult')">
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
<span class="notice">{{message}}</span>
|
||||
<el-row class="button-group">
|
||||
<el-col :span="2" :offset="3">
|
||||
<el-button :id="domIdCommand" type="primary" :disabled="cmdDisabled[0]" @click="command">{{$t('menu.release')}}<span
|
||||
v-show="timeCountCommand>0">({{timeCountCommand}})</span></el-button>
|
||||
</el-col>
|
||||
<el-col :span="2" :offset="1">
|
||||
<el-button :id="domIdConfirm1" type="primary" style="width:120px;" :disabled="cmdDisabled[1]" @click="confirm1">{{$t('menu.firstConfirm')}}
|
||||
</el-button>
|
||||
</el-col>
|
||||
<el-col :span="2" :offset="2">
|
||||
<el-button :id="domIdConfirm2" type="primary" style="width:120px;" :disabled="cmdDisabled[2]" @click="confirm2">{{$t('menu.secondConfirm')}}<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">{{$t('menu.suspend')}}</el-button>
|
||||
</el-col>
|
||||
<el-col :span="2" :offset="1">
|
||||
<el-button :id="domIdClose" @click="close">{{$t('global.close')}}</el-button>
|
||||
</el-col>
|
||||
</el-row>
|
||||
</el-dialog>
|
||||
</div>
|
||||
<div>
|
||||
<el-dialog
|
||||
v-dialogDrag
|
||||
class="fuzhou-01__systerm switch-cmd-control"
|
||||
:title="title"
|
||||
:visible.sync="show"
|
||||
width="840px"
|
||||
: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">{{ $t('menu.commandInformation') }}</span>
|
||||
<el-form label-position="center" size="mini">
|
||||
<el-row>
|
||||
<el-col :span="8">
|
||||
<el-form-item :label="this.$t('menu.type')" 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="this.$t('menu.stationName')" label-width="80px">
|
||||
<el-input v-model="stationName" size="small" disabled />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="8">
|
||||
<el-form-item :label="this.$t('menu.switchName')" label-width="80px">
|
||||
<el-input v-model="switchName" 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="110" :label="this.$t('menu.serialNumber2')" />
|
||||
<el-table-column prop="date" :width="160" :label="this.$t('menu.time')" />
|
||||
<el-table-column prop="context" :width="180" :label="this.$t('menu.implementationProcess')" />
|
||||
<el-table-column prop="result" :label="this.$t('menu.executionResult')" />
|
||||
</el-table>
|
||||
<span class="notice">{{ message }}</span>
|
||||
<el-row class="button-group">
|
||||
<el-col :span="2" :offset="3">
|
||||
<el-button :id="domIdCommand" type="primary" :disabled="cmdDisabled[0]" @click="command">{{ $t('menu.release') }}<span
|
||||
v-show="timeCountCommand>0"
|
||||
>({{ timeCountCommand }})</span></el-button>
|
||||
</el-col>
|
||||
<el-col :span="2" :offset="1">
|
||||
<el-button :id="domIdConfirm1" type="primary" style="width:120px;" :disabled="cmdDisabled[1]" @click="confirm1">{{ $t('menu.firstConfirm') }}
|
||||
</el-button>
|
||||
</el-col>
|
||||
<el-col :span="2" :offset="2">
|
||||
<el-button :id="domIdConfirm2" type="primary" style="width:120px;" :disabled="cmdDisabled[2]" @click="confirm2">{{ $t('menu.secondConfirm') }}<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">{{ $t('menu.suspend') }}</el-button>
|
||||
</el-col>
|
||||
<el-col :span="2" :offset="1">
|
||||
<el-button :id="domIdClose" @click="close">{{ $t('global.close') }}</el-button>
|
||||
</el-col>
|
||||
</el-row>
|
||||
</el-dialog>
|
||||
</div>
|
||||
</template>
|
||||
<script>
|
||||
import { MapDeviceType, OperationEvent } from '@/scripts/ConstDic';
|
||||
import { now } from '@/utils/date';
|
||||
import { MapDeviceType, OperationEvent } from '@/scripts/ConstDic';
|
||||
import { now } from '@/utils/date';
|
||||
|
||||
export default {
|
||||
name: 'SwitchCmdControl',
|
||||
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: '',
|
||||
switchName: ''
|
||||
}
|
||||
},
|
||||
computed: {
|
||||
typeList() {
|
||||
return [
|
||||
{ code: OperationEvent.Switch.unlock.menu.operation, name: this.$t('menu.menuSwitch.switchUnlock') },
|
||||
{ code: OperationEvent.Switch.unblock.menu.operation, name: this.$t('menu.menuSwitch.switchSectionUnblock') },
|
||||
{ code: OperationEvent.Switch.fault.menu.operation, name: this.$t('menu.menuSwitch.switchMalfunctionUnlock') },
|
||||
{ code: OperationEvent.Switch.axlePreReset.menu.operation, name: this.$t('menu.menuSwitch.switchSectionAxisPreReset') },
|
||||
]
|
||||
},
|
||||
show() {
|
||||
return this.dialogShow && !this.$store.state.menuOperation.break;
|
||||
},
|
||||
domIdCommand() {
|
||||
if (this.dialogShow) {
|
||||
if (this.operation == OperationEvent.Switch.unlock.menu.operation) {
|
||||
/** 道岔单解*/
|
||||
return OperationEvent.Switch.unlock.order.domId;
|
||||
} else if (this.operation == OperationEvent.Switch.unblock.menu.operation) {
|
||||
/** 道岔解封*/
|
||||
return OperationEvent.Switch.unblock.order.domId;
|
||||
} else if (this.operation == OperationEvent.Switch.fault.menu.operation) {
|
||||
/** 道岔故障解锁*/
|
||||
return OperationEvent.Switch.fault.order.domId;
|
||||
} else if (this.operation == OperationEvent.Switch.axlePreReset.menu.operation) {
|
||||
/** 道岔计轴复位*/
|
||||
return OperationEvent.Switch.axlePreReset.order.domId;
|
||||
}
|
||||
}
|
||||
},
|
||||
domIdConfirm1() {
|
||||
if (this.dialogShow) {
|
||||
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;
|
||||
} else if (this.operation == OperationEvent.Switch.fault.menu.operation) {
|
||||
/** 道岔故障解锁*/
|
||||
return OperationEvent.Switch.fault.confirm1.domId;
|
||||
} else if (this.operation == OperationEvent.Switch.axlePreReset.menu.operation) {
|
||||
/** 道岔计轴复位*/
|
||||
return OperationEvent.Switch.axlePreReset.confirm1.domId;
|
||||
}
|
||||
}
|
||||
},
|
||||
domIdConfirm2() {
|
||||
if (this.dialogShow) {
|
||||
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;
|
||||
} else if (this.operation == OperationEvent.Switch.fault.menu.operation) {
|
||||
/** 道岔故障解锁*/
|
||||
return OperationEvent.Switch.fault.confirm2.domId;
|
||||
} else if (this.operation == OperationEvent.Switch.axlePreReset.menu.operation) {
|
||||
/** 道岔计轴复位*/
|
||||
return OperationEvent.Switch.axlePreReset.confirm2.domId;
|
||||
}
|
||||
}
|
||||
},
|
||||
domIdStop() {
|
||||
if (this.dialogShow) {
|
||||
if (this.operation == OperationEvent.Switch.unlock.menu.operation) {
|
||||
/** 道岔单解*/
|
||||
return OperationEvent.Switch.unlock.stop.domId;
|
||||
} else if (this.operation == OperationEvent.Switch.unblock.menu.operation) {
|
||||
/** 道岔解封*/
|
||||
return OperationEvent.Switch.unblock.stop.domId;
|
||||
} else if (this.operation == OperationEvent.Switch.fault.menu.operation) {
|
||||
/** 道岔故障解锁*/
|
||||
return OperationEvent.Switch.fault.stop.domId;
|
||||
} else if (this.operation == OperationEvent.Switch.axlePreReset.menu.operation) {
|
||||
/** 道岔计轴复位*/
|
||||
return OperationEvent.Switch.axlePreReset.stop.domId;
|
||||
}
|
||||
}
|
||||
},
|
||||
domIdClose() {
|
||||
if (this.dialogShow) {
|
||||
return OperationEvent.Command.close.menu.domId;
|
||||
}
|
||||
},
|
||||
title() {
|
||||
if (this.dialogShow) {
|
||||
if (this.operation == OperationEvent.Switch.unlock.menu.operation) {
|
||||
return '道岔单解';
|
||||
} else if (this.operation == OperationEvent.Switch.unblock.menu.operation) {
|
||||
return '道岔解封';
|
||||
} else if (this.operation == OperationEvent.Switch.fault.menu.operation) {
|
||||
return '道岔故障解锁';
|
||||
} else if (this.operation == OperationEvent.Switch.axlePreReset.menu.operation) {
|
||||
return '道岔计轴复位';
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
watch: {
|
||||
cmdDisabled: {
|
||||
handler(val, oldVal) {
|
||||
this.stpDisabled = true;
|
||||
val.forEach((elem, index) => {
|
||||
// 在确定1之前的操作才可以终止
|
||||
if (elem == false && 1 <= index && 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) {
|
||||
if (!this.dialogShow) {
|
||||
this.switchName = '';
|
||||
this.stationName = '';
|
||||
if (selected && selected._type.toUpperCase() === 'Switch'.toUpperCase()) {
|
||||
this.switchName = selected.name
|
||||
let station = this.$store.getters['map/getDeviceByCode'](selected.stationCode);
|
||||
if (station) {
|
||||
this.stationName = station.name;
|
||||
}
|
||||
this.selected = selected;
|
||||
}
|
||||
export default {
|
||||
name: 'SwitchCmdControl',
|
||||
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: '',
|
||||
switchName: ''
|
||||
};
|
||||
},
|
||||
computed: {
|
||||
typeList() {
|
||||
return [
|
||||
{ code: OperationEvent.Switch.unlock.menu.operation, name: this.$t('menu.menuSwitch.switchUnlock') },
|
||||
{ code: OperationEvent.Switch.unblock.menu.operation, name: this.$t('menu.menuSwitch.switchSectionUnblock') },
|
||||
{ code: OperationEvent.Switch.fault.menu.operation, name: this.$t('menu.menuSwitch.switchMalfunctionUnlock') },
|
||||
{ code: OperationEvent.Switch.axlePreReset.menu.operation, name: this.$t('menu.menuSwitch.switchSectionAxisPreReset') }
|
||||
];
|
||||
},
|
||||
show() {
|
||||
return this.dialogShow && !this.$store.state.menuOperation.break;
|
||||
},
|
||||
domIdCommand() {
|
||||
if (this.dialogShow) {
|
||||
if (this.operation == OperationEvent.Switch.unlock.menu.operation) {
|
||||
/** 道岔单解*/
|
||||
return OperationEvent.Switch.unlock.order.domId;
|
||||
} else if (this.operation == OperationEvent.Switch.unblock.menu.operation) {
|
||||
/** 道岔解封*/
|
||||
return OperationEvent.Switch.unblock.order.domId;
|
||||
} else if (this.operation == OperationEvent.Switch.fault.menu.operation) {
|
||||
/** 道岔故障解锁*/
|
||||
return OperationEvent.Switch.fault.order.domId;
|
||||
} else if (this.operation == OperationEvent.Switch.axlePreReset.menu.operation) {
|
||||
/** 道岔计轴复位*/
|
||||
return OperationEvent.Switch.axlePreReset.order.domId;
|
||||
}
|
||||
}
|
||||
return '';
|
||||
},
|
||||
domIdConfirm1() {
|
||||
if (this.dialogShow) {
|
||||
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;
|
||||
} else if (this.operation == OperationEvent.Switch.fault.menu.operation) {
|
||||
/** 道岔故障解锁*/
|
||||
return OperationEvent.Switch.fault.confirm1.domId;
|
||||
} else if (this.operation == OperationEvent.Switch.axlePreReset.menu.operation) {
|
||||
/** 道岔计轴复位*/
|
||||
return OperationEvent.Switch.axlePreReset.confirm1.domId;
|
||||
}
|
||||
}
|
||||
return '';
|
||||
},
|
||||
domIdConfirm2() {
|
||||
if (this.dialogShow) {
|
||||
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;
|
||||
} else if (this.operation == OperationEvent.Switch.fault.menu.operation) {
|
||||
/** 道岔故障解锁*/
|
||||
return OperationEvent.Switch.fault.confirm2.domId;
|
||||
} else if (this.operation == OperationEvent.Switch.axlePreReset.menu.operation) {
|
||||
/** 道岔计轴复位*/
|
||||
return OperationEvent.Switch.axlePreReset.confirm2.domId;
|
||||
}
|
||||
}
|
||||
return '';
|
||||
},
|
||||
domIdStop() {
|
||||
if (this.dialogShow) {
|
||||
if (this.operation == OperationEvent.Switch.unlock.menu.operation) {
|
||||
/** 道岔单解*/
|
||||
return OperationEvent.Switch.unlock.stop.domId;
|
||||
} else if (this.operation == OperationEvent.Switch.unblock.menu.operation) {
|
||||
/** 道岔解封*/
|
||||
return OperationEvent.Switch.unblock.stop.domId;
|
||||
} else if (this.operation == OperationEvent.Switch.fault.menu.operation) {
|
||||
/** 道岔故障解锁*/
|
||||
return OperationEvent.Switch.fault.stop.domId;
|
||||
} else if (this.operation == OperationEvent.Switch.axlePreReset.menu.operation) {
|
||||
/** 道岔计轴复位*/
|
||||
return OperationEvent.Switch.axlePreReset.stop.domId;
|
||||
}
|
||||
}
|
||||
return '';
|
||||
},
|
||||
domIdClose() {
|
||||
if (this.dialogShow) {
|
||||
return OperationEvent.Command.close.menu.domId;
|
||||
}
|
||||
return '';
|
||||
},
|
||||
title() {
|
||||
if (this.dialogShow) {
|
||||
if (this.operation == OperationEvent.Switch.unlock.menu.operation) {
|
||||
return '道岔单解';
|
||||
} else if (this.operation == OperationEvent.Switch.unblock.menu.operation) {
|
||||
return '道岔解封';
|
||||
} else if (this.operation == OperationEvent.Switch.fault.menu.operation) {
|
||||
return '道岔故障解锁';
|
||||
} else if (this.operation == OperationEvent.Switch.axlePreReset.menu.operation) {
|
||||
return '道岔计轴复位';
|
||||
}
|
||||
}
|
||||
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) {
|
||||
if (!this.dialogShow) {
|
||||
this.switchName = '';
|
||||
this.stationName = '';
|
||||
if (selected && selected._type.toUpperCase() === 'Switch'.toUpperCase()) {
|
||||
this.switchName = selected.name;
|
||||
const station = this.$store.getters['map/getDeviceByCode'](selected.stationCode);
|
||||
if (station) {
|
||||
this.stationName = station.name;
|
||||
}
|
||||
this.selected = selected;
|
||||
}
|
||||
|
||||
this.order = 0;
|
||||
this.operation = operate.operation;
|
||||
this.dialogShow = true;
|
||||
this.tempData = [];
|
||||
this.timeCountCommand = -1;
|
||||
this.timeCountConfirm = -1;
|
||||
this.cmdDisabled = [false, true, true];
|
||||
}
|
||||
this.stpDisabled = true;
|
||||
this.setMessage(this.$t('tip.releaseTip'));
|
||||
this.$nextTick(function () {
|
||||
this.$store.dispatch('training/emitTipFresh');
|
||||
});
|
||||
},
|
||||
doClose() {
|
||||
this.dialogShow = false;
|
||||
this.$store.dispatch('training/emitTipFresh');
|
||||
},
|
||||
command() {
|
||||
/** 道岔单解/道岔解封/道岔故障解锁/道岔计轴复位*/
|
||||
if (this.operation == OperationEvent.Switch.unlock.menu.operation ||
|
||||
this.order = 0;
|
||||
this.operation = operate.operation;
|
||||
this.dialogShow = true;
|
||||
this.tempData = [];
|
||||
this.timeCountCommand = -1;
|
||||
this.timeCountConfirm = -1;
|
||||
this.cmdDisabled = [false, true, true];
|
||||
}
|
||||
this.stpDisabled = true;
|
||||
this.setMessage(this.$t('tip.releaseTip'));
|
||||
this.$nextTick(function () {
|
||||
this.$store.dispatch('training/emitTipFresh');
|
||||
});
|
||||
},
|
||||
doClose() {
|
||||
this.dialogShow = false;
|
||||
this.$store.dispatch('training/emitTipFresh');
|
||||
},
|
||||
command() {
|
||||
/** 道岔单解/道岔解封/道岔故障解锁/道岔计轴复位*/
|
||||
if (this.operation == OperationEvent.Switch.unlock.menu.operation ||
|
||||
this.operation == OperationEvent.Switch.unblock.menu.operation ||
|
||||
this.operation == OperationEvent.Switch.fault.menu.operation ||
|
||||
this.operation == OperationEvent.Switch.axlePreReset.menu.operation ||
|
||||
this.operation == OperationEvent.Switch.cancelSpeed.menu.operation) {
|
||||
/** 第一步不带弹框处理*/
|
||||
this.commandNoPopUp();
|
||||
} else {
|
||||
/** 第一步带弹框处理*/
|
||||
this.commandHasPopUp();
|
||||
}
|
||||
},
|
||||
commandHasPopUp() {
|
||||
/** 第一步不带弹框处理*/
|
||||
this.commandNoPopUp();
|
||||
} else {
|
||||
/** 第一步带弹框处理*/
|
||||
this.commandHasPopUp();
|
||||
}
|
||||
},
|
||||
commandHasPopUp() {
|
||||
|
||||
},
|
||||
commandNoPopUp() {
|
||||
let operate = {
|
||||
type: MapDeviceType.Switch.type
|
||||
}
|
||||
},
|
||||
commandNoPopUp() {
|
||||
const operate = {
|
||||
type: MapDeviceType.Switch.type
|
||||
};
|
||||
|
||||
if (this.operation == OperationEvent.Switch.unlock.menu.operation) {
|
||||
/** 道岔单解*/
|
||||
operate.operation = OperationEvent.Switch.unlock.order.operation
|
||||
} else if (this.operation == OperationEvent.Switch.unblock.menu.operation) {
|
||||
/** 道岔解封*/
|
||||
operate.operation = OperationEvent.Switch.unblock.order.operation
|
||||
} else if (this.operation == OperationEvent.Switch.fault.menu.operation) {
|
||||
/** 道岔故障解锁*/
|
||||
operate.operation = OperationEvent.Switch.fault.order.operation
|
||||
} else if (this.operation == OperationEvent.Switch.axlePreReset.menu.operation) {
|
||||
/** 道岔计轴复位*/
|
||||
operate.operation = OperationEvent.Switch.axlePreReset.order.operation;
|
||||
}
|
||||
if (this.operation == OperationEvent.Switch.unlock.menu.operation) {
|
||||
/** 道岔单解*/
|
||||
operate.operation = OperationEvent.Switch.unlock.order.operation;
|
||||
} else if (this.operation == OperationEvent.Switch.unblock.menu.operation) {
|
||||
/** 道岔解封*/
|
||||
operate.operation = OperationEvent.Switch.unblock.order.operation;
|
||||
} else if (this.operation == OperationEvent.Switch.fault.menu.operation) {
|
||||
/** 道岔故障解锁*/
|
||||
operate.operation = OperationEvent.Switch.fault.order.operation;
|
||||
} else if (this.operation == OperationEvent.Switch.axlePreReset.menu.operation) {
|
||||
/** 道岔计轴复位*/
|
||||
operate.operation = OperationEvent.Switch.axlePreReset.order.operation;
|
||||
}
|
||||
|
||||
this.setMessage(this.$t('tip.firstConfirmTip'));
|
||||
this.writeRecord({ order: ++this.order, date: now(), context: this.$t('menu.clickReleaseCommand'), result: '' });
|
||||
this.$store.dispatch('training/next', operate).then(({ valid }) => {
|
||||
if (valid) {
|
||||
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
|
||||
this.setButtonEnable({ step: 1 });
|
||||
this.editRecord({ order: this.order, date: now(), context: this.$t('menu.clickReleaseCommand'), result: this.$t('tip.executionSucceed') });
|
||||
} else {
|
||||
this.editRecord({ order: this.order, date: now(), context: this.$t('menu.clickReleaseCommand'), result: this.$t('tip.executionFailed') });
|
||||
}
|
||||
}).catch(() => {
|
||||
this.editRecord({ order: this.order, date: now(), context: this.$t('menu.clickReleaseCommand'), result: this.$t('tip.executionException') });
|
||||
})
|
||||
},
|
||||
confirm1() {
|
||||
let operate = {
|
||||
type: MapDeviceType.Switch.type,
|
||||
}
|
||||
this.setMessage(this.$t('tip.firstConfirmTip'));
|
||||
this.writeRecord({ order: ++this.order, date: now(), context: this.$t('menu.clickReleaseCommand'), result: '' });
|
||||
this.$store.dispatch('training/next', operate).then(({ valid }) => {
|
||||
if (valid) {
|
||||
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
|
||||
this.setButtonEnable({ step: 1 });
|
||||
this.editRecord({ order: this.order, date: now(), context: this.$t('menu.clickReleaseCommand'), result: this.$t('tip.executionSucceed') });
|
||||
} else {
|
||||
this.editRecord({ order: this.order, date: now(), context: this.$t('menu.clickReleaseCommand'), result: this.$t('tip.executionFailed') });
|
||||
}
|
||||
}).catch(() => {
|
||||
this.editRecord({ order: this.order, date: now(), context: this.$t('menu.clickReleaseCommand'), result: this.$t('tip.executionException') });
|
||||
});
|
||||
},
|
||||
confirm1() {
|
||||
const operate = {
|
||||
type: MapDeviceType.Switch.type
|
||||
};
|
||||
|
||||
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;
|
||||
} else if (this.operation == OperationEvent.Switch.fault.menu.operation) {
|
||||
/** 道岔故障解锁*/
|
||||
operate.operation = OperationEvent.Switch.fault.confirm1.operation
|
||||
} else if (this.operation == OperationEvent.Switch.axlePreReset.menu.operation) {
|
||||
/** 道岔计轴复位*/
|
||||
operate.operation = OperationEvent.Switch.axlePreReset.confirm1.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;
|
||||
} else if (this.operation == OperationEvent.Switch.fault.menu.operation) {
|
||||
/** 道岔故障解锁*/
|
||||
operate.operation = OperationEvent.Switch.fault.confirm1.operation;
|
||||
} else if (this.operation == OperationEvent.Switch.axlePreReset.menu.operation) {
|
||||
/** 道岔计轴复位*/
|
||||
operate.operation = OperationEvent.Switch.axlePreReset.confirm1.operation;
|
||||
}
|
||||
|
||||
this.setMessage(this.$t('tip.secondConfirmTip'));
|
||||
this.writeRecord({ order: ++this.order, date: now(), context: this.$t('menu.clickFirstConfirm'), result: '' });
|
||||
this.$store.dispatch('training/next', operate).then(({ valid }) => {
|
||||
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: this.$t('menu.clickFirstConfirm'), result: this.$t('tip.executionSucceed') });
|
||||
} else {
|
||||
this.editRecord({ order: this.order, date: now(), context: this.$t('menu.clickFirstConfirm'), result: this.$t('tip.executionFailed') });
|
||||
}
|
||||
}).catch(() => {
|
||||
this.editRecord({ order: this.order, date: now(), context: this.$t('menu.clickFirstConfirm'), result: this.$t('tip.executionException') });
|
||||
})
|
||||
},
|
||||
confirm2() {
|
||||
let operate = {
|
||||
send: true,
|
||||
type: MapDeviceType.Switch.type,
|
||||
}
|
||||
this.setMessage(this.$t('tip.secondConfirmTip'));
|
||||
this.writeRecord({ order: ++this.order, date: now(), context: this.$t('menu.clickFirstConfirm'), result: '' });
|
||||
this.$store.dispatch('training/next', operate).then(({ valid }) => {
|
||||
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: this.$t('menu.clickFirstConfirm'), result: this.$t('tip.executionSucceed') });
|
||||
} else {
|
||||
this.editRecord({ order: this.order, date: now(), context: this.$t('menu.clickFirstConfirm'), result: this.$t('tip.executionFailed') });
|
||||
}
|
||||
}).catch(() => {
|
||||
this.editRecord({ order: this.order, date: now(), context: this.$t('menu.clickFirstConfirm'), result: this.$t('tip.executionException') });
|
||||
});
|
||||
},
|
||||
confirm2() {
|
||||
const operate = {
|
||||
send: true,
|
||||
type: MapDeviceType.Switch.type
|
||||
};
|
||||
|
||||
if (this.operation == OperationEvent.Switch.unlock.menu.operation) {
|
||||
/** 道岔单解*/
|
||||
operate.operation = OperationEvent.Switch.unlock.confirm2.operation;
|
||||
} else if (this.operation == OperationEvent.Switch.unblock.menu.operation) {
|
||||
/** 道岔解封*/
|
||||
operate.operation = OperationEvent.Switch.unblock.confirm2.operation;
|
||||
} else if (this.operation == OperationEvent.Switch.fault.menu.operation) {
|
||||
/** 道岔故障解锁*/
|
||||
operate.operation = OperationEvent.Switch.fault.confirm2.operation
|
||||
} else if (this.operation == OperationEvent.Switch.axlePreReset.menu.operation) {
|
||||
/** 道岔计轴复位*/
|
||||
operate.operation = OperationEvent.Switch.axlePreReset.confirm2.operation;
|
||||
}
|
||||
if (this.operation == OperationEvent.Switch.unlock.menu.operation) {
|
||||
/** 道岔单解*/
|
||||
operate.operation = OperationEvent.Switch.unlock.confirm2.operation;
|
||||
} else if (this.operation == OperationEvent.Switch.unblock.menu.operation) {
|
||||
/** 道岔解封*/
|
||||
operate.operation = OperationEvent.Switch.unblock.confirm2.operation;
|
||||
} else if (this.operation == OperationEvent.Switch.fault.menu.operation) {
|
||||
/** 道岔故障解锁*/
|
||||
operate.operation = OperationEvent.Switch.fault.confirm2.operation;
|
||||
} else if (this.operation == OperationEvent.Switch.axlePreReset.menu.operation) {
|
||||
/** 道岔计轴复位*/
|
||||
operate.operation = OperationEvent.Switch.axlePreReset.confirm2.operation;
|
||||
}
|
||||
|
||||
this.setMessage('');
|
||||
this.writeRecord({ order: ++this.order, date: now(), context: this.$t('menu.clickSecondConfirm'), result: '' });
|
||||
this.$store.dispatch('training/next', 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: this.$t('menu.clickSecondConfirm'), result: this.$t('tip.executionSucceed') });
|
||||
} else {
|
||||
this.editRecord({ order: this.order, date: now(), context: this.$t('menu.clickSecondConfirm'), result: this.$t('tip.executionFailed') });
|
||||
}
|
||||
}).catch(() => {
|
||||
this.timeCountCommand = -1;
|
||||
this.timeCountConfirm = -1;
|
||||
this.setButtonEnable({ step: -1 });
|
||||
this.editRecord({ order: this.order, date: now(), context: this.$t('menu.clickSecondConfirm'), result: this.$t('tip.executionException') });
|
||||
})
|
||||
},
|
||||
stop() {
|
||||
let operate = {
|
||||
type: MapDeviceType.Switch.type,
|
||||
}
|
||||
this.setMessage('');
|
||||
this.writeRecord({ order: ++this.order, date: now(), context: this.$t('menu.clickSecondConfirm'), result: '' });
|
||||
this.$store.dispatch('training/next', 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: this.$t('menu.clickSecondConfirm'), result: this.$t('tip.executionSucceed') });
|
||||
} else {
|
||||
this.editRecord({ order: this.order, date: now(), context: this.$t('menu.clickSecondConfirm'), result: this.$t('tip.executionFailed') });
|
||||
}
|
||||
}).catch(() => {
|
||||
this.timeCountCommand = -1;
|
||||
this.timeCountConfirm = -1;
|
||||
this.setButtonEnable({ step: -1 });
|
||||
this.editRecord({ order: this.order, date: now(), context: this.$t('menu.clickSecondConfirm'), result: this.$t('tip.executionException') });
|
||||
});
|
||||
},
|
||||
stop() {
|
||||
const operate = {
|
||||
type: MapDeviceType.Switch.type
|
||||
};
|
||||
|
||||
if (this.operation == OperationEvent.Switch.unlock.menu.operation) {
|
||||
/** 道岔单解*/
|
||||
operate.operation = OperationEvent.Switch.unlock.stop.operation;
|
||||
} else if (this.operation == OperationEvent.Switch.unblock.menu.operation) {
|
||||
/** 道岔解封*/
|
||||
operate.operation = OperationEvent.Switch.unblock.stop.operation;
|
||||
} else if (this.operation == OperationEvent.Switch.fault.menu.operation) {
|
||||
/** 道岔故障解锁*/
|
||||
operate.operation = OperationEvent.Switch.fault.stop.operation
|
||||
} else if (this.operation == OperationEvent.Switch.axlePreReset.menu.operation) {
|
||||
/** 道岔计轴复位*/
|
||||
operate.operation = OperationEvent.Switch.axlePreReset.stop.operation;
|
||||
}
|
||||
if (this.operation == OperationEvent.Switch.unlock.menu.operation) {
|
||||
/** 道岔单解*/
|
||||
operate.operation = OperationEvent.Switch.unlock.stop.operation;
|
||||
} else if (this.operation == OperationEvent.Switch.unblock.menu.operation) {
|
||||
/** 道岔解封*/
|
||||
operate.operation = OperationEvent.Switch.unblock.stop.operation;
|
||||
} else if (this.operation == OperationEvent.Switch.fault.menu.operation) {
|
||||
/** 道岔故障解锁*/
|
||||
operate.operation = OperationEvent.Switch.fault.stop.operation;
|
||||
} else if (this.operation == OperationEvent.Switch.axlePreReset.menu.operation) {
|
||||
/** 道岔计轴复位*/
|
||||
operate.operation = OperationEvent.Switch.axlePreReset.stop.operation;
|
||||
}
|
||||
|
||||
this.writeRecord({ order: ++this.order, date: now(), context: this.$t('menu.clickSuspend'), result: '' });
|
||||
this.$store.dispatch('training/next', operate).then(({ valid }) => {
|
||||
if (valid) {
|
||||
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
|
||||
this.setButtonEnable({ step: 0 });
|
||||
this.editRecord({ order: this.order, date: now(), context: this.$t('menu.clickSuspend'), result: this.$t('tip.executionSucceed') });
|
||||
} else {
|
||||
this.editRecord({ order: this.order, date: now(), context: this.$t('menu.clickSuspend'), result: this.$t('tip.executionFailed') });
|
||||
}
|
||||
}).catch(error => {
|
||||
this.editRecord({ order: this.order, date: now(), context: this.$t('menu.clickSuspend'), result: this.$t('tip.executionException') });
|
||||
})
|
||||
},
|
||||
close() {
|
||||
let operate = {
|
||||
type: MapDeviceType.Switch.type,
|
||||
operation: OperationEvent.Command.close.menu.operation,
|
||||
}
|
||||
this.writeRecord({ order: ++this.order, date: now(), context: this.$t('menu.clickSuspend'), result: '' });
|
||||
this.$store.dispatch('training/next', operate).then(({ valid }) => {
|
||||
if (valid) {
|
||||
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
|
||||
this.setButtonEnable({ step: 0 });
|
||||
this.editRecord({ order: this.order, date: now(), context: this.$t('menu.clickSuspend'), result: this.$t('tip.executionSucceed') });
|
||||
} else {
|
||||
this.editRecord({ order: this.order, date: now(), context: this.$t('menu.clickSuspend'), result: this.$t('tip.executionFailed') });
|
||||
}
|
||||
}).catch(() => {
|
||||
this.editRecord({ order: this.order, date: now(), context: this.$t('menu.clickSuspend'), result: this.$t('tip.executionException') });
|
||||
});
|
||||
},
|
||||
close() {
|
||||
const operate = {
|
||||
type: MapDeviceType.Switch.type,
|
||||
operation: OperationEvent.Command.close.menu.operation
|
||||
};
|
||||
|
||||
this.$store.dispatch('training/next', operate).then(({ valid }) => {
|
||||
if (valid) {
|
||||
this.doClose();
|
||||
}
|
||||
}).catch(error => {
|
||||
this.doClose();
|
||||
});
|
||||
},
|
||||
getOperate(operate) {
|
||||
/** 弹框返回值处理*/
|
||||
},
|
||||
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];
|
||||
}
|
||||
}
|
||||
})
|
||||
}
|
||||
}
|
||||
}
|
||||
this.$store.dispatch('training/next', operate).then(({ valid }) => {
|
||||
if (valid) {
|
||||
this.doClose();
|
||||
}
|
||||
}).catch(() => {
|
||||
this.doClose();
|
||||
});
|
||||
},
|
||||
getOperate(operate) {
|
||||
/** 弹框返回值处理*/
|
||||
},
|
||||
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,271 +1,281 @@
|
||||
<template>
|
||||
<el-dialog class="fuzhou-01__systerm switch-control" :title="title" :visible.sync="show" width="300px"
|
||||
:before-close="doClose" :zIndex="2000" :modal="false" :close-on-click-modal="false" v-dialogDrag>
|
||||
<el-row class="header">
|
||||
<el-col :span="11"><span>{{$t('menu.stationName')}}</span></el-col>
|
||||
<el-col :span="11" :offset="2"><span>{{$t('menu.switch')}}</span></el-col>
|
||||
</el-row>
|
||||
<el-row>
|
||||
<el-col :span="11">
|
||||
<el-input v-model="stationName" size="small" disabled></el-input>
|
||||
</el-col>
|
||||
<el-col :span="11" :offset="2">
|
||||
<el-input v-model="switchName" size="small" disabled></el-input>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<el-row style="margin-top: 10px;" v-if="activeShow">
|
||||
<el-col :span="11">
|
||||
<el-radio v-model="radio" label="1" :disabled="radio == 2" style="display: block; text-align: center;">
|
||||
{{$t('menu.activation')}}</el-radio>
|
||||
</el-col>
|
||||
<el-col :span="11" :offset="2">
|
||||
<el-radio v-model="radio" label="2" :disabled="radio == 1" style="display: block; text-align: center;">
|
||||
{{$t('menu.resection')}}</el-radio>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<el-row justify="center" class="button-group">
|
||||
<el-col :span="10" :offset="2">
|
||||
<el-button :id="domIdConfirm" type="primary" :loading="loading" @click="commit">{{$t('global.confirm')}}</el-button>
|
||||
</el-col>
|
||||
<el-col :span="8" :offset="4">
|
||||
<el-button :id="domIdCancel" @click="cancel">{{$t('global.cancel')}}</el-button>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<notice-info ref="noticeInfo"></notice-info>
|
||||
</el-dialog>
|
||||
<el-dialog
|
||||
v-dialogDrag
|
||||
class="fuzhou-01__systerm switch-control"
|
||||
:title="title"
|
||||
:visible.sync="show"
|
||||
width="300px"
|
||||
:before-close="doClose"
|
||||
:z-index="2000"
|
||||
:modal="false"
|
||||
:close-on-click-modal="false"
|
||||
>
|
||||
<el-row class="header">
|
||||
<el-col :span="11"><span>{{ $t('menu.stationName') }}</span></el-col>
|
||||
<el-col :span="11" :offset="2"><span>{{ $t('menu.switch') }}</span></el-col>
|
||||
</el-row>
|
||||
<el-row>
|
||||
<el-col :span="11">
|
||||
<el-input v-model="stationName" size="small" disabled />
|
||||
</el-col>
|
||||
<el-col :span="11" :offset="2">
|
||||
<el-input v-model="switchName" size="small" disabled />
|
||||
</el-col>
|
||||
</el-row>
|
||||
<el-row v-if="activeShow" style="margin-top: 10px;">
|
||||
<el-col :span="11">
|
||||
<el-radio v-model="radio" label="1" :disabled="radio == 2" style="display: block; text-align: center;">
|
||||
{{ $t('menu.activation') }}</el-radio>
|
||||
</el-col>
|
||||
<el-col :span="11" :offset="2">
|
||||
<el-radio v-model="radio" label="2" :disabled="radio == 1" style="display: block; text-align: center;">
|
||||
{{ $t('menu.resection') }}</el-radio>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<el-row justify="center" class="button-group">
|
||||
<el-col :span="10" :offset="2">
|
||||
<el-button :id="domIdConfirm" type="primary" :loading="loading" @click="commit">{{ $t('global.confirm') }}</el-button>
|
||||
</el-col>
|
||||
<el-col :span="8" :offset="4">
|
||||
<el-button :id="domIdCancel" @click="cancel">{{ $t('global.cancel') }}</el-button>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<notice-info ref="noticeInfo" />
|
||||
</el-dialog>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import { MapDeviceType, OperationEvent, getDomIdByOperation } from '@/scripts/ConstDic';
|
||||
import NoticeInfo from './childDialog/childDialog/noticeInfo'
|
||||
import { MapDeviceType, OperationEvent, getDomIdByOperation } from '@/scripts/ConstDic';
|
||||
import NoticeInfo from './childDialog/childDialog/noticeInfo';
|
||||
|
||||
export default {
|
||||
name: 'SwitchControl',
|
||||
components: {
|
||||
NoticeInfo
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
dialogShow: false,
|
||||
loading: false,
|
||||
operation: '',
|
||||
stationName: '',
|
||||
switchName: '',
|
||||
radio: 1,
|
||||
activeShow: false,
|
||||
}
|
||||
},
|
||||
computed: {
|
||||
show() {
|
||||
return this.dialogShow && !this.$store.state.menuOperation.break;
|
||||
},
|
||||
domIdCancel() {
|
||||
return this.dialogShow ? OperationEvent.Command.cancel.menu.domId : '';
|
||||
},
|
||||
domIdConfirm() {
|
||||
return this.dialogShow ? getDomIdByOperation(this.operation) : '';
|
||||
},
|
||||
title() {
|
||||
if (this.operation == OperationEvent.Switch.lock.menu.operation) {
|
||||
return this.$t('menu.menuSwitch.switchLock');
|
||||
} else if (this.operation == OperationEvent.Switch.block.menu.operation) {
|
||||
return this.$t('menu.menuSwitch.switchBlockade');
|
||||
} else if (this.operation == OperationEvent.Switch.turnout.menu.operation) {
|
||||
return this.$t('menu.menuSwitch.switchTurnout');
|
||||
} else if (this.operation == OperationEvent.Switch.turnoutForce.menu.operation) {
|
||||
return this.$t('menu.menuSwitch.switchForcedPull');
|
||||
} else if (this.operation == OperationEvent.Switch.split.menu.operation) {
|
||||
this.activeShow = true;
|
||||
this.radio = '2';
|
||||
return this.$t('menu.menuSwitch.sectionResection');
|
||||
} else if (this.operation == OperationEvent.Switch.active.menu.operation) {
|
||||
this.activeShow = true;
|
||||
this.radio = '1';
|
||||
return this.$t('menu.menuSwitch.sectionActive');
|
||||
}
|
||||
}
|
||||
},
|
||||
mounted() {
|
||||
this.$nextTick(() => {
|
||||
this.$store.dispatch('training/tipReload');
|
||||
})
|
||||
},
|
||||
methods: {
|
||||
doShow(operate, selected) {
|
||||
if (!this.dialogShow) {
|
||||
this.switchName = '';
|
||||
this.stationName = '';
|
||||
if (selected && selected._type.toUpperCase() === 'Switch'.toUpperCase()) {
|
||||
this.switchName = selected.name
|
||||
let station = this.$store.getters['map/getDeviceByCode'](selected.stationCode);
|
||||
if (station) {
|
||||
this.stationName = station.name;
|
||||
}
|
||||
}
|
||||
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('training/emitTipFresh');
|
||||
},
|
||||
commit() {
|
||||
if (this.operation == OperationEvent.Switch.lock.menu.operation) {
|
||||
/** 道岔单锁*/
|
||||
this.lock();
|
||||
} else if (this.operation == OperationEvent.Switch.block.menu.operation) {
|
||||
/** 道岔封锁*/
|
||||
this.block();
|
||||
} else if (this.operation == OperationEvent.Switch.turnout.menu.operation) {
|
||||
/** 道岔转动*/
|
||||
this.turnout(this.operation);
|
||||
} else if (this.operation == OperationEvent.Switch.turnoutForce.menu.operation) {
|
||||
/** 道岔强扳*/
|
||||
this.turnoutForce();
|
||||
} else if (this.operation == OperationEvent.Switch.split.menu.operation) {
|
||||
/** 区段激活*/
|
||||
this.split();
|
||||
} else if (this.operation == OperationEvent.Switch.active.menu.operation) {
|
||||
/** 区段激活*/
|
||||
this.active();
|
||||
}
|
||||
},
|
||||
//道岔单锁
|
||||
lock() {
|
||||
let operate = {
|
||||
send: true,
|
||||
type: MapDeviceType.Switch.type,
|
||||
operation: OperationEvent.Switch.lock.menu.operation,
|
||||
}
|
||||
export default {
|
||||
name: 'SwitchControl',
|
||||
components: {
|
||||
NoticeInfo
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
dialogShow: false,
|
||||
loading: false,
|
||||
operation: '',
|
||||
stationName: '',
|
||||
switchName: '',
|
||||
radio: 1,
|
||||
activeShow: false
|
||||
};
|
||||
},
|
||||
computed: {
|
||||
show() {
|
||||
return this.dialogShow && !this.$store.state.menuOperation.break;
|
||||
},
|
||||
domIdCancel() {
|
||||
return this.dialogShow ? OperationEvent.Command.cancel.menu.domId : '';
|
||||
},
|
||||
domIdConfirm() {
|
||||
return this.dialogShow ? getDomIdByOperation(this.operation) : '';
|
||||
},
|
||||
title() {
|
||||
if (this.operation == OperationEvent.Switch.lock.menu.operation) {
|
||||
return this.$t('menu.menuSwitch.switchLock');
|
||||
} else if (this.operation == OperationEvent.Switch.block.menu.operation) {
|
||||
return this.$t('menu.menuSwitch.switchBlockade');
|
||||
} else if (this.operation == OperationEvent.Switch.turnout.menu.operation) {
|
||||
return this.$t('menu.menuSwitch.switchTurnout');
|
||||
} else if (this.operation == OperationEvent.Switch.turnoutForce.menu.operation) {
|
||||
return this.$t('menu.menuSwitch.switchForcedPull');
|
||||
} else if (this.operation == OperationEvent.Switch.split.menu.operation) {
|
||||
this.activeShow = true;
|
||||
this.radio = '2';
|
||||
return this.$t('menu.menuSwitch.sectionResection');
|
||||
} else if (this.operation == OperationEvent.Switch.active.menu.operation) {
|
||||
this.activeShow = true;
|
||||
this.radio = '1';
|
||||
return this.$t('menu.menuSwitch.sectionActive');
|
||||
}
|
||||
return '';
|
||||
}
|
||||
},
|
||||
mounted() {
|
||||
this.$nextTick(() => {
|
||||
this.$store.dispatch('training/tipReload');
|
||||
});
|
||||
},
|
||||
methods: {
|
||||
doShow(operate, selected) {
|
||||
if (!this.dialogShow) {
|
||||
this.switchName = '';
|
||||
this.stationName = '';
|
||||
if (selected && selected._type.toUpperCase() === 'Switch'.toUpperCase()) {
|
||||
this.switchName = selected.name;
|
||||
const station = this.$store.getters['map/getDeviceByCode'](selected.stationCode);
|
||||
if (station) {
|
||||
this.stationName = station.name;
|
||||
}
|
||||
}
|
||||
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('training/emitTipFresh');
|
||||
},
|
||||
commit() {
|
||||
if (this.operation == OperationEvent.Switch.lock.menu.operation) {
|
||||
/** 道岔单锁*/
|
||||
this.lock();
|
||||
} else if (this.operation == OperationEvent.Switch.block.menu.operation) {
|
||||
/** 道岔封锁*/
|
||||
this.block();
|
||||
} else if (this.operation == OperationEvent.Switch.turnout.menu.operation) {
|
||||
/** 道岔转动*/
|
||||
this.turnout(this.operation);
|
||||
} else if (this.operation == OperationEvent.Switch.turnoutForce.menu.operation) {
|
||||
/** 道岔强扳*/
|
||||
this.turnoutForce();
|
||||
} else if (this.operation == OperationEvent.Switch.split.menu.operation) {
|
||||
/** 区段激活*/
|
||||
this.split();
|
||||
} else if (this.operation == OperationEvent.Switch.active.menu.operation) {
|
||||
/** 区段激活*/
|
||||
this.active();
|
||||
}
|
||||
},
|
||||
// 道岔单锁
|
||||
lock() {
|
||||
const operate = {
|
||||
send: true,
|
||||
type: MapDeviceType.Switch.type,
|
||||
operation: OperationEvent.Switch.lock.menu.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);
|
||||
});
|
||||
},
|
||||
//道岔封锁
|
||||
block() {
|
||||
let operate = {
|
||||
send: true,
|
||||
type: MapDeviceType.Switch.type,
|
||||
operation: OperationEvent.Switch.block.menu.operation,
|
||||
}
|
||||
this.loading = true;
|
||||
this.$store.dispatch('training/next', operate).then(({ valid }) => {
|
||||
this.loading = false;
|
||||
if (valid) {
|
||||
this.doClose();
|
||||
}
|
||||
}).catch(() => {
|
||||
this.loading = false;
|
||||
this.doClose();
|
||||
this.$refs.noticeInfo.doShow(operate);
|
||||
});
|
||||
},
|
||||
// 道岔封锁
|
||||
block() {
|
||||
const operate = {
|
||||
send: true,
|
||||
type: MapDeviceType.Switch.type,
|
||||
operation: OperationEvent.Switch.block.menu.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);
|
||||
});
|
||||
},
|
||||
//道岔转动
|
||||
turnout(operation) {
|
||||
let operate = {
|
||||
send: true,
|
||||
type: MapDeviceType.Switch.type,
|
||||
operation: OperationEvent.Switch.turnout.menu.operation,
|
||||
}
|
||||
this.loading = true;
|
||||
this.$store.dispatch('training/next', operate).then(({ valid }) => {
|
||||
this.loading = false;
|
||||
if (valid) {
|
||||
this.doClose();
|
||||
}
|
||||
}).catch(() => {
|
||||
this.loading = false;
|
||||
this.doClose();
|
||||
this.$refs.noticeInfo.doShow(operate);
|
||||
});
|
||||
},
|
||||
// 道岔转动
|
||||
turnout(operation) {
|
||||
const operate = {
|
||||
send: true,
|
||||
type: MapDeviceType.Switch.type,
|
||||
operation: OperationEvent.Switch.turnout.menu.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);
|
||||
});
|
||||
},
|
||||
//道岔强扮
|
||||
turnoutForce() {
|
||||
let operate = {
|
||||
send: true,
|
||||
type: MapDeviceType.Switch.type,
|
||||
operation: OperationEvent.Switch.turnoutForce.menu.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);
|
||||
});
|
||||
},
|
||||
//区段切除
|
||||
split() {
|
||||
let operate = {
|
||||
send: true,
|
||||
type: MapDeviceType.Switch.type,
|
||||
operation: OperationEvent.Switch.split.menu.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);
|
||||
});
|
||||
},
|
||||
//区段激活
|
||||
active() {
|
||||
let operate = {
|
||||
send: true,
|
||||
type: MapDeviceType.Switch.type,
|
||||
operation: OperationEvent.Switch.active.menu.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: MapDeviceType.Switch.type,
|
||||
operation: OperationEvent.Command.cancel.menu.operation,
|
||||
}
|
||||
this.loading = true;
|
||||
this.$store.dispatch('training/next', operate).then(({ valid }) => {
|
||||
this.loading = false;
|
||||
if (valid) {
|
||||
this.doClose();
|
||||
}
|
||||
}).catch(() => {
|
||||
this.loading = false;
|
||||
this.doClose();
|
||||
this.$refs.noticeInfo.doShow(operate);
|
||||
});
|
||||
},
|
||||
// 道岔强扮
|
||||
turnoutForce() {
|
||||
const operate = {
|
||||
send: true,
|
||||
type: MapDeviceType.Switch.type,
|
||||
operation: OperationEvent.Switch.turnoutForce.menu.operation
|
||||
};
|
||||
this.loading = true;
|
||||
this.$store.dispatch('training/next', operate).then(({ valid }) => {
|
||||
this.loading = false;
|
||||
if (valid) {
|
||||
this.doClose();
|
||||
}
|
||||
}).catch(() => {
|
||||
this.loading = false;
|
||||
this.doClose();
|
||||
this.$refs.noticeInfo.doShow(operate);
|
||||
});
|
||||
},
|
||||
// 区段切除
|
||||
split() {
|
||||
const operate = {
|
||||
send: true,
|
||||
type: MapDeviceType.Switch.type,
|
||||
operation: OperationEvent.Switch.split.menu.operation
|
||||
};
|
||||
this.loading = true;
|
||||
this.$store.dispatch('training/next', operate).then(({ valid }) => {
|
||||
this.loading = false;
|
||||
if (valid) {
|
||||
this.doClose();
|
||||
}
|
||||
}).catch(() => {
|
||||
this.loading = false;
|
||||
this.doClose();
|
||||
this.$refs.noticeInfo.doShow(operate);
|
||||
});
|
||||
},
|
||||
// 区段激活
|
||||
active() {
|
||||
const operate = {
|
||||
send: true,
|
||||
type: MapDeviceType.Switch.type,
|
||||
operation: OperationEvent.Switch.active.menu.operation
|
||||
};
|
||||
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.Switch.type,
|
||||
operation: OperationEvent.Command.cancel.menu.operation
|
||||
};
|
||||
|
||||
this.$store.dispatch('training/next', operate).then(({ valid }) => {
|
||||
if (valid) {
|
||||
this.doClose();
|
||||
}
|
||||
}).catch(error => {
|
||||
this.doClose();
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
this.$store.dispatch('training/next', operate).then(({ valid }) => {
|
||||
if (valid) {
|
||||
this.doClose();
|
||||
}
|
||||
}).catch(() => {
|
||||
this.doClose();
|
||||
});
|
||||
}
|
||||
}
|
||||
};
|
||||
</script>
|
||||
|
@ -1,156 +1,168 @@
|
||||
<template>
|
||||
<el-dialog class="fuzhou-01__systerm route-create" :title="title" :visible.sync="show" width="580px"
|
||||
label-position="top" :before-close="doClose" :zIndex="2000" :modal="false" :close-on-click-modal="false"
|
||||
v-dialogDrag>
|
||||
<div style="padding: 10px 20px; border: 1px solid lightgray;">
|
||||
<el-form size="small" label-width="100px">
|
||||
<el-form-item :label="this.$t('menu.train')+this.$t('global.colon')" prop="trainCode">
|
||||
<el-select v-model="trainCode" filterable :placeholder="this.$t('menu.train')">
|
||||
<el-option v-for="item in trainList" :key="item.code" :label="item.groupNumber"
|
||||
:value="item.code"></el-option>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<!-- <el-form-item label="列车车次:" prop="tripNumber">
|
||||
<el-dialog
|
||||
v-dialogDrag
|
||||
class="fuzhou-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="this.$t('menu.train')+this.$t('global.colon')" prop="trainCode">
|
||||
<el-select v-model="trainCode" filterable :placeholder="this.$t('menu.train')">
|
||||
<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="tripNumber">
|
||||
<el-select v-model="tripNumber" filterable placeholder="列车车次">
|
||||
<el-option v-for="no in trainNoList" :key="no" :label="no" :value="no"></el-option>
|
||||
</el-select>
|
||||
<div style="font-size: 12px;">(上行路线车次号选择偶数,下行路线车次号选择基数)</div>
|
||||
</el-form-item> -->
|
||||
<el-form-item :label="this.$t('menu.trainDirection')+this.$t('global.colon')" prop="direction">
|
||||
<el-select v-model="direction" filterable :placeholder="this.$t('menu.trainDirection')">
|
||||
<el-option v-for="no in directionList" :key="no.value" :label="no.label" :value="no.value">
|
||||
</el-option>
|
||||
</el-select>
|
||||
<!-- <div style="font-size: 12px;">(上行路线车次号选择偶数,下行路线车次号选择基数)</div> -->
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
<el-row>
|
||||
<el-col style="text-align: right;">
|
||||
<el-button :id="domIdConfirm" type="primary" :loading="loading" @click="commit">{{this.$t('global.confirm')}}</el-button>
|
||||
<el-button :id="domIdCancel" @click="cancel">{{this.$t('global.cancel')}}</el-button>
|
||||
</el-col>
|
||||
</el-row>
|
||||
</div>
|
||||
<notice-info ref="noticeInfo"></notice-info>
|
||||
</el-dialog>
|
||||
<el-form-item :label="this.$t('menu.trainDirection')+this.$t('global.colon')" prop="direction">
|
||||
<el-select v-model="direction" filterable :placeholder="this.$t('menu.trainDirection')">
|
||||
<el-option v-for="no in directionList" :key="no.value" :label="no.label" :value="no.value" />
|
||||
</el-select>
|
||||
<!-- <div style="font-size: 12px;">(上行路线车次号选择偶数,下行路线车次号选择基数)</div> -->
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
<el-row>
|
||||
<el-col style="text-align: right;">
|
||||
<el-button :id="domIdConfirm" type="primary" :loading="loading" @click="commit">{{ this.$t('global.confirm') }}</el-button>
|
||||
<el-button :id="domIdCancel" @click="cancel">{{ this.$t('global.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 { getPublishTrainList } from '@/api/jmap/map';
|
||||
import NoticeInfo from './childDialog/childDialog/noticeInfo'
|
||||
import { mapGetters } from 'vuex';
|
||||
import { MapDeviceType, OperationEvent } from '@/scripts/ConstDic';
|
||||
import { getPublishTrainList } from '@/api/jmap/map';
|
||||
import NoticeInfo from './childDialog/childDialog/noticeInfo';
|
||||
|
||||
export default {
|
||||
name: 'RouteCreate',
|
||||
components: {
|
||||
NoticeInfo
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
dialogShow: false,
|
||||
loading: false,
|
||||
trainList: [],
|
||||
trainNoList: [],
|
||||
directionList: [
|
||||
{
|
||||
value: '2',
|
||||
label: this.$t('menu.up')
|
||||
},
|
||||
{
|
||||
value: '1',
|
||||
label: this.$t('menu.down')
|
||||
}
|
||||
],
|
||||
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 this.$t('menu.settingTrain');
|
||||
}
|
||||
},
|
||||
mounted() {
|
||||
this.$nextTick(() => {
|
||||
this.$store.dispatch('training/tipReload');
|
||||
})
|
||||
},
|
||||
methods: {
|
||||
loadInitData(map) {
|
||||
if (Object.keys(map || {}).length) {
|
||||
getPublishTrainList(map.skinCode).then(response => {
|
||||
this.trainList = response.data;
|
||||
}).catch(error => {
|
||||
this.$messageBox(this.$t('error.getTrainListFailed'));
|
||||
})
|
||||
}
|
||||
},
|
||||
doShow(operate, selected) {
|
||||
this.dialogShow = true;
|
||||
this.selected = selected;
|
||||
export default {
|
||||
name: 'RouteCreate',
|
||||
components: {
|
||||
NoticeInfo
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
dialogShow: false,
|
||||
loading: false,
|
||||
trainList: [],
|
||||
trainNoList: [],
|
||||
directionList: [
|
||||
{
|
||||
value: '2',
|
||||
label: this.$t('menu.up')
|
||||
},
|
||||
{
|
||||
value: '1',
|
||||
label: this.$t('menu.down')
|
||||
}
|
||||
],
|
||||
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 this.$t('menu.settingTrain');
|
||||
}
|
||||
},
|
||||
mounted() {
|
||||
this.$nextTick(() => {
|
||||
this.$store.dispatch('training/tipReload');
|
||||
});
|
||||
},
|
||||
methods: {
|
||||
loadInitData(map) {
|
||||
if (Object.keys(map || {}).length) {
|
||||
getPublishTrainList(map.skinCode).then(response => {
|
||||
this.trainList = response.data;
|
||||
}).catch(() => {
|
||||
this.$messageBox(this.$t('error.getTrainListFailed'));
|
||||
});
|
||||
}
|
||||
},
|
||||
doShow(operate, selected) {
|
||||
this.dialogShow = true;
|
||||
this.selected = selected;
|
||||
|
||||
/** 加载列车数据*/
|
||||
this.loadInitData(this.map);
|
||||
/** 加载列车数据*/
|
||||
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');
|
||||
},
|
||||
commit() {
|
||||
let 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(error => {
|
||||
this.loading = false;
|
||||
this.doClose();
|
||||
this.$refs.noticeInfo.doShow(operate);
|
||||
});
|
||||
},
|
||||
cancel() {
|
||||
let operate = {
|
||||
type: MapDeviceType.Section.type,
|
||||
operation: OperationEvent.Command.cancel.menu.operation,
|
||||
}
|
||||
this.$nextTick(function () {
|
||||
this.$store.dispatch('training/emitTipFresh');
|
||||
});
|
||||
},
|
||||
doClose() {
|
||||
this.trainCode = '';
|
||||
this.direction = '';
|
||||
this.loading = false;
|
||||
this.dialogShow = false;
|
||||
this.$store.dispatch('training/emitTipFresh');
|
||||
},
|
||||
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();
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
this.$store.dispatch('training/next', operate).then(({ valid }) => {
|
||||
if (valid) {
|
||||
this.doClose();
|
||||
}
|
||||
}).catch(() => {
|
||||
this.doClose();
|
||||
});
|
||||
}
|
||||
}
|
||||
};
|
||||
</script>
|
||||
|
@ -17,10 +17,10 @@
|
||||
</el-form>
|
||||
<el-row justify="center" class="button-group">
|
||||
<el-col :span="10" :offset="2">
|
||||
<el-button :id="domIdConfirm" type="primary" :loading="loading" @click="commit">{{$t('global.confirm')}}</el-button>
|
||||
<el-button :id="domIdConfirm" type="primary" :loading="loading" @click="commit">{{ $t('global.confirm') }}</el-button>
|
||||
</el-col>
|
||||
<el-col :span="8" :offset="4">
|
||||
<el-button :id="domIdCancel" @click="cancel">{{$t('global.cancel')}}</el-button>
|
||||
<el-button :id="domIdCancel" @click="cancel">{{ $t('global.cancel') }}</el-button>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<confirm-control ref="confirmControl" />
|
||||
|
@ -1,123 +1,128 @@
|
||||
<template>
|
||||
<el-dialog class="fuzhou-01__systerm stand-stop-time" :title="title" :visible.sync="show" width="320px"
|
||||
:before-close="doClose" :zIndex="2000" :modal="false" :close-on-click-modal="false" v-dialogDrag>
|
||||
<el-form size="small" label-width="120px" :model="addModel" :rules="rules" ref="form">
|
||||
<el-form-item :label="this.$t('menu.groupNumber')+this.$t('global.colon')" label-width="120px" prop="tripNumber">
|
||||
<el-input v-model="addModel.tripNumber"></el-input>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
<el-row justify="center" class="button-group">
|
||||
<el-col :span="10" :offset="2">
|
||||
<el-button :id="domIdConfirm" type="primary" :loading="loading" @click="commit">{{$t('global.confirm')}}</el-button>
|
||||
</el-col>
|
||||
<el-col :span="8" :offset="4">
|
||||
<el-button :id="domIdCancel" @click="cancel">{{$t('global.cancel')}}</el-button>
|
||||
</el-col>
|
||||
</el-row>
|
||||
</el-dialog>
|
||||
<el-dialog
|
||||
v-dialogDrag
|
||||
class="fuzhou-01__systerm stand-stop-time"
|
||||
:title="title"
|
||||
:visible.sync="show"
|
||||
width="320px"
|
||||
:before-close="doClose"
|
||||
:z-index="2000"
|
||||
:modal="false"
|
||||
:close-on-click-modal="false"
|
||||
>
|
||||
<el-form ref="form" size="small" label-width="120px" :model="addModel" :rules="rules">
|
||||
<el-form-item :label="this.$t('menu.groupNumber')+this.$t('global.colon')" label-width="120px" prop="tripNumber">
|
||||
<el-input v-model="addModel.tripNumber" />
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
<el-row justify="center" class="button-group">
|
||||
<el-col :span="10" :offset="2">
|
||||
<el-button :id="domIdConfirm" type="primary" :loading="loading" @click="commit">{{ $t('global.confirm') }}</el-button>
|
||||
</el-col>
|
||||
<el-col :span="8" :offset="4">
|
||||
<el-button :id="domIdCancel" @click="cancel">{{ $t('global.cancel') }}</el-button>
|
||||
</el-col>
|
||||
</el-row>
|
||||
</el-dialog>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import { mapGetters } from 'vuex';
|
||||
import { MapDeviceType, OperationEvent } from '@/scripts/ConstDic';
|
||||
import { mapGetters } from 'vuex';
|
||||
import { MapDeviceType, OperationEvent } from '@/scripts/ConstDic';
|
||||
|
||||
export default {
|
||||
name: 'TrainMove',
|
||||
components: {
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
trainNoList: [],
|
||||
addModel: {
|
||||
tripNumber: '',
|
||||
},
|
||||
export default {
|
||||
name: 'TrainMove',
|
||||
components: {
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
trainNoList: [],
|
||||
addModel: {
|
||||
tripNumber: ''
|
||||
},
|
||||
|
||||
rules: {
|
||||
tripNumber: [
|
||||
{ required: true, message: this.$t('rules.selectGroupNumber'), trigger: 'blur' }
|
||||
],
|
||||
},
|
||||
dialogShow: false,
|
||||
loading: false,
|
||||
}
|
||||
},
|
||||
computed: {
|
||||
...mapGetters('map', [
|
||||
'stationStandList'
|
||||
]),
|
||||
show() {
|
||||
return this.dialogShow && !this.$store.state.menuOperation.break;
|
||||
},
|
||||
domIdCancel() {
|
||||
return this.dialogShow ? OperationEvent.Command.cancel.menu.domId : '';
|
||||
},
|
||||
domIdConfirm() {
|
||||
return this.dialogShow ? OperationEvent.Train.editTrainNo.menu.domId : '';
|
||||
},
|
||||
title() {
|
||||
return this.$t('menu.menuTrain.editTrainNo')
|
||||
}
|
||||
},
|
||||
mounted() {
|
||||
this.$nextTick(() => {
|
||||
this.$store.dispatch('training/tipReload');
|
||||
})
|
||||
},
|
||||
methods: {
|
||||
doShow(operate, selected) {
|
||||
//如果不是断点激活,则需要对初始值进行初始化
|
||||
if (!this.dialogShow) {
|
||||
rules: {
|
||||
tripNumber: [
|
||||
{ required: true, message: this.$t('rules.selectGroupNumber'), trigger: 'blur' }
|
||||
]
|
||||
},
|
||||
dialogShow: false,
|
||||
loading: false
|
||||
};
|
||||
},
|
||||
computed: {
|
||||
...mapGetters('map', [
|
||||
'stationStandList'
|
||||
]),
|
||||
show() {
|
||||
return this.dialogShow && !this.$store.state.menuOperation.break;
|
||||
},
|
||||
domIdCancel() {
|
||||
return this.dialogShow ? OperationEvent.Command.cancel.menu.domId : '';
|
||||
},
|
||||
domIdConfirm() {
|
||||
return this.dialogShow ? OperationEvent.Train.editTrainNo.menu.domId : '';
|
||||
},
|
||||
title() {
|
||||
return this.$t('menu.menuTrain.editTrainNo');
|
||||
}
|
||||
},
|
||||
mounted() {
|
||||
this.$nextTick(() => {
|
||||
this.$store.dispatch('training/tipReload');
|
||||
});
|
||||
},
|
||||
methods: {
|
||||
doShow(operate, selected) {
|
||||
this.dialogShow = true;
|
||||
this.$nextTick(function () {
|
||||
this.$store.dispatch('training/emitTipFresh');
|
||||
});
|
||||
},
|
||||
doClose() {
|
||||
this.loading = false;
|
||||
this.dialogShow = false;
|
||||
this.$store.dispatch('training/emitTipFresh');
|
||||
this.$store.dispatch('map/setTrainWindowShow', false);
|
||||
},
|
||||
commit() {
|
||||
this.$refs['form'].validate((valid) => {
|
||||
if (valid) {
|
||||
const operate = {
|
||||
send: true,
|
||||
type: MapDeviceType.Train.type,
|
||||
operation: OperationEvent.Train.editTrainNo.menu.operation
|
||||
};
|
||||
|
||||
}
|
||||
this.dialogShow = true;
|
||||
this.$nextTick(function () {
|
||||
this.$store.dispatch('training/emitTipFresh');
|
||||
});
|
||||
},
|
||||
doClose() {
|
||||
this.loading = false;
|
||||
this.dialogShow = false;
|
||||
this.$store.dispatch('training/emitTipFresh');
|
||||
this.$store.dispatch('map/setTrainWindowShow', false);
|
||||
},
|
||||
commit() {
|
||||
this.$refs['form'].validate((valid) => {
|
||||
if (valid) {
|
||||
let operate = {
|
||||
send: true,
|
||||
type: MapDeviceType.Train.type,
|
||||
operation: OperationEvent.Train.editTrainNo.menu.operation,
|
||||
}
|
||||
this.loading = true;
|
||||
this.$store.dispatch('training/next', operate).then(({ valid }) => {
|
||||
this.loading = false;
|
||||
if (valid) {
|
||||
this.doClose();
|
||||
}
|
||||
}).catch(() => {
|
||||
this.loading = false;
|
||||
this.doClose();
|
||||
});
|
||||
} else {
|
||||
return false;
|
||||
}
|
||||
});
|
||||
},
|
||||
cancel() {
|
||||
const operate = {
|
||||
type: MapDeviceType.Train.type,
|
||||
operation: OperationEvent.Command.cancel.menu.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();
|
||||
})
|
||||
} else {
|
||||
return false;
|
||||
}
|
||||
});
|
||||
},
|
||||
cancel() {
|
||||
let operate = {
|
||||
type: MapDeviceType.Train.type,
|
||||
operation: OperationEvent.Command.cancel.menu.operation,
|
||||
}
|
||||
|
||||
this.$store.dispatch('training/next', operate).then(({ valid }) => {
|
||||
if (valid) {
|
||||
this.doClose();
|
||||
}
|
||||
}).catch(error => { this.doClose(); });
|
||||
}
|
||||
}
|
||||
}
|
||||
this.$store.dispatch('training/next', operate).then(({ valid }) => {
|
||||
if (valid) {
|
||||
this.doClose();
|
||||
}
|
||||
}).catch(() => { this.doClose(); });
|
||||
}
|
||||
}
|
||||
};
|
||||
</script>
|
||||
<style scoped>
|
||||
.fuzhou-01__systerm .el-dialog .base-label {
|
||||
|
@ -1,178 +1,191 @@
|
||||
<template>
|
||||
<el-dialog class="fuzhou-01__systerm stand-stop-time" :title="title" :visible.sync="show" width="640px"
|
||||
:before-close="doClose" :zIndex="2000" :modal="false" :close-on-click-modal="false" v-dialogDrag>
|
||||
<el-form size="small" label-width="80px" :model="addModel" :rules="rules" ref="form">
|
||||
<div style="width: 46%;">
|
||||
<el-form-item :label="this.$t('menu.groupNumber')+this.$t('global.colon')" label-width="95px" prop="tripNumber">
|
||||
<el-input v-model="addModel.tripNumber" disabled></el-input>
|
||||
</el-form-item>
|
||||
</div>
|
||||
<div style="overflow: hidden;">
|
||||
<div
|
||||
style="width: 48%; float: left; padding: 10px 15px; border: 1px double lightgray; margin: 20px 0px; height: 120px; margin-right: 4%;">
|
||||
<span class="base-label">{{$t('menu.sourceTrainWindow')}}</span>
|
||||
<div style="position: relative; top:-10px;">
|
||||
<el-form-item prop="stationStandSource">
|
||||
<span slot="label">{{$t('menu.station') + $t('global.colon')}}</span>
|
||||
<el-select v-model="addModel.stationStandSource" filterable :placeholder="this.$t('global.choose')">
|
||||
<el-option v-for="item in stationStandList" :key="item.code" :label="item.name"
|
||||
:value="item.code">
|
||||
</el-option>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item :label="this.$t('menu.trainWindow')+this.$t('global.colon')" prop="trainSource">
|
||||
<el-input v-model="addModel.trainSource"></el-input>
|
||||
</el-form-item>
|
||||
</div>
|
||||
</div>
|
||||
<div
|
||||
style="width: 48%; float: left; padding: 10px 15px; border: 1px double lightgray; margin: 20px 0px; height: 120px;">
|
||||
<span class="base-label">{{$t('menu.targetTrainWindow')}}</span>
|
||||
<div style="position: relative; top:-10px;">
|
||||
<el-form-item prop="stationStandGoal">
|
||||
<span slot="label">{{$t('menu.station') + $t('global.colon')}}</span>
|
||||
<el-select v-model="addModel.stationStandGoal" filterable :placeholder="this.$t('global.choose')">
|
||||
<el-option v-for="item in stationStandList" :key="item.code" :label="item.name"
|
||||
:value="item.code">
|
||||
</el-option>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item :label="this.$t('menu.trainWindow')+this.$t('global.colon')" prop="trainGoal">
|
||||
<el-input v-model="addModel.trainGoal"></el-input>
|
||||
</el-form-item>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</el-form>
|
||||
<el-row justify="center" class="button-group">
|
||||
<el-col :span="10" :offset="2">
|
||||
<el-button :id="domIdConfirm" type="primary" :loading="loading" @click="commit">{{$t('global.confirm')}}</el-button>
|
||||
</el-col>
|
||||
<el-col :span="8" :offset="4">
|
||||
<el-button :id="domIdCancel" @click="cancel">{{$t('global.cancel')}}</el-button>
|
||||
</el-col>
|
||||
</el-row>
|
||||
</el-dialog>
|
||||
<el-dialog
|
||||
v-dialogDrag
|
||||
class="fuzhou-01__systerm stand-stop-time"
|
||||
:title="title"
|
||||
:visible.sync="show"
|
||||
width="640px"
|
||||
:before-close="doClose"
|
||||
:z-index="2000"
|
||||
:modal="false"
|
||||
:close-on-click-modal="false"
|
||||
>
|
||||
<el-form ref="form" size="small" label-width="80px" :model="addModel" :rules="rules">
|
||||
<div style="width: 46%;">
|
||||
<el-form-item :label="this.$t('menu.groupNumber')+this.$t('global.colon')" label-width="95px" prop="tripNumber">
|
||||
<el-input v-model="addModel.tripNumber" disabled />
|
||||
</el-form-item>
|
||||
</div>
|
||||
<div style="overflow: hidden;">
|
||||
<div
|
||||
style="width: 48%; float: left; padding: 10px 15px; border: 1px double lightgray; margin: 20px 0px; height: 120px; margin-right: 4%;"
|
||||
>
|
||||
<span class="base-label">{{ $t('menu.sourceTrainWindow') }}</span>
|
||||
<div style="position: relative; top:-10px;">
|
||||
<el-form-item prop="stationStandSource">
|
||||
<span slot="label">{{ $t('menu.station') + $t('global.colon') }}</span>
|
||||
<el-select v-model="addModel.stationStandSource" filterable :placeholder="this.$t('global.choose')">
|
||||
<el-option
|
||||
v-for="item in stationStandList"
|
||||
:key="item.code"
|
||||
:label="item.name"
|
||||
:value="item.code"
|
||||
/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item :label="this.$t('menu.trainWindow')+this.$t('global.colon')" prop="trainSource">
|
||||
<el-input v-model="addModel.trainSource" />
|
||||
</el-form-item>
|
||||
</div>
|
||||
</div>
|
||||
<div
|
||||
style="width: 48%; float: left; padding: 10px 15px; border: 1px double lightgray; margin: 20px 0px; height: 120px;"
|
||||
>
|
||||
<span class="base-label">{{ $t('menu.targetTrainWindow') }}</span>
|
||||
<div style="position: relative; top:-10px;">
|
||||
<el-form-item prop="stationStandGoal">
|
||||
<span slot="label">{{ $t('menu.station') + $t('global.colon') }}</span>
|
||||
<el-select v-model="addModel.stationStandGoal" filterable :placeholder="this.$t('global.choose')">
|
||||
<el-option
|
||||
v-for="item in stationStandList"
|
||||
:key="item.code"
|
||||
:label="item.name"
|
||||
:value="item.code"
|
||||
/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item :label="this.$t('menu.trainWindow')+this.$t('global.colon')" prop="trainGoal">
|
||||
<el-input v-model="addModel.trainGoal" />
|
||||
</el-form-item>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</el-form>
|
||||
<el-row justify="center" class="button-group">
|
||||
<el-col :span="10" :offset="2">
|
||||
<el-button :id="domIdConfirm" type="primary" :loading="loading" @click="commit">{{ $t('global.confirm') }}</el-button>
|
||||
</el-col>
|
||||
<el-col :span="8" :offset="4">
|
||||
<el-button :id="domIdCancel" @click="cancel">{{ $t('global.cancel') }}</el-button>
|
||||
</el-col>
|
||||
</el-row>
|
||||
</el-dialog>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import { mapGetters } from 'vuex';
|
||||
import { MapDeviceType, OperationEvent } from '@/scripts/ConstDic';
|
||||
import { mapGetters } from 'vuex';
|
||||
import { MapDeviceType, OperationEvent } from '@/scripts/ConstDic';
|
||||
|
||||
export default {
|
||||
name: 'TrainMove',
|
||||
components: {
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
trainNoList: [],
|
||||
addModel: {
|
||||
tripNumber: '',
|
||||
trainSource: '',
|
||||
stationStandSource: '',
|
||||
trainGoal: '',
|
||||
stationStandGoal: '',
|
||||
},
|
||||
export default {
|
||||
name: 'TrainMove',
|
||||
components: {
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
trainNoList: [],
|
||||
addModel: {
|
||||
tripNumber: '',
|
||||
trainSource: '',
|
||||
stationStandSource: '',
|
||||
trainGoal: '',
|
||||
stationStandGoal: ''
|
||||
},
|
||||
|
||||
rules: {
|
||||
tripNumber: [
|
||||
{ required: true, message: this.$t('rules.selectGroupNumber'), trigger: 'blur' }
|
||||
],
|
||||
trainSource: [
|
||||
{ required: true, message: this.$t('rules.enterTheTripNumber'), trigger: 'blur' }
|
||||
],
|
||||
stationStandSource: [
|
||||
{ required: true, message: this.$t('rules.selectStation'), trigger: 'change' }
|
||||
],
|
||||
trainGoal: [
|
||||
{ required: true, message: this.$t('rules.enterTheTripNumber'), trigger: 'blur' }
|
||||
],
|
||||
stationStandGoal: [
|
||||
{ required: true, message: this.$t('rules.selectStation'), trigger: 'change' }
|
||||
],
|
||||
},
|
||||
dialogShow: false,
|
||||
loading: false,
|
||||
}
|
||||
},
|
||||
computed: {
|
||||
...mapGetters('map', [
|
||||
'stationStandList'
|
||||
]),
|
||||
show() {
|
||||
return this.dialogShow && !this.$store.state.menuOperation.break;
|
||||
},
|
||||
domIdCancel() {
|
||||
return this.dialogShow ? OperationEvent.Command.cancel.menu.domId : '';
|
||||
},
|
||||
domIdConfirm() {
|
||||
return this.dialogShow ? OperationEvent.Train.moveTrainId.menu.domId : '';
|
||||
},
|
||||
title() {
|
||||
return this.$t('menu.menuTrain.moveTrainId');
|
||||
}
|
||||
},
|
||||
mounted() {
|
||||
this.$nextTick(() => {
|
||||
this.$store.dispatch('training/tipReload');
|
||||
})
|
||||
},
|
||||
methods: {
|
||||
doShow(operate, selected) {
|
||||
//如果不是断点激活,则需要对初始值进行初始化
|
||||
if (!this.dialogShow) {
|
||||
rules: {
|
||||
tripNumber: [
|
||||
{ required: true, message: this.$t('rules.selectGroupNumber'), trigger: 'blur' }
|
||||
],
|
||||
trainSource: [
|
||||
{ required: true, message: this.$t('rules.enterTheTripNumber'), trigger: 'blur' }
|
||||
],
|
||||
stationStandSource: [
|
||||
{ required: true, message: this.$t('rules.selectStation'), trigger: 'change' }
|
||||
],
|
||||
trainGoal: [
|
||||
{ required: true, message: this.$t('rules.enterTheTripNumber'), trigger: 'blur' }
|
||||
],
|
||||
stationStandGoal: [
|
||||
{ required: true, message: this.$t('rules.selectStation'), trigger: 'change' }
|
||||
]
|
||||
},
|
||||
dialogShow: false,
|
||||
loading: false
|
||||
};
|
||||
},
|
||||
computed: {
|
||||
...mapGetters('map', [
|
||||
'stationStandList'
|
||||
]),
|
||||
show() {
|
||||
return this.dialogShow && !this.$store.state.menuOperation.break;
|
||||
},
|
||||
domIdCancel() {
|
||||
return this.dialogShow ? OperationEvent.Command.cancel.menu.domId : '';
|
||||
},
|
||||
domIdConfirm() {
|
||||
return this.dialogShow ? OperationEvent.Train.moveTrainId.menu.domId : '';
|
||||
},
|
||||
title() {
|
||||
return this.$t('menu.menuTrain.moveTrainId');
|
||||
}
|
||||
},
|
||||
mounted() {
|
||||
this.$nextTick(() => {
|
||||
this.$store.dispatch('training/tipReload');
|
||||
});
|
||||
},
|
||||
methods: {
|
||||
doShow(operate, selected) {
|
||||
this.dialogShow = true;
|
||||
this.$nextTick(function () {
|
||||
this.$store.dispatch('training/emitTipFresh');
|
||||
});
|
||||
},
|
||||
doClose() {
|
||||
this.loading = false;
|
||||
this.dialogShow = false;
|
||||
this.$store.dispatch('training/emitTipFresh');
|
||||
this.$store.dispatch('map/setTrainWindowShow', false);
|
||||
},
|
||||
commit() {
|
||||
this.$refs['form'].validate((valid) => {
|
||||
if (valid) {
|
||||
const operate = {
|
||||
send: true,
|
||||
type: MapDeviceType.Train.type,
|
||||
operation: OperationEvent.Train.moveTrainId.menu.operation
|
||||
};
|
||||
|
||||
}
|
||||
this.dialogShow = true;
|
||||
this.$nextTick(function () {
|
||||
this.$store.dispatch('training/emitTipFresh');
|
||||
});
|
||||
},
|
||||
doClose() {
|
||||
this.loading = false;
|
||||
this.dialogShow = false;
|
||||
this.$store.dispatch('training/emitTipFresh');
|
||||
this.$store.dispatch('map/setTrainWindowShow', false);
|
||||
},
|
||||
commit() {
|
||||
this.$refs['form'].validate((valid) => {
|
||||
if (valid) {
|
||||
let operate = {
|
||||
send: true,
|
||||
type: MapDeviceType.Train.type,
|
||||
operation: OperationEvent.Train.moveTrainId.menu.operation,
|
||||
}
|
||||
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);
|
||||
});
|
||||
} else {
|
||||
return false;
|
||||
}
|
||||
});
|
||||
},
|
||||
cancel() {
|
||||
const operate = {
|
||||
type: MapDeviceType.Train.type,
|
||||
operation: OperationEvent.Command.cancel.menu.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);
|
||||
})
|
||||
} else {
|
||||
return false;
|
||||
}
|
||||
});
|
||||
},
|
||||
cancel() {
|
||||
let operate = {
|
||||
type: MapDeviceType.Train.type,
|
||||
operation: OperationEvent.Command.cancel.menu.operation,
|
||||
}
|
||||
|
||||
this.$store.dispatch('training/next', operate).then(({ valid }) => {
|
||||
if (valid) {
|
||||
this.doClose();
|
||||
}
|
||||
}).catch(error => { this.doClose(); });
|
||||
}
|
||||
}
|
||||
}
|
||||
this.$store.dispatch('training/next', operate).then(({ valid }) => {
|
||||
if (valid) {
|
||||
this.doClose();
|
||||
}
|
||||
}).catch(() => { this.doClose(); });
|
||||
}
|
||||
}
|
||||
};
|
||||
</script>
|
||||
<style scoped>
|
||||
.fuzhou-01__systerm .el-dialog .base-label {
|
||||
|
@ -1,183 +1,196 @@
|
||||
<template>
|
||||
<el-dialog class="fuzhou-01__systerm stand-stop-time" :title="title" :visible.sync="show" width="640px"
|
||||
:before-close="doClose" :zIndex="2000" :modal="false" :close-on-click-modal="false" v-dialogDrag>
|
||||
<el-form size="small" label-width="80px" :model="addModel" :rules="rules" ref="form">
|
||||
<div style="overflow: hidden;">
|
||||
<div
|
||||
style="width: 48%; float: left; padding: 10px 15px; border: 1px double lightgray; margin: 20px 0px; height: 177px; margin-right: 4%;">
|
||||
<span class="base-label">{{$t('menu.sourceTrainWindow')}}</span>
|
||||
<div style="position: relative; top:-10px;">
|
||||
<el-form-item :label="this.$t('menu.groupNumber')+this.$t('global.colon')" prop="trainNumberSource">
|
||||
<el-input v-model="addModel.trainNumberSource"></el-input>
|
||||
</el-form-item>
|
||||
<el-form-item prop="stationStandSource">
|
||||
<span slot="label">{{$t('menu.station') + $t('global.colon')}}</span>
|
||||
<el-select v-model="addModel.stationStandSource" filterable :placeholder="this.$t('global.choose')">
|
||||
<el-option v-for="item in stationStandList" :key="item.code" :label="item.name"
|
||||
:value="item.code">
|
||||
</el-option>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item :label="this.$t('menu.trainWindow')+this.$t('global.colon')" prop="trainSource">
|
||||
<el-input v-model="addModel.trainSource"></el-input>
|
||||
</el-form-item>
|
||||
</div>
|
||||
</div>
|
||||
<div
|
||||
style="width: 48%; float: left; padding: 10px 15px; border: 1px double lightgray; margin: 20px 0px; height: 177px;">
|
||||
<span class="base-label">{{$t('menu.targetTrainWindow')}}</span>
|
||||
<div style="position: relative; top:-10px;">
|
||||
<el-form-item :label="this.$t('menu.groupNumber')+this.$t('global.colon')" prop="trainNumberGoal">
|
||||
<el-input v-model="addModel.trainNumberGoal"></el-input>
|
||||
</el-form-item>
|
||||
<el-form-item prop="stationStandGoal">
|
||||
<span slot="label">{{$t('menu.station') + $t('global.colon')}}</span>
|
||||
<el-select v-model="addModel.stationStandGoal" filterable :placeholder="this.$t('global.choose')">
|
||||
<el-option v-for="item in stationStandList" :key="item.code" :label="item.name"
|
||||
:value="item.code">
|
||||
</el-option>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item :label="this.$t('menu.trainWindow')+this.$t('global.colon')" prop="trainGoal">
|
||||
<el-input v-model="addModel.trainGoal"></el-input>
|
||||
</el-form-item>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</el-form>
|
||||
<el-row justify="center" class="button-group">
|
||||
<el-col :span="10" :offset="2">
|
||||
<el-button :id="domIdConfirm" type="primary" :loading="loading" @click="commit">{{$t('global.confirm')}}</el-button>
|
||||
</el-col>
|
||||
<el-col :span="8" :offset="4">
|
||||
<el-button :id="domIdCancel" @click="cancel">{{$t('global.cancel')}}</el-button>
|
||||
</el-col>
|
||||
</el-row>
|
||||
</el-dialog>
|
||||
<el-dialog
|
||||
v-dialogDrag
|
||||
class="fuzhou-01__systerm stand-stop-time"
|
||||
:title="title"
|
||||
:visible.sync="show"
|
||||
width="640px"
|
||||
:before-close="doClose"
|
||||
:z-index="2000"
|
||||
:modal="false"
|
||||
:close-on-click-modal="false"
|
||||
>
|
||||
<el-form ref="form" size="small" label-width="80px" :model="addModel" :rules="rules">
|
||||
<div style="overflow: hidden;">
|
||||
<div
|
||||
style="width: 48%; float: left; padding: 10px 15px; border: 1px double lightgray; margin: 20px 0px; height: 177px; margin-right: 4%;"
|
||||
>
|
||||
<span class="base-label">{{ $t('menu.sourceTrainWindow') }}</span>
|
||||
<div style="position: relative; top:-10px;">
|
||||
<el-form-item :label="this.$t('menu.groupNumber')+this.$t('global.colon')" prop="trainNumberSource">
|
||||
<el-input v-model="addModel.trainNumberSource" />
|
||||
</el-form-item>
|
||||
<el-form-item prop="stationStandSource">
|
||||
<span slot="label">{{ $t('menu.station') + $t('global.colon') }}</span>
|
||||
<el-select v-model="addModel.stationStandSource" filterable :placeholder="this.$t('global.choose')">
|
||||
<el-option
|
||||
v-for="item in stationStandList"
|
||||
:key="item.code"
|
||||
:label="item.name"
|
||||
:value="item.code"
|
||||
/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item :label="this.$t('menu.trainWindow')+this.$t('global.colon')" prop="trainSource">
|
||||
<el-input v-model="addModel.trainSource" />
|
||||
</el-form-item>
|
||||
</div>
|
||||
</div>
|
||||
<div
|
||||
style="width: 48%; float: left; padding: 10px 15px; border: 1px double lightgray; margin: 20px 0px; height: 177px;"
|
||||
>
|
||||
<span class="base-label">{{ $t('menu.targetTrainWindow') }}</span>
|
||||
<div style="position: relative; top:-10px;">
|
||||
<el-form-item :label="this.$t('menu.groupNumber')+this.$t('global.colon')" prop="trainNumberGoal">
|
||||
<el-input v-model="addModel.trainNumberGoal" />
|
||||
</el-form-item>
|
||||
<el-form-item prop="stationStandGoal">
|
||||
<span slot="label">{{ $t('menu.station') + $t('global.colon') }}</span>
|
||||
<el-select v-model="addModel.stationStandGoal" filterable :placeholder="this.$t('global.choose')">
|
||||
<el-option
|
||||
v-for="item in stationStandList"
|
||||
:key="item.code"
|
||||
:label="item.name"
|
||||
:value="item.code"
|
||||
/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item :label="this.$t('menu.trainWindow')+this.$t('global.colon')" prop="trainGoal">
|
||||
<el-input v-model="addModel.trainGoal" />
|
||||
</el-form-item>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</el-form>
|
||||
<el-row justify="center" class="button-group">
|
||||
<el-col :span="10" :offset="2">
|
||||
<el-button :id="domIdConfirm" type="primary" :loading="loading" @click="commit">{{ $t('global.confirm') }}</el-button>
|
||||
</el-col>
|
||||
<el-col :span="8" :offset="4">
|
||||
<el-button :id="domIdCancel" @click="cancel">{{ $t('global.cancel') }}</el-button>
|
||||
</el-col>
|
||||
</el-row>
|
||||
</el-dialog>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import { mapGetters } from 'vuex';
|
||||
import { MapDeviceType, OperationEvent } from '@/scripts/ConstDic';
|
||||
import { mapGetters } from 'vuex';
|
||||
import { MapDeviceType, OperationEvent } from '@/scripts/ConstDic';
|
||||
|
||||
export default {
|
||||
name: 'TrainSwitch',
|
||||
components: {
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
trainNoList: [],
|
||||
addModel: {
|
||||
trainNumberSource: '',
|
||||
trainSource: '',
|
||||
stationStandSource: '',
|
||||
trainGoal: '',
|
||||
stationStandGoal: '',
|
||||
trainNumberGoal: '',
|
||||
},
|
||||
export default {
|
||||
name: 'TrainSwitch',
|
||||
components: {
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
trainNoList: [],
|
||||
addModel: {
|
||||
trainNumberSource: '',
|
||||
trainSource: '',
|
||||
stationStandSource: '',
|
||||
trainGoal: '',
|
||||
stationStandGoal: '',
|
||||
trainNumberGoal: ''
|
||||
},
|
||||
|
||||
rules: {
|
||||
trainNumberSource: [
|
||||
{ required: true, message: this.$t('rules.selectGroupNumber'), trigger: 'blur' }
|
||||
],
|
||||
trainSource: [
|
||||
{ required: true, message: this.$t('rules.enterTheTripNumber'), trigger: 'blur' }
|
||||
],
|
||||
stationStandSource: [
|
||||
{ required: true, message: this.$t('rules.selectStation'), trigger: 'change' }
|
||||
],
|
||||
trainNumberGoal: [
|
||||
{ required: true, message: this.$t('rules.selectGroupNumber'), trigger: 'blur' }
|
||||
],
|
||||
trainGoal: [
|
||||
{ required: true, message: this.$t('rules.enterTheTripNumber'), trigger: 'blur' }
|
||||
],
|
||||
stationStandGoal: [
|
||||
{ required: true, message: this.$t('rules.selectStation'), trigger: 'change' }
|
||||
],
|
||||
},
|
||||
dialogShow: false,
|
||||
loading: false,
|
||||
}
|
||||
},
|
||||
computed: {
|
||||
...mapGetters('map', [
|
||||
'stationStandList'
|
||||
]),
|
||||
show() {
|
||||
return this.dialogShow && !this.$store.state.menuOperation.break;
|
||||
},
|
||||
domIdCancel() {
|
||||
return this.dialogShow ? OperationEvent.Command.cancel.menu.domId : '';
|
||||
},
|
||||
domIdConfirm() {
|
||||
return this.dialogShow ? OperationEvent.Train.moveTrainId.menu.domId : '';
|
||||
},
|
||||
title() {
|
||||
return this.$t('menu.menuTrain.moveTrainId');
|
||||
}
|
||||
},
|
||||
mounted() {
|
||||
this.$nextTick(() => {
|
||||
this.$store.dispatch('training/tipReload');
|
||||
})
|
||||
},
|
||||
methods: {
|
||||
doShow(operate, selected) {
|
||||
//如果不是断点激活,则需要对初始值进行初始化
|
||||
if (!this.dialogShow) {
|
||||
rules: {
|
||||
trainNumberSource: [
|
||||
{ required: true, message: this.$t('rules.selectGroupNumber'), trigger: 'blur' }
|
||||
],
|
||||
trainSource: [
|
||||
{ required: true, message: this.$t('rules.enterTheTripNumber'), trigger: 'blur' }
|
||||
],
|
||||
stationStandSource: [
|
||||
{ required: true, message: this.$t('rules.selectStation'), trigger: 'change' }
|
||||
],
|
||||
trainNumberGoal: [
|
||||
{ required: true, message: this.$t('rules.selectGroupNumber'), trigger: 'blur' }
|
||||
],
|
||||
trainGoal: [
|
||||
{ required: true, message: this.$t('rules.enterTheTripNumber'), trigger: 'blur' }
|
||||
],
|
||||
stationStandGoal: [
|
||||
{ required: true, message: this.$t('rules.selectStation'), trigger: 'change' }
|
||||
]
|
||||
},
|
||||
dialogShow: false,
|
||||
loading: false
|
||||
};
|
||||
},
|
||||
computed: {
|
||||
...mapGetters('map', [
|
||||
'stationStandList'
|
||||
]),
|
||||
show() {
|
||||
return this.dialogShow && !this.$store.state.menuOperation.break;
|
||||
},
|
||||
domIdCancel() {
|
||||
return this.dialogShow ? OperationEvent.Command.cancel.menu.domId : '';
|
||||
},
|
||||
domIdConfirm() {
|
||||
return this.dialogShow ? OperationEvent.Train.moveTrainId.menu.domId : '';
|
||||
},
|
||||
title() {
|
||||
return this.$t('menu.menuTrain.moveTrainId');
|
||||
}
|
||||
},
|
||||
mounted() {
|
||||
this.$nextTick(() => {
|
||||
this.$store.dispatch('training/tipReload');
|
||||
});
|
||||
},
|
||||
methods: {
|
||||
doShow(operate, selected) {
|
||||
this.dialogShow = true;
|
||||
this.$nextTick(function () {
|
||||
this.$store.dispatch('training/emitTipFresh');
|
||||
});
|
||||
},
|
||||
doClose() {
|
||||
this.loading = false;
|
||||
this.dialogShow = false;
|
||||
this.$store.dispatch('training/emitTipFresh');
|
||||
this.$store.dispatch('map/setTrainWindowShow', false);
|
||||
},
|
||||
commit() {
|
||||
this.$refs['form'].validate((valid) => {
|
||||
if (valid) {
|
||||
const operate = {
|
||||
send: true,
|
||||
type: MapDeviceType.Train.type,
|
||||
operation: OperationEvent.Train.moveTrainId.menu.operation
|
||||
};
|
||||
|
||||
}
|
||||
this.dialogShow = true;
|
||||
this.$nextTick(function () {
|
||||
this.$store.dispatch('training/emitTipFresh');
|
||||
});
|
||||
},
|
||||
doClose() {
|
||||
this.loading = false;
|
||||
this.dialogShow = false;
|
||||
this.$store.dispatch('training/emitTipFresh');
|
||||
this.$store.dispatch('map/setTrainWindowShow', false);
|
||||
},
|
||||
commit() {
|
||||
this.$refs['form'].validate((valid) => {
|
||||
if (valid) {
|
||||
let operate = {
|
||||
send: true,
|
||||
type: MapDeviceType.Train.type,
|
||||
operation: OperationEvent.Train.moveTrainId.menu.operation,
|
||||
}
|
||||
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);
|
||||
});
|
||||
} else {
|
||||
return false;
|
||||
}
|
||||
});
|
||||
},
|
||||
cancel() {
|
||||
const operate = {
|
||||
type: MapDeviceType.Train.type,
|
||||
operation: OperationEvent.Command.cancel.menu.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);
|
||||
})
|
||||
} else {
|
||||
return false;
|
||||
}
|
||||
});
|
||||
},
|
||||
cancel() {
|
||||
let operate = {
|
||||
type: MapDeviceType.Train.type,
|
||||
operation: OperationEvent.Command.cancel.menu.operation,
|
||||
}
|
||||
|
||||
this.$store.dispatch('training/next', operate).then(({ valid }) => {
|
||||
if (valid) {
|
||||
this.doClose();
|
||||
}
|
||||
}).catch(error => { this.doClose(); });
|
||||
}
|
||||
}
|
||||
}
|
||||
this.$store.dispatch('training/next', operate).then(({ valid }) => {
|
||||
if (valid) {
|
||||
this.doClose();
|
||||
}
|
||||
}).catch(() => { this.doClose(); });
|
||||
}
|
||||
}
|
||||
};
|
||||
</script>
|
||||
<style scoped>
|
||||
.fuzhou-01__systerm .el-dialog .base-label {
|
||||
|
@ -689,7 +689,7 @@ export default {
|
||||
},
|
||||
undeveloped() {
|
||||
this.doClose();
|
||||
|
||||
|
||||
this.$alert(this.$t('menu.menuBar.implemented'), this.$t('global.tips'), {
|
||||
confirmButtonText: this.$t('global.confirm'),
|
||||
callback: action => {
|
||||
|
@ -1,133 +1,142 @@
|
||||
<template>
|
||||
<el-dialog class="fuzhou-01__systerm two-confirmation" :title="$t('menu.menuChildDialog.secondaryConfirmation')" :visible.sync="show" width="360px"
|
||||
:before-close="doClose" :showClose="false" :zIndex="2000" :modal="false" :close-on-click-modal="false"
|
||||
append-to-body v-dialogDrag>
|
||||
<div class="context">
|
||||
<template v-for="message in messages">
|
||||
<span>{{message}}</span><br/>
|
||||
</template>
|
||||
</div>
|
||||
<el-row class="button-group">
|
||||
<el-col :span="10" :offset="3">
|
||||
<el-button :id="show? domIdConfirm: ''" :loading="loading" @click="commit">{{$t('menu.menuChildDialog.confirm')}}</el-button>
|
||||
</el-col>
|
||||
<el-col :span="6" :offset="4">
|
||||
<el-button :id="domIdCancel" @click="cancel">{{$t('menu.menuChildDialog.close')}}</el-button>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<notice-info ref="noticeInfo"></notice-info>
|
||||
</el-dialog>
|
||||
<el-dialog
|
||||
v-dialogDrag
|
||||
class="fuzhou-01__systerm two-confirmation"
|
||||
:title="$t('menu.menuChildDialog.secondaryConfirmation')"
|
||||
:visible.sync="show"
|
||||
width="360px"
|
||||
:before-close="doClose"
|
||||
:show-close="false"
|
||||
:z-index="2000"
|
||||
:modal="false"
|
||||
:close-on-click-modal="false"
|
||||
append-to-body
|
||||
>
|
||||
<div class="context">
|
||||
<template v-for="(message,index) in messages">
|
||||
<span :key="index">{{ message }}</span><br>
|
||||
</template>
|
||||
</div>
|
||||
<el-row class="button-group">
|
||||
<el-col :span="10" :offset="3">
|
||||
<el-button :id="show? domIdConfirm: ''" :loading="loading" @click="commit">{{ $t('menu.menuChildDialog.confirm') }}</el-button>
|
||||
</el-col>
|
||||
<el-col :span="6" :offset="4">
|
||||
<el-button :id="domIdCancel" @click="cancel">{{ $t('menu.menuChildDialog.close') }}</el-button>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<notice-info ref="noticeInfo" />
|
||||
</el-dialog>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import { MapDeviceType, OperationEvent, checkOperationIsCurrentOperate } from '@/scripts/ConstDic';
|
||||
import NoticeInfo from '../../dialog/childDialog/childDialog/noticeInfo'
|
||||
import { OperationEvent, checkOperationIsCurrentOperate } from '@/scripts/ConstDic';
|
||||
import NoticeInfo from '../../dialog/childDialog/childDialog/noticeInfo';
|
||||
|
||||
export default {
|
||||
name: 'TwoConfirmation',
|
||||
data() {
|
||||
return {
|
||||
dialogShow: false,
|
||||
loading: false,
|
||||
operate: '',
|
||||
timer: null,
|
||||
domIdConfirm: ''
|
||||
}
|
||||
},
|
||||
components: {
|
||||
NoticeInfo
|
||||
},
|
||||
computed: {
|
||||
show() {
|
||||
return this.dialogShow && !this.$store.state.menuOperation.break;
|
||||
},
|
||||
domIdCancel() {
|
||||
return this.dialogShow ? OperationEvent.Command.close.confirm.domId : '';
|
||||
},
|
||||
messages() {
|
||||
if (this.operate) {
|
||||
return this.operate.messages;
|
||||
}
|
||||
return []
|
||||
}
|
||||
},
|
||||
mounted() {
|
||||
this.$nextTick(() => {
|
||||
this.$store.dispatch('training/tipReload');
|
||||
})
|
||||
},
|
||||
methods: {
|
||||
doShow(operate) {
|
||||
this.domIdConfirm = '';
|
||||
if (checkOperationIsCurrentOperate(operate.operation, OperationEvent.StationControl.forcedStationControl)) {
|
||||
this.domIdConfirm = OperationEvent.StationControl.forcedStationControl.confirm.domId;
|
||||
} else if (checkOperationIsCurrentOperate(operate.operation, OperationEvent.StationControl.requestStationControl)) {
|
||||
this.domIdConfirm = OperationEvent.StationControl.requestStationControl.confirm.domId;
|
||||
} else if (checkOperationIsCurrentOperate(this.operation, OperationEvent.StationControl.requestCentralControl)) {
|
||||
this.domIdConfirm = OperationEvent.StationControl.requestCentralControl.confirm.domId;
|
||||
}
|
||||
export default {
|
||||
name: 'TwoConfirmation',
|
||||
components: {
|
||||
NoticeInfo
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
dialogShow: false,
|
||||
loading: false,
|
||||
operate: '',
|
||||
timer: null,
|
||||
domIdConfirm: ''
|
||||
};
|
||||
},
|
||||
computed: {
|
||||
show() {
|
||||
return this.dialogShow && !this.$store.state.menuOperation.break;
|
||||
},
|
||||
domIdCancel() {
|
||||
return this.dialogShow ? OperationEvent.Command.close.confirm.domId : '';
|
||||
},
|
||||
messages() {
|
||||
if (this.operate) {
|
||||
return this.operate.messages;
|
||||
}
|
||||
return [];
|
||||
}
|
||||
},
|
||||
mounted() {
|
||||
this.$nextTick(() => {
|
||||
this.$store.dispatch('training/tipReload');
|
||||
});
|
||||
},
|
||||
methods: {
|
||||
doShow(operate) {
|
||||
this.domIdConfirm = '';
|
||||
if (checkOperationIsCurrentOperate(operate.operation, OperationEvent.StationControl.forcedStationControl)) {
|
||||
this.domIdConfirm = OperationEvent.StationControl.forcedStationControl.confirm.domId;
|
||||
} else if (checkOperationIsCurrentOperate(operate.operation, OperationEvent.StationControl.requestStationControl)) {
|
||||
this.domIdConfirm = OperationEvent.StationControl.requestStationControl.confirm.domId;
|
||||
} else if (checkOperationIsCurrentOperate(this.operation, OperationEvent.StationControl.requestCentralControl)) {
|
||||
this.domIdConfirm = OperationEvent.StationControl.requestCentralControl.confirm.domId;
|
||||
}
|
||||
|
||||
this.operate = operate || {};
|
||||
this.dialogShow = true;
|
||||
this.$nextTick(function () {
|
||||
this.$store.dispatch('training/emitTipFresh');
|
||||
});
|
||||
},
|
||||
doClose() {
|
||||
this.dialogShow = false;
|
||||
this.$store.dispatch('training/emitTipFresh');
|
||||
},
|
||||
cancel() {
|
||||
let operate = {
|
||||
type: this.operate.type,
|
||||
operation: OperationEvent.Command.close.confirm.operation,
|
||||
}
|
||||
this.operate = operate || {};
|
||||
this.dialogShow = true;
|
||||
this.$nextTick(function () {
|
||||
this.$store.dispatch('training/emitTipFresh');
|
||||
});
|
||||
},
|
||||
doClose() {
|
||||
this.dialogShow = false;
|
||||
this.$store.dispatch('training/emitTipFresh');
|
||||
},
|
||||
cancel() {
|
||||
const operate = {
|
||||
type: this.operate.type,
|
||||
operation: OperationEvent.Command.close.confirm.operation
|
||||
};
|
||||
|
||||
this.$emit('setOperate', { selection: this.operate.selection, cancel: true });
|
||||
this.$store.dispatch('training/next', operate).then(({ valid }) => {
|
||||
if (valid) {
|
||||
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
|
||||
this.doClose();
|
||||
}
|
||||
})
|
||||
},
|
||||
forEachDoHandler(selection, handler) {
|
||||
selection.forEach(elem => {
|
||||
handler(elem)
|
||||
})
|
||||
},
|
||||
commit() {
|
||||
if (this.operate) {
|
||||
this.loading = true;
|
||||
this.forEachDoHandler(this.operate.selection || [], elem => {
|
||||
let operate = {
|
||||
send: true,
|
||||
type: this.operate.type,
|
||||
val: elem.code
|
||||
}
|
||||
this.$emit('setOperate', { selection: this.operate.selection, cancel: true });
|
||||
this.$store.dispatch('training/next', operate).then(({ valid }) => {
|
||||
if (valid) {
|
||||
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
|
||||
this.doClose();
|
||||
}
|
||||
});
|
||||
},
|
||||
forEachDoHandler(selection, handler) {
|
||||
selection.forEach(elem => {
|
||||
handler(elem);
|
||||
});
|
||||
},
|
||||
commit() {
|
||||
if (this.operate) {
|
||||
this.loading = true;
|
||||
this.forEachDoHandler(this.operate.selection || [], elem => {
|
||||
const operate = {
|
||||
send: true,
|
||||
type: this.operate.type,
|
||||
val: elem.code
|
||||
};
|
||||
|
||||
if (checkOperationIsCurrentOperate(this.operate.operation, OperationEvent.StationControl.forcedStationControl)) {
|
||||
operate.operation = OperationEvent.StationControl.forcedStationControl.confirm.operation;
|
||||
} else if (checkOperationIsCurrentOperate(this.operate.operation, OperationEvent.StationControl.requestStationControl)) {
|
||||
operate.operation = OperationEvent.StationControl.requestStationControl.confirm.operation;
|
||||
} else if (checkOperationIsCurrentOperate(this.operate.operation, OperationEvent.StationControl.requestCentralControl)) {
|
||||
operate.operation = OperationEvent.StationControl.requestCentralControl.confirm.operation;
|
||||
}
|
||||
if (checkOperationIsCurrentOperate(this.operate.operation, OperationEvent.StationControl.forcedStationControl)) {
|
||||
operate.operation = OperationEvent.StationControl.forcedStationControl.confirm.operation;
|
||||
} else if (checkOperationIsCurrentOperate(this.operate.operation, OperationEvent.StationControl.requestStationControl)) {
|
||||
operate.operation = OperationEvent.StationControl.requestStationControl.confirm.operation;
|
||||
} else if (checkOperationIsCurrentOperate(this.operate.operation, OperationEvent.StationControl.requestCentralControl)) {
|
||||
operate.operation = OperationEvent.StationControl.requestCentralControl.confirm.operation;
|
||||
}
|
||||
|
||||
|
||||
this.doClose();
|
||||
this.$emit('setOperate', { selection: this.operate.selection, commit: true });
|
||||
this.$store.dispatch('training/next', operate).then(({ valid, response }) => {
|
||||
if (valid) {
|
||||
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
|
||||
}
|
||||
}).catch((error) => {
|
||||
this.$refs.noticeInfo.doShow(operate);
|
||||
});
|
||||
})
|
||||
this.loading = false;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
this.doClose();
|
||||
this.$emit('setOperate', { selection: this.operate.selection, commit: true });
|
||||
this.$store.dispatch('training/next', operate).then(({ valid, response }) => {
|
||||
if (valid) {
|
||||
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
|
||||
}
|
||||
}).catch(() => {
|
||||
this.$refs.noticeInfo.doShow(operate);
|
||||
});
|
||||
});
|
||||
this.loading = false;
|
||||
}
|
||||
}
|
||||
}
|
||||
};
|
||||
</script>
|
||||
|
@ -1,154 +1,164 @@
|
||||
<template>
|
||||
<el-dialog class="fuzhou-01__systerm user-add" :title="title" :visible.sync="show" width="420px"
|
||||
:before-close="doClose" :zIndex="2000" :modal="false" :close-on-click-modal="false" append-to-body v-dialogDrag>
|
||||
<div style="padding: 15px 40px; border: 1px double lightgray; margin: 20px 10px; ">
|
||||
<el-form size="small" label-width="90px" :model="model" label-position="left" :rules="rules" ref="form">
|
||||
<el-form-item :label="$t('menu.menuChildDialog.jobNumber')" prop="jobNumber">
|
||||
<el-input v-model="model.jobNumber"></el-input>
|
||||
</el-form-item>
|
||||
<el-form-item :label="$t('menu.menuChildDialog.userName')" prop="userName">
|
||||
<el-input v-model="model.userName"></el-input>
|
||||
</el-form-item>
|
||||
<el-form-item :label="$t('menu.menuChildDialog.password')" prop="password">
|
||||
<el-input type="password" v-model="model.password"></el-input>
|
||||
</el-form-item>
|
||||
<el-form-item :label="$t('menu.menuChildDialog.confirmPassword')" prop="confirm">
|
||||
<el-input type="password" v-model="model.confirm"></el-input>
|
||||
</el-form-item>
|
||||
<el-dialog
|
||||
v-dialogDrag
|
||||
class="fuzhou-01__systerm user-add"
|
||||
:title="title"
|
||||
:visible.sync="show"
|
||||
width="420px"
|
||||
:before-close="doClose"
|
||||
:z-index="2000"
|
||||
:modal="false"
|
||||
:close-on-click-modal="false"
|
||||
append-to-body
|
||||
>
|
||||
<div style="padding: 15px 40px; border: 1px double lightgray; margin: 20px 10px; ">
|
||||
<el-form ref="form" size="small" label-width="90px" :model="model" label-position="left" :rules="rules">
|
||||
<el-form-item :label="$t('menu.menuChildDialog.jobNumber')" prop="jobNumber">
|
||||
<el-input v-model="model.jobNumber" />
|
||||
</el-form-item>
|
||||
<el-form-item :label="$t('menu.menuChildDialog.userName')" prop="userName">
|
||||
<el-input v-model="model.userName" />
|
||||
</el-form-item>
|
||||
<el-form-item :label="$t('menu.menuChildDialog.password')" prop="password">
|
||||
<el-input v-model="model.password" type="password" />
|
||||
</el-form-item>
|
||||
<el-form-item :label="$t('menu.menuChildDialog.confirmPassword')" prop="confirm">
|
||||
<el-input v-model="model.confirm" type="password" />
|
||||
</el-form-item>
|
||||
|
||||
</el-form>
|
||||
</div>
|
||||
<el-row justify="center" class="button-group">
|
||||
<el-col :span="8" :offset="6">
|
||||
<el-button :id="domIdConfirm" type="primary" :loading="loading" @click="commit">{{$t('menu.menuChildDialog.determine')}}</el-button>
|
||||
</el-col>
|
||||
<el-col :span="8" :offset="0">
|
||||
<el-button :id="domIdCancel" @click="cancel">{{$t('menu.menuChildDialog.cancel')}}</el-button>
|
||||
</el-col>
|
||||
</el-row>
|
||||
</el-dialog>
|
||||
</el-form>
|
||||
</div>
|
||||
<el-row justify="center" class="button-group">
|
||||
<el-col :span="8" :offset="6">
|
||||
<el-button :id="domIdConfirm" type="primary" :loading="loading" @click="commit">{{ $t('menu.menuChildDialog.determine') }}</el-button>
|
||||
</el-col>
|
||||
<el-col :span="8" :offset="0">
|
||||
<el-button :id="domIdCancel" @click="cancel">{{ $t('menu.menuChildDialog.cancel') }}</el-button>
|
||||
</el-col>
|
||||
</el-row>
|
||||
</el-dialog>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import { mapGetters } from 'vuex';
|
||||
import { MapDeviceType, OperationEvent } from '@/scripts/ConstDic';
|
||||
import { mapGetters } from 'vuex';
|
||||
import { OperationEvent } from '@/scripts/ConstDic';
|
||||
|
||||
export default {
|
||||
name: 'UserAdd',
|
||||
components: {
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
operate: {},
|
||||
operation: null,
|
||||
dialogShow: false,
|
||||
loading: false,
|
||||
model: {
|
||||
type: 'ADD',
|
||||
jobNumber: '',
|
||||
userName: '',
|
||||
password: '',
|
||||
confirm: '',
|
||||
},
|
||||
rules: {
|
||||
jobNumber: [
|
||||
{ required: true, message: this.$t('menu.menuChildDialog.inputJobNumber'), trigger: 'blur' }
|
||||
],
|
||||
userName: [
|
||||
{ required: true, message: this.$t('menu.menuChildDialog.inputUserName'), trigger: 'blur' }
|
||||
],
|
||||
password: [
|
||||
{ required: true, message: this.$t('menu.menuChildDialog.inputPassword'), trigger: 'change' }
|
||||
],
|
||||
confirm: [
|
||||
{ required: true, message: this.$t('menu.menuChildDialog.inputPasswordAgain'), trigger: 'change' }
|
||||
],
|
||||
},
|
||||
}
|
||||
},
|
||||
computed: {
|
||||
...mapGetters('map', [
|
||||
'stationStandList'
|
||||
]),
|
||||
show() {
|
||||
return this.dialogShow && !this.$store.state.menuOperation.break;
|
||||
},
|
||||
domIdCancel() {
|
||||
return this.dialogShow ? OperationEvent.Command.cancel.menu.domId : '';
|
||||
},
|
||||
domIdConfirm() {
|
||||
return this.dialogShow ? OperationEvent.Command.close.confirm.domId : '';
|
||||
},
|
||||
title() {
|
||||
return this.$t('menu.menuChildDialog.addUser')
|
||||
}
|
||||
},
|
||||
mounted() {
|
||||
this.$nextTick(() => {
|
||||
this.$store.dispatch('training/tipReload');
|
||||
})
|
||||
},
|
||||
methods: {
|
||||
doShow(operate) {
|
||||
//非断电激活时设置初始值
|
||||
if (!this.dialogShow) {
|
||||
this.loading = false;
|
||||
this.operate = operate || {};
|
||||
this.operation = operate.operation;
|
||||
this.$nextTick(() => {
|
||||
this.$refs.form.resetFields();
|
||||
});
|
||||
}
|
||||
export default {
|
||||
name: 'UserAdd',
|
||||
components: {
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
operate: {},
|
||||
operation: null,
|
||||
dialogShow: false,
|
||||
loading: false,
|
||||
model: {
|
||||
type: 'ADD',
|
||||
jobNumber: '',
|
||||
userName: '',
|
||||
password: '',
|
||||
confirm: ''
|
||||
},
|
||||
rules: {
|
||||
jobNumber: [
|
||||
{ required: true, message: this.$t('menu.menuChildDialog.inputJobNumber'), trigger: 'blur' }
|
||||
],
|
||||
userName: [
|
||||
{ required: true, message: this.$t('menu.menuChildDialog.inputUserName'), trigger: 'blur' }
|
||||
],
|
||||
password: [
|
||||
{ required: true, message: this.$t('menu.menuChildDialog.inputPassword'), trigger: 'change' }
|
||||
],
|
||||
confirm: [
|
||||
{ required: true, message: this.$t('menu.menuChildDialog.inputPasswordAgain'), trigger: 'change' }
|
||||
]
|
||||
}
|
||||
};
|
||||
},
|
||||
computed: {
|
||||
...mapGetters('map', [
|
||||
'stationStandList'
|
||||
]),
|
||||
show() {
|
||||
return this.dialogShow && !this.$store.state.menuOperation.break;
|
||||
},
|
||||
domIdCancel() {
|
||||
return this.dialogShow ? OperationEvent.Command.cancel.menu.domId : '';
|
||||
},
|
||||
domIdConfirm() {
|
||||
return this.dialogShow ? OperationEvent.Command.close.confirm.domId : '';
|
||||
},
|
||||
title() {
|
||||
return this.$t('menu.menuChildDialog.addUser');
|
||||
}
|
||||
},
|
||||
mounted() {
|
||||
this.$nextTick(() => {
|
||||
this.$store.dispatch('training/tipReload');
|
||||
});
|
||||
},
|
||||
methods: {
|
||||
doShow(operate) {
|
||||
// 非断电激活时设置初始值
|
||||
if (!this.dialogShow) {
|
||||
this.loading = false;
|
||||
this.operate = operate || {};
|
||||
this.operation = operate.operation;
|
||||
this.$nextTick(() => {
|
||||
this.$refs.form.resetFields();
|
||||
});
|
||||
}
|
||||
|
||||
this.dialogShow = true;
|
||||
this.$nextTick(function () {
|
||||
this.$store.dispatch('training/emitTipFresh');
|
||||
});
|
||||
},
|
||||
doClose() {
|
||||
this.loading = false;
|
||||
this.dialogShow = false;
|
||||
this.$store.dispatch('training/emitTipFresh');
|
||||
},
|
||||
commit() {
|
||||
this.$refs['form'].validate((valid) => {
|
||||
if (valid) {
|
||||
let operate = {
|
||||
type: this.operate.type,
|
||||
operation: OperationEvent.Command.close.confirm.operation,
|
||||
}
|
||||
this.dialogShow = true;
|
||||
this.$nextTick(function () {
|
||||
this.$store.dispatch('training/emitTipFresh');
|
||||
});
|
||||
},
|
||||
doClose() {
|
||||
this.loading = false;
|
||||
this.dialogShow = false;
|
||||
this.$store.dispatch('training/emitTipFresh');
|
||||
},
|
||||
commit() {
|
||||
this.$refs['form'].validate((valid) => {
|
||||
if (valid) {
|
||||
const operate = {
|
||||
type: this.operate.type,
|
||||
operation: OperationEvent.Command.close.confirm.operation
|
||||
};
|
||||
|
||||
this.loading = true;
|
||||
this.$store.dispatch('training/next', operate).then(({ valid }) => {
|
||||
this.loading = false;
|
||||
if (valid) {
|
||||
if (this.model.password === this.model.confirm) {
|
||||
this.doClose();
|
||||
this.$emit('operateUser', this.model);
|
||||
} else {
|
||||
this.$messageBox(this.$t('menu.menuChildDialog.passwordInconsistent'));
|
||||
}
|
||||
}
|
||||
})
|
||||
} else {
|
||||
return false;
|
||||
}
|
||||
});
|
||||
},
|
||||
cancel() {
|
||||
let operate = {
|
||||
type: this.operate.type,
|
||||
operation: OperationEvent.Command.cancel.menu.operation,
|
||||
}
|
||||
this.loading = true;
|
||||
this.$store.dispatch('training/next', operate).then(({ valid }) => {
|
||||
this.loading = false;
|
||||
if (valid) {
|
||||
if (this.model.password === this.model.confirm) {
|
||||
this.doClose();
|
||||
this.$emit('operateUser', this.model);
|
||||
} else {
|
||||
this.$messageBox(this.$t('menu.menuChildDialog.passwordInconsistent'));
|
||||
}
|
||||
}
|
||||
});
|
||||
} else {
|
||||
return false;
|
||||
}
|
||||
});
|
||||
},
|
||||
cancel() {
|
||||
const 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(); this.model });
|
||||
}
|
||||
}
|
||||
}
|
||||
this.$store.dispatch('training/next', operate).then(({ valid }) => {
|
||||
if (valid) {
|
||||
this.doClose();
|
||||
}
|
||||
}).catch(() => { this.doClose(); this.model; });
|
||||
}
|
||||
}
|
||||
};
|
||||
</script>
|
||||
<style scoped>
|
||||
.fuzhou-01__systerm .el-dialog .base-label {
|
||||
@ -159,4 +169,4 @@
|
||||
padding: 0 5px;
|
||||
background-color: #F0F0F0;
|
||||
}
|
||||
</style>
|
||||
</style>
|
||||
|
@ -1,125 +1,135 @@
|
||||
<template>
|
||||
<el-dialog class="fuzhou-01__systerm user-delete" :title="title" :visible.sync="show" width="260px"
|
||||
:before-close="doClose" :zIndex="2000" :modal="false" :close-on-click-modal="false" append-to-body v-dialogDrag>
|
||||
<div style="padding-left: 10px; padding-bottom: 10px">
|
||||
<i class="el-icon-info"></i>
|
||||
<template v-for="message in messages">
|
||||
<span>{{message}}</span>
|
||||
</template>
|
||||
</div>
|
||||
<el-row justify="center" class="button-group">
|
||||
<el-col :span="8" :offset="3">
|
||||
<el-button :id="domIdConfirm" type="primary" :loading="loading" @click="commit">{{$t('menu.menuChildDialog.determine')}}</el-button>
|
||||
</el-col>
|
||||
<el-col :span="8" :offset="2">
|
||||
<el-button :id="domIdCancel" @click="cancel">{{$t('menu.menuChildDialog.cancel')}}</el-button>
|
||||
</el-col>
|
||||
</el-row>
|
||||
</el-dialog>
|
||||
<el-dialog
|
||||
v-dialogDrag
|
||||
class="fuzhou-01__systerm user-delete"
|
||||
:title="title"
|
||||
:visible.sync="show"
|
||||
width="260px"
|
||||
:before-close="doClose"
|
||||
:z-index="2000"
|
||||
:modal="false"
|
||||
:close-on-click-modal="false"
|
||||
append-to-body
|
||||
>
|
||||
<div style="padding-left: 10px; padding-bottom: 10px">
|
||||
<i class="el-icon-info" />
|
||||
<template v-for="(message,index) in messages">
|
||||
<span :key="index">{{ message }}</span>
|
||||
</template>
|
||||
</div>
|
||||
<el-row justify="center" class="button-group">
|
||||
<el-col :span="8" :offset="3">
|
||||
<el-button :id="domIdConfirm" type="primary" :loading="loading" @click="commit">{{ $t('menu.menuChildDialog.determine') }}</el-button>
|
||||
</el-col>
|
||||
<el-col :span="8" :offset="2">
|
||||
<el-button :id="domIdCancel" @click="cancel">{{ $t('menu.menuChildDialog.cancel') }}</el-button>
|
||||
</el-col>
|
||||
</el-row>
|
||||
</el-dialog>
|
||||
</template>
|
||||
<script>
|
||||
import { mapGetters } from 'vuex';
|
||||
import { MapDeviceType, OperationEvent } from '@/scripts/ConstDic';
|
||||
import { mapGetters } from 'vuex';
|
||||
import { OperationEvent } from '@/scripts/ConstDic';
|
||||
|
||||
export default {
|
||||
name: 'UserDelete',
|
||||
components: {
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
operate: {},
|
||||
messages: [],
|
||||
model: {
|
||||
type: 'DELETE',
|
||||
jobNumber: '',
|
||||
userName: '',
|
||||
},
|
||||
operation: null,
|
||||
dialogShow: false,
|
||||
loading: false,
|
||||
}
|
||||
},
|
||||
computed: {
|
||||
...mapGetters('map', [
|
||||
'stationStandList'
|
||||
]),
|
||||
show() {
|
||||
return this.dialogShow && !this.$store.state.menuOperation.break;
|
||||
},
|
||||
domIdCancel() {
|
||||
return this.dialogShow ? OperationEvent.Command.cancel.menu.domId : '';
|
||||
},
|
||||
domIdConfirm() {
|
||||
return this.dialogShow ? OperationEvent.Command.close.confirm.domId : '';
|
||||
},
|
||||
title() {
|
||||
return this.$t('menu.menuChildDialog.deleteUser');
|
||||
}
|
||||
},
|
||||
mounted() {
|
||||
this.$nextTick(() => {
|
||||
this.$store.dispatch('training/tipReload');
|
||||
})
|
||||
},
|
||||
methods: {
|
||||
doShow(operate, selected) {
|
||||
//非断电激活时设置初始值
|
||||
if (!this.dialogShow) {
|
||||
this.loading = false;
|
||||
this.operate = operate || {};
|
||||
this.operation = operate.operation;
|
||||
this.messages = operate.messages;
|
||||
this.model.userName = '';
|
||||
this.model.jobNumber = '';
|
||||
if (selected) {
|
||||
this.model.userName = selected.userName;
|
||||
this.model.jobNumber = selected.jobNumber;
|
||||
}
|
||||
}
|
||||
export default {
|
||||
name: 'UserDelete',
|
||||
components: {
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
operate: {},
|
||||
messages: [],
|
||||
model: {
|
||||
type: 'DELETE',
|
||||
jobNumber: '',
|
||||
userName: ''
|
||||
},
|
||||
operation: null,
|
||||
dialogShow: false,
|
||||
loading: false
|
||||
};
|
||||
},
|
||||
computed: {
|
||||
...mapGetters('map', [
|
||||
'stationStandList'
|
||||
]),
|
||||
show() {
|
||||
return this.dialogShow && !this.$store.state.menuOperation.break;
|
||||
},
|
||||
domIdCancel() {
|
||||
return this.dialogShow ? OperationEvent.Command.cancel.menu.domId : '';
|
||||
},
|
||||
domIdConfirm() {
|
||||
return this.dialogShow ? OperationEvent.Command.close.confirm.domId : '';
|
||||
},
|
||||
title() {
|
||||
return this.$t('menu.menuChildDialog.deleteUser');
|
||||
}
|
||||
},
|
||||
mounted() {
|
||||
this.$nextTick(() => {
|
||||
this.$store.dispatch('training/tipReload');
|
||||
});
|
||||
},
|
||||
methods: {
|
||||
doShow(operate, selected) {
|
||||
// 非断电激活时设置初始值
|
||||
if (!this.dialogShow) {
|
||||
this.loading = false;
|
||||
this.operate = operate || {};
|
||||
this.operation = operate.operation;
|
||||
this.messages = operate.messages;
|
||||
this.model.userName = '';
|
||||
this.model.jobNumber = '';
|
||||
if (selected) {
|
||||
this.model.userName = selected.userName;
|
||||
this.model.jobNumber = selected.jobNumber;
|
||||
}
|
||||
}
|
||||
|
||||
this.dialogShow = true;
|
||||
this.$nextTick(function () {
|
||||
this.$store.dispatch('training/emitTipFresh');
|
||||
});
|
||||
},
|
||||
doClose() {
|
||||
this.loading = false;
|
||||
this.dialogShow = false;
|
||||
this.$store.dispatch('training/emitTipFresh');
|
||||
},
|
||||
commit() {
|
||||
if (this.model.userName && this.model.jobNumber) {
|
||||
let operate = {
|
||||
type: this.operate.type,
|
||||
operation: OperationEvent.Command.close.confirm.operation,
|
||||
}
|
||||
this.dialogShow = true;
|
||||
this.$nextTick(function () {
|
||||
this.$store.dispatch('training/emitTipFresh');
|
||||
});
|
||||
},
|
||||
doClose() {
|
||||
this.loading = false;
|
||||
this.dialogShow = false;
|
||||
this.$store.dispatch('training/emitTipFresh');
|
||||
},
|
||||
commit() {
|
||||
if (this.model.userName && this.model.jobNumber) {
|
||||
const operate = {
|
||||
type: this.operate.type,
|
||||
operation: OperationEvent.Command.close.confirm.operation
|
||||
};
|
||||
|
||||
this.loading = true;
|
||||
this.$store.dispatch('training/next', operate).then(({ valid }) => {
|
||||
this.loading = false;
|
||||
if (valid) {
|
||||
this.doClose();
|
||||
this.$emit('operateUser', this.model);
|
||||
}
|
||||
})
|
||||
} else {
|
||||
this.$messageBox(this.$t('menu.menuChildDialog.selectTips'));
|
||||
}
|
||||
},
|
||||
cancel() {
|
||||
let operate = {
|
||||
type: this.operate.type,
|
||||
operation: OperationEvent.Command.cancel.menu.operation,
|
||||
}
|
||||
this.loading = true;
|
||||
this.$store.dispatch('training/next', operate).then(({ valid }) => {
|
||||
this.loading = false;
|
||||
if (valid) {
|
||||
this.doClose();
|
||||
this.$emit('operateUser', this.model);
|
||||
}
|
||||
});
|
||||
} else {
|
||||
this.$messageBox(this.$t('menu.menuChildDialog.selectTips'));
|
||||
}
|
||||
},
|
||||
cancel() {
|
||||
const 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(); });
|
||||
}
|
||||
}
|
||||
}
|
||||
this.$store.dispatch('training/next', operate).then(({ valid }) => {
|
||||
if (valid) {
|
||||
this.doClose();
|
||||
}
|
||||
}).catch(() => { this.doClose(); });
|
||||
}
|
||||
}
|
||||
};
|
||||
</script>
|
||||
<style scoped>
|
||||
.fuzhou-01__systerm .el-dialog .base-label {
|
||||
@ -130,4 +140,4 @@
|
||||
padding: 0 5px;
|
||||
background-color: #F0F0F0;
|
||||
}
|
||||
</style>
|
||||
</style>
|
||||
|
@ -1,170 +1,181 @@
|
||||
<template>
|
||||
<el-dialog class="fuzhou-01__systerm user-edit" :title="title" :visible.sync="show" width="420px"
|
||||
:before-close="doClose" :zIndex="2000" :modal="false" :close-on-click-modal="false" append-to-body v-dialogDrag>
|
||||
<div style="padding: 15px 40px; border: 1px double lightgray; margin: 20px 10px; ">
|
||||
<el-form size="small" label-width="90px" :model="model" label-position="left" :rules="rules" ref="form">
|
||||
<el-form-item :label="$t('menu.menuChildDialog.jobNumber')" prop="jobNumber">
|
||||
<el-input v-model="model.jobNumber" disabled></el-input>
|
||||
</el-form-item>
|
||||
<el-form-item :label="$t('menu.menuChildDialog.userName')" prop="userName">
|
||||
<el-input v-model="model.userName" disabled></el-input>
|
||||
</el-form-item>
|
||||
<el-form-item :label="$t('menu.menuChildDialog.originalPassword')" prop="oldPassword">
|
||||
<el-input type="oldPassword" v-model="model.oldPassword"></el-input>
|
||||
</el-form-item>
|
||||
<el-form-item :label="$t('menu.menuChildDialog.password')" prop="password">
|
||||
<el-input type="password" v-model="model.password"></el-input>
|
||||
</el-form-item>
|
||||
<el-form-item :label="$t('menu.menuChildDialog.confirmPassword')" prop="confirm">
|
||||
<el-input type="password" v-model="model.confirm"></el-input>
|
||||
</el-form-item>
|
||||
<el-dialog
|
||||
v-dialogDrag
|
||||
class="fuzhou-01__systerm user-edit"
|
||||
:title="title"
|
||||
:visible.sync="show"
|
||||
width="420px"
|
||||
:before-close="doClose"
|
||||
:z-index="2000"
|
||||
:modal="false"
|
||||
:close-on-click-modal="false"
|
||||
append-to-body
|
||||
>
|
||||
<div style="padding: 15px 40px; border: 1px double lightgray; margin: 20px 10px; ">
|
||||
<el-form ref="form" size="small" label-width="90px" :model="model" label-position="left" :rules="rules">
|
||||
<el-form-item :label="$t('menu.menuChildDialog.jobNumber')" prop="jobNumber">
|
||||
<el-input v-model="model.jobNumber" disabled />
|
||||
</el-form-item>
|
||||
<el-form-item :label="$t('menu.menuChildDialog.userName')" prop="userName">
|
||||
<el-input v-model="model.userName" disabled />
|
||||
</el-form-item>
|
||||
<el-form-item :label="$t('menu.menuChildDialog.originalPassword')" prop="oldPassword">
|
||||
<el-input v-model="model.oldPassword" type="oldPassword" />
|
||||
</el-form-item>
|
||||
<el-form-item :label="$t('menu.menuChildDialog.password')" prop="password">
|
||||
<el-input v-model="model.password" type="password" />
|
||||
</el-form-item>
|
||||
<el-form-item :label="$t('menu.menuChildDialog.confirmPassword')" prop="confirm">
|
||||
<el-input v-model="model.confirm" type="password" />
|
||||
</el-form-item>
|
||||
|
||||
</el-form>
|
||||
</div>
|
||||
<el-row justify="center" class="button-group">
|
||||
<el-col :span="8" :offset="6">
|
||||
<el-button :id="domIdConfirm" type="primary" :loading="loading" @click="commit">{{$t('menu.menuChildDialog.determine')}}</el-button>
|
||||
</el-col>
|
||||
<el-col :span="8" :offset="0">
|
||||
<el-button :id="domIdCancel" @click="cancel">{{$t('menu.menuChildDialog.cancel')}}</el-button>
|
||||
</el-col>
|
||||
</el-row>
|
||||
</el-dialog>
|
||||
</el-form>
|
||||
</div>
|
||||
<el-row justify="center" class="button-group">
|
||||
<el-col :span="8" :offset="6">
|
||||
<el-button :id="domIdConfirm" type="primary" :loading="loading" @click="commit">{{ $t('menu.menuChildDialog.determine') }}</el-button>
|
||||
</el-col>
|
||||
<el-col :span="8" :offset="0">
|
||||
<el-button :id="domIdCancel" @click="cancel">{{ $t('menu.menuChildDialog.cancel') }}</el-button>
|
||||
</el-col>
|
||||
</el-row>
|
||||
</el-dialog>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import { mapGetters } from 'vuex';
|
||||
import { MapDeviceType, OperationEvent } from '@/scripts/ConstDic';
|
||||
import { mapGetters } from 'vuex';
|
||||
import { OperationEvent } from '@/scripts/ConstDic';
|
||||
|
||||
export default {
|
||||
name: 'UserEdit',
|
||||
components: {
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
operate: {},
|
||||
selected: {},
|
||||
operation: null,
|
||||
dialogShow: false,
|
||||
loading: false,
|
||||
model: {
|
||||
type: 'EDIT',
|
||||
jobNumber: '',
|
||||
userName: '',
|
||||
oldPassword: '',
|
||||
password: '',
|
||||
confirm: '',
|
||||
},
|
||||
rules: {
|
||||
jobNumber: [
|
||||
{ required: true, message: this.$t('menu.menuChildDialog.inputJobNumber'), trigger: 'blur' }
|
||||
],
|
||||
userName: [
|
||||
{ required: true, message: this.$t('menu.menuChildDialog.inputUserName'), trigger: 'blur' }
|
||||
],
|
||||
oldPassword: [
|
||||
{ required: true, message: this.$t('menu.menuChildDialog.inputOriginal'), trigger: 'change' }
|
||||
],
|
||||
password: [
|
||||
{ required: true, message: this.$t('menu.menuChildDialog.inputNewPassword'), trigger: 'change' }
|
||||
],
|
||||
confirm: [
|
||||
{ required: true, message: this.$t('menu.menuChildDialog.inputNewAgain'), trigger: 'change' }
|
||||
],
|
||||
},
|
||||
}
|
||||
},
|
||||
computed: {
|
||||
...mapGetters('map', [
|
||||
'stationStandList'
|
||||
]),
|
||||
show() {
|
||||
return this.dialogShow && !this.$store.state.menuOperation.break;
|
||||
},
|
||||
domIdCancel() {
|
||||
return this.dialogShow ? OperationEvent.Command.cancel.menu.domId : '';
|
||||
},
|
||||
domIdConfirm() {
|
||||
return this.dialogShow ? OperationEvent.Command.close.confirm.domId : '';
|
||||
},
|
||||
title() {
|
||||
return this.$t('menu.menuChildDialog.userEditPage')
|
||||
}
|
||||
},
|
||||
mounted() {
|
||||
this.$nextTick(() => {
|
||||
this.$store.dispatch('training/tipReload');
|
||||
})
|
||||
},
|
||||
methods: {
|
||||
doShow(operate, selected) {
|
||||
//非断电激活时设置初始值
|
||||
if (!this.dialogShow) {
|
||||
this.loading = false;
|
||||
this.operate = operate || {};
|
||||
this.operation = operate.operation;
|
||||
this.$nextTick(() => {
|
||||
this.$refs.form.resetFields();
|
||||
this.selected = selected;
|
||||
if (selected) {
|
||||
this.model.jobNumber = selected.jobNumber;
|
||||
this.model.userName = selected.userName;
|
||||
}
|
||||
});
|
||||
}
|
||||
export default {
|
||||
name: 'UserEdit',
|
||||
components: {
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
operate: {},
|
||||
selected: {},
|
||||
operation: null,
|
||||
dialogShow: false,
|
||||
loading: false,
|
||||
model: {
|
||||
type: 'EDIT',
|
||||
jobNumber: '',
|
||||
userName: '',
|
||||
oldPassword: '',
|
||||
password: '',
|
||||
confirm: ''
|
||||
},
|
||||
rules: {
|
||||
jobNumber: [
|
||||
{ required: true, message: this.$t('menu.menuChildDialog.inputJobNumber'), trigger: 'blur' }
|
||||
],
|
||||
userName: [
|
||||
{ required: true, message: this.$t('menu.menuChildDialog.inputUserName'), trigger: 'blur' }
|
||||
],
|
||||
oldPassword: [
|
||||
{ required: true, message: this.$t('menu.menuChildDialog.inputOriginal'), trigger: 'change' }
|
||||
],
|
||||
password: [
|
||||
{ required: true, message: this.$t('menu.menuChildDialog.inputNewPassword'), trigger: 'change' }
|
||||
],
|
||||
confirm: [
|
||||
{ required: true, message: this.$t('menu.menuChildDialog.inputNewAgain'), trigger: 'change' }
|
||||
]
|
||||
}
|
||||
};
|
||||
},
|
||||
computed: {
|
||||
...mapGetters('map', [
|
||||
'stationStandList'
|
||||
]),
|
||||
show() {
|
||||
return this.dialogShow && !this.$store.state.menuOperation.break;
|
||||
},
|
||||
domIdCancel() {
|
||||
return this.dialogShow ? OperationEvent.Command.cancel.menu.domId : '';
|
||||
},
|
||||
domIdConfirm() {
|
||||
return this.dialogShow ? OperationEvent.Command.close.confirm.domId : '';
|
||||
},
|
||||
title() {
|
||||
return this.$t('menu.menuChildDialog.userEditPage');
|
||||
}
|
||||
},
|
||||
mounted() {
|
||||
this.$nextTick(() => {
|
||||
this.$store.dispatch('training/tipReload');
|
||||
});
|
||||
},
|
||||
methods: {
|
||||
doShow(operate, selected) {
|
||||
// 非断电激活时设置初始值
|
||||
if (!this.dialogShow) {
|
||||
this.loading = false;
|
||||
this.operate = operate || {};
|
||||
this.operation = operate.operation;
|
||||
this.$nextTick(() => {
|
||||
this.$refs.form.resetFields();
|
||||
this.selected = selected;
|
||||
if (selected) {
|
||||
this.model.jobNumber = selected.jobNumber;
|
||||
this.model.userName = selected.userName;
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
this.dialogShow = true;
|
||||
this.$nextTick(function () {
|
||||
this.$store.dispatch('training/emitTipFresh');
|
||||
});
|
||||
},
|
||||
doClose() {
|
||||
this.loading = false;
|
||||
this.dialogShow = false;
|
||||
this.$store.dispatch('training/emitTipFresh');
|
||||
},
|
||||
commit() {
|
||||
this.$refs['form'].validate((valid) => {
|
||||
if (valid) {
|
||||
let operate = {
|
||||
type: this.operate.type,
|
||||
operation: OperationEvent.Command.close.confirm.operation,
|
||||
}
|
||||
this.dialogShow = true;
|
||||
this.$nextTick(function () {
|
||||
this.$store.dispatch('training/emitTipFresh');
|
||||
});
|
||||
},
|
||||
doClose() {
|
||||
this.loading = false;
|
||||
this.dialogShow = false;
|
||||
this.$store.dispatch('training/emitTipFresh');
|
||||
},
|
||||
commit() {
|
||||
this.$refs['form'].validate((valid) => {
|
||||
if (valid) {
|
||||
const operate = {
|
||||
type: this.operate.type,
|
||||
operation: OperationEvent.Command.close.confirm.operation
|
||||
};
|
||||
|
||||
this.loading = true;
|
||||
this.$store.dispatch('training/next', operate).then(({ valid }) => {
|
||||
this.loading = false;
|
||||
if (valid)
|
||||
if (this.selected.password !== this.model.oldPassword) {
|
||||
this.$messageBox(this.$t('menu.menuChildDialog.originalPasswordError'));
|
||||
} else if (this.model.password !== this.model.confirm) {
|
||||
this.$messageBox(this.$t('menu.menuChildDialog.passwordError'));
|
||||
} else if (this.model.oldPassword === this.model.password) {
|
||||
this.$messageBox(this.$t('menu.menuChildDialog.passwordSame'));
|
||||
} else {
|
||||
this.doClose();
|
||||
this.$emit('operateUser', this.model);
|
||||
}
|
||||
})
|
||||
} else {
|
||||
return false;
|
||||
}
|
||||
});
|
||||
},
|
||||
cancel() {
|
||||
let operate = {
|
||||
type: this.operate.type,
|
||||
operation: OperationEvent.Command.cancel.menu.operation,
|
||||
}
|
||||
this.loading = true;
|
||||
this.$store.dispatch('training/next', operate).then(({ valid }) => {
|
||||
this.loading = false;
|
||||
if (valid) {
|
||||
if (this.selected.password !== this.model.oldPassword) {
|
||||
this.$messageBox(this.$t('menu.menuChildDialog.originalPasswordError'));
|
||||
} else if (this.model.password !== this.model.confirm) {
|
||||
this.$messageBox(this.$t('menu.menuChildDialog.passwordError'));
|
||||
} else if (this.model.oldPassword === this.model.password) {
|
||||
this.$messageBox(this.$t('menu.menuChildDialog.passwordSame'));
|
||||
} else {
|
||||
this.doClose();
|
||||
this.$emit('operateUser', this.model);
|
||||
}
|
||||
}
|
||||
});
|
||||
} else {
|
||||
return false;
|
||||
}
|
||||
});
|
||||
},
|
||||
cancel() {
|
||||
const 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(); });
|
||||
}
|
||||
}
|
||||
}
|
||||
this.$store.dispatch('training/next', operate).then(({ valid }) => {
|
||||
if (valid) {
|
||||
this.doClose();
|
||||
}
|
||||
}).catch(() => { this.doClose(); });
|
||||
}
|
||||
}
|
||||
};
|
||||
</script>
|
||||
<style scoped>
|
||||
.fuzhou-01__systerm .el-dialog .base-label {
|
||||
@ -175,4 +186,4 @@
|
||||
padding: 0 5px;
|
||||
background-color: #F0F0F0;
|
||||
}
|
||||
</style>
|
||||
</style>
|
||||
|
@ -1,122 +1,132 @@
|
||||
<template>
|
||||
<el-dialog class="fuzhou-01__systerm manage-user" :title="title" :visible.sync="show" width="600px"
|
||||
:before-close="doClose" :zIndex="2000" :modal="false" :close-on-click-modal="false" v-dialogDrag>
|
||||
<div style="height: 70px;">
|
||||
<div style="position: relative; left: 10px;">
|
||||
</div>
|
||||
<div style="position: relative; left: 80px;">
|
||||
<div style="width:100%">
|
||||
<span style="padding-left: 60px">{{$t('menu.menuDialog.versionName')}}</span>
|
||||
<el-button style="position: absolute; right: 95px;" :id="domIdConfirm" type="primary"
|
||||
:loading="loading" @click="commit">{{$t('menu.menuDialog.confirm')}}</el-button>
|
||||
</div>
|
||||
<div style="width:100%; padding-top: 20px">
|
||||
<span> {{$t('menu.menuDialog.copyright')}}</span>
|
||||
</div>
|
||||
</div>
|
||||
<el-dialog
|
||||
v-dialogDrag
|
||||
class="fuzhou-01__systerm manage-user"
|
||||
:title="title"
|
||||
:visible.sync="show"
|
||||
width="600px"
|
||||
:before-close="doClose"
|
||||
:z-index="2000"
|
||||
:modal="false"
|
||||
:close-on-click-modal="false"
|
||||
>
|
||||
<div style="height: 70px;">
|
||||
<div style="position: relative; left: 10px;" />
|
||||
<div style="position: relative; left: 80px;">
|
||||
<div style="width:100%">
|
||||
<span style="padding-left: 60px">{{ $t('menu.menuDialog.versionName') }}</span>
|
||||
<el-button
|
||||
:id="domIdConfirm"
|
||||
style="position: absolute; right: 95px;"
|
||||
type="primary"
|
||||
:loading="loading"
|
||||
@click="commit"
|
||||
>{{ $t('menu.menuDialog.confirm') }}</el-button>
|
||||
</div>
|
||||
<div style="padding: 10px; margin: 5px; ">
|
||||
<el-table :data="tableData" style="width: 100%;" height="400">
|
||||
<el-table-column prop="moduleName" :label="$t('menu.menuDialog.moduleName')" width="180">
|
||||
</el-table-column>
|
||||
<el-table-column prop="version" :label="$t('menu.menuDialog.version')" width="180">
|
||||
</el-table-column>
|
||||
<el-table-column prop="updateDate" :label="$t('menu.menuDialog.modifyDate')">
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
<div style="width:100%; padding-top: 20px">
|
||||
<span> {{ $t('menu.menuDialog.copyright') }}</span>
|
||||
</div>
|
||||
</el-dialog>
|
||||
</div>
|
||||
</div>
|
||||
<div style="padding: 10px; margin: 5px; ">
|
||||
<el-table :data="tableData" style="width: 100%;" height="400">
|
||||
<el-table-column prop="moduleName" :label="$t('menu.menuDialog.moduleName')" width="180" />
|
||||
<el-table-column prop="version" :label="$t('menu.menuDialog.version')" width="180" />
|
||||
<el-table-column prop="updateDate" :label="$t('menu.menuDialog.modifyDate')" />
|
||||
</el-table>
|
||||
</div>
|
||||
</el-dialog>
|
||||
</template>
|
||||
<script>
|
||||
import { MapDeviceType, OperationEvent } from '@/scripts/ConstDic';
|
||||
import { OperationEvent } from '@/scripts/ConstDic';
|
||||
|
||||
export default {
|
||||
name: 'ManageUser',
|
||||
data() {
|
||||
return {
|
||||
tableData: [
|
||||
{
|
||||
moduleName: this.$t('menu.menuDialog.mainProgramVersion'),
|
||||
version: '123',
|
||||
updateDate: '123'
|
||||
}
|
||||
],
|
||||
operate: {},
|
||||
operation: null,
|
||||
dialogShow: false,
|
||||
loading: false,
|
||||
selected: null,
|
||||
}
|
||||
},
|
||||
computed: {
|
||||
show() {
|
||||
return this.dialogShow && !this.$store.state.menuOperation.break;
|
||||
},
|
||||
domIdCancel() {
|
||||
return this.dialogShow ? OperationEvent.Command.cancel.menu.domId : '';
|
||||
},
|
||||
domIdConfirm() {
|
||||
return this.dialogShow ? OperationEvent.Command.close.menu.domId : '';
|
||||
},
|
||||
title() {
|
||||
return this.$t('menu.menuDialog.about')
|
||||
}
|
||||
},
|
||||
mounted() {
|
||||
this.$nextTick(() => {
|
||||
this.$store.dispatch('training/tipReload');
|
||||
})
|
||||
},
|
||||
methods: {
|
||||
doShow(operate) {
|
||||
//非断电激活时设置初始值
|
||||
if (!this.dialogShow) {
|
||||
this.loading = false;
|
||||
this.operate = operate || {};
|
||||
this.operation = operate.operation;
|
||||
}
|
||||
export default {
|
||||
name: 'ManageUser',
|
||||
data() {
|
||||
return {
|
||||
tableData: [
|
||||
{
|
||||
moduleName: this.$t('menu.menuDialog.mainProgramVersion'),
|
||||
version: '123',
|
||||
updateDate: '123'
|
||||
}
|
||||
],
|
||||
operate: {},
|
||||
operation: null,
|
||||
dialogShow: false,
|
||||
loading: false,
|
||||
selected: null
|
||||
};
|
||||
},
|
||||
computed: {
|
||||
show() {
|
||||
return this.dialogShow && !this.$store.state.menuOperation.break;
|
||||
},
|
||||
domIdCancel() {
|
||||
return this.dialogShow ? OperationEvent.Command.cancel.menu.domId : '';
|
||||
},
|
||||
domIdConfirm() {
|
||||
return this.dialogShow ? OperationEvent.Command.close.menu.domId : '';
|
||||
},
|
||||
title() {
|
||||
return this.$t('menu.menuDialog.about');
|
||||
}
|
||||
},
|
||||
mounted() {
|
||||
this.$nextTick(() => {
|
||||
this.$store.dispatch('training/tipReload');
|
||||
});
|
||||
},
|
||||
methods: {
|
||||
doShow(operate) {
|
||||
// 非断电激活时设置初始值
|
||||
if (!this.dialogShow) {
|
||||
this.loading = false;
|
||||
this.operate = operate || {};
|
||||
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('training/emitTipFresh');
|
||||
},
|
||||
commit() {
|
||||
let operate = {
|
||||
type: this.operate.type,
|
||||
operation: OperationEvent.Command.close.menu.operation,
|
||||
}
|
||||
this.dialogShow = true;
|
||||
this.$nextTick(function () {
|
||||
this.$store.dispatch('training/emitTipFresh');
|
||||
});
|
||||
},
|
||||
doClose() {
|
||||
this.loading = false;
|
||||
this.dialogShow = false;
|
||||
this.$store.dispatch('training/emitTipFresh');
|
||||
},
|
||||
commit() {
|
||||
const operate = {
|
||||
type: this.operate.type,
|
||||
operation: OperationEvent.Command.close.menu.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();
|
||||
})
|
||||
},
|
||||
cancel() {
|
||||
let operate = {
|
||||
type: this.operate.type,
|
||||
operation: OperationEvent.Command.cancel.menu.operation,
|
||||
}
|
||||
this.loading = true;
|
||||
this.$store.dispatch('training/next', operate).then(({ valid }) => {
|
||||
this.loading = false;
|
||||
if (valid) {
|
||||
this.doClose();
|
||||
}
|
||||
}).catch(() => {
|
||||
this.loading = false;
|
||||
this.doClose();
|
||||
});
|
||||
},
|
||||
cancel() {
|
||||
const 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(); });
|
||||
}
|
||||
}
|
||||
}
|
||||
this.$store.dispatch('training/next', operate).then(({ valid }) => {
|
||||
if (valid) {
|
||||
this.doClose();
|
||||
}
|
||||
}).catch(() => { this.doClose(); });
|
||||
}
|
||||
}
|
||||
};
|
||||
</script>
|
||||
<style scoped>
|
||||
.fuzhou-01__systerm .el-dialog .base-label {
|
||||
@ -127,4 +137,4 @@
|
||||
padding: 0 5px;
|
||||
background-color: #F0F0F0;
|
||||
}
|
||||
</style>
|
||||
</style>
|
||||
|
@ -1,282 +1,300 @@
|
||||
<template>
|
||||
<el-dialog class="fuzhou-01__systerm manage-user" :title="title" :visible.sync="show" width="420px"
|
||||
:before-close="doClose" :zIndex="2000" :modal="false" :close-on-click-modal="false" v-dialogDrag>
|
||||
<div style="padding: 5px 5px; border: 1px double lightgray; margin: 20px 0px; ">
|
||||
<span class="base-label">{{$t('menu.menuDialog.userList')}}</span>
|
||||
<el-row>
|
||||
<el-col :span="18">
|
||||
<el-table ref="multipleTable" :data="tableData" border row-key="code" style="width: 100%"
|
||||
height="450" center size="mini" highlight-current-row @row-click="chooseUser">
|
||||
<el-table-column prop="jobNumber" :label="$t('menu.menuDialog.jobNumber')" width="120">
|
||||
<template slot-scope="scope">
|
||||
<span>{{scope.row.jobNumber}}</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="userName" :label="$t('menu.menuDialog.userName')">
|
||||
<template slot-scope="scope">
|
||||
<span>{{scope.row.userName}}</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column width="20">
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
</el-col>
|
||||
<el-col :span="4">
|
||||
<el-button style="margin-top: 140px; margin-left: 10px;" :id="domIdFreshUser" @click="freshUser">{{$t('menu.menuDialog.refresh')}}
|
||||
</el-button>
|
||||
<el-button style="margin-top: 30px; margin-left: 10px;" :id="domIdAddUser" @click="addUser">{{$t('menu.menuDialog.add')}}
|
||||
</el-button>
|
||||
<el-button style="margin-top: 30px; margin-left: 10px;" :id="domIdEditUser" @click="editUser">{{$t('menu.menuDialog.modify')}}
|
||||
</el-button>
|
||||
<el-button style="margin-top: 30px; margin-left: 10px;" :id="domIdDelUser" @click="delUser">{{$t('menu.menuDialog.delete')}}
|
||||
</el-button>
|
||||
</el-col>
|
||||
</el-row>
|
||||
</div>
|
||||
<el-row justify="center" class="button-group">
|
||||
<el-col :span="8" :offset="6">
|
||||
<el-button :id="domIdConfirm" type="primary" :loading="loading" @click="commit">{{$t('menu.menuDialog.confirm')}}</el-button>
|
||||
</el-col>
|
||||
<el-col :span="8" :offset="0">
|
||||
<el-button :id="domIdCancel" @click="cancel">{{$t('menu.menuDialog.cancel')}}</el-button>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<user-add ref="userAdd" @operateUser="operateUser"></user-add>
|
||||
<user-edit ref="userEdit" @operateUser="operateUser"></user-edit>
|
||||
<user-delete ref="userDelete" @operateUser="operateUser"></user-delete>
|
||||
</el-dialog>
|
||||
<el-dialog
|
||||
v-dialogDrag
|
||||
class="fuzhou-01__systerm manage-user"
|
||||
:title="title"
|
||||
:visible.sync="show"
|
||||
width="420px"
|
||||
:before-close="doClose"
|
||||
:z-index="2000"
|
||||
:modal="false"
|
||||
:close-on-click-modal="false"
|
||||
>
|
||||
<div style="padding: 5px 5px; border: 1px double lightgray; margin: 20px 0px; ">
|
||||
<span class="base-label">{{ $t('menu.menuDialog.userList') }}</span>
|
||||
<el-row>
|
||||
<el-col :span="18">
|
||||
<el-table
|
||||
ref="multipleTable"
|
||||
:data="tableData"
|
||||
border
|
||||
row-key="code"
|
||||
style="width: 100%"
|
||||
height="450"
|
||||
center
|
||||
size="mini"
|
||||
highlight-current-row
|
||||
@row-click="chooseUser"
|
||||
>
|
||||
<el-table-column prop="jobNumber" :label="$t('menu.menuDialog.jobNumber')" width="120">
|
||||
<template slot-scope="scope">
|
||||
<span>{{ scope.row.jobNumber }}</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="userName" :label="$t('menu.menuDialog.userName')">
|
||||
<template slot-scope="scope">
|
||||
<span>{{ scope.row.userName }}</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column width="20" />
|
||||
</el-table>
|
||||
</el-col>
|
||||
<el-col :span="4">
|
||||
<el-button :id="domIdFreshUser" style="margin-top: 140px; margin-left: 10px;" @click="freshUser">{{ $t('menu.menuDialog.refresh') }}
|
||||
</el-button>
|
||||
<el-button :id="domIdAddUser" style="margin-top: 30px; margin-left: 10px;" @click="addUser">{{ $t('menu.menuDialog.add') }}
|
||||
</el-button>
|
||||
<el-button :id="domIdEditUser" style="margin-top: 30px; margin-left: 10px;" @click="editUser">{{ $t('menu.menuDialog.modify') }}
|
||||
</el-button>
|
||||
<el-button :id="domIdDelUser" style="margin-top: 30px; margin-left: 10px;" @click="delUser">{{ $t('menu.menuDialog.delete') }}
|
||||
</el-button>
|
||||
</el-col>
|
||||
</el-row>
|
||||
</div>
|
||||
<el-row justify="center" class="button-group">
|
||||
<el-col :span="8" :offset="6">
|
||||
<el-button :id="domIdConfirm" type="primary" :loading="loading" @click="commit">{{ $t('menu.menuDialog.confirm') }}</el-button>
|
||||
</el-col>
|
||||
<el-col :span="8" :offset="0">
|
||||
<el-button :id="domIdCancel" @click="cancel">{{ $t('menu.menuDialog.cancel') }}</el-button>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<user-add ref="userAdd" @operateUser="operateUser" />
|
||||
<user-edit ref="userEdit" @operateUser="operateUser" />
|
||||
<user-delete ref="userDelete" @operateUser="operateUser" />
|
||||
</el-dialog>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import { mapGetters } from 'vuex';
|
||||
import UserAdd from './childDialog/userAdd';
|
||||
import UserEdit from './childDialog/userEdit';
|
||||
import UserDelete from './childDialog/userDelete';
|
||||
import { MapDeviceType, OperationEvent } from '@/scripts/ConstDic';
|
||||
import { mapGetters } from 'vuex';
|
||||
import UserAdd from './childDialog/userAdd';
|
||||
import UserEdit from './childDialog/userEdit';
|
||||
import UserDelete from './childDialog/userDelete';
|
||||
import { OperationEvent } from '@/scripts/ConstDic';
|
||||
|
||||
export default {
|
||||
name: 'ManageUser',
|
||||
components: {
|
||||
UserAdd,
|
||||
UserEdit,
|
||||
UserDelete
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
tableData: [],
|
||||
operate: {},
|
||||
operation: null,
|
||||
dialogShow: false,
|
||||
loading: false,
|
||||
selected: null,
|
||||
}
|
||||
},
|
||||
computed: {
|
||||
...mapGetters('map', [
|
||||
'stationStandList'
|
||||
]),
|
||||
show() {
|
||||
return this.dialogShow && !this.$store.state.menuOperation.break;
|
||||
},
|
||||
domIdAddUser() {
|
||||
return this.dialogShow ? OperationEvent.Command.manage.addUser.domId : '';
|
||||
},
|
||||
domIdEditUser() {
|
||||
return this.dialogShow ? OperationEvent.Command.manage.editUser.domId : '';
|
||||
},
|
||||
domIdDelUser() {
|
||||
return this.dialogShow ? OperationEvent.Command.manage.delUser.domId : '';
|
||||
},
|
||||
domIdFreshUser() {
|
||||
return this.dialogShow ? OperationEvent.Command.manage.freshUser.domId : '';
|
||||
},
|
||||
domIdChooseUser() {
|
||||
return this.dialogShow ? OperationEvent.Command.manage.chooseUser.domId : '';
|
||||
},
|
||||
domIdCancel() {
|
||||
return this.dialogShow ? OperationEvent.Command.cancel.menu.domId : '';
|
||||
},
|
||||
domIdConfirm() {
|
||||
return this.dialogShow ? OperationEvent.Command.close.menu.domId : '';
|
||||
},
|
||||
title() {
|
||||
return this.$t('menu.menuDialog.userManage')
|
||||
}
|
||||
},
|
||||
mounted() {
|
||||
this.$nextTick(() => {
|
||||
this.$store.dispatch('training/tipReload');
|
||||
})
|
||||
},
|
||||
methods: {
|
||||
doShow(operate) {
|
||||
//非断电激活时设置初始值
|
||||
if (!this.dialogShow) {
|
||||
this.loading = false;
|
||||
this.operate = operate || {};
|
||||
this.operation = operate.operation;
|
||||
}
|
||||
export default {
|
||||
name: 'ManageUser',
|
||||
components: {
|
||||
UserAdd,
|
||||
UserEdit,
|
||||
UserDelete
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
tableData: [],
|
||||
operate: {},
|
||||
operation: null,
|
||||
dialogShow: false,
|
||||
loading: false,
|
||||
selected: null
|
||||
};
|
||||
},
|
||||
computed: {
|
||||
...mapGetters('map', [
|
||||
'stationStandList'
|
||||
]),
|
||||
show() {
|
||||
return this.dialogShow && !this.$store.state.menuOperation.break;
|
||||
},
|
||||
domIdAddUser() {
|
||||
return this.dialogShow ? OperationEvent.Command.manage.addUser.domId : '';
|
||||
},
|
||||
domIdEditUser() {
|
||||
return this.dialogShow ? OperationEvent.Command.manage.editUser.domId : '';
|
||||
},
|
||||
domIdDelUser() {
|
||||
return this.dialogShow ? OperationEvent.Command.manage.delUser.domId : '';
|
||||
},
|
||||
domIdFreshUser() {
|
||||
return this.dialogShow ? OperationEvent.Command.manage.freshUser.domId : '';
|
||||
},
|
||||
domIdChooseUser() {
|
||||
return this.dialogShow ? OperationEvent.Command.manage.chooseUser.domId : '';
|
||||
},
|
||||
domIdCancel() {
|
||||
return this.dialogShow ? OperationEvent.Command.cancel.menu.domId : '';
|
||||
},
|
||||
domIdConfirm() {
|
||||
return this.dialogShow ? OperationEvent.Command.close.menu.domId : '';
|
||||
},
|
||||
title() {
|
||||
return this.$t('menu.menuDialog.userManage');
|
||||
}
|
||||
},
|
||||
mounted() {
|
||||
this.$nextTick(() => {
|
||||
this.$store.dispatch('training/tipReload');
|
||||
});
|
||||
},
|
||||
methods: {
|
||||
doShow(operate) {
|
||||
// 非断电激活时设置初始值
|
||||
if (!this.dialogShow) {
|
||||
this.loading = false;
|
||||
this.operate = operate || {};
|
||||
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('training/emitTipFresh');
|
||||
},
|
||||
//添加用户
|
||||
addUser() {
|
||||
let operate = {
|
||||
type: this.operate.type,
|
||||
operation: OperationEvent.Command.manage.addUser.operation,
|
||||
}
|
||||
this.dialogShow = true;
|
||||
this.$nextTick(function () {
|
||||
this.$store.dispatch('training/emitTipFresh');
|
||||
});
|
||||
},
|
||||
doClose() {
|
||||
this.loading = false;
|
||||
this.dialogShow = false;
|
||||
this.$store.dispatch('training/emitTipFresh');
|
||||
},
|
||||
// 添加用户
|
||||
addUser() {
|
||||
const operate = {
|
||||
type: this.operate.type,
|
||||
operation: OperationEvent.Command.manage.addUser.operation
|
||||
};
|
||||
|
||||
this.loading = true;
|
||||
this.$store.dispatch('training/next', operate).then(({ valid }) => {
|
||||
this.loading = false;
|
||||
if (valid) {
|
||||
this.$refs.userAdd.doShow(operate);
|
||||
}
|
||||
}).catch(error => {
|
||||
this.loading = false;
|
||||
})
|
||||
},
|
||||
//编辑用户
|
||||
editUser() {
|
||||
if (this.selected) {
|
||||
let operate = {
|
||||
type: this.operate.type,
|
||||
operation: OperationEvent.Command.manage.editUser.operation,
|
||||
}
|
||||
this.loading = true;
|
||||
this.$store.dispatch('training/next', operate).then(({ valid }) => {
|
||||
this.loading = false;
|
||||
if (valid) {
|
||||
this.$refs.userAdd.doShow(operate);
|
||||
}
|
||||
}).catch(() => {
|
||||
this.loading = false;
|
||||
});
|
||||
},
|
||||
// 编辑用户
|
||||
editUser() {
|
||||
if (this.selected) {
|
||||
const operate = {
|
||||
type: this.operate.type,
|
||||
operation: OperationEvent.Command.manage.editUser.operation
|
||||
};
|
||||
|
||||
this.loading = true;
|
||||
this.$store.dispatch('training/next', operate).then(({ valid }) => {
|
||||
this.loading = false;
|
||||
if (valid) {
|
||||
this.$refs.userEdit.doShow(operate, this.selected);
|
||||
}
|
||||
}).catch(error => {
|
||||
this.loading = false;
|
||||
})
|
||||
} else {
|
||||
this.$messageBox(this.$t('menu.menuDialog.selectUser'));
|
||||
}
|
||||
},
|
||||
//删除用户
|
||||
delUser() {
|
||||
if (this.selected) {
|
||||
let operate = {
|
||||
type: this.operate.type,
|
||||
operation: OperationEvent.Command.manage.delUser.operation,
|
||||
messages: [`${this.$t('menu.menuDialog.deleteMessageOne')} ${this.selected.userName} ${this.$t('menu.menuDialog.deleteMessageTwo')}`]
|
||||
}
|
||||
this.loading = true;
|
||||
this.$store.dispatch('training/next', operate).then(({ valid }) => {
|
||||
this.loading = false;
|
||||
if (valid) {
|
||||
this.$refs.userEdit.doShow(operate, this.selected);
|
||||
}
|
||||
}).catch(() => {
|
||||
this.loading = false;
|
||||
});
|
||||
} else {
|
||||
this.$messageBox(this.$t('menu.menuDialog.selectUser'));
|
||||
}
|
||||
},
|
||||
// 删除用户
|
||||
delUser() {
|
||||
if (this.selected) {
|
||||
const operate = {
|
||||
type: this.operate.type,
|
||||
operation: OperationEvent.Command.manage.delUser.operation,
|
||||
messages: [`${this.$t('menu.menuDialog.deleteMessageOne')} ${this.selected.userName} ${this.$t('menu.menuDialog.deleteMessageTwo')}`]
|
||||
};
|
||||
|
||||
this.loading = true;
|
||||
this.$store.dispatch('training/next', operate).then(({ valid }) => {
|
||||
this.loading = false;
|
||||
if (valid) {
|
||||
this.$refs.userDelete.doShow(operate, this.selected);
|
||||
}
|
||||
}).catch(error => {
|
||||
this.loading = false;
|
||||
})
|
||||
} else {
|
||||
this.$messageBox(this.$t('menu.menuDialog.selectUser'));
|
||||
}
|
||||
},
|
||||
//刷新用户
|
||||
freshUser() {
|
||||
let operate = {
|
||||
type: this.operate.type,
|
||||
operation: OperationEvent.Command.manage.freshUser.operation,
|
||||
}
|
||||
this.loading = true;
|
||||
this.$store.dispatch('training/next', operate).then(({ valid }) => {
|
||||
this.loading = false;
|
||||
if (valid) {
|
||||
this.$refs.userDelete.doShow(operate, this.selected);
|
||||
}
|
||||
}).catch(() => {
|
||||
this.loading = false;
|
||||
});
|
||||
} else {
|
||||
this.$messageBox(this.$t('menu.menuDialog.selectUser'));
|
||||
}
|
||||
},
|
||||
// 刷新用户
|
||||
freshUser() {
|
||||
const operate = {
|
||||
type: this.operate.type,
|
||||
operation: OperationEvent.Command.manage.freshUser.operation
|
||||
};
|
||||
|
||||
this.loading = true;
|
||||
this.$store.dispatch('training/next', operate).then(({ valid }) => {
|
||||
this.loading = false;
|
||||
}).catch(error => {
|
||||
this.loading = false;
|
||||
})
|
||||
},
|
||||
//选择用户
|
||||
chooseUser(row) {
|
||||
let operate = {
|
||||
type: this.operate.type,
|
||||
operation: OperationEvent.Command.manage.chooseUser.operation,
|
||||
}
|
||||
this.loading = true;
|
||||
this.$store.dispatch('training/next', operate).then(({ valid }) => {
|
||||
this.loading = false;
|
||||
}).catch(() => {
|
||||
this.loading = false;
|
||||
});
|
||||
},
|
||||
// 选择用户
|
||||
chooseUser(row) {
|
||||
const operate = {
|
||||
type: this.operate.type,
|
||||
operation: OperationEvent.Command.manage.chooseUser.operation
|
||||
};
|
||||
|
||||
this.loading = true;
|
||||
this.$store.dispatch('training/next', operate).then(({ valid }) => {
|
||||
this.loading = false;
|
||||
this.selected = row;
|
||||
}).catch(error => {
|
||||
this.loading = false;
|
||||
})
|
||||
},
|
||||
commit() {
|
||||
let operate = {
|
||||
type: this.operate.type,
|
||||
operation: OperationEvent.Command.close.menu.operation,
|
||||
}
|
||||
this.loading = true;
|
||||
this.$store.dispatch('training/next', operate).then(({ valid }) => {
|
||||
this.loading = false;
|
||||
this.selected = row;
|
||||
}).catch(() => {
|
||||
this.loading = false;
|
||||
});
|
||||
},
|
||||
commit() {
|
||||
const operate = {
|
||||
type: this.operate.type,
|
||||
operation: OperationEvent.Command.close.menu.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();
|
||||
})
|
||||
},
|
||||
cancel() {
|
||||
let operate = {
|
||||
type: this.operate.type,
|
||||
operation: OperationEvent.Command.cancel.menu.operation,
|
||||
}
|
||||
this.loading = true;
|
||||
this.$store.dispatch('training/next', operate).then(({ valid }) => {
|
||||
this.loading = false;
|
||||
if (valid) {
|
||||
this.doClose();
|
||||
}
|
||||
}).catch(() => {
|
||||
this.loading = false;
|
||||
this.doClose();
|
||||
});
|
||||
},
|
||||
cancel() {
|
||||
const 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(); });
|
||||
},
|
||||
//增删改函数处理
|
||||
operateUser(data) {
|
||||
if (data && data.type === 'ADD') {
|
||||
let index = this.tableData.indexOf(this.tableData.find(elem => { return elem.jobNumber === data.jobNumber }));
|
||||
if (index < 0) {
|
||||
this.tableData.push({
|
||||
jobNumber: data.jobNumber,
|
||||
userName: data.userName,
|
||||
password: data.password
|
||||
});
|
||||
} else {
|
||||
this.$messageBox(this.$t('menu.menuDialog.addFail'));
|
||||
}
|
||||
} else if (data && data.type === 'EDIT') {
|
||||
let index = this.tableData.indexOf(this.tableData.find(elem => { return elem.jobNumber === data.jobNumber }));
|
||||
if (index >= 0) {
|
||||
this.tableData[index].password = data.password;
|
||||
this.tableData[index].userName = data.userName;
|
||||
} else {
|
||||
this.$messageBox(this.$t('menu.menuDialog.modifyFail'));
|
||||
}
|
||||
} else if (data && data.type === 'DELETE') {
|
||||
let index = this.tableData.indexOf(this.tableData.find(elem => { return elem.jobNumber === data.jobNumber }));
|
||||
if (index >= 0) {
|
||||
this.tableData.splice(index, 1);
|
||||
} else {
|
||||
this.$messageBox(this.$t('menu.menuDialog.deleteFail'));
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
this.$store.dispatch('training/next', operate).then(({ valid }) => {
|
||||
if (valid) {
|
||||
this.doClose();
|
||||
}
|
||||
}).catch(() => { this.doClose(); });
|
||||
},
|
||||
// 增删改函数处理
|
||||
operateUser(data) {
|
||||
if (data && data.type === 'ADD') {
|
||||
const index = this.tableData.indexOf(this.tableData.find(elem => { return elem.jobNumber === data.jobNumber; }));
|
||||
if (index < 0) {
|
||||
this.tableData.push({
|
||||
jobNumber: data.jobNumber,
|
||||
userName: data.userName,
|
||||
password: data.password
|
||||
});
|
||||
} else {
|
||||
this.$messageBox(this.$t('menu.menuDialog.addFail'));
|
||||
}
|
||||
} else if (data && data.type === 'EDIT') {
|
||||
const index = this.tableData.indexOf(this.tableData.find(elem => { return elem.jobNumber === data.jobNumber; }));
|
||||
if (index >= 0) {
|
||||
this.tableData[index].password = data.password;
|
||||
this.tableData[index].userName = data.userName;
|
||||
} else {
|
||||
this.$messageBox(this.$t('menu.menuDialog.modifyFail'));
|
||||
}
|
||||
} else if (data && data.type === 'DELETE') {
|
||||
const index = this.tableData.indexOf(this.tableData.find(elem => { return elem.jobNumber === data.jobNumber; }));
|
||||
if (index >= 0) {
|
||||
this.tableData.splice(index, 1);
|
||||
} else {
|
||||
this.$messageBox(this.$t('menu.menuDialog.deleteFail'));
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
};
|
||||
</script>
|
||||
<style scoped>
|
||||
.fuzhou-01__systerm .el-dialog .base-label {
|
||||
@ -287,4 +305,4 @@
|
||||
padding: 0 5px;
|
||||
background-color: #F0F0F0;
|
||||
}
|
||||
</style>
|
||||
</style>
|
||||
|
@ -1,188 +1,196 @@
|
||||
<template>
|
||||
<el-dialog class="fuzhou-01__systerm password-box" :title="$t('menu.menuDialog.passwordBox')" :visible.sync="show" width="320px"
|
||||
:before-close="doClose" :zIndex="2000" :modal="false" :close-on-click-modal="false" v-dialogDrag>
|
||||
<div class="context" style="overflow:hidden">
|
||||
<el-form label-width="80px" size="mini">
|
||||
<el-form-item prop="username">
|
||||
<span slot="label">{{$t('menu.menuDialog.userNameLabel')}}</span>
|
||||
<el-input v-model="model.username" disabled></el-input>
|
||||
</el-form-item>
|
||||
<el-form-item prop="password">
|
||||
<span slot="label">{{$t('menu.menuDialog.password')}}</span>
|
||||
<el-input type="password" v-model="model.password"></el-input>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
<div class="operate">
|
||||
<el-button-group class="left" v-model="key" size="mini">
|
||||
<el-button size="mini" @click="click(1)">1</el-button>
|
||||
<el-button size="mini" @click="click(2)">2</el-button>
|
||||
<el-button size="mini" @click="click(3)">3</el-button>
|
||||
<el-button size="mini" @click="click(4)">4</el-button>
|
||||
<el-button size="mini" @click="click(5)">5</el-button>
|
||||
</el-button-group>
|
||||
<el-button-group class="right" v-model="key" size="mini">
|
||||
<el-button @click="esc">{{$t('menu.menuDialog.back')}}</el-button>
|
||||
</el-button-group>
|
||||
<el-button-group class="left" v-model="key" size="mini">
|
||||
<el-button size="mini" @click="click(6)">6</el-button>
|
||||
<el-button size="mini" @click="click(7)">7</el-button>
|
||||
<el-button size="mini" @click="click(8)">8</el-button>
|
||||
<el-button size="mini" @click="click(9)">9</el-button>
|
||||
<el-button size="mini" @click="click(0)">0</el-button>
|
||||
</el-button-group>
|
||||
<el-button-group class="right" v-model="key" size="mini">
|
||||
<el-button @click="clr">{{$t('menu.menuDialog.clear')}}</el-button>
|
||||
</el-button-group>
|
||||
</div>
|
||||
</div>
|
||||
<el-row class="button-group">
|
||||
<el-col :span="6" :offset="4">
|
||||
<el-button :id="domIdConfirm" type="primary" :loading="loading" @click="commit">{{$t('menu.menuDialog.confirm')}}</el-button>
|
||||
</el-col>
|
||||
<el-col :span="6" :offset="4">
|
||||
<el-button :id="domIdCancel" @click="cancel">{{$t('menu.menuDialog.cancel')}}</el-button>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<notice-info ref="noticeInfo"></notice-info>
|
||||
</el-dialog>
|
||||
<el-dialog
|
||||
v-dialogDrag
|
||||
class="fuzhou-01__systerm password-box"
|
||||
:title="$t('menu.menuDialog.passwordBox')"
|
||||
:visible.sync="show"
|
||||
width="320px"
|
||||
:before-close="doClose"
|
||||
:z-index="2000"
|
||||
:modal="false"
|
||||
:close-on-click-modal="false"
|
||||
>
|
||||
<div class="context" style="overflow:hidden">
|
||||
<el-form label-width="80px" size="mini">
|
||||
<el-form-item prop="username">
|
||||
<span slot="label">{{ $t('menu.menuDialog.userNameLabel') }}</span>
|
||||
<el-input v-model="model.username" disabled />
|
||||
</el-form-item>
|
||||
<el-form-item prop="password">
|
||||
<span slot="label">{{ $t('menu.menuDialog.password') }}</span>
|
||||
<el-input v-model="model.password" type="password" />
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
<div class="operate">
|
||||
<el-button-group v-model="key" class="left" size="mini">
|
||||
<el-button size="mini" @click="click(1)">1</el-button>
|
||||
<el-button size="mini" @click="click(2)">2</el-button>
|
||||
<el-button size="mini" @click="click(3)">3</el-button>
|
||||
<el-button size="mini" @click="click(4)">4</el-button>
|
||||
<el-button size="mini" @click="click(5)">5</el-button>
|
||||
</el-button-group>
|
||||
<el-button-group v-model="key" class="right" size="mini">
|
||||
<el-button @click="esc">{{ $t('menu.menuDialog.back') }}</el-button>
|
||||
</el-button-group>
|
||||
<el-button-group v-model="key" class="left" size="mini">
|
||||
<el-button size="mini" @click="click(6)">6</el-button>
|
||||
<el-button size="mini" @click="click(7)">7</el-button>
|
||||
<el-button size="mini" @click="click(8)">8</el-button>
|
||||
<el-button size="mini" @click="click(9)">9</el-button>
|
||||
<el-button size="mini" @click="click(0)">0</el-button>
|
||||
</el-button-group>
|
||||
<el-button-group v-model="key" class="right" size="mini">
|
||||
<el-button @click="clr">{{ $t('menu.menuDialog.clear') }}</el-button>
|
||||
</el-button-group>
|
||||
</div>
|
||||
</div>
|
||||
<el-row class="button-group">
|
||||
<el-col :span="6" :offset="4">
|
||||
<el-button :id="domIdConfirm" type="primary" :loading="loading" @click="commit">{{ $t('menu.menuDialog.confirm') }}</el-button>
|
||||
</el-col>
|
||||
<el-col :span="6" :offset="4">
|
||||
<el-button :id="domIdCancel" @click="cancel">{{ $t('menu.menuDialog.cancel') }}</el-button>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<notice-info ref="noticeInfo" />
|
||||
</el-dialog>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import { MapDeviceType, OperationEvent, checkOperationIsCurrentOperate } from '@/scripts/ConstDic';
|
||||
import NoticeInfo from '../dialog/childDialog/childDialog/noticeInfo';
|
||||
import { OperationEvent, checkOperationIsCurrentOperate } from '@/scripts/ConstDic';
|
||||
import NoticeInfo from '../dialog/childDialog/childDialog/noticeInfo';
|
||||
|
||||
export default {
|
||||
name: 'PasswordBox',
|
||||
data() {
|
||||
return {
|
||||
dialogShow: false,
|
||||
loading: false,
|
||||
operate: null,
|
||||
operation: null,
|
||||
model: {
|
||||
username: '',
|
||||
password: '',
|
||||
},
|
||||
key: ''
|
||||
}
|
||||
},
|
||||
components: {
|
||||
NoticeInfo
|
||||
},
|
||||
computed: {
|
||||
show() {
|
||||
return this.dialogShow && !this.$store.state.menuOperation.break;
|
||||
},
|
||||
domIdCancel() {
|
||||
return this.dialogShow ? OperationEvent.Command.close.password.domId : '';
|
||||
},
|
||||
domIdConfirm() {
|
||||
if (this.dialogShow) {
|
||||
if (checkOperationIsCurrentOperate(this.operation, OperationEvent.StationControl.forcedStationControl)) {
|
||||
/** 强制站控*/
|
||||
return OperationEvent.StationControl.forcedStationControl.passwordConfirm.domId;
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
mounted() {
|
||||
this.$nextTick(() => {
|
||||
this.$store.dispatch('training/tipReload');
|
||||
})
|
||||
},
|
||||
methods: {
|
||||
loadInitData(operate) {
|
||||
this.model.username = '';
|
||||
this.model.password = '';
|
||||
this.operate = operate || {};
|
||||
this.operation = operate.operation;
|
||||
this.model.username = this.$store.state.user.name;
|
||||
},
|
||||
doShow(operate) {
|
||||
/** 如果不是断点激活,而是第一次显示需要初始化数据*/
|
||||
if (!this.dialogShow) {
|
||||
this.loadInitData(operate);
|
||||
}
|
||||
this.dialogShow = true;
|
||||
this.$nextTick(function () {
|
||||
this.$store.dispatch('training/emitTipFresh');
|
||||
});
|
||||
},
|
||||
doClose() {
|
||||
this.dialogShow = false;
|
||||
this.$store.dispatch('training/emitTipFresh');
|
||||
},
|
||||
cancel() {
|
||||
let operate = {
|
||||
type: this.operate.type,
|
||||
operation: OperationEvent.Command.close.password.operation,
|
||||
}
|
||||
export default {
|
||||
name: 'PasswordBox',
|
||||
components: {
|
||||
NoticeInfo
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
dialogShow: false,
|
||||
loading: false,
|
||||
operate: null,
|
||||
operation: null,
|
||||
model: {
|
||||
username: '',
|
||||
password: ''
|
||||
},
|
||||
key: ''
|
||||
};
|
||||
},
|
||||
computed: {
|
||||
show() {
|
||||
return this.dialogShow && !this.$store.state.menuOperation.break;
|
||||
},
|
||||
domIdCancel() {
|
||||
return this.dialogShow ? OperationEvent.Command.close.password.domId : '';
|
||||
},
|
||||
domIdConfirm() {
|
||||
if (this.dialogShow) {
|
||||
if (checkOperationIsCurrentOperate(this.operation, OperationEvent.StationControl.forcedStationControl)) {
|
||||
/** 强制站控*/
|
||||
return OperationEvent.StationControl.forcedStationControl.passwordConfirm.domId;
|
||||
}
|
||||
}
|
||||
return '';
|
||||
}
|
||||
},
|
||||
mounted() {
|
||||
this.$nextTick(() => {
|
||||
this.$store.dispatch('training/tipReload');
|
||||
});
|
||||
},
|
||||
methods: {
|
||||
loadInitData(operate) {
|
||||
this.model.username = '';
|
||||
this.model.password = '';
|
||||
this.operate = operate || {};
|
||||
this.operation = operate.operation;
|
||||
this.model.username = this.$store.state.user.name;
|
||||
},
|
||||
doShow(operate) {
|
||||
/** 如果不是断点激活,而是第一次显示需要初始化数据*/
|
||||
if (!this.dialogShow) {
|
||||
this.loadInitData(operate);
|
||||
}
|
||||
this.dialogShow = true;
|
||||
this.$nextTick(function () {
|
||||
this.$store.dispatch('training/emitTipFresh');
|
||||
});
|
||||
},
|
||||
doClose() {
|
||||
this.dialogShow = false;
|
||||
this.$store.dispatch('training/emitTipFresh');
|
||||
},
|
||||
cancel() {
|
||||
const operate = {
|
||||
type: this.operate.type,
|
||||
operation: OperationEvent.Command.close.password.operation
|
||||
};
|
||||
|
||||
this.$store.dispatch('training/next', operate).then(({ valid }) => {
|
||||
if (valid) {
|
||||
this.doClose();
|
||||
}
|
||||
})
|
||||
},
|
||||
commit() {
|
||||
let operate = {
|
||||
type: this.operate.type,
|
||||
}
|
||||
this.$store.dispatch('training/next', operate).then(({ valid }) => {
|
||||
if (valid) {
|
||||
this.doClose();
|
||||
}
|
||||
});
|
||||
},
|
||||
commit() {
|
||||
const operate = {
|
||||
type: this.operate.type
|
||||
};
|
||||
|
||||
if (checkOperationIsCurrentOperate(this.operation, OperationEvent.StationControl.forcedStationControl)) {
|
||||
/** 强制站控*/
|
||||
operate.operation = OperationEvent.StationControl.forcedStationControl.passwordConfirm.operation
|
||||
}
|
||||
if (checkOperationIsCurrentOperate(this.operation, OperationEvent.StationControl.forcedStationControl)) {
|
||||
/** 强制站控*/
|
||||
operate.operation = OperationEvent.StationControl.forcedStationControl.passwordConfirm.operation;
|
||||
}
|
||||
|
||||
if (this.model.password == '123456') {
|
||||
this.loading = true;
|
||||
this.$store.dispatch('training/next', operate).then(({ valid }) => {
|
||||
this.loading = false;
|
||||
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
|
||||
if (this.model.password == '123456') {
|
||||
this.loading = true;
|
||||
this.$store.dispatch('training/next', operate).then(({ valid }) => {
|
||||
this.loading = false;
|
||||
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
|
||||
|
||||
if (valid) {
|
||||
this.$emit('setLoginResult', {
|
||||
operation: operate.operation,
|
||||
success: valid
|
||||
});
|
||||
this.doClose();
|
||||
}
|
||||
}).catch(() => {
|
||||
this.loading = false;
|
||||
this.$emit('setLoginResult', {
|
||||
operation: operate.operation,
|
||||
success: false
|
||||
});
|
||||
})
|
||||
} else {
|
||||
this.$refs.noticeInfo.doShow(operate, [this.$t('menu.menuDialog.IncorrectPassword')]);
|
||||
if (valid) {
|
||||
this.$emit('setLoginResult', {
|
||||
operation: operate.operation,
|
||||
success: valid
|
||||
});
|
||||
this.doClose();
|
||||
}
|
||||
}).catch(() => {
|
||||
this.loading = false;
|
||||
this.$emit('setLoginResult', {
|
||||
operation: operate.operation,
|
||||
success: false
|
||||
});
|
||||
});
|
||||
} else {
|
||||
this.$refs.noticeInfo.doShow(operate, [this.$t('menu.menuDialog.IncorrectPassword')]);
|
||||
|
||||
}
|
||||
},
|
||||
click(key) {
|
||||
if (!this.model.password) {
|
||||
this.model.password = '';
|
||||
}
|
||||
this.model.password += key;
|
||||
},
|
||||
esc() {
|
||||
if (this.model.password) {
|
||||
this.model.password = this.model.password.substring(0, this.model.password.length - 1);
|
||||
}
|
||||
},
|
||||
clr() {
|
||||
this.model.password = '';
|
||||
}
|
||||
}
|
||||
},
|
||||
click(key) {
|
||||
if (!this.model.password) {
|
||||
this.model.password = '';
|
||||
}
|
||||
this.model.password += key;
|
||||
},
|
||||
esc() {
|
||||
if (this.model.password) {
|
||||
this.model.password = this.model.password.substring(0, this.model.password.length - 1);
|
||||
}
|
||||
},
|
||||
clr() {
|
||||
this.model.password = '';
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
</script>
|
||||
<style rel="stylesheet/scss" lang="scss" scoped>
|
||||
@import "src/styles/mixin.scss";
|
||||
|
||||
|
||||
|
||||
.password-box .el-form {
|
||||
margin-top: 10px !important;
|
||||
margin-right: 20px !important;
|
||||
@ -218,4 +226,4 @@
|
||||
background: #F0F0F0;
|
||||
width: 80px !important;
|
||||
}
|
||||
</style>
|
||||
</style>
|
||||
|
@ -1,155 +1,167 @@
|
||||
<template>
|
||||
<el-dialog class="fuzhou-01__systerm stand-stop-time" :title="title" :visible.sync="show" width="320px"
|
||||
:before-close="doClose" :zIndex="2000" :modal="false" :close-on-click-modal="false" v-dialogDrag>
|
||||
<el-form size="small" label-width="100px" :model="addModel" :rules="rules" ref="form">
|
||||
<div style="padding: 10px 15px; border: 1px double lightgray; margin: 20px 0px; height: 120px;">
|
||||
<span class="base-label">{{$t('menu.menuDialog.addLocation')}}</span>
|
||||
<div style="position: relative; top:-10px;">
|
||||
<el-form-item prop="stationStandCode">
|
||||
<span slot="label">{{$t('menu.menuDialog.terminalOne')}}</span>
|
||||
<el-select v-model="addModel.stationStandCode" filterable :placeholder="$t('menu.menuDialog.pleaseSelect')">
|
||||
<el-option v-for="item in stationStandList" :key="item.code" :label="item.name"
|
||||
:value="item.code">
|
||||
</el-option>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item prop="trainNumberLimber">
|
||||
<span slot="label" id="frontTrainNumber">{{$t('menu.menuDialog.frontTrainNumber')}}</span>
|
||||
<el-input v-model="addModel.trainNumberLimber"></el-input>
|
||||
</el-form-item>
|
||||
</div>
|
||||
</div>
|
||||
<el-form-item :label="$t('menu.menuDialog.addTrainNumber')" label-width="115px" prop="groupNumber" id="groupNumber">
|
||||
<el-input v-model="addModel.groupNumber"></el-input>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
<el-row justify="center" class="button-group">
|
||||
<el-col :span="10" :offset="2">
|
||||
<el-button :id="domIdConfirm" type="primary" :loading="loading" @click="commit">{{$t('menu.menuDialog.confirm')}}</el-button>
|
||||
</el-col>
|
||||
<el-col :span="8" :offset="4">
|
||||
<el-button :id="domIdCancel" @click="cancel">{{$t('menu.menuDialog.cancel')}}</el-button>
|
||||
</el-col>
|
||||
</el-row>
|
||||
</el-dialog>
|
||||
<el-dialog
|
||||
v-dialogDrag
|
||||
class="fuzhou-01__systerm stand-stop-time"
|
||||
:title="title"
|
||||
:visible.sync="show"
|
||||
width="320px"
|
||||
:before-close="doClose"
|
||||
:z-index="2000"
|
||||
:modal="false"
|
||||
:close-on-click-modal="false"
|
||||
>
|
||||
<el-form ref="form" size="small" label-width="100px" :model="addModel" :rules="rules">
|
||||
<div style="padding: 10px 15px; border: 1px double lightgray; margin: 20px 0px; height: 120px;">
|
||||
<span class="base-label">{{ $t('menu.menuDialog.addLocation') }}</span>
|
||||
<div style="position: relative; top:-10px;">
|
||||
<el-form-item prop="stationStandCode">
|
||||
<span slot="label">{{ $t('menu.menuDialog.terminalOne') }}</span>
|
||||
<el-select v-model="addModel.stationStandCode" filterable :placeholder="$t('menu.menuDialog.pleaseSelect')">
|
||||
<el-option
|
||||
v-for="item in stationStandList"
|
||||
:key="item.code"
|
||||
:label="item.name"
|
||||
:value="item.code"
|
||||
/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item prop="trainNumberLimber">
|
||||
<span id="frontTrainNumber" slot="label">{{ $t('menu.menuDialog.frontTrainNumber') }}</span>
|
||||
<el-input v-model="addModel.trainNumberLimber" />
|
||||
</el-form-item>
|
||||
</div>
|
||||
</div>
|
||||
<el-form-item id="groupNumber" :label="$t('menu.menuDialog.addTrainNumber')" label-width="115px" prop="groupNumber">
|
||||
<el-input v-model="addModel.groupNumber" />
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
<el-row justify="center" class="button-group">
|
||||
<el-col :span="10" :offset="2">
|
||||
<el-button :id="domIdConfirm" type="primary" :loading="loading" @click="commit">{{ $t('menu.menuDialog.confirm') }}</el-button>
|
||||
</el-col>
|
||||
<el-col :span="8" :offset="4">
|
||||
<el-button :id="domIdCancel" @click="cancel">{{ $t('menu.menuDialog.cancel') }}</el-button>
|
||||
</el-col>
|
||||
</el-row>
|
||||
</el-dialog>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import { mapGetters } from 'vuex';
|
||||
import { MapDeviceType, OperationEvent } from '@/scripts/ConstDic';
|
||||
import { mapGetters } from 'vuex';
|
||||
import { MapDeviceType, OperationEvent } from '@/scripts/ConstDic';
|
||||
|
||||
export default {
|
||||
name: 'TrainAdd',
|
||||
components: {
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
trainNoList: [],
|
||||
addModel: {
|
||||
groupNumber: '',
|
||||
stationStandCode: '',
|
||||
trainNumberLimber: '',
|
||||
},
|
||||
export default {
|
||||
name: 'TrainAdd',
|
||||
components: {
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
trainNoList: [],
|
||||
addModel: {
|
||||
groupNumber: '',
|
||||
stationStandCode: '',
|
||||
trainNumberLimber: ''
|
||||
},
|
||||
|
||||
rules: {
|
||||
groupNumber: [
|
||||
{ required: true, message: this.$t('menu.menuDialog.inputTrainNumber'), trigger: 'blur' }
|
||||
],
|
||||
// trainNumberLimber: [
|
||||
// { required: true, message: '请输入前车车次号', trigger: 'blur' }
|
||||
// ],
|
||||
stationStandCode: [
|
||||
{ required: true, message: this.$t('menu.menuDialog.selectTerminal'), trigger: 'change' }
|
||||
],
|
||||
},
|
||||
operation: null,
|
||||
dialogShow: false,
|
||||
loading: false,
|
||||
}
|
||||
},
|
||||
computed: {
|
||||
...mapGetters('map', [
|
||||
'stationStandList'
|
||||
]),
|
||||
show() {
|
||||
return this.dialogShow && !this.$store.state.menuOperation.break;
|
||||
},
|
||||
domIdCancel() {
|
||||
return this.dialogShow ? OperationEvent.Command.cancel.menu.domId : '';
|
||||
},
|
||||
domIdConfirm() {
|
||||
return this.dialogShow ? OperationEvent.Command.planTrain.addPlanTrain.domId : '';
|
||||
},
|
||||
title() {
|
||||
return this.$t('menu.menuDialog.addPlanTrain')
|
||||
}
|
||||
},
|
||||
mounted() {
|
||||
this.$nextTick(() => {
|
||||
this.$store.dispatch('training/tipReload');
|
||||
})
|
||||
},
|
||||
methods: {
|
||||
doShow(operate) {
|
||||
this.operate = operate || {};
|
||||
this.operation = operate.operation;
|
||||
rules: {
|
||||
groupNumber: [
|
||||
{ required: true, message: this.$t('menu.menuDialog.inputTrainNumber'), trigger: 'blur' }
|
||||
],
|
||||
// trainNumberLimber: [
|
||||
// { required: true, message: '请输入前车车次号', trigger: 'blur' }
|
||||
// ],
|
||||
stationStandCode: [
|
||||
{ required: true, message: this.$t('menu.menuDialog.selectTerminal'), trigger: 'change' }
|
||||
]
|
||||
},
|
||||
operation: null,
|
||||
dialogShow: false,
|
||||
loading: false
|
||||
};
|
||||
},
|
||||
computed: {
|
||||
...mapGetters('map', [
|
||||
'stationStandList'
|
||||
]),
|
||||
show() {
|
||||
return this.dialogShow && !this.$store.state.menuOperation.break;
|
||||
},
|
||||
domIdCancel() {
|
||||
return this.dialogShow ? OperationEvent.Command.cancel.menu.domId : '';
|
||||
},
|
||||
domIdConfirm() {
|
||||
return this.dialogShow ? OperationEvent.Command.planTrain.addPlanTrain.domId : '';
|
||||
},
|
||||
title() {
|
||||
return this.$t('menu.menuDialog.addPlanTrain');
|
||||
}
|
||||
},
|
||||
mounted() {
|
||||
this.$nextTick(() => {
|
||||
this.$store.dispatch('training/tipReload');
|
||||
});
|
||||
},
|
||||
methods: {
|
||||
doShow(operate) {
|
||||
this.operate = operate || {};
|
||||
this.operation = operate.operation;
|
||||
|
||||
//非断电激活时设置初始值
|
||||
if (!this.dialogShow) {
|
||||
this.loading = false;
|
||||
}
|
||||
// 非断电激活时设置初始值
|
||||
if (!this.dialogShow) {
|
||||
this.loading = false;
|
||||
}
|
||||
|
||||
this.dialogShow = true;
|
||||
this.$nextTick(function () {
|
||||
this.$store.dispatch('training/emitTipFresh');
|
||||
});
|
||||
},
|
||||
doClose() {
|
||||
this.loading = false;
|
||||
this.dialogShow = false;
|
||||
this.$store.dispatch('training/emitTipFresh');
|
||||
},
|
||||
commit() {
|
||||
this.$refs['form'].validate((valid) => {
|
||||
if (valid) {
|
||||
let operate = {
|
||||
send: true,
|
||||
type: MapDeviceType.Train.type,
|
||||
operation: OperationEvent.Command.planTrain.addPlanTrain.operation,
|
||||
}
|
||||
this.dialogShow = true;
|
||||
this.$nextTick(function () {
|
||||
this.$store.dispatch('training/emitTipFresh');
|
||||
});
|
||||
},
|
||||
doClose() {
|
||||
this.loading = false;
|
||||
this.dialogShow = false;
|
||||
this.$store.dispatch('training/emitTipFresh');
|
||||
},
|
||||
commit() {
|
||||
this.$refs['form'].validate((valid) => {
|
||||
if (valid) {
|
||||
const operate = {
|
||||
send: true,
|
||||
type: MapDeviceType.Train.type,
|
||||
operation: OperationEvent.Command.planTrain.addPlanTrain.operation
|
||||
};
|
||||
|
||||
this.loading = true;
|
||||
this.$store.dispatch('training/next', operate).then(({ valid }) => {
|
||||
this.loading = false;
|
||||
if (valid) {
|
||||
this.doClose();
|
||||
} else {
|
||||
// this.$refs.noticeInfo.doShow(operate);
|
||||
}
|
||||
}).catch(error => {
|
||||
this.loading = false;
|
||||
this.doClose();
|
||||
// this.$refs.noticeInfo.doShow(operate);
|
||||
})
|
||||
} else {
|
||||
return false;
|
||||
}
|
||||
});
|
||||
},
|
||||
cancel() {
|
||||
let operate = {
|
||||
type: MapDeviceType.Train.type,
|
||||
operation: OperationEvent.Command.cancel.menu.operation,
|
||||
}
|
||||
this.loading = true;
|
||||
this.$store.dispatch('training/next', operate).then(({ valid }) => {
|
||||
this.loading = false;
|
||||
if (valid) {
|
||||
this.doClose();
|
||||
} else {
|
||||
// this.$refs.noticeInfo.doShow(operate);
|
||||
}
|
||||
}).catch(() => {
|
||||
this.loading = false;
|
||||
this.doClose();
|
||||
// this.$refs.noticeInfo.doShow(operate);
|
||||
});
|
||||
} else {
|
||||
return false;
|
||||
}
|
||||
});
|
||||
},
|
||||
cancel() {
|
||||
const operate = {
|
||||
type: MapDeviceType.Train.type,
|
||||
operation: OperationEvent.Command.cancel.menu.operation
|
||||
};
|
||||
|
||||
this.$store.dispatch('training/next', operate).then(({ valid }) => {
|
||||
if (valid) {
|
||||
this.doClose();
|
||||
}
|
||||
}).catch(error => { this.doClose(); });
|
||||
}
|
||||
}
|
||||
}
|
||||
this.$store.dispatch('training/next', operate).then(({ valid }) => {
|
||||
if (valid) {
|
||||
this.doClose();
|
||||
}
|
||||
}).catch(() => { this.doClose(); });
|
||||
}
|
||||
}
|
||||
};
|
||||
</script>
|
||||
<style scoped>
|
||||
.fuzhou-01__systerm .el-dialog .base-label {
|
||||
@ -164,4 +176,4 @@
|
||||
line-height: 100%;
|
||||
display: inline-block;
|
||||
}
|
||||
</style>
|
||||
</style>
|
||||
|
@ -1,141 +1,149 @@
|
||||
<template>
|
||||
<el-dialog class="fuzhou-01__systerm stand-stop-time" :title="title" :visible.sync="show" width="320px"
|
||||
:before-close="doClose" :zIndex="2000" :modal="false" :close-on-click-modal="false" v-dialogDrag>
|
||||
<el-form size="small" label-width="100px" :model="addModel" :rules="rules" ref="form">
|
||||
<el-form-item prop="stationStandCode">
|
||||
<span slot="label">{{$t('menu.menuDialog.terminalTwo')}}</span>
|
||||
<el-select v-model="addModel.stationStandCode" filterable :placeholder="$t('menu.menuDialog.pleaseSelect')">
|
||||
<el-option v-for="item in stationStandList" :key="item.code" :label="item.name" :value="item.code">
|
||||
</el-option>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item :label="$t('menu.menuDialog.trainNumber')" prop="groupNumber">
|
||||
<el-input v-model="addModel.groupNumber"></el-input>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
<el-row justify="center" class="button-group">
|
||||
<el-col :span="10" :offset="2">
|
||||
<el-button :id="domIdConfirm" type="primary" :loading="loading" @click="commit">{{$t('menu.menuDialog.confirm')}}</el-button>
|
||||
</el-col>
|
||||
<el-col :span="8" :offset="4">
|
||||
<el-button :id="domIdCancel" @click="cancel">{{$t('menu.menuDialog.cancel')}}</el-button>
|
||||
</el-col>
|
||||
</el-row>
|
||||
</el-dialog>
|
||||
<el-dialog
|
||||
v-dialogDrag
|
||||
class="fuzhou-01__systerm stand-stop-time"
|
||||
:title="title"
|
||||
:visible.sync="show"
|
||||
width="320px"
|
||||
:before-close="doClose"
|
||||
:z-index="2000"
|
||||
:modal="false"
|
||||
:close-on-click-modal="false"
|
||||
>
|
||||
<el-form ref="form" size="small" label-width="100px" :model="addModel" :rules="rules">
|
||||
<el-form-item prop="stationStandCode">
|
||||
<span slot="label">{{ $t('menu.menuDialog.terminalTwo') }}</span>
|
||||
<el-select v-model="addModel.stationStandCode" filterable :placeholder="$t('menu.menuDialog.pleaseSelect')">
|
||||
<el-option v-for="item in stationStandList" :key="item.code" :label="item.name" :value="item.code" />
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item :label="$t('menu.menuDialog.trainNumber')" prop="groupNumber">
|
||||
<el-input v-model="addModel.groupNumber" />
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
<el-row justify="center" class="button-group">
|
||||
<el-col :span="10" :offset="2">
|
||||
<el-button :id="domIdConfirm" type="primary" :loading="loading" @click="commit">{{ $t('menu.menuDialog.confirm') }}</el-button>
|
||||
</el-col>
|
||||
<el-col :span="8" :offset="4">
|
||||
<el-button :id="domIdCancel" @click="cancel">{{ $t('menu.menuDialog.cancel') }}</el-button>
|
||||
</el-col>
|
||||
</el-row>
|
||||
</el-dialog>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import { mapGetters } from 'vuex';
|
||||
import { MapDeviceType, OperationEvent } from '@/scripts/ConstDic';
|
||||
import { mapGetters } from 'vuex';
|
||||
import { MapDeviceType, OperationEvent } from '@/scripts/ConstDic';
|
||||
|
||||
export default {
|
||||
name: 'TrainAdd',
|
||||
components: {
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
trainNoList: [],
|
||||
addModel: {
|
||||
groupNumber: '',
|
||||
stationStandCode: '',
|
||||
},
|
||||
export default {
|
||||
name: 'TrainAdd',
|
||||
components: {
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
trainNoList: [],
|
||||
addModel: {
|
||||
groupNumber: '',
|
||||
stationStandCode: ''
|
||||
},
|
||||
|
||||
rules: {
|
||||
groupNumber: [
|
||||
{ required: true, message: this.$t('menu.menuDialog.inputTrainNumber'), trigger: 'blur' }
|
||||
],
|
||||
stationStandCode: [
|
||||
{ required: true, message: this.$t('menu.menuDialog.selectTerminal'), trigger: 'change' }
|
||||
],
|
||||
},
|
||||
operation: null,
|
||||
dialogShow: false,
|
||||
loading: false,
|
||||
}
|
||||
},
|
||||
computed: {
|
||||
...mapGetters('map', [
|
||||
'stationStandList'
|
||||
]),
|
||||
show() {
|
||||
return this.dialogShow && !this.$store.state.menuOperation.break;
|
||||
},
|
||||
domIdCancel() {
|
||||
return this.dialogShow ? OperationEvent.Command.cancel.menu.domId : '';
|
||||
},
|
||||
domIdConfirm() {
|
||||
return this.dialogShow ? OperationEvent.Command.planTrain.delPlanTrain.domId : '';
|
||||
},
|
||||
title() {
|
||||
return this.$t('menu.menuDialog.deletePlanTrain')
|
||||
}
|
||||
},
|
||||
mounted() {
|
||||
this.$nextTick(() => {
|
||||
this.$store.dispatch('training/tipReload');
|
||||
})
|
||||
},
|
||||
methods: {
|
||||
doShow(operate) {
|
||||
this.operate = operate || {};
|
||||
this.operation = operate.operation;
|
||||
rules: {
|
||||
groupNumber: [
|
||||
{ required: true, message: this.$t('menu.menuDialog.inputTrainNumber'), trigger: 'blur' }
|
||||
],
|
||||
stationStandCode: [
|
||||
{ required: true, message: this.$t('menu.menuDialog.selectTerminal'), trigger: 'change' }
|
||||
]
|
||||
},
|
||||
operation: null,
|
||||
dialogShow: false,
|
||||
loading: false
|
||||
};
|
||||
},
|
||||
computed: {
|
||||
...mapGetters('map', [
|
||||
'stationStandList'
|
||||
]),
|
||||
show() {
|
||||
return this.dialogShow && !this.$store.state.menuOperation.break;
|
||||
},
|
||||
domIdCancel() {
|
||||
return this.dialogShow ? OperationEvent.Command.cancel.menu.domId : '';
|
||||
},
|
||||
domIdConfirm() {
|
||||
return this.dialogShow ? OperationEvent.Command.planTrain.delPlanTrain.domId : '';
|
||||
},
|
||||
title() {
|
||||
return this.$t('menu.menuDialog.deletePlanTrain');
|
||||
}
|
||||
},
|
||||
mounted() {
|
||||
this.$nextTick(() => {
|
||||
this.$store.dispatch('training/tipReload');
|
||||
});
|
||||
},
|
||||
methods: {
|
||||
doShow(operate) {
|
||||
this.operate = operate || {};
|
||||
this.operation = operate.operation;
|
||||
|
||||
//非断电激活时设置初始值
|
||||
if (!this.dialogShow) {
|
||||
this.loading = false;
|
||||
}
|
||||
// 非断电激活时设置初始值
|
||||
if (!this.dialogShow) {
|
||||
this.loading = false;
|
||||
}
|
||||
|
||||
this.dialogShow = true;
|
||||
this.$nextTick(function () {
|
||||
this.$store.dispatch('training/emitTipFresh');
|
||||
});
|
||||
},
|
||||
doClose() {
|
||||
this.loading = false;
|
||||
this.dialogShow = false;
|
||||
this.$store.dispatch('training/emitTipFresh');
|
||||
},
|
||||
commit() {
|
||||
this.$refs['form'].validate((valid) => {
|
||||
if (valid) {
|
||||
let operate = {
|
||||
send: true,
|
||||
type: MapDeviceType.Train.type,
|
||||
operation: OperationEvent.Command.planTrain.delPlanTrain.operation,
|
||||
}
|
||||
this.dialogShow = true;
|
||||
this.$nextTick(function () {
|
||||
this.$store.dispatch('training/emitTipFresh');
|
||||
});
|
||||
},
|
||||
doClose() {
|
||||
this.loading = false;
|
||||
this.dialogShow = false;
|
||||
this.$store.dispatch('training/emitTipFresh');
|
||||
},
|
||||
commit() {
|
||||
this.$refs['form'].validate((valid) => {
|
||||
if (valid) {
|
||||
const operate = {
|
||||
send: true,
|
||||
type: MapDeviceType.Train.type,
|
||||
operation: OperationEvent.Command.planTrain.delPlanTrain.operation
|
||||
};
|
||||
|
||||
this.loading = true;
|
||||
this.$store.dispatch('training/next', operate).then(({ valid }) => {
|
||||
this.loading = false;
|
||||
if (valid) {
|
||||
this.doClose();
|
||||
} else {
|
||||
// this.$refs.noticeInfo.doShow(operate);
|
||||
}
|
||||
}).catch(error => {
|
||||
this.loading = false;
|
||||
this.doClose();
|
||||
// this.$refs.noticeInfo.doShow(operate);
|
||||
})
|
||||
} else {
|
||||
return false;
|
||||
}
|
||||
});
|
||||
},
|
||||
cancel() {
|
||||
let operate = {
|
||||
type: MapDeviceType.Train.type,
|
||||
operation: OperationEvent.Command.cancel.menu.operation,
|
||||
}
|
||||
this.loading = true;
|
||||
this.$store.dispatch('training/next', operate).then(({ valid }) => {
|
||||
this.loading = false;
|
||||
if (valid) {
|
||||
this.doClose();
|
||||
} else {
|
||||
// this.$refs.noticeInfo.doShow(operate);
|
||||
}
|
||||
}).catch(() => {
|
||||
this.loading = false;
|
||||
this.doClose();
|
||||
// this.$refs.noticeInfo.doShow(operate);
|
||||
});
|
||||
} else {
|
||||
return false;
|
||||
}
|
||||
});
|
||||
},
|
||||
cancel() {
|
||||
const operate = {
|
||||
type: MapDeviceType.Train.type,
|
||||
operation: OperationEvent.Command.cancel.menu.operation
|
||||
};
|
||||
|
||||
this.$store.dispatch('training/next', operate).then(({ valid }) => {
|
||||
if (valid) {
|
||||
this.doClose();
|
||||
}
|
||||
}).catch(error => { this.doClose(); });
|
||||
}
|
||||
}
|
||||
}
|
||||
this.$store.dispatch('training/next', operate).then(({ valid }) => {
|
||||
if (valid) {
|
||||
this.doClose();
|
||||
}
|
||||
}).catch(() => { this.doClose(); });
|
||||
}
|
||||
}
|
||||
};
|
||||
</script>
|
||||
<style scoped>
|
||||
.fuzhou-01__systerm .el-dialog .base-label {
|
||||
@ -146,4 +154,4 @@
|
||||
padding: 0 5px;
|
||||
background-color: #F0F0F0;
|
||||
}
|
||||
</style>
|
||||
</style>
|
||||
|
@ -1,152 +1,164 @@
|
||||
<template>
|
||||
<el-dialog class="fuzhou-01__systerm stand-stop-time" :title="title" :visible.sync="show" width="320px"
|
||||
:before-close="doClose" :zIndex="2000" :modal="false" :close-on-click-modal="false" v-dialogDrag>
|
||||
<el-form size="small" label-width="100px" :model="addModel" :rules="rules" ref="form">
|
||||
<el-form-item :label="$t('menu.menuDialog.trainNumber')" label-width="115px" prop="groupNumber">
|
||||
<el-input v-model="addModel.groupNumber"></el-input>
|
||||
</el-form-item>
|
||||
<div style="padding: 10px 15px; border: 1px double lightgray; margin: 20px 0px; height: 120px;">
|
||||
<span class="base-label">{{$t('menu.menuDialog.purpose')}}</span>
|
||||
<div style="position: relative; top:-10px;">
|
||||
<el-form-item prop="stationStandCode">
|
||||
<span slot="label">{{$t('menu.menuDialog.terminalTwo')}}</span>
|
||||
<el-select v-model="addModel.stationStandCode" filterable :placeholder="$t('menu.menuDialog.pleaseSelect')">
|
||||
<el-option v-for="item in stationStandList" :key="item.code" :label="item.name"
|
||||
:value="item.code">
|
||||
</el-option>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item :label="$t('menu.menuDialog.trainNumber')" prop="trainNumberLimber">
|
||||
<el-input v-model="addModel.trainNumberLimber"></el-input>
|
||||
</el-form-item>
|
||||
</div>
|
||||
</div>
|
||||
</el-form>
|
||||
<el-row justify="center" class="button-group">
|
||||
<el-col :span="10" :offset="2">
|
||||
<el-button :id="domIdConfirm" type="primary" :loading="loading" @click="commit">{{$t('menu.menuDialog.confirm')}}</el-button>
|
||||
</el-col>
|
||||
<el-col :span="8" :offset="4">
|
||||
<el-button :id="domIdCancel" @click="cancel">{{$t('menu.menuDialog.cancel')}}</el-button>
|
||||
</el-col>
|
||||
</el-row>
|
||||
</el-dialog>
|
||||
<el-dialog
|
||||
v-dialogDrag
|
||||
class="fuzhou-01__systerm stand-stop-time"
|
||||
:title="title"
|
||||
:visible.sync="show"
|
||||
width="320px"
|
||||
:before-close="doClose"
|
||||
:z-index="2000"
|
||||
:modal="false"
|
||||
:close-on-click-modal="false"
|
||||
>
|
||||
<el-form ref="form" size="small" label-width="100px" :model="addModel" :rules="rules">
|
||||
<el-form-item :label="$t('menu.menuDialog.trainNumber')" label-width="115px" prop="groupNumber">
|
||||
<el-input v-model="addModel.groupNumber" />
|
||||
</el-form-item>
|
||||
<div style="padding: 10px 15px; border: 1px double lightgray; margin: 20px 0px; height: 120px;">
|
||||
<span class="base-label">{{ $t('menu.menuDialog.purpose') }}</span>
|
||||
<div style="position: relative; top:-10px;">
|
||||
<el-form-item prop="stationStandCode">
|
||||
<span slot="label">{{ $t('menu.menuDialog.terminalTwo') }}</span>
|
||||
<el-select v-model="addModel.stationStandCode" filterable :placeholder="$t('menu.menuDialog.pleaseSelect')">
|
||||
<el-option
|
||||
v-for="item in stationStandList"
|
||||
:key="item.code"
|
||||
:label="item.name"
|
||||
:value="item.code"
|
||||
/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item :label="$t('menu.menuDialog.trainNumber')" prop="trainNumberLimber">
|
||||
<el-input v-model="addModel.trainNumberLimber" />
|
||||
</el-form-item>
|
||||
</div>
|
||||
</div>
|
||||
</el-form>
|
||||
<el-row justify="center" class="button-group">
|
||||
<el-col :span="10" :offset="2">
|
||||
<el-button :id="domIdConfirm" type="primary" :loading="loading" @click="commit">{{ $t('menu.menuDialog.confirm') }}</el-button>
|
||||
</el-col>
|
||||
<el-col :span="8" :offset="4">
|
||||
<el-button :id="domIdCancel" @click="cancel">{{ $t('menu.menuDialog.cancel') }}</el-button>
|
||||
</el-col>
|
||||
</el-row>
|
||||
</el-dialog>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import { mapGetters } from 'vuex';
|
||||
import { MapDeviceType, OperationEvent } from '@/scripts/ConstDic';
|
||||
import { mapGetters } from 'vuex';
|
||||
import { MapDeviceType, OperationEvent } from '@/scripts/ConstDic';
|
||||
|
||||
export default {
|
||||
name: 'TrainTranstalet',
|
||||
components: {
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
trainNoList: [],
|
||||
addModel: {
|
||||
groupNumber: '',
|
||||
stationStandCode: '',
|
||||
trainNumberLimber: '',
|
||||
},
|
||||
export default {
|
||||
name: 'TrainTranstalet',
|
||||
components: {
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
trainNoList: [],
|
||||
addModel: {
|
||||
groupNumber: '',
|
||||
stationStandCode: '',
|
||||
trainNumberLimber: ''
|
||||
},
|
||||
|
||||
rules: {
|
||||
groupNumber: [
|
||||
{ required: true, message: this.$t('menu.menuDialog.inputTrainNumber'), trigger: 'blur' }
|
||||
],
|
||||
trainNumberLimber: [
|
||||
{ required: true, message: this.$t('menu.menuDialog.inputFrontNumber'), trigger: 'blur' }
|
||||
],
|
||||
stationStandCode: [
|
||||
{ required: true, message: this.$t('menu.menuDialog.selectTerminal'), trigger: 'change' }
|
||||
],
|
||||
},
|
||||
operation: null,
|
||||
dialogShow: false,
|
||||
loading: false,
|
||||
}
|
||||
},
|
||||
computed: {
|
||||
...mapGetters('map', [
|
||||
'stationStandList'
|
||||
]),
|
||||
show() {
|
||||
return this.dialogShow && !this.$store.state.menuOperation.break;
|
||||
},
|
||||
domIdCancel() {
|
||||
return this.dialogShow ? OperationEvent.Command.cancel.menu.domId : '';
|
||||
},
|
||||
domIdConfirm() {
|
||||
return this.dialogShow ? OperationEvent.Command.planTrain.translatPlanTrain.domId : '';
|
||||
},
|
||||
title() {
|
||||
return this.$t('menu.menuDialog.panPlanCar')
|
||||
}
|
||||
},
|
||||
mounted() {
|
||||
this.$nextTick(() => {
|
||||
this.$store.dispatch('training/tipReload');
|
||||
})
|
||||
},
|
||||
methods: {
|
||||
doShow(operate) {
|
||||
this.operate = operate || {};
|
||||
this.operation = operate.operation;
|
||||
rules: {
|
||||
groupNumber: [
|
||||
{ required: true, message: this.$t('menu.menuDialog.inputTrainNumber'), trigger: 'blur' }
|
||||
],
|
||||
trainNumberLimber: [
|
||||
{ required: true, message: this.$t('menu.menuDialog.inputFrontNumber'), trigger: 'blur' }
|
||||
],
|
||||
stationStandCode: [
|
||||
{ required: true, message: this.$t('menu.menuDialog.selectTerminal'), trigger: 'change' }
|
||||
]
|
||||
},
|
||||
operation: null,
|
||||
dialogShow: false,
|
||||
loading: false
|
||||
};
|
||||
},
|
||||
computed: {
|
||||
...mapGetters('map', [
|
||||
'stationStandList'
|
||||
]),
|
||||
show() {
|
||||
return this.dialogShow && !this.$store.state.menuOperation.break;
|
||||
},
|
||||
domIdCancel() {
|
||||
return this.dialogShow ? OperationEvent.Command.cancel.menu.domId : '';
|
||||
},
|
||||
domIdConfirm() {
|
||||
return this.dialogShow ? OperationEvent.Command.planTrain.translatPlanTrain.domId : '';
|
||||
},
|
||||
title() {
|
||||
return this.$t('menu.menuDialog.panPlanCar');
|
||||
}
|
||||
},
|
||||
mounted() {
|
||||
this.$nextTick(() => {
|
||||
this.$store.dispatch('training/tipReload');
|
||||
});
|
||||
},
|
||||
methods: {
|
||||
doShow(operate) {
|
||||
this.operate = operate || {};
|
||||
this.operation = operate.operation;
|
||||
|
||||
//非断电激活时设置初始值
|
||||
if (!this.dialogShow) {
|
||||
this.loading = false;
|
||||
}
|
||||
// 非断电激活时设置初始值
|
||||
if (!this.dialogShow) {
|
||||
this.loading = false;
|
||||
}
|
||||
|
||||
this.dialogShow = true;
|
||||
this.$nextTick(function () {
|
||||
this.$store.dispatch('training/emitTipFresh');
|
||||
});
|
||||
},
|
||||
doClose() {
|
||||
this.loading = false;
|
||||
this.dialogShow = false;
|
||||
this.$store.dispatch('training/emitTipFresh');
|
||||
},
|
||||
commit() {
|
||||
this.$refs['form'].validate((valid) => {
|
||||
if (valid) {
|
||||
let operate = {
|
||||
send: true,
|
||||
type: MapDeviceType.Train.type,
|
||||
operation: OperationEvent.Command.planTrain.translatPlanTrain.operation,
|
||||
}
|
||||
this.dialogShow = true;
|
||||
this.$nextTick(function () {
|
||||
this.$store.dispatch('training/emitTipFresh');
|
||||
});
|
||||
},
|
||||
doClose() {
|
||||
this.loading = false;
|
||||
this.dialogShow = false;
|
||||
this.$store.dispatch('training/emitTipFresh');
|
||||
},
|
||||
commit() {
|
||||
this.$refs['form'].validate((valid) => {
|
||||
if (valid) {
|
||||
const operate = {
|
||||
send: true,
|
||||
type: MapDeviceType.Train.type,
|
||||
operation: OperationEvent.Command.planTrain.translatPlanTrain.operation
|
||||
};
|
||||
|
||||
this.loading = true;
|
||||
this.$store.dispatch('training/next', operate).then(({ valid }) => {
|
||||
this.loading = false;
|
||||
if (valid) {
|
||||
this.doClose();
|
||||
} else {
|
||||
// this.$refs.noticeInfo.doShow(operate);
|
||||
}
|
||||
}).catch(error => {
|
||||
this.loading = false;
|
||||
this.doClose();
|
||||
// this.$refs.noticeInfo.doShow(operate);
|
||||
})
|
||||
} else {
|
||||
return false;
|
||||
}
|
||||
});
|
||||
},
|
||||
cancel() {
|
||||
let operate = {
|
||||
type: MapDeviceType.Train.type,
|
||||
operation: OperationEvent.Command.cancel.menu.operation,
|
||||
}
|
||||
this.loading = true;
|
||||
this.$store.dispatch('training/next', operate).then(({ valid }) => {
|
||||
this.loading = false;
|
||||
if (valid) {
|
||||
this.doClose();
|
||||
} else {
|
||||
// this.$refs.noticeInfo.doShow(operate);
|
||||
}
|
||||
}).catch(() => {
|
||||
this.loading = false;
|
||||
this.doClose();
|
||||
// this.$refs.noticeInfo.doShow(operate);
|
||||
});
|
||||
} else {
|
||||
return false;
|
||||
}
|
||||
});
|
||||
},
|
||||
cancel() {
|
||||
const operate = {
|
||||
type: MapDeviceType.Train.type,
|
||||
operation: OperationEvent.Command.cancel.menu.operation
|
||||
};
|
||||
|
||||
this.$store.dispatch('training/next', operate).then(({ valid }) => {
|
||||
if (valid) {
|
||||
this.doClose();
|
||||
}
|
||||
}).catch(error => { this.doClose(); });
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
this.$store.dispatch('training/next', operate).then(({ valid }) => {
|
||||
if (valid) {
|
||||
this.doClose();
|
||||
}
|
||||
}).catch(() => { this.doClose(); });
|
||||
}
|
||||
}
|
||||
};
|
||||
</script>
|
||||
|
@ -1,158 +1,166 @@
|
||||
<template>
|
||||
<el-dialog class="fuzhou-01__systerm view-display" :title="$t('menu.menuDialog.deviceDisplaySettings')" :visible.sync="show" width="340px"
|
||||
:before-close="doClose" :zIndex="2000" :modal="false" :close-on-click-modal="false" v-dialogDrag>
|
||||
<el-checkbox-group v-model="deviceLevels">
|
||||
<div>
|
||||
<el-checkbox :label="1">{{$t('menu.menuDialog.trainWindow')}}</el-checkbox>
|
||||
</div>
|
||||
<div>
|
||||
<el-checkbox :label="2">{{$t('menu.menuDialog.sectionBoundary')}}</el-checkbox>
|
||||
</div>
|
||||
<div>
|
||||
<el-checkbox :label="3">{{$t('menu.menuDialog.linkageAutoRouteShow')}}</el-checkbox>
|
||||
</div>
|
||||
<div>
|
||||
<el-checkbox :label="4">{{$t('menu.menuDialog.atsAutoTriggerShow')}}</el-checkbox>
|
||||
</div>
|
||||
</el-checkbox-group>
|
||||
<el-row class="button-group">
|
||||
<el-col :span="8" :offset="2">
|
||||
<el-button class="commit" :id="domIdConfirm" type="primary" :loading="loading" @click="commit">{{$t('menu.menuDialog.confirm')}}
|
||||
</el-button>
|
||||
</el-col>
|
||||
<el-col :span="8" :offset="3">
|
||||
<el-button class="cancal" :id="domIdCancel" @click="cancel">{{$t('menu.menuDialog.cancel')}}</el-button>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<notice-info ref="noticeInfo"></notice-info>
|
||||
</el-dialog>
|
||||
<el-dialog
|
||||
v-dialogDrag
|
||||
class="fuzhou-01__systerm view-display"
|
||||
:title="$t('menu.menuDialog.deviceDisplaySettings')"
|
||||
:visible.sync="show"
|
||||
width="340px"
|
||||
:before-close="doClose"
|
||||
:z-index="2000"
|
||||
:modal="false"
|
||||
:close-on-click-modal="false"
|
||||
>
|
||||
<el-checkbox-group v-model="deviceLevels">
|
||||
<div>
|
||||
<el-checkbox :label="1">{{ $t('menu.menuDialog.trainWindow') }}</el-checkbox>
|
||||
</div>
|
||||
<div>
|
||||
<el-checkbox :label="2">{{ $t('menu.menuDialog.sectionBoundary') }}</el-checkbox>
|
||||
</div>
|
||||
<div>
|
||||
<el-checkbox :label="3">{{ $t('menu.menuDialog.linkageAutoRouteShow') }}</el-checkbox>
|
||||
</div>
|
||||
<div>
|
||||
<el-checkbox :label="4">{{ $t('menu.menuDialog.atsAutoTriggerShow') }}</el-checkbox>
|
||||
</div>
|
||||
</el-checkbox-group>
|
||||
<el-row class="button-group">
|
||||
<el-col :span="8" :offset="2">
|
||||
<el-button :id="domIdConfirm" class="commit" type="primary" :loading="loading" @click="commit">{{ $t('menu.menuDialog.confirm') }}
|
||||
</el-button>
|
||||
</el-col>
|
||||
<el-col :span="8" :offset="3">
|
||||
<el-button :id="domIdCancel" class="cancal" @click="cancel">{{ $t('menu.menuDialog.cancel') }}</el-button>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<notice-info ref="noticeInfo" />
|
||||
</el-dialog>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import { OperationEvent, checkOperationIsCurrentOperate } from '@/scripts/ConstDic';
|
||||
import deviceType from '@/jmap/constant/deviceType';
|
||||
import NoticeInfo from '../dialog/childDialog/childDialog/noticeInfo';
|
||||
import { OperationEvent } from '@/scripts/ConstDic';
|
||||
import NoticeInfo from '../dialog/childDialog/childDialog/noticeInfo';
|
||||
|
||||
export default {
|
||||
name: 'ViewDevice',
|
||||
data() {
|
||||
return {
|
||||
dialogShow: false,
|
||||
loading: false,
|
||||
operate: null,
|
||||
operation: '',
|
||||
deviceLevels: [2, 3, 4, 5],
|
||||
}
|
||||
},
|
||||
components: {
|
||||
NoticeInfo
|
||||
},
|
||||
computed: {
|
||||
show() {
|
||||
return this.dialogShow && !this.$store.state.menuOperation.break;
|
||||
},
|
||||
domIdCancel() {
|
||||
return this.dialogShow ? OperationEvent.Command.cancel.menu.domId : '';
|
||||
},
|
||||
domIdConfirm() {
|
||||
return this.dialogShow ? OperationEvent.Command.close.confirm.domId : '';
|
||||
}
|
||||
export default {
|
||||
name: 'ViewDevice',
|
||||
components: {
|
||||
NoticeInfo
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
dialogShow: false,
|
||||
loading: false,
|
||||
operate: null,
|
||||
operation: '',
|
||||
deviceLevels: [2, 3, 4, 5]
|
||||
};
|
||||
},
|
||||
computed: {
|
||||
show() {
|
||||
return this.dialogShow && !this.$store.state.menuOperation.break;
|
||||
},
|
||||
domIdCancel() {
|
||||
return this.dialogShow ? OperationEvent.Command.cancel.menu.domId : '';
|
||||
},
|
||||
domIdConfirm() {
|
||||
return this.dialogShow ? OperationEvent.Command.close.confirm.domId : '';
|
||||
}
|
||||
|
||||
},
|
||||
mounted() {
|
||||
this.$nextTick(() => {
|
||||
this.setDeviceDisplay();
|
||||
this.$store.dispatch('training/tipReload');
|
||||
})
|
||||
},
|
||||
methods: {
|
||||
doShow(operate) {
|
||||
//如果不是断点激活,而是第一次显示,需要初始化数据
|
||||
if (!this.dialogShow) {
|
||||
this.operate = operate || {};
|
||||
this.operation = operate.operation;
|
||||
}
|
||||
},
|
||||
mounted() {
|
||||
this.$nextTick(() => {
|
||||
this.setDeviceDisplay();
|
||||
this.$store.dispatch('training/tipReload');
|
||||
});
|
||||
},
|
||||
methods: {
|
||||
doShow(operate) {
|
||||
// 如果不是断点激活,而是第一次显示,需要初始化数据
|
||||
if (!this.dialogShow) {
|
||||
this.operate = operate || {};
|
||||
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('training/emitTipFresh');
|
||||
},
|
||||
cancel() {
|
||||
let operate = {
|
||||
type: this.operate.type,
|
||||
operation: OperationEvent.Command.cancel.menu.operation,
|
||||
}
|
||||
this.dialogShow = true;
|
||||
this.$nextTick(function () {
|
||||
this.$store.dispatch('training/emitTipFresh');
|
||||
});
|
||||
},
|
||||
doClose() {
|
||||
this.loading = false;
|
||||
this.dialogShow = false;
|
||||
this.$store.dispatch('training/emitTipFresh');
|
||||
},
|
||||
cancel() {
|
||||
const operate = {
|
||||
type: this.operate.type,
|
||||
operation: OperationEvent.Command.cancel.menu.operation
|
||||
};
|
||||
|
||||
this.$store.dispatch('training/next', operate).then(({ valid }) => {
|
||||
if (valid) {
|
||||
this.doClose();
|
||||
}
|
||||
})
|
||||
},
|
||||
commit() {
|
||||
let operate = {
|
||||
over: true,
|
||||
type: this.operate.type,
|
||||
operation: OperationEvent.Command.close.confirm.operation,
|
||||
val: this.deviceLevels.sort().join('::')
|
||||
}
|
||||
this.$store.dispatch('training/next', operate).then(({ valid }) => {
|
||||
if (valid) {
|
||||
this.doClose();
|
||||
}
|
||||
});
|
||||
},
|
||||
commit() {
|
||||
const operate = {
|
||||
over: true,
|
||||
type: this.operate.type,
|
||||
operation: OperationEvent.Command.close.confirm.operation,
|
||||
val: this.deviceLevels.sort().join('::')
|
||||
};
|
||||
|
||||
this.loading = true;
|
||||
this.$store.dispatch('training/next', operate).then(({ valid }) => {
|
||||
this.loading = false;
|
||||
if (valid) {
|
||||
this.doClose();
|
||||
this.setDeviceDisplay();
|
||||
}
|
||||
}).catch(error => {
|
||||
this.loading = false;
|
||||
})
|
||||
},
|
||||
setDeviceDisplay() {
|
||||
let deviceList = [];
|
||||
this.loading = true;
|
||||
this.$store.dispatch('training/next', operate).then(({ valid }) => {
|
||||
this.loading = false;
|
||||
if (valid) {
|
||||
this.doClose();
|
||||
this.setDeviceDisplay();
|
||||
}
|
||||
}).catch(() => {
|
||||
this.loading = false;
|
||||
});
|
||||
},
|
||||
setDeviceDisplay() {
|
||||
const deviceList = [];
|
||||
|
||||
//区段边界设置
|
||||
let borderBorderShow = this.deviceLevels.indexOf(2) !== -1 ? true : false;
|
||||
let sectionList = this.$store.getters['map/sectionList'];
|
||||
if (sectionList && sectionList.length > 0) {
|
||||
sectionList.forEach(elem => {
|
||||
//区段边界
|
||||
deviceList.push(Object.assign(this.$jlmap.getDeviceByCode(elem.code), {borderBorderShow }));
|
||||
});
|
||||
}
|
||||
// 区段边界设置
|
||||
const borderBorderShow = this.deviceLevels.indexOf(2) !== -1;
|
||||
const sectionList = this.$store.getters['map/sectionList'];
|
||||
if (sectionList && sectionList.length > 0) {
|
||||
sectionList.forEach(elem => {
|
||||
// 区段边界
|
||||
deviceList.push(Object.assign(this.$jlmap.getDeviceByCode(elem.code), {borderBorderShow }));
|
||||
});
|
||||
}
|
||||
|
||||
//车次窗设置
|
||||
let trainWindowShow = this.deviceLevels.indexOf(1) !== -1 ? true : false;
|
||||
let trainWindowList = this.$store.getters['map/trainWindowList'];
|
||||
if (trainWindowList && trainWindowList.length > 0) {
|
||||
trainWindowList.forEach(elem => {
|
||||
//车次窗
|
||||
deviceList.push(Object.assign(this.$jlmap.getDeviceByCode(elem.code), {trainWindowShow }));
|
||||
});
|
||||
}
|
||||
// 车次窗设置
|
||||
const trainWindowShow = this.deviceLevels.indexOf(1) !== -1;
|
||||
const trainWindowList = this.$store.getters['map/trainWindowList'];
|
||||
if (trainWindowList && trainWindowList.length > 0) {
|
||||
trainWindowList.forEach(elem => {
|
||||
// 车次窗
|
||||
deviceList.push(Object.assign(this.$jlmap.getDeviceByCode(elem.code), {trainWindowShow }));
|
||||
});
|
||||
}
|
||||
|
||||
//联锁自动进路表示灯和ATS自动触发表示灯设置
|
||||
let linkageAutoRouteShow = this.deviceLevels.indexOf(3) !== -1 ? true : false; //联锁自动进路表示灯
|
||||
let atsAutoTriggerShow = this.deviceLevels.indexOf(4) !== -1 ? true : false; //ATS自动触发表示灯
|
||||
let signalList = this.$store.getters['map/signalList'];
|
||||
if (signalList && signalList.length > 0) {
|
||||
signalList.forEach(elem => {
|
||||
deviceList.push(Object.assign(this.$jlmap.getDeviceByCode(elem.code), { linkageAutoRouteShow, atsAutoTriggerShow }));
|
||||
})
|
||||
}
|
||||
// 联锁自动进路表示灯和ATS自动触发表示灯设置
|
||||
const linkageAutoRouteShow = this.deviceLevels.indexOf(3) !== -1; // 联锁自动进路表示灯
|
||||
const atsAutoTriggerShow = this.deviceLevels.indexOf(4) !== -1; // ATS自动触发表示灯
|
||||
const signalList = this.$store.getters['map/signalList'];
|
||||
if (signalList && signalList.length > 0) {
|
||||
signalList.forEach(elem => {
|
||||
deviceList.push(Object.assign(this.$jlmap.getDeviceByCode(elem.code), { linkageAutoRouteShow, atsAutoTriggerShow }));
|
||||
});
|
||||
}
|
||||
|
||||
this.$store.dispatch('map/updateMapDevices', deviceList);
|
||||
}
|
||||
}
|
||||
}
|
||||
this.$store.dispatch('map/updateMapDevices', deviceList);
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
</script>
|
||||
<style rel="stylesheet/scss" lang="scss" scoped>
|
||||
@import "src/styles/mixin.scss";
|
||||
</style>
|
||||
</style>
|
||||
|
@ -13,59 +13,59 @@
|
||||
<el-checkbox-group v-model="nameLevels">
|
||||
<el-row>
|
||||
<el-col :span="10">
|
||||
<el-checkbox :label="1">{{$t('menu.menuDialog.signalName')}}</el-checkbox>
|
||||
<el-checkbox :label="1">{{ $t('menu.menuDialog.signalName') }}</el-checkbox>
|
||||
</el-col>
|
||||
<el-col :span="10" :offset="4">
|
||||
<el-checkbox :label="2">{{$t('menu.menuDialog.standTrackName')}}</el-checkbox>
|
||||
<el-checkbox :label="2">{{ $t('menu.menuDialog.standTrackName') }}</el-checkbox>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<el-row>
|
||||
<el-col :span="10">
|
||||
<el-checkbox :label="3" disabled>{{$t('menu.menuDialog.buttonName')}}</el-checkbox>
|
||||
<el-checkbox :label="3" disabled>{{ $t('menu.menuDialog.buttonName') }}</el-checkbox>
|
||||
</el-col>
|
||||
<el-col :span="10" :offset="4">
|
||||
<el-checkbox :label="4">{{$t('menu.menuDialog.reentryTrackName')}}</el-checkbox>
|
||||
<el-checkbox :label="4">{{ $t('menu.menuDialog.reentryTrackName') }}</el-checkbox>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<el-row>
|
||||
<el-col :span="10">
|
||||
<el-checkbox :label="5">{{$t('menu.menuDialog.trackName')}}</el-checkbox>
|
||||
<el-checkbox :label="5">{{ $t('menu.menuDialog.trackName') }}</el-checkbox>
|
||||
</el-col>
|
||||
<el-col :span="10" :offset="4">
|
||||
<el-checkbox dio :label="6">{{$t('menu.menuDialog.transferTrackName')}}</el-checkbox>
|
||||
<el-checkbox dio :label="6">{{ $t('menu.menuDialog.transferTrackName') }}</el-checkbox>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<el-row>
|
||||
<el-col :span="10">
|
||||
<el-checkbox :label="7">{{$t('menu.menuDialog.turnoutName')}}</el-checkbox>
|
||||
<el-checkbox :label="7">{{ $t('menu.menuDialog.turnoutName') }}</el-checkbox>
|
||||
</el-col>
|
||||
<el-col :span="10" :offset="4">
|
||||
<el-checkbox dio :label="8">{{$t('menu.menuDialog.indicatorName')}}</el-checkbox>
|
||||
<el-checkbox dio :label="8">{{ $t('menu.menuDialog.indicatorName') }}</el-checkbox>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<el-row>
|
||||
<el-col :span="10">
|
||||
<el-checkbox :label="9">{{$t('menu.menuDialog.turnoutSectionName')}}</el-checkbox>
|
||||
<el-checkbox :label="9">{{ $t('menu.menuDialog.turnoutSectionName') }}</el-checkbox>
|
||||
</el-col>
|
||||
<el-col :span="10" :offset="4">
|
||||
<el-checkbox dio :label="10">{{$t('menu.menuDialog.destinationName')}}</el-checkbox>
|
||||
<el-checkbox dio :label="10">{{ $t('menu.menuDialog.destinationName') }}</el-checkbox>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<el-row>
|
||||
<el-col :span="10">
|
||||
<el-checkbox :label="11">{{$t('menu.menuDialog.axisSectionName')}}</el-checkbox>
|
||||
<el-checkbox :label="11">{{ $t('menu.menuDialog.axisSectionName') }}</el-checkbox>
|
||||
</el-col>
|
||||
<el-col :span="10" :offset="4">
|
||||
<el-checkbox dio :label="12">{{$t('menu.menuDialog.kmPost')}}</el-checkbox>
|
||||
<el-checkbox dio :label="12">{{ $t('menu.menuDialog.kmPost') }}</el-checkbox>
|
||||
</el-col>
|
||||
</el-row>
|
||||
</el-checkbox-group>
|
||||
<el-row class="button-group">
|
||||
<el-col :span="6" :offset="2">
|
||||
<el-button :id="domIdConfirm" type="primary" :loading="loading" @click="commit">{{$t('menu.menuDialog.confirm')}}</el-button>
|
||||
<el-button :id="domIdConfirm" type="primary" :loading="loading" @click="commit">{{ $t('menu.menuDialog.confirm') }}</el-button>
|
||||
</el-col>
|
||||
<el-col :span="4" :offset="8">
|
||||
<el-button :id="domIdCancel" @click="cancel">{{$t('menu.menuDialog.cancel')}}</el-button>
|
||||
<el-button :id="domIdCancel" @click="cancel">{{ $t('menu.menuDialog.cancel') }}</el-button>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<notice-info ref="noticeInfo" />
|
||||
@ -126,7 +126,7 @@ export default {
|
||||
this.$store.dispatch('training/emitTipFresh');
|
||||
},
|
||||
cancel() {
|
||||
let operate = {
|
||||
const operate = {
|
||||
type: this.operate.type,
|
||||
operation: OperationEvent.Command.cancel.menu.operation
|
||||
};
|
||||
@ -138,7 +138,7 @@ export default {
|
||||
});
|
||||
},
|
||||
commit() {
|
||||
let operate = {
|
||||
const operate = {
|
||||
over: true,
|
||||
type: this.operate.type,
|
||||
operation: OperationEvent.Command.close.confirm.operation,
|
||||
@ -157,24 +157,21 @@ export default {
|
||||
});
|
||||
},
|
||||
setNameDisplay() {
|
||||
let deviceList = [];
|
||||
const deviceList = [];
|
||||
|
||||
// 信号机
|
||||
let nameShow = this.nameLevels.indexOf(1) !== -1;
|
||||
let signalList = this.$store.getters['map/signalList'];
|
||||
const signalList = this.$store.getters['map/signalList'];
|
||||
if (signalList && signalList.length > 0) {
|
||||
signalList.forEach(elem => {
|
||||
deviceList.push(Object.assign(this.$jlmap.getDeviceByCode(elem.code), { nameShow }));
|
||||
});
|
||||
}
|
||||
|
||||
// 按钮名称
|
||||
let show = this.nameLevels.indexOf(3) !== -1;
|
||||
|
||||
// 道岔
|
||||
nameShow = this.nameLevels.indexOf(7) !== -1; // 道岔名称
|
||||
let switchSectionNameShow = this.nameLevels.indexOf(9) !== -1; // 道岔轨名称
|
||||
let switchList = this.$store.getters['map/switchList'];
|
||||
const switchSectionNameShow = this.nameLevels.indexOf(9) !== -1; // 道岔轨名称
|
||||
const switchList = this.$store.getters['map/switchList'];
|
||||
if (switchList && switchList.length > 0) {
|
||||
switchList.forEach(elem => {
|
||||
deviceList.push(Object.assign(this.$jlmap.getDeviceByCode(elem.code), {nameShow, switchSectionNameShow }));
|
||||
@ -182,8 +179,8 @@ export default {
|
||||
}
|
||||
|
||||
// 控制模式
|
||||
let indicatorShow = this.nameLevels.indexOf(8) !== -1;
|
||||
let control = this.$store.getters['map/stationControlList'];
|
||||
const indicatorShow = this.nameLevels.indexOf(8) !== -1;
|
||||
const control = this.$store.getters['map/stationControlList'];
|
||||
if (control && control.length > 0) {
|
||||
control.forEach(elem => {
|
||||
// 标识灯名称
|
||||
@ -196,7 +193,7 @@ export default {
|
||||
let standTrackNameShow = false;
|
||||
let reentryTrackNameShow = false;
|
||||
let transferTrackNameShow = false;
|
||||
let sectionList = this.$store.getters['map/sectionList'];
|
||||
const sectionList = this.$store.getters['map/sectionList'];
|
||||
if (sectionList && sectionList.length > 0) {
|
||||
sectionList.forEach(elem => {
|
||||
elem._type = deviceType.Section;
|
||||
@ -231,13 +228,13 @@ export default {
|
||||
transferTrackNameShow = this.nameLevels.indexOf(6) !== -1;
|
||||
}
|
||||
|
||||
deviceList.push(Object.assign(this.$jlmap.getDeviceByCode(elem.code), { nameShow, standTrackNameShow, reentryTrackNameShow, transferTrackNameShow }));
|
||||
deviceList.push(Object.assign(this.$jlmap.getDeviceByCode(elem.code), { nameShow, standTrackNameShow, reentryTrackNameShow, transferTrackNameShow }));
|
||||
});
|
||||
}
|
||||
|
||||
// 车站
|
||||
let kmPostShow = this.nameLevels.indexOf(12) !== -1;
|
||||
let stationList = this.$store.getters['map/stationList'];
|
||||
const kmPostShow = this.nameLevels.indexOf(12) !== -1;
|
||||
const stationList = this.$store.getters['map/stationList'];
|
||||
if (stationList && stationList.length > 0) {
|
||||
stationList.forEach(elem => {
|
||||
deviceList.push(Object.assign(this.$jlmap.getDeviceByCode(elem.code), { kmPostShow })); // 公里标
|
||||
|
@ -11,64 +11,64 @@
|
||||
:close-on-click-modal="false"
|
||||
>
|
||||
<div style="padding: 10px 20px; border: 1px double lightgray;">
|
||||
<span class="base-label">{{$t('menu.menuDialog.plantrainDisplayMode')}}</span>
|
||||
<span class="base-label">{{ $t('menu.menuDialog.plantrainDisplayMode') }}</span>
|
||||
<el-radio-group v-model="planMode">
|
||||
<el-row>
|
||||
<el-col :span="10">
|
||||
<el-radio :label="1">{{$t('menu.menuDialog.serviceNumber')}} + {{$t('menu.menuDialog.tripNumber')}}</el-radio>
|
||||
<el-radio :label="1">{{ $t('menu.menuDialog.serviceNumber') }} + {{ $t('menu.menuDialog.tripNumber') }}</el-radio>
|
||||
</el-col>
|
||||
<el-col :span="10" :offset="4">
|
||||
<el-radio :label="2">{{$t('menu.menuDialog.serviceNumber')}} + {{$t('menu.menuDialog.groupNumber')}}</el-radio>
|
||||
<el-radio :label="2">{{ $t('menu.menuDialog.serviceNumber') }} + {{ $t('menu.menuDialog.groupNumber') }}</el-radio>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<el-row class="elrow">
|
||||
<el-col :span="10">
|
||||
<el-radio :label="3">{{$t('menu.menuDialog.targetNumber')}} + {{$t('menu.menuDialog.tripNumber')}}</el-radio>
|
||||
<el-radio :label="3">{{ $t('menu.menuDialog.targetNumber') }} + {{ $t('menu.menuDialog.tripNumber') }}</el-radio>
|
||||
</el-col>
|
||||
<el-col :span="10" :offset="4">
|
||||
<el-radio :label="4">{{$t('menu.menuDialog.targetNumber')}} + {{$t('menu.menuDialog.groupNumber')}}</el-radio>
|
||||
<el-radio :label="4">{{ $t('menu.menuDialog.targetNumber') }} + {{ $t('menu.menuDialog.groupNumber') }}</el-radio>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<el-row class="elrow">
|
||||
<el-col :span="10">
|
||||
<el-radio :label="5">{{$t('menu.menuDialog.targetNumber')}} + {{$t('menu.menuDialog.serviceNumber')}} + {{$t('menu.menuDialog.tripNumber')}}</el-radio>
|
||||
<el-radio :label="5">{{ $t('menu.menuDialog.targetNumber') }} + {{ $t('menu.menuDialog.serviceNumber') }} + {{ $t('menu.menuDialog.tripNumber') }}</el-radio>
|
||||
</el-col>
|
||||
<el-col :span="10" :offset="4">
|
||||
<el-radio :label="6">{{$t('menu.menuDialog.targetNumber')}} + {{$t('menu.menuDialog.serviceNumber')}} + {{$t('menu.menuDialog.groupNumber')}}</el-radio>
|
||||
<el-radio :label="6">{{ $t('menu.menuDialog.targetNumber') }} + {{ $t('menu.menuDialog.serviceNumber') }} + {{ $t('menu.menuDialog.groupNumber') }}</el-radio>
|
||||
</el-col>
|
||||
</el-row>
|
||||
</el-radio-group>
|
||||
</div>
|
||||
<div style="padding: 10px 20px; border: 1px double lightgray; margin: 20px 0px;">
|
||||
<span class="base-label">{{$t('menu.menuDialog.headCodeStationDisplayMode')}}</span>
|
||||
<span class="base-label">{{ $t('menu.menuDialog.headCodeStationDisplayMode') }}</span>
|
||||
<el-radio-group v-model="headMode">
|
||||
<el-row>
|
||||
<el-col :span="10">
|
||||
<el-radio :label="3">{{$t('menu.menuDialog.targetNumber')}} + {{$t('menu.menuDialog.tripNumber')}}</el-radio>
|
||||
<el-radio :label="3">{{ $t('menu.menuDialog.targetNumber') }} + {{ $t('menu.menuDialog.tripNumber') }}</el-radio>
|
||||
</el-col>
|
||||
<el-col :span="6" :offset="4">
|
||||
<el-radio :label="4">{{$t('menu.menuDialog.targetNumber')}} + {{$t('menu.menuDialog.groupNumber')}}</el-radio>
|
||||
<el-radio :label="4">{{ $t('menu.menuDialog.targetNumber') }} + {{ $t('menu.menuDialog.groupNumber') }}</el-radio>
|
||||
</el-col>
|
||||
</el-row>
|
||||
</el-radio-group>
|
||||
</div>
|
||||
<div style="padding: 10px 20px; border: 1px double lightgray;">
|
||||
<span class="base-label">{{$t('menu.menuDialog.fontSize')}}</span>
|
||||
<span class="base-label">{{ $t('menu.menuDialog.fontSize') }}</span>
|
||||
<el-row>
|
||||
<el-col :span="10">
|
||||
<el-input v-model="fontSize" size="small" min="16" max="99" />
|
||||
</el-col>
|
||||
<el-col :span="10" :offset="1">
|
||||
<span style="height:32px; line-height:32px;">{{$t('menu.menuDialog.range')}}</span>
|
||||
<span style="height:32px; line-height:32px;">{{ $t('menu.menuDialog.range') }}</span>
|
||||
</el-col>
|
||||
</el-row>
|
||||
</div>
|
||||
<el-row class="button-group">
|
||||
<el-col :span="6" :offset="2">
|
||||
<el-button :id="domIdConfirm" type="primary" :loading="loading" @click="commit">{{$t('menu.menuDialog.confirm')}}</el-button>
|
||||
<el-button :id="domIdConfirm" type="primary" :loading="loading" @click="commit">{{ $t('menu.menuDialog.confirm') }}</el-button>
|
||||
</el-col>
|
||||
<el-col :span="4" :offset="8">
|
||||
<el-button :id="domIdCancel" @click="cancel">{{$t('menu.menuDialog.cancel')}}</el-button>
|
||||
<el-button :id="domIdCancel" @click="cancel">{{ $t('menu.menuDialog.cancel') }}</el-button>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<notice-info ref="noticeInfo" />
|
||||
|
@ -1,404 +1,405 @@
|
||||
<template>
|
||||
<div>
|
||||
<pop-menu ref="popMenu" :menu="menu"></pop-menu>
|
||||
<section-control ref="sectionControl"></section-control>
|
||||
<section-cmd-control ref="sectionCmdControl"></section-cmd-control>
|
||||
<speed-cmd-control ref="speedCmdControl"></speed-cmd-control>
|
||||
<train-create ref="trainCreate"></train-create>
|
||||
<notice-info ref="noticeInfo"></notice-info>
|
||||
</div>
|
||||
<div>
|
||||
<pop-menu ref="popMenu" :menu="menu" />
|
||||
<section-control ref="sectionControl" />
|
||||
<section-cmd-control ref="sectionCmdControl" />
|
||||
<speed-cmd-control ref="speedCmdControl" />
|
||||
<train-create ref="trainCreate" />
|
||||
<notice-info ref="noticeInfo" />
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import PopMenu from '@/components/PopMenu';
|
||||
import SectionControl from './dialog/sectionControl';
|
||||
import SectionCmdControl from './dialog/sectionCmdControl';
|
||||
import SpeedCmdControl from './dialog/speedCmdControl';
|
||||
import TrainCreate from './dialog/trainCreate';
|
||||
import NoticeInfo from './dialog/childDialog/childDialog/noticeInfo'
|
||||
import { mapGetters } from 'vuex';
|
||||
import { TrainingMode, OperateMode } from '@/scripts/ConstDic';
|
||||
import { MapDeviceType, OperationEvent, DeviceMenu } from '@/scripts/ConstDic';
|
||||
import { MenuDisabledState, menuConvert, menuFiltration } from './utils/menuItemStatus';
|
||||
import PopMenu from '@/components/PopMenu';
|
||||
import SectionControl from './dialog/sectionControl';
|
||||
import SectionCmdControl from './dialog/sectionCmdControl';
|
||||
import SpeedCmdControl from './dialog/speedCmdControl';
|
||||
import TrainCreate from './dialog/trainCreate';
|
||||
import NoticeInfo from './dialog/childDialog/childDialog/noticeInfo';
|
||||
import { mapGetters } from 'vuex';
|
||||
import { OperateMode } from '@/scripts/ConstDic';
|
||||
import { MapDeviceType, OperationEvent, DeviceMenu } from '@/scripts/ConstDic';
|
||||
import { MenuDisabledState, menuConvert, menuFiltration } from './utils/menuItemStatus';
|
||||
|
||||
export default {
|
||||
name: 'SectionMenu',
|
||||
components: {
|
||||
PopMenu,
|
||||
SectionControl,
|
||||
SectionCmdControl,
|
||||
SpeedCmdControl,
|
||||
TrainCreate,
|
||||
NoticeInfo
|
||||
},
|
||||
props: {
|
||||
selected: {
|
||||
type: Object
|
||||
}
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
menu: [],
|
||||
menuNormal: {
|
||||
local: [
|
||||
{
|
||||
label: this.$t('menu.menuSection.sectionFaultUnlock'),
|
||||
handler: this.fault,
|
||||
disabledCallback: MenuDisabledState.Section.fault,
|
||||
auth: { station: true, center: false }
|
||||
},
|
||||
{
|
||||
label: this.$t('menu.menuSection.sectionResection'),
|
||||
handler: this.split,
|
||||
disabledCallback: MenuDisabledState.Section.split,
|
||||
auth: { station: true, center: false }
|
||||
},
|
||||
{
|
||||
label: this.$t('menu.menuSection.sectionActive'),
|
||||
handler: this.active,
|
||||
disabledCallback: MenuDisabledState.Section.active,
|
||||
auth: { station: true, center: false }
|
||||
},
|
||||
{
|
||||
label: this.$t('menu.menuSection.sectionAxisPreReset'),
|
||||
handler: this.axlePreReset,
|
||||
disabledCallback: MenuDisabledState.Section.axlePreReset,
|
||||
auth: { station: true, center: false }
|
||||
},
|
||||
{
|
||||
label: this.$t('menu.menuSection.sectionBlockade'),
|
||||
handler: this.lock,
|
||||
disabledCallback: MenuDisabledState.Section.lock,
|
||||
auth: { station: true, center: false }
|
||||
},
|
||||
{
|
||||
label: this.$t('menu.menuSection.sectionUnblock'),
|
||||
handler: this.unlock,
|
||||
disabledCallback: MenuDisabledState.Section.unlock,
|
||||
auth: { station: true, center: false }
|
||||
},
|
||||
{
|
||||
label: this.$t('menu.menuSection.sectionSetSpeedLimit'),
|
||||
handler: this.setSpeed,
|
||||
disabledCallback: MenuDisabledState.Section.setSpeed,
|
||||
auth: { station: true, center: false }
|
||||
},
|
||||
{
|
||||
label: this.$t('menu.menuSection.sectionCancelSpeedLimit'),
|
||||
handler: this.cancelSpeed,
|
||||
disabledCallback: MenuDisabledState.Section.cancelSpeed,
|
||||
auth: { station: true, center: false }
|
||||
}
|
||||
],
|
||||
central: [
|
||||
{
|
||||
label: this.$t('menu.menuSection.sectionFaultUnlock'),
|
||||
handler: this.fault,
|
||||
disabledCallback: MenuDisabledState.Section.fault,
|
||||
auth: { station: false, center: true }
|
||||
},
|
||||
{
|
||||
label: this.$t('menu.menuSection.sectionResection'),
|
||||
handler: this.split,
|
||||
disabledCallback: MenuDisabledState.Section.split,
|
||||
auth: { station: false, center: true }
|
||||
},
|
||||
{
|
||||
label: this.$t('menu.menuSection.sectionActive'),
|
||||
handler: this.active,
|
||||
disabledCallback: MenuDisabledState.Section.active,
|
||||
auth: { station: false, center: true }
|
||||
},
|
||||
{
|
||||
label: this.$t('menu.menuSection.axisPreReset') ,
|
||||
handler: this.axlePreReset,
|
||||
disabledCallback: MenuDisabledState.Section.axlePreReset,
|
||||
auth: { station: false, center: false }
|
||||
},
|
||||
{
|
||||
label: this.$t('menu.menuSection.sectionBlockade'),
|
||||
handler: this.lock,
|
||||
disabledCallback: MenuDisabledState.Section.lock,
|
||||
auth: { station: false, center: true }
|
||||
},
|
||||
{
|
||||
label: this.$t('menu.menuSection.sectionUnblock'),
|
||||
handler: this.unlock,
|
||||
disabledCallback: MenuDisabledState.Section.unlock,
|
||||
auth: { station: false, center: true }
|
||||
},
|
||||
{
|
||||
label: this.$t('menu.menuSection.sectionSetSpeedLimit'),
|
||||
handler: this.setSpeed,
|
||||
disabledCallback: MenuDisabledState.Section.setSpeed,
|
||||
auth: { station: false, center: true }
|
||||
},
|
||||
{
|
||||
label: this.$t('menu.menuSection.sectionCancelSpeedLimit'),
|
||||
handler: this.cancelSpeed,
|
||||
disabledCallback: MenuDisabledState.Section.cancelSpeed,
|
||||
auth: { station: false, center: true }
|
||||
}
|
||||
]
|
||||
},
|
||||
menuTrain: [
|
||||
{
|
||||
label: this.$t('menu.menuSection.createTrain'),
|
||||
handler: this.newTrain,
|
||||
disabledCallback: MenuDisabledState.Section.newTrain
|
||||
},
|
||||
],
|
||||
menuForce: [
|
||||
{
|
||||
label: this.$t('menu.menuSection.setFault'),
|
||||
handler: this.setStoppage,
|
||||
disabledCallback: MenuDisabledState.Section.setStoppage
|
||||
},
|
||||
{
|
||||
label: this.$t('menu.menuSection.cancelFault'),
|
||||
handler: this.cancelStoppage,
|
||||
disabledCallback: MenuDisabledState.Section.cancelStoppage
|
||||
}
|
||||
]
|
||||
}
|
||||
},
|
||||
watch: {
|
||||
'$store.state.menuOperation.menuCount': function (val) {
|
||||
if (this.$store.getters['menuOperation/checkDialogIsOpen'](DeviceMenu.Section) && !this.buttonOperation) {
|
||||
this.doShow(this.$store.state.menuOperation.menuPosition);
|
||||
} else {
|
||||
this.doClose();
|
||||
}
|
||||
}
|
||||
},
|
||||
computed: {
|
||||
...mapGetters('training', [
|
||||
'mode',
|
||||
'operatemode'
|
||||
]),
|
||||
...mapGetters('menuOperation', [
|
||||
'buttonOperation'
|
||||
])
|
||||
},
|
||||
methods: {
|
||||
clickEvent() {
|
||||
let self = this;
|
||||
window.onclick = function (e) {
|
||||
self.doClose();
|
||||
}
|
||||
},
|
||||
initMenu() {
|
||||
//编辑模式菜单列表
|
||||
this.menu = menuFiltration(this.menuNormal);
|
||||
if (this.operatemode === OperateMode.ADMIN) {
|
||||
this.menu = [...this.menu, ...this.menuForce, ...this.menuTrain]
|
||||
}
|
||||
export default {
|
||||
name: 'SectionMenu',
|
||||
components: {
|
||||
PopMenu,
|
||||
SectionControl,
|
||||
SectionCmdControl,
|
||||
SpeedCmdControl,
|
||||
TrainCreate,
|
||||
NoticeInfo
|
||||
},
|
||||
props: {
|
||||
selected: {
|
||||
type: Object,
|
||||
required: true
|
||||
}
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
menu: [],
|
||||
menuNormal: {
|
||||
local: [
|
||||
{
|
||||
label: this.$t('menu.menuSection.sectionFaultUnlock'),
|
||||
handler: this.fault,
|
||||
disabledCallback: MenuDisabledState.Section.fault,
|
||||
auth: { station: true, center: false }
|
||||
},
|
||||
{
|
||||
label: this.$t('menu.menuSection.sectionResection'),
|
||||
handler: this.split,
|
||||
disabledCallback: MenuDisabledState.Section.split,
|
||||
auth: { station: true, center: false }
|
||||
},
|
||||
{
|
||||
label: this.$t('menu.menuSection.sectionActive'),
|
||||
handler: this.active,
|
||||
disabledCallback: MenuDisabledState.Section.active,
|
||||
auth: { station: true, center: false }
|
||||
},
|
||||
{
|
||||
label: this.$t('menu.menuSection.sectionAxisPreReset'),
|
||||
handler: this.axlePreReset,
|
||||
disabledCallback: MenuDisabledState.Section.axlePreReset,
|
||||
auth: { station: true, center: false }
|
||||
},
|
||||
{
|
||||
label: this.$t('menu.menuSection.sectionBlockade'),
|
||||
handler: this.lock,
|
||||
disabledCallback: MenuDisabledState.Section.lock,
|
||||
auth: { station: true, center: false }
|
||||
},
|
||||
{
|
||||
label: this.$t('menu.menuSection.sectionUnblock'),
|
||||
handler: this.unlock,
|
||||
disabledCallback: MenuDisabledState.Section.unlock,
|
||||
auth: { station: true, center: false }
|
||||
},
|
||||
{
|
||||
label: this.$t('menu.menuSection.sectionSetSpeedLimit'),
|
||||
handler: this.setSpeed,
|
||||
disabledCallback: MenuDisabledState.Section.setSpeed,
|
||||
auth: { station: true, center: false }
|
||||
},
|
||||
{
|
||||
label: this.$t('menu.menuSection.sectionCancelSpeedLimit'),
|
||||
handler: this.cancelSpeed,
|
||||
disabledCallback: MenuDisabledState.Section.cancelSpeed,
|
||||
auth: { station: true, center: false }
|
||||
}
|
||||
],
|
||||
central: [
|
||||
{
|
||||
label: this.$t('menu.menuSection.sectionFaultUnlock'),
|
||||
handler: this.fault,
|
||||
disabledCallback: MenuDisabledState.Section.fault,
|
||||
auth: { station: false, center: true }
|
||||
},
|
||||
{
|
||||
label: this.$t('menu.menuSection.sectionResection'),
|
||||
handler: this.split,
|
||||
disabledCallback: MenuDisabledState.Section.split,
|
||||
auth: { station: false, center: true }
|
||||
},
|
||||
{
|
||||
label: this.$t('menu.menuSection.sectionActive'),
|
||||
handler: this.active,
|
||||
disabledCallback: MenuDisabledState.Section.active,
|
||||
auth: { station: false, center: true }
|
||||
},
|
||||
{
|
||||
label: this.$t('menu.menuSection.axisPreReset'),
|
||||
handler: this.axlePreReset,
|
||||
disabledCallback: MenuDisabledState.Section.axlePreReset,
|
||||
auth: { station: false, center: false }
|
||||
},
|
||||
{
|
||||
label: this.$t('menu.menuSection.sectionBlockade'),
|
||||
handler: this.lock,
|
||||
disabledCallback: MenuDisabledState.Section.lock,
|
||||
auth: { station: false, center: true }
|
||||
},
|
||||
{
|
||||
label: this.$t('menu.menuSection.sectionUnblock'),
|
||||
handler: this.unlock,
|
||||
disabledCallback: MenuDisabledState.Section.unlock,
|
||||
auth: { station: false, center: true }
|
||||
},
|
||||
{
|
||||
label: this.$t('menu.menuSection.sectionSetSpeedLimit'),
|
||||
handler: this.setSpeed,
|
||||
disabledCallback: MenuDisabledState.Section.setSpeed,
|
||||
auth: { station: false, center: true }
|
||||
},
|
||||
{
|
||||
label: this.$t('menu.menuSection.sectionCancelSpeedLimit'),
|
||||
handler: this.cancelSpeed,
|
||||
disabledCallback: MenuDisabledState.Section.cancelSpeed,
|
||||
auth: { station: false, center: true }
|
||||
}
|
||||
]
|
||||
},
|
||||
menuTrain: [
|
||||
{
|
||||
label: this.$t('menu.menuSection.createTrain'),
|
||||
handler: this.newTrain,
|
||||
disabledCallback: MenuDisabledState.Section.newTrain
|
||||
}
|
||||
],
|
||||
menuForce: [
|
||||
{
|
||||
label: this.$t('menu.menuSection.setFault'),
|
||||
handler: this.setStoppage,
|
||||
disabledCallback: MenuDisabledState.Section.setStoppage
|
||||
},
|
||||
{
|
||||
label: this.$t('menu.menuSection.cancelFault'),
|
||||
handler: this.cancelStoppage,
|
||||
disabledCallback: MenuDisabledState.Section.cancelStoppage
|
||||
}
|
||||
]
|
||||
};
|
||||
},
|
||||
computed: {
|
||||
...mapGetters('training', [
|
||||
'mode',
|
||||
'operatemode'
|
||||
]),
|
||||
...mapGetters('menuOperation', [
|
||||
'buttonOperation'
|
||||
])
|
||||
},
|
||||
watch: {
|
||||
'$store.state.menuOperation.menuCount': function (val) {
|
||||
if (this.$store.getters['menuOperation/checkDialogIsOpen'](DeviceMenu.Section) && !this.buttonOperation) {
|
||||
this.doShow(this.$store.state.menuOperation.menuPosition);
|
||||
} else {
|
||||
this.doClose();
|
||||
}
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
clickEvent() {
|
||||
const self = this;
|
||||
window.onclick = function (e) {
|
||||
self.doClose();
|
||||
};
|
||||
},
|
||||
initMenu() {
|
||||
// 编辑模式菜单列表
|
||||
this.menu = menuFiltration(this.menuNormal);
|
||||
if (this.operatemode === OperateMode.ADMIN) {
|
||||
this.menu = [...this.menu, ...this.menuForce, ...this.menuTrain];
|
||||
}
|
||||
|
||||
//故障模式菜单列表
|
||||
if (this.operatemode === OperateMode.FAULT) {
|
||||
this.menu = this.menuForce
|
||||
}
|
||||
// 故障模式菜单列表
|
||||
if (this.operatemode === OperateMode.FAULT) {
|
||||
this.menu = this.menuForce;
|
||||
}
|
||||
|
||||
this.menu = menuConvert(this.menu);
|
||||
},
|
||||
doShow(point) {
|
||||
this.clickEvent();
|
||||
this.initMenu();
|
||||
if (this.$refs && this.$refs.popMenu && this.menu && this.menu.length) {
|
||||
this.$refs.popMenu.resetShowPosition(point);
|
||||
}
|
||||
},
|
||||
doClose() {
|
||||
if (this.$refs && this.$refs.popMenu) {
|
||||
this.$refs.popMenu.close();
|
||||
}
|
||||
},
|
||||
//设置故障
|
||||
setStoppage() {
|
||||
let operate = {
|
||||
start: true,
|
||||
send: true,
|
||||
code: this.selected.code,
|
||||
type: MapDeviceType.Section.type,
|
||||
label: MapDeviceType.Section.label,
|
||||
operation: OperationEvent.Section.stoppage.menu.operation
|
||||
};
|
||||
this.$store.dispatch('training/next', operate).then(({ valid }) => {
|
||||
if (valid) {
|
||||
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
|
||||
} else {
|
||||
this.$refs.noticeInfo.doShow(operate);
|
||||
}
|
||||
}).catch(error => {
|
||||
this.$refs.noticeInfo.doShow(operate);
|
||||
})
|
||||
},
|
||||
//取消故障
|
||||
cancelStoppage() {
|
||||
let operate = {
|
||||
start: true,
|
||||
send: true,
|
||||
code: this.selected.code,
|
||||
type: MapDeviceType.Section.type,
|
||||
label: MapDeviceType.Section.label,
|
||||
operation: OperationEvent.Section.cancelStoppage.menu.operation
|
||||
};
|
||||
this.$store.dispatch('training/next', operate).then(({ valid }) => {
|
||||
if (valid) {
|
||||
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
|
||||
} else {
|
||||
this.$refs.noticeInfo.doShow(operate);
|
||||
}
|
||||
}).catch(error => {
|
||||
this.$refs.noticeInfo.doShow(operate);
|
||||
})
|
||||
},
|
||||
//故障解锁
|
||||
fault() {
|
||||
let operate = {
|
||||
start: true,
|
||||
code: this.selected.code,
|
||||
type: MapDeviceType.Section.type,
|
||||
label: MapDeviceType.Section.label,
|
||||
operation: OperationEvent.Section.fault.menu.operation
|
||||
};
|
||||
this.$store.dispatch('training/next', operate).then(({ valid }) => {
|
||||
if (valid) {
|
||||
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
|
||||
this.$refs.sectionCmdControl.doShow(operate, this.selected);
|
||||
}
|
||||
});
|
||||
},
|
||||
//切除
|
||||
split() {
|
||||
let operate = {
|
||||
start: true,
|
||||
code: this.selected.code,
|
||||
type: MapDeviceType.Section.type,
|
||||
label: MapDeviceType.Section.label,
|
||||
operation: OperationEvent.Section.split.menu.operation
|
||||
};
|
||||
this.$store.dispatch('training/next', operate).then(({ valid }) => {
|
||||
if (valid) {
|
||||
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
|
||||
this.$refs.sectionControl.doShow(operate, this.selected);
|
||||
}
|
||||
});
|
||||
},
|
||||
//激活
|
||||
active() {
|
||||
let operate = {
|
||||
start: true,
|
||||
code: this.selected.code,
|
||||
type: MapDeviceType.Section.type,
|
||||
label: MapDeviceType.Section.label,
|
||||
operation: OperationEvent.Section.active.menu.operation
|
||||
};
|
||||
this.$store.dispatch('training/next', operate).then(({ valid }) => {
|
||||
if (valid) {
|
||||
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
|
||||
this.$refs.sectionControl.doShow(operate, this.selected);
|
||||
}
|
||||
});
|
||||
},
|
||||
//区段计轴预复位
|
||||
axlePreReset() {
|
||||
let operate = {
|
||||
start: true,
|
||||
code: this.selected.code,
|
||||
type: MapDeviceType.Section.type,
|
||||
label: MapDeviceType.Section.label,
|
||||
operation: OperationEvent.Section.axlePreReset.menu.operation
|
||||
};
|
||||
this.$store.dispatch('training/next', operate).then(({ valid }) => {
|
||||
if (valid) {
|
||||
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
|
||||
this.$refs.sectionCmdControl.doShow(operate, this.selected);
|
||||
}
|
||||
});
|
||||
},
|
||||
//区段解锁
|
||||
lock() {
|
||||
let operate = {
|
||||
start: true,
|
||||
code: this.selected.code,
|
||||
type: MapDeviceType.Section.type,
|
||||
label: MapDeviceType.Section.label,
|
||||
operation: OperationEvent.Section.lock.menu.operation
|
||||
};
|
||||
this.$store.dispatch('training/next', operate).then(({ valid }) => {
|
||||
if (valid) {
|
||||
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
|
||||
this.$refs.sectionControl.doShow(operate, this.selected);
|
||||
}
|
||||
});
|
||||
},
|
||||
//区段封锁
|
||||
unlock() {
|
||||
let operate = {
|
||||
start: true,
|
||||
code: this.selected.code,
|
||||
type: MapDeviceType.Section.type,
|
||||
label: MapDeviceType.Section.label,
|
||||
operation: OperationEvent.Section.unlock.menu.operation
|
||||
};
|
||||
this.$store.dispatch('training/next', operate).then(({ valid }) => {
|
||||
if (valid) {
|
||||
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
|
||||
this.$refs.sectionCmdControl.doShow(operate, this.selected);
|
||||
}
|
||||
});
|
||||
},
|
||||
//设置速度
|
||||
setSpeed() {
|
||||
let operate = {
|
||||
start: true,
|
||||
code: this.selected.code,
|
||||
type: MapDeviceType.Section.type,
|
||||
label: MapDeviceType.Section.label,
|
||||
operation: OperationEvent.Section.setSpeed.menu.operation
|
||||
};
|
||||
this.$store.dispatch('training/next', operate).then(({ valid }) => {
|
||||
if (valid) {
|
||||
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
|
||||
this.$refs.speedCmdControl.doShow(operate, this.selected);
|
||||
}
|
||||
});
|
||||
},
|
||||
//取消速度
|
||||
cancelSpeed() {
|
||||
let operate = {
|
||||
start: true,
|
||||
send: true,
|
||||
code: this.selected.code,
|
||||
type: MapDeviceType.Section.type,
|
||||
label: MapDeviceType.Section.label,
|
||||
operation: OperationEvent.Section.cancelSpeed.menu.operation
|
||||
};
|
||||
this.$store.dispatch('training/next', operate).then(({ valid, response }) => {
|
||||
if (valid) {
|
||||
let tempData = response.data;
|
||||
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
|
||||
this.$refs.speedCmdControl.doShow(operate, this.selected, tempData);
|
||||
}
|
||||
});
|
||||
},
|
||||
//新建列车
|
||||
newTrain() {
|
||||
let operate = {
|
||||
start: true,
|
||||
code: this.selected.code,
|
||||
type: MapDeviceType.Section.type,
|
||||
label: MapDeviceType.Section.label,
|
||||
operation: OperationEvent.Section.newtrain.menu.operation
|
||||
};
|
||||
this.$store.dispatch('training/next', operate).then(({ valid }) => {
|
||||
if (valid) {
|
||||
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
|
||||
this.$refs.trainCreate.doShow(operate, this.selected);
|
||||
}
|
||||
})
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
this.menu = menuConvert(this.menu);
|
||||
},
|
||||
doShow(point) {
|
||||
this.clickEvent();
|
||||
this.initMenu();
|
||||
if (this.$refs && this.$refs.popMenu && this.menu && this.menu.length) {
|
||||
this.$refs.popMenu.resetShowPosition(point);
|
||||
}
|
||||
},
|
||||
doClose() {
|
||||
if (this.$refs && this.$refs.popMenu) {
|
||||
this.$refs.popMenu.close();
|
||||
}
|
||||
},
|
||||
// 设置故障
|
||||
setStoppage() {
|
||||
const operate = {
|
||||
start: true,
|
||||
send: true,
|
||||
code: this.selected.code,
|
||||
type: MapDeviceType.Section.type,
|
||||
label: MapDeviceType.Section.label,
|
||||
operation: OperationEvent.Section.stoppage.menu.operation
|
||||
};
|
||||
this.$store.dispatch('training/next', operate).then(({ valid }) => {
|
||||
if (valid) {
|
||||
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
|
||||
} else {
|
||||
this.$refs.noticeInfo.doShow(operate);
|
||||
}
|
||||
}).catch(() => {
|
||||
this.$refs.noticeInfo.doShow(operate);
|
||||
});
|
||||
},
|
||||
// 取消故障
|
||||
cancelStoppage() {
|
||||
const operate = {
|
||||
start: true,
|
||||
send: true,
|
||||
code: this.selected.code,
|
||||
type: MapDeviceType.Section.type,
|
||||
label: MapDeviceType.Section.label,
|
||||
operation: OperationEvent.Section.cancelStoppage.menu.operation
|
||||
};
|
||||
this.$store.dispatch('training/next', operate).then(({ valid }) => {
|
||||
if (valid) {
|
||||
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
|
||||
} else {
|
||||
this.$refs.noticeInfo.doShow(operate);
|
||||
}
|
||||
}).catch(() => {
|
||||
this.$refs.noticeInfo.doShow(operate);
|
||||
});
|
||||
},
|
||||
// 故障解锁
|
||||
fault() {
|
||||
const operate = {
|
||||
start: true,
|
||||
code: this.selected.code,
|
||||
type: MapDeviceType.Section.type,
|
||||
label: MapDeviceType.Section.label,
|
||||
operation: OperationEvent.Section.fault.menu.operation
|
||||
};
|
||||
this.$store.dispatch('training/next', operate).then(({ valid }) => {
|
||||
if (valid) {
|
||||
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
|
||||
this.$refs.sectionCmdControl.doShow(operate, this.selected);
|
||||
}
|
||||
});
|
||||
},
|
||||
// 切除
|
||||
split() {
|
||||
const operate = {
|
||||
start: true,
|
||||
code: this.selected.code,
|
||||
type: MapDeviceType.Section.type,
|
||||
label: MapDeviceType.Section.label,
|
||||
operation: OperationEvent.Section.split.menu.operation
|
||||
};
|
||||
this.$store.dispatch('training/next', operate).then(({ valid }) => {
|
||||
if (valid) {
|
||||
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
|
||||
this.$refs.sectionControl.doShow(operate, this.selected);
|
||||
}
|
||||
});
|
||||
},
|
||||
// 激活
|
||||
active() {
|
||||
const operate = {
|
||||
start: true,
|
||||
code: this.selected.code,
|
||||
type: MapDeviceType.Section.type,
|
||||
label: MapDeviceType.Section.label,
|
||||
operation: OperationEvent.Section.active.menu.operation
|
||||
};
|
||||
this.$store.dispatch('training/next', operate).then(({ valid }) => {
|
||||
if (valid) {
|
||||
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
|
||||
this.$refs.sectionControl.doShow(operate, this.selected);
|
||||
}
|
||||
});
|
||||
},
|
||||
// 区段计轴预复位
|
||||
axlePreReset() {
|
||||
const operate = {
|
||||
start: true,
|
||||
code: this.selected.code,
|
||||
type: MapDeviceType.Section.type,
|
||||
label: MapDeviceType.Section.label,
|
||||
operation: OperationEvent.Section.axlePreReset.menu.operation
|
||||
};
|
||||
this.$store.dispatch('training/next', operate).then(({ valid }) => {
|
||||
if (valid) {
|
||||
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
|
||||
this.$refs.sectionCmdControl.doShow(operate, this.selected);
|
||||
}
|
||||
});
|
||||
},
|
||||
// 区段解锁
|
||||
lock() {
|
||||
const operate = {
|
||||
start: true,
|
||||
code: this.selected.code,
|
||||
type: MapDeviceType.Section.type,
|
||||
label: MapDeviceType.Section.label,
|
||||
operation: OperationEvent.Section.lock.menu.operation
|
||||
};
|
||||
this.$store.dispatch('training/next', operate).then(({ valid }) => {
|
||||
if (valid) {
|
||||
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
|
||||
this.$refs.sectionControl.doShow(operate, this.selected);
|
||||
}
|
||||
});
|
||||
},
|
||||
// 区段封锁
|
||||
unlock() {
|
||||
const operate = {
|
||||
start: true,
|
||||
code: this.selected.code,
|
||||
type: MapDeviceType.Section.type,
|
||||
label: MapDeviceType.Section.label,
|
||||
operation: OperationEvent.Section.unlock.menu.operation
|
||||
};
|
||||
this.$store.dispatch('training/next', operate).then(({ valid }) => {
|
||||
if (valid) {
|
||||
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
|
||||
this.$refs.sectionCmdControl.doShow(operate, this.selected);
|
||||
}
|
||||
});
|
||||
},
|
||||
// 设置速度
|
||||
setSpeed() {
|
||||
const operate = {
|
||||
start: true,
|
||||
code: this.selected.code,
|
||||
type: MapDeviceType.Section.type,
|
||||
label: MapDeviceType.Section.label,
|
||||
operation: OperationEvent.Section.setSpeed.menu.operation
|
||||
};
|
||||
this.$store.dispatch('training/next', operate).then(({ valid }) => {
|
||||
if (valid) {
|
||||
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
|
||||
this.$refs.speedCmdControl.doShow(operate, this.selected);
|
||||
}
|
||||
});
|
||||
},
|
||||
// 取消速度
|
||||
cancelSpeed() {
|
||||
const operate = {
|
||||
start: true,
|
||||
send: true,
|
||||
code: this.selected.code,
|
||||
type: MapDeviceType.Section.type,
|
||||
label: MapDeviceType.Section.label,
|
||||
operation: OperationEvent.Section.cancelSpeed.menu.operation
|
||||
};
|
||||
this.$store.dispatch('training/next', operate).then(({ valid, response }) => {
|
||||
if (valid) {
|
||||
const tempData = response.data;
|
||||
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
|
||||
this.$refs.speedCmdControl.doShow(operate, this.selected, tempData);
|
||||
}
|
||||
});
|
||||
},
|
||||
// 新建列车
|
||||
newTrain() {
|
||||
const operate = {
|
||||
start: true,
|
||||
code: this.selected.code,
|
||||
type: MapDeviceType.Section.type,
|
||||
label: MapDeviceType.Section.label,
|
||||
operation: OperationEvent.Section.newtrain.menu.operation
|
||||
};
|
||||
this.$store.dispatch('training/next', operate).then(({ valid }) => {
|
||||
if (valid) {
|
||||
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
|
||||
this.$refs.trainCreate.doShow(operate, this.selected);
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
};
|
||||
</script>
|
||||
|
@ -39,7 +39,8 @@ export default {
|
||||
},
|
||||
props: {
|
||||
selected: {
|
||||
type: Object
|
||||
type: Object,
|
||||
required: true
|
||||
}
|
||||
},
|
||||
data() {
|
||||
|
@ -1,299 +1,300 @@
|
||||
<template>
|
||||
<div>
|
||||
<pop-menu ref="popMenu" :menu="menu"></pop-menu>
|
||||
<station-cmd-control ref="stationCmdControl"></station-cmd-control>
|
||||
<station-human-control-all ref="stationHumanControlAll"></station-human-control-all>
|
||||
<station-set-route-control-all ref="stationSetRouteControlAll"></station-set-route-control-all>
|
||||
<notice-info ref="noticeInfo"></notice-info>
|
||||
</div>
|
||||
<div>
|
||||
<pop-menu ref="popMenu" :menu="menu" />
|
||||
<station-cmd-control ref="stationCmdControl" />
|
||||
<station-human-control-all ref="stationHumanControlAll" />
|
||||
<station-set-route-control-all ref="stationSetRouteControlAll" />
|
||||
<notice-info ref="noticeInfo" />
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import PopMenu from '@/components/PopMenu';
|
||||
import StationCmdControl from './dialog/stationCmdControl';
|
||||
import StationHumanControlAll from './dialog/stationHumanControlAll';
|
||||
import StationSetRouteControlAll from './dialog/stationSetRouteControlAll'
|
||||
import NoticeInfo from './dialog/childDialog/childDialog/noticeInfo'
|
||||
import { mapGetters } from 'vuex';
|
||||
import { TrainingMode, OperateMode } from '@/scripts/ConstDic';
|
||||
import { MapDeviceType, OperationEvent, DeviceMenu } from '@/scripts/ConstDic';
|
||||
import { MenuDisabledState, menuConvert, menuFiltration } from './utils/menuItemStatus';
|
||||
import PopMenu from '@/components/PopMenu';
|
||||
import StationCmdControl from './dialog/stationCmdControl';
|
||||
import StationHumanControlAll from './dialog/stationHumanControlAll';
|
||||
import StationSetRouteControlAll from './dialog/stationSetRouteControlAll';
|
||||
import NoticeInfo from './dialog/childDialog/childDialog/noticeInfo';
|
||||
import { mapGetters } from 'vuex';
|
||||
import { OperateMode } from '@/scripts/ConstDic';
|
||||
import { MapDeviceType, OperationEvent, DeviceMenu } from '@/scripts/ConstDic';
|
||||
import { MenuDisabledState, menuConvert, menuFiltration } from './utils/menuItemStatus';
|
||||
|
||||
export default {
|
||||
name: 'StationMenu',
|
||||
components: {
|
||||
PopMenu,
|
||||
StationCmdControl,
|
||||
StationHumanControlAll,
|
||||
StationSetRouteControlAll,
|
||||
NoticeInfo
|
||||
},
|
||||
props: {
|
||||
selected: {
|
||||
type: Object
|
||||
}
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
menu: [],
|
||||
menuNormal: {
|
||||
local: [
|
||||
{
|
||||
label: this.$t('menu.menuStation.fullSiteSetInterlockAutoTrigger'),
|
||||
handler: this.setAutoTrigger,
|
||||
disabledCallback: MenuDisabledState.Station.setAutoTrigger,
|
||||
auth: { station: true, center: false },
|
||||
},
|
||||
{
|
||||
label: this.$t('menu.menuStation.fullSiteCancelInterlockAutoTrigger'),
|
||||
handler: this.cancelAutoTrigger,
|
||||
disabledCallback: MenuDisabledState.Station.cancelAutoTrigger,
|
||||
auth: { station: true, center: false },
|
||||
},
|
||||
{
|
||||
label: this.$t('menu.menuStation.powerUnLock'),
|
||||
handler: this.powerUnLock,
|
||||
disabledCallback: MenuDisabledState.Station.powerUnLock,
|
||||
auth: { station: true, center: false },
|
||||
},
|
||||
{
|
||||
label: this.$t('menu.menuStation.execKeyOperationTest'),
|
||||
handler: this.execKeyOperationTest,
|
||||
disabledCallback: MenuDisabledState.Station.execKeyOperationTest,
|
||||
auth: { station: true, center: false },
|
||||
}
|
||||
],
|
||||
central: [
|
||||
{
|
||||
label: this.$t('menu.menuStation.allHumanControl'),
|
||||
handler: this.humanControlALL,
|
||||
disabledCallback: MenuDisabledState.Station.humanControlALL,
|
||||
auth: { station: false, center: true },
|
||||
},
|
||||
{
|
||||
label: this.$t('menu.menuStation.allATSAutoControl'),
|
||||
handler: this.atsAutoControlALL,
|
||||
disabledCallback: MenuDisabledState.Station.atsAutoControlALL,
|
||||
auth: { station: false, center: true },
|
||||
},
|
||||
{
|
||||
label: this.$t('menu.menuStation.execKeyOperationTest'),
|
||||
handler: this.execKeyOperationTest,
|
||||
disabledCallback: MenuDisabledState.Station.execKeyOperationTest,
|
||||
auth: { station: false, center: true },
|
||||
}
|
||||
],
|
||||
},
|
||||
menuForce: [
|
||||
{
|
||||
label: this.$t('menu.menuStation.setStoppage'),
|
||||
handler: this.setStoppage,
|
||||
disabledCallback: MenuDisabledState.Station.setStoppage
|
||||
},
|
||||
{
|
||||
label: this.$t('menu.menuStation.cancelStoppage'),
|
||||
handler: this.cancelStoppage,
|
||||
disabledCallback: MenuDisabledState.Station.cancelStoppage
|
||||
}
|
||||
]
|
||||
}
|
||||
},
|
||||
watch: {
|
||||
'$store.state.menuOperation.menuCount': function (val) {
|
||||
if (this.$store.getters['menuOperation/checkDialogIsOpen'](DeviceMenu.Station) && !this.buttonOperation) {
|
||||
this.doShow(this.$store.state.menuOperation.menuPosition);
|
||||
} else {
|
||||
this.doClose();
|
||||
}
|
||||
}
|
||||
},
|
||||
computed: {
|
||||
...mapGetters('training', [
|
||||
'mode',
|
||||
'operatemode'
|
||||
]),
|
||||
...mapGetters('menuOperation', [
|
||||
'buttonOperation'
|
||||
])
|
||||
},
|
||||
methods: {
|
||||
clickEvent() {
|
||||
let self = this;
|
||||
window.onclick = function (e) {
|
||||
self.doClose();
|
||||
}
|
||||
},
|
||||
initMenu() {
|
||||
this.menu = [];
|
||||
if (this.selected.concentrateStationCode == this.selected.code) {
|
||||
//编辑模式菜单列表
|
||||
this.menu = menuFiltration(this.menuNormal);
|
||||
if (this.operatemode === OperateMode.ADMIN) {
|
||||
this.menu = [...this.menu, ...this.menuForce]
|
||||
}
|
||||
}
|
||||
export default {
|
||||
name: 'StationMenu',
|
||||
components: {
|
||||
PopMenu,
|
||||
StationCmdControl,
|
||||
StationHumanControlAll,
|
||||
StationSetRouteControlAll,
|
||||
NoticeInfo
|
||||
},
|
||||
props: {
|
||||
selected: {
|
||||
type: Object,
|
||||
required: true
|
||||
}
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
menu: [],
|
||||
menuNormal: {
|
||||
local: [
|
||||
{
|
||||
label: this.$t('menu.menuStation.fullSiteSetInterlockAutoTrigger'),
|
||||
handler: this.setAutoTrigger,
|
||||
disabledCallback: MenuDisabledState.Station.setAutoTrigger,
|
||||
auth: { station: true, center: false }
|
||||
},
|
||||
{
|
||||
label: this.$t('menu.menuStation.fullSiteCancelInterlockAutoTrigger'),
|
||||
handler: this.cancelAutoTrigger,
|
||||
disabledCallback: MenuDisabledState.Station.cancelAutoTrigger,
|
||||
auth: { station: true, center: false }
|
||||
},
|
||||
{
|
||||
label: this.$t('menu.menuStation.powerUnLock'),
|
||||
handler: this.powerUnLock,
|
||||
disabledCallback: MenuDisabledState.Station.powerUnLock,
|
||||
auth: { station: true, center: false }
|
||||
},
|
||||
{
|
||||
label: this.$t('menu.menuStation.execKeyOperationTest'),
|
||||
handler: this.execKeyOperationTest,
|
||||
disabledCallback: MenuDisabledState.Station.execKeyOperationTest,
|
||||
auth: { station: true, center: false }
|
||||
}
|
||||
],
|
||||
central: [
|
||||
{
|
||||
label: this.$t('menu.menuStation.allHumanControl'),
|
||||
handler: this.humanControlALL,
|
||||
disabledCallback: MenuDisabledState.Station.humanControlALL,
|
||||
auth: { station: false, center: true }
|
||||
},
|
||||
{
|
||||
label: this.$t('menu.menuStation.allATSAutoControl'),
|
||||
handler: this.atsAutoControlALL,
|
||||
disabledCallback: MenuDisabledState.Station.atsAutoControlALL,
|
||||
auth: { station: false, center: true }
|
||||
},
|
||||
{
|
||||
label: this.$t('menu.menuStation.execKeyOperationTest'),
|
||||
handler: this.execKeyOperationTest,
|
||||
disabledCallback: MenuDisabledState.Station.execKeyOperationTest,
|
||||
auth: { station: false, center: true }
|
||||
}
|
||||
]
|
||||
},
|
||||
menuForce: [
|
||||
{
|
||||
label: this.$t('menu.menuStation.setStoppage'),
|
||||
handler: this.setStoppage,
|
||||
disabledCallback: MenuDisabledState.Station.setStoppage
|
||||
},
|
||||
{
|
||||
label: this.$t('menu.menuStation.cancelStoppage'),
|
||||
handler: this.cancelStoppage,
|
||||
disabledCallback: MenuDisabledState.Station.cancelStoppage
|
||||
}
|
||||
]
|
||||
};
|
||||
},
|
||||
computed: {
|
||||
...mapGetters('training', [
|
||||
'mode',
|
||||
'operatemode'
|
||||
]),
|
||||
...mapGetters('menuOperation', [
|
||||
'buttonOperation'
|
||||
])
|
||||
},
|
||||
watch: {
|
||||
'$store.state.menuOperation.menuCount': function (val) {
|
||||
if (this.$store.getters['menuOperation/checkDialogIsOpen'](DeviceMenu.Station) && !this.buttonOperation) {
|
||||
this.doShow(this.$store.state.menuOperation.menuPosition);
|
||||
} else {
|
||||
this.doClose();
|
||||
}
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
clickEvent() {
|
||||
const self = this;
|
||||
window.onclick = function (e) {
|
||||
self.doClose();
|
||||
};
|
||||
},
|
||||
initMenu() {
|
||||
this.menu = [];
|
||||
if (this.selected.concentrateStationCode == this.selected.code) {
|
||||
// 编辑模式菜单列表
|
||||
this.menu = menuFiltration(this.menuNormal);
|
||||
if (this.operatemode === OperateMode.ADMIN) {
|
||||
this.menu = [...this.menu, ...this.menuForce];
|
||||
}
|
||||
}
|
||||
|
||||
if (this.selected.centralized) {
|
||||
//故障模式菜单列表
|
||||
if (this.operatemode === OperateMode.FAULT) {
|
||||
this.menu = [...this.menuForce]
|
||||
}
|
||||
}
|
||||
if (this.selected.centralized) {
|
||||
// 故障模式菜单列表
|
||||
if (this.operatemode === OperateMode.FAULT) {
|
||||
this.menu = [...this.menuForce];
|
||||
}
|
||||
}
|
||||
|
||||
this.menu = menuConvert(this.menu);
|
||||
},
|
||||
doShow(point) {
|
||||
this.clickEvent();
|
||||
this.initMenu();
|
||||
if (this.$refs && this.$refs.popMenu && this.menu && this.menu.length) {
|
||||
this.$refs.popMenu.resetShowPosition(point);
|
||||
}
|
||||
},
|
||||
doClose() {
|
||||
if (this.$refs && this.$refs.popMenu) {
|
||||
this.$refs.popMenu.close();
|
||||
}
|
||||
},
|
||||
//设置故障
|
||||
setStoppage() {
|
||||
let operate = {
|
||||
start: true,
|
||||
send: true,
|
||||
code: this.selected.code,
|
||||
type: MapDeviceType.Station.type,
|
||||
label: MapDeviceType.Station.label,
|
||||
operation: OperationEvent.Station.stoppage.menu.operation
|
||||
};
|
||||
this.$store.dispatch('training/next', operate).then(({ valid }) => {
|
||||
if (valid) {
|
||||
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
|
||||
} else {
|
||||
this.$refs.noticeInfo.doShow(operate);
|
||||
}
|
||||
}).catch(error => {
|
||||
this.$refs.noticeInfo.doShow(operate);
|
||||
})
|
||||
},
|
||||
//取消故障
|
||||
cancelStoppage() {
|
||||
let operate = {
|
||||
start: true,
|
||||
send: true,
|
||||
code: this.selected.code,
|
||||
type: MapDeviceType.Station.type,
|
||||
label: MapDeviceType.Station.label,
|
||||
operation: OperationEvent.Station.cancelStoppage.menu.operation
|
||||
};
|
||||
this.$store.dispatch('training/next', operate).then(({ valid }) => {
|
||||
if (valid) {
|
||||
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
|
||||
} else {
|
||||
this.$refs.noticeInfo.doShow(operate);
|
||||
}
|
||||
}).catch(error => {
|
||||
this.$refs.noticeInfo.doShow(operate);
|
||||
})
|
||||
},
|
||||
//全站设置联锁自动触发
|
||||
setAutoTrigger() {
|
||||
let operate = {
|
||||
start: true,
|
||||
send: true,
|
||||
code: this.selected.code,
|
||||
type: MapDeviceType.Station.type,
|
||||
label: MapDeviceType.Station.label,
|
||||
operation: OperationEvent.Station.setAutoTrigger.menu.operation
|
||||
};
|
||||
this.$store.dispatch('training/next', operate).then(({ valid }) => {
|
||||
if (valid) {
|
||||
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
|
||||
}
|
||||
}).catch(error => {
|
||||
this.$refs.noticeInfo.doShow(operate);
|
||||
})
|
||||
},
|
||||
//全站取消联锁自动触发
|
||||
cancelAutoTrigger() {
|
||||
let operate = {
|
||||
start: true,
|
||||
send: true,
|
||||
code: this.selected.code,
|
||||
type: MapDeviceType.Station.type,
|
||||
label: MapDeviceType.Station.label,
|
||||
operation: OperationEvent.Station.cancelAutoTrigger.menu.operation
|
||||
};
|
||||
this.$store.dispatch('training/next', operate).then(({ valid }) => {
|
||||
if (valid) {
|
||||
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
|
||||
}
|
||||
}).catch(error => {
|
||||
this.$refs.noticeInfo.doShow(operate);
|
||||
})
|
||||
},
|
||||
//上电解锁
|
||||
powerUnLock() {
|
||||
let operate = {
|
||||
start: true,
|
||||
code: this.selected.code,
|
||||
type: MapDeviceType.Station.type,
|
||||
label: MapDeviceType.Station.label,
|
||||
operation: OperationEvent.Station.powerUnLock.menu.operation
|
||||
};
|
||||
this.$store.dispatch('training/next', operate).then(({ valid }) => {
|
||||
if (valid) {
|
||||
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
|
||||
this.$refs.stationCmdControl.doShow(operate, this.selected);
|
||||
}
|
||||
});
|
||||
},
|
||||
//执行关键操作测试
|
||||
execKeyOperationTest() {
|
||||
let operate = {
|
||||
start: true,
|
||||
code: this.selected.code,
|
||||
type: MapDeviceType.Station.type,
|
||||
label: MapDeviceType.Station.label,
|
||||
operation: OperationEvent.Station.execKeyOperationTest.menu.operation
|
||||
};
|
||||
this.$store.dispatch('training/next', operate).then(({ valid }) => {
|
||||
if (valid) {
|
||||
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
|
||||
this.$refs.stationCmdControl.doShow(operate, this.selected);
|
||||
}
|
||||
});
|
||||
},
|
||||
//所有进路自排关
|
||||
humanControlALL() {
|
||||
let operate = {
|
||||
start: true,
|
||||
code: this.selected.code,
|
||||
type: MapDeviceType.Station.type,
|
||||
label: MapDeviceType.Station.label,
|
||||
operation: OperationEvent.Station.humanControlALL.menu.operation,
|
||||
};
|
||||
this.$store.dispatch('training/next', operate).then(({ valid }) => {
|
||||
if (valid) {
|
||||
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
|
||||
this.$refs.stationHumanControlAll.doShow(operate);
|
||||
}
|
||||
})
|
||||
},
|
||||
//所有进路自排开
|
||||
atsAutoControlALL() {
|
||||
let operate = {
|
||||
start: true,
|
||||
code: this.selected.code,
|
||||
type: MapDeviceType.Station.type,
|
||||
label: MapDeviceType.Station.label,
|
||||
operation: OperationEvent.Station.atsAutoControlALL.menu.operation
|
||||
};
|
||||
this.$store.dispatch('training/next', operate).then(({ valid }) => {
|
||||
if (valid) {
|
||||
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
|
||||
this.$refs.stationSetRouteControlAll.doShow(operate, this.selected);
|
||||
}
|
||||
})
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
this.menu = menuConvert(this.menu);
|
||||
},
|
||||
doShow(point) {
|
||||
this.clickEvent();
|
||||
this.initMenu();
|
||||
if (this.$refs && this.$refs.popMenu && this.menu && this.menu.length) {
|
||||
this.$refs.popMenu.resetShowPosition(point);
|
||||
}
|
||||
},
|
||||
doClose() {
|
||||
if (this.$refs && this.$refs.popMenu) {
|
||||
this.$refs.popMenu.close();
|
||||
}
|
||||
},
|
||||
// 设置故障
|
||||
setStoppage() {
|
||||
const operate = {
|
||||
start: true,
|
||||
send: true,
|
||||
code: this.selected.code,
|
||||
type: MapDeviceType.Station.type,
|
||||
label: MapDeviceType.Station.label,
|
||||
operation: OperationEvent.Station.stoppage.menu.operation
|
||||
};
|
||||
this.$store.dispatch('training/next', operate).then(({ valid }) => {
|
||||
if (valid) {
|
||||
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
|
||||
} else {
|
||||
this.$refs.noticeInfo.doShow(operate);
|
||||
}
|
||||
}).catch(() => {
|
||||
this.$refs.noticeInfo.doShow(operate);
|
||||
});
|
||||
},
|
||||
// 取消故障
|
||||
cancelStoppage() {
|
||||
const operate = {
|
||||
start: true,
|
||||
send: true,
|
||||
code: this.selected.code,
|
||||
type: MapDeviceType.Station.type,
|
||||
label: MapDeviceType.Station.label,
|
||||
operation: OperationEvent.Station.cancelStoppage.menu.operation
|
||||
};
|
||||
this.$store.dispatch('training/next', operate).then(({ valid }) => {
|
||||
if (valid) {
|
||||
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
|
||||
} else {
|
||||
this.$refs.noticeInfo.doShow(operate);
|
||||
}
|
||||
}).catch(() => {
|
||||
this.$refs.noticeInfo.doShow(operate);
|
||||
});
|
||||
},
|
||||
// 全站设置联锁自动触发
|
||||
setAutoTrigger() {
|
||||
const operate = {
|
||||
start: true,
|
||||
send: true,
|
||||
code: this.selected.code,
|
||||
type: MapDeviceType.Station.type,
|
||||
label: MapDeviceType.Station.label,
|
||||
operation: OperationEvent.Station.setAutoTrigger.menu.operation
|
||||
};
|
||||
this.$store.dispatch('training/next', operate).then(({ valid }) => {
|
||||
if (valid) {
|
||||
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
|
||||
}
|
||||
}).catch(() => {
|
||||
this.$refs.noticeInfo.doShow(operate);
|
||||
});
|
||||
},
|
||||
// 全站取消联锁自动触发
|
||||
cancelAutoTrigger() {
|
||||
const operate = {
|
||||
start: true,
|
||||
send: true,
|
||||
code: this.selected.code,
|
||||
type: MapDeviceType.Station.type,
|
||||
label: MapDeviceType.Station.label,
|
||||
operation: OperationEvent.Station.cancelAutoTrigger.menu.operation
|
||||
};
|
||||
this.$store.dispatch('training/next', operate).then(({ valid }) => {
|
||||
if (valid) {
|
||||
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
|
||||
}
|
||||
}).catch(() => {
|
||||
this.$refs.noticeInfo.doShow(operate);
|
||||
});
|
||||
},
|
||||
// 上电解锁
|
||||
powerUnLock() {
|
||||
const operate = {
|
||||
start: true,
|
||||
code: this.selected.code,
|
||||
type: MapDeviceType.Station.type,
|
||||
label: MapDeviceType.Station.label,
|
||||
operation: OperationEvent.Station.powerUnLock.menu.operation
|
||||
};
|
||||
this.$store.dispatch('training/next', operate).then(({ valid }) => {
|
||||
if (valid) {
|
||||
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
|
||||
this.$refs.stationCmdControl.doShow(operate, this.selected);
|
||||
}
|
||||
});
|
||||
},
|
||||
// 执行关键操作测试
|
||||
execKeyOperationTest() {
|
||||
const operate = {
|
||||
start: true,
|
||||
code: this.selected.code,
|
||||
type: MapDeviceType.Station.type,
|
||||
label: MapDeviceType.Station.label,
|
||||
operation: OperationEvent.Station.execKeyOperationTest.menu.operation
|
||||
};
|
||||
this.$store.dispatch('training/next', operate).then(({ valid }) => {
|
||||
if (valid) {
|
||||
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
|
||||
this.$refs.stationCmdControl.doShow(operate, this.selected);
|
||||
}
|
||||
});
|
||||
},
|
||||
// 所有进路自排关
|
||||
humanControlALL() {
|
||||
const operate = {
|
||||
start: true,
|
||||
code: this.selected.code,
|
||||
type: MapDeviceType.Station.type,
|
||||
label: MapDeviceType.Station.label,
|
||||
operation: OperationEvent.Station.humanControlALL.menu.operation
|
||||
};
|
||||
this.$store.dispatch('training/next', operate).then(({ valid }) => {
|
||||
if (valid) {
|
||||
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
|
||||
this.$refs.stationHumanControlAll.doShow(operate);
|
||||
}
|
||||
});
|
||||
},
|
||||
// 所有进路自排开
|
||||
atsAutoControlALL() {
|
||||
const operate = {
|
||||
start: true,
|
||||
code: this.selected.code,
|
||||
type: MapDeviceType.Station.type,
|
||||
label: MapDeviceType.Station.label,
|
||||
operation: OperationEvent.Station.atsAutoControlALL.menu.operation
|
||||
};
|
||||
this.$store.dispatch('training/next', operate).then(({ valid }) => {
|
||||
if (valid) {
|
||||
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
|
||||
this.$refs.stationSetRouteControlAll.doShow(operate, this.selected);
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
};
|
||||
</script>
|
||||
|
@ -1,68 +1,67 @@
|
||||
<template>
|
||||
<pop-menu ref="popMenu" :menu="menu"></pop-menu>
|
||||
<pop-menu ref="popMenu" :menu="menu" />
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import PopMenu from '@/components/PopMenu';
|
||||
import { mapGetters } from 'vuex';
|
||||
import { TrainingMode, OperateMode } from '@/scripts/ConstDic';
|
||||
import { MapDeviceType, OperationEvent, DeviceMenu } from '@/scripts/ConstDic';
|
||||
import { MenuDisabledState, menuConvert } from './utils/menuItemStatus';
|
||||
import PopMenu from '@/components/PopMenu';
|
||||
import { mapGetters } from 'vuex';
|
||||
import { DeviceMenu } from '@/scripts/ConstDic';
|
||||
|
||||
export default {
|
||||
name: 'StationControlMenu',
|
||||
props: {
|
||||
selected: {
|
||||
type: Object
|
||||
}
|
||||
},
|
||||
components: {
|
||||
PopMenu
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
menu: [],
|
||||
menuNormal: [
|
||||
],
|
||||
menuForce: [
|
||||
]
|
||||
}
|
||||
},
|
||||
watch: {
|
||||
'$store.state.menuOperation.menuCount': function (val) {
|
||||
if (this.$store.getters['menuOperation/checkDialogIsOpen'](DeviceMenu.StationControl) && !this.buttonOperation) {
|
||||
this.doShow(this.$store.state.menuOperation.menuPosition);
|
||||
} else {
|
||||
this.doClose();
|
||||
}
|
||||
}
|
||||
},
|
||||
computed: {
|
||||
...mapGetters('training', [
|
||||
'mode',
|
||||
'operatemode'
|
||||
]),
|
||||
...mapGetters('menuOperation', [
|
||||
'buttonOperation'
|
||||
])
|
||||
},
|
||||
methods: {
|
||||
clickEvent() {
|
||||
let self = this;
|
||||
window.onclick = function (e) {
|
||||
self.doClose();
|
||||
}
|
||||
},
|
||||
doShow(point) {
|
||||
if (this.$refs && this.$refs.popMenu) {
|
||||
this.$refs.popMenu.close();
|
||||
}
|
||||
},
|
||||
doClose() {
|
||||
if (this.$refs && this.$refs.popMenu) {
|
||||
this.$refs.popMenu.close();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
export default {
|
||||
name: 'StationControlMenu',
|
||||
components: {
|
||||
PopMenu
|
||||
},
|
||||
props: {
|
||||
selected: {
|
||||
type: Object,
|
||||
required: true
|
||||
}
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
menu: [],
|
||||
menuNormal: [
|
||||
],
|
||||
menuForce: [
|
||||
]
|
||||
};
|
||||
},
|
||||
computed: {
|
||||
...mapGetters('training', [
|
||||
'mode',
|
||||
'operatemode'
|
||||
]),
|
||||
...mapGetters('menuOperation', [
|
||||
'buttonOperation'
|
||||
])
|
||||
},
|
||||
watch: {
|
||||
'$store.state.menuOperation.menuCount': function (val) {
|
||||
if (this.$store.getters['menuOperation/checkDialogIsOpen'](DeviceMenu.StationControl) && !this.buttonOperation) {
|
||||
this.doShow(this.$store.state.menuOperation.menuPosition);
|
||||
} else {
|
||||
this.doClose();
|
||||
}
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
clickEvent() {
|
||||
const self = this;
|
||||
window.onclick = function (e) {
|
||||
self.doClose();
|
||||
};
|
||||
},
|
||||
doShow(point) {
|
||||
if (this.$refs && this.$refs.popMenu) {
|
||||
this.$refs.popMenu.close();
|
||||
}
|
||||
},
|
||||
doClose() {
|
||||
if (this.$refs && this.$refs.popMenu) {
|
||||
this.$refs.popMenu.close();
|
||||
}
|
||||
}
|
||||
}
|
||||
};
|
||||
</script>
|
||||
|
@ -39,7 +39,8 @@ export default {
|
||||
},
|
||||
props: {
|
||||
selected: {
|
||||
type: Object
|
||||
type: Object,
|
||||
required: true
|
||||
}
|
||||
},
|
||||
data() {
|
||||
|
@ -1,482 +1,483 @@
|
||||
<template>
|
||||
<div>
|
||||
<pop-menu ref="popMenu" :menu="menu"></pop-menu>
|
||||
<switch-control ref="switchControl"></switch-control>
|
||||
<switch-cmd-control ref="switchCmdControl"></switch-cmd-control>
|
||||
<speed-cmd-control ref="speedCmdControl"></speed-cmd-control>
|
||||
<notice-info ref="noticeInfo"></notice-info>
|
||||
</div>
|
||||
<div>
|
||||
<pop-menu ref="popMenu" :menu="menu" />
|
||||
<switch-control ref="switchControl" />
|
||||
<switch-cmd-control ref="switchCmdControl" />
|
||||
<speed-cmd-control ref="speedCmdControl" />
|
||||
<notice-info ref="noticeInfo" />
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import PopMenu from '@/components/PopMenu';
|
||||
import SwitchControl from './dialog/switchControl';
|
||||
import SwitchCmdControl from './dialog/switchCmdControl';
|
||||
import SpeedCmdControl from './dialog/speedCmdControl';
|
||||
import NoticeInfo from './dialog/childDialog/childDialog/noticeInfo'
|
||||
import { mapGetters } from 'vuex';
|
||||
import { TrainingMode, OperateMode } from '@/scripts/ConstDic';
|
||||
import { MapDeviceType, OperationEvent, DeviceMenu } from '@/scripts/ConstDic';
|
||||
import { MenuDisabledState, menuConvert, menuFiltration } from './utils/menuItemStatus';
|
||||
import PopMenu from '@/components/PopMenu';
|
||||
import SwitchControl from './dialog/switchControl';
|
||||
import SwitchCmdControl from './dialog/switchCmdControl';
|
||||
import SpeedCmdControl from './dialog/speedCmdControl';
|
||||
import NoticeInfo from './dialog/childDialog/childDialog/noticeInfo';
|
||||
import { mapGetters } from 'vuex';
|
||||
import { OperateMode } from '@/scripts/ConstDic';
|
||||
import { MapDeviceType, OperationEvent, DeviceMenu } from '@/scripts/ConstDic';
|
||||
import { MenuDisabledState, menuConvert, menuFiltration } from './utils/menuItemStatus';
|
||||
|
||||
export default {
|
||||
name: 'SwitchMenu',
|
||||
components: {
|
||||
PopMenu,
|
||||
SwitchControl,
|
||||
SwitchCmdControl,
|
||||
SpeedCmdControl,
|
||||
NoticeInfo
|
||||
},
|
||||
props: {
|
||||
selected: {
|
||||
type: Object
|
||||
}
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
menu: [],
|
||||
menuNormal: {
|
||||
local: [
|
||||
{
|
||||
label: this.$t('menu.menuSwitch.switchLock'),
|
||||
handler: this.lock,
|
||||
disabledCallback: MenuDisabledState.Switch.lock,
|
||||
auth: { station: true, center: false }
|
||||
},
|
||||
{
|
||||
label: this.$t('menu.menuSwitch.switchUnlock'),
|
||||
handler: this.unlock,
|
||||
disabledCallback: MenuDisabledState.Switch.unlock,
|
||||
auth: { station: true, center: false }
|
||||
},
|
||||
{
|
||||
label: this.$t('menu.menuSwitch.switchSectionBlockade'),
|
||||
handler: this.block,
|
||||
disabledCallback: MenuDisabledState.Switch.block,
|
||||
auth: { station: true, center: false }
|
||||
},
|
||||
{
|
||||
label: this.$t('menu.menuSwitch.switchSectionUnblock'),
|
||||
handler: this.unblock,
|
||||
disabledCallback: MenuDisabledState.Switch.unblock,
|
||||
auth: { station: true, center: false }
|
||||
},
|
||||
{
|
||||
label: this.$t('menu.menuSwitch.switchTurnout'),
|
||||
handler: this.switchTurnout,
|
||||
disabledCallback: MenuDisabledState.Switch.switchTurnout,
|
||||
auth: { station: true, center: false }
|
||||
},
|
||||
{
|
||||
label: this.$t('menu.menuSwitch.switchSectionFaultUnlock'),
|
||||
handler: this.fault,
|
||||
disabledCallback: MenuDisabledState.Switch.fault,
|
||||
auth: { station: true, center: false }
|
||||
},
|
||||
{
|
||||
label: this.$t('menu.menuSwitch.switchSectionAxisPreReset') ,
|
||||
handler: this.axlePreReset,
|
||||
disabledCallback: MenuDisabledState.Switch.axlePreReset,
|
||||
auth: { station: true, center: false }
|
||||
},
|
||||
{
|
||||
label: this.$t('menu.menuSwitch.sectionResection'),
|
||||
handler: this.split,
|
||||
disabledCallback: MenuDisabledState.Switch.split,
|
||||
auth: { station: true, center: false }
|
||||
},
|
||||
{
|
||||
label: this.$t('menu.menuSwitch.sectionActive'),
|
||||
handler: this.active,
|
||||
disabledCallback: MenuDisabledState.Switch.active,
|
||||
auth: { station: true, center: false }
|
||||
},
|
||||
{
|
||||
label: this.$t('menu.menuSwitch.switchSectionSetSpeedLimit'),
|
||||
handler: this.setSpeed,
|
||||
disabledCallback: MenuDisabledState.Switch.setSpeed,
|
||||
auth: { station: true, center: false }
|
||||
},
|
||||
{
|
||||
label: this.$t('menu.menuSwitch.switchSectionCancelSpeedLimit'),
|
||||
handler: this.cancelSpeed,
|
||||
disabledCallback: MenuDisabledState.Switch.cancelSpeed,
|
||||
auth: { station: true, center: false }
|
||||
}
|
||||
],
|
||||
central: [
|
||||
{
|
||||
label: this.$t('menu.menuSwitch.switchLock'),
|
||||
handler: this.lock,
|
||||
disabledCallback: MenuDisabledState.Switch.lock,
|
||||
auth: { station: false, center: true }
|
||||
},
|
||||
{
|
||||
label: this.$t('menu.menuSwitch.switchUnlock'),
|
||||
handler: this.unlock,
|
||||
disabledCallback: MenuDisabledState.Switch.unlock,
|
||||
auth: { station: false, center: true }
|
||||
},
|
||||
{
|
||||
label: this.$t('menu.menuSwitch.switchSectionBlockade'),
|
||||
handler: this.block,
|
||||
disabledCallback: MenuDisabledState.Switch.block,
|
||||
auth: { station: false, center: true }
|
||||
},
|
||||
{
|
||||
label: this.$t('menu.menuSwitch.switchSectionUnblock'),
|
||||
handler: this.unblock,
|
||||
disabledCallback: MenuDisabledState.Switch.unblock,
|
||||
auth: { station: false, center: true }
|
||||
},
|
||||
{
|
||||
label: this.$t('menu.menuSwitch.switchTurnout'),
|
||||
handler: this.switchTurnout,
|
||||
disabledCallback: MenuDisabledState.Switch.switchTurnout,
|
||||
auth: { station: false, center: true }
|
||||
},
|
||||
{
|
||||
label: this.$t('menu.menuSwitch.switchSectionFaultUnlock'),
|
||||
handler: this.fault,
|
||||
disabledCallback: MenuDisabledState.Switch.fault,
|
||||
auth: { station: false, center: true }
|
||||
},
|
||||
{
|
||||
label: this.$t('menu.menuSwitch.sectionResection'),
|
||||
handler: this.split,
|
||||
disabledCallback: MenuDisabledState.Switch.split,
|
||||
auth: { station: true, center: true }
|
||||
},
|
||||
{
|
||||
label: this.$t('menu.menuSwitch.sectionActive'),
|
||||
handler: this.active,
|
||||
disabledCallback: MenuDisabledState.Switch.active,
|
||||
auth: { station: true, center: true }
|
||||
},
|
||||
{
|
||||
label: this.$t('menu.menuSwitch.switchSectionSetSpeedLimit'),
|
||||
handler: this.setSpeed,
|
||||
disabledCallback: MenuDisabledState.Switch.setSpeed,
|
||||
auth: { station: false, center: true }
|
||||
},
|
||||
{
|
||||
label: this.$t('menu.menuSwitch.switchSectionCancelSpeedLimit'),
|
||||
handler: this.cancelSpeed,
|
||||
disabledCallback: MenuDisabledState.Switch.cancelSpeed,
|
||||
auth: { station: false, center: true }
|
||||
}
|
||||
]
|
||||
},
|
||||
menuForce: [
|
||||
{
|
||||
label: this.$t('menu.menuSwitch.setFault'),
|
||||
handler: this.setStoppage,
|
||||
disabledCallback: MenuDisabledState.Switch.setStoppage,
|
||||
auth: {
|
||||
export default {
|
||||
name: 'SwitchMenu',
|
||||
components: {
|
||||
PopMenu,
|
||||
SwitchControl,
|
||||
SwitchCmdControl,
|
||||
SpeedCmdControl,
|
||||
NoticeInfo
|
||||
},
|
||||
props: {
|
||||
selected: {
|
||||
type: Object,
|
||||
required: true
|
||||
}
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
menu: [],
|
||||
menuNormal: {
|
||||
local: [
|
||||
{
|
||||
label: this.$t('menu.menuSwitch.switchLock'),
|
||||
handler: this.lock,
|
||||
disabledCallback: MenuDisabledState.Switch.lock,
|
||||
auth: { station: true, center: false }
|
||||
},
|
||||
{
|
||||
label: this.$t('menu.menuSwitch.switchUnlock'),
|
||||
handler: this.unlock,
|
||||
disabledCallback: MenuDisabledState.Switch.unlock,
|
||||
auth: { station: true, center: false }
|
||||
},
|
||||
{
|
||||
label: this.$t('menu.menuSwitch.switchSectionBlockade'),
|
||||
handler: this.block,
|
||||
disabledCallback: MenuDisabledState.Switch.block,
|
||||
auth: { station: true, center: false }
|
||||
},
|
||||
{
|
||||
label: this.$t('menu.menuSwitch.switchSectionUnblock'),
|
||||
handler: this.unblock,
|
||||
disabledCallback: MenuDisabledState.Switch.unblock,
|
||||
auth: { station: true, center: false }
|
||||
},
|
||||
{
|
||||
label: this.$t('menu.menuSwitch.switchTurnout'),
|
||||
handler: this.switchTurnout,
|
||||
disabledCallback: MenuDisabledState.Switch.switchTurnout,
|
||||
auth: { station: true, center: false }
|
||||
},
|
||||
{
|
||||
label: this.$t('menu.menuSwitch.switchSectionFaultUnlock'),
|
||||
handler: this.fault,
|
||||
disabledCallback: MenuDisabledState.Switch.fault,
|
||||
auth: { station: true, center: false }
|
||||
},
|
||||
{
|
||||
label: this.$t('menu.menuSwitch.switchSectionAxisPreReset'),
|
||||
handler: this.axlePreReset,
|
||||
disabledCallback: MenuDisabledState.Switch.axlePreReset,
|
||||
auth: { station: true, center: false }
|
||||
},
|
||||
{
|
||||
label: this.$t('menu.menuSwitch.sectionResection'),
|
||||
handler: this.split,
|
||||
disabledCallback: MenuDisabledState.Switch.split,
|
||||
auth: { station: true, center: false }
|
||||
},
|
||||
{
|
||||
label: this.$t('menu.menuSwitch.sectionActive'),
|
||||
handler: this.active,
|
||||
disabledCallback: MenuDisabledState.Switch.active,
|
||||
auth: { station: true, center: false }
|
||||
},
|
||||
{
|
||||
label: this.$t('menu.menuSwitch.switchSectionSetSpeedLimit'),
|
||||
handler: this.setSpeed,
|
||||
disabledCallback: MenuDisabledState.Switch.setSpeed,
|
||||
auth: { station: true, center: false }
|
||||
},
|
||||
{
|
||||
label: this.$t('menu.menuSwitch.switchSectionCancelSpeedLimit'),
|
||||
handler: this.cancelSpeed,
|
||||
disabledCallback: MenuDisabledState.Switch.cancelSpeed,
|
||||
auth: { station: true, center: false }
|
||||
}
|
||||
],
|
||||
central: [
|
||||
{
|
||||
label: this.$t('menu.menuSwitch.switchLock'),
|
||||
handler: this.lock,
|
||||
disabledCallback: MenuDisabledState.Switch.lock,
|
||||
auth: { station: false, center: true }
|
||||
},
|
||||
{
|
||||
label: this.$t('menu.menuSwitch.switchUnlock'),
|
||||
handler: this.unlock,
|
||||
disabledCallback: MenuDisabledState.Switch.unlock,
|
||||
auth: { station: false, center: true }
|
||||
},
|
||||
{
|
||||
label: this.$t('menu.menuSwitch.switchSectionBlockade'),
|
||||
handler: this.block,
|
||||
disabledCallback: MenuDisabledState.Switch.block,
|
||||
auth: { station: false, center: true }
|
||||
},
|
||||
{
|
||||
label: this.$t('menu.menuSwitch.switchSectionUnblock'),
|
||||
handler: this.unblock,
|
||||
disabledCallback: MenuDisabledState.Switch.unblock,
|
||||
auth: { station: false, center: true }
|
||||
},
|
||||
{
|
||||
label: this.$t('menu.menuSwitch.switchTurnout'),
|
||||
handler: this.switchTurnout,
|
||||
disabledCallback: MenuDisabledState.Switch.switchTurnout,
|
||||
auth: { station: false, center: true }
|
||||
},
|
||||
{
|
||||
label: this.$t('menu.menuSwitch.switchSectionFaultUnlock'),
|
||||
handler: this.fault,
|
||||
disabledCallback: MenuDisabledState.Switch.fault,
|
||||
auth: { station: false, center: true }
|
||||
},
|
||||
{
|
||||
label: this.$t('menu.menuSwitch.sectionResection'),
|
||||
handler: this.split,
|
||||
disabledCallback: MenuDisabledState.Switch.split,
|
||||
auth: { station: true, center: true }
|
||||
},
|
||||
{
|
||||
label: this.$t('menu.menuSwitch.sectionActive'),
|
||||
handler: this.active,
|
||||
disabledCallback: MenuDisabledState.Switch.active,
|
||||
auth: { station: true, center: true }
|
||||
},
|
||||
{
|
||||
label: this.$t('menu.menuSwitch.switchSectionSetSpeedLimit'),
|
||||
handler: this.setSpeed,
|
||||
disabledCallback: MenuDisabledState.Switch.setSpeed,
|
||||
auth: { station: false, center: true }
|
||||
},
|
||||
{
|
||||
label: this.$t('menu.menuSwitch.switchSectionCancelSpeedLimit'),
|
||||
handler: this.cancelSpeed,
|
||||
disabledCallback: MenuDisabledState.Switch.cancelSpeed,
|
||||
auth: { station: false, center: true }
|
||||
}
|
||||
]
|
||||
},
|
||||
menuForce: [
|
||||
{
|
||||
label: this.$t('menu.menuSwitch.setFault'),
|
||||
handler: this.setStoppage,
|
||||
disabledCallback: MenuDisabledState.Switch.setStoppage,
|
||||
auth: {
|
||||
|
||||
}
|
||||
},
|
||||
{
|
||||
label: this.$t('menu.menuSwitch.cancelFault'),
|
||||
handler: this.cancelStoppage,
|
||||
disabledCallback: MenuDisabledState.Switch.cancelStoppage,
|
||||
auth: {
|
||||
}
|
||||
},
|
||||
{
|
||||
label: this.$t('menu.menuSwitch.cancelFault'),
|
||||
handler: this.cancelStoppage,
|
||||
disabledCallback: MenuDisabledState.Switch.cancelStoppage,
|
||||
auth: {
|
||||
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
},
|
||||
watch: {
|
||||
'$store.state.menuOperation.menuCount': function (val) {
|
||||
if (this.$store.getters['menuOperation/checkDialogIsOpen'](DeviceMenu.Switch) && !this.buttonOperation) {
|
||||
this.doShow(this.$store.state.menuOperation.menuPosition);
|
||||
} else {
|
||||
this.doClose();
|
||||
}
|
||||
}
|
||||
},
|
||||
computed: {
|
||||
...mapGetters('training', [
|
||||
'mode',
|
||||
'operatemode'
|
||||
]),
|
||||
...mapGetters('menuOperation', [
|
||||
'buttonOperation'
|
||||
])
|
||||
},
|
||||
methods: {
|
||||
clickEvent() {
|
||||
let self = this;
|
||||
window.onclick = function (e) {
|
||||
self.doClose();
|
||||
}
|
||||
},
|
||||
initMenu() {
|
||||
//编辑模式菜单列表
|
||||
this.menu = menuFiltration(this.menuNormal);
|
||||
if (this.operatemode === OperateMode.ADMIN) {
|
||||
this.menu = [...this.menu, ...this.menuForce]
|
||||
}
|
||||
}
|
||||
}
|
||||
]
|
||||
};
|
||||
},
|
||||
computed: {
|
||||
...mapGetters('training', [
|
||||
'mode',
|
||||
'operatemode'
|
||||
]),
|
||||
...mapGetters('menuOperation', [
|
||||
'buttonOperation'
|
||||
])
|
||||
},
|
||||
watch: {
|
||||
'$store.state.menuOperation.menuCount': function (val) {
|
||||
if (this.$store.getters['menuOperation/checkDialogIsOpen'](DeviceMenu.Switch) && !this.buttonOperation) {
|
||||
this.doShow(this.$store.state.menuOperation.menuPosition);
|
||||
} else {
|
||||
this.doClose();
|
||||
}
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
clickEvent() {
|
||||
const self = this;
|
||||
window.onclick = function (e) {
|
||||
self.doClose();
|
||||
};
|
||||
},
|
||||
initMenu() {
|
||||
// 编辑模式菜单列表
|
||||
this.menu = menuFiltration(this.menuNormal);
|
||||
if (this.operatemode === OperateMode.ADMIN) {
|
||||
this.menu = [...this.menu, ...this.menuForce];
|
||||
}
|
||||
|
||||
//故障模式菜单列表
|
||||
if (this.operatemode === OperateMode.FAULT) {
|
||||
this.menu = this.menuForce
|
||||
}
|
||||
// 故障模式菜单列表
|
||||
if (this.operatemode === OperateMode.FAULT) {
|
||||
this.menu = this.menuForce;
|
||||
}
|
||||
|
||||
this.menu = menuConvert(this.menu);
|
||||
},
|
||||
doShow(point) {
|
||||
this.clickEvent();
|
||||
this.initMenu();
|
||||
if (this.$refs && this.$refs.popMenu && this.menu && this.menu.length) {
|
||||
this.$refs.popMenu.resetShowPosition(point);
|
||||
}
|
||||
},
|
||||
doClose() {
|
||||
if (this.$refs && this.$refs.popMenu) {
|
||||
this.$refs.popMenu.close();
|
||||
}
|
||||
},
|
||||
//设置故障
|
||||
setStoppage() {
|
||||
let operate = {
|
||||
start: true,
|
||||
send: true,
|
||||
code: this.selected.code,
|
||||
type: MapDeviceType.Switch.type,
|
||||
label: MapDeviceType.Switch.label,
|
||||
operation: OperationEvent.Switch.stoppage.menu.operation
|
||||
};
|
||||
this.$store.dispatch('training/next', operate).then(({ valid }) => {
|
||||
if (valid) {
|
||||
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
|
||||
} else {
|
||||
this.$refs.noticeInfo.doShow(operate);
|
||||
}
|
||||
}).catch(error => {
|
||||
this.$refs.noticeInfo.doShow(operate);
|
||||
})
|
||||
},
|
||||
//取消故障
|
||||
cancelStoppage() {
|
||||
let operate = {
|
||||
start: true,
|
||||
send: true,
|
||||
code: this.selected.code,
|
||||
type: MapDeviceType.Switch.type,
|
||||
label: MapDeviceType.Switch.label,
|
||||
operation: OperationEvent.Switch.cancelStoppage.menu.operation
|
||||
};
|
||||
this.$store.dispatch('training/next', operate).then(({ valid }) => {
|
||||
if (valid) {
|
||||
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
|
||||
} else {
|
||||
this.$refs.noticeInfo.doShow(operate);
|
||||
}
|
||||
}).catch(error => {
|
||||
this.$refs.noticeInfo.doShow(operate);
|
||||
})
|
||||
},
|
||||
//道岔单锁
|
||||
lock() {
|
||||
let operate = {
|
||||
start: true,
|
||||
code: this.selected.code,
|
||||
type: MapDeviceType.Switch.type,
|
||||
label: MapDeviceType.Switch.label,
|
||||
operation: OperationEvent.Switch.lock.menu.operation
|
||||
};
|
||||
this.$store.dispatch('training/next', operate).then(({ valid }) => {
|
||||
if (valid) {
|
||||
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
|
||||
this.$refs.switchControl.doShow(operate, this.selected);
|
||||
}
|
||||
});
|
||||
},
|
||||
//道岔解封
|
||||
unlock() {
|
||||
let operate = {
|
||||
start: true,
|
||||
code: this.selected.code,
|
||||
type: MapDeviceType.Switch.type,
|
||||
label: MapDeviceType.Switch.label,
|
||||
operation: OperationEvent.Switch.unlock.menu.operation
|
||||
};
|
||||
this.$store.dispatch('training/next', operate).then(({ valid }) => {
|
||||
if (valid) {
|
||||
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
|
||||
this.$refs.switchCmdControl.doShow(operate, this.selected);
|
||||
}
|
||||
});
|
||||
},
|
||||
//道岔封锁
|
||||
block() {
|
||||
let operate = {
|
||||
start: true,
|
||||
code: this.selected.code,
|
||||
type: MapDeviceType.Switch.type,
|
||||
label: MapDeviceType.Switch.label,
|
||||
operation: OperationEvent.Switch.block.menu.operation
|
||||
};
|
||||
this.$store.dispatch('training/next', operate).then(({ valid }) => {
|
||||
if (valid) {
|
||||
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
|
||||
this.$refs.switchControl.doShow(operate, this.selected);
|
||||
}
|
||||
});
|
||||
},
|
||||
//道岔解封
|
||||
unblock() {
|
||||
let operate = {
|
||||
start: true,
|
||||
code: this.selected.code,
|
||||
type: MapDeviceType.Switch.type,
|
||||
label: MapDeviceType.Switch.label,
|
||||
operation: OperationEvent.Switch.unblock.menu.operation
|
||||
};
|
||||
this.$store.dispatch('training/next', operate).then(({ valid }) => {
|
||||
if (valid) {
|
||||
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
|
||||
this.$refs.switchCmdControl.doShow(operate, this.selected);
|
||||
}
|
||||
});
|
||||
},
|
||||
//道岔强扳
|
||||
switchTurnoutForce() {
|
||||
let operate = {
|
||||
start: true,
|
||||
code: this.selected.code,
|
||||
type: MapDeviceType.Switch.type,
|
||||
label: MapDeviceType.Switch.label,
|
||||
operation: OperationEvent.Switch.turnoutForce.menu.operation
|
||||
};
|
||||
this.$store.dispatch('training/next', operate).then(({ valid }) => {
|
||||
if (valid) {
|
||||
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
|
||||
this.$refs.switchControl.doShow(operate, this.selected);
|
||||
}
|
||||
});
|
||||
},
|
||||
//道岔转动
|
||||
switchTurnout() {
|
||||
let operate = {
|
||||
start: true,
|
||||
code: this.selected.code,
|
||||
type: MapDeviceType.Switch.type,
|
||||
label: MapDeviceType.Switch.label,
|
||||
operation: OperationEvent.Switch.turnout.menu.operation
|
||||
};
|
||||
this.menu = menuConvert(this.menu);
|
||||
},
|
||||
doShow(point) {
|
||||
this.clickEvent();
|
||||
this.initMenu();
|
||||
if (this.$refs && this.$refs.popMenu && this.menu && this.menu.length) {
|
||||
this.$refs.popMenu.resetShowPosition(point);
|
||||
}
|
||||
},
|
||||
doClose() {
|
||||
if (this.$refs && this.$refs.popMenu) {
|
||||
this.$refs.popMenu.close();
|
||||
}
|
||||
},
|
||||
// 设置故障
|
||||
setStoppage() {
|
||||
const operate = {
|
||||
start: true,
|
||||
send: true,
|
||||
code: this.selected.code,
|
||||
type: MapDeviceType.Switch.type,
|
||||
label: MapDeviceType.Switch.label,
|
||||
operation: OperationEvent.Switch.stoppage.menu.operation
|
||||
};
|
||||
this.$store.dispatch('training/next', operate).then(({ valid }) => {
|
||||
if (valid) {
|
||||
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
|
||||
} else {
|
||||
this.$refs.noticeInfo.doShow(operate);
|
||||
}
|
||||
}).catch(() => {
|
||||
this.$refs.noticeInfo.doShow(operate);
|
||||
});
|
||||
},
|
||||
// 取消故障
|
||||
cancelStoppage() {
|
||||
const operate = {
|
||||
start: true,
|
||||
send: true,
|
||||
code: this.selected.code,
|
||||
type: MapDeviceType.Switch.type,
|
||||
label: MapDeviceType.Switch.label,
|
||||
operation: OperationEvent.Switch.cancelStoppage.menu.operation
|
||||
};
|
||||
this.$store.dispatch('training/next', operate).then(({ valid }) => {
|
||||
if (valid) {
|
||||
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
|
||||
} else {
|
||||
this.$refs.noticeInfo.doShow(operate);
|
||||
}
|
||||
}).catch(() => {
|
||||
this.$refs.noticeInfo.doShow(operate);
|
||||
});
|
||||
},
|
||||
// 道岔单锁
|
||||
lock() {
|
||||
const operate = {
|
||||
start: true,
|
||||
code: this.selected.code,
|
||||
type: MapDeviceType.Switch.type,
|
||||
label: MapDeviceType.Switch.label,
|
||||
operation: OperationEvent.Switch.lock.menu.operation
|
||||
};
|
||||
this.$store.dispatch('training/next', operate).then(({ valid }) => {
|
||||
if (valid) {
|
||||
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
|
||||
this.$refs.switchControl.doShow(operate, this.selected);
|
||||
}
|
||||
});
|
||||
},
|
||||
// 道岔解封
|
||||
unlock() {
|
||||
const operate = {
|
||||
start: true,
|
||||
code: this.selected.code,
|
||||
type: MapDeviceType.Switch.type,
|
||||
label: MapDeviceType.Switch.label,
|
||||
operation: OperationEvent.Switch.unlock.menu.operation
|
||||
};
|
||||
this.$store.dispatch('training/next', operate).then(({ valid }) => {
|
||||
if (valid) {
|
||||
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
|
||||
this.$refs.switchCmdControl.doShow(operate, this.selected);
|
||||
}
|
||||
});
|
||||
},
|
||||
// 道岔封锁
|
||||
block() {
|
||||
const operate = {
|
||||
start: true,
|
||||
code: this.selected.code,
|
||||
type: MapDeviceType.Switch.type,
|
||||
label: MapDeviceType.Switch.label,
|
||||
operation: OperationEvent.Switch.block.menu.operation
|
||||
};
|
||||
this.$store.dispatch('training/next', operate).then(({ valid }) => {
|
||||
if (valid) {
|
||||
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
|
||||
this.$refs.switchControl.doShow(operate, this.selected);
|
||||
}
|
||||
});
|
||||
},
|
||||
// 道岔解封
|
||||
unblock() {
|
||||
const operate = {
|
||||
start: true,
|
||||
code: this.selected.code,
|
||||
type: MapDeviceType.Switch.type,
|
||||
label: MapDeviceType.Switch.label,
|
||||
operation: OperationEvent.Switch.unblock.menu.operation
|
||||
};
|
||||
this.$store.dispatch('training/next', operate).then(({ valid }) => {
|
||||
if (valid) {
|
||||
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
|
||||
this.$refs.switchCmdControl.doShow(operate, this.selected);
|
||||
}
|
||||
});
|
||||
},
|
||||
// 道岔强扳
|
||||
switchTurnoutForce() {
|
||||
const operate = {
|
||||
start: true,
|
||||
code: this.selected.code,
|
||||
type: MapDeviceType.Switch.type,
|
||||
label: MapDeviceType.Switch.label,
|
||||
operation: OperationEvent.Switch.turnoutForce.menu.operation
|
||||
};
|
||||
this.$store.dispatch('training/next', operate).then(({ valid }) => {
|
||||
if (valid) {
|
||||
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
|
||||
this.$refs.switchControl.doShow(operate, this.selected);
|
||||
}
|
||||
});
|
||||
},
|
||||
// 道岔转动
|
||||
switchTurnout() {
|
||||
const operate = {
|
||||
start: true,
|
||||
code: this.selected.code,
|
||||
type: MapDeviceType.Switch.type,
|
||||
label: MapDeviceType.Switch.label,
|
||||
operation: OperationEvent.Switch.turnout.menu.operation
|
||||
};
|
||||
|
||||
if (operate.operation) {
|
||||
this.$store.dispatch('training/next', operate).then(({ valid }) => {
|
||||
if (valid) {
|
||||
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
|
||||
this.$refs.switchControl.doShow(operate, this.selected);
|
||||
}
|
||||
});
|
||||
}
|
||||
},
|
||||
//道岔故障解锁
|
||||
fault() {
|
||||
let operate = {
|
||||
start: true,
|
||||
code: this.selected.code,
|
||||
type: MapDeviceType.Switch.type,
|
||||
label: MapDeviceType.Switch.label,
|
||||
operation: OperationEvent.Switch.fault.menu.operation
|
||||
};
|
||||
this.$store.dispatch('training/next', operate).then(({ valid }) => {
|
||||
if (valid) {
|
||||
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
|
||||
this.$refs.switchCmdControl.doShow(operate, this.selected);
|
||||
}
|
||||
});
|
||||
},
|
||||
//道岔计轴预复位
|
||||
axlePreReset() {
|
||||
let operate = {
|
||||
start: true,
|
||||
code: this.selected.code,
|
||||
type: MapDeviceType.Switch.type,
|
||||
label: MapDeviceType.Switch.label,
|
||||
operation: OperationEvent.Switch.axlePreReset.menu.operation
|
||||
};
|
||||
this.$store.dispatch('training/next', operate).then(({ valid }) => {
|
||||
if (valid) {
|
||||
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
|
||||
this.$refs.switchCmdControl.doShow(operate, this.selected);
|
||||
}
|
||||
});
|
||||
},
|
||||
//区段切除
|
||||
split() {
|
||||
let operate = {
|
||||
start: true,
|
||||
code: this.selected.code,
|
||||
type: MapDeviceType.Switch.type,
|
||||
label: MapDeviceType.Switch.label,
|
||||
operation: OperationEvent.Switch.split.menu.operation
|
||||
};
|
||||
this.$store.dispatch('training/next', operate).then(({ valid }) => {
|
||||
if (valid) {
|
||||
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
|
||||
this.$refs.switchControl.doShow(operate, this.selected);
|
||||
}
|
||||
});
|
||||
},
|
||||
//区段激活
|
||||
active() {
|
||||
let operate = {
|
||||
start: true,
|
||||
code: this.selected.code,
|
||||
type: MapDeviceType.Switch.type,
|
||||
label: MapDeviceType.Switch.label,
|
||||
operation: OperationEvent.Switch.active.menu.operation
|
||||
};
|
||||
this.$store.dispatch('training/next', operate).then(({ valid }) => {
|
||||
if (valid) {
|
||||
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
|
||||
this.$refs.switchControl.doShow(operate, this.selected);
|
||||
}
|
||||
});
|
||||
},
|
||||
//道岔设置速度
|
||||
setSpeed() {
|
||||
let operate = {
|
||||
start: true,
|
||||
code: this.selected.code,
|
||||
type: MapDeviceType.Switch.type,
|
||||
label: MapDeviceType.Switch.label,
|
||||
operation: OperationEvent.Switch.setSpeed.menu.operation
|
||||
};
|
||||
this.$store.dispatch('training/next', operate).then(({ valid }) => {
|
||||
if (valid) {
|
||||
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
|
||||
this.$refs.speedCmdControl.doShow(operate, this.selected);
|
||||
}
|
||||
});
|
||||
},
|
||||
//道岔取消速度
|
||||
cancelSpeed() {
|
||||
let operate = {
|
||||
start: true,
|
||||
send: true,
|
||||
code: this.selected.code,
|
||||
type: MapDeviceType.Switch.type,
|
||||
label: MapDeviceType.Switch.label,
|
||||
operation: OperationEvent.Switch.cancelSpeed.menu.operation
|
||||
};
|
||||
this.$store.dispatch('training/next', operate).then(({ valid, response }) => {
|
||||
if (valid) {
|
||||
let tempData = response.data;
|
||||
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
|
||||
this.$refs.speedCmdControl.doShow(operate, this.selected, tempData);
|
||||
}
|
||||
});
|
||||
}
|
||||
if (operate.operation) {
|
||||
this.$store.dispatch('training/next', operate).then(({ valid }) => {
|
||||
if (valid) {
|
||||
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
|
||||
this.$refs.switchControl.doShow(operate, this.selected);
|
||||
}
|
||||
});
|
||||
}
|
||||
},
|
||||
// 道岔故障解锁
|
||||
fault() {
|
||||
const operate = {
|
||||
start: true,
|
||||
code: this.selected.code,
|
||||
type: MapDeviceType.Switch.type,
|
||||
label: MapDeviceType.Switch.label,
|
||||
operation: OperationEvent.Switch.fault.menu.operation
|
||||
};
|
||||
this.$store.dispatch('training/next', operate).then(({ valid }) => {
|
||||
if (valid) {
|
||||
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
|
||||
this.$refs.switchCmdControl.doShow(operate, this.selected);
|
||||
}
|
||||
});
|
||||
},
|
||||
// 道岔计轴预复位
|
||||
axlePreReset() {
|
||||
const operate = {
|
||||
start: true,
|
||||
code: this.selected.code,
|
||||
type: MapDeviceType.Switch.type,
|
||||
label: MapDeviceType.Switch.label,
|
||||
operation: OperationEvent.Switch.axlePreReset.menu.operation
|
||||
};
|
||||
this.$store.dispatch('training/next', operate).then(({ valid }) => {
|
||||
if (valid) {
|
||||
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
|
||||
this.$refs.switchCmdControl.doShow(operate, this.selected);
|
||||
}
|
||||
});
|
||||
},
|
||||
// 区段切除
|
||||
split() {
|
||||
const operate = {
|
||||
start: true,
|
||||
code: this.selected.code,
|
||||
type: MapDeviceType.Switch.type,
|
||||
label: MapDeviceType.Switch.label,
|
||||
operation: OperationEvent.Switch.split.menu.operation
|
||||
};
|
||||
this.$store.dispatch('training/next', operate).then(({ valid }) => {
|
||||
if (valid) {
|
||||
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
|
||||
this.$refs.switchControl.doShow(operate, this.selected);
|
||||
}
|
||||
});
|
||||
},
|
||||
// 区段激活
|
||||
active() {
|
||||
const operate = {
|
||||
start: true,
|
||||
code: this.selected.code,
|
||||
type: MapDeviceType.Switch.type,
|
||||
label: MapDeviceType.Switch.label,
|
||||
operation: OperationEvent.Switch.active.menu.operation
|
||||
};
|
||||
this.$store.dispatch('training/next', operate).then(({ valid }) => {
|
||||
if (valid) {
|
||||
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
|
||||
this.$refs.switchControl.doShow(operate, this.selected);
|
||||
}
|
||||
});
|
||||
},
|
||||
// 道岔设置速度
|
||||
setSpeed() {
|
||||
const operate = {
|
||||
start: true,
|
||||
code: this.selected.code,
|
||||
type: MapDeviceType.Switch.type,
|
||||
label: MapDeviceType.Switch.label,
|
||||
operation: OperationEvent.Switch.setSpeed.menu.operation
|
||||
};
|
||||
this.$store.dispatch('training/next', operate).then(({ valid }) => {
|
||||
if (valid) {
|
||||
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
|
||||
this.$refs.speedCmdControl.doShow(operate, this.selected);
|
||||
}
|
||||
});
|
||||
},
|
||||
// 道岔取消速度
|
||||
cancelSpeed() {
|
||||
const operate = {
|
||||
start: true,
|
||||
send: true,
|
||||
code: this.selected.code,
|
||||
type: MapDeviceType.Switch.type,
|
||||
label: MapDeviceType.Switch.label,
|
||||
operation: OperationEvent.Switch.cancelSpeed.menu.operation
|
||||
};
|
||||
this.$store.dispatch('training/next', operate).then(({ valid, response }) => {
|
||||
if (valid) {
|
||||
const tempData = response.data;
|
||||
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
|
||||
this.$refs.speedCmdControl.doShow(operate, this.selected, tempData);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
</script>
|
||||
}
|
||||
};
|
||||
</script>
|
||||
|
@ -1,209 +1,214 @@
|
||||
<template>
|
||||
<el-dialog class="fuzhou-01__systerm alarm-detail" :title="level+$t('menu.passiveDialog.alarmDetailInformation')" :visible.sync="show" width="760px"
|
||||
:before-close="doClose" :zIndex="2000" :modal="false" :close-on-click-modal="false" v-dialogDrag>
|
||||
<el-form label-width="80px" size="mini">
|
||||
<el-row>
|
||||
<el-col :span="8">
|
||||
<el-form-item :label="$t('menu.passiveDialog.lineName')">
|
||||
<el-input v-model="model.lineName" disabled></el-input>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="8">
|
||||
<el-form-item :label="$t('menu.passiveDialog.unitName')">
|
||||
<el-input v-model="model.unitName" disabled></el-input>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="8">
|
||||
<el-form-item :label="$t('menu.passiveDialog.moduleName')">
|
||||
<el-input v-model="model.moduleName" disabled></el-input>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<el-row>
|
||||
<el-col :span="9">
|
||||
<el-form-item :label="$t('menu.passiveDialog.alarmDate')">
|
||||
<el-date-picker v-model="model.alarmDate" type="datetime" :placeholder="$t('menu.passiveDialog.selectDate')" disabled>
|
||||
</el-date-picker>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="7">
|
||||
<el-form-item>
|
||||
<span slot="label">{{$t('menu.passiveDialog.level')}}</span>
|
||||
<el-input v-model="model.level" disabled></el-input>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="8">
|
||||
<el-form-item :label="$t('menu.passiveDialog.confirmStatus')">
|
||||
<el-input v-model="model.confirm" disabled></el-input>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<el-row>
|
||||
<el-col :span="9" class="alarm-type">
|
||||
<el-form-item>
|
||||
<span slot="label">{{$t('menu.passiveDialog.type')}}</span>
|
||||
<el-input v-model="model.type" disabled></el-input>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="15" class="alarm-child-type">
|
||||
<el-form-item :label="$t('menu.passiveDialog.childType')">
|
||||
<el-input v-model="model.childType" disabled></el-input>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<el-form-item :label="$t('menu.passiveDialog.timeSummary')">
|
||||
<el-input v-model="model.timeSummary" disabled></el-input>
|
||||
</el-form-item>
|
||||
<el-form-item :label="$t('menu.passiveDialog.recommendedOperation')">
|
||||
<el-input v-model="model.recommendedOperation" disabled></el-input>
|
||||
</el-form-item>
|
||||
<div class="alarm-detail-description">
|
||||
<span>{{$t('menu.passiveDialog.alarmDetailedDescription')}}</span><br>
|
||||
<el-input type="textarea" :rows="5" :placeholder="$t('menu.passiveDialog.inputContent')" v-model="model.alarmDetail" disabled>
|
||||
</el-input>
|
||||
</div>
|
||||
</el-form>
|
||||
<el-row class="button-group">
|
||||
<el-col :span="3" :offset="9">
|
||||
<el-button :id="domIdCancel" type="primary" :loading="loading" @click="commit">{{$t('menu.passiveDialog.confirm')}}</el-button>
|
||||
</el-col>
|
||||
<el-col :span="10">
|
||||
<span style="line-height:26px">{{$t('menu.passiveDialog.unconfirmedMessageOne')}}{{level}}{{$t('menu.passiveDialog.unconfirmedMessageTwo')}}</span>
|
||||
</el-col>
|
||||
</el-row>
|
||||
</span>
|
||||
</el-dialog>
|
||||
<el-dialog
|
||||
v-dialogDrag
|
||||
class="fuzhou-01__systerm alarm-detail"
|
||||
:title="level+$t('menu.passiveDialog.alarmDetailInformation')"
|
||||
:visible.sync="show"
|
||||
width="760px"
|
||||
:before-close="doClose"
|
||||
:z-index="2000"
|
||||
:modal="false"
|
||||
:close-on-click-modal="false"
|
||||
>
|
||||
<el-form label-width="80px" size="mini">
|
||||
<el-row>
|
||||
<el-col :span="8">
|
||||
<el-form-item :label="$t('menu.passiveDialog.lineName')">
|
||||
<el-input v-model="model.lineName" disabled />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="8">
|
||||
<el-form-item :label="$t('menu.passiveDialog.unitName')">
|
||||
<el-input v-model="model.unitName" disabled />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="8">
|
||||
<el-form-item :label="$t('menu.passiveDialog.moduleName')">
|
||||
<el-input v-model="model.moduleName" disabled />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<el-row>
|
||||
<el-col :span="9">
|
||||
<el-form-item :label="$t('menu.passiveDialog.alarmDate')">
|
||||
<el-date-picker v-model="model.alarmDate" type="datetime" :placeholder="$t('menu.passiveDialog.selectDate')" disabled />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="7">
|
||||
<el-form-item>
|
||||
<span slot="label">{{ $t('menu.passiveDialog.level') }}</span>
|
||||
<el-input v-model="model.level" disabled />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="8">
|
||||
<el-form-item :label="$t('menu.passiveDialog.confirmStatus')">
|
||||
<el-input v-model="model.confirm" disabled />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<el-row>
|
||||
<el-col :span="9" class="alarm-type">
|
||||
<el-form-item>
|
||||
<span slot="label">{{ $t('menu.passiveDialog.type') }}</span>
|
||||
<el-input v-model="model.type" disabled />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="15" class="alarm-child-type">
|
||||
<el-form-item :label="$t('menu.passiveDialog.childType')">
|
||||
<el-input v-model="model.childType" disabled />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<el-form-item :label="$t('menu.passiveDialog.timeSummary')">
|
||||
<el-input v-model="model.timeSummary" disabled />
|
||||
</el-form-item>
|
||||
<el-form-item :label="$t('menu.passiveDialog.recommendedOperation')">
|
||||
<el-input v-model="model.recommendedOperation" disabled />
|
||||
</el-form-item>
|
||||
<div class="alarm-detail-description">
|
||||
<span>{{ $t('menu.passiveDialog.alarmDetailedDescription') }}</span><br>
|
||||
<el-input v-model="model.alarmDetail" type="textarea" :rows="5" :placeholder="$t('menu.passiveDialog.inputContent')" disabled />
|
||||
</div>
|
||||
</el-form>
|
||||
<el-row class="button-group">
|
||||
<el-col :span="3" :offset="9">
|
||||
<el-button :id="domIdCancel" type="primary" :loading="loading" @click="commit">{{ $t('menu.passiveDialog.confirm') }}</el-button>
|
||||
</el-col>
|
||||
<el-col :span="10">
|
||||
<span style="line-height:26px">{{ $t('menu.passiveDialog.unconfirmedMessageOne') }}{{ level }}{{ $t('menu.passiveDialog.unconfirmedMessageTwo') }}</span>
|
||||
</el-col>
|
||||
</el-row>
|
||||
</el-dialog>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import { mapGetters } from 'vuex';
|
||||
import { MapDeviceType, OperationEvent } from '@/scripts/ConstDic';
|
||||
import { mapGetters } from 'vuex';
|
||||
import { OperationEvent } from '@/scripts/ConstDic';
|
||||
|
||||
export default {
|
||||
name: 'AlarmDetail',
|
||||
data() {
|
||||
return {
|
||||
dialogShow: false,
|
||||
loading: false,
|
||||
level: 0,
|
||||
operate: null,
|
||||
controlProps: {
|
||||
'01': this.$t('menu.passiveDialog.centralControl'),
|
||||
'02': this.$t('menu.passiveDialog.stationControl')
|
||||
},
|
||||
model: {
|
||||
lineName: '',
|
||||
unitName: '',
|
||||
moduleName: '',
|
||||
level: '',
|
||||
confirm: '',
|
||||
alarmDate: '',
|
||||
type: '',
|
||||
childType: '',
|
||||
timeSummary: '',
|
||||
recommendedOperation: '',
|
||||
alarmDetail: ''
|
||||
}
|
||||
}
|
||||
},
|
||||
computed: {
|
||||
...mapGetters('map', [
|
||||
'name',
|
||||
]),
|
||||
show() {
|
||||
return this.dialogShow && !this.$store.state.menuOperation.break;
|
||||
},
|
||||
domIdCancel() {
|
||||
return this.dialogShow ? OperationEvent.Command.close.alarm.domId : '';
|
||||
},
|
||||
},
|
||||
watch: {
|
||||
'$store.state.socket.msgHead': function (elem) {
|
||||
if (elem && elem.type == 'resp' && elem.agree) {
|
||||
if (elem.agree) {
|
||||
let operate = this.$store.state.training.operate;
|
||||
let control = this.$store.getters['map/getDeviceByCode'](elem.stationControlCode);
|
||||
let station = this.$store.getters['map/getDeviceByCode'](control.stationCode);
|
||||
let newOperate = {
|
||||
type: operate.type,
|
||||
name: station.name,
|
||||
currentMode: elem.currentMode
|
||||
}
|
||||
export default {
|
||||
name: 'AlarmDetail',
|
||||
data() {
|
||||
return {
|
||||
dialogShow: false,
|
||||
loading: false,
|
||||
level: 0,
|
||||
operate: null,
|
||||
controlProps: {
|
||||
'01': this.$t('menu.passiveDialog.centralControl'),
|
||||
'02': this.$t('menu.passiveDialog.stationControl')
|
||||
},
|
||||
model: {
|
||||
lineName: '',
|
||||
unitName: '',
|
||||
moduleName: '',
|
||||
level: '',
|
||||
confirm: '',
|
||||
alarmDate: '',
|
||||
type: '',
|
||||
childType: '',
|
||||
timeSummary: '',
|
||||
recommendedOperation: '',
|
||||
alarmDetail: ''
|
||||
}
|
||||
};
|
||||
},
|
||||
computed: {
|
||||
...mapGetters('map', [
|
||||
'name'
|
||||
]),
|
||||
show() {
|
||||
return this.dialogShow && !this.$store.state.menuOperation.break;
|
||||
},
|
||||
domIdCancel() {
|
||||
return this.dialogShow ? OperationEvent.Command.close.alarm.domId : '';
|
||||
}
|
||||
},
|
||||
watch: {
|
||||
'$store.state.socket.msgHead': function (elem) {
|
||||
if (elem && elem.type == 'resp' && elem.agree) {
|
||||
if (elem.agree) {
|
||||
const operate = this.$store.state.training.operate;
|
||||
const control = this.$store.getters['map/getDeviceByCode'](elem.stationControlCode);
|
||||
const station = this.$store.getters['map/getDeviceByCode'](control.stationCode);
|
||||
const newOperate = {
|
||||
type: operate.type,
|
||||
name: station.name,
|
||||
currentMode: elem.currentMode
|
||||
};
|
||||
|
||||
this.doShow(newOperate);
|
||||
}
|
||||
}
|
||||
},
|
||||
},
|
||||
mounted() {
|
||||
this.$nextTick(() => {
|
||||
this.$store.dispatch('training/tipReload');
|
||||
})
|
||||
},
|
||||
methods: {
|
||||
doShow(operate) {
|
||||
this.operate = operate || {};
|
||||
this.model = {
|
||||
lineName: this.name,
|
||||
unitName: this.operate.name,
|
||||
moduleName: this.$t('menu.passiveDialog.cmmControlModeConversionMode'),
|
||||
level: this.$t('menu.passiveDialog.zeroLevelAlarm'),
|
||||
confirm: this.$t('menu.passiveDialog.confirmStatus'),
|
||||
alarmDate: new Date(),
|
||||
type: this.$t('menu.passiveDialog.systemEvent'),
|
||||
childType: this.$t('menu.passiveDialog.childTypeTips'),
|
||||
timeSummary: this.$t('menu.passiveDialog.controlModeSummary'),
|
||||
recommendedOperation: '',
|
||||
alarmDetail: `${$t('menu.passiveDialog.controlModeTransfer')} ${this.operate.name}${$t('menu.passiveDialog.alarmDetailOne')}${operate.currentMode == '01' ? this.$t('menu.passiveDialog.stationToCentral') : this.$t('menu.passiveDialog.centralToStation') }!`
|
||||
}
|
||||
this.dialogShow = true;
|
||||
this.$nextTick(function () {
|
||||
this.$store.dispatch('training/emitTipFresh');
|
||||
});
|
||||
},
|
||||
doClose() {
|
||||
if (this.dialogShow) {
|
||||
this.$store.dispatch('socket/shiftMsgQueue');
|
||||
}
|
||||
this.dialogShow = false;
|
||||
this.$store.dispatch('training/emitTipFresh');
|
||||
},
|
||||
cancel() {
|
||||
let operate = {
|
||||
type: this.operate.type,
|
||||
operation: OperationEvent.Command.close.alarm.operation,
|
||||
}
|
||||
this.doShow(newOperate);
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
mounted() {
|
||||
this.$nextTick(() => {
|
||||
this.$store.dispatch('training/tipReload');
|
||||
});
|
||||
},
|
||||
methods: {
|
||||
doShow(operate) {
|
||||
this.operate = operate || {};
|
||||
this.model = {
|
||||
lineName: this.name,
|
||||
unitName: this.operate.name,
|
||||
moduleName: this.$t('menu.passiveDialog.cmmControlModeConversionMode'),
|
||||
level: this.$t('menu.passiveDialog.zeroLevelAlarm'),
|
||||
confirm: this.$t('menu.passiveDialog.confirmStatus'),
|
||||
alarmDate: new Date(),
|
||||
type: this.$t('menu.passiveDialog.systemEvent'),
|
||||
childType: this.$t('menu.passiveDialog.childTypeTips'),
|
||||
timeSummary: this.$t('menu.passiveDialog.controlModeSummary'),
|
||||
recommendedOperation: '',
|
||||
alarmDetail: `${this.$t('menu.passiveDialog.controlModeTransfer')} ${this.operate.name}${this.$t('menu.passiveDialog.alarmDetailOne')}${operate.currentMode == '01' ? this.$t('menu.passiveDialog.stationToCentral') : this.$t('menu.passiveDialog.centralToStation')}!`
|
||||
};
|
||||
this.dialogShow = true;
|
||||
this.$nextTick(function () {
|
||||
this.$store.dispatch('training/emitTipFresh');
|
||||
});
|
||||
},
|
||||
doClose() {
|
||||
if (this.dialogShow) {
|
||||
this.$store.dispatch('socket/shiftMsgQueue');
|
||||
}
|
||||
this.dialogShow = false;
|
||||
this.$store.dispatch('training/emitTipFresh');
|
||||
},
|
||||
cancel() {
|
||||
const operate = {
|
||||
type: this.operate.type,
|
||||
operation: OperationEvent.Command.close.alarm.operation
|
||||
};
|
||||
|
||||
this.$store.dispatch('training/next', operate).then(({ valid }) => {
|
||||
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
|
||||
if (valid) {
|
||||
this.doClose();
|
||||
}
|
||||
})
|
||||
},
|
||||
commit() {
|
||||
let operate = {
|
||||
type: this.operate.type,
|
||||
operation: OperationEvent.Command.close.alarm.operation,
|
||||
}
|
||||
this.$store.dispatch('training/next', operate).then(({ valid }) => {
|
||||
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
|
||||
if (valid) {
|
||||
this.doClose();
|
||||
}
|
||||
})
|
||||
},
|
||||
isClose() {
|
||||
return this.dialogShow;
|
||||
}
|
||||
}
|
||||
}
|
||||
this.$store.dispatch('training/next', operate).then(({ valid }) => {
|
||||
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
|
||||
if (valid) {
|
||||
this.doClose();
|
||||
}
|
||||
});
|
||||
},
|
||||
commit() {
|
||||
const operate = {
|
||||
type: this.operate.type,
|
||||
operation: OperationEvent.Command.close.alarm.operation
|
||||
};
|
||||
this.$store.dispatch('training/next', operate).then(({ valid }) => {
|
||||
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
|
||||
if (valid) {
|
||||
this.doClose();
|
||||
}
|
||||
});
|
||||
},
|
||||
isClose() {
|
||||
return this.dialogShow;
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
</script>
|
||||
<style rel="stylesheet/scss" lang="scss" scoped>
|
||||
@import "src/styles/mixin.scss";
|
||||
|
||||
|
||||
.alarm-type .el-input {
|
||||
width: 220px;
|
||||
}
|
||||
@ -212,4 +217,4 @@
|
||||
padding-left: 12px;
|
||||
text-align: left;
|
||||
}
|
||||
</style>
|
||||
</style>
|
||||
|
@ -1,290 +1,308 @@
|
||||
<template>
|
||||
<el-dialog class="fuzhou-01__systerm passive-control" :title="$t('menu.passiveDialog.controlModeRequest')" :visible.sync="show" width="700px"
|
||||
:before-close="doClose" :showClose="true" :zIndex="2000" :modal="false" :close-on-click-modal="false"
|
||||
v-dialogDrag>
|
||||
<span class="control-label">{{`${requestInfo}${$t('menu.passiveDialog.requestAreaControlMode')}`}}</span>
|
||||
<el-table ref="multipleTable" :data="tableData" border row-key="code" style="width: 100%" height="250" center
|
||||
size="mini" highlight-current-row>
|
||||
<el-table-column prop="operate" :label="$t('menu.passiveDialog.operatingArea')">
|
||||
<template slot-scope="scope">
|
||||
<span :style="{color: scope.row.disabled ? '#CBCBCB':'unset'}">{{scope.row.operate}}</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="control" :label="$t('menu.passiveDialog.currentControlMode')" width="120">
|
||||
<template slot-scope="scope">
|
||||
<span :style="{color: scope.row.disabled ? '#CBCBCB':'unset'}">{{scope.row.control.name}}</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="target" :label="$t('menu.passiveDialog.requestControlMode')" width="120">
|
||||
<template slot-scope="scope">
|
||||
<span :style="{color: scope.row.disabled ? '#CBCBCB':'unset'}">{{scope.row.target.name}}</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="agree" :label="$t('menu.passiveDialog.isAgree')" width="140">
|
||||
<template slot-scope="scope">
|
||||
<el-checkbox ref="agree" v-model="scope.row.agree" :disabled="scope.row.disabled"></el-checkbox>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
<span class="control-label">{{$t('menu.passiveDialog.messageOne')}} {{count}} {{$t('menu.passiveDialog.messageTwo')}}</span>
|
||||
<el-row class="button-group">
|
||||
<el-col :span="10" :offset="3">
|
||||
<el-button :id="domAgree" :disabled="disabledAgree" @click="agree">{{$t('menu.passiveDialog.agree')}}
|
||||
</el-button>
|
||||
</el-col>
|
||||
<el-col :span="6" :offset="4">
|
||||
<el-button :id="domIdRefuse" :disabled="disabledRefuse" @click="refuse">{{$t('menu.passiveDialog.refuse')}}</el-button>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<notice-info ref="noticeInfo"></notice-info>
|
||||
</el-dialog>
|
||||
<el-dialog
|
||||
v-dialogDrag
|
||||
class="fuzhou-01__systerm passive-control"
|
||||
:title="$t('menu.passiveDialog.controlModeRequest')"
|
||||
:visible.sync="show"
|
||||
width="700px"
|
||||
:before-close="doClose"
|
||||
:show-close="true"
|
||||
:z-index="2000"
|
||||
:modal="false"
|
||||
:close-on-click-modal="false"
|
||||
>
|
||||
<span class="control-label">{{ `${requestInfo}${$t('menu.passiveDialog.requestAreaControlMode')}` }}</span>
|
||||
<el-table
|
||||
ref="multipleTable"
|
||||
:data="tableData"
|
||||
border
|
||||
row-key="code"
|
||||
style="width: 100%"
|
||||
height="250"
|
||||
center
|
||||
size="mini"
|
||||
highlight-current-row
|
||||
>
|
||||
<el-table-column prop="operate" :label="$t('menu.passiveDialog.operatingArea')">
|
||||
<template slot-scope="scope">
|
||||
<span :style="{color: scope.row.disabled ? '#CBCBCB':'unset'}">{{ scope.row.operate }}</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="control" :label="$t('menu.passiveDialog.currentControlMode')" width="120">
|
||||
<template slot-scope="scope">
|
||||
<span :style="{color: scope.row.disabled ? '#CBCBCB':'unset'}">{{ scope.row.control.name }}</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="target" :label="$t('menu.passiveDialog.requestControlMode')" width="120">
|
||||
<template slot-scope="scope">
|
||||
<span :style="{color: scope.row.disabled ? '#CBCBCB':'unset'}">{{ scope.row.target.name }}</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="agree" :label="$t('menu.passiveDialog.isAgree')" width="140">
|
||||
<template slot-scope="scope">
|
||||
<el-checkbox ref="agree" v-model="scope.row.agree" :disabled="scope.row.disabled" />
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
<span class="control-label">{{ $t('menu.passiveDialog.messageOne') }} {{ count }} {{ $t('menu.passiveDialog.messageTwo') }}</span>
|
||||
<el-row class="button-group">
|
||||
<el-col :span="10" :offset="3">
|
||||
<el-button :id="domAgree" :disabled="disabledAgree" @click="agree">{{ $t('menu.passiveDialog.agree') }}
|
||||
</el-button>
|
||||
</el-col>
|
||||
<el-col :span="6" :offset="4">
|
||||
<el-button :id="domIdRefuse" :disabled="disabledRefuse" @click="refuse">{{ $t('menu.passiveDialog.refuse') }}</el-button>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<notice-info ref="noticeInfo" />
|
||||
</el-dialog>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import { mapGetters } from 'vuex';
|
||||
import { MapDeviceType, TrainingMode, OperationEvent, getDomIdByOperation, checkOperationIsCurrentOperate } from '@/scripts/ConstDic';
|
||||
import NoticeInfo from '../dialog/childDialog/childDialog/noticeInfo';
|
||||
import { MapDeviceType, OperationEvent } from '@/scripts/ConstDic';
|
||||
import NoticeInfo from '../dialog/childDialog/childDialog/noticeInfo';
|
||||
|
||||
export default {
|
||||
name: 'RequestControl',
|
||||
components: {
|
||||
NoticeInfo
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
dialogShow: false,
|
||||
disabledAgree: false,
|
||||
disabledRefuse: false,
|
||||
requestInfo: this.$t('menu.passiveDialog.dispatcherWorkstation'),
|
||||
controlProps: {
|
||||
'01': this.$t('menu.passiveDialog.inTheControl'),
|
||||
'02': this.$t('menu.passiveDialog.stationControl')
|
||||
},
|
||||
selection: [],
|
||||
tableData: [],
|
||||
timer: null,
|
||||
timeout: 61,
|
||||
count: 0,
|
||||
commandId: '',
|
||||
}
|
||||
},
|
||||
computed: {
|
||||
targetStatus() {
|
||||
if (this.$store.state.training.prdType == '01') {
|
||||
return '01';
|
||||
}
|
||||
if (this.$store.state.training.prdType == '02') {
|
||||
return '02'
|
||||
}
|
||||
},
|
||||
show() {
|
||||
return this.dialogShow && !this.$store.state.menuOperation.break;
|
||||
},
|
||||
domIdChoose() {
|
||||
return this.dialogShow ? OperationEvent.StationControl.controlResponse.choose.domId : '';
|
||||
},
|
||||
domAgree() {
|
||||
return this.dialogShow ? OperationEvent.StationControl.controlResponse.agree.domId : '';
|
||||
},
|
||||
domIdRefuse() {
|
||||
return this.dialogShow ? OperationEvent.StationControl.controlResponse.refuse.domId : '';
|
||||
}
|
||||
},
|
||||
watch: {
|
||||
tableData: {
|
||||
handler(val, oldVal) {
|
||||
this.checkTableDataSelction(val);
|
||||
},
|
||||
deep: true
|
||||
},
|
||||
'$store.state.socket.msgHead': function (elem) {
|
||||
if (elem && elem.type == 'req') {
|
||||
if (elem.stationControlCode) {
|
||||
this.doShow(elem);
|
||||
this.commandId = elem.commandId;
|
||||
}
|
||||
}
|
||||
},
|
||||
},
|
||||
mounted() {
|
||||
this.$nextTick(() => {
|
||||
this.$store.dispatch('training/tipReload');
|
||||
})
|
||||
},
|
||||
methods: {
|
||||
createTimer() {
|
||||
this.count = this.timeout;
|
||||
this.timer = setInterval(() => {
|
||||
if (this.count <= 0) {
|
||||
this.doClose();
|
||||
return;
|
||||
}
|
||||
this.count = this.count - 1;
|
||||
}, 1000)
|
||||
},
|
||||
clearTimer() {
|
||||
if (this.timer) {
|
||||
clearInterval(this.timer);
|
||||
this.timer = null;
|
||||
}
|
||||
},
|
||||
checkTableDataSelction(data) {
|
||||
let selection = [];
|
||||
if (data && data.length > 0) {
|
||||
data.forEach(row => {
|
||||
if (row.agree && !row.disabled) {
|
||||
selection.push(row);
|
||||
}
|
||||
})
|
||||
}
|
||||
export default {
|
||||
name: 'RequestControl',
|
||||
components: {
|
||||
NoticeInfo
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
dialogShow: false,
|
||||
disabledAgree: false,
|
||||
disabledRefuse: false,
|
||||
requestInfo: this.$t('menu.passiveDialog.dispatcherWorkstation'),
|
||||
controlProps: {
|
||||
'01': this.$t('menu.passiveDialog.inTheControl'),
|
||||
'02': this.$t('menu.passiveDialog.stationControl')
|
||||
},
|
||||
selection: [],
|
||||
tableData: [],
|
||||
timer: null,
|
||||
timeout: 61,
|
||||
count: 0,
|
||||
commandId: ''
|
||||
};
|
||||
},
|
||||
computed: {
|
||||
targetStatus() {
|
||||
if (this.$store.state.training.prdType == '01') {
|
||||
return '01';
|
||||
}
|
||||
if (this.$store.state.training.prdType == '02') {
|
||||
return '02';
|
||||
}
|
||||
return '';
|
||||
},
|
||||
show() {
|
||||
return this.dialogShow && !this.$store.state.menuOperation.break;
|
||||
},
|
||||
domIdChoose() {
|
||||
return this.dialogShow ? OperationEvent.StationControl.controlResponse.choose.domId : '';
|
||||
},
|
||||
domAgree() {
|
||||
return this.dialogShow ? OperationEvent.StationControl.controlResponse.agree.domId : '';
|
||||
},
|
||||
domIdRefuse() {
|
||||
return this.dialogShow ? OperationEvent.StationControl.controlResponse.refuse.domId : '';
|
||||
}
|
||||
},
|
||||
watch: {
|
||||
tableData: {
|
||||
handler(val, oldVal) {
|
||||
this.checkTableDataSelction(val);
|
||||
},
|
||||
deep: true
|
||||
},
|
||||
'$store.state.socket.msgHead': function (elem) {
|
||||
if (elem && elem.type == 'req') {
|
||||
if (elem.stationControlCode) {
|
||||
this.doShow(elem);
|
||||
this.commandId = elem.commandId;
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
mounted() {
|
||||
this.$nextTick(() => {
|
||||
this.$store.dispatch('training/tipReload');
|
||||
});
|
||||
},
|
||||
methods: {
|
||||
createTimer() {
|
||||
this.count = this.timeout;
|
||||
this.timer = setInterval(() => {
|
||||
if (this.count <= 0) {
|
||||
this.doClose();
|
||||
return;
|
||||
}
|
||||
this.count = this.count - 1;
|
||||
}, 1000);
|
||||
},
|
||||
clearTimer() {
|
||||
if (this.timer) {
|
||||
clearInterval(this.timer);
|
||||
this.timer = null;
|
||||
}
|
||||
},
|
||||
checkTableDataSelction(data) {
|
||||
const selection = [];
|
||||
if (data && data.length > 0) {
|
||||
data.forEach(row => {
|
||||
if (row.agree && !row.disabled) {
|
||||
selection.push(row);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
this.disabledSend = selection.length ? false : true;
|
||||
if (JSON.stringify(selection) !== JSON.stringify(this.selection)) {
|
||||
this.handleChooseChange(selection);
|
||||
this.selection = selection;
|
||||
this.disabledAgree = this.selection.length <= 0;
|
||||
}
|
||||
},
|
||||
updateTableData(code) {
|
||||
this.tableData = [];
|
||||
this.disabledSend = !selection.length;
|
||||
if (JSON.stringify(selection) !== JSON.stringify(this.selection)) {
|
||||
this.handleChooseChange(selection);
|
||||
this.selection = selection;
|
||||
this.disabledAgree = this.selection.length <= 0;
|
||||
}
|
||||
},
|
||||
updateTableData(code) {
|
||||
this.tableData = [];
|
||||
|
||||
let model = {
|
||||
code: code,
|
||||
operate: '',
|
||||
control: { code: '', name: '' },
|
||||
target: { code: '', name: '' },
|
||||
agree: false,
|
||||
disabled: false,
|
||||
}
|
||||
const model = {
|
||||
code: code,
|
||||
operate: '',
|
||||
control: { code: '', name: '' },
|
||||
target: { code: '', name: '' },
|
||||
agree: false,
|
||||
disabled: false
|
||||
};
|
||||
|
||||
let device = this.$store.getters['map/getDeviceByCode'](code);
|
||||
if (device) {
|
||||
let control = (device || {}).state;
|
||||
if (control) {
|
||||
model.control = { status: control.status, name: this.controlProps[control.status] };
|
||||
model.target = { status: this.targetStatus, name: this.controlProps[this.targetStatus] };
|
||||
}
|
||||
const device = this.$store.getters['map/getDeviceByCode'](code);
|
||||
if (device) {
|
||||
const control = (device || {}).state;
|
||||
if (control) {
|
||||
model.control = { status: control.status, name: this.controlProps[control.status] };
|
||||
model.target = { status: this.targetStatus, name: this.controlProps[this.targetStatus] };
|
||||
}
|
||||
|
||||
let station = this.$store.getters['map/getDeviceByCode'](device.stationCode);
|
||||
if (station) {
|
||||
model.operate = station.name || '';
|
||||
}
|
||||
}
|
||||
const station = this.$store.getters['map/getDeviceByCode'](device.stationCode);
|
||||
if (station) {
|
||||
model.operate = station.name || '';
|
||||
}
|
||||
}
|
||||
|
||||
this.tableData.push(model);
|
||||
},
|
||||
doShow(msgHead) {
|
||||
this.requestInfo = `${msgHead.fromMember.deviceName}`;
|
||||
if (msgHead.fromMember.nickName) {
|
||||
this.requestInfo = `${msgHead.fromMember.deviceName}(${msgHead.fromMember.nickName})`;
|
||||
}
|
||||
this.dialogShow = true;
|
||||
this.disabledAgree = true;
|
||||
this.createTimer();
|
||||
this.updateTableData(msgHead.stationControlCode);
|
||||
this.tableData.push(model);
|
||||
},
|
||||
doShow(msgHead) {
|
||||
this.requestInfo = `${msgHead.fromMember.deviceName}`;
|
||||
if (msgHead.fromMember.nickName) {
|
||||
this.requestInfo = `${msgHead.fromMember.deviceName}(${msgHead.fromMember.nickName})`;
|
||||
}
|
||||
this.dialogShow = true;
|
||||
this.disabledAgree = true;
|
||||
this.createTimer();
|
||||
this.updateTableData(msgHead.stationControlCode);
|
||||
|
||||
let operate = {
|
||||
start: true,
|
||||
type: MapDeviceType.StationControl.type,
|
||||
operation: OperationEvent.StationControl.controlResponse.menu.operation,
|
||||
};
|
||||
const operate = {
|
||||
start: true,
|
||||
type: MapDeviceType.StationControl.type,
|
||||
operation: OperationEvent.StationControl.controlResponse.menu.operation
|
||||
};
|
||||
|
||||
this.$store.dispatch('training/emitTipFresh');
|
||||
this.$store.dispatch('training/next', operate).then(({ valid }) => {
|
||||
if (valid) {
|
||||
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
|
||||
}
|
||||
});
|
||||
this.$store.dispatch('training/emitTipFresh');
|
||||
this.$store.dispatch('training/next', operate).then(({ valid }) => {
|
||||
if (valid) {
|
||||
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
|
||||
}
|
||||
});
|
||||
|
||||
},
|
||||
doClose() {
|
||||
this.disabledAgree = false;
|
||||
if (this.dialogShow) {
|
||||
this.$store.dispatch('socket/shiftMsgQueue');
|
||||
}
|
||||
},
|
||||
doClose() {
|
||||
this.disabledAgree = false;
|
||||
if (this.dialogShow) {
|
||||
this.$store.dispatch('socket/shiftMsgQueue');
|
||||
}
|
||||
|
||||
this.count = 0;
|
||||
this.dialogShow = false;
|
||||
this.clearTimer();
|
||||
this.$store.dispatch('training/emitTipFresh');
|
||||
this.$refs.multipleTable.setCurrentRow();
|
||||
},
|
||||
serializeCodeListWithSeparator(sep) {
|
||||
let codeList = [];
|
||||
if (this.selection && this.selection.length) {
|
||||
this.selection.forEach(elem => {
|
||||
codeList.push(elem.code);
|
||||
})
|
||||
}
|
||||
return codeList.join(sep);
|
||||
},
|
||||
handleChooseChange(selection) {
|
||||
this.selection = selection;
|
||||
if (selection && selection.length) {
|
||||
let operate = {
|
||||
type: MapDeviceType.StationControl.type,
|
||||
operation: OperationEvent.StationControl.controlResponse.choose.operation,
|
||||
val: this.serializeCodeListWithSeparator('::'),
|
||||
}
|
||||
this.count = 0;
|
||||
this.dialogShow = false;
|
||||
this.clearTimer();
|
||||
this.$store.dispatch('training/emitTipFresh');
|
||||
this.$refs.multipleTable.setCurrentRow();
|
||||
},
|
||||
serializeCodeListWithSeparator(sep) {
|
||||
const codeList = [];
|
||||
if (this.selection && this.selection.length) {
|
||||
this.selection.forEach(elem => {
|
||||
codeList.push(elem.code);
|
||||
});
|
||||
}
|
||||
return codeList.join(sep);
|
||||
},
|
||||
handleChooseChange(selection) {
|
||||
this.selection = selection;
|
||||
if (selection && selection.length) {
|
||||
const operate = {
|
||||
type: MapDeviceType.StationControl.type,
|
||||
operation: OperationEvent.StationControl.controlResponse.choose.operation,
|
||||
val: this.serializeCodeListWithSeparator('::')
|
||||
};
|
||||
|
||||
this.$store.dispatch('training/next', operate).then(({ valid }) => {
|
||||
if (valid) {
|
||||
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
|
||||
}
|
||||
})
|
||||
} else if (!selection) {
|
||||
this.$messageBox(this.$t('menu.passiveDialog.selectData'));
|
||||
|
||||
}
|
||||
},
|
||||
agree() {
|
||||
let operate = {
|
||||
send: true,
|
||||
over: true,
|
||||
type: MapDeviceType.StationControl.type,
|
||||
operation: OperationEvent.StationControl.controlResponse.agree.operation,
|
||||
code: this.selection[0].code,
|
||||
val: this.commandId,
|
||||
prdType: this.$store.state.training.prdType
|
||||
}
|
||||
this.$store.dispatch('training/next', operate).then(({ valid }) => {
|
||||
if (valid) {
|
||||
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
|
||||
}
|
||||
});
|
||||
} else if (!selection) {
|
||||
this.$messageBox(this.$t('menu.passiveDialog.selectData'));
|
||||
|
||||
this.clearTimer();
|
||||
this.disabledAgree = true;
|
||||
this.$store.dispatch('training/next', operate).then(({ valid }) => {
|
||||
if (valid) {
|
||||
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
|
||||
this.doClose();
|
||||
}
|
||||
}).catch((error) => {
|
||||
this.$refs.noticeInfo.doShow(operate);
|
||||
})
|
||||
},
|
||||
refuse() {
|
||||
let operate = {
|
||||
send: true,
|
||||
over: true,
|
||||
type: MapDeviceType.StationControl.type,
|
||||
operation: OperationEvent.StationControl.controlResponse.refuse.operation,
|
||||
code: this.selection.length ? this.selection[0].code : '',
|
||||
val: this.commandId,
|
||||
prdType: this.$store.state.training.prdType
|
||||
}
|
||||
if (!operate.code) {
|
||||
operate.code = this.tableData[0].code;
|
||||
}
|
||||
}
|
||||
},
|
||||
agree() {
|
||||
const operate = {
|
||||
send: true,
|
||||
over: true,
|
||||
type: MapDeviceType.StationControl.type,
|
||||
operation: OperationEvent.StationControl.controlResponse.agree.operation,
|
||||
code: this.selection[0].code,
|
||||
val: this.commandId,
|
||||
prdType: this.$store.state.training.prdType
|
||||
};
|
||||
|
||||
this.clearTimer();
|
||||
this.disabledAgree = true;
|
||||
this.$store.dispatch('training/next', operate).then(({ valid }) => {
|
||||
if (valid) {
|
||||
this.doClose();
|
||||
}
|
||||
}).catch((error) => {
|
||||
this.$refs.noticeInfo.doShow(operate);
|
||||
})
|
||||
}
|
||||
}
|
||||
}
|
||||
this.clearTimer();
|
||||
this.disabledAgree = true;
|
||||
this.$store.dispatch('training/next', operate).then(({ valid }) => {
|
||||
if (valid) {
|
||||
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
|
||||
this.doClose();
|
||||
}
|
||||
}).catch(() => {
|
||||
this.$refs.noticeInfo.doShow(operate);
|
||||
});
|
||||
},
|
||||
refuse() {
|
||||
const operate = {
|
||||
send: true,
|
||||
over: true,
|
||||
type: MapDeviceType.StationControl.type,
|
||||
operation: OperationEvent.StationControl.controlResponse.refuse.operation,
|
||||
code: this.selection.length ? this.selection[0].code : '',
|
||||
val: this.commandId,
|
||||
prdType: this.$store.state.training.prdType
|
||||
};
|
||||
if (!operate.code) {
|
||||
operate.code = this.tableData[0].code;
|
||||
}
|
||||
|
||||
this.clearTimer();
|
||||
this.disabledAgree = true;
|
||||
this.$store.dispatch('training/next', operate).then(({ valid }) => {
|
||||
if (valid) {
|
||||
this.doClose();
|
||||
}
|
||||
}).catch(() => {
|
||||
this.$refs.noticeInfo.doShow(operate);
|
||||
});
|
||||
}
|
||||
}
|
||||
};
|
||||
</script>
|
||||
|
||||
<style rel="stylesheet/scss" lang="scss" scoped>
|
||||
@ -294,4 +312,4 @@
|
||||
line-height: 30px;
|
||||
font-size: 18px;
|
||||
}
|
||||
</style>
|
||||
</style>
|
||||
|
@ -1,106 +1,115 @@
|
||||
<template>
|
||||
<el-dialog class="fuzhou-01__systerm cmd-notice" :title="$t('menu.passiveDialog.operationCommandTips')" :visible.sync="show" width="400px"
|
||||
:before-close="doClose" :zIndex="2000" :modal="false" :close-on-click-modal="false" v-dialogDrag>
|
||||
<span>{{name}},{{msg}}!</span>
|
||||
<el-row class="button-group">
|
||||
<el-button :id="domIdCancel" type="primary" :loading="loading" @click="commit">{{$t('menu.passiveDialog.operationConfirm')}}</el-button>
|
||||
</el-row>
|
||||
</el-dialog>
|
||||
<el-dialog
|
||||
v-dialogDrag
|
||||
class="fuzhou-01__systerm cmd-notice"
|
||||
:title="$t('menu.passiveDialog.operationCommandTips')"
|
||||
:visible.sync="show"
|
||||
width="400px"
|
||||
:before-close="doClose"
|
||||
:z-index="2000"
|
||||
:modal="false"
|
||||
:close-on-click-modal="false"
|
||||
>
|
||||
<span>{{ name }},{{ msg }}!</span>
|
||||
<el-row class="button-group">
|
||||
<el-button :id="domIdCancel" type="primary" :loading="loading" @click="commit">{{ $t('menu.passiveDialog.operationConfirm') }}</el-button>
|
||||
</el-row>
|
||||
</el-dialog>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import { MapDeviceType, OperationEvent } from '@/scripts/ConstDic';
|
||||
export default {
|
||||
name: 'CmdNotice',
|
||||
data() {
|
||||
return {
|
||||
dialogShow: false,
|
||||
loading: false,
|
||||
operate: null,
|
||||
name: '',
|
||||
msg: ''
|
||||
}
|
||||
},
|
||||
computed: {
|
||||
show() {
|
||||
return this.dialogShow && !this.$store.state.menuOperation.break;
|
||||
},
|
||||
domIdCancel() {
|
||||
return this.dialogShow ? OperationEvent.Command.close.notice.domId : '';
|
||||
},
|
||||
},
|
||||
watch: {
|
||||
'$store.state.socket.msgHead': function (elem) {
|
||||
if (elem && elem.type == 'resp' && (elem.timeout || !elem.agree)) {
|
||||
let operate = this.$store.state.training.operate;
|
||||
let control = this.$store.getters['map/getDeviceByCode'](elem.stationControlCode);
|
||||
let station = this.$store.getters['map/getDeviceByCode'](control.stationCode);
|
||||
let newOperate = {
|
||||
type: operate.type,
|
||||
name: station.name,
|
||||
}
|
||||
import { OperationEvent } from '@/scripts/ConstDic';
|
||||
export default {
|
||||
name: 'CmdNotice',
|
||||
data() {
|
||||
return {
|
||||
dialogShow: false,
|
||||
loading: false,
|
||||
operate: null,
|
||||
name: '',
|
||||
msg: ''
|
||||
};
|
||||
},
|
||||
computed: {
|
||||
show() {
|
||||
return this.dialogShow && !this.$store.state.menuOperation.break;
|
||||
},
|
||||
domIdCancel() {
|
||||
return this.dialogShow ? OperationEvent.Command.close.notice.domId : '';
|
||||
}
|
||||
},
|
||||
watch: {
|
||||
'$store.state.socket.msgHead': function (elem) {
|
||||
if (elem && elem.type == 'resp' && (elem.timeout || !elem.agree)) {
|
||||
const operate = this.$store.state.training.operate;
|
||||
const control = this.$store.getters['map/getDeviceByCode'](elem.stationControlCode);
|
||||
const station = this.$store.getters['map/getDeviceByCode'](control.stationCode);
|
||||
const newOperate = {
|
||||
type: operate.type,
|
||||
name: station.name
|
||||
};
|
||||
|
||||
if (elem.timeout) {
|
||||
newOperate['msg'] = this.$t('menu.passiveDialog.requestTimedOut');
|
||||
this.doShow(newOperate);
|
||||
} else if (!elem.agree) {
|
||||
newOperate['msg'] = this.$t('menu.passiveDialog.requestRejection');
|
||||
this.doShow(newOperate);
|
||||
}
|
||||
}
|
||||
},
|
||||
},
|
||||
mounted() {
|
||||
this.$nextTick(() => {
|
||||
this.$store.dispatch('training/tipReload');
|
||||
})
|
||||
},
|
||||
methods: {
|
||||
doShow(operate) {
|
||||
this.operate = operate || {};
|
||||
this.name = this.operate.name || '';
|
||||
this.msg = this.operate.msg || '';
|
||||
this.dialogShow = true;
|
||||
this.$nextTick(function () {
|
||||
this.$store.dispatch('training/emitTipFresh');
|
||||
});
|
||||
},
|
||||
doClose() {
|
||||
if (this.dialogShow) {
|
||||
this.$store.dispatch('socket/shiftMsgQueue');
|
||||
}
|
||||
this.dialogShow = false;
|
||||
this.$store.dispatch('training/emitTipFresh');
|
||||
},
|
||||
cancel() {
|
||||
let operate = {
|
||||
operation: this.operate.type,
|
||||
operation: OperationEvent.Command.close.notice.operation,
|
||||
}
|
||||
if (elem.timeout) {
|
||||
newOperate['msg'] = this.$t('menu.passiveDialog.requestTimedOut');
|
||||
this.doShow(newOperate);
|
||||
} else if (!elem.agree) {
|
||||
newOperate['msg'] = this.$t('menu.passiveDialog.requestRejection');
|
||||
this.doShow(newOperate);
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
mounted() {
|
||||
this.$nextTick(() => {
|
||||
this.$store.dispatch('training/tipReload');
|
||||
});
|
||||
},
|
||||
methods: {
|
||||
doShow(operate) {
|
||||
this.operate = operate || {};
|
||||
this.name = this.operate.name || '';
|
||||
this.msg = this.operate.msg || '';
|
||||
this.dialogShow = true;
|
||||
this.$nextTick(function () {
|
||||
this.$store.dispatch('training/emitTipFresh');
|
||||
});
|
||||
},
|
||||
doClose() {
|
||||
if (this.dialogShow) {
|
||||
this.$store.dispatch('socket/shiftMsgQueue');
|
||||
}
|
||||
this.dialogShow = false;
|
||||
this.$store.dispatch('training/emitTipFresh');
|
||||
},
|
||||
cancel() {
|
||||
const operate = {
|
||||
type: this.operate.type,
|
||||
operation: OperationEvent.Command.close.notice.operation
|
||||
};
|
||||
|
||||
this.$store.dispatch('training/next', operate).then(({ valid }) => {
|
||||
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
|
||||
if (valid) {
|
||||
this.doClose();
|
||||
}
|
||||
})
|
||||
},
|
||||
commit() {
|
||||
let operate = {
|
||||
type: this.operate.type,
|
||||
operation: OperationEvent.Command.close.notice.operation,
|
||||
}
|
||||
this.$store.dispatch('training/next', operate).then(({ valid }) => {
|
||||
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
|
||||
if (valid) {
|
||||
this.doClose();
|
||||
}
|
||||
})
|
||||
},
|
||||
isClose() {
|
||||
return this.dialogShow;
|
||||
}
|
||||
}
|
||||
}
|
||||
this.$store.dispatch('training/next', operate).then(({ valid }) => {
|
||||
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
|
||||
if (valid) {
|
||||
this.doClose();
|
||||
}
|
||||
});
|
||||
},
|
||||
commit() {
|
||||
const operate = {
|
||||
type: this.operate.type,
|
||||
operation: OperationEvent.Command.close.notice.operation
|
||||
};
|
||||
this.$store.dispatch('training/next', operate).then(({ valid }) => {
|
||||
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
|
||||
if (valid) {
|
||||
this.doClose();
|
||||
}
|
||||
});
|
||||
},
|
||||
isClose() {
|
||||
return this.dialogShow;
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
</script>
|
||||
</script>
|
||||
|
@ -1,31 +1,23 @@
|
||||
<template>
|
||||
<div id="statusDownTrainDetail"></div>
|
||||
<div id="statusDownTrainDetail" />
|
||||
</template>
|
||||
|
||||
<script>
|
||||
export default {
|
||||
name: 'StatusDownTrainDetail',
|
||||
props: {
|
||||
selected: {
|
||||
type: Object
|
||||
}
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
}
|
||||
},
|
||||
mounted() {
|
||||
}
|
||||
}
|
||||
export default {
|
||||
name: 'StatusDownTrainDetail',
|
||||
props: {
|
||||
selected: {
|
||||
type: Object,
|
||||
required: true
|
||||
}
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
};
|
||||
},
|
||||
mounted() {
|
||||
}
|
||||
};
|
||||
</script>
|
||||
<style>
|
||||
#statusDownTrainDetail {
|
||||
z-index: 1000;
|
||||
position: absolute;
|
||||
height: $height;
|
||||
line-height: $height;
|
||||
border-radius: 0px !important;
|
||||
top: 0px;
|
||||
left: 0px;
|
||||
}
|
||||
</style>
|
||||
</style>
|
||||
|
@ -1,31 +1,24 @@
|
||||
<template>
|
||||
<div id="statusUpTrainDetail"></div>
|
||||
<div id="statusUpTrainDetail" />
|
||||
</template>
|
||||
|
||||
<script>
|
||||
export default {
|
||||
name: 'StatusUpTrainDetail',
|
||||
props: {
|
||||
selected: {
|
||||
type: Object
|
||||
}
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
}
|
||||
},
|
||||
mounted() {
|
||||
}
|
||||
}
|
||||
export default {
|
||||
name: 'StatusUpTrainDetail',
|
||||
props: {
|
||||
selected: {
|
||||
type: Object,
|
||||
required: true
|
||||
}
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
};
|
||||
},
|
||||
mounted() {
|
||||
}
|
||||
};
|
||||
</script>
|
||||
<style>
|
||||
#statusUpTrainDetail {
|
||||
z-index: 1000;
|
||||
position: absolute;
|
||||
height: $height;
|
||||
line-height: $height;
|
||||
border-radius: 0px !important;
|
||||
top: 0px;
|
||||
left: 0px;
|
||||
}
|
||||
</style>
|
||||
|
||||
</style>
|
||||
|
@ -13,10 +13,10 @@
|
||||
<div style="margin: 10px">
|
||||
<el-row>
|
||||
<el-col :span="3">
|
||||
<el-radio v-model="model.type" label="1">{{$t('menu.addToTheFront')}}</el-radio>
|
||||
<el-radio v-model="model.type" label="1">{{ $t('menu.addToTheFront') }}</el-radio>
|
||||
</el-col>
|
||||
<el-col :span="2" :offset="1">
|
||||
<span>{{$t('menu.tripNumber') + $t('global.colon')}}</span>
|
||||
<span>{{ $t('menu.tripNumber') + $t('global.colon') }}</span>
|
||||
</el-col>
|
||||
<el-col :span="5">
|
||||
<el-select v-model="model.tripNumber" :placeholder="this.$t('global.choose')">
|
||||
@ -29,7 +29,7 @@
|
||||
</el-select>
|
||||
</el-col>
|
||||
<el-col :span="3" :offset="1">
|
||||
<span>{{$t('global.startTime') + $t('global.colon')}}</span>
|
||||
<span>{{ $t('global.startTime') + $t('global.colon') }}</span>
|
||||
</el-col>
|
||||
<el-col :span="5">
|
||||
<el-select v-model="model.startTime" :placeholder="this.$t('global.choose')">
|
||||
@ -44,10 +44,10 @@
|
||||
</el-row>
|
||||
<el-row>
|
||||
<el-col :span="3">
|
||||
<el-radio v-model="model.type" label="2">{{$t('menu.addToTheEnd')}}</el-radio>
|
||||
<el-radio v-model="model.type" label="2">{{ $t('menu.addToTheEnd') }}</el-radio>
|
||||
</el-col>
|
||||
<el-col :span="2" :offset="1">
|
||||
<span>{{$t('menu.tripNumber') + $t('global.colon')}}</span>
|
||||
<span>{{ $t('menu.tripNumber') + $t('global.colon') }}</span>
|
||||
</el-col>
|
||||
<el-col :span="5">
|
||||
<el-select v-model="model.tripNumber" :placeholder="this.$t('global.choose')">
|
||||
@ -60,7 +60,7 @@
|
||||
</el-select>
|
||||
</el-col>
|
||||
<el-col :span="3" :offset="1">
|
||||
<span>{{$t('global.startTime') + $t('global.colon')}}</span>
|
||||
<span>{{ $t('global.startTime') + $t('global.colon') }}</span>
|
||||
</el-col>
|
||||
<el-col :span="5">
|
||||
<el-select v-model="model.startTime" :placeholder="this.$t('global.choose')">
|
||||
@ -75,7 +75,7 @@
|
||||
|
||||
</el-row>
|
||||
<el-row style="margin-bottom: 5px;">
|
||||
{{$t('menu.crossing') + $t('global.colon')}}
|
||||
{{ $t('menu.crossing') + $t('global.colon') }}
|
||||
</el-row>
|
||||
<el-row>
|
||||
<el-table :data="model.route" border :height="180">
|
||||
@ -86,7 +86,7 @@
|
||||
</el-table>
|
||||
</el-row>
|
||||
<el-row style=" margin-bottom: 5px;margin-top: 10px;">
|
||||
{{$t('global.details') + $t('global.colon')}}
|
||||
{{ $t('global.details') + $t('global.colon') }}
|
||||
</el-row>
|
||||
<el-row>
|
||||
<el-table :data="model.detail" border :height="180">
|
||||
@ -98,13 +98,13 @@
|
||||
</el-row>
|
||||
<el-row>
|
||||
<el-col :offset="16">
|
||||
<el-checkbox v-model="model.default">{{$t('menu.displaysDefaultStopTimesAndRunLevels')}}</el-checkbox>
|
||||
<el-checkbox v-model="model.default">{{ $t('menu.displaysDefaultStopTimesAndRunLevels') }}</el-checkbox>
|
||||
</el-col>
|
||||
</el-row>
|
||||
</div>
|
||||
<el-row type="flex" justify="center" class="button-group">
|
||||
<el-button @click="commit">{{$t('global.confirm')}}</el-button>
|
||||
<el-button @click="doClose">{{$t('global.cancel')}}</el-button>
|
||||
<el-button @click="commit">{{ $t('global.confirm') }}</el-button>
|
||||
<el-button @click="doClose">{{ $t('global.cancel') }}</el-button>
|
||||
</el-row>
|
||||
</el-dialog>
|
||||
</template>
|
||||
|
@ -11,8 +11,8 @@
|
||||
>
|
||||
<QueryListPage ref="pageRules" :pager-config="pagerConfig" :query-form="queryForm" :query-list="queryList" />
|
||||
<el-row type="flex" justify="center" class="button-group">
|
||||
<el-button type="primary" :loading="loading" @click="handleConfirm">{{$t('global.select')}}</el-button>
|
||||
<el-button @click="dialogShow = false">{{$t('global.cancel')}}</el-button>
|
||||
<el-button type="primary" :loading="loading" @click="handleConfirm">{{ $t('global.select') }}</el-button>
|
||||
<el-button @click="dialogShow = false">{{ $t('global.cancel') }}</el-button>
|
||||
</el-row>
|
||||
</el-dialog>
|
||||
</template>
|
||||
|
@ -11,8 +11,8 @@
|
||||
>
|
||||
<QueryListPage ref="pageRules" :pager-config="pagerConfig" :query-form="queryForm" :query-list="queryList" />
|
||||
<el-row type="flex" justify="center" class="button-group">
|
||||
<el-button type="primary" :loading="loading" @click="handleConfirm">{{$t('menu.load')}}</el-button>
|
||||
<el-button @click="dialogShow = false">{{$t('global.cancel')}}</el-button>
|
||||
<el-button type="primary" :loading="loading" @click="handleConfirm">{{ $t('menu.load') }}</el-button>
|
||||
<el-button @click="dialogShow = false">{{ $t('global.cancel') }}</el-button>
|
||||
</el-row>
|
||||
</el-dialog>
|
||||
</template>
|
||||
|
@ -18,7 +18,7 @@
|
||||
<el-input v-model="model.planName" :readonly="true" />
|
||||
</el-col>
|
||||
<el-col :span="4" :offset="1">
|
||||
<el-button @click="handleChoose">{{this.$t('global.select')}}</el-button>
|
||||
<el-button @click="handleChoose">{{ this.$t('global.select') }}</el-button>
|
||||
</el-col>
|
||||
</el-row>
|
||||
</el-form-item>
|
||||
@ -36,8 +36,8 @@
|
||||
</el-form>
|
||||
</el-row>
|
||||
<el-row type="flex" justify="center" class="button-group">
|
||||
<el-button @click="create">{{$t('global.confirm')}}</el-button>
|
||||
<el-button @click="doClose">{{$t('global.cancel')}}</el-button>
|
||||
<el-button @click="create">{{ $t('global.confirm') }}</el-button>
|
||||
<el-button @click="doClose">{{ $t('global.cancel') }}</el-button>
|
||||
</el-row>
|
||||
<choose-template-plan ref="choose" @chooseConfirm="chooseConfirm" />
|
||||
</el-dialog>
|
||||
|
@ -11,14 +11,14 @@
|
||||
:close-on-click-modal="false"
|
||||
>
|
||||
<el-row>
|
||||
<el-radio v-model="type" :label="1">{{$t('menu.deleteAllPreviousTasks')}}</el-radio>
|
||||
<el-radio v-model="type" :label="1">{{ $t('menu.deleteAllPreviousTasks') }}</el-radio>
|
||||
</el-row>
|
||||
<el-row>
|
||||
<el-radio v-model="type" :label="2">{{$t('menu.deleteAllSubsequentTasks')}}</el-radio>
|
||||
<el-radio v-model="type" :label="2">{{ $t('menu.deleteAllSubsequentTasks') }}</el-radio>
|
||||
</el-row>
|
||||
<el-row type="flex" justify="center" class="button-group">
|
||||
<el-button @click="commit">{{$t('global.confirm')}}</el-button>
|
||||
<el-button @click="doClose">{{$t('global.cancel')}}</el-button>
|
||||
<el-button @click="commit">{{ $t('global.confirm') }}</el-button>
|
||||
<el-button @click="doClose">{{ $t('global.cancel') }}</el-button>
|
||||
</el-row>
|
||||
</el-dialog>
|
||||
</template>
|
||||
|
@ -11,8 +11,8 @@
|
||||
:close-on-click-modal="false"
|
||||
>
|
||||
<el-row type="flex" justify="center" class="button-group">
|
||||
<el-button @click="commit">{{$t('global.confirm')}}</el-button>
|
||||
<el-button @click="doClose">{{$t('global.cancel')}}</el-button>
|
||||
<el-button @click="commit">{{ $t('global.confirm') }}</el-button>
|
||||
<el-button @click="doClose">{{ $t('global.cancel') }}</el-button>
|
||||
</el-row>
|
||||
</el-dialog>
|
||||
</template>
|
||||
|
@ -11,7 +11,7 @@
|
||||
:close-on-click-modal="false"
|
||||
>
|
||||
<el-row>
|
||||
<el-col :offset="10">{{$t('menu.trainLine')}}</el-col>
|
||||
<el-col :offset="10">{{ $t('menu.trainLine') }}</el-col>
|
||||
</el-row>
|
||||
<el-row>
|
||||
<el-col :span="17">
|
||||
@ -24,19 +24,19 @@
|
||||
</el-col>
|
||||
<el-col :span="6" :offset="1">
|
||||
<el-row type="flex" justify="center">
|
||||
<el-button class="view-button" @click="handleAddTask">{{this.$t('menu.addTask2')}}</el-button>
|
||||
<el-button class="view-button" @click="handleAddTask">{{ this.$t('menu.addTask2') }}</el-button>
|
||||
</el-row>
|
||||
<el-row type="flex" justify="center">
|
||||
<el-button class="view-button" @click="handleReplace">{{this.$t('menu.replace')}}</el-button>
|
||||
<el-button class="view-button" @click="handleReplace">{{ this.$t('menu.replace') }}</el-button>
|
||||
</el-row>
|
||||
<el-row type="flex" justify="center">
|
||||
<el-button class="view-button" @click="handleDeleteTask">{{this.$t('menu.deleteTask2')}}</el-button>
|
||||
<el-button class="view-button" @click="handleDeleteTask">{{ this.$t('menu.deleteTask2') }}</el-button>
|
||||
</el-row>
|
||||
<div class="view-box">
|
||||
<el-row type="flex" justify="center">
|
||||
<el-radio-group v-model="storeInOut">
|
||||
<el-radio :label="1">{{this.$t('menu.inTheLibrary')}}</el-radio>
|
||||
<el-radio :label="2">{{this.$t('menu.outOfTheLibrary')}}</el-radio>
|
||||
<el-radio :label="1">{{ this.$t('menu.inTheLibrary') }}</el-radio>
|
||||
<el-radio :label="2">{{ this.$t('menu.outOfTheLibrary') }}</el-radio>
|
||||
</el-radio-group>
|
||||
</el-row>
|
||||
</div>
|
||||
@ -50,21 +50,21 @@
|
||||
<el-input v-model="newServiceNumber" size="small" />
|
||||
</el-col>
|
||||
<el-col :span="5" style="padding-left: 20px">
|
||||
<el-button style="width: 150px;" @click="handleModifyingTripNumber">{{$t('menu.changeTripNumber')}}</el-button>
|
||||
<el-button style="width: 150px;" @click="handleModifyingTripNumber">{{ $t('menu.changeTripNumber') }}</el-button>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<el-row style="margin-top: 10px">
|
||||
<el-col :span="4"><span class="view-label">{{$t('menu.lineStartTime')}}</span></el-col>
|
||||
<el-col :span="4"><span class="view-label">{{ $t('menu.lineStartTime') }}</span></el-col>
|
||||
<el-col :span="8">
|
||||
<el-time-select v-model="serviceStartTime" size="small" />
|
||||
</el-col>
|
||||
<el-col :span="4"><span class="view-label">{{$t('menu.lineEndTime')}}</span></el-col>
|
||||
<el-col :span="4"><span class="view-label">{{ $t('menu.lineEndTime') }}</span></el-col>
|
||||
<el-col :span="8">
|
||||
<el-time-select v-model="serviceEndTime" size="small" />
|
||||
</el-col>
|
||||
</el-row>
|
||||
<el-row style="margin-top: 20px">
|
||||
<el-col :offset="10">{{$t('menu.lineDetails')}}</el-col>
|
||||
<el-col :offset="10">{{ $t('menu.lineDetails') }}</el-col>
|
||||
</el-row>
|
||||
<el-row>
|
||||
<el-table :data="tripData" border style="width: 100%" height="200">
|
||||
@ -76,11 +76,11 @@
|
||||
</el-table>
|
||||
</el-row>
|
||||
<el-row style="margin-top: 20px">
|
||||
<el-checkbox v-model="effect">{{$t('menu.affectSubsequentTasks')}}</el-checkbox>
|
||||
<el-checkbox v-model="effect">{{ $t('menu.affectSubsequentTasks') }}</el-checkbox>
|
||||
</el-row>
|
||||
<el-row type="flex" justify="center">
|
||||
<el-button @click="commit">{{$t('global.confirm')}}</el-button>
|
||||
<el-button @click="doClose">{{$t('global.cancel')}}</el-button>
|
||||
<el-button @click="commit">{{ $t('global.confirm') }}</el-button>
|
||||
<el-button @click="doClose">{{ $t('global.cancel') }}</el-button>
|
||||
</el-row>
|
||||
</el-dialog>
|
||||
</template>
|
||||
|
@ -15,7 +15,7 @@
|
||||
<el-col :span="4">
|
||||
<el-row>
|
||||
<el-col :span="9">
|
||||
<span>{{$t('menu.tripNumber') + $t('global.colon')}}</span>
|
||||
<span>{{ $t('menu.tripNumber') + $t('global.colon') }}</span>
|
||||
</el-col>
|
||||
<el-col :span="15">
|
||||
<el-select v-model="model.tripNumber" style="display: inline-black" :placeholder="this.$t('global.choose')">
|
||||
@ -32,14 +32,14 @@
|
||||
<el-col :span="2">
|
||||
<el-row>
|
||||
<el-col :offset="4">
|
||||
<el-checkbox v-model="model.trainManual">{{this.$t('menu.manual')}}</el-checkbox>
|
||||
<el-checkbox v-model="model.trainManual">{{ this.$t('menu.manual') }}</el-checkbox>
|
||||
</el-col>
|
||||
</el-row>
|
||||
</el-col>
|
||||
<el-col :span="5">
|
||||
<el-row>
|
||||
<el-col :span="12">
|
||||
<span>{{$t('menu.defaultStopTime') + $t('global.colon')}}</span>
|
||||
<span>{{ $t('menu.defaultStopTime') + $t('global.colon') }}</span>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-select v-model="model.time" style="display: inline-black" :placeholder="this.$t('global.choose')">
|
||||
@ -56,7 +56,7 @@
|
||||
<el-col :span="5">
|
||||
<el-row>
|
||||
<el-col :span="9" :offset="2">
|
||||
<span>{{$t('menu.serviceNumber') + $t('global.colon')}}</span>
|
||||
<span>{{ $t('menu.serviceNumber') + $t('global.colon') }}</span>
|
||||
</el-col>
|
||||
<el-col :span="13">
|
||||
<el-input v-model="model.serviceNumber" />
|
||||
@ -68,13 +68,13 @@
|
||||
<el-col :span="22" :offset="2">
|
||||
<el-row>
|
||||
<el-col :span="6">
|
||||
<el-checkbox v-model="model.clearGuest">{{$t('menu.clearGuest')}}</el-checkbox>
|
||||
<el-checkbox v-model="model.clearGuest">{{ $t('menu.clearGuest') }}</el-checkbox>
|
||||
</el-col>
|
||||
<el-col :span="8">
|
||||
<el-checkbox v-model="model.continuationPlan">{{$t('menu.continuationPlan')}}</el-checkbox>
|
||||
<el-checkbox v-model="model.continuationPlan">{{ $t('menu.continuationPlan') }}</el-checkbox>
|
||||
</el-col>
|
||||
<el-col :span="6">
|
||||
<el-checkbox v-model="model.firstTrain">{{$t('menu.firstTrain')}}</el-checkbox>
|
||||
<el-checkbox v-model="model.firstTrain">{{ $t('menu.firstTrain') }}</el-checkbox>
|
||||
</el-col>
|
||||
</el-row>
|
||||
</el-col>
|
||||
@ -85,7 +85,7 @@
|
||||
<el-col :span="4">
|
||||
<el-row>
|
||||
<el-col :span="9">
|
||||
<span>{{$t('menu.serialNumber') + $t('global.colon')}}</span>
|
||||
<span>{{ $t('menu.serialNumber') + $t('global.colon') }}</span>
|
||||
</el-col>
|
||||
<el-col :span="15">
|
||||
<el-select v-model="model.serialNumber" style="display: inline-black" :placeholder="this.$t('global.choose')">
|
||||
@ -102,14 +102,14 @@
|
||||
<el-col :span="2">
|
||||
<el-row>
|
||||
<el-col :offset="4">
|
||||
<el-checkbox v-model="model.serialManual">{{this.$t('menu.manual')}}</el-checkbox>
|
||||
<el-checkbox v-model="model.serialManual">{{ this.$t('menu.manual') }}</el-checkbox>
|
||||
</el-col>
|
||||
</el-row>
|
||||
</el-col>
|
||||
<el-col :span="5">
|
||||
<el-row>
|
||||
<el-col :span="12">
|
||||
<span>{{$t('menu.defaultRunLevel') + $t('global.colon')}}</span>
|
||||
<span>{{ $t('menu.defaultRunLevel') + $t('global.colon') }}</span>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-select v-model="model.level" style="display: inline-black" :placeholder="this.$t('global.choose')">
|
||||
@ -126,7 +126,7 @@
|
||||
<el-col :span="5">
|
||||
<el-row>
|
||||
<el-col :span="9" :offset="2">
|
||||
<span>{{$t('global.startTime') + $t('global.colon')}}</span>
|
||||
<span>{{ $t('global.startTime') + $t('global.colon') }}</span>
|
||||
</el-col>
|
||||
<el-col :span="13">
|
||||
<el-time-select v-model="model.startTime" :placeholder="this.$t('global.selectionTime')" :clearable="false" />
|
||||
@ -152,7 +152,7 @@
|
||||
</el-col>
|
||||
</el-row>
|
||||
<el-row style="margin-bottom: 5px;">
|
||||
{{$t('menu.crossing') + $t('global.colon')}}
|
||||
{{ $t('menu.crossing') + $t('global.colon') }}
|
||||
</el-row>
|
||||
<el-row>
|
||||
<el-table :data="model.route" border :height="140">
|
||||
@ -161,7 +161,7 @@
|
||||
{{ formatName(scope.row.beginStationCode) }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="beginStationStandCode" :label="this.$t('menu.startPlatform')"/>
|
||||
<el-table-column prop="beginStationStandCode" :label="this.$t('menu.startPlatform')" />
|
||||
<el-table-column prop="endStationCode" :label="this.$t('menu.terminal')">
|
||||
<template slot-scope="scope">
|
||||
{{ formatName(scope.row.endStationCode) }}
|
||||
@ -173,7 +173,7 @@
|
||||
</el-table>
|
||||
</el-row>
|
||||
<el-row style=" margin-bottom: 5px;margin-top: 10px;">
|
||||
{{$t('global.details') + $t('global.colon')}}
|
||||
{{ $t('global.details') + $t('global.colon') }}
|
||||
</el-row>
|
||||
<el-row>
|
||||
<el-table :data="model.detail" border :height="140">
|
||||
@ -203,13 +203,13 @@
|
||||
</el-row>
|
||||
<el-row>
|
||||
<el-col :offset="16">
|
||||
<el-checkbox v-model="model.default">{{$t('menu.displaysDefaultStopTimesAndRunLevels')}}</el-checkbox>
|
||||
<el-checkbox v-model="model.default">{{ $t('menu.displaysDefaultStopTimesAndRunLevels') }}</el-checkbox>
|
||||
</el-col>
|
||||
</el-row>
|
||||
</div>
|
||||
<el-row type="flex" justify="center" class="button-group">
|
||||
<el-button @click="commit">{{$t('global.confirm')}}</el-button>
|
||||
<el-button @click="doClose">{{$t('global.cancel')}}</el-button>
|
||||
<el-button @click="commit">{{ $t('global.confirm') }}</el-button>
|
||||
<el-button @click="doClose">{{ $t('global.cancel') }}</el-button>
|
||||
</el-row>
|
||||
</el-dialog>
|
||||
</template>
|
||||
|
@ -3,23 +3,23 @@
|
||||
<div class="nav">
|
||||
<template v-for="(item,i) in menu">
|
||||
<template v-if="noShowingChildren(item.children)">
|
||||
<li class="nav-li" @click="hookClick(item)">
|
||||
<li :key="i" class="nav-li" @click="hookClick(item)">
|
||||
<span class="nav-li-text">{{ item.title }}</span>
|
||||
</li>
|
||||
</template>
|
||||
<template v-else>
|
||||
<li class="nav-li" @click.stop="popupMenuA(item, i)">
|
||||
<li :key="i" class="nav-li" @click.stop="popupMenuA(item, i)">
|
||||
<span class="nav-li-text">{{ item.title }}</span>
|
||||
<ul class="nav-ul" :class="{'active' :i==classA}">
|
||||
<template v-for="(child,j) in item.children">
|
||||
<template
|
||||
v-if="child.children&&child.children.length>0&&hasShowingChildren(child.children)"
|
||||
>
|
||||
<li v-if="child.type === 'separator'" class="menu-separator">
|
||||
<li v-if="child.type === 'separator'" :key="j" class="menu-separator">
|
||||
<span class="status"> </span>
|
||||
<span class="separator"> </span>
|
||||
</li>
|
||||
<li v-else-if="child.type === 'file'" class="menu-li">
|
||||
<li v-else-if="child.type === 'file'" :key="j" class="menu-li">
|
||||
<div class="menu-li-block">
|
||||
<span class="menu-li-text">
|
||||
<span class="status"> </span>
|
||||
@ -35,7 +35,7 @@
|
||||
</span>
|
||||
</div>
|
||||
</li>
|
||||
<li v-else class="menu-li" @click.stop="popupMenuB(child, j)">
|
||||
<li v-else :key="j" class="menu-li" @click.stop="popupMenuB(child, j)">
|
||||
<div class="menu-li-block">
|
||||
<span class="menu-li-text">
|
||||
<span class="status"> </span>
|
||||
@ -44,11 +44,11 @@
|
||||
</div>
|
||||
<ul class="menu-ul" :class="{'active' :j==classB}">
|
||||
<template v-for="(grandchild,k) in child.children">
|
||||
<li v-if="grandchild.type === 'separator'" class="menu-separator">
|
||||
<li v-if="grandchild.type === 'separator'" :key="k" class="menu-separator">
|
||||
<span class="status"> </span>
|
||||
<span class="separator"> </span>
|
||||
</li>
|
||||
<li v-else-if="grandchild.type === 'file'" class="menu-li">
|
||||
<li v-else-if="grandchild.type === 'file'" :key="k" class="menu-li">
|
||||
<div class="menu-li-block">
|
||||
<span class="menu-li-text">
|
||||
<span class="status"> </span>
|
||||
@ -68,7 +68,7 @@
|
||||
</span>
|
||||
</div>
|
||||
</li>
|
||||
<li v-else class="menu-li" @click.stop="hookClick(grandchild)">
|
||||
<li v-else :key="k" class="menu-li" @click.stop="hookClick(grandchild)">
|
||||
<div class="menu-li-block">
|
||||
<span class="menu-li-text">
|
||||
<span class="status"> </span>
|
||||
@ -81,11 +81,11 @@
|
||||
</li>
|
||||
</template>
|
||||
<template v-else>
|
||||
<li v-if="child.type === 'separator'" class="menu-separator">
|
||||
<li v-if="child.type === 'separator'" :key="j" class="menu-separator">
|
||||
<span class="status"> </span>
|
||||
<span class="separator"> </span>
|
||||
</li>
|
||||
<li v-else-if="child.type === 'file'" class="menu-li">
|
||||
<li v-else-if="child.type === 'file'" :key="j" class="menu-li">
|
||||
<div class="menu-li-block">
|
||||
<span class="menu-li-text">
|
||||
<span class="status"> </span>
|
||||
@ -101,7 +101,7 @@
|
||||
</span>
|
||||
</div>
|
||||
</li>
|
||||
<li v-else class="menu-li" @click.stop="hookClick(child)">
|
||||
<li v-else :key="j" class="menu-li" @click.stop="hookClick(child)">
|
||||
<div class="menu-li-block">
|
||||
<span class="menu-li-text">
|
||||
<span class="status"> </span>
|
||||
@ -119,11 +119,7 @@
|
||||
</div>
|
||||
</template>
|
||||
<script>
|
||||
import XLSX from 'xlsx';
|
||||
import { mapGetters } from 'vuex';
|
||||
import { importRunPlan } from '@/api/runplan';
|
||||
import { importData } from '../planConvert';
|
||||
import { launchFullscreen } from '@/utils/screen';
|
||||
import { EventBus } from '@/scripts/event-bus';
|
||||
|
||||
export default {
|
||||
@ -191,17 +187,17 @@ export default {
|
||||
{
|
||||
title: this.$t('menu.viewPlanList'),
|
||||
click: this.handleViewPlanSchedule,
|
||||
width: 150
|
||||
width: 150
|
||||
},
|
||||
{
|
||||
title: this.$t('menu.createAWeekPlan'),
|
||||
click: this.handleCreateWeekPlan,
|
||||
width: 150
|
||||
width: 150
|
||||
},
|
||||
{
|
||||
title: this.$t('menu.loadTheDayPlan'),
|
||||
click: this.handleReloadTodayPlan,
|
||||
width: 150
|
||||
width: 150
|
||||
}
|
||||
// {
|
||||
// title: '有效性检查',
|
||||
|
@ -41,7 +41,7 @@ export default {
|
||||
},
|
||||
{
|
||||
prop: 'startTime',
|
||||
label: this.$t('menu.arrivalTime'),
|
||||
label: this.$t('menu.arrivalTime')
|
||||
},
|
||||
{
|
||||
prop: 'stopTime',
|
||||
|
Loading…
Reference in New Issue
Block a user