From 7400b2f1f68c6fbdbf3233275b1193f9941625e0 Mon Sep 17 00:00:00 2001 From: dong <58670809@qq.com> Date: Tue, 6 Jun 2023 11:12:06 +0800 Subject: [PATCH 1/3] =?UTF-8?q?=E7=99=BB=E5=BD=95=E5=92=8C=E6=B3=A8?= =?UTF-8?q?=E5=86=8C=E6=89=8B=E6=9C=BA=E6=A0=BC=E5=BC=8F=E6=A0=A1=E9=AA=8C?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/pages/UserLogin.vue | 3 +++ src/pages/UserRegister.vue | 3 +++ 2 files changed, 6 insertions(+) diff --git a/src/pages/UserLogin.vue b/src/pages/UserLogin.vue index ee9fdf1..e04fed8 100644 --- a/src/pages/UserLogin.vue +++ b/src/pages/UserLogin.vue @@ -23,6 +23,9 @@ v-model="loginInfo.account" label="账号" lazy-rules + type="tel" + mask="###########" + :rules="[(val) => val.length == 11 || '请输入正确手机格式!']" /> Date: Tue, 6 Jun 2023 11:16:51 +0800 Subject: [PATCH 2/3] =?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 | 6 +++--- src/pages/DraftManage.vue | 6 +++--- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/src/api/DraftApi.ts b/src/api/DraftApi.ts index 4eea281..9e61d8e 100644 --- a/src/api/DraftApi.ts +++ b/src/api/DraftApi.ts @@ -1,6 +1,6 @@ import { api } from 'src/boot/axios'; -const DraftUriBase = '/api/draft/layout'; +const DraftUriBase = '/api/drafting'; /** * 分页查询 @@ -8,11 +8,11 @@ const DraftUriBase = '/api/draft/layout'; * @returns */ export function pageQuery(query: { - pageNum: number; + current: number; size: number; name: string; }) { - return api.get(`${DraftUriBase}/page`, { params: query }); + return api.get(`${DraftUriBase}/paging`, { params: query }); } /** diff --git a/src/pages/DraftManage.vue b/src/pages/DraftManage.vue index 9680784..d128014 100644 --- a/src/pages/DraftManage.vue +++ b/src/pages/DraftManage.vue @@ -164,7 +164,7 @@ async function onRequest(props: any) { loading.value = true; try { let response = await pageQuery({ - pageNum: page, + current: page, size: rowsPerPage, name: filter.name, }); @@ -178,7 +178,7 @@ async function onRequest(props: any) { } catch (error: any) { $q.notify({ type: 'negative', - message: error, + message: error.message, }); } finally { loading.value = false; @@ -234,7 +234,7 @@ async function publishGraphics() { } catch (error: any) { $q.notify({ type: 'negative', - message: error, + message: error.message, }); } } From 17c2c02e10e6215dfafa0cdac723520b808af914 Mon Sep 17 00:00:00 2001 From: dong <58670809@qq.com> Date: Tue, 6 Jun 2023 13:14:42 +0800 Subject: [PATCH 3/3] =?UTF-8?q?=E8=8D=89=E7=A8=BF=E6=8E=A5=E5=8F=A3?= =?UTF-8?q?=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 | 41 ++++++++++++++++++++++++++++++--------- src/pages/DraftManage.vue | 10 +++++----- 2 files changed, 37 insertions(+), 14 deletions(-) diff --git a/src/api/DraftApi.ts b/src/api/DraftApi.ts index 9e61d8e..3a1615f 100644 --- a/src/api/DraftApi.ts +++ b/src/api/DraftApi.ts @@ -1,18 +1,32 @@ import { api } from 'src/boot/axios'; +import { PageDto, PageQueryDto } from './ApiCommon'; const DraftUriBase = '/api/drafting'; +interface Item { + id: number; + name: string; + proto: Array; + createdAt: string; + updateAt: string; +} + +export class PagingQueryParams extends PageQueryDto { + name?: string; +} + /** * 分页查询 - * @param query + * @param params * @returns */ -export function pageQuery(query: { - current: number; - size: number; - name: string; -}) { - return api.get(`${DraftUriBase}/paging`, { params: query }); +export async function pageQuery( + params: PagingQueryParams +): Promise> { + const response = await api.get(`${DraftUriBase}/paging`, { + params: params, + }); + return response.data; } /** @@ -20,8 +34,8 @@ export function pageQuery(query: { * @param params * @returns */ -export function createDraft(draftData: { name: string }): Promise { - return api.post(`${DraftUriBase}/create`, draftData); +export function createDraft(draftData: { name: string }) { + return api.post(`${DraftUriBase}`, draftData); } /** @@ -43,3 +57,12 @@ export function publishDraft(data: { }) { return api.post(`${DraftUriBase}/publish`, data); } + +/** + * 获取草稿数据 + * @param params + * @returns + */ +export function getDraft(id: string) { + return api.get(`${DraftUriBase}/${id}`); +} diff --git a/src/pages/DraftManage.vue b/src/pages/DraftManage.vue index d128014..491b61f 100644 --- a/src/pages/DraftManage.vue +++ b/src/pages/DraftManage.vue @@ -128,15 +128,15 @@ const columnDefs: QTableColumn[] = [ }, { name: 'creator', label: '创建人', field: 'creator', align: 'center' }, { - name: 'createTime', + name: 'createdAt', label: '创建时间', - field: 'createTime', + field: 'createdAt', align: 'center', }, { - name: 'updateTime', + name: 'updateAt', label: '更新时间', - field: 'updateTime', + field: 'updateAt', align: 'center', }, { name: 'operations', label: '操作', field: 'operations', align: 'center' }, @@ -168,7 +168,7 @@ async function onRequest(props: any) { size: rowsPerPage, name: filter.name, }); - const pageData = response.data; + const pageData = response; pagination.value.rowsNumber = pageData.total; pagination.value.page = page; pagination.value.rowsPerPage = rowsPerPage;