Newer
Older
baseResourceFront / src / api / fileImport.js
zhangyingjie on 10 Mar 2021 1 KB 与基础框架合并
import request from '@/utils/request'
import Vue from 'vue'
export function batchImportController(fileobj) {
  const param = new FormData()
  param.append('file', fileobj)
  const basetConfig = Vue.prototype.baseConfig // 注意该行应放在export里面,否则获取不到值
  const lampPath = basetConfig.lampBasePath
  return request({
    url: lampPath + 'busDeviceController/batchImport',
    method: 'post',
    headers: { 'Content-Type': 'multipart/form-data' },
    data: param
  })
}

export function batchImportLamppost(fileobj) {
  const param = new FormData()
  param.append('file', fileobj)
  const basetConfig = Vue.prototype.baseConfig // 注意该行应放在export里面,否则获取不到值
  const lampPath = basetConfig.lampBasePath
  return request({
    url: lampPath + 'busDeviceLamppost/batchImport',
    method: 'post',
    headers: { 'Content-Type': 'multipart/form-data' },
    data: param
  })
}

export function batchImportLamp(fileobj) {
  const param = new FormData()
  param.append('file', fileobj)
  const basetConfig = Vue.prototype.baseConfig // 注意该行应放在export里面,否则获取不到值
  const lampPath = basetConfig.lampBasePath
  return request({
    url: lampPath + 'busDeviceLamp/batchImportAll',
    method: 'post',
    headers: { 'Content-Type': 'multipart/form-data' },
    data: param
  })
}
// 灯箱导入
export function batchImportLampbox(fileobj) {
  const param = new FormData()
  param.append('file', fileobj)
  const basetConfig = Vue.prototype.baseConfig // 注意该行应放在export里面,否则获取不到值
  const lampPath = basetConfig.lampBasePath
  return request({
    url: lampPath + 'busDeviceLampbox/batchImport',
    method: 'post',
    headers: { 'Content-Type': 'multipart/form-data' },
    data: param
  })
}