vue2-client 1.3.11 → 1.3.14

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.
Files changed (96) hide show
  1. package/CHANGELOG.md +311 -308
  2. package/index.js +30 -30
  3. package/package.json +76 -76
  4. package/src/base-client/components/common/AddressSearchCombobox/AddressSearchCombobox.vue +225 -225
  5. package/src/base-client/components/common/CreateQuery/CreateQuery.vue +551 -551
  6. package/src/base-client/components/common/CreateQuery/CreateQueryItem.vue +777 -777
  7. package/src/base-client/components/common/CreateSimpleFormQuery/CreateSimpleFormQueryItem.vue +553 -553
  8. package/src/base-client/components/common/CustomColumnsDrawer/index.md +46 -46
  9. package/src/base-client/components/common/FormGroupQuery/FormGroupQuery.vue +165 -165
  10. package/src/base-client/components/common/JSONToTree/jsontotree.vue +275 -275
  11. package/src/base-client/components/common/Upload/Upload.vue +161 -161
  12. package/src/base-client/components/common/XAddForm/XAddForm.vue +353 -353
  13. package/src/base-client/components/common/XAddNativeForm/XAddNativeForm.vue +326 -326
  14. package/src/base-client/components/common/XCard/XCard.vue +64 -64
  15. package/src/base-client/components/common/XForm/XForm.vue +273 -273
  16. package/src/base-client/components/common/XForm/XFormItem.vue +389 -389
  17. package/src/base-client/components/common/XFormTable/XFormTable.vue +505 -505
  18. package/src/base-client/components/common/XFormTable/index.md +96 -96
  19. package/src/base-client/components/common/XTable/XTable.vue +278 -278
  20. package/src/base-client/components/system/LogDetailsView/LogDetailsView.vue +376 -376
  21. package/src/base-client/components/system/QueryParamsDetailsView/QueryParamsDetailsView.vue +281 -281
  22. package/src/base-client/components/ticket/TicketDetailsView/TicketDetailsView.vue +807 -807
  23. package/src/base-client/components/ticket/TicketDetailsView/index.md +29 -29
  24. package/src/base-client/components/ticket/TicketDetailsView/part/TicketDetailsFlow.vue +260 -260
  25. package/src/base-client/components/ticket/TicketSubmitSuccessView/TicketSubmitSuccessView.vue +532 -532
  26. package/src/base-client/components/ticket/TicketSubmitSuccessView/index.md +29 -29
  27. package/src/base-client/plugins/AppData.js +69 -69
  28. package/src/base-client/plugins/GetLoginInfoService.js +179 -252
  29. package/src/base-client/plugins/PagedList.js +177 -177
  30. package/src/base-client/plugins/compatible/LoginServiceOA.js +20 -20
  31. package/src/base-client/plugins/i18n-extend.js +32 -32
  32. package/src/components/Ellipsis/index.md +38 -38
  33. package/src/components/NumberInfo/index.md +43 -43
  34. package/src/components/STable/README.md +341 -341
  35. package/src/components/STable/index.js +318 -318
  36. package/src/components/Trend/index.md +45 -45
  37. package/src/components/checkbox/ColorCheckbox.vue +157 -157
  38. package/src/components/checkbox/ImgCheckbox.vue +163 -163
  39. package/src/components/exception/ExceptionPage.vue +70 -70
  40. package/src/components/form/FormRow.vue +52 -52
  41. package/src/components/index.js +36 -36
  42. package/src/components/menu/SideMenu.vue +62 -62
  43. package/src/components/menu/menu.js +273 -273
  44. package/src/components/setting/Setting.vue +235 -235
  45. package/src/components/table/StandardTable.vue +141 -141
  46. package/src/components/table/advance/ActionColumns.vue +158 -158
  47. package/src/components/table/advance/SearchArea.vue +355 -355
  48. package/src/components/tool/AStepItem.vue +60 -60
  49. package/src/components/tool/AvatarList.vue +68 -68
  50. package/src/components/tool/Drawer.vue +142 -142
  51. package/src/components/tool/TagSelect.vue +83 -83
  52. package/src/components/transition/PageToggleTransition.vue +97 -97
  53. package/src/config/replacer/resolve.config.js +67 -67
  54. package/src/layouts/AdminLayout.vue +174 -174
  55. package/src/layouts/header/AdminHeader.vue +104 -104
  56. package/src/layouts/header/HeaderNotice.vue +167 -167
  57. package/src/layouts/header/HeaderSearch.vue +67 -67
  58. package/src/layouts/header/InstitutionDetail.vue +181 -181
  59. package/src/layouts/tabs/TabsHead.vue +190 -190
  60. package/src/layouts/tabs/TabsView.vue +379 -379
  61. package/src/mock/goods/index.js +108 -108
  62. package/src/pages/CreateQueryPage.vue +65 -65
  63. package/src/pages/login/Login.vue +277 -277
  64. package/src/pages/report/ReportTable.js +124 -124
  65. package/src/pages/report/ReportTableHome.vue +28 -28
  66. package/src/pages/resourceManage/orgListManage.vue +98 -98
  67. package/src/pages/system/dictionary/index.vue +43 -43
  68. package/src/pages/system/file/index.vue +317 -317
  69. package/src/pages/system/queryParams/index.vue +43 -43
  70. package/src/pages/system/ticket/index.vue +461 -461
  71. package/src/pages/system/ticket/submitTicketSuccess.vue +206 -206
  72. package/src/router/async/config.async.js +27 -27
  73. package/src/router/async/router.map.js +56 -56
  74. package/src/router/index.js +27 -27
  75. package/src/services/api/DictionaryDetailsViewApi.js +6 -6
  76. package/src/services/api/LogDetailsViewApi.js +10 -10
  77. package/src/services/api/QueryParamsDetailsViewApi.js +6 -6
  78. package/src/services/api/TicketDetailsViewApi.js +34 -34
  79. package/src/services/api/common.js +58 -58
  80. package/src/services/api/commonTempTable.js +10 -10
  81. package/src/services/api/index.js +17 -17
  82. package/src/services/api/manage.js +8 -8
  83. package/src/store/mutation-types.js +2 -2
  84. package/src/theme/default/nprogress.less +76 -76
  85. package/src/theme/default/style.less +47 -47
  86. package/src/utils/colors.js +103 -103
  87. package/src/utils/excel/Blob.js +180 -180
  88. package/src/utils/excel/Export2Excel.js +141 -141
  89. package/src/utils/formatter.js +68 -68
  90. package/src/utils/i18n.js +80 -80
  91. package/src/utils/request.js +225 -225
  92. package/src/utils/routerUtil.js +358 -358
  93. package/src/utils/theme-color-replacer-extend.js +91 -91
  94. package/src/utils/themeUtil.js +100 -100
  95. package/src/utils/util.js +230 -230
  96. package/vue.config.js +99 -99
