super-page-runtime 2.1.22 → 2.1.23

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.
@@ -68,7 +68,7 @@ function getCommonFormData(pageContext, id) {
68
68
  param["taskId"] = taskId;
69
69
  }
70
70
  console.log("getCommonFormData---listCodesMap=", pageContext.listCodesMap);
71
- if (!pageContext.listCodesMap && pageContext.tableUuids) {
71
+ if ((!pageContext.listCodesMap || Object.keys(pageContext.listCodesMap).length === 0) && pageContext.tableUuids) {
72
72
  const listCodesMap = {};
73
73
  pageContext.tableUuids.forEach((tableUuid) => {
74
74
  const listCode = getListCode(pageCode, pageVersion, tableUuid);
@@ -292,7 +292,8 @@ function formatAdditionalParamMapIds(ids) {
292
292
  ids = ids.split(",");
293
293
  } else if (typeof ids === "number") {
294
294
  ids = [ids];
295
- } else ;
295
+ } else
296
+ ;
296
297
  }
297
298
  return ids;
298
299
  }
@@ -4,6 +4,7 @@ import eventBus from "../eventBus.js";
4
4
  import http from "agilebuilder-ui/src/utils/request";
5
5
  import { getAdditionalParamMap } from "../events/standard-event.js";
6
6
  import { i18nValidatePropRulesMessage } from "../events/validator-util.js";
7
+ import { getBaseUrl } from "../common-util.js";
7
8
  const functions = {
8
9
  /**
9
10
  * 展示页面中的某个组件元素
@@ -266,6 +267,18 @@ const functions = {
266
267
  } else {
267
268
  console.error("tableUUid is undefined");
268
269
  }
270
+ },
271
+ // 根据key获得serverConfig中配置的信息
272
+ getServerConfigValue(key) {
273
+ return window["$vueApp"].config.globalProperties[key];
274
+ },
275
+ // 获得当前系统的后端访问路径
276
+ getBackendUrl(pageContext) {
277
+ return getBaseUrl(pageContext.backendUrl, false);
278
+ },
279
+ // 获得平台后端访问路径
280
+ getPlateBackendUrl() {
281
+ return window["$vueApp"].config.globalProperties.baseAPI;
269
282
  }
270
283
  };
271
284
  function packageAllFeildsRules(pageContext, item) {
@@ -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) {
@@ -80,7 +80,8 @@ function getTableQueryInfo(dataOriginInfo, pageContext2) {
80
80
  }
81
81
  }
82
82
  }
83
- if (f.propValue) ;
83
+ if (f.propValue)
84
+ ;
84
85
  searchForm.push(tempObj);
85
86
  }
86
87
  infoObj.props.searchForm = searchForm;
@@ -138,7 +138,8 @@ function getRequestObject(pageRequest) {
138
138
  requestObj[paramStrs[0]] = paramStrs.length > 1 ? paramStrs[1] : "";
139
139
  }
140
140
  }
141
- if (requestObj["_t_"]) ;
141
+ if (requestObj["_t_"])
142
+ ;
142
143
  return requestObj;
143
144
  }
144
145
  function packageAdditionalMapWithRoute(route, requestObj) {
@@ -1,5 +1,5 @@
1
1
  import _sfc_main from "./placeholder-runtime.vue2.js";
2
- /* empty css */
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 {
@@ -349,7 +349,8 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
349
349
  if (!_selectFile_.value) {
350
350
  return;
351
351
  }
352
- if (_selectFile_.value.value === "" || _selectFile_.value.value === null) return;
352
+ if (_selectFile_.value.value === "" || _selectFile_.value.value === null)
353
+ return;
353
354
  const fileObj = _selectFile_.value.files[0];
354
355
  if (fileObj) {
355
356
  _selectFile_.value.value = null;
@@ -397,14 +398,20 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
397
398
  const additionalParamMap = getAdditionalParamMap(pageContext);
398
399
  let dataId = eventParams ? eventParams.id : null;
399
400
  let ids = eventParams ? eventParams.ids : null;
400
- const dataModel = pageContext.value.entity.data;
401
- const pageModel = pageContext.value.entity.page;
401
+ let selections = eventParams ? eventParams.selections : [];
402
+ console.log("getPopPageSetting---selections=", selections, "parentPageContext.value=", parentPageContext.value);
402
403
  let entity = {};
403
- if (pageModel) {
404
- Object.assign(entity, pageModel);
405
- }
406
- if (dataModel) {
407
- Object.assign(entity, dataModel);
404
+ if (selections && selections.length > 0) {
405
+ entity = selections[0];
406
+ } else {
407
+ const dataModel = parentPageContext.value.entity.data;
408
+ const pageModel = parentPageContext.value.entity.page;
409
+ if (pageModel) {
410
+ Object.assign(entity, pageModel);
411
+ }
412
+ if (dataModel) {
413
+ Object.assign(entity, dataModel);
414
+ }
408
415
  }
409
416
  jumpToPage(myJumpPageSetting, null, dataId, entity, additionalParamMap, ids).then(
410
417
  (openPageParams) => {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "super-page-runtime",
3
- "version": "2.1.22",
3
+ "version": "2.1.23",
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.63",
51
+ "agilebuilder-ui": "1.0.64",
52
52
  "axios": "^1.6.8",
53
53
  "cypress": "^13.6.6",
54
54
  "element-plus": "^2.6.1",