import request from '@/utils/request'
import state from '@/store'
import router from '@/router'

// 项目
export function getProject() {
  return request({
    url: '',
    method: 'post',
    data: {
      UserID: state.state.user.id,
      ModularID: router.currentRoute.path,
      type: '1',
      name: 'PDM_项目名称_查询数据_是否显示_初始化',
      param: '项目流水号_check=0=int&项目流水号=0'
    }
  })
}
// 机床
export function getToolNum(check, num) {
  return request({
    url: '',
    method: 'post',
    data: {
      UserID: state.state.user.id,
      ModularID: router.currentRoute.path,
      type: '1',
      name: 'PDM_项目名称_查询数据_是否显示_初始化',
      param: '项目流水号_check=' + check + '=int&项目流水号=' + num
    }
  })
}
export function searchTable(check, num, check1, num1) {
  return request({
    url: '',
    method: 'post',
    data: {
      UserID: state.state.user.id,
      ModularID: router.currentRoute.path,
      type: '1',
      name: 'PDM_项目名称_查询数据_是否显示',
      param: '项目流水号_check=' + check + '=int&项目流水号=' + num + '&机床流水号_check=' + check1 + '=int&机床流水号=' + num1
    }
  })
}
export function upData(num, show) {
  return request({
    url: '',
    method: 'post',
    data: {
      UserID: state.state.user.id,
      ModularID: router.currentRoute.path,
      type: '2',
      name: 'PDM_项目名称_查询数据_是否显示_更改状态',
      param: '机床流水号=' + num + '&是否显示=' + show
    }
  })
}
