feat(form): table配置支持showIndex用于控制行号

This commit is contained in:
roymondchen 2022-09-22 12:29:15 +08:00 committed by jia000
parent 34b628cc07
commit eb03ce358f
2 changed files with 10 additions and 1 deletions

View File

@ -76,7 +76,7 @@
width="45"
></el-table-column>
<el-table-column width="60" label="序号" v-if="showIndex">
<el-table-column width="60" label="序号" v-if="showIndex && config.showIndex">
<template v-slot="scope">{{ scope.$index + 1 + pagecontext * pagesize }}</template>
</el-table-column>

View File

@ -570,20 +570,29 @@ export interface TableConfig extends FormItem {
tableItems?: ColumnConfig[];
groupItems?: ColumnConfig[];
enableToggleMode?: boolean;
/** 最大行数 */
max?: number;
/** 最大高度 */
maxHeight?: number | string;
border?: boolean;
/** 显示行号 */
showIndex?: boolean;
enum?: any[];
/** 是否显示添加按钮 */
addable?: (mForm: FormState | undefined, data: any) => boolean | 'undefined' | boolean;
/** 是否显示删除按钮 */
delete?: (model: any, index: number, values: any) => boolean | boolean;
/** 是否显示导入按钮 */
importable?: (mForm: FormState | undefined, data: any) => boolean | 'undefined' | boolean;
/** 是否显示checkbox */
selection?: (mForm: FormState | undefined, data: any) => boolean | boolean | 'single';
/** 新增的默认行 */
defaultAdd?: (mForm: FormState | undefined, data: any) => any;
onSelect?: (mForm: FormState | undefined, data: any) => any;
defautSort?: SortProp;
defaultSort?: SortProp;
dropSort?: boolean;
/** 是否显示全屏按钮 */
enableFullscreen?: boolean;
fixed?: boolean;
itemExtra?: string | FilterFunction;