tree-upload-vue3 1.1.12 → 1.1.13
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/README.md +26 -0
- package/dist/components/SchemaPreview.vue.d.ts +3 -1
- package/dist/tree-upload-vue3.css +1 -1
- package/dist/tree-upload-vue3.es.js +875 -612
- package/dist/tree-upload-vue3.umd.js +1 -1
- package/dist/types/index.d.ts +11 -0
- package/dist//346/265/213/350/257/225/345/234/260/345/235/227/345/257/274/345/205/245_20260409143915A001.xlsx +0 -0
- package/package.json +7 -4
package/README.md
CHANGED
|
@@ -115,6 +115,22 @@ const mySchema = reactive<TreeUploadSchema>({
|
|
|
115
115
|
{ prop: 'name', label: '文件名' },
|
|
116
116
|
{ prop: 'size', label: '大小', formatter: 'fileSize' }
|
|
117
117
|
],
|
|
118
|
+
actions: [
|
|
119
|
+
{ key: 'preview', label: '预览', type: 'primary' },
|
|
120
|
+
{ key: 'download', label: '下载' },
|
|
121
|
+
{ key: 'delete', label: '删除', type: 'danger' }
|
|
122
|
+
],
|
|
123
|
+
download: {
|
|
124
|
+
// 可选,默认从 row.url / row.name 读取
|
|
125
|
+
urlField: 'url',
|
|
126
|
+
nameField: 'name',
|
|
127
|
+
// 文件接口需要鉴权时可透传请求头
|
|
128
|
+
requestOptions: {
|
|
129
|
+
headers: {
|
|
130
|
+
Authorization: 'Bearer xxx'
|
|
131
|
+
}
|
|
132
|
+
}
|
|
133
|
+
},
|
|
118
134
|
ui: {
|
|
119
135
|
pagination: { enabled: true, pageSize: 20 }
|
|
120
136
|
}
|
|
@@ -198,12 +214,22 @@ const mySchema = reactive<TreeUploadSchema>({
|
|
|
198
214
|
| --- | --- | --- |
|
|
199
215
|
| `dataSource` | `{ type: 'static' \| 'api', ... }` | 表格数据源。`api` 模式支持动态参数 (如 `requirementId: '${currentNode.id}'`) |
|
|
200
216
|
| `columns` | `TableColumnSchema[]` | 列定义。支持 `formatter: 'fileSize'` |
|
|
217
|
+
| `actions` | `TableActionSchema[]` | 行操作按钮配置。内置支持 `preview` / `download` / `delete` |
|
|
218
|
+
| `download` | `TableDownloadSchema` | 下载配置。支持自定义文件地址字段、文件名字段和请求头 |
|
|
201
219
|
| `ui.pagination` | `{ enabled: boolean, pageSize: number }` | 分页配置 (无数据时自动隐藏) |
|
|
202
220
|
|
|
203
221
|
行级按钮控制(FileItem):
|
|
204
222
|
- `actions`: 当前行允许的操作列表,支持字符串数组或对象数组。
|
|
205
223
|
- `disabledActions`: 当前行禁用的操作 key 列表。
|
|
206
224
|
|
|
225
|
+
下载配置(`table.download`):
|
|
226
|
+
- `urlField`: 下载地址字段名,默认 `url`。
|
|
227
|
+
- `nameField`: 下载文件名字段名,默认 `name`。
|
|
228
|
+
- 默认行为:统一通过请求文件流后触发浏览器下载,避免部分图片 / PDF / 跨域直链在当前窗口打开。
|
|
229
|
+
- `requestOptions.headers`: 需要鉴权时透传请求头。
|
|
230
|
+
- `requestOptions.method`: 下载请求方法,默认 `GET`。
|
|
231
|
+
- `requestOptions.withCredentials`: 是否携带 Cookie。
|
|
232
|
+
|
|
207
233
|
## 🛠 开发与构建
|
|
208
234
|
|
|
209
235
|
```bash
|
|
@@ -8,5 +8,7 @@ declare const _default: import('vue').DefineComponent<__VLS_Props, {}, {}, {}, {
|
|
|
8
8
|
"update:modelValue": (...args: any[]) => void;
|
|
9
9
|
}, string, import('vue').PublicProps, Readonly<__VLS_Props> & Readonly<{
|
|
10
10
|
"onUpdate:modelValue"?: ((...args: any[]) => any) | undefined;
|
|
11
|
-
}>, {}, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {
|
|
11
|
+
}>, {}, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {
|
|
12
|
+
dialogRef: any;
|
|
13
|
+
}, any>;
|
|
12
14
|
export default _default;
|