增加更多筛选项
This commit is contained in:
parent
5888422322
commit
4adcfacc12
@ -21,6 +21,14 @@ export const iscsStyleOption = [
|
||||
},
|
||||
];
|
||||
|
||||
export const searchTscsStyleOption = [
|
||||
{
|
||||
label: '全部',
|
||||
value: IscsStyle.UNKNOWN,
|
||||
},
|
||||
...iscsStyleOption,
|
||||
];
|
||||
|
||||
export interface DraftItem {
|
||||
id: number;
|
||||
name: string;
|
||||
@ -34,7 +42,9 @@ export interface DraftItem {
|
||||
updatedAt: string;
|
||||
defaultReleaseDataName: string;
|
||||
}
|
||||
|
||||
export interface IscsDataOptions {
|
||||
style: IscsStyle;
|
||||
}
|
||||
export interface PagingQueryParams {
|
||||
paging: {
|
||||
page: number;
|
||||
@ -42,9 +52,10 @@ export interface PagingQueryParams {
|
||||
};
|
||||
query: {
|
||||
dataType: DraftDataType;
|
||||
userId?: number;
|
||||
options?: IscsDataOptions;
|
||||
name?: string;
|
||||
isShared?: boolean;
|
||||
userId?: number;
|
||||
};
|
||||
}
|
||||
export interface DraftIscsDataDto {
|
||||
@ -52,9 +63,6 @@ export interface DraftIscsDataDto {
|
||||
options: IscsDataOptions;
|
||||
}
|
||||
|
||||
export interface IscsDataOptions {
|
||||
style: IscsStyle;
|
||||
}
|
||||
export async function draftPageQuery(
|
||||
params: PagingQueryParams
|
||||
): Promise<PageDto<DraftIscsDataDto>> {
|
||||
@ -208,10 +216,7 @@ export function saveDraft(variables: { id: number; data: string }) {
|
||||
* @param variables
|
||||
* @returns
|
||||
*/
|
||||
export async function saveAsDraft(variables: {
|
||||
id: number;
|
||||
name: string;
|
||||
}) {
|
||||
export async function saveAsDraft(variables: { id: number; name: string }) {
|
||||
const mutation = `
|
||||
mutation saveAsNewDraftData($id: Int,$name: String) {
|
||||
saveAsNewDraftData(id: $id,name: $name){
|
||||
|
@ -26,6 +26,7 @@ interface PagingQueryParams {
|
||||
userId?: number;
|
||||
name?: string;
|
||||
isPublished?: boolean;
|
||||
options?: IscsDataOptions;
|
||||
};
|
||||
}
|
||||
export interface PublishIscsDataDto {
|
||||
|
@ -15,19 +15,35 @@
|
||||
@request="onRequest"
|
||||
>
|
||||
<template v-slot:top-right>
|
||||
<q-input
|
||||
dense
|
||||
debounce="1000"
|
||||
v-model="filter.name"
|
||||
label="名称"
|
||||
></q-input>
|
||||
<q-btn flat round color="primary" icon="search" />
|
||||
<q-btn
|
||||
color="primary"
|
||||
v-if="route.name == 'iscsDraft'"
|
||||
label="新建"
|
||||
@click="createFormShow = true"
|
||||
/>
|
||||
<div class="q-gutter-md q-mt-none row justify-center items-start">
|
||||
<q-input dense debounce="1000" v-model="filter.name" label="名称" />
|
||||
<q-select
|
||||
dense
|
||||
v-model="filter.iscsStyle"
|
||||
:options="searchTscsStyleOption"
|
||||
emit-value
|
||||
map-options
|
||||
options-dense
|
||||
class="ellipsis"
|
||||
label="ISCS风格"
|
||||
style="width: 130px"
|
||||
/>
|
||||
<q-select
|
||||
v-if="route.name == 'iscsDraft'"
|
||||
dense
|
||||
v-model="filter.isShared"
|
||||
:options="isSharedOption"
|
||||
class="ellipsis"
|
||||
label="共享相关"
|
||||
style="width: 130px"
|
||||
/>
|
||||
<q-btn
|
||||
color="primary"
|
||||
v-if="route.name == 'iscsDraft'"
|
||||
label="新建"
|
||||
@click="createFormShow = true"
|
||||
/>
|
||||
</div>
|
||||
</template>
|
||||
<template v-slot:header-cell-name="props">
|
||||
<q-th :props="props">
|
||||
@ -249,6 +265,7 @@ import {
|
||||
sharedDraftPageQuery,
|
||||
PagingQueryParams,
|
||||
iscsStyleOption,
|
||||
searchTscsStyleOption,
|
||||
} from '../api/DraftApi';
|
||||
import { ApiError } from 'src/boot/axios';
|
||||
import { useRoute, useRouter } from 'vue-router';
|
||||
@ -339,6 +356,8 @@ const tableRef = ref();
|
||||
const rows = reactive([]);
|
||||
const filter = reactive({
|
||||
name: '',
|
||||
iscsStyle: IscsStyle.UNKNOWN,
|
||||
isShared: '全部',
|
||||
});
|
||||
const loading = ref(false);
|
||||
const pagination = ref({
|
||||
@ -353,8 +372,6 @@ const pagination = ref({
|
||||
let allRequestData: DraftIscsDataDto[] = [];
|
||||
async function onRequest(props: any) {
|
||||
const { page, rowsPerPage } = props.pagination;
|
||||
const filter = props.filter;
|
||||
|
||||
loading.value = true;
|
||||
const variables: PagingQueryParams = {
|
||||
paging: {
|
||||
@ -363,9 +380,19 @@ async function onRequest(props: any) {
|
||||
},
|
||||
query: {
|
||||
dataType: DraftDataType.ISCS,
|
||||
name: filter.name,
|
||||
},
|
||||
};
|
||||
if (filter.name) {
|
||||
Object.assign(variables.query, { name: filter.name });
|
||||
}
|
||||
if (filter.iscsStyle) {
|
||||
Object.assign(variables.query, { options: { style: filter.iscsStyle } });
|
||||
}
|
||||
if (filter.isShared !== '全部') {
|
||||
Object.assign(variables.query, {
|
||||
isShared: filter.isShared == '共享' ? true : false,
|
||||
});
|
||||
}
|
||||
try {
|
||||
let response: PageDto<DraftIscsDataDto>;
|
||||
if (route.name == 'iscsDraft') {
|
||||
@ -402,6 +429,9 @@ function getTypeName(row: DraftItem) {
|
||||
return iscsStyleName || '';
|
||||
}
|
||||
|
||||
//查询相关
|
||||
const isSharedOption = ['全部', '共享', '不共享'];
|
||||
|
||||
//新建相关
|
||||
const createFormShow = ref(false);
|
||||
const createForm = reactive({
|
||||
|
@ -18,13 +18,28 @@
|
||||
@request="onRequest"
|
||||
>
|
||||
<template v-slot:top-right>
|
||||
<q-input
|
||||
dense
|
||||
debounce="1000"
|
||||
v-model="filter.name"
|
||||
label="名称"
|
||||
></q-input>
|
||||
<q-btn flat round color="primary" icon="search" />
|
||||
<div class="q-gutter-md q-mt-none row justify-center items-start">
|
||||
<q-input dense debounce="1000" v-model="filter.name" label="名称" />
|
||||
<q-select
|
||||
dense
|
||||
v-model="filter.iscsStyle"
|
||||
:options="searchTscsStyleOption"
|
||||
emit-value
|
||||
map-options
|
||||
options-dense
|
||||
class="ellipsis"
|
||||
label="ISCS风格"
|
||||
style="width: 130px"
|
||||
/>
|
||||
<q-select
|
||||
dense
|
||||
v-model="filter.isPublished"
|
||||
:options="isPublishedOption"
|
||||
class="ellipsis"
|
||||
label="上下架"
|
||||
style="width: 130px"
|
||||
/>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<template v-slot:header-cell-name="props">
|
||||
@ -141,7 +156,12 @@ import {
|
||||
import { useRoute } from 'vue-router';
|
||||
import { ApiError } from 'src/boot/axios';
|
||||
import { nextTick } from 'process';
|
||||
import { DraftDataType, iscsStyleOption } from 'src/api/DraftApi';
|
||||
import {
|
||||
DraftDataType,
|
||||
IscsStyle,
|
||||
iscsStyleOption,
|
||||
searchTscsStyleOption,
|
||||
} from 'src/api/DraftApi';
|
||||
|
||||
const route = useRoute();
|
||||
const $q = useQuasar();
|
||||
@ -210,6 +230,8 @@ const tableRef = ref();
|
||||
const rows = reactive([]);
|
||||
const filter = reactive({
|
||||
name: '',
|
||||
iscsStyle: IscsStyle.UNKNOWN,
|
||||
isPublished: '全部',
|
||||
});
|
||||
const loading = ref(false);
|
||||
const pagination = ref({
|
||||
@ -234,9 +256,19 @@ async function onRequest(props: any) {
|
||||
},
|
||||
query: {
|
||||
dataType: DraftDataType.ISCS,
|
||||
name: filter.name,
|
||||
},
|
||||
};
|
||||
if (filter.name) {
|
||||
Object.assign(variables.query, { name: filter.name });
|
||||
}
|
||||
if (filter.iscsStyle) {
|
||||
Object.assign(variables.query, { options: { style: filter.iscsStyle } });
|
||||
}
|
||||
if (filter.isPublished !== '全部') {
|
||||
Object.assign(variables.query, {
|
||||
isPublished: filter.isPublished == '上架' ? true : false,
|
||||
});
|
||||
}
|
||||
try {
|
||||
const response = await publishPageQuery(variables);
|
||||
pagination.value.rowsNumber = response.total;
|
||||
@ -268,6 +300,9 @@ function getTypeName(row: PublishItem) {
|
||||
return iscsStyleName || '';
|
||||
}
|
||||
|
||||
//查询相关
|
||||
const isPublishedOption = ['全部', '上架', '下架'];
|
||||
|
||||
//上下架
|
||||
function dataReleaseFn(row: PublishItem) {
|
||||
if (row.isPublished) {
|
||||
|
Loading…
Reference in New Issue
Block a user