Bläddra i källkod

fix: 邮编分区邮编显示问题

lyc 6 dagar sedan
förälder
incheckning
19f93fcc98
1 ändrade filer med 13 tillägg och 5 borttagningar
  1. 13 5
      src/utils/dealData.ts

+ 13 - 5
src/utils/dealData.ts

@@ -37,11 +37,19 @@ export function dealWithData(data: Recordable, type: string) {
         case BaseZoning.ZONING_POSTAL_CODE:
             // 并接邮编显示
             const filterData = newData.filter(item => item.startZipCode && item.endZipCode)
-            str = filterData.map(item => {
-                const startZipCode = item.startZipCode || ''
-                const endZipCode = item.endZipCode || ''
-                return startZipCode + ',' + endZipCode
-            }).join('|')
+            if (isArrayLength(filterData)) {
+                str = filterData.map(item => {
+                    const startZipCode = item.startZipCode || ''
+                    const endZipCode = item.endZipCode || ''
+                    return startZipCode + ',' + endZipCode
+                }).join('|')
+            } else {
+                str = newData.map(item => {
+                    const startZipCode = item.startZipCode || ''
+                    const endZipCode = item.endZipCode || ''
+                    return startZipCode + ',' + endZipCode
+                }).join('|')
+            }
             break;
         default:
             break;