单表示例,加入字段排序和默认排序例子
parent
5b806bc70d
commit
91bb10a861
|
@ -8,6 +8,7 @@ export const columns: BasicColumn[] = [
|
||||||
dataIndex: 'name',
|
dataIndex: 'name',
|
||||||
width: 70,
|
width: 70,
|
||||||
align: 'left',
|
align: 'left',
|
||||||
|
sorter: true
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
title: '关键词',
|
title: '关键词',
|
||||||
|
@ -23,6 +24,7 @@ export const columns: BasicColumn[] = [
|
||||||
title: '工资',
|
title: '工资',
|
||||||
dataIndex: 'salaryMoney',
|
dataIndex: 'salaryMoney',
|
||||||
width: 40,
|
width: 40,
|
||||||
|
sorter: true
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
title: '奖金',
|
title: '奖金',
|
||||||
|
@ -32,6 +34,7 @@ export const columns: BasicColumn[] = [
|
||||||
{
|
{
|
||||||
title: '性别',
|
title: '性别',
|
||||||
dataIndex: 'sex',
|
dataIndex: 'sex',
|
||||||
|
sorter: true,
|
||||||
customRender: ({ record }) => {
|
customRender: ({ record }) => {
|
||||||
return render.renderDict(record.sex, 'sex');
|
return render.renderDict(record.sex, 'sex');
|
||||||
// let v = record.sex ? (record.sex == '1' ? '男' : '女') : '';
|
// let v = record.sex ? (record.sex == '1' ? '男' : '女') : '';
|
||||||
|
|
|
@ -119,6 +119,11 @@
|
||||||
style: { textAlign: 'left' },
|
style: { textAlign: 'left' },
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
//自定义默认排序
|
||||||
|
defSort: {
|
||||||
|
column: 'sex,salaryMoney',
|
||||||
|
order: 'desc',
|
||||||
|
},
|
||||||
striped: true,
|
striped: true,
|
||||||
useSearchForm: true,
|
useSearchForm: true,
|
||||||
showTableSetting: true,
|
showTableSetting: true,
|
||||||
|
|
Loading…
Reference in New Issue