@fecp/designer 5.6.33 → 5.6.37

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.
@@ -277,13 +277,13 @@ const _sfc_main = /* @__PURE__ */ Object.assign({
277
277
  return total + (isNaN(value) ? 0 : value);
278
278
  }, 0);
279
279
  if (isNaN(sum)) {
280
- footerRow[fieldName] = " ";
280
+ footerRow[fieldName] = "";
281
281
  } else {
282
282
  const field = fieldsData.value.find((f) => f.fieldName == fieldName);
283
- footerRow[fieldName] = formatSummaryValue(sum, field) || " ";
283
+ footerRow[fieldName] = formatSummaryValue(sum, field) ?? "";
284
284
  }
285
285
  } else {
286
- footerRow[fieldName] = " ";
286
+ footerRow[fieldName] = "";
287
287
  }
288
288
  });
289
289
  } else if (mode === "all") {
@@ -293,12 +293,12 @@ const _sfc_main = /* @__PURE__ */ Object.assign({
293
293
  const sum = allSummaryData.value[fieldName];
294
294
  if (sum != void 0 && sum != null) {
295
295
  const field = fieldsData.value.find((f) => f.fieldName == fieldName);
296
- footerRow[fieldName] = formatSummaryValue(sum, field) || " ";
296
+ footerRow[fieldName] = formatSummaryValue(sum, field) ?? "";
297
297
  } else {
298
- footerRow[fieldName] = " ";
298
+ footerRow[fieldName] = "";
299
299
  }
300
300
  } else {
301
- footerRow[fieldName] = " ";
301
+ footerRow[fieldName] = "";
302
302
  }
303
303
  });
304
304
  }
@@ -682,7 +682,7 @@ const _sfc_main = /* @__PURE__ */ Object.assign({
682
682
  dataSourceManager.value.clearSort();
683
683
  (_b = summaryAllDataManager.value) == null ? void 0 : _b.updateParams(filters);
684
684
  tableDataFetch();
685
- clearSelection();
685
+ if (!props.isDialog) clearSelection();
686
686
  } else {
687
687
  searchData.value = filters;
688
688
  }
@@ -702,7 +702,7 @@ const _sfc_main = /* @__PURE__ */ Object.assign({
702
702
  dataSourceManager.value.clearSort();
703
703
  (_b = summaryAllDataManager.value) == null ? void 0 : _b.clearParams();
704
704
  tableDataFetch();
705
- clearSelection();
705
+ if (!props.isDialog) clearSelection();
706
706
  }
707
707
  };
708
708
  const refresh = (options = {}) => {
@@ -777,7 +777,7 @@ const _sfc_main = /* @__PURE__ */ Object.assign({
777
777
  summaryResult[fieldName] = sum;
778
778
  });
779
779
  fieldsData.value.forEach((item) => {
780
- if (!summaryResult[item.fieldName]) {
780
+ if (summaryResult[item.fieldName] === void 0) {
781
781
  summaryResult[item.fieldName] = "";
782
782
  }
783
783
  });
@@ -1108,7 +1108,10 @@ const _sfc_main = /* @__PURE__ */ Object.assign({
1108
1108
  isDialog: __props.isDialog,
1109
1109
  hiddenFormData: hiddenFormData.value,
1110
1110
  btnRollbackEvent: __props.btnRollbackEvent,
1111
- formatCellValue: formatCellValue$1
1111
+ formatCellValue: formatCellValue$1,
1112
+ "summary-config": summaryConfig.value,
1113
+ "summary-all-data": allSummaryData.value,
1114
+ "format-summary-value": formatSummaryValue
1112
1115
  }, createSlots({ _: 2 }, [
1113
1116
  renderList(fieldsData.value, (field) => {
1114
1117
  return {
@@ -1118,7 +1121,7 @@ const _sfc_main = /* @__PURE__ */ Object.assign({
1118
1121
  ])
1119
1122
  };
1120
1123
  })
1121
- ]), 1032, ["fields-data", "show-index", "select-mode", "is-opt-btns", "opt-btns", "mode-key", "modes", "data-source-options", "dictionary-options", "localConfig", "table-ref", "table-data", "readonly", "isDialog", "hiddenFormData", "btnRollbackEvent"])
1124
+ ]), 1032, ["fields-data", "show-index", "select-mode", "is-opt-btns", "opt-btns", "mode-key", "modes", "data-source-options", "dictionary-options", "localConfig", "table-ref", "table-data", "readonly", "isDialog", "hiddenFormData", "btnRollbackEvent", "summary-config", "summary-all-data"])
1122
1125
  ];
