super-page-runtime 2.1.50 → 2.1.57

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 (36) hide show
  1. package/dist/es/components/runtime/utils/api/page-expose-util.js +110 -3
  2. package/dist/es/components/runtime/utils/charts/chart-columnline-util.js +12 -3
  3. package/dist/es/components/runtime/utils/charts/chart-util.d.ts +24 -0
  4. package/dist/es/components/runtime/utils/charts/chart-util.js +18 -1
  5. package/dist/es/components/runtime/utils/common-util.d.ts +1 -0
  6. package/dist/es/components/runtime/utils/common-util.js +6 -5
  7. package/dist/es/components/runtime/utils/events/event-util.d.ts +1 -0
  8. package/dist/es/components/runtime/utils/events/event-util.js +17 -4
  9. package/dist/es/components/runtime/utils/events/standard-event.d.ts +1 -1
  10. package/dist/es/components/runtime/utils/events/standard-event.js +6 -4
  11. package/dist/es/components/runtime/utils/events/validator-util.js +2 -1
  12. package/dist/es/components/runtime/utils/interfaces/page-design-types.d.ts +1 -0
  13. package/dist/es/components/runtime/utils/page-helper-util.d.ts +18 -0
  14. package/dist/es/components/runtime/utils/page-helper-util.js +23 -5
  15. package/dist/es/components/runtime/utils/page-init-util.js +14 -10
  16. package/dist/es/components/runtime/utils/table-utils.js +3 -7
  17. package/dist/es/components/runtime/views/assemblys/button/button/button-runtime.vue2.js +3 -1
  18. package/dist/es/components/runtime/views/assemblys/chart/column-line/column-line-runtime.vue2.js +5 -3
  19. package/dist/es/components/runtime/views/assemblys/chart/table/chart-table-util.js +108 -46
  20. package/dist/es/components/runtime/views/assemblys/chart/table/normal-column.vue.js +4 -1
  21. package/dist/es/components/runtime/views/assemblys/chart/table/table-pageination.vue.js +64 -0
  22. package/dist/es/components/runtime/views/assemblys/chart/table/table-pageination.vue2.js +4 -0
  23. package/dist/es/components/runtime/views/assemblys/chart/table/table-runtime.vue2.js +106 -20
  24. package/dist/es/components/runtime/views/assemblys/container/tools/tools-runtime.vue2.js +0 -2
  25. package/dist/es/components/runtime/views/assemblys/data/table/main-table-runtime.vue.js +107 -53
  26. package/dist/es/components/runtime/views/assemblys/data/table/sub-table-runtime.vue.js +25 -8
  27. package/dist/es/components/runtime/views/assemblys/data/table/table-runtime.vue2.js +18 -3
  28. package/dist/es/components/runtime/views/assemblys/form/checkbox/checkbox-runtime.vue2.js +1 -1
  29. package/dist/es/components/runtime/views/assemblys/form/date-picker/datepicker-runtime.vue2.js +0 -3
  30. package/dist/es/components/runtime/views/assemblys/form/file-upload/fileupload-runtime.vue2.js +0 -2
  31. package/dist/es/components/runtime/views/assemblys/form/input-text/inputtext-runtime.vue2.js +3 -12
  32. package/dist/es/components/runtime/views/assemblys/form/rich-text/richtext-runtime.vue2.js +49 -26
  33. package/dist/es/components/runtime/views/assemblys/form/select/select-runtime.vue2.js +19 -12
  34. package/dist/es/components/runtime/views/assemblys/object-render.vue.js +3 -5
  35. package/dist/es/components/runtime/views/super-page.vue.js +88 -26
  36. package/package.json +2 -2
@@ -1,10 +1,11 @@
1
- import { defineComponent, ref, onMounted, resolveComponent, openBlock, createElementBlock, normalizeStyle, unref, normalizeClass, withDirectives, createVNode, vShow, withCtx, Fragment, renderList, createBlock, watch, h } from "vue";
1
+ import { defineComponent, ref, onMounted, watch, resolveComponent, openBlock, createElementBlock, normalizeStyle, unref, normalizeClass, withDirectives, createVNode, vShow, withCtx, Fragment, renderList, createBlock, createCommentVNode, h } from "vue";
2
2
  import _sfc_main$1 from "../common/common-chart-header.vue.js";
3
- import { getChartDatasFromPage, isPromise, getValueFromVariable } from "../../../../utils/page-helper-util.js";
3
+ import { getChartDatasFromPage, getValueFromVariable, isPromise, setValueForVariableName, updateChartDatasourcesByComponent } from "../../../../utils/page-helper-util.js";
4
4
  import { getCustomFunc } from "../../../../utils/events/event-util.js";
