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 * @returns
*/ */
export const parent = (params: { type: string | number; parentId: number | string }) => { 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 * @returns
*/ */
export const parentV2 = (params: { type: string | number; parentId: number | string }) => { 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 * @returns
*/ */
export const page = (params: pageReq) => { 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>({ const query = ref<pageReq>({
pageNo: 1, pageNo: 1,
@ -74,14 +74,16 @@
getPage() getPage()
} }
const { data: result, refresh: getPage } = useAsyncData(
const { data:result, refresh:getPage } = await useAsyncData(`draw-page-list-${Date.now()}`, async () => { `draw-page-list-${Date.now()}`,
const res = await page(query.value) async () => {
return res.data const res = await page(query.value)
return res.data
},{ },
immediate: true, {
}) immediate: true,
}
)
// const getPage = () => { // const getPage = () => {
// page(query).then((res) => { // page(query).then((res) => {
// const { data, code } = res // const { data, code } = res

View File

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