Skip to content

Commit

Permalink
feat(projects): update
Browse files Browse the repository at this point in the history
  • Loading branch information
honghuangdc committed Mar 21, 2024
1 parent 8630175 commit 4158a72
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 11 deletions.
4 changes: 0 additions & 4 deletions src/hooks/common/naive-table.ts
Original file line number Diff line number Diff line change
Expand Up @@ -221,10 +221,6 @@ export function getNaiveTableIndex(pagination: PaginationProps, index: number) {
return (page - 1) * pageSize + index + 1;
}

export function getNaiveTableRowKey<T extends TableData>(row: T) {
return row.id;
}

function isTableColumnHasKey<T>(column: TableColumn<T>): column is NaiveUI.TableColumnWithKey<T> {
return Boolean((column as NaiveUI.TableColumnWithKey<T>).key);
}
9 changes: 2 additions & 7 deletions src/views/manage/user/index2.vue
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,7 @@ import { fetchGetUserList } from '@/service/api';
import { $t } from '@/locales';
import { useAppStore } from '@/store/modules/app';
import { enableStatusRecord, userGenderRecord } from '@/constants/business';
import {
getNaiveTableIndex,
getNaiveTableRowKey,
useNaiveTable,
useNaiveTableOperate
} from '@/hooks/common/naive-table';
import { getNaiveTableIndex, useNaiveTable, useNaiveTableOperate } from '@/hooks/common/naive-table';
import UserOperateDrawer from './modules/user-operate-drawer.vue';
import UserSearch from './modules/user-search.vue';
Expand Down Expand Up @@ -178,7 +173,7 @@ function edit(id: number) {
:scroll-x="962"
:loading="loading"
remote
:row-key="getNaiveTableRowKey"
:row-key="row => row.id"
:pagination="mobilePagination"
class="sm:h-full"
/>
Expand Down

0 comments on commit 4158a72

Please sign in to comment.