5
5
  import _sfc_main$2 from "./group-column.vue.js";
6
6
  import _sfc_main$3 from "./normal-column.vue.js";
7
- import { getSummaryTitleColumn, getSummaryDataColumn, rowDataToColumn, getColumnToRowTableConfig, colDataToRow, summaryStatistics, replacePlaceholders, getHeaderCellStyleUtil, getRowStyleUtil, getCellStyleUtil, getIndexColumn } from "./chart-table-util.js";
7
+ import _sfc_main$4 from "./table-pageination.vue.js";
8
+ import { getSummaryTitleColumn, getSummaryDataColumn, rowDataToColumn, getColumnToRowTableConfig, colDataToRow, computeFormula, summaryStatistics, replacePlaceholders, getHeaderCellStyleUtil, getRowStyleUtil, getCellStyleUtil, getIndexColumn } from "./chart-table-util.js";
8
9
  const _sfc_main = /* @__PURE__ */ defineComponent({
9
10
  __name: "table-runtime",
10
11
  props: {
@@ -41,6 +42,9 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
41
42
  const groupSummaryColumns = ref({});
42
43
  const groupSummaryDataRowIndex = [];
43
44
  const columnStyleSourceConfig = ref({});
45
+ const dataFormulaMapping = ref({});
46
+ const total = ref(0);
47
+ let tmpTableData = [];
44
48
  if (!props.configure.props.modelCustom) {
45
49
  if (!isEnableGroupHeader.value) {
46
50
  tableColumnsConfig.value = props.configure.items;
@@ -50,7 +54,13 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
50
54
  (_a = props.configure.items) == null ? void 0 : _a.forEach((item) => {
51
55
  columnsConfigKeyValues.value[item.uuid] = item;
52
56
  if (Object.keys(item.style).length > 0) {
53
- columnStyleSourceConfig.value[item.props.base.prop] = { cellStyle: item.style, titleStyle: item.titleStyle };
57
+ columnStyleSourceConfig.value[item.props.base.prop] = {
58
+ cellStyle: item.style,
59
+ titleStyle: item.titleStyle
60
+ };
61
+ }
62
+ if (item.formula && item.formula.trim() !== "") {
63
+ dataFormulaMapping.value[item.props.base.prop] = item.formula;
54
64
  }
55
65
  });
56
66
  }
@@ -68,6 +78,17 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
68
78
  const resultData = getChartDatasFromPage(props.pageContext, props.configure);
69
79
  if (resultData) {
70
80
  updateChartDatas(resultData);
81
+ } else {
82
+ if (props.configure.props.dataOrigin.dataSource === "variable") {
83
+ watchVariableDataChange();
84
+ const tmpTableData2 = getValueFromVariable(
85
+ props.pageContext.entity,
86
+ props.configure.props.dataOrigin.variable
87
+ );
88
+ if (tmpTableData2) {
89
+ loadTable(tmpTableData2, resultData);
90
+ }
91
+ }
71
92
  }
72
93
  });
73
94
  function watchVariableDataChange() {
@@ -76,7 +97,7 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
76
97
  watch(
77
98
  () => path.reduce((obj, key) => obj[key], props.pageContext.entity),
78
99
  (newVal) => {
79
- loadTable(JSON.parse(JSON.stringify(newVal)));
100
+ loadTable(JSON.parse(JSON.stringify(newVal)), null);
80
101
  }
81
102
  );
82
103
  }
@@ -117,7 +138,6 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
117
138
  }
118
139
  }
119
140
  }
120
- let tmpTableData = [];
121
141
  if (props.configure.props.dataOrigin.dataSource === "service" && resultData.result) {
122
142
  tmpTableData = resultData.result[props.configure.props.dataOrigin.service.serviceDataField];
123
143
  } else if (props.configure.props.dataOrigin.dataSource === "variable") {
@@ -128,16 +148,17 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
128
148
  );
129
149
  }
130
150
  if (tmpTableData) {
131
- loadTable(tmpTableData);
151
+ loadTable(tmpTableData, resultData);
132
152
  }
133
153
  }
