fix: 排序字段中间态 orderDir 没有置空问题 (#4971)

Co-authored-by: srleng <srleng@gaojihealth.com>
This commit is contained in:
lengshengren 2022-07-27 14:22:24 +08:00 committed by GitHub
parent 066879f999
commit c4cdef65f6
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -279,7 +279,11 @@ export const TableStore = iRendererStore
primaryField: 'id',
orderBy: '',
orderDir: types.optional(
types.union(types.literal('asc'), types.literal('desc')),
types.union(
types.literal('asc'),
types.literal('desc'),
types.literal('')
),
'asc'
),
draggable: false,
@ -1268,9 +1272,9 @@ export const TableStore = iRendererStore
self.expandedRows.replace(rows.map(item => item.id));
}
function setOrderByInfo(key: string, direction: 'asc' | 'desc') {
function setOrderByInfo(key: string, direction: 'asc' | 'desc' | '') {
self.orderBy = key;
self.orderDir = direction;
self.orderDir = key ? direction : '';
}
function reset() {