imatrix-ui 0.0.15 → 0.1.1-up

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 (171) hide show
  1. package/.vscode/extensions.json +3 -0
  2. package/README.md +7 -0
  3. package/components/dynamic-source-select/dynamic-source-select-service.js +106 -0
  4. package/components/dynamic-source-select/dynamic-source-select.vue +673 -0
  5. package/components/dynamic-source-select/events.js +77 -0
  6. package/components/fs-preview/fs-preview.vue +287 -0
  7. package/components/index.js +26 -0
  8. package/components/plugins/export-data-new.js +623 -0
  9. package/components/plugins/export-data.js +431 -0
  10. package/components/plugins/index.js +15 -0
  11. package/components/plugins/public-method.js +47 -0
  12. package/components/rich-editor/index-bak.vue +306 -0
  13. package/components/rich-editor/index.vue +236 -0
  14. package/components/rich-editor/langs/zh-Hans.js +438 -0
  15. package/components/rich-editor/viewer.vue +105 -0
  16. package/components/super-grid/apis.js +1065 -0
  17. package/components/super-grid/columns-config.vue +430 -0
  18. package/components/super-grid/custom-formatter.js +330 -0
  19. package/components/super-grid/dynamic-input.vue +1706 -0
  20. package/components/super-grid/eventBus.js +2 -0
  21. package/components/super-grid/events.js +56 -0
  22. package/components/super-grid/formValidatorUtil.js +300 -0
  23. package/components/super-grid/formatter.js +190 -0
  24. package/components/super-grid/group-column.vue +100 -0
  25. package/components/super-grid/header-context-menu.vue +82 -0
  26. package/components/super-grid/index-column.vue +69 -0
  27. package/components/super-grid/normal-column.vue +1148 -0
  28. package/components/super-grid/public-methods.js +30 -0
  29. package/components/super-grid/row-operation.vue +193 -0
  30. package/components/super-grid/search-button.vue +74 -0
  31. package/components/super-grid/search-condition-input.vue +73 -0
  32. package/components/super-grid/search-condition-list.vue +68 -0
  33. package/components/super-grid/search-form-advancedQuery.vue +820 -0
  34. package/components/super-grid/search-form-dialog.vue +77 -0
  35. package/components/super-grid/search-form-item.vue +470 -0
  36. package/components/super-grid/search-form-number.vue +111 -0
  37. package/components/super-grid/search-form-open.vue +178 -0
  38. package/components/super-grid/search-form-ordinarySearch.vue +218 -0
  39. package/components/super-grid/search-form.vue +756 -0
  40. package/components/super-grid/search-methods.js +484 -0
  41. package/components/super-grid/selection-column.vue +46 -0
  42. package/components/super-grid/store.js +3 -0
  43. package/components/super-grid/super-grid-service.js +682 -0
  44. package/components/super-grid/super-grid.vue +2893 -0
  45. package/components/super-grid/utils.js +851 -0
  46. package/components/super-grid/view-image-dialog.vue +173 -0
  47. package/components/utils/gogocodeTransfer.js +59 -0
  48. package/components/utils/utils.js +180 -0
  49. package/components/utils/value-set.js +98 -0
  50. package/components/z-test-utton/index.vue +82 -0
  51. package/package.json +29 -40
  52. package/public/index.html +13 -0
  53. package/public/vite.svg +1 -0
  54. package/src/api/sso-service.js +172 -19
  55. package/src/api/tab.js +36 -0
  56. package/src/api/user-service.js +11 -11
  57. package/src/assets/401/401.gif +0 -0
  58. package/src/assets/404/404-cloud.png +0 -0
  59. package/src/assets/404/404.png +0 -0
  60. package/src/assets/cloud.png +0 -0
  61. package/src/directives/permission/index.js +13 -13
  62. package/src/directives/permission/permission.js +20 -15
  63. package/src/i18n/i18n.js +16 -0
  64. package/src/i18n/langs/cn.js +254 -0
  65. package/src/i18n/langs/en.js +264 -0
  66. package/src/permission.js +157 -71
  67. package/src/plugins.js +18 -18
  68. package/src/router/index.js +96 -69
  69. package/src/store/getters.js +15 -10
  70. package/src/store/index.js +19 -19
  71. package/src/store/modules/app.js +54 -42
  72. package/src/store/modules/permission.js +137 -73
  73. package/src/store/modules/tab-content.js +36 -0
  74. package/src/store/modules/user.js +293 -80
  75. package/src/styles/display-layout.scss +34 -0
  76. package/src/styles/element-ui.scss +29 -29
  77. package/src/styles/index.scss +157 -78
  78. package/src/styles/mixin.scss +27 -27
  79. package/src/styles/theme/black/font-style.scss +70 -0
  80. package/src/styles/theme/black/index.scss +306 -0
  81. package/src/styles/theme/black/sidebar.scss +189 -0
  82. package/src/styles/theme/blue/font-style.scss +46 -0
  83. package/src/styles/theme/blue/index.scss +172 -0
  84. package/src/styles/{sidebar.scss → theme/blue/sidebar.scss} +171 -141
  85. package/src/styles/theme/blue2/font-style.scss +70 -0
  86. package/src/styles/theme/blue2/index.scss +188 -0
  87. package/src/styles/theme/blue2/sidebar.scss +201 -0
  88. package/src/styles/theme/dark-blue/button.scss +9 -0
  89. package/src/styles/theme/dark-blue/card.scss +62 -0
  90. package/src/styles/theme/dark-blue/checkbox.scss +10 -0
  91. package/src/styles/theme/dark-blue/dark-blue-var.scss +8 -0
  92. package/src/styles/theme/dark-blue/dialog.scss +21 -0
  93. package/src/styles/theme/dark-blue/element-variables.scss +7 -0
  94. package/src/styles/theme/dark-blue/font.scss +71 -0
  95. package/src/styles/theme/dark-blue/form.scss +51 -0
  96. package/src/styles/theme/dark-blue/index.scss +269 -0
  97. package/src/styles/theme/dark-blue/input.scss +15 -0
  98. package/src/styles/theme/dark-blue/message.scss +8 -0
  99. package/src/styles/theme/dark-blue/pagination.scss +14 -0
  100. package/src/styles/theme/dark-blue/scrollbar-style.scss +32 -0
  101. package/src/styles/theme/dark-blue/sidebar.scss +266 -0
  102. package/src/styles/theme/dark-blue/tab.scss +83 -0
  103. package/src/styles/theme/dark-blue/table.scss +60 -0
  104. package/src/styles/theme/dark-blue/tree.scss +31 -0
  105. package/src/styles/theme/dark-blue/var.scss +1028 -0
  106. package/src/styles/theme/gray/card-style.scss +54 -0
  107. package/src/styles/theme/gray/font-style.scss +70 -0
  108. package/src/styles/theme/gray/index.scss +172 -0
  109. package/src/styles/theme/gray/input-style.scss +19 -0
  110. package/src/styles/theme/gray/scrollbar-style.scss +32 -0
  111. package/src/styles/theme/gray/sidebar.scss +231 -0
  112. package/src/styles/theme/gray/tab-style.scss +81 -0
  113. package/src/styles/transition.scss +47 -46
  114. package/src/utils/auth-api.js +159 -0
  115. package/src/utils/auth.js +61 -15
  116. package/src/utils/calculator/calculator-factory-wf.js +558 -0
  117. package/src/utils/calculator/calculator-factory.js +145 -0
  118. package/src/utils/calculator/calculator-util.js +166 -0
  119. package/src/utils/common-util.js +305 -0
  120. package/src/utils/eventBus.js +2 -0
  121. package/src/utils/iconUtils.js +28 -0
  122. package/src/utils/index.js +102 -86
  123. package/src/utils/jump-page-utils.js +814 -0
  124. package/src/utils/local-storage.js +33 -31
  125. package/src/utils/menu.js +19 -0
  126. package/src/utils/permission.js +31 -26
  127. package/src/utils/permissionAuth.js +90 -0
  128. package/src/utils/range-selector.js +188 -0
  129. package/src/utils/request.js +270 -116
  130. package/src/utils/restful-interface-utils.js +57 -0
  131. package/src/utils/util.js +698 -0
  132. package/src/utils/validate.js +34 -33
  133. package/src/utils/watermark.js +108 -0
  134. package/src/utils/workflow-util.js +93 -0
  135. package/src/views/404.vue +248 -228
  136. package/src/views/dsc-component/Sidebar/Item.vue +84 -0
  137. package/src/views/dsc-component/Sidebar/Link.vue +38 -0
  138. package/src/views/dsc-component/Sidebar/SidebarItem.vue +196 -0
  139. package/src/views/dsc-component/Sidebar/index.vue +220 -0
  140. package/src/views/dsc-component/tabs/tab-content.vue +199 -0
  141. package/src/views/error-page/401.vue +106 -91
  142. package/src/views/error-page/404.vue +248 -228
  143. package/src/views/layout/EmptyLayout.vue +3 -0
  144. package/src/views/layout/Layout.vue +81 -68
  145. package/src/views/layout/NewLayout.vue +18 -0
  146. package/src/views/layout/components/AppMain.vue +39 -29
  147. package/src/views/layout/components/Breadcrumb/index.vue +156 -0
  148. package/src/views/layout/components/Menubar/Item.vue +57 -0
  149. package/src/views/layout/components/Menubar/Link.vue +38 -0
  150. package/src/views/layout/components/Menubar/SidebarItem.vue +164 -0
  151. package/src/views/layout/components/Menubar/index.vue +210 -0
  152. package/src/views/layout/components/Sidebar/Item.vue +53 -29
  153. package/src/views/layout/components/Sidebar/Link.vue +38 -39
  154. package/src/views/layout/components/Sidebar/SidebarItem.vue +135 -100
  155. package/src/views/layout/components/Sidebar/index.vue +141 -48
  156. package/src/views/layout/components/iframe-page.vue +38 -0
  157. package/src/views/layout/components/index.js +4 -3
  158. package/src/views/layout/components/tabs/tab-content.vue +207 -0
  159. package/src/views/layout/mixin/ResizeHandler.js +41 -41
  160. package/src/views/layout/tab-content-iframe-index.vue +38 -0
  161. package/src/views/layout/tab-content-index.vue +93 -0
  162. package/src/views/login/authredirect.vue +10 -10
  163. package/src/views/login/index.vue +296 -203
  164. package/src/views/login/update-password.vue +243 -0
  165. package/src/views/redirect/index.vue +14 -12
  166. package/src/views/wf-history/tache-subprocess-history.vue +45 -0
  167. package/vite.config.js +31 -0
  168. package/lib/super-ui.css +0 -1
  169. package/lib/super-ui.umd.min.js +0 -2
  170. package/src/styles/variables.scss +0 -4
  171. package/src/views/layout/components/Navbar.vue +0 -92
