diff --git a/src/api/DraftApi.ts b/src/api/DraftApi.ts new file mode 100644 index 0000000..837806f --- /dev/null +++ b/src/api/DraftApi.ts @@ -0,0 +1,52 @@ +import { api } from 'src/boot/axios'; +import { PageQueryDto } from './ApiCommon'; + +const DraftUriBase = '/api/draft'; + +export class PagingQueryParams extends PageQueryDto { + name?: string; +} + +/** + * 分页查询用户信息 + * @param params + * @returns + */ +export async function pageQuery(params: PagingQueryParams) { + const response = await api.get(`${DraftUriBase}/paging`, { + params: params, + }); + return response.data; +} + +/** + * 创建草稿 + * @param params + * @returns + */ +export async function createDraft(draftData: { + name: string; +}): Promise { + const response = await api.post(`${DraftUriBase}/create`, draftData); + return response.data; +} + +/** + * 删除草稿 + * @param id 草稿id + */ +export async function deleteDraft(id: string) { + return await api.delete(`${DraftUriBase}/delete/${id}`); +} + +/** + * 草稿图发布 + * @param id 草稿id + */ +export async function publishDraft(data: { + layoutId: string; + name: string; + overwrite?: boolean; +}) { + return await api.post(`${DraftUriBase}/publish`, data); +} diff --git a/src/pages/DraftManage.vue b/src/pages/DraftManage.vue new file mode 100644 index 0000000..9dd8110 --- /dev/null +++ b/src/pages/DraftManage.vue @@ -0,0 +1,264 @@ + + + diff --git a/src/router/routes.ts b/src/router/routes.ts index 465e233..e351f41 100644 --- a/src/router/routes.ts +++ b/src/router/routes.ts @@ -19,6 +19,18 @@ const routes: RouteRecordRaw[] = [ name: 'register', component: () => import('pages/UserRegister.vue'), }, + { + path: '/dataManage', + name: 'dataManage', + component: () => import('layouts/MainLayout.vue'), + children: [ + { + path: 'draft', + name: 'draft', + component: () => import('pages/DraftManage.vue'), + }, + ], + }, // Always leave this as last one, // but you can also remove it