Prechádzať zdrojové kódy

fix(mixins): 优化学校目的地匹配逻辑

扩展匹配条件,同时支持通过编码和名称匹配区域信息,修复仅通过编码匹配可能找不到对应区域的问题
lsc 4 hodín pred
rodič
commit
ad33180f02
1 zmenil súbory, kde vykonal 2 pridanie a 2 odobranie
  1. 2 2
      src/mixins/mixin.js

+ 2 - 2
src/mixins/mixin.js

@@ -203,7 +203,7 @@ export const myMixin = {
           }
           }
         }
         }
       }
       }
-      let area = this.areaJson.find(item => this.userJson.schooldest.includes(item.code));
+      let area = this.areaJson.find(item => this.userJson.schooldest.includes(item.code) || this.userJson.schooldest.includes(item.name));
       let dest = area ? area.name : '未知';
       let dest = area ? area.name : '未知';
 
 
       let params = {
       let params = {
@@ -291,7 +291,7 @@ export const myMixin = {
         }
         }
       }
       }
 
 
-      let area = this.areaJson.find(item => this.userJson.schooldest.includes(item.code));
+      let area = this.areaJson.find(item => this.userJson.schooldest.includes(item.code) || this.userJson.schooldest.includes(item.name));
       let dest = area ? area.name : '未知';
       let dest = area ? area.name : '未知';
 
 
       let params = {
       let params = {