fix(projects): fix table row-key ts type

This commit is contained in:
Soybean 2024-03-16 16:18:44 +08:00
parent 03c2f3aaf0
commit 0cc8f05a26
3 changed files with 16 additions and 3 deletions

View File

@ -223,6 +223,10 @@ async function handleDelete(id: number) {
getData(); getData();
} }
function getRowKey(row: Api.SystemManage.Menu) {
return row.id;
}
</script> </script>
<template> <template>
@ -246,8 +250,9 @@ async function handleDelete(id: number) {
:flex-height="!appStore.isMobile" :flex-height="!appStore.isMobile"
:scroll-x="1088" :scroll-x="1088"
:loading="loading" :loading="loading"
:row-key="getRowKey"
remote
:pagination="pagination" :pagination="pagination"
:row-key="item => item.id"
class="sm:h-full" class="sm:h-full"
/> />
<MenuOperateDrawer <MenuOperateDrawer

View File

@ -182,6 +182,10 @@ function getIndex(index: number) {
return String((page - 1) * pageSize + index + 1); return String((page - 1) * pageSize + index + 1);
} }
function getRowKey(row: Api.SystemManage.User) {
return row.id;
}
</script> </script>
<template> <template>
@ -207,8 +211,8 @@ function getIndex(index: number) {
:scroll-x="702" :scroll-x="702"
:loading="loading" :loading="loading"
remote remote
:row-key="getRowKey"
:pagination="mobilePagination" :pagination="mobilePagination"
:row-key="item => item.id"
class="sm:h-full" class="sm:h-full"
/> />
<RoleOperateDrawer <RoleOperateDrawer

View File

@ -212,6 +212,10 @@ function getIndex(index: number) {
return String((page - 1) * pageSize + index + 1); return String((page - 1) * pageSize + index + 1);
} }
function getRowKey(row: Api.SystemManage.User) {
return row.id;
}
</script> </script>
<template> <template>
@ -237,8 +241,8 @@ function getIndex(index: number) {
:scroll-x="962" :scroll-x="962"
:loading="loading" :loading="loading"
remote remote
:row-key="getRowKey"
:pagination="mobilePagination" :pagination="mobilePagination"
:row-key="item => item.id"
class="sm:h-full" class="sm:h-full"
/> />
<UserOperateDrawer <UserOperateDrawer