From 92d034e0e124928179f072224e9c2c1ad87fc1b2 Mon Sep 17 00:00:00 2001
From: Tevin <tingquanren@163.com>
Date: Mon, 31 Jul 2023 11:43:45 +0800
Subject: [PATCH] 地址联动组件升级,支持第四级街道,数据采用异步

---
 forms/chinaArea/SmartAddress.js |    8 ++++----
 1 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/forms/chinaArea/SmartAddress.js b/forms/chinaArea/SmartAddress.js
index 750a6ac..ee453ec 100644
--- a/forms/chinaArea/SmartAddress.js
+++ b/forms/chinaArea/SmartAddress.js
@@ -3,7 +3,7 @@
  * @author Tevin
  */
 
-import ChinaLocations from '@components/forms/chinaArea/ChinaLocations';
+import { $locations } from '@components/forms/chinaArea/ChinaLocations';
 import { Tools } from '@components/common/Tools';
 
 export class SmartAddress {
@@ -18,7 +18,7 @@
         }
         this.wordData = {};
         const wordArr = this._splitWord(word);
-        ChinaLocations.onReady(() => {
+        $locations.onReady(() => {
             this._checkPhone(wordArr);
             this._checkCompany(wordArr);
             this._checkUser(wordArr);
@@ -161,7 +161,7 @@
 
     _isAddress(content) {
         content = content.replace('中国', '');
-        const provinceNames = ChinaLocations.getLocationTree()
+        const provinceNames = $locations.getLocationTree()
             .map(lv1 => lv1.label.replace('特别行政区', '').replace('省', ''));
         for (let province of provinceNames) {
             if (content.indexOf(province) >= 0) {
@@ -173,7 +173,7 @@
 
     _parseAddress(content) {
         content = content.replace('中国', '');
-        const chinaTree = ChinaLocations.getLocationTree();
+        const chinaTree = $locations.getLocationTree();
         // 省份处理 ---
         const provinceTailReg = /特别行政区|自治区|省|市$/;
         for (let province of chinaTree) {

--
Gitblit v1.9.1