优化版本列表获取逻辑,提升组件性能
This commit is contained in:
@ -83,6 +83,13 @@
|
|||||||
return props.type === 1 ? '图纸' : props.type === 3 ? '模型' : '文本'
|
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(
|
const { data: breadList } = await useAsyncData(
|
||||||
`breadList-${props.type}-${props.id}-${query.value.projectType}-${Date.now()}`,
|
`breadList-${props.type}-${props.id}-${query.value.projectType}-${Date.now()}`,
|
||||||
@ -172,12 +179,7 @@
|
|||||||
{ server: true } // 确保在服务端执行
|
{ 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) => {
|
const handleClick = (row: any) => {
|
||||||
query.value.title = ''
|
query.value.title = ''
|
||||||
|
|||||||
Reference in New Issue
Block a user