You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

53 lines
1.4 KiB

// 用于配置某些组件的常规配置,而无需修改组件
2 years ago
import type { SorterResult } from '../components/Table'
export default {
// 表格配置
2 years ago
table: {
// 表格接口请求通用配置,可在组件prop覆盖
// 支持 xxx.xxx.xxx格式
2 years ago
fetchSetting: {
// 传给后台的当前页字段
pageField: 'pageNo',
// 传给后台的每页显示多少条的字段
2 years ago
sizeField: 'pageSize',
// 接口返回表格数据的字段
listField: 'list',
// 接口返回表格总数的字段
totalField: 'total',
2 years ago
},
// 可选的分页选项
2 years ago
pageSizeOptions: ['10', '50', '80', '100'],
// 默认每页显示多少条
2 years ago
defaultPageSize: 10,
// 默认排序方法
2 years ago
defaultSize: 'middle',
// 自定义通用排序功能
2 years ago
defaultSortFn: (sortInfo: SorterResult) => {
const { field, order } = sortInfo
if (field && order) {
return {
// 排序字段
2 years ago
field,
// 排序方式 asc/desc
order,
2 years ago
}
}
else {
2 years ago
return {}
}
},
// 自定义过滤方法
2 years ago
defaultFilterFn: (data: Partial<Recordable<string[]>>) => {
return data
},
2 years ago
},
// 滚动组件配置
2 years ago
scrollbar: {
// 是否使用原生滚动样式
// 开启后,菜单,弹窗,抽屉会使用原生滚动条组件
native: false,
},
2 years ago
}