import request from '@/utils/request'
import { parseStrEmpty } from "@/utils/goldenwater";

export function listPhase(query) {
  return request({ url: '/pms/phase/list', method: 'get', params: query })
}

export function getPhase(pazId) {
  return request({ url: '/pms/phase/' + parseStrEmpty(pazId), method: 'get' })
}

export function addPhase(data) {
  return request({ url: '/pms/phase', method: 'post', data: data })
}

export function updatePhase(data) {
  return request({ url: '/pms/phase', method: 'put', data: data })
}

export function delPhase(pazId) {
  return request({ url: '/pms/phase/' + pazId, method: 'delete' })
}

export function listPhaseTask(query) {
  return request({ url: '/pms/phase/task/list', method: 'get', params: query })
}

export function getPhaseTask(taskId) {
  return request({ url: '/pms/phase/task/' + parseStrEmpty(taskId), method: 'get' })
}

export function addPhaseTask(data) {
  return request({ url: '/pms/phase/task', method: 'post', data: data })
}

export function updatePhaseTask(data) {
  return request({ url: '/pms/phase/task', method: 'put', data: data })
}

export function delPhaseTask(taskId) {
  return request({ url: '/pms/phase/task/' + taskId, method: 'delete' })
}

export function listPhaseLog(query) {
  return request({ url: '/pms/phase/log/list', method: 'get', params: query })
}

export function addPhaseLog(data) {
  return request({ url: '/pms/phase/log', method: 'post', data: data })
}

export function delPhaseLog(logId) {
  return request({ url: '/pms/phase/log/' + logId, method: 'delete' })
}
