This commit is contained in:
Yuan 2023-06-06 13:18:00 +08:00
commit b3da1703b5
4 changed files with 46 additions and 17 deletions

View File

@ -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<string>;
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<PageDto<Item>> {
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<string> {
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}`);
}

View File

@ -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,
});
}
}

View File

@ -23,6 +23,9 @@
v-model="loginInfo.account"
label="账号"
lazy-rules
type="tel"
mask="###########"
:rules="[(val) => val.length == 11 || '请输入正确手机格式!']"
/>
<q-input

View File

@ -30,6 +30,9 @@
v-model="loginInfo.mobile"
label="手机号"
lazy-rules
type="tel"
mask="###########"
:rules="[(val) => val.length == 11 || '请输入正确手机格式!']"
/>
<q-input