super-page-runtime 2.0.53 → 2.0.57
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/events/standard-event.js +3 -2
- 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/utils/table-utils.d.ts +3 -0
- package/dist/es/components/runtime/utils/table-utils.js +12 -0
- package/dist/es/components/runtime/views/super-page.vue.js +2 -1
- package/package.json +2 -2
|
@@ -12,6 +12,7 @@ import { refreshPage } from "../api/api-util.js";
|
|
|
12
12
|
import { getPermissionCodes, getModelFields } from "../page-init-util.js";
|
|
13
13
|
import { updateChartDatasources, getVariableValue, setVariableValue } from "../page-helper-util.js";
|
|
14
14
|
import printLabelUtil from "./print-label.js";
|
|
15
|
+
import { getTableNameByTableUuid } from "../table-utils.js";
|
|
15
16
|
const standardEvents = {
|
|
16
17
|
// 表单标准事件保存save
|
|
17
18
|
save: function(params) {
|
|
@@ -750,10 +751,11 @@ function deleteFunc(params) {
|
|
|
750
751
|
).then(() => {
|
|
751
752
|
const pageContext = params.pageContext;
|
|
752
753
|
const configureObj = params.configureObj;
|
|
753
|
-
const tableName = pageContext.tableName;
|
|
754
754
|
const configureBase = configureObj.props.base;
|
|
755
755
|
const systemCode = pageContext.systemCode;
|
|
756
756
|
const backendUrl = pageContext.backendUrl;
|
|
757
|
+
let tableUuid = configureObj.props.base.tableUuid;
|
|
758
|
+
const tableName = getTableNameByTableUuid(pageContext, tableUuid);
|
|
757
759
|
const baseUrl = getBaseUrl(backendUrl, pageContext.isTest);
|
|
758
760
|
let path = baseUrl + "/dsc/commons/" + tableName;
|
|
759
761
|
path = getRealRestApiPath(path, systemCode, backendUrl, pageContext.isTest);
|
|
@@ -792,7 +794,6 @@ function deleteFunc(params) {
|
|
|
792
794
|
http.delete(path, {
|
|
793
795
|
data: param
|
|
794
796
|
}).then((data) => {
|
|
795
|
-
const tableUuid = configureObj.props.base.tableUuid;
|
|
796
797
|
const gridRef = getComponentRef(pageContext, tableUuid);
|
|
797
798
|
if (gridRef) {
|
|
798
799
|
gridRef.isDeleteChange(true);
|
|
@@ -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) {
|
|
@@ -10,7 +10,19 @@ function popupToPage(params) {
|
|
|
10
10
|
console.log("弹框显示页面--popupToPage====params=", params);
|
|
11
11
|
eventBus.$emit(pageCode + "_open-dialog", params);
|
|
12
12
|
}
|
|
13
|
+
function getTableNameByTableUuid(pageContext, tableUuid) {
|
|
14
|
+
let tableName = pageContext.tableName;
|
|
15
|
+
if (!tableUuid && tableName) {
|
|
16
|
+
return tableName;
|
|
17
|
+
}
|
|
18
|
+
let tableConfigure;
|
|
19
|
+
if (pageContext.tableRuntimes && tableUuid && pageContext.tableRuntimes[tableUuid]) {
|
|
20
|
+
tableConfigure = JSON.parse(pageContext.tableRuntimes[tableUuid].configure);
|
|
21
|
+
}
|
|
22
|
+
return tableConfigure && tableConfigure.props && tableConfigure.props.dataOrigin ? tableConfigure.props.dataOrigin.tableName : null;
|
|
23
|
+
}
|
|
13
24
|
export {
|
|
14
25
|
getDataTypeMapRequest,
|
|
26
|
+
getTableNameByTableUuid,
|
|
15
27
|
popupToPage
|
|
16
28
|
};
|
|
@@ -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.57",
|
|
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",
|