vue2-client 1.8.166 → 1.8.167

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 (167) hide show
  1. package/.env +19 -19
  2. package/.eslintrc.js +90 -90
  3. package/CHANGELOG.md +824 -824
  4. package/Components.md +60 -60
  5. package/babel.config.js +21 -21
  6. package/docs/index.md +30 -30
  7. package/index.js +31 -31
  8. package/jest-transform-stub.js +8 -8
  9. package/jest.config.js +21 -21
  10. package/jest.setup.js +7 -7
  11. package/package.json +97 -97
  12. package/public/index.html +27 -27
  13. package/src/App.vue +164 -164
  14. package/src/ReportView.js +19 -19
  15. package/src/assets/img/querySlotDemo.svg +15 -15
  16. package/src/assets/svg/badtwo.svg +1 -1
  17. package/src/assets/svg/goodtwo.svg +1 -1
  18. package/src/base-client/components/common/AMisRender/index.js +3 -3
  19. package/src/base-client/components/common/AMisRender/index.vue +263 -263
  20. package/src/base-client/components/common/AddressSearchCombobox/AddressSearchCombobox.vue +316 -316
  21. package/src/base-client/components/common/AmapMarker/AmapPointRendering.vue +120 -120
  22. package/src/base-client/components/common/CitySelect/index.js +3 -3
  23. package/src/base-client/components/common/CitySelect/index.md +109 -109
  24. package/src/base-client/components/common/CreateQuery/CreateQuery.vue +669 -669
  25. package/src/base-client/components/common/CreateQuery/CreateQueryItem.vue +1014 -1014
  26. package/src/base-client/components/common/CreateQuery/index.js +3 -3
  27. package/src/base-client/components/common/CreateQuery/index.md +42 -42
  28. package/src/base-client/components/common/CreateSimpleFormQuery/CreateSimpleFormQuery.vue +452 -452
  29. package/src/base-client/components/common/CreateSimpleFormQuery/CreateSimpleFormQueryItem.vue +511 -511
  30. package/src/base-client/components/common/CreateSimpleFormQuery/index.js +3 -3
  31. package/src/base-client/components/common/CreateSimpleFormQuery/index.md +42 -42
  32. package/src/base-client/components/common/FormGroupEdit/FormGroupEdit.vue +149 -149
  33. package/src/base-client/components/common/FormGroupEdit/index.js +3 -3
  34. package/src/base-client/components/common/FormGroupEdit/index.md +43 -43
  35. package/src/base-client/components/common/FormGroupQuery/FormGroupQuery.vue +166 -166
  36. package/src/base-client/components/common/FormGroupQuery/index.js +3 -3
  37. package/src/base-client/components/common/FormGroupQuery/index.md +43 -43
  38. package/src/base-client/components/common/JSONToTree/jsontotree.vue +271 -271
  39. package/src/base-client/components/common/PersonSetting/PersonSetting.vue +208 -208
  40. package/src/base-client/components/common/PersonSetting/index.js +3 -3
  41. package/src/base-client/components/common/Tree/Tree.vue +149 -149
  42. package/src/base-client/components/common/Tree/index.js +2 -2
  43. package/src/base-client/components/common/Upload/Upload.vue +197 -197
  44. package/src/base-client/components/common/Upload/index.js +3 -3
  45. package/src/base-client/components/common/XAddForm/XAddForm.vue +92 -92
  46. package/src/base-client/components/common/XAddNativeForm/XAddNativeForm.vue +502 -502
  47. package/src/base-client/components/common/XAddNativeForm/index.md +146 -146
  48. package/src/base-client/components/common/XAddNativeFormOA/XAddNativeFormOA.vue +303 -303
  49. package/src/base-client/components/common/XAddNativeFormOA/index.js +3 -3
  50. package/src/base-client/components/common/XAddNativeFormOA/index.md +146 -146
  51. package/src/base-client/components/common/XBadge/XBadge.vue +78 -78
  52. package/src/base-client/components/common/XCard/XCard.vue +64 -64
  53. package/src/base-client/components/common/XDataDrawer/XDataDrawer.vue +180 -180
  54. package/src/base-client/components/common/XDataDrawer/index.js +3 -3
  55. package/src/base-client/components/common/XDataDrawer/index.md +41 -41
  56. package/src/base-client/components/common/XDescriptions/XDescriptions.vue +117 -117
  57. package/src/base-client/components/common/XDescriptions/index.js +3 -3
  58. package/src/base-client/components/common/XDescriptions/index.md +83 -83
  59. package/src/base-client/components/common/XForm/XForm.vue +253 -253
  60. package/src/base-client/components/common/XForm/XFormItem.vue +545 -545
  61. package/src/base-client/components/common/XForm/XTreeSelect.vue +191 -191
  62. package/src/base-client/components/common/XForm/index.md +178 -178
  63. package/src/base-client/components/common/XFormCol/XFormCol.vue +38 -38
  64. package/src/base-client/components/common/XFormTable/XFormTable.vue +418 -418
  65. package/src/base-client/components/common/XFormTable/index.md +98 -98
  66. package/src/base-client/components/common/XImportExcel/XImportExcel.vue +131 -131
  67. package/src/base-client/components/common/XReport/XReport.vue +694 -694
  68. package/src/base-client/components/common/XReport/XReportDesign.vue +423 -414
  69. package/src/base-client/components/common/XReport/XReportTrGroup.vue +602 -596
  70. package/src/base-client/components/common/XReport/index.js +3 -3
  71. package/src/base-client/components/common/XReport/index.md +44 -44
  72. package/src/base-client/components/common/XReportSlot/XReportSlot.vue +110 -110
  73. package/src/base-client/components/common/XReportSlot/index.js +3 -3
  74. package/src/base-client/components/common/XStepView/XStepView.vue +252 -252
  75. package/src/base-client/components/common/XStepView/index.js +3 -3
  76. package/src/base-client/components/common/XStepView/index.md +31 -31
  77. package/src/base-client/components/common/XTable/XTable.vue +549 -549
  78. package/src/base-client/components/common/XTable/index.md +255 -255
  79. package/src/base-client/components/common/XTree/XTree.vue +76 -76
  80. package/src/base-client/components/common/XTree/index.js +3 -3
  81. package/src/base-client/components/common/XTree/index.md +36 -36
  82. package/src/base-client/components/index.js +47 -47
  83. package/src/base-client/components/system/DictionaryDetailsView/DictionaryDetailsView.vue +232 -232
  84. package/src/base-client/components/system/QueryParamsDetailsView/QueryParamsDetailsView.vue +281 -281
  85. package/src/base-client/plugins/AppData.js +115 -115
  86. package/src/base-client/plugins/Config.js +19 -19
  87. package/src/base-client/plugins/GetLoginInfoService.js +182 -182
  88. package/src/base-client/plugins/tabs-page-plugin.js +39 -39
  89. package/src/bootstrap.js +39 -39
  90. package/src/components/CodeMirror/inedx.vue +118 -118
  91. package/src/components/CodeMirror/setting.js +40 -40
  92. package/src/components/FilePreview/FilePreview.vue +166 -166
  93. package/src/components/NumberInfo/NumberInfo.vue +54 -54
  94. package/src/components/STable/index.js +323 -323
  95. package/src/components/checkbox/ColorCheckbox.vue +157 -157
  96. package/src/components/checkbox/ImgCheckbox.vue +163 -163
  97. package/src/components/menu/SideMenu.vue +75 -75
  98. package/src/components/menu/menu.js +273 -273
  99. package/src/components/tool/AStepItem.vue +60 -60
  100. package/src/config/CreateQueryConfig.js +322 -322
  101. package/src/config/default/antd.config.js +89 -89
  102. package/src/config/default/setting.config.js +53 -53
  103. package/src/font-style/font.css +4 -4
  104. package/src/layouts/CommonLayout.vue +56 -56
  105. package/src/layouts/PageLayout.vue +151 -151
  106. package/src/layouts/SinglePageView.vue +138 -138
  107. package/src/layouts/header/AdminHeader.vue +132 -132
  108. package/src/layouts/header/HeaderNotice.vue +177 -177
  109. package/src/layouts/tabs/TabsHead.vue +189 -189
  110. package/src/layouts/tabs/TabsView.vue +387 -387
  111. package/src/lib.js +1 -1
  112. package/src/main.js +26 -26
  113. package/src/mock/extend/index.js +84 -84
  114. package/src/mock/goods/index.js +108 -108
  115. package/src/pages/AMisDemo/AMisDemo.vue +325 -325
  116. package/src/pages/AMisDemo/AMisDemo2.vue +74 -74
  117. package/src/pages/DynamicStatistics/ChartSelector.vue +331 -331
  118. package/src/pages/DynamicStatistics/DataTabs.vue +83 -83
  119. package/src/pages/DynamicStatistics/DynamicTable.vue +128 -128
  120. package/src/pages/DynamicStatistics/EvaluationArea.vue +69 -69
  121. package/src/pages/DynamicStatistics/FavoriteList.vue +51 -51
  122. package/src/pages/DynamicStatistics/QuestionHistoryAndFavorites.vue +591 -591
  123. package/src/pages/DynamicStatistics/SearchBar.vue +192 -192
  124. package/src/pages/DynamicStatistics/index.vue +282 -282
  125. package/src/pages/Example/index.vue +1432 -1305
  126. package/src/pages/ServiceReview/index.vue +284 -284
  127. package/src/pages/XReportView/index.vue +62 -62
  128. package/src/pages/login/Login.vue +378 -378
  129. package/src/pages/login/LoginV3.vue +389 -389
  130. package/src/pages/resourceManage/orgListManage.vue +98 -98
  131. package/src/pages/system/dictionary/index.vue +44 -44
  132. package/src/pages/system/monitor/loginInfor/index.vue +37 -37
  133. package/src/pages/system/monitor/operLog/index.vue +37 -37
  134. package/src/pages/system/settings/modifyPassword.vue +117 -117
  135. package/src/pages/system/ticket/index.vue +480 -480
  136. package/src/pages/system/ticket/submitTicketSuccess.vue +484 -484
  137. package/src/router/async/config.async.js +32 -32
  138. package/src/router/async/router.map.js +98 -98
  139. package/src/router/guards.js +214 -214
  140. package/src/router/index.js +27 -27
  141. package/src/router.js +18 -18
  142. package/src/services/api/TicketDetailsViewApi.js +46 -46
  143. package/src/services/api/cas.js +79 -79
  144. package/src/services/api/common.js +274 -274
  145. package/src/services/api/entity.js +18 -18
  146. package/src/services/api/index.js +17 -17
  147. package/src/services/api/restTools.js +46 -46
  148. package/src/services/apiService.js +14 -14
  149. package/src/services/user.js +71 -71
  150. package/src/store/modules/setting.js +119 -119
  151. package/src/theme/default/style.less +57 -57
  152. package/src/utils/authority-utils.js +85 -85
  153. package/src/utils/errorCode.js +6 -6
  154. package/src/utils/htmlToPDF.js +108 -108
  155. package/src/utils/htmlToPDFApi.js +5 -5
  156. package/src/utils/indexedDB.js +201 -201
  157. package/src/utils/login.js +141 -141
  158. package/src/utils/map-utils.js +47 -47
  159. package/src/utils/request.js +343 -343
  160. package/src/utils/routerUtil.js +428 -428
  161. package/src/utils/util.js +231 -231
  162. package/src/utils/waterMark.js +31 -31
  163. package/test/Amis.spec.js +163 -163
  164. package/test/Tree.spec.js +167 -167
  165. package/test/myDialog.spec.js +46 -46
  166. package/vue.config.js +166 -166
  167. package//350/277/201/347/247/273/346/227/245/345/277/227.md +15 -15
