super-page-runtime 2.1.83 → 2.1.87
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/common-util.js +0 -1
- package/dist/es/components/runtime/utils/events/event-util.js +13 -0
- package/dist/es/components/runtime/utils/events/standard-event.js +32 -16
- package/dist/es/components/runtime/utils/page-helper-util.js +9 -6
- package/dist/es/components/runtime/utils/page-init-util.js +3 -19
- package/dist/es/components/runtime/views/assemblys/form/custom/custom-runtime.vue2.js +14 -13
- package/dist/es/components/runtime/views/assemblys/form/dept-tree/depttree-runtime.vue2.js +12 -15
- package/dist/es/components/runtime/views/assemblys/object-render.vue.js +30 -4
- package/package.json +2 -2
|
@@ -134,7 +134,6 @@ function isNumber(numStr) {
|
|
|
134
134
|
}
|
|
135
135
|
function isWorkflowPage(pageContext) {
|
|
136
136
|
const isWorkflow = pageContext.isWorkflowEntity ? true : pageContext.workflowCode ? true : false;
|
|
137
|
-
console.log("isWorkflowPage----isWorkflow=", isWorkflow, "pageContext.isWorkflowEntity=", pageContext.isWorkflowEntity, "pageContext.workflowCode=", pageContext.workflowCode);
|
|
138
137
|
return isWorkflow;
|
|
139
138
|
}
|
|
140
139
|
function refreshMobileDialogType(jumpPageSetting, isMobile) {
|
|
@@ -619,6 +619,19 @@ function setTableEvents(options, tableEvents, pageContext, configureObj) {
|
|
|
619
619
|
beforeRestoreValidate({ pageContext, configureObj }),
|
|
620
620
|
options["lineEditOptions"]
|
|
621
621
|
);
|
|
622
|
+
filterDataEvent(
|
|
623
|
+
"filterDataEvent",
|
|
624
|
+
getHandleEvent(null, pageContext, configureObj, "filter-data", {
|
|
625
|
+
pageContext,
|
|
626
|
+
configureObj
|
|
627
|
+
}),
|
|
628
|
+
options
|
|
629
|
+
);
|
|
630
|
+
}
|
|
631
|
+
}
|
|
632
|
+
function filterDataEvent(gridEventType, eventFunc, options) {
|
|
633
|
+
if (eventFunc) {
|
|
634
|
+
options[gridEventType] = eventFunc;
|
|
622
635
|
}
|
|
623
636
|
}
|
|
624
637
|
function addTableEvent(gridEventType, eventFunc, options) {
|
|
@@ -514,13 +514,9 @@ function getCommonFormRequestParam(pageContext, configureObj, isUnControlVersion
|
|
|
514
514
|
}
|
|
515
515
|
}
|
|
516
516
|
console.log("getCommonFormRequestParam--------configureObj----", configureObj);
|
|
517
|
-
const autoSetValueData = configureObj
|
|
517
|
+
const autoSetValueData = getButtonAutoSetValueData(configureObj);
|
|
518
518
|
if (autoSetValueData) {
|
|
519
|
-
|
|
520
|
-
param["autoSetValueData"] = JSON.stringify(autoSetValueData);
|
|
521
|
-
} else if (typeof autoSetValueData === "string") {
|
|
522
|
-
param["autoSetValueData"] = autoSetValueData;
|
|
523
|
-
}
|
|
519
|
+
param["autoSetValueData"] = autoSetValueData;
|
|
524
520
|
}
|
|
525
521
|
const logSetting = (_a = configureObj.props.base) == null ? void 0 : _a.logSetting;
|
|
526
522
|
if (logSetting) {
|
|
@@ -687,7 +683,11 @@ function closeDialog(pageContext, dataModel, isNeedValueMapping) {
|
|
|
687
683
|
}
|
|
688
684
|
}
|
|
689
685
|
function updateValuesWhenCloseDialog(parentPageContext, parentConfigureObj, sourceModel, sourceTableName) {
|
|
690
|
-
|
|
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
691
|
const targetTableName = parentPageContext.tableName;
|
|
692
692
|
console.log("update-value66-", sourceModel, sourceTableName);
|
|
693
693
|
updateWithPageValue(sourceModel, valueMappings, parentPageContext);
|
|
@@ -699,8 +699,7 @@ function updateValuesWhenCloseDialog(parentPageContext, parentConfigureObj, sour
|
|
|
699
699
|
});
|
|
700
700
|
}
|
|
701
701
|
function updateWithPageValue(sourceModel, valueMappings, parentPageContext) {
|
|
702
|
-
|
|
703
|
-
if (sourceModel && sourceModel !== null && entity && entity !== null && valueMappings) {
|
|
702
|
+
if (sourceModel && sourceModel !== null && valueMappings) {
|
|
704
703
|
let sourceEntity = sourceModel;
|
|
705
704
|
if (Array.isArray(sourceModel) && sourceModel.length > 0) {
|
|
706
705
|
sourceEntity = sourceModel[0];
|
|
@@ -733,7 +732,13 @@ function dealAfterWithList(pageContext, configureObj, row, successTip) {
|
|
|
733
732
|
console.error("tableUuid is empty");
|
|
734
733
|
}
|
|
735
734
|
} else if (successOperation === "closeWindow" || successOperation === "closeWindowAndRefresh") {
|
|
736
|
-
|
|
735
|
+
const pageData = deepCopy(pageContext.entity.page);
|
|
736
|
+
let dataModel = row;
|
|
737
|
+
if (!dataModel) {
|
|
738
|
+
dataModel = {};
|
|
739
|
+
}
|
|
740
|
+
Object.assign(pageData, dataModel);
|
|
741
|
+
closeDialog(pageContext, pageData, isNeedValueMapping);
|
|
737
742
|
}
|
|
738
743
|
if (successTip) {
|
|
739
744
|
ElMessage({
|
|
@@ -1041,6 +1046,10 @@ function doImportFinally(params, fileObj) {
|
|
|
1041
1046
|
if (judgeHeavyList) {
|
|
1042
1047
|
param.append("judgeHeavyList", JSON.stringify(judgeHeavyList));
|
|
1043
1048
|
}
|
|
1049
|
+
const autoSetValueData = getButtonAutoSetValueData(buttonConfigureObj);
|
|
1050
|
+
if (autoSetValueData) {
|
|
1051
|
+
param.append("autoSetValueData", autoSetValueData);
|
|
1052
|
+
}
|
|
1044
1053
|
const formNoRuleCode = pageContext.formNoRuleCode;
|
|
1045
1054
|
if (formNoRuleCode) {
|
|
1046
1055
|
param.append("formNoRuleCode", formNoRuleCode);
|
|
@@ -1227,13 +1236,9 @@ function getWorkflowSaveParams(params) {
|
|
|
1227
1236
|
}
|
|
1228
1237
|
}
|
|
1229
1238
|
console.log("getWorkflowSaveParams----configureObj=", configureObj);
|
|
1230
|
-
const autoSetValueData = configureObj
|
|
1239
|
+
const autoSetValueData = getButtonAutoSetValueData(configureObj);
|
|
1231
1240
|
if (autoSetValueData) {
|
|
1232
|
-
|
|
1233
|
-
param["autoSetValueData"] = JSON.stringify(autoSetValueData);
|
|
1234
|
-
} else if (typeof autoSetValueData === "string") {
|
|
1235
|
-
param["autoSetValueData"] = autoSetValueData;
|
|
1236
|
-
}
|
|
1241
|
+
param["autoSetValueData"] = autoSetValueData;
|
|
1237
1242
|
}
|
|
1238
1243
|
if (pageContext.beanName) {
|
|
1239
1244
|
param["beanName"] = pageContext.beanName;
|
|
@@ -2329,6 +2334,17 @@ function changeActionPermissionToMap(pageContext) {
|
|
|
2329
2334
|
}
|
|
2330
2335
|
pageContext.actionPermissionMap = actionPermissionMap;
|
|
2331
2336
|
}
|
|
2337
|
+
function getButtonAutoSetValueData(configureObj) {
|
|
2338
|
+
const autoSetValueData = configureObj.props.setValueList;
|
|
2339
|
+
if (autoSetValueData) {
|
|
2340
|
+
if (isArrayFn(autoSetValueData) && autoSetValueData.length > 0) {
|
|
2341
|
+
return JSON.stringify(autoSetValueData);
|
|
2342
|
+
} else if (typeof autoSetValueData === "string" && autoSetValueData !== "[]") {
|
|
2343
|
+
return autoSetValueData;
|
|
2344
|
+
}
|
|
2345
|
+
}
|
|
2346
|
+
return null;
|
|
2347
|
+
}
|
|
2332
2348
|
export {
|
|
2333
2349
|
dealAfterOperate,
|
|
2334
2350
|
dealCompleteTaskParam,
|
|
@@ -146,12 +146,15 @@ function updateChartDatasources(pageContext2, dataSourceConfs, appendParams, isI
|
|
|
146
146
|
const configure = componentRef.getConfigure();
|
|
147
147
|
const serviceInputs = (_a = configure == null ? void 0 : configure.props.dataOrigin) == null ? void 0 : _a.serviceInputs;
|
|
148
148
|
if (serviceInputs) {
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
149
|
+
const services = item.services;
|
|
150
|
+
if (services && services.length > 0) {
|
|
151
|
+
services[0].serviceInParams = {};
|
|
152
|
+
serviceInputs.forEach((inParam) => {
|
|
153
|
+
const paramName = inParam.name;
|
|
154
|
+
const paramValue = inParam.value;
|
|
155
|
+
services[0].serviceInParams[paramName] = getValueFromVariable(pageContext2.entity, paramValue);
|
|
156
|
+
});
|
|
157
|
+
}
|
|
155
158
|
}
|
|
156
159
|
}
|
|
157
160
|
});
|
|
@@ -175,9 +175,6 @@ function packageAdditionalMap(paramStoreId, requestObj) {
|
|
|
175
175
|
}
|
|
176
176
|
}
|
|
177
177
|
function getModelFields(formItemConfigure, prop) {
|
|
178
|
-
if (!formItemConfigure) {
|
|
179
|
-
return ["temp"];
|
|
180
|
-
}
|
|
181
178
|
let propsBase;
|
|
182
179
|
let propName = prop;
|
|
183
180
|
if (!prop) {
|
|
@@ -185,9 +182,9 @@ function getModelFields(formItemConfigure, prop) {
|
|
|
185
182
|
propName = propsBase.prop;
|
|
186
183
|
}
|
|
187
184
|
let fields = null;
|
|
188
|
-
if (prop) {
|
|
185
|
+
if (prop && !prop.startsWith("${")) {
|
|
189
186
|
fields = ["data", prop];
|
|
190
|
-
} else if (!propName || !propName.startsWith("${")) {
|
|
187
|
+
} else if (formItemConfigure && (!propName || !propName.startsWith("${"))) {
|
|
191
188
|
fields = ["page", formItemConfigure.uuid];
|
|
192
189
|
} else if (propName.startsWith("${")) {
|
|
193
190
|
propName = propName.substring(2, propName.length - 1);
|
|
@@ -292,15 +289,9 @@ function queryPageSuperGrids(pageDesign, pageContext, publishVersion) {
|
|
|
292
289
|
function packageFormRules(pageContext, configure) {
|
|
293
290
|
var _a, _b;
|
|
294
291
|
const prop = configure.props && configure.props.base ? configure.props.base.prop : null;
|
|
295
|
-
|
|
292
|
+
const isWorkflow = isWorkflowPage(pageContext);
|
|
296
293
|
let allFieldsDisabled = false;
|
|
297
294
|
if (isWorkflow) {
|
|
298
|
-
console.log(
|
|
299
|
-
"packageFormRules-----prop=",
|
|
300
|
-
prop,
|
|
301
|
-
"--pageContext.fieldPermissionMap=",
|
|
302
|
-
pageContext.fieldPermissionMap
|
|
303
|
-
);
|
|
304
295
|
if (configure.name !== "button-detail" && pageContext.fieldPermissionMap) {
|
|
305
296
|
const allFields = pageContext.fieldPermissionMap.get("all_fields");
|
|
306
297
|
if ((allFields == null ? void 0 : allFields["canEdit"]) === false && ((_a = configure.runtime) == null ? void 0 : _a.props)) {
|
|
@@ -325,7 +316,6 @@ function packageFormRules(pageContext, configure) {
|
|
|
325
316
|
}
|
|
326
317
|
if (!allFieldsDisabled && configure.name !== "button-detail" && pageContext.fieldPermissionMap) {
|
|
327
318
|
const propEditPermission = pageContext.fieldPermissionMap.get(propName);
|
|
328
|
-
console.log("packageFormRules-----prop=", prop, "--propEditPermission=", propEditPermission);
|
|
329
319
|
if (!configure.runtime.props) {
|
|
330
320
|
configure.runtime.props = {};
|
|
331
321
|
}
|
|
@@ -336,12 +326,6 @@ function packageFormRules(pageContext, configure) {
|
|
|
336
326
|
configure.runtime.props.state = "";
|
|
337
327
|
configure.runtime.props.required = true;
|
|
338
328
|
}
|
|
339
|
-
console.log(
|
|
340
|
-
"packageFormRules-----prop=",
|
|
341
|
-
prop,
|
|
342
|
-
"--configure.runtime.props=",
|
|
343
|
-
configure.runtime.props
|
|
344
|
-
);
|
|
345
329
|
} else {
|
|
346
330
|
configure.runtime.props.state = "";
|
|
347
331
|
}
|
|
@@ -23,7 +23,7 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
23
23
|
pageContext: {},
|
|
24
24
|
configure: {}
|
|
25
25
|
},
|
|
26
|
-
setup(__props) {
|
|
26
|
+
setup(__props, { expose: __expose }) {
|
|
27
27
|
const props = __props;
|
|
28
28
|
const entity = props.pageContext.entity ? props.pageContext.entity : {};
|
|
29
29
|
const dynamicFields = getFormModelFields(props.pageContext, props.configure);
|
|
@@ -104,19 +104,14 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
104
104
|
});
|
|
105
105
|
nextTick(() => {
|
|
106
106
|
const value = dynamicModelMethod.value;
|
|
107
|
-
handleAfterInitEvent(
|
|
107
|
+
handleAfterInitEvent(value, props.pageContext, props.configure, {
|
|
108
|
+
formItemRef: formItemRef.value,
|
|
109
|
+
componentRef: customRef.value,
|
|
110
|
+
titleRef: titleRef.value,
|
|
108
111
|
value,
|
|
109
|
-
props.pageContext,
|
|
110
|
-
props.
|
|
111
|
-
|
|
112
|
-
formItemRef: formItemRef.value,
|
|
113
|
-
componentRef: customRef.value,
|
|
114
|
-
titleRef: titleRef.value,
|
|
115
|
-
value,
|
|
116
|
-
entity: props.pageContext.entity.data,
|
|
117
|
-
pageData: props.pageContext.entity.page
|
|
118
|
-
}
|
|
119
|
-
);
|
|
112
|
+
entity: props.pageContext.entity.data,
|
|
113
|
+
pageData: props.pageContext.entity.page
|
|
114
|
+
});
|
|
120
115
|
});
|
|
121
116
|
});
|
|
122
117
|
function handleCustomEvent(eventType) {
|
|
@@ -126,6 +121,12 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
126
121
|
eventBus.$off(componentId.value + "-scanDone");
|
|
127
122
|
eventBus.$off(componentId.value + "-pickFileDone");
|
|
128
123
|
});
|
|
124
|
+
function getCustomRef() {
|
|
125
|
+
return customRef.value;
|
|
126
|
+
}
|
|
127
|
+
__expose({
|
|
128
|
+
getCustomRef
|
|
129
|
+
});
|
|
129
130
|
return (_ctx, _cache) => {
|
|
130
131
|
const _component_el_form_item = resolveComponent("el-form-item");
|
|
131
132
|
return designProperty.value.tittleShow ? (openBlock(), createBlock(_component_el_form_item, {
|
|
@@ -36,24 +36,21 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
36
36
|
onMounted(() => {
|
|
37
37
|
nextTick(() => {
|
|
38
38
|
const value = dataModel ? dataModel[fieldName] : null;
|
|
39
|
-
handleAfterInitEvent(
|
|
39
|
+
handleAfterInitEvent(value, props.pageContext, props.configure, {
|
|
40
|
+
formItemRef: formItemRef.value,
|
|
41
|
+
componentRef: componentRef.value,
|
|
42
|
+
titleRef: titleRef.value,
|
|
40
43
|
value,
|
|
41
|
-
props.pageContext,
|
|
42
|
-
props.
|
|
43
|
-
|
|
44
|
-
formItemRef: formItemRef.value,
|
|
45
|
-
componentRef: componentRef.value,
|
|
46
|
-
titleRef: titleRef.value,
|
|
47
|
-
value,
|
|
48
|
-
entity: props.pageContext.entity.data,
|
|
49
|
-
pageData: props.pageContext.entity.page
|
|
50
|
-
}
|
|
51
|
-
);
|
|
44
|
+
entity: props.pageContext.entity.data,
|
|
45
|
+
pageData: props.pageContext.entity.page
|
|
46
|
+
});
|
|
52
47
|
});
|
|
53
48
|
});
|
|
54
49
|
const autoSetFields = designProperty.value.autoSetFields ? designProperty.value.autoSetFields : [];
|
|
55
|
-
function changeValue(value) {
|
|
56
|
-
|
|
50
|
+
function changeValue(model, value) {
|
|
51
|
+
if (model === fieldName) {
|
|
52
|
+
handleFormEvent(value, props.pageContext, props.configure, "change");
|
|
53
|
+
}
|
|
57
54
|
}
|
|
58
55
|
function showTree() {
|
|
59
56
|
handleFormEvent(null, props.pageContext, props.configure, "click");
|
|
@@ -97,7 +94,7 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
97
94
|
fields: unref(autoSetFields),
|
|
98
95
|
size: designProperty.value.size,
|
|
99
96
|
separator: designProperty.value.separator,
|
|
100
|
-
|
|
97
|
+
onSetValue: changeValue,
|
|
101
98
|
onShowTree: showTree
|
|
102
99
|
}, null, 8, ["disabled", "multiple", "treeType", "value", "models", "fields", "size", "separator"])
|
|
103
100
|
]),
|
|
@@ -5,7 +5,7 @@ import { PageDimensions } from "../../utils/interfaces/page-design-types.js";
|
|
|
5
5
|
import { addComponentRef, addComponentRefByCode } from "../../utils/global-refs.js";
|
|
6
6
|
import { getPermissionCodes, packageFormRules, controlObjectRenderState } from "../../utils/page-init-util.js";
|
|
7
7
|
import { caculateShowCondition, getFormPropName, getSizeConfig } from "../../utils/page-helper-util.js";
|
|
8
|
-
import { getPropClassName, isNumber } from "../../utils/common-util.js";
|
|
8
|
+
import { isWorkflowPage, getPropClassName, isNumber } from "../../utils/common-util.js";
|
|
9
9
|
import { isShowComponent } from "../../utils/events/event-util.js";
|
|
10
10
|
const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
11
11
|
__name: "object-render",
|
|
@@ -26,6 +26,7 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
26
26
|
packageFormRules(props.pageContext, props.configure);
|
|
27
27
|
let handleShowFlag = ref(true);
|
|
28
28
|
let showFlag = ref(true);
|
|
29
|
+
let editFlag = ref("");
|
|
29
30
|
if (props.configure && props.configure.props) {
|
|
30
31
|
let showConditions = [];
|
|
31
32
|
if ((_a = props.configure.props.base) == null ? void 0 : _a.showConditions) {
|
|
@@ -60,9 +61,34 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
60
61
|
const runtime = props.configure.runtime ? props.configure.runtime : {};
|
|
61
62
|
const property = runtime.props ? runtime.props : {};
|
|
62
63
|
property.rawSate = property.state;
|
|
63
|
-
|
|
64
|
-
const
|
|
65
|
-
|
|
64
|
+
if (isWorkflowPage(props.pageContext) && props.pageContext.fieldPermissionMap) {
|
|
65
|
+
const allFields = props.pageContext.fieldPermissionMap.get("all_fields");
|
|
66
|
+
if ((allFields == null ? void 0 : allFields["canEdit"]) === false) {
|
|
67
|
+
editFlag.value = "disabled";
|
|
68
|
+
} else {
|
|
69
|
+
const propsBase = props.configure.props.base;
|
|
70
|
+
if (propsBase && propsBase.prop) {
|
|
71
|
+
let propName = propsBase.prop;
|
|
72
|
+
propName = getFormPropName(propName);
|
|
73
|
+
const propEditPermission = props.pageContext.fieldPermissionMap.get(propName);
|
|
74
|
+
if (propEditPermission) {
|
|
75
|
+
if (propEditPermission["canEdit"] === false) {
|
|
76
|
+
editFlag.value = "disabled";
|
|
77
|
+
}
|
|
78
|
+
}
|
|
79
|
+
}
|
|
80
|
+
}
|
|
81
|
+
}
|
|
82
|
+
property.state = computed({
|
|
83
|
+
get() {
|
|
84
|
+
if (editFlag.value === "disabled") {
|
|
85
|
+
return editFlag.value;
|
|
86
|
+
}
|
|
87
|
+
const canEdit = caculateShowCondition(props.pageContext, editConditions);
|
|
88
|
+
return canEdit ? "" : "disabled";
|
|
89
|
+
},
|
|
90
|
+
set() {
|
|
91
|
+
}
|
|
66
92
|
});
|
|
67
93
|
}
|
|
68
94
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "super-page-runtime",
|
|
3
|
-
"version": "2.1.
|
|
3
|
+
"version": "2.1.87",
|
|
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.98",
|
|
52
52
|
"axios": "^1.6.8",
|
|
53
53
|
"cypress": "^13.6.6",
|
|
54
54
|
"element-plus": "^2.6.1",
|