feat:财务和合同
This commit is contained in:
@@ -14,6 +14,9 @@ import type { CaseCategory, CaseFilterValues, CaseItem } from '@/types/case-libr
|
||||
import { ensureLoggedIn } from '@/utils/auth-guard'
|
||||
import { buildCaseLibraryQuery } from '@/utils/build-case-library-query'
|
||||
import { cloneCaseFilter } from '@/utils/case-filter'
|
||||
import { ensureCaseBusinessTypeMap } from '@/utils/ensure-case-business-type-map'
|
||||
import { fetchCaseLibraryByBusinessTypes } from '@/utils/fetch-case-library-by-types'
|
||||
import { resolveBusinessTypeFilterValues } from '@/utils/format-business-type'
|
||||
import { mapProjectCasesToCaseItems } from '@/utils/map-case-library'
|
||||
import filterIcon from '@/static/icons/icon-filter.svg'
|
||||
import CaseCard from './components/CaseCard.vue'
|
||||
@@ -53,6 +56,8 @@ async function fetchCaseList(reset = false) {
|
||||
loadingMore.value = true
|
||||
|
||||
try {
|
||||
await ensureCaseBusinessTypeMap()
|
||||
|
||||
const params = buildCaseLibraryQuery({
|
||||
keyword: keyword.value,
|
||||
activeCategory: activeCategory.value,
|
||||
@@ -61,7 +66,13 @@ async function fetchCaseList(reset = false) {
|
||||
pageSize: CASE_PAGE_SIZE,
|
||||
})
|
||||
|
||||
const result = await getCaseLibraryList(params)
|
||||
const typeValues = activeCategory.value === '全部'
|
||||
? []
|
||||
: resolveBusinessTypeFilterValues(activeCategory.value)
|
||||
|
||||
const result = typeValues.length
|
||||
? await fetchCaseLibraryByBusinessTypes(params, typeValues)
|
||||
: await getCaseLibraryList(params)
|
||||
const rows = result?.rows ?? []
|
||||
const mapped = await mapProjectCasesToCaseItems(rows)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user