From 360829d661eedfbf9355bed1ca1a32c93f0ed665 Mon Sep 17 00:00:00 2001 From: joylink_zhaoerwei Date: Fri, 9 Jun 2023 14:01:16 +0800 Subject: [PATCH 1/8] =?UTF-8?q?=E5=8F=91=E5=B8=83=E5=9B=BEapi=E5=92=8C?= =?UTF-8?q?=E9=A1=B5=E9=9D=A2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/api/PublishApi.ts | 61 +++++++++++++++++++++++++ src/pages/PublishManage.vue | 90 +++++-------------------------------- 2 files changed, 71 insertions(+), 80 deletions(-) create mode 100644 src/api/PublishApi.ts diff --git a/src/api/PublishApi.ts b/src/api/PublishApi.ts new file mode 100644 index 0000000..fef433e --- /dev/null +++ b/src/api/PublishApi.ts @@ -0,0 +1,61 @@ +import { api } from 'src/boot/axios'; +import { PageDto, PageQueryDto } from './ApiCommon'; + +const PublishUriBase = '/api/publishedGi'; + +interface Item { + id: number; + name: string; + proto: string; + createdAt: string; + updateAt: string; + creatorId?: number; +} + +export class PagingQueryParams extends PageQueryDto { + name?: string; +} + +/** + * 草稿图发布 + * @param id 草稿id + */ +export function publishDraft(data: { + layoutId: string; + name: string; + overwrite?: boolean; +}) { + return api.post(`${PublishUriBase}/publish`, data); +} + +/** + * 获取发布图形数据列表 + * @param params + * @returns + */ +export async function getDraft(id: number): Promise { + const response = await api.get(`${PublishUriBase}/list`); + return response.data; +} + +/** + * 分页查询 + * @param params + * @returns + */ +export async function pageQuery( + params: PagingQueryParams +): Promise> { + const response = await api.get(`${PublishUriBase}/paging`, { + params: params, + }); + return response.data; +} + +/** + * 删除发布图 + * @param id 草稿id + */ +export function deletePublish(id: number) { + return api.delete(`${PublishUriBase}/${id}`); +} diff --git a/src/pages/PublishManage.vue b/src/pages/PublishManage.vue index 1d7449c..5367708 100644 --- a/src/pages/PublishManage.vue +++ b/src/pages/PublishManage.vue @@ -2,7 +2,7 @@
-