This commit is contained in:
dap
2024-12-13 08:36:45 +08:00
57 changed files with 1240 additions and 135 deletions

View File

@@ -7,12 +7,12 @@ import { Page, useVbenDrawer, type VbenFormProps } from '@vben/common-ui';
import { $t } from '@vben/locales';
import { Modal, Space } from 'ant-design-vue';
import { isEmpty } from 'lodash-es';
import {
useVbenVxeGrid,
vxeCheckboxChecked,
type VxeGridProps,
vxeSortEvent,
} from '#/adapter/vxe-table';
import {
operLogClean,
@@ -60,18 +60,12 @@ const gridOptions: VxeGridProps<OperationLog> = {
pagerConfig: {},
proxyConfig: {
ajax: {
query: async ({ page, sort }, formValues = {}) => {
query: async ({ page }, formValues = {}) => {
const params: any = {
pageNum: page.currentPage,
pageSize: page.pageSize,
...formValues,
};
if (!isEmpty(sort)) {
params.orderByColumn = sort.field;
params.isAsc = sort.order;
}
return await operLogList(params);
},
},
@@ -81,7 +75,10 @@ const gridOptions: VxeGridProps<OperationLog> = {
keyField: 'operId',
},
sortConfig: {
// 远程排序
remote: true,
// 支持多字段排序 默认关闭
multiple: true,
},
id: 'monitor-operlog-index',
};
@@ -90,9 +87,7 @@ const [BasicTable, tableApi] = useVbenVxeGrid({
formOptions,
gridOptions,
gridEvents: {
sortChange: () => {
tableApi.query();
},
sortChange: (sortParams) => vxeSortEvent(tableApi, sortParams),
},
});

View File

@@ -17,12 +17,12 @@ import {
Switch,
Tooltip,
} from 'ant-design-vue';
import { isEmpty } from 'lodash-es';
import {
useVbenVxeGrid,
vxeCheckboxChecked,
type VxeGridProps,
vxeSortEvent,
} from '#/adapter/vxe-table';
import { configInfoByKey } from '#/api/system/config';
import { ossDownload, ossList, ossRemove } from '#/api/system/oss';
@@ -66,16 +66,12 @@ const gridOptions: VxeGridProps = {
pagerConfig: {},
proxyConfig: {
ajax: {
query: async ({ page, sort }, formValues = {}) => {
query: async ({ page }, formValues = {}) => {
const params: any = {
pageNum: page.currentPage,
pageSize: page.pageSize,
...formValues,
};
if (!isEmpty(sort)) {
params.orderByColumn = sort.field;
params.isAsc = sort.order;
}
return await ossList(params);
},
},
@@ -86,7 +82,10 @@ const gridOptions: VxeGridProps = {
height: 65,
},
sortConfig: {
// 远程排序
remote: true,
// 支持多字段排序 默认关闭
multiple: false,
},
id: 'system-oss-index',
};
@@ -95,9 +94,7 @@ const [BasicTable, tableApi] = useVbenVxeGrid({
formOptions,
gridOptions,
gridEvents: {
sortChange: () => {
tableApi.query();
},
sortChange: (sortParams) => vxeSortEvent(tableApi, sortParams),
},
});

View File

@@ -192,7 +192,7 @@ const { hasAccessByCodes } = useAccess();
<div class="flex h-full gap-[8px]">
<DeptTree
v-model:select-dept-id="selectDeptId"
:width="260"
class="w-[260px]"
@reload="() => tableApi.reload()"
@select="() => tableApi.reload()"
/>