super-page-runtime 2.0.92 → 2.0.95
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/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 +2 -1
- 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/super-page.vue.js +2 -1
- package/package.json +2 -2
|
@@ -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) {
|
|
@@ -137,7 +137,8 @@ function getRequestObject(pageRequest) {
|
|
|
137
137
|
requestObj[paramStrs[0]] = paramStrs.length > 1 ? paramStrs[1] : "";
|
|
138
138
|
}
|
|
139
139
|
}
|
|
140
|
-
if (requestObj["_t_"])
|
|
140
|
+
if (requestObj["_t_"])
|
|
141
|
+
;
|
|
141
142
|
return requestObj;
|
|
142
143
|
}
|
|
143
144
|
function packageAdditionalMapWithRoute(route, requestObj) {
|
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
|
+
|
|
@@ -348,7 +348,8 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
348
348
|
if (!_selectFile_.value) {
|
|
349
349
|
return;
|
|
350
350
|
}
|
|
351
|
-
if (_selectFile_.value.value === "" || _selectFile_.value.value === null)
|
|
351
|
+
if (_selectFile_.value.value === "" || _selectFile_.value.value === null)
|
|
352
|
+
return;
|
|
352
353
|
const fileObj = _selectFile_.value.files[0];
|
|
353
354
|
if (fileObj) {
|
|
354
355
|
_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.95",
|
|
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.61",
|
|
52
52
|
"axios": "^1.6.8",
|
|
53
53
|
"cypress": "^13.6.6",
|
|
54
54
|
"element-plus": "^2.6.1",
|