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" > - +