Fix code formatting and error handling

This commit is contained in:
wangqiao
2025-08-27 16:31:23 +08:00
parent dc628e3494
commit 0f96406b5a
3 changed files with 21 additions and 19 deletions

View File

@ -16,7 +16,7 @@ export const create = (params: TcreateReq) => {
* @returns
*/
export const parent = (params: { type: string | number; parentId: number | string }) => {
return useFetchRequest.get<IResponse<parentRes[]>>('/prod-api/app-api/business/app/dict/parent', { query:params })
return useFetchRequest.get<IResponse<parentRes[]>>('/prod-api/app-api/business/app/dict/parent', { query: params })
}
/**
* 获取具有上下级的字典信息
@ -24,7 +24,7 @@ export const parent = (params: { type: string | number; parentId: number | strin
* @returns
*/
export const parentV2 = (params: { type: string | number; parentId: number | string }) => {
return useDollarFetchRequest.get<IResponse<parentRes[]>>('/prod-api/app-api/business/app/dict/parent', { query:params })
return useDollarFetchRequest.get<IResponse<parentRes[]>>('/prod-api/app-api/business/app/dict/parent', { query: params })
}
/**
* 获取具有上下级的字典信息
@ -56,7 +56,7 @@ export const labels = (params: { type: string | number }) => {
* @returns
*/
export const page = (params: pageReq) => {
return useFetchRequest.get<IResponse<pageRes>>('/prod-api/app-api/business/app/project-draw/page', {query:params})
return useFetchRequest.get<IResponse<pageRes>>('/prod-api/app-api/business/app/project-draw/page', { query: params })
}
/**
* 获得项目表内容信息分页

View File

@ -43,7 +43,7 @@
},
]
)
const keywords = ref(route.query?.valuekeywords as string || '')
const keywords = ref((route.query?.valuekeywords as string) || '')
const query = ref<pageReq>({
pageNo: 1,
@ -74,14 +74,16 @@
getPage()
}
const { data:result, refresh:getPage } = await useAsyncData(`draw-page-list-${Date.now()}`, async () => {
const res = await page(query.value)
return res.data
},{
immediate: true,
})
const { data: result, refresh: getPage } = useAsyncData(
`draw-page-list-${Date.now()}`,
async () => {
const res = await page(query.value)
return res.data
},
{
immediate: true,
}
)
// const getPage = () => {
// page(query).then((res) => {
// const { data, code } = res

View File

@ -162,13 +162,13 @@
return []
})
if (!projectTypeList.value?.length) {
throw createError({
statusCode: 404,
statusMessage: 'Page Not Found',
fatal: true,
})
}
// if (!projectTypeList.value?.length) {
// throw createError({
// statusCode: 404,
// statusMessage: 'Page Not Found',
// fatal: true,
// })
// }
const { data: hotTopList, refresh: getHotTop } = useAsyncData('hotTop-PopularDrawings-popularDrawings', async () => {
const res = await hotTop({