Files
xk-admin/apps/web-antd/src/views/system/region/config/table.ts
李琦 f0a33a628b feat:
1. 更新框架
2. 修复框架更新后导致的问题
2026-08-10 18:44:39 +08:00

66 lines
1.6 KiB
TypeScript

import type { VxeGridProps } from '#/adapter/vxe-table';
import { getRegionList } from '#/views/system/region/api';
export const gridOptions: VxeGridProps = {
checkboxConfig: {
highlight: true,
labelField: '',
},
columnConfig: {
useKey: true,
},
rowConfig: {
useKey: true,
},
columns: [
{ type: 'checkbox', width: 60 },
{ width: 60, treeNode: true },
{ field: 'id', align: 'left', title: 'ID', width: 100 },
{ field: 'name', title: '地区' },
{ field: 'express_fee', title: '快递费' },
{ field: 'created_at', title: '创建时间' },
{ type: 'html', title: '操作', slots: { default: 'action' } },
],
keepSource: true,
pagerConfig: {},
proxyConfig: {
ajax: {
// 请求后端接口方法
query: async ({ page }, formValues) => {
return await getRegionList({
page: page.currentPage,
pageSize: page.pageSize,
...formValues,
});
},
},
},
treeConfig: {
parentField: 'pid',
rowField: 'id',
transform: true,
expandAll: false,
},
height: 'auto',
border: false,
toolbarConfig: {
// 是否显示搜索表单控制按钮
// @ts-ignore 正式环境时有完整的类型声明
search: true,
refresh: true, // 刷新
print: false, // 打印
export: false, // 导出
// custom: true, // 自定义列
zoom: true, // 最大化最小化
slots: {
buttons: 'toolbar-actions',
},
custom: {
// 自定义列-图标
icon: 'vxe-icon-menu',
},
},
showOverflow: false,
};