Showing
1 changed file
with
4 additions
and
2 deletions
| 1 | <!-- | 1 | <!-- |
| 2 | * @Date: 2022-08-31 16:16:49 | 2 | * @Date: 2022-08-31 16:16:49 |
| 3 | * @LastEditors: hookehuyr hookehuyr@gmail.com | 3 | * @LastEditors: hookehuyr hookehuyr@gmail.com |
| 4 | - * @LastEditTime: 2022-12-30 10:32:42 | 4 | + * @LastEditTime: 2022-12-30 12:46:21 |
| 5 | * @FilePath: /data-table/src/components/FileUploaderField/index.vue | 5 | * @FilePath: /data-table/src/components/FileUploaderField/index.vue |
| 6 | * @Description: 文件上传控件 | 6 | * @Description: 文件上传控件 |
| 7 | --> | 7 | --> |
| ... | @@ -23,7 +23,7 @@ | ... | @@ -23,7 +23,7 @@ |
| 23 | :key="index" | 23 | :key="index" |
| 24 | style="padding-left: 1rem; margin-bottom: 0.5rem" | 24 | style="padding-left: 1rem; margin-bottom: 0.5rem" |
| 25 | > | 25 | > |
| 26 | - <span style="font-size: 1rem">{{ file.filename }}</span | 26 | + <span style="font-size: 1rem">{{ file.filename }} {{ (file.size / 1024 / 1024).toFixed(2) }}MB</span |
| 27 | > | 27 | > |
| 28 | <span style="color: #e32525; font-size: 0.85rem" @click="beforeDelete(file)" | 28 | <span style="color: #e32525; font-size: 0.85rem" @click="beforeDelete(file)" |
| 29 | >移除</span | 29 | >移除</span |
| ... | @@ -157,6 +157,7 @@ const afterRead = async (files) => { | ... | @@ -157,6 +157,7 @@ const afterRead = async (files) => { |
| 157 | // meta_id: imgUrl.meta_id, | 157 | // meta_id: imgUrl.meta_id, |
| 158 | filename: files.file.name, | 158 | filename: files.file.name, |
| 159 | url: imgUrl.src, | 159 | url: imgUrl.src, |
| 160 | + size: files.file.size | ||
| 160 | // isImage: true, | 161 | // isImage: true, |
| 161 | }); | 162 | }); |
| 162 | loading.value = false; | 163 | loading.value = false; |
| ... | @@ -255,6 +256,7 @@ var muliUpload = async (files) => { | ... | @@ -255,6 +256,7 @@ var muliUpload = async (files) => { |
| 255 | // meta_id: res.meta_id, | 256 | // meta_id: res.meta_id, |
| 256 | filename: item.file.name, | 257 | filename: item.file.name, |
| 257 | url: res.src, | 258 | url: res.src, |
| 259 | + size: files.file.size | ||
| 258 | // isImage: true, | 260 | // isImage: true, |
| 259 | }); | 261 | }); |
| 260 | loading.value = false; | 262 | loading.value = false; | ... | ... |
-
Please register or login to post a comment