super-page-runtime 2.1.20 → 2.1.21
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 +4 -8
- package/dist/es/components/runtime/utils/common-util.d.ts +2 -1
- package/dist/es/components/runtime/utils/common-util.js +9 -0
- package/dist/es/components/runtime/utils/events/event-util.js +4 -8
- package/dist/es/components/runtime/utils/events/standard-event.js +6 -6
- package/package.json +2 -2
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { getSessionCache } from "agilebuilder-ui/src/utils/auth";
|
|
2
2
|
import http from "agilebuilder-ui/src/utils/request";
|
|
3
|
-
import { getBaseUrl, getListCode } from "../common-util.js";
|
|
3
|
+
import { isWorkflowPage, getBaseUrl, getListCode } from "../common-util.js";
|
|
4
4
|
import { getAdditionalParamMap, dealCompleteTaskParam } from "../events/standard-event.js";
|
|
5
5
|
import { packageCustomRules, getWorkflowRules } from "../events/validator-util.js";
|
|
6
6
|
import { handleEvent } from "../events/event-util.js";
|
|
@@ -11,15 +11,11 @@ function refreshPage(pageContext, id) {
|
|
|
11
11
|
});
|
|
12
12
|
}
|
|
13
13
|
function getFormData(pageContext, id) {
|
|
14
|
-
var _a;
|
|
15
14
|
const pageType = pageContext.pageType;
|
|
16
15
|
if (pageType && pageType === "form") {
|
|
17
16
|
console.log("获取表单数据getData--pageContext=", pageContext);
|
|
18
17
|
pageContext.canClick = false;
|
|
19
|
-
|
|
20
|
-
if ((_a = pageContext.props) == null ? void 0 : _a.activeWorkflow) {
|
|
21
|
-
isWorkflow = pageContext.workflowCode ? true : false;
|
|
22
|
-
}
|
|
18
|
+
const isWorkflow = isWorkflowPage(pageContext);
|
|
23
19
|
if (isWorkflow) {
|
|
24
20
|
return getWorkflowFormData(pageContext, id);
|
|
25
21
|
} else {
|
|
@@ -204,7 +200,7 @@ function changePermissionListToMap(pageContext) {
|
|
|
204
200
|
changeActionPermissionToMap(pageContext);
|
|
205
201
|
}
|
|
206
202
|
function changeFieldPermissionToMap(pageContext) {
|
|
207
|
-
|
|
203
|
+
const fieldPermissionMap = /* @__PURE__ */ new Map();
|
|
208
204
|
const fieldPermissions = pageContext.fieldPermissions;
|
|
209
205
|
if (typeof fieldPermissions !== "undefined") {
|
|
210
206
|
for (let i = 0; i < fieldPermissions.length; i++) {
|
|
@@ -262,7 +258,7 @@ function changeFieldPermissionToMap(pageContext) {
|
|
|
262
258
|
}
|
|
263
259
|
function changeActionPermissionToMap(pageContext) {
|
|
264
260
|
const fieldPermissionMap = pageContext.fieldPermissionMap;
|
|
265
|
-
|
|
261
|
+
const actionPermissionMap = /* @__PURE__ */ new Map();
|
|
266
262
|
const actionPermissions = pageContext.actionPermissions;
|
|
267
263
|
if (typeof actionPermissions !== "undefined" && actionPermissions !== null) {
|
|
268
264
|
const subModelNames = Object.keys(actionPermissions);
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { Component } from './interfaces/page-design-types';
|
|
1
|
+
import { Component, PageContext } from './interfaces/page-design-types';
|
|
2
2
|
|
|
3
3
|
export declare function isArrayFn(value: any): boolean;
|
|
4
4
|
export declare function getBaseUrl(backendUrl: string | null | undefined, isTest?: boolean): any;
|
|
@@ -24,3 +24,4 @@ export declare function getWorkflowId(pageContext: any): any;
|
|
|
24
24
|
*/
|
|
25
25
|
export declare function getPropClassName(configure: Component): any;
|
|
26
26
|
export declare function isNumber(numStr: any): boolean;
|
|
27
|
+
export declare function isWorkflowPage(pageContext: PageContext): boolean;
|
|
@@ -132,6 +132,14 @@ function isNumber(numStr) {
|
|
|
132
132
|
return false;
|
|
133
133
|
}
|
|
134
134
|
}
|
|
135
|
+
function isWorkflowPage(pageContext) {
|
|
136
|
+
var _a;
|
|
137
|
+
let isWorkflow = false;
|
|
138
|
+
if ((_a = pageContext.props) == null ? void 0 : _a.activeWorkflow) {
|
|
139
|
+
isWorkflow = pageContext.workflowCode ? true : false;
|
|
140
|
+
}
|
|
141
|
+
return isWorkflow;
|
|
142
|
+
}
|
|
135
143
|
export {
|
|
136
144
|
deepCopy,
|
|
137
145
|
getBaseUrl,
|
|
@@ -141,6 +149,7 @@ export {
|
|
|
141
149
|
getWorkflowId,
|
|
142
150
|
isArrayFn,
|
|
143
151
|
isNumber,
|
|
152
|
+
isWorkflowPage,
|
|
144
153
|
packageTemplateFiles,
|
|
145
154
|
upperFirstCase
|
|
146
155
|
};
|
|
@@ -98,14 +98,11 @@ function handleFormEvent($event, pageContext, configure, eventType, otherParams)
|
|
|
98
98
|
if (eventType && eventType === "change") {
|
|
99
99
|
const subTableWatchProps = pageContext.subTableWatchProps;
|
|
100
100
|
if (subTableWatchProps) {
|
|
101
|
-
for (
|
|
101
|
+
for (const tableUuid in subTableWatchProps) {
|
|
102
102
|
const mainFormProps = subTableWatchProps[tableUuid];
|
|
103
103
|
const propName = (_b = (_a = configure.props) == null ? void 0 : _a.base) == null ? void 0 : _b.prop;
|
|
104
104
|
if (mainFormProps && mainFormProps.indexOf(propName) >= 0) {
|
|
105
|
-
eventBus.$emit(
|
|
106
|
-
"_refreshSubTable_" + tableUuid,
|
|
107
|
-
{ propName }
|
|
108
|
-
);
|
|
105
|
+
eventBus.$emit("_refreshSubTable_" + tableUuid, { propName });
|
|
109
106
|
}
|
|
110
107
|
}
|
|
111
108
|
}
|
|
@@ -267,7 +264,6 @@ function doValidateForm(pageContext, configure, eventParams) {
|
|
|
267
264
|
});
|
|
268
265
|
}
|
|
269
266
|
function doBeforeClickEvent(pageContext, configure, otherParams) {
|
|
270
|
-
let result = true;
|
|
271
267
|
const events = configure.runtime && configure.runtime.events ? configure.runtime.events : [];
|
|
272
268
|
const beforeClickFunc = getEventFuncByType(pageContext, events, "beforeClick");
|
|
273
269
|
let beforeClickResult;
|
|
@@ -275,9 +271,9 @@ function doBeforeClickEvent(pageContext, configure, otherParams) {
|
|
|
275
271
|
beforeClickResult = callItemEvent(pageContext, configure, beforeClickFunc, null, otherParams);
|
|
276
272
|
}
|
|
277
273
|
if (beforeClickResult === void 0) {
|
|
278
|
-
|
|
274
|
+
return true;
|
|
279
275
|
}
|
|
280
|
-
return
|
|
276
|
+
return beforeClickResult;
|
|
281
277
|
}
|
|
282
278
|
function doClickJumpPageEvent(pageContext, configure, eventParams) {
|
|
283
279
|
const myPageCode = pageContext.code;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { getBaseUrl, getRealRestApiPath, upperFirstCase, packageTemplateFiles, deepCopy, isArrayFn } from "../common-util.js";
|
|
1
|
+
import { getBaseUrl, getRealRestApiPath, upperFirstCase, isWorkflowPage, packageTemplateFiles, deepCopy, isArrayFn } from "../common-util.js";
|
|
2
2
|
import http from "agilebuilder-ui/src/utils/request";
|
|
3
3
|
import { getI18n } from "agilebuilder-ui/src/utils/util";
|
|
4
4
|
import { ElMessage, ElMessageBox } from "element-plus";
|
|
@@ -248,7 +248,7 @@ function exportFormReport(pageContext, configureObj, templateFile, isPdf) {
|
|
|
248
248
|
const fileName = templateFile.templateName;
|
|
249
249
|
const systemCode = pageContext.systemCode;
|
|
250
250
|
const logSetting = (_a = configureObj.props.base) == null ? void 0 : _a.logSetting;
|
|
251
|
-
const isWorkflowForm = pageContext
|
|
251
|
+
const isWorkflowForm = isWorkflowPage(pageContext);
|
|
252
252
|
const beanName = pageContext.beanName;
|
|
253
253
|
const button = configureObj.props.base;
|
|
254
254
|
const tableName = configureObj.tableName ? configureObj.tableName : pageContext.tableName;
|
|
@@ -389,7 +389,7 @@ function saveFunc(params, isListButton) {
|
|
|
389
389
|
}
|
|
390
390
|
function getCommonFormRequestParam(pageContext, configureObj, isUnControlVersion, mainDefaultValueColumns, dynamicColumnInfo, ids2, row) {
|
|
391
391
|
var _a;
|
|
392
|
-
const isWorkflow = pageContext
|
|
392
|
+
const isWorkflow = isWorkflowPage(pageContext);
|
|
393
393
|
const systemCode = pageContext.systemCode;
|
|
394
394
|
const isPermission = configureObj.props.base.isPermission === void 0 || configureObj.props.base.isPermission === "true" || configureObj.props.base.isPermission;
|
|
395
395
|
const functionCodes = getPermissionCodes(configureObj, pageContext);
|
|
@@ -442,7 +442,7 @@ function getCommonFormRequestParam(pageContext, configureObj, isUnControlVersion
|
|
|
442
442
|
if (!param["systemCode"]) {
|
|
443
443
|
param["systemCode"] = systemCode;
|
|
444
444
|
}
|
|
445
|
-
const beanName =
|
|
445
|
+
const beanName = pageContext.beanName;
|
|
446
446
|
if (beanName) {
|
|
447
447
|
param["beanName"] = beanName;
|
|
448
448
|
}
|
|
@@ -789,7 +789,7 @@ function deleteFunc(params) {
|
|
|
789
789
|
let path = baseUrl + "/dsc/commons/" + tableName;
|
|
790
790
|
path = getRealRestApiPath(path, systemCode, backendUrl, pageContext.isTest);
|
|
791
791
|
const isPermission = configureBase.isPermission === void 0 || configureBase.isPermission === "true" || configureBase.isPermission;
|
|
792
|
-
const isWorkflow = pageContext
|
|
792
|
+
const isWorkflow = isWorkflowPage(pageContext);
|
|
793
793
|
const functionCodes = getPermissionCodes(configureObj, pageContext);
|
|
794
794
|
const param = {
|
|
795
795
|
ids: ids2,
|
|
@@ -952,7 +952,7 @@ function doImportFinally(params, fileObj) {
|
|
|
952
952
|
}
|
|
953
953
|
param.append("isAsync", isAsync + "");
|
|
954
954
|
param.append("pageCode", pageContext.code);
|
|
955
|
-
const isWorkflowEntity = pageContext
|
|
955
|
+
const isWorkflowEntity = isWorkflowPage(pageContext);
|
|
956
956
|
if (isWorkflowEntity !== null && isWorkflowEntity !== void 0) {
|
|
957
957
|
param.append("isWorkflowEntity", isWorkflowEntity + "");
|
|
958
958
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "super-page-runtime",
|
|
3
|
-
"version": "2.1.
|
|
3
|
+
"version": "2.1.21",
|
|
4
4
|
"description": "AgileBuilder super page runtime",
|
|
5
5
|
"license": "ISC",
|
|
6
6
|
"main": "dist/es/index.js",
|
|
@@ -48,7 +48,7 @@
|
|
|
48
48
|
"@vitejs/plugin-vue-jsx": "^3.1.0",
|
|
49
49
|
"@vue/eslint-config-prettier": "^8.0.0",
|
|
50
50
|
"@vue/test-utils": "^2.4.4",
|
|
51
|
-
"agilebuilder-ui": "1.0.
|
|
51
|
+
"agilebuilder-ui": "1.0.63",
|
|
52
52
|
"axios": "^1.6.8",
|
|
53
53
|
"cypress": "^13.6.6",
|
|
54
54
|
"element-plus": "^2.6.1",
|