@@ -1,274 +1,274 @@
1
- import { indexedDB } from '@vue2-client/utils/indexedDB'
2
- import notification from 'ant-design-vue/lib/notification'
3
- import message from 'ant-design-vue/lib/message'
4
- import { blobValidate } from '@vue2-client/utils/common'
5
- import errorCode from '@vue2-client/utils/errorCode'
6
- import { saveAs } from 'file-saver'
7
- import { post } from '@vue2-client/services/api/restTools'
8
-
9
- const commonApi = {
10
- // 获取配置
11
- getConfig: 'logic/openapi/getLiuliConfiguration',
12
- // 获取原生配置
13
- getNativeConfig: 'logic/openapi/getLiuliNativeConfiguration',
14
- // 配置解析
15
- parseConfig: 'logic/parseConfig',
16
- // 通用查询
17
- query: 'logic/commonQuery',
18
- // 表单查询
19
- queryWithResource: 'logic/commonQueryWithResource',
20
- // 通用新增/修改
21
- addOrModify: 'logic/commonAddOrModify',
22
- // 通用删除
23
- delete: 'logic/commonDelete',
24
- // 导入数据
25
- importData: 'crud/importDataByExcel',
26
- // 导出数据
27
- exportData: 'logic/commonExport',
28
- // 导入模板下载
29
- downloadImportTemplate: 'logic/commonDownloadImportTemplate',
30
- // 下载数据
31
- download: 'resource/download',
32
- // 通用上传
33
- upload: 'resource/upload',
34
- // 文件实体操作
35
- fileEntity: 'entity/t_files',
36
- // 获取所有员工及其部门的级联菜单数据
37
- getEmpTree: '/api/af-system/logic/getEmpTree',
38
- // 获取表格列配置
39
- getColumnsJson: '/api/af-system/logic/getColumns',
40
- }
41
-
42
- /**
43
- * 获取字典键参数
44
- */
45
- export function getDictionaryParam (isDev) {
46
- let apiPre = '/api/'
47
- if (isDev) {
48
- apiPre = '/devApi/'
49
- }
50
- return post(apiPre + 'af-system/logic/getDictionaryParam', {})
51
- }
52
-
53
- /**
54
- * 根据配置名获取配置内容
55
- * @param content 已有的配置内容
56
- * @param configName 配置名称
57
- * @param serviceName 命名空间名称
58
- * @param callback 回调函数
59
- * @param isDev 是否为开发环境
60
- */
61
- export function getConfig (content, configName, serviceName = process.env.VUE_APP_SYSTEM_NAME, callback, isDev) {
62
- if (content) {
63
- return content
64
- }
65
- let apiPre = '/api/'
66
- if (isDev) {
67
- apiPre = '/devApi/'
68
- }
69
- const getConfigUrl = apiPre + serviceName + '/' + commonApi.getConfig
70
- indexedDB.getByWeb(configName, getConfigUrl, { configName: configName }, callback)
71
- }
72
-
73
- export function getConfigByName (configName, serviceName = process.env.VUE_APP_SYSTEM_NAME, callback, isDev) {
74
- return getConfig(undefined, configName, serviceName, callback, isDev)
75
- }
76
-
77
- export function getNativeConfig (configName, serviceName = process.env.VUE_APP_SYSTEM_NAME, isDev) {
78
- let apiPre = '/api/'
79
- if (isDev) {
80
- apiPre = '/devApi/'
81
- }
82
- const getConfigUrl = apiPre + serviceName + '/' + commonApi.getNativeConfig
83
- return post(getConfigUrl, { configName: configName })
84
- }
85
-
86
- /**
87
- * 调用Logic获取配置内容
88
- * @param logicName Logic名称
89
- * @param parameter Logic调用参数
90
- * @param serviceName 命名空间名称
91
- * @param callback 回调函数
92
- * @param isDev 是否是开发环境
93
- */
94
- export function getConfigByLogic (logicName, parameter, serviceName = process.env.VUE_APP_SYSTEM_NAME, callback, isDev) {
95
- let apiPre = '/api/'
96
- if (isDev) {
97
- apiPre = '/devApi/'
98
- }
99
- indexedDB.getByWeb(`${logicName}_${JSON.stringify(parameter)}`, apiPre + serviceName + '/logic/' + logicName,
100
- parameter, callback)
101
- }
102
-
103
- /**
104
- * 配置解析
105
- * @param configContent 原配置内容
106
- * @param configType 配置类型
107
- * @param serviceName 命名空间名称
108
- * @param isDev 是否是开发环境
109
- */
110
- export function parseConfig (configContent, configType, serviceName = process.env.VUE_APP_SYSTEM_NAME, isDev) {
111
- let apiPre = '/api/'
112
- if (isDev) {
113
- apiPre = '/devApi/'
114
- }
115
- const url = apiPre + serviceName + '/' + commonApi.parseConfig
116
- return post(url, {
117
- configType: configType,
118
- configContent: configContent
119
- })
120
- }
121
-
122
- /**
123
- * 通用执行业务逻辑
124
- */
125
- export function runLogic (logicName, parameter, serviceName = process.env.VUE_APP_SYSTEM_NAME, isDev) {
126
- let apiPre = '/api/'
127
- if (isDev) {
128
- apiPre = '/devApi/'
129
- }
130
- return post(apiPre + serviceName + '/logic/' + logicName, parameter)
131
- }
132
-
133
- /**
134
- * 通用查询
135
- */
136
- export function query (parameter, serviceName = process.env.VUE_APP_SYSTEM_NAME, isDev) {
137
- let apiPre = '/api/'
138
- if (isDev) {
139
- apiPre = '/devApi/'
140
- }
141
- return post(apiPre + serviceName + '/' + commonApi.query, parameter, null)
142
- }
143
-
144
- /**
145
- * 通用表单查询
146
- */
147
- export function queryWithResource (parameter, serviceName = process.env.VUE_APP_SYSTEM_NAME, isDev) {
148
- let apiPre = '/api/'
149
- if (isDev) {
150
- apiPre = '/devApi/'
151
- }
152
- return post(apiPre + serviceName + '/' + commonApi.queryWithResource, parameter, null)
153
- }
154
-
155
- /**
156
- * 通用新增/修改
157
- */
158
- export function addOrModify (parameter, serviceName = process.env.VUE_APP_SYSTEM_NAME, isDev) {
159
- let apiPre = '/api/'
160
- if (isDev) {
161
- apiPre = '/devApi/'
162
- }
163
- return post(apiPre + serviceName + '/' + commonApi.addOrModify, parameter, null)
164
- }
165
-
166
- /**
167
- * 通用删除
168
- */
169
- export function remove (parameter, serviceName = process.env.VUE_APP_SYSTEM_NAME, isDev) {
170
- let apiPre = '/api/'
171
- if (isDev) {
172
- apiPre = '/devApi/'
173
- }
174
- return post(apiPre + serviceName + '/' + commonApi.delete, parameter, null)
175
- }
176
-
177
- /**
178
- * 通用导入
179
- */
180
- export function importData (parameter, serviceName = process.env.VUE_APP_SYSTEM_NAME, isDev) {
181
- let apiPre = '/api/'
182
- if (isDev) {
183
- apiPre = '/devApi/'
184
- }
185
- return post(apiPre + serviceName + '/' + commonApi.importData, parameter, null)
186
- }
187
-
188
- /**
189
- * 通用导出
190
- */
191
- export function exportData (parameter, serviceName = process.env.VUE_APP_SYSTEM_NAME, isDev) {
192
- let apiPre = '/api/'
193
- if (isDev) {
194
- apiPre = '/devApi/'
195
- }
196
- return post(apiPre + serviceName + '/' + commonApi.exportData, parameter, null)
197
- }
198
-
199
- /**
200
- * 通用上传
201
- */
202
- export function upload (parameter, serviceName = process.env.VUE_APP_SYSTEM_NAME, config, isDev) {
203
- let apiPre = '/api/'
204
- if (isDev) {
205
- apiPre = '/devApi/'
206
- }
207
- return post(apiPre + serviceName + '/' + commonApi.upload, parameter, config)
208
- }
209
-
210
- /**
211
- * 通用导入模板下载
212
- */
213
- export function downloadImportExcel (parameter, serviceName = process.env.VUE_APP_SYSTEM_NAME, isDev) {
214
- let apiPre = '/api/'
215
- if (isDev) {
216
- apiPre = '/devApi/'
217
- }
218
- return post(apiPre + serviceName + '/' + commonApi.downloadImportTemplate, parameter, null)
219
- }
220
-
221
- // 通用下载
222
- export function download (parameter, filename, serviceName = process.env.VUE_APP_SYSTEM_NAME, isDev) {
223
- let apiPre = '/api/'
224
- if (isDev) {
225
- apiPre = '/devApi/'
226
- }
227
- const notificationKey = 'download'
228
- notification.open({
229
- key: notificationKey,
230
- message: '正在下载数据,请稍候',
231
- duration: null,
232
- icon: h => {
233
- return h(
234
- 'a-icon',
235
- {
236
- props: {
237
- type: 'loading'
238
- }
239
- }
240
- )
241
- }
242
- })
243
- return post(apiPre + serviceName + '/' + commonApi.download, parameter, {
244
- responseType: 'blob'
245
- }).then(async (data) => {
246
- const isLogin = await blobValidate(data)
247
- if (isLogin) {
248
- const blob = new Blob([data])
249
- saveAs(blob, filename)
250
- message.success('下载成功')
251
- } else {
252
- const resText = await data.text()
253
- const rspObj = JSON.parse(resText)
254
- const errMsg = errorCode[rspObj.code] || rspObj.msg || errorCode.default
255
- message.error(errMsg)
256
- }
257
- notification.close(notificationKey)
258
- }).catch((r) => {
259
- message.error('功能尚未实现,敬请期待!')
260
- // message.error('下载文件出现错误,请联系管理员!')
261
- notification.close(notificationKey)
262
- })
263
- }
264
-
265
- // 文件删除
266
- export function fileDelete (parameter, serviceName = process.env.VUE_APP_SYSTEM_NAME, isDev) {
267
- let apiPre = '/api/'
268
- if (isDev) {
269
- apiPre = '/devApi/'
270
- }
271
- return post(apiPre + serviceName + '/' + commonApi.fileEntity, parameter)
272
- }
273
-
274
- export { commonApi }
1
+ import { indexedDB } from '@vue2-client/utils/indexedDB'
2
+ import notification from 'ant-design-vue/lib/notification'
3
+ import message from 'ant-design-vue/lib/message'
4
+ import { blobValidate } from '@vue2-client/utils/common'
5
+ import errorCode from '@vue2-client/utils/errorCode'
6
+ import { saveAs } from 'file-saver'
7
+ import { post } from '@vue2-client/services/api/restTools'
8
+
9
+ const commonApi = {
10
+ // 获取配置
11
+ getConfig: 'logic/openapi/getLiuliConfiguration',
12
+ // 获取原生配置
13
+ getNativeConfig: 'logic/openapi/getLiuliNativeConfiguration',
14
+ // 配置解析
15
+ parseConfig: 'logic/parseConfig',
16
+ // 通用查询
17
+ query: 'logic/commonQuery',
18
+ // 表单查询
19
+ queryWithResource: 'logic/commonQueryWithResource',
20
+ // 通用新增/修改
21
+ addOrModify: 'logic/commonAddOrModify',
22
+ // 通用删除
23
+ delete: 'logic/commonDelete',
24
+ // 导入数据
25
+ importData: 'crud/importDataByExcel',
26
+ // 导出数据
27
+ exportData: 'logic/commonExport',
28
+ // 导入模板下载
29
+ downloadImportTemplate: 'logic/commonDownloadImportTemplate',
30
+ // 下载数据
31
+ download: 'resource/download',
32
+ // 通用上传
33
+ upload: 'resource/upload',
34
+ // 文件实体操作
35
+ fileEntity: 'entity/t_files',
36
+ // 获取所有员工及其部门的级联菜单数据
37
+ getEmpTree: '/api/af-system/logic/getEmpTree',
38
+ // 获取表格列配置
39
+ getColumnsJson: '/api/af-system/logic/getColumns',
40
+ }
41
+
42
+ /**
43
+ * 获取字典键参数
44
+ */
45
+ export function getDictionaryParam (isDev) {
46
+ let apiPre = '/api/'
47
+ if (isDev) {
48
+ apiPre = '/devApi/'
49
+ }
50
+ return post(apiPre + 'af-system/logic/getDictionaryParam', {})
51
+ }
52
+
53
+ /**
54
+ * 根据配置名获取配置内容
55
+ * @param content 已有的配置内容
56
+ * @param configName 配置名称
57
+ * @param serviceName 命名空间名称
58
+ * @param callback 回调函数
59
+ * @param isDev 是否为开发环境
60
+ */
61
+ export function getConfig (content, configName, serviceName = process.env.VUE_APP_SYSTEM_NAME, callback, isDev) {
62
+ if (content) {
63
+ return content
64
+ }
65
+ let apiPre = '/api/'
66
+ if (isDev) {
67
+ apiPre = '/devApi/'
68
+ }
69
+ const getConfigUrl = apiPre + serviceName + '/' + commonApi.getConfig
70
+ indexedDB.getByWeb(configName, getConfigUrl, { configName: configName }, callback)
71
+ }
72
+
73
+ export function getConfigByName (configName, serviceName = process.env.VUE_APP_SYSTEM_NAME, callback, isDev) {
74
+ return getConfig(undefined, configName, serviceName, callback, isDev)
75
+ }
76
+
77
+ export function getNativeConfig (configName, serviceName = process.env.VUE_APP_SYSTEM_NAME, isDev) {
78
+ let apiPre = '/api/'
79
+ if (isDev) {
80
+ apiPre = '/devApi/'
81
+ }
82
+ const getConfigUrl = apiPre + serviceName + '/' + commonApi.getNativeConfig
83
+ return post(getConfigUrl, { configName: configName })
84
+ }
85
+
86
+ /**
87
+ * 调用Logic获取配置内容
88
+ * @param logicName Logic名称
89
+ * @param parameter Logic调用参数
90
+ * @param serviceName 命名空间名称
91
+ * @param callback 回调函数
92
+ * @param isDev 是否是开发环境
93
+ */
94
+ export function getConfigByLogic (logicName, parameter, serviceName = process.env.VUE_APP_SYSTEM_NAME, callback, isDev) {
95
+ let apiPre = '/api/'
96
+ if (isDev) {
97
+ apiPre = '/devApi/'
98
+ }
99
+ indexedDB.getByWeb(`${logicName}_${JSON.stringify(parameter)}`, apiPre + serviceName + '/logic/' + logicName,
100
+ parameter, callback)
101
+ }
102
+
103
+ /**
104
+ * 配置解析
105
+ * @param configContent 原配置内容
106
+ * @param configType 配置类型
107
+ * @param serviceName 命名空间名称
108
+ * @param isDev 是否是开发环境
109
+ */
110
+ export function parseConfig (configContent, configType, serviceName = process.env.VUE_APP_SYSTEM_NAME, isDev) {
111
+ let apiPre = '/api/'
112
+ if (isDev) {
113
+ apiPre = '/devApi/'
114
+ }
115
+ const url = apiPre + serviceName + '/' + commonApi.parseConfig
116
+ return post(url, {
117
+ configType: configType,
118
+ configContent: configContent
119
+ })
120
+ }
121
+
122
+ /**
123
+ * 通用执行业务逻辑
124
+ */
125
+ export function runLogic (logicName, parameter, serviceName = process.env.VUE_APP_SYSTEM_NAME, isDev) {
126
+ let apiPre = '/api/'
127
+ if (isDev) {
128
+ apiPre = '/devApi/'
129
+ }
130
+ return post(apiPre + serviceName + '/logic/' + logicName, parameter)
131
+ }
132
+
133
+ /**
134
+ * 通用查询
135
+ */
136
+ export function query (parameter, serviceName = process.env.VUE_APP_SYSTEM_NAME, isDev) {
137
+ let apiPre = '/api/'
138
+ if (isDev) {
139
+ apiPre = '/devApi/'
140
+ }
141
+ return post(apiPre + serviceName + '/' + commonApi.query, parameter, null)
142
+ }
143
+
144
+ /**
145
+ * 通用表单查询
146
+ */
147
+ export function queryWithResource (parameter, serviceName = process.env.VUE_APP_SYSTEM_NAME, isDev) {
148
+ let apiPre = '/api/'
149
+ if (isDev) {
150
+ apiPre = '/devApi/'
151
+ }
152
+ return post(apiPre + serviceName + '/' + commonApi.queryWithResource, parameter, null)
153
+ }
154
+
155
+ /**
156
+ * 通用新增/修改
157
+ */
158
+ export function addOrModify (parameter, serviceName = process.env.VUE_APP_SYSTEM_NAME, isDev) {
159
+ let apiPre = '/api/'
160
+ if (isDev) {
161
+ apiPre = '/devApi/'
162
+ }
163
+ return post(apiPre + serviceName + '/' + commonApi.addOrModify, parameter, null)
164
+ }
165
+
166
+ /**
167
+ * 通用删除
168
+ */
169
+ export function remove (parameter, serviceName = process.env.VUE_APP_SYSTEM_NAME, isDev) {
170
+ let apiPre = '/api/'
171
+ if (isDev) {
172
+ apiPre = '/devApi/'
173
+ }
174
+ return post(apiPre + serviceName + '/' + commonApi.delete, parameter, null)
175
+ }
176
+
177
+ /**
178
+ * 通用导入
179
+ */
180
+ export function importData (parameter, serviceName = process.env.VUE_APP_SYSTEM_NAME, isDev) {
181
+ let apiPre = '/api/'
182
+ if (isDev) {
183
+ apiPre = '/devApi/'
184
+ }
185
+ return post(apiPre + serviceName + '/' + commonApi.importData, parameter, null)
186
+ }
187
+
188
+ /**
189
+ * 通用导出
190
+ */
191
+ export function exportData (parameter, serviceName = process.env.VUE_APP_SYSTEM_NAME, isDev) {
192
+ let apiPre = '/api/'
193
+ if (isDev) {
194
+ apiPre = '/devApi/'
195
+ }
196
+ return post(apiPre + serviceName + '/' + commonApi.exportData, parameter, null)
197
+ }
198
+
199
+ /**
200
+ * 通用上传
201
+ */
202
+ export function upload (parameter, serviceName = process.env.VUE_APP_SYSTEM_NAME, config, isDev) {
203
+ let apiPre = '/api/'
204
+ if (isDev) {
205
+ apiPre = '/devApi/'
206
+ }
207
+ return post(apiPre + serviceName + '/' + commonApi.upload, parameter, config)
208
+ }
209
+
210
+ /**
211
+ * 通用导入模板下载
212
+ */
213
+ export function downloadImportExcel (parameter, serviceName = process.env.VUE_APP_SYSTEM_NAME, isDev) {
214
+ let apiPre = '/api/'
215
+ if (isDev) {
216
+ apiPre = '/devApi/'
217
+ }
218
+ return post(apiPre + serviceName + '/' + commonApi.downloadImportTemplate, parameter, null)
219
+ }
220
+
221
+ // 通用下载
222
+ export function download (parameter, filename, serviceName = process.env.VUE_APP_SYSTEM_NAME, isDev) {
223
+ let apiPre = '/api/'
224
+ if (isDev) {
225
+ apiPre = '/devApi/'
226
+ }
227
+ const notificationKey = 'download'
228
+ notification.open({
229
+ key: notificationKey,
230
+ message: '正在下载数据,请稍候',
231
+ duration: null,
232
+ icon: h => {
233
+ return h(
234
+ 'a-icon',
235
+ {
236
+ props: {
237
+ type: 'loading'
238
+ }
239
+ }
240
+ )
241
+ }
242
+ })
243
+ return post(apiPre + serviceName + '/' + commonApi.download, parameter, {
244
+ responseType: 'blob'
245
+ }).then(async (data) => {
246
+ const isLogin = await blobValidate(data)
247
+ if (isLogin) {
248
+ const blob = new Blob([data])
249
+ saveAs(blob, filename)
250
+ message.success('下载成功')
251
+ } else {
252
+ const resText = await data.text()
253
+ const rspObj = JSON.parse(resText)
254
+ const errMsg = errorCode[rspObj.code] || rspObj.msg || errorCode.default
255
+ message.error(errMsg)
256
+ }
257
+ notification.close(notificationKey)
258
+ }).catch((r) => {
259
+ message.error('功能尚未实现,敬请期待!')
260
+ // message.error('下载文件出现错误,请联系管理员!')
261
+ notification.close(notificationKey)
262
+ })
263
+ }
264
+
265
+ // 文件删除
266
+ export function fileDelete (parameter, serviceName = process.env.VUE_APP_SYSTEM_NAME, isDev) {
267
+ let apiPre = '/api/'
268
+ if (isDev) {
269
+ apiPre = '/devApi/'
270
+ }
271
+ return post(apiPre + serviceName + '/' + commonApi.fileEntity, parameter)
272
+ }
273
+
274
+ export { commonApi }
@@ -1,18 +1,18 @@
1
- import { post } from '@vue2-client/services/api/restTools'
2
-
3
- const entityApi = {
4
- // 根据ID查询数据
5
- getById: (entityName, id, data = {}, serviceName = process.env.VUE_APP_SYSTEM_NAME) => {
6
- return post(`/api/${serviceName}/entity/query/${entityName}/${id}`, data)
7
- },
8
- // 根据ID集合查询所有数据
9
- findAllByIds: (entityName, data, serviceName = process.env.VUE_APP_SYSTEM_NAME) => {
10
- return post(`/api/${serviceName}/entity/query/${entityName}`, data)
11
- },
12
- // 查询实体的总数量
13
- getCount: (entityName, serviceName = process.env.VUE_APP_SYSTEM_NAME) => {
14
- return post(`/api/${serviceName}/entity/queryCount/${entityName}`, {})
15
- }
16
- }
17
-
18
- export { entityApi }
1
+ import { post } from '@vue2-client/services/api/restTools'
2
+
3
+ const entityApi = {
4
+ // 根据ID查询数据
5
+ getById: (entityName, id, data = {}, serviceName = process.env.VUE_APP_SYSTEM_NAME) => {
6
+ return post(`/api/${serviceName}/entity/query/${entityName}/${id}`, data)
7
+ },
8
+ // 根据ID集合查询所有数据
9
+ findAllByIds: (entityName, data, serviceName = process.env.VUE_APP_SYSTEM_NAME) => {
10
+ return post(`/api/${serviceName}/entity/query/${entityName}`, data)
11
+ },
12
+ // 查询实体的总数量
13
+ getCount: (entityName, serviceName = process.env.VUE_APP_SYSTEM_NAME) => {
14
+ return post(`/api/${serviceName}/entity/queryCount/${entityName}`, {})
15
+ }
16
+ }
17
+
18
+ export { entityApi }
@@ -1,17 +1,17 @@
1
- import { commonApi, getConfig, query, addOrModify, remove } from '@vue2-client/services/api/common'
2
- import { QueryParamsDetailsViewApi } from '@vue2-client/services/api/QueryParamsDetailsViewApi'
3
- import { DictionaryDetailsViewApi } from '@vue2-client/services/api/DictionaryDetailsViewApi'
4
- import { LogDetailsViewApi } from '@vue2-client/services/api/LogDetailsViewApi'
5
- import { manageApi } from '@vue2-client/services/api/manage'
6
- import { get, post } from '@vue2-client/services/api/restTools'
7
- import { TicketDetailsViewApi } from '@vue2-client/services/api/TicketDetailsViewApi'
8
-
9
- export {
10
- commonApi, getConfig, query, addOrModify, remove,
11
- DictionaryDetailsViewApi,
12
- LogDetailsViewApi,
13
- manageApi,
14
- QueryParamsDetailsViewApi,
15
- get, post,
16
- TicketDetailsViewApi
17
- }
1
+ import { commonApi, getConfig, query, addOrModify, remove } from '@vue2-client/services/api/common'
2
+ import { QueryParamsDetailsViewApi } from '@vue2-client/services/api/QueryParamsDetailsViewApi'
3
+ import { DictionaryDetailsViewApi } from '@vue2-client/services/api/DictionaryDetailsViewApi'
4
+ import { LogDetailsViewApi } from '@vue2-client/services/api/LogDetailsViewApi'
5
+ import { manageApi } from '@vue2-client/services/api/manage'
6
+ import { get, post } from '@vue2-client/services/api/restTools'
7
+ import { TicketDetailsViewApi } from '@vue2-client/services/api/TicketDetailsViewApi'
8
+
9
+ export {
10
+ commonApi, getConfig, query, addOrModify, remove,
11
+ DictionaryDetailsViewApi,
12
+ LogDetailsViewApi,
13
+ manageApi,
14
+ QueryParamsDetailsViewApi,
15
+ get, post,
16
+ TicketDetailsViewApi
17
+ }