super-page-runtime 2.1.54 → 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 (27) hide show
  1. package/dist/es/components/runtime/utils/charts/chart-columnline-util.js +0 -1
  2. package/dist/es/components/runtime/utils/charts/chart-util.d.ts +24 -0
  3. package/dist/es/components/runtime/utils/charts/chart-util.js +4 -1
  4. package/dist/es/components/runtime/utils/common-util.js +2 -5
  5. package/dist/es/components/runtime/utils/events/event-util.js +3 -3
  6. package/dist/es/components/runtime/utils/events/standard-event.d.ts +1 -1
  7. package/dist/es/components/runtime/utils/events/standard-event.js +3 -3
  8. package/dist/es/components/runtime/utils/events/validator-util.js +2 -1
  9. package/dist/es/components/runtime/utils/page-helper-util.js +0 -1
  10. package/dist/es/components/runtime/utils/page-init-util.js +11 -9
  11. package/dist/es/components/runtime/utils/table-utils.js +3 -7
  12. package/dist/es/components/runtime/views/assemblys/button/button/button-runtime.vue2.js +0 -1
  13. package/dist/es/components/runtime/views/assemblys/chart/table/chart-table-util.js +106 -55
  14. package/dist/es/components/runtime/views/assemblys/chart/table/normal-column.vue.js +0 -2
  15. package/dist/es/components/runtime/views/assemblys/chart/table/table-runtime.vue2.js +14 -8
  16. package/dist/es/components/runtime/views/assemblys/container/tools/tools-runtime.vue2.js +0 -3
  17. package/dist/es/components/runtime/views/assemblys/data/table/main-table-runtime.vue.js +22 -35
  18. package/dist/es/components/runtime/views/assemblys/data/table/sub-table-runtime.vue.js +18 -7
  19. package/dist/es/components/runtime/views/assemblys/data/table/table-runtime.vue2.js +11 -2
  20. package/dist/es/components/runtime/views/assemblys/form/checkbox/checkbox-runtime.vue2.js +1 -1
  21. package/dist/es/components/runtime/views/assemblys/form/date-picker/datepicker-runtime.vue2.js +0 -3
  22. package/dist/es/components/runtime/views/assemblys/form/file-upload/fileupload-runtime.vue2.js +0 -2
  23. package/dist/es/components/runtime/views/assemblys/form/input-text/inputtext-runtime.vue2.js +2 -12
  24. package/dist/es/components/runtime/views/assemblys/form/select/select-runtime.vue2.js +0 -6
  25. package/dist/es/components/runtime/views/assemblys/object-render.vue.js +3 -5
  26. package/dist/es/components/runtime/views/super-page.vue.js +88 -26
  27. package/package.json +2 -2
