super-page-runtime 2.1.19 → 2.1.21

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.
@@ -1,6 +1,6 @@
1
1
  import { getSessionCache } from "agilebuilder-ui/src/utils/auth";
2
2
  import http from "agilebuilder-ui/src/utils/request";
3
- import { getBaseUrl, getListCode } from "../common-util.js";
3
+ import { isWorkflowPage, getBaseUrl, getListCode } from "../common-util.js";
4
4
  import { getAdditionalParamMap, dealCompleteTaskParam } from "../events/standard-event.js";
5
5
  import { packageCustomRules, getWorkflowRules } from "../events/validator-util.js";
6
6
  import { handleEvent } from "../events/event-util.js";
@@ -11,15 +11,11 @@ function refreshPage(pageContext, id) {
11
11
  });
12
12
  }
13
13
  function getFormData(pageContext, id) {
14
- var _a;
15
14
  const pageType = pageContext.pageType;
16
15
  if (pageType && pageType === "form") {
17
16
  console.log("获取表单数据getData--pageContext=", pageContext);
18
17
  pageContext.canClick = false;
19
- let isWorkflow = false;
20
- if ((_a = pageContext.props) == null ? void 0 : _a.activeWorkflow) {
21
- isWorkflow = pageContext.workflowCode ? true : false;
22
- }
18
+ const isWorkflow = isWorkflowPage(pageContext);
23
19
  if (isWorkflow) {
24
20
  return getWorkflowFormData(pageContext, id);
25
21
  } else {
@@ -204,7 +200,7 @@ function changePermissionListToMap(pageContext) {
204
200
  changeActionPermissionToMap(pageContext);
205
201
  }
206
202
  function changeFieldPermissionToMap(pageContext) {
207
- let fieldPermissionMap = /* @__PURE__ */ new Map();
203
+ const fieldPermissionMap = /* @__PURE__ */ new Map();
208
204
  const fieldPermissions = pageContext.fieldPermissions;
209
205
  if (typeof fieldPermissions !== "undefined") {
210
206
  for (let i = 0; i < fieldPermissions.length; i++) {
@@ -262,7 +258,7 @@ function changeFieldPermissionToMap(pageContext) {
262
258
  }
263
259
  function changeActionPermissionToMap(pageContext) {
264
260
  const fieldPermissionMap = pageContext.fieldPermissionMap;
265
- let actionPermissionMap = /* @__PURE__ */ new Map();
261
+ const actionPermissionMap = /* @__PURE__ */ new Map();
266
262
  const actionPermissions = pageContext.actionPermissions;
267
263
  if (typeof actionPermissions !== "undefined" && actionPermissions !== null) {
268
264
  const subModelNames = Object.keys(actionPermissions);
@@ -296,8 +292,7 @@ function formatAdditionalParamMapIds(ids) {
296
292
  ids = ids.split(",");
297
293
  } else if (typeof ids === "number") {
298
294
  ids = [ids];
299
- } else
300
- ;
295
+ } else ;
301
296
  }
302
297
  return ids;
303
298
  }
@@ -1,7 +1,7 @@
1
- import { Component } from './interfaces/page-design-types';
1
+ import { Component, PageContext } from './interfaces/page-design-types';
2
2
 
3
3
  export declare function isArrayFn(value: any): boolean;
4
- export declare function getBaseUrl(backendUrl: any, isTest?: boolean): any;
4
+ export declare function getBaseUrl(backendUrl: string | null | undefined, isTest?: boolean): any;
5
5
  export declare function getRealRestApiPath(orgRestApiPath: any, systemCode: any, backendUrl: any, isTest?: boolean): any;
6
6
  /**
7
7
  * 封装模板文件列表
@@ -24,3 +24,4 @@ export declare function getWorkflowId(pageContext: any): any;
24
24
  */
25
25
  export declare function getPropClassName(configure: Component): any;
26
26
  export declare function isNumber(numStr: any): boolean;
27
+ export declare function isWorkflowPage(pageContext: PageContext): boolean;
@@ -11,7 +11,11 @@ function getBaseUrl(backendUrl, isTest) {
11
11
  if (isTest) {
12
12
  return backendUrl;
13
13
  } else {
14
- let baseUrl = window["$vueApp"].config.globalProperties.baseURL;
14
+ const { baseURL, projectModel } = window["$vueApp"].config.globalProperties;
15
+ let baseUrl = baseURL;
16
+ if (projectModel === "developing.model") {
17
+ return baseUrl;
18
+ }
15
19
  if (backendUrl) {
16
20
  baseUrl = getSystemBackendUrl(backendUrl);
17
21
  }
@@ -128,6 +132,14 @@ function isNumber(numStr) {
128
132
  return false;
129
133
  }
130
134
  }
135
+ function isWorkflowPage(pageContext) {
136
+ var _a;
137
+ let isWorkflow = false;
138
+ if ((_a = pageContext.props) == null ? void 0 : _a.activeWorkflow) {
139
+ isWorkflow = pageContext.workflowCode ? true : false;
140
+ }
141
+ return isWorkflow;
142
+ }
131
143
  export {
132
144
  deepCopy,
133
145
  getBaseUrl,
@@ -137,6 +149,7 @@ export {
137
149
  getWorkflowId,
138
150
  isArrayFn,
139
151
  isNumber,
152
+ isWorkflowPage,
140
153
  packageTemplateFiles,
141
154
  upperFirstCase
142
155
  };
@@ -98,14 +98,11 @@ function handleFormEvent($event, pageContext, configure, eventType, otherParams)
98
98
  if (eventType && eventType === "change") {
99
99
  const subTableWatchProps = pageContext.subTableWatchProps;
100
100
  if (subTableWatchProps) {
101
- for (let tableUuid in subTableWatchProps) {
101
+ for (const tableUuid in subTableWatchProps) {
102
102
  const mainFormProps = subTableWatchProps[tableUuid];
103
103
  const propName = (_b = (_a = configure.props) == null ? void 0 : _a.base) == null ? void 0 : _b.prop;
104
104
  if (mainFormProps && mainFormProps.indexOf(propName) >= 0) {
105
- eventBus.$emit(
106
- "_refreshSubTable_" + tableUuid,
107
- { propName }
108
- );
105
+ eventBus.$emit("_refreshSubTable_" + tableUuid, { propName });
109
106
  }
110
107
  }
111
108
  }
@@ -267,7 +264,6 @@ function doValidateForm(pageContext, configure, eventParams) {
267
264
  });
268
265
  }
269
266
  function doBeforeClickEvent(pageContext, configure, otherParams) {
270
- let result = true;
271
267
  const events = configure.runtime && configure.runtime.events ? configure.runtime.events : [];
272
268
  const beforeClickFunc = getEventFuncByType(pageContext, events, "beforeClick");
273
269
  let beforeClickResult;
@@ -275,9 +271,9 @@ function doBeforeClickEvent(pageContext, configure, otherParams) {
275
271
  beforeClickResult = callItemEvent(pageContext, configure, beforeClickFunc, null, otherParams);
276
272
  }
277
273
  if (beforeClickResult === void 0) {
278
- result = true;
274
+ return true;
279
275
  }
280
- return result;
276
+ return beforeClickResult;
281
277
  }
282
278
  function doClickJumpPageEvent(pageContext, configure, eventParams) {
283
279
  const myPageCode = pageContext.code;
@@ -1,4 +1,4 @@
1
- import { getBaseUrl, getRealRestApiPath, upperFirstCase, packageTemplateFiles, deepCopy, isArrayFn } from "../common-util.js";
1
+ import { getBaseUrl, getRealRestApiPath, upperFirstCase, isWorkflowPage, packageTemplateFiles, deepCopy, isArrayFn } from "../common-util.js";
2
2
  import http from "agilebuilder-ui/src/utils/request";
3
3
  import { getI18n } from "agilebuilder-ui/src/utils/util";
4
4
  import { ElMessage, ElMessageBox } from "element-plus";
@@ -248,7 +248,7 @@ function exportFormReport(pageContext, configureObj, templateFile, isPdf) {
248
248
  const fileName = templateFile.templateName;
249
249
  const systemCode = pageContext.systemCode;
250
250
  const logSetting = (_a = configureObj.props.base) == null ? void 0 : _a.logSetting;
251
- const isWorkflowForm = pageContext.workflowCode ? true : false;
251
+ const isWorkflowForm = isWorkflowPage(pageContext);
252
252
  const beanName = pageContext.beanName;
253
253
  const button = configureObj.props.base;
254
254
  const tableName = configureObj.tableName ? configureObj.tableName : pageContext.tableName;
@@ -389,7 +389,7 @@ function saveFunc(params, isListButton) {
389
389
  }
390
390
  function getCommonFormRequestParam(pageContext, configureObj, isUnControlVersion, mainDefaultValueColumns, dynamicColumnInfo, ids2, row) {
391
391
  var _a;
392
- const isWorkflow = pageContext.workflowCode ? true : false;
392
+ const isWorkflow = isWorkflowPage(pageContext);
393
393
  const systemCode = pageContext.systemCode;
394
394
  const isPermission = configureObj.props.base.isPermission === void 0 || configureObj.props.base.isPermission === "true" || configureObj.props.base.isPermission;
395
395
  const functionCodes = getPermissionCodes(configureObj, pageContext);
@@ -442,7 +442,7 @@ function getCommonFormRequestParam(pageContext, configureObj, isUnControlVersion
442
442
  if (!param["systemCode"]) {
443
443
  param["systemCode"] = systemCode;
444
444
  }
445
- const beanName = configureObj.props.base.beanName;
445
+ const beanName = pageContext.beanName;
446
446
  if (beanName) {
447
447
  param["beanName"] = beanName;
448
448
  }
@@ -789,7 +789,7 @@ function deleteFunc(params) {
789
789
  let path = baseUrl + "/dsc/commons/" + tableName;
790
790
  path = getRealRestApiPath(path, systemCode, backendUrl, pageContext.isTest);
791
791
  const isPermission = configureBase.isPermission === void 0 || configureBase.isPermission === "true" || configureBase.isPermission;
792
- const isWorkflow = pageContext.workflowCode ? true : false;
792
+ const isWorkflow = isWorkflowPage(pageContext);
793
793
  const functionCodes = getPermissionCodes(configureObj, pageContext);
794
794
  const param = {
795
795
  ids: ids2,
@@ -952,7 +952,7 @@ function doImportFinally(params, fileObj) {
952
952
  }
953
953
  param.append("isAsync", isAsync + "");
954
954
  param.append("pageCode", pageContext.code);
955
- const isWorkflowEntity = pageContext.workflowCode ? true : false;
955
+ const isWorkflowEntity = isWorkflowPage(pageContext);
956
956
  if (isWorkflowEntity !== null && isWorkflowEntity !== void 0) {
957
957
  param.append("isWorkflowEntity", isWorkflowEntity + "");
958
958
  }
@@ -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) {
@@ -80,8 +80,7 @@ function getTableQueryInfo(dataOriginInfo, pageContext2) {
80
80
  }
81
81
  }
82
82
  }
83
- if (f.propValue)
84
- ;
83
+ if (f.propValue) ;
85
84
  searchForm.push(tempObj);
86
85
  }
87
86
  infoObj.props.searchForm = searchForm;
@@ -138,8 +138,7 @@ function getRequestObject(pageRequest) {
138
138
  requestObj[paramStrs[0]] = paramStrs.length > 1 ? paramStrs[1] : "";
139
139
  }
140
140
  }
141
- if (requestObj["_t_"])
142
- ;
141
+ if (requestObj["_t_"]) ;
143
142
  return requestObj;
144
143
  }
145
144
  function packageAdditionalMapWithRoute(route, requestObj) {
@@ -1,7 +1,7 @@
1
1
  import { defineComponent, ref, onMounted, watch, onUnmounted, resolveComponent, openBlock, createElementBlock, createVNode, unref } from "vue";
2
2
  import "agilebuilder-ui";
3
3
  import { setTableEvents, getEventFuncByType, canExecuteButton, doAfterClickEvent, getEventNameByType, doBeforeClickEvent, getHandleEvent, gridSelectRecord, gridSelectAllRecords, gridSelectionChange, cellClick, cellDblClick, rowClick, rowDblClick, headerClick } from "../../../../utils/events/event-util.js";
4
- import { getListCode, getRealRestApiPath } from "../../../../utils/common-util.js";
4
+ import { getBaseUrl, getListCode, getRealRestApiPath } from "../../../../utils/common-util.js";
5
5
  import { getAdditionalParamMap, getSaveFormRequestWithRow, standardEvents } from "../../../../utils/events/standard-event.js";
6
6
  import { isPromise } from "agilebuilder-ui/src/utils/common-util";
7
7
  import { getDataTypeMapRequest, popupToPage } from "../../../../utils/table-utils.js";
@@ -32,7 +32,7 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
32
32
  const systemCode = pageContext.systemCode;
33
33
  const backendUrl = pageContext.backendUrl;
34
34
  const tableName = configure.props && configure.props.dataOrigin && configure.props.dataOrigin.tableName;
35
- let baseURL = pageContext.backendUrl;
35
+ let baseURL = getBaseUrl(pageContext.backendUrl, pageContext.isTest);
36
36
  if (!baseURL) {
37
37
  baseURL = window["$vueApp"].config.globalProperties.baseURL;
38
38
  }
@@ -541,7 +541,14 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
541
541
  if (!gridRef.value) {
542
542
  return;
543
543
  }
544
- console.log("objectRender---configure.name=", props.configure.name, "props.configure=", props.configure, "runtimeStyle.value=", runtimeStyle);
544
+ console.log(
545
+ "objectRender---configure.name=",
546
+ props.configure.name,
547
+ "props.configure=",
548
+ props.configure,
549
+ "runtimeStyle.value=",
550
+ runtimeStyle
551
+ );
545
552
  const sizeConfig = getSizeConfig(props.pageContext, props.configure);
546
553
  if (sizeConfig && sizeConfig["isCalcHeight"]) {
547
554
  let thisRefDom = gridRef.value.$el;
@@ -553,7 +560,7 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
553
560
  return;
554
561
  }
555
562
  const rect = thisRefDom.getBoundingClientRect();
556
- return window.innerHeight - rect.y - 80;
563
+ return window.innerHeight - rect.y - 90;
557
564
  }
558
565
  }
559
566
  function customButtonClick(originalValue, formatValue, row, column, rowIndex, button) {
@@ -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 {
@@ -346,8 +346,7 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
346
346
  if (!_selectFile_.value) {
347
347
  return;
348
348
  }
349
- if (_selectFile_.value.value === "" || _selectFile_.value.value === null)
350
- return;
349
+ if (_selectFile_.value.value === "" || _selectFile_.value.value === null) return;
351
350
  const fileObj = _selectFile_.value.files[0];
352
351
  if (fileObj) {
353
352
  _selectFile_.value.value = null;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "super-page-runtime",
3
- "version": "2.1.19",
3
+ "version": "2.1.21",
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.62",
51
+ "agilebuilder-ui": "1.0.63",
52
52
  "axios": "^1.6.8",
53
53
  "cypress": "^13.6.6",
54
54
  "element-plus": "^2.6.1",