vue2-client 1.5.22 → 1.5.23
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/CHANGELOG.md +1 -1
- package/package.json +1 -1
- package/src/base-client/plugins/AppData.js +76 -75
package/CHANGELOG.md
CHANGED
package/package.json
CHANGED
|
@@ -1,75 +1,76 @@
|
|
|
1
|
-
import { manageApi, post } from '@vue2-client/services/api'
|
|
2
|
-
import { handleTree } from '@vue2-client/utils/util'
|
|
3
|
-
|
|
4
|
-
const GetAppDataService = {
|
|
5
|
-
install (Vue) {
|
|
6
|
-
// 给vue增添对话框显示方法
|
|
7
|
-
Vue.$appdata = Vue.prototype.$appdata = GetAppDataService
|
|
8
|
-
},
|
|
9
|
-
async load () {
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
localStorage.setItem(process.env.
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
const
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
const
|
|
59
|
-
const
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
}
|
|
75
|
-
|
|
1
|
+
import { manageApi, post } from '@vue2-client/services/api'
|
|
2
|
+
import { handleTree } from '@vue2-client/utils/util'
|
|
3
|
+
|
|
4
|
+
const GetAppDataService = {
|
|
5
|
+
install (Vue) {
|
|
6
|
+
// 给vue增添对话框显示方法
|
|
7
|
+
Vue.$appdata = Vue.prototype.$appdata = GetAppDataService
|
|
8
|
+
},
|
|
9
|
+
async load () {
|
|
10
|
+
localStorage.removeItem(undefined)
|
|
11
|
+
const params = {}
|
|
12
|
+
await post(manageApi.getDictionaryValue, {}).then((res) => {
|
|
13
|
+
Object.assign(params, res)
|
|
14
|
+
const badgeItemArray = {}
|
|
15
|
+
for (const key of Object.keys(params)) {
|
|
16
|
+
badgeItemArray[key] = {}
|
|
17
|
+
for (const item of params[key]) {
|
|
18
|
+
let status
|
|
19
|
+
if (!item.status) {
|
|
20
|
+
status = 'none'
|
|
21
|
+
} else {
|
|
22
|
+
status = item.status
|
|
23
|
+
}
|
|
24
|
+
badgeItemArray[key][item.value] = {
|
|
25
|
+
status: status,
|
|
26
|
+
text: item.text
|
|
27
|
+
}
|
|
28
|
+
}
|
|
29
|
+
}
|
|
30
|
+
// 追加参数
|
|
31
|
+
localStorage.setItem(process.env.VUE_APP_DICTIONARY_KEY, JSON.stringify(params))
|
|
32
|
+
localStorage.setItem(process.env.VUE_APP_BADGE_KEY, JSON.stringify(badgeItemArray))
|
|
33
|
+
})
|
|
34
|
+
},
|
|
35
|
+
// 返回树形省市区
|
|
36
|
+
async getDivisionsOhChinaForTree () {
|
|
37
|
+
let list = this.getDivisionsOhChinaForList()
|
|
38
|
+
// 获取省市区数据
|
|
39
|
+
if (!list) {
|
|
40
|
+
await post(manageApi.getDivisionsOhChina, {}).then((res) => {
|
|
41
|
+
list = res
|
|
42
|
+
localStorage.setItem(process.env.VUE_APP_DIVISIONSOHCHINA, JSON.stringify(res))
|
|
43
|
+
})
|
|
44
|
+
}
|
|
45
|
+
return handleTree(list, 'code', 'parentcode')
|
|
46
|
+
},
|
|
47
|
+
// 返回列表省市区
|
|
48
|
+
getDivisionsOhChinaForList () {
|
|
49
|
+
const str = localStorage.getItem(process.env.VUE_APP_DIVISIONSOHCHINA)
|
|
50
|
+
return JSON.parse(str)
|
|
51
|
+
},
|
|
52
|
+
getDictionaryList (key) {
|
|
53
|
+
const str = localStorage.getItem(process.env.VUE_APP_DICTIONARY_KEY)
|
|
54
|
+
const object = JSON.parse(str)
|
|
55
|
+
return object[key]
|
|
56
|
+
},
|
|
57
|
+
getParam (key, value) {
|
|
58
|
+
const str = localStorage.getItem(process.env.VUE_APP_BADGE_KEY)
|
|
59
|
+
const object = JSON.parse(str)
|
|
60
|
+
const result = object[key]
|
|
61
|
+
if (result && result.hasOwnProperty(value)) {
|
|
62
|
+
return result[value]
|
|
63
|
+
} else {
|
|
64
|
+
return null
|
|
65
|
+
}
|
|
66
|
+
},
|
|
67
|
+
getParams () {
|
|
68
|
+
const str = localStorage.getItem(process.env.VUE_APP_DICTIONARY_KEY)
|
|
69
|
+
return JSON.parse(str)
|
|
70
|
+
},
|
|
71
|
+
getSingleValues () {
|
|
72
|
+
const str = localStorage.getItem(process.env.VUE_APP_BADGE_KEY)
|
|
73
|
+
return JSON.parse(str)
|
|
74
|
+
}
|
|
75
|
+
}
|
|
76
|
+
export default GetAppDataService
|