import { action, makeObservable, observable } from "mobx";
// 档案文件夹
import baseHttp from "@/service/base";
import BaseStore from "./baseStore";
import { TagDataType } from "@/model/userModel";

class FolderConfig {
    static LIST: string = "/v1/archives/folder/list"
    static ADD: string = "/v1/archives/folder"
    static DELETE: string = "/v1/archives/folder"
    static EDIT: string = "/v1/archives/folder"
    static AList: string = "/v1/archives/list"
}
class FolderStore extends BaseStore<TagDataType> {

    constructor() {
        super(FolderConfig)
        makeObservable(this, {
            getAlist: action,
            getFolderList: action,
            alist: observable,
        })
    }

    async getAlist(idl?: string) {
        let res = await baseHttp.get(FolderConfig.AList+"/"+idl, {});
        this.alist = res.data?.record;
    }
    async getFolderList(idl?: string) {
        return await baseHttp.get(FolderConfig.LIST+"/"+idl, {});
    }
    alist!: Array<any>;
}
const folderStore = new FolderStore()
export default folderStore;