@@ -210,7 +210,6 @@ function updateChartOption(pageContext, configure, chartOption, resultData) {
210
210
  sortDatas(pageContext, configure, datas);
211
211
  datas = limitDatas(pageContext, configure, datas, groupFields, limitValueFields);
212
212
  const xValues = [];
213
- console.log("accumulateFields", accumulateFields);
214
213
  const cumulativeMap = {};
215
214
  for (const data of datas) {
216
215
  if (!data) {
@@ -67,6 +67,30 @@ export declare function limitDatas(pageContext: PageContext, configure: Componen
67
67
  * @returns
68
68
  */
69
69
  export declare function caculateFormulaValue(itemConfs: any, datas: any, accumulateFields: any): any;
70
+ /**
71
+ * 获取数据源中的最小值
72
+ * @param datas 数据源
73
+ * @param fieldName 字段名
74
+ */
75
+ export declare function getMinValue(datas: any, fieldName: string): any;
76
+ /**
77
+ * 获取数据源中的最大值
78
+ * @param datas 数据源
79
+ * @param fieldName 字段名
80
+ */
81
+ export declare function getMaxValue(datas: any, fieldName: string): any;
82
+ /**
83
+ * 获取数据源中的汇总值
84
+ * @param datas 数据源
85
+ * @param fieldName 字段名
86
+ */
87
+ export declare function getSumValue(datas: any, fieldName: string): any;
88
+ /**
89
+ * 获取平均值
90
+ * @param datas 数据源
91
+ * @param fieldName 字段名
92
+ */
93
+ export declare function getAvgValue(datas: any, fieldName: string): any;
70
94
  /**
71
95
  * 执行统计图的计算公式
72
96
  * @param formulaStr 计算公式
@@ -14,7 +14,6 @@ const themeMap = {
14
14
  theme3
15
15
  };
16
16
  function getCustomTheme(themeName) {
17
- console.log("getdd", themeName);
18
17
  return themeMap[themeName];
19
18
  }
20
19
  function getCustomThemeOptions() {
@@ -510,9 +509,13 @@ export {
510
509
  clearChartSelected,
511
510
  executeChartFormula,
512
511
  exportCommonChart,
512
+ getAvgValue,
513
513
  getCustomTheme,
514
514
  getCustomThemeOptions,
515
+ getMaxValue,
516
+ getMinValue,
515
517
  getNumFormatter,
518
+ getSumValue,
516
519
  initChartOption,
517
520
  limitDatas,
518
521
  monitorChartClickToVariable,
@@ -133,11 +133,8 @@ function isNumber(numStr) {
133
133
  }
134
134
  }
135
135
  function isWorkflowPage(pageContext) {
136
- var _a;
137
- let isWorkflow = false;
138
- if ((_a = pageContext.props) == null ? void 0 : _a.activeWorkflow) {
139
- isWorkflow = pageContext.workflowCode ? true : false;
140
- }
136
+ const isWorkflow = pageContext.isWorkflowEntity ? true : pageContext.workflowCode ? true : false;
137
+ console.log("isWorkflowPage----isWorkflow=", isWorkflow, "pageContext.isWorkflowEntity=", pageContext.isWorkflowEntity, "pageContext.workflowCode=", pageContext.workflowCode);
141
138
  return isWorkflow;
142
139
  }
143
140
  function refreshMobileDialogType(jumpPageSetting, isMobile) {
@@ -121,8 +121,8 @@ function handleEventUtil($event, pageContext, configure, eventType, isExecute, o
121
121
  const tableUuid = getTableUuid(pageContext, configure);
122
122
  if (tableUuid) {
123
123
  const gridRef = getComponentRef(pageContext, tableUuid);
124
- const selections = gridRef.getSelections();
125
- const selectionIds = gridRef.getSelectionIds();
124
+ const selections = gridRef ? gridRef.getSelections() : null;
125
+ const selectionIds = gridRef ? gridRef.getSelectionIds() : null;
126
126
  if (!otherParams) {
127
127
  otherParams = {};
128
128
  }
@@ -134,7 +134,7 @@ function handleEventUtil($event, pageContext, configure, eventType, isExecute, o
134
134
  otherParams["id"] = selectionIds && selectionIds.length > 0 ? selectionIds[0] : null;
135
135
  otherParams["ids"] = selectionIds;
136
136
  }
137
- const tableConfigure = gridRef.getTableConfigure();
137
+ const tableConfigure = gridRef ? gridRef.getTableConfigure() : null;
138
138
  otherParams["tableConfigure"] = tableConfigure;
139
139
  }
140
140
  const eventParams = packageEventParams(pageContext, configure, $event, otherParams);
@@ -57,7 +57,7 @@ export declare function getSaveFormRequest(pageContext: PageContext, configureOb
57
57
  */
58
58
  export declare function dealAfterOperate(pageContext: any, configureObj: any, data: any, successTip: any, isListButton?: boolean): void;
59
59
  export declare function updateValuesWhenCloseDialog(parentPageContext: any, parentConfigureObj: any, sourceModel: any, sourceTableName: any): void;
60
- export declare function refreshFormOrListPage(pageContext: any, configureObj: any): void;
60
+ export declare function refreshFormOrListPage(pageContext: any, configureObj: any, isRefreshWhenClosePopup: any): void;
61
61
  export declare function doImportFinally(params: any, fileObj: any): void;
62
62
  export declare function judgeDataNumber(buttonConfigureObj: any, ids: any): boolean;
63
63
  export declare function dealCompleteTaskParam(commonEntity: any, isInit: any, pageContext: any, params?: any, operationResult?: any): boolean;
@@ -743,9 +743,9 @@ function dealAfterWithList(pageContext, configureObj, row, successTip) {
743
743
  });
744
744
  }
745
745
  }
746
- function refreshFormOrListPage(pageContext, configureObj) {
747
- let successOperation = configureObj.props.base.successOperation;
748
- console.log("refreshFormOrListPage22=====successOperation=", successOperation);
746
+ function refreshFormOrListPage(pageContext, configureObj, isRefreshWhenClosePopup) {
747
+ let successOperation = isRefreshWhenClosePopup ? "refresh" : configureObj.props.base.successOperation;
748
+ console.log("refreshFormOrListPage22=====successOperation=", successOperation, "isRefreshWhenClosePopup=", isRefreshWhenClosePopup);
749
749
  const buttonForPageType = getPageType(pageContext, configureObj);
750
750
  console.log("refreshFormOrListPage22=====buttonForPageType=", buttonForPageType);
751
751
  if (buttonForPageType && buttonForPageType === "list" && !successOperation) {
@@ -4,6 +4,7 @@ import { getComponentRef, getComponentRefByCode, getAllComponentRefs } from "../
4
4
  import { getI18n } from "agilebuilder-ui/src/utils/util";
5
5
  import { getAdditionalParamMap } from "./standard-event.js";
6
6
  import { isPromise } from "agilebuilder-ui/src/utils/common-util";
7
+ import { isWorkflowPage } from "../common-util.js";
7
8
  function setObjectPropRule(prop, rules, leafRule) {
8
9
  const rule = {};
9
10
  if (!rules) {
@@ -181,7 +182,7 @@ function validateDataModelFunc(pageContext, configureObj, isEnableRequired) {
181
182
  }
182
183
  function validateDataModel(isEnableRequired, dataModel, rules, pageContext) {
183
184
  if (isEnableRequired) {
184
- const isWorkflow = pageContext.workflowCode ? true : false;
185
+ const isWorkflow = isWorkflowPage(pageContext);
185
186
  if (isWorkflow) {
186
187
  return validateWorkflowFormDataModel(dataModel, pageContext, rules);
187
188
  } else {
@@ -487,7 +487,6 @@ function getValueFromSource(valueSource, paramName, paramType) {
487
487
  return getValueFromSource(childValue, newParamName, paramType);
488
488
  } else {
489
489
  if (paramType == "context") {
490
- console.log("newDate", paramName);
491
490
  if (paramName == "currentDate" || paramName == "currentTime") {
492
491
  return /* @__PURE__ */ new Date();
493
492
  } else if (paramName.startsWith("currentDate") && paramName.length > 11) {
@@ -4,7 +4,7 @@ import { PageDimensions } from "./interfaces/page-design-types.js";
4
4
  import { setVariableValue, formatVariableValue, getFormPropName } from "./page-helper-util.js";
5
5
  import { getSessionCache } from "agilebuilder-ui/src/utils/auth";
6
6
  import { functions } from "./api/page-expose-util.js";
7
- import { deepCopy } from "./common-util.js";
7
+ import { isWorkflowPage, deepCopy } from "./common-util.js";
8
8
  function queryPageDesignByCode(pageCode) {
9
9
  return http.get(
10
10
  window["$vueApp"].config.globalProperties.baseAPI + "/component/super-page-design/runtime/" + pageCode
@@ -49,6 +49,10 @@ function convertToPageContext(pageDesign, pageRequest) {
49
49
  refercePropMap: (_a = pageDesign.runtime) == null ? void 0 : _a.refercePropMap,
50
50
  //当前表单页面中引用字段信息集合,get请求时需要使用,格式为{tableName:[字段名,.. ... ], tableName:[字段名,.. ... ]}
51
51
  subTableWatchProps: pageDesign.subTableWatchProps,
52
+ dataTypeMaps: pageDesign.dataTypeMaps,
53
+ // 列表页面时后台会传该属性到前端
54
+ isWorkflowEntity: pageDesign.isWorkflowEntity,
55
+ // 列表页面时后台会传该属性到前端。列表删除时会用到该属性。
52
56
  entity: {
53
57
  data: {},
54
58
  task: {},
@@ -279,17 +283,15 @@ function queryPageSuperGrids(pageDesign, pageContext, publishVersion) {
279
283
  tableRuntimes,
280
284
  additionalParamMapJson,
281
285
  pageCode,
282
- publishVersion
286
+ publishVersion,
287
+ pageType: pageDesign.pageType
283
288
  }
284
289
  );
285
290
  }
286
291
  function packageFormRules(pageContext, configure) {
287
- var _a, _b, _c;
292
+ var _a, _b;
288
293
  const prop = configure.props && configure.props.base ? configure.props.base.prop : null;
289
- let isWorkflow = false;
290
- if ((_a = pageContext.props) == null ? void 0 : _a.activeWorkflow) {
291
- isWorkflow = pageContext.workflowCode ? true : false;
292
- }
294
+ let isWorkflow = isWorkflowPage(pageContext);
293
295
  let allFieldsDisabled = false;
294
296
  if (isWorkflow) {
295
297
  console.log(
@@ -300,7 +302,7 @@ function packageFormRules(pageContext, configure) {
300
302
  );
301
303
  if (configure.name !== "button-detail" && pageContext.fieldPermissionMap) {
302
304
  const allFields = pageContext.fieldPermissionMap.get("all_fields");
303
- if ((allFields == null ? void 0 : allFields["canEdit"]) === false && ((_b = configure.runtime) == null ? void 0 : _b.props)) {
305
+ if ((allFields == null ? void 0 : allFields["canEdit"]) === false && ((_a = configure.runtime) == null ? void 0 : _a.props)) {
304
306
  configure.runtime.props.state = "disabled";
305
307
  allFieldsDisabled = true;
306
308
  }
@@ -340,7 +342,7 @@ function packageFormRules(pageContext, configure) {
340
342
  configure.runtime.props.state = "";
341
343
  }
342
344
  }
343
- if ((_c = configure.props) == null ? void 0 : _c.customRuleEvents) {
345
+ if ((_b = configure.props) == null ? void 0 : _b.customRuleEvents) {
344
346
  if (!pageContext.customRuleEvents) {
345
347
  pageContext.customRuleEvents = [];
346
348
  }
@@ -1,10 +1,7 @@
1
- import { getBaseUrl } from "./common-util.js";
2
- import http from "agilebuilder-ui/src/utils/request";
1
+ import "agilebuilder-ui/src/utils/common-util";
2
+ import "agilebuilder-ui/src/utils/util";
3
+ import "agilebuilder-ui/src/utils/request";
3
4
  import eventBus from "./eventBus.js";
4
- function getDataTypeMapRequest(backendUrl, tableName, isTest) {
5
- const baseUrl = getBaseUrl(backendUrl, isTest);
6
- return http.get(baseUrl + "/dsc/commons/tables/" + tableName + "/data-types");
7
- }
8
5
  function popupToPage(params) {
9
6
  const pageCode = params.pageContext && params.pageContext.code;
10
7
  console.log("弹框显示页面--popupToPage====params=", params);
@@ -22,7 +19,6 @@ function getTableNameByTableUuid(pageContext, tableUuid) {
22
19
  return tableConfigure && tableConfigure.props && tableConfigure.props.dataOrigin ? tableConfigure.props.dataOrigin.tableName : null;
23
20
  }
24
21
  export {
25
- getDataTypeMapRequest,
26
22
  getTableNameByTableUuid,
27
23
  popupToPage
28
24
  };
@@ -22,7 +22,6 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
22
22
  return props.pageContext.canClick !== void 0 && props.pageContext.clickUuid !== void 0 ? !props.pageContext.canClick && props.pageContext.clickUuid === props.configure.uuid : false;
23
23
  }
24
24
  onMounted(() => {
25
- console.log("button-----onMounted");
26
25
  });
27
26
  return (_ctx, _cache) => {
28
27
  const _component_el_button = resolveComponent("el-button");
@@ -1,20 +1,22 @@
1
- import { getValueFromVariable } from "../../../../utils/page-helper-util.js";
1
+ import { getParamNames, getValueFromVariable } from "../../../../utils/page-helper-util.js";
2
2
  import { getCustomFunc } from "../../../../utils/events/event-util.js";
3
+ import { getMinValue, getMaxValue, getSumValue, getAvgValue } from "../../../../utils/charts/chart-util.js";
4
+ import "element-plus/es/locale/index.mjs";
3
5
  class ExpressionEvaluator {
4
- static evaluate(pageContext, conditions, data) {
6
+ static evaluate(pageContext, conditions, data2) {
5
7
  const expressions = conditions.map(
6
- (condition) => this.createExpression(pageContext, condition, data)
8
+ (condition) => this.createExpression(pageContext, condition, data2)
7
9
  );
8
10
  const joinedExpression = expressions.join(" ");
9
11
  return this.evaluateExpression(joinedExpression);
10
12
  }
11
- static createExpression(pageContext, condition, data) {
13
+ static createExpression(pageContext, condition, data2) {
12
14
  const { propName, operator, propValue, leftBracket, rightBracket, joinSign, dataType } = condition;
13
15
  if (!propName || propName === "") {
14
16
  return "";
15
17
  }
16
- const value = getValueFromVariable(pageContext.entity, propName, data);
17
- let expression2 = `${leftBracket} ${this.getComparisonExpression(value, operator, getValueFromVariable(pageContext.entity, propValue, data), dataType)} ${rightBracket}`;
18
+ const value = getValueFromVariable(pageContext.entity, propName, data2);
19
+ let expression2 = `${leftBracket} ${this.getComparisonExpression(value, operator, getValueFromVariable(pageContext.entity, propValue, data2), dataType)} ${rightBracket}`;
18
20
  if (joinSign) {
19
21
  if (joinSign === "and" || joinSign === "AND") {
20
22
  expression2 += "&&";
@@ -91,8 +93,9 @@ class ExpressionEvaluator {
91
93
  }
92
94
  }
93
95
  function getSummaryTitleColumn(configure) {
96
+ var _a;
94
97
  const result = {};
95
- if (configure.props.summaries.titleColumn && configure.props.summaries.titleColumn.length > 0) {
98
+ if (((_a = configure.props.summaries) == null ? void 0 : _a.titleColumn) && configure.props.summaries.titleColumn.length > 0) {
96
99
  configure.props.summaries.titleColumn.forEach((item) => {
97
100
  result[item.prop] = item;
98
101
  });
@@ -100,11 +103,12 @@ function getSummaryTitleColumn(configure) {
100
103
  return result;
101
104
  }
102
105
  function getSummaryDataColumn(configure, type) {
106
+ var _a;
103
107
  const result = {};
104
- if (configure.props.summaries.dataColumn && configure.props.summaries.dataColumn.length > 0) {
108
+ if (((_a = configure.props.summaries) == null ? void 0 : _a.dataColumn) && configure.props.summaries.dataColumn.length > 0) {
105
109
  configure.props.summaries.dataColumn.forEach((item) => {
106
- var _a;
107
- const columnConfigs = (_a = configure.items) == null ? void 0 : _a.find(
110
+ var _a2;
111
+ const columnConfigs = (_a2 = configure.items) == null ? void 0 : _a2.find(
108
112
  (columnItem) => item.prop === columnItem.props.base.prop
109
113
  );
110
114
  if (columnConfigs) {
@@ -118,15 +122,15 @@ function getSummaryDataColumn(configure, type) {
118
122
  }
119
123
  return result;
120
124
  }
121
- function summaryStatistics(summaryColumn, data, prop, pageContext) {
125
+ function summaryStatistics(summaryColumn, data2, prop, pageContext) {
122
126
  let sumsIndex = "";
123
127
  const summaryMode = summaryColumn.summaryMode;
124
- const values = data.map((item) => Number(item[prop])).filter((value) => !Number.isNaN(value));
128
+ const values = data2.map((item) => Number(item[prop])).filter((value) => !Number.isNaN(value));
125
129
  if (values.length > 0) {
126
130
  if (summaryMode === "custom") {
127
131
  const func = getCustomFunc(pageContext, summaryColumn.customFunc);
128
132
  if (func) {
129
- const resultValue = func.apply(func, [{ data, prop }]);
133
+ const resultValue = func.apply(func, [{ data: data2, prop }]);
130
134
  if (resultValue) {
131
135
  sumsIndex = ` ${resultValue}`;
132
136
  } else {
@@ -158,23 +162,23 @@ function summaryStatistics(summaryColumn, data, prop, pageContext) {
158
162
  }
159
163
  return sumsIndex;
160
164
  }
161
- function replacePlaceholders(template, data) {
165
+ function replacePlaceholders(template, data2) {
162
166
  if (template) {
163
167
  return template.replace(/\$\{row\.(\w+)\}/g, (match, p1) => {
164
- return Object.prototype.hasOwnProperty.call(data, p1) ? data[p1] : "";
168
+ return Object.prototype.hasOwnProperty.call(data2, p1) ? data2[p1] : "";
165
169
  });
166
170
  }
167
171
  }
168
- function getHeaderCellStyleUtil(data, runtimeStyle, props) {
172
+ function getHeaderCellStyleUtil(data2, runtimeStyle, props) {
169
173
  var _a;
170
174
  const headerStyle = {};
171
- if (data.column.property) {
175
+ if (data2.column.property) {
172
176
  (_a = runtimeStyle.titleStyle) == null ? void 0 : _a.forEach((item) => {
173
- if (item.field && item.field.includes(data.column.property)) {
177
+ if (item.field && item.field.includes(data2.column.property)) {
174
178
  if (item.scopeFunc) {
175
179
  const func = getCustomFunc(props.pageContext, item.scopeFunc);
176
180
  if (func) {
177
- const funcResult = func.apply(func, [{ item, data }]);
181
+ const funcResult = func.apply(func, [{ item, data: data2 }]);
178
182
  if (funcResult !== false) {
179
183
  copyStyle(headerStyle, item);
180
184
  }
@@ -185,21 +189,22 @@ function getHeaderCellStyleUtil(data, runtimeStyle, props) {
185
189
  }
186
190
  });
187
191
  }
188
- const cellTitleStytle = getCellStyleUtil(data, runtimeStyle.cellTitleStyle, props);
192
+ const cellTitleStytle = getCellStyleUtil(data2, runtimeStyle.cellTitleStyle, props);
189
193
  if (cellTitleStytle) {
190
194
  Object.assign(headerStyle, cellTitleStytle);
191
195
  }
192
196
  return headerStyle;
193
197
  }
194
- function getRowStyleUtil(data, groupSummaryDataRowIndex, props) {
198
+ function getRowStyleUtil(data2, groupSummaryDataRowIndex, props) {
195
199
  const returnStyle = {};
200
+ console.log("getRowStyleUtil---props.configure---", props.configure);
196
201
  if (props.configure.style.rowStyle) {
197
202
  for (let i = 0; i < props.configure.style.rowStyle.length; i++) {
198
203
  const rowStyle = props.configure.style.rowStyle[i];
199
204
  if (rowStyle.scopeFunc) {
200
205
  const func = getCustomFunc(props.pageContext, rowStyle.scopeFunc);
201
206
  if (func) {
202
- const funcResult = func.apply(func, [{ data }]);
207
+ const funcResult = func.apply(func, [{ data: data2 }]);
203
208
  if (funcResult !== void 0 && funcResult !== null && funcResult !== false) {
204
209
  copyStyle(returnStyle, rowStyle);
205
210
  }
@@ -208,17 +213,19 @@ function getRowStyleUtil(data, groupSummaryDataRowIndex, props) {
208
213
  const result = ExpressionEvaluator.evaluate(
209
214
  props.pageContext,
210
215
  rowStyle.matchingCondition,
211
- data.row
216
+ data2.row
212
217
  );
213
218
  if (result || result === void 0) {
214
219
  copyStyle(returnStyle, rowStyle);
215
220
  }
216
221
  } else {
222
+ console.log("getRowStyleUtil---rowStyle---", rowStyle);
217
223
  copyStyle(returnStyle, rowStyle);
218
224
  }
219
225
  }
220
226
  }
221
- if (groupSummaryDataRowIndex && groupSummaryDataRowIndex.length > 0 && groupSummaryDataRowIndex.indexOf(data.rowIndex) !== -1) {
227
+ if (groupSummaryDataRowIndex && groupSummaryDataRowIndex.length > 0 && groupSummaryDataRowIndex.indexOf(data2.rowIndex) !== -1) {
228
+ console.log("getRowStyleUtil---groupSummaryDataRowIndex---", groupSummaryDataRowIndex);
222
229
  const result = {};
223
230
  if (props.configure.style.collectStyle && props.configure.style.collectStyle.length > 0) {
224
231
  for (let i = 0; i < props.configure.style.collectStyle.length; i++) {
@@ -231,9 +238,10 @@ function getRowStyleUtil(data, groupSummaryDataRowIndex, props) {
231
238
  }
232
239
  return result;
233
240
  }
241
+ console.log("getRowStyleUtil---returnStyle---", returnStyle);
234
242
  return returnStyle;
235
243
  }
236
- function getCellStyleUtil(data, cellStyles, props) {
244
+ function getCellStyleUtil(data2, cellStyles, props) {
237
245
  const cellStyle = {};
238
246
  if (cellStyles) {
239
247
  for (let i = 0; i < cellStyles.length; i++) {
@@ -241,7 +249,7 @@ function getCellStyleUtil(data, cellStyles, props) {
241
249
  if (columnsStyleSetting.scopeFunc) {
242
250
  const func = getCustomFunc(props.pageContext, columnsStyleSetting.scopeFunc);
243
251
  if (func) {
244
- const funcResult = func.apply(func, [{ data }]);
252
+ const funcResult = func.apply(func, [{ data: data2 }]);
245
253
  if (funcResult !== false) {
246
254
  copyStyle(cellStyle, columnsStyleSetting);
247
255
  }
@@ -250,7 +258,7 @@ function getCellStyleUtil(data, cellStyles, props) {
250
258
  const result = ExpressionEvaluator.evaluate(
251
259
  props.pageContext,
252
260
  columnsStyleSetting.matchingCondition,
253
- data.row
261
+ data2.row
254
262
  );
255
263
  if (result || result === void 0) {
256
264
  copyStyle(cellStyle, columnsStyleSetting);
@@ -268,39 +276,39 @@ function copyStyle(target, source) {
268
276
  Object.assign(target, JSON.parse(source.customStyle));
269
277
  }
270
278
  }
271
- function rowDataToColumn(data, configure) {
279
+ function rowDataToColumn(data2, configure) {
272
280
  const groupByFields = configure.props.dataOrigin.groupField;
273
281
  const titleColumns = configure.props.dataOrigin.rowToColumn.titleColumns;
274
282
  const dataColumns = configure.props.dataOrigin.rowToColumn.dataColumns;
275
283
  const result = [];
276
284
  const groupedData = {};
277
- data.forEach((item) => {
278
- const key = groupByFields.map((field) => item[field]).join("|");
279
- if (!groupedData[key]) {
285
+ data2.forEach((item) => {
286
+ const key2 = groupByFields.map((field) => item[field]).join("|");
287
+ if (!groupedData[key2]) {
280
288
  const group = {};
281
289
  groupByFields.forEach((field) => group[field] = item[field]);
282
- groupedData[key] = group;
290
+ groupedData[key2] = group;
283
291
  result.push(group);
284
292
  }
285
293
  dataColumns.forEach((valueField) => {
286
294
  const columnNameParts = titleColumns.map((field) => item[field]);
287
295
  const columnName = `${columnNameParts.join("")}${valueField}`;
288
- groupedData[key][columnName] = item[valueField];
296
+ groupedData[key2][columnName] = item[valueField];
289
297
  });
290
298
  });
291
299
  return result;
292
300
  }
293
- function colDataToRow(data, configure) {
301
+ function colDataToRow(data2, configure) {
294
302
  const groupByFields = configure.props.dataOrigin.groupField;
295
303
  const titleColumns = configure.props.dataOrigin.columnToRow.titleColumns;
296
304
  const dataColumns = configure.props.dataOrigin.columnToRow.dataColumns;
297
305
  const transColumns = configure.props.dataOrigin.columnToRow.transColumns;
298
306
  const dataColumnsMapping = configure.props.dataOrigin.columnToRow.dataColumnsMapping;
299
- if (data.length === 0) {
300
- return data;
307
+ if (data2.length === 0) {
308
+ return data2;
301
309
  }
302
310
  const result = [];
303
- const newData = groupBy(data, groupByFields);
311
+ const newData = groupBy(data2, groupByFields);
304
312
  const dataColumnsConfig = dataColumns.reduce((max, current) => {
305
313
  return current.columns.length > max.columns.length ? current : max;
306
314
  }, dataColumns[0]);
@@ -410,22 +418,22 @@ function getColumnToRowTableConfig(configure) {
410
418
  });
411
419
  return newTableColumns;
412
420
  }
413
- function groupBy(data, groupFields) {
421
+ function groupBy(data2, groupFields) {
414
422
  const grouped = {};
415
- data.forEach((item) => {
416
- const key = groupFields.map((field) => item[field]).join("|");
417
- if (!grouped[key]) {
418
- grouped[key] = {
423
+ data2.forEach((item) => {
424
+ const key2 = groupFields.map((field) => item[field]).join("|");
425
+ if (!grouped[key2]) {
426
+ grouped[key2] = {
419
427
  ...item,
420
428
  // 复制所有字段
421
429
  records: []
422
430
  // 初始化记录数组
423
431
  };
424
- groupFields.forEach((field, index) => {
425
- grouped[key][field] = item[field];
432
+ groupFields.forEach((field, index2) => {
433
+ grouped[key2][field] = item[field];
426
434
  });
427
435
  }
428
- grouped[key].records.push(item);
436
+ grouped[key2].records.push(item);
429
437
  });
430
438
  return Object.values(grouped).map((group) => ({
431
439
  ...group,
@@ -463,16 +471,59 @@ function getIndexColumn() {
463
471
  }
464
472
  };
465
473
  }
466
- function computeFormula(row, formula) {
467
- try {
468
- return new Function(
469
- "row",
470
- `return ${formula.replace(/\$\{row\.(\w+)\}/g, (_, key) => `row.${key}`)}`
471
- )(row);
472
- } catch (error) {
473
- console.error("数据公式解析错误:", error);
474
- return 0;
475
- }
474
+ function computeFormula(itemConfs, datas) {
475
+ Object.keys(itemConfs).forEach((key) => {
476
+ const paramNames = getParamNames(itemConfs[key]);
477
+ datas.forEach((data, index) => {
478
+ const totalValueMap = {};
479
+ for (const paramName of paramNames) {
480
+ if (paramName.startsWith("${min.")) {
481
+ totalValueMap[paramName] = getMinValue(datas, getFieldName(paramName));
482
+ } else if (paramName.startsWith("${max.")) {
483
+ totalValueMap[paramName] = getMaxValue(datas, getFieldName(paramName));
484
+ } else if (paramName.startsWith("${sum.")) {
485
+ totalValueMap[paramName] = getSumValue(datas, getFieldName(paramName));
486
+ } else if (paramName.startsWith("${avg.")) {
487
+ totalValueMap[paramName] = getAvgValue(datas, getFieldName(paramName));
488
+ } else if (paramName.startsWith("${add.")) {
489
+ const fieldName = getFieldName(paramName);
490
+ let currentRowValue = 0;
491
+ try {
492
+ currentRowValue = Number(data[fieldName]);
493
+ datas.slice(0, index).forEach((item) => {
494
+ currentRowValue += Number(item[fieldName]);
495
+ });
496
+ } catch (e) {
497
+ console.error("计算错误:", e);
498
+ currentRowValue = 0;
499
+ }
500
+ totalValueMap[paramName] = currentRowValue;
501
+ } else if (paramName.startsWith("${row.")) {
502
+ totalValueMap[paramName] = data[getFieldName(paramName)];
503
+ }
504
+ }
505
+ let expr = itemConfs[key];
506
+ Object.keys(totalValueMap).forEach((exprParam) => {
507
+ if (expr.indexOf(exprParam) > -1) {
508
+ expr = expr.replaceAll(exprParam, totalValueMap[exprParam]);
509
+ }
510
+ });
511
+ for (const paramName of paramNames) {
512
+ if (expr.indexOf(paramName) > -1) {
513
+ expr = expr.replaceAll(paramName, 0);
514
+ }
515
+ }
516
+ try {
517
+ data[key] = eval(expr);
518
+ } catch (e) {
519
+ console.error(itemConfs[key] + " 计算错误, 替换后表达式为:" + expr, e);
520
+ data[key] = 0;
521
+ }
522
+ });
523
+ });
524
+ }
525
+ function getFieldName(paramName) {
526
+ return paramName.substring(6, paramName.length - 1);
476
527
  }
477
528
  export {
478
529
  ExpressionEvaluator,
@@ -36,7 +36,6 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
36
36
  resloveLinkText.value = true;
37
37
  }
38
38
  function formatter(row, column, cellValue, index) {
39
- console.log("formatter", row);
40
39
  }
41
40
  function showLink(row) {
42
41
  var _a;
@@ -91,7 +90,6 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
91
90
  }
92
91
  }
93
92
  function formatContent(row, format) {
94
- console.log("formatContent", row, format);
95
93
  const value = row[props.column.props.base.prop];
96
94
  switch (format.type) {
97
95
  case "number":
@@ -1,6 +1,6 @@
1
- import { defineComponent, ref, onMounted, resolveComponent, openBlock, createElementBlock, normalizeStyle, unref, normalizeClass, withDirectives, createVNode, vShow, withCtx, Fragment, renderList, createBlock, createCommentVNode, 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, setValueForVariableName, updateChartDatasourcesByComponent } 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";
@@ -78,6 +78,17 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
78
78
  const resultData = getChartDatasFromPage(props.pageContext, props.configure);
79
79
  if (resultData) {
80
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
+ }
81
92
  }
82
93
  });
83
94
  function watchVariableDataChange() {
@@ -169,12 +180,7 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
169
180
  }
170
181
  }
171
182
  if (Object.keys(dataFormulaMapping.value).length > 0 && tmpTableData2 && tmpTableData2.length > 0) {
172
- tmpTableData2.forEach((item) => {
173
- Object.keys(dataFormulaMapping.value).forEach((key) => {
174
- const formula = dataFormulaMapping.value[key];
175
- item[key] = computeFormula(item, formula);
176
- });
177
- });
183
+ computeFormula(dataFormulaMapping.value, tmpTableData2);
178
184
  }
179
185
  if ((_a2 = props.configure.pageination) == null ? void 0 : _a2.enable) {
180
186
  tableDataPageination(resultData);
@@ -15,11 +15,8 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
15
15
  const runtimeStyle = ref(runtimeInfo.style ? runtimeInfo.style : {});
16
16
  const runtimeClass = runtimeInfo.class;
17
17
  onMounted(() => {
18
- console.log("tools-runtime.vue-onMounted");
19
18
  if (thisRef.value && thisRef.value.parentNode) {
20
19
  const resizeObserver2 = new ResizeObserver((entries) => {
21
- for (let entry of entries) {
22
- }
23
20
  caculatePositionStyle();
24
21
  });
25
22
  resizeObserver2.observe(thisRef.value.parentNode);
@@ -1,22 +1,21 @@
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, isVariableInvalidValue } 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";
11
10
  import { getRowStyleUtil, getCellStyleUtil, getHeaderCellStyleUtil } from "../../chart/table/chart-table-util.js";
12
- import "../../../../utils/global-refs.js";
13
11
  const _sfc_main = /* @__PURE__ */ defineComponent({
14
12
  __name: "main-table-runtime",
15
13
  props: {
16
14
  pageContext: {},
17
15
  configure: {}
18
16
  },
19
- setup(__props, { expose: __expose }) {
17
+ emits: ["setSafeDeleteTableCode"],
18
+ setup(__props, { expose: __expose, emit: __emit }) {
20
19
  const props = __props;
21
20
  const pageContext = props.pageContext;
22
21
  let configure = props.configure;
@@ -39,6 +38,7 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
39
38
  baseURL = window["$vueApp"].config.globalProperties.baseURL;
40
39
  }
41
40
  const operationButtonObj = ref({});
41
+ const linkageVariable = [];
42
42
  const listOptions = ref({});
43
43
  listOptions.value = getOptions();
44
44
  const gridRef = ref();
@@ -53,7 +53,7 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
53
53
  const superGridSetting = superGridItems ? superGridItems[configure.uuid] : null;
54
54
  console.log("superGridSetting1111===", superGridItems, superGridSetting);
55
55
  const isCanShowMobileSearch = ref(false);
56
- const linkageVariable = [];
56
+ const $emit = __emit;
57
57
  onMounted(() => {
58
58
  window.addEventListener("message", recieveMessage);
59
59
  eventBus.$on(
@@ -78,6 +78,9 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
78
78
  gridRef.value.scanDone(data);
79
79
  });
80
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
+ }
81
84
  });
82
85
  watch(
83
86
  () => props.pageContext.searchFormData,
@@ -144,7 +147,7 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
144
147
  // 是否启用回车事件
145
148
  isWithDataPermission: configure.props && configure.props.otherSettings && configure.props.otherSettings.isWithDataPermission ? configure.props.otherSettings.isWithDataPermission : false,
146
149
  pageDevMode: false,
147
- isWorkflowEntity: pageContext.workflowCode ? true : false,
150
+ isWorkflowEntity: isWorkflowPage(pageContext),
148
151
  tableClass: runtimeClass,
149
152
  tableStyle: runtimeStyle,
150
153
  pageContext,
@@ -156,21 +159,16 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
156
159
  };
157
160
  setOperationButtons(options);
158
161
  setSortInfo(options);
159
- const getDataTypeMap = myGetDataTypeMap();
160
- if (getDataTypeMap) {
161
- getDataTypeMap.then(() => {
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
- }
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]);
172
167
  }
173
168
  });
169
+ if (linkageVariable.length > 0) {
170
+ addLinkageWatch();
171
+ }
174
172
  }
175
173
  setTreeSetting(options);
176
174
  setGridEvents(options);
@@ -188,17 +186,6 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
188
186
  });
189
187
  }
190
188
  }
191
- function myGetDataTypeMap(options) {
192
- if (!backendUrl && !tableName) {
193
- return;
194
- }
195
- return getDataTypeMapRequest(backendUrl, tableName, pageContext.isTest).then((result) => {
196
- if (!pageContext["dataTypeMaps"]) {
197
- pageContext["dataTypeMaps"] = {};
198
- }
199
- pageContext["dataTypeMaps"][tableName] = result["dataTypeMap"];
200
- });
201
- }
202
189
  function setOperationButtons(options) {
203
190
  const showOperation = configure.props && configure.props.base ? configure.props.base.showOperation : false;
204
191
  const operationButtonSettings = configure.btnList;
@@ -500,11 +487,11 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
500
487
  }
501
488
  }
502
489
  function searchGridData(data) {
503
- if (!pageContext["dataTypeMaps"] || !pageContext["dataTypeMaps"][tableName]) {
490
+ if (!pageContext["dataTypeMaps"]) {
504
491
  console.log("!pageContext['dataTypeMaps'] || !pageContext['dataTypeMaps'][tableName]");
505
492
  return;
506
493
  }
507
- const dataTypeObj = pageContext["dataTypeMaps"][tableName];
494
+ const dataTypeObj = pageContext["dataTypeMaps"];
508
495
  let toolbarFieldParam = [];
509
496
  if (data) {
510
497
  for (var key in data) {
@@ -707,7 +694,7 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
707
694
  gridRef.value.showMobileSearch();
708
695
  }
709
696
  }
710
- function canShowMobileSearch(listCode2) {
697
+ function canShowMobileSearchFunc(listCode2) {
711
698
  isCanShowMobileSearch.value = true;
712
699
  }
713
700
  function getRowStyle(data) {
@@ -830,7 +817,7 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
830
817
  onHeaderClick: headerClickEvent,
831
818
  onRefresh: clearSelections,
832
819
  onNewOpenGridDialog: unref(popupToPage),
833
- onCanShowMobileSearch: canShowMobileSearch
820
+ onCanShowMobileSearch: canShowMobileSearchFunc
834
821
  }, null, 8, ["url", "options", "code", "settings", "search-form-info", "list-toolbar-form-data", "onNewOpenGridDialog"])
835
822
  ]);
836
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);
@@ -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
  }
@@ -81,13 +88,15 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
81
88
  ref_key: "gridRef",
82
89
  ref: gridRef,
83
90
  pageContext: _ctx.pageContext,
84
- configure: tableConfigure.value
91
+ configure: tableConfigure.value,
92
+ onSetSafeDeleteTableCode: setSafeDeleteTableCode
85
93
  }, null, 8, ["pageContext", "configure"])) : (openBlock(), createBlock(_sfc_main$2, {
86
94
  key: 1,
87
95
  ref_key: "gridRef",
88
96
  ref: gridRef,
89
97
  pageContext: _ctx.pageContext,
90
- configure: tableConfigure.value
98
+ configure: tableConfigure.value,
99
+ onSetSafeDeleteTableCode: setSafeDeleteTableCode
91
100
  }, null, 8, ["pageContext", "configure"]))
92
101
  ]);
93
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;
@@ -45,8 +45,6 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
45
45
  return value;
46
46
  }
47
47
  if (formatStr) {
48
- console.log("formatStr", formatStr);
49
- console.log("before", value);
50
48
  try {
51
49
  const convertValue = dayjs(value);
52
50
  let value2 = null;
@@ -55,7 +53,6 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
55
53
  } else {
56
54
  value2 = dayjs(value).format(formatStr);
57
55
  }
58
- console.log("after", value2);
59
56
  return value2;
60
57
  } catch (e) {
61
58
  console.error("日期值格式化错误", e);
@@ -24,9 +24,7 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
24
24
  const pathFields = getFieldsByVariable(propsBase.prop);
25
25
  const nameFields = getFieldsByVariable(propsBase.propName);
26
26
  const pageCode = props.pageContext.code;
27
- console.log("pathFields-----", pathFields, "pageCode=", pageCode, "propsBase.prop=", propsBase.prop);
28
27
  const componentId = ref(pathFields ? pageCode + "__" + pathFields.join("__") : null);
29
- console.log("componentId-----", componentId.value);
30
28
  const initPaths = getVariableValue(entity, pathFields);
31
29
  const fileUploadRef = ref(null);
32
30
  const fileList = ref([]);
@@ -21,18 +21,9 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
21
21
  let dynamicFields = getFormModelFields(props.pageContext, props.configure);
22
22
  const isMobile = ref(isMobileBrowser());
23
23
  const pageCode = props.pageContext.code;
24
- console.log(
25
- "pathFields-----",
26
- dynamicFields,
27
- "pageCode=",
28
- pageCode,
29
- "props.configure=",
30
- props.configure
31
- );
32
24
  const componentId = ref(
33
25
  dynamicFields && dynamicFields.length > 0 ? pageCode + "__" + dynamicFields.join("__") : null
34
26
  );
35
- console.log("componentId-----", componentId.value);
36
27
  const dynamicModelMethod = computed({
37
28
  get() {
38
29
  return getVariableValue(entity, dynamicFields);
@@ -66,11 +57,10 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
66
57
  } else {
67
58
  userAgent = "browser";
68
59
  }
69
- console.log("window.location.protocol---", window.location.protocol);
60
+ const isApk = isMobile.value && userAgent && userAgent === "app" ? true : false;
70
61
  const isShowScanIcon = ref(
71
- isMobile.value && scanEnable.value && window.location.protocol === "https:" ? true : false
62
+ isApk && scanEnable.value || isMobile.value && scanEnable.value && window.location.protocol === "https:" ? true : false
72
63
  );
73
- const isApk = isMobile.value && userAgent && userAgent === "app" ? true : false;
74
64
  let scanRuleSets = {};
75
65
  if (((_b = designProperty.value.scan) == null ? void 0 : _b.enable) && ((_c = designProperty.value.scan.ruleList) == null ? void 0 : _c.length) > 0) {
76
66
  setScanRuleSets();
@@ -25,7 +25,6 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
25
25
  const dynamicModelMethod = computed({
26
26
  get() {
27
27
  let val = getVariableValue(entity, dynamicFields);
28
- console.log("select组件----dynamicModelMethod---get-111-val", val);
29
28
  if (val !== void 0 && val !== null) {
30
29
  val = val + "";
31
30
  }
@@ -34,7 +33,6 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
34
33
  val = val.split(",");
35
34
  }
36
35
  }
37
- console.log("select组件----dynamicModelMethod---get222--val", val);
38
36
  return val;
39
37
  },
40
38
  set(value) {
@@ -43,7 +41,6 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
43
41
  value = value.join(",");
44
42
  }
45
43
  }
46
- console.log("select组件----dynamicModelMethod---set--value", value);
47
44
  setVariableValue(entity, dynamicFields, value);
48
45
  }
49
46
  });
@@ -52,7 +49,6 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
52
49
  if (cacheOptions.length > 0) {
53
50
  listOptions.value = cacheOptions;
54
51
  }
55
- console.log("select组件----listOptions.value=", listOptions.value);
56
52
  const queryLoadingFlag = ref(false);
57
53
  const dataOrigin = props.configure.props && props.configure.props.dataOrigin ? props.configure.props.dataOrigin : {};
58
54
  const valueType = dataOrigin.optionValueSetType;
@@ -163,10 +159,8 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
163
159
  }
164
160
  function updateOptions(newOptions) {
165
161
  listOptions.value = newOptions ? newOptions : [];
166
- console.log("updateOptions", newOptions);
167
162
  }
168
163
  onMounted(() => {
169
- console.log("select-----onMounted");
170
164
  });
171
165
  __expose({
172
166
  updateOptions
@@ -14,13 +14,12 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
14
14
  configure: {}
15
15
  },
16
16
  setup(__props) {
17
- var _a;
17
+ var _a, _b;
18
18
  const props = __props;
19
19
  if (props.configure.style == void 0) {
20
20
  props.configure.style = {};
21
21
  }
22
22
  const permissionCodes = getPermissionCodes(props.configure, props.pageContext);
23
- console.log("Object-Render---permissionCodes=", permissionCodes);
24
23
  if (props.configure && props.configure.props && props.configure.props.base) {
25
24
  props.configure.props.base.functionCode = permissionCodes;
26
25
  }
@@ -51,13 +50,12 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
51
50
  }
52
51
  }
53
52
  }
54
- console.log("obj-render-dynamicShowFlag", dynamicShowFlag);
55
53
  return dynamicShowFlag;
56
54
  });
57
55
  const propConfigure = props.configure;
58
56
  propConfigure._dynamicShowFlag = showFlag;
59
- if (props.configure.props.editConditions) {
60
- const editConditions = props.configure.props.editConditions;
57
+ if ((_b = props.configure.props.base) == null ? void 0 : _b.editConditions) {
58
+ const editConditions = props.configure.props.base.editConditions;
61
59
  if (editConditions.length > 0) {
62
60
  const runtime = props.configure.runtime ? props.configure.runtime : {};
63
61
  const property = runtime.props ? runtime.props : {};
@@ -3,7 +3,7 @@ import _sfc_main$1 from "./assemblys/object-render.vue.js";
3
3
  import { updateOptionDatasources, updateChartDatasources } from "../utils/page-helper-util.js";
4
4
  import { queryPageSuperGrids, queryPageDesignByCode, convertToPageContext, packageAdditionalMapWithRoute } from "../utils/page-init-util.js";
5
5
  import { addComponentRef, removePageAllRef, initComponentRefState } from "../utils/global-refs.js";
6
- import { removeCustomFuncFromWindow, handleEvent, initPageEvents } from "../utils/events/event-util.js";
6
+ import { removeCustomFuncFromWindow, handleEvent, initPageEvents, getCustomFunc } from "../utils/events/event-util.js";
7
7
  import _sfc_main$2 from "./assemblys/common/export-form-report-dialog.vue.js";
8
8
  import _sfc_main$3 from "./assemblys/common/task-informition-dialog.vue.js";
9
9
  import _sfc_main$4 from "./assemblys/common/remove-signer-dialog.vue.js";
@@ -17,10 +17,11 @@ import { i18nValidateRulesMessage } from "../utils/events/validator-util.js";
17
17
  import _sfc_main$5 from "./super-page-dialog.vue.js";
18
18
  import { useRoute, useRouter } from "vue-router";
19
19
  import { jumpToPage } from "agilebuilder-ui/src/utils/jump-page-utils";
20
- import { setSessionCache } from "agilebuilder-ui/src/utils/auth";
20
+ import { setSessionCache, getUsername } from "agilebuilder-ui/src/utils/auth";
21
21
  import { deepCopy, isNumber, refreshMobileDialogType } from "../utils/common-util.js";
22
22
  import { isMobileBrowser } from "agilebuilder-ui/src/utils/common-util";
23
23
  import { usePageContextStore } from "../utils/page-store.js";
24
+ import imatrixUiStore from "agilebuilder-ui/src/store";
24
25
  const _hoisted_1 = { class: "app-container" };
25
26
  const _sfc_main = /* @__PURE__ */ defineComponent({
26
27
  __name: "super-page",
@@ -236,7 +237,6 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
236
237
  pageContext2.initChartData = {};
237
238
  pageContext2.initChartData.data = deepCopy(pageContext2.entity.data);
238
239
  pageContext2.initChartData.page = deepCopy(pageContext2.entity.page);
239
- console.log("pageContext.chartConfigs:", chartConfigs);
240
240
  if (chartConfigs && chartConfigs.length > 0) {
241
241
  updateChartDatasources(pageContext2, chartConfigs, null, true);
242
242
  }
@@ -271,8 +271,10 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
271
271
  setTimeout(() => {
272
272
  initPageDesign(props.pageDesign).then(() => {
273
273
  if (props.pageDesign.tableRuntimes && Object.keys(props.pageDesign.tableRuntimes).length > 0) {
274
- queryPageSuperGrids(props.pageDesign, pageContext.value, props.publishVersion).then((superGridItems) => {
275
- pageContext.value.superGridItems = superGridItems;
274
+ queryPageSuperGrids(props.pageDesign, pageContext.value, props.publishVersion).then((result) => {
275
+ pageContext.value.isWorkflowEntity = result.isWorkflowEntity;
276
+ pageContext.value.dataTypeMaps = result.dataTypeMaps;
277
+ pageContext.value.superGridItems = result.superGrids;
276
278
  }).catch((error) => {
277
279
  console.log("queryPageSuperGrids error", error);
278
280
  }).finally(() => {
@@ -443,6 +445,27 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
443
445
  }
444
446
  });
445
447
  }
448
+ function getCurrentUserPermissionsWhenPopPageDiff(popPageSetting, jumpMode) {
449
+ const loginName = getUsername();
450
+ return new Promise((resolve, reject) => {
451
+ if (loginName) {
452
+ debugger;
453
+ if ((jumpMode === "popup" || isMobile) && parentPageContext.value.systemCode !== popPageSetting.customSystem) {
454
+ const systemCode = popPageSetting.customSystem;
455
+ imatrixUiStore.dispatch("getCurrentUserPermissions", { loginName, systemCode }).then(() => {
456
+ resolve(true);
457
+ }).catch(() => {
458
+ console.log("获得用户权限失败");
459
+ resolve(true);
460
+ });
461
+ } else {
462
+ resolve(true);
463
+ }
464
+ } else {
465
+ resolve(true);
466
+ }
467
+ });
468
+ }
446
469
  const router = useRouter();
447
470
  function openDialog(configureObj, eventParams, myJumpPageSetting) {
448
471
  getPopPageSetting(configureObj, eventParams, myJumpPageSetting).then((openPageParams) => {
@@ -469,31 +492,32 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
469
492
  popPageSetting.isNewPage = true;
470
493
  if (jumpMode === "popup" || jumpMode === "refresh") {
471
494
  const linkType = popPageSetting.linkType;
472
- if (isMobile && (parentPageContext.value.systemCode !== popPageSetting.customSystem || linkType && linkType === "url")) {
473
- popPageSetting._isIframe = true;
474
- if (jumpMode === "refresh") {
475
- popPageSetting.dialogType = "drawer";
476
- popPageSetting.jumpPageWidth = "100%";
477
- }
478
- jumpPageSetting.value = popPageSetting;
479
- isShowDialog.value = true;
480
- } else {
481
- popPageSetting._isIframe = false;
482
- if (jumpMode === "popup" || isMobile && jumpMode === "refresh") {
495
+ getCurrentUserPermissionsWhenPopPageDiff(popPageSetting, jumpMode).then(() => {
496
+ if (isMobile && (parentPageContext.value.systemCode !== popPageSetting.customSystem || linkType && linkType === "url")) {
497
+ popPageSetting._isIframe = true;
483
498
  if (jumpMode === "refresh") {
484
499
  popPageSetting.dialogType = "drawer";
485
500
  popPageSetting.jumpPageWidth = "100%";
486
501
  }
487
- debugger;
488
502
  jumpPageSetting.value = popPageSetting;
489
503
  isShowDialog.value = true;
490
- } else if (jumpMode === "refresh") {
491
- router.push({
492
- path: "/dsc/page",
493
- query: popPageSetting
494
- });
504
+ } else {
505
+ popPageSetting._isIframe = false;
506
+ if (jumpMode === "popup" || isMobile && jumpMode === "refresh") {
507
+ if (jumpMode === "refresh") {
508
+ popPageSetting.dialogType = "drawer";
509
+ popPageSetting.jumpPageWidth = "100%";
510
+ }
511
+ jumpPageSetting.value = popPageSetting;
512
+ isShowDialog.value = true;
513
+ } else if (jumpMode === "refresh") {
514
+ router.push({
515
+ path: "/dsc/page",
516
+ query: popPageSetting
517
+ });
518
+ }
495
519
  }
496
- }
520
+ });
497
521
  eventBus.$on(eventPageInfo.value + "close-dialog", (params) => {
498
522
  closeFunc(params);
499
523
  });
@@ -504,6 +528,7 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
504
528
  });
505
529
  }
506
530
  function closeFunc(params) {
531
+ debugger;
507
532
  const jumpMode = params.jumpMode;
508
533
  if (jumpMode && jumpMode === "popup" || isMobile && jumpMode === "refresh") {
509
534
  closeDialog(params);
@@ -512,6 +537,9 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
512
537
  }
513
538
  }
514
539
  function closeDialog(params) {
540
+ debugger;
541
+ const closeEventName = jumpPageSetting.value.closeEvent;
542
+ const isRefreshWhenClosePopup = jumpPageSetting.value.isRefreshWhenClosePopup;
515
543
  let dataModel;
516
544
  let sourceTableName;
517
545
  if (params) {
@@ -528,20 +556,54 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
528
556
  }
529
557
  }
530
558
  const targetTableName = parentPageContext.value.tableName;
531
- handleEvent(null, parentPageContext.value, parentConfigureObj.value, "closePopup", {
559
+ let currentParentConfigureObj;
560
+ const columnProp = parentEventParams.value.columnProp ? parentEventParams.value.columnProp : null;
561
+ if (columnProp) {
562
+ const columnConfigures = parentConfigureObj.value.items.filter(
563
+ (column) => {
564
+ var _a, _b, _c, _d;
565
+ return ((_b = (_a = column.props) == null ? void 0 : _a.base) == null ? void 0 : _b.prop) && ((_d = (_c = column.props) == null ? void 0 : _c.base) == null ? void 0 : _d.prop) === columnProp;
566
+ }
567
+ );
568
+ currentParentConfigureObj = columnConfigures && columnConfigures.length > 0 ? columnConfigures[0] : null;
569
+ } else {
570
+ currentParentConfigureObj = parentConfigureObj.value;
571
+ }
572
+ handleEvent(null, parentPageContext.value, currentParentConfigureObj, "closePopup", {
532
573
  sourceModel: dataModel,
533
574
  sourceTableName,
534
575
  jumpPageSetting,
535
576
  entity: parentPageContext.value.entity.data,
536
- targetTableName
577
+ targetTableName,
578
+ pageContext: pageContext.value,
579
+ parentPageContext: parentPageContext.value,
580
+ parentConfigureObj: currentParentConfigureObj,
581
+ columnProp
537
582
  });
538
- refreshFormOrListPage(parentPageContext.value, parentConfigureObj.value);
583
+ handleCloseDialogEvent(closeEventName, columnProp, currentParentConfigureObj);
584
+ refreshFormOrListPage(parentPageContext.value, parentConfigureObj.value, isRefreshWhenClosePopup);
539
585
  parentPageContext.value = null;
540
586
  parentConfigureObj.value = null;
541
587
  parentEventParams.value = null;
542
588
  eventBus.$off(eventPageInfo.value + "close-dialog");
543
589
  isShowDialog.value = false;
544
590
  }
591
+ function handleCloseDialogEvent(closeEventName, columnProp, currentParentConfigureObj) {
592
+ if (closeEventName) {
593
+ const func = getCustomFunc(parentPageContext.value, closeEventName);
594
+ if (func) {
595
+ func.apply(func, [
596
+ {
597
+ pageContext: pageContext.value,
598
+ parentPageContext: parentPageContext.value,
599
+ parentConfigureObj: currentParentConfigureObj,
600
+ jumpPageSetting,
601
+ columnProp
602
+ }
603
+ ]);
604
+ }
605
+ }
606
+ }
545
607
  function pickFileDone(data) {
546
608
  let componentId = data.componentId;
547
609
  let listCode = data.listCode;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "super-page-runtime",
3
- "version": "2.1.54",
3
+ "version": "2.1.57",
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.87",
51
+ "agilebuilder-ui": "1.0.89",
52
52
  "axios": "^1.6.8",
53
53
  "cypress": "^13.6.6",
54
54
  "element-plus": "^2.6.1",