Blame view

src/api/community/communityApi.js 2.29 KB
0e3df9ef   wuxw   优化物业账号下切换小区功能
1
  import { setCommunitys,setCurrentCommunity,getCurrentCommunity } from "@/utils/vc"
a42b3256   wuxw   HC小区管理系统前段vue版正在开发中
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
51
52
53
  import request from '@/utils/request'
  export function _loadCommunityInfo(_param) {
      return new Promise((resolve, reject) => {
          request({
              url: '/community.listMyEnteredCommunitys',
              method: 'get',
              params: {
                  page: 1,
                  row: 3
              }
          }).then(response => {
              const res = response.data
              let _communityInfos = res.communitys;
              if (_communityInfos && _communityInfos.length > 0) {
                  setCurrentCommunity(_communityInfos[0]);
                  setCommunitys(_communityInfos);
                  if (_param && _param.communityId) {
                      let _communityId = _param.communityId;
                      _communityInfos.forEach(_c => {
                          if (_c.communityId == _communityId) {
                              setCurrentCommunity(_c);
                          }
                      })
                  }
              }
              // 获取验证码成功
              resolve(res)
          }).catch(error => {
              reject(error)
          })
      })
  }
  
  export function getDict(tableName,tableColumns) {
      return new Promise((resolve, reject) => {
          request({
              url: '/callComponent/core/list',
              method: 'get',
              params: {
                  name: tableName,
                  type: tableColumns,
                  page:1,
                  row:500
              }
          }).then(response => {
              const res = response.data
              // 获取验证码成功
              resolve(res)
          }).catch(error => {
              reject(error)
          })
      })
0e3df9ef   wuxw   优化物业账号下切换小区功能
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
  }
  
  export function getCommunityId() {
      return getCurrentCommunity().communityId
  }
  
  
  
  export function getCommunityName() {
      return getCurrentCommunity().name
  }
  
  export function getMyEnteredCommunitys(_param) {
      return new Promise((resolve, reject) => {
          request({
              url: '/community.listMyEnteredCommunitys',
              method: 'get',
              params: {
                  ..._param
              }
          }).then(response => {
              const res = response.data
              // 获取验证码成功
              resolve(res)
          }).catch(error => {
              reject(error)
          })
      })
a42b3256   wuxw   HC小区管理系统前段vue版正在开发中
82
  }