@fmdevui/fm-dev 1.0.86 → 1.0.88

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.
@@ -9,4 +9,5 @@ export * from './utils';
9
9
  export * from './auth';
10
10
  export * from './hook/dateTimeShortCust';
11
11
  export * from './hook/useVxeTableOptionsHook';
12
+ export * from './utils/cityparess';
12
13
  export * from './types';
@@ -0,0 +1,6 @@
1
+ declare const addressparsing: (val: any) => Promise<{
2
+ province: string;
3
+ city: any;
4
+ county: any;
5
+ }>;
6
+ export { addressparsing };
package/es/index.mjs CHANGED
@@ -38,6 +38,7 @@ export { PUB } from './packages/core/utils/const/index.mjs';
38
38
  export { auth, authAll, auths, hAuth, hAuthAll, hAuths } from './packages/core/auth/index.mjs';
39
39
  export { useDateTimeShortCust } from './packages/core/hook/dateTimeShortCust.mjs';
40
40
  export { useVxeTable } from './packages/core/hook/useVxeTableOptionsHook.mjs';
41
+ export { addressparsing } from './packages/core/utils/cityparess/index.mjs';
41
42
 
42
43
  const install = installer.install;
43
44
 
@@ -9,6 +9,7 @@ import './utils/index.mjs';
9
9
  export { auth, authAll, auths, hAuth, hAuthAll, hAuths } from './auth/index.mjs';
10
10
  export { useDateTimeShortCust } from './hook/dateTimeShortCust.mjs';
11
11
  export { useVxeTable } from './hook/useVxeTableOptionsHook.mjs';
12
+ export { addressparsing } from './utils/cityparess/index.mjs';
12
13
  import './types/index.mjs';
13
14
  export { elSvg } from './ui/components/svgIcon/index.mjs';
14
15
  export { useApi, useBaseApi } from './api/base/index.mjs';
