@fecp/designer 5.6.36 → 5.6.39

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 (31) hide show
  1. package/es/designer/package.json.mjs +1 -1
  2. package/es/designer/src/components/DataSourceSelect.vue.mjs +10 -4
  3. package/es/designer/src/packages/dialog/index.vue.mjs +28 -11
  4. package/es/designer/src/packages/dialog/index.vue2.mjs +28 -11
  5. package/es/designer/src/packages/dialog/useDialogDialog.mjs +1 -1
  6. package/es/designer/src/packages/dialogGlobal/index.vue.mjs +28 -11
  7. package/es/designer/src/packages/dialogGlobal/index.vue2.mjs +28 -11
  8. package/es/designer/src/packages/dialogGlobal/useDialogGlobalDialog.mjs +1 -1
  9. package/es/designer/src/packages/form/index.vue.mjs +2 -2
  10. package/es/designer/src/packages/form/property/widgets.vue.mjs +2 -2
  11. package/es/designer/src/packages/utils/common.mjs +17 -0
  12. package/es/designer.css +162 -161
  13. package/es/packages/vue/src/components/forms/formItem/FormItem.vue.mjs +1 -1
  14. package/es/packages/vue/src/components/table/Table.vue.mjs +13 -10
  15. package/es/packages/vue/src/components/table/TableColumn.vue.mjs +55 -2
  16. package/lib/designer/package.json.js +1 -1
  17. package/lib/designer/src/components/DataSourceSelect.vue.js +9 -3
  18. package/lib/designer/src/packages/dialog/index.vue.js +26 -9
  19. package/lib/designer/src/packages/dialog/index.vue2.js +351 -334
  20. package/lib/designer/src/packages/dialog/useDialogDialog.js +1 -1
  21. package/lib/designer/src/packages/dialogGlobal/index.vue.js +26 -9
  22. package/lib/designer/src/packages/dialogGlobal/index.vue2.js +321 -304
  23. package/lib/designer/src/packages/dialogGlobal/useDialogGlobalDialog.js +1 -1
  24. package/lib/designer/src/packages/form/index.vue.js +2 -2
  25. package/lib/designer/src/packages/form/property/widgets.vue.js +2 -2
  26. package/lib/designer/src/packages/utils/common.js +17 -0
  27. package/lib/designer.css +162 -161
  28. package/lib/packages/vue/src/components/forms/formItem/FormItem.vue.js +1 -1
  29. package/lib/packages/vue/src/components/table/Table.vue.js +13 -10
  30. package/lib/packages/vue/src/components/table/TableColumn.vue.js +55 -2
  31. package/package.json +23 -23
@@ -316,5 +316,5 @@ const _sfc_main = /* @__PURE__ */ Object.assign({
316
316
  };
317
317
  }
318
318
  });
319
- const _FormItem = /* @__PURE__ */ _pluginVue_exportHelper.default(_sfc_main, [["__scopeId", "data-v-4bbb491d"]]);
319
+ const _FormItem = /* @__PURE__ */ _pluginVue_exportHelper.default(_sfc_main, [["__scopeId", "data-v-45b25958"]]);
320
320
  exports.default = _FormItem;
@@ -279,13 +279,13 @@ const _sfc_main = /* @__PURE__ */ Object.assign({
279
279
  return total + (isNaN(value) ? 0 : value);
280
280
  }, 0);
281
281
  if (isNaN(sum)) {
282
- footerRow[fieldName] = " ";
282
+ footerRow[fieldName] = "";
283
283
  } else {
284
284
  const field = fieldsData.value.find((f) => f.fieldName == fieldName);
285
- footerRow[fieldName] = formatSummaryValue(sum, field) || " ";
285
+ footerRow[fieldName] = formatSummaryValue(sum, field) ?? "";
286
286
  }
287
287
  } else {
288
- footerRow[fieldName] = " ";
288
+ footerRow[fieldName] = "";
289
289
  }
290
290
  });
