张延森 4 anni fa
parent
commit
aebedc2935
30 ha cambiato i file con 604 aggiunte e 75 eliminazioni
  1. 1
    1
      config/defaultSettings.js
  2. 11
    1
      config/routes.js
  3. 56
    0
      src/components/CommunitySelect/index.jsx
  4. 0
    1
      src/components/XForm/WrapperForm.jsx
  5. 2
    2
      src/models/user.js
  6. 4
    0
      src/pages/dashboard/index.jsx
  7. 2
    0
      src/pages/property/building/BatchImport.jsx
  8. 2
    1
      src/pages/property/building/components/Building.jsx
  9. 1
    0
      src/pages/property/building/components/BuildingLevelCell.jsx
  10. 3
    0
      src/pages/property/building/components/BuildingLevelRow.jsx
  11. 1
    0
      src/pages/property/building/components/BuildingRoomCell.jsx
  12. 2
    0
      src/pages/property/building/components/BuildingUnit.jsx
  13. 2
    1
      src/pages/property/building/components/BuildingUnitCell.jsx
  14. 17
    8
      src/pages/property/building/list.jsx
  15. 123
    0
      src/pages/property/community/index.jsx
  16. 135
    0
      src/pages/property/contact/PublicServ.jsx
  17. 8
    9
      src/pages/property/contact/components/Editor.jsx
  18. 30
    8
      src/pages/property/contact/index.jsx
  19. 15
    3
      src/pages/property/lifeConsultant/index.jsx
  20. 14
    1
      src/pages/property/notice/Edit.jsx
  21. 18
    3
      src/pages/property/notice/index.jsx
  22. 8
    11
      src/pages/property/proprietor/Add.jsx
  23. 20
    4
      src/pages/property/proprietor/Audit.jsx
  24. 25
    1
      src/pages/property/proprietor/BatchImport.jsx
  25. 21
    7
      src/pages/property/proprietor/index.jsx
  26. 18
    3
      src/pages/property/ticket/index.jsx
  27. 5
    3
      src/pages/property/utils/hooks/useRoomSelect.js
  28. 30
    7
      src/pages/staff/list/editStaff.jsx
  29. 2
    0
      src/services/apis.js
  30. 28
    0
      src/services/community_api.js

+ 1
- 1
config/defaultSettings.js Vedi File

12
   },
12
   },
13
   title: '远道荟',
13
   title: '远道荟',
14
   pwa: false,
14
   pwa: false,
15
-  iconfontUrl: '',
15
+  iconfontUrl: ''
16
 };
16
 };

+ 11
- 1
config/routes.js Vedi File

70
             name: '物业管理',
70
             name: '物业管理',
71
             component: '../layouts/BlankLayout',
71
             component: '../layouts/BlankLayout',
