super-page-runtime 2.0.80 → 2.0.81

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.
@@ -75,6 +75,9 @@ function getCommonFormData(pageContext, id) {
75
75
  });
76
76
  param["listCodes"] = listCodes;
77
77
  }
78
+ if (pageContext.refercePropMap) {
79
+ param["refercePropMap"] = pageContext.refercePropMap;
80
+ }
78
81
  const urlForView = backendUrl + "/dsc/commons/gets";
79
82
  http.post(urlForView, param).then((commonEntity) => {
80
83
  if (commonEntity) {
@@ -155,6 +158,9 @@ function getWorkflowFormData(pageContext, id) {
155
158
  if (pageContext.beanName) {
156
159
  param["beanName"] = pageContext.beanName;
157
160
  }
161
+ if (pageContext.refercePropMap) {
162
+ param["refercePropMap"] = pageContext.refercePropMap;
163
+ }
158
164
  const baseUrl = getBaseUrl(pageContext.backendUrl, pageContext.isTest);
159
165
  const urlForView = baseUrl + "/dsc/workflow-commons/gets";
160
166
  http.post(urlForView, param).then((commonEntity) => {
@@ -290,8 +296,7 @@ function formatAdditionalParamMapIds(ids) {
290
296
  ids = ids.split(",");
291
297
  } else if (typeof ids === "number") {
292
298
  ids = [ids];
293
- } else
294
- ;
299
+ } else ;
295
300
  }
296
301
  return ids;
297
302
  }
@@ -1,3 +1,5 @@
1
+ import { Component } from './interfaces/page-design-types';
2
+
1
3
  export declare function isArrayFn(value: any): boolean;
2
4
  export declare function getBaseUrl(backendUrl: any, isTest?: boolean): any;
3
5
  export declare function getRealRestApiPath(orgRestApiPath: any, systemCode: any, backendUrl: any, isTest?: boolean): any;
@@ -15,3 +17,9 @@ export declare function getListCode(pageCode: any, pageVersion: any, tableUuid:
15
17
  */
16
18
  export declare function deepCopy(srcObj: any): any;
17
19
  export declare function getWorkflowId(pageContext: any): any;
20
+ /**
21
+ * 获得当前属性名,封装到class中,操作dom时可能会使用
22
+ * @param configure
23
+ * @returns
24
+ */
25
+ export declare function getPropClassName(configure: Component): any;
@@ -96,10 +96,30 @@ function getWorkflowId(pageContext) {
96
96
  }
97
97
  return workflowId;
98
98
  }
99
+ function getPropClassName(configure) {
100
+ var _a, _b, _c, _d;
101
+ let propClassName;
102
+ if (configure && ((_b = (_a = configure.props) == null ? void 0 : _a.base) == null ? void 0 : _b.prop)) {
103
+ let prop = (_d = (_c = configure.props) == null ? void 0 : _c.base) == null ? void 0 : _d.prop;
104
+ if (prop.indexOf("${") >= 0) {
105
+ prop = prop.substring(2, prop.lastIndexOf("}"));
106
+ }
107
+ const props = prop.split(".");
108
+ if (props.length === 2) {
109
+ propClassName = props[1];
110
+ } else if (props.length === 3) {
111
+ propClassName = props[1] + "__" + props[2];
112
+ }
113
+ } else if (configure.code) {
114
+ propClassName = configure.code;
115
+ }
116
+ return propClassName;
117
+ }
99
118
  export {
100
119
  deepCopy,
101
120
  getBaseUrl,
102
121
  getListCode,
122
+ getPropClassName,
103
123
  getRealRestApiPath,
104
124
  getWorkflowId,
105
125
  isArrayFn,
@@ -765,6 +765,7 @@ function deleteFunc(params) {
765
765
  type: "warning",
766
766
  message: getI18n().t("superPageRuntimeMessage.pleaseSelectRecord")
767
767
  });
768
+ resolve(true);
768
769
  return;
769
770
  }
770
771
  ElMessageBox.confirm(
@@ -75,25 +75,10 @@ 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
- }
93
78
  return rules;
94
79
  }
95
80
  function validator(entity, rules, columns, rowIndex, isSql) {
96
- return validatorEntity(entity, rules, columns, rowIndex, true, isSql);
81
+ return validatorEntity(entity, rules, columns, rowIndex, true);
97
82
  }
98
83
  function sublistVerify(rules) {
99
84
  if (!rules) {
@@ -119,7 +104,7 @@ function sublistVerify(rules) {
119
104
  function validatorEntity(entity, rules, columns, rowIndex, isShouldRepeateValdate, isSql) {
120
105
  let validateRules = sublistVerify(rules);
121
106
  if ((!rules || rules === null) && columns) {
122
- validateRules = getValidator(columns);
107
+ validateRules = getValidator();
123
108
  }
124
109
  if (!validateRules || Object.keys(validateRules).length === 0) {
125
110
  entity["validateErrorField"] = "";
@@ -137,11 +122,6 @@ function validatorEntity(entity, rules, columns, rowIndex, isShouldRepeateValdat
137
122
  if (errors) {
138
123
  result = errors[0].message;
139
124
  fieldName = errors[0]["field"];
140
- if (typeof rowIndex !== "undefined" && rowIndex !== null) {
141
- result = getI18n().t("superPageRuntimeMessage.recordLine", {
142
- row: rowIndex + 1
143
- }) + "," + result;
144
- }
145
125
  ElMessage({
146
126
  message: result,
147
127
  showClose: true,
@@ -154,11 +134,11 @@ function validatorEntity(entity, rules, columns, rowIndex, isShouldRepeateValdat
154
134
  }
155
135
  if (fieldName && isShouldRepeateValdate === true) {
156
136
  const reg1 = /[A-Z]+/;
157
- if (isSql !== void 0 && isSql === true && reg1.test(fieldName) && entity[fieldName.toLowerCase()] !== void 0) {
137
+ if (reg1.test(fieldName) && entity[fieldName.toLowerCase()] !== void 0) {
158
138
  const copyEntity = JSON.parse(JSON.stringify(entity));
159
139
  copyEntity[fieldName.toUpperCase()] = entity[fieldName.toLowerCase()];
160
140
  delete copyEntity[fieldName.toLowerCase()];
161
- result = validatorEntity(copyEntity, rules, columns, rowIndex, false, isSql);
141
+ result = validatorEntity(copyEntity, rules, columns, rowIndex, false);
162
142
  }
163
143
  }
164
144
  }
@@ -206,7 +186,7 @@ function validateWorkflowFormDataModel(dataModel, pageContext) {
206
186
  if (!rules || Object.keys(rules).length === 0) {
207
187
  result = true;
208
188
  } else {
209
- result = validator(handleModels, rules, null, null, true);
189
+ result = validator(handleModels, rules, null, null);
210
190
  }
211
191
  if (result === true) {
212
192
  const workflowFieldPermissionRules = pageContext.workflowRules;
@@ -270,7 +250,7 @@ function validateCommonFormDataModel(dataModel, pageContext, rules) {
270
250
  if (!rules || Object.keys(rules).length === 0) {
271
251
  resolve(handleModels);
272
252
  } else {
273
- const validateEntityResult = validator(handleModels, rules, null, null, true);
253
+ const validateEntityResult = validator(handleModels, rules, null, null);
274
254
  if (validateEntityResult === true) {
275
255
  const validateResult = validateSubTables(pageContext);
276
256
  if (validateResult === true) {
@@ -136,6 +136,7 @@ export interface PageContext extends Component {
136
136
  searchFormData?: Array<object>;
137
137
  selectOptions?: object;
138
138
  chartDataSourceMap?: any;
139
+ refercePropMap?: object;
139
140
  [otherProp: string]: any;
140
141
  }
141
142
  /**
@@ -77,8 +77,7 @@ function getTableQueryInfo(dataOriginInfo, pageContext2) {
77
77
  }
78
78
  }
79
79
  }
80
- if (f.propValue)
81
- ;
80
+ if (f.propValue) ;
82
81
  searchForm.push(tempObj);
83
82
  }
84
83
  infoObj.props.searchForm = searchForm;
@@ -306,14 +305,13 @@ function setVariableValue(entity, fields, newValue) {
306
305
  let tempObj = entity;
307
306
  for (let i = 0; i < fields.length; i++) {
308
307
  const fieldName = fields[i];
309
- if (i + 1 == fields.length) {
308
+ if (i + 1 === fields.length) {
310
309
  tempObj[fieldName] = newValue;
311
310
  } else {
312
- tempObj = tempObj[fieldName];
313
- if (tempObj == void 0) {
311
+ if (tempObj[fieldName] === void 0) {
314
312
  tempObj[fieldName] = {};
315
- tempObj = tempObj[fieldName];
316
313
  }
314
+ tempObj = tempObj[fieldName];
317
315
  }
318
316
  }
319
317
  }
@@ -12,6 +12,7 @@ function queryPageDesignByCode(pageCode) {
12
12
  );
13
13
  }
14
14
  function convertToPageContext(pageDesign, pageRequest) {
15
+ var _a;
15
16
  if (pageDesign == null) {
16
17
  return null;
17
18
  }
@@ -46,6 +47,8 @@ function convertToPageContext(pageDesign, pageRequest) {
46
47
  // 列表分页信息,格式是:{列表编码: 每页显示多少条记录},表单页面中校验有分页的子表时提示使用,提示信息格式:第 {pageNum} 页第 {row} 行记录
47
48
  workflowCode: pageDesign.workflowCode,
48
49
  workflowVersion: pageDesign.workflowVersion,
50
+ refercePropMap: (_a = pageDesign.runtime) == null ? void 0 : _a.refercePropMap,
51
+ //当前表单页面中引用字段信息集合,get请求时需要使用,格式为{tableName:[字段名,.. ... ], tableName:[字段名,.. ... ]}
49
52
  entity: {
50
53
  data: {},
51
54
  task: {},
@@ -114,8 +117,7 @@ function getRequestObject(pageRequest) {
114
117
  requestObj[paramStrs[0]] = paramStrs.length > 1 ? paramStrs[1] : "";
115
118
  }
116
119
  }
117
- if (requestObj["_t_"])
118
- ;
120
+ if (requestObj["_t_"]) ;
119
121
  return requestObj;
120
122
  }
121
123
  function packageAdditionalMapWithRoute(route, requestObj) {
@@ -1,5 +1,5 @@
1
1
  import _sfc_main from "./placeholder-runtime.vue2.js";
2
- import "./placeholder-runtime.vue3.js";
2
+ /* empty css */
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 {
@@ -5,6 +5,7 @@ import { PageDimensions } from "../../utils/interfaces/page-design-types.js";
5
5
  import { addComponentRef, addComponentRefByCode } from "../../utils/global-refs.js";
6
6
  import { getPermissionCodes, packageFormRules, controlObjectRenderState } from "../../utils/page-init-util.js";
7
7
  import { caculateShowCondition, getFormPropName } from "../../utils/page-helper-util.js";
8
+ import { getPropClassName } from "../../utils/common-util.js";
8
9
  const _sfc_main = /* @__PURE__ */ defineComponent({
9
10
  __name: "object-render",
10
11
  props: {
@@ -12,6 +13,7 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
12
13
  configure: {}
13
14
  },
14
15
  setup(__props) {
16
+ var _a;
15
17
  const props = __props;
16
18
  if (props.configure.style == void 0) {
17
19
  props.configure.style = {};
@@ -24,17 +26,25 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
24
26
  let handleShowFlag = ref(true);
25
27
  let showFlag = ref(true);
26
28
  if (props.configure && props.configure.props) {
27
- if (props.configure.props.showConditions) {
28
- const showConditions = props.configure.props.showConditions;
29
- if (showConditions.length > 0) {
30
- showFlag = computed(() => {
31
- if (!handleShowFlag.value) {
32
- return false;
33
- }
34
- return caculateShowCondition(props.pageContext, props.configure, showConditions);
35
- });
29
+ let showConditions = [];
30
+ if ((_a = props.configure.props.base) == null ? void 0 : _a.showConditions) {
31
+ if (typeof props.configure.props.base.showConditions === "string") {
32
+ showConditions = JSON.parse(props.configure.props.base.showConditions);
33
+ } else {
34
+ showConditions = props.configure.props.base.showConditions;
36
35
  }
37
36
  }
37
+ showFlag = computed(() => {
38
+ var _a2;
39
+ if (!handleShowFlag.value) {
40
+ return false;
41
+ }
42
+ const state = (_a2 = props.configure.props.base) == null ? void 0 : _a2.state;
43
+ if (state && state === "hidden") {
44
+ return false;
45
+ }
46
+ return caculateShowCondition(props.pageContext, props.configure, showConditions);
47
+ });
38
48
  if (props.configure.props.editConditions) {
39
49
  const editConditions = props.configure.props.editConditions;
40
50
  if (editConditions.length > 0) {
@@ -58,9 +68,13 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
58
68
  const thisRef = ref(null);
59
69
  const runtimeStyle = ref({});
60
70
  const runtimeClass = ref("");
71
+ const propClassName = getPropClassName(props.configure);
72
+ if (propClassName) {
73
+ runtimeClass.value = propClassName;
74
+ }
61
75
  const commonRuntime = props.configure.runtime && props.configure.runtime.common ? props.configure.runtime.common : {};
62
76
  if (commonRuntime.class) {
63
- runtimeClass.value = commonRuntime.class;
77
+ runtimeClass.value += " " + commonRuntime.class;
64
78
  }
65
79
  if (commonRuntime.style) {
66
80
  Object.assign(runtimeStyle.value, commonRuntime.style);
@@ -19,6 +19,7 @@ import { useRoute, useRouter } from "vue-router";
19
19
  import { jumpToPage } from "agilebuilder-ui/src/utils/jump-page-utils";
20
20
  import { setSessionCache } from "agilebuilder-ui/src/utils/auth";
21
21
  import { deepCopy } from "../utils/common-util.js";
22
+ const _hoisted_1 = { class: "app-container" };
22
23
  const _sfc_main = /* @__PURE__ */ defineComponent({
23
24
  __name: "super-page",
24
25
  props: {
@@ -335,8 +336,7 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
335
336
  if (!_selectFile_.value) {
336
337
  return;
337
338
  }
338
- if (_selectFile_.value.value === "" || _selectFile_.value.value === null)
339
- return;
339
+ if (_selectFile_.value.value === "" || _selectFile_.value.value === null) return;
340
340
  const fileObj = _selectFile_.value.files[0];
341
341
  if (fileObj) {
342
342
  _selectFile_.value.value = null;
@@ -480,7 +480,7 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
480
480
  isShowDialog.value = false;
481
481
  }
482
482
  return (_ctx, _cache) => {
483
- return openBlock(), createElementBlock("div", null, [
483
+ return openBlock(), createElementBlock("div", _hoisted_1, [
484
484
  isShowPage.value ? (openBlock(), createElementBlock("div", {
485
485
  key: 0,
486
486
  ref_key: "thisRef",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "super-page-runtime",
3
- "version": "2.0.80",
3
+ "version": "2.0.81",
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.56",
51
+ "agilebuilder-ui": "1.0.57",
52
52
  "axios": "^1.6.8",
53
53
  "cypress": "^13.6.6",
54
54
  "element-plus": "^2.6.1",