vue2-client 1.1.0 → 1.2.2

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 (147) hide show
  1. package/.eslintrc.js +81 -81
  2. package/README.md +65 -63
  3. package/babel.config.js +15 -14
  4. package/docs/index.md +29 -29
  5. package/docs/notice.md +22 -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/assets/img/SunClientDownload.png +0 -0
  12. package/src/assets/img/SunClientManual/1.png +0 -0
  13. package/src/assets/img/SunClientManual/2.png +0 -0
  14. package/src/assets/img/SunClientManual/3.png +0 -0
  15. package/src/assets/img/SunClientManual/4.png +0 -0
  16. package/src/assets/img/ToDeskDownload.png +0 -0
  17. package/src/assets/img/ToDeskManual/1.png +0 -0
  18. package/src/assets/img/ToDeskManual/2.png +0 -0
  19. package/src/assets/img/ToDeskManual/3.png +0 -0
  20. package/src/assets/img/ToDeskManual/4.png +0 -0
  21. package/src/assets/sound/newNote.mp3 +0 -0
  22. package/src/base-client/all.js +57 -57
  23. package/src/base-client/components/common/CreateQuery/CreateQuery.vue +1157 -1159
  24. package/src/base-client/components/common/CreateQuery/index.md +1 -1
  25. package/src/base-client/components/common/CreateSimpleFormQuery/CreateSimpleFormQuery.vue +540 -540
  26. package/src/base-client/components/common/CreateSimpleFormQuery/index.md +1 -1
  27. package/src/base-client/components/common/CustomColumnsDrawer/index.md +1 -1
  28. package/src/base-client/components/common/FormGroupEdit/FormGroupEdit.vue +150 -150
  29. package/src/base-client/components/common/FormGroupEdit/index.md +1 -1
  30. package/src/base-client/components/common/FormGroupQuery/index.md +1 -1
  31. package/src/base-client/components/common/XAddForm/XAddForm.vue +323 -323
  32. package/src/base-client/components/common/XAddForm/index.md +1 -1
  33. package/src/base-client/components/common/XBadge/index.md +1 -1
  34. package/src/base-client/components/common/XCard/index.md +1 -1
  35. package/src/base-client/components/common/XForm/XForm.vue +275 -275
  36. package/src/base-client/components/common/XForm/XFormItem.vue +217 -217
  37. package/src/base-client/components/common/XForm/index.md +196 -196
  38. package/src/base-client/components/common/XFormCol/index.md +1 -1
  39. package/src/base-client/components/common/XFormTable/XFormTable.vue +407 -405
  40. package/src/base-client/components/common/XFormTable/index.md +3 -3
  41. package/src/base-client/components/common/XTable/XTable.vue +262 -262
  42. package/src/base-client/components/common/XTable/index.md +255 -255
  43. package/src/base-client/components/common/XTreeOne/XTreeOne.vue +1 -1
  44. package/src/base-client/components/iot/CustomerDetailsView/CustomerDetailsView.vue +226 -226
  45. package/src/base-client/components/iot/CustomerDetailsView/index.md +2 -2
  46. package/src/base-client/components/iot/DataAnalysisUser/DataAnalysisUser.vue +1 -1
  47. package/src/base-client/components/iot/DataAnalysisViewGD/DataAnalysisViewGD.vue +548 -548
  48. package/src/base-client/components/iot/DeviceBrandDetailsView/DeviceBrandDetailsView.vue +453 -453
  49. package/src/base-client/components/iot/DeviceDetailsView/DeviceDetailsView.vue +231 -231
  50. package/src/base-client/components/iot/DeviceDetailsView/index.md +1 -1
  51. package/src/base-client/components/iot/DeviceDetailsView/part/DeviceDetailsCount.vue +330 -330
  52. package/src/base-client/components/iot/DeviceDetailsView/part/DeviceDetailsException.vue +1 -1
  53. package/src/base-client/components/iot/DeviceDetailsView/part/DeviceDetailsInstruct.vue +3 -3
  54. package/src/base-client/components/iot/DeviceDetailsView/part/DeviceDetailsInstructOperate.vue +122 -122
  55. package/src/base-client/components/iot/DeviceDetailsView/part/DeviceDetailsMain.vue +1 -1
  56. package/src/base-client/components/iot/DeviceDetailsView/part/DeviceDetailsRead.vue +3 -3
  57. package/src/base-client/components/iot/DeviceTypeDetailsView/DeviceTypeDetailsView.vue +277 -277
  58. package/src/base-client/components/iot/InstructDetailsView/InstructDetailsView.vue +472 -472
  59. package/src/base-client/components/iot/InstructDetailsView/index.md +1 -1
  60. package/src/base-client/components/iot/LogDetailsView/LogDetailsView.vue +380 -380
  61. package/src/base-client/components/iot/LogDetailsView/index.md +1 -1
  62. package/src/base-client/components/iot/MeterDetailsView/MeterDetailsView.vue +360 -360
  63. package/src/base-client/components/iot/MeterDetailsView/index.md +1 -1
  64. package/src/base-client/components/iot/MeterDetailsView/part/MeterDetailsCount.vue +335 -335
  65. package/src/base-client/components/iot/MeterDetailsView/part/MeterDetailsException.vue +185 -185
  66. package/src/base-client/components/iot/MeterDetailsView/part/MeterDetailsHandPlan.vue +292 -292
  67. package/src/base-client/components/iot/MeterDetailsView/part/MeterDetailsInstruct.vue +237 -237
  68. package/src/base-client/components/iot/MeterDetailsView/part/MeterDetailsMain.vue +257 -257
  69. package/src/base-client/components/iot/MeterDetailsView/part/MeterDetailsSellGas.vue +190 -190
  70. package/src/base-client/components/iot/WebmeterAnalysisView/WebmeterAnalysisView.vue +723 -723
  71. package/src/base-client/components/iot/WebmeterAnalysisView/index.md +1 -1
  72. package/src/base-client/components/system/DictionaryDetailsView/DictionaryDetailsView.vue +232 -232
  73. package/src/base-client/components/system/DictionaryDetailsView/index.md +1 -1
  74. package/src/base-client/components/system/QueryParamsDetailsView/QueryParamsDetailsView.vue +248 -248
  75. package/src/base-client/components/ticket/EmployeeDetailsView/EmployeeDetailsView.vue +371 -406
  76. package/src/base-client/components/ticket/TicketDetailsView/TicketDetailsView.vue +838 -486
  77. package/src/base-client/components/ticket/TicketDetailsView/part/TicketDetailsFlow.vue +261 -184
  78. package/src/base-client/components/ticket/TicketSubmitSuccessView/TicketSubmitSuccessView.vue +528 -303
  79. package/src/base-client/plugins/AppData.js +69 -69
  80. package/src/base-client/plugins/GetLoginInfoService.js +221 -221
  81. package/src/base-client/plugins/index.js +21 -21
  82. package/src/bootstrap.js +27 -27
  83. package/src/components/Ellipsis/Ellipsis.vue +1 -1
  84. package/src/components/Ellipsis/index.md +2 -2
  85. package/src/components/NumberInfo/index.md +1 -1
  86. package/src/components/STable/README.md +3 -3
  87. package/src/components/Trend/index.md +1 -1
  88. package/src/components/cache/AKeepAlive.js +1 -1
  89. package/src/components/checkbox/index.js +2 -2
  90. package/src/components/index.js +15 -15
  91. package/src/components/menu/menu.js +1 -1
  92. package/src/components/setting/Setting.vue +4 -4
  93. package/src/components/table/advance/AdvanceTable.vue +3 -3
  94. package/src/components/transition/PageToggleTransition.vue +1 -1
  95. package/src/config/default/setting.config.js +33 -33
  96. package/src/layouts/CommonLayout.vue +1 -1
  97. package/src/layouts/ComponentLayoutOne.vue +47 -47
  98. package/src/layouts/PageLayout.vue +2 -2
  99. package/src/layouts/SinglePageView.vue +1 -1
  100. package/src/layouts/header/AdminHeader.vue +2 -2
  101. package/src/layouts/header/HeaderAvatar.vue +1 -1
  102. package/src/layouts/header/HeaderNotice.vue +97 -97
  103. package/src/layouts/tabs/TabsHead.vue +1 -1
  104. package/src/layouts/tabs/TabsView.vue +6 -6
  105. package/src/main.js +20 -20
  106. package/src/mock/common/reportData.js +20 -20
  107. package/src/mock/goods/index.js +2 -2
  108. package/src/mock/index.js +6 -6
  109. package/src/mock/project/index.js +1 -1
  110. package/src/mock/user/current.js +1 -1
  111. package/src/mock/user/login.js +1 -1
  112. package/src/mock/user/routes.js +61 -61
  113. package/src/mock/workplace/index.js +1 -1
  114. package/src/pages/exception/403.vue +25 -25
  115. package/src/pages/exception/404.vue +25 -25
  116. package/src/pages/exception/500.vue +25 -25
  117. package/src/pages/login/Login.vue +194 -194
  118. package/src/pages/report/ReportTable.js +125 -125
  119. package/src/pages/report/ReportTableHome.vue +28 -28
  120. package/src/pages/resourceManage/resourceManageMain.vue +55 -55
  121. package/src/pages/system/applyInstallView/Core.vue +1 -1
  122. package/src/pages/system/applyInstallView/index.vue +1 -1
  123. package/src/pages/system/dictionary/index.vue +1 -1
  124. package/src/pages/system/queryParams/index.vue +1 -1
  125. package/src/router/async/config.async.js +1 -1
  126. package/src/router/async/router.map.js +59 -59
  127. package/src/router/guards.js +3 -3
  128. package/src/router/index.js +27 -27
  129. package/src/services/api/EmployeeDetailsViewApi.js +3 -1
  130. package/src/services/api/TicketDetailsViewApi.js +9 -1
  131. package/src/services/api/common.js +37 -39
  132. package/src/services/api/restTools.js +23 -23
  133. package/src/services/dataSource.js +1 -1
  134. package/src/services/user.js +2 -2
  135. package/src/store/index.js +5 -5
  136. package/src/store/modules/setting.js +5 -5
  137. package/src/theme/index.less +5 -5
  138. package/src/theme/reportTable.less +58 -58
  139. package/src/utils/i18n.js +2 -2
  140. package/src/utils/indexedDB.js +146 -146
  141. package/src/utils/request.js +197 -197
  142. package/src/utils/routerUtil.js +18 -5
  143. package/tests/unit/ReportTable.spec.js +15 -15
  144. package/vue.config.js +153 -152
  145. package/webpack.config.js +12 -12
  146. package/src/index.js +0 -28
  147. 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,221 +1,221 @@
1
- import Vue from 'vue'
2
- import { SEARCH } from '@/services/api'
3
- import { post } from '@/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 '@/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