fix: 计划任务详情页删除时刷新选中值 (#1616)

pull/1619/head
ssongliu 2023-07-12 14:35:15 +08:00 committed by GitHub
parent 1a891cb048
commit f40b053e5b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 7 additions and 0 deletions

View File

@ -186,6 +186,8 @@ func (u *CronjobService) HandleRmExpired(backType, backupPath, localDir string,
itemPath := strings.TrimPrefix(backupPath, "/")
itemPath = strings.TrimSuffix(itemPath, "/") + "/"
fileItem = itemPath + strings.TrimPrefix(file, localDir+"/")
} else {
fileItem = strings.TrimPrefix(file, localDir+"/")
}
}
_, _ = backClient.Delete(fileItem)

View File

@ -528,12 +528,17 @@ const search = async () => {
if (!currentRecord.value) {
currentRecord.value = records.value[0];
} else {
let beDelete = true;
for (const item of records.value) {
if (item.id === currentRecord.value.id) {
beDelete = false;
currentRecord.value = item;
break;
}
}
if (beDelete) {
currentRecord.value = records.value[0];
}
}
if (currentRecord.value?.records) {
loadRecord(currentRecord.value);