vue2-client 1.2.0 → 1.2.1

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 (120) hide show
  1. package/README.md +65 -65
  2. package/babel.config.js +1 -0
  3. package/docs/notice.md +24 -0
  4. package/index.js +28 -28
  5. package/package.json +1 -1
  6. package/src/App.vue +93 -93
  7. package/src/base-client/all.js +57 -57
  8. package/src/base-client/components/common/CreateQuery/CreateQuery.vue +1159 -1159
  9. package/src/base-client/components/common/CreateQuery/index.md +42 -42
  10. package/src/base-client/components/common/CreateSimpleFormQuery/CreateSimpleFormQuery.vue +540 -540
  11. package/src/base-client/components/common/CreateSimpleFormQuery/index.md +42 -42
  12. package/src/base-client/components/common/CustomColumnsDrawer/index.md +46 -46
  13. package/src/base-client/components/common/FormGroupEdit/FormGroupEdit.vue +150 -150
  14. package/src/base-client/components/common/FormGroupEdit/index.md +43 -43
  15. package/src/base-client/components/common/FormGroupQuery/index.md +43 -43
  16. package/src/base-client/components/common/XAddForm/XAddForm.vue +323 -323
  17. package/src/base-client/components/common/XAddForm/index.md +60 -60
  18. package/src/base-client/components/common/XBadge/index.md +39 -39
  19. package/src/base-client/components/common/XCard/index.md +43 -43
  20. package/src/base-client/components/common/XForm/XForm.vue +275 -275
  21. package/src/base-client/components/common/XForm/XFormItem.vue +217 -217
  22. package/src/base-client/components/common/XForm/index.md +196 -196
  23. package/src/base-client/components/common/XFormCol/index.md +35 -35
  24. package/src/base-client/components/common/XFormTable/XFormTable.vue +405 -405
  25. package/src/base-client/components/common/XFormTable/index.md +89 -89
  26. package/src/base-client/components/common/XTable/XTable.vue +262 -262
  27. package/src/base-client/components/common/XTable/index.md +255 -255
  28. package/src/base-client/components/common/XTreeOne/XTreeOne.vue +105 -105
  29. package/src/base-client/components/iot/CustomerDetailsView/CustomerDetailsView.vue +226 -226
  30. package/src/base-client/components/iot/CustomerDetailsView/index.md +41 -41
  31. package/src/base-client/components/iot/DataAnalysisUser/DataAnalysisUser.vue +127 -127
  32. package/src/base-client/components/iot/DataAnalysisViewGD/DataAnalysisViewGD.vue +548 -548
  33. package/src/base-client/components/iot/DeviceBrandDetailsView/DeviceBrandDetailsView.vue +453 -453
  34. package/src/base-client/components/iot/DeviceDetailsView/DeviceDetailsView.vue +231 -231
  35. package/src/base-client/components/iot/DeviceDetailsView/index.md +43 -43
  36. package/src/base-client/components/iot/DeviceDetailsView/part/DeviceDetailsCount.vue +330 -330
  37. package/src/base-client/components/iot/DeviceDetailsView/part/DeviceDetailsException.vue +57 -57
  38. package/src/base-client/components/iot/DeviceDetailsView/part/DeviceDetailsInstruct.vue +122 -122
  39. package/src/base-client/components/iot/DeviceDetailsView/part/DeviceDetailsInstructOperate.vue +122 -122
  40. package/src/base-client/components/iot/DeviceDetailsView/part/DeviceDetailsMain.vue +225 -225
  41. package/src/base-client/components/iot/DeviceDetailsView/part/DeviceDetailsRead.vue +135 -135
  42. package/src/base-client/components/iot/DeviceTypeDetailsView/DeviceTypeDetailsView.vue +277 -277
  43. package/src/base-client/components/iot/InstructDetailsView/InstructDetailsView.vue +472 -472
  44. package/src/base-client/components/iot/InstructDetailsView/index.md +45 -45
  45. package/src/base-client/components/iot/LogDetailsView/LogDetailsView.vue +380 -380
  46. package/src/base-client/components/iot/LogDetailsView/index.md +43 -43
  47. package/src/base-client/components/iot/MeterDetailsView/MeterDetailsView.vue +360 -360
  48. package/src/base-client/components/iot/MeterDetailsView/index.md +43 -43
  49. package/src/base-client/components/iot/MeterDetailsView/part/MeterDetailsCount.vue +335 -335
  50. package/src/base-client/components/iot/MeterDetailsView/part/MeterDetailsException.vue +185 -185
  51. package/src/base-client/components/iot/MeterDetailsView/part/MeterDetailsHandPlan.vue +292 -292
  52. package/src/base-client/components/iot/MeterDetailsView/part/MeterDetailsInstruct.vue +237 -237
  53. package/src/base-client/components/iot/MeterDetailsView/part/MeterDetailsMain.vue +257 -257
  54. package/src/base-client/components/iot/MeterDetailsView/part/MeterDetailsSellGas.vue +190 -190
  55. package/src/base-client/components/iot/WebmeterAnalysisView/WebmeterAnalysisView.vue +723 -723
  56. package/src/base-client/components/iot/WebmeterAnalysisView/index.md +48 -48
  57. package/src/base-client/components/system/DictionaryDetailsView/DictionaryDetailsView.vue +232 -232
  58. package/src/base-client/components/system/DictionaryDetailsView/index.md +41 -41
  59. package/src/base-client/components/system/QueryParamsDetailsView/QueryParamsDetailsView.vue +248 -248
  60. package/src/base-client/components/ticket/EmployeeDetailsView/EmployeeDetailsView.vue +406 -406
  61. package/src/base-client/components/ticket/TicketDetailsView/TicketDetailsView.vue +486 -486
  62. package/src/base-client/components/ticket/TicketDetailsView/part/TicketDetailsFlow.vue +184 -184
  63. package/src/base-client/components/ticket/TicketSubmitSuccessView/TicketSubmitSuccessView.vue +303 -303
  64. package/src/base-client/plugins/AppData.js +69 -69
  65. package/src/base-client/plugins/GetLoginInfoService.js +221 -221
  66. package/src/base-client/plugins/index.js +21 -21
  67. package/src/bootstrap.js +27 -27
  68. package/src/components/Ellipsis/Ellipsis.vue +64 -64
  69. package/src/components/Ellipsis/index.md +38 -38
  70. package/src/components/NumberInfo/index.md +43 -43
  71. package/src/components/STable/README.md +341 -341
  72. package/src/components/Trend/index.md +45 -45
  73. package/src/components/cache/AKeepAlive.js +172 -172
  74. package/src/components/checkbox/index.js +7 -7
  75. package/src/components/index.js +36 -36
  76. package/src/components/menu/menu.js +273 -273
  77. package/src/components/setting/Setting.vue +237 -237
  78. package/src/components/table/advance/AdvanceTable.vue +275 -275
  79. package/src/components/transition/PageToggleTransition.vue +97 -97
  80. package/src/layouts/CommonLayout.vue +42 -42
  81. package/src/layouts/PageLayout.vue +151 -151
  82. package/src/layouts/SinglePageView.vue +74 -74
  83. package/src/layouts/header/AdminHeader.vue +109 -109
  84. package/src/layouts/header/HeaderAvatar.vue +60 -60
  85. package/src/layouts/header/HeaderNotice.vue +97 -97
  86. package/src/layouts/tabs/TabsHead.vue +190 -190
  87. package/src/layouts/tabs/TabsView.vue +355 -355
  88. package/src/main.js +20 -20
  89. package/src/mock/goods/index.js +108 -108
  90. package/src/mock/index.js +12 -12
  91. package/src/mock/project/index.js +17 -17
  92. package/src/mock/user/current.js +13 -13
  93. package/src/mock/user/login.js +39 -39
  94. package/src/mock/workplace/index.js +15 -15
  95. package/src/pages/exception/403.vue +25 -25
  96. package/src/pages/exception/404.vue +25 -25
  97. package/src/pages/exception/500.vue +25 -25
  98. package/src/pages/login/Login.vue +194 -194
  99. package/src/pages/report/ReportTableHome.vue +28 -28
  100. package/src/pages/resourceManage/resourceManageMain.vue +55 -55
  101. package/src/pages/system/applyInstallView/Core.vue +570 -570
  102. package/src/pages/system/applyInstallView/index.vue +34 -34
  103. package/src/pages/system/dictionary/index.vue +41 -41
  104. package/src/pages/system/queryParams/index.vue +41 -41
  105. package/src/router/async/config.async.js +25 -25
  106. package/src/router/async/router.map.js +59 -59
  107. package/src/router/guards.js +104 -104
  108. package/src/router/index.js +27 -27
  109. package/src/services/api/common.js +39 -39
  110. package/src/services/api/restTools.js +23 -23
  111. package/src/services/dataSource.js +12 -12
  112. package/src/services/user.js +34 -34
  113. package/src/store/modules/setting.js +114 -114
  114. package/src/utils/i18n.js +80 -80
  115. package/src/utils/indexedDB.js +146 -146
  116. package/src/utils/request.js +197 -197
  117. package/src/utils/routerUtil.js +15 -2
  118. package/tests/unit/ReportTable.spec.js +15 -15
  119. package/vue.config.js +153 -153
  120. package/webpack.config.js +12 -12