134
- function loadTable(tmpTableData) {
154
+ function loadTable(tmpTableData2, resultData) {
155
+ var _a2;
135
156
  if (enableTransition("rowToColumn")) {
136
- tmpTableData = rowDataToColumn(tmpTableData, props.configure);
157
+ tmpTableData2 = rowDataToColumn(tmpTableData2, props.configure);
137
158
  if (!isEnableGroupHeader.value) {
138
159
  const updatedColumnConfig = updateColumnConfig(
139
160
  tableColumnsConfig.value,
140
- tmpTableData,
161
+ tmpTableData2,
141
162
  props.configure.props.dataOrigin.rowToColumn.titleColumns,
142
163
  props.configure.props.dataOrigin.rowToColumn.dataColumns
143
164
  );
@@ -147,18 +168,24 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
147
168
  if (!isEnableGroupHeader.value) {
148
169
  tableColumnsConfig.value = getColumnToRowTableConfig(props.configure);
149
170
  }
150
- tmpTableData = colDataToRow(tmpTableData, props.configure);
171
+ tmpTableData2 = colDataToRow(tmpTableData2, props.configure);
151
172
  }
152
173
  if (props.configure.props.dataOrigin.dataFormatting) {
153
174
  const func = getCustomFunc(props.pageContext, props.configure.props.dataOrigin.dataFormatting);
154
175
  if (func) {
155
- const resultValue = func.apply(func, [{ tableData: tmpTableData }]);
176
+ const resultValue = func.apply(func, [{ tableData: tmpTableData2 }]);
156
177
  if (resultValue) {
157
- tableData.value = resultValue;
178
+ tmpTableData2 = resultValue;
158
179
  }
159
180
  }
181
+ }
182
+ if (Object.keys(dataFormulaMapping.value).length > 0 && tmpTableData2 && tmpTableData2.length > 0) {
183
+ computeFormula(dataFormulaMapping.value, tmpTableData2);
184
+ }
185
+ if ((_a2 = props.configure.pageination) == null ? void 0 : _a2.enable) {
186
+ tableDataPageination(resultData);
160
187
  } else {
161
- tableData.value = tmpTableData;
188
+ tableData.value = tmpTableData2;
162
189
  }
163
190
  if (props.configure.props.highOrder.groupField && props.configure.props.highOrder.groupField.length > 0) {
164
191
  const groupField = props.configure.props.highOrder.groupField;
@@ -172,7 +199,11 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
172
199
  function getHeaderCellStyle(data) {
173
200
  const cellTitleStyle = columnStyleSourceConfig.value[data.column.property] ? columnStyleSourceConfig.value[data.column.property].titleStyle : null;
174
201
  const rowTitleStyle = runtimeStyle == null ? void 0 : runtimeStyle.titleStyle;
175
- return getHeaderCellStyleUtil(data, { cellTitleStyle, titleStyle: rowTitleStyle }, props);
202
+ return getHeaderCellStyleUtil(
203
+ data,
204
+ { cellTitleStyle, titleStyle: rowTitleStyle },
205
+ props
206
+ );
176
207
  }
177
208
  function getRowStyle(data) {
178
209
  return getRowStyleUtil(data, groupSummaryDataRowIndex, props);
@@ -310,18 +341,18 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
310
341
  const groupResult = Object.values(groupedData);
311
342
  for (let i = 0; i < groupResult.length; i++) {
312
343
  const group = groupResult[i];
313
- const total = {};
344
+ const total2 = {};
314
345
  summaryColumns == null ? void 0 : summaryColumns.forEach((column) => {
315
346
  const prop = column.props.base.prop;
316
347
  const res = summaryStatistics(groupSummaryColumns.value[prop], group, prop, props.pageContext);
317
- total[prop] = res;
348
+ total2[prop] = res;
318
349
  });
319
350
  result.push(...group);
320
351
  groupColumns == null ? void 0 : groupColumns.forEach((column) => {
321
352
  const prop = column.props.base.prop;
322
- total[prop] = replacePlaceholders(column.props.base.summaryTitle, group[0]);
353
+ total2[prop] = replacePlaceholders(column.props.base.summaryTitle, group[0]);
323
354
  });
324
- result.push(total);
355
+ result.push(total2);
325
356
  groupSummaryDataRowIndex.push(result.length - 1);
326
357
  }
327
358
  return result;
@@ -334,6 +365,53 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
334
365
  }
335
366
  }
336
367
  }
368
+ function tableDataPageination(resultData) {
369
+ if (props.configure.pageination.type === "frontend") {
370
+ total.value = tmpTableData.length;
371
+ frontendPageination(1, props.configure.pageination.pageSize);
372
+ } else if (props.configure.pageination.type === "backend") {
373
+ tableData.value = tmpTableData;
374
+ if (props.configure.pageination.totalFrom) {
375
+ total.value = resultData.result[props.configure.pageination.totalFrom];
376
+ }
377
+ }
378
+ }
379
+ function pageChange(currentPage, pageSize) {
380
+ if (props.configure.pageination.type === "frontend") {
381
+ frontendPageination(currentPage, pageSize);
382
+ } else {
383
+ backendPageination(currentPage, pageSize);
384
+ }
385
+ }
386
+ function pageSizeChange(currentPage, pageSize) {
387
+ if (props.configure.pageination.type === "frontend") {
388
+ frontendPageination(currentPage, pageSize);
389
+ } else {
390
+ backendPageination(currentPage, pageSize);
391
+ }
392
+ }
393
+ function frontendPageination(currentPage, pageSize) {
394
+ if (tmpTableData) {
395
+ tableData.value = tmpTableData.slice((currentPage - 1) * pageSize, currentPage * pageSize);
396
+ }
397
+ }
398
+ function backendPageination(currentPage, pageSize) {
399
+ if (props.configure.pageination.currentPageSet) {
400
+ setValueForVariableName(
401
+ props.pageContext.entity,
402
+ props.configure.pageination.currentPageSet,
403
+ currentPage
404
+ );
405
+ }
406
+ if (props.configure.pageination.pageSizeSet) {
407
+ setValueForVariableName(
408
+ props.pageContext.entity,
409
+ props.configure.pageination.pageSizeSet,
410
+ pageSize
411
+ );
412
+ }
413
+ updateChartDatasourcesByComponent(props.pageContext, props.configure.uuid);
414
+ }
337
415
  function exportChart() {
338
416
  }
339
417
  __expose({
@@ -391,7 +469,15 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
391
469
  }), 128))