291
291
  } else if (mode === "all") {
@@ -295,12 +295,12 @@ const _sfc_main = /* @__PURE__ */ Object.assign({
295
295
  const sum = allSummaryData.value[fieldName];
296
296
  if (sum != void 0 && sum != null) {
297
297
  const field = fieldsData.value.find((f) => f.fieldName == fieldName);
298
- footerRow[fieldName] = formatSummaryValue(sum, field) || " ";
298
+ footerRow[fieldName] = formatSummaryValue(sum, field) ?? "";
299
299
  } else {
300
- footerRow[fieldName] = " ";
300
+ footerRow[fieldName] = "";
301
301
  }
302
302
  } else {
303
- footerRow[fieldName] = " ";
303
+ footerRow[fieldName] = "";
304
304
  }
305
305
  });
306
306
  }
@@ -779,7 +779,7 @@ const _sfc_main = /* @__PURE__ */ Object.assign({
779
779
  summaryResult[fieldName] = sum;
780
780
  });
781
781
  fieldsData.value.forEach((item) => {
782
- if (!summaryResult[item.fieldName]) {
782
+ if (summaryResult[item.fieldName] === void 0) {
783
783
  summaryResult[item.fieldName] = "";
784
784
  }
785
785
  });
@@ -1110,7 +1110,10 @@ const _sfc_main = /* @__PURE__ */ Object.assign({
1110
1110
  isDialog: __props.isDialog,
1111
1111
  hiddenFormData: hiddenFormData.value,
1112
1112
  btnRollbackEvent: __props.btnRollbackEvent,
1113
- formatCellValue: formatCellValue$1
1113
+ formatCellValue: formatCellValue$1,
1114
+ "summary-config": summaryConfig.value,
1115
+ "summary-all-data": allSummaryData.value,
1116
+ "format-summary-value": formatSummaryValue
1114
1117
  }, vue.createSlots({ _: 2 }, [
1115
1118
  vue.renderList(fieldsData.value, (field) => {
1116
1119
  return {
@@ -1120,7 +1123,7 @@ const _sfc_main = /* @__PURE__ */ Object.assign({
1120
1123
  ])
1121
1124
  };
1122
1125
  })
1123
- ]), 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"])
1126
+ ]), 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"])
1124
1127
  ];
1125
1128
  }),
1126
1129
  _: 3
@@ -1140,5 +1143,5 @@ const _sfc_main = /* @__PURE__ */ Object.assign({
1140
1143
  };
1141
1144
  }
1142
1145
  });
1143
- const _Table = /* @__PURE__ */ _pluginVue_exportHelper.default(_sfc_main, [["__scopeId", "data-v-cec18beb"]]);
1146
+ const _Table = /* @__PURE__ */ _pluginVue_exportHelper.default(_sfc_main, [["__scopeId", "data-v-e66cf49b"]]);
1144
1147
  exports.default = _Table;
@@ -117,7 +117,18 @@ const _sfc_main = {
117
117
  type: Object,
118
118
  default: {}
119
119
  },
120
- formatCellValue: Function
120
+ formatCellValue: Function,
121
+ // 合计配置:{ enabled, mode, summaryFields }
122
+ summaryConfig: {
123
+ type: Object,
124
+ default: () => ({})
125
+ },
126
+ // 全量模式的合计结果:{ [fieldName]: sum }
127
+ summaryAllData: {
128
+ type: Object,
129
+ default: () => ({})
130
+ },
131
+ formatSummaryValue: Function
121
132
  },
122
133
  setup(__props) {
123
134
  const props = __props;
@@ -134,6 +145,46 @@ const _sfc_main = {
134
145
  }
135
146
  return fields;
136
147
  });
