import request from '@/utils/request'
//资源图片上传
export function imgUpLoad(param){
    const formData = new FormData()
    formData.append('file', param.file)
    formData.append('fileType', param.type)
    return request({
      url: '/system/sys/file/upload',
      method: 'post',
      data: formData,
      headers: {
        'Content-Type': 'multipart/form-data',
      }
    })
  }

  export function imgUpLoadTwo(param){
    const formData = new FormData()
    formData.append('file', param.file)
    formData.append('fileType', param.type)
    return request({
      url: '/file/upload',
      method: 'post',
      data: formData,
      headers: {
        'Content-Type': 'multipart/form-data',
      }
    })
  }

  export function imgUpLoadThree(param){
    const formData = new FormData()
    param.forEach(item => {
      formData.append('files', item)
    })
    // formData.append('files', param)
    return request({
      url: '/file/uploadFiles',
      method: 'post',
      data: formData,
      headers: {
        'Content-Type': 'multipart/form-data',
      }
    })
  }


//资源文件上传
export function fileUpLoad(param){
    const formData = new FormData()
    formData.append('file', param.file)
    return request({
      url: '/system/sys/file/upload',
      method: 'post',
      data: formData,
    })
  }

// excel文件上传
export function excelUpLoad(param){
  const formData = new FormData()
  formData.append('file', param.file)
  return request({
    url: '/material/base/maPartType/readExcel',
    method: 'post',
    data: formData,
  })
}

// excel文件下载
export function downloadExcel(param){
  return request({
    url: '/material/base/maPartType/downLoad',
    method: 'post',
    param
  })
}

