392
470
  ]),
393
471
  _: 1
394
- }, 8, ["data", "show-summary", "stripe"])
472
+ }, 8, ["data", "show-summary", "stripe"]),
473
+ __props.configure.pageination && __props.configure.pageination.enable ? (openBlock(), createBlock(_sfc_main$4, {
474
+ key: 0,
475
+ configure: __props.configure,
476
+ "table-data": tableData.value,
477
+ total: total.value,
478
+ onPageChange: pageChange,
479
+ onPageSizeChange: pageSizeChange
480
+ }, null, 8, ["configure", "table-data", "total"])) : createCommentVNode("", true)
395
481
  ], 6);
396
482
  };
397
483
  }
@@ -17,8 +17,6 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
17
17
  onMounted(() => {
18
18
  if (thisRef.value && thisRef.value.parentNode) {
19
19
  const resizeObserver2 = new ResizeObserver((entries) => {
20
- for (let entry of entries) {
21
- }
22
20
  caculatePositionStyle();
23
21
  });
24
22
  resizeObserver2.observe(thisRef.value.parentNode);
@@ -1,10 +1,9 @@
1
1
  import { defineComponent, ref, onMounted, watch, onUnmounted, resolveComponent, openBlock, createElementBlock, createVNode, unref } from "vue";
2
- import "agilebuilder-ui";
3
2
  import { setTableEvents, canExecuteButton, doAfterClickEvent, getEventNameByType, doBeforeClickEvent, getHandleEvent, gridSelectRecord, gridSelectAllRecords, gridSelectionChange, cellClick, cellDblClick, rowClick, rowDblClick, headerClick } from "../../../../utils/events/event-util.js";
4
- import { getBaseUrl, getListCode, getRealRestApiPath } from "../../../../utils/common-util.js";
3
+ import { getBaseUrl, getListCode, getRealRestApiPath, isWorkflowPage, isVariableInvalidValue } from "../../../../utils/common-util.js";
5
4
  import { getAdditionalParamMap, getSaveFormRequestWithRow, standardEvents } from "../../../../utils/events/standard-event.js";
6
5
  import { isPromise } from "agilebuilder-ui/src/utils/common-util";
7
- import { getDataTypeMapRequest, popupToPage } from "../../../../utils/table-utils.js";
6
+ import { popupToPage } from "../../../../utils/table-utils.js";
8
7
  import eventBus from "../../../../utils/eventBus.js";
9
8
  import { getPermissionCodes, getDefaultValue } from "../../../../utils/page-init-util.js";
10
9
  import { decomposeVariable, getSizeConfig } from "../../../../utils/page-helper-util.js";
@@ -15,7 +14,8 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
15
14
  pageContext: {},
16
15
  configure: {}
17
16
  },
18
- setup(__props, { expose: __expose }) {
17
+ emits: ["setSafeDeleteTableCode"],
18
+ setup(__props, { expose: __expose, emit: __emit }) {
19
19
  const props = __props;
20
20
  const pageContext = props.pageContext;
21
21
  let configure = props.configure;
@@ -38,9 +38,10 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
38
38
  baseURL = window["$vueApp"].config.globalProperties.baseURL;
39
39
  }
40
40
  const operationButtonObj = ref({});
41
+ const linkageVariable = [];
41
42
  const listOptions = ref({});
42
43
  listOptions.value = getOptions();
43
- const gridRef = ref(null);
44
+ const gridRef = ref();
44
45
  const urlToListData = getUrlToListData();
45
46
  const listCode = getListCode(pageContext.code, pageContext.version, configure.uuid);
46
47
  const myPageCode = pageContext.code;
@@ -52,6 +53,7 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
52
53
  const superGridSetting = superGridItems ? superGridItems[configure.uuid] : null;
53
54
  console.log("superGridSetting1111===", superGridItems, superGridSetting);
54
55
  const isCanShowMobileSearch = ref(false);
56
+ const $emit = __emit;
55
57
  onMounted(() => {
56
58
  window.addEventListener("message", recieveMessage);
57
59
  eventBus.$on(
@@ -76,6 +78,9 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
76
78
  gridRef.value.scanDone(data);
77
79
  });
78
80
  listOptions.value["formSetMaxHeight"] = getComponentHeight();
81
+ if (listOptions.value && listOptions.value.configureObj.props.base && listOptions.value.configureObj.props.base.isSafeDelete) {
82
+ $emit("setSafeDeleteTableCode", listOptions.value.extraParam.tableName);
83
+ }
79
84
  });
80
85
  watch(
81
86
  () => props.pageContext.searchFormData,
@@ -89,26 +94,6 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
89
94
  searchGridData(props.pageContext.entity.data);
90
95
  }
91
96
  );
92
- const linkageVariable = [];
93
- if (configure.props.linkages && configure.props.linkages.length > 0) {
94
- configure.props.linkages.forEach((linkage) => {
95
- const variablePath = decomposeVariable(linkage.fieldName);
96
- if (variablePath && variablePath.length > 1) {
97
- linkageVariable.push(variablePath[1]);
98
- }
99
- });
100
- if (linkageVariable.length > 0) {
101
- linkageVariable.forEach((variable) => {
102
- watch(
103
- () => props.pageContext.entity.page[variable],
104
- () => {
105
- const values = getLinkageVariableValues();
106
- searchGridData(values);
107
- }
108
- );
109
- });
110
- }
111
- }
112
97
  onUnmounted(() => {
113
98
  eventBus.$off(eventPageInfo + "-close-component-page-dialog");
114
99
  eventBus.$off(eventPageInfo + "_close-dialog-get-entity");
@@ -148,7 +133,7 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
148
133
  esc: escRestorRow
149
134
  },
150
135
  indexContinuous: configure.props && configure.props.otherSettings ? configure.props.otherSettings.serialNumberContinuous : false,
151
- initSearch: configure.props && configure.props.base.initializationQuery ? configure.props.base.initializationQuery : true,
136
+ initSearch: configure.props && configure.props.dataOrigin.initializationQuery === false ? false : true,
152
137
  // 初始化时是否查询,默认是查询
153
138
  resizeHeight: resizeListHeight,
154
139
  pageCode: pageContext.code,
@@ -162,7 +147,7 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
162
147
  // 是否启用回车事件
163
148
  isWithDataPermission: configure.props && configure.props.otherSettings && configure.props.otherSettings.isWithDataPermission ? configure.props.otherSettings.isWithDataPermission : false,
164
149
  pageDevMode: false,
165
- isWorkflowEntity: pageContext.workflowCode ? true : false,
150
+ isWorkflowEntity: isWorkflowPage(pageContext),
166
151
  tableClass: runtimeClass,
167
152
  tableStyle: runtimeStyle,
168
153
  pageContext,
@@ -174,7 +159,17 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
174
159
  };
175
160
  setOperationButtons(options);
176
161
  setSortInfo(options);
177
- myGetDataTypeMap();
162
+ if (configure.props.linkages && configure.props.linkages.length > 0) {
163
+ configure.props.linkages.forEach((linkage) => {
164
+ const variablePath = decomposeVariable(linkage.fieldName);
165
+ if (variablePath && variablePath.length > 1) {
166
+ linkageVariable.push(variablePath[1]);
167
+ }
168
+ });
169
+ if (linkageVariable.length > 0) {
170
+ addLinkageWatch();
171
+ }
172
+ }
178
173
  setTreeSetting(options);
179
174
  setGridEvents(options);
180
175
  return options;
@@ -191,17 +186,6 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
191
186
  });
