From 0f96406b5abc1947abc02984925e4f53ed07ad87 Mon Sep 17 00:00:00 2001 From: wangqiao Date: Wed, 27 Aug 2025 16:31:23 +0800 Subject: [PATCH] Fix code formatting and error handling --- api/upnew/index.ts | 6 +++--- pages/drawe/index.vue | 20 +++++++++++--------- pages/home/components/PopularDrawings.vue | 14 +++++++------- 3 files changed, 21 insertions(+), 19 deletions(-) diff --git a/api/upnew/index.ts b/api/upnew/index.ts index 6e4ada5..315ea80 100644 --- a/api/upnew/index.ts +++ b/api/upnew/index.ts @@ -16,7 +16,7 @@ export const create = (params: TcreateReq) => { * @returns */ export const parent = (params: { type: string | number; parentId: number | string }) => { - return useFetchRequest.get>('/prod-api/app-api/business/app/dict/parent', { query:params }) + return useFetchRequest.get>('/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>('/prod-api/app-api/business/app/dict/parent', { query:params }) + return useDollarFetchRequest.get>('/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>('/prod-api/app-api/business/app/project-draw/page', {query:params}) + return useFetchRequest.get>('/prod-api/app-api/business/app/project-draw/page', { query: params }) } /** * 获得项目表内容信息分页 diff --git a/pages/drawe/index.vue b/pages/drawe/index.vue index cc29ef9..02557e7 100644 --- a/pages/drawe/index.vue +++ b/pages/drawe/index.vue @@ -43,7 +43,7 @@ }, ] ) - const keywords = ref(route.query?.valuekeywords as string || '') + const keywords = ref((route.query?.valuekeywords as string) || '') const query = ref({ 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 diff --git a/pages/home/components/PopularDrawings.vue b/pages/home/components/PopularDrawings.vue index 5d54bb3..48360bb 100644 --- a/pages/home/components/PopularDrawings.vue +++ b/pages/home/components/PopularDrawings.vue @@ -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({