This commit is contained in:
yanran200730
2022-01-20 11:04:44 +08:00
parent 4755651c38
commit e11b79b9e1
3 changed files with 9 additions and 5 deletions

View File

@@ -19,7 +19,7 @@
<u-form-item label="发布地区" prop="areaId" required> <u-form-item label="发布地区" prop="areaId" required>
<div class="right"> <div class="right">
<AiAreaPicker v-model="forms.areaId" :areaId="user.areaId" @select="areaSelect"></AiAreaPicker> <AiAreaPicker :value="forms.areaId" :areaId="user.areaId" @select="areaSelect"></AiAreaPicker>
<u-icon name="arrow-right" color="#CCCCCC" class="right-icon area-right-icon"></u-icon> <u-icon name="arrow-right" color="#CCCCCC" class="right-icon area-right-icon"></u-icon>
</div> </div>
</u-form-item> </u-form-item>
@@ -69,13 +69,14 @@ export default {
}, },
computed: {...mapState(['user'])}, computed: {...mapState(['user'])},
onLoad(o) { onLoad(o) {
console.log(o)
if (o.id) { if (o.id) {
this.id = o.id this.id = o.id
} }
this.moduleId = o.moduleId this.moduleId = o.moduleId
this.forms.areaId = this.user.areaId if (!o.id) {
this.forms.areaId = this.user.areaId
}
this.listName = o.listName this.listName = o.listName
this.getType() this.getType()
}, },

View File

@@ -93,7 +93,6 @@ export default {
this.areaIdProps = this.user.areaId this.areaIdProps = this.user.areaId
if (!this.id) { if (!this.id) {
this.forms.areaId = this.user.areaId this.forms.areaId = this.user.areaId
this.forms.areaName = this.user.areaName
} }
this.$dict.load('realityStatus').then(() => { this.$dict.load('realityStatus').then(() => {
this.getDetail() this.getDetail()

View File

@@ -161,10 +161,13 @@ export default {
if (this.value && !this.areaName && this.value !== this.areaId) { if (this.value && !this.areaName && this.value !== this.areaId) {
this.areaName = this.list.find((e) => e.id == this.value).name this.areaName = this.list.find((e) => e.id == this.value).name
} }
if (!this.areaName && this.value === this.areaId) { if (!this.areaName && this.value === this.areaId) {
this.areaName = self.name this.areaName = self.name
} }
if (!this.value) {
this.areaName = self.name
}
if (self.id) { if (self.id) {
this.list.unshift(self) this.list.unshift(self)
} }
@@ -230,6 +233,7 @@ export default {
}, },
handleInit() { handleInit() {
this.index = this.value || this.areaId this.index = this.value || this.areaId
console.log(this.value, this.areaId)
if (this.all && !this.areaId && !this.currentArea.id) { if (this.all && !this.areaId && !this.currentArea.id) {
this.getProvinces() this.getProvinces()