Newer
Older
baseResourceFront / src / api / street.js
zhangyingjie on 10 Mar 2021 1 KB 与基础框架合并
/**
 * 道路管理接口
 */

import request from '@/utils/request'
import qs from 'qs'
import Vue from 'vue'

// 查询道路
export function getStreet(params) {
  const basetConfig = Vue.prototype.baseConfig // 注意该行应放在export里面,否则获取不到值
  const lampPath = basetConfig.lampBasePath
  return request({
    url: lampPath + 'busBaseStreet/listPage',
    method: 'get',
    params: params
  })
}

// 不分页查询所有道路
export function getAllStreet(params) {
  const basetConfig = Vue.prototype.baseConfig // 注意该行应放在export里面,否则获取不到值
  const lampPath = basetConfig.lampBasePath
  return request({
    url: lampPath + 'busBaseStreet/list',
    method: 'get',
    params: params
  })
}

// 删除道路
export function delStreets(ids) {
  const basetConfig = Vue.prototype.baseConfig // 注意该行应放在export里面,否则获取不到值
  const lampPath = basetConfig.lampBasePath
  return request({
    url: lampPath + 'busBaseStreet/batchDelete',
    method: 'post',
    params: {
      busBaseStreetIds: ids
    },
    paramsSerializer: params => {
      return qs.stringify(params, { indices: false })
    }
  })
}

// 添加道路
export function addStreet(params) {
  const basetConfig = Vue.prototype.baseConfig // 注意该行应放在export里面,否则获取不到值
  const lampPath = basetConfig.lampBasePath
  return request({
    url: lampPath + 'busBaseStreet/add',
    method: 'post',
    params
  })
}

// 编辑道路
export function updateStreet(params) {
  const basetConfig = Vue.prototype.baseConfig // 注意该行应放在export里面,否则获取不到值
  const lampPath = basetConfig.lampBasePath
  return request({
    url: lampPath + 'busBaseStreet/update',
    method: 'post',
    params
  })
}