fix: 查询条件清空时,依旧会传递空值的请求参数

This commit is contained in:
louis 2024-02-28 15:04:31 +08:00
parent 424bde5b16
commit 8770ef36a7
4 changed files with 21 additions and 8 deletions

View File

@ -99,9 +99,15 @@ export const useTableMethods = ({ state, props, emit }: UseTableMethodsContext)
...queryFormRef.value.handleFormValues(values),
...queryParams,
};
for (const key in queryParams) {
if (queryParams[key] !== 0 && !queryParams[key]) {
delete queryParams[key];
}
}
}
loadingRef.value = true;
const res = await dataRequest(queryParams);
const isArrayResult = Array.isArray(res);

View File

@ -2,14 +2,14 @@
<div>
<router-view v-slot="{ Component }">
<template v-if="Component">
<!-- <transition mode="out-in" :duration="100"> -->
<Suspense>
<component :is="Component" />
<template #fallback>
<a-skeleton />
</template>
</Suspense>
<!-- </transition> -->
<transition mode="out-in" :duration="100">
<Suspense>
<component :is="Component" />
<template #fallback>
<a-skeleton />
</template>
</Suspense>
</transition>
</template>
</router-view>
</div>

View File

@ -91,6 +91,7 @@
:name="Object.is(route.meta?.transitionName, false) ? '' : 'fade-transform'"
mode="out-in"
appear
:duration="300"
>
<keep-alive :include="keepAliveComponents">
<component :is="Component" :key="route.fullPath" />

View File

@ -58,6 +58,12 @@ export const baseColumns: TableColumnItem[] = [
width: 120,
dataIndex: 'email',
},
{
title: 'QQ',
width: 120,
hideInSearch: true,
dataIndex: 'qq',
},
{
title: '手机',
width: 120,