@@ -1,29 +1,29 @@
1
- # TicketDetailsView 工单详情页
2
-
3
- 提供一个可以对单个工单进行一系列通用业务操作的抽屉实现
4
-
5
-
6
-
7
- ## 何时使用
8
-
9
- 允许用户对单个工单进行一系列通用业务操作
10
-
11
-
12
-
13
- ## 代码演示
14
-
15
- ```html
16
- <ticket-details-view
17
- :visible.sync="detailVisible"
18
- :ticketId="ticketId"
19
- v-if="ticketId"
20
- />
21
- ```
22
-
23
- ## API
24
-
25
- | 参数 | 说明 | 类型 | 默认值 |
26
- |---------------|-------|---------|-------|
27
- | detailVisible | 是否显示 | Boolean | false |
28
- | ticketId | 工单编号 | String | null |
29
- | id | 负责人id | String | null |
1
+ # TicketDetailsView 工单详情页
2
+
3
+ 提供一个可以对单个工单进行一系列通用业务操作的抽屉实现
4
+
5
+
6
+
7
+ ## 何时使用
8
+
9
+ 允许用户对单个工单进行一系列通用业务操作
10
+
11
+
12
+
13
+ ## 代码演示
14
+
15
+ ```html
16
+ <ticket-details-view
17
+ :visible.sync="detailVisible"
18
+ :ticketId="ticketId"
19
+ v-if="ticketId"
20
+ />
21
+ ```
22
+
23
+ ## API
24
+
25
+ | 参数 | 说明 | 类型 | 默认值 |
26
+ |---------------|-------|---------|-------|
27
+ | detailVisible | 是否显示 | Boolean | false |
28
+ | ticketId | 工单编号 | String | null |
29
+ | id | 负责人id | String | null |
@@ -1,69 +1,69 @@
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
- if (item.status) {
18
- badgeItemArray[key][item.value] = {
19
- status: item.status,
20
- text: item.text
21
- }
22
- }
23
- }
24
- }
25
- // 追加参数
26
- localStorage.setItem(process.env.VUE_APP_DICTIONARY_KEY, JSON.stringify(params))
27
- localStorage.setItem(process.env.VUE_APP_BADGE_KEY, JSON.stringify(badgeItemArray))
28
- })
29
- // 获取省市区数据
30
- await post(manageApi.getDivisionsOhChina, {}).then((res) => {
31
- // 追加参数
32
- localStorage.setItem(process.env.VUE_APP_DIVISIONSOHCHINA, JSON.stringify(res))
33
- })
34
- },
35
- // 返回树形省市区
36
- getDivisionsOhChinaForTree () {
37
- const str = localStorage.getItem(process.env.VUE_APP_DIVISIONSOHCHINA)
38
- return handleTree(JSON.parse(str), 'code', 'parentcode')
39
- },
40
- // 返回列表省市区
41
- getDivisionsOhChinaForList () {
42
- const str = localStorage.getItem(process.env.VUE_APP_DIVISIONSOHCHINA)
43
- return JSON.parse(str)
44
- },
45
- getDictionaryList (key) {
46
- const str = localStorage.getItem(process.env.VUE_APP_DICTIONARY_KEY)
47
- const object = JSON.parse(str)
48
- return object[key]
49
- },
50
- getParam (key, value) {
51
- const str = localStorage.getItem(process.env.VUE_APP_BADGE_KEY)
52
- const object = JSON.parse(str)
53
- const result = object[key]
54
- if (result && result.hasOwnProperty(value)) {
55
- return result[value]
56
- } else {
57
- return null
58
- }
59
- },
60
- getParams () {
61
- const str = localStorage.getItem(process.env.VUE_APP_DICTIONARY_KEY)
62
- return JSON.parse(str)
63
- },
64
- getSingleValues () {
65
- const str = localStorage.getItem(process.env.VUE_APP_BADGE_KEY)
66
- return JSON.parse(str)
67
- }
68
- }
69
- 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
+ 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
+ if (item.status) {
18
+ badgeItemArray[key][item.value] = {
19
+ status: item.status,
20
+ text: item.text
21
+ }
22
+ }
23
+ }
24
+ }
25
+ // 追加参数
26
+ localStorage.setItem(process.env.VUE_APP_DICTIONARY_KEY, JSON.stringify(params))
27
+ localStorage.setItem(process.env.VUE_APP_BADGE_KEY, JSON.stringify(badgeItemArray))
28
+ })
29
+ // 获取省市区数据
30
+ await post(manageApi.getDivisionsOhChina, {}).then((res) => {
31
+ // 追加参数
32
+ localStorage.setItem(process.env.VUE_APP_DIVISIONSOHCHINA, JSON.stringify(res))
33
+ })
34
+ },
35
+ // 返回树形省市区
36
+ getDivisionsOhChinaForTree () {
37
+ const str = localStorage.getItem(process.env.VUE_APP_DIVISIONSOHCHINA)
38
+ return handleTree(JSON.parse(str), 'code', 'parentcode')
39
+ },
40
+ // 返回列表省市区
41
+ getDivisionsOhChinaForList () {
42
+ const str = localStorage.getItem(process.env.VUE_APP_DIVISIONSOHCHINA)
43
+ return JSON.parse(str)
44
+ },
45
+ getDictionaryList (key) {
46
+ const str = localStorage.getItem(process.env.VUE_APP_DICTIONARY_KEY)
47
+ const object = JSON.parse(str)
48
+ return object[key]
49
+ },
50
+ getParam (key, value) {
51
+ const str = localStorage.getItem(process.env.VUE_APP_BADGE_KEY)
52
+ const object = JSON.parse(str)
53
+ const result = object[key]
54
+ if (result && result.hasOwnProperty(value)) {
55
+ return result[value]
56
+ } else {
57
+ return null
58
+ }
59
+ },
60
+ getParams () {
61
+ const str = localStorage.getItem(process.env.VUE_APP_DICTIONARY_KEY)
62
+ return JSON.parse(str)
63
+ },
64
+ getSingleValues () {
65
+ const str = localStorage.getItem(process.env.VUE_APP_BADGE_KEY)
66
+ return JSON.parse(str)
67
+ }
68
+ }
69
+ export default GetAppDataService
@@ -1,252 +1,179 @@
1
- import Vue from 'vue'
2
- import { SEARCH } from '@vue2-client/services/apiService'
3
- import { post } from '@vue2-client/services/api'
4
-
5
- /**
6
- * 获取片区
7
- * @returns {Promise<void>}
8
- */
9
- // eslint-disable-next-line
10
- async function getAllArea () {
11
- try {
12
- const getAllArea = await post(SEARCH, {
13
- source: 'this.getParentByType($organization$).getChildByName($片区$).getChildren()',
14
- userid: Vue.$login.f.id
15
- })
16
- const areaTemp = []
17
- for (let i = 0; i < getAllArea.length; i++) {
18
- areaTemp.push({ label: getAllArea[i].name, value: getAllArea[i] })
19
- }
20
- Vue.$login.f.f_allArea = areaTemp
21
- } catch (error) {
22
- Vue.$login.f.f_allArea = []
23
- console.log('获取片区异常', error)
24
- }
25
- }
26
- /**
27
- * 获取抄表员
28
- * @returns {Promise<void>}
29
- */
30
- async function getGasman () {
31
- try {
32
- const getGasman = await post(SEARCH, {
33
- source: 'this.getParentByType($organization$).getChildByName($抄表员$).getUsers()',
34
- userid: Vue.$login.f.id
35
- })
36
- const gasman = []
37
- for (let i = 0; i < getGasman.length; i++) {
38
- gasman.push(getGasman[i])
39
- }
40
- Vue.$login.f.f_gasman = gasman
41
- } catch (error) {
42
- Vue.$login.f.f_gasman = []
43
- console.log('获取抄表员异常', error)
44
- }
45
- }
46
- /**
47
- * 获取资源服务权限
48
- * @returns {Promise<void>}
49
- */
50
- async function getLic () {
51
- try {
52
- const getLic = await post(SEARCH, { data: {
53
- source: 'this.getRights().where(row.getType()==$function$ && row.getPath($name$).indexOf($资源操作$) != -1)',
54
- userid: Vue.$login.f.id
55
- } }, { resolveMsg: null, rejectMsg: null })
56
- const arry = []
57
- getLic.forEach((item) => {
58
- arry.push(item.name)
59
- })
60
- Vue.$login.f.lics = arry
61
- } catch (error) {
62
- Vue.$login.f.f_gasman = []
63
- console.log('获取资源服务权限异常', error)
64
- }
65
- }
66
- /**
67
- * 获取界面细节 (界面权限)
68
- * @returns {Promise<void>}
69
- */
70
- async function getViewDetails () {
71
- try {
72
- const viewDetails = await post(SEARCH, {
73
- source: 'this.getRights().where(row.getType()==$function$ && row.getPath($name$).indexOf($功能权限$) != -1)',
74
- userid: Vue.$login.f.id
75
- }, { resolveMsg: null, rejectMsg: null })
76
- const r = viewDetails
77
- Vue.$login.r = []
78
- r.forEach(x => Vue.$login.r.push(x.name))
79
- } catch (error) {
80
- Vue.$login.r = []
81
- console.log('获取界面细节异常', error)
82
- }
83
- }
84
- /**
85
- * 获取资源功能
86
- * @returns {Promise<void>}
87
- */
88
- async function getResourceFunction () {
89
- try {
90
- const resourceFunction = await post(SEARCH, {
91
- source: 'tool.getFullTree(this.getRights().where(row.getName() == $组织管理$||row.getName() == $功能管理$||row.getName() == $部门管理$ || row.getName() == $角色管理$ || row.getName() == $人员管理$|| row.getName() == $资源调配$ ))',
92
- userid: Vue.$login.f.id
93
- }, { resolveMsg: null, rejectMsg: null })
94
- return resourceFunction
95
- } catch (error) {
96
- console.log('获取资源功能异常', error)
97
- }
98
- }
99
- /**
100
- * 获取组织管理数据
101
- * @returns {Promise<void>}
102
- */
103
- async function getOrganization () {
104
- try {
105
- const resourceFunction = await post(SEARCH, {
106
- source: 'tool.getFullTree(this.getRights().where(row.getType() == $organization$||row.getType() == $zone$))',
107
- userid: Vue.$login.f.id
108
- }, { resolveMsg: null, rejectMsg: null })
109
- return resourceFunction
110
- } catch (error) {
111
- console.log('获取组织管理数据异常', error)
112
- }
113
- }
114
- /**
115
- * 完整资源树筛选指定名称的资源
116
- * @param fun 要筛选的资源树
117
- * @param name 筛选的资源名称
118
- * @returns {*}
119
- */
120
- function searchFun (fun, name) {
121
- if (fun.length > 0) {
122
- if (fun[0].name === name) {
123
- return fun[0].children
124
- } else {
125
- return searchFun(fun[0].children, name)
126
- }
127
- }
128
- }
129
-
130
- const loginGen = async function (response) {
131
- Vue.$login.f = response
132
- await Promise.all([Vue.$appdata.load(), getGasman(), getLic(), getViewDetails()])
133
- const login = {
134
- f: Vue.$login.f,
135
- jwt: Vue.$login.f.id,
136
- r: Vue.$login.r
137
- }
138
- Vue.$store.commit('account/setLogin', login)
139
- }
140
- const GetLoginInfoService = {
141
- install (Vue) {
142
- // 给vue增添对话框显示方法
143
- Vue.$login = Vue.prototype.$login = GetLoginInfoService
144
- },
145
-
146
- f: {
147
-
148
- },
149
-
150
- login (response) {
151
- return loginGen(response)
152
- },
153
-
154
- convertToIn (val) {
155
- let temp = ''
156
- if (val instanceof Array) {
157
- if (val.length >= 1) {
158
- temp = '('
159
- val.forEach((res) => {
160
- temp += `'${res}',`
161
- })
162
- temp = temp.substr(0, temp.length - 1) + ')'
163
- }
164
- }
165
- return temp
166
- },
167
- toStandardTimeString () {
168
- const dt = new Date()
169
- const month = dt.getMonth() + 1
170
- const date = dt.getDate()
171
- const hour = dt.getHours()
172
- const min = dt.getMinutes()
173
- const sec = dt.getSeconds()
174
- return dt.getFullYear() + '-' + (month < 10 ? '0' + month : month) + '-' + (date < 10 ? '0' + date : date) +
175
- ' ' + (hour < 10 ? '0' + hour : hour) + ':' + (min < 10 ? '0' + min : min) + ':' + (sec < 10 ? '0' + sec : sec)
176
- },
177
-
178
- guid () {
179
- const buf = new Uint16Array(8)
180
- window.crypto.getRandomValues(buf)
181
- const S4 = function (num) {
182
- let ret = num.toString()
183
- while (ret.length < 4) {
184
- ret = '0' + ret
185
- }
186
- return ret
187
- }
188
- return (S4(buf[0]) + S4(buf[1]) + S4(buf[2]) + S4(buf[3]) + S4(buf[4]) + S4(buf[5]) + S4(buf[6]) + S4(buf[7]))
189
- },
190
- required (param) {
191
- if (typeof param === 'number' && param === 0) {
192
- return false
193
- }
194
- if (!param) {
195
- return true
196
- }
197
- param = param + ''
198
- param = param.trim()
199
- return !param
200
- },
201
-
202
- isInt (n) {
203
- return !window.isNaN(n) && n % 1 === 0
204
- },
205
-
206
- // 不能选择器中截取掉多余的字符
207
- orgName (name) {
208
- return name.substring(10)
209
- },
210
-
211
- addDate (date, days) {
212
- // 求取当前时间的工具
213
- let endDate = new Date(date)
214
- endDate = endDate.valueOf()
215
- endDate = endDate + days * 24 * 60 * 60 * 1000
216
- endDate = new Date(endDate)
217
- const month = endDate.getMonth() + 1
218
- const day = endDate.getDate()
219
- const hour = endDate.getHours()
220
- const min = endDate.getMinutes()
221
- const sec = endDate.getSeconds()
222
- return endDate.getFullYear() + '-' + (month < 10 ? '0' + month : month) + '-' + (day < 10 ? '0' + day : day) +
223
- ' ' + (hour < 10 ? '0' + hour : hour) + ':' + (min < 10 ? '0' + min : min) + ':' + (sec < 10 ? '0' + sec : sec)
224
- // return a
225
- },
226
-
227
- // 对字符串进行加密
228
- compileStr (code) {
229
- let c = String.fromCharCode(code.charCodeAt(0) + code.length)
230
- for (let i = 1; i < code.length; i++) {
231
- c += String.fromCharCode(code.charCodeAt(i) + code.charCodeAt(i - 1))
232
- }
233
- return escape(c)
234
- },
235
-
236
- // 字符串进行解密
237
- uncompileStr (code) {
238
- code = unescape(code)
239
- let c = String.fromCharCode(code.charCodeAt(0) - code.length)
240
- for (let i = 1; i < code.length; i++) {
241
- c += String.fromCharCode(code.charCodeAt(i) - c.charCodeAt(i - 1))
242
- }
243
- return c
244
- }
245
- }
246
-
247
- export default GetLoginInfoService
248
- export {
249
- getResourceFunction,
250
- getOrganization,
251
- searchFun
252
- }
1
+ import Vue from 'vue'
2
+ import { SEARCH } from '@vue2-client/services/apiService'
3
+ import { post } from '@vue2-client/services/api'
4
+
5
+ /**
6
+ * 获取片区
7
+ * @returns {Promise<void>}
8
+ */
9
+ // eslint-disable-next-line
10
+ async function getAllArea () {
11
+ try {
12
+ const getAllArea = await post(SEARCH, {
13
+ source: 'this.getParentByType($organization$).getChildByName($片区$).getChildren()',
14
+ userid: Vue.$login.f.id
15
+ })
16
+ const areaTemp = []
17
+ for (let i = 0; i < getAllArea.length; i++) {
18
+ areaTemp.push({ label: getAllArea[i].name, value: getAllArea[i] })
19
+ }
20
+ Vue.$login.f.f_allArea = areaTemp
21
+ } catch (error) {
22
+ Vue.$login.f.f_allArea = []
23
+ console.log('获取片区异常', error)
24
+ }
25
+ }
26
+ /**
27
+ * 获取抄表员
28
+ * @returns {Promise<void>}
29
+ */
30
+ // eslint-disable-next-line
31
+ async function getGasman () {
32
+ try {
33
+ const getGasman = await post(SEARCH, {
34
+ source: 'this.getParentByType($organization$).getChildByName($抄表员$).getUsers()',
35
+ userid: Vue.$login.f.id
36
+ })
37
+ const gasman = []
38
+ for (let i = 0; i < getGasman.length; i++) {
39
+ gasman.push(getGasman[i])
40
+ }
41
+ Vue.$login.f.f_gasman = gasman
42
+ } catch (error) {
43
+ Vue.$login.f.f_gasman = []
44
+ console.log('获取抄表员异常', error)
45
+ }
46
+ }
47
+ /**
48
+ * 获取资源服务权限
49
+ * @returns {Promise<void>}
50
+ */
51
+ // eslint-disable-next-line
52
+ async function getLic () {
53
+ try {
54
+ const getLic = await post(SEARCH, { data: {
55
+ source: 'this.getRights().where(row.getType()==$function$ && row.getPath($name$).indexOf($资源操作$) != -1)',
56
+ userid: Vue.$login.f.id
57
+ } }, { resolveMsg: null, rejectMsg: null })
58
+ const arry = []
59
+ getLic.forEach((item) => {
60
+ arry.push(item.name)
61
+ })
62
+ Vue.$login.f.lics = arry
63
+ } catch (error) {
64
+ Vue.$login.f.f_gasman = []
65
+ console.log('获取资源服务权限异常', error)
66
+ }
67
+ }
68
+
69
+ /**
70
+ * 获取界面细节 (界面权限)
71
+ * @returns {Promise<void>}
72
+ */
73
+ // eslint-disable-next-line
74
+ async function getViewDetails () {
75
+ try {
76
+ const viewDetails = await post(SEARCH, {
77
+ source: 'this.getRights().where(row.getType()==$function$ && row.getPath($name$).indexOf($功能权限$) != -1)',
78
+ userid: Vue.$login.f.id
79
+ }, { resolveMsg: null, rejectMsg: null })
80
+ const r = viewDetails
81
+ Vue.$login.r = []
82
+ r.forEach(x => Vue.$login.r.push(x.name))
83
+ } catch (error) {
84
+ Vue.$login.r = []
85
+ console.log('获取界面细节异常', error)
86
+ }
87
+ }
88
+ /**
89
+ * 获取资源功能
90
+ * @returns {Promise<void>}
91
+ */
92
+ async function getResourceFunction () {
93
+ try {
94
+ const resourceFunction = await post(SEARCH, {
95
+ source: 'tool.getFullTree(this.getRights().where(row.getName() == $组织管理$||row.getName() == $功能管理$||row.getName() == $部门管理$ || row.getName() == $角色管理$ || row.getName() == $人员管理$|| row.getName() == $资源调配$ ))',
96
+ userid: Vue.$login.f.id
97
+ }, { resolveMsg: null, rejectMsg: null })
98
+ return resourceFunction
99
+ } catch (error) {
100
+ console.log('获取资源功能异常', error)
101
+ }
102
+ }
103
+ /**
104
+ * 获取组织管理数据
105
+ * @returns {Promise<void>}
106
+ */
107
+ async function getOrganization () {
108
+ try {
109
+ const resourceFunction = await post(SEARCH, {
110
+ source: 'tool.getFullTree(this.getRights().where(row.getType() == $organization$||row.getType() == $zone$))',
111
+ userid: Vue.$login.f.id
112
+ }, { resolveMsg: null, rejectMsg: null })
113
+ return resourceFunction
114
+ } catch (error) {
115
+ console.log('获取组织管理数据异常', error)
116
+ }
117
+ }
118
+ /**
119
+ * 完整资源树筛选指定名称的资源
120
+ * @param fun 要筛选的资源树
121
+ * @param name 筛选的资源名称
122
+ * @returns {*}
123
+ */
124
+ function searchFun (fun, name) {
125
+ if (fun.length > 0) {
126
+ if (fun[0].name === name) {
127
+ return fun[0].children
128
+ } else {
129
+ return searchFun(fun[0].children, name)
130
+ }
131
+ }
132
+ }
133
+
134
+ const loginGen = async function (response) {
135
+ Vue.$login.f = response
136
+ await Promise.all([Vue.$appdata.load()])
137
+ const login = {
138
+ f: Vue.$login.f,
139
+ jwt: Vue.$login.f.id,
140
+ r: Vue.$login.r
141
+ }
142
+ Vue.$store.commit('account/setLogin', login)
143
+ }
144
+ const GetLoginInfoService = {
145
+ install (Vue) {
146
+ // 给vue增添对话框显示方法
147
+ Vue.$login = Vue.prototype.$login = GetLoginInfoService
148
+ },
149
+
150
+ f: {
151
+
152
+ },
153
+
154
+ login (response) {
155
+ return loginGen(response)
156
+ },
157
+ required (param) {
158
+ if (typeof param === 'number' && param === 0) {
159
+ return false
160
+ }
161
+ if (!param) {
162
+ return true
163
+ }
164
+ param = param + ''
165
+ param = param.trim()
166
+ return !param
167
+ },
168
+ // 不能选择器中截取掉多余的字符
169
+ orgName (name) {
170
+ return name.substring(10)
171
+ }
172
+ }
173
+
174
+ export default GetLoginInfoService
175
+ export {
176
+ getResourceFunction,
177
+ getOrganization,
178
+ searchFun
179
+ }