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


class EmergencyConfig {
    static LIST: string = "emerg/list"
    static ADD: string = "emerg"
    static DELETE: string = "emerg"
    static EDIT: string = "emerg"
    static ACCESS: string = "emerg/accept"
    static fish: string = "emerg/fish"
    static USERLIST: string = "emerg/user"
    
}
class EmergencyStore extends BaseStore<TagDataType> {
    constructor() {
        super(EmergencyConfig)
        makeObservable(this, {
            access: action
        })
    }
    async access(id: number, param: any) {
        await baseHttp.put(EmergencyConfig.ACCESS + "/" + id, param)
        this.getlist()
    }
    async fish(id: string) {
        await baseHttp.put(EmergencyConfig.fish + "/" + id, {})
        this.getlist()
    }
    async getUserlist(id: string) {
        return await baseHttp.get(EmergencyConfig.USERLIST + "/" + id, {})
    }
}
export const emergencyStore = new EmergencyStore()