148
+ const fieldMap = vue.computed(() => {
149
+ const map = {};
150
+ (props.fieldsData || []).forEach((field) => {
151
+ map[field.fieldName] = field;
152
+ });
153
+ return map;
154
+ });
155
+ const exportCellLabel = ({ row, column }) => {
156
+ const field = fieldMap.value[column.field];
157
+ if (!field) return "";
158
+ let label = props.formatCellValue ? props.formatCellValue(row, field) : row[field.fieldName];
159
+ if (label === null || label === void 0) label = "";
160
+ if (typeof label === "string" && label.trim() === "") return "";
161
+ if (field.prefix) label = `${field.prefix}${label}`;
162
+ if (field.suffix) label = `${label}${field.suffix}`;
163
+ return label;
164
+ };
165
+ const footerExportCell = ({ options, column }) => {
166
+ var _a;
167
+ const config = props.summaryConfig || {};
168
+ if (!config.enabled) return "";
169
+ const field = fieldMap.value[column.field];
170
+ if (!field) return "";
171
+ const firstVisible = (props.fieldsData || []).find((item) => item.isShow);
172
+ if (firstVisible && firstVisible.fieldName === field.fieldName) return "合计";
173
+ const summaryFields = config.summaryFields || [];
174
+ if (!summaryFields.includes(field.fieldName)) return "";
175
+ const format = (value) => props.formatSummaryValue ? props.formatSummaryValue(value, field) ?? "" : value;
176
+ if ((options == null ? void 0 : options.mode) !== "all" && config.mode === "all") {
177
+ const sum2 = (_a = props.summaryAllData) == null ? void 0 : _a[field.fieldName];
178
+ if (sum2 === void 0 || sum2 === null) return "";
179
+ return format(sum2);
180
+ }
181
+ const list = (options == null ? void 0 : options.data) || [];
182
+ const sum = list.reduce((total, row) => {
183
+ const value = parseFloat(row == null ? void 0 : row[field.fieldName]);
184
+ return total + (isNaN(value) ? 0 : value);
185
+ }, 0);
186
+ return format(sum);
187
+ };
137
188
  const getColumnWidth = (field) => {
138
189
  if (field.widthMode === "auto") {
139
190
  return void 0;
@@ -272,6 +323,8 @@ const _sfc_main = {
272
323
  "header-align": field.headerAlign,
273
324
  sortable: field.sortRule && field.sortRule != "none",
274
325
  resizable: false,
326
+ "export-method": exportCellLabel,
327
+ "footer-export-method": footerExportCell,
275
328
  "show-header-overflow": "",
276
329
  "show-footer-overflow": "",
277
330
  "show-overflow": field.isOverflowWrap ? false : "tooltip",
@@ -342,5 +395,5 @@ const _sfc_main = {
342
395
  };
343
396
  }
344
397
  };
345
- const TableColumn = /* @__PURE__ */ _pluginVue_exportHelper.default(_sfc_main, [["__scopeId", "data-v-fac941fe"]]);
398
+ const TableColumn = /* @__PURE__ */ _pluginVue_exportHelper.default(_sfc_main, [["__scopeId", "data-v-b4612c25"]]);
346
399
  exports.default = TableColumn;
package/package.json CHANGED
@@ -1,23 +1,23 @@
1
- {
2
- "name": "@fecp/designer",
3
- "version": "5.6.36",
4
- "main": "lib/designer/index.js",
5
- "module": "es/designer/index.mjs",
6
- "files": [
7
- "es",
8
- "lib"
9
- ],
10
- "scripts": {
11
- "publish": "npm publish --access public"
12
- },
13
- "keywords": [
14
- "fecp",
15
- "vue3组件库"
16
- ],
17
- "sideEffects": [
18
- "**/*.css"
19
- ],
20
- "author": "",
21
- "license": "MIT",
22
- "description": ""
23
- }
1
+ {
2
+ "name": "@fecp/designer",
3
+ "version": "5.6.39",
4
+ "main": "lib/designer/index.js",
5
+ "module": "es/designer/index.mjs",
6
+ "files": [
7
+ "es",
8
+ "lib"
9
+ ],
10
+ "scripts": {
11
+ "publish": "npm publish --access public"
12
+ },
13
+ "keywords": [
14
+ "fecp",
15
+ "vue3组件库"
16
+ ],
17
+ "sideEffects": [
18
+ "**/*.css"
19
+ ],
20
+ "author": "",
21
+ "license": "MIT",
22
+ "description": ""
23
+ }