72
             routes: [
72
             routes: [
73
+              {
74
+                path: 'community',
75
+                name: '社区管理',
76
+                component: './property/community'
77
+              },
73
               {
78
               {
74
                 path: 'buildingInfo',
79
                 path: 'buildingInfo',
75
                 name: '楼栋管理',
80
                 name: '楼栋管理',
142
                 component: './property/news/Edit',
147
                 component: './property/news/Edit',
143
                 hideInMenu: true,
148
                 hideInMenu: true,
144
               },
149
               },
150
+              {
151
+                path: 'public-service',
152
+                name: '公共服务',
153
+                component: './property/contact/PublicServ'
154
+              },
145
               {
155
               {
146
                 path: 'bill/management',
156
                 path: 'bill/management',
147
                 name: '收费组管理',
157
                 name: '收费组管理',
200
               },
210
               },
201
               {
211
               {
202
                 path: 'contact',
212
                 path: 'contact',
203
-                name: '联系方式',
213
+                name: '联系物业',
204
                 component: './property/contact'
214
                 component: './property/contact'
205
               },
215
               },
206
               {
216
               {

+ 56
- 0
src/components/CommunitySelect/index.jsx Vedi File

1
+import React, { useEffect, useState, useRef } from 'react'
2
+import { connect } from 'dva'
3
+import { Select } from 'antd'
4
+
5
+const CommunitySelect = props => {
6
+  const [value, setValue] = useState()
7
+  const inited = useRef(false)
8
+
9
+  const { communityList, user, dispatch, autoInited, ...selectProps } = props
10
+
11
+  const dataList = ((user || {}).isAdmin ? communityList : (user || {}).communityList) || []
12
+
13
+  const handleChange = val => {
14
+    if (props.onChange) {
15
+      props.onChange(val)
16
+    } else {
17
+      setValue(val)
18
+    }
19
+  }
20
+
21
+  useEffect(() => {
22
+    if (!user || !user.userId) {
23
+      return
24
+    }
25
+
26
+    // 初始化逻辑
27
+    if (!inited.current) {
28
+      // 如果有默认值, 则使用默认值
29
+      if (props.value) {
30
+        setValue(props.value)
31
+        inited.current = true
32
+      } else if (autoInited) {
33
+        // 如果没有默认值, 但是需要设置默认值
34
+        // 那么默认使用第一个
35
+        const first = (dataList[0] || {}).id
36
+        if (first) {
37
+          handleChange(props.mode === 'multiple' ? [first] : first)
38
+        }
39
+
40
+        inited.current = true
41
+      }
42
+    } else {
43
+      setValue(props.value)
44
+    }
45
+  }, [user, autoInited, dataList, props.value])
46
+
47
+  return (
48
+    <Select {...selectProps} value={value} onChange={handleChange}>
49
+      {
50
+        dataList.map(community => (<Select.Option key={community.id} value={community.id}>{community.name}</Select.Option>))
51
+      }
52
+    </Select>
53
+  )
54
+}
55
+
56
+export default connect(s => ({ communityList: (s.user || {}).communityList, user: (s.user || {}).currentUser }))(CommunitySelect)

+ 0
- 1
src/components/XForm/WrapperForm.jsx Vedi File

61
 
61
 
62
   render () {
62
   render () {
63
     const {fields, form, children, submitBtn, cancelBtn, ...formProps} = this.props;
63
     const {fields, form, children, submitBtn, cancelBtn, ...formProps} = this.props;
64
-    console.log('fields:', fields)
65
     const FeildItems = (fields || []).filter(x => x).map((props, inx) => (<WrapperItem key={inx} {...props} form={form} />))
64
     const FeildItems = (fields || []).filter(x => x).map((props, inx) => (<WrapperItem key={inx} {...props} form={form} />))
66
     
65
     
67
     return (
66
     return (

+ 2
- 2
src/models/user.js Vedi File

30
   },
30
   },
31
   reducers: {
31
   reducers: {
32
     saveCurrentUser(state, { payload }) {
32
     saveCurrentUser(state, { payload }) {
33
-      const { taUser = {} , menuList = [], buttonList = [] } = payload || {}
33
+      const { taUser = {} , menuList = [], buttonList = [], ...others } = payload || {}
34
       const currentUser = { ...taUser, roles: (taUser.roles || []).map(x => x.roleId) }
34
       const currentUser = { ...taUser, roles: (taUser.roles || []).map(x => x.roleId) }
35
 
35
 
36
       setAllBtnAuth(buttonList)
36
       setAllBtnAuth(buttonList)
37
       setUserBtnAuth(currentUser.buttons)
37
       setUserBtnAuth(currentUser.buttons)
38
 
38
 
39
-      return { ...state, currentUser, menuList, buttonList };
39
+      return { ...state, currentUser, menuList, buttonList, ...others };
40
     },
40
     },
41
     changeNotifyCount(
41
     changeNotifyCount(
42
       state = {
42
       state = {

+ 4
- 0
src/pages/dashboard/index.jsx Vedi File

1
 import React, { useEffect, useState } from 'react'
1
 import React, { useEffect, useState } from 'react'
2
 import { PageHeader, Row, Col, Card, Icon } from 'antd'
2
 import { PageHeader, Row, Col, Card, Icon } from 'antd'
3
+import CommunitySelect from '@/components/CommunitySelect'
3
 import ABPart from './components/ABPart'
4
 import ABPart from './components/ABPart'
4
 import BuildingStatic from './components/BuildingStatic'
5
 import BuildingStatic from './components/BuildingStatic'
5
 import ShortCut from './components/ShortCut'
6
 import ShortCut from './components/ShortCut'
24
         title="工作台"
25
         title="工作台"
25
         backIcon={false}
26
         backIcon={false}
26
         ghost={false}
27
         ghost={false}
28
+        extra={[
29
+          <CommunitySelect key="1" style={{minWidth: 200}} autoInited />
30
+        ]}
27
       >
31
       >
28
         <ABPart
32
         <ABPart
29
           align="middle"
33
           align="middle"

+ 2
- 0
src/pages/property/building/BatchImport.jsx Vedi File

32
         excelRef.current = files[0]
32
         excelRef.current = files[0]
33
         const formData = new FormData()
33
         const formData = new FormData()
34
         formData.append('file', excelRef.current)
34
         formData.append('file', excelRef.current)
35
+        formData.append("communityId", props.community)
35
         
36
         
36
         setLoading(true)
37
         setLoading(true)
37
         uploadBuildingTreeExcel({ data: formData }).then(res => {
38
         uploadBuildingTreeExcel({ data: formData }).then(res => {
58
 
59
 
59
     const formData = new FormData()
60
     const formData = new FormData()
60
     formData.append('file', excelRef.current)
61
     formData.append('file', excelRef.current)
62
+    formData.append("communityId", props.community)
61
 
63
 
62
     setLoading(true)
64
     setLoading(true)
63
     submitBuildingTreeExcel({ data: formData }).then(res => {
65
     submitBuildingTreeExcel({ data: formData }).then(res => {

+ 2
- 1
src/pages/property/building/components/Building.jsx Vedi File

19
       name: props.phase.name,
19
       name: props.phase.name,
20
       type: 'building',
20
       type: 'building',
21
       nodeNumber: v,
21
       nodeNumber: v,
22
+      communityId: props.community,
22
     }}).then((res) => {
23
     }}).then((res) => {
23
       notification.success({message: '添加成功'})
24
       notification.success({message: '添加成功'})
24
       setBuildingList(buildingList.concat(res))
25
       setBuildingList(buildingList.concat(res))
71
                 key={`${index}`}
72
                 key={`${index}`}
72
                 tab={<span>{building.name} <Icon type="close" style={{fontSize: '0.8em', color: '#888', marginLeft: 8}} onClick={() => handleDeleteBuilding(building)} /></span>}
73
                 tab={<span>{building.name} <Icon type="close" style={{fontSize: '0.8em', color: '#888', marginLeft: 8}} onClick={() => handleDeleteBuilding(building)} /></span>}
73
               >
74
               >
74
-                <BuildingUnit building={building} phase={props.phase} />
75
+                <BuildingUnit building={building} phase={props.phase} community={props.community} />
75
               </Tabs.TabPane>
76
               </Tabs.TabPane>
76
             )
77
             )
77
           })
78
           })

+ 1
- 0
src/pages/property/building/components/BuildingLevelCell.jsx Vedi File

50
       name: roomInfo.levelName,
50
       name: roomInfo.levelName,
51
       type: 'roomNo',
51
       type: 'roomNo',
52
       nodeNumber: val,
52
       nodeNumber: val,
53
+      communityId: props.community,
53
     }}).then((res) => {
54
     }}).then((res) => {
54
       if (props.onHouseAdd) {
55
       if (props.onHouseAdd) {
55
         props.onHouseAdd(res)
56
         props.onHouseAdd(res)

+ 3
- 0
src/pages/property/building/components/BuildingLevelRow.jsx Vedi File

32
         render: (t, row) => (
32
         render: (t, row) => (
33
           <BuildingLevelCell
33
           <BuildingLevelCell
34
             dataSource={row}
34
             dataSource={row}
35
+            community={props.community}
35
             onHouseAdd={props.onHouseAdd}
36
             onHouseAdd={props.onHouseAdd}
36
             onEdit={props.onLevelEdit}
37
             onEdit={props.onLevelEdit}
37
             onDelete={props.onLevelDelete}
38
             onDelete={props.onLevelDelete}
50
               id: row[`id-${index}`],
51
               id: row[`id-${index}`],
51
               name: row[`name-${index}`]
52
               name: row[`name-${index}`]
52
             }}
53
             }}
54
+            community={props.community}
53
             onEdit={props.onHouseEdit}
55
             onEdit={props.onHouseEdit}
54
             onDelete={props.onHouseDelete}
56
             onDelete={props.onHouseDelete}
55
           />
57
           />
94
     <div>
96
     <div>
95
       <BuildingUnitCell
97
       <BuildingUnitCell
96
         dataSource={anyRoom}
98
         dataSource={anyRoom}
99
+        community={props.community}
97
         onLevelAdd={props.onLevelAdd}
100
         onLevelAdd={props.onLevelAdd}
98
         onEdit={props.onUnitEdit}
101
         onEdit={props.onUnitEdit}
99
         onDelete={props.onUnitDelete}
102
         onDelete={props.onUnitDelete}

+ 1
- 0
src/pages/property/building/components/BuildingRoomCell.jsx Vedi File

32
         name: roomInfo.levelName,
32
         name: roomInfo.levelName,
33
         type: 'roomNo',
33
         type: 'roomNo',
34
         nodeNumber: val,
34
         nodeNumber: val,
35
+        communityId: props.community,
35
       }}).then((res) => {
36
       }}).then((res) => {
36
         if (props.onEdit) {
37
         if (props.onEdit) {
37
           props.onEdit(res)
38
           props.onEdit(res)

+ 2
- 0
src/pages/property/building/components/BuildingUnit.jsx Vedi File

48
       name: props.building.name,
48
       name: props.building.name,
49
       type: 'unit',
49
       type: 'unit',
50
       nodeNumber: v,
50
       nodeNumber: v,
51
+      communityId: props.community,
51
     }}).then((res) => {
52
     }}).then((res) => {
52
       // 构造房间数据
53
       // 构造房间数据
53
       const roomInfo = {
54
       const roomInfo = {
214
               <div style={{flex: 'none', marginLeft: 48}} key={key}>
215
               <div style={{flex: 'none', marginLeft: 48}} key={key}>
215
                 <BuildingLevelRow
216
                 <BuildingLevelRow
216
                   dataSource={roomGroup[key]}
217
                   dataSource={roomGroup[key]}
218
+                  community={props.community}
217
                   onUnitDelete={handleDeleteUnit}
219
                   onUnitDelete={handleDeleteUnit}
218
                   onHouseAdd={handleHouseAdd}
220
                   onHouseAdd={handleHouseAdd}
219
                   onHouseEdit={handleHouseEdit}
221
                   onHouseEdit={handleHouseEdit}

+ 2
- 1
src/pages/property/building/components/BuildingUnitCell.jsx Vedi File

50
       name: roomInfo.unitName,
50
       name: roomInfo.unitName,
51
       type: 'level',
51
       type: 'level',
52
       nodeNumber: val,
52
       nodeNumber: val,
53
+      communityId: props.community,
53
     }}).then((res) => {
54
     }}).then((res) => {
54
       // 构造房间数据
55
       // 构造房间数据
55
       const room = {
56
       const room = {
97
   return (
98
   return (
98
     <div style={{textAlign: 'center', fontSize: '1.2em', lineHeight: '3.5em'}} >
99
     <div style={{textAlign: 'center', fontSize: '1.2em', lineHeight: '3.5em'}} >
99
       <Dropdown overlay={menu} trigger={['contextMenu']} placement="topCenter">
100
       <Dropdown overlay={menu} trigger={['contextMenu']} placement="topCenter">
100
-        <div style={{cursor: 'pointer'}}>{roomInfo.unitName}</div>
101
+        <div style={{cursor: 'pointer', height: 60}}>{roomInfo.unitName}</div>
101
       </Dropdown>
102
       </Dropdown>
102
       <Prompt visible={unitVisible} onOk={handleEdit} onCancel={() => setUnitVisible(false)} placeholder="请填写单元名称" />
103
       <Prompt visible={unitVisible} onOk={handleEdit} onCancel={() => setUnitVisible(false)} placeholder="请填写单元名称" />
103
       <Prompt visible={levelVisible} onOk={handleLevelAdd} onCancel={() => setLevelVisible(false)} placeholder="请填写楼层名称" />
104
       <Prompt visible={levelVisible} onOk={handleLevelAdd} onCancel={() => setLevelVisible(false)} placeholder="请填写楼层名称" />

+ 17
- 8
src/pages/property/building/list.jsx Vedi File

4
 import { fetch, fetchList, apis } from '@/utils/request'
4
 import { fetch, fetchList, apis } from '@/utils/request'
5
 import Prompt from '@/components/Prompt'
5
 import Prompt from '@/components/Prompt'
6
 import Building from './components/Building'
6
 import Building from './components/Building'
7
+import CommunitySelect from '@/components/CommunitySelect'
7
 
8
 
8
 const fetchPhaseList = fetch(apis.buildingOwnerInfo.getPhaseList)
9
 const fetchPhaseList = fetch(apis.buildingOwnerInfo.getPhaseList)
9
 const addNode = fetch(apis.buildingOwnerInfo.addNode)
10
 const addNode = fetch(apis.buildingOwnerInfo.addNode)
13
   const [phaseList, setPhaseList] = useState([])
14
   const [phaseList, setPhaseList] = useState([])
14
   const [loading, setLoading] = useState(false)
15
   const [loading, setLoading] = useState(false)
15
   const [phaseVisible, setPhaseVisible] = useState(false)
16
   const [phaseVisible, setPhaseVisible] = useState(false)
17
+  const [community, setCommunity] = useState()
16
 
18
 
17
   const handleEdit = (key, act) => {
19
   const handleEdit = (key, act) => {
18
     const phase = phaseList[key - 0]
20
     const phase = phaseList[key - 0]
38
   }
40
   }
39
 
41
 
40
   const handleBatchImport = () => {
42
   const handleBatchImport = () => {
41
-    router.push('/property/buildingInfo/importExcel')
43
+    router.push(`/property/buildingInfo/importExcel?community=${community}`)
42
   }
44
   }
43
 
45
 
44
   const handleAddPhase = v => {
46
   const handleAddPhase = v => {
45
     addNode({ data: {
47
     addNode({ data: {
46
       type: 'phase',
48
       type: 'phase',
47
       nodeNumber: v,
49
       nodeNumber: v,
50
+      communityId: community,
48
     }}).then((res) => {
51
     }}).then((res) => {
49
       notification.success({message: '添加成功'})
52
       notification.success({message: '添加成功'})
50
       setPhaseList(phaseList.concat(res))
53
       setPhaseList(phaseList.concat(res))
54
 
57
 
55
   // 获取期
58
   // 获取期
56
   useEffect(() => {
59
   useEffect(() => {
57
-    setLoading(true)
58
-    fetchPhaseList().then(res => {
59
-      setPhaseList(res)
60
-      setLoading(false)
61
-    }).catch(() => setLoading(false))
62
-  }, [])
60
+    if (community) {
61
+      setLoading(true)
62
+      fetchPhaseList({params: {communityId: community}}).then(res => {
63
+        setPhaseList(res)
64
+        setLoading(false)
65
+      }).catch(() => setLoading(false))
66
+    }
67
+  }, [community])
63
 
68
 
64
   return (
69
   return (
65
     <div>
70
     <div>
68
         backIcon={false}
73
         backIcon={false}
69
         extra={<Button type="link" onClick={handleBatchImport}><Icon type="upload"/>批量导入</Button>}
74
         extra={<Button type="link" onClick={handleBatchImport}><Icon type="upload"/>批量导入</Button>}
70
       />
75
       />
76
+      <div style={{marginTop: 16}}>
77
+        <span style={{display: 'inline-block', marginRight: '1em'}}>选择小区: </span>
78
+        <CommunitySelect style={{minWidth: 200}} value={community} autoInited onChange={v => setCommunity(v)} />
79
+      </div>
71
       <div style={{marginTop: 16}}>
80
       <div style={{marginTop: 16}}>
72
         <Spin spinning={loading}>
81
         <Spin spinning={loading}>
73
           <Tabs
82
           <Tabs
81
             phaseList.map((phase, index) => {
90
             phaseList.map((phase, index) => {
82
               return (
91
               return (
83
                 <Tabs.TabPane tab={phase.name} key={`${index}`}>
92
                 <Tabs.TabPane tab={phase.name} key={`${index}`}>
84
-                  <Building phase={phase} />
93
+                  <Building phase={phase} community={community} />
85
                 </Tabs.TabPane>
94
                 </Tabs.TabPane>
86
               )
95
               )
87
             })
96
             })

+ 123
- 0
src/pages/property/community/index.jsx Vedi File

1
+import React, { useEffect, useRef, useState } from 'react'
2
+import { fetchList, fetch, apis } from '@/utils/request'
3
+import moment from 'moment'
4
+import { Icon, Table, Button, Popconfirm, Divider, notification } from 'antd'
5
+import Prompt from '@/components/Prompt'
6
+
7
+const getList = fetchList(apis.community.list)
8
+const updateCommunity = fetch(apis.community.update)
9
+const saveCommunity = fetch(apis.community.save)
10
+const deleteCommunity = fetch(apis.community.delete)
11
+
12
+export default props => {
13
+  const [loading, setLoading] = useState(false)
14
+  const [showPrompt, setShowPrompt] = useState(false)
15
+  const [listData, setListData] = useState([])
16
+  const [queryParams, setQueryParams] = useState({ pageNum: 1, pageSize: 100 })
17
+  const selectedRow = useRef()
18
+
19
+  const handleRowPrepare = row => {
20
+    selectedRow.current = row
21
+    setShowPrompt(true)
22
+  }
23
+
24
+  const handleStatusTrigger = row => {
25
+    // 发布 -> 取消发布
26
+    // 取消发布 -> 发布
27
+    const status = Math.abs(row.status - 1)
28
+    const data = { ...row, status }
29
+    updateCommunity({data, urlData: {id: row.id}}).then(res => {
30
+      notification.success({message: "操作成功"})
31
+      // 触发数据刷新
32
+      setQueryParams({...queryParams})
33
+    })
34
+  }
35
+
36
+  const handleRowEdit = v => {
37
+    if (!selectedRow.current) {
38
+      // 新增
39
+      const data = {name: v}
40
+      saveCommunity({data}).then(res => {
41
+        // 刷新页面
42
+        setQueryParams({...queryParams})
43
+      })
44
+    } else {
45
+      // 修改
46
+      const data = {
47
+        ...selectedRow.current,
48
+        name: v
49
+      }
50
+      updateCommunity({data, urlData: {id: data.id}}).then(res => {
51
+        // 刷新页面
52
+        setQueryParams({...queryParams})
53
+      })
54
+    }
55
+
56
+    setShowPrompt(false)
57
+  }
58
+
59
+  const handleDeleteRow = row => {
60
+    deleteCommunity({ urlData: {id: row.id} }).then(res => {
61
+      Modal.success({
62
+        content: '删除内容成功',
63
+        onOk: () => {
64
+          // 触发数据刷新
65
+          setQueryParams({...queryParams})
66
+        }
67
+      })
68
+    })
69
+  }
70
+
71
+  useEffect(() => {
72
+    setLoading(true)
73
+    getList(queryParams).then(res => {
74
+      const [list] = res
75
+      setListData(list)
76
+      setLoading(false)
77
+    }).catch(e => console.error(e) || setLoading(false))
78
+  }, [queryParams])
79
+
80
+  return (
81
+    <div>
82
+      <div style={{marginBottom: 16}}>
83
+        <Button type="primary" onClick={() => handleRowPrepare()}><Icon type="plug" />新增社区</Button>
84
+      </div>
85
+      <Table loading={loading} dataSource={listData} rowKey="id">
86
+        <Table.Column title="名称" dataIndex="name" key="name" width={480} />
87
+        <Table.Column title="状态" dataIndex="status" key="status" render={t => t === 1 ? '正常' : '未发布'} />
88
+        <Table.Column title="创建时间" dataIndex="createDate" key="createDate" render={t => moment(t).format('YYYY-MM-DD HH:mm')} />
89
+        <Table.Column
90
+          title="操作"
91
+          key="action"
92
+          align="center"
93
+          render={(_, row) => {
94
+            return (
95
+              <>
96
+                <Popconfirm
97
+                  title="确认进行删除操作?"
98
+                  onConfirm={() => handleDeleteRow(row)}
99
+                  okText="删除"
100
+                  cancelText="取消"
101
+                >
102
+                  <Button type="link">删除</Button>
103
+                </Popconfirm>
104
+                <Divider type="vertical" />
105
+                {/* <Popconfirm
106
+                  title={`确认进行${row.status === 1? '取消发布' : '发布'}操作`}
107
+                  onConfirm={() => handleStatusTrigger(row)}
108
+                  okText={row.status === 1? '取消发布' : '发布'}
109
+                  cancelText="取消"
110
+                >
111
+                  <Button type="link">{row.status === 1? '取消发布' : '发布'}</Button>
112
+                </Popconfirm>
113
+                <Divider type="vertical" /> */}
114
+                <Button type="link" onClick={() => handleRowPrepare(row) }>编辑</Button>
115
+              </>
116
+            )
117
+          }}
118
+        />
119
+      </Table>
120
+      <Prompt visible={showPrompt} onOk={handleRowEdit} placeholder="请输入小区名称" />
121
+    </div>
122
+  )
123
+}

+ 135
- 0
src/pages/property/contact/PublicServ.jsx Vedi File

1
+import React, { useState, useEffect } from 'react'
2
+import { Select, Spin, Table, Button, Form, Input, Divider, Typography, Popconfirm, notification } from 'antd'
3
+import NavLink from 'umi/navlink'
4
+import { fetchList, apis, fetch } from '@/utils/request'
5
+import Search from '../components/Search'
6
+import List from '../components/List'
7
+import Editor from './components/Editor'
8
+
9
+const listTel = fetch(apis.announcement.getTelList)
10
+const deleteTel = fetch(apis.announcement.deleteTel)
11
+const saveTel = fetch(apis.announcement.saveTel)
12
+const updateTel = fetch(apis.announcement.updateTel)
13
+
14
+const Condition = props => {
15
+  return (
16
+    <Search
17
+      onSearch={props.onSearch}
18
+      onReset={props.onReset}
19
+      render={form => {
20
+        const { getFieldDecorator, setFieldsValue } = form
21
+        
22
+        return (
23
+          <>
24
+            <Form.Item label="名称">
25
+            {
26
+              getFieldDecorator('name')(<Input placeholder="名称" />)
27
+            }
28
+            </Form.Item>
29
+            <Form.Item label="电话">
30
+            {
31
+              getFieldDecorator('tel')(<Input placeholder="电话" />)
32
+            }
33
+            </Form.Item>
34
+          </>
35
+        )
36
+      }}
37
+    />
38
+  )
39
+}
40
+
41
+export default props => {
42
+  const telType = "common"
43
+  const [loading, setLoading] = useState(false)
44
+  const [listData, setListData] = useState([])
45
+  const [pagination, setPagination] = useState({})
46
+  const [queryParams, setQueryParams] = useState({ pageNum: 1, pageSize: 10, type: telType })
47
+  const [showEditor, setShowEditor] = useState(false)
48
+  const [currentRow, setCurrentRow] = useState()
49
+
50
+  const handleSearch = vals => {
51
+    setQueryParams({
52
+      ...queryParams,
53
+      ...vals,
54
+      pageNum: 1,
55
+    })
56
+  }
57
+
58
+  const handlePageChange = (pageNum, pageSize) => {
59
+    setQueryParams({
60
+      ...queryParams,      
61
+      pageNum,
62
+      pageSize,
63
+    })
64
+  }
65
+
66
+  const triggerShowEditor = row => {
67
+    setShowEditor(!showEditor)
68
+    setCurrentRow({...(row || {})})
69
+  }
70
+
71
+  const handleEditor = vals => {
72
+    if (vals.id) {
73
+      updateTel({data: vals}).then(res => {
74
+        notification.success({message: '信息更新成功'})
75
+        triggerShowEditor()
76
+        setQueryParams({...queryParams})
77
+      })
78
+    } else {
79
+      saveTel({data: vals}).then(res => {
80
+        notification.success({message: '信息保存成功'})
81
+        triggerShowEditor()
82
+        setQueryParams({...queryParams})
83
+      })
84
+    }
85
+  }
86
+
87
+  const handleDeleteRow = row => {
88
+    deleteTel({data: [row.id]}).then(res => {
89
+      notification.success({ message: '删除成功' })
90
+      setQueryParams({...queryParams})
91
+    })
92
+  }
93
+
94
+  useEffect(() => {
95
+    setLoading(true)
96
+    listTel({params: queryParams}).then(res => {
97
+      const {list, ...pagi} = res
98
+      setListData(list)
99
+      setPagination(pagi)
100
+      setLoading(false)
101
+    }).catch(e => setLoading(false))
102
+  }, [queryParams])
103
+
104
+  return (
105
+    <div>
106
+      <Condition onSearch={handleSearch} onReset={handleSearch} />
107
+      <div style={{ margin: '24px 0' }}>
108
+        <Button type="primary" onClick={() => triggerShowEditor()}>添加</Button>
109
+      </div>
110
+      <List dataSource={listData} loading={loading} pagination={pagination} onPageChange={handlePageChange} rowKey="id">
111
+        <Table.Column title="名称" dataIndex="name" key="name" />
112
+        <Table.Column title="电话" dataIndex="tel" key="tel" />
113
+        {/* <Table.Column title="物业类型" dataIndex="type" key="type" render={(item, row) => (
114
+          <span>{item == "prop" ? "物业电话" : "公共服务电话"}</span>
115
+        )}/> */}
116
+        <Table.Column title="备注" dataIndex="remark" key="remark" />
117
+        <Table.Column title="操作" dataIndex="id" key="id" width="200px" render={(_, row) => (
118
+          <>
119
+            <Popconfirm
120
+              title="确认进行删除操作?"
121
+              onConfirm={() => handleDeleteRow(row)}
122
+              okText="删除"
123
+              cancelText="取消"
124
+            >
125
+              <Button type="link">删除</Button>
126
+            </Popconfirm>
127
+            <Divider type="vertical" />
128
+            <Button type="link" onClick={() => triggerShowEditor(row)}>编辑</Button>
129
+          </>
130
+        )} />
131
+      </List>
132
+      <Editor visible={showEditor} type={telType} dataSource={currentRow} onSubmit={handleEditor} onCancel={triggerShowEditor} />
133
+    </div>
134
+  )
135
+}

+ 8
- 9
src/pages/property/contact/components/Editor.jsx Vedi File

33
       if (!err) {
33
       if (!err) {
34
         props.onSubmit({
34
         props.onSubmit({
35
           ...(props.dataSource || {}),
35
           ...(props.dataSource || {}),
36
-          ...values
36
+          ...values,
37
+          type: props.type,
37
         })
38
         })
38
       }
39
       }
39
     })
40
     })
67
             props.form.getFieldDecorator('remark')(<Input placeholder="请填写备注" />)
68
             props.form.getFieldDecorator('remark')(<Input placeholder="请填写备注" />)
68
           }
69
           }
69
         </Form.Item>
70
         </Form.Item>
70
-        <Form.Item label="物业类型">
71
-          {props.form.getFieldDecorator('type')(
72
-            <Select defaultValue="prop" placeholder="物业类型">
73
-              <Option value="prop">物业电话</Option>
74
-              <Option value="common">公共服务</Option>
75
-            </Select>,
76
-          )}
77
-        </Form.Item>
71
+        {/* <Form.Item label="类型">
72
+          <Select value={props.type} disabled placeholder="物业类型">
73
+            <Option value="prop">物业电话</Option>
74
+            <Option value="common">公共服务</Option>
75
+          </Select>,
76
+        </Form.Item> */}
78
         <Form.Item {...tailFormItemLayout}>
77
         <Form.Item {...tailFormItemLayout}>
79
           <Button type="primary" htmlType="submit">确定</Button>
78
           <Button type="primary" htmlType="submit">确定</Button>
80
           <Button onClick={props.onCancel} style={{ marginLeft: '48px' }}>取消</Button>
79
           <Button onClick={props.onCancel} style={{ marginLeft: '48px' }}>取消</Button>

+ 30
- 8
src/pages/property/contact/index.jsx Vedi File

2
 import { Select, Spin, Table, Button, Form, Input, Divider, Typography, Popconfirm, notification } from 'antd'
2
 import { Select, Spin, Table, Button, Form, Input, Divider, Typography, Popconfirm, notification } from 'antd'
3
 import NavLink from 'umi/navlink'
3
 import NavLink from 'umi/navlink'
4
 import { fetchList, apis, fetch } from '@/utils/request'
4
 import { fetchList, apis, fetch } from '@/utils/request'
5
+import CommunitySelect from '@/components/CommunitySelect'
5
 import Search from '../components/Search'
6
 import Search from '../components/Search'
6
 import List from '../components/List'
7
 import List from '../components/List'
7
 import Editor from './components/Editor'
8
 import Editor from './components/Editor'
12
 const updateTel = fetch(apis.announcement.updateTel)
13
 const updateTel = fetch(apis.announcement.updateTel)
13
 
14
 
14
 const Condition = props => {
15
 const Condition = props => {
16
+  const [communityId, setCommunityId] = useState()
17
+
18
+  const handleCommunityChange = v => {
19
+    setCommunityId(v)
20
+
21
+    props.onCommunityChange(v)
22
+  }
23
+
15
   return (
24
   return (
16
     <Search
25
     <Search
17
       onSearch={props.onSearch}
26
       onSearch={props.onSearch}
21
         
30
         
22
         return (
31
         return (
23
           <>
32
           <>
33
+            <Form.Item label="小区">
34
+              <CommunitySelect value={communityId} onChange={handleCommunityChange} autoInited />
35
+            </Form.Item>
24
             <Form.Item label="名称">
36
             <Form.Item label="名称">
25
             {
37
             {
26
               getFieldDecorator('name')(<Input placeholder="名称" />)
38
               getFieldDecorator('name')(<Input placeholder="名称" />)
39
 }
51
 }
40
 
52
 
41
 export default props => {
53
 export default props => {
54
+  const telType = "prop"
42
   const [loading, setLoading] = useState(false)
55
   const [loading, setLoading] = useState(false)
43
   const [listData, setListData] = useState([])
56
   const [listData, setListData] = useState([])
44
   const [pagination, setPagination] = useState({})
57
   const [pagination, setPagination] = useState({})
45
-  const [queryParams, setQueryParams] = useState({ pageNum: 1, pageSize: 10 })
58
+  const [queryParams, setQueryParams] = useState({ pageNum: 1, pageSize: 10, type: telType })
46
   const [showEditor, setShowEditor] = useState(false)
59
   const [showEditor, setShowEditor] = useState(false)
47
   const [currentRow, setCurrentRow] = useState()
60
   const [currentRow, setCurrentRow] = useState()
61
+  const [communityId, setCommunityId] = useState()
48
 
62
 
49
   const handleSearch = vals => {
63
   const handleSearch = vals => {
50
     setQueryParams({
64
     setQueryParams({
68
   }
82
   }
69
 
83
 
70
   const handleEditor = vals => {
84
   const handleEditor = vals => {
85
+    if (!communityId) {
86
+      notification.warn({message: '请选择小区'})
87
+      return
88
+    }
89
+
71
     if (vals.id) {
90
     if (vals.id) {
72
       updateTel({data: vals}).then(res => {
91
       updateTel({data: vals}).then(res => {
73
         notification.success({message: '信息更新成功'})
92
         notification.success({message: '信息更新成功'})
75
         setQueryParams({...queryParams})
94
         setQueryParams({...queryParams})
76
       })
95
       })
77
     } else {
96
     } else {
78
-      saveTel({data: vals}).then(res => {
97
+      saveTel({data: {...vals, communityId}}).then(res => {
79
         notification.success({message: '信息保存成功'})
98
         notification.success({message: '信息保存成功'})
80
         triggerShowEditor()
99
         triggerShowEditor()
81
         setQueryParams({...queryParams})
100
         setQueryParams({...queryParams})
91
   }
110
   }
92
 
111
 
93
   useEffect(() => {
112
   useEffect(() => {
113
+    if (!communityId) {
114
+      return
115
+    }
94
     setLoading(true)
116
     setLoading(true)
95
-    listTel({params: queryParams}).then(res => {
117
+    listTel({params: {...queryParams, communityId}}).then(res => {
96
       const {list, ...pagi} = res
118
       const {list, ...pagi} = res
97
       setListData(list)
119
       setListData(list)
98
       setPagination(pagi)
120
       setPagination(pagi)
99
       setLoading(false)
121
       setLoading(false)
100
     }).catch(e => setLoading(false))
122
     }).catch(e => setLoading(false))
101
-  }, [queryParams])
123
+  }, [queryParams, communityId])
102
 
124
 
103
   return (
125
   return (
104
     <div>
126
     <div>
105
-      <Condition onSearch={handleSearch} onReset={handleSearch} />
127
+      <Condition onSearch={handleSearch} onReset={handleSearch} onCommunityChange={v => setCommunityId(v)} />
106
       <div style={{ margin: '24px 0' }}>
128
       <div style={{ margin: '24px 0' }}>
107
         <Button type="primary" onClick={() => triggerShowEditor()}>添加</Button>
129
         <Button type="primary" onClick={() => triggerShowEditor()}>添加</Button>
108
       </div>
130
       </div>
109
       <List dataSource={listData} loading={loading} pagination={pagination} onPageChange={handlePageChange} rowKey="id">
131
       <List dataSource={listData} loading={loading} pagination={pagination} onPageChange={handlePageChange} rowKey="id">
110
         <Table.Column title="名称" dataIndex="name" key="name" />
132
         <Table.Column title="名称" dataIndex="name" key="name" />
111
         <Table.Column title="电话" dataIndex="tel" key="tel" />
133
         <Table.Column title="电话" dataIndex="tel" key="tel" />
112
-        <Table.Column title="物业类型" dataIndex="type" key="type" render={(item, row) => (
134
+        {/* <Table.Column title="物业类型" dataIndex="type" key="type" render={(item, row) => (
113
           <span>{item == "prop" ? "物业电话" : "公共服务电话"}</span>
135
           <span>{item == "prop" ? "物业电话" : "公共服务电话"}</span>
114
-        )}/>
136
+        )}/> */}
115
         <Table.Column title="备注" dataIndex="remark" key="remark" />
137
         <Table.Column title="备注" dataIndex="remark" key="remark" />
116
         <Table.Column title="操作" dataIndex="id" key="id" width="200px" render={(_, row) => (
138
         <Table.Column title="操作" dataIndex="id" key="id" width="200px" render={(_, row) => (
117
           <>
139
           <>
128
           </>
150
           </>
129
         )} />
151
         )} />
130
       </List>
152
       </List>
131
-      <Editor visible={showEditor} dataSource={currentRow} onSubmit={handleEditor} onCancel={triggerShowEditor} />
153
+      <Editor visible={showEditor} type={telType} dataSource={currentRow} onSubmit={handleEditor} onCancel={triggerShowEditor} />
132
     </div>
154
     </div>
133
   )
155
   )
134
 }
156
 }

+ 15
- 3
src/pages/property/lifeConsultant/index.jsx Vedi File

2
 import { Select, Spin, Table, Button, Form, Input, Divider, Modal, Rate, Popconfirm } from 'antd'
2
 import { Select, Spin, Table, Button, Form, Input, Divider, Modal, Rate, Popconfirm } from 'antd'
3
 import NavLink from 'umi/navlink'
3
 import NavLink from 'umi/navlink'
4
 import { fetchList, apis, fetch } from '@/utils/request'
4
 import { fetchList, apis, fetch } from '@/utils/request'
5
+import CommunitySelect from '@/components/CommunitySelect'
5
 import Search from '../components/Search'
6
 import Search from '../components/Search'
6
 import List from '../components/List'
7
 import List from '../components/List'
7
 
8
 
8
 const lifeConsultant = fetchList(apis.propUser.lifeConsultant)
9
 const lifeConsultant = fetchList(apis.propUser.lifeConsultant)
9
 
10
 
10
 const Condition = props => {
11
 const Condition = props => {
12
+  const [communityId, setCommunityId] = useState()
13
+
14
+  const handleCommunityChange = v => {
15
+    setCommunityId(v)
16
+
17
+    props.onCommunityChange(v)
18
+  }
11
   return (
19
   return (
12
     <Search
20
     <Search
13
       onSearch={props.onSearch}
21
       onSearch={props.onSearch}
17
         
25
         
18
         return (
26
         return (
19
           <>
27
           <>
28
+            <Form.Item label="小区">
29
+              <CommunitySelect value={communityId} onChange={handleCommunityChange} autoInited />
30
+            </Form.Item>
20
             <Form.Item label="管家名称">
31
             <Form.Item label="管家名称">
21
             {
32
             {
22
               getFieldDecorator('userName')(<Input placeholder="管家名称" />)
33
               getFieldDecorator('userName')(<Input placeholder="管家名称" />)
39
   const [listData, setListData] = useState([])
50
   const [listData, setListData] = useState([])
40
   const [pagination, setPagination] = useState({})
51
   const [pagination, setPagination] = useState({})
41
   const [queryParams, setQueryParams] = useState({ pageNum: 1, pageSize: 10 })
52
   const [queryParams, setQueryParams] = useState({ pageNum: 1, pageSize: 10 })
53
+  const [communityId, setCommunityId] = useState()
42
 
54
 
43
   const handleSearch = vals => {
55
   const handleSearch = vals => {
44
     setQueryParams({
56
     setQueryParams({
58
 
70
 
59
   useEffect(() => {
71
   useEffect(() => {
60
     setLoading(true)
72
     setLoading(true)
61
-    lifeConsultant(queryParams).then(res => {
73
+    lifeConsultant({...queryParams, communityId}).then(res => {
62
       const [list, pageInfo] = res || {}
74
       const [list, pageInfo] = res || {}
63
       setListData(list)
75
       setListData(list)
64
       setPagination(pageInfo)
76
       setPagination(pageInfo)
65
       setLoading(false)
77
       setLoading(false)
66
     }).catch(() => setLoading(false))
78
     }).catch(() => setLoading(false))
67
-  }, [queryParams])
79
+  }, [queryParams, communityId])
68
 
80
 
69
   return (
81
   return (
70
     <div>
82
     <div>
71
-      <Condition onSearch={handleSearch} onReset={handleSearch} />
83
+      <Condition onSearch={handleSearch} onReset={handleSearch} onCommunityChange={v => setCommunityId(v)} />
72
       <div style={{ margin: '24px 0' }}>
84
       <div style={{ margin: '24px 0' }}>
73
         {/* <NavLink to={`/staff/editStaff`}>
85
         {/* <NavLink to={`/staff/editStaff`}>
74
           <Button type="primary">添加管家</Button>
86
           <Button type="primary">添加管家</Button>

+ 14
- 1
src/pages/property/notice/Edit.jsx Vedi File

1
 import React, { useEffect, useState } from 'react'
1
 import React, { useEffect, useState } from 'react'
2
 import router from 'umi/router'
2
 import router from 'umi/router'
3
 import { fetch, apis } from '@/utils/request'
3
 import { fetch, apis } from '@/utils/request'
4
-import { Button, Form, Input, InputNumber, Modal, Radio, Select } from 'antd'
4
+import { Button, Form, Input, InputNumber, Modal, notification, Radio, Select } from 'antd'
5
 import Wangedit from '@/components/Wangedit/Wangedit'
5
 import Wangedit from '@/components/Wangedit/Wangedit'
6
 import ImageUpload from '@/components/uploadImage/ImageUpload'
6
 import ImageUpload from '@/components/uploadImage/ImageUpload'
7
+import CommunitySelect from '@/components/CommunitySelect'
7
 
8
 
8
 const formItemLayout = {
9
 const formItemLayout = {
9
   labelCol: {
10
   labelCol: {
86
   return (
87
   return (
87
     <div>
88
     <div>
88
       <Form {...formItemLayout} onSubmit={handleSubmit}>
89
       <Form {...formItemLayout} onSubmit={handleSubmit}>
90
+        <Form.Item label="小区">
91
+        {
92
+          getFieldDecorator('communityId', {
93
+            rules: [
94
+              {
95
+                required: true,
96
+                message: '请选择小区',
97
+              },
98
+            ],
99
+          })(<CommunitySelect />)
100
+        }
101
+        </Form.Item>
89
         <Form.Item label="类型">
102
         <Form.Item label="类型">
90
         {
103
         {
91
           getFieldDecorator('annType')(
104
           getFieldDecorator('annType')(

+ 18
- 3
src/pages/property/notice/index.jsx Vedi File

2
 import { Select, Spin, Table, Button, Form, Input, Divider, Modal,Popconfirm, notification } from 'antd'
2
 import { Select, Spin, Table, Button, Form, Input, Divider, Modal,Popconfirm, notification } from 'antd'
3
 import NavLink from 'umi/navlink'
3
 import NavLink from 'umi/navlink'
4
 import { fetch, apis } from '@/utils/request'
4
 import { fetch, apis } from '@/utils/request'
5
+import CommunitySelect from '@/components/CommunitySelect'
5
 import Search from '../components/Search'
6
 import Search from '../components/Search'
6
 import List from '../components/List'
7
 import List from '../components/List'
7
 
8
 
10
 const updateannouncement = fetch(apis.announcement.updateannouncement)
11
 const updateannouncement = fetch(apis.announcement.updateannouncement)
11
 
12
 
12
 const Condition = props => {
13
 const Condition = props => {
14
+  const [communityId, setCommunityId] = useState()
15
+  
16
+  const handleCommunityChange = v => {
17
+    setCommunityId(v)
18
+
19
+    props.onCommunityChange(v)
20
+  }
21
+
13
   return (
22
   return (
14
     <Search
23
     <Search
15
       onSearch={props.onSearch}
24
       onSearch={props.onSearch}
19
         
28
         
20
         return (
29
         return (
21
           <>
30
           <>
31
+            <Form.Item label="小区">
32
+            {
33
+              <CommunitySelect value={communityId} onChange={handleCommunityChange} autoInited />
34
+            }
35
+            </Form.Item>
22
             <Form.Item label="公告编号">
36
             <Form.Item label="公告编号">
23
             {
37
             {
24
               getFieldDecorator('announcementNumber')(<Input placeholder="公告编号" />)
38
               getFieldDecorator('announcementNumber')(<Input placeholder="公告编号" />)
55
 export default props => {
69
 export default props => {
56
   const [loading, setLoading] = useState(false)
70
   const [loading, setLoading] = useState(false)
57
   const [listData, setListData] = useState([])
71
   const [listData, setListData] = useState([])
72
+  const [communityId, setCommunityId] = useState()
58
   const [pagination, setPagination] = useState({})
73
   const [pagination, setPagination] = useState({})
59
   const [queryParams, setQueryParams] = useState({ pageNum: 1, pageSize: 10 })
74
   const [queryParams, setQueryParams] = useState({ pageNum: 1, pageSize: 10 })
60
 
75
 
95
 
110
 
96
   useEffect(() => {
111
   useEffect(() => {
97
     setLoading(true)
112
     setLoading(true)
98
-    listAnnouncement({ data: queryParams }).then(res => {
113
+    listAnnouncement({ data: {...queryParams, communityId} }).then(res => {
99
       const { list, ...pageInfo } = res || {}
114
       const { list, ...pageInfo } = res || {}
100
       setListData(list)
115
       setListData(list)
101
       setPagination(pageInfo)
116
       setPagination(pageInfo)
102
       setLoading(false)
117
       setLoading(false)
103
     }).catch(() => setLoading(false))
118
     }).catch(() => setLoading(false))
104
-  }, [queryParams])
119
+  }, [queryParams, communityId])
105
 
120
 
106
   return (
121
   return (
107
     <div>
122
     <div>
108
-      <Condition onSearch={handleSearch} onReset={handleSearch} />
123
+      <Condition onSearch={handleSearch} onReset={handleSearch} onCommunityChange={v => setCommunityId(v)} />
109
       <div style={{ margin: '24px 0' }}>
124
       <div style={{ margin: '24px 0' }}>
110
         <NavLink to={`/property/notice/edit`}>
125
         <NavLink to={`/property/notice/edit`}>
111
           <Button type="primary">添加</Button>
126
           <Button type="primary">添加</Button>

+ 8
- 11
src/pages/property/proprietor/Add.jsx Vedi File

3
 import router from 'umi/router'
3
 import router from 'umi/router'
4
 import { fetch, apis } from '@/utils/request'
4
 import { fetch, apis } from '@/utils/request'
5
 import useRoomSelect from '../utils/hooks/useRoomSelect'
5
 import useRoomSelect from '../utils/hooks/useRoomSelect'
6
+import CommunitySelect from '@/components/CommunitySelect'
6
 
7
 
7
 const addPerson = fetch(apis.buildingOwnerInfo.addBuilding)
8
 const addPerson = fetch(apis.buildingOwnerInfo.addBuilding)
8
 const taUserHasOwner = fetch(apis.propUser.taUserHasOwner)
9
 const taUserHasOwner = fetch(apis.propUser.taUserHasOwner)
35
 const isEmpty = o => !o || (Array.isArray(o) && !o.length) || (typeof o === 'object' && !Object.keys(o).length)
36
 const isEmpty = o => !o || (Array.isArray(o) && !o.length) || (typeof o === 'object' && !Object.keys(o).length)
36
 
37
 
37
 export default Form.create()(props => {
38
 export default Form.create()(props => {
39
+  const [communityId, setCommunityId] = useState()
38
   const {
40
   const {
39
     phaseId,
41
     phaseId,
40
     setPhaseId,
42
     setPhaseId,
51
     unitList,
53
     unitList,
52
     levelList,
54
     levelList,
53
     roomNoList
55
     roomNoList
54
-  } = useRoomSelect()
56
+  } = useRoomSelect(communityId)
55
 
57
 
56
   const [owerExist, setOwnerExist] = useState(false)
58
   const [owerExist, setOwnerExist] = useState(false)
57
   const [telAccUser, setTelAccUser] = useState()
59
   const [telAccUser, setTelAccUser] = useState()
74
 
76
 
75
   useEffect(() => {
77
   useEffect(() => {
76
     if (roomNoId) {
78
     if (roomNoId) {
77
-      taUserHasOwner({ params: {phaseId, buildingId, unitId, levelId, roomNoId} }).then(res => {
79
+      taUserHasOwner({ params: {communityId, phaseId, buildingId, unitId, levelId, roomNoId} }).then(res => {
78
         setOwnerExist(res.boolRole)
80
         setOwnerExist(res.boolRole)
79
       })
81
       })
80
     }
82
     }
81
   }, [roomNoId])
83
   }, [roomNoId])
82
   
84
   
83
-  useEffect(() => {
84
-    if (roomNoId) {
85
-      taUserHasOwner({ params: {phaseId, buildingId, unitId, levelId, roomNoId} }).then(res => {
86
-        setOwnerExist(res.boolRole)
87
-      })
88
-    }
89
-  }, [roomNoId])
90
-
91
-
92
   const handleSubmit = e => {
85
   const handleSubmit = e => {
93
     e.preventDefault();
86
     e.preventDefault();
94
     if (!isEmpty(telAccUser)) {
87
     if (!isEmpty(telAccUser)) {
99
       if (!err) {
92
       if (!err) {
100
         const data = {
93
         const data = {
101
           ...values,
94
           ...values,
95
+          communityId,
102
           phaseId,
96
           phaseId,
103
           buildingId,
97
           buildingId,
104
           unitId,
98
           unitId,
121
   return (
115
   return (
122
     <div>
116
     <div>
123
       <Form {...formItemLayout} onSubmit={handleSubmit}>
117
       <Form {...formItemLayout} onSubmit={handleSubmit}>
118
+        <Form.Item label="小区" required>
119
+          <CommunitySelect value={communityId} onChange={v => setCommunityId(v)} autoInited />
120
+        </Form.Item>
124
         <Form.Item label="期/区" required>
121
         <Form.Item label="期/区" required>
125
           <Select value={phaseId} onChange={handlePhaseChange} style={{ minWidth: '120px' }} placeholder="期/区">
122
           <Select value={phaseId} onChange={handlePhaseChange} style={{ minWidth: '120px' }} placeholder="期/区">
126
             {
123
             {

+ 20
- 4
src/pages/property/proprietor/Audit.jsx Vedi File

4
 import Search from '../components/Search'
4
 import Search from '../components/Search'
5
 import List from '../components/List'
5
 import List from '../components/List'
6
 import AuditNot from './components/AuditNot'
6
 import AuditNot from './components/AuditNot'
7
+import CommunitySelect from '@/components/CommunitySelect'
7
 
8
 
8
 const Condition = props => {
9
 const Condition = props => {
10
+  const [communityId, setCommunityId] = useState()
11
+
12
+  const handleCommunityChange = v => {
13
+    props.onCommunityChange(v)
14
+    setCommunityId(v)
15
+  }
16
+
9
   return (
17
   return (
10
     <Search
18
     <Search
11
       onSearch={props.onSearch}
19
       onSearch={props.onSearch}
15
 
23
 
16
         return (
24
         return (
17
           <>
25
           <>
26
+            <Form.Item label="小区">
27
+            {
28
+              <CommunitySelect autoInited value={communityId} onChange={handleCommunityChange} />
29
+            }
30
+            </Form.Item>
18
             <Form.Item label="姓名">
31
             <Form.Item label="姓名">
19
             {
32
             {
20
               getFieldDecorator('userName')(<Input style={{ width: '160px' }} placeholder="姓名" />)
33
               getFieldDecorator('userName')(<Input style={{ width: '160px' }} placeholder="姓名" />)
53
   const [selectedKeys, setSelectedKeys] = useState([])
66
   const [selectedKeys, setSelectedKeys] = useState([])
54
   const [pagination, setPagination] = useState({})
67
   const [pagination, setPagination] = useState({})
55
   const [queryParams, setQueryParams] = useState({ pageNum: 1, pageSize: 10 })
68
   const [queryParams, setQueryParams] = useState({ pageNum: 1, pageSize: 10 })
69
+  const [communityId, setCommunityId] = useState()
56
 
70
 
57
   const currentRow = useRef()
71
   const currentRow = useRef()
58
   
72
   
60
     setQueryParams({
74
     setQueryParams({
61
       ...queryParams,
75
       ...queryParams,
62
       ...vals,
76
       ...vals,
77
+      communityId,
63
       pageNum: 1
78
       pageNum: 1
64
     })
79
     })
65
   }
80
   }
66
 
81
 
67
   const rowSelection = {
82
   const rowSelection = {
68
     onChange: (selectedRowKeys, selectedRows) => {
83
     onChange: (selectedRowKeys, selectedRows) => {
69
-      console.log('------>', selectedRowKeys)
84
+      // console.log('------>', selectedRowKeys)
70
       setSelectedKeys(selectedRowKeys)
85
       setSelectedKeys(selectedRowKeys)
71
     }
86
     }
72
   }
87
   }
107
     const row = {
122
     const row = {
108
       ...currentRow.current,
123
       ...currentRow.current,
109
       ...vals,
124
       ...vals,
125
+      communityId,
110
     }
126
     }
111
 
127
 
112
     handleVerfiy(row, false)
128
     handleVerfiy(row, false)
143
 
159
 
144
   useEffect(() => {
160
   useEffect(() => {
145
     setLoading(true)
161
     setLoading(true)
146
-    userVerifyAll(queryParams).then(res => {
162
+    userVerifyAll({...queryParams, communityId}).then(res => {
147
       const [records, pagi] = res || []
163
       const [records, pagi] = res || []
148
       setListData(records)
164
       setListData(records)
149
       setPagination({total: pagi.total, pageSize: pagi.size, pageNum: pagi.current})
165
       setPagination({total: pagi.total, pageSize: pagi.size, pageNum: pagi.current})
150
       setLoading(false)
166
       setLoading(false)
151
     }).catch(() => setLoading(false))
167
     }).catch(() => setLoading(false))
152
-  }, [queryParams])
168
+  }, [queryParams, communityId])
153
 
169
 
154
   return (
170
   return (
155
     <div>
171
     <div>
156
-      <Condition onSearch={handleSearch} onSearch={handleSearch} />
172
+      <Condition onSearch={handleSearch} onSearch={handleSearch} onCommunityChange={v => setCommunityId(v)} />
157
       <div style={{ margin: '24px 0' }}>
173
       <div style={{ margin: '24px 0' }}>
158
         <div style={{marginLeft: 16, display: 'inline-block'}}>
174
         <div style={{marginLeft: 16, display: 'inline-block'}}>
159
           <Popconfirm
175
           <Popconfirm

+ 25
- 1
src/pages/property/proprietor/BatchImport.jsx Vedi File

15
   const [dataList, setDataList] = useState([])
15
   const [dataList, setDataList] = useState([])
16
   const [pagenavi, setPagenavi] = useState({ pageSize: 10, total: 0 })
16
   const [pagenavi, setPagenavi] = useState({ pageSize: 10, total: 0 })
17
 
17
 
18
+  const communityId = props.location.query.community
18
   const excelRef = useRef()
19
   const excelRef = useRef()
19
 
20
 
21
+  const checkCommunity = () => {
22
+    if (!communityId) {
23
+      notification.warn({message: '没有选择小区'})
24
+      return false
25
+    }
26
+
27
+    return true
28
+  }
29
+
20
   const downloadExcel = () => {
30
   const downloadExcel = () => {
21
-    buildingDownloadExcel().then(res => {
31
+    if (!checkCommunity()) {
32
+      return
33
+    }
34
+
35
+    buildingDownloadExcel({params: {communityId}}).then(res => {
22
       const url = window.URL.createObjectURL(new Blob([res]))
36
       const url = window.URL.createObjectURL(new Blob([res]))
23
       const link = document.createElement('a')
37
       const link = document.createElement('a')
24
       link.href = url
38
       link.href = url
28
   }
42
   }
29
 
43
 
30
   const importExcel = () => {
44
   const importExcel = () => {
45
+    if (!checkCommunity()) {
46
+      return
47
+    }
48
+
31
     const input = document.createElement('input')
49
     const input = document.createElement('input')
32
     input.setAttribute('type', 'file')
50
     input.setAttribute('type', 'file')
33
     input.addEventListener('input', e => {
51
     input.addEventListener('input', e => {
36
         excelRef.current = files[0]
54
         excelRef.current = files[0]
37
         const formData = new FormData()
55
         const formData = new FormData()
38
         formData.append('file', excelRef.current)
56
         formData.append('file', excelRef.current)
57
+        formData.append('communityId', communityId)
39
         
58
         
40
         setLoading(true)
59
         setLoading(true)
41
         uploadBuildingExcel({ data: formData }).then(res => {
60
         uploadBuildingExcel({ data: formData }).then(res => {
55
   }
74
   }
56
 
75
 
57
   const submitExcel = () => {
76
   const submitExcel = () => {
77
+    if (!checkCommunity()) {
78
+      return
79
+    }
80
+
58
     if (!excelRef.current) {
81
     if (!excelRef.current) {
59
       notification.warning({ message: '没有选择文件' })
82
       notification.warning({ message: '没有选择文件' })
60
       return
83
       return
62
 
85
 
63
     const formData = new FormData()
86
     const formData = new FormData()
64
     formData.append('file', excelRef.current)
87
     formData.append('file', excelRef.current)
88
+    formData.append('communityId', communityId)
65
 
89
 
66
     setLoading(true)
90
     setLoading(true)
67
     submitBuildingExcel({ data: formData }).then(res => {
91
     submitBuildingExcel({ data: formData }).then(res => {

+ 21
- 7
src/pages/property/proprietor/index.jsx Vedi File

3
 import NavLink from 'umi/navlink'
3
 import NavLink from 'umi/navlink'
4
 import { fetch, fetchList, apis } from '@/utils/request'
4
 import { fetch, fetchList, apis } from '@/utils/request'
5
 import { exportExcel } from '@/utils/utils'
5
 import { exportExcel } from '@/utils/utils'
6
+import CommunitySelect from '@/components/CommunitySelect'
6
 import Search from '../components/Search'
7
 import Search from '../components/Search'
7
 import List from '../components/List'
8
 import List from '../components/List'
8
 import useRoomSelect from '../utils/hooks/useRoomSelect'
9
 import useRoomSelect from '../utils/hooks/useRoomSelect'
12
 const deleteBuilding = fetch(apis.buildingOwnerInfo.deleteBuilding)
13
 const deleteBuilding = fetch(apis.buildingOwnerInfo.deleteBuilding)
13
 
14
 
14
 const Condition = props => {
15
 const Condition = props => {
16
+  const [communityId, setCommunityId] = useState()
17
+
15
   const {
18
   const {
16
     phaseId,
19
     phaseId,
17
     setPhaseId,
20
     setPhaseId,
28
     unitList,
31
     unitList,
29
     levelList,
32
     levelList,
30
     roomNoList
33
     roomNoList
31
-  } = useRoomSelect()
34
+  } = useRoomSelect(communityId)
32
 
35
 
33
   const handleSearch = vals => {
36
   const handleSearch = vals => {
34
     const data = {
37
     const data = {
35
       ...vals,
38
       ...vals,
39
+      communityId,
36
       phaseId,
40
       phaseId,
37
       buildingId,
41
       buildingId,
38
       unitId,
42
       unitId,
66
     }
70
     }
67
   }
71
   }
68
 
72
 
73
+  const handleCommunityChange = v => {
74
+    setCommunityId(v)
75
+
76
+    props.onCommunityChange(v)
77
+  }
78
+
69
   return (
79
   return (
70
     <Search
80
     <Search
71
       onSearch={handleSearch}
81
       onSearch={handleSearch}
81
 
91
 
82
         return (
92
         return (
83
           <>
93
           <>
94
+            <Form.Item>
95
+              <CommunitySelect value={communityId} onChange={handleCommunityChange} autoInited />
96
+            </Form.Item>
84
             <Form.Item>
97
             <Form.Item>
85
               <Select value={phaseId} onChange={handlePhaseChange} style={{ minWidth: '120px' }} placeholder="期/区">
98
               <Select value={phaseId} onChange={handlePhaseChange} style={{ minWidth: '120px' }} placeholder="期/区">
86
                 {
99
                 {
160
   const [listData, setListData] = useState([])
173
   const [listData, setListData] = useState([])
161
   const [selectedKeys, setSelectedKeys] = useState([])
174
   const [selectedKeys, setSelectedKeys] = useState([])
162
   const [pagination, setPagination] = useState({})
175
   const [pagination, setPagination] = useState({})
176
+  const [communityId, setCommunityId] = useState()
163
   const [queryParams, setQueryParams] = useState({ pageNum: 1, pageSize: 10 })
177
   const [queryParams, setQueryParams] = useState({ pageNum: 1, pageSize: 10 })
164
 
178
 
165
   const rowSelection = {
179
   const rowSelection = {
166
     onChange: (selectedRowKeys, selectedRows) => {
180
     onChange: (selectedRowKeys, selectedRows) => {
167
-      console.log('------>', selectedRowKeys)
181
+      // console.log('------>', selectedRowKeys)
168
       setSelectedKeys(selectedRowKeys)
182
       setSelectedKeys(selectedRowKeys)
169
     }
183
     }
170
   }
184
   }
209
 
223
 
210
   const handleExport = () => {
224
   const handleExport = () => {
211
     setLoading(true)
225
     setLoading(true)
212
-    buildingInfoListExport({ data: {...queryParams, pageNum: 1, pageSize: 9999} }).then(res => {
226
+    buildingInfoListExport({ data: {...queryParams, communityId, pageNum: 1, pageSize: 9999} }).then(res => {
213
       setLoading(false)
227
       setLoading(false)
214
       exportExcel(res, "业主列表")
228
       exportExcel(res, "业主列表")
215
     }).catch(() => setLoading(false))
229
     }).catch(() => setLoading(false))
217
 
231
 
218
   useEffect(() => {
232
   useEffect(() => {
219
     setLoading(true)
233
     setLoading(true)
220
-    buildingInfoList({ data: queryParams }).then(res => {
234
+    buildingInfoList({ data: {...queryParams, communityId} }).then(res => {
221
       const { list, ...pageInfo } = res || {}
235
       const { list, ...pageInfo } = res || {}
222
       setListData(list)
236
       setListData(list)
223
       setPagination(pageInfo)
237
       setPagination(pageInfo)
224
       setLoading(false)
238
       setLoading(false)
225
     }).catch(() => setLoading(false))
239
     }).catch(() => setLoading(false))
226
-  }, [queryParams])
240
+  }, [queryParams, communityId])
227
 
241
 
228
   return (
242
   return (
229
     <div>
243
     <div>
230
-      <Condition onSearch={handleSearch} onReset={handleSearch} />
244
+      <Condition onSearch={handleSearch} onReset={handleSearch} onCommunityChange={v => setCommunityId(v)} />
231
       <div style={{ margin: '24px 0' }}>
245
       <div style={{ margin: '24px 0' }}>
232
         <NavLink to={`/property/proprietor/add`}>
246
         <NavLink to={`/property/proprietor/add`}>
233
           <Button type="primary">添加</Button>
247
           <Button type="primary">添加</Button>
245
         <div style={{marginLeft: 16, display: 'inline-block'}}>
259
         <div style={{marginLeft: 16, display: 'inline-block'}}>
246
           <Button onClick={handleExport}>导出</Button>
260
           <Button onClick={handleExport}>导出</Button>
247
         </div>
261
         </div>
248
-        <NavLink to={`/property/proprietor/batch`}>
262
+        <NavLink to={`/property/proprietor/batch?community=${communityId}`}>
249
           <Button type="link"><Icon type="upload"/>批量导入业主资料</Button>
263
           <Button type="link"><Icon type="upload"/>批量导入业主资料</Button>
250
         </NavLink>
264
         </NavLink>
251
       </div>
265
       </div>

+ 18
- 3
src/pages/property/ticket/index.jsx Vedi File

2
 import { Select, Spin, Table, Button, Form, Input, Divider, Typography } from 'antd'
2
 import { Select, Spin, Table, Button, Form, Input, Divider, Typography } from 'antd'
3
 import NavLink from 'umi/navlink'
3
 import NavLink from 'umi/navlink'
4
 import { fetchList, apis, fetch } from '@/utils/request'
4
 import { fetchList, apis, fetch } from '@/utils/request'
5
+import CommunitySelect from '@/components/CommunitySelect'
5
 import Search from '../components/Search'
6
 import Search from '../components/Search'
6
 import List from '../components/List'
7
 import List from '../components/List'
7
 
8
 
52
 const listTicket = fetch(apis.ticket.listTicket)
53
 const listTicket = fetch(apis.ticket.listTicket)
53
 
54
 
54
 const Condition = props => {
55
 const Condition = props => {
56
+  const [communityId, setCommunityId] = useState()
57
+  
58
+  const handleCommunityChange = v => {
59
+    setCommunityId(v)
60
+
61
+    props.onCommunityChange(v)
62
+  }
63
+
55
   return (
64
   return (
56
     <Search
65
     <Search
57
       onSearch={props.onSearch}
66
       onSearch={props.onSearch}
61
         
70
         
62
         return (
71
         return (
63
           <>
72
           <>
73
+            <Form.Item label="小区">
74
+            {
75
+              <CommunitySelect value={communityId} onChange={handleCommunityChange} autoInited />
76
+            }
77
+            </Form.Item>
64
             <Form.Item label="工单编号">
78
             <Form.Item label="工单编号">
65
             {
79
             {
66
               getFieldDecorator('id')(<Input placeholder="工单编号" />)
80
               getFieldDecorator('id')(<Input placeholder="工单编号" />)
113
 export default props => {
127
 export default props => {
114
   const [loading, setLoading] = useState(false)
128
   const [loading, setLoading] = useState(false)
115
   const [listData, setListData] = useState([])
129
   const [listData, setListData] = useState([])
130
+  const [communityId, setCommunityId] = useState()
116
   const [pagination, setPagination] = useState({})
131
   const [pagination, setPagination] = useState({})
117
   const [queryParams, setQueryParams] = useState({ pageNum: 1, pageSize: 10 })
132
   const [queryParams, setQueryParams] = useState({ pageNum: 1, pageSize: 10 })
118
 
133
 
134
 
149
 
135
   useEffect(() => {
150
   useEffect(() => {
136
     setLoading(true)
151
     setLoading(true)
137
-    listTicket({data: queryParams}).then(res => {
152
+    listTicket({data: {...queryParams, communityId}}).then(res => {
138
       const {list, ...pagi} = res
153
       const {list, ...pagi} = res
139
       setListData(list)
154
       setListData(list)
140
       setPagination(pagi)
155
       setPagination(pagi)
141
       setLoading(false)
156
       setLoading(false)
142
     }).catch(e => setLoading(false))
157
     }).catch(e => setLoading(false))
143
-  }, [queryParams])
158
+  }, [queryParams, communityId])
144
 
159
 
145
   return (
160
   return (
146
     <div>
161
     <div>
147
-      <Condition onSearch={handleSearch} onReset={handleSearch} />
162
+      <Condition onSearch={handleSearch} onReset={handleSearch} onCommunityChange={v => setCommunityId(v)} />
148
       <div style={{ margin: '24px 0' }}>
163
       <div style={{ margin: '24px 0' }}>
149
         {/* <NavLink to={`/property/notice/edit`}>
164
         {/* <NavLink to={`/property/notice/edit`}>
150
           <Button type="primary">添加</Button>
165
           <Button type="primary">添加</Button>

+ 5
- 3
src/pages/property/utils/hooks/useRoomSelect.js Vedi File

7
 const fetchLevelList = fetch(apis.buildingOwnerInfo.getLevelList)
7
 const fetchLevelList = fetch(apis.buildingOwnerInfo.getLevelList)
8
 const fetchRoomNoList = fetch(apis.buildingOwnerInfo.getRoomNoList)
8
 const fetchRoomNoList = fetch(apis.buildingOwnerInfo.getRoomNoList)
9
 
9
 
10
-export default function useRoomSelect() {
10
+export default function useRoomSelect(communityId) {
11
   const [phaseList, setPhaseList] = useState([])
11
   const [phaseList, setPhaseList] = useState([])
12
   const [buildingList, setBuildingList] = useState([])
12
   const [buildingList, setBuildingList] = useState([])
13
   const [unitList, setUnitList] = useState([])
13
   const [unitList, setUnitList] = useState([])
22
 
22
 
23
   // 获取期
23
   // 获取期
24
   useEffect(() => {
24
   useEffect(() => {
25
-    fetchPhaseList().then(res => setPhaseList(res))
26
-  }, [])
25
+    if (communityId) {
26
+      fetchPhaseList({params: {communityId}}).then(res => setPhaseList(res))
27
+    }
28
+  }, [communityId])
27
 
29
 
28
   // 楼栋
30
   // 楼栋
29
   useEffect(() => {
31
   useEffect(() => {

+ 30
- 7
src/pages/staff/list/editStaff.jsx Vedi File

2
 
2
 
3
 import { Input, Menu, Dropdown, Button, Icon, message, Table, Tooltip, Tabs, Radio, Divider, Tag, Select, Form, Alert, Modal } from 'antd';
3
 import { Input, Menu, Dropdown, Button, Icon, message, Table, Tooltip, Tabs, Radio, Divider, Tag, Select, Form, Alert, Modal } from 'antd';
4
 import { FormattedMessage } from 'umi-plugin-react/locale';
4
 import { FormattedMessage } from 'umi-plugin-react/locale';
5
-import BuildSelect from '../../../components/SelectButton/BuildSelect'
5
+import BuildSelect from '@/components/SelectButton/BuildSelect'
6
 import router from 'umi/router';
6
 import router from 'umi/router';
7
-import styles from '../../style/GoodsList.less';
8
-import { FieldTypes, createForm } from '../../../components/XForm';
9
-import Wangedit from '../../../components/Wangedit/Wangedit'
7
+import { FieldTypes, createForm } from '@/components/XForm';
8
+import Wangedit from '@/components/Wangedit/Wangedit'
9
+import CommunitySelect from '@/components/CommunitySelect';
10
 import channels from './channelList.less';
10
 import channels from './channelList.less';
11
 import Tagss from '../components/Tagss.jsx';
11
 import Tagss from '../components/Tagss.jsx';
12
 import apis from '../../../services/apis';
12
 import apis from '../../../services/apis';
13
 import request from '../../../utils/request'
13
 import request from '../../../utils/request'
14
 import BuildingSelection from '../components/BuildingSelection'
14
 import BuildingSelection from '../components/BuildingSelection'
15
+import styles from '../../style/GoodsList.less';
15
 
16
 
16
 const { TextArea } = Input;
17
 const { TextArea } = Input;
17
 const { Option } = Select;
18
 const { Option } = Select;
27
 
28
 
28
 const XForm = createForm({ onValuesChange: handleFormValueChange })
29
 const XForm = createForm({ onValuesChange: handleFormValueChange })
29
 
30
 
31
+const AuthCommunity = props => {
32
+  const value = (props.value || []).map(x => x.id)
33
+  const handleChange = vals => {
34
+    const data = (vals || []).map(x => ({id: x}))
35
+    props.onChange(data)
36
+  }
37
+
38
+  return (
39
+    <CommunitySelect
40
+      mode="multiple"
41
+      value={value}
42
+      onChange={handleChange}
43
+    />
44
+  )
45
+}
46
+
30
 /**
47
 /**
31
  *
48
  *
32
  *
49
  *
251
         { required: true, message: '请选择头像' },
268
         { required: true, message: '请选择头像' },
252
       ]
269
       ]
253
     },
270
     },
271
+    {
272
+      label: '授权小区',
273
+      name: 'communityList',
274
+      render: <AuthCommunity />,
275
+      value: userData.communityList,
276
+      rules: [
277
+        { required: true, message: '请选择授权小区' },
278
+      ]
279
+    },
254
     {
280
     {
255
       label: '简介',
281
       label: '简介',
256
       name: 'description',
282
       name: 'description',
257
       render: <TextArea className={channels.inpuitTxt} placeholder="生活管家请在此填写服务范围" ></TextArea>,
283
       render: <TextArea className={channels.inpuitTxt} placeholder="生活管家请在此填写服务范围" ></TextArea>,
258
       value: userData.description
284
       value: userData.description
259
-
260
     },
285
     },
261
     {
286
     {
262
       label: '状态',
287
       label: '状态',
336
     // },
361
     // },
337
   ]
362
   ]
338
 
363
 
339
-  console.log('--------->', fields)
340
-
341
   return <div>
364
   return <div>
342
             <XForm onChange={console.log} onSubmit={handleSubmit} fields={fields.filter(Boolean)} onCancel={() => router.go(-1)}></XForm>
365
             <XForm onChange={console.log} onSubmit={handleSubmit} fields={fields.filter(Boolean)} onCancel={() => router.go(-1)}></XForm>
343
             {/* <Modal
366
             {/* <Modal

+ 2
- 0
src/services/apis.js Vedi File

6
 import ticket from './ticket_api'
6
 import ticket from './ticket_api'
7
 import propNews from './prop_news_api'
7
 import propNews from './prop_news_api'
8
 import dashboard from './dashboard_api'
8
 import dashboard from './dashboard_api'
9
+import community from './community_api'
9
 
10
 
10
 const prefix = `${APIBaseURL}api/admin`
11
 const prefix = `${APIBaseURL}api/admin`
11
 
12
 
21
   ticket: ticket(prefix),
22
   ticket: ticket(prefix),
22
   propNews: propNews(prefix),
23
   propNews: propNews(prefix),
23
   dashboard: dashboard(prefix),
24
   dashboard: dashboard(prefix),
25
+  community: community(prefix),
24
   mp: {
26
   mp: {
25
     detail: {
27
     detail: {
26
       url: `${prefix}/taMpInfo`,
28
       url: `${prefix}/taMpInfo`,

+ 28
- 0
src/services/community_api.js Vedi File

1
+
2
+export default prefix => ({
3
+  list: {
4
+    url: `${prefix}/tpCommunity`,
5
+    method: 'GET',
6
+    action: 'admin.community.list'
7
+  },
8
+  detail: {
9
+    url: `${prefix}/tpCommunity/:id`,
10
+    method: 'GET',
11
+    action: 'admin.community.detail'
12
+  },
13
+  update: {
14
+    url: `${prefix}/tpCommunity/:id`,
15
+    method: 'PUT',
16
+    action: 'admin.community.update'
17
+  },
18
+  save: {
19
+    url: `${prefix}/tpCommunity`,
20
+    method: 'POST',
21
+    action: 'admin.community.save'
22
+  },
23
+  delete: {
24
+    url: `${prefix}/tpCommunity/:id`,
25
+    method: 'DELETE',
26
+    action: 'admin.community.delete'
27
+  },
28
+})