import req from '@/request.js'

const portal = window.context.portal
export default {
  //新增
  addSave(data, cb) {
    req
      .post(portal + `/wrp/mtrdReserve/disasterPrevention/create`, data)
      .then(rep => {
        cb(rep.data)
      })
  },
  // 确认修改
  upData(data, cb) {
    req
      .post(portal + `/wrp/mtrdReserve/disasterPrevention/updateById`, data)
      .then(rep => {
        cb(rep.data)
      })
  },
  // 分页
  ListGet(data, cb) {
    req
      .post(portal + `/wrp/mtrdReserve/disasterPrevention/query`, data)
      .then(rep => {
        cb(rep.data)
      })
  },
  // 修改
  detailId(id, cb) {
    req
      .get(portal + `/wrp/mtrdReserve/disasterPrevention/get/` + id)
      .then(rep => {
        cb(rep.data)
      })
  },
  //删除
  remove(ids, cb) {
    req
      .get(
        portal + `/wrp/mtrdReserve/disasterPrevention/deleteByIds?ids=` + ids
      )
      .then(rep => {
        cb(rep.data)
      })
  },
  getbasAdName(data, cb) {
    req.post(portal + `/sys/sysAreas/v1/townTree`, data).then(rep => {
      cb(rep.data)
    })
  },
  //上传
  upload(data, cb) {
    req
      .post(portal + `/wrp/mtrdReserve/disasterPrevention/importExcel`, data)
      .then(rep => {
        cb(rep.data)
      })
  },
  // 行政区查询接口
  getbasAdName(data, cb) {
    req.post(portal + `/sys/sysAreas/v1/townTree`, data).then(rep => {
      cb(rep.data)
    })
  }
}
