DESKTOP-SVI9JE1\muzen vor 1 Jahr
Ursprung
Commit
205af8c979
1 geänderte Dateien mit 4 neuen und 2 gelöschten Zeilen
  1. 4 2
      src/mixin/index.js

+ 4 - 2
src/mixin/index.js

@@ -641,10 +641,12 @@ const mapMixin = {
     
     
     areaFormatter(row) {
     areaFormatter(row) {
       if (this.mapOptions.length > 0) {
       if (this.mapOptions.length > 0) {
-        let province = row.province ? this.mapOptions.find(i => i.id == row.province) : { name: '', childList: [] }
+        let province = row.province ? this.mapOptions.find(i => i.id == row.province) : ''
         let provinceName = province ? province.name : ''
         let provinceName = province ? province.name : ''
-        let city = province.childList.length > 0 ? province.childList.find(i => i.id == row.city) : ''
+
+        let city = province && province.childList.length > 0 ? province.childList.find(i => i.id == row.city) : ''
         let cityName = city ? `-${city.name}` : ''
         let cityName = city ? `-${city.name}` : ''
+
         let area = city && city.childList.length > 0 ? city.childList.find(i => i.id == row.area) : ''
         let area = city && city.childList.length > 0 ? city.childList.find(i => i.id == row.area) : ''
         let areaName = area ? `-${area.name}` : ''
         let areaName = area ? `-${area.name}` : ''
         return `${provinceName}${cityName}${areaName}`
         return `${provinceName}${cityName}${areaName}`