1123
1126
  }),
1124
1127
  _: 3
@@ -1138,7 +1141,7 @@ const _sfc_main = /* @__PURE__ */ Object.assign({
1138
1141
  };
1139
1142
  }
1140
1143
  });
1141
- const _Table = /* @__PURE__ */ _export_sfc(_sfc_main, [["__scopeId", "data-v-63047ad0"]]);
1144
+ const _Table = /* @__PURE__ */ _export_sfc(_sfc_main, [["__scopeId", "data-v-e66cf49b"]]);
1142
1145
  export {
1143
1146
  _Table as default
1144
1147
  };
@@ -115,7 +115,18 @@ const _sfc_main = {
115
115
  type: Object,
116
116
  default: {}
117
117
  },
118
- formatCellValue: Function
118
+ formatCellValue: Function,
119
+ // 合计配置:{ enabled, mode, summaryFields }
120
+ summaryConfig: {
121
+ type: Object,
122
+ default: () => ({})
123
+ },
124
+ // 全量模式的合计结果:{ [fieldName]: sum }
125
+ summaryAllData: {
126
+ type: Object,
127
+ default: () => ({})
128
+ },
129
+ formatSummaryValue: Function
119
130
  },
120
131
  setup(__props) {
121
132
  const props = __props;
@@ -132,6 +143,46 @@ const _sfc_main = {
132
143
  }
133
144
  return fields;
134
145
  });
146
+ const fieldMap = computed(() => {
147
+ const map = {};
148
+ (props.fieldsData || []).forEach((field) => {
149
+ map[field.fieldName] = field;
150
+ });
151
+ return map;
152
+ });
153
+ const exportCellLabel = ({ row, column }) => {
154
+ const field = fieldMap.value[column.field];
155
+ if (!field) return "";
156
+ let label = props.formatCellValue ? props.formatCellValue(row, field) : row[field.fieldName];
157
+ if (label === null || label === void 0) label = "";
158
+ if (typeof label === "string" && label.trim() === "") return "";
159
+ if (field.prefix) label = `${field.prefix}${label}`;
160
+ if (field.suffix) label = `${label}${field.suffix}`;
161
+ return label;
162
+ };
163
+ const footerExportCell = ({ options, column }) => {
164
+ var _a;
165
+ const config = props.summaryConfig || {};
166
+ if (!config.enabled) return "";
167
+ const field = fieldMap.value[column.field];
168
+ if (!field) return "";
169
+ const firstVisible = (props.fieldsData || []).find((item) => item.isShow);
170
+ if (firstVisible && firstVisible.fieldName === field.fieldName) return "合计";
171
+ const summaryFields = config.summaryFields || [];
172
+ if (!summaryFields.includes(field.fieldName)) return "";
173
+ const format = (value) => props.formatSummaryValue ? props.formatSummaryValue(value, field) ?? "" : value;
174
+ if ((options == null ? void 0 : options.mode) !== "all" && config.mode === "all") {
175
+ const sum2 = (_a = props.summaryAllData) == null ? void 0 : _a[field.fieldName];
176
+ if (sum2 === void 0 || sum2 === null) return "";
177
+ return format(sum2);
178
+ }
179
+ const list = (options == null ? void 0 : options.data) || [];
180
+ const sum = list.reduce((total, row) => {
181
+ const value = parseFloat(row == null ? void 0 : row[field.fieldName]);
182
+ return total + (isNaN(value) ? 0 : value);
183
+ }, 0);
184
+ return format(sum);
185
+ };
135
186
  const getColumnWidth = (field) => {
136
187
  if (field.widthMode === "auto") {
137
188
  return void 0;
@@ -270,6 +321,8 @@ const _sfc_main = {
270
321
  "header-align": field.headerAlign,
271
322
  sortable: field.sortRule && field.sortRule != "none",
272
323
  resizable: false,
324
+ "export-method": exportCellLabel,
325
+ "footer-export-method": footerExportCell,
273
326
  "show-header-overflow": "",
274
327
  "show-footer-overflow": "",
275
328
  "show-overflow": field.isOverflowWrap ? false : "tooltip",
@@ -340,7 +393,7 @@ const _sfc_main = {
340
393
  };
341
394
  }
342
395
  };
343
- const TableColumn = /* @__PURE__ */ _export_sfc(_sfc_main, [["__scopeId", "data-v-fac941fe"]]);
396
+ const TableColumn = /* @__PURE__ */ _export_sfc(_sfc_main, [["__scopeId", "data-v-b4612c25"]]);
344
397
  export {
345
398
  TableColumn as default
346
399
  };
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperties(exports, { __esModule: { value: true }, [Symbol.toStringTag]: { value: "Module" } });
3
- const version = "5.6.33";
3
+ const version = "5.6.37";
4
4
  const packageJson = {
5
5
  version
6
6
  };
@@ -25,10 +25,10 @@ const common = require("../utils/common.js");
25
25
  const index$1 = require("../../../../node_modules/@vexip-ui/utils/dist/index.js");
26
26
  const index = require("./aside/index.js");
27
27
  const aiMarks = require("../aiForm/aiMarks.js");
28
- ;/* empty css */
29
- const _pluginVue_exportHelper = require("../../../../_virtual/_plugin-vue_export-helper.js");
30
28
  ;/* empty css */
31
29
  ;/* empty css */
30
+ ;/* empty css */
31
+ const _pluginVue_exportHelper = require("../../../../_virtual/_plugin-vue_export-helper.js");
32
32
  const index$2 = require("../../../../node_modules/element-plus/es/components/scrollbar/index.js");
33
33
  const index$3 = require("../../../../node_modules/element-plus/es/components/form/index.js");
34
34
  const gridLayout_vue = require("../../../../node_modules/grid-layout-plus/es/components/grid-layout.vue.js");
@@ -61,7 +61,7 @@ const _sfc_main = {
61
61
  ]),
