feat: 优化创建分组字段填充

This commit is contained in:
tbphp
2025-07-23 18:39:17 +08:00
parent 529513f848
commit 2d41a1b45d
3 changed files with 107 additions and 15 deletions

View File

@@ -51,6 +51,15 @@ async function handleGroupRefresh() {
}
}
async function handleGroupRefreshAndSelect(targetGroupId: number) {
await loadGroups();
// 刷新完成后,切换到指定的分组
const targetGroup = groups.value.find(g => g.id === targetGroupId);
if (targetGroup) {
handleGroupSelect(targetGroup);
}
}
function handleGroupDelete(deletedGroup: Group) {
// 从分组列表中移除已删除的分组
groups.value = groups.value.filter(g => g.id !== deletedGroup.id);
@@ -71,6 +80,7 @@ function handleGroupDelete(deletedGroup: Group) {
:loading="loading"
@group-select="handleGroupSelect"
@refresh="handleGroupRefresh"
@refresh-and-select="handleGroupRefreshAndSelect"
/>
</div>