import request from "@/utils/request";
import {useUserStore} from "@/stores/user";

const userStore = useUserStore()

/**
 * 稽察 - 获取问题清单
 */
export function getTacQuestionList() {
    const userid = userStore.userId
    return request({
        url: '/tac/pblm/info/pageNew',
        method: 'POST',
        data: {
            "count": "false",
            "orderBy": "INTM",
            "pageNum": 1,
            "pageSize": 200,
            "pblmQlttvCd": 0,
            "persId": userid,
            "sn": 0,
            "year": 0
        }
    })
}


/**
 * 稽察 - 获取违法事项列表
 * {"class1Name":"","pageNum":2,"pageSize":20,"pblmType":"1"}
 */
export function getIllegalActList(data) {
    data.realPageNum = 0
    return request({
        url: '/tac/obj/pblmstb/page',
        method: 'POST',
        data: data
    })
}

/**
 * 违法事项详情
 */
export function getIllegalActById(id) {
    return request({
        url: `/tac/obj/pblmstb/${id}`,
        method: 'get',
    })
}

/**
 * 稽察 - 稽察单位
 */
export function getTacUnitList(rgstrId, sysType) {
    return request({
        url: '/tac/pawp/unit/sctn/list',
        method: 'POST',
        data: {"pageNum": 1, "pageSize": 1000, "rgstrId": rgstrId, "sysType": sysType}
    })
}

/**
 * 稽察 - 新增问题
 */
export function addTacQuestion(data) {
    return request({
        url: '/tac/pblm/info',
        method: 'POST',
        data: data
    })
}

export function deleteTacQuestion(pblmId) {
    return request({
        url: `/tac/pblm/info/del/${pblmId}`,
        method: 'get',
    })
}