@@ -1,69 +1,69 @@
1
- import { post } from '@vue2-client/services/api/restTools'
2
- import { manageApi } from '@vue2-client/services/api/manage'
3
- import { commonApi } from '@vue2-client/services/api/common'
4
-
5
- const GetAppDataService = {
6
- install (Vue) {
7
- // 给vue增添对话框显示方法
8
- Vue.$appdata = Vue.prototype.$appdata = GetAppDataService
9
- },
10
- async load () {
11
- const params = {}
12
- // 查询燃气公司列表
13
- const orgList = []
14
- await post(manageApi.orgList, {}).then(async res => {
15
- for (let i = 0, len = res.length; i < len; i++) {
16
- orgList.push({
17
- label: res[i],
18
- value: res[i],
19
- text: res[i]
20
- })
21
- }
22
- params['orgList'] = orgList
23
- await post(commonApi.getDictionaryValue, {}).then((res) => {
24
- Object.assign(params, res)
25
- const badgeItemArray = {}
26
- for (const key of Object.keys(params)) {
27
- badgeItemArray[key] = {}
28
- for (const item of params[key]) {
29
- if (item.status) {
30
- badgeItemArray[key][item.value] = {
31
- status: item.status,
32
- text: item.text
33
- }
34
- }
35
- }
36
- }
37
- // 追加参数
38
- localStorage.setItem(process.env.VUE_APP_DICTIONARY_KEY, JSON.stringify(params))
39
- localStorage.setItem(process.env.VUE_APP_BADGE_KEY, JSON.stringify(badgeItemArray))
40
- })
41
- })
42
- },
43
- getDictionaryList (key) {
44
- const str = localStorage.getItem(process.env.VUE_APP_DICTIONARY_KEY)
45
- const object = JSON.parse(str)
46
- return object[key]
47
- },
48
- getParam (key, value) {
49
- const str = localStorage.getItem(process.env.VUE_APP_BADGE_KEY)
50
- const object = JSON.parse(str)
51
- const result = object[key]
52
- if (result && result.hasOwnProperty(value)) {
53
- return result[value]
54
- } else {
55
- return null
56
- }
57
- },
58
- getParams () {
59
- const str = localStorage.getItem(process.env.VUE_APP_DICTIONARY_KEY)
60
- const object = JSON.parse(str)
61
- return object
62
- },
63
- getSingleValues () {
64
- const str = localStorage.getItem(process.env.VUE_APP_BADGE_KEY)
65
- const object = JSON.parse(str)
66
- return object
67
- }
68
- }
69
- export default GetAppDataService
1
+ import { post } from '@vue2-client/services/api/restTools'
2
+ import { manageApi } from '@vue2-client/services/api/manage'
3
+ import { commonApi } from '@vue2-client/services/api/common'
4
+
5
+ const GetAppDataService = {
6
+ install (Vue) {
7
+ // 给vue增添对话框显示方法
8
+ Vue.$appdata = Vue.prototype.$appdata = GetAppDataService
9
+ },
10
+ async load () {
11
+ const params = {}
12
+ // 查询燃气公司列表
13
+ const orgList = []
14
+ await post(manageApi.orgList, {}).then(async res => {
15
+ for (let i = 0, len = res.length; i < len; i++) {
16
+ orgList.push({
17
+ label: res[i],
18
+ value: res[i],
19
+ text: res[i]
20
+ })
21
+ }
22
+ params['orgList'] = orgList
23
+ await post(commonApi.getDictionaryValue, {}).then((res) => {
24
+ Object.assign(params, res)
25
+ const badgeItemArray = {}
26
+ for (const key of Object.keys(params)) {
27
+ badgeItemArray[key] = {}
28
+ for (const item of params[key]) {
29
+ if (item.status) {
30
+ badgeItemArray[key][item.value] = {
31
+ status: item.status,
32
+ text: item.text
33
+ }
34
+ }
35
+ }
36
+ }
37
+ // 追加参数
38
+ localStorage.setItem(process.env.VUE_APP_DICTIONARY_KEY, JSON.stringify(params))
39
+ localStorage.setItem(process.env.VUE_APP_BADGE_KEY, JSON.stringify(badgeItemArray))
40
+ })
41
+ })
42
+ },
43
+ getDictionaryList (key) {
44
+ const str = localStorage.getItem(process.env.VUE_APP_DICTIONARY_KEY)
45
+ const object = JSON.parse(str)
46
+ return object[key]
47
+ },
48
+ getParam (key, value) {
49
+ const str = localStorage.getItem(process.env.VUE_APP_BADGE_KEY)
50
+ const object = JSON.parse(str)
51
+ const result = object[key]
52
+ if (result && result.hasOwnProperty(value)) {
53
+ return result[value]
54
+ } else {
55
+ return null
56
+ }
57
+ },
58
+ getParams () {
59
+ const str = localStorage.getItem(process.env.VUE_APP_DICTIONARY_KEY)
60
+ const object = JSON.parse(str)
61
+ return object
62
+ },
63
+ getSingleValues () {
64
+ const str = localStorage.getItem(process.env.VUE_APP_BADGE_KEY)
65
+ const object = JSON.parse(str)
66
+ return object
67
+ }
68
+ }
69
+ export default GetAppDataService
@@ -1,221 +1,221 @@
1
- import Vue from 'vue'
2
- import { SEARCH } from '@vue2-client/services/api'
3
- import { post } from '@vue2-client/services/api/restTools'
4
-
5
- const loginGen = async function (response) {
6
- Vue.$login.f = response
7
- await Promise.all([Vue.$appdata.load(), getGasman(), getLic(), getViewDetails()])
8
- const login = {
9
- f: Vue.$login.f,
10
- jwt: Vue.$login.f.id,
11
- r: Vue.$login.r
12
- }
13
- Vue.$store.commit('account/setLogin', login)
14
- }
15
-
16
- /**
17
- * 获取片区
18
- * @returns {Promise<void>}
19
- */
20
- // eslint-disable-next-line
21
- async function getAllArea () {
22
- try {
23
- const getAllArea = await post(SEARCH, {
24
- source: 'this.getParentByType($organization$).getChildByName($片区$).getChildren()',
25
- userid: Vue.$login.f.id
26
- })
27
- const areaTemp = []
28
- for (let i = 0; i < getAllArea.length; i++) {
29
- areaTemp.push({ label: getAllArea[i].name, value: getAllArea[i] })
30
- }
31
- Vue.$login.f.f_allArea = areaTemp
32
- } catch (error) {
33
- Vue.$login.f.f_allArea = []
34
- console.log('获取片区异常', error)
35
- }
36
- }
37
- /**
38
- * 获取抄表员
39
- * @returns {Promise<void>}
40
- */
41
- async function getGasman () {
42
- try {
43
- const getGasman = await post(SEARCH, {
44
- source: 'this.getParentByType($organization$).getChildByName($抄表员$).getUsers()',
45
- userid: Vue.$login.f.id
46
- })
47
- const gasman = []
48
- for (let i = 0; i < getGasman.length; i++) {
49
- gasman.push(getGasman[i])
50
- }
51
- Vue.$login.f.f_gasman = gasman
52
- } catch (error) {
53
- Vue.$login.f.f_gasman = []
54
- console.log('获取抄表员异常', error)
55
- }
56
- }
57
- /**
58
- * 获取资源服务权限
59
- * @returns {Promise<void>}
60
- */
61
- async function getLic () {
62
- try {
63
- const getLic = await post(SEARCH, { data: {
64
- source: 'this.getRights().where(row.getType()==$function$ && row.getPath($name$).indexOf($资源操作$) != -1)',
65
- userid: Vue.$login.f.id
66
- } }, { resolveMsg: null, rejectMsg: null })
67
- const arry = []
68
- getLic.forEach((item) => {
69
- arry.push(item.name)
70
- })
71
- Vue.$login.f.lics = arry
72
- } catch (error) {
73
- Vue.$login.f.f_gasman = []
74
- console.log('获取资源服务权限异常', error)
75
- }
76
- }
77
- /**
78
- * 获取界面细节 (界面权限)
79
- * @returns {Promise<void>}
80
- */
81
- async function getViewDetails () {
82
- try {
83
- const viewDetails = await post(SEARCH, {
84
- source: 'this.getRights().where(row.getType()==$function$ && row.getPath($name$).indexOf($功能权限$) != -1)',
85
- userid: Vue.$login.f.id
86
- }, { resolveMsg: null, rejectMsg: null })
87
- const r = viewDetails
88
- Vue.$login.r = []
89
- r.forEach(x => Vue.$login.r.push(x.name))
90
- } catch (error) {
91
- Vue.$login.r = []
92
- console.log('获取界面细节异常', error)
93
- }
94
- }
95
- /**
96
- * 获取资源功能
97
- * @returns {Promise<void>}
98
- */
99
- async function getResourceFunction () {
100
- try {
101
- const resourceFunction = await post(SEARCH, {
102
- source: 'tool.getFullTree(this.getRights().where(row.getName() == $组织管理$||row.getName() == $功能管理$||row.getName() == $部门管理$ || row.getName() == $角色管理$ || row.getName() == $人员管理$|| row.getName() == $资源调配$ ))',
103
- userid: Vue.$login.f.id
104
- }, { resolveMsg: null, rejectMsg: null })
105
- return resourceFunction
106
- } catch (error) {
107
- console.log('获取资源功能异常', error)
108
- }
109
- }
110
-
111
- const GetLoginInfoService = {
112
- install (Vue) {
113
- // 给vue增添对话框显示方法
114
- Vue.$login = Vue.prototype.$login = GetLoginInfoService
115
- },
116
-
117
- f: {
118
-
119
- },
120
-
121
- login (response) {
122
- return loginGen(response)
123
- },
124
-
125
- convertToIn (val) {
126
- let temp = ''
127
- if (val instanceof Array) {
128
- if (val.length >= 1) {
129
- temp = '('
130
- val.forEach((res) => {
131
- temp += `'${res}',`
132
- })
133
- temp = temp.substr(0, temp.length - 1) + ')'
134
- }
135
- }
136
- return temp
137
- },
138
- toStandardTimeString () {
139
- const dt = new Date()
140
- const month = dt.getMonth() + 1
141
- const date = dt.getDate()
142
- const hour = dt.getHours()
143
- const min = dt.getMinutes()
144
- const sec = dt.getSeconds()
145
- return dt.getFullYear() + '-' + (month < 10 ? '0' + month : month) + '-' + (date < 10 ? '0' + date : date) +
146
- ' ' + (hour < 10 ? '0' + hour : hour) + ':' + (min < 10 ? '0' + min : min) + ':' + (sec < 10 ? '0' + sec : sec)
147
- },
148
-
149
- guid () {
150
- const buf = new Uint16Array(8)
151
- window.crypto.getRandomValues(buf)
152
- const S4 = function (num) {
153
- let ret = num.toString()
154
- while (ret.length < 4) {
155
- ret = '0' + ret
156
- }
157
- return ret
158
- }
159
- 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]))
160
- },
161
- required (param) {
162
- if (typeof param === 'number' && param === 0) {
163
- return false
164
- }
165
- if (!param) {
166
- return true
167
- }
168
- param = param + ''
169
- param = param.trim()
170
- return !param
171
- },
172
-
173
- isInt (n) {
174
- return !window.isNaN(n) && n % 1 === 0
175
- },
176
-
177
- // 不能选择器中截取掉多余的字符
178
- orgName (name) {
179
- return name.substring(10)
180
- },
181
-
182
- addDate (date, days) {
183
- // 求取当前时间的工具
184
- let endDate = new Date(date)
185
- endDate = endDate.valueOf()
186
- endDate = endDate + days * 24 * 60 * 60 * 1000
187
- endDate = new Date(endDate)
188
- const month = endDate.getMonth() + 1
189
- const day = endDate.getDate()
190
- const hour = endDate.getHours()
191
- const min = endDate.getMinutes()
192
- const sec = endDate.getSeconds()
193
- return endDate.getFullYear() + '-' + (month < 10 ? '0' + month : month) + '-' + (day < 10 ? '0' + day : day) +
194
- ' ' + (hour < 10 ? '0' + hour : hour) + ':' + (min < 10 ? '0' + min : min) + ':' + (sec < 10 ? '0' + sec : sec)
195
- // return a
196
- },
197
-
198
- // 对字符串进行加密
199
- compileStr (code) {
200
- let c = String.fromCharCode(code.charCodeAt(0) + code.length)
201
- for (let i = 1; i < code.length; i++) {
202
- c += String.fromCharCode(code.charCodeAt(i) + code.charCodeAt(i - 1))
203
- }
204
- return escape(c)
205
- },
206
-
207
- // 字符串进行解密
208
- uncompileStr (code) {
209
- code = unescape(code)
210
- let c = String.fromCharCode(code.charCodeAt(0) - code.length)
211
- for (let i = 1; i < code.length; i++) {
212
- c += String.fromCharCode(code.charCodeAt(i) - c.charCodeAt(i - 1))
213
- }
214
- return c
215
- }
216
- }
217
-
218
- export default GetLoginInfoService
219
- export {
220
- getResourceFunction
221
- }
1
+ import Vue from 'vue'
2
+ import { SEARCH } from '@vue2-client/services/api'
3
+ import { post } from '@vue2-client/services/api/restTools'
4
+
5
+ const loginGen = async function (response) {
6
+ Vue.$login.f = response
7
+ await Promise.all([Vue.$appdata.load(), getGasman(), getLic(), getViewDetails()])
8
+ const login = {
9
+ f: Vue.$login.f,
10
+ jwt: Vue.$login.f.id,
11
+ r: Vue.$login.r
12
+ }
13
+ Vue.$store.commit('account/setLogin', login)
14
+ }
15
+
16
+ /**
17
+ * 获取片区
18
+ * @returns {Promise<void>}
19
+ */
20
+ // eslint-disable-next-line
21
+ async function getAllArea () {
22
+ try {
23
+ const getAllArea = await post(SEARCH, {
24
+ source: 'this.getParentByType($organization$).getChildByName($片区$).getChildren()',
25
+ userid: Vue.$login.f.id
26
+ })
27
+ const areaTemp = []
28
+ for (let i = 0; i < getAllArea.length; i++) {
29
+ areaTemp.push({ label: getAllArea[i].name, value: getAllArea[i] })
30
+ }
31
+ Vue.$login.f.f_allArea = areaTemp
32
+ } catch (error) {
33
+ Vue.$login.f.f_allArea = []
34
+ console.log('获取片区异常', error)
35
+ }
36
+ }
37
+ /**
38
+ * 获取抄表员
39
+ * @returns {Promise<void>}
40
+ */
41
+ async function getGasman () {
42
+ try {
43
+ const getGasman = await post(SEARCH, {
44
+ source: 'this.getParentByType($organization$).getChildByName($抄表员$).getUsers()',
45
+ userid: Vue.$login.f.id
46
+ })
47
+ const gasman = []
48
+ for (let i = 0; i < getGasman.length; i++) {
49
+ gasman.push(getGasman[i])
50
+ }
51
+ Vue.$login.f.f_gasman = gasman
52
+ } catch (error) {
53
+ Vue.$login.f.f_gasman = []
54
+ console.log('获取抄表员异常', error)
55
+ }
56
+ }
57
+ /**
58
+ * 获取资源服务权限
59
+ * @returns {Promise<void>}
60
+ */
61
+ async function getLic () {
62
+ try {
63
+ const getLic = await post(SEARCH, { data: {
64
+ source: 'this.getRights().where(row.getType()==$function$ && row.getPath($name$).indexOf($资源操作$) != -1)',
65
+ userid: Vue.$login.f.id
66
+ } }, { resolveMsg: null, rejectMsg: null })
67
+ const arry = []
68
+ getLic.forEach((item) => {
69
+ arry.push(item.name)
70
+ })
71
+ Vue.$login.f.lics = arry
72
+ } catch (error) {
73
+ Vue.$login.f.f_gasman = []
74
+ console.log('获取资源服务权限异常', error)
75
+ }
76
+ }
77
+ /**
78
+ * 获取界面细节 (界面权限)
79
+ * @returns {Promise<void>}
80
+ */
81
+ async function getViewDetails () {
82
+ try {
83
+ const viewDetails = await post(SEARCH, {
84
+ source: 'this.getRights().where(row.getType()==$function$ && row.getPath($name$).indexOf($功能权限$) != -1)',
85
+ userid: Vue.$login.f.id
86
+ }, { resolveMsg: null, rejectMsg: null })
87
+ const r = viewDetails
88
+ Vue.$login.r = []
89
+ r.forEach(x => Vue.$login.r.push(x.name))
90
+ } catch (error) {
91
+ Vue.$login.r = []
92
+ console.log('获取界面细节异常', error)
93
+ }
94
+ }
95
+ /**
96
+ * 获取资源功能
97
+ * @returns {Promise<void>}
98
+ */
99
+ async function getResourceFunction () {
100
+ try {
101
+ const resourceFunction = await post(SEARCH, {
102
+ source: 'tool.getFullTree(this.getRights().where(row.getName() == $组织管理$||row.getName() == $功能管理$||row.getName() == $部门管理$ || row.getName() == $角色管理$ || row.getName() == $人员管理$|| row.getName() == $资源调配$ ))',
103
+ userid: Vue.$login.f.id
104
+ }, { resolveMsg: null, rejectMsg: null })
105
+ return resourceFunction
106
+ } catch (error) {
107
+ console.log('获取资源功能异常', error)
108
+ }
109
+ }
110
+
111
+ const GetLoginInfoService = {
112
+ install (Vue) {
113
+ // 给vue增添对话框显示方法
114
+ Vue.$login = Vue.prototype.$login = GetLoginInfoService
115
+ },
116
+
117
+ f: {
118
+
119
+ },
120
+
121
+ login (response) {
122
+ return loginGen(response)
123
+ },
124
+
125
+ convertToIn (val) {
126
+ let temp = ''
127
+ if (val instanceof Array) {
128
+ if (val.length >= 1) {
129
+ temp = '('
130
+ val.forEach((res) => {
131
+ temp += `'${res}',`
132
+ })
133
+ temp = temp.substr(0, temp.length - 1) + ')'
134
+ }
135
+ }
136
+ return temp
137
+ },
138
+ toStandardTimeString () {
139
+ const dt = new Date()
140
+ const month = dt.getMonth() + 1
141
+ const date = dt.getDate()
142
+ const hour = dt.getHours()
143
+ const min = dt.getMinutes()
144
+ const sec = dt.getSeconds()
145
+ return dt.getFullYear() + '-' + (month < 10 ? '0' + month : month) + '-' + (date < 10 ? '0' + date : date) +
146
+ ' ' + (hour < 10 ? '0' + hour : hour) + ':' + (min < 10 ? '0' + min : min) + ':' + (sec < 10 ? '0' + sec : sec)
147
+ },
148
+
149
+ guid () {
150
+ const buf = new Uint16Array(8)
151
+ window.crypto.getRandomValues(buf)
152
+ const S4 = function (num) {
153
+ let ret = num.toString()
154
+ while (ret.length < 4) {
155
+ ret = '0' + ret
156
+ }
157
+ return ret
158
+ }
159
+ 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]))
160
+ },
161
+ required (param) {
162
+ if (typeof param === 'number' && param === 0) {
163
+ return false
164
+ }
165
+ if (!param) {
166
+ return true
167
+ }
168
+ param = param + ''
169
+ param = param.trim()
170
+ return !param
171
+ },
172
+
173
+ isInt (n) {
174
+ return !window.isNaN(n) && n % 1 === 0
175
+ },
176
+
177
+ // 不能选择器中截取掉多余的字符
178
+ orgName (name) {
179
+ return name.substring(10)
180
+ },
181
+
182
+ addDate (date, days) {
183
+ // 求取当前时间的工具
184
+ let endDate = new Date(date)
185
+ endDate = endDate.valueOf()
186
+ endDate = endDate + days * 24 * 60 * 60 * 1000
187
+ endDate = new Date(endDate)
188
+ const month = endDate.getMonth() + 1
189
+ const day = endDate.getDate()
190
+ const hour = endDate.getHours()
191
+ const min = endDate.getMinutes()
192
+ const sec = endDate.getSeconds()
193
+ return endDate.getFullYear() + '-' + (month < 10 ? '0' + month : month) + '-' + (day < 10 ? '0' + day : day) +
194
+ ' ' + (hour < 10 ? '0' + hour : hour) + ':' + (min < 10 ? '0' + min : min) + ':' + (sec < 10 ? '0' + sec : sec)
195
+ // return a
196
+ },
197
+
198
+ // 对字符串进行加密
199
+ compileStr (code) {
200
+ let c = String.fromCharCode(code.charCodeAt(0) + code.length)
201
+ for (let i = 1; i < code.length; i++) {
202
+ c += String.fromCharCode(code.charCodeAt(i) + code.charCodeAt(i - 1))
203
+ }
204
+ return escape(c)
205
+ },
206
+
207
+ // 字符串进行解密
208
+ uncompileStr (code) {
209
+ code = unescape(code)
210
+ let c = String.fromCharCode(code.charCodeAt(0) - code.length)
211
+ for (let i = 1; i < code.length; i++) {
212
+ c += String.fromCharCode(code.charCodeAt(i) - c.charCodeAt(i - 1))
213
+ }
214
+ return c
215
+ }
216
+ }
217
+
218
+ export default GetLoginInfoService
219
+ export {
220
+ getResourceFunction
221
+ }
@@ -1,21 +1,21 @@
1
- import GetLoginInfoService from '@vue2-client/base-client/plugins/GetLoginInfoService'
2
- import GetAppDataService from '@vue2-client/base-client/plugins/AppData'
3
- import getConfig from '@vue2-client/base-client/plugins/Config'
4
- import moment from '@vue2-client/base-client/plugins/moment'
5
-
6
- import VueI18nPlugin from './i18n-extend'
7
- import AuthorityPlugin from './authority-plugin'
8
- import TabsPagePlugin from './tabs-page-plugin'
9
-
10
- const Plugins = {
11
- install: function (Vue) {
12
- Vue.use(GetLoginInfoService)
13
- Vue.use(GetAppDataService)
14
- Vue.use(getConfig)
15
- Vue.use(moment)
16
- Vue.use(VueI18nPlugin)
17
- Vue.use(AuthorityPlugin)
18
- Vue.use(TabsPagePlugin)
19
- }
20
- }
21
- export default Plugins
1
+ import GetLoginInfoService from '@vue2-client/base-client/plugins/GetLoginInfoService'
2
+ import GetAppDataService from '@vue2-client/base-client/plugins/AppData'
3
+ import getConfig from '@vue2-client/base-client/plugins/Config'
4
+ import moment from '@vue2-client/base-client/plugins/moment'
5
+
6
+ import VueI18nPlugin from './i18n-extend'
7
+ import AuthorityPlugin from './authority-plugin'
8
+ import TabsPagePlugin from './tabs-page-plugin'
9
+
10
+ const Plugins = {
11
+ install: function (Vue) {
12
+ Vue.use(GetLoginInfoService)
13
+ Vue.use(GetAppDataService)
14
+ Vue.use(getConfig)
15
+ Vue.use(moment)
16
+ Vue.use(VueI18nPlugin)
17
+ Vue.use(AuthorityPlugin)
18
+ Vue.use(TabsPagePlugin)
19
+ }
20
+ }
21
+ export default Plugins