Skip to content

Commit

Permalink
默认排序改成录制中排最前面 (#710)
Browse files Browse the repository at this point in the history
  • Loading branch information
kira1928 authored May 5, 2024
1 parent 31dfc42 commit ba3ca83
Showing 1 changed file with 14 additions and 2 deletions.
16 changes: 14 additions & 2 deletions src/webapp/src/component/live-list/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ class LiveList extends React.Component<Props, IState> {
//定时器
timer!: NodeJS.Timeout;

runStatus = {
runStatus: ColumnProps<ItemData> = {
title: '运行状态',
key: 'tags',
dataIndex: 'tags',
Expand Down Expand Up @@ -71,9 +71,21 @@ class LiveList extends React.Component<Props, IState> {
})}
</span>
),
sorter: (a: ItemData, b: ItemData) => {
const isRecordingA = a.tags.includes('录制中');
const isRecordingB = b.tags.includes('录制中');
if (isRecordingA === isRecordingB) {
return 0;
} else if (isRecordingA) {
return 1;
} else {
return -1;
}
},
defaultSortOrder: 'descend',
};

runAction = {
runAction: ColumnProps<ItemData> = {
title: '操作',
key: 'action',
dataIndex: 'listening',
Expand Down

0 comments on commit ba3ca83

Please sign in to comment.