super-page-runtime 2.1.17 → 2.1.20

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.
Files changed (19) hide show
  1. package/dist/es/components/runtime/utils/api/api-util.js +1 -2
  2. package/dist/es/components/runtime/utils/common-util.d.ts +1 -1
  3. package/dist/es/components/runtime/utils/common-util.js +5 -1
  4. package/dist/es/components/runtime/utils/events/validator-util.js +6 -26
  5. package/dist/es/components/runtime/utils/page-helper-util.d.ts +1 -0
  6. package/dist/es/components/runtime/utils/page-helper-util.js +20 -2
  7. package/dist/es/components/runtime/utils/page-init-util.js +25 -9
  8. package/dist/es/components/runtime/views/assemblys/container/form/form-runtime.vue2.js +32 -25
  9. package/dist/es/components/runtime/views/assemblys/data/table/main-table-runtime.vue.js +38 -2
  10. package/dist/es/components/runtime/views/assemblys/data/table/sub-table-runtime.vue.js +2 -13
  11. package/dist/es/components/runtime/views/assemblys/form/date-picker/datepicker-runtime.vue2.js +2 -0
  12. package/dist/es/components/runtime/views/assemblys/form/placeholder/placeholder-runtime.vue.js +1 -1
  13. package/dist/es/components/runtime/views/assemblys/form/select/select-runtime.vue2.js +4 -1
  14. package/dist/es/components/runtime/views/assemblys/object-render.vue.js +49 -9
  15. package/dist/es/components/runtime/views/assemblys/workflow/picture-flow/pictureflow-runtime.vue2.js +8 -1
  16. package/dist/es/components/runtime/views/assemblys/workflow/text-history/textflow-runtime.vue2.js +10 -3
  17. package/dist/es/components/runtime/views/super-page.vue.js +4 -7
  18. package/package.json +2 -2
  19. package/dist/es/components/runtime/views/assemblys/form/placeholder/placeholder-runtime.vue3.js +0 -1
@@ -296,8 +296,7 @@ function formatAdditionalParamMapIds(ids) {
296
296
  ids = ids.split(",");
297
297
  } else if (typeof ids === "number") {
298
298
  ids = [ids];
299
- } else
300
- ;
299
+ } else ;
301
300
  }
302
301
  return ids;
303
302
  }
@@ -1,7 +1,7 @@
1
1
  import { Component } 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
  * 封装模板文件列表
@@ -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
  }
@@ -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) {
@@ -138,3 +138,4 @@ export declare function caculateShowCondition(pageContext: PageContext, configur
138
138
  */
139
139
  export declare function monitorFieldChange(pageContext: PageContext, monitorFields: Array<string>, triggerFunc: Function): void;
140
140
  export declare function getFormPropName(prop: any): any;
141
+ export declare function getSizeConfig(pageContext: PageContext, configure: Component): any;
@@ -7,6 +7,9 @@ function getComponentOptionConfigs(component, pageContext2) {
7
7
  if (!component.props || !component.props.dataOrigin) {
8
8
  return;
9
9
  }
10
+ if (component.name && component.name === "table") {
11
+ return;
12
+ }
10
13
  const dataOriginInfo = component.props.dataOrigin;
11
14
  const infoObj = {
12
15
  uuid: component.uuid
@@ -77,8 +80,7 @@ function getTableQueryInfo(dataOriginInfo, pageContext2) {
77
80
  }
78
81
  }
79
82
  }
80
- if (f.propValue)
81
- ;
83
+ if (f.propValue) ;
82
84
  searchForm.push(tempObj);
83
85
  }
84
86
  infoObj.props.searchForm = searchForm;
@@ -614,6 +616,21 @@ function getFormPropName(prop) {
614
616
  return prop;
615
617
  }
616
618
  }