62
62
  _: 1
63
63
  }),
64
- vue.unref(currentItem).fieldType == "H2" ? (vue.openBlock(), vue.createBlock(_component_el_form_item, {
64
+ vue.unref(currentItem).fieldType == "h2" ? (vue.openBlock(), vue.createBlock(_component_el_form_item, {
65
65
  key: 0,
66
66
  label: "副标题",
67
67
  required: ""
@@ -157,7 +157,8 @@ const _sfc_main = {
157
157
  function getHeightOnTypeChange(fieldType, labelPosition) {
158
158
  const isTop = labelPosition === "top";
159
159
  if (fieldType === "textarea") return 2;
160
- if (["subTitle", "h2", "divider"].includes(fieldType)) return isTop ? 0.75 : 1;
160
+ if (["subTitle", "h2", "divider"].includes(fieldType))
161
+ return isTop ? 0.75 : 1;
161
162
  if (fieldType === "subForm" || fieldType === "subTable")
162
163
  return isTop ? 1.5 : 2;
163
164
  if (["approvalHistory", "document", "contract"].includes(fieldType))
@@ -175,10 +176,7 @@ const _sfc_main = {
175
176
  }
176
177
  );
177
178
  if (fieldInData) {
178
- fieldInData.h = getHeightOnTypeChange(
179
- fieldType,
180
- configData == null ? void 0 : configData.labelPosition
181
- );
179
+ fieldInData.h = getHeightOnTypeChange(fieldType, configData == null ? void 0 : configData.labelPosition);
182
180
  }
183
181
  eventBus.default.emit("resizeEvent");
184
182
  }
@@ -1243,5 +1241,5 @@ const _sfc_main = {
1243
1241
  };
1244
1242
  }
1245
1243
  };
1246
- const widgets = /* @__PURE__ */ _pluginVue_exportHelper.default(_sfc_main, [["__scopeId", "data-v-17c61c2b"]]);
1244
+ const widgets = /* @__PURE__ */ _pluginVue_exportHelper.default(_sfc_main, [["__scopeId", "data-v-d987bd0b"]]);
1247
1245
  exports.default = widgets;
@@ -517,5 +517,5 @@ const _sfc_main = {
517
517
  };
518
518
  }
519
519
  };
520
- const widgets = /* @__PURE__ */ _pluginVue_exportHelper.default(_sfc_main, [["__scopeId", "data-v-ee9264c8"]]);
520
+ const widgets = /* @__PURE__ */ _pluginVue_exportHelper.default(_sfc_main, [["__scopeId", "data-v-f4497954"]]);
521
521
  exports.default = widgets;