import { price, User } from '@/api'

import request from '@/utils/require'

// 本周行情列表
export function queryReportTime(data, pageData) {
    return request({
        url: `${price}/queryReportTime?page=${pageData.page}&size=${pageData.size}`,
        method: 'post',
        data: data
    })
}
// 本周行情详情局列表
export function queryCountryDetails(data, pageData) {
    return request({
        url: `${price}/queryCountryDetails?page=${pageData.page}&size=${pageData.size}`,
        method: 'post',
        data: data
    })
}
// 本周行情详情库列表
export function queryPointDetails(data, pageData) {
    return request({
        url: `${price}/queryPointDetails?page=${pageData.page}&size=${pageData.size}`,
        method: 'post',
        data: data
    })
}
// 价格走势成品粮--局
export function queryPriceCPL(data) {
    return request({
        url: `${price}/queryPriceCPL`,
        method: 'post',
        data: data
    })
}
// 价格走势食用油--局
export function queryPriceSYY(data) {
    return request({
        url: `${price}/queryPriceSYY`,
        method: 'post',
        data: data
    })
}
// 价格走势原粮--局
export function queryPriceYL(data) {
    return request({
        url: `${price}/queryPriceYl`,
        method: 'post',
        data: data
    })
}
// 价格走势成品粮--库点
export function queryPricePointCPL(data) {
    return request({
        url: `${price}/queryPricePointCPL`,
        method: 'post',
        data: data
    })
}
// 价格走势食用油--库点
export function queryPricePointSYY(data) {
    return request({
        url: `${price}/queryPricePointSYY`,
        method: 'post',
        data: data
    })
}
// 价格走势原粮--库点
export function queryPricePointYL(data) {
    return request({
        url: `${price}/queryPricePointYL`,
        method: 'post',
        data: data
    })
}

// 组织机构树
export function treeOrg() {
    return request({
        url: `${User}/org/tree`,
        method: 'post',
    })
}

// 点击查询树
export function queryTree(id) {
    return request({
        url: `${price}/indicatorMonitor/?monitorId=${id}`,
        method: 'get',
    })
}

export function checkStandTree(id) {
    return request({
        url: `${price}/indicatorStandard/?indicatorId=${id}`,
        method: 'get',
    })
}
// 所有的指标树
export function allIndexTree() {
    return request({
        url: `${price}/indicatorsTree?treeCode=0`,
        method: 'get',
    })
}


export function saveIndicator(obj) {
    return request({
        url: `${price}/indicatorMonitor/`,
        method: 'post',
        data: obj
    })
}

//指标标准树报讯
export function saveIndicatorStand(obj) {
    return request({
        url: `${price}/indicatorStandard/`,
        method: 'post',
        data: obj
    })
}

// 查询所欲指标标准
export function getInstand() {
    return request({
        url: `${price}/indStandards`,
        method: 'get',
    })
}


// 指标单位树
export function getIndUnite() {
    return request({
        url: `${price}/indUnits`,
        method: 'get',
    })
}

export function accessIndica(obj) {
    return request({
        url: `${price}/indicator/`,
        method: 'put',
        data: obj
    })
}
