import { getAction, deleteAction, putAction, postAction } from '@/api/manageForWarn'
import _ from 'lodash'

// 报警历史 每天的数据
// {jh}
const getWarnHistoryList = (params) => getAction('/dataVue/common/queryWarnHistoryDay', params)

// 报警历史数据 每小时的数据
// { lineNum, date, hour, total, fzqk, gcyj, zjy }
const getWarnHistoryList_Hour = (params) => getAction('/dataVue/common/queryWarnHistoryHour', params)

const getAvaliableJh = (params) => getAction('/dataVue/common/getAJh', params)
const getAvaliableJh2 = (params) => getAction('/dataVue/common/getAJh2', params)
const getInfoByJh = (params) => getAction('/dataVue/common/getInfoByJh', params)
const getAJhByJh = (params) => getAction('/dataVue/common/getAJhByJh', params)
const getTopJhList = (params) => getAction('/dataVue/common/getDrillingWell', params)
const getTopJhList2 = (params) => getAction('/dataVue/common/getDrillingWell2', params)
const getComplexList = (params) => getAction('/dataVue/common/getCaseList', params)
const addComplexCase = (params) => postAction('/dataVue/common/addCase', params)
const editComplexCase = (params) => putAction('/dataVue/common/editCase', params)
const delComplexCase = (params) => deleteAction('dataVue/common/deleteCase', params)

const getEjdwList = (params) => getAction('dataVue/common/getEjdwList', params)
const getRbEjdwList= (params) => getAction('dataVue/common/getRbEjdwList', params)

const luceneIndex1 = (params) => getAction('/dataVue/lucene/createIndex', params)
const luceneIndex = (params) => getAction('/dataVue/lucene/createFzqkIndex', params)
const luceneSearch = (params) => getAction('/dataVue/lucene/searchHighlight', params)

// params: { jh, zjyLastJson }
const queryFocusWarn = (params) => getAction('/dataVue/common/queryFocusWarnReal', params)
// params: { jh }
const queryWellCoordinate = (params) => getAction('/dataVue/common/queryWellCoordinate', params)

// params: {jh}
const getValueMonitorLastHour = (params) => getAction('/dataVue/common/queryValueMonitorLastHour', params)
const getValueMonitorNew = (params) => getAction('/dataVue/common/queryValueMonitorNew', params)

// params: {jh}
const getWellOwnSingle = (params) => getAction('/engineer/template/getWellOwnEngineer', params)
// params: {jh, template}
const saveWellEngineerTemplate = (params) => postAction('/engineer/template/saveEngineer', params)

const restoreDefault = (params) => postAction('/engineer/template/restoreDefault')
const resetDefault = (params) => getAction('/engineer/template/revertEngineer', params)


const queryDerrickNow = (params) => getAction('/dataVue/common/queryDerrickNow', params)

const startWarnHistoryTask = (params) => getAction('/dataVue/task/startWarnHistory', params)
const recheckWarnReady = (params) => getAction('/dataVue/task/recheckHistoryReady', params)
const checkWarnReady = (params) => getAction('/dataVue/task/checkHistoryReady', params)

const queryStratum = (params) => getAction('/dataVue/common/queryStratum', params)
const queryCaseInDistance = (params) => getAction('dataVue/common/queryCaseInDistance', params)
const queryCase = (id) => getAction('dataVue/common/queryCase', { id })
const queryCaseFromChart = (params) => getAction('dataVue/common/queryCaseFromChart', params)

const queryLastRow = (params) => getAction('dataVue/common/queryLastRow', params)
const addFocusJh = (params) => postAction('focusJh/add', params)
const deleteFocusJh = (params) => deleteAction('focusJh/delete', params)

//获取工程预警数据(数据库)
// const getGcyjList = (params) => getAction('engineer/warnResult/getGcyjNewList', params)
const getGcyjList = (params) => getAction('engineer/warnResult/getGcyjNewList_new', params)
const saveDefault = (params) => postAction('engineer/template/saveDefault', params)


export default {
  getAvaliableJh,
  getAvaliableJh2,
  getAJhByJh,
  getTopJhList,
  getTopJhList2,
  getValueMonitorNew,

  getWarnHistoryList,
  getWarnHistoryList_Hour,

  getWellOwnSingle,

  getComplexList,
  addComplexCase,
  editComplexCase,
  delComplexCase,

  getEjdwList,
  getRbEjdwList,

  luceneIndex1,
  luceneIndex,
  luceneSearch,

  queryFocusWarn,
  queryWellCoordinate,

  getValueMonitorLastHour,
  saveWellEngineerTemplate,
  restoreDefault,
  resetDefault,
  queryDerrickNow,

  startWarnHistoryTask,
  recheckWarnReady,
  checkWarnReady,

  queryStratum,
  queryCaseInDistance,
  queryCase,
  queryCaseFromChart,

  queryLastRow,
  addFocusJh,
  deleteFocusJh,
  getInfoByJh,
  getGcyjList,
  saveDefault
}
