chore: 默认值

This commit is contained in:
dap 2024-10-06 09:53:00 +08:00
parent da4c612481
commit 60ae7cc0cc
15 changed files with 103 additions and 100 deletions

View File

@ -1,6 +1,6 @@
import type { Dept } from './model';
import type { ID, PageQuery } from '#/api/common';
import type { ID } from '#/api/common';
import { requestClient } from '#/api/request';
@ -10,7 +10,7 @@ enum Api {
root = '/system/dept',
}
export function deptList(params?: PageQuery) {
export function deptList(params?: any) {
return requestClient.get<Dept[]>(Api.deptList, { params });
}

View File

@ -1,6 +1,6 @@
import type { Menu, MenuOption, MenuResp } from './model';
import type { ID, IDS, PageQuery } from '#/api/common';
import type { ID, IDS } from '#/api/common';
import { requestClient } from '#/api/request';
@ -12,7 +12,7 @@ enum Api {
tenantPackageMenuTreeselect = '/system/menu/tenantPackageMenuTreeselect',
}
export function menuList(params?: PageQuery) {
export function menuList(params?: any) {
return requestClient.get<Menu[]>(Api.menuList, { params });
}

View File

@ -44,7 +44,7 @@ const gridOptions: VxeGridProps = {
pagerConfig: {},
proxyConfig: {
ajax: {
query: async ({ page }, formValues) => {
query: async ({ page }, formValues = {}) => {
return await loginInfoList({
pageNum: page.currentPage,
pageSize: page.pageSize,
@ -147,7 +147,7 @@ async function handleUnlock() {
:disabled="!checked"
danger
type="primary"
v-access:code="['monitor:logininfor:delete']"
v-access:code="['monitor:logininfor:remove']"
@click="handleMultiDelete"
>
{{ $t('pages.common.delete') }}
@ -158,7 +158,6 @@ async function handleUnlock() {
</Space>
</template>
<template #action="{ row }">
<Space>
<a-button size="small" type="link" @click.stop="handlePreview(row)">
{{ $t('pages.common.info') }}
</a-button>
@ -167,11 +166,16 @@ async function handleUnlock() {
title="确认删除?"
@confirm="() => handleDelete(row)"
>
<a-button danger size="small" type="link" @click.stop="">
<a-button
danger
size="small"
type="link"
v-access:code="['monitor:logininfor:remove']"
@click.stop=""
>
删除
</a-button>
</Popconfirm>
</Space>
</template>
</BasicTable>
<LoginInfoModal />

View File

@ -45,7 +45,7 @@ const gridOptions: VxeGridProps = {
pagerConfig: {},
proxyConfig: {
ajax: {
query: async ({ page }, formValues) => {
query: async ({ page }, formValues = {}) => {
return await clientList({
pageNum: page.currentPage,
pageSize: page.pageSize,

View File

@ -43,7 +43,7 @@ const gridOptions: VxeGridProps = {
pagerConfig: {},
proxyConfig: {
ajax: {
query: async ({ page }, formValues) => {
query: async ({ page }, formValues = {}) => {
//
if (formValues?.createTime) {
formValues.params = {
@ -105,7 +105,7 @@ async function handleEdit(record: Recordable<any>) {
async function handleDelete(row: Recordable<any>) {
await configRemove(row.configId);
await tableApi.reload();
await tableApi.query();
}
function handleMultiDelete() {
@ -117,14 +117,14 @@ function handleMultiDelete() {
content: `确认删除选中的${ids.length}条记录吗?`,
onOk: async () => {
await configRemove(ids);
await tableApi.reload();
await tableApi.query();
},
});
}
async function handleRefreshCache() {
await configRefreshCache();
await tableApi.reload();
await tableApi.query();
}
</script>
@ -187,6 +187,6 @@ async function handleRefreshCache() {
</Popconfirm>
</template>
</BasicTable>
<ConfigModal @reload="tableApi.reload()" />
<ConfigModal @reload="tableApi.query()" />
</Page>
</template>

View File

@ -117,13 +117,18 @@ export const drawerSchema: FormSchemaGetter = () => [
rules: z
.string()
.regex(/^1[3,4578]\d{9}$/, { message: '请输入正确的手机号' })
.optional(),
.optional()
.or(z.literal('')),
},
{
component: 'Input',
fieldName: 'email',
label: '邮箱',
rules: z.string().email({ message: '请输入正确的邮箱' }).optional(),
rules: z
.string()
.email({ message: '请输入正确的邮箱' })
.optional()
.or(z.literal('')),
},
{
component: 'RadioGroup',

View File

@ -31,7 +31,7 @@ const gridOptions: VxeGridProps = {
},
proxyConfig: {
ajax: {
query: async (_, formValues) => {
query: async (_, formValues = {}) => {
const resp = await deptList({
...formValues,
});
@ -117,7 +117,6 @@ function collapseAll() {
</Space>
</template>
<template #action="{ row }">
<Space>
<a-button
size="small"
type="link"
@ -141,7 +140,6 @@ function collapseAll() {
{{ $t('pages.common.delete') }}
</a-button>
</Popconfirm>
</Space>
</template>
</BasicTable>
<DeptDrawer @reload="tableApi.query()" />

View File

@ -29,7 +29,7 @@ const gridOptions: VxeGridProps = {
},
proxyConfig: {
ajax: {
query: async (_, formValues) => {
query: async (_, formValues = {}) => {
const resp = await menuList({
...formValues,
});
@ -109,7 +109,6 @@ function collapseAll() {
</Space>
</template>
<template #action="{ row }">
<Space>
<a-button
size="small"
type="link"
@ -127,13 +126,12 @@ function collapseAll() {
danger
size="small"
type="link"
v-access:code="['system:menu:delete']"
v-access:code="['system:menu:remove']"
@click.stop=""
>
{{ $t('pages.common.delete') }}
</a-button>
</Popconfirm>
</Space>
</template>
</BasicTable>
<MenuDrawer @reload="tableApi.query()" />

View File

@ -37,7 +37,7 @@ const gridOptions: VxeGridProps = {
pagerConfig: {},
proxyConfig: {
ajax: {
query: async ({ page }, formValues) => {
query: async ({ page }, formValues = {}) => {
//
if (formValues?.createTime) {
formValues.params = {
@ -100,7 +100,7 @@ async function handleEdit(record: Recordable<any>) {
async function handleDelete(row: Recordable<any>) {
await noticeRemove(row.noticeId);
await tableApi.reload();
await tableApi.query();
}
function handleMultiDelete() {
@ -112,7 +112,7 @@ function handleMultiDelete() {
content: `确认删除选中的${ids.length}条记录吗?`,
onOk: async () => {
await noticeRemove(ids);
await tableApi.reload();
await tableApi.query();
},
});
}
@ -170,6 +170,6 @@ function handleMultiDelete() {
</Popconfirm>
</template>
</BasicTable>
<NoticeModal @reload="tableApi.reload()" />
<NoticeModal @reload="tableApi.query()" />
</Page>
</template>

View File

@ -40,7 +40,7 @@ const gridOptions: VxeGridProps = {
pagerConfig: {},
proxyConfig: {
ajax: {
query: async ({ page }, formValues) => {
query: async ({ page }, formValues = {}) => {
//
if (formValues?.createTime) {
formValues.params = {

View File

@ -45,7 +45,7 @@ const gridOptions: VxeGridProps = {
pagerConfig: {},
proxyConfig: {
ajax: {
query: async ({ page }, formValues) => {
query: async ({ page }, formValues = {}) => {
//
if (formValues?.createTime) {
formValues.params = {
@ -127,7 +127,7 @@ function handleMultiDelete() {
content: `确认删除选中的${ids.length}条记录吗?`,
onOk: async () => {
await postRemove(ids);
await tableApi.reload();
await tableApi.query();
},
});
}
@ -172,7 +172,6 @@ function handleMultiDelete() {
</Space>
</template>
<template #action="{ row }">
<Space>
<a-button
size="small"
type="link"
@ -196,7 +195,6 @@ function handleMultiDelete() {
{{ $t('pages.common.delete') }}
</a-button>
</Popconfirm>
</Space>
</template>
</BasicTable>
<PostDrawer @reload="tableApi.query()" />

View File

@ -61,7 +61,7 @@ const gridOptions: VxeGridProps = {
pagerConfig: {},
proxyConfig: {
ajax: {
query: async ({ page }, formValues) => {
query: async ({ page }, formValues = {}) => {
//
if (formValues?.createTime) {
formValues.params = {

View File

@ -45,7 +45,7 @@ const gridOptions: VxeGridProps = {
pagerConfig: {},
proxyConfig: {
ajax: {
query: async ({ page }, formValues) => {
query: async ({ page }, formValues = {}) => {
//
if (formValues?.createTime) {
formValues.params = {

View File

@ -45,7 +45,7 @@ const gridOptions: VxeGridProps = {
pagerConfig: {},
proxyConfig: {
ajax: {
query: async ({ page }, formValues) => {
query: async ({ page }, formValues = {}) => {
//
if (formValues?.createTime) {
formValues.params = {

View File

@ -83,7 +83,7 @@ const gridOptions: VxeGridProps = {
pagerConfig: {},
proxyConfig: {
ajax: {
query: async ({ page }, formValues) => {
query: async ({ page }, formValues = {}) => {
//
if (formValues?.createTime) {
formValues.params = {