@fmdevui/fm-dev 1.0.89 → 1.0.90
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/es/_virtual/de-DE.mjs +1 -1
- package/es/_virtual/en-US.mjs +1 -1
- package/es/_virtual/es-ES.mjs +1 -1
- package/es/_virtual/fr-FR.mjs +1 -1
- package/es/_virtual/it-IT.mjs +1 -1
- package/es/_virtual/ja-JP.mjs +1 -1
- package/es/_virtual/ko-KR.mjs +1 -1
- package/es/_virtual/nb-NO.mjs +1 -1
- package/es/_virtual/pt-BR.mjs +1 -1
- package/es/_virtual/ru-RU.mjs +1 -1
- package/es/_virtual/th-TH.mjs +1 -1
- package/es/_virtual/vi-VN.mjs +1 -1
- package/es/_virtual/zh-CN.mjs +1 -1
- package/es/_virtual/zh-HK.mjs +1 -1
- package/es/_virtual/zh-TW.mjs +1 -1
- package/es/core/utils/cityparess/index.d.ts +2 -2
- package/es/packages/core/ui/components/fmaddressparsing/index.vue2.mjs +174 -104
- package/es/packages/core/utils/cityparess/index.mjs +169 -94
- package/index.js +345 -200
- package/index.min.js +27 -27
- package/index.min.mjs +26 -26
- package/index.mjs +345 -200
- package/lib/_virtual/de-DE.js +1 -1
- package/lib/_virtual/en-US.js +1 -1
- package/lib/_virtual/es-ES.js +1 -1
- package/lib/_virtual/fr-FR.js +1 -1
- package/lib/_virtual/it-IT.js +1 -1
- package/lib/_virtual/ja-JP.js +1 -1
- package/lib/_virtual/ko-KR.js +1 -1
- package/lib/_virtual/nb-NO.js +1 -1
- package/lib/_virtual/pt-BR.js +1 -1
- package/lib/_virtual/ru-RU.js +1 -1
- package/lib/_virtual/th-TH.js +1 -1
- package/lib/_virtual/vi-VN.js +1 -1
- package/lib/_virtual/zh-CN.js +1 -1
- package/lib/_virtual/zh-HK.js +1 -1
- package/lib/_virtual/zh-TW.js +1 -1
- package/lib/core/utils/cityparess/index.d.ts +2 -2
- package/lib/packages/core/ui/components/fmaddressparsing/index.vue2.js +174 -104
- package/lib/packages/core/utils/cityparess/index.js +169 -94
- package/package.json +1 -1
- /package/es/{defaults.css → component.css} +0 -0
- /package/es/node_modules/.pnpm/{vxe-table@4.16.4_vue@3.5.20_typescript@5.8.3_ → vxe-table@4.16.6_vue@3.5.20_typescript@5.8.3_}/node_modules/vxe-table/lib/locale/lang/de-DE.mjs +0 -0
- /package/es/node_modules/.pnpm/{vxe-table@4.16.4_vue@3.5.20_typescript@5.8.3_ → vxe-table@4.16.6_vue@3.5.20_typescript@5.8.3_}/node_modules/vxe-table/lib/locale/lang/en-US.mjs +0 -0
- /package/es/node_modules/.pnpm/{vxe-table@4.16.4_vue@3.5.20_typescript@5.8.3_ → vxe-table@4.16.6_vue@3.5.20_typescript@5.8.3_}/node_modules/vxe-table/lib/locale/lang/es-ES.mjs +0 -0
- /package/es/node_modules/.pnpm/{vxe-table@4.16.4_vue@3.5.20_typescript@5.8.3_ → vxe-table@4.16.6_vue@3.5.20_typescript@5.8.3_}/node_modules/vxe-table/lib/locale/lang/fr-FR.mjs +0 -0
- /package/es/node_modules/.pnpm/{vxe-table@4.16.4_vue@3.5.20_typescript@5.8.3_ → vxe-table@4.16.6_vue@3.5.20_typescript@5.8.3_}/node_modules/vxe-table/lib/locale/lang/it-IT.mjs +0 -0
- /package/es/node_modules/.pnpm/{vxe-table@4.16.4_vue@3.5.20_typescript@5.8.3_ → vxe-table@4.16.6_vue@3.5.20_typescript@5.8.3_}/node_modules/vxe-table/lib/locale/lang/ja-JP.mjs +0 -0
- /package/es/node_modules/.pnpm/{vxe-table@4.16.4_vue@3.5.20_typescript@5.8.3_ → vxe-table@4.16.6_vue@3.5.20_typescript@5.8.3_}/node_modules/vxe-table/lib/locale/lang/ko-KR.mjs +0 -0
- /package/es/node_modules/.pnpm/{vxe-table@4.16.4_vue@3.5.20_typescript@5.8.3_ → vxe-table@4.16.6_vue@3.5.20_typescript@5.8.3_}/node_modules/vxe-table/lib/locale/lang/nb-NO.mjs +0 -0
- /package/es/node_modules/.pnpm/{vxe-table@4.16.4_vue@3.5.20_typescript@5.8.3_ → vxe-table@4.16.6_vue@3.5.20_typescript@5.8.3_}/node_modules/vxe-table/lib/locale/lang/pt-BR.mjs +0 -0
- /package/es/node_modules/.pnpm/{vxe-table@4.16.4_vue@3.5.20_typescript@5.8.3_ → vxe-table@4.16.6_vue@3.5.20_typescript@5.8.3_}/node_modules/vxe-table/lib/locale/lang/ru-RU.mjs +0 -0
- /package/es/node_modules/.pnpm/{vxe-table@4.16.4_vue@3.5.20_typescript@5.8.3_ → vxe-table@4.16.6_vue@3.5.20_typescript@5.8.3_}/node_modules/vxe-table/lib/locale/lang/th-TH.mjs +0 -0
- /package/es/node_modules/.pnpm/{vxe-table@4.16.4_vue@3.5.20_typescript@5.8.3_ → vxe-table@4.16.6_vue@3.5.20_typescript@5.8.3_}/node_modules/vxe-table/lib/locale/lang/vi-VN.mjs +0 -0
- /package/es/node_modules/.pnpm/{vxe-table@4.16.4_vue@3.5.20_typescript@5.8.3_ → vxe-table@4.16.6_vue@3.5.20_typescript@5.8.3_}/node_modules/vxe-table/lib/locale/lang/zh-CHT.mjs +0 -0
- /package/es/node_modules/.pnpm/{vxe-table@4.16.4_vue@3.5.20_typescript@5.8.3_ → vxe-table@4.16.6_vue@3.5.20_typescript@5.8.3_}/node_modules/vxe-table/lib/locale/lang/zh-CN.mjs +0 -0
- /package/es/node_modules/.pnpm/{vxe-table@4.16.4_vue@3.5.20_typescript@5.8.3_ → vxe-table@4.16.6_vue@3.5.20_typescript@5.8.3_}/node_modules/vxe-table/lib/locale/lang/zh-HK.mjs +0 -0
- /package/es/node_modules/.pnpm/{vxe-table@4.16.4_vue@3.5.20_typescript@5.8.3_ → vxe-table@4.16.6_vue@3.5.20_typescript@5.8.3_}/node_modules/vxe-table/lib/locale/lang/zh-TW.mjs +0 -0
- /package/lib/{defaults.css → index.css} +0 -0
- /package/lib/node_modules/.pnpm/{vxe-table@4.16.4_vue@3.5.20_typescript@5.8.3_ → vxe-table@4.16.6_vue@3.5.20_typescript@5.8.3_}/node_modules/vxe-table/lib/locale/lang/de-DE.js +0 -0
- /package/lib/node_modules/.pnpm/{vxe-table@4.16.4_vue@3.5.20_typescript@5.8.3_ → vxe-table@4.16.6_vue@3.5.20_typescript@5.8.3_}/node_modules/vxe-table/lib/locale/lang/en-US.js +0 -0
- /package/lib/node_modules/.pnpm/{vxe-table@4.16.4_vue@3.5.20_typescript@5.8.3_ → vxe-table@4.16.6_vue@3.5.20_typescript@5.8.3_}/node_modules/vxe-table/lib/locale/lang/es-ES.js +0 -0
- /package/lib/node_modules/.pnpm/{vxe-table@4.16.4_vue@3.5.20_typescript@5.8.3_ → vxe-table@4.16.6_vue@3.5.20_typescript@5.8.3_}/node_modules/vxe-table/lib/locale/lang/fr-FR.js +0 -0
- /package/lib/node_modules/.pnpm/{vxe-table@4.16.4_vue@3.5.20_typescript@5.8.3_ → vxe-table@4.16.6_vue@3.5.20_typescript@5.8.3_}/node_modules/vxe-table/lib/locale/lang/it-IT.js +0 -0
- /package/lib/node_modules/.pnpm/{vxe-table@4.16.4_vue@3.5.20_typescript@5.8.3_ → vxe-table@4.16.6_vue@3.5.20_typescript@5.8.3_}/node_modules/vxe-table/lib/locale/lang/ja-JP.js +0 -0
- /package/lib/node_modules/.pnpm/{vxe-table@4.16.4_vue@3.5.20_typescript@5.8.3_ → vxe-table@4.16.6_vue@3.5.20_typescript@5.8.3_}/node_modules/vxe-table/lib/locale/lang/ko-KR.js +0 -0
- /package/lib/node_modules/.pnpm/{vxe-table@4.16.4_vue@3.5.20_typescript@5.8.3_ → vxe-table@4.16.6_vue@3.5.20_typescript@5.8.3_}/node_modules/vxe-table/lib/locale/lang/nb-NO.js +0 -0
- /package/lib/node_modules/.pnpm/{vxe-table@4.16.4_vue@3.5.20_typescript@5.8.3_ → vxe-table@4.16.6_vue@3.5.20_typescript@5.8.3_}/node_modules/vxe-table/lib/locale/lang/pt-BR.js +0 -0
- /package/lib/node_modules/.pnpm/{vxe-table@4.16.4_vue@3.5.20_typescript@5.8.3_ → vxe-table@4.16.6_vue@3.5.20_typescript@5.8.3_}/node_modules/vxe-table/lib/locale/lang/ru-RU.js +0 -0
- /package/lib/node_modules/.pnpm/{vxe-table@4.16.4_vue@3.5.20_typescript@5.8.3_ → vxe-table@4.16.6_vue@3.5.20_typescript@5.8.3_}/node_modules/vxe-table/lib/locale/lang/th-TH.js +0 -0
- /package/lib/node_modules/.pnpm/{vxe-table@4.16.4_vue@3.5.20_typescript@5.8.3_ → vxe-table@4.16.6_vue@3.5.20_typescript@5.8.3_}/node_modules/vxe-table/lib/locale/lang/vi-VN.js +0 -0
- /package/lib/node_modules/.pnpm/{vxe-table@4.16.4_vue@3.5.20_typescript@5.8.3_ → vxe-table@4.16.6_vue@3.5.20_typescript@5.8.3_}/node_modules/vxe-table/lib/locale/lang/zh-CHT.js +0 -0
- /package/lib/node_modules/.pnpm/{vxe-table@4.16.4_vue@3.5.20_typescript@5.8.3_ → vxe-table@4.16.6_vue@3.5.20_typescript@5.8.3_}/node_modules/vxe-table/lib/locale/lang/zh-CN.js +0 -0
- /package/lib/node_modules/.pnpm/{vxe-table@4.16.4_vue@3.5.20_typescript@5.8.3_ → vxe-table@4.16.6_vue@3.5.20_typescript@5.8.3_}/node_modules/vxe-table/lib/locale/lang/zh-HK.js +0 -0
- /package/lib/node_modules/.pnpm/{vxe-table@4.16.4_vue@3.5.20_typescript@5.8.3_ → vxe-table@4.16.6_vue@3.5.20_typescript@5.8.3_}/node_modules/vxe-table/lib/locale/lang/zh-TW.js +0 -0
|
@@ -1,114 +1,150 @@
|
|
|
1
1
|
import { useBaseApi } from '../../api/base/index.mjs';
|
|
2
2
|
|
|
3
3
|
const addressparsing = async (val) => {
|
|
4
|
-
let province = "";
|
|
5
4
|
if (val == null || val == void 0 || val == "" || val.trim() == "" || val.trim().length < 2) {
|
|
6
5
|
return { province: "", city: "", county: "" };
|
|
7
6
|
}
|
|
7
|
+
let _Province = "";
|
|
8
|
+
let _City = "";
|
|
9
|
+
let _County = "";
|
|
8
10
|
const oldvalue = val.trim();
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
province = cityobj.p;
|
|
11
|
+
const oldValueLen = val.trim().length;
|
|
12
|
+
const oneObje = getProvince(oldvalue);
|
|
13
|
+
let nextValue = oldvalue;
|
|
14
|
+
if (oneObje.p != "") {
|
|
15
|
+
_Province = oneObje.p;
|
|
16
|
+
nextValue = oldvalue.replace(oneObje.p, "").trim();
|
|
17
|
+
if (nextValue.length == oldValueLen) {
|
|
18
|
+
for (let i = _Province.length - 1; i >= 1; i--) {
|
|
19
|
+
nextValue = oldvalue.replace(oneObje.p.substr(0, i), "").trim();
|
|
20
|
+
if (nextValue.length < oldValueLen) {
|
|
21
|
+
break;
|
|
22
|
+
}
|
|
23
|
+
}
|
|
23
24
|
}
|
|
24
25
|
}
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
if (
|
|
37
|
-
|
|
38
|
-
if (countyOjb.x == "" && newValue.length > 6) {
|
|
39
|
-
countyOjb = chkeCounty(province, cityobj.c, newValue.substr(0, 7));
|
|
40
|
-
if (countyOjb.x == "" && newValue.length > 7) {
|
|
41
|
-
countyOjb = chkeCounty(province, cityobj.c, newValue.substr(0, 8));
|
|
42
|
-
if (countyOjb.x == "" && newValue.length > 8) {
|
|
43
|
-
countyOjb = chkeCounty(province, cityobj.c, newValue.substr(0, 9));
|
|
44
|
-
if (countyOjb.x == "" && newValue.length > 9) {
|
|
45
|
-
countyOjb = chkeCounty(province, cityobj.c, newValue.substr(0, 10));
|
|
46
|
-
if (countyOjb.x == "" && newValue.length > 10) {
|
|
47
|
-
countyOjb = chkeCounty(province, cityobj.c, newValue.substr(0, 11));
|
|
48
|
-
if (countyOjb.x == "" && newValue.length > 11) {
|
|
49
|
-
countyOjb = chkeCounty(province, cityobj.c, newValue.substr(0, 12));
|
|
50
|
-
if (countyOjb.x == "" && newValue.length > 12) {
|
|
51
|
-
countyOjb = chkeCounty(province, cityobj.c, newValue.substr(0, 13));
|
|
52
|
-
}
|
|
53
|
-
}
|
|
54
|
-
}
|
|
55
|
-
}
|
|
56
|
-
}
|
|
57
|
-
}
|
|
58
|
-
}
|
|
26
|
+
const oldValueLen2 = nextValue.length;
|
|
27
|
+
const twoObje = getCity(nextValue, _Province);
|
|
28
|
+
if (twoObje.c != "") {
|
|
29
|
+
_City = twoObje.c;
|
|
30
|
+
if (_Province == "") {
|
|
31
|
+
_Province = twoObje.p;
|
|
32
|
+
}
|
|
33
|
+
nextValue = nextValue.replace(twoObje.c, "").trim();
|
|
34
|
+
if (nextValue.length == oldValueLen2) {
|
|
35
|
+
for (let i = _City.length - 1; i >= 1; i--) {
|
|
36
|
+
nextValue = nextValue.replace(twoObje.c.substr(0, i), "").trim();
|
|
37
|
+
if (nextValue.length < oldValueLen2) {
|
|
38
|
+
break;
|
|
59
39
|
}
|
|
60
40
|
}
|
|
61
41
|
}
|
|
62
42
|
}
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
43
|
+
const oldValueLen3 = nextValue.length;
|
|
44
|
+
const threeObje = getCounty(nextValue, _City, _Province);
|
|
45
|
+
if (threeObje.x != "") {
|
|
46
|
+
_County = threeObje.x;
|
|
47
|
+
if (_Province == "") {
|
|
48
|
+
_Province = threeObje.p;
|
|
49
|
+
}
|
|
50
|
+
if (_City == "") {
|
|
51
|
+
_City = threeObje.c;
|
|
52
|
+
}
|
|
53
|
+
nextValue = nextValue.replace(threeObje.x, "").trim();
|
|
54
|
+
if (nextValue.length == oldValueLen3) {
|
|
55
|
+
for (let i = _City.length - 1; i >= 1; i--) {
|
|
56
|
+
nextValue = nextValue.replace(threeObje.x.substr(0, i), "").trim();
|
|
57
|
+
if (nextValue.length < oldValueLen3) {
|
|
58
|
+
break;
|
|
59
|
+
}
|
|
60
|
+
}
|
|
61
|
+
}
|
|
68
62
|
}
|
|
69
|
-
if (
|
|
70
|
-
return { province, city:
|
|
63
|
+
if (_Province != "" && _City != "" && _County != "") {
|
|
64
|
+
return { province: _Province, city: _City, county: _County };
|
|
71
65
|
}
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
return { province, city: cityobj.c, county: countyOjb.x };
|
|
66
|
+
if (nextValue.length < 2) {
|
|
67
|
+
return { province: _Province, city: _City, county: _County };
|
|
75
68
|
}
|
|
76
|
-
const res = await useBaseApi("sysRegion").post({ Province:
|
|
69
|
+
const res = await useBaseApi("sysRegion").post({ Province: _Province, City: _City, text: oldvalue, textnew: nextValue }, "qRegionInfo");
|
|
77
70
|
const streetobj = res.data.result;
|
|
78
|
-
const rpdata = { province, city: cityobj.c, county: countyOjb.x };
|
|
79
71
|
if (streetobj.province != "") {
|
|
80
|
-
|
|
72
|
+
_Province = streetobj.province;
|
|
81
73
|
}
|
|
82
74
|
if (streetobj.city != "") {
|
|
83
|
-
|
|
75
|
+
_City = streetobj.city;
|
|
84
76
|
}
|
|
85
77
|
if (streetobj.county != "") {
|
|
86
|
-
|
|
78
|
+
_County = streetobj.county;
|
|
87
79
|
}
|
|
88
|
-
return
|
|
80
|
+
return { province: _Province, city: _City, county: _County };
|
|
89
81
|
};
|
|
90
|
-
const
|
|
82
|
+
const getProvince = (val) => {
|
|
83
|
+
if (val == null || val == void 0 || val == "" || val.length < 2) {
|
|
84
|
+
return { p: "", jval: "" };
|
|
85
|
+
}
|
|
86
|
+
const jval = val.substr(0, 2);
|
|
87
|
+
const objectOne = splitProvince(jval);
|
|
88
|
+
if (objectOne.list.length == 1) {
|
|
89
|
+
return { p: objectOne.list[0], jval };
|
|
90
|
+
} else if (objectOne.list.length > 1) {
|
|
91
|
+
const jval3 = val.substr(0, 3);
|
|
92
|
+
const objectThreed = splitProvince(jval3);
|
|
93
|
+
if (objectThreed.list.length == 1) {
|
|
94
|
+
return { p: objectThreed.list[0], jval: jval3 };
|
|
95
|
+
}
|
|
96
|
+
}
|
|
97
|
+
return { p: "", jval: "" };
|
|
98
|
+
};
|
|
99
|
+
const splitProvince = (val) => {
|
|
91
100
|
if (val == null || val == void 0 || val == "") {
|
|
92
|
-
return "";
|
|
101
|
+
return { p: "", list: [], count: 0 };
|
|
93
102
|
}
|
|
94
|
-
|
|
103
|
+
const findList = [];
|
|
95
104
|
for (let i = 0; i < provinceData.length; i++) {
|
|
96
105
|
if (provinceData[i].indexOf(val) > -1) {
|
|
97
106
|
const arrTemp = provinceData[i].split("|");
|
|
98
107
|
const arr = arrTemp.filter((item) => item == val);
|
|
99
108
|
if (arr && arr.length > 0) {
|
|
100
|
-
|
|
101
|
-
|
|
109
|
+
findList.push(provinceData[i].split("|")[0]);
|
|
110
|
+
}
|
|
111
|
+
}
|
|
112
|
+
}
|
|
113
|
+
const firstOne = findList.length > 0 ? findList[0] : "";
|
|
114
|
+
return { p: firstOne, list: findList, count: findList.length };
|
|
115
|
+
};
|
|
116
|
+
const getCity = (val, province) => {
|
|
117
|
+
if (val == null || val == void 0 || val == "" || val.length < 2) {
|
|
118
|
+
return { p: "", c: "", jval: "" };
|
|
119
|
+
}
|
|
120
|
+
const jval = val.substr(0, 2);
|
|
121
|
+
const objectOne = splitCity(jval, province);
|
|
122
|
+
if (objectOne.list.length == 1) {
|
|
123
|
+
return { p: objectOne.p, c: objectOne.c, jval };
|
|
124
|
+
} else if (objectOne.list.length > 1) {
|
|
125
|
+
const jval3 = val.substr(0, 3);
|
|
126
|
+
const objectThreed = splitCity(jval3, province);
|
|
127
|
+
if (objectThreed.list.length == 1) {
|
|
128
|
+
return { p: objectThreed.p, c: objectThreed.c, jval: jval3 };
|
|
129
|
+
} else if (objectThreed.list.length == 0) {
|
|
130
|
+
return { p: objectOne.p, c: objectOne.c, jval: val };
|
|
131
|
+
} else if (objectThreed.list.length > 0) {
|
|
132
|
+
const jval4 = val.substr(0, 4);
|
|
133
|
+
const objectFoure = splitCity(jval4, province);
|
|
134
|
+
if (objectFoure.list.length > 0) {
|
|
135
|
+
return { p: objectFoure.p, c: objectFoure.c, jval: jval4 };
|
|
136
|
+
} else if (objectFoure.list.length == 0) {
|
|
137
|
+
return { p: objectThreed.p, c: objectThreed.c, jval: jval3 };
|
|
102
138
|
}
|
|
103
139
|
}
|
|
104
140
|
}
|
|
105
|
-
return
|
|
141
|
+
return { p: "", c: "", jval: "" };
|
|
106
142
|
};
|
|
107
|
-
const
|
|
143
|
+
const splitCity = (val, province) => {
|
|
108
144
|
if (val == null || val == void 0 || val == "") {
|
|
109
|
-
return { p: "", c: "" };
|
|
145
|
+
return { p: "", c: "", list: [] };
|
|
110
146
|
}
|
|
111
|
-
|
|
147
|
+
const findList = [];
|
|
112
148
|
for (let i = 0; i < cityData.length; i++) {
|
|
113
149
|
if (cityData[i].indexOf(val) > -1) {
|
|
114
150
|
const arrTemp = cityData[i].split("|");
|
|
@@ -116,26 +152,60 @@ const chkeCity = (province, val) => {
|
|
|
116
152
|
if (arr && arr.length > 0) {
|
|
117
153
|
if (province != "") {
|
|
118
154
|
if (cityData[i].split("|")[0] == province) {
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
155
|
+
findList.push(
|
|
156
|
+
{
|
|
157
|
+
p: cityData[i].split("|")[0],
|
|
158
|
+
c: cityData[i].split("|")[1]
|
|
159
|
+
}
|
|
160
|
+
);
|
|
122
161
|
}
|
|
123
162
|
} else {
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
163
|
+
findList.push(
|
|
164
|
+
{
|
|
165
|
+
p: cityData[i].split("|")[0],
|
|
166
|
+
c: cityData[i].split("|")[1]
|
|
167
|
+
}
|
|
168
|
+
);
|
|
127
169
|
}
|
|
128
|
-
break;
|
|
129
170
|
}
|
|
130
171
|
}
|
|
131
172
|
}
|
|
132
|
-
|
|
173
|
+
const _p = findList.length > 0 ? findList[0].p : "";
|
|
174
|
+
const _c = findList.length > 0 ? findList[0].c : "";
|
|
175
|
+
return { p: _p, c: _c, list: findList };
|
|
133
176
|
};
|
|
134
|
-
const
|
|
177
|
+
const getCounty = (val, city, province) => {
|
|
178
|
+
if (val == null || val == void 0 || val == "" || val.length < 2) {
|
|
179
|
+
return { p: "", c: "", x: "", jval: "" };
|
|
180
|
+
}
|
|
181
|
+
const jval = val.substr(0, 2);
|
|
182
|
+
const objectOne = splitCounty(jval, city, province);
|
|
183
|
+
if (objectOne.list.length == 1) {
|
|
184
|
+
return { p: objectOne.p, c: objectOne.c, x: objectOne.x, jval };
|
|
185
|
+
} else if (objectOne.list.length > 1) {
|
|
186
|
+
const jval3 = val.substr(0, 3);
|
|
187
|
+
const objectThreed = splitCounty(jval3, city, province);
|
|
188
|
+
if (objectThreed.list.length == 1) {
|
|
189
|
+
return { p: objectThreed.p, c: objectThreed.c, x: objectThreed.x, jval: jval3 };
|
|
190
|
+
} else if (objectThreed.list.length == 0) {
|
|
191
|
+
return { p: objectOne.p, c: objectOne.c, x: objectOne.x, jval: val };
|
|
192
|
+
} else if (objectThreed.list.length > 0) {
|
|
193
|
+
const jval4 = val.substr(0, 4);
|
|
194
|
+
const objectFoure = splitCounty(jval3, city, province);
|
|
195
|
+
if (objectFoure.list.length > 0) {
|
|
196
|
+
return { p: objectFoure.p, c: objectFoure.c, x: objectFoure.x, jval: jval4 };
|
|
197
|
+
} else if (objectFoure.list.length == 0) {
|
|
198
|
+
return { p: objectThreed.p, c: objectThreed.c, x: objectThreed.x, jval: jval3 };
|
|
199
|
+
}
|
|
200
|
+
}
|
|
201
|
+
}
|
|
202
|
+
return { p: "", c: "", x: "", jval: "" };
|
|
203
|
+
};
|
|
204
|
+
const splitCounty = (val, city, province) => {
|
|
135
205
|
if (val == null || val == void 0 || val == "") {
|
|
136
|
-
return { p: "", c: "", x: "" };
|
|
206
|
+
return { p: "", c: "", x: "", list: [] };
|
|
137
207
|
}
|
|
138
|
-
|
|
208
|
+
const findList = [];
|
|
139
209
|
for (let i = 0; i < countyData.length; i++) {
|
|
140
210
|
if (countyData[i].indexOf(val) > -1) {
|
|
141
211
|
const arrTemp = countyData[i].split("|");
|
|
@@ -143,21 +213,26 @@ const chkeCounty = (province, city, val) => {
|
|
|
143
213
|
if (arr && arr.length > 0) {
|
|
144
214
|
if (province != "" && city != "") {
|
|
145
215
|
if (countyData[i].split("|")[0] == province && countyData[i].split("|")[1] == city) {
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
216
|
+
findList.push({
|
|
217
|
+
p: countyData[i].split("|")[0],
|
|
218
|
+
c: countyData[i].split("|")[1],
|
|
219
|
+
x: countyData[i].split("|")[2]
|
|
220
|
+
});
|
|
150
221
|
}
|
|
151
222
|
} else {
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
223
|
+
findList.push({
|
|
224
|
+
p: countyData[i].split("|")[0],
|
|
225
|
+
c: countyData[i].split("|")[1],
|
|
226
|
+
x: countyData[i].split("|")[2]
|
|
227
|
+
});
|
|
156
228
|
}
|
|
157
229
|
}
|
|
158
230
|
}
|
|
159
231
|
}
|
|
160
|
-
|
|
232
|
+
const _p = findList.length > 0 ? findList[0].p : "";
|
|
233
|
+
const _c = findList.length > 0 ? findList[0].c : "";
|
|
234
|
+
const _x = findList.length > 0 ? findList[0].x : "";
|
|
235
|
+
return { p: _p, c: _c, x: _x, list: findList };
|
|
161
236
|
};
|
|
162
237
|
const provinceData = [
|
|
163
238
|
"\u5317\u4EAC\u5E02|\u5317\u4EAC",
|