Newer
Older
baseResourceFront / src / api / system / area.js
yangqianqian on 23 Mar 2021 2 KB 修改UI
/**
 * 区域管理接口
 */
import request from '@/utils/request'
import qs from 'qs'
import Vue from 'vue'

// 区域查询
export function getAreaList(params) {
  return request({
    url: 'area/listPage',
    method: 'get',
    params
  })
}

// 根据部门找其默认区域
export function getAreaByDept(deptid) {
  return request({
    url: 'config/getAreaByDept',
    method: 'get',
    params: {
      deptId: deptid
    }
  })
}

// 区域查询,非分页,加载树用
export function getAreaTree(params) {
  return request({
    url: 'area/list',
    method: 'get',
    params
  })
}
// 区域类型查询
export function getAreaType() {
  return request({
    url: 'dict/code/levelType',
    method: 'get'
  })
}

// 添加区域
export function addArea(params) {
  return request({
    url: 'area/add',
    method: 'post',
    params
  })
}
// 修改区域机构
export function updateArea(params) {
  return request({
    url: 'area/update',
    method: 'post',
    params
  })
}
// 删除区域机构
export function delArea(id) {
  return request({
    url: 'area/delete',
    method: 'post',
    params: {
      id: id
    }
  })
}

// 查询道路
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
  })
}