192
187
  }
193
188
  }
194
- function myGetDataTypeMap(options) {
195
- if (!backendUrl && !tableName) {
196
- return;
197
- }
198
- getDataTypeMapRequest(backendUrl, tableName, pageContext.isTest).then((result) => {
199
- if (!pageContext["dataTypeMaps"]) {
200
- pageContext["dataTypeMaps"] = {};
201
- }
202
- pageContext["dataTypeMaps"][tableName] = result["dataTypeMap"];
203
- });
204
- }
205
189
  function setOperationButtons(options) {
206
190
  const showOperation = configure.props && configure.props.base ? configure.props.base.showOperation : false;
207
191
  const operationButtonSettings = configure.btnList;
@@ -503,10 +487,11 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
503
487
  }
504
488
  }
505
489
  function searchGridData(data) {
506
- if (!pageContext["dataTypeMaps"] || !pageContext["dataTypeMaps"][tableName]) {
490
+ if (!pageContext["dataTypeMaps"]) {
491
+ console.log("!pageContext['dataTypeMaps'] || !pageContext['dataTypeMaps'][tableName]");
507
492
  return;
508
493
  }
509
- const dataTypeObj = pageContext["dataTypeMaps"][tableName];
494
+ const dataTypeObj = pageContext["dataTypeMaps"];
510
495
  let toolbarFieldParam = [];
511
496
  if (data) {
512
497
  for (var key in data) {
@@ -553,6 +538,7 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
553
538
  }
554
539
  }
555
540
  }
541
+ console.log("toolbarRefresh");
556
542
  gridRef.value.toolbarRefresh(null, null, toolbarFieldParam);
557
543
  }
