super-page-runtime 2.1.933 → 2.2.0

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