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 CHANGED
@@ -1,7 +1,7 @@
1
1
  # Change Log
2
2
  > 所有关于本项目的变化都在该文档里。
3
3
 
4
- **1.5.22 -2022-12-15 @江超**
4
+ **1.5.22 - 1.5.23 -2022-12-15 @江超**
5
5
  - 新增个人设置页面
6
6
 
7
7
  **1.5.14 - 1.5.21 -2022-12-13 @苗艳强**
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "vue2-client",
3
- "version": "1.5.22",
3
+ "version": "1.5.23",
4
4
  "private": false,
5
5
  "scripts": {
6
6
  "serve": "vue-cli-service serve",
@@ -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
- const params = {}
11
- await post(manageApi.getDictionaryValue, {}).then((res) => {
12
- Object.assign(params, res)
13
- const badgeItemArray = {}
14
- for (const key of Object.keys(params)) {
15
- badgeItemArray[key] = {}
16
- for (const item of params[key]) {
17
- let status
18
- if (!item.status) {
19
- status = 'none'
20
- } else {
21
- status = item.status
22
- }
23
- badgeItemArray[key][item.value] = {
24
- status: status,
25
- text: item.text
26
- }
27
- }
28
- }
29
- // 追加参数
30
- localStorage.setItem(process.env.VUE_APP_DICTIONARY_KEY, JSON.stringify(params))
31
- localStorage.setItem(process.env.VUE_APP_BADGE_KEY, JSON.stringify(badgeItemArray))
32
- })
33
- },
34
- // 返回树形省市区
35
- async getDivisionsOhChinaForTree () {
36
- let list = this.getDivisionsOhChinaForList()
37
- // 获取省市区数据
38
- if (!list) {
39
- await post(manageApi.getDivisionsOhChina, {}).then((res) => {
40
- list = res
41
- localStorage.setItem(process.env.VUE_APP_DIVISIONSOHCHINA, JSON.stringify(res))
42
- })
43
- }
44
- return handleTree(list, 'code', 'parentcode')
45
- },
46
- // 返回列表省市区
47
- getDivisionsOhChinaForList () {
48
- const str = localStorage.getItem(process.env.VUE_APP_DIVISIONSOHCHINA)
49
- return JSON.parse(str)
50
- },
51
- getDictionaryList (key) {
52
- const str = localStorage.getItem(process.env.VUE_APP_DICTIONARY_KEY)
53
- const object = JSON.parse(str)
54
- return object[key]
55
- },
56
- getParam (key, value) {
57
- const str = localStorage.getItem(process.env.VUE_APP_BADGE_KEY)
58
- const object = JSON.parse(str)
59
- const result = object[key]
60
- if (result && result.hasOwnProperty(value)) {
61
- return result[value]
62
- } else {
63
- return null
64
- }
65
- },
66
- getParams () {
67
- const str = localStorage.getItem(process.env.VUE_APP_DICTIONARY_KEY)
68
- return JSON.parse(str)
69
- },
70
- getSingleValues () {
71
- const str = localStorage.getItem(process.env.VUE_APP_BADGE_KEY)
72
- return JSON.parse(str)
73
- }
74
- }
75
- export default GetAppDataService
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