558
544
  function resizeListHeight(params) {
@@ -599,7 +585,6 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
599
585
  rowIndex,
600
586
  button
601
587
  };
602
- debugger;
603
588
  const buttonConfigure = operationButtonObj.value[button.sourceButton.uuid];
604
589
  const tableConfigure = configure;
605
590
  buttonConfigure.props.base.tableUuid = tableConfigure.uuid;
@@ -709,9 +694,24 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
709
694
  gridRef.value.showMobileSearch();
710
695
  }
711
696
  }
712
- function canShowMobileSearch(listCode2) {
697
+ function canShowMobileSearchFunc(listCode2) {
713
698
  isCanShowMobileSearch.value = true;
714
699
  }
700
+ function getRowStyle(data) {
701
+ return getRowStyleUtil(data, [], props);
702
+ }
703
+ function getCellStyle(data) {
704
+ return getCellStyleUtil(data, data.cellStyle, props);
705
+ }
706
+ function getTitleStyle(data) {
707
+ const cellTitleStyle = data.titleStyle;
708
+ const rowTitleStyle = props.configure.style.titleStyle;
709
+ return getHeaderCellStyleUtil(
710
+ data,
711
+ { cellTitleStyle, titleStyle: rowTitleStyle },
712
+ props
713
+ );
714
+ }
715
715
  function getLinkageVariableValues() {
716
716
  const values = {};
717
717
  linkageVariable.forEach((variable) => {
@@ -719,16 +719,69 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
719
719
  });
720
720
  return values;
721
721
  }
722
- function getRowStyle(data) {
723
- return getRowStyleUtil(data, null, props);
722
+ function addLinkageWatch() {
723
+ if (props.pageContext.toolsInputComponents && props.pageContext.toolsInputComponents.length > 0) {
724
+ let waitComponentRenderProps = [];
725
+ props.pageContext.toolsInputComponents.forEach((componentItem) => {
726
+ const isLinkComponent = configure.props.linkages.some(
727
+ (linkage) => linkage.fieldName === componentItem.prop
728
+ );
729
+ if (isLinkComponent && componentItem.defaultValue) {
730
+ const variablePath = decomposeVariable(componentItem.prop);
731
+ if (variablePath && variablePath.length > 1) {
732
+ waitComponentRenderProps.push(variablePath[1]);
733
+ }
734
+ }
735
+ });
736
+ if (waitComponentRenderProps.length === 0) {
737
+ linkageVariableWatch();
738
+ } else {
739
+ const values = getLinkageVariableValues();
740
+ waitComponentRenderProps = waitComponentRenderProps.filter((unsetVariable) => {
741
+ return isVariableInvalidValue(values, unsetVariable);
742
+ });
743
+ if (waitComponentRenderProps.length === 0) {
744
+ searchGridData(values);
745
+ linkageVariableWatch();
746
+ } else {
747
+ linkageVariable.forEach((variable) => {
748
+ watch(
749
+ () => props.pageContext.entity.page[variable],
750
+ () => {
751
+ const values2 = getLinkageVariableValues();
752
+ if (waitComponentRenderProps.length === 0) {
753
+ searchGridData(values2);
754
+ } else {
755
+ waitComponentRenderProps = waitComponentRenderProps.filter((unsetVariable) => {
756
+ return isVariableInvalidValue(values2, unsetVariable);
757
+ });
758
+ if (waitComponentRenderProps.length === 0) {
759
+ searchGridData(values2);
760
+ }
761
+ }
762
+ },
763
+ { immediate: true }
764
+ );
765
+ });
766
+ }
767
+ }
768
+ }
724
769
  }
725
- function getCellStyle(data) {
726
- return getCellStyleUtil(data, data.cellStyle, props);
770
+ function linkageVariableWatch() {
771
+ linkageVariable.forEach((variable) => {
772
+ watch(
773
+ () => props.pageContext.entity.page[variable],
774
+ () => {
775
+ const values = getLinkageVariableValues();
776
+ searchGridData(values);
777
+ }
778
+ );
779
+ });
727
780
  }
728
- function getTitleStyle(data) {
729
- const cellTitleStyle = data.titleStyle;
730
- const rowTitleStyle = props.configure.style.titleStyle;
731
- return getHeaderCellStyleUtil(data, { cellTitleStyle, titleStyle: rowTitleStyle }, props);
781
+ function getTableSelectOptions() {
782
+ if (gridRef.value) {
783
+ return gridRef.value.getTableSelectOptions(listCode);
784
+ }
732
785
  }
733
786
  __expose({
734
787
  refresh,
@@ -739,7 +792,8 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
739
792
  getTableConfigure,
740
793
  isDeleteChange,
741
794
  validatorSunTableListData,
742
- showMobileSearch
795
+ showMobileSearch,
796
+ getTableSelectOptions
743
797
  });
744
798
  return (_ctx, _cache) => {
745
799
  const _component_super_grid = resolveComponent("super-grid");
@@ -763,7 +817,7 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
763
817
  onHeaderClick: headerClickEvent,
764
818
  onRefresh: clearSelections,
765
819
  onNewOpenGridDialog: unref(popupToPage),
766
- onCanShowMobileSearch: canShowMobileSearch
820
+ onCanShowMobileSearch: canShowMobileSearchFunc
767
821
  }, null, 8, ["url", "options", "code", "settings", "search-form-info", "list-toolbar-form-data", "onNewOpenGridDialog"])
768
822
  ]);
769
823
  };
