perf: 文件管理、分析页、代码生成等部分组件调整为异步加载

This commit is contained in:
KAI
2024-11-06 12:21:53 +00:00
committed by Charles7c
parent 798dda9440
commit 2caedd165f
15 changed files with 34 additions and 20 deletions

View File

@@ -40,16 +40,9 @@
</template>
<script setup lang="ts">
import FileImage from './FileImage.vue'
import FileRightMenu from './FileRightMenu.vue'
import type { FileItem } from '@/apis/system'
interface Props {
data?: FileItem[]
selectedFileIds?: string[]
isBatchMode?: boolean
}
const props = withDefaults(defineProps<Props>(), {
data: () => [], // 文件数据
selectedFileIds: () => [], // 批量模式下选中的文件id数组
@@ -62,6 +55,14 @@ const emit = defineEmits<{
(e: 'right-menu-click', mode: string, item: FileItem): void
}>()
const FileImage = defineAsyncComponent(() => import('./FileImage.vue'))
interface Props {
data?: FileItem[]
selectedFileIds?: string[]
isBatchMode?: boolean
}
// 文件名称带后缀
const getFileName = (item: FileItem) => {
return `${item.name}${item.extension ? `.${item.extension}` : ''}`