@@ -57,9 +57,9 @@ var _sfc_main = /* @__PURE__ */ defineComponent({
57
57
  if (newValue.length < 2) {
58
58
  return;
59
59
  }
60
- let cityobj = chkeCity(newValue.substr(0, 2));
60
+ let cityobj = chkeCity(province, newValue.substr(0, 2));
61
61
  if (cityobj.c == "" && newValue.length > 2) {
62
- cityobj = chkeCity(newValue.substr(0, 3));
62
+ cityobj = chkeCity(province, newValue.substr(0, 3));
63
63
  if (cityobj.c != "" && province == "") {
64
64
  province = cityobj.p;
65
65
  }
@@ -68,29 +68,29 @@ var _sfc_main = /* @__PURE__ */ defineComponent({
68
68
  if (newValue.length < 2) {
69
69
  return;
70
70
  }
71
- let countyOjb = chkeCounty(newValue.substr(0, 2));
71
+ let countyOjb = chkeCounty(province, cityobj.c, newValue.substr(0, 2));
72
72
  if (countyOjb.x == "" && newValue.length > 2) {
73
- countyOjb = chkeCounty(newValue.substr(0, 3));
73
+ countyOjb = chkeCounty(province, cityobj.c, newValue.substr(0, 3));
74
74
  if (countyOjb.x == "" && newValue.length > 3) {
75
- countyOjb = chkeCounty(newValue.substr(0, 4));
75
+ countyOjb = chkeCounty(province, cityobj.c, newValue.substr(0, 4));
76
76
  if (countyOjb.x == "" && newValue.length > 4) {
77
- countyOjb = chkeCounty(newValue.substr(0, 5));
77
+ countyOjb = chkeCounty(province, cityobj.c, newValue.substr(0, 5));
78
78
  if (countyOjb.x == "" && newValue.length > 5) {
79
- countyOjb = chkeCounty(newValue.substr(0, 6));
79
+ countyOjb = chkeCounty(province, cityobj.c, newValue.substr(0, 6));
80
80
  if (countyOjb.x == "" && newValue.length > 6) {
81
- countyOjb = chkeCounty(newValue.substr(0, 7));
81
+ countyOjb = chkeCounty(province, cityobj.c, newValue.substr(0, 7));
82
82
  if (countyOjb.x == "" && newValue.length > 7) {
83
- countyOjb = chkeCounty(newValue.substr(0, 8));
83
+ countyOjb = chkeCounty(province, cityobj.c, newValue.substr(0, 8));
84
84
  if (countyOjb.x == "" && newValue.length > 8) {
85
- countyOjb = chkeCounty(newValue.substr(0, 9));
85
+ countyOjb = chkeCounty(province, cityobj.c, newValue.substr(0, 9));
86
86
  if (countyOjb.x == "" && newValue.length > 9) {
87
- countyOjb = chkeCounty(newValue.substr(0, 10));
87
+ countyOjb = chkeCounty(province, cityobj.c, newValue.substr(0, 10));
88
88
  if (countyOjb.x == "" && newValue.length > 10) {
89
- countyOjb = chkeCounty(newValue.substr(0, 11));
89
+ countyOjb = chkeCounty(province, cityobj.c, newValue.substr(0, 11));
90
90
  if (countyOjb.x == "" && newValue.length > 11) {
91
- countyOjb = chkeCounty(newValue.substr(0, 12));
91
+ countyOjb = chkeCounty(province, cityobj.c, newValue.substr(0, 12));
92
92
  if (countyOjb.x == "" && newValue.length > 12) {
93
- countyOjb = chkeCounty(newValue.substr(0, 13));
93
+ countyOjb = chkeCounty(province, cityobj.c, newValue.substr(0, 13));
94
94
  }
95
95
  }
96
96
  }
@@ -180,7 +180,7 @@ var _sfc_main = /* @__PURE__ */ defineComponent({
180
180
  }
181
181
  return province;
182
182
  };
183
- const chkeCity = (val) => {
183
+ const chkeCity = (province, val) => {
184
184
  if (val == null || val == void 0 || val == "") {
185
185
  return { p: "", c: "" };
186
186
  }
@@ -190,15 +190,24 @@ var _sfc_main = /* @__PURE__ */ defineComponent({
190
190
  const arrTemp = cityData[i].split("|");
191
191
  const arr = arrTemp.filter((item) => item == val);
192
192
  if (arr && arr.length > 0) {
193
- cityobj.p = cityData[i].split("|")[0];
194
- cityobj.c = cityData[i].split("|")[1];
193
+ if (province != "") {
194
+ if (cityData[i].split("|")[0] == province) {
195
+ cityobj.p = cityData[i].split("|")[0];
196
+ cityobj.c = cityData[i].split("|")[1];
197
+ break;
198
+ }
199
+ } else {
200
+ cityobj.p = cityData[i].split("|")[0];
201
+ cityobj.c = cityData[i].split("|")[1];
202
+ break;
203
+ }
195
204
  break;
196
205
  }
197
206
  }
198
207
  }
199
208
  return cityobj;
200
209
  };
201
- const chkeCounty = (val) => {
210
+ const chkeCounty = (province, city, val) => {
202
211
  if (val == null || val == void 0 || val == "") {
203
212
  return { p: "", c: "", x: "" };
204
213
  }
@@ -208,10 +217,19 @@ var _sfc_main = /* @__PURE__ */ defineComponent({
208
217
  const arrTemp = countyData[i].split("|");
209
218
  const arr = arrTemp.filter((item) => item == val);
210
219
  if (arr && arr.length > 0) {
211
- countyobj.p = countyData[i].split("|")[0];
212
- countyobj.c = countyData[i].split("|")[1];
213
- countyobj.x = countyData[i].split("|")[2];
214
- break;
220
+ if (province != "" && city != "") {
221
+ if (countyData[i].split("|")[0] == province && countyData[i].split("|")[1] == city) {
222
+ countyobj.p = countyData[i].split("|")[0];
223
+ countyobj.c = countyData[i].split("|")[1];
224
+ countyobj.x = countyData[i].split("|")[2];
225
+ break;
226
+ }
227
+ } else {
228
+ countyobj.p = countyData[i].split("|")[0];
229
+ countyobj.c = countyData[i].split("|")[1];
230
+ countyobj.x = countyData[i].split("|")[2];
231
+ break;
232
+ }
215
233
  }
216
234
  }
217
235
  }