super-page-runtime 2.1.15 → 2.1.19

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.
@@ -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
@@ -614,6 +617,21 @@ function getFormPropName(prop) {
614
617
  return prop;
615
618
  }
616
619
  }
620
+ function getSizeConfig(pageContext2, configure2) {
621
+ const pageModeType = getPageModeType(pageContext2);
622
+ let sizeConfig;
623
+ if (configure2.props && configure2.props.size && configure2.props.size[pageModeType]) {
624
+ sizeConfig = configure2.props.size[pageModeType];
625
+ }
626
+ return sizeConfig;
627
+ }
628
+ function getPageModeType(pageContext2) {
629
+ let dimensions = pageContext2.dimensions;
630
+ if (!dimensions) {
631
+ dimensions = "pc";
632
+ }
633
+ return dimensions;
634
+ }
617
635
  export {
618
636
  autoSetAfterSelect,
619
637
  caculateShowCondition,
@@ -624,6 +642,7 @@ export {
624
642
  getFormPropName,
625
643
  getOptionDatasFromPage,
626
644
  getParamNames,
645
+ getSizeConfig,
627
646
  getValueFromSource,
628
647
  getValueFromVariable,
629
648
  getVariableValue,
@@ -282,13 +282,25 @@ function queryPageSuperGrids(pageDesign, pageContext, publishVersion) {
282
282
  );
283
283
  }
284
284
  function packageFormRules(pageContext, configure) {
285
- var _a, _b;
286
- const isWorkflow = pageContext.workflowCode ? true : false;
285
+ var _a, _b, _c;
286
+ const prop = configure.props && configure.props.base ? configure.props.base.prop : null;
287
+ let isWorkflow = false;
288
+ if ((_a = pageContext.props) == null ? void 0 : _a.activeWorkflow) {
289
+ isWorkflow = pageContext.workflowCode ? true : false;
290
+ }
291
+ let allFieldsDisabled = false;
287
292
  if (isWorkflow) {
293
+ console.log(
294
+ "packageFormRules-----prop=",
295
+ prop,
296
+ "--pageContext.fieldPermissionMap=",
297
+ pageContext.fieldPermissionMap
298
+ );
288
299
  if (configure.name !== "button-detail" && pageContext.fieldPermissionMap) {
289
300
  const allFields = pageContext.fieldPermissionMap.get("all_fields");
290
- if ((allFields == null ? void 0 : allFields["canEdit"]) === false && ((_a = configure.runtime) == null ? void 0 : _a.props)) {
301
+ if ((allFields == null ? void 0 : allFields["canEdit"]) === false && ((_b = configure.runtime) == null ? void 0 : _b.props)) {
291
302
  configure.runtime.props.state = "disabled";
303
+ allFieldsDisabled = true;
292
304
  }
293
305
  }
294
306
  const requiredRules = configure.props && configure.props.rules ? configure.props.rules.filter((item) => item.required) : null;
@@ -298,7 +310,6 @@ function packageFormRules(pageContext, configure) {
298
310
  });
299
311
  }
300
312
  }
301
- const prop = configure.props && configure.props.base ? configure.props.base.prop : null;
302
313
  if (prop) {
303
314
  const propName = getFormPropName(prop);
304
315
  if (!pageContext.rules) {
@@ -310,17 +321,27 @@ function packageFormRules(pageContext, configure) {
310
321
  }
311
322
  pageContext.rules[propName] = configure.props.rules;
312
323
  }
313
- if (configure.name !== "button-detail" && pageContext.fieldPermissionMap) {
324
+ if (!allFieldsDisabled && configure.name !== "button-detail" && pageContext.fieldPermissionMap) {
314
325
  const propEditPermission = pageContext.fieldPermissionMap.get(propName);
326
+ console.log("packageFormRules-----prop=", prop, "--propEditPermission=", propEditPermission);
315
327
  if (propEditPermission) {
316
328
  if (propEditPermission["canEdit"] === false) {
317
329
  configure.runtime.props.state = "disabled";
318
330
  } else if (propEditPermission["canEdit"]) {
331
+ configure.runtime.props.state = "";
319
332
  configure.runtime.props.required = true;
320
333
  }
334
+ console.log(
335
+ "packageFormRules-----prop=",
336
+ prop,
337
+ "--configure.runtime.props=",
338
+ configure.runtime.props
339
+ );
340
+ } else {
341
+ configure.runtime.props.state = "";
321
342
  }
322
343
  }
323
- if ((_b = configure.props) == null ? void 0 : _b.customRuleEvents) {
344
+ if ((_c = configure.props) == null ? void 0 : _c.customRuleEvents) {
324
345
  if (!pageContext.customRuleEvents) {
325
346
  pageContext.customRuleEvents = [];
326
347
  }
@@ -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
  });
@@ -7,6 +7,7 @@ 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: {
@@ -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,33 @@ 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("objectRender---configure.name=", props.configure.name, "props.configure=", props.configure, "runtimeStyle.value=", runtimeStyle);
545
+ const sizeConfig = getSizeConfig(props.pageContext, props.configure);
546
+ if (sizeConfig && sizeConfig["isCalcHeight"]) {
547
+ let thisRefDom = gridRef.value.$el;
548
+ if (!thisRefDom) {
549
+ thisRefDom = gridRef.value;
550
+ }
551
+ const parentNode = thisRefDom.parentNode;
552
+ if (!thisRefDom || !parentNode) {
553
+ return;
554
+ }
555
+ const rect = thisRefDom.getBoundingClientRect();
556
+ return window.innerHeight - rect.y - 80;
557
+ }
529
558
  }
530
559
  function customButtonClick(originalValue, formatValue, row, column, rowIndex, button) {
531
560
  const otherParams = {
@@ -1,6 +1,6 @@
1
- import { defineComponent, ref, resolveComponent, openBlock, createElementBlock, createBlock, unref, createCommentVNode } from "vue";
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 { setVariableValue, getVariableValue } 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";
@@ -31,6 +31,7 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
31
31
  const entity = props.pageContext.entity ? props.pageContext.entity : {};
32
32
  let dynamicFields = getModelFields(props.configure, prop);
33
33
  const listViewShowFlag = ref(false);
34
+ let componentKey = ref(0);
34
35
  const baseURL = window["$vueApp"].config.globalProperties.baseURL;
35
36
  const listViewOptions = ref({
36
37
  isSql: true,
@@ -58,14 +59,54 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
58
59
  listViewOptions.value.showPageArea = false;
59
60
  }
60
61
  const gridRef = ref(null);
62
+ onMounted(() => {
63
+ const tableUuid = configure.uuid;
64
+ const subTableWatchProps = pageContext.subTableWatchProps;
65
+ eventBus.$on("_refreshSubTable_" + tableUuid, (params) => {
66
+ console.log("-_refreshSubTable--tableUuid=", tableUuid, "params=", params);
67
+ const propName = params.propName;
68
+ if (subTableWatchProps && subTableWatchProps[tableUuid] && subTableWatchProps[tableUuid].length > 0) {
69
+ const mainFormProps = subTableWatchProps[tableUuid];
70
+ if (mainFormProps.indexOf(propName) >= 0) {
71
+ if (gridRef.value) {
72
+ changeInitializationSubTable();
73
+ }
74
+ }
75
+ }
76
+ });
77
+ eventBus.$on("_refreshSubTableHandle_" + tableUuid, (params) => {
78
+ console.log("-_refreshSubTableHandle_--tableUuid=", tableUuid, "params=", params);
79
+ changeInitializationSubTable();
80
+ });
81
+ eventBus.$on(
82
+ "_refreshChildData_" + tableUuid,
83
+ (gridData) => {
84
+ console.log("-_refreshChildData_--tableUuid=", tableUuid);
85
+ refreshChildTableData(gridData);
86
+ }
87
+ );
88
+ });
89
+ onUnmounted(() => {
90
+ const tableUuid = configure.uuid;
91
+ eventBus.$off("_refreshSubTable_" + tableUuid);
92
+ eventBus.$off("_refreshSubTableHandle_" + tableUuid);
93
+ eventBus.$off("_refreshChildData_" + tableUuid);
94
+ });
61
95
  function currencyListViewSetting(canRrefreshSubtableData) {
62
96
  if (canRrefreshSubtableData === void 0) {
63
97
  canRrefreshSubtableData = judgeInitializationSubTable();
64
98
  }
99
+ listViewOptions.value["isPageInfo"] = false;
65
100
  listViewOptions.value["isFormSubTable"] = true;
66
101
  listViewOptions.value["canRrefreshSubtableData"] = canRrefreshSubtableData;
67
102
  listViewOptions.value["getFormData"] = getParentFormData;
68
103
  listViewOptions.value["getGridData"] = getGridData;
104
+ listViewOptions.value.extraParam["subTableListViewCode"] = listCode;
105
+ listViewOptions.value.extraParam["subtableSetting"] = configure.props && configure.props.otherSettings ? JSON.stringify(configure.props.otherSettings) : null;
106
+ listViewOptions.value.extraParam["additionalParamMap"] = additionalParamMap;
107
+ listViewOptions.value.extraParam["entityMap"] = pageContext.entity.data;
108
+ listViewOptions.value.extraParam["contextMap"] = pageContext.entity.context;
109
+ listViewOptions.value.extraParam["taskMap"] = pageContext.entity.task;
69
110
  if (!(configure.props && configure.props.base && configure.props.base.showOperation)) {
70
111
  let hiddenColumns = listViewOptions.value.hiddenColumns;
71
112
  if (!hiddenColumns) {
@@ -78,11 +119,7 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
78
119
  listViewOptions.value["showOperationButton"] = configure.props && configure.props.base ? configure.props.base.showOperation : false;
79
120
  listViewOptions.value["isPdfEditor"] = false;
80
121
  listViewOptions.value["tableRecordMaxNum"] = configure.props && configure.props.otherSettings ? configure.props.otherSettings.tableRecordMaxNum : null;
81
- const pageModeType = getPageModeType();
82
- let sizeConfig;
83
- if (configure.props && configure.props.size && configure.props.size[pageModeType]) {
84
- sizeConfig = configure.props.size[pageModeType];
85
- }
122
+ let sizeConfig = getSizeConfig(pageContext, configure);
86
123
  if (sizeConfig && sizeConfig.fixHeight) {
87
124
  listViewOptions.value["formSetHeight"] = sizeConfig.fixHeight;
88
125
  }
@@ -90,13 +127,6 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
90
127
  listViewOptions.value["formSetMaxHeight"] = sizeConfig.maxHeight;
91
128
  }
92
129
  }
93
- function getPageModeType() {
94
- let dimensions = pageContext.dimensions;
95
- if (!dimensions) {
96
- dimensions = "pc";
97
- }
98
- return dimensions;
99
- }
100
130
  function judgeInitializationSubTable() {
101
131
  if (!configure.props || !configure.props.otherSettings) {
102
132
  return;
@@ -127,20 +157,25 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
127
157
  function getGridData() {
128
158
  return getVariableValue(entity, dynamicFields);
129
159
  }
160
+ function initializationSubTable() {
161
+ const canRrefreshSubtableData = judgeInitializationSubTable();
162
+ if (canRrefreshSubtableData) {
163
+ changeInitializationSubTable(canRrefreshSubtableData);
164
+ } else {
165
+ currencyListViewSetting(canRrefreshSubtableData);
166
+ listViewOptions.value["isPageInfo"] = false;
167
+ listViewOptions.value["subTableData"] = getValue();
168
+ setGridDataEventOptions();
169
+ }
170
+ }
130
171
  function changeInitializationSubTable(canRrefreshSubtableData) {
131
172
  currencyListViewSetting(canRrefreshSubtableData);
132
- listViewOptions.value["isPageInfo"] = false;
133
- listViewOptions.value["subTableData"] = getValue();
134
- listViewOptions.value.extraParam["subTableListViewCode"] = listCode;
135
- listViewOptions.value.extraParam["subtableSetting"] = configure.props && configure.props.otherSettings ? JSON.stringify(configure.props.otherSettings) : null;
136
- listViewOptions.value.extraParam["additionalParamMap"] = additionalParamMap;
137
- listViewOptions.value.extraParam["entityMap"] = pageContext.entity.data;
138
- listViewOptions.value.extraParam["contextMap"] = pageContext.entity.context;
139
- listViewOptions.value.extraParam["taskMap"] = pageContext.entity.task;
173
+ listViewOptions.value["subTableData"] = null;
140
174
  setGridDataEventOptions();
141
175
  listViewShowFlag.value = false;
142
176
  setTimeout(() => {
143
177
  listViewShowFlag.value = true;
178
+ componentKey.value = componentKey.value + 1;
144
179
  setGridToStore();
145
180
  }, 10);
146
181
  }
@@ -189,7 +224,9 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
189
224
  if (!pageContext.tableUuids) {
190
225
  pageContext.tableUuids = [];
191
226
  }
192
- pageContext.tableUuids.push(configure.uuid);
227
+ if (pageContext.tableUuids.indexOf(configure.uuid) < 0) {
228
+ pageContext.tableUuids.push(configure.uuid);
229
+ }
193
230
  }
194
231
  function getOperations() {
195
232
  let operations = [];
@@ -224,7 +261,7 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
224
261
  }
225
262
  return operations;
226
263
  }
227
- changeInitializationSubTable();
264
+ initializationSubTable();
228
265
  function getEntityId(row) {
229
266
  if (row && row.id) {
230
267
  return row.id;
@@ -427,6 +464,15 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
427
464
  function setValue(value) {
428
465
  return setVariableValue(entity, dynamicFields, value);
429
466
  }
467
+ function refreshChildTableData(gridData) {
468
+ setValue(gridData);
469
+ setTimeout(() => {
470
+ if (gridRef.value) {
471
+ gridRef.value.refreshChildData(listCode, gridData, configure.props && configure.props.base && configure.props.base.subPaging === true);
472
+ listViewOptions.value.extraParam["entityMap"] = pageContext.entity.data;
473
+ }
474
+ }, 10);
475
+ }
430
476
  __expose({
431
477
  createRow,
432
478
  getSelections,
@@ -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,
@@ -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
  }
@@ -495,9 +493,9 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
495
493
  return (_ctx, _cache) => {
496
494
  return openBlock(), createElementBlock("div", _hoisted_1, [
497
495
  isShowPage.value ? (openBlock(), createElementBlock("div", {
498
- key: 0,
499
496
  ref_key: "thisRef",
500
497
  ref: thisRef,
498
+ key: pageKey.value,
501
499
  class: normalizeClass(pageClass.value),
502
500
  style: normalizeStyle(pageStyle.value)
503
501
  }, [
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "super-page-runtime",
3
- "version": "2.1.15",
3
+ "version": "2.1.19",
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",