mirror of
https://github.com/whyour/qinglong.git
synced 2026-07-17 17:54:32 +08:00
日志管理支持删除日志文件和目录
This commit is contained in:
@@ -283,17 +283,7 @@ const Script = () => {
|
||||
message.success(`删除成功`);
|
||||
let newData = [...data];
|
||||
if (currentNode.parent) {
|
||||
const parentNodeIndex = newData.findIndex(
|
||||
(x) => x.key === currentNode.parent,
|
||||
);
|
||||
const parentNode = newData[parentNodeIndex];
|
||||
const index = parentNode.children.findIndex(
|
||||
(y) => y.key === currentNode.key,
|
||||
);
|
||||
if (index !== -1 && parentNodeIndex !== -1) {
|
||||
parentNode.children.splice(index, 1);
|
||||
newData.splice(parentNodeIndex, 1, { ...parentNode });
|
||||
}
|
||||
newData = depthFirstSearch(newData, (c) => c.key === currentNode.key);
|
||||
} else {
|
||||
const index = newData.findIndex(
|
||||
(x) => x.key === currentNode.key,
|
||||
|
||||
Reference in New Issue
Block a user