el-plus-crud 0.1.115 → 0.1.117
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/CHANGELOG.md +9 -0
- package/dist/components/el-plus-form/components/fileType.d.ts +36 -0
- package/dist/el-plus-crud.mjs +3358 -3385
- package/dist/el-plus-crud.umd.js +1 -1
- package/dist/style.css +1 -1
- package/example/App.vue +31 -0
- package/lib/components/el-plus-form/components/ElPlusFormFile.vue +152 -12
- package/lib/components/el-plus-form/components/ElPlusFormUpload.vue +31 -14
- package/lib/components/el-plus-form/components/fileType.ts +79 -0
- package/package.json +1 -1
- package/dist/components/el-plus-form/components/components/file-icons/FileIcons.vue.d.ts +0 -27
- package/dist/components/el-plus-form/components/components/file-icons/data/index.d.ts +0 -5
- package/lib/components/el-plus-form/components/components/file-icons/FileIcons.vue +0 -203
- package/lib/components/el-plus-form/components/components/file-icons/data/index.ts +0 -27
- package/lib/components/el-plus-form/components/components/file-icons/images/doc.svg +0 -13
- package/lib/components/el-plus-form/components/components/file-icons/images/file.svg +0 -19
- package/lib/components/el-plus-form/components/components/file-icons/images/jpg.svg +0 -14
- package/lib/components/el-plus-form/components/components/file-icons/images/pdf.svg +0 -13
- package/lib/components/el-plus-form/components/components/file-icons/images/png.svg +0 -13
- package/lib/components/el-plus-form/components/components/file-icons/images/ppt.svg +0 -13
- package/lib/components/el-plus-form/components/components/file-icons/images/xls.svg +0 -13
package/CHANGELOG.md
CHANGED
|
@@ -2,6 +2,15 @@
|
|
|
2
2
|
|
|
3
3
|
All notable changes to this project will be documented in this file. See [standard-version](https://github.com/conventional-changelog/standard-version) for commit guidelines.
|
|
4
4
|
|
|
5
|
+
### [0.1.117](https://github.com/KDJack/el-plus-crud/compare/v0.1.116...v0.1.117) (2026-08-12)
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
### Features
|
|
9
|
+
|
|
10
|
+
* **form:** file 组件改为圆角卡片样式,与 upload 卡片统一 ([9109043](https://github.com/KDJack/el-plus-crud/commit/9109043a62dc992e87744731749492e784c3e04b))
|
|
11
|
+
|
|
12
|
+
### [0.1.116](https://github.com/KDJack/el-plus-crud/compare/v0.1.115...v0.1.116) (2026-08-12)
|
|
13
|
+
|
|
5
14
|
### [0.1.115](https://github.com/KDJack/el-plus-crud/compare/v0.1.114...v0.1.115) (2026-08-12)
|
|
6
15
|
|
|
7
16
|
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* 类型 → 色系 class + 缩写标签
|
|
3
|
+
* 与 ElPlusFormUpload cardMode 共用同一套分类,单一来源
|
|
4
|
+
*/
|
|
5
|
+
export declare const TYPE_META: Record<string, {
|
|
6
|
+
cls: string;
|
|
7
|
+
label: string;
|
|
8
|
+
}>;
|
|
9
|
+
/**
|
|
10
|
+
* 取文件类型 key(img/pdf/word/excel/ppt/txt/zip/file)
|
|
11
|
+
* 兼容 IOssInfo 与 el-upload 内部 file:suffix 优先取业务字段,缺失则从文件名提取扩展名兜底,
|
|
12
|
+
* 否则类型图标会全部退化成 file
|
|
13
|
+
*/
|
|
14
|
+
export declare function getFileType(file: any): string;
|
|
15
|
+
export declare function typeClass(file: any): string;
|
|
16
|
+
export declare function typeLabel(file: any): string;
|
|
17
|
+
export declare function isImageFile(file: any): boolean;
|
|
18
|
+
/**
|
|
19
|
+
* 图片可直接 <img> 展示的 url(缩略图 / 预览器共用)。
|
|
20
|
+
* 取址顺序:signUrl → shareUrl → url → furl → previewUrl(末位兜底),含 raw 兜底。
|
|
21
|
+
* 末位 previewUrl 用于兼容「图片仅带 previewUrl、无 objectUrl 直链」的异常数据——
|
|
22
|
+
* 否则缩略图能显示、但预览器 url-list 取空 → el-image-viewer 打开后 img 不渲染。
|
|
23
|
+
* 正常 OSS 图片首选仍是 shareUrl(objectUrl),previewUrl 仅在全空时兜底,不改变首选语义。
|
|
24
|
+
*/
|
|
25
|
+
export declare function getImageUrl(item: any): string;
|
|
26
|
+
/**
|
|
27
|
+
* 是否为图片项:suffix 命中图片后缀,或 url 为 data:image base64。
|
|
28
|
+
* 与 ElPlusFormUpload 的 isImageItem 对齐(预览/点击路径用此判定,而非仅后缀的 isImageFile)。
|
|
29
|
+
* ponytail: base64 data URL 无文件后缀,suffix 解析不可靠,须以 data: 前缀兜底,
|
|
30
|
+
* 否则点击会误判为非图片 → 走文件预览分支。
|
|
31
|
+
*/
|
|
32
|
+
export declare function isImageItem(item: any): boolean;
|
|
33
|
+
/**
|
|
34
|
+
* 文件大小格式化
|
|
35
|
+
*/
|
|
36
|
+
export declare function formatSize(bytes?: number): string;
|