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

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

export function getAccessory(id) {
  return request({ url: '/pms/accessory/' + parseStrEmpty(id), method: 'get' })
}

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

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

export function delAccessory(id) {
  return request({ url: '/pms/accessory/' + id, method: 'delete' })
}

export function selectFolder(query) {
  return request({ url: '/pms/accessory/tree', method: 'get', params: query })
}

export function saveMove(data) {
  return request({ url: '/pms/accessory/move', method: 'put', data: data })
}

export function saveFile(data) {
  return request({ url: '/pms/accessory/upload', method: 'post', data: data, headers: { 'Content-Type': 'multipart/form-data' } })
}

export function updateSeq(data) {
  return request({ url: '/pms/accessory/seq', method: 'put', data: data })
}

export function swapSeq(data) {
  return request({ url: '/pms/accessory/swapSeq', method: 'put', params: data })
}
