From 5f6b52228bd0a6dc65243f92986d78368f0fc53e Mon Sep 17 00:00:00 2001 From: dong <58670809@qq.com> Date: Mon, 5 Jun 2023 17:27:38 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BB=A3=E7=A0=81=E8=B0=83=E6=95=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/api/DraftApi.ts | 37 +++++++++++++++---------------------- src/pages/DraftManage.vue | 4 ++-- src/pages/UserManage.vue | 2 +- 3 files changed, 18 insertions(+), 25 deletions(-) diff --git a/src/api/DraftApi.ts b/src/api/DraftApi.ts index 837806f..4eea281 100644 --- a/src/api/DraftApi.ts +++ b/src/api/DraftApi.ts @@ -1,22 +1,18 @@ import { api } from 'src/boot/axios'; -import { PageQueryDto } from './ApiCommon'; -const DraftUriBase = '/api/draft'; - -export class PagingQueryParams extends PageQueryDto { - name?: string; -} +const DraftUriBase = '/api/draft/layout'; /** - * 分页查询用户信息 - * @param params + * 分页查询 + * @param query * @returns */ -export async function pageQuery(params: PagingQueryParams) { - const response = await api.get(`${DraftUriBase}/paging`, { - params: params, - }); - return response.data; +export function pageQuery(query: { + pageNum: number; + size: number; + name: string; +}) { + return api.get(`${DraftUriBase}/page`, { params: query }); } /** @@ -24,29 +20,26 @@ export async function pageQuery(params: PagingQueryParams) { * @param params * @returns */ -export async function createDraft(draftData: { - name: string; -}): Promise { - const response = await api.post(`${DraftUriBase}/create`, draftData); - return response.data; +export function createDraft(draftData: { name: string }): Promise { + return api.post(`${DraftUriBase}/create`, draftData); } /** * 删除草稿 * @param id 草稿id */ -export async function deleteDraft(id: string) { - return await api.delete(`${DraftUriBase}/delete/${id}`); +export function deleteDraft(id: string) { + return api.delete(`${DraftUriBase}/${id}`); } /** * 草稿图发布 * @param id 草稿id */ -export async function publishDraft(data: { +export function publishDraft(data: { layoutId: string; name: string; overwrite?: boolean; }) { - return await api.post(`${DraftUriBase}/publish`, data); + return api.post(`${DraftUriBase}/publish`, data); } diff --git a/src/pages/DraftManage.vue b/src/pages/DraftManage.vue index 9dd8110..9680784 100644 --- a/src/pages/DraftManage.vue +++ b/src/pages/DraftManage.vue @@ -20,7 +20,7 @@ v-model="filter.name" label="名称" > - + @@ -164,7 +164,7 @@ async function onRequest(props: any) { loading.value = true; try { let response = await pageQuery({ - current: page, + pageNum: page, size: rowsPerPage, name: filter.name, }); diff --git a/src/pages/UserManage.vue b/src/pages/UserManage.vue index 5de2fd1..43f81ba 100644 --- a/src/pages/UserManage.vue +++ b/src/pages/UserManage.vue @@ -24,7 +24,7 @@ :options="optionsSearch" > - +