Skip to content

Commit

Permalink
chore: 优化文件管理部分显示效果
Browse files Browse the repository at this point in the history
  • Loading branch information
Charles7c committed May 14, 2024
1 parent 4eef0db commit 7a2c66e
Show file tree
Hide file tree
Showing 6 changed files with 57 additions and 9 deletions.
9 changes: 9 additions & 0 deletions src/assets/icons/directory-blue.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
12 changes: 12 additions & 0 deletions src/assets/icons/directory-open-blue.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
12 changes: 12 additions & 0 deletions src/assets/icons/directory-open.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
9 changes: 9 additions & 0 deletions src/assets/icons/directory.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,9 @@
</div>
</a-row>
<a-row style="margin-top: 15px">
<a-descriptions :column="1" title="详细信息" layout="inline-vertical">
<a-descriptions-item :label="data.name">{{ formatFileSize(data.size) }}</a-descriptions-item>
<a-descriptions :column="1" layout="inline-vertical">
<a-descriptions-item label="名称">{{ getFileName(data) }}</a-descriptions-item>
<a-descriptions-item label="大小">{{ formatFileSize(data.size) }}</a-descriptions-item>
<a-descriptions-item label="创建时间">{{ data.createTime }}</a-descriptions-item>
<a-descriptions-item label="修改时间">{{ data.updateTime }}</a-descriptions-item>
</a-descriptions>
Expand All @@ -23,6 +24,11 @@ interface Props {
}
withDefaults(defineProps<Props>(), {})
// 文件名称带后缀
const getFileName = (item: FileItem) => {
return `${item.name}${item.extension ? `.${item.extension}` : ''}`
}
</script>

<style lang="less" scoped>
Expand Down
14 changes: 7 additions & 7 deletions src/views/system/file/main/FileMain/FileList.vue
Original file line number Diff line number Diff line change
Expand Up @@ -27,22 +27,17 @@
<div class="file-image">
<FileImage :data="record"></FileImage>
</div>
<span>{{ record.name }}</span>
<span>{{ getFileName(record) }}</span>
</section>
<template #content>
<FileRightMenu :data="record" @click="handleRightMenuClick($event, record)"></FileRightMenu>
</template>
</a-trigger>
</template>
</a-table-column>
<a-table-column title="文件大小" data-index="size" :width="150">
<a-table-column title="大小" data-index="size" :width="150">
<template #cell="{ record }">{{ formatFileSize(record.size) }}</template>
</a-table-column>
<a-table-column title="扩展名" data-index="extension" :width="100">
<template #cell="{ record }">
<a-tag v-if="record.extension" size="small" color="purple">{{ record.extension }}</a-tag>
</template>
</a-table-column>
<a-table-column title="修改时间" data-index="updateTime" :width="200"></a-table-column>
<a-table-column title="操作" :width="120" align="center">
<template #cell="{ record }">
Expand Down Expand Up @@ -88,6 +83,11 @@ const emit = defineEmits<{
(e: 'right-menu-click', mode: string, item: FileItem): void
}>()
// 文件名称带后缀
const getFileName = (item: FileItem) => {
return `${item.name}${item.extension ? `.${item.extension}` : ''}`
}
const rowSelection: TableRowSelection = reactive({
type: 'checkbox',
showCheckedAll: true
Expand Down

0 comments on commit 7a2c66e

Please sign in to comment.