import request from '@/utils/request'
import store from '@/store'


/**
 * 获取危险源
 * http://127.0.0.1:8899/3rd/ent/dangerSources?cId=161279123718145&riskPointType=1
 *
 * @return
 */
export function getDangerSources(baseUrl, data) {
    return request({
        url: baseUrl + '/3rd/ent/dangerSources',
        method: 'get',
        params: data
    })
}

/**
 * 获取岗位
 * http://127.0.0.1:8899/3rd/ent/getPositionList?cId=161279123718145
 *
 * @return
 */
export function getPositionList(baseUrl, data) {
    return request({
        url: baseUrl + '/3rd/ent/getPositionList',
        method: 'get',
        params: data
    })
}

/**
 * 企业管控层级
 * http://127.0.0.1:8899/3rd/ent/getCtrlList?cId=161279123718145
 *
 * @return
 */
export function getCtrlList(baseUrl, data) {
    return request({
        url: baseUrl + '/3rd/ent/getCtrlList',
        method: 'get',
        params: data
    })
}

/**
 * 保存作业步骤
 * {"riskName":"作业步骤","riskConsequence":"危害产生的后果","riskReason":"危害因素","riskCtrlLevelId":"161279127912452","riskLevel":"4","riskCode":"风险编号","riskPointType":"1","dangerSrcId":"168959563923457","dangerSrcName":"测试","riskMeasureType5":"5","riskLevelText":"岗位级","riskMeasureType2":"2","riskCtrlPositionId":"161279488622596","riskMeasureType1":"1","riskMeasureType4":"4","riskMeasureType3":"3"}
 *
 * @return
 */
export function saveRisk(baseUrl, data) {
    return request({
        url: baseUrl + '/3rd/ent/saveRisk',
        method: 'post',
        data
    })
}

/**
 * 获取风险列表
 * http://127.0.0.1:8899/3rd/ent/riskList?cId=161279123718145&riskPointType=1
 *
 * @return
 */
export function riskList(baseUrl, data) {
    return request({
        url: baseUrl + '/3rd/ent/riskList',
        method: 'get',
        params: data
    })
}

// 获取风险措施 详情
export function getRiskMeasureListByRiskId(baseUrl, data) {
    return request({
        url: baseUrl + '/3rd/sysRisk/getRiskMeasureListByRiskId',
        method: 'get',
        params: data
    })
}

/**
 * 删除逾期任务(物理删除)
 *
 * @return
 */
export function delRiskCheckSchdule(baseUrl, data) {
    return request({
        url: baseUrl + '/3rd/ent/delRiskCheckSchdule',
        method: 'get',
        params: data
    })
}

/**
 * 删除逾期任务(逻辑删除)
 *
 * @return
 */
export function upDelRiskCheckSchdule(baseUrl, data) {
    return request({
        url: baseUrl + '/3rd/ent/upDelRiskCheckSchdule',
        method: 'get',
        params: data
    })
}


/**
 * 删除逾期任务(逻辑删除)
 *
 * @return
 */
export function delScoreLog(baseUrl, data) {
    return request({
        url: baseUrl + '/3rd/ent/delScoreLog',
        method: 'get',
        params: data
    })
}
