feat: 首页仪表盘接口对接完成

This commit is contained in:
landaiqing
2024-07-17 00:12:32 +08:00
parent d63b76b639
commit 359ef60128
36 changed files with 2510 additions and 1162 deletions

View File

@@ -5,7 +5,7 @@ import { isHydrated, makePersistable } from "mobx-persist-store";
import { handleLocalforage } from "@/utils/localforage";
export class useFileStore {
filePath: [any] = ["/root"];
filePath: [any] = [];
constructor() {
makeObservable(this, {
@@ -14,6 +14,8 @@ export class useFileStore {
getFilePath: action,
clearFilePath: action,
getFilePathSecondLast: action,
getMiddlePath: action,
clearAllFilePath: action,
isHydrated: action,
});
makePersistable(
@@ -54,10 +56,21 @@ export class useFileStore {
}
this.filePath.pop();
}
// 清空所有文件路径
clearAllFilePath() {
this.filePath.splice(0);
}
// 获取文件路径倒数第二个
getFilePathSecondLast() {
return this.filePath.slice(0, -1).pop();
}
// 获取文件路径中间路径
getMiddlePath() {
if (this.filePath.length <= 2) {
return " ";
}
return this.filePath.slice(1, this.filePath.length - 1).join("/");
}
isHydrated() {
return isHydrated(this);