From ae333df092271dc2a9963f7065df396a25aee885 Mon Sep 17 00:00:00 2001
From: shuishen <1109946754@qq.com>
Date: Sat, 23 Dec 2023 12:44:40 +0800
Subject: [PATCH] 解决报错的问题,场所管理

---
 src/views/place/index.vue             |   34 ++++++++++++++++------------------
 src/views/userHouse/houseHoldList.vue |    1 +
 2 files changed, 17 insertions(+), 18 deletions(-)

diff --git a/src/views/place/index.vue b/src/views/place/index.vue
index 335cbf2..1a64c0a 100644
--- a/src/views/place/index.vue
+++ b/src/views/place/index.vue
@@ -405,7 +405,7 @@
         rowSave (row, done, loading) {
             if (row.imageUrls.length > 0) {
                 var urls = []
-                var split = row.imageUrls.split(",")
+                var split = row.imageUrls.split(",").filter(item => item != '')
                 split.forEach(url => {
                     var names = url.split("jczz/")
                     urls.push(names[1])
@@ -442,7 +442,7 @@
         rowUpdate (row, index, done, loading) {
             if (row.imageUrls.length > 0) {
                 var urls = []
-                var split = row.imageUrls.split(",")
+                var split = row.imageUrls.split(",").filter(item => item != '')
                 split.forEach(url => {
                     var names = url.split("jczz/")
                     urls.push(names[1])
@@ -524,30 +524,28 @@
             if (["edit", "view"].includes(type)) {
                 getPlace(this.form.id).then((res) => {
                     this.form = res.data.data
-                    if (this.form.imageUrls) {
-                        if (this.form.imageUrls.length > 0) {
-                            var urls = []
-                            var names = this.form.imageUrls.split(",")
-                            names.forEach(name => {
-                                urls.push(website.minioUrl + name)
-                            })
-                            this.form.imageUrls = urls.join(",")
-                        }
+
+                    if (this.form.imageUrls.length) {
+                        this.form.imageUrls = this.form.imageUrls.split(",").filter(item => item != '').map(item => website.minioUrl + item).join(',')
                     }
 
                     if (this.form.placePoiLabelVOList.length) {
-                        this.form.label = this.form.placePoiLabelVOList.find(item => {
+                        let lebelTwo = this.form.placePoiLabelVOList.find(item => {
                             return item.type == 2
-                        }).poiCode
+                        })
 
-                        this.form.smallLabel = this.form.placePoiLabelVOList.find(item => {
+                        if (lebelTwo) this.form.label = String(lebelTwo.poiCode)
+
+                        let lebelThree = this.form.placePoiLabelVOList.find(item => {
                             return item.type == 3
-                        }).poiCode
+                        })
+
+                        if (lebelThree) this.form.label = String(lebelThree.poiCode)
                     }
+
+                    done()
                 })
             }
-            // con
-            done()
         },
         currentChange (currentPage) {
             this.page.currentPage = currentPage
@@ -583,7 +581,7 @@
                     if (item.imageUrls) {
                         if (item.imageUrls.length > 0) {
                             var urls = []
-                            var names = item.imageUrls.split(",")
+                            var names = item.imageUrls.split(",").filter(item => item != '')
                             names.forEach(name => {
                                 urls.push(website.minioUrl + name)
                             })
diff --git a/src/views/userHouse/houseHoldList.vue b/src/views/userHouse/houseHoldList.vue
index e93ed36..b73f134 100644
--- a/src/views/userHouse/houseHoldList.vue
+++ b/src/views/userHouse/houseHoldList.vue
@@ -192,6 +192,7 @@
                     {
                         width: 110,
                         label: "电话",
+                        labelWidth: 120,
                         prop: "phoneNumber",
                         search: true,
                         searchSpan: 3,

--
Gitblit v1.9.3