import Axios from 'axios'

import {
  REQUEST_CONFIG,
  INDEX_TEMPLATE_ADMQ, INDEX_TEMPLATE_QUERY, INDEX_TEMPLATE_TOTAL, PERFORM_TASK_QUERY
} from '../../utils/RequestUrls'
var staticMethods = {
  /**
   * @Description  : huoqusuoyou
   * @author       : ls
   * @date         : 2020/4/26 15:10
   * @param        :
   * @return       :
   */
  getIndexTemplateCollection: function () {
    return Axios.get(INDEX_TEMPLATE_ADMQ)
  },

  /**
   * @Description  : 添加指标模板
   * @author       : ls
   * @date         : 2020/4/27 9:45
   * @param        :
   * @return       :
   */
  postAddIndexTemplate: function (indexT) {
    return Axios.post(INDEX_TEMPLATE_ADMQ, indexT, REQUEST_CONFIG)
  },

  /**
   * @Description  : shanchu
   * @author       : ls
   * @date         : 2020/4/27 9:55
   * @param        :
   * @return       :
   */
  deleteDeleteIndexTemplate: function (keyList) {
    return Axios.delete(INDEX_TEMPLATE_ADMQ, {
      data: keyList,
      headers: {'Content-Type': 'application/json', 'Encoding': 'utf-8'}
    })
  },

  /**
   * @Description  : 修改指标模板
   * @author       : ls
   * @date         : 2020/4/27 17:05
   * @param        :
   * @return       :
   */
  putModifyIndexTemplate: function (indexT) {
    return Axios.put(INDEX_TEMPLATE_ADMQ, indexT, REQUEST_CONFIG)
  },

  /**
   * @Description  : 条件查询
   * @author       : ls
   * @date         : 2020/4/27 10:33
   * @param        :
   * @return       :
   */
  putConditionQueryIndexTemplate: function (conditionSet) {
    return Axios.put(INDEX_TEMPLATE_QUERY, conditionSet, REQUEST_CONFIG)
  },
  /**
   * @Description  : 总数
   * @author       : ls
   * @date         : 2020/6/10 15:54
   * @param        :
   * @return       :
   */
  getIndexTemplateCounts: function (conditionSet) {
    return Axios.put(INDEX_TEMPLATE_TOTAL, conditionSet, REQUEST_CONFIG)
  },
  /**
   * @Description  : 分页
   * @author       : ls
   * @date         : 2020/6/10 16:03
   * @param        :
   * @return       :
   */
  queryIndexTemplatePaging: function (beginItem, endItem, selectList) {
    return Axios.put(INDEX_TEMPLATE_QUERY + '/' + beginItem + '/' + endItem + '/', selectList, REQUEST_CONFIG)
  }
}

function IndexTemplateAPI () {
  return Object.freeze(Object.assign(
    {
      // object methods comes here
    },
    staticMethods
  ))
}
// inject static methods
Object.assign(IndexTemplateAPI, staticMethods)
export default IndexTemplateAPI
