From 2901b24f435d0b1def92179222d7f73e6c2f5e68 Mon Sep 17 00:00:00 2001 From: wangqiao Date: Sat, 13 Sep 2025 12:51:48 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BC=98=E5=8C=96=E5=9B=BE=E7=BA=B8=E7=BC=96?= =?UTF-8?q?=E8=BE=91=E5=8A=9F=E8=83=BD=E5=92=8C=E6=8F=90=E4=BA=A4=E9=80=BB?= =?UTF-8?q?=E8=BE=91?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- api/upnew/index.ts | 2 +- pages/upnew/index.vue | 10 ++-------- 2 files changed, 3 insertions(+), 9 deletions(-) diff --git a/api/upnew/index.ts b/api/upnew/index.ts index 3f7d51e..c23029a 100644 --- a/api/upnew/index.ts +++ b/api/upnew/index.ts @@ -91,6 +91,6 @@ export const view = (params: { id: string | number; projectId: string | number } /** * 编辑图纸 */ -export const edit = (data: TcreateReq & { projectId: number }) => { +export const edit = (data: TcreateReq) => { return useDollarFetchRequest.put>('/prod-api/app-api/business/app/project/update', data) } diff --git a/pages/upnew/index.vue b/pages/upnew/index.vue index 4660b82..731913e 100644 --- a/pages/upnew/index.vue +++ b/pages/upnew/index.vue @@ -99,14 +99,7 @@ if (valid) { loading.value = true try { - const res = - type.value === 'add' - ? await create(form) - : await edit({ - ...form, - id: Number(id.value), - projectId: Number(projectId.value), - }) + const res = type.value === 'add' ? await create(form) : await edit(form) if (res.code === 0) { // 弹窗提示 ElMessage.success('操作成功') @@ -148,6 +141,7 @@ view({ id: id.value, projectId: projectId.value }).then((res) => { const { code, data } = res if (code === 0) { + form.id = data.id form.isDomestic = data.isDomestic form.province = data.province form.city = data.city