super-page-runtime 2.0.53 → 2.0.56
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.
|
@@ -74,10 +74,25 @@ function getEndObjectRule(rule, props, currentProp) {
|
|
|
74
74
|
}
|
|
75
75
|
function getValidator(columns) {
|
|
76
76
|
const rules = {};
|
|
77
|
+
if (columns) {
|
|
78
|
+
columns.forEach((editField) => {
|
|
79
|
+
const prop = editField.model;
|
|
80
|
+
if (prop && editField.validations) {
|
|
81
|
+
const validations = editField.validations;
|
|
82
|
+
if (prop.indexOf(".") > 0) {
|
|
83
|
+
setObjectPropRule(editField.prop, rules, validations);
|
|
84
|
+
} else {
|
|
85
|
+
if (validations && validations.length > 0) {
|
|
86
|
+
rules[prop] = [...validations];
|
|
87
|
+
}
|
|
88
|
+
}
|
|
89
|
+
}
|
|
90
|
+
});
|
|
91
|
+
}
|
|
77
92
|
return rules;
|
|
78
93
|
}
|
|
79
94
|
function validator(entity, rules, columns, rowIndex, isSql) {
|
|
80
|
-
return validatorEntity(entity, rules, columns, rowIndex, true);
|
|
95
|
+
return validatorEntity(entity, rules, columns, rowIndex, true, isSql);
|
|
81
96
|
}
|
|
82
97
|
function sublistVerify(rules) {
|
|
83
98
|
if (!rules) {
|
|
@@ -103,7 +118,7 @@ function sublistVerify(rules) {
|
|
|
103
118
|
function validatorEntity(entity, rules, columns, rowIndex, isShouldRepeateValdate, isSql) {
|
|
104
119
|
let validateRules = sublistVerify(rules);
|
|
105
120
|
if ((!rules || rules === null) && columns) {
|
|
106
|
-
validateRules = getValidator();
|
|
121
|
+
validateRules = getValidator(columns);
|
|
107
122
|
}
|
|
108
123
|
if (!validateRules || Object.keys(validateRules).length === 0) {
|
|
109
124
|
entity["validateErrorField"] = "";
|
|
@@ -121,6 +136,11 @@ function validatorEntity(entity, rules, columns, rowIndex, isShouldRepeateValdat
|
|
|
121
136
|
if (errors) {
|
|
122
137
|
result = errors[0].message;
|
|
123
138
|
fieldName = errors[0]["field"];
|
|
139
|
+
if (typeof rowIndex !== "undefined" && rowIndex !== null) {
|
|
140
|
+
result = getI18n().t("superPageRuntimeMessage.recordLine", {
|
|
141
|
+
row: rowIndex + 1
|
|
142
|
+
}) + "," + result;
|
|
143
|
+
}
|
|
124
144
|
ElMessage({
|
|
125
145
|
message: result,
|
|
126
146
|
showClose: true,
|
|
@@ -133,11 +153,11 @@ function validatorEntity(entity, rules, columns, rowIndex, isShouldRepeateValdat
|
|
|
133
153
|
}
|
|
134
154
|
if (fieldName && isShouldRepeateValdate === true) {
|
|
135
155
|
const reg1 = /[A-Z]+/;
|
|
136
|
-
if (reg1.test(fieldName) && entity[fieldName.toLowerCase()] !== void 0) {
|
|
156
|
+
if (isSql !== void 0 && isSql === true && reg1.test(fieldName) && entity[fieldName.toLowerCase()] !== void 0) {
|
|
137
157
|
const copyEntity = JSON.parse(JSON.stringify(entity));
|
|
138
158
|
copyEntity[fieldName.toUpperCase()] = entity[fieldName.toLowerCase()];
|
|
139
159
|
delete copyEntity[fieldName.toLowerCase()];
|
|
140
|
-
result = validatorEntity(copyEntity, rules, columns, rowIndex, false);
|
|
160
|
+
result = validatorEntity(copyEntity, rules, columns, rowIndex, false, isSql);
|
|
141
161
|
}
|
|
142
162
|
}
|
|
143
163
|
}
|
|
@@ -185,7 +205,7 @@ function validateWorkflowFormDataModel(dataModel, pageContext) {
|
|
|
185
205
|
if (!rules || Object.keys(rules).length === 0) {
|
|
186
206
|
result = true;
|
|
187
207
|
} else {
|
|
188
|
-
result = validator(handleModels, rules, null, null);
|
|
208
|
+
result = validator(handleModels, rules, null, null, true);
|
|
189
209
|
}
|
|
190
210
|
if (result === true) {
|
|
191
211
|
const workflowFieldPermissionRules = pageContext.workflowRules;
|
|
@@ -249,7 +269,7 @@ function validateCommonFormDataModel(dataModel, pageContext, rules) {
|
|
|
249
269
|
if (!rules || Object.keys(rules).length === 0) {
|
|
250
270
|
resolve(handleModels);
|
|
251
271
|
} else {
|
|
252
|
-
const validateEntityResult = validator(handleModels, rules, null, null);
|
|
272
|
+
const validateEntityResult = validator(handleModels, rules, null, null, true);
|
|
253
273
|
if (validateEntityResult === true) {
|
|
254
274
|
const validateResult = validateSubTables(pageContext);
|
|
255
275
|
if (validateResult === true) {
|
|
@@ -334,7 +334,8 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
334
334
|
if (!_selectFile_.value) {
|
|
335
335
|
return;
|
|
336
336
|
}
|
|
337
|
-
if (_selectFile_.value.value === "" || _selectFile_.value.value === null)
|
|
337
|
+
if (_selectFile_.value.value === "" || _selectFile_.value.value === null)
|
|
338
|
+
return;
|
|
338
339
|
const fileObj = _selectFile_.value.files[0];
|
|
339
340
|
if (fileObj) {
|
|
340
341
|
_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.56",
|
|
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.46",
|
|
52
52
|
"axios": "^1.6.8",
|
|
53
53
|
"cypress": "^13.6.6",
|
|
54
54
|
"element-plus": "^2.6.1",
|