@@ -0,0 +1,814 @@
1
+ import * as Vue from 'vue'
2
+ import {
3
+ analysisCondition,
4
+ analysisValue,
5
+ getEntityFieldValue,
6
+ setEntityFieldValue,
7
+ } from './util'
8
+ import { getSystemFrontendUrl } from './common-util'
9
+ // 解析初始化条件,api方法;additionalParamMap是上个页面传过来的附加参数集合
10
+ export function initialization(
11
+ jumpPage,
12
+ entity,
13
+ isSql,
14
+ additionalParamerter,
15
+ contextParameter,
16
+ tableName,
17
+ parentFormData
18
+ ) {
19
+ const result = {}
20
+ if (jumpPage) {
21
+ // 页面附加参数
22
+ result.visible = true
23
+ let additionalParameterMap = {}
24
+ if (
25
+ additionalParamerter &&
26
+ typeof additionalParamerter === 'string' &&
27
+ additionalParamerter !== ''
28
+ ) {
29
+ additionalParameterMap = JSON.parse(additionalParamerter)
30
+ } else if (
31
+ additionalParamerter &&
32
+ typeof additionalParamerter === 'object'
33
+ ) {
34
+ additionalParameterMap = additionalParamerter
35
+ }
36
+ // 环境变量,例如:当前用户id、当前用户登录名等
37
+ let contextParameterMap = {}
38
+ if (
39
+ contextParameter &&
40
+ typeof contextParameter === 'string' &&
41
+ contextParameter !== ''
42
+ ) {
43
+ contextParameterMap = JSON.parse(contextParameter)
44
+ } else if (contextParameter && typeof contextParameter === 'object') {
45
+ contextParameterMap = contextParameter
46
+ }
47
+ if (jumpPage.displayTextJudge) {
48
+ // 例如:${obj.menu_code}-#-#${input.---}-#-#${context.currentTransactor}
49
+ const label = analysisValue(
50
+ jumpPage.displayText,
51
+ entity,
52
+ additionalParameterMap,
53
+ contextParameterMap
54
+ )
55
+ result.label = label
56
+ }
57
+ if (jumpPage.icon) {
58
+ result.icon = jumpPage.icon
59
+ }
60
+ if (jumpPage.linkTips) {
61
+ result.title = jumpPage.linkTips
62
+ }
63
+ if (jumpPage.buttonDisplayConditionsList) {
64
+ let displayJudgment = ''
65
+ if (jumpPage.buttonDisplayConditionsList) {
66
+ displayJudgment = JSON.stringify(jumpPage.buttonDisplayConditionsList)
67
+ }
68
+ if (displayJudgment && displayJudgment !== '') {
69
+ const visible = analysisCondition(
70
+ displayJudgment,
71
+ entity,
72
+ additionalParameterMap,
73
+ contextParameterMap,
74
+ isSql,
75
+ tableName,
76
+ parentFormData
77
+ )
78
+ result.visible = visible
79
+ }
80
+ }
81
+ }
82
+ return result
83
+ }
84
+
85
+ /**
86
+ * 弹框方法
87
+ * @param {*} pageSetting 格式为:
88
+ * {
89
+ * jumpPageSetting:{
90
+ * jumpPageUrl:'弹出的页面编码或路径',
91
+ * jumpPageAdditional:{附加参数},
92
+ * isNeedId:true/false 是否拼接id参数默认是true,
93
+ * jumpPageOpenMode:'popup/newTab/refresh 页面显示方式'
94
+ * jumpPageWidth: '500弹框宽度',
95
+ * jumpPageHeight: '600弹框高度'
96
+ * },
97
+ * system:{frontendUrl:'http://localhost:8080/dsc',code:xxx},
98
+ * dataId: 1,
99
+ * entity:{业务实体信息},
100
+ * additionalParamMap:{上个页面传过来的附加参数},
101
+ * ids:[1,2],
102
+ * parentFormData: {父表单实体,用于解析${parent.xxx}参数}
103
+ * }
104
+ */
105
+ export function openPage(pageSetting) {
106
+ if (pageSetting) {
107
+ const jumpPageSetting = pageSetting.jumpPageSetting
108
+ const system = pageSetting.system
109
+ const dataId = pageSetting.dataId
110
+ const ids = pageSetting.ids
111
+ const buttonCode = pageSetting.buttonCode
112
+ // 上个页面传过来的附加参数
113
+ const additionalParamMap = pageSetting.additionalParamMap
114
+ const entity = pageSetting.entity
115
+ const parentFormData = pageSetting.parentFormData
116
+ jumpToPage(
117
+ jumpPageSetting,
118
+ system,
119
+ dataId,
120
+ entity,
121
+ additionalParamMap,
122
+ ids,
123
+ buttonCode,
124
+ parentFormData
125
+ ).then((openPageParams) => {
126
+ let jumpMode
127
+ if (openPageParams) {
128
+ jumpMode = openPageParams.jumpMode
129
+ }
130
+ if (openPageParams) {
131
+ const popPageSetting = openPageParams
132
+ const path = popPageSetting._path
133
+ if (jumpMode === 'popup') {
134
+ let jumpPageWidth
135
+ let jumpPageHeight
136
+
137
+ if (openPageParams.jumpPageWidth) {
138
+ jumpPageWidth = openPageParams.jumpPageWidth
139
+ } else {
140
+ jumpPageWidth = window.innerWidth - 150
141
+ }
142
+
143
+ if (openPageParams.jumpPageHeight) {
144
+ jumpPageHeight = openPageParams.jumpPageHeight
145
+ } else {
146
+ jumpPageHeight = window.innerHeight - 150
147
+ }
148
+ // 弹出页面
149
+ window.open(
150
+ path,
151
+ '',
152
+ `height=` +
153
+ jumpPageHeight +
154
+ `,width=` +
155
+ jumpPageWidth +
156
+ `,top=100,left=100,toolbar=no,menubar=no,scrollbars=no,resizable=no,location=no,status=no`
157
+ )
158
+ } else if (jumpMode === 'refresh') {
159
+ window.location.href = path
160
+ }
161
+ }
162
+ })
163
+ }
164
+ }
165
+
166
+ // 附加参数中是否设值了ID参数。如果添加了id参数,则不需要自动添加dataId参数
167
+ function isHasIdAdditionalParam(jumpPageAdditional) {
168
+ if (jumpPageAdditional && jumpPageAdditional.length > 0) {
169
+ for (let i = 0; i < jumpPageAdditional.length; i++) {
170
+ const item = jumpPageAdditional[i]
171
+ if (
172
+ item.paramName &&
173
+ (item.paramName === 'id' || item.paramName === 'ID')
174
+ ) {
175
+ return true
176
+ }
177
+ }
178
+ }
179
+ }
180
+
181
+ // 页面跳转处理,api方法;additionalParamMap是上个页面传过来的附加参数集合;
182
+ // isFromChart 是否是从chart方面来,如果是,则弹窗和刷新页面都用winows方式打开
183
+ export function jumpToPage(
184
+ jumpPageSetting,
185
+ system,
186
+ dataId,
187
+ entity,
188
+ additionalParamMap,
189
+ ids,
190
+ buttonCode,
191
+ parentFormData
192
+ ) {
193
+ return new Promise((resolve, reject) => {
194
+ if (
195
+ jumpPageSetting &&
196
+ typeof jumpPageSetting === 'string' &&
197
+ jumpPageSetting !== ''
198
+ ) {
199
+ jumpPageSetting = JSON.parse(jumpPageSetting)
200
+ }
201
+ if (!jumpPageSetting.jumpPageUrl) {
202
+ resolve()
203
+ }
204
+ getSystem(system, jumpPageSetting.jumpPageUrl)
205
+ .then((system) => {
206
+ if (
207
+ jumpPageSetting.jumpPageAdditional &&
208
+ jumpPageSetting.jumpPageAdditional.length > 0
209
+ ) {
210
+ // 发送请求,获取附加参数,并存入缓存
211
+ const paramPath =
212
+ window.$vueApp.config.globalProperties.baseAPI +
213
+ '/component/super-pages/parsing-additional-parameters'
214
+ const paramMap = {}
215
+ paramMap.jumpPageAdditional = JSON.stringify(
216
+ jumpPageSetting.jumpPageAdditional
217
+ )
218
+ // 表单页面
219
+ paramMap.entity = entity
220
+ paramMap.additionalParamMap = additionalParamMap
221
+ console.log('paramMap.parentFormData', parentFormData)
222
+ paramMap.parentFormData = parentFormData
223
+ const isHasIdParam = isHasIdAdditionalParam(
224
+ jumpPageSetting.jumpPageAdditional
225
+ )
226
+
227
+ window.$vueApp.config.globalProperties.$http
228
+ .post(paramPath, paramMap)
229
+ .then((result) => {
230
+ let paramStoreId = ''
231
+ if (result && result.uuid) {
232
+ paramStoreId = result.uuid + '_additionalParamMap'
233
+ window.sessionStorage.setItem(
234
+ paramStoreId,
235
+ JSON.stringify(result.paramMap)
236
+ )
237
+ }
238
+ jumpPageSetting.paramStoreId = paramStoreId
239
+ // 存入缓存
240
+ jumpToPageTwo(
241
+ jumpPageSetting,
242
+ system,
243
+ dataId,
244
+ ids,
245
+ buttonCode,
246
+ isHasIdParam
247
+ ).then((openPageParams) => {
248
+ // openPageParams:xxx弹框打开页面时需要的参数 或 刷新页面时路由查询参数
249
+ resolve(openPageParams)
250
+ })
251
+ })
252
+ } else {
253
+ jumpToPageTwo(
254
+ jumpPageSetting,
255
+ system,
256
+ dataId,
257
+ ids,
258
+ buttonCode,
259
+ false
260
+ ).then((openPageParams) => {
261
+ // openPageParams:xxx弹框打开页面时需要的参数 或 刷新页面时路由查询参数
262
+ resolve(openPageParams)
263
+ })
264
+ }
265
+ })
266
+ .catch((error) => {
267
+ console.log(error)
268
+ reject(error)
269
+ })
270
+ })
271
+ }
272
+
273
+ function getSystem(system, jumpPageUrl) {
274
+ return new Promise((resolve, reject) => {
275
+ if (isFullPath(jumpPageUrl)) {
276
+ resolve(null)
277
+ } else {
278
+ if (!system || system === null) {
279
+ if (jumpPageUrl.indexOf('page:') === 0) {
280
+ const pageCode = jumpPageUrl.substring(
281
+ jumpPageUrl.indexOf('page:') + 'page:'.length
282
+ )
283
+ const path =
284
+ window.$vueApp.config.globalProperties.baseAPI +
285
+ '/component/business-systems/with-page-codes/' +
286
+ pageCode
287
+ window.$vueApp.config.globalProperties.$http
288
+ .get(path)
289
+ .then((data) => {
290
+ resolve(data)
291
+ })
292
+ .catch((error) => {
293
+ reject(error)
294
+ })
295
+ } else {
296
+ // 则根据当前系统编码获得系统
297
+ let systemCode = window.$vueApp.config.globalProperties.customSystem
298
+ if (!systemCode) {
299
+ systemCode = window.$vueApp.config.globalProperties.systemCode
300
+ }
301
+ const path =
302
+ window.$vueApp.config.globalProperties.baseAPI +
303
+ '/component/business-systems/' +
304
+ systemCode
305
+ window.$vueApp.config.globalProperties.$http
306
+ .get(path)
307
+ .then((data) => {
308
+ resolve(data)
309
+ })
310
+ .catch((error) => {
311
+ reject(error)
312
+ })
313
+ }
314
+ } else {
315
+ resolve(system)
316
+ }
317
+ }
318
+ })
319
+ }
320
+
321
+ // 表示是全路径
322
+ function isFullPath(path) {
323
+ return path.indexOf('http:') === 0 || path.indexOf('https:') === 0
324
+ }
325
+ // 正式跳转
326
+ function jumpToPageTwo(
327
+ jumpPageSetting,
328
+ system,
329
+ dataId,
330
+ ids,
331
+ buttonCode,
332
+ isHasIdParam
333
+ ) {
334
+ return new Promise((resolve, reject) => {
335
+ const jumpPageUrl = jumpPageSetting.jumpPageUrl
336
+ if (!jumpPageUrl) {
337
+ return
338
+ }
339
+ if (jumpPageUrl.indexOf('page:') === 0) {
340
+ // 表示是自定义系统跳转页面编码
341
+ jumpWithSuperPage(
342
+ jumpPageUrl,
343
+ system,
344
+ dataId,
345
+ jumpPageSetting,
346
+ ids,
347
+ buttonCode,
348
+ isHasIdParam
349
+ ).then((openPageParams) => {
350
+ resolve(openPageParams)
351
+ })
352
+ } else {
353
+ const additionalParameterStr = analysisAdditionalParameter(
354
+ jumpPageSetting.paramStoreId
355
+ )
356
+ // 表示是路径,格式如:http://www.baidu.com 或 http://localhost:9600/demo/#/demo/plan/list 或 /demo/plan/list
357
+ let path = jumpPageUrl
358
+ if (jumpPageUrl.indexOf('path:') >= 0) {
359
+ // 兼容历史数据
360
+ path = jumpPageUrl.substring(
361
+ jumpPageUrl.indexOf('path:') + 'path:'.length
362
+ )
363
+ }
364
+ if (isFullPath(path)) {
365
+ // 表示是全路径,例如:http://www.baidu.com 或 http://localhost:9600/demo/#/demo/plan/list
366
+ } else if (system) {
367
+ // 表示是路由路径,例如:/demo/plan/list
368
+ const frontendUrl = getSystemFrontendUrl(system.frontendUrl)
369
+ path = frontendUrl + '/#' + path
370
+ }
371
+ const systemName = getSystemNameWithLanguage(system)
372
+ jumpToPageWithFullPath(
373
+ dataId,
374
+ path,
375
+ additionalParameterStr,
376
+ jumpPageSetting,
377
+ ids,
378
+ buttonCode,
379
+ isHasIdParam,
380
+ systemName
381
+ )
382
+ resolve()
383
+ }
384
+ })
385
+ }
386
+ /**
387
+ * 全路径时跳转页面处理
388
+ * @param {*} dataId
389
+ * @param {*} path
390
+ * @param {*} additionalParameterStr
391
+ * @param {*} jumpPage
392
+ */
393
+ function jumpToPageWithFullPath(
394
+ dataId,
395
+ path,
396
+ additionalParameterStr,
397
+ jumpPage,
398
+ ids,
399
+ buttonCode,
400
+ isHasIdParam,
401
+ systemName
402
+ ) {
403
+ path = packagePathParams(
404
+ dataId,
405
+ path,
406
+ jumpPage,
407
+ ids,
408
+ buttonCode,
409
+ isHasIdParam
410
+ )
411
+ // 保持这种情况参数传递,是为了解决不同域时获得不到window.sessionStorage中存的附加参数问题
412
+ if (additionalParameterStr && additionalParameterStr !== '') {
413
+ let systemNameParam = ''
414
+ if (systemName) {
415
+ systemNameParam = '&_systemName_=' + encodeURI(systemName)
416
+ }
417
+ if (path.indexOf('?') !== -1) {
418
+ path += '&'
419
+ path += additionalParameterStr + systemNameParam
420
+ } else {
421
+ path += '?'
422
+ path += additionalParameterStr + systemNameParam
423
+ }
424
+ }
425
+ let jumpMode = 'refresh'
426
+ if (jumpPage) {
427
+ if (jumpPage.jumpPageOpenMode) {
428
+ jumpMode = jumpPage.jumpPageOpenMode
429
+ }
430
+ }
431
+ if (jumpMode === 'popup') {
432
+ // 弹框
433
+ let jumpPageWidth
434
+ let jumpPageHeight
435
+
436
+ if (jumpPage.jumpPageWidth) {
437
+ jumpPageWidth = jumpPage.jumpPageWidth
438
+ } else {
439
+ jumpPageWidth = window.innerWidth - 150
440
+ }
441
+
442
+ if (jumpPage.jumpPageHeight) {
443
+ jumpPageHeight = jumpPage.jumpPageHeight
444
+ } else {
445
+ jumpPageHeight = window.innerHeight - 150
446
+ }
447
+ const features =
448
+ 'height=' +
449
+ jumpPageHeight +
450
+ ', width=' +
451
+ jumpPageWidth +
452
+ ', top=0, left=0, toolbar=no, menubar=no,' +
453
+ 'scrollbars=no,resizable=no, location=no, status=no' // 设置新窗口的特性
454
+ window.open(path, 'newW', features) // 打开新窗口
455
+ } else if (jumpMode === 'newTab') {
456
+ // 新页签
457
+ window.open(path)
458
+ } else {
459
+ // 刷新页面
460
+ location.href = path
461
+ }
462
+ }
463
+
464
+ // path封装参数
465
+ function packagePathParams(
466
+ dataId,
467
+ path,
468
+ jumpPage,
469
+ ids,
470
+ buttonCode,
471
+ isHasIdParam
472
+ ) {
473
+ if (
474
+ jumpPage.isNeedId === undefined ||
475
+ jumpPage.isNeedId === null ||
476
+ jumpPage.isNeedId === true
477
+ ) {
478
+ if (!isHasIdParam && dataId) {
479
+ // 表示是修改或查看页面,封装id参数
480
+ let paramSeparator = '?'
481
+ if (path.indexOf('?') > 0) {
482
+ paramSeparator = '&'
483
+ }
484
+ path = path + paramSeparator + 'id=' + dataId
485
+ }
486
+ }
487
+ // window.sessionStorage中存储附加参数的key
488
+ const paramStoreId = jumpPage.paramStoreId
489
+ if (paramStoreId && paramStoreId !== '') {
490
+ const paramStoreIdParam = 'paramStoreId=' + paramStoreId
491
+ if (path.indexOf('?') !== -1) {
492
+ path += '&'
493
+ path += paramStoreIdParam
494
+ } else {
495
+ path += '?'
496
+ path += paramStoreIdParam
497
+ }
498
+ }
499
+ if (ids && ids.length > 0) {
500
+ if (path.indexOf('?') !== -1) {
501
+ path += '&'
502
+ path += 'ids=' + ids.join(',')
503
+ } else {
504
+ path += '?'
505
+ path += 'ids=' + ids.join(',')
506
+ }
507
+ }
508
+ if (buttonCode) {
509
+ if (path.indexOf('?') !== -1) {
510
+ path += '&buttonCode=' + buttonCode
511
+ } else {
512
+ path += '?buttonCode=' + buttonCode
513
+ }
514
+ }
515
+ return path
516
+ }
517
+
518
+ function getPageCode(jumpPageUrl) {
519
+ let pageCode
520
+ if (jumpPageUrl && jumpPageUrl.indexOf('page:') !== -1) {
521
+ pageCode = jumpPageUrl.substring(
522
+ jumpPageUrl.indexOf('page:') + 'page:'.length
523
+ )
524
+ }
525
+ return pageCode
526
+ }
527
+ // 使用页面组件内部调整
528
+ function jumpWithSuperPage(
529
+ jumpPageUrl,
530
+ system,
531
+ dataId,
532
+ jumpPageSetting,
533
+ ids,
534
+ buttonCode,
535
+ isHasIdParam
536
+ ) {
537
+ return new Promise((resolve, reject) => {
538
+ // 表示是自定义系统跳转页面编码
539
+ console.log(
540
+ '----jumpWithSuperPage---',
541
+ jumpPageUrl,
542
+ system,
543
+ dataId,
544
+ jumpPageSetting
545
+ )
546
+ const pageCode = getPageCode(jumpPageUrl)
547
+ let jumpMode = 'refresh'
548
+ if (jumpPageSetting) {
549
+ if (jumpPageSetting.jumpPageOpenMode) {
550
+ jumpMode = jumpPageSetting.jumpPageOpenMode
551
+ }
552
+ }
553
+ const jumpJsonData = {
554
+ jumpMode: jumpMode,
555
+ }
556
+ window.sessionStorage.setItem(pageCode + '-jumpMode', JSON.stringify(jumpJsonData))
557
+ if (jumpMode === 'popup') {
558
+ const path = packageOpenUrl(
559
+ system,
560
+ pageCode,
561
+ dataId,
562
+ jumpPageSetting,
563
+ jumpMode,
564
+ ids,
565
+ buttonCode,
566
+ isHasIdParam
567
+ )
568
+ // 页面布局中的按钮打开
569
+ const popPageSetting = openDialogWhenPopup(
570
+ jumpPageSetting,
571
+ system,
572
+ pageCode,
573
+ dataId,
574
+ jumpMode,
575
+ ids,
576
+ buttonCode
577
+ )
578
+ popPageSetting._path = path
579
+ resolve(popPageSetting)
580
+ } else if (jumpMode === 'newTab') {
581
+ // 新页签打开
582
+ const path = packageOpenUrl(
583
+ system,
584
+ pageCode,
585
+ dataId,
586
+ jumpPageSetting,
587
+ jumpMode,
588
+ ids,
589
+ buttonCode,
590
+ isHasIdParam
591
+ )
592
+ window.open(path)
593
+ resolve()
594
+ } else {
595
+ // 刷新页面
596
+ const queryParam = {
597
+ pageCode: pageCode,
598
+ customSystem: system.code,
599
+ jumpMode: jumpMode,
600
+ buttonCode: buttonCode,
601
+ ids: ids ? ids.join(',') : '',
602
+ }
603
+ if (
604
+ jumpPageSetting.isNeedId === undefined ||
605
+ jumpPageSetting.isNeedId === null ||
606
+ jumpPageSetting.isNeedId === true
607
+ ) {
608
+ if (!isHasIdParam && dataId) {
609
+ // 表示是修改或查看页面,封装id参数
610
+ queryParam.id = dataId
611
+ }
612
+ }
613
+ const paramStoreId = jumpPageSetting.paramStoreId
614
+ if (paramStoreId && paramStoreId !== '') {
615
+ queryParam['paramStoreId'] = paramStoreId
616
+ }
617
+ const path = packageOpenUrl(
618
+ system,
619
+ pageCode,
620
+ dataId,
621
+ jumpPageSetting,
622
+ jumpMode,
623
+ ids,
624
+ buttonCode,
625
+ isHasIdParam
626
+ )
627
+ queryParam._path = path
628
+ resolve(queryParam)
629
+ }
630
+ })
631
+ }
632
+ /**
633
+ * 使用dialog打开弹框,页面布局中的按钮、自定义按钮等使用该方法
634
+ * @param {*} jumpPageSetting
635
+ * @param {*} system
636
+ * @param {*} pageCode
637
+ * @param {*} dataId
638
+ * @param {*} jumpMode
639
+ * @param {*} ids
640
+ * @param {*} buttonCode
641
+ */
642
+ function openDialogWhenPopup(
643
+ jumpPageSetting,
644
+ system,
645
+ pageCode,
646
+ dataId,
647
+ jumpMode,
648
+ ids,
649
+ buttonCode
650
+ ) {
651
+ const popPageSetting = {}
652
+ if (jumpPageSetting) {
653
+ popPageSetting.jumpPageTitle = jumpPageSetting.jumpPageTitle
654
+ popPageSetting.jumpPageWidth = jumpPageSetting.jumpPageWidth
655
+ popPageSetting.jumpPageHeight = jumpPageSetting.jumpPageHeight
656
+ popPageSetting.valueMappings = jumpPageSetting.valueMappings
657
+ popPageSetting.updateValueEvent = jumpPageSetting.updateValueEvent
658
+ popPageSetting.closeEvent = jumpPageSetting.closeEvent
659
+ }
660
+ // 是否是自定义系统
661
+ let isDsc = false
662
+ if (typeof system.standard !== 'undefined') {
663
+ isDsc = !system.standard
664
+ }
665
+ popPageSetting.pageCode = pageCode
666
+ if (
667
+ jumpPageSetting.isNeedId === undefined ||
668
+ jumpPageSetting.isNeedId === null ||
669
+ jumpPageSetting.isNeedId === true
670
+ ) {
671
+ if (dataId) {
672
+ // 表示是修改或查看页面,封装id参数
673
+ popPageSetting.dataId = dataId
674
+ }
675
+ }
676
+ popPageSetting.isDsc = isDsc
677
+ // 用于获取window.sessionStorage中缓存的附加参数的key值
678
+ popPageSetting.paramStoreId = jumpPageSetting.paramStoreId
679
+ // 打开方式
680
+ popPageSetting.jumpMode = jumpMode
681
+ popPageSetting.ids = ids
682
+ popPageSetting.buttonCode = buttonCode
683
+ // eventBus.$emit('showDialogPage', buttonSetting)
684
+ return popPageSetting
685
+ }
686
+
687
+ function packageOpenUrl(
688
+ system,
689
+ pageCode,
690
+ dataId,
691
+ jumpPageSetting,
692
+ jumpMode,
693
+ ids,
694
+ buttonCode,
695
+ isHasIdParam
696
+ ) {
697
+ const frontendUrl = getSystemFrontendUrl(system.frontendUrl)
698
+ let path =
699
+ frontendUrl +
700
+ '/#/dsc-full-screen/page?customSystem=' +
701
+ system.code +
702
+ '&pageCode=' +
703
+ pageCode +
704
+ '&jumpMode=' +
705
+ jumpMode
706
+ const systemName = getSystemNameWithLanguage(system)
707
+ if (systemName) {
708
+ path += '&_systemName_=' + encodeURI(systemName)
709
+ }
710
+ return packagePathParams(
711
+ dataId,
712
+ path,
713
+ jumpPageSetting,
714
+ ids,
715
+ buttonCode,
716
+ isHasIdParam
717
+ )
718
+ }
719
+
720
+ function getSystemNameWithLanguage(system) {
721
+ if (system) {
722
+ let locale = 'cn'
723
+ if (window.$locale) {
724
+ locale = window.$locale
725
+ }
726
+ if (locale === 'cn') {
727
+ return system.name
728
+ } else {
729
+ return system.enName
730
+ }
731
+ }
732
+ }
733
+
734
+ // 解析跳转页面附带参数
735
+ function analysisAdditionalParameter(paramStoreId) {
736
+ const additionalParamMap = window.sessionStorage.getItem(paramStoreId)
737
+ return analysisAdditionalParameterWithMap(additionalParamMap)
738
+ }
739
+
740
+ // 解析跳转页面附带参数
741
+ function analysisAdditionalParameterWithMap(additionalParamMap) {
742
+ let additionalParameterStr = ''
743
+ if (additionalParamMap) {
744
+ const additionalParameterMap = JSON.parse(additionalParamMap)
745
+ const keys = Object.keys(additionalParameterMap)
746
+ console.log(
747
+ 'analysisAdditionalParameterWithMap--Object.keys(additionalParameterMap)=',
748
+ keys
749
+ )
750
+ for (let i = 0; i < keys.length; i++) {
751
+ if (additionalParameterStr !== '') {
752
+ additionalParameterStr += '&'
753
+ }
754
+ additionalParameterStr += keys[i]
755
+ additionalParameterStr += '='
756
+ additionalParameterStr += additionalParameterMap[keys[i]]
757
+ }
758
+ }
759
+ return additionalParameterStr
760
+ }
761
+
762
+ export function updateWithPageValue(
763
+ sourceModel,
764
+ sourceTableName,
765
+ jumpPageSetting,
766
+ entity,
767
+ targetTableName,
768
+ isNeedReplaceFieldName
769
+ ) {
770
+ if (
771
+ sourceModel &&
772
+ sourceModel !== null &&
773
+ entity &&
774
+ entity !== null &&
775
+ jumpPageSetting &&
776
+ jumpPageSetting !== null &&
777
+ jumpPageSetting.valueMappings
778
+ ) {
779
+ let sourceEntity = sourceModel
780
+ if (Array.isArray(sourceModel) && sourceModel.length > 0) {
781
+ // 弹出框中列表选择了多行时,默认只赋值第一行记录
782
+ sourceEntity = sourceModel[0]
783
+ }
784
+ const valueMappings = jumpPageSetting.valueMappings
785
+ valueMappings.forEach((valueMapping) => {
786
+ let sourceField = valueMapping.source
787
+ let targetValue = getEntityFieldValue(sourceEntity, sourceField)
788
+ // sql查询时,会把点“.”改为两个下划线"__"
789
+ const replaceDot = '__'
790
+ if (targetValue === undefined || targetValue === null) {
791
+ // 如果通过字段没有获得字段,则再拼接表名作为字段,重新获得字段值
792
+ if (sourceField && sourceTableName && sourceField.indexOf('.') > 0) {
793
+ // 表示包括点“.”,需要把两个下划线"__"重新改为点“.”,否则会导致查询报500错误
794
+ sourceField = sourceTableName + replaceDot + sourceField
795
+ }
796
+ // 重新获得字段值
797
+ targetValue = getEntityFieldValue(sourceEntity, sourceField)
798
+ }
799
+
800
+ let targetField = valueMapping.target
801
+ if (
802
+ isNeedReplaceFieldName !== undefined &&
803
+ isNeedReplaceFieldName === true &&
804
+ targetField &&
805
+ targetTableName &&
806
+ targetField.indexOf('.') > 0
807
+ ) {
808
+ // 表示包括点“.”,需要把两个下划线"__"重新改为点“.”,否则会导致查询报500错误
809
+ targetField = targetTableName + replaceDot + targetField
810
+ }
811
+ setEntityFieldValue(entity, targetField, targetValue)
812
+ })
813
+ }
814
+ }