super-page-runtime 2.0.81 → 2.0.85
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 +2 -1
- package/dist/es/components/runtime/utils/events/event-util.js +4 -0
- package/dist/es/components/runtime/utils/events/standard-event.js +4 -3
- package/dist/es/components/runtime/utils/events/validator-util.js +26 -6
- package/dist/es/components/runtime/utils/page-helper-util.js +2 -1
- package/dist/es/components/runtime/utils/page-init-util.js +13 -5
- package/dist/es/components/runtime/views/assemblys/data/table/main-table-runtime.vue.js +3 -1
- package/dist/es/components/runtime/views/assemblys/form/checkbox/checkbox-runtime.vue2.js +8 -1
- package/dist/es/components/runtime/views/assemblys/form/link/link-runtime.vue2.js +2 -2
- package/dist/es/components/runtime/views/assemblys/form/placeholder/placeholder-runtime.vue.js +1 -1
- package/dist/es/components/runtime/views/assemblys/form/placeholder/placeholder-runtime.vue3.js +1 -0
- package/dist/es/components/runtime/views/assemblys/form/radio/radio-runtime.vue2.js +5 -1
- package/dist/es/components/runtime/views/assemblys/form/select/select-runtime.vue2.js +5 -1
- package/dist/es/components/runtime/views/assemblys/form/switch/switch-runtime.vue2.js +20 -10
- package/dist/es/components/runtime/views/super-page.vue.js +2 -1
- package/package.json +2 -2
|
@@ -208,6 +208,10 @@ function buttonClickEvent(pageContext, configure, eventParams) {
|
|
|
208
208
|
function doValidateForm(pageContext, configure, eventParams) {
|
|
209
209
|
const events = configure.runtime && configure.runtime.events ? configure.runtime.events : [];
|
|
210
210
|
let isEnableRequired = true;
|
|
211
|
+
console.log("doValidateForm---eventParams=", eventParams);
|
|
212
|
+
if (eventParams == null ? void 0 : eventParams.skipValidate) {
|
|
213
|
+
isEnableRequired = false;
|
|
214
|
+
}
|
|
211
215
|
const clickEventFunObj = getClickEventFuncByType(pageContext, events, "click");
|
|
212
216
|
if (clickEventFunObj) {
|
|
213
217
|
const isStandardEvent = clickEventFunObj.isStandard;
|
|
@@ -251,7 +251,7 @@ function exportFormReport(pageContext, configureObj, templateFile, isPdf) {
|
|
|
251
251
|
const isWorkflowForm = pageContext.workflowCode ? true : false;
|
|
252
252
|
const beanName = pageContext.beanName;
|
|
253
253
|
const button = configureObj.props.base;
|
|
254
|
-
const tableName = configureObj.tableName;
|
|
254
|
+
const tableName = configureObj.tableName ? configureObj.tableName : pageContext.tableName;
|
|
255
255
|
const backendUrl = pageContext.backendUrl;
|
|
256
256
|
const viewModels = pageContext.entity.data;
|
|
257
257
|
const isPermission = button.isPermission === void 0 || button.isPermission === "true" || button.isPermission;
|
|
@@ -783,7 +783,7 @@ function deleteFunc(params) {
|
|
|
783
783
|
const configureBase = configureObj.props.base;
|
|
784
784
|
const systemCode = pageContext.systemCode;
|
|
785
785
|
const backendUrl = pageContext.backendUrl;
|
|
786
|
-
const tableUuid = configureObj.props.base.tableUuid;
|
|
786
|
+
const tableUuid = configureObj.props.base.tableUuid ? configureObj.props.base.tableUuid : params.tableUuid;
|
|
787
787
|
const tableName = getTableNameByTableUuid(pageContext, tableUuid);
|
|
788
788
|
const baseUrl = getBaseUrl(backendUrl, pageContext.isTest);
|
|
789
789
|
let path = baseUrl + "/dsc/commons/" + tableName;
|
|
@@ -914,8 +914,9 @@ function doImportFinally(params, fileObj) {
|
|
|
914
914
|
const pageContext = params.pageContext;
|
|
915
915
|
const buttonConfigureObj = params.configureObj;
|
|
916
916
|
const tableConfigure = params.tableConfigure;
|
|
917
|
-
const tableName = pageContext.tableName;
|
|
918
917
|
const buttonConfigureBase = buttonConfigureObj.props.base;
|
|
918
|
+
const tableUuid = buttonConfigureObj.props.base.tableUuid ? buttonConfigureObj.props.base.tableUuid : params.tableUuid;
|
|
919
|
+
const tableName = getTableNameByTableUuid(pageContext, tableUuid);
|
|
919
920
|
const param = new FormData();
|
|
920
921
|
param.append("multipartFile", fileObj);
|
|
921
922
|
if (tableName) {
|
|
@@ -75,10 +75,25 @@ function getEndObjectRule(rule, props, currentProp) {
|
|
|
75
75
|
}
|
|
76
76
|
function getValidator(columns) {
|
|
77
77
|
const rules = {};
|
|
78
|
+
if (columns) {
|
|
79
|
+
columns.forEach((editField) => {
|
|
80
|
+
const prop = editField.model;
|
|
81
|
+
if (prop && editField.validations) {
|
|
82
|
+
const validations = editField.validations;
|
|
83
|
+
if (prop.indexOf(".") > 0) {
|
|
84
|
+
setObjectPropRule(editField.prop, rules, validations);
|
|
85
|
+
} else {
|
|
86
|
+
if (validations && validations.length > 0) {
|
|
87
|
+
rules[prop] = [...validations];
|
|
88
|
+
}
|
|
89
|
+
}
|
|
90
|
+
}
|
|
91
|
+
});
|
|
92
|
+
}
|
|
78
93
|
return rules;
|
|
79
94
|
}
|
|
80
95
|
function validator(entity, rules, columns, rowIndex, isSql) {
|
|
81
|
-
return validatorEntity(entity, rules, columns, rowIndex, true);
|
|
96
|
+
return validatorEntity(entity, rules, columns, rowIndex, true, isSql);
|
|
82
97
|
}
|
|
83
98
|
function sublistVerify(rules) {
|
|
84
99
|
if (!rules) {
|
|
@@ -104,7 +119,7 @@ function sublistVerify(rules) {
|
|
|
104
119
|
function validatorEntity(entity, rules, columns, rowIndex, isShouldRepeateValdate, isSql) {
|
|
105
120
|
let validateRules = sublistVerify(rules);
|
|
106
121
|
if ((!rules || rules === null) && columns) {
|
|
107
|
-
validateRules = getValidator();
|
|
122
|
+
validateRules = getValidator(columns);
|
|
108
123
|
}
|
|
109
124
|
if (!validateRules || Object.keys(validateRules).length === 0) {
|
|
110
125
|
entity["validateErrorField"] = "";
|
|
@@ -122,6 +137,11 @@ function validatorEntity(entity, rules, columns, rowIndex, isShouldRepeateValdat
|
|
|
122
137
|
if (errors) {
|
|
123
138
|
result = errors[0].message;
|
|
124
139
|
fieldName = errors[0]["field"];
|
|
140
|
+
if (typeof rowIndex !== "undefined" && rowIndex !== null) {
|
|
141
|
+
result = getI18n().t("superPageRuntimeMessage.recordLine", {
|
|
142
|
+
row: rowIndex + 1
|
|
143
|
+
}) + "," + result;
|
|
144
|
+
}
|
|
125
145
|
ElMessage({
|
|
126
146
|
message: result,
|
|
127
147
|
showClose: true,
|
|
@@ -134,11 +154,11 @@ function validatorEntity(entity, rules, columns, rowIndex, isShouldRepeateValdat
|
|
|
134
154
|
}
|
|
135
155
|
if (fieldName && isShouldRepeateValdate === true) {
|
|
136
156
|
const reg1 = /[A-Z]+/;
|
|
137
|
-
if (reg1.test(fieldName) && entity[fieldName.toLowerCase()] !== void 0) {
|
|
157
|
+
if (isSql !== void 0 && isSql === true && reg1.test(fieldName) && entity[fieldName.toLowerCase()] !== void 0) {
|
|
138
158
|
const copyEntity = JSON.parse(JSON.stringify(entity));
|
|
139
159
|
copyEntity[fieldName.toUpperCase()] = entity[fieldName.toLowerCase()];
|
|
140
160
|
delete copyEntity[fieldName.toLowerCase()];
|
|
141
|
-
result = validatorEntity(copyEntity, rules, columns, rowIndex, false);
|
|
161
|
+
result = validatorEntity(copyEntity, rules, columns, rowIndex, false, isSql);
|
|
142
162
|
}
|
|
143
163
|
}
|
|
144
164
|
}
|
|
@@ -186,7 +206,7 @@ function validateWorkflowFormDataModel(dataModel, pageContext) {
|
|
|
186
206
|
if (!rules || Object.keys(rules).length === 0) {
|
|
187
207
|
result = true;
|
|
188
208
|
} else {
|
|
189
|
-
result = validator(handleModels, rules, null, null);
|
|
209
|
+
result = validator(handleModels, rules, null, null, true);
|
|
190
210
|
}
|
|
191
211
|
if (result === true) {
|
|
192
212
|
const workflowFieldPermissionRules = pageContext.workflowRules;
|
|
@@ -250,7 +270,7 @@ function validateCommonFormDataModel(dataModel, pageContext, rules) {
|
|
|
250
270
|
if (!rules || Object.keys(rules).length === 0) {
|
|
251
271
|
resolve(handleModels);
|
|
252
272
|
} else {
|
|
253
|
-
const validateEntityResult = validator(handleModels, rules, null, null);
|
|
273
|
+
const validateEntityResult = validator(handleModels, rules, null, null, true);
|
|
254
274
|
if (validateEntityResult === true) {
|
|
255
275
|
const validateResult = validateSubTables(pageContext);
|
|
256
276
|
if (validateResult === true) {
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import http from "agilebuilder-ui/src/utils/request";
|
|
2
|
-
import "vue-router";
|
|
3
2
|
import { getAdditionalParamMap } from "./events/standard-event.js";
|
|
4
3
|
import { PageDimensions } from "./interfaces/page-design-types.js";
|
|
5
4
|
import { setVariableValue, formatVariableValue, getFormPropName } from "./page-helper-util.js";
|
|
@@ -117,7 +116,8 @@ function getRequestObject(pageRequest) {
|
|
|
117
116
|
requestObj[paramStrs[0]] = paramStrs.length > 1 ? paramStrs[1] : "";
|
|
118
117
|
}
|
|
119
118
|
}
|
|
120
|
-
if (requestObj["_t_"])
|
|
119
|
+
if (requestObj["_t_"])
|
|
120
|
+
;
|
|
121
121
|
return requestObj;
|
|
122
122
|
}
|
|
123
123
|
function packageAdditionalMapWithRoute(route, requestObj) {
|
|
@@ -187,7 +187,7 @@ function getFormModelFields(pageContext, formItemConfigure, prop) {
|
|
|
187
187
|
multiple = propsBase.multiple;
|
|
188
188
|
}
|
|
189
189
|
const defaultValueSet = propsBase ? propsBase.defaultValue : null;
|
|
190
|
-
|
|
190
|
+
const defaultValue = getDefaultValue(pageContext, defaultValueSet, componentType, multiple);
|
|
191
191
|
if (defaultValue !== void 0 && defaultValue !== null) {
|
|
192
192
|
setVariableValue(entity, fields, defaultValue);
|
|
193
193
|
}
|
|
@@ -311,12 +311,20 @@ function packageFormRules(pageContext, configure) {
|
|
|
311
311
|
}
|
|
312
312
|
function controlObjectRenderState(pageContext, propName) {
|
|
313
313
|
if (pageContext.initInfo) {
|
|
314
|
-
const types = [
|
|
314
|
+
const types = [
|
|
315
|
+
"dynamicControlFormEdit",
|
|
316
|
+
"disableElement",
|
|
317
|
+
"enableElement",
|
|
318
|
+
"hideElement",
|
|
319
|
+
"showElement"
|
|
320
|
+
];
|
|
315
321
|
types.forEach((type) => {
|
|
316
322
|
const infos = pageContext.initInfo[type];
|
|
317
323
|
if (infos) {
|
|
318
324
|
if (type === "dynamicControlFormEdit") {
|
|
319
|
-
let settings = infos.filter(
|
|
325
|
+
let settings = infos.filter(
|
|
326
|
+
(item) => item.name === "_all_fields" || item.name === propName
|
|
327
|
+
);
|
|
320
328
|
if (settings && settings.length > 0) {
|
|
321
329
|
settings = settings.filter((item) => item.name === "_all_fields");
|
|
322
330
|
if (settings && settings.length > 0) {
|
|
@@ -543,7 +543,9 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
543
543
|
}
|
|
544
544
|
function recieveMessage(event) {
|
|
545
545
|
if (event.data === "close_open_win") {
|
|
546
|
-
gridRef.value
|
|
546
|
+
if (gridRef.value) {
|
|
547
|
+
gridRef.value.refresh();
|
|
548
|
+
}
|
|
547
549
|
}
|
|
548
550
|
}
|
|
549
551
|
function select(selection, row) {
|
|
@@ -14,9 +14,16 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
14
14
|
let dynamicFields = getFormModelFields(props.pageContext, props.configure);
|
|
15
15
|
const dynamicModelMethod = computed({
|
|
16
16
|
get() {
|
|
17
|
-
|
|
17
|
+
let val = getVariableValue(entity, dynamicFields);
|
|
18
|
+
if (val) {
|
|
19
|
+
val = val.split(",");
|
|
20
|
+
}
|
|
21
|
+
return val;
|
|
18
22
|
},
|
|
19
23
|
set(value) {
|
|
24
|
+
if (value && value.length > 0) {
|
|
25
|
+
value = value.join(",");
|
|
26
|
+
}
|
|
20
27
|
setVariableValue(entity, dynamicFields, value);
|
|
21
28
|
}
|
|
22
29
|
});
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { defineComponent, ref, computed, resolveComponent, openBlock, createBlock, normalizeClass, unref, normalizeStyle, withCtx, createElementBlock, toDisplayString, createCommentVNode, createVNode, createTextVNode } from "vue";
|
|
2
2
|
import { getFormModelFields } from "../../../../utils/page-init-util.js";
|
|
3
3
|
import { getVariableValue } from "../../../../utils/page-helper-util.js";
|
|
4
|
-
import {
|
|
4
|
+
import { handleEvent } from "../../../../utils/events/event-util.js";
|
|
5
5
|
const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
6
6
|
__name: "link-runtime",
|
|
7
7
|
props: {
|
|
@@ -61,7 +61,7 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
61
61
|
disabled: designProperty.value.state === "disabled",
|
|
62
62
|
type: designProperty.value.type,
|
|
63
63
|
underline: designProperty.value.underline,
|
|
64
|
-
onClick: _cache[0] || (_cache[0] = ($event) => unref(
|
|
64
|
+
onClick: _cache[0] || (_cache[0] = ($event) => unref(handleEvent)($event, _ctx.pageContext, _ctx.configure, "click", { skipValidate: true }))
|
|
65
65
|
}, {
|
|
66
66
|
default: withCtx(() => [
|
|
67
67
|
createTextVNode(toDisplayString(dynamicValue.value), 1)
|
package/dist/es/components/runtime/views/assemblys/form/placeholder/placeholder-runtime.vue.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import _sfc_main from "./placeholder-runtime.vue2.js";
|
|
2
|
-
|
|
2
|
+
import "./placeholder-runtime.vue3.js";
|
|
3
3
|
import _export_sfc from "../../../../../../_virtual/_plugin-vue_export-helper.js";
|
|
4
4
|
const placeholderRuntime = /* @__PURE__ */ _export_sfc(_sfc_main, [["__scopeId", "data-v-a0860ff0"]]);
|
|
5
5
|
export {
|
package/dist/es/components/runtime/views/assemblys/form/placeholder/placeholder-runtime.vue3.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
|
|
@@ -14,7 +14,11 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
14
14
|
let dynamicFields = getFormModelFields(props.pageContext, props.configure);
|
|
15
15
|
const dynamicModelMethod = computed({
|
|
16
16
|
get() {
|
|
17
|
-
|
|
17
|
+
let val = getVariableValue(entity, dynamicFields);
|
|
18
|
+
if (val !== void 0 && val !== null) {
|
|
19
|
+
val = val + "";
|
|
20
|
+
}
|
|
21
|
+
return val;
|
|
18
22
|
},
|
|
19
23
|
set(value) {
|
|
20
24
|
setVariableValue(entity, dynamicFields, value);
|
|
@@ -17,7 +17,11 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
17
17
|
let dynamicFields = getFormModelFields(props.pageContext, props.configure);
|
|
18
18
|
const dynamicModelMethod = computed({
|
|
19
19
|
get() {
|
|
20
|
-
|
|
20
|
+
let val = getVariableValue(entity, dynamicFields);
|
|
21
|
+
if (val !== void 0 && val !== null) {
|
|
22
|
+
val = val + "";
|
|
23
|
+
}
|
|
24
|
+
return val;
|
|
21
25
|
},
|
|
22
26
|
set(value) {
|
|
23
27
|
setVariableValue(entity, dynamicFields, value);
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { defineComponent,
|
|
1
|
+
import { defineComponent, ref, computed, resolveComponent, openBlock, createBlock, normalizeClass, unref, normalizeStyle, withCtx, createElementBlock, toDisplayString, createCommentVNode, createVNode } from "vue";
|
|
2
2
|
import { getFormModelFields } from "../../../../utils/page-init-util.js";
|
|
3
3
|
import { getVariableValue, setVariableValue } from "../../../../utils/page-helper-util.js";
|
|
4
4
|
import { handleFormEvent } from "../../../../utils/events/event-util.js";
|
|
@@ -12,20 +12,30 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
12
12
|
const props = __props;
|
|
13
13
|
const entity = props.pageContext.entity ? props.pageContext.entity : {};
|
|
14
14
|
let dynamicFields = getFormModelFields(props.pageContext, props.configure);
|
|
15
|
+
const runtimeInfo = props.configure.runtime ? props.configure.runtime : {};
|
|
16
|
+
const runtimeStyle = runtimeInfo.style;
|
|
17
|
+
const runtimeClass = runtimeInfo.class;
|
|
18
|
+
const headerStyle = runtimeInfo.headerStyle;
|
|
19
|
+
const designProperty = ref(runtimeInfo.props ? runtimeInfo.props : {});
|
|
20
|
+
if (designProperty.value.activeValue === void 0 || designProperty.value.activeValue === null) {
|
|
21
|
+
designProperty.value.activeValue = "1";
|
|
22
|
+
}
|
|
23
|
+
if (designProperty.value.inactiveValue === void 0 || designProperty.value.inactiveValue === null) {
|
|
24
|
+
designProperty.value.activeValue = "0";
|
|
25
|
+
}
|
|
26
|
+
const switchStyle = runtimeInfo.switchStyle;
|
|
15
27
|
const dynamicModelMethod = computed({
|
|
16
28
|
get() {
|
|
17
|
-
|
|
29
|
+
let val = getVariableValue(entity, dynamicFields);
|
|
30
|
+
if (val !== void 0 && val !== null) {
|
|
31
|
+
val = val = "";
|
|
32
|
+
}
|
|
33
|
+
return val;
|
|
18
34
|
},
|
|
19
35
|
set(value) {
|
|
20
36
|
setVariableValue(entity, dynamicFields, value);
|
|
21
37
|
}
|
|
22
38
|
});
|
|
23
|
-
const runtimeInfo = props.configure.runtime ? props.configure.runtime : {};
|
|
24
|
-
const runtimeStyle = runtimeInfo.style;
|
|
25
|
-
const runtimeClass = runtimeInfo.class;
|
|
26
|
-
const headerStyle = runtimeInfo.headerStyle;
|
|
27
|
-
const designProperty = ref(runtimeInfo.props ? runtimeInfo.props : {});
|
|
28
|
-
const switchStyle = runtimeInfo.switchStyle;
|
|
29
39
|
return (_ctx, _cache) => {
|
|
30
40
|
const _component_el_switch = resolveComponent("el-switch");
|
|
31
41
|
const _component_el_form_item = resolveComponent("el-form-item");
|
|
@@ -44,7 +54,7 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
44
54
|
default: withCtx(() => [
|
|
45
55
|
createVNode(_component_el_switch, {
|
|
46
56
|
disabled: designProperty.value.state === "disabled",
|
|
47
|
-
"active-value
|
|
57
|
+
"active-value": designProperty.value.activeValue,
|
|
48
58
|
"active-text": designProperty.value.activeText,
|
|
49
59
|
"inactive-value": designProperty.value.inactiveValue,
|
|
50
60
|
"inactive-text": designProperty.value.inactiveText,
|
|
@@ -54,7 +64,7 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
54
64
|
modelValue: dynamicModelMethod.value,
|
|
55
65
|
"onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => dynamicModelMethod.value = $event),
|
|
56
66
|
onChange: _cache[1] || (_cache[1] = ($event) => unref(handleFormEvent)($event, _ctx.pageContext, _ctx.configure, "change"))
|
|
57
|
-
}, null, 8, ["disabled", "active-value
|
|
67
|
+
}, null, 8, ["disabled", "active-value", "active-text", "inactive-value", "inactive-text", "width", "size", "style", "modelValue"])
|
|
58
68
|
]),
|
|
59
69
|
_: 1
|
|
60
70
|
}, 8, ["required", "class", "label-width", "style"]);
|
|
@@ -336,7 +336,8 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
336
336
|
if (!_selectFile_.value) {
|
|
337
337
|
return;
|
|
338
338
|
}
|
|
339
|
-
if (_selectFile_.value.value === "" || _selectFile_.value.value === null)
|
|
339
|
+
if (_selectFile_.value.value === "" || _selectFile_.value.value === null)
|
|
340
|
+
return;
|
|
340
341
|
const fileObj = _selectFile_.value.files[0];
|
|
341
342
|
if (fileObj) {
|
|
342
343
|
_selectFile_.value.value = null;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "super-page-runtime",
|
|
3
|
-
"version": "2.0.
|
|
3
|
+
"version": "2.0.85",
|
|
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.58",
|
|
52
52
|
"axios": "^1.6.8",
|
|
53
53
|
"cypress": "^13.6.6",
|
|
54
54
|
"element-plus": "^2.6.1",
|