feat 联调项目表

This commit is contained in:
Ironsp
2026-09-17 10:41:07 +08:00
parent e803ffa38c
commit 0399e8ede4
12 changed files with 127 additions and 60 deletions

View File

@@ -5,18 +5,14 @@ import { calcUncompactedArea } from '@/service/project'
import { useDbStore } from '@/store/modules/db'
const db = useDbStore()
const { currentProject: storedProject, hasCurrentProject } = useCurrentProject()
const { hasCurrentProject, currentProjectId } = useCurrentProject()
const currentProject = computed(() => {
if (!hasCurrentProject.value)
if (!hasCurrentProject.value || currentProjectId.value == null)
return null
const list = db.project || []
const storedId = storedProject.value?.id
if (storedId == null)
return null
return list.find(item => item.id === storedId) || null
return list.find(item => item.id === currentProjectId.value) || null
})
const progressPercent = computed(() => {
@@ -84,8 +80,9 @@ function formatPercent(value: number | null) {
}
onMounted(async () => {
if (!db.project?.length)
await db.loadAll()
if (!hasCurrentProject.value || currentProjectId.value == null)
return
await db.loadByProject(currentProjectId.value)
})
</script>