代码调整
This commit is contained in:
parent
481a2b12c1
commit
5f6b52228b
@ -1,22 +1,18 @@
|
||||
import { api } from 'src/boot/axios';
|
||||
import { PageQueryDto } from './ApiCommon';
|
||||
|
||||
const DraftUriBase = '/api/draft';
|
||||
|
||||
export class PagingQueryParams extends PageQueryDto {
|
||||
name?: string;
|
||||
}
|
||||
const DraftUriBase = '/api/draft/layout';
|
||||
|
||||
/**
|
||||
* 分页查询用户信息
|
||||
* @param params
|
||||
* 分页查询
|
||||
* @param query
|
||||
* @returns
|
||||
*/
|
||||
export async function pageQuery(params: PagingQueryParams) {
|
||||
const response = await api.get(`${DraftUriBase}/paging`, {
|
||||
params: params,
|
||||
});
|
||||
return response.data;
|
||||
export function pageQuery(query: {
|
||||
pageNum: number;
|
||||
size: number;
|
||||
name: string;
|
||||
}) {
|
||||
return api.get(`${DraftUriBase}/page`, { params: query });
|
||||
}
|
||||
|
||||
/**
|
||||
@ -24,29 +20,26 @@ export async function pageQuery(params: PagingQueryParams) {
|
||||
* @param params
|
||||
* @returns
|
||||
*/
|
||||
export async function createDraft(draftData: {
|
||||
name: string;
|
||||
}): Promise<string> {
|
||||
const response = await api.post(`${DraftUriBase}/create`, draftData);
|
||||
return response.data;
|
||||
export function createDraft(draftData: { name: string }): Promise<string> {
|
||||
return api.post(`${DraftUriBase}/create`, draftData);
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除草稿
|
||||
* @param id 草稿id
|
||||
*/
|
||||
export async function deleteDraft(id: string) {
|
||||
return await api.delete(`${DraftUriBase}/delete/${id}`);
|
||||
export function deleteDraft(id: string) {
|
||||
return api.delete(`${DraftUriBase}/${id}`);
|
||||
}
|
||||
|
||||
/**
|
||||
* 草稿图发布
|
||||
* @param id 草稿id
|
||||
*/
|
||||
export async function publishDraft(data: {
|
||||
export function publishDraft(data: {
|
||||
layoutId: string;
|
||||
name: string;
|
||||
overwrite?: boolean;
|
||||
}) {
|
||||
return await api.post(`${DraftUriBase}/publish`, data);
|
||||
return api.post(`${DraftUriBase}/publish`, data);
|
||||
}
|
||||
|
@ -20,7 +20,7 @@
|
||||
v-model="filter.name"
|
||||
label="名称"
|
||||
></q-input>
|
||||
<q-btn flat round color="primary" icon="sym_o_search" />
|
||||
<q-btn flat round color="primary" icon="search" />
|
||||
<q-btn color="primary" label="新建" @click="createFormShow = true" />
|
||||
</template>
|
||||
|
||||
@ -164,7 +164,7 @@ async function onRequest(props: any) {
|
||||
loading.value = true;
|
||||
try {
|
||||
let response = await pageQuery({
|
||||
current: page,
|
||||
pageNum: page,
|
||||
size: rowsPerPage,
|
||||
name: filter.name,
|
||||
});
|
||||
|
@ -24,7 +24,7 @@
|
||||
:options="optionsSearch"
|
||||
></q-select>
|
||||
</q-card-section>
|
||||
<q-btn flat round color="primary" icon="sym_o_search" />
|
||||
<q-btn flat round color="primary" icon="search" />
|
||||
</template>
|
||||
|
||||
<template v-slot:body-cell-operations="props">
|
||||
|
Loading…
Reference in New Issue
Block a user