Browse Source

新增默认平台名称、修改所属区域展示

pull/1/head
余菲 2 years ago
parent
commit
aaa931efc6
2 changed files with 31 additions and 27 deletions
  1. +1
    -1
      src/views/data/tenant/index.vue
  2. +30
    -26
      src/views/data/tenant/tenant-edit.vue

+ 1
- 1
src/views/data/tenant/index.vue View File

@@ -56,7 +56,7 @@
</template>
<!-- 所属区域 -->
<template #provinceName="{record}">
<span>{{record.provinceName + record.cityName + record.districtName + ''}}</span>
<span>{{(record.provinceName || '') + (record.cityName || '') + (record.districtName || '')}}</span>
</template>
<!-- 租户类型 -->
<template #type="{ record }">

+ 30
- 26
src/views/data/tenant/tenant-edit.vue View File

@@ -86,6 +86,7 @@
"
style="width: 100%"
placeholder="请选择省"
allow-clear
@change="selectArea(form.provinceCode, 'province', 'city')"
>
<a-select-option
@@ -104,6 +105,7 @@
>
<a-select
v-model:value="form.cityCode"
allow-clear
:get-popup-container="
(triggerNode) => {
return triggerNode.parentNode;
@@ -134,6 +136,7 @@
return triggerNode.parentNode;
}
"
allow-clear
style="width: 100%"
placeholder="请选择区"
@change="selectArea(form.districtCode, 'district', 'street')"
@@ -153,8 +156,8 @@
<a-form-item label="平台名称:" name="platformName">
<a-input
allow-clear
:maxlength="150"
placeholder="请输入平台名称"
:maxlength="8"
placeholder="请输入平台名称(长度不超过8个字)"
v-model:value="form.platformName"
/>
</a-form-item>
@@ -247,38 +250,39 @@ export default {
},
watch: {
data() {
if (this.data) {
this.form = Object.assign({}, this.data);
this.isUpdate = true;
this.initUpload = this.data.logo

} else {
this.form = { status: 1 };
this.isUpdate = false;
this.initUpload = ''
}
if (this.$refs.form) {
this.$refs.form.clearValidate();
}
},
visible() {
if(this.visible) {
if(this.provinceList.length) {
if(this.form.provinceCode) {
this.provinceList.forEach((item) => {
if (item.citycode === this.form.provinceCode) {
this.cityList = item.itemList
}
})
}
if(this.form.cityCode) {
this.cityList.forEach((item) => {
if (item.citycode === this.form.cityCode) {
this.districtList = item.itemList
}
})
if (this.data) {
this.form = Object.assign({}, this.data);
this.isUpdate = true;
this.initUpload = this.data.logo
if(this.provinceList.length) {
if(this.form.provinceCode) {
this.provinceList.forEach((item) => {
if (item.citycode === this.form.provinceCode) {
this.cityList = item.itemList
}
})
}
if(this.form.cityCode) {
this.cityList.forEach((item) => {
if (item.citycode === this.form.cityCode) {
this.districtList = item.itemList
}
})
}
}
} else {
this.form = {platformName: '河湖长眼巡检平台'};
this.isUpdate = false;
this.initUpload = ''
}
} else {
this.form = {platformName: '河湖长眼巡检平台'}
}
}
},

Loading…
Cancel
Save