Skip to content

Commit 7a2c66e

Browse files
committed
chore: 优化文件管理部分显示效果
1 parent 4eef0db commit 7a2c66e

File tree

6 files changed

+57
-9
lines changed

6 files changed

+57
-9
lines changed

src/assets/icons/directory-blue.svg

Lines changed: 9 additions & 0 deletions
Loading
Lines changed: 12 additions & 0 deletions
Loading

src/assets/icons/directory-open.svg

Lines changed: 12 additions & 0 deletions
Loading

src/assets/icons/directory.svg

Lines changed: 9 additions & 0 deletions
Loading

src/views/system/file/components/FileDetailModal/ModalContent.vue

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,9 @@
55
</div>
66
</a-row>
77
<a-row style="margin-top: 15px">
8-
<a-descriptions :column="1" title="详细信息" layout="inline-vertical">
9-
<a-descriptions-item :label="data.name">{{ formatFileSize(data.size) }}</a-descriptions-item>
8+
<a-descriptions :column="1" layout="inline-vertical">
9+
<a-descriptions-item label="名称">{{ getFileName(data) }}</a-descriptions-item>
10+
<a-descriptions-item label="大小">{{ formatFileSize(data.size) }}</a-descriptions-item>
1011
<a-descriptions-item label="创建时间">{{ data.createTime }}</a-descriptions-item>
1112
<a-descriptions-item label="修改时间">{{ data.updateTime }}</a-descriptions-item>
1213
</a-descriptions>
@@ -23,6 +24,11 @@ interface Props {
2324
}
2425
2526
withDefaults(defineProps<Props>(), {})
27+
28+
// 文件名称带后缀
29+
const getFileName = (item: FileItem) => {
30+
return `${item.name}${item.extension ? `.${item.extension}` : ''}`
31+
}
2632
</script>
2733

2834
<style lang="less" scoped>

src/views/system/file/main/FileMain/FileList.vue

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -27,22 +27,17 @@
2727
<div class="file-image">
2828
<FileImage :data="record"></FileImage>
2929
</div>
30-
<span>{{ record.name }}</span>
30+
<span>{{ getFileName(record) }}</span>
3131
</section>
3232
<template #content>
3333
<FileRightMenu :data="record" @click="handleRightMenuClick($event, record)"></FileRightMenu>
3434
</template>
3535
</a-trigger>
3636
</template>
3737
</a-table-column>
38-
<a-table-column title="文件大小" data-index="size" :width="150">
38+
<a-table-column title="大小" data-index="size" :width="150">
3939
<template #cell="{ record }">{{ formatFileSize(record.size) }}</template>
4040
</a-table-column>
41-
<a-table-column title="扩展名" data-index="extension" :width="100">
42-
<template #cell="{ record }">
43-
<a-tag v-if="record.extension" size="small" color="purple">{{ record.extension }}</a-tag>
44-
</template>
45-
</a-table-column>
4641
<a-table-column title="修改时间" data-index="updateTime" :width="200"></a-table-column>
4742
<a-table-column title="操作" :width="120" align="center">
4843
<template #cell="{ record }">
@@ -88,6 +83,11 @@ const emit = defineEmits<{
8883
(e: 'right-menu-click', mode: string, item: FileItem): void
8984
}>()
9085
86+
// 文件名称带后缀
87+
const getFileName = (item: FileItem) => {
88+
return `${item.name}${item.extension ? `.${item.extension}` : ''}`
89+
}
90+
9191
const rowSelection: TableRowSelection = reactive({
9292
type: 'checkbox',
9393
showCheckedAll: true

0 commit comments

Comments
 (0)