优化版本列表获取逻辑,提升组件性能

This commit is contained in:
wangqiao
2025-09-02 17:49:59 +08:00
parent a900399dd0
commit fa971cff5b

View File

@ -83,6 +83,13 @@
return props.type === 1 ? '图纸' : props.type === 3 ? '模型' : '文本'
})
/** 版本 */
const { data: editionsList } = useAsyncData(`editionsList-${props.type}-${Date.now()}`, async () => {
const res = await parent({ type: 2, parentId: 0 })
const all = [{ id: '-1', name: '全部' }]
return [...all, ...res.data]
})
// 获取面包屑
const { data: breadList } = await useAsyncData(
`breadList-${props.type}-${props.id}-${query.value.projectType}-${Date.now()}`,
@ -172,12 +179,7 @@
{ server: true } // 确保在服务端执行
)
/** 版本 */
const { data: editionsList } = useAsyncData(`editionsList-${props.type}-${Date.now()}`, async () => {
const res = await parent({ type: 2, parentId: 0 })
const all = [{ id: '-1', name: '全部' }]
return [...all, ...res.data]
})
const handleClick = (row: any) => {
query.value.title = ''