知识库以及文件重命名、移动、删除

This commit is contained in:
1025859868@qq.com
2024-06-07 13:49:49 +08:00
parent 2e6312e84f
commit 8af9a4cb61
6 changed files with 228 additions and 57 deletions

View File

@@ -34,6 +34,10 @@ export default function FileLibPage() {
readFileLibDatabase(param.page, 10000, param.keyword, parentId)
)
useEffect(() => {
reload()
}, [])
// Delete
const { delShow, idRef, close, delConfirm } = useDelete();
@@ -62,12 +66,12 @@ export default function FileLibPage() {
const backFolder = (parentId, index) => {
setParentId(parentId)
reload();
if(index != -1){
titleArray.splice(index)
if(index == -1){
setTitleArray([])
}else if(index == (titleArray.length - 1)){
return;
}else{
setTitleArray([])
titleArray.splice(index+1)
}
}
@@ -108,7 +112,7 @@ export default function FileLibPage() {
{
titleArray.map((title, index) => (
<div className={"title-item"} key={title}>
<span>{index == (titleArray.length - 1)? ">" : ""}</span>
<span>{index <= (titleArray.length - 1)? ">" : ""}</span>
<label onClick={()=>backFolder(title.id, index)}>{title.name}</label>
</div>
))