wui-components-v2 1.1.44 → 1.1.46

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.
@@ -11,7 +11,7 @@
11
11
  <script setup lang="ts">
12
12
  import { ref } from 'vue'
13
13
  import { useGlobalToast } from '../../composables/useGlobalToast'
14
- import { parse as AddressParse } from 'address-parse'
14
+ import parse from 'china-address-parse'
15
15
  const toast = useGlobalToast()
16
16
  defineOptions({
17
17
  name: 'AddAddressPage',
@@ -31,8 +31,9 @@ function identifyingFn(){
31
31
  toast.info('请输入内容')
32
32
  return
33
33
  }
34
- const currentValue = AddressParse.parse(personDetail.value)
35
- if (!currentValue || !currentValue[0]) {
34
+ const currentValue:any = parse(personDetail.value)
35
+ console.log('智能识别', currentValue)
36
+ if (!currentValue) {
36
37
  toast.info('无法识别地址')
37
38
  return
38
39
  }
@@ -42,22 +43,22 @@ function identifyingFn(){
42
43
  props.group?.fields?.forEach((item: any, index: number) => {
43
44
  switch (index) {
44
45
  case 0:
45
- model.value[item.sourceId] = currentValue[0].name || ''
46
+ model.value[item.sourceId] = currentValue.name || ''
46
47
  break;
47
48
  case 1:
48
- model.value[item.sourceId] = currentValue[0].mobile || currentValue[0].phone || ''
49
+ model.value[item.sourceId] = currentValue.telNumber || currentValue.phone || ''
49
50
  break;
50
51
  case 2:
51
- model.value[item.sourceId] = currentValue[0].province || ''
52
+ model.value[item.sourceId] = currentValue.provinceName || ''
52
53
  break;
53
54
  case 3:
54
- model.value[item.sourceId] = currentValue[0].city || ''
55
+ model.value[item.sourceId] = currentValue.cityName || ''
55
56
  break;
56
57
  case 4:
57
- model.value[item.sourceId] = currentValue[0].area || ''
58
+ model.value[item.sourceId] = currentValue.countyName || ''
58
59
  break;
59
60
  case 5:
60
- model.value[item.sourceId] = currentValue[0].details || ''
61
+ model.value[item.sourceId] = currentValue.address || ''
61
62
  break;
62
63
  default:
63
64
  break;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "wui-components-v2",
3
- "version": "1.1.44",
3
+ "version": "1.1.46",
4
4
  "description": "wui 组件库",
5
5
  "author": "wgxshh",
6
6
  "license": "MIT",
@@ -13,7 +13,8 @@
13
13
  "test": "echo \"Error: no test specified\" && exit 1"
14
14
  },
15
15
  "dependencies": {
16
- "address-parse": "^1.2.19",
16
+ "@wot-ui/ui": "^2.0.8",
17
+ "china-address-parse": "^1.2.1",
17
18
  "dayjs": "^1.11.20",
18
19
  "jsencrypt": "^3.3.2",
19
20
  "z-paging": "^2.8.5"