cosey 0.3.8 → 0.3.10
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.
|
@@ -110,7 +110,7 @@ var stdin_default = /* @__PURE__ */defineComponent({
|
|
|
110
110
|
};
|
|
111
111
|
const exportColumns = computed(() => {
|
|
112
112
|
return renderedColumns.value?.filter(column => {
|
|
113
|
-
return !isNullish(column.prop || column.property) && (column.prop || column.property) !== "" || column.columns && column.columns.length > 0;
|
|
113
|
+
return !isNullish(column.prop || column.property) && (column.prop || column.property) !== "" || column.columns && column.columns.length > 0 || column.type === "index";
|
|
114
114
|
});
|
|
115
115
|
});
|
|
116
116
|
watch([() => props.columns, () => props.actionColumn], () => {
|
|
@@ -139,12 +139,9 @@ var stdin_default = /* @__PURE__ */defineComponent({
|
|
|
139
139
|
if (!Array.isArray(sums[0])) {
|
|
140
140
|
sums = [sums];
|
|
141
141
|
}
|
|
142
|
-
data.push(...sums.map(sum => {
|
|
143
|
-
return columns.
|
|
144
|
-
|
|
145
|
-
return row;
|
|
146
|
-
}, {});
|
|
147
|
-
}));
|
|
142
|
+
data.push(...sums.map(sum => sum.filter((_, index) => {
|
|
143
|
+
return columns[index].type === "selection" ? false : true;
|
|
144
|
+
}).map(item => getVNodeText(item))));
|
|
148
145
|
}
|
|
149
146
|
return data;
|
|
150
147
|
});
|
package/package.json
CHANGED
package/utils/excel/index.js
CHANGED
|
@@ -133,9 +133,17 @@ async function exportExcel(scheme, data, options) {
|
|
|
133
133
|
const fColumns = flatColumns(columns);
|
|
134
134
|
const ooa = Array.isArray(data) ? data : data[name];
|
|
135
135
|
let aoa = ooa.map(
|
|
136
|
-
(obj, index) => fColumns.map((column) => {
|
|
137
|
-
|
|
138
|
-
|
|
136
|
+
(obj, index) => fColumns.map((column, colIndex) => {
|
|
137
|
+
if (index < ooa.length - footerCount) {
|
|
138
|
+
if (column.type === "index") {
|
|
139
|
+
return index + 1;
|
|
140
|
+
} else {
|
|
141
|
+
const value = obj[column.prop];
|
|
142
|
+
return transform ? transform(obj, column, value, index) : value;
|
|
143
|
+
}
|
|
144
|
+
} else {
|
|
145
|
+
return obj[colIndex];
|
|
146
|
+
}
|
|
139
147
|
})
|
|
140
148
|
);
|
|
141
149
|
let headAoa = [];
|