线路设计-仿真成员-会话群名称显示调整

This commit is contained in:
dong 2023-04-24 10:42:18 +08:00
parent 4fe929cd37
commit 196f8e5306

View File

@ -304,7 +304,7 @@
</div>
</el-tab-pane>
<el-tab-pane class="view-control" label="会话群" name="six" :lazy="lazy">
<el-tabs v-model="conversationActive" class="card" style="height: 100%">
<el-tabs v-model="conversationActive" class="card" style="height: calc(100% - 46px)">
<el-tab-pane class="view-control" label="地铁CBTC" name="METRO">
<div style="height: 100%;overflow-y: auto;padding: 5px;">
<el-row :gutter="5" style="margin-bottom: 5px;">
@ -316,7 +316,7 @@
</el-row>
<el-row v-for="(item, index) in conversationMetroList" :key="index" :gutter="5" class="conversationRow">
<el-col :span="4">
<el-input v-model="item.name" size="mini" />
<el-input v-model="item.name" size="mini" :title="item.name" />
</el-col>
<el-col :span="4">
<div class="uploadImgDiv">
@ -326,12 +326,12 @@
</div>
</el-col>
<el-col :span="5">
<el-select v-model="item.leaderId" placeholder="请选择" size="mini">
<el-select v-model="item.leaderId" placeholder="请选择" size="mini" :title="getMemberTitle(item.leaderId, memberMetroList)">
<el-option v-for="elem in memberMetroList" :key="elem.id" :label="getLabel(elem)" :value="elem.id" />
</el-select>
</el-col>
<el-col :span="8">
<el-select v-model="item.memberIds" multiple collapse-tags placeholder="请选择" size="mini">
<el-select v-model="item.memberIds" multiple collapse-tags placeholder="请选择" size="mini" :title="getMemberTitle(item.memberIds, memberMetroList)">
<el-option v-for="elem in memberMetroList" :key="elem.id" :label="getLabel(elem)" :value="elem.id" />
</el-select>
</el-col>
@ -352,7 +352,7 @@
</el-row>
<el-row v-for="(item, index) in conversationRailwayList" :key="index" :gutter="5" class="conversationRow">
<el-col :span="4">
<el-input v-model="item.name" size="mini" />
<el-input v-model="item.name" size="mini" :title="item.name" />
</el-col>
<el-col :span="4">
<div class="uploadImgDiv">
@ -362,12 +362,12 @@
</div>
</el-col>
<el-col :span="5">
<el-select v-model="item.leaderId" placeholder="请选择" size="mini">
<el-select v-model="item.leaderId" placeholder="请选择" size="mini" :title="getMemberTitle(item.leaderId, memberRailwayList)">
<el-option v-for="elem in memberRailwayList" :key="elem.id" :label="getLabel(elem)" :value="elem.id" />
</el-select>
</el-col>
<el-col :span="8">
<el-select v-model="item.memberIds" multiple collapse-tags placeholder="请选择" size="mini">
<el-select v-model="item.memberIds" multiple collapse-tags placeholder="请选择" size="mini" :title="getMemberTitle(item.memberIds, memberRailwayList)">
<el-option v-for="elem in memberRailwayList" :key="elem.id" :label="getLabel(elem)" :value="elem.id" />
</el-select>
</el-col>
@ -388,7 +388,7 @@
</el-row>
<el-row v-for="(item, index) in conversationEmergencyList" :key="index" :gutter="5" class="conversationRow">
<el-col :span="4">
<el-input v-model="item.name" size="mini" />
<el-input v-model="item.name" size="mini" :title="item.name" />
</el-col>
<el-col :span="4">
<div class="uploadImgDiv">
@ -398,12 +398,12 @@
</div>
</el-col>
<el-col :span="5">
<el-select v-model="item.leaderId" placeholder="请选择" size="mini">
<el-select v-model="item.leaderId" placeholder="请选择" size="mini" :title="getMemberTitle(item.leaderId, memberEmergencyList)">
<el-option v-for="elem in memberEmergencyList" :key="elem.id" :label="getLabel(elem)" :value="elem.id" />
</el-select>
</el-col>
<el-col :span="8">
<el-select v-model="item.memberIds" multiple collapse-tags placeholder="请选择" size="mini">
<el-select v-model="item.memberIds" multiple collapse-tags placeholder="请选择" size="mini" :title="getMemberTitle(item.memberIds, memberEmergencyList)">
<el-option v-for="elem in memberEmergencyList" :key="elem.id" :label="getLabel(elem)" :value="elem.id" />
</el-select>
</el-col>
@ -514,6 +514,25 @@ export default {
this.initDisStationList();
},
methods: {
getMemberTitle(val, list) {
const mapList = {};
list.forEach(item => {
mapList[item.id] = item;
});
const titleArr = [];
let valArr = [];
if (Array.isArray(val)) {
valArr = val;
} else if (typeof val == 'string') {
valArr = [val];
}
valArr.forEach(id => {
if (mapList[id]) {
titleArr.push(this.getLabel(mapList[id]));
}
});
return titleArr.join('\n');
},
getImgUrl(url) {
return url ? this.$store.state.user.ossUrl + '/conversationGroup/' + url : '';
},