@@ -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 { getSizeConfig, getVariableValue, setVariableValue } from "../../../../utils/page-helper-util.js";
3
+ import { setVariableValue, getVariableValue, getSizeConfig } 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";
@@ -13,7 +13,8 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
13
13
  pageContext: {},
14
14
  configure: {}
15
15
  },
16
- setup(__props, { expose: __expose }) {
16
+ emits: ["setSafeDeleteTableCode"],
17
+ setup(__props, { expose: __expose, emit: __emit }) {
17
18
  const props = __props;
18
19
  const pageContext = props.pageContext;
19
20
  const configure = props.configure;
@@ -56,6 +57,7 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
56
57
  rowStyleRender: getRowStyle,
57
58
  titleStyleRender: getTitleStyle
58
59
  });
60
+ const $emit = __emit;
59
61
  if (runtimeStyle) {
60
62
  listViewOptions.value["tableStyle"] = runtimeStyle;
61
63
  }
@@ -80,15 +82,13 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
80
82
  if (subTableWatchProps && subTableWatchProps[tableUuid] && subTableWatchProps[tableUuid].length > 0) {
81
83
  const mainFormProps = subTableWatchProps[tableUuid];
82
84
  if (mainFormProps.indexOf(propName) >= 0) {
83
- if (gridRef.value) {
84
- changeInitializationSubTable();
85
- }
85
+ reloadSubTableData();
86
86
  }
87
87
  }
88
88
  });
89
89
  eventBus.$on("_refreshSubTableHandle_" + tableUuid, (params) => {
90
90
  console.log("-_refreshSubTableHandle_--tableUuid=", tableUuid, "params=", params);
91
- changeInitializationSubTable();
91
+ reloadSubTableData();
92
92
  });
93
93
  eventBus.$on(
94
94
  "_refreshChildData_" + tableUuid,
@@ -105,7 +105,16 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
105
105
  console.log("superPage5555---listCode---scanDone--listCode=", listCode, "data=", data);
106
106
  gridRef.value.scanDone(data);
107
107
  });
