From 2305d3452a7e3dadeff21ec10f8944d2ee35eb55 Mon Sep 17 00:00:00 2001 From: dong <58670809@qq.com> Date: Mon, 5 Jun 2023 16:13:27 +0800 Subject: [PATCH] =?UTF-8?q?=E8=8D=89=E7=A8=BF=E5=9B=BE=E7=AE=A1=E7=90=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/api/DraftApi.ts | 52 ++++++++ src/pages/DraftManage.vue | 264 ++++++++++++++++++++++++++++++++++++++ src/router/routes.ts | 12 ++ 3 files changed, 328 insertions(+) create mode 100644 src/api/DraftApi.ts create mode 100644 src/pages/DraftManage.vue 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