This commit is contained in:
joylink_cuiweidong 2022-08-10 17:47:46 +08:00
commit dd82df1b4a

View File

@ -58,7 +58,7 @@
<el-form-item v-if="!addModel.multiRoute" label="起始区段:" prop="startSectionCode">
<el-select v-model="addModel.startSectionCode" clearable filterable :placeholder="$t('map.pleaseSelect')">
<el-option
v-for="item in signalList"
v-for="item in sectionList"
:key="item.code"
:label="`${item.name}(${item.code})`"
:value="item.code"
@ -72,7 +72,7 @@
<el-form-item v-if="!addModel.multiRoute" label="终到区段:" prop="endSectionCode">
<el-select v-model="addModel.endSectionCode" clearable filterable :placeholder="$t('map.pleaseSelect')">
<el-option
v-for="item in signalList"
v-for="item in sectionList"
:key="item.code"
:label="`${item.name}(${item.code})`"
:value="item.code"
@ -146,7 +146,7 @@
</el-table>
</el-form-item>
<el-form-item label="排列进路按钮:" prop="btnCodeList">
<el-select v-model="addModel.btnCodeList" clearable filterable multiple :placeholder="$t('map.pleaseSelect')">
<el-select key="456t" v-model="addModel.btnCodeList" clearable filterable multiple :placeholder="$t('map.pleaseSelect')">
<el-option
v-for="item in btnList"
:key="item.code"
@ -166,6 +166,44 @@
<el-radio :label="false">{{ $t('map.deny') }}</el-radio>
</el-radio-group>
</el-form-item> -->
<el-form-item v-if="addModel.type == 'DEPARTURE'" label="区段占用与信号:" prop="leaveSectionWithAspectMap">
<el-select v-model="lSWACode" clearable filterable>
<el-option
v-for="item in sectionList"
:key="item.code"
:label="`${item.name}(${item.code})`"
:value="item.code"
/>
</el-select>
<el-select v-model="lSWASignalAspect" filterable :placeholder="$t('map.pleaseSelect')" style="width:100px">
<el-option
v-for="item in lSWASignalAspectList"
:key="item.value"
:label="`${item.label}`"
:value="item.value"
/>
</el-select>
<el-button type="primary" @click="addLSWAList">{{ $t('map.add') }}</el-button>
<el-table :data="lSWAList" border style="width: 97%;margin-top:10px;">
<el-table-column prop="sectionCode" label="区段名称">
<template slot-scope="scope">
<span>{{ covertSectionCode(scope.row.sectionCode) }}</span>
</template>
</el-table-column>
<el-table-column prop="signalAspect" label="信号显示">
<template slot-scope="scope">
<span>{{ covertLSWAAspect(scope.row.signalAspect) }}</span>
</template>
</el-table-column>
<el-table-column fixed="right" :label="$t('map.operation')" width="50">
<template slot-scope="scope">
<el-button type="text" size="small" @click.native.prevent="deleteLSWAItem(scope.row.sectionCode)">
{{ $t('map.remove') }}
</el-button>
</template>
</el-table-column>
</el-table>
</el-form-item>
</el-form>
<div class="bigDraft">
<el-button-group class="bigDraftBtn">
@ -253,6 +291,7 @@ export default {
switchCode:'',
normal: true
},
leaveSectionWithAspectMap: {},
btnCodeList:[],
routeAspectList:[]
},
@ -286,8 +325,30 @@ export default {
],
'routeAspectList':[
{ required: true, validator:this.RAListValidate, trigger: 'blur' }
],
'leaveSectionWithAspectMap':[
{ required: true, validator:this.lSWAValidate, trigger: 'blur' }
]
}
},
lSWACode:'',
lSWASignalAspect: 'R',
lSWASignalAspectList:[
{label:'无显示', value: 'No'},
{label:'红', value: 'R'},
{label:'绿', value: 'G'},
{label:'黄', value: 'Y'},
{label:'白', value: 'W'},
{label:'蓝', value: 'B'},
{label:'红黄', value: 'RY'},
{label:'红白', value: 'RW'},
{label:'绿绿', value: 'GG'},
{label:'绿黄', value: 'GY'},
{label:'黄黄', value: 'YY'},
{label:'红闪', value: 'RF'},
{label:'黄闪', value: 'YF'},
{label:'绿闪', value: 'GF'},
{label:'白闪', value: 'WF'}
]
};
},
computed: {
@ -312,6 +373,16 @@ export default {
});
});
return list;
},
lSWAList() {
const list = [];
Object.keys(this.addModel.leaveSectionWithAspectMap || {}).forEach(item => {
list.push({
sectionCode: item,
signalAspect: this.addModel.leaveSectionWithAspectMap[item]
});
});
return list;
}
},
watch: {
@ -364,6 +435,13 @@ export default {
callback();
}
},
lSWAValidate(rule, value, callback) {
if (Object.keys(value) <= 0) {
callback(new Error('请添加区段占用与信号'));
} else {
callback();
}
},
changeRadio() {
this.$refs.form.clearValidate();
},
@ -414,6 +492,9 @@ export default {
if (newModel.pathSwitchPosition && !newModel.pathSwitchPosition.switchCode) {
delete newModel.pathSwitchPosition;
}
if (newModel.type != 'DEPARTURE') {
delete newModel.leaveSectionWithAspectMap;
}
let api = editBigRoute;
if (!this.isModify) {
api = postBigRoute;
@ -467,6 +548,7 @@ export default {
switchCode:'',
normal:true
},
leaveSectionWithAspectMap: {},
btnCodeList:[],
routeAspectList:[]
};
@ -485,6 +567,20 @@ export default {
},
deleteSignalAspect(list, index) {
list.splice(index, 1);
},
addLSWAList() {
if (this.lSWACode && this.lSWASignalAspect) {
this.$set(this.addModel.leaveSectionWithAspectMap, this.lSWACode, this.lSWASignalAspect);
}
},
covertSectionCode(code) {
return (this.sectionList.find(route=>{ return route.code == code; }) || {name:''}).name;
},
covertLSWAAspect(code) {
return (this.lSWASignalAspectList.find(signalAspect=>{ return signalAspect.value == code; }) || {label:''}).label;
},
deleteLSWAItem(key) {
this.$delete(this.addModel.leaveSectionWithAspectMap, key);
}
}
};
@ -494,9 +590,6 @@ export default {
height: 100%;
overflow:auto;
padding-bottom: 60px;
}
.bigDefinition{
}
.bigDraft{
position: absolute;
@ -505,6 +598,9 @@ export default {
box-shadow: 4px 5px 10px #565656;
width: 100%;
padding: 8px 10px;
z-index: 100;
}
.bigDraftBtn{
float: right;
}
.bigDraftBtn{float: right;}
</style>