java
<div v-if="form.caseType == 1">
<p class="title-submit" style="margin-top: 0">案源提供人信息</p>
<el-row v-for="(item, index) in form.superviseList" :key="index">
<el-col :span="8">
<el-form-item :label="`第${index + 1}位监督检查人`" style="margin-left: -40px" required>
<el-select v-model="item.superviseName" filterable :placeholder="`请选择第${index + 1}位监督检查人`">
<div v-if="item.isSpDept === 'Y'">
<el-option v-for="option in userList" :key="option.userId" :label="option.label" :value="option.userId">
</el-option>
</div>
<div v-else-if="item.superviseDept">
<el-option v-for="option in combinedUserList" :key="option.userId" :label="option.label" :value="option.userId">
</el-option>
</div>
<div v-else>
<el-option v-for="option in otherUserList" :key="option.userId" :label="option.label" :value="option.userId">
</el-option>
</div>
</el-select>
</el-form-item>
</el-col>
java
superviseList: [{
isSpDept: "Y",
superviseName: "",
superviseDept: "",
},],
根据superviseDept是否有传入值 进行回显选择
combinedUserList 是两个回显list的合并值 合并值看之前内容
根据判断 看是否正确回显数据 (此时修改前 表单组件表格 有时候显示字典键值)
java
userList: [],
otherUserList: [],
combinedUserList: [],
java
created() {
listCheckUser(2, true).then((response) => {
this.userList = response.rows.map((d) => {
d.label = `${d.nickName}`;
return d;
});
this.combinedUserList = this.userList.concat(this.otherUserList);
});