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

class ExceCompetConfig {
    static LIST: string = "/v1/exceCompet/list"
    static ADD: string = "/v1/exceCompet"
    static DELETE: string = "/v1/exceCompet"
    static EDIT: string = "/v1/exceCompet"
    static Audit: string = "/v1/exceCompet/audit"
}
class ExceCompetStore extends BaseStore<TagDataType> {
    constructor() {
        super(ExceCompetConfig)
        makeObservable(this, {
            save: action,
            audit: action
        })
    }

    async audit(id: string, param: Object) {
        await baseHttp.put(ExceCompetConfig.Audit + "/" + id, param)
        this.getlist();
    }
    async save(id: string, list: Array<any>) {
        return await baseHttp.post(ExceCompetConfig.ADD + "/" + id, { "list": list });
    }
}
export const exceCompetStore = new ExceCompetStore()

