n20-common-lib 2.8.10 → 2.8.12

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "n20-common-lib",
3
- "version": "2.8.10",
3
+ "version": "2.8.12",
4
4
  "private": false,
5
5
  "scripts": {
6
6
  "serve": "vue-cli-service serve",
@@ -13,8 +13,6 @@
13
13
 
14
14
  <script>
15
15
  import axios from '../../utils/axios'
16
- import list2tree from '../../utils/list2tree'
17
-
18
16
  window._china_area_tree_ = undefined
19
17
 
20
18
  export default {
@@ -32,10 +30,15 @@ export default {
32
30
  type: Boolean,
33
31
  default: true
34
32
  },
33
+
35
34
  isUrban: {
36
35
  type: Boolean,
37
36
  default: false
38
37
  },
38
+ isStreet: {
39
+ type: Boolean,
40
+ default: false
41
+ },
39
42
  labelSort: {
40
43
  type: Boolean,
41
44
  default: false
@@ -60,7 +63,8 @@ export default {
60
63
  value: 'regionNo',
61
64
  label: 'regionName',
62
65
  children: 'children',
63
- expandTrigger: 'hover'
66
+ expandTrigger: 'hover',
67
+ checkStrictly: this.isUrban ? false : true
64
68
  }
65
69
  return Object.assign(_prop, this.props)
66
70
  },
@@ -69,46 +73,40 @@ export default {
69
73
  },
70
74
  urbanKey() {
71
75
  return this.countryId === 'CHN' ? '_china_urban_tree_' : `_${this.countryId}_urban_tree_`
76
+ },
77
+ streetKey() {
78
+ return this.countryId === 'CHN' ? '_china_street_tree_' : `_${this.countryId}_street_tree_`
72
79
  }
73
80
  },
74
81
  mounted() {
75
82
  if (!window[this.areaKey]) {
76
83
  this.getAreaTree()
77
84
  } else {
78
- this.areaTree = this.isUrban ? window[this.urbanKey] : window[this.areaKey]
85
+ this.areaTree = this.isUrban
86
+ ? window[this.urbanKey]
87
+ : this.isStreet
88
+ ? window[this.streetKey]
89
+ : window[this.areaKey]
79
90
  }
80
91
  },
81
92
  methods: {
82
93
  getAreaTree() {
83
94
  axios
84
- .get('/bems/1.0/area', { countryId: this.countryId, isEnable: '1' }, { loading: false, noMsg: true })
95
+ .get(
96
+ `/bems/1.0/area?t=${Math.random()}`,
97
+ { countryId: this.countryId, isEnable: '1', resultType: 2, queryLeave4: this.isStreet },
98
+ { loading: false, noMsg: true }
99
+ )
85
100
  .then(({ data }) => {
86
- let dataAr = JSON.parse(JSON.stringify(data))
87
- let dataUb = JSON.parse(JSON.stringify(data))
88
-
89
- let areaTree = list2tree(
90
- dataAr,
91
- 'regionNo',
92
- 'fatherNo',
93
- 'children',
94
- this.labelSort ? 'regionName' : 'regionNo'
95
- )
96
- let noAreaTree = areaTree.filter((a) => a.regionLevel !== '1')
97
- if (noAreaTree.length > 0) {
98
- console.warn('这些区域找不到父级节点:', noAreaTree)
99
- }
100
- window[this.areaKey] = areaTree.filter((a) => a.regionLevel === '1')
101
+ window[this.urbanKey] = isUrbanFn(JSON.parse(JSON.stringify(data)))
102
+ window[this.streetKey] = treeFn(JSON.parse(JSON.stringify(data)))
103
+ window[this.areaKey] = treeFn(JSON.parse(JSON.stringify(data)))
101
104
 
102
- let urbanTree = list2tree(
103
- dataUb.filter((d) => d.regionLevel !== '3'),
104
- 'regionNo',
105
- 'fatherNo',
106
- 'children',
107
- this.labelSort ? 'regionName' : 'regionNo'
108
- )
109
-
110
- window[this.urbanKey] = urbanTree.filter((a) => a.regionLevel === '1')
111
- this.areaTree = this.isUrban ? window[this.urbanKey] : window[this.areaKey]
105
+ this.areaTree = this.isUrban
106
+ ? window[this.urbanKey]
107
+ : this.isStreet
108
+ ? window[this.streetKey]
109
+ : window[this.areaKey]
112
110
  })
113
111
  },
114
112
  updateArea() {
@@ -116,4 +114,30 @@ export default {
116
114
  }
117
115
  }
118
116
  }
117
+
118
+ const treeFn = (data) => {
119
+ return data?.map((res) => {
120
+ if (!['3', '4', '5'].includes(res.regionLevel)) {
121
+ res.disabled = true
122
+ }
123
+
124
+ if (!res.children?.length) {
125
+ res.children = null
126
+ } else {
127
+ res.children = treeFn(res.children)
128
+ }
129
+ return res
130
+ })
131
+ }
132
+
133
+ const isUrbanFn = (data) => {
134
+ return data?.map((res) => {
135
+ if (res.regionLevel === '2') {
136
+ res.children = null
137
+ } else {
138
+ res.children = isUrbanFn(res.children)
139
+ }
140
+ return res
141
+ })
142
+ }
119
143
  </script>
@@ -1563,7 +1563,11 @@ try {
1563
1563
  Notification({
1564
1564
  title: '提示',
1565
1565
  dangerouslyUseHTMLString: true,
1566
- message: `<div>检测到您的电脑中没有安装签名助手,为了不影响使用请使用管理员权限<a class="color-primary" href="/portal/天诚安信数字证书助手-3.7.7.0.exe" download>下载安装</a>天诚安信数字证书助手</div>`,
1566
+ message: `<div>检测到您的电脑中没有安装签名助手,为了不影响使用请使用管理员权限<a class="color-primary" href="/portal/${
1567
+ process.env.VUE_APP_NetSign_ARG_SignName ||
1568
+ window.VUE_APP_NetSign_ARG_SignName ||
1569
+ '天诚安信数字证书助手-3.7.7.0.exe'
1570
+ }" download>下载安装</a>天诚安信数字证书助手</div>`,
1567
1571
  duration: 5000
1568
1572
  })
1569
1573
  }
@@ -10,6 +10,7 @@ export async function getSign(p1, p2, p3) {
10
10
  console.error('请设置签名服务公司sessionStorage.signType,公司字段映射:', CaMap)
11
11
  signType = CaMap['null'] ? CaMap['null'].type : ''
12
12
  }
13
+ let url = window.NetSignName
13
14
 
14
15
  const por = new Promise((resolve, reject) => {
15
16
  if (signType === 'inetSign' /* 信安CA */) {
@@ -22,7 +23,7 @@ export async function getSign(p1, p2, p3) {
22
23
  } else {
23
24
  reject()
24
25
  }
25
- })
26
+ }, url)
26
27
  }
27
28
  )
28
29
  } else if (signType === 'bjcaSign' /* 北京CA */) {
@@ -67,7 +68,7 @@ export async function getSign(p1, p2, p3) {
67
68
  } else {
68
69
  reject()
69
70
  }
70
- })
71
+ }, url)
71
72
  }
72
73
  )
73
74
  } else if (signType === 'netcaSign' /* 网证通 */) {
@@ -90,7 +91,7 @@ export async function getSign(p1, p2, p3) {
90
91
  } else {
91
92
  reject()
92
93
  }
93
- })
94
+ }, url)
94
95
  }
95
96
  )
96
97
  } else if (signType === 'cfcaSign' /* CFCA */) {