108
+ if (listViewOptions.value && listViewOptions.value.configureObj.props.base && listViewOptions.value.configureObj.props.base.isSafeDelete) {
109
+ $emit("setSafeDeleteTableCode", listViewOptions.value.extraParam.tableName);
110
+ }
108
111
  });
112
+ function reloadSubTableData() {
113
+ if (gridRef.value) {
114
+ listViewOptions.value["subTableData"] = null;
115
+ gridRef.value.reloadSubTableData(listCode);
116
+ }
117
+ }
109
118
  onUnmounted(() => {
110
119
  const tableUuid = configure.uuid;
111
120
  eventBus.$off("_refreshSubTable_" + tableUuid);
@@ -497,7 +506,9 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
497
506
  }, 10);
498
507
  }
499
508
  function getRowStyle(data) {
500
- return getRowStyleUtil(data, null, props);
509
+ const style = getRowStyleUtil(data, null, props);
510
+ console.log("getRowStyle----style=", style);
511
+ return style;
501
512
  }
502
513
  function getCellStyle(data) {
503
514
  return getCellStyleUtil(data, data.cellStyle, props);
@@ -507,6 +518,11 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
507
518
  const rowTitleStyle = props.configure.style.titleStyle;
508
519
  return getHeaderCellStyleUtil(data, { cellTitleStyle, titleStyle: rowTitleStyle }, props);
509
520
  }
521
+ function getTableSelectOptions() {
522
+ if (gridRef.value) {
523
+ return gridRef.value.getTableSelectOptions(listCode);
524
+ }
525
+ }
510
526
  __expose({
511
527
  createRow,
512
528
  getSelections,
@@ -515,7 +531,8 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
515
531
  getTableConfigure,
516
532
  validatorSunTableListData,
517
533
  getValue,
518
- setValue
534
+ setValue,
535
+ getTableSelectOptions
519
536
  });
520
537
  return (_ctx, _cache) => {
521
538
  const _component_super_grid = resolveComponent("super-grid");
@@ -29,6 +29,13 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
29
29
  return gridRef.value.validatorSunTableListData();
30
30
  }
31
31
  }
32
+ function setSafeDeleteTableCode(code) {
33
+ if (props.pageContext.entity.data._SAFE_DELETE_TABLE_NAMES) {
34
+ props.pageContext.entity.data._SAFE_DELETE_TABLE_NAMES.push(code);
35
+ } else {
36
+ props.pageContext.entity.data._SAFE_DELETE_TABLE_NAMES = [code];
37
+ }
38
+ }
32
39
  function clearSelections() {
33
40
  return gridRef.value.clearSelections();
34
41
  }
@@ -57,6 +64,11 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
57
64
  function showMobileSearch() {
58
65
  gridRef.value.showMobileSearch();
59
66
  }
67
+ function getTableSelectOptions() {
68
+ if (gridRef.value) {
69
+ return gridRef.value.getTableSelectOptions();
70
+ }
71
+ }
60
72
  __expose({
61
73
  refresh,
62
74
  createRow,
@@ -66,7 +78,8 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
66
78
  getTableConfigure,
67
79
  isDeleteChange,
68
80
  validatorSunTableListData,
69
- showMobileSearch
81
+ showMobileSearch,
82
+ getTableSelectOptions
70
83
  });
71
84
  return (_ctx, _cache) => {
72
85
  return openBlock(), createElementBlock("div", null, [
@@ -75,13 +88,15 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
75
88
  ref_key: "gridRef",
76
89
  ref: gridRef,
77
90
  pageContext: _ctx.pageContext,
78
- configure: tableConfigure.value
91
+ configure: tableConfigure.value,
92
+ onSetSafeDeleteTableCode: setSafeDeleteTableCode
79
93
  }, null, 8, ["pageContext", "configure"])) : (openBlock(), createBlock(_sfc_main$2, {
80
94
  key: 1,
81
95
  ref_key: "gridRef",
82
96
  ref: gridRef,
83
97
  pageContext: _ctx.pageContext,
84
- configure: tableConfigure.value
98
+ configure: tableConfigure.value,
99
+ onSetSafeDeleteTableCode: setSafeDeleteTableCode
85
100
  }, null, 8, ["pageContext", "configure"]))
86
101
  ]);
87
102
  };
@@ -16,7 +16,7 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
16
16
  const dynamicModelMethod = computed({
17
17
  get() {
18
18
  let val = getVariableValue(entity, dynamicFields);
19
- if (val) {
19
+ if (val && typeof val === "string") {
20
20
  val = val.split(",");
21
21
  }
22
22
  return val;