super-page-runtime 2.0.19 → 2.0.25
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/es/components/runtime/utils/api/api-util.js +18 -16
- package/dist/es/components/runtime/utils/api/page-expose-util.d.ts +1 -0
- package/dist/es/components/runtime/utils/api/page-expose-util.js +206 -0
- package/dist/es/components/runtime/utils/assemblys-config.js +16 -7
- package/dist/es/components/runtime/utils/common-util.d.ts +2 -2
- package/dist/es/components/runtime/utils/common-util.js +8 -12
- package/dist/es/components/runtime/utils/events/event-util.d.ts +14 -0
- package/dist/es/components/runtime/utils/events/event-util.js +101 -32
- package/dist/es/components/runtime/utils/events/standard-event.d.ts +2 -0
- package/dist/es/components/runtime/utils/events/standard-event.js +189 -133
- package/dist/es/components/runtime/utils/events/validator-util.js +4 -3
- package/dist/es/components/runtime/utils/form/scan-util.js +191 -0
- package/dist/es/components/runtime/utils/global-refs.js +12 -0
- package/dist/es/components/runtime/utils/interfaces/page-design-types.d.ts +2 -0
- package/dist/es/components/runtime/utils/page-helper-util.js +20 -4
- package/dist/es/components/runtime/utils/page-init-util.js +9 -15
- package/dist/es/components/runtime/utils/table-utils.js +4 -5
- package/dist/es/components/runtime/views/assemblys/button/button/button-runtime.vue2.js +17 -17
- package/dist/es/components/runtime/views/assemblys/button/dropdown/dropdown-runtime.vue2.js +17 -17
- package/dist/es/components/runtime/views/assemblys/common/remove-signer-dialog.vue.d.ts +1 -1
- package/dist/es/components/runtime/views/assemblys/common/task-informition-dialog.vue.d.ts +1 -1
- package/dist/es/components/runtime/views/assemblys/container/flex/flex-runtime.vue2.js +5 -5
- package/dist/es/components/runtime/views/assemblys/data/bar-code/barcode-runtime.vue.js +4 -0
- package/dist/es/components/runtime/views/assemblys/data/bar-code/barcode-runtime.vue2.js +207 -0
- package/dist/es/components/runtime/views/assemblys/data/table/main-table-runtime.vue.js +99 -68
- package/dist/es/components/runtime/views/assemblys/data/table/sub-table-runtime.vue.js +3 -2
- package/dist/es/components/runtime/views/assemblys/form/checkbox/checkbox-runtime.vue2.js +11 -11
- package/dist/es/components/runtime/views/assemblys/form/date-picker/datepicker-runtime.vue2.js +28 -28
- package/dist/es/components/runtime/views/assemblys/form/dept-tree/depttree-runtime.vue2.js +12 -12
- package/dist/es/components/runtime/views/assemblys/form/divider/divider-runtime.vue2.js +7 -5
- package/dist/es/components/runtime/views/assemblys/form/file-upload/fileupload-runtime.vue2.js +14 -14
- package/dist/es/components/runtime/views/assemblys/form/input-number/input-number-runtime.vue2.js +15 -15
- package/dist/es/components/runtime/views/assemblys/form/input-text/inputtext-runtime.vue2.js +24 -1
- package/dist/es/components/runtime/views/assemblys/form/label/label-runtime.vue2.js +40 -37
- package/dist/es/components/runtime/views/assemblys/form/link/link-runtime.vue2.js +10 -10
- package/dist/es/components/runtime/views/assemblys/form/radio/radio-runtime.vue2.js +13 -13
- package/dist/es/components/runtime/views/assemblys/form/rich-text/richtext-runtime.vue2.js +96 -26
- package/dist/es/components/runtime/views/assemblys/form/select/select-runtime.vue2.js +8 -8
- package/dist/es/components/runtime/views/assemblys/form/switch/switch-runtime.vue2.js +13 -13
- package/dist/es/components/runtime/views/assemblys/form/tag/tag-runtime.vue2.js +10 -10
- package/dist/es/components/runtime/views/assemblys/form/textarea/textarea-runtime.vue2.js +14 -14
- package/dist/es/components/runtime/views/assemblys/object-render.vue.js +5 -2
- package/dist/es/components/runtime/views/assemblys/workflow/workflow-button/workflowbutton-runtime.vue2.js +5 -7
- package/dist/es/components/runtime/views/super-page.vue.js +18 -7
- package/package.json +3 -2
- package/dist/lib/_virtual/AttributeMap.js +0 -4
- package/dist/lib/_virtual/Delta.js +0 -4
- package/dist/lib/_virtual/Op.js +0 -4
- package/dist/lib/_virtual/OpIterator.js +0 -4
- package/dist/lib/_virtual/__vite-browser-external.js +0 -3
- package/dist/lib/_virtual/_commonjsHelpers.js +0 -8
- package/dist/lib/_virtual/_plugin-vue_export-helper.js +0 -9
- package/dist/lib/_virtual/dayjs.min.js +0 -4
- package/dist/lib/_virtual/index.js +0 -4
- package/dist/lib/_virtual/index2.js +0 -4
- package/dist/lib/_virtual/index3.js +0 -4
- package/dist/lib/assets/chart-themes/theme1.d.ts +0 -4
- package/dist/lib/assets/chart-themes/theme1.js +0 -7
- package/dist/lib/assets/chart-themes/theme2.d.ts +0 -4
- package/dist/lib/assets/chart-themes/theme2.js +0 -7
- package/dist/lib/assets/chart-themes/theme3.d.ts +0 -4
- package/dist/lib/assets/chart-themes/theme3.js +0 -7
- package/dist/lib/components/runtime/index.d.ts +0 -4
- package/dist/lib/components/runtime/utils/api/api-util.d.ts +0 -11
- package/dist/lib/components/runtime/utils/api/api-util.js +0 -128
- package/dist/lib/components/runtime/utils/assemblys-config.js +0 -258
- package/dist/lib/components/runtime/utils/charts/chart-util.d.ts +0 -11
- package/dist/lib/components/runtime/utils/charts/chart-util.js +0 -28
- package/dist/lib/components/runtime/utils/common-util.d.ts +0 -16
- package/dist/lib/components/runtime/utils/common-util.js +0 -94
- package/dist/lib/components/runtime/utils/eventBus.d.ts +0 -7
- package/dist/lib/components/runtime/utils/eventBus.js +0 -10
- package/dist/lib/components/runtime/utils/events/event-util.d.ts +0 -48
- package/dist/lib/components/runtime/utils/events/event-util.js +0 -526
- package/dist/lib/components/runtime/utils/events/standard-event.d.ts +0 -61
- package/dist/lib/components/runtime/utils/events/standard-event.js +0 -1625
- package/dist/lib/components/runtime/utils/events/validator-util.d.ts +0 -4
- package/dist/lib/components/runtime/utils/events/validator-util.js +0 -389
- package/dist/lib/components/runtime/utils/global-refs.d.ts +0 -59
- package/dist/lib/components/runtime/utils/global-refs.js +0 -65
- package/dist/lib/components/runtime/utils/interfaces/page-design-types.d.ts +0 -223
- package/dist/lib/components/runtime/utils/interfaces/page-design-types.js +0 -9
- package/dist/lib/components/runtime/utils/page-helper-util.d.ts +0 -106
- package/dist/lib/components/runtime/utils/page-helper-util.js +0 -622
- package/dist/lib/components/runtime/utils/page-init-util.d.ts +0 -38
- package/dist/lib/components/runtime/utils/page-init-util.js +0 -200
- package/dist/lib/components/runtime/utils/page-permission-util.d.ts +0 -26
- package/dist/lib/components/runtime/utils/page-permission-util.js +0 -525
- package/dist/lib/components/runtime/utils/store-util.d.ts +0 -15
- package/dist/lib/components/runtime/utils/store-util.js +0 -17
- package/dist/lib/components/runtime/utils/store.d.ts +0 -2
- package/dist/lib/components/runtime/utils/store.js +0 -3
- package/dist/lib/components/runtime/utils/table-utils.js +0 -24
- package/dist/lib/components/runtime/views/assemblys/button/button/button-runtime.vue.js +0 -3
- package/dist/lib/components/runtime/views/assemblys/button/button/button-runtime.vue2.js +0 -54
- package/dist/lib/components/runtime/views/assemblys/button/button-group/buttongroup-runtime.vue.js +0 -3
- package/dist/lib/components/runtime/views/assemblys/button/button-group/buttongroup-runtime.vue2.js +0 -35
- package/dist/lib/components/runtime/views/assemblys/button/dropdown/dropdown-runtime.vue.js +0 -3
- package/dist/lib/components/runtime/views/assemblys/button/dropdown/dropdown-runtime.vue2.js +0 -110
- package/dist/lib/components/runtime/views/assemblys/chart/column-line/column-line-runtime.vue.js +0 -3
- package/dist/lib/components/runtime/views/assemblys/chart/column-line/column-line-runtime.vue2.js +0 -432
- package/dist/lib/components/runtime/views/assemblys/chart/common/common-chart-header-breadcrumb.vue.js +0 -43
- package/dist/lib/components/runtime/views/assemblys/chart/common/common-chart-header-breadcrumb.vue2.js +0 -3
- package/dist/lib/components/runtime/views/assemblys/chart/common/common-chart-header-group.vue.js +0 -61
- package/dist/lib/components/runtime/views/assemblys/chart/common/common-chart-header-group.vue2.js +0 -3
- package/dist/lib/components/runtime/views/assemblys/chart/common/common-chart-header.vue.js +0 -126
- package/dist/lib/components/runtime/views/assemblys/chart/common/common-chart-header.vue2.js +0 -3
- package/dist/lib/components/runtime/views/assemblys/chart/gauge/gauge-runtime.vue.js +0 -3
- package/dist/lib/components/runtime/views/assemblys/chart/gauge/gauge-runtime.vue2.js +0 -52
- package/dist/lib/components/runtime/views/assemblys/chart/pie/pie-runtime.vue.js +0 -3
- package/dist/lib/components/runtime/views/assemblys/chart/pie/pie-runtime.vue2.js +0 -54
- package/dist/lib/components/runtime/views/assemblys/chart/radar/radar-runtime.vue.js +0 -3
- package/dist/lib/components/runtime/views/assemblys/chart/radar/radar-runtime.vue2.js +0 -54
- package/dist/lib/components/runtime/views/assemblys/chart/scatter/scatter-runtime.vue.js +0 -3
- package/dist/lib/components/runtime/views/assemblys/chart/scatter/scatter-runtime.vue2.js +0 -56
- package/dist/lib/components/runtime/views/assemblys/common/export-form-report-dialog.vue.d.ts +0 -24
- package/dist/lib/components/runtime/views/assemblys/common/export-form-report-dialog.vue.js +0 -147
- package/dist/lib/components/runtime/views/assemblys/common/export-form-report-dialog.vue2.js +0 -3
- package/dist/lib/components/runtime/views/assemblys/common/remove-signer-dialog.vue.d.ts +0 -35
- package/dist/lib/components/runtime/views/assemblys/common/remove-signer-dialog.vue.js +0 -127
- package/dist/lib/components/runtime/views/assemblys/common/remove-signer-dialog.vue2.js +0 -3
- package/dist/lib/components/runtime/views/assemblys/common/task-informition-dialog.vue.d.ts +0 -26
- package/dist/lib/components/runtime/views/assemblys/common/task-informition-dialog.vue.js +0 -104
- package/dist/lib/components/runtime/views/assemblys/common/task-informition-dialog.vue2.js +0 -3
- package/dist/lib/components/runtime/views/assemblys/container/card/card-runtime.vue.js +0 -3
- package/dist/lib/components/runtime/views/assemblys/container/card/card-runtime.vue2.js +0 -72
- package/dist/lib/components/runtime/views/assemblys/container/collapse/collapse-runtime.vue.js +0 -3
- package/dist/lib/components/runtime/views/assemblys/container/collapse/collapse-runtime.vue2.js +0 -74
- package/dist/lib/components/runtime/views/assemblys/container/container/container-runtime.vue.js +0 -3
- package/dist/lib/components/runtime/views/assemblys/container/container/container-runtime.vue2.js +0 -79
- package/dist/lib/components/runtime/views/assemblys/container/flex/flex-runtime.vue.js +0 -3
- package/dist/lib/components/runtime/views/assemblys/container/flex/flex-runtime.vue2.js +0 -43
- package/dist/lib/components/runtime/views/assemblys/container/form/form-runtime.vue.js +0 -3
- package/dist/lib/components/runtime/views/assemblys/container/form/form-runtime.vue2.js +0 -44
- package/dist/lib/components/runtime/views/assemblys/container/iframe/iframe-runtime.vue.js +0 -3
- package/dist/lib/components/runtime/views/assemblys/container/iframe/iframe-runtime.vue2.js +0 -30
- package/dist/lib/components/runtime/views/assemblys/container/tabs/tabs-runtime.vue.js +0 -3
- package/dist/lib/components/runtime/views/assemblys/container/tabs/tabs-runtime.vue2.js +0 -69
- package/dist/lib/components/runtime/views/assemblys/container/tools/tools-runtime.vue.js +0 -3
- package/dist/lib/components/runtime/views/assemblys/container/tools/tools-runtime.vue2.js +0 -75
- package/dist/lib/components/runtime/views/assemblys/data/table/main-table-runtime.vue.js +0 -642
- package/dist/lib/components/runtime/views/assemblys/data/table/main-table-runtime.vue2.js +0 -3
- package/dist/lib/components/runtime/views/assemblys/data/table/sub-table-runtime.vue.js +0 -453
- package/dist/lib/components/runtime/views/assemblys/data/table/sub-table-runtime.vue2.js +0 -3
- package/dist/lib/components/runtime/views/assemblys/data/table/table-runtime.vue.js +0 -3
- package/dist/lib/components/runtime/views/assemblys/data/table/table-runtime.vue2.js +0 -88
- package/dist/lib/components/runtime/views/assemblys/error-render.vue.d.ts +0 -22
- package/dist/lib/components/runtime/views/assemblys/error-render.vue.js +0 -22
- package/dist/lib/components/runtime/views/assemblys/error-render.vue2.js +0 -3
- package/dist/lib/components/runtime/views/assemblys/form/checkbox/checkbox-runtime.vue.js +0 -3
- package/dist/lib/components/runtime/views/assemblys/form/checkbox/checkbox-runtime.vue2.js +0 -156
- package/dist/lib/components/runtime/views/assemblys/form/date-picker/datepicker-runtime.vue.js +0 -3
- package/dist/lib/components/runtime/views/assemblys/form/date-picker/datepicker-runtime.vue2.js +0 -82
- package/dist/lib/components/runtime/views/assemblys/form/dept-tree/depttree-runtime.vue.js +0 -3
- package/dist/lib/components/runtime/views/assemblys/form/dept-tree/depttree-runtime.vue2.js +0 -64
- package/dist/lib/components/runtime/views/assemblys/form/divider/divider-runtime.vue.js +0 -3
- package/dist/lib/components/runtime/views/assemblys/form/divider/divider-runtime.vue2.js +0 -40
- package/dist/lib/components/runtime/views/assemblys/form/file-upload/fileupload-runtime.vue.js +0 -3
- package/dist/lib/components/runtime/views/assemblys/form/file-upload/fileupload-runtime.vue2.js +0 -74
- package/dist/lib/components/runtime/views/assemblys/form/input-number/input-number-runtime.vue.js +0 -3
- package/dist/lib/components/runtime/views/assemblys/form/input-number/input-number-runtime.vue2.js +0 -63
- package/dist/lib/components/runtime/views/assemblys/form/input-text/inputtext-runtime.vue.js +0 -3
- package/dist/lib/components/runtime/views/assemblys/form/input-text/inputtext-runtime.vue2.js +0 -127
- package/dist/lib/components/runtime/views/assemblys/form/label/label-runtime.vue.js +0 -3
- package/dist/lib/components/runtime/views/assemblys/form/label/label-runtime.vue2.js +0 -127
- package/dist/lib/components/runtime/views/assemblys/form/link/link-runtime.vue.js +0 -3
- package/dist/lib/components/runtime/views/assemblys/form/link/link-runtime.vue2.js +0 -77
- package/dist/lib/components/runtime/views/assemblys/form/placeholder/placeholder-runtime.vue.js +0 -3
- package/dist/lib/components/runtime/views/assemblys/form/placeholder/placeholder-runtime.vue2.js +0 -29
- package/dist/lib/components/runtime/views/assemblys/form/radio/radio-runtime.vue.js +0 -3
- package/dist/lib/components/runtime/views/assemblys/form/radio/radio-runtime.vue2.js +0 -157
- package/dist/lib/components/runtime/views/assemblys/form/rich-text/richtext-runtime.vue.js +0 -3
- package/dist/lib/components/runtime/views/assemblys/form/rich-text/richtext-runtime.vue2.js +0 -164
- package/dist/lib/components/runtime/views/assemblys/form/select/select-runtime.vue.js +0 -3
- package/dist/lib/components/runtime/views/assemblys/form/select/select-runtime.vue2.js +0 -201
- package/dist/lib/components/runtime/views/assemblys/form/switch/switch-runtime.vue.js +0 -3
- package/dist/lib/components/runtime/views/assemblys/form/switch/switch-runtime.vue2.js +0 -63
- package/dist/lib/components/runtime/views/assemblys/form/tag/tag-runtime.vue.js +0 -3
- package/dist/lib/components/runtime/views/assemblys/form/tag/tag-runtime.vue2.js +0 -63
- package/dist/lib/components/runtime/views/assemblys/form/textarea/textarea-runtime.vue.js +0 -3
- package/dist/lib/components/runtime/views/assemblys/form/textarea/textarea-runtime.vue2.js +0 -65
- package/dist/lib/components/runtime/views/assemblys/object-render.vue.d.ts +0 -17
- package/dist/lib/components/runtime/views/assemblys/object-render.vue.js +0 -142
- package/dist/lib/components/runtime/views/assemblys/object-render.vue2.js +0 -3
- package/dist/lib/components/runtime/views/assemblys/workflow/workflow-button/workflowbutton-runtime.vue.js +0 -3
- package/dist/lib/components/runtime/views/assemblys/workflow/workflow-button/workflowbutton-runtime.vue2.js +0 -61
- package/dist/lib/components/runtime/views/super-page-dialog.vue.d.ts +0 -36
- package/dist/lib/components/runtime/views/super-page-dialog.vue.js +0 -73
- package/dist/lib/components/runtime/views/super-page-dialog.vue2.js +0 -3
- package/dist/lib/components/runtime/views/super-page.vue.d.ts +0 -91
- package/dist/lib/components/runtime/views/super-page.vue.js +0 -496
- package/dist/lib/components/runtime/views/super-page.vue2.js +0 -3
- package/dist/lib/favicon.ico +0 -0
- package/dist/lib/index.d.ts +0 -8
- package/dist/lib/index.js +0 -15
|
@@ -2,9 +2,10 @@ import { getSystemBackendUrl } from "agilebuilder-ui/src/utils/common-util";
|
|
|
2
2
|
import { getSessionCache } from "agilebuilder-ui/src/utils/auth";
|
|
3
3
|
import http from "agilebuilder-ui/src/utils/request";
|
|
4
4
|
import { getBaseUrl } from "../common-util.js";
|
|
5
|
-
import { dealCompleteTaskParam } from "../events/standard-event.js";
|
|
5
|
+
import { getAdditionalParamMap, dealCompleteTaskParam } from "../events/standard-event.js";
|
|
6
6
|
import { packageCustomRules, getWorkflowRules } from "../events/validator-util.js";
|
|
7
7
|
import { handleEvent } from "../events/event-util.js";
|
|
8
|
+
import { functions } from "./page-expose-util.js";
|
|
8
9
|
function refreshPage(pageContext) {
|
|
9
10
|
getFormData(pageContext).then((commonEntity) => {
|
|
10
11
|
pageContext.isRefresh = true;
|
|
@@ -28,23 +29,23 @@ function getFormData(pageContext) {
|
|
|
28
29
|
}
|
|
29
30
|
function getCommonFormData(pageContext) {
|
|
30
31
|
return new Promise((resolve, reject) => {
|
|
31
|
-
const
|
|
32
|
+
const systemCode = pageContext.systemCode;
|
|
32
33
|
const pageCode = pageContext.code;
|
|
33
34
|
const pageVersion = pageContext.version;
|
|
34
|
-
const additionalParamMap = pageContext
|
|
35
|
+
const additionalParamMap = getAdditionalParamMap(pageContext);
|
|
35
36
|
const dataId = additionalParamMap ? additionalParamMap.id : null;
|
|
36
37
|
const ids = additionalParamMap ? additionalParamMap.ids : null;
|
|
37
38
|
const taskId = additionalParamMap ? additionalParamMap.taskId : null;
|
|
38
|
-
const permissionPrefix =
|
|
39
|
-
const backendUrl = getSystemBackendUrl(
|
|
39
|
+
const permissionPrefix = pageCode;
|
|
40
|
+
const backendUrl = getSystemBackendUrl(pageContext.backendUrl);
|
|
40
41
|
const param = {
|
|
41
42
|
pageCode,
|
|
42
43
|
pageVersion,
|
|
43
44
|
tableName: pageContext.tableName,
|
|
44
45
|
formNoRuleCode: pageContext.formNoRuleCode,
|
|
45
46
|
id: dataId,
|
|
46
|
-
systemCode
|
|
47
|
-
functionCode: permissionPrefix + ".
|
|
47
|
+
systemCode,
|
|
48
|
+
functionCode: permissionPrefix + ".gets",
|
|
48
49
|
tableNames: pageContext.tableNames
|
|
49
50
|
};
|
|
50
51
|
if (!param.id && additionalParamMap && additionalParamMap._t_ && getSessionCache(additionalParamMap._t_ + "_id")) {
|
|
@@ -72,7 +73,7 @@ function getCommonFormData(pageContext) {
|
|
|
72
73
|
pageContext.initFormNo = commonEntity.formNo;
|
|
73
74
|
}
|
|
74
75
|
const customRules = pageContext.customRules;
|
|
75
|
-
|
|
76
|
+
const formRules = pageContext.rules;
|
|
76
77
|
const newFormRules = packageCustomRules(customRules, formRules);
|
|
77
78
|
pageContext.rules = newFormRules;
|
|
78
79
|
const pageDesign = {
|
|
@@ -96,22 +97,22 @@ function getCommonFormData(pageContext) {
|
|
|
96
97
|
}
|
|
97
98
|
function getWorkflowFormData(pageContext) {
|
|
98
99
|
return new Promise((resolve, reject) => {
|
|
99
|
-
const
|
|
100
|
+
const systemCode = pageContext.systemCode;
|
|
100
101
|
const pageCode = pageContext.code;
|
|
101
102
|
const pageVersion = pageContext.version;
|
|
102
|
-
const additionalParamMap = pageContext
|
|
103
|
+
const additionalParamMap = getAdditionalParamMap(pageContext);
|
|
103
104
|
const dataId = additionalParamMap ? additionalParamMap.id : null;
|
|
104
105
|
const ids = additionalParamMap ? additionalParamMap.ids : null;
|
|
105
106
|
const taskId = additionalParamMap ? additionalParamMap.taskId : null;
|
|
106
|
-
const permissionPrefix =
|
|
107
|
+
const permissionPrefix = pageCode;
|
|
107
108
|
const param = {
|
|
108
109
|
pageCode,
|
|
109
110
|
pageVersion,
|
|
110
111
|
tableName: pageContext.tableName,
|
|
111
112
|
formNoRuleCode: pageContext.formNoRuleCode,
|
|
112
113
|
isWorkflowEntity: true,
|
|
113
|
-
systemCode
|
|
114
|
-
functionCode: permissionPrefix + ".
|
|
114
|
+
systemCode,
|
|
115
|
+
functionCode: permissionPrefix + ".gets",
|
|
115
116
|
tableNames: pageContext.tableNames
|
|
116
117
|
};
|
|
117
118
|
if (ids) {
|
|
@@ -135,7 +136,7 @@ function getWorkflowFormData(pageContext) {
|
|
|
135
136
|
if (pageContext.beanName) {
|
|
136
137
|
param["beanName"] = pageContext.beanName;
|
|
137
138
|
}
|
|
138
|
-
const baseUrl = getBaseUrl(
|
|
139
|
+
const baseUrl = getBaseUrl(pageContext.backendUrl);
|
|
139
140
|
const urlForView = baseUrl + "/dsc/workflow-commons/gets";
|
|
140
141
|
http.post(urlForView, param).then((commonEntity) => {
|
|
141
142
|
pageContext.definitionId = commonEntity.definitionId;
|
|
@@ -231,8 +232,8 @@ function changeFieldPermissionToMap(pageContext) {
|
|
|
231
232
|
pageContext.fieldPermissionMap = fieldPermissionMap;
|
|
232
233
|
}
|
|
233
234
|
function changeActionPermissionToMap(pageContext) {
|
|
234
|
-
|
|
235
|
-
|
|
235
|
+
const fieldPermissionMap = pageContext.fieldPermissionMap;
|
|
236
|
+
const actionPermissionMap = pageContext.actionPermissionMap;
|
|
236
237
|
const actionPermissions = pageContext.actionPermissions;
|
|
237
238
|
if (typeof actionPermissions !== "undefined" && actionPermissions !== null) {
|
|
238
239
|
const subModelNames = Object.keys(actionPermissions);
|
|
@@ -260,6 +261,7 @@ function changeActionPermissionToMap(pageContext) {
|
|
|
260
261
|
}
|
|
261
262
|
pageContext.actionPermissionMap = actionPermissionMap;
|
|
262
263
|
}
|
|
264
|
+
window["$PageUtil"] = functions;
|
|
263
265
|
export {
|
|
264
266
|
getFormData,
|
|
265
267
|
refreshPage
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const functions: any;
|
|
@@ -0,0 +1,206 @@
|
|
|
1
|
+
import { setValueForVariableName } from "../page-helper-util.js";
|
|
2
|
+
import { getComponentRefByCode } from "../global-refs.js";
|
|
3
|
+
import eventBus from "../eventBus.js";
|
|
4
|
+
import http from "agilebuilder-ui/src/utils/request";
|
|
5
|
+
import { getAdditionalParamMap } from "../events/standard-event.js";
|
|
6
|
+
const functions = {
|
|
7
|
+
/**
|
|
8
|
+
* 展示页面中的某个组件元素
|
|
9
|
+
* @param pageDesign 页面设计对象
|
|
10
|
+
* @param codes 展示组件所绑定的变量或者是绑定的code值, 绑定变量时传递变量名, 如果绑定的变量为${data.xxx}则传递xxx
|
|
11
|
+
*/
|
|
12
|
+
showElement: function(pageContext, codes) {
|
|
13
|
+
codes.forEach((code) => {
|
|
14
|
+
const ref = getComponentRefByCode(pageContext, code);
|
|
15
|
+
if (ref) {
|
|
16
|
+
ref.show();
|
|
17
|
+
} else {
|
|
18
|
+
console.error(`未找到code为${code}的组件`);
|
|
19
|
+
}
|
|
20
|
+
});
|
|
21
|
+
},
|
|
22
|
+
/**
|
|
23
|
+
* 隐藏页面中的某个组件元素
|
|
24
|
+
* @param pageDesign 页面设计对象
|
|
25
|
+
* @param codes 展示组件所绑定的变量或者是绑定的code值, 绑定变量时传递变量名, 如果绑定的变量为${data.xxx}则传递xxx
|
|
26
|
+
*/
|
|
27
|
+
hideElement: function(pageContext, codes) {
|
|
28
|
+
codes.forEach((code) => {
|
|
29
|
+
const ref = getComponentRefByCode(pageContext, code);
|
|
30
|
+
if (ref) {
|
|
31
|
+
ref.hide();
|
|
32
|
+
} else {
|
|
33
|
+
console.error(`未找到code为${code}的组件`);
|
|
34
|
+
}
|
|
35
|
+
});
|
|
36
|
+
},
|
|
37
|
+
/**
|
|
38
|
+
* 设置组件元素可用状态
|
|
39
|
+
* @param pageContext
|
|
40
|
+
* @param codes ['name', 'age']
|
|
41
|
+
*/
|
|
42
|
+
enableElement: function(pageContext, codes) {
|
|
43
|
+
codes.forEach((code) => {
|
|
44
|
+
const ref = getComponentRefByCode(pageContext, code);
|
|
45
|
+
if (ref) {
|
|
46
|
+
const configure = ref.getConfigure();
|
|
47
|
+
if (configure && configure.runtime.props) {
|
|
48
|
+
configure.runtime.props.state = "enabled";
|
|
49
|
+
}
|
|
50
|
+
} else {
|
|
51
|
+
console.error(`未找到code为${code}的组件`);
|
|
52
|
+
}
|
|
53
|
+
});
|
|
54
|
+
},
|
|
55
|
+
/**
|
|
56
|
+
* 禁用页面中的某个组件元素
|
|
57
|
+
* @param pageContext
|
|
58
|
+
* @param codes ['name', 'age']
|
|
59
|
+
*/
|
|
60
|
+
disableElement: function(pageContext, codes) {
|
|
61
|
+
codes.forEach((code) => {
|
|
62
|
+
const ref = getComponentRefByCode(pageContext, code);
|
|
63
|
+
if (ref) {
|
|
64
|
+
const configure = ref.getConfigure();
|
|
65
|
+
if (configure && configure.runtime.props) {
|
|
66
|
+
configure.runtime.props.state = "disabled";
|
|
67
|
+
}
|
|
68
|
+
} else {
|
|
69
|
+
console.error(`未找到code为${code}的组件`);
|
|
70
|
+
}
|
|
71
|
+
});
|
|
72
|
+
},
|
|
73
|
+
/**
|
|
74
|
+
* 设置值
|
|
75
|
+
* @param pageDesign 页面设计对象
|
|
76
|
+
* @param keyValue {"name":"xxx",age:1,addr:"bj"} 展示组件所绑定的变量或者是绑定的code值, 绑定变量时传递变量名, 如果绑定的变量为${data.xxx}则传递xxx
|
|
77
|
+
*/
|
|
78
|
+
setEntityDataValue: function(pageContext, keyValue) {
|
|
79
|
+
Object.keys(keyValue).forEach((key) => {
|
|
80
|
+
setValueForVariableName(
|
|
81
|
+
pageContext.entity,
|
|
82
|
+
key.startsWith("${") ? key : "${data." + key + "}",
|
|
83
|
+
keyValue[key]
|
|
84
|
+
);
|
|
85
|
+
});
|
|
86
|
+
},
|
|
87
|
+
/**
|
|
88
|
+
* 设置值
|
|
89
|
+
* @param pageDesign 页面设计对象
|
|
90
|
+
* @param keyValue {"name":"xxx",age:1,addr:"bj"} 展示组件所绑定的变量或者是绑定的code值, 绑定变量时传递变量名, 如果绑定的变量为${data.xxx}则传递xxx
|
|
91
|
+
*/
|
|
92
|
+
setEntityPageValue: function(pageContext, keyValue) {
|
|
93
|
+
Object.keys(keyValue).forEach((key) => {
|
|
94
|
+
setValueForVariableName(
|
|
95
|
+
pageContext.entity,
|
|
96
|
+
key.startsWith("${") ? key : "${page." + key + "}",
|
|
97
|
+
keyValue[key]
|
|
98
|
+
);
|
|
99
|
+
});
|
|
100
|
+
},
|
|
101
|
+
setEntityValueByType: function(pageContext, type, keyValue) {
|
|
102
|
+
Object.keys(keyValue).forEach((key) => {
|
|
103
|
+
setValueForVariableName(
|
|
104
|
+
pageContext.entity,
|
|
105
|
+
key.startsWith("${") ? key : "${" + type + "." + key + "}",
|
|
106
|
+
keyValue[key]
|
|
107
|
+
);
|
|
108
|
+
});
|
|
109
|
+
},
|
|
110
|
+
/**
|
|
111
|
+
*
|
|
112
|
+
* @param pageContext
|
|
113
|
+
* @param keyValue [
|
|
114
|
+
{
|
|
115
|
+
name: 'xxxx',
|
|
116
|
+
show: true,
|
|
117
|
+
readonly: true,
|
|
118
|
+
disabled: true,
|
|
119
|
+
rules: [
|
|
120
|
+
{
|
|
121
|
+
required: true,
|
|
122
|
+
message: 'Please input email address',
|
|
123
|
+
trigger: 'blur'
|
|
124
|
+
},
|
|
125
|
+
{
|
|
126
|
+
type: 'email',
|
|
127
|
+
message: 'Please input correct email address',
|
|
128
|
+
trigger: ['blur', 'change']
|
|
129
|
+
}
|
|
130
|
+
]
|
|
131
|
+
}
|
|
132
|
+
]
|
|
133
|
+
*/
|
|
134
|
+
fnProhibitToEdit: function(pageContext, settings) {
|
|
135
|
+
if (!pageContext.customRules) {
|
|
136
|
+
pageContext.customRules = {};
|
|
137
|
+
}
|
|
138
|
+
settings.forEach((item) => {
|
|
139
|
+
if (!item.name) {
|
|
140
|
+
return;
|
|
141
|
+
}
|
|
142
|
+
if (item.rules) {
|
|
143
|
+
pageContext.customRules[item.name] = item.rules;
|
|
144
|
+
}
|
|
145
|
+
const ref = getComponentRefByCode(pageContext, item.name);
|
|
146
|
+
if (ref) {
|
|
147
|
+
if (item.show !== void 0) {
|
|
148
|
+
item.show ? ref.show() : ref.hide();
|
|
149
|
+
}
|
|
150
|
+
const configure = ref.getConfigure();
|
|
151
|
+
if (item.required !== void 0) {
|
|
152
|
+
configure.runtime.props.required = item.required;
|
|
153
|
+
}
|
|
154
|
+
if (item.readonly !== void 0) {
|
|
155
|
+
item.readonly ? configure.runtime.props.state = "readonly" : configure.runtime.props.state = "enabled";
|
|
156
|
+
}
|
|
157
|
+
if (item.disabled !== void 0) {
|
|
158
|
+
item.disabled ? configure.runtime.props.state = "disabled" : configure.runtime.props.state = "enabled";
|
|
159
|
+
}
|
|
160
|
+
}
|
|
161
|
+
});
|
|
162
|
+
},
|
|
163
|
+
/**
|
|
164
|
+
* 调用服务流,
|
|
165
|
+
* @param pageContext
|
|
166
|
+
* @param flowCode
|
|
167
|
+
* @returns
|
|
168
|
+
*/
|
|
169
|
+
executeServiceFlow: function(pageContext, flowCode, params) {
|
|
170
|
+
const pageCode = pageContext.code;
|
|
171
|
+
if (!params) {
|
|
172
|
+
params = {
|
|
173
|
+
entity: pageContext.entity.data,
|
|
174
|
+
serviceVariables: {},
|
|
175
|
+
requestParams: getAdditionalParamMap(pageContext),
|
|
176
|
+
taskParamMap: pageContext.entity.task,
|
|
177
|
+
dynamicDimensionValue: [],
|
|
178
|
+
dynamicSortValue: ""
|
|
179
|
+
};
|
|
180
|
+
}
|
|
181
|
+
if (!params.entity) {
|
|
182
|
+
params.entity = pageContext.entity.data;
|
|
183
|
+
}
|
|
184
|
+
if (!params.requestParams) {
|
|
185
|
+
params.requestParams = getAdditionalParamMap(pageContext);
|
|
186
|
+
}
|
|
187
|
+
if (!params.taskParamMap) {
|
|
188
|
+
params.requestParams = pageContext.entity.task;
|
|
189
|
+
}
|
|
190
|
+
let baseUrl = pageContext.backendUrl;
|
|
191
|
+
if (!baseUrl) {
|
|
192
|
+
baseUrl = window["$vueApp"].config.globalProperties.baseURL;
|
|
193
|
+
}
|
|
194
|
+
return http.post(`${baseUrl}/dsc/service-flow/execute/${pageCode}/${flowCode}`, params);
|
|
195
|
+
},
|
|
196
|
+
openPage: function(pageContext, openParam) {
|
|
197
|
+
eventBus.$emit(pageContext.code + "_open-dialog", {
|
|
198
|
+
pageContext,
|
|
199
|
+
eventParams: {},
|
|
200
|
+
configureObj: { props: { linkPage: openParam } }
|
|
201
|
+
});
|
|
202
|
+
}
|
|
203
|
+
};
|
|
204
|
+
export {
|
|
205
|
+
functions
|
|
206
|
+
};
|
|
@@ -249,13 +249,22 @@ const assemblyGroups = [
|
|
|
249
249
|
{
|
|
250
250
|
name: "data",
|
|
251
251
|
label: "数据",
|
|
252
|
-
items: [
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
252
|
+
items: [
|
|
253
|
+
{
|
|
254
|
+
name: "table",
|
|
255
|
+
label: "表格",
|
|
256
|
+
runtimeComponent: defineAsyncComponent(() => {
|
|
257
|
+
return import("../views/assemblys/data/table/table-runtime.vue.js");
|
|
258
|
+
})
|
|
259
|
+
},
|
|
260
|
+
{
|
|
261
|
+
name: "bar-code",
|
|
262
|
+
label: "条码",
|
|
263
|
+
runtimeComponent: defineAsyncComponent(() => {
|
|
264
|
+
return import("../views/assemblys/data/bar-code/barcode-runtime.vue.js");
|
|
265
|
+
})
|
|
266
|
+
}
|
|
267
|
+
]
|
|
259
268
|
}
|
|
260
269
|
];
|
|
261
270
|
function getRuntimeComponentByName(name) {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
export declare function isArrayFn(value: any): boolean;
|
|
2
|
-
export declare function getBaseUrl(
|
|
3
|
-
export declare function getRealRestApiPath(orgRestApiPath: any,
|
|
2
|
+
export declare function getBaseUrl(backendUrl: any): any;
|
|
3
|
+
export declare function getRealRestApiPath(orgRestApiPath: any, systemCode: any, backendUrl: any): any;
|
|
4
4
|
/**
|
|
5
5
|
* 封装模板文件列表
|
|
6
6
|
* @param templateFiles
|
|
@@ -7,23 +7,19 @@ function isArrayFn(value) {
|
|
|
7
7
|
return Object.prototype.toString.call(value) === "[object Array]";
|
|
8
8
|
}
|
|
9
9
|
}
|
|
10
|
-
function getBaseUrl(
|
|
10
|
+
function getBaseUrl(backendUrl) {
|
|
11
11
|
let baseUrl = window["$vueApp"].config.globalProperties.baseURL;
|
|
12
|
-
if (
|
|
13
|
-
baseUrl = getSystemBackendUrl(
|
|
12
|
+
if (backendUrl) {
|
|
13
|
+
baseUrl = getSystemBackendUrl(backendUrl);
|
|
14
14
|
}
|
|
15
15
|
return baseUrl;
|
|
16
16
|
}
|
|
17
|
-
function getRealRestApiPath(orgRestApiPath,
|
|
17
|
+
function getRealRestApiPath(orgRestApiPath, systemCode, backendUrl) {
|
|
18
18
|
let path = orgRestApiPath;
|
|
19
19
|
if (orgRestApiPath) {
|
|
20
|
-
if (
|
|
21
|
-
const baseUrl = getBaseUrl(
|
|
22
|
-
|
|
23
|
-
path = baseUrl + "/" + system.code + orgRestApiPath;
|
|
24
|
-
} else {
|
|
25
|
-
path = baseUrl + orgRestApiPath;
|
|
26
|
-
}
|
|
20
|
+
if (backendUrl && !isFullPath(orgRestApiPath)) {
|
|
21
|
+
const baseUrl = getBaseUrl(backendUrl);
|
|
22
|
+
path = baseUrl + "/" + systemCode + orgRestApiPath;
|
|
27
23
|
}
|
|
28
24
|
}
|
|
29
25
|
return path;
|
|
@@ -69,7 +65,7 @@ function upperFirstCase(str) {
|
|
|
69
65
|
return str.toLowerCase().replace(/( |^)[a-z]/g, (L) => L.toUpperCase());
|
|
70
66
|
}
|
|
71
67
|
function getListCode(pageCode, pageVersion, tableUuid) {
|
|
72
|
-
return pageCode + "
|
|
68
|
+
return pageCode + "__V" + pageVersion + "__" + tableUuid;
|
|
73
69
|
}
|
|
74
70
|
function deepCopy(srcObj) {
|
|
75
71
|
if (typeof srcObj !== "object" || srcObj === null) {
|
|
@@ -5,6 +5,13 @@ import { PageDesign, Component, PageContext } from '../interfaces/page-design-ty
|
|
|
5
5
|
* @param pageDesign
|
|
6
6
|
*/
|
|
7
7
|
export declare function initPageEvents(pageDesign: PageDesign, pageContext: PageContext): void;
|
|
8
|
+
/**
|
|
9
|
+
* 获取自定义方法
|
|
10
|
+
* @param pageContext
|
|
11
|
+
* @param funcName
|
|
12
|
+
* @returns
|
|
13
|
+
*/
|
|
14
|
+
export declare function getCustomFunc(pageContext: PageContext, funcName: any): any;
|
|
8
15
|
/**
|
|
9
16
|
* 页面销毁时,将window上注册的函数移除掉
|
|
10
17
|
* @param pageDesign
|
|
@@ -21,6 +28,13 @@ export declare function doAfterClickEvent(pageContext: PageContext, configure: C
|
|
|
21
28
|
* @param eventType change、click等事件类型
|
|
22
29
|
*/
|
|
23
30
|
export declare function getEventFuncByType(pageContext: PageContext, events: Array<any>, eventType: string): any;
|
|
31
|
+
/**
|
|
32
|
+
* 根据事件类型,获得事件名称
|
|
33
|
+
* @param events
|
|
34
|
+
* @param eventType
|
|
35
|
+
* @returns
|
|
36
|
+
*/
|
|
37
|
+
export declare function getEventNameByType(events: Array<any>, eventType: string): any;
|
|
24
38
|
/**
|
|
25
39
|
* 获得事件Function对象
|
|
26
40
|
* @param events 该组件所有事件集合
|
|
@@ -1,18 +1,71 @@
|
|
|
1
1
|
import { isPromise } from "agilebuilder-ui/src/utils/common-util";
|
|
2
|
-
import { judgeDataNumber, standardEvents, dealAfterOperate } from "./standard-event.js";
|
|
2
|
+
import { judgeDataNumber, standardEvents, getAdditionalParamMap, dealAfterOperate } from "./standard-event.js";
|
|
3
3
|
import { validateDataModelFunc } from "./validator-util.js";
|
|
4
|
-
import { getComponentRef } from "../global-refs.js";
|
|
4
|
+
import { getComponentRef, getComponentRefByCode } from "../global-refs.js";
|
|
5
5
|
import { ElMessage } from "element-plus";
|
|
6
6
|
import { analysisCondition } from "agilebuilder-ui/src/utils/util";
|
|
7
7
|
import { getListCode } from "../common-util.js";
|
|
8
8
|
import eventBus from "../eventBus.js";
|
|
9
|
-
import "
|
|
10
|
-
import "dayjs";
|
|
11
|
-
import "agilebuilder-ui/src/utils/calculator/calculator-util";
|
|
12
|
-
import "vue";
|
|
9
|
+
import { getValueFromSource } from "../page-helper-util.js";
|
|
13
10
|
function initPageEvents(pageDesign, pageContext) {
|
|
14
11
|
if (pageDesign && pageDesign.customEvents) {
|
|
15
|
-
|
|
12
|
+
const customEvents = transferToFunction(pageDesign.customEvents);
|
|
13
|
+
appendDefaultMethod(pageContext, customEvents);
|
|
14
|
+
console.log("initPage customEvents", customEvents);
|
|
15
|
+
pageContext.customEvents = customEvents;
|
|
16
|
+
}
|
|
17
|
+
}
|
|
18
|
+
function getCustomFunc(pageContext, funcName) {
|
|
19
|
+
if (pageContext.customEvents) {
|
|
20
|
+
return pageContext.customEvents[funcName];
|
|
21
|
+
}
|
|
22
|
+
}
|
|
23
|
+
function appendDefaultMethod(pageContext, customEvents) {
|
|
24
|
+
if (!customEvents) {
|
|
25
|
+
return;
|
|
26
|
+
}
|
|
27
|
+
for (const pro in customEvents) {
|
|
28
|
+
const func = customEvents[pro];
|
|
29
|
+
func.get = function(code) {
|
|
30
|
+
if (code) {
|
|
31
|
+
return getComponentRefByCode(pageContext, code);
|
|
32
|
+
} else {
|
|
33
|
+
return void 0;
|
|
34
|
+
}
|
|
35
|
+
};
|
|
36
|
+
func.getByUuid = function(uuid) {
|
|
37
|
+
if (uuid) {
|
|
38
|
+
return getComponentRef(pageContext, uuid);
|
|
39
|
+
} else {
|
|
40
|
+
return void 0;
|
|
41
|
+
}
|
|
42
|
+
};
|
|
43
|
+
func.getPageContext = function() {
|
|
44
|
+
return pageContext;
|
|
45
|
+
};
|
|
46
|
+
func.getContextValue = function(fieldName) {
|
|
47
|
+
let contextData = pageContext && pageContext.entity ? pageContext.entity.context : null;
|
|
48
|
+
contextData = contextData ? contextData : {};
|
|
49
|
+
return getValueFromSource(contextData, fieldName, "context");
|
|
50
|
+
};
|
|
51
|
+
func.getContext = function() {
|
|
52
|
+
return pageContext && pageContext.entity ? pageContext.entity.context : {};
|
|
53
|
+
};
|
|
54
|
+
func.getSystem = function() {
|
|
55
|
+
return pageContext && pageContext.entity ? pageContext.entity.system : {};
|
|
56
|
+
};
|
|
57
|
+
func.getTask = function() {
|
|
58
|
+
return pageContext && pageContext.entity ? pageContext.entity.task : {};
|
|
59
|
+
};
|
|
60
|
+
func.getRequest = function() {
|
|
61
|
+
return pageContext && pageContext.entity ? pageContext.entity.request : {};
|
|
62
|
+
};
|
|
63
|
+
func.getPage = function() {
|
|
64
|
+
return pageContext && pageContext.entity ? pageContext.entity.page : {};
|
|
65
|
+
};
|
|
66
|
+
func.getCustomFunc = function(funcName) {
|
|
67
|
+
return getCustomFunc(pageContext, funcName);
|
|
68
|
+
};
|
|
16
69
|
}
|
|
17
70
|
}
|
|
18
71
|
function removeCustomFuncFromWindow(pageDesign) {
|
|
@@ -36,9 +89,8 @@ function handleEventUtil($event, pageContext, configure, eventType, isExecute, o
|
|
|
36
89
|
const pageCode = pageContext.code;
|
|
37
90
|
const pageVersion = pageContext.version;
|
|
38
91
|
const events = configure.runtime && configure.runtime.events ? configure.runtime.events : [];
|
|
39
|
-
const componentType = configure.name;
|
|
40
92
|
let eventFun;
|
|
41
|
-
if (eventType && eventType === "click"
|
|
93
|
+
if (eventType && eventType === "click") {
|
|
42
94
|
const tableUuid = configure.props.base.tableUuid ? configure.props.base.tableUuid : pageContext.tableUuids && pageContext.tableUuids.length > 0 ? pageContext.tableUuids[0] : null;
|
|
43
95
|
if (tableUuid) {
|
|
44
96
|
const gridRef = getComponentRef(pageContext, tableUuid);
|
|
@@ -69,13 +121,6 @@ function handleEventUtil($event, pageContext, configure, eventType, isExecute, o
|
|
|
69
121
|
}
|
|
70
122
|
}
|
|
71
123
|
}
|
|
72
|
-
function handleEventByEventName(pageContext, configure, eventName, otherParams) {
|
|
73
|
-
const eventFun = getEventByEventName(pageContext, eventName);
|
|
74
|
-
if (eventFun) {
|
|
75
|
-
const eventParams = packageEventParams(pageContext, configure, null, otherParams);
|
|
76
|
-
return callItemEvent(pageContext, configure, eventFun, eventParams);
|
|
77
|
-
}
|
|
78
|
-
}
|
|
79
124
|
function packageEventParams(pageContext, configureObj, $event, otherParams) {
|
|
80
125
|
const params = {};
|
|
81
126
|
if (otherParams) {
|
|
@@ -238,7 +283,8 @@ function doAfterClickFunc(pageContext, configure, eventParams, isStandardEvent,
|
|
|
238
283
|
pageContext,
|
|
239
284
|
configure,
|
|
240
285
|
result,
|
|
241
|
-
"
|
|
286
|
+
"",
|
|
287
|
+
// superPageRuntimeMessage.successfulOperation 开发人员自己加事件
|
|
242
288
|
isListButton
|
|
243
289
|
);
|
|
244
290
|
} else {
|
|
@@ -258,35 +304,50 @@ function doClickEvent(pageContext, configure, clickEventFunObj, eventParams) {
|
|
|
258
304
|
doClickCustomEvent(pageContext, configure, clickEventFunObj, eventParams);
|
|
259
305
|
}
|
|
260
306
|
}
|
|
261
|
-
function getEventByEventName(pageContext,
|
|
307
|
+
function getEventByEventName(pageContext, eventObj) {
|
|
262
308
|
const eventsObj = pageContext.customEvents;
|
|
263
|
-
if (eventsObj &&
|
|
264
|
-
|
|
309
|
+
if (eventsObj && eventObj) {
|
|
310
|
+
let key = "";
|
|
311
|
+
if (typeof eventObj === "object") {
|
|
312
|
+
key = eventObj.componentUuid + "_" + eventObj.name;
|
|
313
|
+
} else {
|
|
314
|
+
key = eventObj;
|
|
315
|
+
}
|
|
316
|
+
return eventsObj[key];
|
|
265
317
|
}
|
|
266
318
|
}
|
|
267
319
|
function getEventFuncByType(pageContext, events, eventType) {
|
|
268
320
|
if (events && eventType) {
|
|
269
|
-
const eventArr = events.filter((item) => item.name === eventType
|
|
321
|
+
const eventArr = events.filter((item) => item.name === eventType);
|
|
270
322
|
if (eventArr && eventArr.length > 0) {
|
|
271
323
|
const event = eventArr[0];
|
|
272
324
|
if (event.isStandard) {
|
|
273
325
|
return standardEvents[event.eventName];
|
|
274
326
|
} else {
|
|
275
|
-
return getEventByEventName(pageContext, event
|
|
327
|
+
return getEventByEventName(pageContext, event);
|
|
276
328
|
}
|
|
277
329
|
}
|
|
278
330
|
}
|
|
279
331
|
}
|
|
332
|
+
function getEventNameByType(events, eventType) {
|
|
333
|
+
if (events && eventType) {
|
|
334
|
+
const eventArr = events.filter((item) => item.name === eventType);
|
|
335
|
+
if (eventArr && eventArr.length > 0) {
|
|
336
|
+
const event = eventArr[0];
|
|
337
|
+
return event.eventName;
|
|
338
|
+
}
|
|
339
|
+
}
|
|
340
|
+
}
|
|
280
341
|
function getClickEventFuncByType(pageContext, events, eventType) {
|
|
281
342
|
if (events && eventType) {
|
|
282
|
-
const eventArr = events.filter((item) => item.name === eventType
|
|
343
|
+
const eventArr = events.filter((item) => item.name === eventType);
|
|
283
344
|
if (eventArr && eventArr.length > 0) {
|
|
284
345
|
const event = eventArr[0];
|
|
285
346
|
if (event.isStandard) {
|
|
286
347
|
return { func: standardEvents[event.eventName], isStandard: true, event };
|
|
287
348
|
} else {
|
|
288
349
|
return {
|
|
289
|
-
func: getEventByEventName(pageContext, event
|
|
350
|
+
func: getEventByEventName(pageContext, event),
|
|
290
351
|
isStandard: false,
|
|
291
352
|
event
|
|
292
353
|
};
|
|
@@ -310,19 +371,25 @@ function callItemEvent(pageContext, configureObj, eventFun, eventParams, otherPa
|
|
|
310
371
|
eventParams[key] = otherParams[key];
|
|
311
372
|
}
|
|
312
373
|
}
|
|
313
|
-
return eventFun(eventParams);
|
|
374
|
+
return eventFun.apply(eventFun, [eventParams]);
|
|
314
375
|
}
|
|
315
376
|
function transferToFunction(customEvents) {
|
|
316
377
|
const eventsObj = {};
|
|
317
378
|
customEvents.forEach((event) => {
|
|
318
|
-
if (event.jsContent) {
|
|
319
|
-
eventsObj[event.eventName] = new Function("params", event.jsContent);
|
|
379
|
+
if (!event.isStandard && event.jsContent) {
|
|
320
380
|
if (event.name === "customFunc") {
|
|
381
|
+
let newFunc = null;
|
|
321
382
|
if (event.funcParam) {
|
|
322
|
-
|
|
383
|
+
const args = event.funcParam.split(",");
|
|
384
|
+
newFunc = new Function(args, event.jsContent);
|
|
323
385
|
} else {
|
|
324
|
-
|
|
386
|
+
newFunc = new Function(event.jsContent);
|
|
325
387
|
}
|
|
388
|
+
eventsObj[event.eventName] = newFunc;
|
|
389
|
+
} else {
|
|
390
|
+
let key = event.componentUuid + "_";
|
|
391
|
+
key += event.name;
|
|
392
|
+
eventsObj[key] = new Function("params", event.jsContent);
|
|
326
393
|
}
|
|
327
394
|
}
|
|
328
395
|
});
|
|
@@ -351,7 +418,7 @@ function canExecuteButton(params) {
|
|
|
351
418
|
});
|
|
352
419
|
} else {
|
|
353
420
|
const contextParameter = pageContext.entity.context;
|
|
354
|
-
const additionalParamMap = pageContext
|
|
421
|
+
const additionalParamMap = getAdditionalParamMap(pageContext);
|
|
355
422
|
const isSql = true;
|
|
356
423
|
const tableName = pageContext.tableName;
|
|
357
424
|
let isCanExecute = true;
|
|
@@ -370,7 +437,8 @@ function canExecuteButton(params) {
|
|
|
370
437
|
contextParameter,
|
|
371
438
|
isSql,
|
|
372
439
|
tableName,
|
|
373
|
-
null
|
|
440
|
+
null,
|
|
441
|
+
pageContext
|
|
374
442
|
);
|
|
375
443
|
if (!canExecute) {
|
|
376
444
|
isCanExecute = false;
|
|
@@ -542,13 +610,14 @@ export {
|
|
|
542
610
|
fileUploadDeleted,
|
|
543
611
|
fileUploadUploaded,
|
|
544
612
|
getClickEventFuncByType,
|
|
613
|
+
getCustomFunc,
|
|
545
614
|
getEventFuncByType,
|
|
615
|
+
getEventNameByType,
|
|
546
616
|
getHandleEvent,
|
|
547
617
|
gridSelectAllRecords,
|
|
548
618
|
gridSelectRecord,
|
|
549
619
|
gridSelectionChange,
|
|
550
620
|
handleEvent,
|
|
551
|
-
handleEventByEventName,
|
|
552
621
|
headerClick,
|
|
553
622
|
initPageEvents,
|
|
554
623
|
removeCustomFuncFromWindow,
|
|
@@ -38,6 +38,7 @@ export declare const standardEvents: {
|
|
|
38
38
|
lineEditCreate: (params: any) => void;
|
|
39
39
|
};
|
|
40
40
|
export declare function exportFormReport(pageContext: any, configureObj: any, templateFile: any, isPdf: any): void;
|
|
41
|
+
export declare function getSaveFormRequestWithRow(pageContext: any, configureObj: any, url: any, isUnControlVersion: any, mainDefaultValueColumns: any, dynamicColumnInfo: any, row: any): any;
|
|
41
42
|
export declare function getSaveFormRequest(pageContext: any, configureObj: any, url: any, isUnControlVersion: any, mainDefaultValueColumns: any, dynamicColumnInfo: any): any;
|
|
42
43
|
/**
|
|
43
44
|
* 按钮执行后页面处理方式:刷新、关闭弹框等等
|
|
@@ -53,6 +54,7 @@ export declare function doImportFinally(params: any, fileObj: any): void;
|
|
|
53
54
|
export declare function judgeDataNumber(buttonConfigureObj: any, ids: any): boolean;
|
|
54
55
|
export declare function dealCompleteTaskParam(commonEntity: any, isInit: any, pageContext: any, params?: any, operationResult?: any): boolean;
|
|
55
56
|
export declare function doAssign(params: any, selectNodeInfo: any): void;
|
|
57
|
+
export declare function getAdditionalParamMap(pageContext: any): any;
|
|
56
58
|
export declare function doAddSigner(params: any, selectNodeInfo: any): void;
|
|
57
59
|
export declare function doCreateCopyTask(params: any, selectNodeInfo: any): void;
|
|
58
60
|
export declare function getTaskInformitions(params: any): any;
|