Blame view

src/api/car/carStructureApi.js 1.09 KB
f92fd6ac   wuxw   开发我的小区下的功能
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
  import request from '@/utils/request'
  import { getCommunityId } from '@/api/community/communityApi'
  
  // 查询楼栋和单元树形数据
  export function queryFloorAndUnits(params) {
    return new Promise((resolve, reject) => {
      const communityId = getCommunityId()
      request({
        url: '/floor.queryFloorAndUnits',
        method: 'get',
        params: {
          ...params,
          communityId
        }
      }).then(response => {
        const res = response.data
        resolve(res)
      }).catch(error => {
        reject(error)
      })
    })
  }
  
  // 查询车位结构列表
  export function listCarStructure(params) {
    return new Promise((resolve, reject) => {
      const communityId = getCommunityId()
      request({
        url: '/car.listCarStructure',
        method: 'get',
        params: {
          ...params,
          communityId
        }
      }).then(response => {
        const res = response.data
        resolve({
          data: res.data,
          total: res.total
        })
      }).catch(error => {
        reject(error)
      })
    })
  }
  
  // 获取当前小区ID
  export function getCurrentCommunityId() {
    return getCommunityId()
  }