cosey 0.3.9 → 0.3.11

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.
@@ -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.reduce((row, column, index) => {
144
- row[column.prop || column.property] = getVNodeText(sum[index]);
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
  });
@@ -1,3 +1,4 @@
1
+ import { type AxiosRequestConfig } from 'axios';
1
2
  import { type MediaCardBaseProps } from '../media-card';
2
3
  import { type UploadContext } from '../upload-context';
3
4
  export type UploadFileStatus = 'unready' | 'ready' | 'loading' | 'success' | 'error';
@@ -25,6 +26,7 @@ export interface UploadProps {
25
26
  selectOnly?: boolean;
26
27
  size?: MediaCardBaseProps['size'];
27
28
  request?: UploadContext['request'];
29
+ requestConfig?: AxiosRequestConfig;
28
30
  }
29
31
  export declare const defaultUploadProps: {
30
32
  accept: string;
@@ -64,6 +64,10 @@ var stdin_default = /* @__PURE__ */defineComponent({
64
64
  request: {
65
65
  type: Function,
66
66
  required: false
67
+ },
68
+ requestConfig: {
69
+ type: Object,
70
+ required: false
67
71
  }
68
72
  }, defaultUploadProps),
69
73
  emits: ["exceed", "update:modelValue", "change"],
@@ -189,11 +193,13 @@ var stdin_default = /* @__PURE__ */defineComponent({
189
193
  };
190
194
  const doUpload = async options => {
191
195
  return (props.request || request)?.(options.data, {
196
+ ...props.requestConfig,
192
197
  signal: options.signal,
193
198
  onUploadProgress(event) {
194
199
  if (event.total) {
195
200
  options.onProgress(event.loaded / event.total * 100);
196
201
  }
202
+ props.requestConfig?.onUploadProgress?.(event);
197
203
  }
198
204
  }).then(url => {
199
205
  options.onSuccess(url);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "cosey",
3
- "version": "0.3.9",
3
+ "version": "0.3.11",
4
4
  "description": "基于 Vue3 + vite 的后台管理系统框架",
5
5
  "type": "module",
6
6
  "main": "index.js",
@@ -133,12 +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
- if (column.type === "index") {
138
- return index + 1;
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];
139
146
  }
140
- const value = obj[column.prop];
141
- return transform && index < ooa.length - footerCount ? transform(obj, column, value, index) : value;
142
147
  })
143
148
  );
144
149
  let headAoa = [];