super-page-runtime 2.2.26 → 2.2.29-tmp2
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/dist/es/_virtual/_plugin-vue_export-helper.js +7 -5
- package/dist/es/assets/chart-themes/theme1.js +6 -2
- package/dist/es/assets/chart-themes/theme2.js +6 -2
- package/dist/es/assets/chart-themes/theme3.js +6 -2
- package/dist/es/components/runtime/utils/api/api-util.js +7 -4
- package/dist/es/components/runtime/utils/api/page-expose-util.js +443 -135
- package/dist/es/components/runtime/utils/assemblys-config.js +369 -13
- package/dist/es/components/runtime/utils/barcode-util.js +33 -9
- package/dist/es/components/runtime/utils/charts/chart-columnline-util.js +306 -122
- package/dist/es/components/runtime/utils/charts/chart-gauge-util.js +68 -29
- package/dist/es/components/runtime/utils/charts/chart-pie-util.js +152 -68
- package/dist/es/components/runtime/utils/charts/chart-radar-util.js +124 -46
- package/dist/es/components/runtime/utils/charts/chart-scatter-util.js +99 -36
- package/dist/es/components/runtime/utils/charts/chart-util.js +522 -224
- package/dist/es/components/runtime/utils/common-util.js +156 -76
- package/dist/es/components/runtime/utils/eventBus.js +8 -3
- package/dist/es/components/runtime/utils/events/event-util.js +775 -362
- package/dist/es/components/runtime/utils/events/print-label.js +140 -72
- package/dist/es/components/runtime/utils/events/standard-event.js +2320 -808
- package/dist/es/components/runtime/utils/events/validator-util.js +560 -224
- package/dist/es/components/runtime/utils/form/date-shortcuts.js +88 -28
- package/dist/es/components/runtime/utils/form/scan-util.js +162 -61
- package/dist/es/components/runtime/utils/global-refs.js +84 -53
- package/dist/es/components/runtime/utils/i18n-util.js +20 -11
- package/dist/es/components/runtime/utils/interfaces/page-design-types.js +7 -2
- package/dist/es/components/runtime/utils/page-helper-util.js +660 -279
- package/dist/es/components/runtime/utils/page-init-util.js +406 -141
- package/dist/es/components/runtime/utils/page-permission-util.js +531 -22
- package/dist/es/components/runtime/utils/page-store.js +68 -23
- package/dist/es/components/runtime/utils/store-util.js +13 -9
- package/dist/es/components/runtime/utils/store.js +2 -2
- package/dist/es/components/runtime/utils/table-utils.js +81 -40
- package/dist/es/components/runtime/utils/tree-utils.js +37 -17
- package/dist/es/components/runtime/views/assemblys/button/button/button-runtime.vue.js +2 -2
- package/dist/es/components/runtime/views/assemblys/button/button/button-runtime.vue2.js +83 -21
- package/dist/es/components/runtime/views/assemblys/button/button-group/buttongroup-runtime.vue.js +2 -2
- package/dist/es/components/runtime/views/assemblys/button/button-group/buttongroup-runtime.vue2.js +46 -14
- package/dist/es/components/runtime/views/assemblys/button/dropdown/dropdown-runtime.vue.js +2 -2
- package/dist/es/components/runtime/views/assemblys/button/dropdown/dropdown-runtime.vue2.js +132 -36
- package/dist/es/components/runtime/views/assemblys/button/export-pdf/exportpdf-runtime.vue.js +2 -2
- package/dist/es/components/runtime/views/assemblys/button/export-pdf/exportpdf-runtime.vue2.js +18 -4
- package/dist/es/components/runtime/views/assemblys/button/print-label/printlabel-runtime.vue.js +2 -2
- package/dist/es/components/runtime/views/assemblys/button/print-label/printlabel-runtime.vue2.js +107 -17
- package/dist/es/components/runtime/views/assemblys/chart/column-line/column-line-runtime.vue.js +2 -2
- package/dist/es/components/runtime/views/assemblys/chart/column-line/column-line-runtime.vue2.js +198 -50
- package/dist/es/components/runtime/views/assemblys/chart/common/common-chart-header-breadcrumb.vue.js +42 -12
- package/dist/es/components/runtime/views/assemblys/chart/common/common-chart-header-breadcrumb.vue2.js +2 -2
- package/dist/es/components/runtime/views/assemblys/chart/common/common-chart-header-group.vue.js +60 -7
- package/dist/es/components/runtime/views/assemblys/chart/common/common-chart-header-group.vue2.js +2 -2
- package/dist/es/components/runtime/views/assemblys/chart/common/common-chart-header.vue.js +203 -52
- package/dist/es/components/runtime/views/assemblys/chart/common/common-chart-header.vue2.js +2 -2
- package/dist/es/components/runtime/views/assemblys/chart/common/common-homepage-search.vue.js +4 -4
- package/dist/es/components/runtime/views/assemblys/chart/common/common-homepage-search.vue2.js +162 -46
- package/dist/es/components/runtime/views/assemblys/chart/gauge/gauge-runtime.vue.js +2 -2
- package/dist/es/components/runtime/views/assemblys/chart/gauge/gauge-runtime.vue2.js +109 -32
- package/dist/es/components/runtime/views/assemblys/chart/pie/pie-runtime.vue.js +2 -2
- package/dist/es/components/runtime/views/assemblys/chart/pie/pie-runtime.vue2.js +166 -43
- package/dist/es/components/runtime/views/assemblys/chart/radar/radar-runtime.vue.js +2 -2
- package/dist/es/components/runtime/views/assemblys/chart/radar/radar-runtime.vue2.js +117 -32
- package/dist/es/components/runtime/views/assemblys/chart/scatter/scatter-runtime.vue.js +2 -2
- package/dist/es/components/runtime/views/assemblys/chart/scatter/scatter-runtime.vue2.js +118 -32
- package/dist/es/components/runtime/views/assemblys/chart/table/chart-table-util.js +597 -246
- package/dist/es/components/runtime/views/assemblys/chart/table/group-column-item.vue.js +42 -4
- package/dist/es/components/runtime/views/assemblys/chart/table/group-column-item.vue2.js +2 -2
- package/dist/es/components/runtime/views/assemblys/chart/table/group-column.vue.js +62 -8
- package/dist/es/components/runtime/views/assemblys/chart/table/group-column.vue2.js +2 -2
- package/dist/es/components/runtime/views/assemblys/chart/table/normal-column.vue.js +160 -29
- package/dist/es/components/runtime/views/assemblys/chart/table/normal-column.vue2.js +2 -2
- package/dist/es/components/runtime/views/assemblys/chart/table/table-pageination.vue.js +62 -13
- package/dist/es/components/runtime/views/assemblys/chart/table/table-pageination.vue2.js +2 -2
- package/dist/es/components/runtime/views/assemblys/chart/table/table-runtime.vue.js +2 -2
- package/dist/es/components/runtime/views/assemblys/chart/table/table-runtime.vue2.js +594 -212
- package/dist/es/components/runtime/views/assemblys/common/export-form-report-dialog.vue.js +139 -29
- package/dist/es/components/runtime/views/assemblys/common/export-form-report-dialog.vue2.js +2 -2
- package/dist/es/components/runtime/views/assemblys/common/remove-signer-dialog.vue.js +125 -21
- package/dist/es/components/runtime/views/assemblys/common/remove-signer-dialog.vue2.js +2 -2
- package/dist/es/components/runtime/views/assemblys/common/task-informition-dialog.vue.js +102 -16
- package/dist/es/components/runtime/views/assemblys/common/task-informition-dialog.vue2.js +2 -2
- package/dist/es/components/runtime/views/assemblys/container/card/card-runtime.vue.js +2 -2
- package/dist/es/components/runtime/views/assemblys/container/card/card-runtime.vue2.js +81 -18
- package/dist/es/components/runtime/views/assemblys/container/collapse/collapse-runtime.vue.js +2 -2
- package/dist/es/components/runtime/views/assemblys/container/collapse/collapse-runtime.vue2.js +82 -17
- package/dist/es/components/runtime/views/assemblys/container/container/container-runtime.vue.js +2 -2
- package/dist/es/components/runtime/views/assemblys/container/container/container-runtime.vue2.js +86 -14
- package/dist/es/components/runtime/views/assemblys/container/flex/flex-runtime.vue.js +2 -2
- package/dist/es/components/runtime/views/assemblys/container/flex/flex-runtime.vue2.js +79 -21
- package/dist/es/components/runtime/views/assemblys/container/form/form-runtime.vue.js +2 -2
- package/dist/es/components/runtime/views/assemblys/container/form/form-runtime.vue2.js +61 -16
- package/dist/es/components/runtime/views/assemblys/container/iframe/iframe-runtime.vue.js +2 -2
- package/dist/es/components/runtime/views/assemblys/container/iframe/iframe-runtime.vue2.js +37 -10
- package/dist/es/components/runtime/views/assemblys/container/tabs/tabs-runtime.vue.js +2 -2
- package/dist/es/components/runtime/views/assemblys/container/tabs/tabs-runtime.vue2.js +127 -38
- package/dist/es/components/runtime/views/assemblys/container/tools/tools-runtime.vue.js +2 -2
- package/dist/es/components/runtime/views/assemblys/container/tools/tools-runtime.vue2.js +76 -28
- package/dist/es/components/runtime/views/assemblys/data/bar-code/barcode-runtime.vue.js +2 -2
- package/dist/es/components/runtime/views/assemblys/data/bar-code/barcode-runtime.vue2.js +178 -61
- package/dist/es/components/runtime/views/assemblys/data/table/main-table-runtime.vue.js +810 -302
- package/dist/es/components/runtime/views/assemblys/data/table/main-table-runtime.vue2.js +2 -2
- package/dist/es/components/runtime/views/assemblys/data/table/sub-table-runtime.vue.js +635 -262
- package/dist/es/components/runtime/views/assemblys/data/table/sub-table-runtime.vue2.js +2 -2
- package/dist/es/components/runtime/views/assemblys/data/table/table-runtime.vue.js +2 -2
- package/dist/es/components/runtime/views/assemblys/data/table/table-runtime.vue2.js +115 -40
- package/dist/es/components/runtime/views/assemblys/data/tree/tree-runtime.vue.js +2 -2
- package/dist/es/components/runtime/views/assemblys/data/tree/tree-runtime.vue2.js +215 -56
- package/dist/es/components/runtime/views/assemblys/error-render.vue.js +21 -3
- package/dist/es/components/runtime/views/assemblys/error-render.vue2.js +2 -2
- package/dist/es/components/runtime/views/assemblys/form/checkbox/checkbox-runtime.vue.js +2 -2
- package/dist/es/components/runtime/views/assemblys/form/checkbox/checkbox-runtime.vue2.js +154 -42
- package/dist/es/components/runtime/views/assemblys/form/common/title-suffix-element.vue.js +98 -34
- package/dist/es/components/runtime/views/assemblys/form/common/title-suffix-element.vue2.js +2 -2
- package/dist/es/components/runtime/views/assemblys/form/custom/custom-runtime.vue.js +2 -2
- package/dist/es/components/runtime/views/assemblys/form/custom/custom-runtime.vue2.js +200 -52
- package/dist/es/components/runtime/views/assemblys/form/date-picker/datepicker-runtime.vue.js +2 -2
- package/dist/es/components/runtime/views/assemblys/form/date-picker/datepicker-runtime.vue2.js +239 -68
- package/dist/es/components/runtime/views/assemblys/form/dept-tree/depttree-runtime.vue.js +2 -2
- package/dist/es/components/runtime/views/assemblys/form/dept-tree/depttree-runtime.vue2.js +109 -31
- package/dist/es/components/runtime/views/assemblys/form/divider/divider-runtime.vue.js +2 -2
- package/dist/es/components/runtime/views/assemblys/form/divider/divider-runtime.vue2.js +59 -21
- package/dist/es/components/runtime/views/assemblys/form/file-upload/fileupload-runtime.vue.js +2 -2
- package/dist/es/components/runtime/views/assemblys/form/file-upload/fileupload-runtime.vue2.js +188 -56
- package/dist/es/components/runtime/views/assemblys/form/input-number/input-number-runtime.vue.js +2 -2
- package/dist/es/components/runtime/views/assemblys/form/input-number/input-number-runtime.vue2.js +103 -22
- package/dist/es/components/runtime/views/assemblys/form/input-text/inputtext-runtime.vue.js +2 -2
- package/dist/es/components/runtime/views/assemblys/form/input-text/inputtext-runtime.vue2.js +245 -57
- package/dist/es/components/runtime/views/assemblys/form/label/label-runtime.vue.js +2 -2
- package/dist/es/components/runtime/views/assemblys/form/label/label-runtime.vue2.js +174 -32
- package/dist/es/components/runtime/views/assemblys/form/link/link-runtime.vue.js +2 -2
- package/dist/es/components/runtime/views/assemblys/form/link/link-runtime.vue2.js +107 -28
- package/dist/es/components/runtime/views/assemblys/form/placeholder/placeholder-runtime.vue.js +4 -4
- package/dist/es/components/runtime/views/assemblys/form/placeholder/placeholder-runtime.vue2.js +50 -13
- package/dist/es/components/runtime/views/assemblys/form/radio/radio-runtime.vue.js +2 -2
- package/dist/es/components/runtime/views/assemblys/form/radio/radio-runtime.vue2.js +194 -64
- package/dist/es/components/runtime/views/assemblys/form/rich-text/richtext-runtime.vue.js +2 -2
- package/dist/es/components/runtime/views/assemblys/form/rich-text/richtext-runtime.vue2.js +249 -88
- package/dist/es/components/runtime/views/assemblys/form/select/select-runtime.vue.js +2 -2
- package/dist/es/components/runtime/views/assemblys/form/select/select-runtime.vue2.js +263 -80
- package/dist/es/components/runtime/views/assemblys/form/separatelabel/separatelabel-runtime.vue.js +2 -2
- package/dist/es/components/runtime/views/assemblys/form/separatelabel/separatelabel-runtime.vue2.js +57 -13
- package/dist/es/components/runtime/views/assemblys/form/switch/switch-runtime.vue.js +2 -2
- package/dist/es/components/runtime/views/assemblys/form/switch/switch-runtime.vue2.js +155 -30
- package/dist/es/components/runtime/views/assemblys/form/tag/tag-runtime.vue.js +2 -2
- package/dist/es/components/runtime/views/assemblys/form/tag/tag-runtime.vue2.js +129 -40
- package/dist/es/components/runtime/views/assemblys/form/textarea/textarea-runtime.vue.js +2 -2
- package/dist/es/components/runtime/views/assemblys/form/textarea/textarea-runtime.vue2.js +107 -22
- package/dist/es/components/runtime/views/assemblys/home-chart-render.vue.js +188 -89
- package/dist/es/components/runtime/views/assemblys/home-chart-render.vue2.js +2 -2
- package/dist/es/components/runtime/views/assemblys/object-render.vue.js +272 -133
- package/dist/es/components/runtime/views/assemblys/object-render.vue2.js +2 -2
- package/dist/es/components/runtime/views/assemblys/workflow/picture-flow/pictureflow-runtime.vue.js +2 -2
- package/dist/es/components/runtime/views/assemblys/workflow/picture-flow/pictureflow-runtime.vue2.js +46 -18
- package/dist/es/components/runtime/views/assemblys/workflow/text-history/textflow-runtime.vue.js +2 -2
- package/dist/es/components/runtime/views/assemblys/workflow/text-history/textflow-runtime.vue2.js +49 -21
- package/dist/es/components/runtime/views/assemblys/workflow/workflow-button/workflowbutton-runtime.vue.js +2 -2
- package/dist/es/components/runtime/views/assemblys/workflow/workflow-button/workflowbutton-runtime.vue2.js +58 -20
- package/dist/es/components/runtime/views/assemblys/workflow/workflow-node/workflownode-runtime.vue.js +2 -2
- package/dist/es/components/runtime/views/assemblys/workflow/workflow-node/workflownode-runtime.vue2.js +53 -16
- package/dist/es/components/runtime/views/home-chart.vue.js +160 -40
- package/dist/es/components/runtime/views/home-chart.vue2.js +2 -2
- package/dist/es/components/runtime/views/super-page-dialog.vue.js +139 -20
- package/dist/es/components/runtime/views/super-page-dialog.vue2.js +2 -2
- package/dist/es/components/runtime/views/super-page.vue.js +754 -226
- package/dist/es/components/runtime/views/super-page.vue2.js +2 -2
- package/dist/es/i18n/langs/cn.js +55 -2
- package/dist/es/i18n/langs/en.js +55 -2
- package/package.json +2 -2
|
@@ -1,875 +1,2387 @@
|
|
|
1
|
-
import { deepCopy
|
|
2
|
-
import
|
|
3
|
-
import { getI18n
|
|
4
|
-
import { ElMessage
|
|
5
|
-
import { getToken
|
|
6
|
-
import { getComponentRef
|
|
7
|
-
import
|
|
8
|
-
import
|
|
9
|
-
import { handleEvent
|
|
10
|
-
import { setStoreInfo
|
|
11
|
-
import { getPermissionCodes
|
|
12
|
-
import { updateChartDatasources
|
|
13
|
-
import
|
|
14
|
-
import { getTableNameByTableUuid
|
|
15
|
-
import { getWorkflowRules
|
|
16
|
-
import { functions
|
|
17
|
-
import { usePageContextStore
|
|
18
|
-
const
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
},
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
},
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
1
|
+
import { deepCopy, isWorkflowPage, isArrayFn, getBaseUrl, getRealRestApiPath, packageTemplateFiles, upperFirstCase, getListCode } from "../common-util.js";
|
|
2
|
+
import http from "agilebuilder-ui/src/utils/request";
|
|
3
|
+
import { getI18n } from "agilebuilder-ui/src/utils/util";
|
|
4
|
+
import { ElMessage, ElMessageBox } from "element-plus";
|
|
5
|
+
import { getToken, getSessionCache, setSessionCache } from "agilebuilder-ui/src/utils/auth";
|
|
6
|
+
import { getComponentRef } from "../global-refs.js";
|
|
7
|
+
import bus from "../eventBus.js";
|
|
8
|
+
import axios from "axios";
|
|
9
|
+
import { handleEvent, getTableUuid, doAfterClickEvent } from "./event-util.js";
|
|
10
|
+
import { setStoreInfo } from "../store-util.js";
|
|
11
|
+
import { getPermissionCodes, getDefaultValue, getModelFields } from "../page-init-util.js";
|
|
12
|
+
import { updateChartDatasources, caculateShowCondition, getVariableValue, setVariableValue } from "../page-helper-util.js";
|
|
13
|
+
import printLabelUtil from "./print-label.js";
|
|
14
|
+
import { getTableNameByTableUuid } from "../table-utils.js";
|
|
15
|
+
import { getWorkflowRules, packageCustomRules } from "./validator-util.js";
|
|
16
|
+
import { functions } from "../api/page-expose-util.js";
|
|
17
|
+
import { usePageContextStore } from "../page-store.js";
|
|
18
|
+
const standardEvents = {
|
|
19
|
+
// 表单标准事件保存save
|
|
20
|
+
save: function(params) {
|
|
21
|
+
console.log("表单标准事件保存save--params=", params);
|
|
22
|
+
return saveFunc(params, false);
|
|
23
|
+
},
|
|
24
|
+
// 列表标准事件保存saveList
|
|
25
|
+
saveList: function(params) {
|
|
26
|
+
console.log("列表标准事件保存saveList--params=", params);
|
|
27
|
+
return saveFunc(params, true);
|
|
28
|
+
},
|
|
29
|
+
// 表单标准事件导出报告exportForm
|
|
30
|
+
exportForm: function(params) {
|
|
31
|
+
console.log("表单标准事件导出报告exportForm--params=", params);
|
|
32
|
+
const pageContext = params.pageContext;
|
|
33
|
+
const pagCode = pageContext.code;
|
|
34
|
+
const eventPageInfo = pagCode + "_";
|
|
35
|
+
bus.$emit(eventPageInfo + "export-form-report", params);
|
|
36
|
+
},
|
|
37
|
+
// 表单标准事件导出报告exportPDF
|
|
38
|
+
exportPDF: function(params) {
|
|
39
|
+
console.log("表单标准事件导出报告exportPDF--params=", params);
|
|
40
|
+
const pageContext = params.pageContext;
|
|
41
|
+
const pagCode = pageContext.code;
|
|
42
|
+
const eventPageInfo = pagCode + "_";
|
|
43
|
+
bus.$emit(eventPageInfo + "export-pdf-report", params);
|
|
44
|
+
},
|
|
45
|
+
// 表单标准事件提交submit
|
|
46
|
+
submit: function(params) {
|
|
47
|
+
console.log("表单标准事件提交submit--params=", params);
|
|
48
|
+
return submitForm(params, false, "submit", "/dsc/commons/submits");
|
|
49
|
+
},
|
|
50
|
+
// 列表标准事件提交submitList
|
|
51
|
+
submitList: function(params) {
|
|
52
|
+
console.log("列表标准事件提交submitList--params=", params);
|
|
53
|
+
return submitForm(params, true, "submit", "/dsc/commons/batch-submits");
|
|
54
|
+
},
|
|
55
|
+
// 表单标准事件同意agree
|
|
56
|
+
agree: function(params) {
|
|
57
|
+
console.log("表单标准事件同意agree--params=", params);
|
|
58
|
+
return submitForm(params, false, "agree", "/dsc/commons/approves");
|
|
59
|
+
},
|
|
60
|
+
// 列表标准事件同意agreeList
|
|
61
|
+
agreeList: function(params) {
|
|
62
|
+
console.log("列表标准事件同意agreeList--params=", params);
|
|
63
|
+
return submitForm(params, true, "agree", "/dsc/commons/batch-approves");
|
|
64
|
+
},
|
|
65
|
+
// 表单标准事件不同意disagree
|
|
66
|
+
disagree: function(params) {
|
|
67
|
+
console.log("表单标准事件不同意disagree--params=", params);
|
|
68
|
+
return submitForm(params, false, "disagree", "/dsc/commons/refuses");
|
|
69
|
+
},
|
|
70
|
+
// 列表标准事件不同意disagreeList
|
|
71
|
+
disagreeList: function(params) {
|
|
72
|
+
console.log("列表标准事件不同意disagreeList--params=", params);
|
|
73
|
+
return submitForm(params, true, "disagree", "/dsc/commons/batch-refuses");
|
|
74
|
+
},
|
|
75
|
+
// TODO: 待页面跳转功能完善后再实现
|
|
76
|
+
back: function(params) {
|
|
77
|
+
console.log("表单标准事件返回back--params=", params);
|
|
78
|
+
const pageContext = params.pageContext;
|
|
79
|
+
const dataModel = pageContext.entity ? pageContext.entity.data : {};
|
|
80
|
+
const isNeedValueMapping = params.configureObj.props && params.configureObj.props.base ? params.configureObj.props.base.isNeedValueMapping : false;
|
|
81
|
+
closeDialog(pageContext, dataModel, isNeedValueMapping);
|
|
82
|
+
},
|
|
83
|
+
// 列表标准事件删除delete
|
|
84
|
+
delete: function(params) {
|
|
85
|
+
console.log("列表标准事件删除delete--params=", params);
|
|
86
|
+
return deleteFunc(params);
|
|
87
|
+
},
|
|
88
|
+
// 列表标准事件下载导入模板downloadTemplate
|
|
89
|
+
downloadTemplate: function(params) {
|
|
90
|
+
console.log("列表标准事件下载导入模板downloadTemplate--params=", params);
|
|
91
|
+
downloadTemplateFunc(params);
|
|
92
|
+
},
|
|
93
|
+
// 列表标准事件 导入import
|
|
94
|
+
import: function(params) {
|
|
95
|
+
console.log("列表标准事件 导入import--params=", params);
|
|
96
|
+
const pageContext = params.pageContext;
|
|
97
|
+
const pagCode = pageContext.code;
|
|
98
|
+
const eventPageInfo = pagCode + "_";
|
|
99
|
+
bus.$emit(eventPageInfo + "import-file", params);
|
|
100
|
+
},
|
|
101
|
+
// 列表标准事件 导出export
|
|
102
|
+
export: function(params) {
|
|
103
|
+
console.log("列表标准事件 导出export--params=", params);
|
|
104
|
+
return exportFunc(params);
|
|
105
|
+
},
|
|
106
|
+
// 列表标准事件 查询search
|
|
107
|
+
search: function(params) {
|
|
108
|
+
console.log("列表标准事件 刷新列表 search--params=", params);
|
|
109
|
+
const pageContext = params.pageContext;
|
|
110
|
+
const tableUuid = params.tableUuid;
|
|
111
|
+
const gridRef = getComponentRef(pageContext, tableUuid);
|
|
112
|
+
gridRef.refresh();
|
|
113
|
+
},
|
|
114
|
+
showSearch: function(params) {
|
|
115
|
+
console.log("列表标准事件 显示查询区域 showSearch--params=", params);
|
|
116
|
+
const pageContext = params.pageContext;
|
|
117
|
+
const tableUuid = params.tableUuid;
|
|
118
|
+
const gridRef = getComponentRef(pageContext, tableUuid);
|
|
119
|
+
gridRef.showMobileSearch();
|
|
120
|
+
},
|
|
121
|
+
// 流程表单标准事件 暂存workflowSave
|
|
122
|
+
workflowSave: function(params) {
|
|
123
|
+
console.log("流程表单标准事件 暂存workflowSave--params=", params);
|
|
124
|
+
return workflowSaveFunc(params);
|
|
125
|
+
},
|
|
126
|
+
// 流程表单标准事件 提交流程submitProcess
|
|
127
|
+
submitProcess: function(params) {
|
|
128
|
+
console.log("流程表单标准事件 提交流程submitProcess--params=", params);
|
|
129
|
+
return submitProcessFunc(params);
|
|
130
|
+
},
|
|
131
|
+
// 流程表单标准事件 提交任务submitTask
|
|
132
|
+
submitTask: function(params) {
|
|
133
|
+
console.log("流程表单标准事件 提交任务submitTask--params=", params);
|
|
134
|
+
return completeTaskFunc(params, "SUBMIT");
|
|
135
|
+
},
|
|
136
|
+
// 流程表单标准事件 同意approve
|
|
137
|
+
approve: function(params) {
|
|
138
|
+
console.log("流程表单标准事件 同意approve--params=", params);
|
|
139
|
+
return completeTaskFunc(params, "APPROVE");
|
|
140
|
+
},
|
|
141
|
+
// 流程表单标准事件 不同意refuse
|
|
142
|
+
refuse: function(params) {
|
|
143
|
+
console.log("流程表单标准事件 不同意refuse--params=", params);
|
|
144
|
+
return completeTaskFunc(params, "REFUSE");
|
|
145
|
+
},
|
|
146
|
+
// 流程表单标准事件 已阅readed
|
|
147
|
+
readed: function(params) {
|
|
148
|
+
console.log("流程表单标准事件 已阅readed--params=", params);
|
|
149
|
+
return completeTaskFunc(params, "READED");
|
|
150
|
+
},
|
|
151
|
+
// 流程表单标准事件 赞成agreemen
|
|
152
|
+
agreement: function(params) {
|
|
153
|
+
console.log("流程表单标准事件 赞成agreement--params=", params);
|
|
154
|
+
return completeTaskFunc(params, "AGREEMENT");
|
|
155
|
+
},
|
|
156
|
+
// 流程表单标准事件 反对oppose
|
|
157
|
+
oppose: function(params) {
|
|
158
|
+
console.log("流程表单标准事件 反对oppose--params=", params);
|
|
159
|
+
return completeTaskFunc(params, "OPPOSE");
|
|
160
|
+
},
|
|
161
|
+
// 流程表单标准事件 弃权kiken
|
|
162
|
+
kiken: function(params) {
|
|
163
|
+
console.log("流程表单标准事件 弃权kiken--params=", params);
|
|
164
|
+
return completeTaskFunc(params, "KIKEN");
|
|
165
|
+
},
|
|
166
|
+
// 流程表单标准事件 指派assign
|
|
167
|
+
assign: function(params) {
|
|
168
|
+
console.log("流程表单标准事件 指派assign--params=", params);
|
|
169
|
+
return assignTask(params);
|
|
170
|
+
},
|
|
171
|
+
// 流程表单标准事件 抄送copyTask
|
|
172
|
+
copyTask: function(params) {
|
|
173
|
+
console.log("流程表单标准事件 抄送copyTask--params=", params);
|
|
174
|
+
return createCopyTask(params);
|
|
175
|
+
},
|
|
176
|
+
// 流程表单标准事件 加签addSigner
|
|
177
|
+
addSigner: function(params) {
|
|
178
|
+
console.log("流程表单标准事件 加签addSigner--params=", params);
|
|
179
|
+
return addSignerFunc(params);
|
|
180
|
+
},
|
|
181
|
+
// 流程表单标准事件 领取drawTask
|
|
182
|
+
drawTask: function(params) {
|
|
183
|
+
console.log("流程表单标准事件 领取drawTask--params=", params);
|
|
184
|
+
return drawTaskFunc(params);
|
|
185
|
+
},
|
|
186
|
+
// 放弃领取abandonReceive
|
|
187
|
+
abandonReceive: function(params) {
|
|
188
|
+
console.log("流程表单标准事件 放弃领取abandonReceive--params=", params);
|
|
189
|
+
return abandonReceiveFunc(params);
|
|
190
|
+
},
|
|
191
|
+
// 流程表单标准事件 驳回returnToPreviousTask
|
|
192
|
+
returnToPreviousTask: function(params) {
|
|
193
|
+
console.log("流程表单标准事件 驳回returnToPreviousTask--params=", params);
|
|
194
|
+
return returnToPreviousTaskFunc(params);
|
|
195
|
+
},
|
|
196
|
+
// 流程表单标准事件 强制结束endInstance
|
|
197
|
+
endInstance: function(params) {
|
|
198
|
+
console.log("流程表单标准事件 强制结束endInstance--params=", params);
|
|
199
|
+
return endInstanceFunc(params);
|
|
200
|
+
},
|
|
201
|
+
// 流程表单标准事件 退回returnTaskTo
|
|
202
|
+
returnTaskTo: function(params) {
|
|
203
|
+
console.log("流程表单标准事件 退回returnTaskTo--params=", params);
|
|
204
|
+
return returnTaskToFunc(params);
|
|
205
|
+
},
|
|
206
|
+
// 流程表单标准事件 减签removeSigner
|
|
207
|
+
removeSigner: function(params) {
|
|
208
|
+
console.log("流程表单标准事件 减签removeSigner--params=", params);
|
|
209
|
+
return removeSignerfunc(params);
|
|
210
|
+
},
|
|
211
|
+
// 流程表单标准事件 取回retrieveTask
|
|
212
|
+
retrieveTask: function(params) {
|
|
213
|
+
console.log("流程表单标准事件 取回retrieveTask--params=", params);
|
|
214
|
+
return retrieveTaskFunc(params);
|
|
215
|
+
},
|
|
216
|
+
viewDetail: function(params) {
|
|
217
|
+
},
|
|
218
|
+
lineEditCreate: function(params) {
|
|
219
|
+
console.log("列表行编辑 新建lineEditCreate--params=", params);
|
|
220
|
+
return lineEditCreateFunc(params);
|
|
221
|
+
},
|
|
222
|
+
printLabel: function(params) {
|
|
223
|
+
console.log("打印标签 打印标签事件--params=", params);
|
|
224
|
+
return printLabel(params);
|
|
225
|
+
},
|
|
226
|
+
queryCharts: function(params) {
|
|
227
|
+
console.log("查询统计图--params=", params);
|
|
228
|
+
queryPageCharts(params);
|
|
229
|
+
},
|
|
230
|
+
resetCharts: function(params) {
|
|
231
|
+
var _a, _b;
|
|
232
|
+
console.log("重置统计图--params=", params);
|
|
233
|
+
const pageContext = params.pageContext;
|
|
234
|
+
pageContext.entity.data = deepCopy((_a = pageContext.initChartData) == null ? void 0 : _a.data);
|
|
235
|
+
pageContext.entity.page = deepCopy((_b = pageContext.initChartData) == null ? void 0 : _b.page);
|
|
236
|
+
params.isInitChart = true;
|
|
237
|
+
queryPageCharts(params);
|
|
238
|
+
},
|
|
239
|
+
exportCharts: function(params) {
|
|
240
|
+
console.log("导出统计图--params=", params);
|
|
241
|
+
exportPageCharts(params);
|
|
242
|
+
}
|
|
243
|
+
};
|
|
244
|
+
function queryPageCharts(params) {
|
|
245
|
+
const pageContext = params.pageContext;
|
|
246
|
+
const chartConfigs = pageContext.initChartServiceConfigs;
|
|
247
|
+
if (!chartConfigs || chartConfigs.length == 0) {
|
|
248
|
+
console.log("无需要查询的统计图数据");
|
|
249
|
+
return;
|
|
250
|
+
}
|
|
251
|
+
const configure = params.configureObj;
|
|
252
|
+
let runtimeProps = null;
|
|
253
|
+
if (configure && configure.runtime) {
|
|
254
|
+
runtimeProps = configure.runtime.props;
|
|
255
|
+
}
|
|
256
|
+
const hisState = runtimeProps ? runtimeProps.state : void 0;
|
|
257
|
+
if (runtimeProps) {
|
|
258
|
+
runtimeProps.state = "disabled";
|
|
259
|
+
}
|
|
260
|
+
updateChartDatasources(pageContext, chartConfigs, void 0, params.isInitChart).then(() => {
|
|
261
|
+
if (runtimeProps) {
|
|
262
|
+
runtimeProps.state = hisState;
|
|
263
|
+
}
|
|
264
|
+
}).catch(() => {
|
|
265
|
+
if (runtimeProps) {
|
|
266
|
+
runtimeProps.state = hisState;
|
|
267
|
+
}
|
|
268
|
+
});
|
|
269
|
+
}
|
|
270
|
+
function exportPageCharts(params) {
|
|
271
|
+
const pageContext = params.pageContext;
|
|
272
|
+
const allChartUuids = pageContext.allChartUuids;
|
|
273
|
+
if (!allChartUuids || allChartUuids.length == 0) {
|
|
274
|
+
console.log("无需要导出的统计图数据");
|
|
275
|
+
return;
|
|
276
|
+
}
|
|
277
|
+
const configure = params.configureObj;
|
|
278
|
+
let runtimeProps = null;
|
|
279
|
+
if (configure && configure.runtime) {
|
|
280
|
+
runtimeProps = configure.runtime.props;
|
|
281
|
+
}
|
|
282
|
+
const hisState = runtimeProps ? runtimeProps.state : void 0;
|
|
283
|
+
if (runtimeProps) {
|
|
284
|
+
runtimeProps.state = "disabled";
|
|
285
|
+
}
|
|
286
|
+
const exportChartList = [];
|
|
287
|
+
for (let i = 0; i < allChartUuids.length; i++) {
|
|
288
|
+
const chartUuid = allChartUuids[i];
|
|
289
|
+
const componentObj = getComponentRef(pageContext, chartUuid);
|
|
290
|
+
if (componentObj) {
|
|
291
|
+
const chartConfig = componentObj.getConfigure();
|
|
292
|
+
if (chartConfig && chartConfig.exportable && chartConfig._dynamicShowFlag && componentObj.exportChart) {
|
|
293
|
+
exportChartList.push(componentObj.exportChart());
|
|
294
|
+
}
|
|
295
|
+
}
|
|
296
|
+
}
|
|
297
|
+
if (!exportChartList || exportChartList.length == 0) {
|
|
298
|
+
console.log("无需要导出的统计图数据");
|
|
299
|
+
return;
|
|
300
|
+
}
|
|
301
|
+
let exportFileName;
|
|
302
|
+
let pageName = pageContext.label;
|
|
303
|
+
if (!pageName) {
|
|
304
|
+
pageName = pageContext.code;
|
|
305
|
+
}
|
|
306
|
+
exportFileName = pageName;
|
|
307
|
+
const param = {
|
|
308
|
+
reportDataList: exportChartList,
|
|
309
|
+
beanName: pageContext.beanName
|
|
310
|
+
};
|
|
311
|
+
const backendUrl = pageContext.backendUrl;
|
|
312
|
+
let request;
|
|
313
|
+
const baseUrl = getBaseUrl(backendUrl, pageContext.isTest);
|
|
314
|
+
const path = baseUrl + "/dsc/commons/exportChart";
|
|
315
|
+
axios.defaults.headers.common.Authorization = getToken();
|
|
316
|
+
request = axios.post(path, param, { responseType: "blob" });
|
|
317
|
+
request.then((res) => {
|
|
318
|
+
const link = document.createElement("a");
|
|
319
|
+
link.style.display = "none";
|
|
320
|
+
link.href = URL.createObjectURL(res.data);
|
|
321
|
+
link.setAttribute("download", exportFileName + ".xlsx");
|
|
322
|
+
document.body.appendChild(link);
|
|
323
|
+
link.click();
|
|
324
|
+
document.body.removeChild(link);
|
|
325
|
+
}).finally(() => {
|
|
326
|
+
if (runtimeProps) {
|
|
327
|
+
runtimeProps.state = hisState;
|
|
328
|
+
}
|
|
329
|
+
});
|
|
330
|
+
}
|
|
331
|
+
function exportFormReport(pageContext, configureObj, templateFile, isPdf) {
|
|
332
|
+
var _a;
|
|
333
|
+
const templateUUID = templateFile.templateUuid;
|
|
334
|
+
const fileName = templateFile.templateName;
|
|
335
|
+
const systemCode = pageContext.systemCode;
|
|
336
|
+
const logSetting = (_a = configureObj.props.base) == null ? void 0 : _a.logSetting;
|
|
337
|
+
const isWorkflowForm = isWorkflowPage(pageContext);
|
|
338
|
+
const beanName = pageContext.beanName;
|
|
339
|
+
const button = configureObj.props.base;
|
|
340
|
+
const tableName = configureObj.tableName ? configureObj.tableName : pageContext.tableName;
|
|
341
|
+
const backendUrl = pageContext.backendUrl;
|
|
342
|
+
const viewModels = functions.getFormViewData(pageContext);
|
|
343
|
+
console.log("exportFormReport----viewModels=", viewModels);
|
|
344
|
+
const isPermission = button.isPermission === void 0 || button.isPermission === "true" || button.isPermission;
|
|
345
|
+
const functionCodes = getPermissionCodes(configureObj, pageContext);
|
|
346
|
+
const param = {
|
|
347
|
+
entity: viewModels,
|
|
348
|
+
fileName: templateUUID,
|
|
349
|
+
// uuid
|
|
350
|
+
showName: fileName,
|
|
351
|
+
// 下载的文件名称
|
|
352
|
+
beanName,
|
|
353
|
+
isWorkflowForm,
|
|
354
|
+
// 是否是流程表单
|
|
355
|
+
functionCode: functionCodes,
|
|
356
|
+
tableName,
|
|
357
|
+
isPermission: isPermission + "",
|
|
358
|
+
systemCode,
|
|
359
|
+
listCodesMap: pageContext.listCodesMap,
|
|
360
|
+
pageCode: pageContext.code,
|
|
361
|
+
pageVersion: pageContext.version
|
|
362
|
+
};
|
|
363
|
+
if (logSetting) {
|
|
364
|
+
param["logSettingText"] = logSetting.join("");
|
|
365
|
+
}
|
|
366
|
+
const additionalParamMap = getAdditionalParamMap(pageContext);
|
|
367
|
+
param["additionalParamMap"] = additionalParamMap;
|
|
368
|
+
let exportResult;
|
|
369
|
+
if (isPdf) {
|
|
370
|
+
exportResult = exportFormPdf(fileName, backendUrl, param, pageContext.isTest);
|
|
371
|
+
} else {
|
|
372
|
+
exportResult = exportFormReportSuccess(fileName, backendUrl, param, pageContext.isTest);
|
|
373
|
+
}
|
|
374
|
+
if (exportResult) {
|
|
375
|
+
exportResult.then(() => {
|
|
376
|
+
doAfterClickEvent(pageContext, configureObj);
|
|
69
377
|
});
|
|
70
|
-
}
|
|
71
|
-
}
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
const
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
const
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
u2 && (f2 += "&systemCode=" + u2);
|
|
83
|
-
const b2 = e3.listCode;
|
|
84
|
-
b2 && (f2 += "&listCode=" + b2);
|
|
85
|
-
t2.beanName && (f2 += "&beanName=" + t2.beanName);
|
|
86
|
-
const C2 = w(s2, t2);
|
|
87
|
-
C2 && (f2 += "&functionCode=" + C2);
|
|
88
|
-
t2.tableName && (f2 += "&tableName=" + t2.tableName);
|
|
89
|
-
t2.code && (f2 += "&pageCode=" + t2.code);
|
|
90
|
-
t2.version && (f2 += "&pageVersion=" + t2.version);
|
|
91
|
-
const T2 = d();
|
|
92
|
-
T2 && (f2 += "&JWT=" + T2);
|
|
93
|
-
const y2 = "_RUN_CURRENT_ROLE", h2 = m(y2);
|
|
94
|
-
h2 && (f2 += "&" + y2 + "=" + h2);
|
|
95
|
-
if (o2) {
|
|
96
|
-
f2 += "&isPermission=" + (void 0 === o2.isPermission || "true" === o2.isPermission || o2.isPermission);
|
|
97
|
-
}
|
|
98
|
-
const P2 = n(l2, t2.isTest);
|
|
99
|
-
window.open(P2 + "/dsc/commons/download-files" + f2);
|
|
100
|
-
}(e2);
|
|
101
|
-
}, import: function(e2) {
|
|
102
|
-
const t2 = e2.pageContext.code + "_";
|
|
103
|
-
b.$emit(t2 + "import-file", e2);
|
|
104
|
-
}, export: function(e2) {
|
|
105
|
-
return function(e3) {
|
|
106
|
-
return new Promise((t2, s2) => {
|
|
107
|
-
const n2 = e3.pageContext, o2 = e3.configureObj.props.base, i2 = e3.listCode, a2 = e3.selections, r2 = {};
|
|
108
|
-
a2 && a2.length > 0 && (r2.data = a2);
|
|
109
|
-
let c2 = n2.label;
|
|
110
|
-
c2 || (c2 = n2.code);
|
|
111
|
-
let u2 = false;
|
|
112
|
-
u2 = void 0 !== o2.isAsync && null !== o2.isAsync && o2.isAsync;
|
|
113
|
-
const l2 = void 0 === o2.isPermission || "true" === o2.isPermission || o2.isPermission, p2 = w(e3.configureObj, n2), d2 = c2, m2 = { backendUrl: n2.backendUrl, pageContext: n2 };
|
|
114
|
-
window.$vueApp.config.globalProperties.$exportDataNew(r2, d2, i2, p2, null, m2, u2, n2.code, l2);
|
|
378
|
+
}
|
|
379
|
+
}
|
|
380
|
+
function exportFormReportSuccess(fileName, backendUrl, param, isTest) {
|
|
381
|
+
return new Promise((resolve, reject) => {
|
|
382
|
+
const baseUrl = getBaseUrl(backendUrl, isTest);
|
|
383
|
+
const path = baseUrl + "/dsc/commons/export-reports";
|
|
384
|
+
axios.defaults.headers.common.Authorization = getToken();
|
|
385
|
+
const request = axios.post(path, param, {
|
|
386
|
+
// headers: {
|
|
387
|
+
// 'content-type': 'application/x-www-form-urlencoded'
|
|
388
|
+
// },
|
|
389
|
+
responseType: "blob"
|
|
115
390
|
});
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
}).catch((e4) => {
|
|
135
|
-
s2(e4);
|
|
136
|
-
});
|
|
391
|
+
request.then((response) => {
|
|
392
|
+
const blob = new Blob([response.data]);
|
|
393
|
+
let fileNameTwo = "报告.xlsx";
|
|
394
|
+
if (fileName) {
|
|
395
|
+
fileNameTwo = fileName;
|
|
396
|
+
}
|
|
397
|
+
const elink = document.createElement("a");
|
|
398
|
+
elink.download = fileNameTwo;
|
|
399
|
+
elink.style.display = "none";
|
|
400
|
+
elink.target = "_blank";
|
|
401
|
+
elink.href = URL.createObjectURL(blob);
|
|
402
|
+
document.body.appendChild(elink);
|
|
403
|
+
elink.click();
|
|
404
|
+
URL.revokeObjectURL(elink.href);
|
|
405
|
+
document.body.removeChild(elink);
|
|
406
|
+
resolve(true);
|
|
407
|
+
}).catch((error) => {
|
|
408
|
+
reject(error);
|
|
137
409
|
});
|
|
138
|
-
}
|
|
139
|
-
}
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
410
|
+
});
|
|
411
|
+
}
|
|
412
|
+
function exportFormPdf(fileName, backendUrl, param, isTest) {
|
|
413
|
+
return new Promise((resolve, reject) => {
|
|
414
|
+
const baseUrl = getBaseUrl(backendUrl, isTest);
|
|
415
|
+
const path = baseUrl + "/dsc/commons/export-pdf";
|
|
416
|
+
axios.defaults.headers.common.Authorization = getToken();
|
|
417
|
+
const request = axios.post(path, param, {
|
|
418
|
+
headers: {
|
|
419
|
+
"content-type": "application/json"
|
|
420
|
+
},
|
|
421
|
+
responseType: "blob"
|
|
422
|
+
});
|
|
423
|
+
request.then((response) => {
|
|
424
|
+
const blob = new Blob([response.data]);
|
|
425
|
+
const elink = document.createElement("a");
|
|
426
|
+
elink.download = fileName.substring(0, fileName.lastIndexOf(".")) + ".pdf";
|
|
427
|
+
elink.style.display = "none";
|
|
428
|
+
elink.target = "_blank";
|
|
429
|
+
elink.href = URL.createObjectURL(blob);
|
|
430
|
+
document.body.appendChild(elink);
|
|
431
|
+
elink.click();
|
|
432
|
+
URL.revokeObjectURL(elink.href);
|
|
433
|
+
document.body.removeChild(elink);
|
|
434
|
+
resolve(true);
|
|
435
|
+
}).catch((error) => {
|
|
436
|
+
reject(error);
|
|
437
|
+
});
|
|
438
|
+
});
|
|
439
|
+
}
|
|
440
|
+
function saveFunc(params, isListButton) {
|
|
441
|
+
return new Promise((resolve, reject) => {
|
|
442
|
+
const pageContext = params.pageContext;
|
|
443
|
+
const configureObj = params.configureObj;
|
|
444
|
+
const mainDefaultValueColumns = params.mainDefaultValueColumns;
|
|
445
|
+
const dynamicColumnInfo = params.dynamicColumnInfo;
|
|
446
|
+
const successOperation = configureObj.props.base.successOperation;
|
|
447
|
+
let isUnControlVersion = false;
|
|
448
|
+
if (successOperation && successOperation === "noOperation") {
|
|
449
|
+
isUnControlVersion = true;
|
|
450
|
+
}
|
|
451
|
+
const request = getSaveFormRequest(
|
|
452
|
+
pageContext,
|
|
453
|
+
configureObj,
|
|
454
|
+
"/dsc/commons",
|
|
455
|
+
isUnControlVersion,
|
|
456
|
+
mainDefaultValueColumns,
|
|
457
|
+
dynamicColumnInfo
|
|
458
|
+
);
|
|
459
|
+
if (request) {
|
|
460
|
+
request.then((data) => {
|
|
461
|
+
dealAfterOperate(
|
|
462
|
+
pageContext,
|
|
463
|
+
configureObj,
|
|
464
|
+
data,
|
|
465
|
+
"superPageRuntimeMessage.successfulSave",
|
|
466
|
+
isListButton
|
|
467
|
+
);
|
|
468
|
+
resolve(data);
|
|
469
|
+
}).catch((error) => {
|
|
470
|
+
reject(error);
|
|
151
471
|
});
|
|
472
|
+
} else {
|
|
473
|
+
reject("保存时request不存在");
|
|
474
|
+
}
|
|
475
|
+
});
|
|
476
|
+
}
|
|
477
|
+
function getCommonFormRequestParam(pageContext, configureObj, isUnControlVersion, mainDefaultValueColumns, dynamicColumnInfo, ids2, row) {
|
|
478
|
+
var _a;
|
|
479
|
+
const isWorkflow = isWorkflowPage(pageContext);
|
|
480
|
+
const systemCode = pageContext.systemCode;
|
|
481
|
+
const isPermission = configureObj.props.base.isPermission === void 0 || configureObj.props.base.isPermission === "true" || configureObj.props.base.isPermission;
|
|
482
|
+
const functionCodes = getPermissionCodes(configureObj, pageContext);
|
|
483
|
+
let entity = row;
|
|
484
|
+
if (!entity) {
|
|
485
|
+
entity = pageContext.entity.data;
|
|
486
|
+
}
|
|
487
|
+
const param = {
|
|
488
|
+
entity,
|
|
489
|
+
tableName: pageContext.tableName,
|
|
490
|
+
formNoRuleCode: pageContext.formNoRuleCode,
|
|
491
|
+
isWorkflowEntity: isWorkflow,
|
|
492
|
+
functionCode: functionCodes,
|
|
493
|
+
isPermission: isPermission + "",
|
|
494
|
+
listCodesMap: pageContext.listCodesMap,
|
|
495
|
+
pageCode: pageContext.code,
|
|
496
|
+
pageVersion: pageContext.version
|
|
497
|
+
};
|
|
498
|
+
if (ids2) {
|
|
499
|
+
param["ids"] = ids2;
|
|
500
|
+
}
|
|
501
|
+
if (pageContext.judgeHeavyList) {
|
|
502
|
+
if (isArrayFn(pageContext.judgeHeavyList)) {
|
|
503
|
+
param["judgeHeavyList"] = JSON.stringify(pageContext.judgeHeavyList);
|
|
504
|
+
} else {
|
|
505
|
+
param["judgeHeavyList"] = pageContext.judgeHeavyList;
|
|
506
|
+
}
|
|
507
|
+
}
|
|
508
|
+
const conversionCodes = configureObj.props.base.conversionCodes;
|
|
509
|
+
if (conversionCodes) {
|
|
510
|
+
if (isArrayFn(conversionCodes)) {
|
|
511
|
+
param["dataConversionRule"] = conversionCodes.join(",");
|
|
512
|
+
} else if (typeof conversionCodes === "string") {
|
|
513
|
+
param["dataConversionRule"] = conversionCodes;
|
|
514
|
+
}
|
|
515
|
+
}
|
|
516
|
+
console.log("getCommonFormRequestParam--------configureObj----", configureObj);
|
|
517
|
+
const autoSetValueData = getButtonAutoSetValueData(configureObj);
|
|
518
|
+
if (autoSetValueData) {
|
|
519
|
+
param["autoSetValueData"] = autoSetValueData;
|
|
520
|
+
}
|
|
521
|
+
const logSetting = (_a = configureObj.props.base) == null ? void 0 : _a.logSetting;
|
|
522
|
+
if (logSetting) {
|
|
523
|
+
param["logSettingText"] = logSetting.join("");
|
|
524
|
+
}
|
|
525
|
+
if (!param["systemCode"]) {
|
|
526
|
+
param["systemCode"] = systemCode;
|
|
527
|
+
}
|
|
528
|
+
const beanName = pageContext.beanName;
|
|
529
|
+
if (beanName) {
|
|
530
|
+
param["beanName"] = beanName;
|
|
531
|
+
}
|
|
532
|
+
if (dynamicColumnInfo) {
|
|
533
|
+
param["dynamicColumnInfo"] = dynamicColumnInfo;
|
|
534
|
+
}
|
|
535
|
+
if (mainDefaultValueColumns) {
|
|
536
|
+
param["mainDefaultValueColumns"] = mainDefaultValueColumns;
|
|
537
|
+
}
|
|
538
|
+
const additionalParamMap = getAdditionalParamMap(pageContext);
|
|
539
|
+
param["additionalParamMap"] = additionalParamMap;
|
|
540
|
+
if (isUnControlVersion !== void 0) {
|
|
541
|
+
param["unControlVersion"] = isUnControlVersion;
|
|
542
|
+
}
|
|
543
|
+
return param;
|
|
544
|
+
}
|
|
545
|
+
function getSaveFormRequestWithRow(pageContext, configureObj, url, isUnControlVersion, mainDefaultValueColumns, dynamicColumnInfo, row, otherParams) {
|
|
546
|
+
const systemCode = pageContext.systemCode;
|
|
547
|
+
const backendUrl = pageContext.backendUrl;
|
|
548
|
+
const param = getCommonFormRequestParam(
|
|
549
|
+
pageContext,
|
|
550
|
+
configureObj,
|
|
551
|
+
isUnControlVersion,
|
|
552
|
+
mainDefaultValueColumns,
|
|
553
|
+
dynamicColumnInfo,
|
|
554
|
+
null,
|
|
555
|
+
row
|
|
556
|
+
);
|
|
557
|
+
if (otherParams) {
|
|
558
|
+
if (otherParams.tableName) {
|
|
559
|
+
param.tableName = otherParams.tableName;
|
|
560
|
+
}
|
|
561
|
+
}
|
|
562
|
+
return getSaveFormRequestByParam(
|
|
563
|
+
systemCode,
|
|
564
|
+
backendUrl,
|
|
565
|
+
param,
|
|
566
|
+
url,
|
|
567
|
+
pageContext.entity.data,
|
|
568
|
+
pageContext.isTest
|
|
569
|
+
);
|
|
570
|
+
}
|
|
571
|
+
function getSaveFormRequest(pageContext, configureObj, url, isUnControlVersion, mainDefaultValueColumns, dynamicColumnInfo) {
|
|
572
|
+
return getSaveFormRequestWithRow(
|
|
573
|
+
pageContext,
|
|
574
|
+
configureObj,
|
|
575
|
+
url,
|
|
576
|
+
isUnControlVersion,
|
|
577
|
+
mainDefaultValueColumns,
|
|
578
|
+
dynamicColumnInfo,
|
|
579
|
+
null,
|
|
580
|
+
null
|
|
581
|
+
);
|
|
582
|
+
}
|
|
583
|
+
function getSaveFormRequestByParam(systemCode, backendUrl, param, url, formData, isTest) {
|
|
584
|
+
const baseUrl = getBaseUrl(backendUrl, isTest);
|
|
585
|
+
let path = baseUrl + url;
|
|
586
|
+
path = getRealRestApiPath(path, systemCode, backendUrl, isTest);
|
|
587
|
+
let request;
|
|
588
|
+
if (formData && (formData.id || formData.ID)) {
|
|
589
|
+
request = http.put(path, param);
|
|
590
|
+
} else {
|
|
591
|
+
request = http.post(path, param);
|
|
592
|
+
}
|
|
593
|
+
return request;
|
|
594
|
+
}
|
|
595
|
+
function dealAfterOperate(pageContext, configureObj, data, successTip, isListButton) {
|
|
596
|
+
const buttonForPageType = getPageType(pageContext, configureObj, isListButton);
|
|
597
|
+
if (buttonForPageType && buttonForPageType === "list") {
|
|
598
|
+
dealAfterWithList(pageContext, configureObj, data, successTip);
|
|
599
|
+
pageContext.canClick = true;
|
|
600
|
+
} else if (buttonForPageType && buttonForPageType === "form") {
|
|
601
|
+
dealAfterWithForm(pageContext, configureObj, data, successTip);
|
|
602
|
+
} else {
|
|
603
|
+
pageContext.canClick = true;
|
|
604
|
+
}
|
|
605
|
+
}
|
|
606
|
+
function getPageType(pageContext, configureObj, isListButton) {
|
|
607
|
+
let pageType;
|
|
608
|
+
if (isListButton === void 0) {
|
|
609
|
+
pageType = configureObj.props.base.tableUuid ? "list" : null;
|
|
610
|
+
} else if (isListButton === false) {
|
|
611
|
+
pageType = "form";
|
|
612
|
+
}
|
|
613
|
+
if (!pageType) {
|
|
614
|
+
pageType = pageContext.pageType;
|
|
615
|
+
}
|
|
616
|
+
return pageType;
|
|
617
|
+
}
|
|
618
|
+
function dealAfterWithForm(pageContext, configureObj, data, successTip) {
|
|
619
|
+
if (data) {
|
|
620
|
+
const commonEntity = data;
|
|
621
|
+
let dataModel;
|
|
622
|
+
if (commonEntity.entity) {
|
|
623
|
+
dataModel = commonEntity.entity;
|
|
624
|
+
}
|
|
625
|
+
if (commonEntity.formNo) {
|
|
626
|
+
pageContext.initFormNo = commonEntity.formNo;
|
|
627
|
+
}
|
|
628
|
+
const totalModel = { ...dataModel, ...pageContext.entity.page };
|
|
629
|
+
afterSuccessOperateInForm(pageContext, configureObj, totalModel);
|
|
630
|
+
} else {
|
|
631
|
+
pageContext.canClick = true;
|
|
632
|
+
}
|
|
633
|
+
if (successTip) {
|
|
634
|
+
ElMessage({
|
|
635
|
+
message: getI18n().t(successTip),
|
|
636
|
+
type: "success",
|
|
637
|
+
showClose: true
|
|
152
638
|
});
|
|
153
|
-
}
|
|
154
|
-
}
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
}
|
|
165
|
-
|
|
166
|
-
}
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
}(
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
}
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
const
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
return oe(e3, i2, o2, "superPageRuntimeMessage.successfulReturnToPreviousTask");
|
|
197
|
-
}(e2);
|
|
198
|
-
}, endInstance: function(e2) {
|
|
199
|
-
return function(e3) {
|
|
200
|
-
const t2 = e3.pageContext, s2 = t2.backendUrl, o2 = n(s2, t2.isTest) + "/dsc/workflow-commons/end-instance", i2 = K(e3);
|
|
201
|
-
return oe(e3, i2, o2, "superPageRuntimeMessage.successfulEndInstance");
|
|
202
|
-
}(e2);
|
|
203
|
-
}, returnTaskTo: function(e2) {
|
|
204
|
-
return function(e3) {
|
|
205
|
-
const t2 = e3.pageContext, s2 = t2.code + "_";
|
|
206
|
-
b.$emit(s2 + "choose-return-node", e3);
|
|
207
|
-
}(e2);
|
|
208
|
-
}, removeSigner: function(e2) {
|
|
209
|
-
return function(e3) {
|
|
210
|
-
const t2 = e3.pageContext, s2 = t2.code + "_";
|
|
211
|
-
b.$emit(s2 + "remove-signer", e3);
|
|
212
|
-
}(e2);
|
|
213
|
-
}, retrieveTask: function(e2) {
|
|
214
|
-
return function(e3) {
|
|
215
|
-
const t2 = e3.pageContext, s2 = t2.backendUrl, o2 = n(s2, t2.isTest) + "/dsc/workflow-commons/retrieves", i2 = K(e3);
|
|
216
|
-
return oe(e3, i2, o2, "superPageRuntimeMessage.successfulRetrieve");
|
|
217
|
-
}(e2);
|
|
218
|
-
}, viewDetail: function(e2) {
|
|
219
|
-
}, lineEditCreate: function(e2) {
|
|
220
|
-
return function(e3) {
|
|
221
|
-
const t2 = e3.pageContext, s2 = e3.tableUuid, n2 = g(t2, s2);
|
|
222
|
-
n2 && (e3.getDefaultValueFunc = k, n2.createRow(e3.listCode, {}, e3));
|
|
223
|
-
}(e2);
|
|
224
|
-
}, printLabel: function(e2) {
|
|
225
|
-
return function(e3) {
|
|
226
|
-
let t2 = null;
|
|
227
|
-
try {
|
|
228
|
-
if (t2 = e3.menuItem ? e3.menuItem.templateUuid : e3.configureObj.props.base.template[0].templateUuid, !t2) throw new Error("未找到模板");
|
|
229
|
-
} catch (e4) {
|
|
230
|
-
}
|
|
231
|
-
I.printLabel(e3, t2);
|
|
232
|
-
}(e2);
|
|
233
|
-
}, queryCharts: function(e2) {
|
|
234
|
-
j(e2);
|
|
235
|
-
}, resetCharts: function(t2) {
|
|
236
|
-
var _a, _b;
|
|
237
|
-
const s2 = t2.pageContext;
|
|
238
|
-
s2.entity.data = e((_a = s2.initChartData) == null ? void 0 : _a.data), s2.entity.page = e((_b = s2.initChartData) == null ? void 0 : _b.page), t2.isInitChart = true, j(t2);
|
|
239
|
-
}, exportCharts: function(e2) {
|
|
240
|
-
!function(e3) {
|
|
241
|
-
const t2 = e3.pageContext, s2 = t2.allChartUuids;
|
|
242
|
-
if (!s2 || 0 == s2.length) return;
|
|
243
|
-
const o2 = e3.configureObj;
|
|
244
|
-
let i2 = null;
|
|
245
|
-
o2 && o2.runtime && (i2 = o2.runtime.props);
|
|
246
|
-
const a2 = i2 ? i2.state : void 0;
|
|
247
|
-
i2 && (i2.state = "disabled");
|
|
248
|
-
const r2 = [];
|
|
249
|
-
for (let e4 = 0; e4 < s2.length; e4++) {
|
|
250
|
-
const n2 = s2[e4], o3 = g(t2, n2);
|
|
251
|
-
if (o3) {
|
|
252
|
-
const e5 = o3.getConfigure();
|
|
253
|
-
e5 && e5.exportable && e5._dynamicShowFlag && o3.exportChart && r2.push(o3.exportChart());
|
|
254
|
-
}
|
|
255
|
-
}
|
|
256
|
-
if (!r2 || 0 == r2.length) return;
|
|
257
|
-
let c2, u2 = t2.label;
|
|
258
|
-
u2 || (u2 = t2.code);
|
|
259
|
-
c2 = u2;
|
|
260
|
-
const l2 = { reportDataList: r2, beanName: t2.beanName }, p2 = t2.backendUrl;
|
|
261
|
-
let m2;
|
|
262
|
-
const f2 = n(p2, t2.isTest) + "/dsc/commons/exportChart";
|
|
263
|
-
C.defaults.headers.common.Authorization = d(), m2 = C.post(f2, l2, { responseType: "blob" }), m2.then((e4) => {
|
|
264
|
-
const t3 = document.createElement("a");
|
|
265
|
-
t3.style.display = "none", t3.href = URL.createObjectURL(e4.data), t3.setAttribute("download", c2 + ".xlsx"), document.body.appendChild(t3), t3.click(), document.body.removeChild(t3);
|
|
266
|
-
}).finally(() => {
|
|
267
|
-
i2 && (i2.state = a2);
|
|
639
|
+
}
|
|
640
|
+
}
|
|
641
|
+
function afterSuccessOperateInForm(pageContext, configureObj, dataModel) {
|
|
642
|
+
const successOperation = configureObj.props.base.successOperation;
|
|
643
|
+
if (!successOperation || successOperation === null) {
|
|
644
|
+
return;
|
|
645
|
+
}
|
|
646
|
+
const isNeedValueMapping = configureObj.props.base.isNeedValueMapping;
|
|
647
|
+
if (successOperation === "noOperation") {
|
|
648
|
+
if (dataModel) {
|
|
649
|
+
pageContext.entity.data = dataModel;
|
|
650
|
+
}
|
|
651
|
+
pageContext.canClick = true;
|
|
652
|
+
} else if (successOperation === "refresh") {
|
|
653
|
+
if (dataModel && (dataModel.id || dataModel.ID)) {
|
|
654
|
+
refreshPage(pageContext, dataModel.ID ? dataModel.ID : dataModel.id);
|
|
655
|
+
} else {
|
|
656
|
+
pageContext.canClick = true;
|
|
657
|
+
}
|
|
658
|
+
} else if (successOperation === "closeWindow" || successOperation === "closeWindowAndRefresh") {
|
|
659
|
+
closeDialog(pageContext, dataModel, isNeedValueMapping);
|
|
660
|
+
pageContext.canClick = true;
|
|
661
|
+
console.log("afterSuccessOperateInForm--successOperation=--", successOperation);
|
|
662
|
+
}
|
|
663
|
+
}
|
|
664
|
+
function closeDialog(pageContext, dataModel, isNeedValueMapping) {
|
|
665
|
+
const jumpMode = pageContext.entity && pageContext.entity.request ? pageContext.entity.request.jumpMode : null;
|
|
666
|
+
if (jumpMode === "openWindow" || jumpMode === "newTab") {
|
|
667
|
+
if (window.parent) {
|
|
668
|
+
window.parent.close();
|
|
669
|
+
} else {
|
|
670
|
+
window.close();
|
|
671
|
+
}
|
|
672
|
+
} else {
|
|
673
|
+
const sourceTableName = pageContext.tableName;
|
|
674
|
+
const isNeedValueMappingFinal = isNeedValueMapping !== void 0 && isNeedValueMapping === true && dataModel && dataModel !== void 0;
|
|
675
|
+
const parentPageCode = pageContext.entity && pageContext.entity.request ? pageContext.entity.request.parentPageCode : null;
|
|
676
|
+
const eventPageInfo = parentPageCode + "_";
|
|
677
|
+
bus.$emit(eventPageInfo + "close-dialog", {
|
|
678
|
+
isNeedValueMapping: isNeedValueMappingFinal,
|
|
679
|
+
dataModel,
|
|
680
|
+
sourceTableName,
|
|
681
|
+
jumpMode
|
|
268
682
|
});
|
|
269
|
-
}
|
|
270
|
-
}
|
|
271
|
-
function
|
|
272
|
-
|
|
273
|
-
if (!
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
683
|
+
}
|
|
684
|
+
}
|
|
685
|
+
function updateValuesWhenCloseDialog(parentPageContext, parentConfigureObj, sourceModel, sourceTableName, valueMappings) {
|
|
686
|
+
var _a;
|
|
687
|
+
if (!valueMappings) {
|
|
688
|
+
valueMappings = parentConfigureObj.runtime && parentConfigureObj.runtime.linkPage && parentConfigureObj.runtime.linkPage.valueMappings ? parentConfigureObj.runtime.linkPage.valueMappings : null;
|
|
689
|
+
if (!valueMappings) {
|
|
690
|
+
valueMappings = (_a = parentConfigureObj.props.linkPage) == null ? void 0 : _a.valueMappings;
|
|
691
|
+
}
|
|
692
|
+
}
|
|
693
|
+
const targetTableName = parentPageContext.tableName;
|
|
694
|
+
console.log("update-value66-", sourceModel, sourceTableName);
|
|
695
|
+
updateWithPageValue(sourceModel, valueMappings, parentPageContext);
|
|
696
|
+
handleEvent(null, parentPageContext, parentConfigureObj, "setValue", {
|
|
697
|
+
sourceModel,
|
|
698
|
+
sourceTableName,
|
|
699
|
+
entity: parentPageContext.entity.data,
|
|
700
|
+
targetTableName
|
|
282
701
|
});
|
|
283
702
|
}
|
|
284
|
-
function
|
|
703
|
+
function updateWithPageValue(sourceModel, valueMappings, parentPageContext) {
|
|
704
|
+
if (sourceModel && sourceModel !== null && valueMappings) {
|
|
705
|
+
let sourceEntity = sourceModel;
|
|
706
|
+
if (Array.isArray(sourceModel) && sourceModel.length > 0) {
|
|
707
|
+
sourceEntity = sourceModel[0];
|
|
708
|
+
}
|
|
709
|
+
valueMappings.forEach((valueMapping) => {
|
|
710
|
+
const sourceField = valueMapping.source;
|
|
711
|
+
if (!sourceField) {
|
|
712
|
+
return;
|
|
713
|
+
}
|
|
714
|
+
const sourceFields = sourceField.split(".");
|
|
715
|
+
const targetValue = getVariableValue(sourceEntity, sourceFields);
|
|
716
|
+
const targetField = valueMapping.target;
|
|
717
|
+
const targetFields = getModelFields(null, targetField);
|
|
718
|
+
setVariableValue(parentPageContext.entity, targetFields, targetValue);
|
|
719
|
+
});
|
|
720
|
+
}
|
|
721
|
+
}
|
|
722
|
+
function dealAfterWithList(pageContext, configureObj, row, successTip) {
|
|
723
|
+
let successOperation = configureObj.props.base.successOperation;
|
|
724
|
+
const isNeedValueMapping = configureObj.props.base.isNeedValueMapping;
|
|
725
|
+
const tableUuid = getTableUuid(pageContext, configureObj);
|
|
726
|
+
if (!successOperation) {
|
|
727
|
+
successOperation = "refresh";
|
|
728
|
+
}
|
|
729
|
+
if (successOperation === "refresh") {
|
|
730
|
+
if (tableUuid) {
|
|
731
|
+
const gridRef = getComponentRef(pageContext, tableUuid);
|
|
732
|
+
gridRef.refresh();
|
|
733
|
+
} else {
|
|
734
|
+
console.error("tableUuid is empty");
|
|
735
|
+
}
|
|
736
|
+
} else if (successOperation === "closeWindow" || successOperation === "closeWindowAndRefresh") {
|
|
737
|
+
const pageData = deepCopy(pageContext.entity.page);
|
|
738
|
+
let dataModel = row;
|
|
739
|
+
if (!dataModel) {
|
|
740
|
+
dataModel = {};
|
|
741
|
+
}
|
|
742
|
+
Object.assign(pageData, dataModel);
|
|
743
|
+
closeDialog(pageContext, pageData, isNeedValueMapping);
|
|
744
|
+
}
|
|
745
|
+
if (successTip) {
|
|
746
|
+
ElMessage({
|
|
747
|
+
message: getI18n().t(successTip),
|
|
748
|
+
type: "success",
|
|
749
|
+
showClose: true
|
|
750
|
+
});
|
|
751
|
+
}
|
|
752
|
+
}
|
|
753
|
+
function refreshFormOrListPage(pageContext, configureObj, isRefreshWhenClosePopup, mySuccessOperation) {
|
|
285
754
|
var _a;
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
let
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
755
|
+
if (configureObj && !configureObj.props.base) {
|
|
756
|
+
configureObj.props.base = {};
|
|
757
|
+
}
|
|
758
|
+
let successOperation = mySuccessOperation;
|
|
759
|
+
if (!successOperation) {
|
|
760
|
+
successOperation = isRefreshWhenClosePopup ? "refresh" : (_a = configureObj.props.base) == null ? void 0 : _a.successOperation;
|
|
761
|
+
}
|
|
762
|
+
console.log(
|
|
763
|
+
"refreshFormOrListPage22=====successOperation=",
|
|
764
|
+
successOperation,
|
|
765
|
+
"isRefreshWhenClosePopup=",
|
|
766
|
+
isRefreshWhenClosePopup
|
|
767
|
+
);
|
|
768
|
+
const buttonForPageType = getPageType(pageContext, configureObj);
|
|
769
|
+
console.log("refreshFormOrListPage22=====buttonForPageType=", buttonForPageType);
|
|
770
|
+
if (buttonForPageType && buttonForPageType === "list" && !successOperation) {
|
|
771
|
+
successOperation = "refresh";
|
|
772
|
+
}
|
|
773
|
+
console.log("refreshFormOrListPage33=====successOperation=", successOperation);
|
|
774
|
+
if (successOperation === "refresh") {
|
|
775
|
+
if (buttonForPageType && buttonForPageType === "list") {
|
|
776
|
+
const tableUuid = getTableUuid(pageContext, configureObj);
|
|
777
|
+
if (tableUuid) {
|
|
778
|
+
const gridRef = getComponentRef(pageContext, tableUuid);
|
|
779
|
+
gridRef.refresh();
|
|
780
|
+
} else {
|
|
781
|
+
console.error("tableUuid is empty");
|
|
782
|
+
}
|
|
783
|
+
} else if (buttonForPageType && buttonForPageType === "form") {
|
|
784
|
+
const dataModel = pageContext.entity.data;
|
|
785
|
+
refreshPage(pageContext, dataModel.ID ? dataModel.ID : dataModel.id);
|
|
786
|
+
}
|
|
787
|
+
}
|
|
788
|
+
}
|
|
789
|
+
function submitForm(params, isListButton, eventName, url) {
|
|
790
|
+
return new Promise((resolve, reject) => {
|
|
791
|
+
const pageContext = params.pageContext;
|
|
792
|
+
const configureObj = params.configureObj;
|
|
793
|
+
const mainDefaultValueColumns = params.mainDefaultValueColumns;
|
|
794
|
+
const dynamicColumnInfo = params.dynamicColumnInfo;
|
|
795
|
+
const ids2 = params.ids;
|
|
796
|
+
const successOperation = configureObj.props.base.successOperation;
|
|
797
|
+
let isUnControlVersion = false;
|
|
798
|
+
if (successOperation && successOperation === "noOperation") {
|
|
799
|
+
isUnControlVersion = true;
|
|
800
|
+
}
|
|
801
|
+
let tableName = pageContext.tableName;
|
|
802
|
+
if (isListButton) {
|
|
803
|
+
const tableUuid = configureObj.props.base.tableUuid ? configureObj.props.base.tableUuid : params.tableUuid;
|
|
804
|
+
tableName = getTableNameByTableUuid(pageContext, tableUuid);
|
|
805
|
+
}
|
|
806
|
+
const request = getSubmitFormRequest(
|
|
807
|
+
pageContext,
|
|
808
|
+
configureObj,
|
|
809
|
+
url,
|
|
810
|
+
isUnControlVersion,
|
|
811
|
+
mainDefaultValueColumns,
|
|
812
|
+
dynamicColumnInfo,
|
|
813
|
+
eventName,
|
|
814
|
+
ids2,
|
|
815
|
+
tableName
|
|
816
|
+
);
|
|
817
|
+
if (request) {
|
|
818
|
+
request.then((data) => {
|
|
819
|
+
dealAfterOperate(
|
|
820
|
+
pageContext,
|
|
821
|
+
configureObj,
|
|
822
|
+
data,
|
|
823
|
+
"superPageRuntimeMessage.successfulSave",
|
|
824
|
+
isListButton
|
|
825
|
+
);
|
|
826
|
+
resolve(data);
|
|
827
|
+
}).catch((error) => {
|
|
828
|
+
reject(error);
|
|
299
829
|
});
|
|
300
|
-
}
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
830
|
+
} else {
|
|
831
|
+
reject("request不存在");
|
|
832
|
+
}
|
|
833
|
+
});
|
|
834
|
+
}
|
|
835
|
+
function getSubmitFormRequest(pageContext, configureObj, url, isUnControlVersion, mainDefaultValueColumns, dynamicColumnInfo, eventName, ids2, tableName) {
|
|
836
|
+
return new Promise((resolve, reject) => {
|
|
837
|
+
const buttonName = configureObj.props.base.title;
|
|
838
|
+
const operationI18nTip = "superPageRuntimeMessage.whetherToConfirm" + upperFirstCase(eventName);
|
|
839
|
+
ElMessageBox.confirm(
|
|
840
|
+
getI18n().t(operationI18nTip, { name: buttonName }),
|
|
841
|
+
getI18n().t("superPageRuntimeMessage.tips"),
|
|
842
|
+
{
|
|
843
|
+
confirmButtonText: getI18n().t("superPageRuntimeMessage.sure"),
|
|
844
|
+
cancelButtonText: getI18n().t("superPageRuntimeMessage.cancel"),
|
|
845
|
+
type: "warning"
|
|
846
|
+
}
|
|
847
|
+
).then(() => {
|
|
848
|
+
const systemCode = pageContext.systemCode;
|
|
849
|
+
const backendUrl = pageContext.backendUrl;
|
|
850
|
+
const param = getCommonFormRequestParam(
|
|
851
|
+
pageContext,
|
|
852
|
+
configureObj,
|
|
853
|
+
isUnControlVersion,
|
|
854
|
+
mainDefaultValueColumns,
|
|
855
|
+
dynamicColumnInfo,
|
|
856
|
+
ids2,
|
|
857
|
+
null
|
|
858
|
+
);
|
|
859
|
+
param.tableName = tableName;
|
|
860
|
+
const baseUrl = getBaseUrl(backendUrl, pageContext.isTest);
|
|
861
|
+
let path = baseUrl + url;
|
|
862
|
+
path = getRealRestApiPath(path, systemCode, backendUrl, pageContext.isTest);
|
|
863
|
+
http.post(path, param).then((result) => {
|
|
864
|
+
resolve(result);
|
|
865
|
+
}).catch((error) => {
|
|
866
|
+
reject(error);
|
|
313
867
|
});
|
|
868
|
+
}).catch(() => {
|
|
869
|
+
reject("点击了取消按钮");
|
|
314
870
|
});
|
|
315
|
-
}(r2, g2, y2, e2.isTest), k2 && k2.then(() => {
|
|
316
|
-
h(e2, s2);
|
|
317
871
|
});
|
|
318
872
|
}
|
|
319
|
-
function
|
|
320
|
-
return new Promise((
|
|
321
|
-
const
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
|
|
873
|
+
function deleteFunc(params) {
|
|
874
|
+
return new Promise((resolve, reject) => {
|
|
875
|
+
const ids2 = params.ids;
|
|
876
|
+
if (!ids2 || ids2.length === 0) {
|
|
877
|
+
ElMessage({
|
|
878
|
+
showClose: true,
|
|
879
|
+
type: "warning",
|
|
880
|
+
message: getI18n().t("superPageRuntimeMessage.pleaseSelectRecord")
|
|
881
|
+
});
|
|
882
|
+
resolve(true);
|
|
883
|
+
return;
|
|
884
|
+
}
|
|
885
|
+
ElMessageBox.confirm(
|
|
886
|
+
getI18n().t("superPageRuntimeMessage.whetherToConfirmDeletion"),
|
|
887
|
+
getI18n().t("superPageRuntimeMessage.tips"),
|
|
888
|
+
{
|
|
889
|
+
confirmButtonText: getI18n().t("superPageRuntimeMessage.sure"),
|
|
890
|
+
cancelButtonText: getI18n().t("superPageRuntimeMessage.cancel"),
|
|
891
|
+
type: "warning"
|
|
892
|
+
}
|
|
893
|
+
).then(() => {
|
|
894
|
+
var _a;
|
|
895
|
+
const pageContext = params.pageContext;
|
|
896
|
+
const configureObj = params.configureObj;
|
|
897
|
+
const configureBase = configureObj.props.base;
|
|
898
|
+
const systemCode = pageContext.systemCode;
|
|
899
|
+
const backendUrl = pageContext.backendUrl;
|
|
900
|
+
const tableUuid = configureObj.props.base.tableUuid ? configureObj.props.base.tableUuid : params.tableUuid;
|
|
901
|
+
const tableName = getTableNameByTableUuid(pageContext, tableUuid);
|
|
902
|
+
const baseUrl = getBaseUrl(backendUrl, pageContext.isTest);
|
|
903
|
+
let path = baseUrl + "/dsc/commons/" + tableName;
|
|
904
|
+
path = getRealRestApiPath(path, systemCode, backendUrl, pageContext.isTest);
|
|
905
|
+
const isPermission = configureBase.isPermission === void 0 || configureBase.isPermission === "true" || configureBase.isPermission;
|
|
906
|
+
const isWorkflow = isWorkflowPage(pageContext);
|
|
907
|
+
const functionCodes = getPermissionCodes(configureObj, pageContext);
|
|
908
|
+
const param = {
|
|
909
|
+
ids: ids2,
|
|
910
|
+
functionCode: functionCodes,
|
|
911
|
+
isPermission: isPermission + "",
|
|
912
|
+
systemCode,
|
|
913
|
+
isWorkflowEntity: isWorkflow,
|
|
914
|
+
listCodesMap: pageContext.listCodesMap,
|
|
915
|
+
pageCode: pageContext.code,
|
|
916
|
+
pageVersion: pageContext.version
|
|
917
|
+
};
|
|
918
|
+
if (pageContext.beanName) {
|
|
919
|
+
param["beanName"] = pageContext.beanName;
|
|
920
|
+
}
|
|
921
|
+
const deleteLogicSetting = configureObj.props.deleteLogicSetting;
|
|
922
|
+
if (deleteLogicSetting) {
|
|
923
|
+
if (typeof deleteLogicSetting === "object") {
|
|
924
|
+
param["deleteLogicSetting"] = JSON.stringify(deleteLogicSetting);
|
|
925
|
+
} else if (typeof deleteLogicSetting === "string") {
|
|
926
|
+
param["deleteLogicSetting"] = deleteLogicSetting;
|
|
927
|
+
}
|
|
928
|
+
}
|
|
929
|
+
const logSetting = (_a = configureObj.props.base) == null ? void 0 : _a.logSetting;
|
|
930
|
+
if (logSetting) {
|
|
931
|
+
param["logSettingText"] = logSetting.join("");
|
|
932
|
+
}
|
|
933
|
+
const isSafeDelete = configureObj.props.base.isSafeDelete;
|
|
934
|
+
if (isSafeDelete) {
|
|
935
|
+
param["isSafeDelete"] = isSafeDelete;
|
|
936
|
+
}
|
|
937
|
+
http.delete(path, {
|
|
938
|
+
data: param
|
|
939
|
+
}).then((data) => {
|
|
940
|
+
const gridRef = getComponentRef(pageContext, tableUuid);
|
|
941
|
+
if (gridRef) {
|
|
942
|
+
gridRef.isDeleteChange(true);
|
|
943
|
+
gridRef.clearSelections();
|
|
944
|
+
}
|
|
945
|
+
dealAfterOperate(
|
|
946
|
+
pageContext,
|
|
947
|
+
configureObj,
|
|
948
|
+
data,
|
|
949
|
+
"superPageRuntimeMessage.successfulDelete",
|
|
950
|
+
true
|
|
951
|
+
);
|
|
952
|
+
resolve(true);
|
|
953
|
+
}).catch((e) => {
|
|
954
|
+
reject(e);
|
|
955
|
+
});
|
|
956
|
+
}).catch(() => {
|
|
957
|
+
reject();
|
|
958
|
+
});
|
|
330
959
|
});
|
|
331
960
|
}
|
|
332
|
-
function
|
|
961
|
+
function downloadTemplateFunc(params) {
|
|
333
962
|
var _a;
|
|
334
|
-
const
|
|
335
|
-
|
|
336
|
-
|
|
337
|
-
const
|
|
338
|
-
|
|
339
|
-
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
|
|
343
|
-
|
|
344
|
-
|
|
345
|
-
const
|
|
346
|
-
|
|
347
|
-
|
|
348
|
-
|
|
349
|
-
|
|
350
|
-
|
|
351
|
-
|
|
352
|
-
|
|
353
|
-
|
|
354
|
-
|
|
355
|
-
|
|
356
|
-
|
|
357
|
-
|
|
358
|
-
}
|
|
359
|
-
|
|
360
|
-
|
|
361
|
-
}
|
|
362
|
-
|
|
363
|
-
|
|
364
|
-
|
|
365
|
-
|
|
366
|
-
|
|
367
|
-
|
|
368
|
-
|
|
369
|
-
|
|
370
|
-
|
|
371
|
-
|
|
372
|
-
|
|
373
|
-
|
|
374
|
-
|
|
375
|
-
|
|
376
|
-
|
|
377
|
-
|
|
378
|
-
}
|
|
379
|
-
|
|
380
|
-
|
|
381
|
-
|
|
382
|
-
|
|
383
|
-
|
|
384
|
-
|
|
385
|
-
|
|
386
|
-
|
|
387
|
-
|
|
388
|
-
|
|
389
|
-
|
|
390
|
-
|
|
391
|
-
|
|
392
|
-
|
|
393
|
-
|
|
394
|
-
|
|
395
|
-
|
|
396
|
-
|
|
397
|
-
|
|
398
|
-
|
|
399
|
-
if ("openWindow" === n2 || "newTab" === n2) window.parent ? window.parent.close() : window.close();
|
|
400
|
-
else {
|
|
401
|
-
const o2 = e2.tableName, i2 = void 0 !== s2 && true === s2 && t2 && void 0 !== t2, a2 = (e2.entity && e2.entity.request ? e2.entity.request.parentPageCode : null) + "_";
|
|
402
|
-
b.$emit(a2 + "close-dialog", { isNeedValueMapping: i2, dataModel: t2, sourceTableName: o2, jumpMode: n2 });
|
|
403
|
-
}
|
|
404
|
-
}
|
|
405
|
-
function G(e2, t2, s2, n2, o2) {
|
|
963
|
+
const pageContext = params.pageContext;
|
|
964
|
+
const configureObj = params.configureObj;
|
|
965
|
+
const configureBase = configureObj.props.base;
|
|
966
|
+
const templateFilesResult = packageTemplateFiles(configureBase.templateFiles);
|
|
967
|
+
let templateUUID;
|
|
968
|
+
let templateShowPath;
|
|
969
|
+
if (templateFilesResult && templateFilesResult.length > 0) {
|
|
970
|
+
templateUUID = templateFilesResult[0].templateUuid;
|
|
971
|
+
templateShowPath = templateFilesResult[0].templateName;
|
|
972
|
+
}
|
|
973
|
+
const systemCode = pageContext.systemCode;
|
|
974
|
+
const backendUrl = pageContext.backendUrl;
|
|
975
|
+
const showName = templateShowPath;
|
|
976
|
+
let param = "?1=1";
|
|
977
|
+
if (templateUUID && showName && templateUUID !== "undefined" && showName !== "undefined" && templateUUID !== "null" && showName !== "null") {
|
|
978
|
+
param += "&fileName=" + encodeURI(templateUUID) + "&showName=" + encodeURI(showName);
|
|
979
|
+
} else if (showName) {
|
|
980
|
+
param += "&showName=" + encodeURI(showName);
|
|
981
|
+
} else if (pageContext.label) {
|
|
982
|
+
param += "&showName=" + encodeURI(pageContext.label) + ".xlsx";
|
|
983
|
+
}
|
|
984
|
+
const logSetting = (_a = configureObj.props.base) == null ? void 0 : _a.logSetting;
|
|
985
|
+
if (logSetting) {
|
|
986
|
+
param += "&logSettingText=" + logSetting.join("");
|
|
987
|
+
}
|
|
988
|
+
if (systemCode) {
|
|
989
|
+
param += "&systemCode=" + systemCode;
|
|
990
|
+
}
|
|
991
|
+
const listCode = params.listCode;
|
|
992
|
+
if (listCode) {
|
|
993
|
+
param += "&listCode=" + listCode;
|
|
994
|
+
}
|
|
995
|
+
if (pageContext.beanName) {
|
|
996
|
+
param += "&beanName=" + pageContext.beanName;
|
|
997
|
+
}
|
|
998
|
+
const functionCodes = getPermissionCodes(configureObj, pageContext);
|
|
999
|
+
if (functionCodes) {
|
|
1000
|
+
param += "&functionCode=" + functionCodes;
|
|
1001
|
+
}
|
|
1002
|
+
if (pageContext.tableName) {
|
|
1003
|
+
param += "&tableName=" + pageContext.tableName;
|
|
1004
|
+
}
|
|
1005
|
+
if (pageContext.code) {
|
|
1006
|
+
param += "&pageCode=" + pageContext.code;
|
|
1007
|
+
}
|
|
1008
|
+
if (pageContext.version) {
|
|
1009
|
+
param += "&pageVersion=" + pageContext.version;
|
|
1010
|
+
}
|
|
1011
|
+
const token = getToken();
|
|
1012
|
+
if (token) {
|
|
1013
|
+
param += "&JWT=" + token;
|
|
1014
|
+
}
|
|
1015
|
+
const runCurrentRoleKey = "_RUN_CURRENT_ROLE";
|
|
1016
|
+
const currentRole = getSessionCache(runCurrentRoleKey);
|
|
1017
|
+
if (currentRole) {
|
|
1018
|
+
param += "&" + runCurrentRoleKey + "=" + currentRole;
|
|
1019
|
+
}
|
|
1020
|
+
if (configureBase) {
|
|
1021
|
+
const isPermission = configureBase.isPermission === void 0 || configureBase.isPermission === "true" || configureBase.isPermission;
|
|
1022
|
+
param += "&isPermission=" + isPermission;
|
|
1023
|
+
}
|
|
1024
|
+
const baseUrl = getBaseUrl(backendUrl, pageContext.isTest);
|
|
1025
|
+
window.open(baseUrl + "/dsc/commons/download-files" + param);
|
|
1026
|
+
}
|
|
1027
|
+
function doImportFinally(params, fileObj) {
|
|
406
1028
|
var _a;
|
|
407
|
-
|
|
408
|
-
const
|
|
409
|
-
|
|
410
|
-
|
|
411
|
-
|
|
412
|
-
|
|
413
|
-
|
|
414
|
-
|
|
415
|
-
|
|
416
|
-
|
|
1029
|
+
const pageContext = params.pageContext;
|
|
1030
|
+
const buttonConfigureObj = params.configureObj;
|
|
1031
|
+
const tableConfigure = params.tableConfigure;
|
|
1032
|
+
const buttonConfigureBase = buttonConfigureObj.props.base;
|
|
1033
|
+
const tableUuid = buttonConfigureObj.props.base.tableUuid ? buttonConfigureObj.props.base.tableUuid : params.tableUuid;
|
|
1034
|
+
const tableName = getTableNameByTableUuid(pageContext, tableUuid);
|
|
1035
|
+
const param = new FormData();
|
|
1036
|
+
param.append("multipartFile", fileObj);
|
|
1037
|
+
if (tableName) {
|
|
1038
|
+
param.append("tableName", tableName);
|
|
1039
|
+
}
|
|
1040
|
+
if (pageContext.importBeanName) {
|
|
1041
|
+
param.append("importBeanName", pageContext.importBeanName);
|
|
1042
|
+
}
|
|
1043
|
+
if (pageContext.beanName) {
|
|
1044
|
+
param.append("beanName", pageContext.beanName);
|
|
1045
|
+
}
|
|
1046
|
+
const listViewImportDuplicate = (_a = tableConfigure.props.importSetting) == null ? void 0 : _a.listViewImportDuplicate;
|
|
1047
|
+
if (listViewImportDuplicate) {
|
|
1048
|
+
param.append("importDuplicateRule", listViewImportDuplicate);
|
|
1049
|
+
}
|
|
1050
|
+
const judgeHeavyList = pageContext.judgeHeavyList;
|
|
1051
|
+
if (judgeHeavyList) {
|
|
1052
|
+
param.append("judgeHeavyList", JSON.stringify(judgeHeavyList));
|
|
1053
|
+
}
|
|
1054
|
+
const autoSetValueData = getButtonAutoSetValueData(buttonConfigureObj);
|
|
1055
|
+
if (autoSetValueData) {
|
|
1056
|
+
param.append("autoSetValueData", autoSetValueData);
|
|
1057
|
+
}
|
|
1058
|
+
const formNoRuleCode = pageContext.formNoRuleCode;
|
|
1059
|
+
if (formNoRuleCode) {
|
|
1060
|
+
param.append("formNoRuleCode", formNoRuleCode);
|
|
1061
|
+
}
|
|
1062
|
+
const listCode = params.listCode;
|
|
1063
|
+
if (listCode) {
|
|
1064
|
+
param.append("listCode", listCode);
|
|
1065
|
+
}
|
|
1066
|
+
let isAsync = false;
|
|
1067
|
+
if (buttonConfigureBase["isAsync"] !== void 0 && buttonConfigureBase["isAsync"] !== null) {
|
|
1068
|
+
isAsync = buttonConfigureBase.isAsync;
|
|
1069
|
+
} else {
|
|
1070
|
+
isAsync = false;
|
|
1071
|
+
}
|
|
1072
|
+
param.append("isAsync", isAsync + "");
|
|
1073
|
+
param.append("pageCode", pageContext.code);
|
|
1074
|
+
const isWorkflowEntity = isWorkflowPage(pageContext);
|
|
1075
|
+
if (isWorkflowEntity !== null && isWorkflowEntity !== void 0) {
|
|
1076
|
+
param.append("isWorkflowEntity", isWorkflowEntity + "");
|
|
1077
|
+
}
|
|
1078
|
+
const functionCodes = getPermissionCodes(buttonConfigureObj, pageContext);
|
|
1079
|
+
if (functionCodes) {
|
|
1080
|
+
param.append("functionCode", functionCodes);
|
|
1081
|
+
}
|
|
1082
|
+
const additionalParamMap = getAdditionalParamMap(pageContext);
|
|
1083
|
+
param.append("additionalParamMapStr", JSON.stringify(additionalParamMap));
|
|
1084
|
+
const isPermission = buttonConfigureBase.isPermission === void 0 || buttonConfigureBase.isPermission === "true" || buttonConfigureBase.isPermission;
|
|
1085
|
+
param.append("isPermission", isPermission + "");
|
|
1086
|
+
const systemCode = pageContext.systemCode;
|
|
1087
|
+
if (systemCode) {
|
|
1088
|
+
param.append("systemCode", systemCode);
|
|
1089
|
+
}
|
|
1090
|
+
const backendUrl = pageContext.backendUrl;
|
|
1091
|
+
const baseUrl = getBaseUrl(backendUrl, pageContext.isTest);
|
|
1092
|
+
let path = baseUrl + "/dsc/commons/import-data";
|
|
1093
|
+
path = getRealRestApiPath(path, systemCode, backendUrl, pageContext.isTest);
|
|
1094
|
+
http.post(path, param).then((data) => {
|
|
1095
|
+
if (isAsync) {
|
|
1096
|
+
ElMessage({
|
|
1097
|
+
showClose: true,
|
|
1098
|
+
type: "success",
|
|
1099
|
+
message: getI18n().t("superPageRuntimeMessage.asyncImport")
|
|
417
1100
|
});
|
|
1101
|
+
} else {
|
|
1102
|
+
let isSuccess = false;
|
|
1103
|
+
if (data) {
|
|
1104
|
+
isSuccess = false;
|
|
1105
|
+
ElMessage({
|
|
1106
|
+
dangerouslyUseHTMLString: true,
|
|
1107
|
+
showClose: true,
|
|
1108
|
+
type: "warning",
|
|
1109
|
+
message: data
|
|
1110
|
+
});
|
|
1111
|
+
} else {
|
|
1112
|
+
ElMessage({
|
|
1113
|
+
showClose: true,
|
|
1114
|
+
type: "success",
|
|
1115
|
+
message: getI18n().t("superPageRuntimeMessage.successfulImport")
|
|
1116
|
+
});
|
|
1117
|
+
isSuccess = true;
|
|
1118
|
+
}
|
|
1119
|
+
dealAfterOperate(pageContext, buttonConfigureObj, data, null, true);
|
|
1120
|
+
pageContext.result = isSuccess;
|
|
1121
|
+
doAfterClickEvent(pageContext, buttonConfigureObj);
|
|
418
1122
|
}
|
|
419
|
-
}(
|
|
1123
|
+
}).catch((error) => {
|
|
1124
|
+
console.log("error==", error);
|
|
1125
|
+
});
|
|
420
1126
|
}
|
|
421
|
-
function
|
|
422
|
-
|
|
423
|
-
|
|
424
|
-
|
|
425
|
-
|
|
426
|
-
|
|
427
|
-
|
|
428
|
-
|
|
429
|
-
|
|
430
|
-
|
|
431
|
-
|
|
432
|
-
}
|
|
433
|
-
} else if (i2 && "form" === i2) {
|
|
434
|
-
const t3 = e2.entity.data;
|
|
435
|
-
le(e2, t3.ID ? t3.ID : t3.id);
|
|
436
|
-
}
|
|
437
|
-
}
|
|
438
|
-
}
|
|
439
|
-
function J(e2, t2, s2, i2) {
|
|
440
|
-
return new Promise((r2, l2) => {
|
|
441
|
-
const d2 = e2.pageContext, m2 = e2.configureObj, f2 = e2.mainDefaultValueColumns, g2 = e2.dynamicColumnInfo, b2 = e2.ids, C2 = m2.props.base.successOperation;
|
|
442
|
-
let T2 = false;
|
|
443
|
-
C2 && "noOperation" === C2 && (T2 = true);
|
|
444
|
-
let y2 = d2.tableName;
|
|
445
|
-
if (t2) {
|
|
446
|
-
const t3 = m2.props.base.tableUuid ? m2.props.base.tableUuid : e2.tableUuid;
|
|
447
|
-
y2 = x(d2, t3);
|
|
448
|
-
}
|
|
449
|
-
const h2 = function(e3, t3, s3, i3, r3, l3, d3, m3, f3) {
|
|
450
|
-
return new Promise((g3, b3) => {
|
|
451
|
-
const C3 = t3.props.base.title, T3 = "superPageRuntimeMessage.whetherToConfirm" + a(d3);
|
|
452
|
-
p.confirm(u().t(T3, { name: C3 }), u().t("superPageRuntimeMessage.tips"), { confirmButtonText: u().t("superPageRuntimeMessage.sure"), cancelButtonText: u().t("superPageRuntimeMessage.cancel"), type: "warning" }).then(() => {
|
|
453
|
-
const a2 = e3.systemCode, u2 = e3.backendUrl, p2 = B(e3, t3, i3, r3, l3, m3, null);
|
|
454
|
-
p2.tableName = f3;
|
|
455
|
-
let d4 = n(u2, e3.isTest) + s3;
|
|
456
|
-
d4 = o(d4, a2, u2, e3.isTest), c.post(d4, p2).then((e4) => {
|
|
457
|
-
g3(e4);
|
|
458
|
-
}).catch((e4) => {
|
|
459
|
-
b3(e4);
|
|
460
|
-
});
|
|
461
|
-
}).catch(() => {
|
|
462
|
-
b3("点击了取消按钮");
|
|
1127
|
+
function judgeDataNumber(buttonConfigureObj, ids2) {
|
|
1128
|
+
const buttonConfigureBase = buttonConfigureObj.props.base;
|
|
1129
|
+
if (buttonConfigureBase.conditionsForExecution && buttonConfigureBase.conditionsForExecution !== "") {
|
|
1130
|
+
if (buttonConfigureBase.conditionsForExecution === "one") {
|
|
1131
|
+
if (!ids2 || ids2.length !== 1) {
|
|
1132
|
+
ElMessage({
|
|
1133
|
+
showClose: true,
|
|
1134
|
+
type: "warning",
|
|
1135
|
+
message: getI18n().t("superPageRuntimeMessage.thePreconditionOfTheButtonTo", {
|
|
1136
|
+
message: getI18n().t("superPageRuntimeMessage.onlyOneRecordCanBeselected")
|
|
1137
|
+
})
|
|
463
1138
|
});
|
|
464
|
-
|
|
465
|
-
|
|
466
|
-
|
|
467
|
-
|
|
468
|
-
|
|
469
|
-
|
|
470
|
-
|
|
1139
|
+
return false;
|
|
1140
|
+
}
|
|
1141
|
+
} else if (buttonConfigureBase.conditionsForExecution === "more") {
|
|
1142
|
+
if (!ids2 || ids2.length <= 0) {
|
|
1143
|
+
ElMessage({
|
|
1144
|
+
showClose: true,
|
|
1145
|
+
type: "warning",
|
|
1146
|
+
message: getI18n().t("superPageRuntimeMessage.thePreconditionOfTheButtonTo", {
|
|
1147
|
+
message: getI18n().t("superPageRuntimeMessage.selectAtLeastOneRecord")
|
|
1148
|
+
})
|
|
1149
|
+
});
|
|
1150
|
+
return false;
|
|
1151
|
+
}
|
|
1152
|
+
}
|
|
1153
|
+
}
|
|
1154
|
+
return true;
|
|
1155
|
+
}
|
|
1156
|
+
function exportFunc(params) {
|
|
1157
|
+
return new Promise((resolve, reject) => {
|
|
1158
|
+
const pageContext = params.pageContext;
|
|
1159
|
+
const configureBase = params.configureObj.props.base;
|
|
1160
|
+
const listCode = params.listCode;
|
|
1161
|
+
const selections = params.selections;
|
|
1162
|
+
const dataParam = {};
|
|
1163
|
+
if (selections && selections.length > 0) {
|
|
1164
|
+
dataParam["data"] = selections;
|
|
1165
|
+
}
|
|
1166
|
+
let pageName = pageContext.label;
|
|
1167
|
+
if (!pageName) {
|
|
1168
|
+
pageName = pageContext.code;
|
|
1169
|
+
}
|
|
1170
|
+
let isAsync = false;
|
|
1171
|
+
if (configureBase["isAsync"] !== void 0 && configureBase["isAsync"] !== null) {
|
|
1172
|
+
isAsync = configureBase.isAsync;
|
|
1173
|
+
} else {
|
|
1174
|
+
isAsync = false;
|
|
1175
|
+
}
|
|
1176
|
+
const isPermission = configureBase.isPermission === void 0 || configureBase.isPermission === "true" || configureBase.isPermission;
|
|
1177
|
+
const functionCodes = getPermissionCodes(params.configureObj, pageContext);
|
|
1178
|
+
const exportFileName = pageName;
|
|
1179
|
+
const exportOptions = {
|
|
1180
|
+
backendUrl: pageContext.backendUrl,
|
|
1181
|
+
pageContext
|
|
1182
|
+
};
|
|
1183
|
+
console.log("exportFunc======exportOptions=", exportOptions);
|
|
1184
|
+
window["$vueApp"].config.globalProperties.$exportDataNew(
|
|
1185
|
+
dataParam,
|
|
1186
|
+
exportFileName,
|
|
1187
|
+
listCode,
|
|
1188
|
+
functionCodes,
|
|
1189
|
+
null,
|
|
1190
|
+
exportOptions,
|
|
1191
|
+
isAsync,
|
|
1192
|
+
pageContext.code,
|
|
1193
|
+
isPermission
|
|
1194
|
+
);
|
|
471
1195
|
});
|
|
472
1196
|
}
|
|
473
|
-
function
|
|
1197
|
+
function getWorkflowSaveParams(params) {
|
|
474
1198
|
var _a;
|
|
475
|
-
const
|
|
476
|
-
|
|
477
|
-
const
|
|
478
|
-
|
|
479
|
-
const
|
|
480
|
-
|
|
481
|
-
|
|
482
|
-
|
|
483
|
-
|
|
484
|
-
|
|
485
|
-
|
|
486
|
-
|
|
487
|
-
|
|
488
|
-
|
|
489
|
-
|
|
490
|
-
|
|
491
|
-
|
|
492
|
-
|
|
493
|
-
|
|
494
|
-
|
|
495
|
-
|
|
496
|
-
|
|
497
|
-
|
|
498
|
-
|
|
499
|
-
|
|
500
|
-
|
|
501
|
-
|
|
502
|
-
|
|
503
|
-
|
|
504
|
-
|
|
505
|
-
|
|
506
|
-
|
|
507
|
-
|
|
1199
|
+
const pageContext = params.pageContext;
|
|
1200
|
+
const configureObj = params.configureObj;
|
|
1201
|
+
const dataModel = pageContext.entity.data;
|
|
1202
|
+
const systemCode = pageContext.systemCode;
|
|
1203
|
+
const permissionPrefix = pageContext.code;
|
|
1204
|
+
let functionCodes = getPermissionCodes(configureObj, pageContext);
|
|
1205
|
+
if (!functionCodes) {
|
|
1206
|
+
functionCodes = permissionPrefix + ".xxx";
|
|
1207
|
+
}
|
|
1208
|
+
if (!dataModel.id && !dataModel.ID) {
|
|
1209
|
+
dataModel["PAGE_CODE"] = pageContext.code;
|
|
1210
|
+
dataModel["PAGE_VERSION"] = pageContext.version;
|
|
1211
|
+
}
|
|
1212
|
+
const param = {
|
|
1213
|
+
entity: dataModel,
|
|
1214
|
+
pageMoel: pageContext.entity.page,
|
|
1215
|
+
formNoRuleCode: pageContext.formNoRuleCode,
|
|
1216
|
+
tableName: pageContext.tableName,
|
|
1217
|
+
emailTemplateCode: pageContext.emailTemplateCode,
|
|
1218
|
+
definitionId: pageContext.definitionId,
|
|
1219
|
+
functionCode: functionCodes,
|
|
1220
|
+
systemCode,
|
|
1221
|
+
listCodesMap: pageContext.listCodesMap,
|
|
1222
|
+
pageCode: pageContext.code,
|
|
1223
|
+
pageVersion: pageContext.version
|
|
1224
|
+
};
|
|
1225
|
+
if (pageContext.completeTaskParam) {
|
|
1226
|
+
param["completeTaskParam"] = {
|
|
1227
|
+
taskId: pageContext.completeTaskParam.taskId,
|
|
1228
|
+
opinion: pageContext.completeTaskParam.opinion
|
|
1229
|
+
};
|
|
1230
|
+
}
|
|
1231
|
+
if (pageContext.judgeHeavyList) {
|
|
1232
|
+
if (isArrayFn(pageContext.judgeHeavyList)) {
|
|
1233
|
+
param["judgeHeavyList"] = JSON.stringify(pageContext.judgeHeavyList);
|
|
1234
|
+
} else {
|
|
1235
|
+
param["judgeHeavyList"] = pageContext.judgeHeavyList;
|
|
1236
|
+
}
|
|
1237
|
+
}
|
|
1238
|
+
const conversionCodes = configureObj.props.base.conversionCodes;
|
|
1239
|
+
if (conversionCodes) {
|
|
1240
|
+
if (isArrayFn(conversionCodes)) {
|
|
1241
|
+
param["dataConversionRule"] = conversionCodes.join(",");
|
|
1242
|
+
} else if (typeof conversionCodes === "string") {
|
|
1243
|
+
param["dataConversionRule"] = conversionCodes;
|
|
1244
|
+
}
|
|
1245
|
+
}
|
|
1246
|
+
console.log("getWorkflowSaveParams----configureObj=", configureObj);
|
|
1247
|
+
const autoSetValueData = getButtonAutoSetValueData(configureObj);
|
|
1248
|
+
if (autoSetValueData) {
|
|
1249
|
+
param["autoSetValueData"] = autoSetValueData;
|
|
1250
|
+
}
|
|
1251
|
+
if (pageContext.beanName) {
|
|
1252
|
+
param["beanName"] = pageContext.beanName;
|
|
1253
|
+
}
|
|
1254
|
+
const logSetting = (_a = configureObj.props.base) == null ? void 0 : _a.logSetting;
|
|
1255
|
+
if (logSetting) {
|
|
1256
|
+
param["logSettingText"] = logSetting.join("");
|
|
1257
|
+
}
|
|
1258
|
+
if (!param.systemCode) {
|
|
1259
|
+
param.systemCode = systemCode;
|
|
1260
|
+
}
|
|
1261
|
+
const additionalParamMap = getAdditionalParamMap(pageContext);
|
|
1262
|
+
param["additionalParamMap"] = additionalParamMap;
|
|
1263
|
+
if (additionalParamMap.ids && additionalParamMap.ids.length > 0) {
|
|
1264
|
+
if (typeof additionalParamMap.ids === "string") {
|
|
1265
|
+
param["ids"] = additionalParamMap.ids.split(",");
|
|
1266
|
+
} else if (Array.isArray(additionalParamMap.ids)) {
|
|
1267
|
+
param["ids"] = additionalParamMap.ids;
|
|
1268
|
+
} else if (typeof ids === "number") {
|
|
1269
|
+
param["ids"] = [additionalParamMap.ids];
|
|
1270
|
+
} else {
|
|
1271
|
+
console.error("ids参数类型错误");
|
|
1272
|
+
}
|
|
1273
|
+
}
|
|
1274
|
+
const successOperation = configureObj.props.base.successOperation;
|
|
1275
|
+
if (successOperation && successOperation === "noOperation") {
|
|
1276
|
+
param["unControlVersion"] = true;
|
|
1277
|
+
}
|
|
1278
|
+
param["isWorkflowEntity"] = true;
|
|
1279
|
+
return param;
|
|
1280
|
+
}
|
|
1281
|
+
async function workflowSaveFunc(params) {
|
|
1282
|
+
return new Promise((resolve, reject) => {
|
|
1283
|
+
const pageContext = params.pageContext;
|
|
1284
|
+
const dataModel = pageContext.entity.data;
|
|
1285
|
+
const systemCode = pageContext.systemCode;
|
|
1286
|
+
const backendUrl = pageContext.backendUrl;
|
|
1287
|
+
let path = getBaseUrl(backendUrl, pageContext.isTest) + "/dsc/workflow-commons";
|
|
1288
|
+
path = getRealRestApiPath(path, systemCode, backendUrl, pageContext.isTest);
|
|
1289
|
+
if (!path) {
|
|
1290
|
+
ElMessage({
|
|
1291
|
+
showClose: true,
|
|
1292
|
+
type: "warning",
|
|
1293
|
+
message: getI18n().t("superPageRuntimeMessage.requestPathEmpty")
|
|
1294
|
+
});
|
|
1295
|
+
return;
|
|
1296
|
+
}
|
|
1297
|
+
const param = getWorkflowSaveParams(params);
|
|
1298
|
+
let request;
|
|
1299
|
+
if (dataModel.id || dataModel.ID) {
|
|
1300
|
+
request = http.put(path, param);
|
|
1301
|
+
} else {
|
|
1302
|
+
request = http.post(path, param);
|
|
1303
|
+
}
|
|
1304
|
+
request.then((commonEntity) => {
|
|
1305
|
+
let result = true;
|
|
1306
|
+
if (commonEntity) {
|
|
1307
|
+
result = dealCompleteTaskParam(commonEntity, false, pageContext, params, null);
|
|
1308
|
+
}
|
|
1309
|
+
if (result === true) {
|
|
1310
|
+
ElMessage({
|
|
1311
|
+
showClose: true,
|
|
1312
|
+
type: "success",
|
|
1313
|
+
message: getI18n().t("superPageRuntimeMessage.successfulSave")
|
|
1314
|
+
});
|
|
1315
|
+
}
|
|
1316
|
+
resolve(true);
|
|
1317
|
+
}).catch((error) => {
|
|
1318
|
+
reject(error);
|
|
1319
|
+
});
|
|
508
1320
|
});
|
|
509
1321
|
}
|
|
510
|
-
function
|
|
511
|
-
const
|
|
512
|
-
|
|
513
|
-
|
|
514
|
-
|
|
515
|
-
|
|
1322
|
+
function dealCompleteTaskParam(commonEntity, isInit, pageContext, params, operationResult) {
|
|
1323
|
+
const pageCode = pageContext.code;
|
|
1324
|
+
const pageVersion = pageContext.version;
|
|
1325
|
+
let taskId;
|
|
1326
|
+
if (commonEntity) {
|
|
1327
|
+
if (isInit) {
|
|
1328
|
+
pageContext.initFormNo = commonEntity.formNo;
|
|
1329
|
+
pageContext.emailTemplateCode = commonEntity.emailTemplateCode;
|
|
1330
|
+
}
|
|
1331
|
+
if (commonEntity.entity) {
|
|
1332
|
+
pageContext.entity.data = commonEntity.entity;
|
|
1333
|
+
cacheFormDataId(commonEntity.entity.id || commonEntity.entity.ID, pageContext);
|
|
1334
|
+
}
|
|
1335
|
+
const completeTaskResult = commonEntity.completeTaskResult;
|
|
1336
|
+
if (completeTaskResult) {
|
|
1337
|
+
const completeTaskTipType = completeTaskResult.completeTaskTipType;
|
|
1338
|
+
if (completeTaskTipType && completeTaskTipType === "MESSAGE") {
|
|
1339
|
+
const message = completeTaskResult.content;
|
|
1340
|
+
ElMessage({
|
|
1341
|
+
showClose: true,
|
|
1342
|
+
type: "warning",
|
|
1343
|
+
message
|
|
1344
|
+
});
|
|
1345
|
+
return false;
|
|
1346
|
+
}
|
|
1347
|
+
}
|
|
1348
|
+
if (commonEntity.completeTaskParam) {
|
|
1349
|
+
const completeTaskParam = commonEntity.completeTaskParam;
|
|
1350
|
+
taskId = completeTaskParam.taskId;
|
|
1351
|
+
if (params) {
|
|
1352
|
+
params.taskId = taskId;
|
|
1353
|
+
}
|
|
1354
|
+
setStoreInfo(pageCode, pageVersion, "_completeTaskParam", completeTaskParam);
|
|
1355
|
+
pageContext.fieldPermissions = completeTaskParam.fieldPermissions;
|
|
1356
|
+
pageContext.actionPermissions = completeTaskParam.actionPermissions;
|
|
1357
|
+
pageContext.workflowButtonComponent = completeTaskParam.buttonComponent;
|
|
1358
|
+
pageContext.completeTaskParam = completeTaskParam;
|
|
1359
|
+
}
|
|
1360
|
+
if (!pageContext.entity) {
|
|
1361
|
+
pageContext.entity = {};
|
|
1362
|
+
}
|
|
1363
|
+
pageContext.entity.task = commonEntity.taskParamMap;
|
|
1364
|
+
setStoreInfo(pageCode, pageVersion, "_currentActivityName", commonEntity.taskName);
|
|
1365
|
+
}
|
|
1366
|
+
if (params) {
|
|
1367
|
+
params.operationResult = operationResult;
|
|
1368
|
+
}
|
|
1369
|
+
if (!isInit) {
|
|
1370
|
+
dealAfterOperate(pageContext, params.configureObj, commonEntity, null, false);
|
|
516
1371
|
}
|
|
517
1372
|
return true;
|
|
518
1373
|
}
|
|
519
|
-
function
|
|
520
|
-
|
|
521
|
-
|
|
522
|
-
|
|
523
|
-
|
|
524
|
-
|
|
525
|
-
|
|
526
|
-
|
|
527
|
-
|
|
528
|
-
|
|
529
|
-
|
|
530
|
-
|
|
531
|
-
|
|
532
|
-
|
|
533
|
-
|
|
534
|
-
|
|
535
|
-
|
|
536
|
-
|
|
537
|
-
|
|
538
|
-
|
|
539
|
-
|
|
540
|
-
|
|
541
|
-
t2 && (s2.initFormNo = e2.formNo, s2.emailTemplateCode = e2.emailTemplateCode), e2.entity && (s2.entity.data = e2.entity, function(e3, t3) {
|
|
542
|
-
const s3 = te(t3);
|
|
543
|
-
e3 && s3 && f(s3._t_ + "_id", e3);
|
|
544
|
-
}(e2.entity.id || e2.entity.ID, s2));
|
|
545
|
-
const o3 = e2.completeTaskResult;
|
|
546
|
-
if (o3) {
|
|
547
|
-
const e3 = o3.completeTaskTipType;
|
|
548
|
-
if (e3 && "MESSAGE" === e3) {
|
|
549
|
-
const e4 = o3.content;
|
|
550
|
-
return l({ showClose: true, type: "warning", message: e4 }), false;
|
|
551
|
-
}
|
|
552
|
-
}
|
|
553
|
-
if (e2.completeTaskParam) {
|
|
554
|
-
const t3 = e2.completeTaskParam;
|
|
555
|
-
r2 = t3.taskId, n2 && (n2.taskId = r2), P(i2, a2, "_completeTaskParam", t3), s2.fieldPermissions = t3.fieldPermissions, s2.actionPermissions = t3.actionPermissions, s2.workflowButtonComponent = t3.buttonComponent, s2.completeTaskParam = t3;
|
|
556
|
-
}
|
|
557
|
-
s2.entity || (s2.entity = {}), s2.entity.task = e2.taskParamMap, P(i2, a2, "_currentActivityName", e2.taskName);
|
|
558
|
-
}
|
|
559
|
-
return n2 && (n2.operationResult = o2), t2 || F(s2, n2.configureObj, e2, null, false), true;
|
|
560
|
-
}
|
|
561
|
-
async function X(e2, t2) {
|
|
562
|
-
const s2 = await function(e3) {
|
|
563
|
-
return new Promise((t3, s3) => {
|
|
564
|
-
var _a, _b, _c, _d;
|
|
565
|
-
const n2 = e3.configureObj;
|
|
566
|
-
if (n2) {
|
|
567
|
-
let s4 = false;
|
|
568
|
-
if (((_b = (_a = n2.props) == null ? void 0 : _a.base) == null ? void 0 : _b.isMustOpinion) && (s4 = true), true === s4) {
|
|
569
|
-
const t4 = e3.pageContext, o2 = (_d = (_c = n2.props) == null ? void 0 : _c.base) == null ? void 0 : _d.mustOpinionConditions;
|
|
570
|
-
s4 = R(t4, n2, o2);
|
|
1374
|
+
function submitProcessFunc(params) {
|
|
1375
|
+
return new Promise((resolve, reject) => {
|
|
1376
|
+
const pageContext = params.pageContext;
|
|
1377
|
+
const systemCode = pageContext.systemCode;
|
|
1378
|
+
const backendUrl = pageContext.backendUrl;
|
|
1379
|
+
let path = getBaseUrl(backendUrl, pageContext.isTest) + "/dsc/workflow-commons/submit";
|
|
1380
|
+
path = getRealRestApiPath(path, systemCode, backendUrl, pageContext.isTest);
|
|
1381
|
+
if (!path) {
|
|
1382
|
+
ElMessage({
|
|
1383
|
+
showClose: true,
|
|
1384
|
+
type: "warning",
|
|
1385
|
+
message: getI18n().t("superPageRuntimeMessage.requestPathEmpty")
|
|
1386
|
+
});
|
|
1387
|
+
return;
|
|
1388
|
+
}
|
|
1389
|
+
const param = getWorkflowSaveParams(params);
|
|
1390
|
+
const request = http.post(path, param);
|
|
1391
|
+
if (request) {
|
|
1392
|
+
request.then((commonEntity) => {
|
|
1393
|
+
let result = true;
|
|
1394
|
+
if (commonEntity) {
|
|
1395
|
+
result = dealCompleteTaskParam(commonEntity, false, pageContext, params, null);
|
|
571
1396
|
}
|
|
572
|
-
|
|
573
|
-
|
|
574
|
-
|
|
575
|
-
|
|
576
|
-
|
|
577
|
-
|
|
578
|
-
|
|
579
|
-
|
|
580
|
-
|
|
1397
|
+
if (result === true) {
|
|
1398
|
+
ElMessage({
|
|
1399
|
+
showClose: true,
|
|
1400
|
+
type: "success",
|
|
1401
|
+
message: getI18n().t("superPageRuntimeMessage.successfulSubmit")
|
|
1402
|
+
});
|
|
1403
|
+
}
|
|
1404
|
+
resolve(true);
|
|
1405
|
+
}).catch((error) => {
|
|
1406
|
+
reject(error);
|
|
1407
|
+
});
|
|
1408
|
+
}
|
|
1409
|
+
});
|
|
1410
|
+
}
|
|
1411
|
+
async function completeTaskFunc(params, operationResult) {
|
|
1412
|
+
const validateOpinionResult = await validateOpinion(params);
|
|
1413
|
+
return new Promise((resolve, reject) => {
|
|
581
1414
|
var _a;
|
|
582
|
-
if (
|
|
583
|
-
const
|
|
584
|
-
|
|
585
|
-
|
|
586
|
-
const
|
|
587
|
-
|
|
588
|
-
|
|
589
|
-
|
|
590
|
-
|
|
591
|
-
|
|
592
|
-
|
|
1415
|
+
if (validateOpinionResult) {
|
|
1416
|
+
const pageContext = params.pageContext;
|
|
1417
|
+
const systemCode = pageContext.systemCode;
|
|
1418
|
+
const backendUrl = pageContext.backendUrl;
|
|
1419
|
+
const opinion = validateOpinionResult === true ? (_a = pageContext.completeTaskParam) == null ? void 0 : _a.opinion : validateOpinionResult;
|
|
1420
|
+
let path = getBaseUrl(backendUrl, pageContext.isTest) + "/dsc/workflow-commons/complete-tasks";
|
|
1421
|
+
path = getRealRestApiPath(path, systemCode, backendUrl, pageContext.isTest);
|
|
1422
|
+
if (!path) {
|
|
1423
|
+
ElMessage({
|
|
1424
|
+
showClose: true,
|
|
1425
|
+
type: "warning",
|
|
1426
|
+
message: getI18n().t("superPageRuntimeMessage.requestPathEmpty")
|
|
1427
|
+
});
|
|
1428
|
+
return;
|
|
1429
|
+
}
|
|
1430
|
+
const param = getWorkflowSaveParams(params);
|
|
1431
|
+
param["completeTaskParam"] = {
|
|
1432
|
+
operationResult,
|
|
1433
|
+
taskId: pageContext.completeTaskParam ? pageContext.completeTaskParam.taskId : null,
|
|
1434
|
+
opinion: opinion ? opinion : null
|
|
1435
|
+
};
|
|
1436
|
+
const request = http.post(path, param);
|
|
1437
|
+
request.then((commonEntity) => {
|
|
1438
|
+
let result = true;
|
|
1439
|
+
if (commonEntity) {
|
|
1440
|
+
result = dealCompleteTaskParam(
|
|
1441
|
+
commonEntity,
|
|
1442
|
+
false,
|
|
1443
|
+
pageContext,
|
|
1444
|
+
params,
|
|
1445
|
+
operationResult
|
|
1446
|
+
);
|
|
1447
|
+
}
|
|
1448
|
+
if (result === true) {
|
|
1449
|
+
ElMessage({
|
|
1450
|
+
showClose: true,
|
|
1451
|
+
type: "success",
|
|
1452
|
+
message: getI18n().t("superPageRuntimeMessage.successfulCompleteTask")
|
|
1453
|
+
});
|
|
1454
|
+
}
|
|
1455
|
+
resolve(true);
|
|
1456
|
+
}).catch((error) => {
|
|
1457
|
+
reject(error);
|
|
593
1458
|
});
|
|
594
|
-
} else
|
|
1459
|
+
} else {
|
|
1460
|
+
resolve(true);
|
|
1461
|
+
}
|
|
595
1462
|
});
|
|
596
1463
|
}
|
|
597
|
-
function
|
|
598
|
-
|
|
599
|
-
|
|
600
|
-
|
|
601
|
-
|
|
602
|
-
|
|
1464
|
+
function validateOpinion(params) {
|
|
1465
|
+
return new Promise((resolve, reject) => {
|
|
1466
|
+
var _a, _b, _c, _d;
|
|
1467
|
+
const configureObj = params.configureObj;
|
|
1468
|
+
if (configureObj) {
|
|
1469
|
+
let isOpinionRequired = false;
|
|
1470
|
+
if ((_b = (_a = configureObj.props) == null ? void 0 : _a.base) == null ? void 0 : _b.isMustOpinion) {
|
|
1471
|
+
isOpinionRequired = true;
|
|
1472
|
+
}
|
|
1473
|
+
if (isOpinionRequired === true) {
|
|
1474
|
+
const pageContext = params.pageContext;
|
|
1475
|
+
const mustOpinionConditions = (_d = (_c = configureObj.props) == null ? void 0 : _c.base) == null ? void 0 : _d.mustOpinionConditions;
|
|
1476
|
+
isOpinionRequired = caculateShowCondition(pageContext, configureObj, mustOpinionConditions);
|
|
1477
|
+
}
|
|
1478
|
+
if (isOpinionRequired === true) {
|
|
1479
|
+
ElMessageBox.prompt(
|
|
1480
|
+
getI18n().t("superPageRuntimeMessage.pleaseInputOpinion"),
|
|
1481
|
+
getI18n().t("superPageRuntimeMessage.opinion"),
|
|
1482
|
+
{
|
|
1483
|
+
confirmButtonText: getI18n().t("superPageRuntimeMessage.sure"),
|
|
1484
|
+
cancelButtonText: getI18n().t("superPageRuntimeMessage.cancel"),
|
|
1485
|
+
// 输入框类型
|
|
1486
|
+
inputType: "textarea",
|
|
1487
|
+
inputValue: null,
|
|
1488
|
+
closeOnClickModal: false,
|
|
1489
|
+
inputValidator: (value) => {
|
|
1490
|
+
if (value && value.trim()) {
|
|
1491
|
+
return true;
|
|
1492
|
+
} else {
|
|
1493
|
+
return getI18n().t("superPageRuntimeMessage.pleaseInputOpinion");
|
|
1494
|
+
}
|
|
1495
|
+
}
|
|
1496
|
+
}
|
|
1497
|
+
).then(({ value }) => {
|
|
1498
|
+
resolve(value);
|
|
1499
|
+
}).catch(() => {
|
|
1500
|
+
resolve(false);
|
|
1501
|
+
});
|
|
1502
|
+
} else {
|
|
1503
|
+
resolve(true);
|
|
1504
|
+
}
|
|
1505
|
+
} else {
|
|
1506
|
+
resolve(true);
|
|
1507
|
+
}
|
|
1508
|
+
});
|
|
1509
|
+
}
|
|
1510
|
+
function assignTask(params) {
|
|
1511
|
+
const pageContext = params.pageContext;
|
|
1512
|
+
const pagCode = pageContext.code;
|
|
1513
|
+
const eventPageInfo = pagCode + "_";
|
|
1514
|
+
bus.$emit(eventPageInfo + "assign-task", params);
|
|
1515
|
+
}
|
|
1516
|
+
function doAssign(params, selectNodeInfo) {
|
|
1517
|
+
if (selectNodeInfo) {
|
|
1518
|
+
const pageContext = params.pageContext;
|
|
1519
|
+
const configureObj = params.configureObj;
|
|
1520
|
+
const backendUrl = pageContext.backendUrl;
|
|
1521
|
+
const path = getBaseUrl(backendUrl, pageContext.isTest) + "/dsc/workflow-commons/assigns";
|
|
1522
|
+
const assigneeId = selectNodeInfo.id ? selectNodeInfo.id : selectNodeInfo.ID ? selectNodeInfo.ID : null;
|
|
1523
|
+
const requestParam = getWorkflowSaveParams(params);
|
|
1524
|
+
requestParam["assigneeId"] = assigneeId;
|
|
1525
|
+
transactTask(params, requestParam, path, "superPageRuntimeMessage.successfulAssign").then(
|
|
1526
|
+
(result) => {
|
|
1527
|
+
doAfterClickEvent(pageContext, configureObj);
|
|
1528
|
+
}
|
|
1529
|
+
);
|
|
603
1530
|
}
|
|
604
1531
|
}
|
|
605
|
-
function
|
|
606
|
-
const
|
|
607
|
-
|
|
608
|
-
|
|
609
|
-
|
|
610
|
-
|
|
611
|
-
|
|
612
|
-
|
|
613
|
-
|
|
614
|
-
|
|
615
|
-
|
|
616
|
-
|
|
617
|
-
|
|
618
|
-
|
|
619
|
-
|
|
620
|
-
|
|
621
|
-
|
|
622
|
-
|
|
623
|
-
|
|
624
|
-
|
|
625
|
-
|
|
626
|
-
|
|
627
|
-
|
|
1532
|
+
function getTransactTaskParam(params) {
|
|
1533
|
+
const pageContext = params.pageContext;
|
|
1534
|
+
const dataModel = pageContext.entity.data;
|
|
1535
|
+
const systemCode = pageContext.systemCode;
|
|
1536
|
+
const permissionPrefix = pageContext.code;
|
|
1537
|
+
const additionalParamMap = getAdditionalParamMap(pageContext);
|
|
1538
|
+
const dataId = dataModel.ID !== void 0 && dataModel.ID !== null ? dataModel.ID : dataModel.id;
|
|
1539
|
+
const requestParams = {
|
|
1540
|
+
beanName: pageContext.beanName,
|
|
1541
|
+
id: dataId,
|
|
1542
|
+
entity: dataModel,
|
|
1543
|
+
additionalParamMap,
|
|
1544
|
+
tableName: pageContext.tableName,
|
|
1545
|
+
functionCode: permissionPrefix + ".xxx",
|
|
1546
|
+
isWorkflowEntity: true,
|
|
1547
|
+
listCodesMap: pageContext.listCodesMap,
|
|
1548
|
+
pageCode: pageContext.code,
|
|
1549
|
+
pageVersion: pageContext.version
|
|
1550
|
+
};
|
|
1551
|
+
requestParams["completeTaskParam"] = {
|
|
1552
|
+
taskId: pageContext.completeTaskParam.taskId,
|
|
1553
|
+
systemCode
|
|
1554
|
+
};
|
|
1555
|
+
return requestParams;
|
|
1556
|
+
}
|
|
1557
|
+
function getAdditionalParamMap(pageContext) {
|
|
1558
|
+
if (pageContext.entity) {
|
|
1559
|
+
let additionalParamMap = deepCopy(pageContext.entity.page);
|
|
1560
|
+
if (!additionalParamMap) {
|
|
1561
|
+
additionalParamMap = {};
|
|
1562
|
+
}
|
|
1563
|
+
const requestMap = pageContext.entity.request;
|
|
1564
|
+
if (requestMap) {
|
|
1565
|
+
Object.assign(additionalParamMap, requestMap);
|
|
1566
|
+
}
|
|
1567
|
+
return additionalParamMap;
|
|
628
1568
|
}
|
|
629
1569
|
}
|
|
630
|
-
function
|
|
631
|
-
|
|
632
|
-
|
|
633
|
-
|
|
634
|
-
|
|
635
|
-
|
|
636
|
-
|
|
637
|
-
|
|
638
|
-
|
|
639
|
-
|
|
640
|
-
|
|
1570
|
+
function addSignerFunc(params) {
|
|
1571
|
+
const pageContext = params.pageContext;
|
|
1572
|
+
const pagCode = pageContext.code;
|
|
1573
|
+
const eventPageInfo = pagCode + "_";
|
|
1574
|
+
bus.$emit(eventPageInfo + "add-signer", params);
|
|
1575
|
+
}
|
|
1576
|
+
function doAddSigner(params, selectNodeInfo) {
|
|
1577
|
+
if (selectNodeInfo) {
|
|
1578
|
+
const pageContext = params.pageContext;
|
|
1579
|
+
const buttonConfigureObj = params.configureObj;
|
|
1580
|
+
const systemCode = pageContext.systemCode;
|
|
1581
|
+
const backendUrl = pageContext.backendUrl;
|
|
1582
|
+
let path = getBaseUrl(backendUrl, pageContext.isTest) + "/dsc/workflow-commons/add-signers";
|
|
1583
|
+
path = getRealRestApiPath(path, systemCode, backendUrl, pageContext.isTest);
|
|
1584
|
+
if (!path) {
|
|
1585
|
+
ElMessage({
|
|
1586
|
+
showClose: true,
|
|
1587
|
+
type: "warning",
|
|
1588
|
+
message: getI18n().t("superPageRuntimeMessage.requestPathEmpty")
|
|
1589
|
+
});
|
|
1590
|
+
return;
|
|
1591
|
+
}
|
|
1592
|
+
const requestParams = getTransactTaskParam(params);
|
|
1593
|
+
requestParams["completeTaskParam"].transactors = selectNodeInfo.loginNames.join(",").split(",");
|
|
1594
|
+
const request = http.post(path, requestParams);
|
|
1595
|
+
if (request) {
|
|
1596
|
+
request.then((commonEntity) => {
|
|
1597
|
+
ElMessage({
|
|
1598
|
+
showClose: true,
|
|
1599
|
+
type: "success",
|
|
1600
|
+
message: getI18n().t("superPageRuntimeMessage.successfulOperation")
|
|
1601
|
+
});
|
|
1602
|
+
if (commonEntity.entity) {
|
|
1603
|
+
dealAfterOperate(pageContext, buttonConfigureObj, commonEntity, null, false);
|
|
1604
|
+
}
|
|
1605
|
+
doAfterClickEvent(pageContext, buttonConfigureObj);
|
|
1606
|
+
});
|
|
1607
|
+
}
|
|
641
1608
|
}
|
|
642
1609
|
}
|
|
643
|
-
function
|
|
644
|
-
|
|
645
|
-
|
|
646
|
-
|
|
647
|
-
|
|
648
|
-
|
|
649
|
-
|
|
650
|
-
|
|
651
|
-
|
|
652
|
-
|
|
653
|
-
|
|
654
|
-
|
|
1610
|
+
function createCopyTask(params) {
|
|
1611
|
+
const pageContext = params.pageContext;
|
|
1612
|
+
const pagCode = pageContext.code;
|
|
1613
|
+
const eventPageInfo = pagCode + "_";
|
|
1614
|
+
bus.$emit(eventPageInfo + "copy-task", params);
|
|
1615
|
+
}
|
|
1616
|
+
function doCreateCopyTask(params, selectNodeInfo) {
|
|
1617
|
+
if (selectNodeInfo) {
|
|
1618
|
+
const pageContext = params.pageContext;
|
|
1619
|
+
const buttonConfigureObj = params.configureObj;
|
|
1620
|
+
const systemCode = pageContext.systemCode;
|
|
1621
|
+
const backendUrl = pageContext.backendUrl;
|
|
1622
|
+
let path = getBaseUrl(backendUrl, pageContext.isTest) + "/dsc/workflow-commons/add-signers";
|
|
1623
|
+
path = getRealRestApiPath(path, systemCode, backendUrl, pageContext.isTest);
|
|
1624
|
+
if (!path) {
|
|
1625
|
+
ElMessage({
|
|
1626
|
+
showClose: true,
|
|
1627
|
+
type: "warning",
|
|
1628
|
+
message: getI18n().t("superPageRuntimeMessage.requestPathEmpty")
|
|
1629
|
+
});
|
|
1630
|
+
return;
|
|
1631
|
+
}
|
|
1632
|
+
const requestParams = getTransactTaskParam(params);
|
|
1633
|
+
requestParams["completeTaskParam"].transactors = selectNodeInfo.userIds.join(",").split(",");
|
|
1634
|
+
const request = http.post(path, requestParams);
|
|
1635
|
+
if (request) {
|
|
1636
|
+
request.then((commonEntity) => {
|
|
1637
|
+
ElMessage({
|
|
1638
|
+
showClose: true,
|
|
1639
|
+
type: "success",
|
|
1640
|
+
message: getI18n().t("superPageRuntimeMessage.successfulOperation")
|
|
1641
|
+
});
|
|
1642
|
+
doAfterClickEvent(pageContext, buttonConfigureObj);
|
|
1643
|
+
});
|
|
1644
|
+
}
|
|
1645
|
+
}
|
|
655
1646
|
}
|
|
656
|
-
function
|
|
657
|
-
|
|
658
|
-
|
|
659
|
-
|
|
660
|
-
|
|
661
|
-
|
|
662
|
-
|
|
663
|
-
|
|
664
|
-
|
|
665
|
-
|
|
666
|
-
|
|
1647
|
+
function transactTask(params, requestParam, path, successMessageTip) {
|
|
1648
|
+
return new Promise((resolve, reject) => {
|
|
1649
|
+
const pageContext = params.pageContext;
|
|
1650
|
+
const systemCode = pageContext.systemCode;
|
|
1651
|
+
const backendUrl = pageContext.backendUrl;
|
|
1652
|
+
path = getRealRestApiPath(path, systemCode, backendUrl, pageContext.isTest);
|
|
1653
|
+
if (!path) {
|
|
1654
|
+
ElMessage({
|
|
1655
|
+
showClose: true,
|
|
1656
|
+
type: "warning",
|
|
1657
|
+
message: getI18n().t("superPageRuntimeMessage.requestPathEmpty")
|
|
1658
|
+
});
|
|
1659
|
+
return;
|
|
1660
|
+
}
|
|
1661
|
+
const request = http.post(path, requestParam);
|
|
1662
|
+
if (request) {
|
|
1663
|
+
request.then((commonEntity) => {
|
|
1664
|
+
let result = true;
|
|
1665
|
+
if (commonEntity) {
|
|
1666
|
+
result = dealCompleteTaskParam(commonEntity, false, pageContext, params, null);
|
|
1667
|
+
}
|
|
1668
|
+
if (result === true) {
|
|
1669
|
+
ElMessage({
|
|
1670
|
+
showClose: true,
|
|
1671
|
+
type: "success",
|
|
1672
|
+
message: getI18n().t(successMessageTip)
|
|
1673
|
+
});
|
|
1674
|
+
}
|
|
1675
|
+
resolve(true);
|
|
1676
|
+
}).catch((error) => {
|
|
1677
|
+
reject(error);
|
|
1678
|
+
});
|
|
1679
|
+
}
|
|
667
1680
|
});
|
|
668
1681
|
}
|
|
669
|
-
function
|
|
670
|
-
const
|
|
671
|
-
|
|
672
|
-
const
|
|
673
|
-
|
|
674
|
-
|
|
675
|
-
}
|
|
676
|
-
function
|
|
677
|
-
|
|
678
|
-
|
|
679
|
-
|
|
680
|
-
|
|
681
|
-
|
|
682
|
-
|
|
683
|
-
|
|
684
|
-
|
|
685
|
-
|
|
1682
|
+
function drawTaskFunc(params) {
|
|
1683
|
+
const pageContext = params.pageContext;
|
|
1684
|
+
const backendUrl = pageContext.backendUrl;
|
|
1685
|
+
const path = getBaseUrl(backendUrl, pageContext.isTest) + "/dsc/workflow-commons/draw-tasks";
|
|
1686
|
+
const requestParam = getWorkflowSaveParams(params);
|
|
1687
|
+
return transactTask(params, requestParam, path, "superPageRuntimeMessage.successfulDrawTask");
|
|
1688
|
+
}
|
|
1689
|
+
function abandonReceiveFunc(params) {
|
|
1690
|
+
const pageContext = params.pageContext;
|
|
1691
|
+
const backendUrl = pageContext.backendUrl;
|
|
1692
|
+
const path = getBaseUrl(backendUrl, pageContext.isTest) + "/dsc/workflow-commons/abandon-receives";
|
|
1693
|
+
const requestParam = getWorkflowSaveParams(params);
|
|
1694
|
+
return transactTask(
|
|
1695
|
+
params,
|
|
1696
|
+
requestParam,
|
|
1697
|
+
path,
|
|
1698
|
+
"superPageRuntimeMessage.successfulAbandonReceive"
|
|
1699
|
+
);
|
|
1700
|
+
}
|
|
1701
|
+
function returnToPreviousTaskFunc(params) {
|
|
1702
|
+
const pageContext = params.pageContext;
|
|
1703
|
+
const backendUrl = pageContext.backendUrl;
|
|
1704
|
+
const path = getBaseUrl(backendUrl, pageContext.isTest) + "/dsc/workflow-commons/return-to-previous-tasks";
|
|
1705
|
+
const requestParam = getWorkflowSaveParams(params);
|
|
1706
|
+
return transactTask(
|
|
1707
|
+
params,
|
|
1708
|
+
requestParam,
|
|
1709
|
+
path,
|
|
1710
|
+
"superPageRuntimeMessage.successfulReturnToPreviousTask"
|
|
1711
|
+
);
|
|
1712
|
+
}
|
|
1713
|
+
function endInstanceFunc(params) {
|
|
1714
|
+
const pageContext = params.pageContext;
|
|
1715
|
+
const backendUrl = pageContext.backendUrl;
|
|
1716
|
+
const path = getBaseUrl(backendUrl, pageContext.isTest) + "/dsc/workflow-commons/end-instance";
|
|
1717
|
+
const requestParam = getWorkflowSaveParams(params);
|
|
1718
|
+
return transactTask(params, requestParam, path, "superPageRuntimeMessage.successfulEndInstance");
|
|
1719
|
+
}
|
|
1720
|
+
function returnTaskToFunc(params) {
|
|
1721
|
+
const pageContext = params.pageContext;
|
|
1722
|
+
const pagCode = pageContext.code;
|
|
1723
|
+
const eventPageInfo = pagCode + "_";
|
|
1724
|
+
bus.$emit(eventPageInfo + "choose-return-node", params);
|
|
1725
|
+
}
|
|
1726
|
+
function getTaskInformitions(params) {
|
|
1727
|
+
const pageContext = params.pageContext;
|
|
1728
|
+
const systemCode = pageContext.systemCode;
|
|
1729
|
+
const backendUrl = pageContext.backendUrl;
|
|
1730
|
+
const completeTaskParam = pageContext.completeTaskParam;
|
|
1731
|
+
let path = getBaseUrl(backendUrl, pageContext.isTest) + "/dsc/workflow-commons/returnable-task/" + completeTaskParam.taskId;
|
|
1732
|
+
path = getRealRestApiPath(path, systemCode, backendUrl, pageContext.isTest);
|
|
1733
|
+
if (!path) {
|
|
1734
|
+
ElMessage({
|
|
1735
|
+
showClose: true,
|
|
1736
|
+
type: "warning",
|
|
1737
|
+
message: getI18n().t("superPageRuntimeMessage.requestPathEmpty")
|
|
686
1738
|
});
|
|
1739
|
+
return;
|
|
687
1740
|
}
|
|
1741
|
+
const permissionPrefix = pageContext.code;
|
|
1742
|
+
const additionalParamMap = getAdditionalParamMap(pageContext);
|
|
1743
|
+
const requestParams = {
|
|
1744
|
+
beanName: pageContext.beanName,
|
|
1745
|
+
additionalParamMap,
|
|
1746
|
+
tableName: pageContext.tableName,
|
|
1747
|
+
functionCode: permissionPrefix + ".xxx"
|
|
1748
|
+
};
|
|
1749
|
+
return http.post(path, requestParams);
|
|
688
1750
|
}
|
|
689
|
-
function
|
|
690
|
-
|
|
691
|
-
|
|
692
|
-
|
|
693
|
-
|
|
694
|
-
|
|
695
|
-
|
|
696
|
-
|
|
697
|
-
|
|
698
|
-
|
|
699
|
-
|
|
700
|
-
|
|
701
|
-
|
|
702
|
-
|
|
703
|
-
|
|
704
|
-
|
|
705
|
-
|
|
706
|
-
|
|
707
|
-
|
|
708
|
-
|
|
709
|
-
|
|
710
|
-
|
|
711
|
-
|
|
712
|
-
|
|
713
|
-
|
|
714
|
-
|
|
715
|
-
|
|
716
|
-
|
|
717
|
-
|
|
718
|
-
|
|
719
|
-
|
|
720
|
-
|
|
721
|
-
|
|
722
|
-
|
|
723
|
-
|
|
724
|
-
|
|
725
|
-
|
|
726
|
-
|
|
727
|
-
|
|
728
|
-
|
|
729
|
-
|
|
1751
|
+
function doReturnTaskTo(params, selectTaskNode) {
|
|
1752
|
+
const pageContext = params.pageContext;
|
|
1753
|
+
const configureObj = params.configureObj;
|
|
1754
|
+
const backendUrl = pageContext.backendUrl;
|
|
1755
|
+
const path = getBaseUrl(backendUrl, pageContext.isTest) + "/dsc/workflow-commons/returnTaskTo";
|
|
1756
|
+
const requestParam = getWorkflowSaveParams(params);
|
|
1757
|
+
if (selectTaskNode.nodeName) {
|
|
1758
|
+
requestParam["returnToNodeName"] = selectTaskNode.nodeName;
|
|
1759
|
+
}
|
|
1760
|
+
if (selectTaskNode.nodeId) {
|
|
1761
|
+
requestParam["returnToNodeId"] = selectTaskNode.nodeId;
|
|
1762
|
+
}
|
|
1763
|
+
transactTask(params, requestParam, path, "superPageRuntimeMessage.successfulReturnTaskTo").then(
|
|
1764
|
+
(result) => {
|
|
1765
|
+
doAfterClickEvent(pageContext, configureObj);
|
|
1766
|
+
}
|
|
1767
|
+
);
|
|
1768
|
+
}
|
|
1769
|
+
function removeSignerfunc(params) {
|
|
1770
|
+
const pageContext = params.pageContext;
|
|
1771
|
+
const pagCode = pageContext.code;
|
|
1772
|
+
const eventPageInfo = pagCode + "_";
|
|
1773
|
+
bus.$emit(eventPageInfo + "remove-signer", params);
|
|
1774
|
+
}
|
|
1775
|
+
function getRemoveSigner(params) {
|
|
1776
|
+
const pageContext = params.pageContext;
|
|
1777
|
+
const systemCode = pageContext.systemCode;
|
|
1778
|
+
const backendUrl = pageContext.backendUrl;
|
|
1779
|
+
let path = getBaseUrl(backendUrl, pageContext.isTest) + "/dsc/workflow-commons/get-remove-signers";
|
|
1780
|
+
const requestParam = getWorkflowSaveParams(params);
|
|
1781
|
+
path = getRealRestApiPath(path, systemCode, backendUrl, pageContext.isTest);
|
|
1782
|
+
if (!path) {
|
|
1783
|
+
ElMessage({
|
|
1784
|
+
showClose: true,
|
|
1785
|
+
type: "warning",
|
|
1786
|
+
message: getI18n().t("superPageRuntimeMessage.requestPathEmpty")
|
|
1787
|
+
});
|
|
1788
|
+
return;
|
|
1789
|
+
}
|
|
1790
|
+
return http.post(path, requestParam);
|
|
1791
|
+
}
|
|
1792
|
+
function doRemoveSigners(params, selectRemoveTasks) {
|
|
1793
|
+
if (selectRemoveTasks) {
|
|
1794
|
+
const pageContext = params.pageContext;
|
|
1795
|
+
const configureObj = params.configureObj;
|
|
1796
|
+
const systemCode = pageContext.systemCode;
|
|
1797
|
+
const backendUrl = pageContext.backendUrl;
|
|
1798
|
+
let path = getBaseUrl(backendUrl, pageContext.isTest) + "/dsc/workflow-commons/remove-signers";
|
|
1799
|
+
path = getRealRestApiPath(path, systemCode, backendUrl, pageContext.isTest);
|
|
1800
|
+
if (!path) {
|
|
1801
|
+
ElMessage({
|
|
1802
|
+
showClose: true,
|
|
1803
|
+
type: "warning",
|
|
1804
|
+
message: getI18n().t("superPageRuntimeMessage.requestPathEmpty")
|
|
1805
|
+
});
|
|
1806
|
+
return;
|
|
1807
|
+
}
|
|
1808
|
+
const taskIds = selectRemoveTasks.map((task) => task.id ? task.id : task.ID ? task.ID : null);
|
|
1809
|
+
const requestParam = getWorkflowSaveParams(params);
|
|
1810
|
+
requestParam["ids"] = taskIds;
|
|
1811
|
+
const request = http.post(path, requestParam);
|
|
1812
|
+
if (request) {
|
|
1813
|
+
request.then((commonEntity) => {
|
|
1814
|
+
dealAfterOperate(
|
|
1815
|
+
pageContext,
|
|
1816
|
+
configureObj,
|
|
1817
|
+
commonEntity,
|
|
1818
|
+
"superPageRuntimeMessage.successfulOperation",
|
|
1819
|
+
false
|
|
1820
|
+
);
|
|
1821
|
+
doAfterClickEvent(pageContext, configureObj);
|
|
1822
|
+
});
|
|
1823
|
+
}
|
|
1824
|
+
}
|
|
1825
|
+
}
|
|
1826
|
+
function retrieveTaskFunc(params) {
|
|
1827
|
+
const pageContext = params.pageContext;
|
|
1828
|
+
const backendUrl = pageContext.backendUrl;
|
|
1829
|
+
const path = getBaseUrl(backendUrl, pageContext.isTest) + "/dsc/workflow-commons/retrieves";
|
|
1830
|
+
const requestParam = getWorkflowSaveParams(params);
|
|
1831
|
+
return transactTask(params, requestParam, path, "superPageRuntimeMessage.successfulRetrieve");
|
|
1832
|
+
}
|
|
1833
|
+
function lineEditCreateFunc(params) {
|
|
1834
|
+
const pageContext = params.pageContext;
|
|
1835
|
+
const tableUuid = params["tableUuid"];
|
|
1836
|
+
const gridRef = getComponentRef(pageContext, tableUuid);
|
|
1837
|
+
if (gridRef) {
|
|
1838
|
+
params.getDefaultValueFunc = getDefaultValue;
|
|
1839
|
+
gridRef.createRow(params.listCode, {}, params);
|
|
1840
|
+
}
|
|
1841
|
+
}
|
|
1842
|
+
function printLabel(params) {
|
|
1843
|
+
let templateUuid = null;
|
|
1844
|
+
try {
|
|
1845
|
+
if (params.menuItem) {
|
|
1846
|
+
templateUuid = params.menuItem.templateUuid;
|
|
1847
|
+
} else {
|
|
1848
|
+
templateUuid = params.configureObj.props.base.template[0].templateUuid;
|
|
1849
|
+
}
|
|
1850
|
+
if (!templateUuid) {
|
|
1851
|
+
throw new Error("未找到模板");
|
|
1852
|
+
}
|
|
1853
|
+
} catch (e) {
|
|
1854
|
+
console.error("打印标签失败,未在配置中找到找到模板", e, params);
|
|
1855
|
+
}
|
|
1856
|
+
printLabelUtil.printLabel(params, templateUuid);
|
|
1857
|
+
}
|
|
1858
|
+
function isVisibleWorkflowButton(standardEventName, buttonInfo, completeTaskParam) {
|
|
1859
|
+
let isVisible = false;
|
|
1860
|
+
if (standardEventName && buttonInfo) {
|
|
1861
|
+
if (standardEventName === "workflowSave") {
|
|
1862
|
+
isVisible = isVisibleWorkflowSave(buttonInfo);
|
|
1863
|
+
} else if (standardEventName === "submitProcess") {
|
|
1864
|
+
isVisible = isVisibleSubmitProcess(buttonInfo);
|
|
1865
|
+
} else if (standardEventName === "submitTask") {
|
|
1866
|
+
isVisible = isVisibleSubmitTask(buttonInfo);
|
|
1867
|
+
} else if (standardEventName === "drawTask") {
|
|
1868
|
+
isVisible = isVisibleDrawTask(buttonInfo);
|
|
1869
|
+
} else if (standardEventName === "abandonReceive") {
|
|
1870
|
+
isVisible = isVisibleAbandonReceive(buttonInfo);
|
|
1871
|
+
} else if (standardEventName === "approve" || standardEventName === "refuse") {
|
|
1872
|
+
isVisible = isVisibleApproveOrRefuse(buttonInfo);
|
|
1873
|
+
} else if (standardEventName === "readed") {
|
|
1874
|
+
isVisible = isVisibleReaded(buttonInfo);
|
|
1875
|
+
} else if (standardEventName === "assign") {
|
|
1876
|
+
isVisible = isVisibleAssignTask(buttonInfo);
|
|
1877
|
+
} else if (standardEventName === "copyTask") {
|
|
1878
|
+
isVisible = isVisibleCopyTask(buttonInfo);
|
|
1879
|
+
} else if (standardEventName === "addSigner") {
|
|
1880
|
+
isVisible = isVisibleAddSigner(buttonInfo);
|
|
1881
|
+
} else if (standardEventName === "removeSigner") {
|
|
1882
|
+
isVisible = isVisibleRemoveSigner(buttonInfo);
|
|
1883
|
+
} else if (standardEventName === "retrieveTask") {
|
|
1884
|
+
isVisible = isVisibleRetrieveTask(buttonInfo);
|
|
1885
|
+
} else if (standardEventName === "agreement" || standardEventName === "oppose") {
|
|
1886
|
+
isVisible = isVisibleAgreementOrOppose(buttonInfo);
|
|
1887
|
+
} else if (standardEventName === "kiken") {
|
|
1888
|
+
isVisible = isVisibleKiken(buttonInfo);
|
|
1889
|
+
} else if (isShowOtherWorkflowBtn(buttonInfo, completeTaskParam)) {
|
|
1890
|
+
if (standardEventName === "returnToPreviousTask") {
|
|
1891
|
+
isVisible = isVisibleReturnToPreviousTask(buttonInfo);
|
|
1892
|
+
} else {
|
|
1893
|
+
isVisible = true;
|
|
1894
|
+
}
|
|
1895
|
+
}
|
|
1896
|
+
}
|
|
1897
|
+
return isVisible;
|
|
1898
|
+
}
|
|
1899
|
+
function isVisibleWorkflowSave(buttonInfo) {
|
|
1900
|
+
if (typeof buttonInfo["processState"] === "undefined" || buttonInfo["processState"] === null || buttonInfo["processState"] === "UNSUBMIT" && buttonInfo["active"] === "WAIT_TRANSACT") {
|
|
1901
|
+
if (typeof buttonInfo["processState"] === "undefined" || buttonInfo["showButtonSave"] === true) {
|
|
730
1902
|
return true;
|
|
731
|
-
}
|
|
732
|
-
|
|
733
|
-
|
|
734
|
-
if (
|
|
1903
|
+
}
|
|
1904
|
+
}
|
|
1905
|
+
if (buttonInfo["processState"] && buttonInfo["processState"] === "SUBMIT") {
|
|
1906
|
+
if (buttonInfo["processingMode"] !== "TYPE_READ" && buttonInfo["showButtonSave"] && (buttonInfo["active"] === "WAIT_TRANSACT" || buttonInfo["active"] === "WAIT_DESIGNATE_TRANSACTOR" || buttonInfo["active"] === "WAIT_CHOICE_TACHE" || buttonInfo["active"] === "DRAW_WAIT")) {
|
|
1907
|
+
return true;
|
|
1908
|
+
}
|
|
1909
|
+
}
|
|
1910
|
+
return false;
|
|
1911
|
+
}
|
|
1912
|
+
function isVisibleSubmitProcess(buttonInfo) {
|
|
1913
|
+
if (typeof buttonInfo["processState"] === "undefined" || buttonInfo["processState"] === null || buttonInfo["processState"] === "UNSUBMIT" && buttonInfo["active"] === "WAIT_TRANSACT") {
|
|
1914
|
+
if (typeof buttonInfo["processState"] === "undefined" || buttonInfo["showButtonSave"] === true) {
|
|
1915
|
+
return true;
|
|
1916
|
+
}
|
|
1917
|
+
}
|
|
1918
|
+
return false;
|
|
1919
|
+
}
|
|
1920
|
+
function isVisibleSubmitTask(buttonInfo) {
|
|
1921
|
+
if (buttonInfo["processState"] && buttonInfo["processState"] === "SUBMIT") {
|
|
1922
|
+
if (buttonInfo["active"] === "WAIT_TRANSACT" && buttonInfo["processingMode"] === "EDIT") {
|
|
1923
|
+
return true;
|
|
1924
|
+
}
|
|
1925
|
+
}
|
|
1926
|
+
return false;
|
|
1927
|
+
}
|
|
1928
|
+
function isVisibleDrawTask(buttonInfo) {
|
|
1929
|
+
if (buttonInfo["processState"] && buttonInfo["processState"] === "SUBMIT") {
|
|
1930
|
+
if (buttonInfo["active"] && (buttonInfo["active"] === "DRAW_WAIT" || buttonInfo["active"] === "DEPT_DRAW_WAIT") && buttonInfo["showButtonDraw"]) {
|
|
1931
|
+
return true;
|
|
1932
|
+
}
|
|
1933
|
+
}
|
|
1934
|
+
return false;
|
|
1935
|
+
}
|
|
1936
|
+
function isVisibleAbandonReceive(buttonInfo) {
|
|
1937
|
+
if (buttonInfo["processState"] && buttonInfo["processState"] === "SUBMIT") {
|
|
1938
|
+
if ((buttonInfo["drawTask"] && buttonInfo["active"] === "WAIT_TRANSACT" || buttonInfo["canAbandonDeptTask"] && buttonInfo["active"] === "WAIT_TRANSACT") && buttonInfo["showButtonAbandon"]) {
|
|
1939
|
+
return true;
|
|
1940
|
+
}
|
|
1941
|
+
}
|
|
1942
|
+
return false;
|
|
1943
|
+
}
|
|
1944
|
+
function isVisibleApproveOrRefuse(buttonInfo) {
|
|
1945
|
+
if (buttonInfo["processState"] && buttonInfo["processState"] === "SUBMIT") {
|
|
1946
|
+
if (buttonInfo["active"] === "WAIT_TRANSACT" && (buttonInfo["processingMode"] === "APPROVE" || buttonInfo["processingMode"] === "COUNTERSIGN")) {
|
|
1947
|
+
return true;
|
|
1948
|
+
}
|
|
1949
|
+
}
|
|
1950
|
+
return false;
|
|
1951
|
+
}
|
|
1952
|
+
function isVisibleAddSigner(buttonInfo) {
|
|
1953
|
+
if (buttonInfo["processState"] && buttonInfo["processState"] === "SUBMIT") {
|
|
1954
|
+
if (buttonInfo["active"] === "WAIT_TRANSACT" && (buttonInfo["processingMode"] === "APPROVE" || buttonInfo["processingMode"] === "COUNTERSIGN") && buttonInfo["processingMode"] === "COUNTERSIGN" && buttonInfo["showButtonAddCounter"]) {
|
|
1955
|
+
return true;
|
|
1956
|
+
}
|
|
1957
|
+
}
|
|
1958
|
+
return false;
|
|
1959
|
+
}
|
|
1960
|
+
function isVisibleRemoveSigner(buttonInfo) {
|
|
1961
|
+
if (buttonInfo["processState"] && buttonInfo["processState"] === "SUBMIT") {
|
|
1962
|
+
if (buttonInfo["active"] === "WAIT_TRANSACT" && (buttonInfo["processingMode"] === "APPROVE" || buttonInfo["processingMode"] === "COUNTERSIGN") && buttonInfo["processingMode"] === "COUNTERSIGN" && buttonInfo["showButtonDelCounter"]) {
|
|
1963
|
+
return true;
|
|
1964
|
+
}
|
|
1965
|
+
}
|
|
1966
|
+
return false;
|
|
1967
|
+
}
|
|
1968
|
+
function isVisibleAgreementOrOppose(buttonInfo) {
|
|
1969
|
+
if (buttonInfo["processState"] && buttonInfo["processState"] === "SUBMIT") {
|
|
1970
|
+
if (buttonInfo["active"] === "WAIT_TRANSACT" && buttonInfo["processingMode"] === "VOTE") {
|
|
1971
|
+
return true;
|
|
1972
|
+
}
|
|
1973
|
+
}
|
|
1974
|
+
return false;
|
|
1975
|
+
}
|
|
1976
|
+
function isVisibleKiken(buttonInfo) {
|
|
1977
|
+
if (buttonInfo["processState"] && buttonInfo["processState"] === "SUBMIT") {
|
|
1978
|
+
if (buttonInfo["active"] === "WAIT_TRANSACT" && buttonInfo["processingMode"] === "VOTE" && buttonInfo["showButtonKiken"]) {
|
|
1979
|
+
return true;
|
|
1980
|
+
}
|
|
1981
|
+
}
|
|
1982
|
+
return false;
|
|
1983
|
+
}
|
|
1984
|
+
function isVisibleCopyTask(buttonInfo) {
|
|
1985
|
+
if (buttonInfo["processState"] && buttonInfo["processState"] === "SUBMIT") {
|
|
1986
|
+
if (buttonInfo["active"] === "WAIT_TRANSACT" && buttonInfo["processingMode"] !== "TYPE_READ" && buttonInfo["showButtonCopy"]) {
|
|
1987
|
+
return true;
|
|
1988
|
+
}
|
|
1989
|
+
}
|
|
1990
|
+
return false;
|
|
1991
|
+
}
|
|
1992
|
+
function isVisibleAssignTask(buttonInfo) {
|
|
1993
|
+
if (buttonInfo["processState"] && buttonInfo["processState"] === "SUBMIT") {
|
|
1994
|
+
if (buttonInfo["processingMode"] !== "TYPE_READ" && (buttonInfo["active"] === "WAIT_TRANSACT" || buttonInfo["active"] === "DRAW_WAIT")) {
|
|
1995
|
+
return true;
|
|
1996
|
+
}
|
|
1997
|
+
}
|
|
1998
|
+
return false;
|
|
1999
|
+
}
|
|
2000
|
+
function isVisibleRetrieveTask(buttonInfo) {
|
|
2001
|
+
if (buttonInfo["processState"] && buttonInfo["processState"] === "SUBMIT") {
|
|
2002
|
+
if (showRetrieve(buttonInfo)) {
|
|
2003
|
+
return true;
|
|
2004
|
+
}
|
|
2005
|
+
}
|
|
2006
|
+
return false;
|
|
2007
|
+
}
|
|
2008
|
+
function showRetrieve(buttonInfo) {
|
|
2009
|
+
if (buttonInfo["active"] !== "COMPLETED") {
|
|
735
2010
|
return false;
|
|
736
|
-
}
|
|
737
|
-
|
|
2011
|
+
}
|
|
2012
|
+
if (buttonInfo["processingMode"] === "TYPE_READ") {
|
|
738
2013
|
return false;
|
|
739
|
-
}
|
|
740
|
-
|
|
741
|
-
const t4 = e4;
|
|
742
|
-
let s3 = true;
|
|
743
|
-
t4 && (s3 = t4.taskComplete);
|
|
744
|
-
return s3;
|
|
745
|
-
}(t3);
|
|
746
|
-
}(t2, s2) && (n2 = "returnToPreviousTask" !== e2 || function(e3) {
|
|
747
|
-
if (e3.rebuttable) return true;
|
|
2014
|
+
}
|
|
2015
|
+
if (!buttonInfo["showButtonGetBack"]) {
|
|
748
2016
|
return false;
|
|
749
|
-
}
|
|
2017
|
+
}
|
|
2018
|
+
return true;
|
|
2019
|
+
}
|
|
2020
|
+
function isVisibleReaded(buttonInfo) {
|
|
2021
|
+
if (buttonInfo["active"] === "WAIT_TRANSACT" && buttonInfo["processingMode"] === "TYPE_READ") {
|
|
2022
|
+
return true;
|
|
2023
|
+
}
|
|
2024
|
+
return false;
|
|
2025
|
+
}
|
|
2026
|
+
function isVisibleReturnToPreviousTask(buttonInfo) {
|
|
2027
|
+
if (buttonInfo["rebuttable"]) {
|
|
2028
|
+
return true;
|
|
2029
|
+
}
|
|
2030
|
+
return false;
|
|
2031
|
+
}
|
|
2032
|
+
function isShowOtherWorkflowBtn(buttonInfo, completeTaskParam) {
|
|
2033
|
+
return buttonInfo["processState"] && buttonInfo["processState"] === "SUBMIT" && buttonInfo["processingMode"] !== "TYPE_READ" && !isTaskComplete(completeTaskParam);
|
|
2034
|
+
}
|
|
2035
|
+
function isTaskComplete(completeTaskParam) {
|
|
2036
|
+
const taskParam = completeTaskParam;
|
|
2037
|
+
let taskComplete = true;
|
|
2038
|
+
if (taskParam) {
|
|
2039
|
+
taskComplete = taskParam.taskComplete;
|
|
2040
|
+
}
|
|
2041
|
+
return taskComplete;
|
|
2042
|
+
}
|
|
2043
|
+
function cacheFormDataId(dataId, pageContext) {
|
|
2044
|
+
const additionalParamMap = getAdditionalParamMap(pageContext);
|
|
2045
|
+
if (dataId && additionalParamMap) {
|
|
2046
|
+
setSessionCache(additionalParamMap._t_ + "_id", dataId);
|
|
2047
|
+
}
|
|
2048
|
+
}
|
|
2049
|
+
function refreshPage(pageContext, id) {
|
|
2050
|
+
if (!pageContext.entity.page) {
|
|
2051
|
+
pageContext.entity.page = {};
|
|
2052
|
+
}
|
|
2053
|
+
pageContext.entity.page["_isRefresh"] = true;
|
|
2054
|
+
getFormData(pageContext, id).then((commonEntity) => {
|
|
2055
|
+
pageContext.isRefresh = true;
|
|
2056
|
+
});
|
|
750
2057
|
}
|
|
751
|
-
function
|
|
752
|
-
|
|
753
|
-
|
|
2058
|
+
function getFormData(pageContext, id, isNeedId) {
|
|
2059
|
+
const pageType = pageContext.pageType;
|
|
2060
|
+
if (pageType && pageType === "form") {
|
|
2061
|
+
console.log("获取表单数据getData--pageContext=", pageContext);
|
|
2062
|
+
pageContext.canClick = false;
|
|
2063
|
+
const isWorkflow = isWorkflowPage(pageContext);
|
|
2064
|
+
if (isWorkflow) {
|
|
2065
|
+
return getWorkflowFormData(pageContext, id, isNeedId);
|
|
2066
|
+
} else {
|
|
2067
|
+
return getCommonFormData(pageContext, id, isNeedId);
|
|
2068
|
+
}
|
|
2069
|
+
} else {
|
|
2070
|
+
return new Promise((resolve, reject) => {
|
|
2071
|
+
resolve(true);
|
|
2072
|
+
});
|
|
2073
|
+
}
|
|
2074
|
+
}
|
|
2075
|
+
function getCommonFormData(pageContext, id, isNeedId) {
|
|
2076
|
+
return new Promise((resolve, reject) => {
|
|
2077
|
+
const systemCode = pageContext.systemCode;
|
|
2078
|
+
const pageCode = pageContext.code;
|
|
2079
|
+
const pageVersion = pageContext.version;
|
|
2080
|
+
const additionalParamMap = getAdditionalParamMap(pageContext);
|
|
2081
|
+
let dataId = id ? id : null;
|
|
2082
|
+
let ids2 = id ? [id] : null;
|
|
2083
|
+
if (isNeedId === void 0 || isNeedId) {
|
|
2084
|
+
if (!dataId) {
|
|
2085
|
+
dataId = additionalParamMap && additionalParamMap.id ? additionalParamMap.id : null;
|
|
2086
|
+
}
|
|
2087
|
+
if (!ids2) {
|
|
2088
|
+
ids2 = additionalParamMap ? additionalParamMap.ids : null;
|
|
2089
|
+
}
|
|
2090
|
+
} else {
|
|
2091
|
+
dataId = null;
|
|
2092
|
+
ids2 = null;
|
|
2093
|
+
additionalParamMap._id = additionalParamMap.id;
|
|
2094
|
+
additionalParamMap.id = null;
|
|
2095
|
+
}
|
|
2096
|
+
const taskId = additionalParamMap ? additionalParamMap.taskId : null;
|
|
2097
|
+
const permissionPrefix = pageCode;
|
|
2098
|
+
console.log("getCommonFormData-----pageContext=", pageContext);
|
|
2099
|
+
const backendUrl = getBaseUrl(pageContext.backendUrl, pageContext.isTest);
|
|
2100
|
+
const param = {
|
|
2101
|
+
pageCode,
|
|
2102
|
+
pageVersion,
|
|
2103
|
+
tableName: pageContext.tableName,
|
|
2104
|
+
formNoRuleCode: pageContext.formNoRuleCode,
|
|
2105
|
+
id: dataId,
|
|
2106
|
+
systemCode,
|
|
2107
|
+
functionCode: permissionPrefix + ".gets",
|
|
2108
|
+
listCodesMap: pageContext.listCodesMap
|
|
2109
|
+
};
|
|
2110
|
+
if (!param.id && additionalParamMap && additionalParamMap._t_ && getSessionCache(additionalParamMap._t_ + "_id")) {
|
|
2111
|
+
param.id = getSessionCache(additionalParamMap._t_ + "_id");
|
|
2112
|
+
}
|
|
2113
|
+
if (ids2) {
|
|
2114
|
+
param["ids"] = formatAdditionalParamMapIds(ids2);
|
|
2115
|
+
}
|
|
2116
|
+
if (pageContext.notIdInitializationList) {
|
|
2117
|
+
param["noIdAndTaskIdInitSetting"] = JSON.stringify(pageContext.notIdInitializationList);
|
|
2118
|
+
}
|
|
2119
|
+
if (additionalParamMap) {
|
|
2120
|
+
param["additionalParamMap"] = additionalParamMap;
|
|
2121
|
+
}
|
|
2122
|
+
if (pageContext.beanName) {
|
|
2123
|
+
param["beanName"] = pageContext.beanName;
|
|
2124
|
+
}
|
|
2125
|
+
if (taskId) {
|
|
2126
|
+
param["taskId"] = taskId;
|
|
2127
|
+
}
|
|
2128
|
+
console.log("getCommonFormData---listCodesMap=", pageContext.listCodesMap);
|
|
2129
|
+
if ((!pageContext.listCodesMap || Object.keys(pageContext.listCodesMap).length === 0) && pageContext.tableUuids) {
|
|
2130
|
+
const listCodesMap = {};
|
|
2131
|
+
pageContext.tableUuids.forEach((tableUuid) => {
|
|
2132
|
+
const listCode = getListCode(pageCode, pageVersion, tableUuid);
|
|
2133
|
+
listCodesMap[listCode] = listCode;
|
|
2134
|
+
});
|
|
2135
|
+
param["listCodesMap"] = listCodesMap;
|
|
2136
|
+
}
|
|
2137
|
+
if (pageContext.refercePropMap) {
|
|
2138
|
+
param["refercePropMap"] = pageContext.refercePropMap;
|
|
2139
|
+
}
|
|
2140
|
+
const urlForView = backendUrl + "/dsc/commons/gets";
|
|
2141
|
+
const pageContextUtil = usePageContextStore();
|
|
2142
|
+
pageContextUtil.restorePageLoadState();
|
|
2143
|
+
handleEvent(null, pageContext, pageContext, "beforeFormLoadData");
|
|
2144
|
+
http.post(urlForView, param).then((commonEntity) => {
|
|
2145
|
+
if (commonEntity) {
|
|
2146
|
+
pageContext.entity.data = commonEntity.entity;
|
|
2147
|
+
pageContext.initFormNo = commonEntity.formNo;
|
|
2148
|
+
}
|
|
2149
|
+
const customRules = pageContext.customRules;
|
|
2150
|
+
const formRules = pageContext.rules;
|
|
2151
|
+
const newFormRules = packageCustomRules(customRules, formRules);
|
|
2152
|
+
pageContext.rules = newFormRules;
|
|
2153
|
+
pageContext.canClick = true;
|
|
2154
|
+
handleEvent(null, pageContext, pageContext, "afterFormLoadData");
|
|
2155
|
+
pageContextUtil.setFormPageDataLoadState(true);
|
|
2156
|
+
resolve(commonEntity);
|
|
2157
|
+
}).catch((error) => {
|
|
2158
|
+
pageContext.canClick = true;
|
|
2159
|
+
reject(error);
|
|
2160
|
+
});
|
|
754
2161
|
});
|
|
755
2162
|
}
|
|
756
|
-
function
|
|
757
|
-
|
|
758
|
-
|
|
759
|
-
|
|
760
|
-
|
|
761
|
-
|
|
762
|
-
|
|
763
|
-
|
|
764
|
-
|
|
765
|
-
|
|
766
|
-
|
|
767
|
-
|
|
768
|
-
|
|
769
|
-
|
|
770
|
-
|
|
771
|
-
|
|
772
|
-
|
|
773
|
-
|
|
774
|
-
|
|
775
|
-
|
|
776
|
-
|
|
777
|
-
|
|
778
|
-
|
|
779
|
-
|
|
780
|
-
|
|
781
|
-
|
|
782
|
-
|
|
783
|
-
|
|
784
|
-
|
|
785
|
-
|
|
786
|
-
|
|
787
|
-
|
|
788
|
-
|
|
2163
|
+
function getWorkflowFormData(pageContext, id, isNeedId) {
|
|
2164
|
+
return new Promise((resolve, reject) => {
|
|
2165
|
+
const systemCode = pageContext.systemCode;
|
|
2166
|
+
const pageCode = pageContext.code;
|
|
2167
|
+
const pageVersion = pageContext.version;
|
|
2168
|
+
const additionalParamMap = getAdditionalParamMap(pageContext);
|
|
2169
|
+
let dataId = id ? id : null;
|
|
2170
|
+
let ids2 = id ? [id] : null;
|
|
2171
|
+
if (isNeedId === void 0 || isNeedId) {
|
|
2172
|
+
if (!dataId) {
|
|
2173
|
+
dataId = additionalParamMap && additionalParamMap.id ? additionalParamMap.id : null;
|
|
2174
|
+
}
|
|
2175
|
+
if (!ids2) {
|
|
2176
|
+
ids2 = additionalParamMap ? additionalParamMap.ids : null;
|
|
2177
|
+
}
|
|
2178
|
+
} else {
|
|
2179
|
+
dataId = null;
|
|
2180
|
+
ids2 = null;
|
|
2181
|
+
additionalParamMap._id = additionalParamMap.id;
|
|
2182
|
+
additionalParamMap.id = null;
|
|
2183
|
+
}
|
|
2184
|
+
const taskId = additionalParamMap ? additionalParamMap.taskId : null;
|
|
2185
|
+
const permissionPrefix = pageCode;
|
|
2186
|
+
const param = {
|
|
2187
|
+
pageCode,
|
|
2188
|
+
pageVersion,
|
|
2189
|
+
tableName: pageContext.tableName,
|
|
2190
|
+
formNoRuleCode: pageContext.formNoRuleCode,
|
|
2191
|
+
isWorkflowEntity: true,
|
|
2192
|
+
systemCode,
|
|
2193
|
+
functionCode: permissionPrefix + ".workflowGets",
|
|
2194
|
+
listCodesMap: pageContext.listCodesMap
|
|
2195
|
+
};
|
|
2196
|
+
console.log("getWorkflowFormData---listCodesMap=", pageContext.listCodesMap);
|
|
2197
|
+
if ((!pageContext.listCodesMap || Object.keys(pageContext.listCodesMap).length === 0) && pageContext.tableUuids) {
|
|
2198
|
+
const listCodesMap = {};
|
|
2199
|
+
pageContext.tableUuids.forEach((tableUuid) => {
|
|
2200
|
+
const listCode = getListCode(pageCode, pageVersion, tableUuid);
|
|
2201
|
+
listCodesMap[listCode] = listCode;
|
|
2202
|
+
});
|
|
2203
|
+
param["listCodesMap"] = listCodesMap;
|
|
2204
|
+
}
|
|
2205
|
+
if (ids2) {
|
|
2206
|
+
param["ids"] = formatAdditionalParamMapIds(ids2);
|
|
2207
|
+
}
|
|
2208
|
+
if (taskId) {
|
|
2209
|
+
param["taskId"] = taskId;
|
|
2210
|
+
} else if (dataId) {
|
|
2211
|
+
param["id"] = dataId;
|
|
2212
|
+
} else {
|
|
2213
|
+
if (additionalParamMap && additionalParamMap._t_ && getSessionCache(additionalParamMap._t_ + "_id")) {
|
|
2214
|
+
param["id"] = getSessionCache(additionalParamMap._t_ + "_id");
|
|
2215
|
+
}
|
|
2216
|
+
if (pageContext.notIdInitializationList) {
|
|
2217
|
+
param["noIdAndTaskIdInitSetting"] = JSON.stringify(pageContext.notIdInitializationList);
|
|
2218
|
+
}
|
|
2219
|
+
}
|
|
2220
|
+
if (additionalParamMap) {
|
|
2221
|
+
param["additionalParamMap"] = additionalParamMap;
|
|
2222
|
+
}
|
|
2223
|
+
if (pageContext.beanName) {
|
|
2224
|
+
param["beanName"] = pageContext.beanName;
|
|
2225
|
+
}
|
|
2226
|
+
if (pageContext.refercePropMap) {
|
|
2227
|
+
param["refercePropMap"] = pageContext.refercePropMap;
|
|
2228
|
+
}
|
|
2229
|
+
const baseUrl = getBaseUrl(pageContext.backendUrl, pageContext.isTest);
|
|
2230
|
+
const urlForView = baseUrl + "/dsc/workflow-commons/gets";
|
|
2231
|
+
const pageContextUtil = usePageContextStore();
|
|
2232
|
+
pageContextUtil.restorePageLoadState();
|
|
2233
|
+
handleEvent(null, pageContext, pageContext, "beforeFormLoadData");
|
|
2234
|
+
http.post(urlForView, param).then((commonEntity) => {
|
|
2235
|
+
pageContext.definitionId = commonEntity.definitionId;
|
|
2236
|
+
pageContext.entity.task = commonEntity.taskParamMap;
|
|
2237
|
+
dealCompleteTaskParam(commonEntity, true, pageContext);
|
|
2238
|
+
pageContext.workflowRules = getWorkflowRules(pageContext);
|
|
2239
|
+
const pageType = pageContext.pageType;
|
|
2240
|
+
if (pageType && pageType === "form") {
|
|
2241
|
+
changePermissionListToMap(pageContext);
|
|
2242
|
+
}
|
|
2243
|
+
pageContext.canClick = true;
|
|
2244
|
+
handleEvent(null, pageContext, pageContext, "afterFormLoadData");
|
|
2245
|
+
pageContextUtil.setFormPageDataLoadState(true);
|
|
2246
|
+
resolve(commonEntity);
|
|
2247
|
+
}).catch((error) => {
|
|
2248
|
+
pageContext.canClick = true;
|
|
2249
|
+
reject(error);
|
|
2250
|
+
});
|
|
2251
|
+
});
|
|
2252
|
+
}
|
|
2253
|
+
function formatAdditionalParamMapIds(ids2) {
|
|
2254
|
+
if (ids2) {
|
|
2255
|
+
if (typeof ids2 === "string") {
|
|
2256
|
+
ids2 = ids2.split(",");
|
|
2257
|
+
} else if (typeof ids2 === "number") {
|
|
2258
|
+
ids2 = [ids2];
|
|
2259
|
+
} else ;
|
|
2260
|
+
}
|
|
2261
|
+
return ids2;
|
|
2262
|
+
}
|
|
2263
|
+
function changePermissionListToMap(pageContext) {
|
|
2264
|
+
changeFieldPermissionToMap(pageContext);
|
|
2265
|
+
changeActionPermissionToMap(pageContext);
|
|
2266
|
+
}
|
|
2267
|
+
function changeFieldPermissionToMap(pageContext) {
|
|
2268
|
+
const fieldPermissionMap = /* @__PURE__ */ new Map();
|
|
2269
|
+
const fieldPermissions = pageContext.fieldPermissions;
|
|
2270
|
+
if (typeof fieldPermissions !== "undefined") {
|
|
2271
|
+
for (let i = 0; i < fieldPermissions.length; i++) {
|
|
2272
|
+
const prop = fieldPermissions[i].name;
|
|
2273
|
+
if (prop) {
|
|
2274
|
+
if (prop.indexOf("$") === 0 && prop.indexOf(".") > 0) {
|
|
2275
|
+
const fieldPermissionOrg = fieldPermissions[i];
|
|
2276
|
+
const fieldPermission = JSON.parse(JSON.stringify(fieldPermissionOrg));
|
|
2277
|
+
const subModelName = prop.substring(1, prop.indexOf("."));
|
|
2278
|
+
const subProp = prop.substring(prop.indexOf(".") + 1);
|
|
2279
|
+
fieldPermission.name = subProp;
|
|
2280
|
+
if (fieldPermission && fieldPermission.name === "all_fields") {
|
|
2281
|
+
if (fieldPermission.canEdit === false) {
|
|
2282
|
+
if (fieldPermission.rowIndexes) {
|
|
2283
|
+
fieldPermissionMap.set(subModelName, [
|
|
2284
|
+
{
|
|
2285
|
+
name: "all_fields",
|
|
2286
|
+
canEdit: false,
|
|
2287
|
+
rowIndexes: fieldPermission.rowIndexes
|
|
789
2288
|
}
|
|
790
|
-
|
|
2289
|
+
]);
|
|
2290
|
+
} else {
|
|
2291
|
+
fieldPermissionMap.set(subModelName, [{ name: "all_fields", canEdit: false }]);
|
|
791
2292
|
}
|
|
792
|
-
|
|
793
|
-
|
|
794
|
-
|
|
795
|
-
|
|
796
|
-
|
|
797
|
-
|
|
798
|
-
|
|
799
|
-
else {
|
|
800
|
-
const s6 = o4.canUpdate, n3 = o4.updateRowIndexes;
|
|
801
|
-
void 0 !== s6 && false === s6 && null != n3 && n3.length > 0 && t4.set(e6, [{ name: "all_fields", canEdit: false, rowIndexes: n3 }]);
|
|
2293
|
+
} else {
|
|
2294
|
+
if (fieldPermission.rowIndexes) {
|
|
2295
|
+
fieldPermissionMap.set(subModelName, [
|
|
2296
|
+
{
|
|
2297
|
+
name: "all_fields",
|
|
2298
|
+
canEdit: true,
|
|
2299
|
+
rowIndexes: fieldPermission.rowIndexes
|
|
802
2300
|
}
|
|
803
|
-
|
|
804
|
-
|
|
2301
|
+
]);
|
|
2302
|
+
} else {
|
|
2303
|
+
fieldPermissionMap.set(subModelName, [{ name: "all_fields", canEdit: true }]);
|
|
805
2304
|
}
|
|
806
|
-
|
|
807
|
-
|
|
808
|
-
|
|
809
|
-
|
|
810
|
-
|
|
811
|
-
|
|
812
|
-
|
|
813
|
-
|
|
814
|
-
|
|
815
|
-
|
|
816
|
-
|
|
817
|
-
|
|
818
|
-
|
|
819
|
-
if (!y2.id && p2 && p2._t_ && m(p2._t_ + "_id") && (y2.id = m(p2._t_ + "_id")), f2 && (y2.ids = de(f2)), e3.notIdInitializationList && (y2.noIdAndTaskIdInitSetting = JSON.stringify(e3.notIdInitializationList)), p2 && (y2.additionalParamMap = p2), e3.beanName && (y2.beanName = e3.beanName), g2 && (y2.taskId = g2), (!e3.listCodesMap || 0 === Object.keys(e3.listCodesMap).length) && e3.tableUuids) {
|
|
820
|
-
const t3 = {};
|
|
821
|
-
e3.tableUuids.forEach((e4) => {
|
|
822
|
-
const s4 = r(u2, l2, e4);
|
|
823
|
-
t3[s4] = s4;
|
|
824
|
-
}), y2.listCodesMap = t3;
|
|
2305
|
+
}
|
|
2306
|
+
} else {
|
|
2307
|
+
let subTableFieldPermission = fieldPermissionMap.get(subModelName);
|
|
2308
|
+
if (subTableFieldPermission) {
|
|
2309
|
+
subTableFieldPermission.push(fieldPermission);
|
|
2310
|
+
} else {
|
|
2311
|
+
subTableFieldPermission = [];
|
|
2312
|
+
subTableFieldPermission.push(fieldPermission);
|
|
2313
|
+
}
|
|
2314
|
+
fieldPermissionMap.set(subModelName, subTableFieldPermission);
|
|
2315
|
+
}
|
|
2316
|
+
} else {
|
|
2317
|
+
fieldPermissionMap.set(prop, fieldPermissions[i]);
|
|
825
2318
|
}
|
|
826
|
-
|
|
827
|
-
|
|
828
|
-
P2.restorePageLoadState(), T(null, e3, e3, "beforeFormLoadData"), c.post(h2, y2).then((t3) => {
|
|
829
|
-
t3 && (e3.entity.data = t3.entity, e3.initFormNo = t3.formNo);
|
|
830
|
-
const s4 = e3.customRules, n2 = e3.rules, i4 = U(s4, n2);
|
|
831
|
-
e3.rules = i4, e3.canClick = true, T(null, e3, e3, "afterFormLoadData"), P2.setFormPageDataLoadState(true), o3(t3);
|
|
832
|
-
}).catch((t3) => {
|
|
833
|
-
e3.canClick = true, i3(t3);
|
|
834
|
-
});
|
|
835
|
-
});
|
|
836
|
-
}(e2, s2, o2);
|
|
2319
|
+
}
|
|
2320
|
+
}
|
|
837
2321
|
}
|
|
838
|
-
|
|
839
|
-
e3(true);
|
|
840
|
-
});
|
|
2322
|
+
pageContext.fieldPermissionMap = fieldPermissionMap;
|
|
841
2323
|
}
|
|
842
|
-
function
|
|
843
|
-
|
|
2324
|
+
function changeActionPermissionToMap(pageContext) {
|
|
2325
|
+
const fieldPermissionMap = pageContext.fieldPermissionMap;
|
|
2326
|
+
const actionPermissionMap = /* @__PURE__ */ new Map();
|
|
2327
|
+
const actionPermissions = pageContext.actionPermissions;
|
|
2328
|
+
if (typeof actionPermissions !== "undefined" && actionPermissions !== null) {
|
|
2329
|
+
const subModelNames = Object.keys(actionPermissions);
|
|
2330
|
+
subModelNames.forEach((subModelName) => {
|
|
2331
|
+
const oneTableActionPermission = actionPermissions[subModelName];
|
|
2332
|
+
const subTableFieldPermission = fieldPermissionMap.get(subModelName);
|
|
2333
|
+
if (subTableFieldPermission && subTableFieldPermission.length > 0 && subTableFieldPermission[0].name === "all_fields" && subTableFieldPermission[0].canEdit === false) {
|
|
2334
|
+
oneTableActionPermission.canUpdate = false;
|
|
2335
|
+
oneTableActionPermission.canAdd = false;
|
|
2336
|
+
} else {
|
|
2337
|
+
const canUpdate = oneTableActionPermission.canUpdate;
|
|
2338
|
+
const updateRowIndexes = oneTableActionPermission.updateRowIndexes;
|
|
2339
|
+
if (canUpdate !== void 0 && canUpdate === false && updateRowIndexes !== void 0 && updateRowIndexes !== null && updateRowIndexes.length > 0) {
|
|
2340
|
+
fieldPermissionMap.set(subModelName, [
|
|
2341
|
+
{
|
|
2342
|
+
name: "all_fields",
|
|
2343
|
+
canEdit: false,
|
|
2344
|
+
rowIndexes: updateRowIndexes
|
|
2345
|
+
}
|
|
2346
|
+
]);
|
|
2347
|
+
}
|
|
2348
|
+
}
|
|
2349
|
+
actionPermissionMap.set(subModelName, oneTableActionPermission);
|
|
2350
|
+
});
|
|
2351
|
+
}
|
|
2352
|
+
pageContext.actionPermissionMap = actionPermissionMap;
|
|
844
2353
|
}
|
|
845
|
-
function
|
|
846
|
-
const
|
|
847
|
-
if (
|
|
848
|
-
if (
|
|
849
|
-
|
|
2354
|
+
function getButtonAutoSetValueData(configureObj) {
|
|
2355
|
+
const autoSetValueData = configureObj.props.setValueList;
|
|
2356
|
+
if (autoSetValueData) {
|
|
2357
|
+
if (isArrayFn(autoSetValueData) && autoSetValueData.length > 0) {
|
|
2358
|
+
return JSON.stringify(autoSetValueData);
|
|
2359
|
+
} else if (typeof autoSetValueData === "string" && autoSetValueData !== "[]") {
|
|
2360
|
+
return autoSetValueData;
|
|
2361
|
+
}
|
|
850
2362
|
}
|
|
851
2363
|
return null;
|
|
852
2364
|
}
|
|
853
2365
|
export {
|
|
854
|
-
|
|
855
|
-
|
|
856
|
-
|
|
857
|
-
|
|
858
|
-
|
|
859
|
-
|
|
860
|
-
|
|
861
|
-
|
|
862
|
-
|
|
863
|
-
|
|
864
|
-
|
|
865
|
-
|
|
866
|
-
|
|
867
|
-
|
|
868
|
-
|
|
869
|
-
|
|
870
|
-
|
|
871
|
-
|
|
872
|
-
|
|
873
|
-
|
|
874
|
-
|
|
2366
|
+
dealAfterOperate,
|
|
2367
|
+
dealCompleteTaskParam,
|
|
2368
|
+
doAddSigner,
|
|
2369
|
+
doAssign,
|
|
2370
|
+
doCreateCopyTask,
|
|
2371
|
+
doImportFinally,
|
|
2372
|
+
doRemoveSigners,
|
|
2373
|
+
doReturnTaskTo,
|
|
2374
|
+
exportFormReport,
|
|
2375
|
+
getAdditionalParamMap,
|
|
2376
|
+
getFormData,
|
|
2377
|
+
getRemoveSigner,
|
|
2378
|
+
getSaveFormRequest,
|
|
2379
|
+
getSaveFormRequestWithRow,
|
|
2380
|
+
getTaskInformitions,
|
|
2381
|
+
isVisibleWorkflowButton,
|
|
2382
|
+
judgeDataNumber,
|
|
2383
|
+
refreshFormOrListPage,
|
|
2384
|
+
refreshPage,
|
|
2385
|
+
standardEvents,
|
|
2386
|
+
updateValuesWhenCloseDialog
|
|
875
2387
|
};
|