diff --git a/src/api/DraftApi.ts b/src/api/DraftApi.ts index af88d88..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: { - pages: 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 0d4ff4a..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' }, @@ -164,11 +164,11 @@ async function onRequest(props: any) { loading.value = true; try { let response = await pageQuery({ - pages: page, + current: page, 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; @@ -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, }); } } 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 || '请输入正确手机格式!']" />