浏览代码

Merge branch 'master' of http://git.ycjcjy.com/zhiyuxing/estateagents-admin-manager

许静 5 年前
父节点
当前提交
9be148ac09

+ 4
- 6
src/pages/building/list/add/components/poster.jsx 查看文件

31
     // eslint-disable-next-line react-hooks/rules-of-hooks
31
     // eslint-disable-next-line react-hooks/rules-of-hooks
32
     useEffect(() => {
32
     useEffect(() => {
33
       request({
33
       request({
34
-        url: '/api/admin/poster',
35
-        method: 'GET',
34
+        ...apis.activity.poster,
36
         params: { targetId: buildingId, targetType: 'building' },
35
         params: { targetId: buildingId, targetType: 'building' },
37
       }).then(data => {
36
       }).then(data => {
38
         console.log(data, '2222')
37
         console.log(data, '2222')
64
     if (buildingId) {
63
     if (buildingId) {
65
       if (posterId) {
64
       if (posterId) {
66
         request({
65
         request({
67
-          url: `/api/admin/poster/${posterId}`,
68
-          method: 'PUT',
66
+          ...apis.activity.updatePoster,
67
+          urlData: { id: posterId },
69
           data: { targetId: buildingId, targetType: 'building', posterImg: imgValue, posterTitle: inputValue, posterDescription: textAreaValue },
68
           data: { targetId: buildingId, targetType: 'building', posterImg: imgValue, posterTitle: inputValue, posterDescription: textAreaValue },
70
         }).then(() => {
69
         }).then(() => {
71
           message.info('保存成功')
70
           message.info('保存成功')
74
         })
73
         })
75
       } else {
74
       } else {
76
         request({
75
         request({
77
-          url: '/api/admin/poster',
78
-          method: 'POST',
76
+          ...apis.activity.addPoster,
79
           data: { targetId: buildingId, targetType: 'building', posterImg: imgValue, posterTitle: inputValue, posterDescription: textAreaValue },
77
           data: { targetId: buildingId, targetType: 'building', posterImg: imgValue, posterTitle: inputValue, posterDescription: textAreaValue },
80
         }).then(data => {
78
         }).then(data => {
81
           setPosterId(data.posterId)
79
           setPosterId(data.posterId)

+ 7
- 8
src/pages/building/list/add/components/share.jsx 查看文件

14
 import touxiang from '../../../../../assets/touxiang.jpg';
14
 import touxiang from '../../../../../assets/touxiang.jpg';
15
 import poster1 from '../../../../../assets/poster1.png';
15
 import poster1 from '../../../../../assets/poster1.png';
16
 import poster2 from '../../../../../assets/poster2.png';
16
 import poster2 from '../../../../../assets/poster2.png';
17
+import apis from '../../../../../services/apis';
17
 
18
 
18
 const Share = props => {
19
 const Share = props => {
19
   const [inputValue, changeInput] = useState('')
20
   const [inputValue, changeInput] = useState('')
25
     // eslint-disable-next-line react-hooks/rules-of-hooks
26
     // eslint-disable-next-line react-hooks/rules-of-hooks
26
     useEffect(() => {
27
     useEffect(() => {
27
       request({
28
       request({
28
-        url: '/api/admin/shareContent',
29
-        method: 'GET',
29
+        ...apis.activity.shareContent,
30
         params: { targetId: buildingId, targetType: 'building' },
30
         params: { targetId: buildingId, targetType: 'building' },
31
       }).then(data => {
31
       }).then(data => {
32
         if (data.length > 0) {
32
         if (data.length > 0) {
44
     if (buildingId) {
44
     if (buildingId) {
45
       if (shareContentId) {
45
       if (shareContentId) {
46
         request({
46
         request({
47
-          url: `/api/admin/shareContent/${shareContentId}`,
48
-          method: 'PUT',
49
-          data: { targetId: buildingId, shareContentType: 'building',shareContentImg: imgValue,shareContentTitle: inputValue },
47
+          ...apis.activity.updateShareContent,
48
+          urlData: { id: shareContentId },
49
+          data: { targetId: buildingId, shareContentType: 'building', shareContentImg: imgValue,shareContentTitle: inputValue },
50
         }).then(data => {
50
         }).then(data => {
51
           message.info('保存成功')
51
           message.info('保存成功')
52
         }).catch(err => {
52
         }).catch(err => {
54
         })
54
         })
55
        } else {
55
        } else {
56
         request({
56
         request({
57
-          url: '/api/admin/shareContent',
58
-          method: 'POST',
59
-          data: { targetId: buildingId, shareContentType: 'building',shareContentImg: imgValue,shareContentTitle: inputValue },
57
+          ...apis.activity.addShareContent,
58
+          data: { targetId: buildingId, shareContentType: 'building', shareContentImg: imgValue,shareContentTitle: inputValue },
60
         }).then(data => {
59
         }).then(data => {
61
           setShareContentId(data.shareContentId)
60
           setShareContentId(data.shareContentId)
62
           message.info('保存成功')
61
           message.info('保存成功')

+ 16
- 8
src/pages/building/list/index.jsx 查看文件

111
       <p className={Styles.cardText}>
111
       <p className={Styles.cardText}>
112
         <span className={Styles.title}>楼盘编号</span>
112
         <span className={Styles.title}>楼盘编号</span>
113
         <span >:{data.code}</span>
113
         <span >:{data.code}</span>
114
-        <span className={Styles.ediText} onClick={() => toEdi(data)}>
115
-          编辑
116
-                <Icon type="form" style={{ color: '#C0C4CC', marginLeft: '10px' }} />
117
-        </span>
114
+        <AuthButton name="admin.building.update.put" noRight={null}>
115
+          <span className={Styles.ediText} onClick={() => toEdi(data)}>
116
+            编辑
117
+                  <Icon type="form" style={{ color: '#C0C4CC', marginLeft: '10px' }} />
118
+          </span>
119
+        </AuthButton>
118
       </p>
120
       </p>
119
       <p className={Styles.cardText}>
121
       <p className={Styles.cardText}>
120
         <span className={Styles.title}>楼盘名称</span>
122
         <span className={Styles.title}>楼盘名称</span>
139
         <span >:{data.createDate}</span>
141
         <span >:{data.createDate}</span>
140
       </p>
142
       </p>
141
       <p style={{ margin: '15px 0', position: 'relative', fontSize: '0.11rem' }}>
143
       <p style={{ margin: '15px 0', position: 'relative', fontSize: '0.11rem' }}>
144
+      <AuthButton name="admin.building.update.status.put" noRight={null}>
142
         <span style={{ color: '#FF4A4A' }} onClick={() => pulicAndUnPulic(data)}>
145
         <span style={{ color: '#FF4A4A' }} onClick={() => pulicAndUnPulic(data)}>
143
           {/* 已发布的时候,需要显示取消发布的字样 */}
146
           {/* 已发布的时候,需要显示取消发布的字样 */}
144
           {data.status === 1 ? '取消发布' : '发布'}
147
           {data.status === 1 ? '取消发布' : '发布'}
145
           <Icon type={data.status === 1 ? 'close-circle' : 'form'} style={{ color: '#C0C4CC', marginLeft: '8px' }} />
148
           <Icon type={data.status === 1 ? 'close-circle' : 'form'} style={{ color: '#C0C4CC', marginLeft: '8px' }} />
146
         </span>
149
         </span>
150
+      </AuthButton>
151
+      <AuthButton name="admin.building.delete.id.delete" noRight={null}>
147
         <span style={{
152
         <span style={{
148
           color: '#FF4A4A', position: 'absolute', right: '0',
153
           color: '#FF4A4A', position: 'absolute', right: '0',
149
         }} onClick={() => deleteBuilding(data)}>
154
         }} onClick={() => deleteBuilding(data)}>
150
           删除
155
           删除
151
                 <Icon type="rest" style={{ color: '#C0C4CC', marginLeft: '8px' }} />
156
                 <Icon type="rest" style={{ color: '#C0C4CC', marginLeft: '8px' }} />
152
         </span>
157
         </span>
158
+      </AuthButton>
153
       </p>
159
       </p>
154
     </Card>
160
     </Card>
155
   )
161
   )
279
           )}
285
           )}
280
         </Form.Item>
286
         </Form.Item>
281
         <Form.Item>
287
         <Form.Item>
282
-          <Button type="primary" htmlType="submit">
283
-            搜索
284
-          </Button>
288
+          <AuthButton name="admin.buildinglist.get" noRight={null}>
289
+            <Button type="primary" htmlType="submit">
290
+              搜索
291
+            </Button>
292
+          </AuthButton>
285
         </Form.Item>
293
         </Form.Item>
286
       </Form>
294
       </Form>
287
 
295
 
288
-      <AuthButton name="building.add" noRight={null}>
296
+      <AuthButton name="admin.building.add.post" noRight={null}>
289
         <Button type="danger" className={Styles.addButton} onClick={() => toAdd()}>
297
         <Button type="danger" className={Styles.addButton} onClick={() => toAdd()}>
290
           新增楼盘
298
           新增楼盘
291
         </Button>
299
         </Button>

+ 4
- 1
src/pages/building/type/index.jsx 查看文件

5
 import Styles from './style.less'
5
 import Styles from './style.less'
6
 import request from '../../../utils/request';
6
 import request from '../../../utils/request';
7
 import apis from '../../../services/apis';
7
 import apis from '../../../services/apis';
8
+import AuthButton from '@/components/AuthButton';
8
 
9
 
9
 function body() {
10
 function body() {
10
   // eslint-disable-next-line react-hooks/rules-of-hooks
11
   // eslint-disable-next-line react-hooks/rules-of-hooks
96
 
97
 
97
   return (
98
   return (
98
     <>
99
     <>
99
-      <Button type="danger" onClick={() => toEdi()}>新增类型</Button>
100
+      <AuthButton name="admin.tdBuildingType.post" noRight={null}>
101
+        <Button type="danger" onClick={() => toEdi()}>新增类型</Button>
102
+      </AuthButton>
100
       <Table style={{ marginTop: '30px' }} dataSource={data.records} columns={columns} pagination={false} />
103
       <Table style={{ marginTop: '30px' }} dataSource={data.records} columns={columns} pagination={false} />
101
       {/* 分页 */}
104
       {/* 分页 */}
102
       <div style={{ display: 'flex', justifyContent: 'flex-end', marginTop: '30px' }}>
105
       <div style={{ display: 'flex', justifyContent: 'flex-end', marginTop: '30px' }}>

+ 21
- 10
src/pages/channel/InviteClients.jsx 查看文件

4
 import { FormattedMessage } from 'umi-plugin-react/locale';
4
 import { FormattedMessage } from 'umi-plugin-react/locale';
5
 import channels from './channelList.less';
5
 import channels from './channelList.less';
6
 import router from 'umi/router';
6
 import router from 'umi/router';
7
+import apis from '../../services/apis';
7
 import request from '../../utils/request'
8
 import request from '../../utils/request'
8
 
9
 
9
 const { Option } = Select;
10
 const { Option } = Select;
45
   const [data, setData] = useState({ channelNmae: [], result: [] })
46
   const [data, setData] = useState({ channelNmae: [], result: [] })
46
   // eslint-disable-next-line react-hooks/rules-of-hooks
47
   // eslint-disable-next-line react-hooks/rules-of-hooks
47
   useEffect(() => {
48
   useEffect(() => {
48
-    getList({ id: props.location.query.id, pageNum: 1, pageSize: 10 })
49
+    getListInvite({ id: props.location.query.id, pageNum: 1, pageSize: 10 })
49
   }, [])
50
   }, [])
50
 
51
 
51
-  function getList(params) {
52
-    request({
53
-      url: '/api/admin/channel/InviteClientsList',
54
-      method: 'GET',
55
-      params: { ...params },
56
-  // eslint-disable-next-line no-shadow
57
-  }).then(data => {
58
-      console.log(data)
52
+  // function getListInvite(params) {
53
+  //   request({
54
+  //     url: '/api/admin/channel/InviteClientsList',
55
+  //     method: 'GET',
56
+  //     params: { ...params },
57
+  // // eslint-disable-next-line no-shadow
58
+  // }).then(data => {
59
+  //     console.log(data)
60
+  //     setData(data)
61
+  // })
62
+  // }
63
+
64
+  function getListInvite(params) {
65
+    request({ ...apis.channelList.getListInvite, params: { ...params } }).then((data) => {
59
       setData(data)
66
       setData(data)
67
+  }).catch((err) => {
68
+      console.log(err)
69
+      message.info(err.msg || err.message)
60
   })
70
   })
61
   }
71
   }
72
+
62
   // 分页
73
   // 分页
63
   function onChange(pageNumber) {
74
   function onChange(pageNumber) {
64
     // eslint-disable-next-line react-hooks/rules-of-hooks
75
     // eslint-disable-next-line react-hooks/rules-of-hooks
65
-      getList({ pageNum: pageNumber, pageSize: 9 })
76
+    getListInvite({ pageNum: pageNumber, pageSize: 9 })
66
   }
77
   }
67
   return (
78
   return (
68
     <>
79
     <>

+ 7
- 10
src/pages/channel/addChannel.jsx 查看文件

3
 import { FormattedMessage } from 'umi-plugin-react/locale';
3
 import { FormattedMessage } from 'umi-plugin-react/locale';
4
 import channels from './channelList.less';
4
 import channels from './channelList.less';
5
 import router from 'umi/router';
5
 import router from 'umi/router';
6
+import apis from '../../services/apis';
6
 import request from '../../utils/request'
7
 import request from '../../utils/request'
7
 
8
 
8
 const { TextArea } = Input;
9
 const { TextArea } = Input;
17
   //   addChannel({ pageNum: 1, pageSize: 10 })
18
   //   addChannel({ pageNum: 1, pageSize: 10 })
18
   // }, [])
19
   // }, [])
19
 
20
 
20
-  function addChannel (params) {
21
-    request({
22
-      url: '/api/admin/channel',
23
-      method: 'POST',
24
-      data: { ...params },
25
-      // eslint-disable-next-line no-shadow
26
-    }).then(data => {
27
-      console.log(data)
21
+  function addChannel(params) {
22
+    request({ ...apis.channelList.addChannel, data: { ...params } }).then((data) => {
28
       setData(data)
23
       setData(data)
29
-      // eslint-disable-next-line no-unused-expressions
30
       router.go(-1)
24
       router.go(-1)
31
-    })
25
+  }).catch((err) => {
26
+      console.log(err)
27
+      message.info(err.msg || err.message)
28
+  })
32
   }
29
   }
33
 
30
 
34
   function handleSubmit (e) {
31
   function handleSubmit (e) {

+ 13
- 22
src/pages/channel/brokerList.jsx 查看文件

3
 import { FormattedMessage } from 'umi-plugin-react/locale';
3
 import { FormattedMessage } from 'umi-plugin-react/locale';
4
 import channels from './channelList.less';
4
 import channels from './channelList.less';
5
 import router from 'umi/router';
5
 import router from 'umi/router';
6
+import apis from '../../services/apis';
6
 import request from '../../utils/request'
7
 import request from '../../utils/request'
7
 
8
 
8
 const { Option } = Select;
9
 const { Option } = Select;
102
 //   const [page, changePage] = useState({})
103
 //   const [page, changePage] = useState({})
103
   // eslint-disable-next-line react-hooks/rules-of-hooks
104
   // eslint-disable-next-line react-hooks/rules-of-hooks
104
   useEffect(() => {
105
   useEffect(() => {
105
-    getList()
106
+    getListBroker()
106
   }, [])
107
   }, [])
107
-      function getList(params) {
108
-      request({
109
-        url: '/api/admin/channel/broker',
110
-        method: 'GET',
111
-        params: { ...params },
112
-    // eslint-disable-next-line no-shadow
113
-    }).then(data => {
114
-        console.log(data)
108
+
109
+    function getListBroker(params) {
110
+      request({ ...apis.channelList.getListBroker, params: { ...params } }).then((data) => {
115
         setData(data)
111
         setData(data)
112
+    }).catch((err) => {
113
+        console.log(err)
114
+        message.info(err.msg || err.message)
116
     })
115
     })
117
     }
116
     }
118
-  // const getList = e => {
119
-  //   request({
120
-  //       url: '/api/xxx',
121
-  //       method: 'GET',
122
-  //       params: {},
123
-  //   // eslint-disable-next-line no-shadow
124
-  //   }).then(data => {
125
-  //       setData(data)
126
-  //   })
127
-  // }
117
+
118
+
128
  // 查询
119
  // 查询
129
  function queryList() {
120
  function queryList() {
130
-  getList({ ...queryData, pageNum: 1, pageSize: 10, channelId: localStorage.getItem('value') })
121
+  getListBroker({ ...queryData, pageNum: 1, pageSize: 10, channelId: localStorage.getItem('value') })
131
 }
122
 }
132
     // 分页
123
     // 分页
133
     function onChange(pageNumber) {
124
     function onChange(pageNumber) {
134
       // eslint-disable-next-line react-hooks/rules-of-hooks
125
       // eslint-disable-next-line react-hooks/rules-of-hooks
135
-        getList({ pageNum: pageNumber, pageSize: 10 })
126
+      getListBroker({ pageNum: pageNumber, pageSize: 10 })
136
     }
127
     }
137
     // 获取input的值
128
     // 获取input的值
138
     function onInputChangePhone (e) {
129
     function onInputChangePhone (e) {
145
     setQueryData({ ...queryData, phone: e.target.value })
136
     setQueryData({ ...queryData, phone: e.target.value })
146
   }
137
   }
147
   function refurbishList () {
138
   function refurbishList () {
148
-    getList({ pageNum: 1, pageSize: 10 })
139
+    getListBroker({ pageNum: 1, pageSize: 10 })
149
   }
140
   }
150
   // eslint-disable-next-line no-undef
141
   // eslint-disable-next-line no-undef
151
   function handleClick() {
142
   function handleClick() {

+ 7
- 9
src/pages/channel/channelList.jsx 查看文件

3
 import { FormattedMessage } from 'umi-plugin-react/locale';
3
 import { FormattedMessage } from 'umi-plugin-react/locale';
4
 import channels from './channelList.less';
4
 import channels from './channelList.less';
5
 import router from 'umi/router';
5
 import router from 'umi/router';
6
+import apis from '../../services/apis';
6
 import request from '../../utils/request'
7
 import request from '../../utils/request'
7
 
8
 
8
 const { Option } = Select;
9
 const { Option } = Select;
112
     localStorage.removeItem('value');
113
     localStorage.removeItem('value');
113
     getList({ pageNum: 1, pageSize: 10 })
114
     getList({ pageNum: 1, pageSize: 10 })
114
   }, [])
115
   }, [])
115
-
116
+ 
116
   function getList(params) {
117
   function getList(params) {
117
-    request({
118
-      url: '/api/admin/channel',
119
-      method: 'GET',
120
-      params: { ...params },
121
-      // eslint-disable-next-line no-shadow
122
-    }).then(data => {
123
-      console.log(data)
118
+    request({ ...apis.channelList.getList, params: { ...params } }).then((data) => {
124
       setData(data)
119
       setData(data)
125
-    })
120
+  }).catch((err) => {
121
+      console.log(err)
122
+      message.info(err.msg || err.message)
123
+  })
126
   }
124
   }
127
   // value 的值
125
   // value 的值
128
   function handleChange(value) {
126
   function handleChange(value) {

+ 15
- 15
src/pages/channel/editChannel.jsx 查看文件

3
 import { FormattedMessage } from 'umi-plugin-react/locale';
3
 import { FormattedMessage } from 'umi-plugin-react/locale';
4
 import channels from './channelList.less';
4
 import channels from './channelList.less';
5
 import router from 'umi/router';
5
 import router from 'umi/router';
6
+import apis from '../../services/apis';
6
 import request from '../../utils/request'
7
 import request from '../../utils/request'
7
 
8
 
8
 const { TextArea } = Input;
9
 const { TextArea } = Input;
14
   useEffect(() => {
15
   useEffect(() => {
15
     getById()
16
     getById()
16
   }, [])
17
   }, [])
18
+  
19
+  
17
   // 查询当前信息
20
   // 查询当前信息
18
-  function getById() {
19
-    request({
20
-      url: `/api/admin/channel/${props.location.query.id}`,
21
-      method: 'GET',
22
-  // eslint-disable-next-line no-shadow
23
-  }).then(data => {
21
+  function getById(params) {
22
+    request({ ...apis.channelList.getById, urlData: { id: props.location.query.id } }).then((data) => {
24
       props.form.setFieldsValue(data)
23
       props.form.setFieldsValue(data)
24
+  }).catch((err) => {
25
+      console.log(err)
26
+      message.info(err.msg || err.message)
25
   })
27
   })
26
   }
28
   }
27
 
29
 
28
   // 编辑
30
   // 编辑
29
   function editChannel(data) {
31
   function editChannel(data) {
30
-      request({
31
-        url: `/api/admin/channel/${props.location.query.id}`,
32
-        method: 'PUT',
33
-        data: { ...data },
34
-    // eslint-disable-next-line no-shadow
35
-    }).then(data => {
36
-         // eslint-disable-next-line no-unused-expressions
37
-         router.go(-1)
38
-    })
32
+    request({ ...apis.channelList.editChannel, urlData: { id: props.location.query.id }, data: { ...data } }).then((data) => {
33
+      router.go(-1)
34
+  }).catch((err) => {
35
+      console.log(err)
36
+      message.info(err.msg || err.message)
37
+  })
39
   }
38
   }
40
 
39
 
40
+
41
   function handleSubmit(e) {
41
   function handleSubmit(e) {
42
     e.preventDefault();
42
     e.preventDefault();
43
     props.form.validateFields((err, values) => {
43
     props.form.validateFields((err, values) => {

+ 20
- 10
src/pages/channel/recommendClients.jsx 查看文件

3
 import { FormattedMessage } from 'umi-plugin-react/locale';
3
 import { FormattedMessage } from 'umi-plugin-react/locale';
4
 import channels from './channelList.less';
4
 import channels from './channelList.less';
5
 import router from 'umi/router';
5
 import router from 'umi/router';
6
+import apis from '../../services/apis';
6
 import request from '../../utils/request'
7
 import request from '../../utils/request'
7
 
8
 
8
 const { Option } = Select;
9
 const { Option } = Select;
98
 //   const [page, changePage] = useState({})
99
 //   const [page, changePage] = useState({})
99
   // eslint-disable-next-line react-hooks/rules-of-hooks
100
   // eslint-disable-next-line react-hooks/rules-of-hooks
100
   useEffect(() => {
101
   useEffect(() => {
101
-    getList({ pageNumber: 1, pageSize: 10 })
102
+    getListRecommend({ pageNumber: 1, pageSize: 10 })
102
   }, [])
103
   }, [])
103
 
104
 
104
-  function getList(params) {
105
-    request({
106
-      url: `/api/admin/customer/recommend/${props.location.query.id}`,
107
-      method: 'GET',
108
-      params: { ...params },
109
-  // eslint-disable-next-line no-shadow
110
-  }).then(data => {
111
-      console.log(data)
105
+  // function getListRecommend(params) {
106
+  //   request({
107
+  //     url: `/api/admin/customer/recommend/${props.location.query.id}`,
108
+  //     method: 'GET',
109
+  //     params: { ...params },
110
+  // // eslint-disable-next-line no-shadow
111
+  // }).then(data => {
112
+  //     console.log(data)
113
+  //     setData(data)
114
+  // })
115
+  // }
116
+
117
+  function getListRecommend(params) {
118
+    request({ ...apis.channelList.getListRecommend, urlData: { id: props.location.query.id }, params: { ...params } }).then((data) => {
112
       setData(data)
119
       setData(data)
120
+  }).catch((err) => {
121
+      console.log(err)
122
+      message.info(err.msg || err.message)
113
   })
123
   })
114
   }
124
   }
115
 
125
 
117
    // 分页
127
    // 分页
118
  function onChange(pageNum) {
128
  function onChange(pageNum) {
119
       // eslint-disable-next-line react-hooks/rules-of-hooks
129
       // eslint-disable-next-line react-hooks/rules-of-hooks
120
-        getList({ pageNumber: pageNum, pageSize: 9 })
130
+      getListRecommend({ pageNumber: pageNum, pageSize: 9 })
121
     }
131
     }
122
 return (
132
 return (
123
   <>
133
   <>

+ 25
- 14
src/pages/customer/customerlist/index.jsx 查看文件

10
 import IntegralRecord from './components/integralRecord'
10
 import IntegralRecord from './components/integralRecord'
11
 import ChangeStatus from './components/changeStatus'
11
 import ChangeStatus from './components/changeStatus'
12
 import BuildSelect from '../../../components/SelectButton/BuildSelect'
12
 import BuildSelect from '../../../components/SelectButton/BuildSelect'
13
+import AuthButton from '@/components/AuthButton';
13
 
14
 
14
 
15
 
15
 const { Option } = Select;
16
 const { Option } = Select;
191
       // eslint-disable-next-line no-nested-ternary
192
       // eslint-disable-next-line no-nested-ternary
192
       render: (_, record) => (
193
       render: (_, record) => (
193
         <>
194
         <>
194
-          <Button className={customerType === 'private' ? Styles.text : Styles.displayS} type="link" onClick={() => showStatus(record)}>变更状态</Button>
195
-          &nbsp;&nbsp;
196
-          <Button className={customerType === 'private' ? Styles.text : Styles.displayS} type="link" onClick={() => showGM(record)}>调整归属</Button>
197
-          <br />
198
-          <Button className={customerType === 'private' ? Styles.text : Styles.displayS} type="link" onClick={() => toCustomerDateil(record)}>查看详情</Button>
199
-          &nbsp;&nbsp;
200
-          <Button className={customerType === 'private' ? Styles.text : Styles.displayS} type="link" onClick={() => showRecord(record)}>积分记录</Button>
195
+          <AuthButton name="admin.customer.recommend.edit.id.put" noRight={null}>
196
+            <Button className={customerType === 'private' ? Styles.text : Styles.displayS} type="link" onClick={() => showStatus(record)}>变更状态</Button>
197
+            &nbsp;&nbsp;
198
+            <Button className={customerType === 'private' ? Styles.text : Styles.displayS} type="link" onClick={() => showGM(record)}>调整归属</Button>
199
+          </AuthButton>
200
+            <br />
201
+          <AuthButton name="admin.customer.recommend.get" noRight={null}>
202
+            <Button className={customerType === 'private' ? Styles.text : Styles.displayS} type="link" onClick={() => toCustomerDateil(record)}>查看详情</Button>
203
+          </AuthButton>
204
+            &nbsp;&nbsp;
205
+          <AuthButton name="admin.mine.taPointsRecords.id.get" noRight={null}>
206
+            <Button className={customerType === 'private' ? Styles.text : Styles.displayS} type="link" onClick={() => showRecord(record)}>积分记录</Button>
207
+          </AuthButton>
201
         </>
208
         </>
202
       ),
209
       ),
203
     },
210
     },
247
           )}
254
           )}
248
         </Form.Item>
255
         </Form.Item>
249
         <Form.Item>
256
         <Form.Item>
250
-          <Button type="primary" htmlType="submit" >
251
-            查询
252
-          </Button>
257
+          <AuthButton name="admin.customer.recommend.get" noRight={null}>
258
+            <Button type="primary" htmlType="submit" >
259
+              查询
260
+            </Button>
261
+          </AuthButton>
253
         </Form.Item>
262
         </Form.Item>
254
       </Form>
263
       </Form>
255
 
264
 
256
       <div style={{ marginTop: '20px', marginBottom: '20px' }}>
265
       <div style={{ marginTop: '20px', marginBottom: '20px' }}>
257
-        <Radio.Group value={customerType} onChange={radioButtonHandleSizeChange} buttonStyle="solid">
258
-          <Radio.Button value="private">私客</Radio.Button>
259
-          <Radio.Button value="public">公客</Radio.Button>
260
-        </Radio.Group>
266
+        <AuthButton name="admin.customer.recommend.get" noRight={null}>
267
+          <Radio.Group value={customerType} onChange={radioButtonHandleSizeChange} buttonStyle="solid">
268
+            <Radio.Button value="private">私客</Radio.Button>
269
+            <Radio.Button value="public">公客</Radio.Button>
270
+          </Radio.Group>
271
+        </AuthButton>
261
       </div>
272
       </div>
262
       <Table dataSource={dataSource.records} columns={columns} pagination={{ total: dataSource.total, onChange }} />
273
       <Table dataSource={dataSource.records} columns={columns} pagination={{ total: dataSource.total, onChange }} />
263
 
274
 

+ 12
- 5
src/pages/customer/independentList/index.jsx 查看文件

5
 import apis from '../../../services/apis';
5
 import apis from '../../../services/apis';
6
 import Styles from './style.less';
6
 import Styles from './style.less';
7
 import { router } from 'umi';
7
 import { router } from 'umi';
8
+import AuthButton from '@/components/AuthButton';
8
 
9
 
9
 
10
 
10
 const { Option } = Select;
11
 const { Option } = Select;
375
           {
376
           {
376
             <>
377
             <>
377
               {/* <sapn style={{ color: 'rgba(239,39,58,1)' }}>查看详细</sapn> */}
378
               {/* <sapn style={{ color: 'rgba(239,39,58,1)' }}>查看详细</sapn> */}
378
-              <a style={{ color: 'rgba(239,39,58,1)' }} onClick={() => Invite(record)}>邀请经纪人</a>
379
+              <AuthButton name="admin.channel.InviteClientsList.get" noRight={null}>
380
+                <a style={{ color: 'rgba(239,39,58,1)' }} onClick={() => Invite(record)}>邀请经纪人</a>
381
+              </AuthButton>
379
               &nbsp;&nbsp;&nbsp;&nbsp;
382
               &nbsp;&nbsp;&nbsp;&nbsp;
380
-              <a style={{ color: 'rgba(239,39,58,1)' }} onClick={() => gM(record)}>推荐客户</a>
383
+              <AuthButton name="admin.customer.recommend.id.get" noRight={null}>
384
+                <a style={{ color: 'rgba(239,39,58,1)' }} onClick={() => gM(record)}>推荐客户</a>
385
+              </AuthButton>
381
             </>
386
             </>
382
           }
387
           }
383
         </>
388
         </>
405
           )}
410
           )}
406
         </Form.Item>
411
         </Form.Item>
407
         <Form.Item>
412
         <Form.Item>
408
-          <Button type="primary" htmlType="submit" className={Styles.SubmitButton}>
409
-            搜索
410
-          </Button>
413
+          <AuthButton name="admin.customer.agents.get" noRight={null}>
414
+            <Button type="primary" htmlType="submit" className={Styles.SubmitButton}>
415
+              搜索
416
+            </Button>
417
+          </AuthButton>
411
         </Form.Item>
418
         </Form.Item>
412
       </Form>
419
       </Form>
413
 
420
 

+ 9
- 4
src/pages/customer/recommendCustomer/index.jsx 查看文件

5
 import apis from '../../../services/apis';
5
 import apis from '../../../services/apis';
6
 import Styles from './style.less';
6
 import Styles from './style.less';
7
 import { router } from 'umi';
7
 import { router } from 'umi';
8
+import AuthButton from '@/components/AuthButton';
8
 
9
 
9
 
10
 
10
 const { Option } = Select;
11
 const { Option } = Select;
130
       render: (_, record) => (
131
       render: (_, record) => (
131
         <>
132
         <>
132
           {
133
           {
133
-            record.verifyStatus === 0 ? <sapn style={{ color: 'rgba(239,39,58,1)' }} onClick={() => toAudit(record.customerId)}>审核</sapn> : ''
134
+            <AuthButton name="admin.customer.recommend.verify.id.put" noRight={null}>
135
+              {record.verifyStatus === 0 ? <sapn style={{ color: 'rgba(239,39,58,1)' }} onClick={() => toAudit(record.customerId)}>审核</sapn> : ''}
136
+            </AuthButton>
134
           }
137
           }
135
         </>
138
         </>
136
       ),
139
       ),
176
           )}
179
           )}
177
         </Form.Item>
180
         </Form.Item>
178
         <Form.Item>
181
         <Form.Item>
179
-          <Button type="primary" htmlType="submit" className={Styles.SubmitButton}>
180
-            搜索
181
-          </Button>
182
+          <AuthButton name="admin.customer.recommend.recommender.get" noRight={null}>
183
+            <Button type="primary" htmlType="submit" className={Styles.SubmitButton}>
184
+              搜索
185
+            </Button>
186
+          </AuthButton>
182
         </Form.Item>
187
         </Form.Item>
183
       </Form>
188
       </Form>
184
 
189
 

+ 6
- 3
src/pages/customer/report/index.jsx 查看文件

5
 import apis from '../../../services/apis';
5
 import apis from '../../../services/apis';
6
 import Styles from './style.less';
6
 import Styles from './style.less';
7
 import BuildSelect from '../../../components/SelectButton/BuildSelect'
7
 import BuildSelect from '../../../components/SelectButton/BuildSelect'
8
+import AuthButton from '@/components/AuthButton';
8
 
9
 
9
 
10
 
10
 const { Option } = Select;
11
 const { Option } = Select;
153
           )}
154
           )}
154
         </Form.Item>
155
         </Form.Item>
155
         <Form.Item>
156
         <Form.Item>
156
-          <Button type="primary" htmlType="submit">
157
-            搜索
158
-          </Button>
157
+          <AuthButton name="admin.customer.recommend.report.get" noRight={null}>
158
+            <Button type="primary" htmlType="submit">
159
+              搜索
160
+            </Button>
161
+          </AuthButton>
159
         </Form.Item>
162
         </Form.Item>
160
       </Form>
163
       </Form>
161
       <Table style={{marginTop:'40px'}} dataSource={dataSource.records} columns={columns} pagination={{ total: dataSource.total, onChange }} />
164
       <Table style={{marginTop:'40px'}} dataSource={dataSource.records} columns={columns} pagination={{ total: dataSource.total, onChange }} />

+ 21
- 5
src/pages/integralMall/GoodsList.jsx 查看文件

6
 import BuildSelect from '../../components/SelectButton/BuildSelect'
6
 import BuildSelect from '../../components/SelectButton/BuildSelect'
7
 import apis from '../../services/apis';
7
 import apis from '../../services/apis';
8
 import request from '../../utils/request'
8
 import request from '../../utils/request'
9
+import AuthButton from '@/components/AuthButton';
9
 
10
 
10
 const { Option } = Select;
11
 const { Option } = Select;
11
 
12
 
123
       dataIndex: 'handle',
124
       dataIndex: 'handle',
124
       key: 'handle',
125
       key: 'handle',
125
       align: 'center',
126
       align: 'center',
126
-      render: (x, row) => <><span style={{ color: '#EF273A', marginRight: '20px' }} onClick={changeGoodsStatus(row)}>{row.status == 1 ? '下架' : '上架'}<Icon type="shopping-cart" className={styles.shoppingCart} />
127
-                            </span><span style={{ color: '#FF925C' }} onClick={toEditGoods(row.goodsId)}>编辑<Icon type="form" className={styles.edit} /></span></>,
127
+      render: (x, row) => (
128
+        <>
129
+          <AuthButton name="admin.taGoods.change.put" noRight={null}>
130
+            <span style={{ color: '#EF273A', marginRight: '20px' }} onClick={changeGoodsStatus(row)}>
131
+              {row.status == 1 ? '下架' : '上架'}
132
+              {<Icon type="shopping-cart" className={styles.shoppingCart} />}
133
+            </span>
134
+          </AuthButton>
135
+          <AuthButton name="admin.taGoods.put" noRight={null}>
136
+            <span style={{ color: '#FF925C' }} onClick={toEditGoods(row.goodsId)}>
137
+              编辑<Icon type="form" className={styles.edit} />
138
+            </span>
139
+          </AuthButton>
140
+        </>
141
+      ),
128
     },
142
     },
129
   ];
143
   ];
130
 
144
 
171
           )}
185
           )}
172
         </Form.Item>
186
         </Form.Item>
173
         <Form.Item>
187
         <Form.Item>
174
-          <Button type="primary" htmlType="submit" className={styles.searchBtn}>
175
-            搜索
176
-          </Button>
188
+          <AuthButton name="admin.taGoods.get" noRight={null}>
189
+            <Button type="primary" htmlType="submit" className={styles.searchBtn}>
190
+              搜索
191
+            </Button>
192
+          </AuthButton>
177
         </Form.Item>
193
         </Form.Item>
178
       </Form>
194
       </Form>
179
       <Button type="danger" className={styles.addBtn} onClick={toEditGoods()}>新增</Button>
195
       <Button type="danger" className={styles.addBtn} onClick={toEditGoods()}>新增</Button>

+ 16
- 3
src/pages/integralMall/achieve.jsx 查看文件

6
 import moment from 'moment';
6
 import moment from 'moment';
7
 import BuildSelect from '../../components/SelectButton/BuildSelect'
7
 import BuildSelect from '../../components/SelectButton/BuildSelect'
8
 import apis from '../../services/apis';
8
 import apis from '../../services/apis';
9
-import request from '../../utils/request'
9
+import request from '../../utils/request';
10
+import AuthButton from '@/components/AuthButton';
10
 
11
 
11
 const { TabPane } = Tabs;
12
 const { TabPane } = Tabs;
12
 
13
 
89
       dataIndex: 'handle',
90
       dataIndex: 'handle',
90
       key: 'handle',
91
       key: 'handle',
91
       align: 'center',
92
       align: 'center',
92
-      render: (x,row) => <><span style={{ color: '#EF273A', marginRight: '20px' }} onClick={changeStatus(row)}>{row.status == 1?'停用':'启用'}<Icon type="stop" className={styles.shoppingCart} /></span>
93
-                      <span style={{ color: '#FF925C' }}>{row.buildingId != null ? '编辑'`${<Icon type="form" className={styles.edit} />}` : ''}</span></>,
93
+      render: (x,row) => (
94
+        <>
95
+          <AuthButton name="admin.tdPointsRules.change.put" noRight={null}>
96
+            <span style={{ color: '#EF273A', marginRight: '20px' }} onClick={changeStatus(row)}>
97
+              {row.status == 1?'停用':'启用'}<Icon type="stop" className={styles.shoppingCart} />
98
+            </span>
99
+          </AuthButton>
100
+          <AuthButton name="admin.tdPointsRules.put" noRight={null}>
101
+            <span style={{ color: '#FF925C' }}>
102
+              {row.buildingId != null ? '编辑'`${<Icon type="form" className={styles.edit} />}` : ''}
103
+            </span>
104
+          </AuthButton>
105
+        </>
106
+      ),
94
     },
107
     },
95
   ];
108
   ];
96
 
109
 

+ 31
- 20
src/pages/staff/list/RoleList.jsx 查看文件

7
 import { Card, Avatar } from 'antd';
7
 import { Card, Avatar } from 'antd';
8
 import request from '../../../utils/request'
8
 import request from '../../../utils/request'
9
 import Styles from './style.less';
9
 import Styles from './style.less';
10
+import apis from '../../../services/apis';
10
 
11
 
11
 const header = props => {
12
 const header = props => {
12
 // function confirm(id) {
13
 // function confirm(id) {
40
 // 初始化角色
41
 // 初始化角色
41
  useEffect(() => {
42
  useEffect(() => {
42
    localStorage.removeItem('value');
43
    localStorage.removeItem('value');
43
-    getList({ pageNum: 1, pageSize: 100 })
44
+    getRoleList({ pageNum: 1, pageSize: 100 })
44
  }, [])
45
  }, [])
45
 
46
 
46
- function getList(params) {
47
-   request({
48
-     url: '/api/admin/taRole',
49
-     method: 'GET',
50
-     params: { ...params },
51
- // eslint-disable-next-line no-shadow
52
- }).then(data => {
53
-     console.log(data)
54
-     setData(data)
55
- })
56
- }
57
-// 是否停用
58
-function stop(id) {
59
-  request({
60
-    url: `/api/admin/taRole/stop/${id}`,
61
-    method: 'PUT',
62
-// eslint-disable-next-line no-shadow
63
-}).then(data => {
64
-  getList({ pageNum: 1, pageSize: 100 })
47
+//  function getRoleList(params) {
48
+//    request({
49
+//      url: '/api/admin/taRole',
50
+//      method: 'GET',
51
+//      params: { ...params },
52
+//  // eslint-disable-next-line no-shadow
53
+//  }).then(data => {
54
+//      console.log(data)
55
+//      setData(data)
56
+//  })
57
+//  }
58
+
59
+ function getRoleList(params) {
60
+  request({ ...apis.role.getRoleList, params: { ...params } }).then((data) => {
61
+    setData(data)
62
+}).catch((err) => {
63
+    console.log(err)
64
+    message.info(err.msg || err.message)
65
+})
66
+}
67
+
68
+
69
+function stop(ids) {
70
+  request({ ...apis.role.stop, urlData: { id: ids } }).then((data) => {
71
+    getRoleList({ pageNum: 1, pageSize: 100 })
72
+}).catch((err) => {
73
+    console.log(err)
74
+    message.info(err.msg || err.message)
65
 })
75
 })
66
 }
76
 }
77
+
67
 const dataSource = [
78
 const dataSource = [
68
   {
79
   {
69
     name: '置业顾问',
80
     name: '置业顾问',

+ 106
- 102
src/pages/staff/list/addRole.jsx 查看文件

6
 import channels from './channelList.less';
6
 import channels from './channelList.less';
7
 import { resolve, join } from 'path';
7
 import { resolve, join } from 'path';
8
 import router from 'umi/router';
8
 import router from 'umi/router';
9
+import apis from '../../../services/apis';
9
 
10
 
10
 const { TextArea } = Input;
11
 const { TextArea } = Input;
11
 
12
 
17
  * @returns
18
  * @returns
18
  */
19
  */
19
 const Poster = props => {
20
 const Poster = props => {
20
-  console.log('props,props', props.user.currentUser)
21
   const userMenus = props.user.currentUser.menus;
21
   const userMenus = props.user.currentUser.menus;
22
   const userBtns = props.user.currentUser.buttons;
22
   const userBtns = props.user.currentUser.buttons;
23
 
23
 
30
   const [dataButtonId, setDataButtonId] = useState([])
30
   const [dataButtonId, setDataButtonId] = useState([])
31
 
31
 
32
   useEffect(() => {
32
   useEffect(() => {
33
-    // 新增和编辑用一个页面,判断新增是否为0和null
33
+    // 新增和编辑用一个页面
34
     if (props.location.query) {
34
     if (props.location.query) {
35
       const { id } = props.location.query
35
       const { id } = props.location.query
36
       if (id) {
36
       if (id) {
41
     buttonList({ pageNum: 1, pageSize: 100 })
41
     buttonList({ pageNum: 1, pageSize: 100 })
42
   }, [])
42
   }, [])
43
   // 当前所有的菜单
43
   // 当前所有的菜单
44
+  // function menuList(params) {
45
+  //   request({
46
+  //     url: '/api/admin/menuList',
47
+  //     method: 'GET',
48
+  //     params: { ...params },
49
+  //     // eslint-disable-next-line no-shadow
50
+  //   }).then(data => {
51
+  //     setData(data)
52
+  //   })
53
+  // }
44
   function menuList(params) {
54
   function menuList(params) {
45
-    request({
46
-      url: '/api/admin/menuList',
47
-      method: 'GET',
48
-      params: { ...params },
49
-      // eslint-disable-next-line no-shadow
50
-    }).then(data => {
55
+    request({ ...apis.role.menuList, params: { ...params } }).then((data) => {
51
       setData(data)
56
       setData(data)
52
-    })
57
+  }).catch((err) => {
58
+      console.log(err)
59
+      message.info(err.msg || err.message)
60
+  })
53
   }
61
   }
62
+
54
   // 所有按钮
63
   // 所有按钮
64
+  // function buttonList(params) {
65
+  //   request({
66
+  //     url: '/api/admin/buttonList',
67
+  //     method: 'GET',
68
+  //     params: { ...params },
69
+  //     // eslint-disable-next-line no-shadow
70
+  //   }).then(data => {
71
+  //     console.log(data)
72
+  //     setBuutonDate(data)
73
+  //   })
74
+  // }
75
+
55
   function buttonList(params) {
76
   function buttonList(params) {
56
-    request({
57
-      url: '/api/admin/buttonList',
58
-      method: 'GET',
59
-      params: { ...params },
60
-      // eslint-disable-next-line no-shadow
61
-    }).then(data => {
62
-      console.log(data)
77
+    request({ ...apis.role.buttonList, params: { ...params } }).then((data) => {
63
       setBuutonDate(data)
78
       setBuutonDate(data)
64
-    })
79
+  }).catch((err) => {
80
+      console.log(err)
81
+  })
65
   }
82
   }
66
 
83
 
84
+
67
   // 根据角色id查询当前的菜单及其按钮
85
   // 根据角色id查询当前的菜单及其按钮
68
-  function buttonAndMenuList(params, id) {
69
-    console.log('id: ', id)
70
-    request({
71
-      url: `/api/admin/taRole/details/${id}`,
72
-      method: 'GET',
73
-      params: { ...params },
74
-      // eslint-disable-next-line no-shadow
75
-    }).then(data => {
76
-      console.log('data.roleName: ', data)
86
+  // function buttonAndMenuList(params, id) {
87
+  //   console.log('id: ', id)
88
+  //   request({
89
+  //     url: `/api/admin/taRole/details/${id}`,
90
+  //     method: 'GET',
91
+  //     params: { ...params },
92
+  //     // eslint-disable-next-line no-shadow
93
+  //   }).then(data => {
94
+  //     console.log('data.roleName: ', data)
95
+  //     props.form.setFieldsValue({ roleName: data.roleName })
96
+  //     console.log(data)
97
+  //     setData(data)
98
+
99
+  //     // 获取所有的权限Id
100
+  //     if (data.sysMenuList) {
101
+  //       setDataMenuId(data.sysMenuList.map(item => item.menuId))
102
+  //       setDataButtonId((data.sysMenuList.map(item => item.sysButtonInMenu && item.sysButtonInMenu.map(btn => btn.btnId).join(',')).filter(f => f !== '').join(',').split(',')).map(a => parseInt(a)))
103
+  //     }
104
+  //   })
105
+  // }
106
+
107
+  function buttonAndMenuList(params, ids) {
108
+    request({ ...apis.role.buttonAndMenuList, urlData: { id: ids }, params: { ...params } }).then(data => {
77
       props.form.setFieldsValue({ roleName: data.roleName })
109
       props.form.setFieldsValue({ roleName: data.roleName })
78
       console.log(data)
110
       console.log(data)
79
       setData(data)
111
       setData(data)
80
 
112
 
81
       // 获取所有的权限Id
113
       // 获取所有的权限Id
82
-      setDataMenuId(data.sysMenuList.map(item => item.menuId))
83
-      setDataButtonId((data.sysMenuList.map(item => item.sysButtonInMenu.map(btn => btn.btnId).join(',')).filter(f => f !== '').join(',').split(',')).map(a => parseInt(a)))
84
-    })
85
-  }
86
-  // 添加角色
87
-  function addRole(params) {
88
-    request({
89
-      url: '/api/admin/taRole/',
90
-      method: 'GET',
91
-      params: { ...params },
92
-      // eslint-disable-next-line no-shadow
93
-    }).then(data => {
94
-      console.log(data)
95
-      setData(data)
96
-    })
114
+      if (data.sysMenuList) {
115
+        setDataMenuId(data.sysMenuList.map(item => item.menuId))
116
+        setDataButtonId((data.sysMenuList.map(item => item.sysButtonInMenu && item.sysButtonInMenu.map(btn => btn.btnId).join(',')).filter(f => f !== '').join(',').split(',')).map(a => parseInt(a)))
117
+      }
118
+  }).catch((err) => {
119
+      console.log(err)
120
+      message.info(err.msg || err.message)
121
+  })
97
   }
122
   }
98
 
123
 
99
-
100
   // const [menus, setMenus] = useState([]);
124
   // const [menus, setMenus] = useState([]);
101
   // 判断menus是否有值
125
   // 判断menus是否有值
102
   const [menus, setMenus] = useState([]);
126
   const [menus, setMenus] = useState([]);
103
-  const addMenus = m => {
104
-    const newMenus = [...menus, m]
105
-    setMenus([...menus, m])
106
-  };
127
+
128
+  const addMenus = m => setMenus([...menus, m])
107
   const delMenus = m => setMenus(menus.filter(x => x.menuId !== m.menuId));
129
   const delMenus = m => setMenus(menus.filter(x => x.menuId !== m.menuId));
130
+
108
   const handleMenuChange = m => e => {
131
   const handleMenuChange = m => e => {
109
     if (e.target.checked) {
132
     if (e.target.checked) {
110
       setDataMenuId(dataMenuId.concat(m.menuId))
133
       setDataMenuId(dataMenuId.concat(m.menuId))
111
       addMenus(m)
134
       addMenus(m)
112
     } else {
135
     } else {
113
-      setDataMenuId([m.menuId])
136
+      setDataMenuId(dataMenuId.filter(item => item !== m.menuId));
114
       delMenus(m)
137
       delMenus(m)
115
     }
138
     }
116
-    console.log('dataMenuId', dataMenuId)
117
-    console.log('menus', menus)
118
   }
139
   }
119
 
140
 
120
   const [but, setBut] = useState([]);
141
   const [but, setBut] = useState([]);
121
   // 判断menus是否有值
142
   // 判断menus是否有值
122
-  const addBut = m => setBut([...but, m]);
143
+  const addBut = m => setBut([...but, m])
123
   const delBut = m => setBut(but.filter(x => x.menuId !== m.menuId));
144
   const delBut = m => setBut(but.filter(x => x.menuId !== m.menuId));
124
   const handleButChange = m => e => {
145
   const handleButChange = m => e => {
125
-    console.log('e', m)
126
     if (e.target.checked) {
146
     if (e.target.checked) {
147
+      setDataButtonId(dataButtonId.concat(m.btnId))
127
       addBut(m)
148
       addBut(m)
128
     } else {
149
     } else {
150
+      setDataButtonId(dataButtonId.filter(item => item !== m.btnId));
129
       delBut(m)
151
       delBut(m)
130
     }
152
     }
131
   }
153
   }
138
     textAlign: 'left',
160
     textAlign: 'left',
139
     height: '72px',
161
     height: '72px',
140
   };
162
   };
141
-  // 添加菜单
142
-  function addMenuList() {
143
-    request({
144
-      url: '/api/admin/updateAuthMenu',
145
-      method: 'PUT',
146
-      data: { sysMenu: menus },
147
-      // eslint-disable-next-line no-shadow
148
-    }).then(data => {
149
-      console.log(data)
150
-    })
151
-  }
152
-
153
-  // 添加按钮
154
-  function addButt() {
155
-    request({
156
-      url: '/api/admin/updateAuthMenu',
157
-      method: 'PUT',
158
-      data: { sysMenu: but },
159
-      // eslint-disable-next-line no-shadow
160
-    }).then(data => {
161
-      console.log(data)
162
-    })
163
-  }
164
 
163
 
165
-  // 添加按钮
166
-  function editAndAddRole() {
167
-    request({
168
-      url: '/admin/editAndAddRole/{id}',
169
-      method: 'PUT',
170
-      data: { sysMenu: but },
171
-      // eslint-disable-next-line no-shadow
172
-    }).then(data => {
173
-      console.log(data)
174
-    })
175
-  }
176
-
177
-  function toRoleList(roleId) {
164
+  function toRoleList() {
178
     router.push({
165
     router.push({
179
       pathname: '/staff/RoleList',
166
       pathname: '/staff/RoleList',
180
     });
167
     });
181
   }
168
   }
169
+  // function updateAuthMenu(params) {
170
+  //   request({
171
+  //     url: '/api/admin/updateAuthMenu',
172
+  //     method: 'POST',
173
+  //     data: { ...params },
174
+  //     // eslint-disable-next-line no-shadow
175
+  //   }).then(data => {
176
+  //     toRoleList()
177
+  //   })
178
+  // }
179
+
180
+  function updateAuthMenu(data) {
181
+    request({ ...apis.role.updateAuthMenu, data: { ...data } }).then((data) => {
182
+      toRoleList()
183
+  }).catch((err) => {
184
+      console.log(err)
185
+  })
186
+  }
187
+
182
 
188
 
183
   function handleSubmit(e) {
189
   function handleSubmit(e) {
184
     e.preventDefault();
190
     e.preventDefault();
185
     props.form.validateFields((err, values) => {
191
     props.form.validateFields((err, values) => {
186
-      console.log('values', values)
187
-      // 保存菜单
188
-      // addMenuList()
189
-      // setm
190
-      const sumitMenu = [...data.sysMenuList, ...menus]
191
-      request({
192
-        url: '/api/admin/updateAuthMenu',
193
-        method: 'POST',
194
-        data: { sysMenu: sumitMenu, name: values.roleName, id: props.location.query.id },
195
-        // eslint-disable-next-line no-shadow
196
-      }).then(data => {
197
-        toRoleList()
198
-      })
192
+      if (props.location.query.id !== undefined) {
193
+        console.log('menus', menus)
194
+      
195
+        const sumitMenu = userMenus.filter(item => dataMenuId.includes(item.menuId))
196
+        const sumitBtn = userMenus.filter(item => dataButtonId.includes(item.btnId))
197
+        // console.log('sumitMenu', sumitMenu)
198
+        // const sumitBut = data.sysMenuList[0].sysButtonInMenu.concat(but)
199
+        updateAuthMenu({ sysMenu: sumitMenu, name: values.roleName, id: props.location.query.id, sysButton: sumitBtn })
200
+      } else {
201
+        updateAuthMenu({ sysMenu: menus, name: values.roleName, id: props.location.query.id, sysButton: but })
202
+        }
199
     });
203
     });
200
   }
204
   }
201
   const { getFieldDecorator } = props.form;
205
   const { getFieldDecorator } = props.form;
205
         <Form labelCol={{ span: 7 }} wrapperCol={{ span: 12 }} onSubmit={handleSubmit}>
209
         <Form labelCol={{ span: 7 }} wrapperCol={{ span: 12 }} onSubmit={handleSubmit}>
206
           <Form.Item label="角色名称">
210
           <Form.Item label="角色名称">
207
             {getFieldDecorator('roleName', {
211
             {getFieldDecorator('roleName', {
208
-              rules: [{ required: true, message: '请输入渠道名称' }],
212
+              rules: [{ required: true, message: '请输入角色名称' }],
209
             })(<Input className={channels.inpuit} />)}
213
             })(<Input className={channels.inpuit} />)}
210
 
214
 
211
           </Form.Item>
215
           </Form.Item>
249
             <Button type="primary" htmlType="submit">
253
             <Button type="primary" htmlType="submit">
250
               保存
254
               保存
251
           </Button>
255
           </Button>
252
-            <Button className={channels.formButton} htmlType="submit">
256
+            <Button className={channels.formButton} htmlType="submit" onChange = {toRoleList}>
253
               取消
257
               取消
254
           </Button>
258
           </Button>
255
           </Form.Item>
259
           </Form.Item>

+ 153
- 6
src/services/apis.js 查看文件

15
     current: {
15
     current: {
16
       method: 'GET',
16
       method: 'GET',
17
       url: `${prefix}/taUser/current`,
17
       url: `${prefix}/taUser/current`,
18
+      action: 'admin.taUser.current.get',
18
     },
19
     },
19
     signin: {
20
     signin: {
20
       method: 'POST',
21
       method: 'POST',
21
       url: `${prefix}/taUser/signin`,
22
       url: `${prefix}/taUser/signin`,
22
-      login: true
23
+      login: true,
24
+      action: 'admin.taUser.signin.post',
23
     },
25
     },
24
     signout: {
26
     signout: {
25
       method: 'POST',
27
       method: 'POST',
31
     getList: {
33
     getList: {
32
       method: 'GET',
34
       method: 'GET',
33
       url: `${prefix}/buildinglist`,
35
       url: `${prefix}/buildinglist`,
36
+      action: 'admin.buildinglist.get',
34
     },
37
     },
35
     updateStatus: {
38
     updateStatus: {
36
       method: 'PUT',
39
       method: 'PUT',
37
       url: `${prefix}/building/update/status`,
40
       url: `${prefix}/building/update/status`,
41
+      action: 'admin.building.update.status.put',
38
     },
42
     },
39
     addBuilding: {
43
     addBuilding: {
40
       method: 'POST',
44
       method: 'POST',
41
       url: `${prefix}/building/add`,
45
       url: `${prefix}/building/add`,
46
+      action: 'admin.building.add.post',
42
     },
47
     },
43
     updateBuilding: {
48
     updateBuilding: {
44
       method: 'PUT',
49
       method: 'PUT',
45
       url: `${prefix}/building/update`,
50
       url: `${prefix}/building/update`,
51
+      action: 'admin.building.update.put',
46
     },
52
     },
47
     buildingGetById: {
53
     buildingGetById: {
48
       method: 'GET',
54
       method: 'GET',
49
       url: `${prefix}/buildingSelectId/id`,
55
       url: `${prefix}/buildingSelectId/id`,
56
+      action: 'admin.buildingSelectId.id.get',
50
     },
57
     },
51
     deleteBuilding: {
58
     deleteBuilding: {
52
       method: 'DELETE',
59
       method: 'DELETE',
53
       url: `${prefix}/building/delete/id`,
60
       url: `${prefix}/building/delete/id`,
61
+      action: 'admin.building.delete.id.delete',
54
     },
62
     },
55
     buildingApartment: {
63
     buildingApartment: {
56
       method: 'GET',
64
       method: 'GET',
57
       url: `${prefix}/buildingApartment/buildingId/id`,
65
       url: `${prefix}/buildingApartment/buildingId/id`,
66
+      action: 'admin.buildingApartment.buildingId.id.get',
58
     },
67
     },
59
     buildingApartmentGetById: {
68
     buildingApartmentGetById: {
60
       method: 'GET',
69
       method: 'GET',
61
       url: `${prefix}/buildingApartment/id`,
70
       url: `${prefix}/buildingApartment/id`,
71
+      action: 'admin.buildingApartment.id.get',
62
     },
72
     },
63
     buildingApartmentUpdate: {
73
     buildingApartmentUpdate: {
64
       method: 'PUT',
74
       method: 'PUT',
65
       url: `${prefix}/buildingApartment/update`,
75
       url: `${prefix}/buildingApartment/update`,
76
+      action: 'admin.buildingApartment.update.put',
66
     },
77
     },
67
     buildingApartmentAdd: {
78
     buildingApartmentAdd: {
68
       method: 'POST',
79
       method: 'POST',
69
       url: `${prefix}/buildingApartment/add`,
80
       url: `${prefix}/buildingApartment/add`,
81
+      action: 'admin.buildingApartment.add.post',
70
     },
82
     },
71
     buildingApartmentDelete: {
83
     buildingApartmentDelete: {
72
       method: 'DELETE',
84
       method: 'DELETE',
73
       url: `${prefix}/apartment/deleted/id`,
85
       url: `${prefix}/apartment/deleted/id`,
86
+      action: 'admin.apartment.deleted.id.delete',
74
     },
87
     },
75
   },
88
   },
76
   buildingType: {
89
   buildingType: {
77
     getList: {
90
     getList: {
78
       method: 'GET',
91
       method: 'GET',
79
       url: `${prefix}/tdBuildingType`,
92
       url: `${prefix}/tdBuildingType`,
93
+      action: 'admin.tdBuildingType.get',
80
     },
94
     },
81
     delete: {
95
     delete: {
82
       method: 'DELETE',
96
       method: 'DELETE',
83
       url: `${prefix}/tdBuildingType/id`,
97
       url: `${prefix}/tdBuildingType/id`,
98
+      action: 'admin.tdBuildingType.id.delete',
84
     },
99
     },
85
     update: {
100
     update: {
86
       method: 'PUT',
101
       method: 'PUT',
87
       url: `${prefix}/tdBuildingType/id`,
102
       url: `${prefix}/tdBuildingType/id`,
103
+      action: 'admin.tdBuildingType.id.put',
88
     },
104
     },
89
     add: {
105
     add: {
90
       method: 'POST',
106
       method: 'POST',
91
       url: `${prefix}/tdBuildingType`,
107
       url: `${prefix}/tdBuildingType`,
108
+      action: 'admin.tdBuildingType.post',
92
     },
109
     },
93
     getById: {
110
     getById: {
94
       method: 'GET',
111
       method: 'GET',
95
       url: `${prefix}/tdBuildingType/id`,
112
       url: `${prefix}/tdBuildingType/id`,
113
+      action: 'admin.tdBuildingType.id.get',
96
     },
114
     },
97
   },
115
   },
98
   news: {
116
   news: {
99
     getList: {
117
     getList: {
100
       method: 'GET',
118
       method: 'GET',
101
       url: `${prefix}/taNews`,
119
       url: `${prefix}/taNews`,
102
-      action: '/api/admin/taNews'
120
+      action: 'admin.taNews.get',
103
     },
121
     },
104
   },
122
   },
105
   customer: {
123
   customer: {
106
     drift: {
124
     drift: {
107
       method: 'GET',
125
       method: 'GET',
108
       url: `${prefix}/customer/recommend/drift`,
126
       url: `${prefix}/customer/recommend/drift`,
127
+      action: 'admin.customer.recommend.drift.get',
109
     },
128
     },
110
     report: {
129
     report: {
111
       method: 'GET',
130
       method: 'GET',
112
       url: `${prefix}/customer/recommend/report`,
131
       url: `${prefix}/customer/recommend/report`,
132
+      action: 'admin.customer.recommend.report.get',
113
     },
133
     },
114
     recommender: {
134
     recommender: {
115
       method: 'GET',
135
       method: 'GET',
116
       url: `${prefix}/customer/recommend/recommender`,
136
       url: `${prefix}/customer/recommend/recommender`,
137
+      action: 'admin.customer.recommend.recommender.get',
117
     },
138
     },
118
     auto: {
139
     auto: {
119
       method: 'PUT',
140
       method: 'PUT',
120
       url: `${prefix}/customer/recommend/verify/id`,
141
       url: `${prefix}/customer/recommend/verify/id`,
142
+      action: 'admin.customer.recommend.verify.id.put',
121
     },
143
     },
122
     recommendGetById: {
144
     recommendGetById: {
123
       method: 'GET',
145
       method: 'GET',
124
       url: `${prefix}/customer/recommend/getById/id`,
146
       url: `${prefix}/customer/recommend/getById/id`,
147
+      action: 'admin.customer.recommend.getById.id.get',
125
     },
148
     },
126
     agents: {
149
     agents: {
127
       method: 'GET',
150
       method: 'GET',
128
       url: `${prefix}/customer/agents`,
151
       url: `${prefix}/customer/agents`,
152
+      action: 'admin.customer.agents.get',
129
     },
153
     },
130
     customerRecommend: {
154
     customerRecommend: {
131
       method: 'GET',
155
       method: 'GET',
132
       url: `${prefix}/customer/recommend`,
156
       url: `${prefix}/customer/recommend`,
157
+      action: 'admin.customer.recommend.get',
133
     },
158
     },
134
     consultant: {
159
     consultant: {
135
       method: 'GET',
160
       method: 'GET',
136
       url: `${prefix}/consultant`,
161
       url: `${prefix}/consultant`,
162
+      action: 'admin.consultant.get',
137
     },
163
     },
138
     recommendEdit: {
164
     recommendEdit: {
139
       method: 'PUT',
165
       method: 'PUT',
140
       url: `${prefix}/customer/recommend/edit/id`,
166
       url: `${prefix}/customer/recommend/edit/id`,
167
+      action: 'admin.customer.recommend.edit.id.put',
141
     },
168
     },
142
     taPointsRecords: {
169
     taPointsRecords: {
143
       method: 'GET',
170
       method: 'GET',
144
       url: `${prefix}/mine/taPointsRecords/id`,
171
       url: `${prefix}/mine/taPointsRecords/id`,
172
+      action: 'admin.mine.taPointsRecords.id.get',
145
     },
173
     },
146
     recommend: {
174
     recommend: {
147
       method: 'GET',
175
       method: 'GET',
148
       url: `${prefix}/customer/recommend/id`,
176
       url: `${prefix}/customer/recommend/id`,
177
+      action: 'admin.customer.recommend.id.get',
149
     },
178
     },
150
     InviteClientsList: {
179
     InviteClientsList: {
151
       method: 'GET',
180
       method: 'GET',
152
       url: `${prefix}/channel/InviteClientsList`,
181
       url: `${prefix}/channel/InviteClientsList`,
182
+      action: 'admin.channel.InviteClientsList.get',
153
     },
183
     },
154
     CustomerRecommendGet: {
184
     CustomerRecommendGet: {
155
       method: 'GET',
185
       method: 'GET',
156
       url: `${prefix}/customer/recommend/get/id`,
186
       url: `${prefix}/customer/recommend/get/id`,
187
+      action: 'admin.customer.recommend.get.id.get',
157
     },
188
     },
158
   },
189
   },
159
   indexEcharts: {
190
   indexEcharts: {
163
     },
194
     },
164
     userCity: {
195
     userCity: {
165
       method:'get',
196
       method:'get',
166
-      url: `${prefix}/selectCityUser`
197
+      url: `${prefix}/selectCityUser`,
198
+      action: 'admin.selectCityUser.get'
167
     },
199
     },
168
 
200
 
169
   },
201
   },
171
       list: {
203
       list: {
172
         method: 'GET',
204
         method: 'GET',
173
         url: `${prefix}/iBuildingDynamicList`,
205
         url: `${prefix}/iBuildingDynamicList`,
206
+        action: 'admin.iBuildingDynamicList.get',
174
       },
207
       },
175
       weight: {
208
       weight: {
176
         method: 'PUT',
209
         method: 'PUT',
177
         url: `${prefix}/buildingDynamic/weight`,
210
         url: `${prefix}/buildingDynamic/weight`,
211
+        action: 'admin.buildingDynamic.weight.put',
178
       },
212
       },
179
       cancel: {
213
       cancel: {
180
         method: 'PUT',
214
         method: 'PUT',
181
         url: `${prefix}/buildingDynamic/cancel/:id`,
215
         url: `${prefix}/buildingDynamic/cancel/:id`,
216
+        action: 'admin.buildingDynamic.cancel.dynamicId.put'
182
       },
217
       },
183
       send: {
218
       send: {
184
         url: `${prefix}/buildingDynamic/send/:id`,
219
         url: `${prefix}/buildingDynamic/send/:id`,
185
         method: 'PUT',
220
         method: 'PUT',
221
+        action: 'admin.buildingDynamic.send.dynamicId.put'
186
       },
222
       },
187
       finish: {
223
       finish: {
188
         url: `${prefix}/buildingDynamic/finish`,
224
         url: `${prefix}/buildingDynamic/finish`,
189
         method: 'PUT',
225
         method: 'PUT',
226
+        action: 'admin.buildingDynamic.finish.put'
190
       },
227
       },
191
       details: {
228
       details: {
192
         url: `${prefix}/buildingDynamic/Details`,
229
         url: `${prefix}/buildingDynamic/Details`,
193
         method: 'GET',
230
         method: 'GET',
231
+        action: 'admin.buildingDynamic.Details.get',
194
       },
232
       },
195
       update: {
233
       update: {
196
         url: `${prefix}/buildingDynamic/update`,
234
         url: `${prefix}/buildingDynamic/update`,
197
         method: 'PUT',
235
         method: 'PUT',
236
+        action: 'admin.buildingDynamic.update.put',
198
       },
237
       },
199
       add: {
238
       add: {
200
         url: `${prefix}/buildingDynamic/add`,
239
         url: `${prefix}/buildingDynamic/add`,
201
         method: 'POST',
240
         method: 'POST',
241
+        action: 'admin.buildingDynamic.add.post',
202
       },
242
       },
203
       poster: {
243
       poster: {
204
         url: `${prefix}/poster`,
244
         url: `${prefix}/poster`,
205
         method: 'GET',
245
         method: 'GET',
246
+        action: 'admin.poster.get',
206
       },
247
       },
207
       updatePoster: {
248
       updatePoster: {
208
         url: `${prefix}/poster/:id`,
249
         url: `${prefix}/poster/:id`,
209
         method: 'PUT',
250
         method: 'PUT',
251
+        action: 'admin.poster.id.put',
210
       },
252
       },
211
       addPoster: {
253
       addPoster: {
212
         url: `${prefix}/poster`,
254
         url: `${prefix}/poster`,
213
         method: 'POST',
255
         method: 'POST',
256
+        action: 'admin.poster.post',
214
       },
257
       },
215
       shareContent: {
258
       shareContent: {
216
         url: `${prefix}/shareContent`,
259
         url: `${prefix}/shareContent`,
217
         method: 'GET',
260
         method: 'GET',
261
+        action: 'admin.shareContent.get',
218
       },
262
       },
219
       updateShareContent: {
263
       updateShareContent: {
220
         url: `${prefix}/shareContent/:id`,
264
         url: `${prefix}/shareContent/:id`,
221
         method: 'PUT',
265
         method: 'PUT',
266
+        action: 'admin.shareContent.id.put',
222
       },
267
       },
223
       addShareContent: {
268
       addShareContent: {
224
         url: `${prefix}/shareContent`,
269
         url: `${prefix}/shareContent`,
225
         method: 'POST',
270
         method: 'POST',
271
+        action: 'admin.shareContent.post',
226
       },
272
       },
227
       signList: {
273
       signList: {
228
         url: `${prefix}/SignList`,
274
         url: `${prefix}/SignList`,
229
         method: 'GET',
275
         method: 'GET',
276
+        action: 'admin.SignList.get',
230
       }
277
       }
231
   },
278
   },
232
   integralMall: {
279
   integralMall: {
233
     tdPointsRules: {
280
     tdPointsRules: {
234
       url: `${prefix}/tdPointsRules`,
281
       url: `${prefix}/tdPointsRules`,
235
       method: 'GET',
282
       method: 'GET',
283
+      action: 'admin.tdPointsRules.get',
236
     },
284
     },
237
     change: {
285
     change: {
238
       url: `${prefix}/tdPointsRules/change`,
286
       url: `${prefix}/tdPointsRules/change`,
239
       method: 'PUT',
287
       method: 'PUT',
288
+      action: 'admin.tdPointsRules.change.put',
240
     },
289
     },
241
     taGoods: {
290
     taGoods: {
242
       url: `${prefix}/taGoods/:id`,
291
       url: `${prefix}/taGoods/:id`,
243
       method: 'GET',
292
       method: 'GET',
293
+      action: 'admin.taGoods.id.get',
244
     },
294
     },
245
     updateTaGoods: {
295
     updateTaGoods: {
246
       url: `${prefix}/taGoods`,
296
       url: `${prefix}/taGoods`,
247
       method: 'PUT',
297
       method: 'PUT',
298
+      action: 'admin.taGoods.put',
248
     },
299
     },
249
     addTaGoods: {
300
     addTaGoods: {
250
       url: `${prefix}/taGoods/add`,
301
       url: `${prefix}/taGoods/add`,
251
       method: 'POST',
302
       method: 'POST',
303
+      action: 'admin.taGoods.add.post',
252
     },
304
     },
253
     taPointsExchange: {
305
     taPointsExchange: {
254
       url: `${prefix}/taPointsExchange`,
306
       url: `${prefix}/taPointsExchange`,
255
-        method: 'GET',
307
+      method: 'GET',
308
+      action: 'admin.taPointsExchange.get',
256
     },
309
     },
257
     getTaGoods: {
310
     getTaGoods: {
258
       url: `${prefix}/taGoods`,
311
       url: `${prefix}/taGoods`,
259
       method: 'GET',
312
       method: 'GET',
313
+      action: 'admin.taGoods.get',
260
     },
314
     },
261
     changeTaGoods: {
315
     changeTaGoods: {
262
       url: `${prefix}/taGoods/change`,
316
       url: `${prefix}/taGoods/change`,
263
       method: 'PUT',
317
       method: 'PUT',
318
+      action: 'admin.taGoods.change.put',
264
     },
319
     },
265
     changeTaPointsExchange: {
320
     changeTaPointsExchange: {
266
       url: `${prefix}/taPointsExchange/change`,
321
       url: `${prefix}/taPointsExchange/change`,
267
       method: 'PUT',
322
       method: 'PUT',
323
+      action: 'admin.taPointsExchange.change.put',
268
     }
324
     }
269
   },
325
   },
270
   carsuseFigure: {
326
   carsuseFigure: {
271
     extendContent: {
327
     extendContent: {
272
       url: `${prefix}/extendContent`,
328
       url: `${prefix}/extendContent`,
273
       method: 'GET',
329
       method: 'GET',
330
+      action: 'admin.extendContent.get',
274
     },
331
     },
275
     finish: {
332
     finish: {
276
       url: `${prefix}/buildingDynamic/finish`,
333
       url: `${prefix}/buildingDynamic/finish`,
277
       method: 'PUT',
334
       method: 'PUT',
335
+      action: 'admin.buildingDynamic.finish.put',
278
     },
336
     },
279
     updataExtendContent: {
337
     updataExtendContent: {
280
       url: `${prefix}/extendContent/:id`,
338
       url: `${prefix}/extendContent/:id`,
281
       method: 'PUT',
339
       method: 'PUT',
340
+      action: 'admin.extendContent.id.put',
282
     },
341
     },
283
     getExtendContent: {
342
     getExtendContent: {
284
       url: `${prefix}/extendContent/:id`,
343
       url: `${prefix}/extendContent/:id`,
285
       method: 'GET',
344
       method: 'GET',
345
+      action: 'admin.extendContent.id.get',
286
     },
346
     },
287
     addExtendContent: {
347
     addExtendContent: {
288
       url: `${prefix}/extendContent`,
348
       url: `${prefix}/extendContent`,
289
       method: 'POST',
349
       method: 'POST',
350
+      action: 'admin.extendContent.post',
290
     }
351
     }
291
   },
352
   },
292
   system: {
353
   system: {
293
     taPolicy: {
354
     taPolicy: {
294
       url: `${prefix}/taPolicy/:id`,
355
       url: `${prefix}/taPolicy/:id`,
295
       method: 'GET',
356
       method: 'GET',
357
+      action: 'admin.taPolicy.id.get',
296
     },
358
     },
297
     updateTaPolicy: {
359
     updateTaPolicy: {
298
       url: `${prefix}/taPolicy/:id`,
360
       url: `${prefix}/taPolicy/:id`,
299
       method: 'PUT',
361
       method: 'PUT',
362
+      action: 'admin.taPolicy.id.put',
300
     },
363
     },
301
     addTaPolicy: {
364
     addTaPolicy: {
302
       url: `${prefix}/taPolicy`,
365
       url: `${prefix}/taPolicy`,
303
       method: 'POST',
366
       method: 'POST',
367
+      action: 'admin.taPolicy.post',
304
     },
368
     },
305
     getTaPolicy: {
369
     getTaPolicy: {
306
       url: `${prefix}/taPolicy`,
370
       url: `${prefix}/taPolicy`,
307
       method: 'GET',
371
       method: 'GET',
372
+      action: 'admin.taPolicy.get',
308
     },
373
     },
309
     deleteTaPolicy: {
374
     deleteTaPolicy: {
310
       url: `${prefix}/taPolicy/:id`,
375
       url: `${prefix}/taPolicy/:id`,
311
       method: 'DELETE',
376
       method: 'DELETE',
377
+      action: 'admin.taPolicy.id.delete',
312
     },
378
     },
313
     tdBizEventIntention: {
379
     tdBizEventIntention: {
314
       url: `${prefix}/tdBizEventIntention`,
380
       url: `${prefix}/tdBizEventIntention`,
315
       method: 'GET',
381
       method: 'GET',
382
+      action: 'admin.tdBizEventIntention.get',
316
     },
383
     },
317
     taBuildingIntentionAddOrUpdate: {
384
     taBuildingIntentionAddOrUpdate: {
318
       url: `${prefix}/taBuildingIntentionAddOrUpdate/:id`,
385
       url: `${prefix}/taBuildingIntentionAddOrUpdate/:id`,
319
       method: 'POST',
386
       method: 'POST',
387
+      action: 'admin.taBuildingIntentionAddOrUpdate.buildingId.post',
320
     },
388
     },
321
     taCustomerMessage: {
389
     taCustomerMessage: {
322
       url: `${prefix}/taCustomerMessage`,
390
       url: `${prefix}/taCustomerMessage`,
323
       method: 'GET',
391
       method: 'GET',
392
+      action: 'admin.taCustomerMessage.get',
324
     },
393
     },
325
     tdReports: {
394
     tdReports: {
326
       url: `${prefix}/tdReports`,
395
       url: `${prefix}/tdReports`,
327
       method: 'GET',
396
       method: 'GET',
397
+      action: 'admin.tdReports.get',
328
     },
398
     },
329
     taBuildingReports: {
399
     taBuildingReports: {
330
       url: `${prefix}/taBuildingReports`,
400
       url: `${prefix}/taBuildingReports`,
331
       method: 'GET',
401
       method: 'GET',
402
+      action: 'admin.taBuildingReports.get',
332
     },
403
     },
333
     addTaBuildingReports: {
404
     addTaBuildingReports: {
334
       url: `${prefix}/taBuildingReport/add`,
405
       url: `${prefix}/taBuildingReport/add`,
335
       method: 'POST',
406
       method: 'POST',
407
+      action: 'admin.taBuildingReport.add.post',
336
     }
408
     }
337
   },
409
   },
338
   staff: {
410
   staff: {
339
     taUser: {
411
     taUser: {
340
       url: `${prefix}/taUser`,
412
       url: `${prefix}/taUser`,
341
       method: 'GET',
413
       method: 'GET',
414
+      action: 'admin.taUser.get',
342
     },
415
     },
343
     taTags: {
416
     taTags: {
344
       url: `${prefix}/taTags`,
417
       url: `${prefix}/taTags`,
345
       method: 'GET',
418
       method: 'GET',
419
+      action: 'admin.taTags.get',
346
     },
420
     },
347
     getTaUser: {
421
     getTaUser: {
348
       url: `${prefix}/taUser/:id`,
422
       url: `${prefix}/taUser/:id`,
349
       method: 'GET',
423
       method: 'GET',
424
+      action: 'admin.taUser.id.get',
350
     },
425
     },
351
     updateTaUser: {
426
     updateTaUser: {
352
       url: `${prefix}/taUser/:id`,
427
       url: `${prefix}/taUser/:id`,
353
       method: 'PUT',
428
       method: 'PUT',
429
+      action: 'admin.taUser.id.put',
354
     },
430
     },
355
     addTaUser: {
431
     addTaUser: {
356
       url: `${prefix}/taUser`,
432
       url: `${prefix}/taUser`,
357
       method: 'POST',
433
       method: 'POST',
434
+      action: 'admin.taUser.post',
358
     },
435
     },
359
     change: {
436
     change: {
360
       url: `${prefix}/turn/taUser/:id/:type`,
437
       url: `${prefix}/turn/taUser/:id/:type`,
361
       method: 'PUT',
438
       method: 'PUT',
362
-    }
363
-  }
439
+      action: 'admin.turn.taUser.put',  
440
+    },
441
+  },
442
+  channelList: {
443
+    getList: {
444
+      url: `${prefix}/channel`,
445
+      method: 'GET',
446
+      action: 'admin.channel.get',
447
+    },
448
+    addChannel: {
449
+      url: `${prefix}/channel`,
450
+      method: 'POST',
451
+      action: 'admin.channel.post',
452
+    },
453
+    getById: {
454
+      url: `${prefix}/channel/:id`,
455
+      method: 'GET',
456
+      action: 'admin.channel.id.get',
457
+    },
458
+    editChannel: {
459
+      url: `${prefix}/channel/:id`,
460
+      method: 'PUT',
461
+      action: 'admin.channel.id.put',
462
+    },
463
+    getListBroker: {
464
+      url: `${prefix}/channel/broker`,
465
+      method: 'GET',
466
+      action: 'admin.channel.broker.get',
467
+    },
468
+    getListRecommend: {
469
+      url: `${prefix}/customer/recommend/:id`,
470
+      method: 'GET',
471
+      action: 'admin.customer.recommend.id.get',
472
+    },
473
+    getListInvite: {
474
+      url: `${prefix}/channel/InviteClientsList`,
475
+      method: 'GET',
476
+      action: 'admin.InviteClientsList.get',
477
+    },
478
+ },
479
+ role: {
480
+  getRoleList: {
481
+    url: `${prefix}/taRole`,
482
+    method: 'GET',
483
+    action: 'admin.taRole.get',
484
+  },
485
+  stop: {
486
+    url: `${prefix}/taRole/stop/:id`,
487
+    method: 'PUT',
488
+    action: 'admin.taRole.stop.id.PUT',
489
+  },
490
+  menuList: {
491
+    url: `${prefix}/menuList`,
492
+    method: 'GET',
493
+    action: 'admin.menuList.get',
494
+  },
495
+  buttonList: {
496
+    url: `${prefix}/buttonList`,
497
+    method: 'GET',
498
+    action: 'admin.buttonList.get',
499
+  },
500
+  buttonAndMenuList: {
501
+    url: `${prefix}/taRole/details/:id`,
502
+    method: 'GET',
503
+    action: 'admin.taRole.details.id.get'
504
+  },
505
+  updateAuthMenu: {
506
+    url: `${prefix}/updateAuthMenu`,
507
+    method: 'POST',
508
+    action: 'admin.updateAuthMenu.post',
509
+  },
510
+ },
364
   // indexEcharts:{
511
   // indexEcharts:{
365
   //   list:{
512
   //   list:{
366
   //     method:'get',
513
   //     method:'get',