@fe6/water-pro
Version:
An enterprise-class UI design language and Vue-based implementation
160 lines (159 loc) • 3.48 kB
JavaScript
/** @format */
import { h } from 'vue';
import AEmpty from '../../empty';
import PropTypes from '../../_util/vue-types';
import { DEFAULT_FILTER_FN, DEFAULT_SORT_FN, FETCH_SETTING } from './const'; // 注释看 types/table
export var basicProps = {
clickToRowSelect: PropTypes.bool.def(true),
isTreeTable: PropTypes.bool.def(false),
draggable: PropTypes.bool.def(false),
formLabelALigin: PropTypes.oneOf(['left', 'right']).def('right'),
formLabelCol: Object,
formWrapperCol: Object,
tableSetting: {
type: Object
},
inset: PropTypes.bool,
totalRender: Function,
sortFn: {
type: Function,
default: DEFAULT_SORT_FN
},
filterFn: {
type: Function,
default: DEFAULT_FILTER_FN
},
showTableSetting: PropTypes.bool,
autoCreateKey: PropTypes.bool.def(true),
striped: PropTypes.bool.def(true),
showSummary: PropTypes.bool,
cardable: PropTypes.bool,
cardTitle: PropTypes.string,
emptyPlaceholderClassName: PropTypes.func,
locale: {
type: Object,
default: function _default() {
return {
filterConfirm: '确定',
filterReset: '重置',
emptyText: function emptyText() {
return h('div', {
style: {
position: 'absolute',
top: '50%',
left: '50%',
transform: 'translate(-50%, -50%)'
}
}, [h(AEmpty)]);
}
};
}
},
summaryFunc: {
type: [Function, Array],
default: null
},
summaryData: {
type: Array,
default: null
},
indentSize: PropTypes.number.def(24),
// TODO 是否可拖拽列
// canColDrag: PropTypes.bool.def(true),
api: {
type: Function,
default: null
},
beforeFetch: {
type: Function,
default: null
},
afterFetch: {
type: Function,
default: null
},
handleSearchInfoFn: {
type: Function,
default: null
},
fetchSetting: {
type: Object,
default: function _default() {
return FETCH_SETTING;
}
},
// 立即请求接口
immediate: PropTypes.bool.def(true),
emptyDataIsShowTable: PropTypes.bool.def(true),
// 额外的请求参数
searchInfo: {
type: Object,
default: null
},
// 使用搜索表单
useSearchForm: PropTypes.bool,
// 表单配置
formConfig: {
type: Object,
default: null
},
columns: {
type: [Array],
default: function _default() {
return [];
}
},
showIndexColumn: PropTypes.bool.def(false),
indexColumnProps: {
type: Object,
default: null
},
actionColumn: {
type: Object,
default: null
},
ellipsis: PropTypes.bool.def(true),
// 因为选中操作显示,高度不匹配
canResize: PropTypes.looseBool,
// canResize: PropTypes.bool.def(true),
clearSelectOnPageChange: PropTypes.bool,
resizeHeightOffset: PropTypes.number.def(0),
rowSelection: {
type: Object,
default: null
},
title: {
type: [String, Function],
default: null
},
titleHelpMessage: {
type: [String, Array]
},
maxHeight: PropTypes.number,
dataSource: {
type: Array,
default: null
},
rowKey: {
type: [String, Function],
default: ''
},
bordered: PropTypes.bool,
pagination: {
type: [Object, Boolean],
default: null
},
loading: PropTypes.bool,
rowClassName: {
type: Function
},
scroll: {
type: Object,
default: null
},
prefixCls: PropTypes.string,
dragOtions: {
type: Object,
default: null
}
};