@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.
- package/es/designer/package.json.mjs +1 -1
- package/es/designer/src/packages/form/index.vue.mjs +2 -2
- package/es/designer/src/packages/form/property/subTitleH2.vue.mjs +1 -1
- package/es/designer/src/packages/form/property/widgets.vue.mjs +4 -6
- package/es/designer/src/packages/table/property/widgets.vue.mjs +1 -1
- package/es/designer.css +103 -101
- package/es/packages/vue/src/components/forms/form/Form.vue.mjs +15 -2
- package/es/packages/vue/src/components/forms/text/Text.vue.mjs +4 -4
- package/es/packages/vue/src/components/table/Table.vue.mjs +15 -12
- package/es/packages/vue/src/components/table/TableColumn.vue.mjs +55 -2
- package/lib/designer/package.json.js +1 -1
- package/lib/designer/src/packages/form/index.vue.js +2 -2
- package/lib/designer/src/packages/form/property/subTitleH2.vue.js +1 -1
- package/lib/designer/src/packages/form/property/widgets.vue.js +4 -6
- package/lib/designer/src/packages/table/property/widgets.vue.js +1 -1
- package/lib/designer.css +103 -101
- package/lib/packages/vue/src/components/forms/form/Form.vue.js +15 -2
- package/lib/packages/vue/src/components/forms/text/Text.vue.js +4 -4
- package/lib/packages/vue/src/components/table/Table.vue.js +15 -12
- package/lib/packages/vue/src/components/table/TableColumn.vue.js +55 -2
- package/package.json +1 -1
|
@@ -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-
|
|
398
|
+
const TableColumn = /* @__PURE__ */ _pluginVue_exportHelper.default(_sfc_main, [["__scopeId", "data-v-b4612c25"]]);
|
|
346
399
|
exports.default = TableColumn;
|