WebApp【公共组件库】@前端(For Git Submodule)
Tevin
2023-07-31 92d034e0e124928179f072224e9c2c1ad87fc1b2
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) {