619
+ function getSizeConfig(pageContext2, configure2) {
620
+ const pageModeType = getPageModeType(pageContext2);
621
+ let sizeConfig;
622
+ if (configure2.props && configure2.props.size && configure2.props.size[pageModeType]) {
623
+ sizeConfig = configure2.props.size[pageModeType];
624
+ }
625
+ return sizeConfig;
626
+ }
627
+ function getPageModeType(pageContext2) {
628
+ let dimensions = pageContext2.dimensions;
629
+ if (!dimensions) {
630
+ dimensions = "pc";
631
+ }
632
+ return dimensions;
633
+ }
617
634
  export {
618
635
  autoSetAfterSelect,
619
636
  caculateShowCondition,
@@ -624,6 +641,7 @@ export {
624
641
  getFormPropName,
625
642
  getOptionDatasFromPage,
626
643
  getParamNames,
644
+ getSizeConfig,
627
645
  getValueFromSource,
628
646
  getValueFromVariable,
629
647
  getVariableValue,
@@ -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) {
@@ -282,15 +281,25 @@ function queryPageSuperGrids(pageDesign, pageContext, publishVersion) {
282
281
  );
283
282
  }
284
283
  function packageFormRules(pageContext, configure) {
285
- var _a, _b;
284
+ var _a, _b, _c;
286
285
  const prop = configure.props && configure.props.base ? configure.props.base.prop : null;
287
- const isWorkflow = pageContext.workflowCode ? true : false;
286
+ let isWorkflow = false;
287
+ if ((_a = pageContext.props) == null ? void 0 : _a.activeWorkflow) {
288
+ isWorkflow = pageContext.workflowCode ? true : false;
289
+ }
290
+ let allFieldsDisabled = false;
288
291
  if (isWorkflow) {
289
- console.log("packageFormRules-----prop=", prop, "--pageContext.fieldPermissionMap=", pageContext.fieldPermissionMap);
292
+ console.log(
293
+ "packageFormRules-----prop=",
294
+ prop,
295
+ "--pageContext.fieldPermissionMap=",
296
+ pageContext.fieldPermissionMap
297
+ );
290
298
  if (configure.name !== "button-detail" && pageContext.fieldPermissionMap) {
291
299
  const allFields = pageContext.fieldPermissionMap.get("all_fields");
292
- if ((allFields == null ? void 0 : allFields["canEdit"]) === false && ((_a = configure.runtime) == null ? void 0 : _a.props)) {
300
+ if ((allFields == null ? void 0 : allFields["canEdit"]) === false && ((_b = configure.runtime) == null ? void 0 : _b.props)) {
293
301
  configure.runtime.props.state = "disabled";
302
+ allFieldsDisabled = true;
294
303
  }
295
304
  }
296
305
  const requiredRules = configure.props && configure.props.rules ? configure.props.rules.filter((item) => item.required) : null;
@@ -311,7 +320,7 @@ function packageFormRules(pageContext, configure) {
311
320
  }
312
321
  pageContext.rules[propName] = configure.props.rules;
313
322
  }
314
- if (configure.name !== "button-detail" && pageContext.fieldPermissionMap) {
323
+ if (!allFieldsDisabled && configure.name !== "button-detail" && pageContext.fieldPermissionMap) {
315
324
  const propEditPermission = pageContext.fieldPermissionMap.get(propName);
316
325
  console.log("packageFormRules-----prop=", prop, "--propEditPermission=", propEditPermission);
317
326
  if (propEditPermission) {
@@ -321,10 +330,17 @@ function packageFormRules(pageContext, configure) {
321
330
  configure.runtime.props.state = "";
322
331
  configure.runtime.props.required = true;
323
332
  }
324
- console.log("packageFormRules-----prop=", prop, "--configure.runtime.props=", configure.runtime.props);
333
+ console.log(
334
+ "packageFormRules-----prop=",
335
+ prop,
336
+ "--configure.runtime.props=",
337
+ configure.runtime.props
338
+ );
339
+ } else {
340
+ configure.runtime.props.state = "";
325
341
  }
326
342
  }
327
- if ((_b = configure.props) == null ? void 0 : _b.customRuleEvents) {
343
+ if ((_c = configure.props) == null ? void 0 : _c.customRuleEvents) {
328
344
  if (!pageContext.customRuleEvents) {
329
345
  pageContext.customRuleEvents = [];
330
346
  }
@@ -1,6 +1,11 @@
1
- import { defineComponent, ref, resolveComponent, openBlock, createBlock, unref, normalizeStyle, normalizeClass, withCtx, createElementBlock, toDisplayString, createCommentVNode, Fragment, renderList } from "vue";
1
+ import { defineComponent, ref, resolveComponent, openBlock, createElementBlock, createVNode, unref, normalizeStyle, normalizeClass, withCtx, toDisplayString, createCommentVNode, Fragment, renderList, createBlock } from "vue";
2
2
  import _sfc_main$1 from "../../object-render.vue.js";
3
3
  import "../../../../utils/global-refs.js";
4
+ import "agilebuilder-ui/src/utils/common-util";
5
+ import "agilebuilder-ui/src/utils/util";
6
+ import "agilebuilder-ui/src/utils/request";
7
+ import "dayjs";
8
+ import "agilebuilder-ui/src/utils/calculator/calculator-util";
4
9
  const _sfc_main = /* @__PURE__ */ defineComponent({
5
10
  __name: "form-runtime",
6
11
  props: {
@@ -19,30 +24,32 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
19
24
  const titleStyle = ref(runtimeInfo.titleStyle ? runtimeInfo.titleStyle : {});
20
25
  return (_ctx, _cache) => {
21
26
  const _component_el_form = resolveComponent("el-form");
22
- return openBlock(), createBlock(_component_el_form, {
23
- ref: "thisRef",
24
- "label-width": unref(runtimeProps).labelWidth,
25
- "label-position": unref(runtimeProps).labelPosition,
26
- size: unref(runtimeProps).componentSize,
27
- style: normalizeStyle(runtimeStyle.value),
28
- class: normalizeClass(unref(runtimeClass))
29
- }, {
30
- default: withCtx(() => [
31
- unref(runtimeProps).formTitle ? (openBlock(), createElementBlock("div", {
32
- key: 0,
33
- class: "amb-widget-form-title",
34
- style: normalizeStyle(titleStyle.value)
35
- }, toDisplayString(unref(runtimeProps).formTitle), 5)) : createCommentVNode("", true),
36
- (openBlock(true), createElementBlock(Fragment, null, renderList(_ctx.configure.items, (element, itemIndex) => {
37
- return openBlock(), createBlock(_sfc_main$1, {
38
- key: element.uuid,
39
- pageContext: _ctx.pageContext,
40
- configure: element
41
- }, null, 8, ["pageContext", "configure"]);
42
- }), 128))
43
- ]),
44
- _: 1
45
- }, 8, ["label-width", "label-position", "size", "style", "class"]);
27
+ return openBlock(), createElementBlock("div", null, [
28
+ createVNode(_component_el_form, {
29
+ ref: "thisRef",
30
+ "label-width": unref(runtimeProps).labelWidth,
31
+ "label-position": unref(runtimeProps).labelPosition,
32
+ size: unref(runtimeProps).componentSize,
33
+ style: normalizeStyle(runtimeStyle.value),
34
+ class: normalizeClass(unref(runtimeClass))
35
+ }, {
36
+ default: withCtx(() => [
37
+ unref(runtimeProps).formTitle ? (openBlock(), createElementBlock("div", {
38
+ key: 0,
39
+ class: "amb-widget-form-title",
40
+ style: normalizeStyle(titleStyle.value)
41
+ }, toDisplayString(unref(runtimeProps).formTitle), 5)) : createCommentVNode("", true),
42
+ (openBlock(true), createElementBlock(Fragment, null, renderList(_ctx.configure.items, (element, itemIndex) => {
43
+ return openBlock(), createBlock(_sfc_main$1, {
44
+ key: element.uuid,
45
+ pageContext: _ctx.pageContext,
46
+ configure: element
47
+ }, null, 8, ["pageContext", "configure"]);
48
+ }), 128))
49
+ ]),
50
+ _: 1
51
+ }, 8, ["label-width", "label-position", "size", "style", "class"])
52
+ ]);
46
53
  };
47
54
  }
48
55
  });
@@ -1,12 +1,13 @@
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";
8
8
  import eventBus from "../../../../utils/eventBus.js";
9
9
  import { getPermissionCodes, getDefaultValue } from "../../../../utils/page-init-util.js";
10
+ import { getSizeConfig } from "../../../../utils/page-helper-util.js";
10
11
  const _sfc_main = /* @__PURE__ */ defineComponent({
11
12
  __name: "main-table-runtime",
12
13
  props: {
@@ -31,7 +32,7 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
31
32
  const systemCode = pageContext.systemCode;
32
33
  const backendUrl = pageContext.backendUrl;
33
34
  const tableName = configure.props && configure.props.dataOrigin && configure.props.dataOrigin.tableName;
34
- let baseURL = pageContext.backendUrl;
35
+ let baseURL = getBaseUrl(pageContext.backendUrl, pageContext.isTest);
35
36
  if (!baseURL) {
36
37
  baseURL = window["$vueApp"].config.globalProperties.baseURL;
37
38
  }
@@ -64,6 +65,7 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
64
65
  eventBus.$on(eventPageInfo + "_close-dialog-get-entity", () => {
65
66
  eventBus.$emit(eventPageInfo + "_close-super-dialog");
66
67
  });
68
+ listOptions.value["formSetMaxHeight"] = getComponentHeight();
67
69
  });
68
70
  watch(
69
71
  () => props.pageContext.searchFormData,
@@ -526,6 +528,40 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
526
528
  gridRef.value.toolbarRefresh(null, null, toolbarFieldParam);
527
529
  }
528
530
  function resizeListHeight(params) {
531
+ const contentHeight = getComponentHeight();
532
+ if (contentHeight) {
533
+ let searchHeight = 0;
534
+ if (params.searchHeight) {
535
+ searchHeight = params.searchHeight;
536
+ }
537
+ return contentHeight - 20 - searchHeight;
538
+ }
539
+ }
540
+ function getComponentHeight() {
541
+ if (!gridRef.value) {
542
+ return;
543
+ }
544
+ console.log(
545
+ "objectRender---configure.name=",
546
+ props.configure.name,
547
+ "props.configure=",
548
+ props.configure,
549
+ "runtimeStyle.value=",
550
+ runtimeStyle
551
+ );
552
+ const sizeConfig = getSizeConfig(props.pageContext, props.configure);
553
+ if (sizeConfig && sizeConfig["isCalcHeight"]) {
554
+ let thisRefDom = gridRef.value.$el;
555
+ if (!thisRefDom) {
556
+ thisRefDom = gridRef.value;
557
+ }
558
+ const parentNode = thisRefDom.parentNode;
559
+ if (!thisRefDom || !parentNode) {
560
+ return;
561
+ }
562
+ const rect = thisRefDom.getBoundingClientRect();
563
+ return window.innerHeight - rect.y - 90;
564
+ }
529
565
  }
530
566
  function customButtonClick(originalValue, formatValue, row, column, rowIndex, button) {
531
567
  const otherParams = {
@@ -1,6 +1,6 @@
1
1
  import { defineComponent, ref, onMounted, onUnmounted, resolveComponent, openBlock, createElementBlock, createBlock, unref, createCommentVNode } from "vue";
2
2
  import { setTableEvents, gridSelectRecord, gridSelectAllRecords, gridSelectionChange, cellClick, cellDblClick, rowClick, rowDblClick, headerClick } from "../../../../utils/events/event-util.js";
3
- import { getVariableValue, setVariableValue } from "../../../../utils/page-helper-util.js";
3
+ import { getSizeConfig, getVariableValue, setVariableValue } from "../../../../utils/page-helper-util.js";
4
4
  import { getModelFields, getDefaultValue } from "../../../../utils/page-init-util.js";
5
5
  import eventBus from "../../../../utils/eventBus.js";
6
6
  import { popupToPage } from "../../../../utils/table-utils.js";
@@ -119,11 +119,7 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
119
119
  listViewOptions.value["showOperationButton"] = configure.props && configure.props.base ? configure.props.base.showOperation : false;
120
120
  listViewOptions.value["isPdfEditor"] = false;
121
121
  listViewOptions.value["tableRecordMaxNum"] = configure.props && configure.props.otherSettings ? configure.props.otherSettings.tableRecordMaxNum : null;
122
- const pageModeType = getPageModeType();
123
- let sizeConfig;
124
- if (configure.props && configure.props.size && configure.props.size[pageModeType]) {
125
- sizeConfig = configure.props.size[pageModeType];
126
- }
122
+ let sizeConfig = getSizeConfig(pageContext, configure);
127
123
  if (sizeConfig && sizeConfig.fixHeight) {
128
124
  listViewOptions.value["formSetHeight"] = sizeConfig.fixHeight;
129
125
  }
@@ -131,13 +127,6 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
131
127
  listViewOptions.value["formSetMaxHeight"] = sizeConfig.maxHeight;
132
128
  }
133
129
  }
134
- function getPageModeType() {
135
- let dimensions = pageContext.dimensions;
136
- if (!dimensions) {
137
- dimensions = "pc";
138
- }
139
- return dimensions;
140
- }
141
130
  function judgeInitializationSubTable() {
142
131
  if (!configure.props || !configure.props.otherSettings) {
143
132
  return;
@@ -121,6 +121,7 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
121
121
  designProperty.value.dateType == "time" || designProperty.value.dateType == "timerange" ? (openBlock(), createBlock(_component_el_time_picker, {
122
122
  key: 0,
123
123
  "is-range": designProperty.value.dateType == "timerange",
124
+ style: { "width": "100%" },
124
125
  "range-separator": "-",
125
126
  clearable: designProperty.value.clearable,
126
127
  disabled: designProperty.value.state === "disabled",
@@ -144,6 +145,7 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
144
145
  }, null, 8, ["is-range", "clearable", "disabled", "readonly", "size", "placeholder", "start-placeholder", "end-placeholder", "format", "value-format", "modelValue", "shortcuts", "type"])) : (openBlock(), createBlock(_component_el_date_picker, {
145
146
  key: 1,
146
147
  clearable: designProperty.value.clearable,
148
+ style: { "width": "100%" },
147
149
  disabled: designProperty.value.state === "disabled",
148
150
  readonly: designProperty.value.state === "readonly",
149
151
  size: designProperty.value.size,
@@ -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 {
@@ -174,6 +174,7 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
174
174
  ]),
175
175
  default: withCtx(() => [
176
176
  createVNode(_component_el_select, {
177
+ style: { "width": "100%" },
177
178
  disabled: designProperty.value.state === "disabled",
178
179
  size: designProperty.value.size,
179
180
  clearable: designProperty.value.clearable,
@@ -197,7 +198,9 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
197
198
  key: item.value,
198
199
  label: item.label,
199
200
  value: item.value,
200
- onClick: ($event) => unref(handleFormEvent)(item.value, _ctx.pageContext, _ctx.configure, "click", { values: dynamicModelMethod.value })
201
+ onClick: ($event) => unref(handleFormEvent)(item.value, _ctx.pageContext, _ctx.configure, "click", {
202
+ values: dynamicModelMethod.value
203
+ })
201
204
  }, {
202
205
  default: withCtx(() => [
203
206
  item._description_ ? (openBlock(), createElementBlock(Fragment, { key: 0 }, [
@@ -1,11 +1,11 @@
1
- import { defineComponent, ref, computed, markRaw, onMounted, resolveDirective, withDirectives, openBlock, createBlock, resolveDynamicComponent, normalizeStyle, normalizeClass, vShow, unref } from "vue";
1
+ import { defineComponent, ref, computed, markRaw, onMounted, resolveDirective, withDirectives, openBlock, createBlock, resolveDynamicComponent, normalizeStyle, normalizeClass, vShow, unref, nextTick } from "vue";
2
2
  import _sfc_main$1 from "./error-render.vue.js";
3
3
  import { getRuntimeComponentByName } from "../../utils/assemblys-config.js";
4
4
  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
- import { caculateShowCondition, getFormPropName } from "../../utils/page-helper-util.js";
8
- import { getPropClassName } from "../../utils/common-util.js";
7
+ import { caculateShowCondition, getFormPropName, getSizeConfig } from "../../utils/page-helper-util.js";
8
+ import { getPropClassName, isNumber } from "../../utils/common-util.js";
9
9
  const _sfc_main = /* @__PURE__ */ defineComponent({
10
10
  __name: "object-render",
11
11
  props: {
@@ -129,19 +129,59 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
129
129
  propName = getFormPropName(propName);
130
130
  controlObjectRenderState(props.pageContext, propName);
131
131
  }
132
+ setComponentHeight();
132
133
  }
133
134
  onMounted(() => {
134
- if (!thisRef.value || !thisRef.value.parentNode) {
135
- return;
136
- }
137
135
  dynamicallyCalculatePosition();
138
136
  });
137
+ function setComponentHeight() {
138
+ if (!thisRef.value) {
139
+ return;
140
+ }
141
+ const sizeConfig = getSizeConfig(props.pageContext, props.configure);
142
+ if (props.configure.name !== "table" && sizeConfig && sizeConfig["isCalcHeight"]) {
143
+ nextTick(() => {
144
+ let thisRefDom = thisRef.value.$el;
145
+ if (!thisRefDom) {
146
+ thisRefDom = thisRef.value;
147
+ }
148
+ const parentNode = thisRefDom.parentNode;
149
+ if (!thisRefDom || !parentNode) {
150
+ return;
151
+ }
152
+ const rect = thisRefDom.getBoundingClientRect();
153
+ let contentHeight = window.innerHeight - rect.y - 80;
154
+ let heightStyle = contentHeight + "";
155
+ if (isNumber(contentHeight)) {
156
+ heightStyle = contentHeight + "px";
157
+ }
158
+ runtimeStyle.value["height"] = heightStyle;
159
+ runtimeStyle.value["overflow-y"] = "auto";
160
+ runtimeStyle.value["overflow-x"] = "hidden";
161
+ if (!props.configure.sytle) {
162
+ props.configure.sytle = {};
163
+ }
164
+ props.configure.sytle._heightStyle = heightStyle;
165
+ });
166
+ }
167
+ }
139
168
  const dynamicallyCalculatePosition = () => {
169
+ if (!thisRef.value) {
170
+ return;
171
+ }
172
+ let thisRefDom = thisRef.value.$el;
173
+ if (!thisRefDom) {
174
+ thisRefDom = thisRef.value;
175
+ }
176
+ const parentNode = thisRefDom.parentNode;
177
+ if (!thisRefDom || !parentNode) {
178
+ return;
179
+ }
140
180
  const thisProps = props.configure.props ? props.configure.props : {};
141
181
  const thisStyle = props.configure.style ? props.configure.style : {};
142
182
  const position = thisProps.position;
143
183
  if (position == "top" || position == "bottom") {
144
- const contentObj = [thisRef.value.parentNode];
184
+ const contentObj = [parentNode];
145
185
  if (contentObj && contentObj.length > 0) {
146
186
  const contentRec = contentObj[0].getBoundingClientRect();
147
187
  if (position == "top") {
@@ -151,13 +191,13 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
151
191
  runtimeStyle.value["bottom"] = "10px";
152
192
  }
153
193
  }
154
- const thisRec = thisRef.value.getBoundingClientRect();
194
+ const thisRec = thisRefDom.getBoundingClientRect();
155
195
  runtimeStyle.value["width"] = thisRec.width + "px";
156
196
  } else if (thisStyle.position) {
157
197
  runtimeStyle.value["position"] = thisStyle.position;
158
198
  if (runtimeStyle.value.position != "relative") {
159
199
  if (!runtimeStyle.value["width"]) {
160
- const thisRec = thisRef.value.getBoundingClientRect();
200
+ const thisRec = thisRefDom.getBoundingClientRect();
161
201
  runtimeStyle.value["width"] = thisRec.width + "px";
162
202
  }
163
203
  if (thisStyle.left) {
@@ -8,9 +8,16 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
8
8
  configure: {}
9
9
  },
10
10
  setup(__props) {
11
+ var _a;
11
12
  const props = __props;
12
13
  const maxHeight = ref(null);
13
- maxHeight.value = window.innerHeight - 120;
14
+ const heightStyle = (_a = props.configure.sytle) == null ? void 0 : _a._heightStyle;
15
+ if (heightStyle && (heightStyle + "").indexOf("px") > 0) {
16
+ const contentHeight = heightStyle.substring(0, heightStyle.lastIndexOf("px"));
17
+ maxHeight.value = Number(contentHeight) - 20;
18
+ } else {
19
+ maxHeight.value = window.innerHeight - 120;
20
+ }
14
21
  const historyGraphRef = ref(null);
15
22
  const workflowId = getWorkflowId(props.pageContext);
16
23
  if (props.pageContext.entity && props.pageContext.entity.task) {
@@ -8,16 +8,23 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
8
8
  configure: {}
9
9
  },
10
10
  setup(__props) {
11
+ var _a;
11
12
  const props = __props;
12
13
  const maxHeight = ref(null);
13
- maxHeight.value = window.innerHeight - 120;
14
+ const heightStyle = (_a = props.configure.sytle) == null ? void 0 : _a._heightStyle;
15
+ if (heightStyle && (heightStyle + "").indexOf("px") > 0) {
16
+ const contentHeight = heightStyle.substring(0, heightStyle.lastIndexOf("px"));
17
+ maxHeight.value = Number(contentHeight) - 20;
18
+ } else {
19
+ maxHeight.value = window.innerHeight - 120;
20
+ }
14
21
  const historyList = ref(null);
15
22
  const workflowId = getWorkflowId(props.pageContext);
16
23
  if (props.pageContext.entity && props.pageContext.entity.task) {
17
24
  watch(
18
25
  () => {
19
- var _a;
20
- return (_a = props.pageContext.entity.task) == null ? void 0 : _a.id;
26
+ var _a2;
27
+ return (_a2 = props.pageContext.entity.task) == null ? void 0 : _a2.id;
21
28
  },
22
29
  () => {
23
30
  if (workflowId && historyList.value && props.pageContext.entity.task) {
@@ -109,6 +109,7 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
109
109
  const buttonConfigure = ref(null);
110
110
  const buttonPageContext = ref(null);
111
111
  const route = useRoute();
112
+ const pageKey = ref(0);
112
113
  function initPageDesign(pageDesign) {
113
114
  const tempContext = convertToPageContext(pageDesign, props.pageRequest);
114
115
  tempContext.isTest = props.isTest;
@@ -202,10 +203,7 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
202
203
  () => pageContext.value.isRefresh,
203
204
  (newValue) => {
204
205
  if (newValue) {
205
- isShowPage.value = false;
206
- setTimeout(() => {
207
- isShowPage.value = true;
208
- }, 100);
206
+ pageKey.value++;
209
207
  pageContext.value.isRefresh = false;
210
208
  }
211
209
  }
@@ -348,8 +346,7 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
348
346
  if (!_selectFile_.value) {
349
347
  return;
350
348
  }
351
- if (_selectFile_.value.value === "" || _selectFile_.value.value === null)
352
- return;
349
+ if (_selectFile_.value.value === "" || _selectFile_.value.value === null) return;
353
350
  const fileObj = _selectFile_.value.files[0];
354
351
  if (fileObj) {
355
352
  _selectFile_.value.value = null;
@@ -495,9 +492,9 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
495
492
  return (_ctx, _cache) => {
496
493
  return openBlock(), createElementBlock("div", _hoisted_1, [
497
494
  isShowPage.value ? (openBlock(), createElementBlock("div", {
498
- key: 0,
499
495
  ref_key: "thisRef",
500
496
  ref: thisRef,
497
+ key: pageKey.value,
501
498
  class: normalizeClass(pageClass.value),
502
499
  style: normalizeStyle(pageStyle.value)
503
500
  }, [
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "super-page-runtime",
3
- "version": "2.1.17",
3
+ "version": "2.1.20",
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.61",
51
+ "agilebuilder-ui": "1.0.62",
52
52
  "axios": "^1.6.8",
53
53
  "cypress": "^13.6.6",
54
54
  "element-plus": "^2.6.1",