feat 联调项目表
This commit is contained in:
@@ -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>
|
||||
|
||||
|
||||
Reference in New Issue
Block a user