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


class EmergencyConfig {
    static LIST: string = "/v1/emerg/list"
    static ADD: string = "/v1/emerg"
    static DELETE: string = "/v1/emerg"
    static EDIT: string = "/v1/emerg"
    static ACCESS: string = "/v1/emerg/accept"
    static fish: string = "/v1/emerg/fish"
    static USERLIST: string = "/v1/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()

