super-pages 0.7.60 → 0.7.61
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.
- package/lib/super-pages.css +1 -1
- package/lib/super-pages.umd.min.js +4 -4
- package/package.json +1 -1
- package/packages/super-page/src/button-group.vue +67 -65
- package/packages/super-page/src/chart-page.vue +23 -3
- package/packages/super-page/src/chart-query-page.vue +11 -3
- package/packages/super-page/src/common-form-page.vue +48 -37
- package/packages/super-page/src/list-page.vue +65 -48
- package/packages/super-page/src/list-toolbar-page.vue +9 -1
- package/packages/super-page/src/super-page.vue +3 -2
- package/packages/super-page/src/util/ListButtonEvent.js +68 -42
- package/packages/super-page/src/util/formButtonEvent.js +3 -3
- package/packages/super-page/src/util/util.js +161 -86
- package/packages/super-page/src/util/workflowButtonEvent.js +1 -1
- package/packages/super-page/src/workflow-form-page.vue +269 -246
- package/packages/super-page-dialog/src/super-page-dialog.vue +16 -12
- package/src/i18n/langs/cn.js +2 -1
- package/src/i18n/langs/en.js +2 -1
|
@@ -1,14 +1,14 @@
|
|
|
1
|
-
import {
|
|
2
|
-
getStoreInfo,
|
|
3
|
-
setStoreInfo,
|
|
4
|
-
packageTemplateFiles
|
|
5
|
-
} from './common-util'
|
|
6
1
|
import {
|
|
7
2
|
updateWithPageValue
|
|
8
3
|
} from 'imatrix-ui/src/utils/jump-page-utils'
|
|
4
|
+
import {
|
|
5
|
+
getStoreInfo,
|
|
6
|
+
packageTemplateFiles,
|
|
7
|
+
setStoreInfo
|
|
8
|
+
} from './common-util'
|
|
9
9
|
const buttonEvents = {
|
|
10
10
|
// 按钮组中各按钮的操作
|
|
11
|
-
clickButton
|
|
11
|
+
clickButton(button, system, listCode, ids,
|
|
12
12
|
tableName, entityName, myJsContent, entities,
|
|
13
13
|
deleteLogicSetting, formNoRuleCode, importRuleCode, beanName, isWorkflow, uuid) {
|
|
14
14
|
if (typeof (button.isExtension) !== 'undefined' && button.isExtension === true) {
|
|
@@ -152,7 +152,15 @@ const buttonEvents = {
|
|
|
152
152
|
}
|
|
153
153
|
this.downloadTemplate(templateUUID, templateShowPath, tableName, importRuleCode, system, button.logSetting, listCode, entityName, beanName, button)
|
|
154
154
|
} else if (button.code === 'export') {
|
|
155
|
-
|
|
155
|
+
// 是否异步
|
|
156
|
+
let isAsync = false
|
|
157
|
+
if (button.hasOwnProperty('isAsync')) {
|
|
158
|
+
isAsync = button.isAsync
|
|
159
|
+
} else {
|
|
160
|
+
isAsync = false
|
|
161
|
+
}
|
|
162
|
+
// 页面编码 this.pageCode
|
|
163
|
+
this.export(listCode, button.functionCode, uuid, isAsync, this.pageCode)
|
|
156
164
|
} else if (button.code === 'viewDetail') {
|
|
157
165
|
// 查看详情
|
|
158
166
|
let dataId
|
|
@@ -182,7 +190,7 @@ const buttonEvents = {
|
|
|
182
190
|
}
|
|
183
191
|
}
|
|
184
192
|
},
|
|
185
|
-
judgeDataNumber
|
|
193
|
+
judgeDataNumber(button, ids, isDefaultOne) {
|
|
186
194
|
if (button.conditionsForExecution && button.conditionsForExecution !== '') {
|
|
187
195
|
if (button.conditionsForExecution === 'one') {
|
|
188
196
|
if (!ids || ids.length !== 1) {
|
|
@@ -222,7 +230,7 @@ const buttonEvents = {
|
|
|
222
230
|
}
|
|
223
231
|
return true
|
|
224
232
|
},
|
|
225
|
-
refreshMyList
|
|
233
|
+
refreshMyList(successOperation, isNeedValueMapping, row) {
|
|
226
234
|
if (!successOperation) {
|
|
227
235
|
successOperation = 'refresh'
|
|
228
236
|
}
|
|
@@ -249,22 +257,22 @@ const buttonEvents = {
|
|
|
249
257
|
}
|
|
250
258
|
},
|
|
251
259
|
// 列表-新建
|
|
252
|
-
create
|
|
260
|
+
create(jumpPage, system, button, entities) {
|
|
253
261
|
console.log('create-------this.pageCode=', this.pageCode)
|
|
254
262
|
this.jumpToPage(jumpPage, system, null, entities && entities.length > 0 ? entities[0] : null, this.additionalParamMap, null, button.code, this.pageCode)
|
|
255
263
|
},
|
|
256
264
|
// 列表-修改
|
|
257
|
-
update
|
|
265
|
+
update(jumpPage, system, dataId, button, ids, entity) {
|
|
258
266
|
this.jumpToPage(jumpPage, system, dataId, entity, this.additionalParamMap, ids, button.code, this.pageCode)
|
|
259
267
|
},
|
|
260
268
|
// 查看详情
|
|
261
|
-
viewDetail
|
|
269
|
+
viewDetail(jumpPage, system, dataId, button, row) {
|
|
262
270
|
this.jumpToPage(jumpPage, system, dataId, row, this.additionalParamMap, null, button.code, this.pageCode)
|
|
263
271
|
// // 控制当是修改按钮的弹框关闭时,刷新列表页面数据
|
|
264
272
|
setStoreInfo(this.pageCode, 'openPageButton', 'viewDetail')
|
|
265
273
|
},
|
|
266
274
|
// 列表-删除
|
|
267
|
-
delete
|
|
275
|
+
delete(ids, system, restfulApiPath, tableName, entityName, myJsContent, button, deleteLogicSetting, entities, beanName, isWorkflowEntity) {
|
|
268
276
|
this.$confirm(this.$t('superPageMessage.whetherToConfirmDeletion'), this.$t('superPageMessage.tips'), {
|
|
269
277
|
confirmButtonText: this.$t('superPageMessage.sure'),
|
|
270
278
|
cancelButtonText: this.$t('superPageMessage.cancel'),
|
|
@@ -339,10 +347,10 @@ const buttonEvents = {
|
|
|
339
347
|
// button.loading = false
|
|
340
348
|
})
|
|
341
349
|
}
|
|
342
|
-
}).catch(() => {})
|
|
350
|
+
}).catch(() => { })
|
|
343
351
|
},
|
|
344
352
|
// 下载模板
|
|
345
|
-
downloadTemplate
|
|
353
|
+
downloadTemplate(templateUUID, showName, tableName, importRuleCode, system, logSettingText, listCode, entityName, beanName, button) {
|
|
346
354
|
// filePath格式如:用户定义的文件名~~服务器上磁盘中存储的文件路径及文件名。例如:user-info.xls~~iMatrix/b03dr45f5h4g.xls
|
|
347
355
|
// let fileShowName = ''
|
|
348
356
|
if (!showName && button.templateI18nLable) {
|
|
@@ -383,9 +391,9 @@ const buttonEvents = {
|
|
|
383
391
|
const baseUrl = this.getBaseUrl(system)
|
|
384
392
|
window.open(baseUrl + '/dsc/commons/download-files' + param)
|
|
385
393
|
},
|
|
386
|
-
doImportFinally
|
|
394
|
+
doImportFinally(system, restfulApiPath, tableName, entityName,
|
|
387
395
|
myJsContent, button, listViewImportDuplicate, fileObj,
|
|
388
|
-
judgeHeavyList, formNoRuleCode, importRuleCode, listCode, beanName) {
|
|
396
|
+
judgeHeavyList, formNoRuleCode, importRuleCode, listCode, beanName, pageCode) {
|
|
389
397
|
const param = new FormData()
|
|
390
398
|
param.append('multipartFile', fileObj)
|
|
391
399
|
if (tableName) {
|
|
@@ -420,6 +428,16 @@ const buttonEvents = {
|
|
|
420
428
|
// 列表编码
|
|
421
429
|
param.append('listCode', listCode)
|
|
422
430
|
}
|
|
431
|
+
let isAsync = false
|
|
432
|
+
if (button.hasOwnProperty('isAsync')) {
|
|
433
|
+
// 是否异步
|
|
434
|
+
isAsync = button.isAsync
|
|
435
|
+
} else {
|
|
436
|
+
isAsync = false
|
|
437
|
+
}
|
|
438
|
+
param.append('isAsync', isAsync)
|
|
439
|
+
// 页面编码
|
|
440
|
+
param.append('pageCode', pageCode)
|
|
423
441
|
const isWorkflowEntity = getStoreInfo(this.pageCode, tableName + '_isProcess')
|
|
424
442
|
if (isWorkflowEntity !== null && isWorkflowEntity !== undefined) {
|
|
425
443
|
param.append('isWorkflowEntity', isWorkflowEntity)
|
|
@@ -452,30 +470,38 @@ const buttonEvents = {
|
|
|
452
470
|
if (request) {
|
|
453
471
|
button.importing = true
|
|
454
472
|
request.then(data => {
|
|
455
|
-
|
|
456
|
-
if (data) {
|
|
457
|
-
isSuccess = false
|
|
473
|
+
if (isAsync) {
|
|
458
474
|
this.$message({
|
|
459
|
-
dangerouslyUseHTMLString: true,
|
|
460
475
|
showClose: true,
|
|
461
|
-
type: '
|
|
462
|
-
message:
|
|
476
|
+
type: 'success',
|
|
477
|
+
message: this.$t('superPageMessage.asyncImport')
|
|
463
478
|
})
|
|
464
479
|
} else {
|
|
465
|
-
|
|
466
|
-
|
|
467
|
-
|
|
468
|
-
|
|
469
|
-
|
|
480
|
+
let isSuccess = false
|
|
481
|
+
if (data) {
|
|
482
|
+
isSuccess = false
|
|
483
|
+
this.$message({
|
|
484
|
+
dangerouslyUseHTMLString: true,
|
|
485
|
+
showClose: true,
|
|
486
|
+
type: 'warning',
|
|
487
|
+
message: data
|
|
488
|
+
})
|
|
489
|
+
} else {
|
|
490
|
+
// 刷新列表组件
|
|
491
|
+
this.$message({
|
|
492
|
+
showClose: true,
|
|
493
|
+
type: 'success',
|
|
494
|
+
message: this.$t('superPageMessage.successfulImport')
|
|
495
|
+
})
|
|
496
|
+
isSuccess = true
|
|
497
|
+
}
|
|
498
|
+
this.refreshMyList(button.successOperation)
|
|
499
|
+
// afterClick回调方法
|
|
500
|
+
this.callAfterClickButton(this.listEvents, this.listCode + '__' + button.code, {
|
|
501
|
+
params: this.additionalParamMap,
|
|
502
|
+
result: isSuccess
|
|
470
503
|
})
|
|
471
|
-
isSuccess = true
|
|
472
504
|
}
|
|
473
|
-
this.refreshMyList(button.successOperation)
|
|
474
|
-
// afterClick回调方法
|
|
475
|
-
this.callAfterClickButton(this.listEvents, this.listCode + '__' + button.code, {
|
|
476
|
-
params: this.additionalParamMap,
|
|
477
|
-
result: isSuccess
|
|
478
|
-
})
|
|
479
505
|
button.importing = false
|
|
480
506
|
}).catch(error => {
|
|
481
507
|
button.importing = false
|
|
@@ -484,31 +510,31 @@ const buttonEvents = {
|
|
|
484
510
|
}
|
|
485
511
|
},
|
|
486
512
|
// 列表-导出。导出台账数据,有查询条件则导出查询条件对应的数据,没有查询条件则导出所有记录
|
|
487
|
-
export
|
|
513
|
+
export(listCode, functionCode, uuid, isAsync, pageCode) {
|
|
488
514
|
const dataParam = {}
|
|
489
515
|
if (this.selections && this.selections.length > 0) {
|
|
490
516
|
dataParam.data = this.selections
|
|
491
517
|
}
|
|
492
518
|
let exportFileName
|
|
493
519
|
let pageName = getStoreInfo(this.pageCode, '_pageNameI18n')
|
|
494
|
-
if(!pageName) {
|
|
520
|
+
if (!pageName) {
|
|
495
521
|
pageName = getStoreInfo(this.pageCode, '_pageName')
|
|
496
522
|
}
|
|
497
|
-
if(!pageName) {
|
|
523
|
+
if (!pageName) {
|
|
498
524
|
pageName = this.pageCode
|
|
499
525
|
}
|
|
500
526
|
exportFileName = pageName
|
|
501
527
|
this.$exportDataNew(dataParam,
|
|
502
528
|
exportFileName,
|
|
503
529
|
listCode,
|
|
504
|
-
functionCode, uuid)
|
|
530
|
+
functionCode, uuid, null, isAsync, pageCode)
|
|
505
531
|
// afterClick回调方法
|
|
506
532
|
this.callAfterClickButton(this.listEvents, this.listCode + '__export', {
|
|
507
533
|
params: this.additionalParamMap
|
|
508
534
|
})
|
|
509
535
|
},
|
|
510
536
|
// 列表-提交/同意/不同意
|
|
511
|
-
submitGrid
|
|
537
|
+
submitGrid(ids, system, restfulApiPath, tableName, entityName, myJsContent, button, formNoRuleCode, buttonCode, entity, additionalParamMap, entities, beanName, isWorkflow) {
|
|
512
538
|
const operationI18nTip = 'superPageMessage.whetherToConfirm' + this.upperFirstCase(buttonCode)
|
|
513
539
|
this.$confirm(this.$t(operationI18nTip, { name: button.label }), this.$t('superPageMessage.tips'), {
|
|
514
540
|
confirmButtonText: this.$t('superPageMessage.sure'),
|
|
@@ -585,11 +611,11 @@ const buttonEvents = {
|
|
|
585
611
|
})
|
|
586
612
|
},
|
|
587
613
|
// 获得字段类型集合
|
|
588
|
-
getDataTypeMapRequest
|
|
614
|
+
getDataTypeMapRequest(system, tableName) {
|
|
589
615
|
const baseUrl = this.getBaseUrl(system)
|
|
590
616
|
return this.$http.get(baseUrl + '/dsc/commons/tables/' + tableName + '/data-types')
|
|
591
617
|
},
|
|
592
|
-
updateValues
|
|
618
|
+
updateValues(sourceModel, sourceTableName) {
|
|
593
619
|
console.log('update-value66-', sourceModel, sourceTableName)
|
|
594
620
|
// 更新数据
|
|
595
621
|
updateWithPageValue(sourceModel, sourceTableName, this.jumpPageSetting, this.editRow, this.tableName)
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import {
|
|
2
2
|
updateWithPageValue
|
|
3
3
|
} from 'imatrix-ui/src/utils/jump-page-utils'
|
|
4
|
-
import {packageTemplateFiles} from './common-util'
|
|
4
|
+
import { packageTemplateFiles } from './common-util'
|
|
5
5
|
const buttonEvents = {
|
|
6
6
|
// 按钮组中各按钮的操作
|
|
7
7
|
clickFormButton (button, system, formCode, formVersion, tableName, formData, entityName, myJsContent, formNoRuleCode, ids, isBatchProcessing, needDeleteFileUuidS, additionalParamMap, beanName) {
|
|
@@ -50,8 +50,8 @@ const buttonEvents = {
|
|
|
50
50
|
}
|
|
51
51
|
})
|
|
52
52
|
}
|
|
53
|
-
} else
|
|
54
|
-
//
|
|
53
|
+
} else {
|
|
54
|
+
// 自定义按钮默认的成功后操作是关闭弹框
|
|
55
55
|
let successOperation
|
|
56
56
|
if (button.successOperation) {
|
|
57
57
|
successOperation = button.successOperation
|
|
@@ -17,7 +17,8 @@ import {
|
|
|
17
17
|
showWatermark
|
|
18
18
|
} from 'imatrix-ui/src/utils/watermark'
|
|
19
19
|
import {
|
|
20
|
-
getSystemBackendUrl
|
|
20
|
+
getSystemBackendUrl,
|
|
21
|
+
isPromise
|
|
21
22
|
} from 'imatrix-ui/src/utils/common-util'
|
|
22
23
|
import {
|
|
23
24
|
getToken
|
|
@@ -142,6 +143,13 @@ const Util = {
|
|
|
142
143
|
}
|
|
143
144
|
}
|
|
144
145
|
if (!isCanExecute) {
|
|
146
|
+
if (failMessage) {
|
|
147
|
+
this.$message({
|
|
148
|
+
showClose: true,
|
|
149
|
+
type: 'warning',
|
|
150
|
+
message: failMessage
|
|
151
|
+
})
|
|
152
|
+
}
|
|
145
153
|
resolve({
|
|
146
154
|
canExecute: false,
|
|
147
155
|
message: failMessage,
|
|
@@ -264,7 +272,6 @@ const Util = {
|
|
|
264
272
|
// 表单页面“成功后” 操作
|
|
265
273
|
afterSuccessOperateInForm (successOperation, formData, isNeedValueMapping, isWorkflowForm) {
|
|
266
274
|
console.log('afterSuccessOperateInForm---successOperation=-', successOperation, formData, isNeedValueMapping)
|
|
267
|
-
setStoreInfo(this.pageCode, '_formData', formData)
|
|
268
275
|
if (!successOperation || successOperation === '' || successOperation === null) {
|
|
269
276
|
// 如果没有配置“成功后”操作,则默认是刷新
|
|
270
277
|
successOperation = 'refresh'
|
|
@@ -272,8 +279,9 @@ const Util = {
|
|
|
272
279
|
if (successOperation === 'noOperation') {
|
|
273
280
|
// 无操作时,更新表单内容
|
|
274
281
|
// 必须加这个代码,否则会导致表单不能连续保存
|
|
275
|
-
if (this.$refs.superForm) {
|
|
282
|
+
if (formData && this.$refs.superForm) {
|
|
276
283
|
this.$refs.superForm.refresh(formData)
|
|
284
|
+
setStoreInfo(this.pageCode, '_formData', formData)
|
|
277
285
|
}
|
|
278
286
|
} else if (successOperation === 'refresh') {
|
|
279
287
|
// 重新加载表单,解决子表权限问题
|
|
@@ -459,52 +467,63 @@ const Util = {
|
|
|
459
467
|
// 返回值为false,不继续执行按钮操作
|
|
460
468
|
return
|
|
461
469
|
}
|
|
462
|
-
|
|
463
|
-
|
|
464
|
-
|
|
465
|
-
|
|
466
|
-
const buttonFun = eval('(' + myJsContent + ')')
|
|
467
|
-
// 运行方法
|
|
468
|
-
request = buttonFun(this, param)
|
|
469
|
-
} else {
|
|
470
|
-
const baseUrl = this.getBaseUrl(system)
|
|
471
|
-
const path = baseUrl + '/dsc/commons/export-reports'
|
|
472
|
-
axios.defaults.headers.common.Authorization = getToken()
|
|
473
|
-
request = axios.post(
|
|
474
|
-
path,
|
|
475
|
-
param, {
|
|
476
|
-
responseType: 'blob'
|
|
477
|
-
}, {
|
|
478
|
-
headers: {
|
|
479
|
-
'content-type': 'application/x-www-form-urlencoded'
|
|
480
|
-
}
|
|
470
|
+
if (isPromise(beforeClickResult)) {
|
|
471
|
+
beforeClickResult.then((result) => {
|
|
472
|
+
if (result) {
|
|
473
|
+
this.exportFormReportSuccess(templateUUID, fileName, myJsContent, entityName, system, logSettingText, taskMap, additionalParamMap, isWorkflowForm, beanName, button, tableName, param)
|
|
481
474
|
}
|
|
482
|
-
)
|
|
483
|
-
}
|
|
484
|
-
request.then((response) => {
|
|
485
|
-
const blob = new Blob([response.data])
|
|
486
|
-
let fileNameTwo = '报告.xlsx'
|
|
487
|
-
if (fileName) {
|
|
488
|
-
fileNameTwo = fileName
|
|
489
|
-
}
|
|
490
|
-
const elink = document.createElement('a')
|
|
491
|
-
elink.download = fileNameTwo
|
|
492
|
-
elink.style.display = 'none'
|
|
493
|
-
elink.target = '_blank'
|
|
494
|
-
elink.href = URL.createObjectURL(blob)
|
|
495
|
-
document.body.appendChild(elink)
|
|
496
|
-
elink.click()
|
|
497
|
-
URL.revokeObjectURL(elink.href) // 释放URL对象
|
|
498
|
-
document.body.removeChild(elink)
|
|
499
|
-
// 调用afterClick回调事件
|
|
500
|
-
this.callAfterClickButton(this.formEvents, this.formViewCode + '__exportForm', {
|
|
501
|
-
params: this.additionalParamMap,
|
|
502
|
-
entity: this.formData
|
|
503
475
|
})
|
|
504
|
-
}
|
|
476
|
+
} else {
|
|
477
|
+
this.exportFormReportSuccess(templateUUID, fileName, myJsContent, entityName, system, logSettingText, taskMap, additionalParamMap, isWorkflowForm, beanName, button, tableName, param)
|
|
478
|
+
}
|
|
505
479
|
})
|
|
506
480
|
}
|
|
507
481
|
},
|
|
482
|
+
exportFormReportSuccess (templateUUID, fileName, myJsContent, entityName, system, logSettingText, taskMap, additionalParamMap, isWorkflowForm, beanName, button, tableName, param) {
|
|
483
|
+
let request
|
|
484
|
+
if (myJsContent) {
|
|
485
|
+
// 将js文本转换为函数,并运行
|
|
486
|
+
// eslint-disable-next-line no-eval
|
|
487
|
+
const buttonFun = eval('(' + myJsContent + ')')
|
|
488
|
+
// 运行方法
|
|
489
|
+
request = buttonFun(this, param)
|
|
490
|
+
} else {
|
|
491
|
+
const baseUrl = this.getBaseUrl(system)
|
|
492
|
+
const path = baseUrl + '/dsc/commons/export-reports'
|
|
493
|
+
axios.defaults.headers.common.Authorization = getToken()
|
|
494
|
+
request = axios.post(
|
|
495
|
+
path,
|
|
496
|
+
param, {
|
|
497
|
+
responseType: 'blob'
|
|
498
|
+
}, {
|
|
499
|
+
headers: {
|
|
500
|
+
'content-type': 'application/x-www-form-urlencoded'
|
|
501
|
+
}
|
|
502
|
+
}
|
|
503
|
+
)
|
|
504
|
+
}
|
|
505
|
+
request.then((response) => {
|
|
506
|
+
const blob = new Blob([response.data])
|
|
507
|
+
let fileNameTwo = '报告.xlsx'
|
|
508
|
+
if (fileName) {
|
|
509
|
+
fileNameTwo = fileName
|
|
510
|
+
}
|
|
511
|
+
const elink = document.createElement('a')
|
|
512
|
+
elink.download = fileNameTwo
|
|
513
|
+
elink.style.display = 'none'
|
|
514
|
+
elink.target = '_blank'
|
|
515
|
+
elink.href = URL.createObjectURL(blob)
|
|
516
|
+
document.body.appendChild(elink)
|
|
517
|
+
elink.click()
|
|
518
|
+
URL.revokeObjectURL(elink.href) // 释放URL对象
|
|
519
|
+
document.body.removeChild(elink)
|
|
520
|
+
// 调用afterClick回调事件
|
|
521
|
+
this.callAfterClickButton(this.formEvents, this.formViewCode + '__exportForm', {
|
|
522
|
+
params: this.additionalParamMap,
|
|
523
|
+
entity: this.formData
|
|
524
|
+
})
|
|
525
|
+
})
|
|
526
|
+
},
|
|
508
527
|
// 首字母大写
|
|
509
528
|
upperFirstCase (str) {
|
|
510
529
|
return str.toLowerCase().replace(/( |^)[a-z]/g, (L) => L.toUpperCase()) // 执行代码
|
|
@@ -653,6 +672,44 @@ const Util = {
|
|
|
653
672
|
})
|
|
654
673
|
},
|
|
655
674
|
jumpToPage (jumpPageSetting, system, dataId, entity, additionalParamMap, ids, buttonCode, pageCode) {
|
|
675
|
+
let canClick = true
|
|
676
|
+
let pageCustomEvents = this.customEvents
|
|
677
|
+
console.log('super-pages---jumpToPage---this.customEvents', pageCustomEvents)
|
|
678
|
+
if (jumpPageSetting.beforeClick) {
|
|
679
|
+
const funName = jumpPageSetting.beforeClick
|
|
680
|
+
console.log('super-pages---jumpToPage---jumpPageSetting.beforeClick', funName)
|
|
681
|
+
let beforeClickEvent
|
|
682
|
+
if (
|
|
683
|
+
pageCustomEvents &&
|
|
684
|
+
funName &&
|
|
685
|
+
funName !== null &&
|
|
686
|
+
pageCustomEvents[funName]
|
|
687
|
+
) {
|
|
688
|
+
beforeClickEvent = pageCustomEvents[funName]
|
|
689
|
+
}
|
|
690
|
+
if (beforeClickEvent) {
|
|
691
|
+
const param = {
|
|
692
|
+
entity: entity,
|
|
693
|
+
additionalParamMap: additionalParamMap,
|
|
694
|
+
ids: ids,
|
|
695
|
+
dataId: dataId
|
|
696
|
+
}
|
|
697
|
+
canClick = beforeClickEvent.call(this, param)
|
|
698
|
+
}
|
|
699
|
+
}
|
|
700
|
+
if (isPromise(canClick)) {
|
|
701
|
+
canClick = canClick.then((result) => {
|
|
702
|
+
if (result === undefined || result === true) {
|
|
703
|
+
this.doJumpPage(jumpPageSetting, system, dataId, entity, additionalParamMap, ids, buttonCode, pageCode)
|
|
704
|
+
}
|
|
705
|
+
})
|
|
706
|
+
} else {
|
|
707
|
+
if (canClick === undefined || canClick === true) {
|
|
708
|
+
this.doJumpPage(jumpPageSetting, system, dataId, entity, additionalParamMap, ids, buttonCode, pageCode)
|
|
709
|
+
}
|
|
710
|
+
}
|
|
711
|
+
},
|
|
712
|
+
doJumpPage (jumpPageSetting, system, dataId, entity, additionalParamMap, ids, buttonCode, pageCode) {
|
|
656
713
|
jumpToPage(jumpPageSetting, system, dataId, entity, additionalParamMap, ids, buttonCode).then((openPageParams) => {
|
|
657
714
|
if (openPageParams) {
|
|
658
715
|
const jumpMode = openPageParams.jumpMode
|
|
@@ -662,6 +719,9 @@ const Util = {
|
|
|
662
719
|
popPageSetting.isRefreshWhenClosePopup = jumpPageSetting.isRefreshWhenClosePopup
|
|
663
720
|
this.jumpPageSetting = popPageSetting
|
|
664
721
|
this.isShowPageDialog = true
|
|
722
|
+
console.log('jumpToPage---pageCode-isShowPageDialog=', pageCode)
|
|
723
|
+
// 存储页面是否有弹框,如果有弹框则super-grid的回车事件不要生效
|
|
724
|
+
sessionStorage.setItem(pageCode + '-isShowPageDialog', true)
|
|
665
725
|
} else if (jumpMode === 'refresh') {
|
|
666
726
|
this.$router.push({
|
|
667
727
|
path: '/dsc/page',
|
|
@@ -754,11 +814,15 @@ const Util = {
|
|
|
754
814
|
} else {
|
|
755
815
|
that.isShowPageDialog = false
|
|
756
816
|
that.jumpPageSetting = null
|
|
817
|
+
console.log('closeInPageEvent---that.pageCode-isShowPageDialog=', that.pageCode)
|
|
818
|
+
sessionStorage.removeItem(that.pageCode + '-isShowPageDialog')
|
|
757
819
|
}
|
|
758
820
|
},
|
|
759
821
|
// 响应关闭弹框事件
|
|
760
822
|
eventBusOnCloseDialog (pageCode, that, buttonCode, successOperation, jumpPageSetting, isRefresh) {
|
|
761
823
|
that.isShowPageDialog = false
|
|
824
|
+
console.log('eventBusOnCloseDialog---that.pageCode-isShowPageDialog=', that.pageCode)
|
|
825
|
+
sessionStorage.removeItem(that.pageCode + '-isShowPageDialog')
|
|
762
826
|
that.jumpPageSetting = null
|
|
763
827
|
if (isRefresh !== undefined && isRefresh !== null && isRefresh === true) {
|
|
764
828
|
const gridRef = that.$refs.grid
|
|
@@ -904,52 +968,63 @@ const Util = {
|
|
|
904
968
|
// 返回值为false,不继续执行按钮操作
|
|
905
969
|
return
|
|
906
970
|
}
|
|
907
|
-
|
|
908
|
-
|
|
909
|
-
|
|
910
|
-
|
|
911
|
-
const buttonFun = eval('(' + myJsContent + ')')
|
|
912
|
-
// 运行方法
|
|
913
|
-
request = buttonFun(this, param)
|
|
914
|
-
} else {
|
|
915
|
-
const baseUrl = this.getBaseUrl(system)
|
|
916
|
-
const path = baseUrl + '/dsc/commons/create-preview-file'
|
|
917
|
-
axios.defaults.headers.common.Authorization = Cookies.get('JWT')
|
|
918
|
-
request = axios.post(
|
|
919
|
-
path,
|
|
920
|
-
param, {}, {
|
|
921
|
-
headers: {
|
|
922
|
-
'content-type': 'application/x-www-form-urlencoded'
|
|
923
|
-
}
|
|
971
|
+
if (isPromise(beforeClickResult)) {
|
|
972
|
+
beforeClickResult.then((result) => {
|
|
973
|
+
if (result) {
|
|
974
|
+
this.previewFormReportSuccess(templateUUID, fileName, myJsContent, entityName, system, logSettingText, taskMap, additionalParamMap, isWorkflowForm, beanName, functionCode, tableName, param)
|
|
924
975
|
}
|
|
925
|
-
)
|
|
926
|
-
}
|
|
927
|
-
|
|
928
|
-
|
|
929
|
-
window.open(previewUrl + '?showName=' + encodeURI(response.data) + '&serverPath=' + encodeURI(response.data))
|
|
930
|
-
// const blob = new Blob([response.data])
|
|
931
|
-
// let fileNameTwo = '报告.xlsx'
|
|
932
|
-
// if (fileName) {
|
|
933
|
-
// fileNameTwo = fileName
|
|
934
|
-
// }
|
|
935
|
-
// const elink = document.createElement('a')
|
|
936
|
-
// elink.download = fileNameTwo
|
|
937
|
-
// elink.style.display = 'none'
|
|
938
|
-
// elink.target = '_blank'
|
|
939
|
-
// elink.href = URL.createObjectURL(blob)
|
|
940
|
-
// document.body.appendChild(elink)
|
|
941
|
-
// elink.click()
|
|
942
|
-
// URL.revokeObjectURL(elink.href) // 释放URL对象
|
|
943
|
-
// document.body.removeChild(elink)
|
|
944
|
-
// // 调用afterClick回调事件
|
|
945
|
-
// this.callAfterClickButton(this.formEvents, this.formViewCode + '__exportForm', {
|
|
946
|
-
// params: this.additionalParamMap,
|
|
947
|
-
// entity: this.formData
|
|
948
|
-
// })
|
|
949
|
-
})
|
|
976
|
+
})
|
|
977
|
+
} else {
|
|
978
|
+
this.previewFormReportSuccess(templateUUID, fileName, myJsContent, entityName, system, logSettingText, taskMap, additionalParamMap, isWorkflowForm, beanName, functionCode, tableName, param)
|
|
979
|
+
}
|
|
950
980
|
})
|
|
951
981
|
}
|
|
952
982
|
},
|
|
983
|
+
previewFormReportSuccess (templateUUID, fileName, myJsContent, entityName, system, logSettingText, taskMap, additionalParamMap, isWorkflowForm, beanName, functionCode, tableName, param) {
|
|
984
|
+
let request
|
|
985
|
+
if (myJsContent) {
|
|
986
|
+
// 将js文本转换为函数,并运行
|
|
987
|
+
// eslint-disable-next-line no-eval
|
|
988
|
+
const buttonFun = eval('(' + myJsContent + ')')
|
|
989
|
+
// 运行方法
|
|
990
|
+
request = buttonFun(this, param)
|
|
991
|
+
} else {
|
|
992
|
+
const baseUrl = this.getBaseUrl(system)
|
|
993
|
+
const path = baseUrl + '/dsc/commons/create-preview-file'
|
|
994
|
+
axios.defaults.headers.common.Authorization = Cookies.get('JWT')
|
|
995
|
+
request = axios.post(
|
|
996
|
+
path,
|
|
997
|
+
param, {}, {
|
|
998
|
+
headers: {
|
|
999
|
+
'content-type': 'application/x-www-form-urlencoded'
|
|
1000
|
+
}
|
|
1001
|
+
}
|
|
1002
|
+
)
|
|
1003
|
+
}
|
|
1004
|
+
request.then((response) => {
|
|
1005
|
+
const previewUrl = Vue.prototype.baseURL + '/component/export-report/preview'
|
|
1006
|
+
window.open(previewUrl + '?showName=' + encodeURI(response.data) + '&serverPath=' + encodeURI(response.data))
|
|
1007
|
+
// const blob = new Blob([response.data])
|
|
1008
|
+
// let fileNameTwo = '报告.xlsx'
|
|
1009
|
+
// if (fileName) {
|
|
1010
|
+
// fileNameTwo = fileName
|
|
1011
|
+
// }
|
|
1012
|
+
// const elink = document.createElement('a')
|
|
1013
|
+
// elink.download = fileNameTwo
|
|
1014
|
+
// elink.style.display = 'none'
|
|
1015
|
+
// elink.target = '_blank'
|
|
1016
|
+
// elink.href = URL.createObjectURL(blob)
|
|
1017
|
+
// document.body.appendChild(elink)
|
|
1018
|
+
// elink.click()
|
|
1019
|
+
// URL.revokeObjectURL(elink.href) // 释放URL对象
|
|
1020
|
+
// document.body.removeChild(elink)
|
|
1021
|
+
// // 调用afterClick回调事件
|
|
1022
|
+
// this.callAfterClickButton(this.formEvents, this.formViewCode + '__exportForm', {
|
|
1023
|
+
// params: this.additionalParamMap,
|
|
1024
|
+
// entity: this.formData
|
|
1025
|
+
// })
|
|
1026
|
+
})
|
|
1027
|
+
},
|
|
953
1028
|
// 重新刷新按钮
|
|
954
1029
|
reviewButton (entity) {
|
|
955
1030
|
if (this.$refs.superForm) {
|