This commit is contained in:
ival 2019-08-08 14:32:47 +08:00
commit 842c7f9df2

View File

@ -1,6 +1,15 @@
<template> <template>
<el-dialog class="fuzhou-01__systerm view-train-id" title="列车识别号显示设置" :visible.sync="show" width="420px" <el-dialog
:before-close="doClose" :zIndex="2000" :modal="false" :close-on-click-modal="false" v-dialogDrag> v-dialogDrag
class="fuzhou-01__systerm view-train-id"
title="列车识别号显示设置"
:visible.sync="show"
width="420px"
:before-close="doClose"
:z-index="2000"
:modal="false"
:close-on-click-modal="false"
>
<div style="padding: 10px 20px; border: 1px double lightgray;"> <div style="padding: 10px 20px; border: 1px double lightgray;">
<span class="base-label">计划车显示模式</span> <span class="base-label">计划车显示模式</span>
<el-radio-group v-model="planMode"> <el-radio-group v-model="planMode">
@ -47,7 +56,7 @@
<span class="base-label">字体大小</span> <span class="base-label">字体大小</span>
<el-row> <el-row>
<el-col :span="10"> <el-col :span="10">
<el-input v-model="fontSize" size="small" min="16" max="99"></el-input> <el-input v-model="fontSize" size="small" min="16" max="99" />
</el-col> </el-col>
<el-col :span="10" :offset="1"> <el-col :span="10" :offset="1">
<span style="height:32px; line-height:32px;">范围16-99</span> <span style="height:32px; line-height:32px;">范围16-99</span>
@ -62,17 +71,20 @@
<el-button :id="domIdCancel" @click="cancel"> </el-button> <el-button :id="domIdCancel" @click="cancel"> </el-button>
</el-col> </el-col>
</el-row> </el-row>
<notice-info ref="noticeInfo"></notice-info> <notice-info ref="noticeInfo" />
</el-dialog> </el-dialog>
</template> </template>
<script> <script>
import { OperationEvent, checkOperationIsCurrentOperate } from '@/scripts/ConstDic'; import { OperationEvent } from '@/scripts/ConstDic';
import deviceType from '@/jmap/constant/deviceType'; // import deviceType from '@/jmap/constant/deviceType';
import NoticeInfo from '../dialog/childDialog/childDialog/noticeInfo'; import NoticeInfo from '../dialog/childDialog/childDialog/noticeInfo';
export default { export default {
name: 'ViewTrainId', name: 'ViewTrainId',
components: {
NoticeInfo
},
data() { data() {
return { return {
dialogShow: false, dialogShow: false,
@ -81,11 +93,8 @@
operation: '', operation: '',
planMode: 5, planMode: 5,
headMode: 5, headMode: 5,
fontSize: 16, fontSize: 16
} };
},
components: {
NoticeInfo
}, },
computed: { computed: {
show() { show() {
@ -102,14 +111,14 @@
this.$nextTick(() => { this.$nextTick(() => {
this.setTrainDispaly(); this.setTrainDispaly();
this.$store.dispatch('training/tipReload'); this.$store.dispatch('training/tipReload');
}) });
}, },
methods: { methods: {
doShow(operate) { doShow(operate) {
this.operate = operate || {}; this.operate = operate || {};
this.operation = operate.operation; this.operation = operate.operation;
// //
if (!this.dialogShow) { if (!this.dialogShow) {
this.loading = false; this.loading = false;
} }
@ -125,42 +134,42 @@
this.$store.dispatch('training/emitTipFresh'); this.$store.dispatch('training/emitTipFresh');
}, },
cancel() { cancel() {
let operate = { const operate = {
type: this.operate.type, type: this.operate.type,
operation: OperationEvent.Command.cancel.menu.operation, operation: OperationEvent.Command.cancel.menu.operation
} };
this.$store.dispatch('training/next', operate).then(({ valid }) => { this.$store.dispatch('training/next', operate).then(({ valid }) => {
if (valid) { if (valid) {
this.doClose(); this.doClose();
} }
}) });
}, },
commit() { commit() {
let operate = { const operate = {
over: true, over: true,
type: this.operate.type, type: this.operate.type,
operation: OperationEvent.Command.close.confirm.operation, operation: OperationEvent.Command.close.confirm.operation,
val: [this.planMode, this.headMode, this.fontSize].join('::') val: [this.planMode, this.headMode, this.fontSize].join('::')
} };
this.loading = true this.loading = true;
this.$store.dispatch('training/next', operate).then(({ valid }) => { this.$store.dispatch('training/next', operate).then(({ valid }) => {
this.loading = false this.loading = false;
if (valid) { if (valid) {
this.setTrainDispaly(); this.setTrainDispaly();
this.doClose(); this.doClose();
} }
}).catch(error => { }).catch(() => {
this.loading = false; this.loading = false;
}) });
}, },
setTrainDispaly() { setTrainDispaly() {
let updatlist = []; const updatlist = [];
let trainList = this.$store.getters['training/viewTrainList']; const trainList = this.$store.getters['training/viewTrainList'];
if (trainList && trainList.length > 0) { if (trainList && trainList.length > 0) {
let nameFormat = this.trainNameFormatBy(this.planMode); const nameFormat = this.trainNameFormatBy(this.planMode);
let nameFontSize = this.fontSize; const nameFontSize = this.fontSize;
trainList.forEach(elem => { trainList.forEach(elem => {
updatlist.push(Object.assign(this.$jlmap.getDeviceByCode(elem.code), {nameFormat, nameFontSize })); updatlist.push(Object.assign(this.$jlmap.getDeviceByCode(elem.code), {nameFormat, nameFontSize }));
}); });
@ -170,16 +179,16 @@
}, },
trainNameFormatBy(mode) { trainNameFormatBy(mode) {
switch (mode.toString()) { switch (mode.toString()) {
case '1': return 'serviceNumber:tripNumber'; //+ case '1': return 'serviceNumber:tripNumber'; // +
case '2': return 'serviceNumber:groupNumber'; //+ case '2': return 'serviceNumber:groupNumber'; // +
case '3': return 'targetCode:tripNumber'; //+ case '3': return 'targetCode:tripNumber'; // +
case '4': return 'targetCode:groupNumber'; //+ case '4': return 'targetCode:groupNumber'; // +
case '5': return 'targetCode:serviceNumber:tripNumber'; //++ case '5': return 'targetCode:serviceNumber:tripNumber'; // ++
case '6': return 'targetCode:serviceNumber:groupNumber'; //++ case '6': return 'targetCode:serviceNumber:groupNumber'; // ++
} }
return ''; // return ''; //
}
} }
} }
};
</script> </script>