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