专家审核城市领域回显处理

This commit is contained in:
熊丽君
2022-01-20 10:53:46 +08:00
parent 8be58b403d
commit a92bb310a7
4 changed files with 42 additions and 6 deletions

View File

@ -87,6 +87,15 @@ export default {
},
};
},
watch: {
value(newOld) {
const data = Object.assign({}, newOld);
this.provinceCodeChange(data.province);
this.cityCodeChange(data.city);
newOld.city = data.city;
newOld.district = data.district;
},
},
methods: {
getProvinceByParent(id) {
return new Promise((resolve, reject) => {

View File

@ -64,10 +64,15 @@
closable
@close="handleFieldClose(index)"
>
<span v-for="(item, i) in tag" :key="item.id">
{{ item.name }}
<span v-if="tag.length != i + 1">></span>
</span>
<template v-if="Array.isArray(tag)">
<span v-for="(item, i) in tag" :key="item.id">
{{ item.name }}
<span v-if="tag.length != i + 1">></span>
</span>
</template>
<template v-else>
<span>{{ tag }}</span>
</template>
</el-tag>
</div>
</el-form-item>
@ -100,6 +105,19 @@ export default {
},
};
},
watch: {
value(newVal, oldVal) {
let _key = [];
let _value = [];
for (let i = 0; i < newVal.industrys.length; i++) {
const item = newVal.industrys[i];
_key.push(item.key);
_value.push(item.value);
}
newVal.industrys = _key;
this.industrysTags = _value;
},
},
methods: {
getFieldByParent(id) {
return new Promise((resolve, reject) => {

View File

@ -78,7 +78,6 @@ export default {
return;
}
expertDetail({ id }).then((res) => {
console.log(res);
this.form = res.data;
});
},

View File

@ -51,7 +51,17 @@
<el-table v-loading="loading" :data="userList">
<el-table-column label="数据编号" align="center" width="150" prop="id" />
<el-table-column label="专家姓名" align="center" prop="name" />
<el-table-column label="研究领域" align="center" prop="industry" />
<el-table-column
label="研究领域"
align="center"
prop="industrys"
show-overflow-tooltip
>
<template slot-scope="scope">
<div>{{ scope.row.industrys[0] }}</div>
<!-- <div v-for="item in scope.row.industrys" :key="item">{{ item }}</div> -->
</template>
</el-table-column>
<el-table-column
label="所属科研机构"
align="center"