feat: 首页仪表盘接口对接完成
This commit is contained in:
@@ -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);
|
||||
|
Reference in New Issue
Block a user