import request from '@/utils/request'

// 查询模板指标明细列表
export function listDetail(query) {
    return request({
        url: '/metrics/detail/list',
        method: 'get',
        params: query
    })
}

// 查询模板指标明细详细
export function getDetail(tplDetailId) {
    return request({
        url: '/metrics/detail/' + tplDetailId,
        method: 'get'
    })
}

// 新增模板指标明细
export function addDetail(data) {
    return request({
        url: '/metrics/detail',
        method: 'post',
        data: data
    })
}

// 修改模板指标明细
export function updateDetail(data) {
    return request({
        url: '/metrics/detail',
        method: 'put',
        data: data
    })
}

// 删除模板指标明细
export function delDetail(tplDetailId) {
    return request({
        url: '/metrics/detail/' + tplDetailId,
        method: 'delete'
    })
}

//选择指标
export function selectDetails(tplId,query) {
    return request({
        url: `/metrics/detail/select/${tplId}`,
        method: 'get',
        params: query
    })
}

// 添加指标
export function addDetailByTplId(tplId, data) {
    return request({
        url: `/metrics/detail/add/${tplId}`,
        method: 'get',
        params: data
    })
}
