Your Name 3 years ago
parent
commit
152f5cc54d
40 changed files with 281 additions and 193 deletions
  1. 3
    3
      src/components/AuthButton/index.jsx
  2. 8
    5
      src/components/Poster/Form.jsx
  3. 2
    1
      src/components/Poster/index.jsx
  4. 5
    2
      src/components/Share/index.jsx
  5. 9
    6
      src/pages/building/Developers/Edit.jsx
  6. 1
    1
      src/pages/building/Developers/index.jsx
  7. 2
    2
      src/pages/building/Developers/tableColumns.js
  8. 16
    13
      src/pages/building/Edit/AlbumList/List.jsx
  9. 6
    3
      src/pages/building/Edit/AlbumList/index.jsx
  10. 6
    3
      src/pages/building/Edit/Apartment/Form.jsx
  11. 12
    7
      src/pages/building/Edit/Apartment/List.jsx
  12. 4
    1
      src/pages/building/Edit/Apartment/index.jsx
  13. 6
    3
      src/pages/building/Edit/Basic/index.jsx
  14. 4
    0
      src/pages/building/Edit/Channel.jsx
  15. 7
    5
      src/pages/building/Edit/News/Form.jsx
  16. 12
    7
      src/pages/building/Edit/News/List.jsx
  17. 6
    3
      src/pages/building/Edit/News/index.jsx
  18. 9
    6
      src/pages/building/Edit/OnSiteService.jsx
  19. 7
    4
      src/pages/building/Edit/Panorama/Form.jsx
  20. 8
    6
      src/pages/building/Edit/Panorama/List.jsx
  21. 8
    5
      src/pages/building/Edit/Panorama/index.jsx
  22. 6
    5
      src/pages/building/Edit/SpecialRoom/Form.jsx
  23. 12
    7
      src/pages/building/Edit/SpecialRoom/List.jsx
  24. 6
    3
      src/pages/building/Edit/SpecialRoom/index.jsx
  25. 2
    2
      src/pages/building/Edit/index.jsx
  26. 6
    1
      src/pages/building/List/index.jsx
  27. 3
    3
      src/pages/building/List/tableColumns.js
  28. 12
    10
      src/pages/building/type/edi.jsx
  29. 2
    2
      src/pages/building/type/index.jsx
  30. 7
    8
      src/pages/customer/Customer/PrivateCustomer/index.jsx
  31. 8
    10
      src/pages/customer/Customer/PublicCustomer/index.jsx
  32. 18
    13
      src/pages/recommend/channel/audit.jsx
  33. 12
    9
      src/pages/recommend/channel/index.jsx
  34. 15
    8
      src/pages/recommend/customer/audit.jsx
  35. 10
    8
      src/pages/recommend/customer/index.jsx
  36. 10
    9
      src/pages/staff/Role/Edit/index.jsx
  37. 3
    3
      src/pages/staff/Role/List/index.jsx
  38. 1
    0
      src/pages/staff/staff/Edit/index.jsx
  39. 4
    4
      src/pages/staff/staff/list/index.jsx
  40. 3
    2
      src/utils/request.js

+ 3
- 3
src/components/AuthButton/index.jsx View File

@@ -3,10 +3,10 @@ import React from 'react';
3 3
 let allBtns = [];
4 4
 let current = [];
5 5
 
6
-const AuthButton = ({ children, name, noRight }) => {
6
+const AuthButton = ({ children, name, noRight = null }) => {
7 7
   const btn = allBtns.filter(x => x.code === name)[0]
8
-  if (!btn) {
9
-    return <>{children}</>
8
+  if (!btn || !name) {
9
+    return children
10 10
   }
11 11
 
12 12
   const hasRight = current.filter(x => x.code === name)[0]  

+ 8
- 5
src/components/Poster/Form.jsx View File

@@ -1,6 +1,7 @@
1 1
 import React, { useEffect, useState } from 'react'
2 2
 import { Button, Form, Input, message } from 'antd'
3 3
 import ImageUpload from '@/components/XForm/ImageUpload'
4
+import AuthButton from '@/components/AuthButton'
4 5
 import { fetch, apis } from '@/utils/request'
5 6
 
6 7
 const formItemLayout = {
@@ -19,7 +20,7 @@ const saveData = fetch(apis.activity.addPoster)
19 20
 const updateData = fetch(apis.activity.updatePoster)
20 21
 
21 22
 const PosterForm = (props) => {
22
-  const { form, targetId, targetType } = props
23
+  const { form, targetId, targetType, rights } = props
23 24
   const { getFieldDecorator, resetFields, setFieldsValue, validateFields } = form
24 25
 
25 26
   const [formData, setFormData] = useState()
@@ -91,11 +92,13 @@ const PosterForm = (props) => {
91 92
       </Form.Item>
92 93
       <Form.Item label="海报描述">
93 94
       {getFieldDecorator('posterDescription')(<Input.TextArea row={4} />)}
94
-      </Form.Item>
95
+      </Form.Item>*/}
95 96
       <Form.Item label=" " colon={false} style={{marginTop: '2em'}}>
96
-        <Button loading={loading} style={{marginLeft: '4em'}} type="primary" htmlType="submit">保存</Button>
97
-        {/* <Button style={{marginLeft: '2em'}} onClick={props.onCancel}>取消</Button> */}
98
-       {/* </Form.Item> */}
97
+        <AuthButton name={rights}>
98
+          <Button loading={loading} style={{marginLeft: '4em'}} type="primary" htmlType="submit">保存</Button>
99
+        </AuthButton>
100
+        {/* <Button style={{marginLeft: '2em'}} onClick={props.onCancel}>取消</Button>  */}
101
+      </Form.Item>
99 102
     </Form>
100 103
   )
101 104
 }

+ 2
- 1
src/components/Poster/index.jsx View File

@@ -7,7 +7,7 @@ import Styles from './style.less'
7 7
 const noop = x => x;
8 8
 
9 9
 export default (props) => {
10
-  const { target, onCancel = noop } = props
10
+  const { target, rights, onCancel = noop } = props
11 11
   const { id: targetId, type: targetType } = target
12 12
 
13 13
   const [posterImg, setPosterImg] = useState()
@@ -21,6 +21,7 @@ export default (props) => {
21 21
         <Form
22 22
           targetId={targetId}
23 23
           targetType={targetType}
24
+          rights={rights}
24 25
           onImageChange={setPosterImg}
25 26
           onCancel={onCancel}
26 27
         />

+ 5
- 2
src/components/Share/index.jsx View File

@@ -1,6 +1,7 @@
1 1
 import React, { useState, useEffect } from 'react'
2 2
 import { Button, Form, Input, message } from 'antd'
3 3
 import ImageUpload from '@/components/XForm/ImageUpload'
4
+import AuthButton from '@/components/AuthButton'
4 5
 import { fetch, apis } from '@/utils/request'
5 6
 
6 7
 const formItemLayout = {
@@ -18,7 +19,7 @@ const saveData = fetch(apis.activity.addShareContent)
18 19
 const updateData = fetch(apis.activity.updateShareContent)
19 20
 
20 21
 const ShareForm = (props) => {
21
-  const { target, form } = props
22
+  const { target, form, rights } = props
22 23
   const { id: targetId, type: targetType } = target
23 24
   const { getFieldDecorator, resetFields, setFieldsValue, validateFields } = form
24 25
 
@@ -87,7 +88,9 @@ const ShareForm = (props) => {
87 88
       })(<ImageUpload />)}
88 89
       </Form.Item>
89 90
       <Form.Item label=" " colon={false} style={{marginTop: '2em'}}>
90
-        <Button loading={loading} style={{marginLeft: '4em'}} type="primary" htmlType="submit">保存</Button>
91
+        <AuthButton name={rights}>
92
+          <Button loading={loading} style={{marginLeft: '4em'}} type="primary" htmlType="submit">保存</Button>
93
+        </AuthButton>
91 94
         {/* <Button style={{marginLeft: '2em'}} onClick={props.onCancel}>取消</Button> */}
92 95
       </Form.Item>
93 96
     </Form>

+ 9
- 6
src/pages/building/Developers/Edit.jsx View File

@@ -1,10 +1,11 @@
1 1
 import React, { useState, useEffect } from 'react';
2 2
 import { Input, Button, Card, Form, notification, message } from 'antd';
3 3
 import router from 'umi/router';
4
+import AuthButton from '@/components/AuthButton'
4 5
 // import Styles from './style.less';
5
-import ImageUploader from '../../../components/XForm/ImageUpload';
6
-import request from '../../../utils/request';
7
-import apis from '../../../services/apis';
6
+import ImageUploader from '@/components/XForm/ImageUpload';
7
+import request from '@/utils/request';
8
+import apis from '@/services/apis';
8 9
 import { fetch } from '@/utils/request';
9 10
 import pinyin from 'pinyin';
10 11
 
@@ -193,9 +194,11 @@ function Edit(props) {
193 194
           {...tailFormItemLayout}
194 195
           style={{ display: 'flex', justifyContent: 'space-between' }}
195 196
         >
196
-          <Button type="primary" htmlType="submit" style={{ margin: '0' }}>
197
-            确定
198
-          </Button>
197
+          <AuthButton name="building.brand">
198
+            <Button type="primary" htmlType="submit" style={{ margin: '0' }}>
199
+              确定
200
+            </Button>
201
+          </AuthButton>
199 202
           &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
200 203
           <Button onClick={() => router.go(-1)}>取消</Button>
201 204
         </Form.Item>

+ 1
- 1
src/pages/building/Developers/index.jsx View File

@@ -60,7 +60,7 @@ export default (props) => {
60 60
   const actionRender = () => {
61 61
     return (
62 62
       //name
63
-      <AuthButton name="admin.brand.addBrand" noRight={null}>
63
+      <AuthButton name="building.brand.add" noRight={null}>
64 64
         <Button type="primary" icon="plus" onClick={toEdit} >
65 65
           新增
66 66
         </Button>

+ 2
- 2
src/pages/building/Developers/tableColumns.js View File

@@ -47,10 +47,10 @@ export default ({page,getBrandData, onEdit, onDelete}) => [
47 47
     key: 'options',
48 48
     align: 'center',
49 49
     render: withActions((_, row) => [
50
-      <AuthButton name="admin.building.public" noRight={null}>
50
+      <AuthButton name="building.brand.edit" noRight={null}>
51 51
         <OperButton onClick={() => onEdit(row)}>编辑</OperButton>
52 52
       </AuthButton>,
53
-      <AuthButton name="admin.brabd.delete" noRight={null}>
53
+      <AuthButton name="building.brand.delete" noRight={null}>
54 54
         <OperButton.Confirm
55 55
           title="确认删除?"
56 56
           content="删除之后不可恢复"

+ 16
- 13
src/pages/building/Edit/AlbumList/List.jsx View File

@@ -1,6 +1,7 @@
1 1
 import React, { useEffect, useState } from 'react';
2 2
 import { Button, Collapse, Popconfirm } from 'antd';
3 3
 import ImageListUpload from '@/components/XForm/ImageListUpload';
4
+import AuthButton from '@/components/AuthButton'
4 5
 
5 6
 const { Panel } = Collapse;
6 7
 
@@ -35,19 +36,21 @@ export default props => {
35 36
 
36 37
   const Extra = item => (
37 38
     <>
38
-      <Button type="link" size="small" onClick={(e)=>{e.stopPropagation(),props.onRename(item)}}>
39
-        重命名
40
-      </Button>
41
-      {/* <Popconfirm title="Are you sure delete this task?" onConfirm={props.onDelete}> */}
42
-      <Button
43
-        type="link"
44
-        size="small"
45
-        style={{ color: 'red' }}
46
-        onClick={e =>{ e.stopPropagation(),props.onDelete(item)} }
47
-      >
48
-        删除
49
-      </Button>
50
-      {/* </Popconfirm> */}
39
+      <AuthButton name="building.photo.rename">
40
+        <Button type="link" size="small" onClick={(e)=>{e.stopPropagation(),props.onRename(item)}}>
41
+          重命名
42
+        </Button>
43
+      </AuthButton>
44
+      <AuthButton name="building.photo.delete">
45
+        <Button
46
+          type="link"
47
+          size="small"
48
+          style={{ color: 'red' }}
49
+          onClick={e =>{ e.stopPropagation(),props.onDelete(item)} }
50
+        >
51
+          删除
52
+        </Button>
53
+      </AuthButton>
51 54
     </>
52 55
   );
53 56
 

+ 6
- 3
src/pages/building/Edit/AlbumList/index.jsx View File

@@ -1,6 +1,7 @@
1 1
 import React, { useState, useEffect, useRef } from 'react';
2 2
 import { Button, Modal, message, Input } from 'antd';
3 3
 import request, { apis } from '@/utils/request';
4
+import AuthButton from '@/components/AuthButton'
4 5
 import Form from './Form';
5 6
 import List from './List';
6 7
 import ModalForm from '../components/ModalForm';
@@ -135,9 +136,11 @@ export default props => {
135 136
   return (
136 137
     <div>
137 138
       <div>
138
-        <Button type="primary" onClick={() => setVisible(true)}>
139
-          新增相册
140
-        </Button>
139
+        <AuthButton name="building.photo.add">
140
+          <Button type="primary" onClick={() => setVisible(true)}>
141
+            新增相册
142
+          </Button>
143
+        </AuthButton>
141 144
       </div>
142 145
       <Form
143 146
         visible={visible}

+ 6
- 3
src/pages/building/Edit/Apartment/Form.jsx View File

@@ -1,6 +1,7 @@
1 1
 import React, { useEffect, useState } from 'react';
2 2
 import { Button, Form, Input, message, Select } from 'antd';
3 3
 import ImageUpload from '@/components/XForm/ImageUpload';
4
+import AuthButton from '@/components/AuthButton'
4 5
 import { fetch, apis } from '@/utils/request';
5 6
 import ModalForm from '../components/ModalForm';
6 7
 import InputNumber from '../components/InputNumber';
@@ -158,9 +159,11 @@ const AMForm = props => {
158 159
         })(<InputNumber min={0} step={1} style={fullWidth} />)}
159 160
       </Form.Item>
160 161
       <Form.Item label=" " colon={false} style={{ marginTop: '2em' }}>
161
-        <Button loading={loading} style={{ marginLeft: '4em' }} type="primary" htmlType="submit">
162
-          保存
163
-        </Button>
162
+        <AuthButton name="building.houseType.edit">
163
+          <Button loading={loading} style={{ marginLeft: '4em' }} type="primary" htmlType="submit">
164
+            保存
165
+          </Button>
166
+        </AuthButton>
164 167
         <Button style={{ marginLeft: '2em' }} onClick={props.onCancel}>
165 168
           取消
166 169
         </Button>

+ 12
- 7
src/pages/building/Edit/Apartment/List.jsx View File

@@ -1,5 +1,6 @@
1 1
 import React from 'react'
2 2
 import { Button, Table, Popconfirm } from 'antd'
3
+import AuthButton from '@/components/AuthButton'
3 4
 import moment from 'moment'
4 5
 
5 6
 const saleType = [
@@ -87,13 +88,17 @@ export default (props) => {
87 88
       key: 'apartmentId',
88 89
       render: (_, record) => (
89 90
         <>
90
-          <Button type="link" onClick={() => props.onEdit(record)}>编辑</Button>
91
-          <Popconfirm
92
-            title="确定要进行删除操作 ?"
93
-            onConfirm={() => props.onDelete(record)}
94
-          >
95
-            <Button type="link" style={{ color: 'red' }}>删除</Button>
96
-          </Popconfirm>
91
+          <AuthButton name="building.houseType.edit">
92
+            <Button type="link" onClick={() => props.onEdit(record)}>编辑</Button>
93
+          </AuthButton>
94
+          <AuthButton name="building.houseType.delete">
95
+            <Popconfirm
96
+              title="确定要进行删除操作 ?"
97
+              onConfirm={() => props.onDelete(record)}
98
+            >
99
+              <Button type="link" style={{ color: 'red' }}>删除</Button>
100
+            </Popconfirm>
101
+          </AuthButton>
97 102
         </>
98 103
       ),
99 104
     },

+ 4
- 1
src/pages/building/Edit/Apartment/index.jsx View File

@@ -1,6 +1,7 @@
1 1
 import React, { useEffect, useState, useRef } from 'react'
2 2
 import { Button, message } from 'antd'
3 3
 import { fetch, apis } from '@/utils/request'
4
+import AuthButton from '@/components/AuthButton'
4 5
 import Form from './Form'
5 6
 import List from './List'
6 7
 
@@ -62,7 +63,9 @@ export default (props) => {
62 63
   return (
63 64
     <div>
64 65
       <div>
65
-        <Button type="primary" onClick={() => handleEdit()}>新增户型</Button>
66
+        <AuthButton name="building.houseType.add">
67
+          <Button type="primary" onClick={() => handleEdit()}>新增户型</Button>
68
+        </AuthButton>
66 69
       </div>
67 70
       <Form buildingId={id} visible={visible} onCancel={() => setVisible(false)} formData={apartmentRef.current} onSuccess={handleSuccess} />
68 71
       <List loading={loading} dataSource={list} onEdit={handleEdit} onDelete={handleDelete} />

+ 6
- 3
src/pages/building/Edit/Basic/index.jsx View File

@@ -7,6 +7,7 @@ import ImageListUpload from '@/components/XForm/ImageListUpload'
7 7
 import SelectCity from '@/components/SelectButton/CitySelect'
8 8
 import AreaSelect from '@/components/SelectButton/AreaSelect'
9 9
 import InstitutionSelect from '@/components/SelectButton/InstitutionSelect'
10
+import AuthButton from '@/components/AuthButton'
10 11
 import { POI_TYPES_KETY, POI_TYPES, getPoiData } from '@/utils/map'
11 12
 import Amap from '../components/Amap'
12 13
 import BuildingType from '../components/BuildingTypeSelect'
@@ -444,9 +445,11 @@ const BuildingBasic = React.forwardRef((props, ref) => {
444 445
         </Form.Item> */}
445 446
 
446 447
         <Form.Item label=" " colon={false}>
447
-          <Button style={{marginLeft: '6em'}} type="primary" htmlType="submit">
448
-              确定
449
-          </Button>
448
+          <AuthButton name="building.detail.save">
449
+            <Button style={{marginLeft: '6em'}} type="primary" htmlType="submit">
450
+                确定
451
+            </Button>
452
+          </AuthButton>
450 453
           <Button style={{marginLeft: '2em'}} onClick={() => router.go(-1)}>
451 454
               取消
452 455
           </Button>

+ 4
- 0
src/pages/building/Edit/Channel.jsx View File

@@ -2,6 +2,7 @@ import React, { useEffect, useState } from 'react'
2 2
 import { connect } from 'dva';
3 3
 import { Button, Form, Input, message, Select } from 'antd'
4 4
 import { fetch, apis } from '@/utils/request'
5
+import AuthButton from '@/components/AuthButton'
5 6
 import InputNumber from './components/InputNumber'
6 7
 import { formItemLayout, validMinNum } from './utils'
7 8
 
@@ -80,6 +81,9 @@ const ChannelForm = React.forwardRef((props, ref) => {
80 81
       {getFieldDecorator('remark', {})(<Input.TextArea row={4} />)}
81 82
       </Form.Item>
82 83
       <Form.Item label=" " colon={false} style={{marginTop: '2em'}}>
84
+        <AuthButton name="building.channel.save">
85
+          <Button style={{marginLeft: '4em'}} loading={loading} type="primary" htmlType="submit">保存</Button>
86
+        </AuthButton>
83 87
         <Button style={{marginLeft: '4em'}} loading={loading} type="primary" htmlType="submit">保存</Button>
84 88
         {/* <Button style={{marginLeft: '2em'}} onClick={props.onCancel}>取消</Button> */}
85 89
       </Form.Item>

+ 7
- 5
src/pages/building/Edit/News/Form.jsx View File

@@ -1,9 +1,10 @@
1 1
 import React, { useState, useEffect } from 'react';
2 2
 import { Button, Form, Input, DatePicker, notification } from 'antd';
3
-import ModalForm from '../components/ModalForm';
3
+import AuthButton from '@/components/AuthButton'
4 4
 import request from '@/utils/request';
5 5
 import apis from '@/services/apis';
6 6
 import moment from 'moment';
7
+import ModalForm from '../components/ModalForm';
7 8
 
8 9
 const fullWidth = { width: '100%' };
9 10
 
@@ -14,7 +15,6 @@ const AMForm = props => {
14 15
 
15 16
   useEffect(() => {
16 17
     if (data) {
17
-      console.log(data, '-----------------');
18 18
       data.trendTime=moment(data.trendTime)
19 19
       setFieldsValue(data);
20 20
     }
@@ -81,9 +81,11 @@ const AMForm = props => {
81 81
         })(<Input.TextArea row={4} />)}
82 82
       </Form.Item>
83 83
       <Form.Item label=" " colon={false} style={{ marginTop: '2em' }}>
84
-        <Button style={{ marginLeft: '4em' }} type="primary" htmlType="submit">
85
-          保存
86
-        </Button>
84
+        <AuthButton name="building.dynamic.edit">
85
+          <Button style={{ marginLeft: '4em' }} type="primary" htmlType="submit">
86
+            保存
87
+          </Button>
88
+        </AuthButton>
87 89
         <Button style={{ marginLeft: '2em' }} onClick={props.onCancel}>
88 90
           取消
89 91
         </Button>

+ 12
- 7
src/pages/building/Edit/News/List.jsx View File

@@ -1,5 +1,6 @@
1 1
 import React from 'react';
2 2
 import { Button, Table,Popconfirm  } from 'antd';
3
+import AuthButton from '@/components/AuthButton'
3 4
 import moment from 'moment'
4 5
 
5 6
 export default props => {
@@ -29,14 +30,18 @@ export default props => {
29 30
       key: 'apartmentId',
30 31
       render: (_, record) => (
31 32
         <>
32
-          <Button type="link" onClick={() => props.onEdit(record)}>
33
-            编辑
34
-          </Button>
35
-          <Popconfirm title="确定要进行删除操作 ?" onConfirm={() => props.onDelete(record)}>
36
-            <Button type="link" style={{ color: 'red' }}>
37
-              删除
33
+          <AuthButton name="building.dynamic.edit">
34
+            <Button type="link" onClick={() => props.onEdit(record)}>
35
+              编辑
38 36
             </Button>
39
-          </Popconfirm>
37
+          </AuthButton>
38
+          <AuthButton name="building.dynamic.delete">
39
+            <Popconfirm title="确定要进行删除操作 ?" onConfirm={() => props.onDelete(record)}>
40
+              <Button type="link" style={{ color: 'red' }}>
41
+                删除
42
+              </Button>
43
+            </Popconfirm>
44
+          </AuthButton>
40 45
         </>
41 46
       ),
42 47
     },

+ 6
- 3
src/pages/building/Edit/News/index.jsx View File

@@ -1,5 +1,6 @@
1 1
 import React, { useEffect, useState } from 'react';
2 2
 import { Button, notification } from 'antd';
3
+import AuthButton from '@/components/AuthButton'
3 4
 import Form from './Form';
4 5
 import List from './List';
5 6
 
@@ -71,9 +72,11 @@ export default props => {
71 72
   return (
72 73
     <div>
73 74
       <div>
74
-        <Button type="primary" onClick={() => setVisible({visible:true})}>
75
-          新增动态
76
-        </Button>
75
+        <AuthButton name="building.dynamic.add">
76
+          <Button type="primary" onClick={() => setVisible({visible:true})}>
77
+            新增动态
78
+          </Button>
79
+        </AuthButton>
77 80
       </div>
78 81
       <Form visibleData={visible} buildingId={id} onCancel={() => setVisible({visible:false})} onSuccess={onSuccess} />
79 82
       <List data={data} buildingId={id} loading={loading} onChangePageNum={onChangePageNum} onDelete={onDelete} onEdit={onEdit}/>

+ 9
- 6
src/pages/building/Edit/OnSiteService.jsx View File

@@ -2,8 +2,9 @@ import React, { useState, useEffect } from 'react';
2 2
 import { Input, Popconfirm, Table, Typography,notification } from 'antd';
3 3
 import request from '@/utils/request';
4 4
 import apis from '@/services/apis';
5
-import Styles from './style.less';
5
+import AuthButton from '@/components/AuthButton'
6 6
 import { getImgURL } from '@/utils/image';
7
+import Styles from './style.less';
7 8
 
8 9
 const { Text } = Typography;
9 10
 
@@ -95,11 +96,13 @@ export default props => {
95 96
       title: '操作',
96 97
       key: 'action',
97 98
       render: (_, row) => (
98
-        <Popconfirm title="确认执行取消操作?" onConfirm={() => handleCancel(row)}>
99
-          <a href="#" style={{ color: 'red' }}>
100
-            取消绑定
101
-          </a>
102
-        </Popconfirm>
99
+        <AuthButton name="building.marketing.delete">
100
+          <Popconfirm title="确认执行取消操作?" onConfirm={() => handleCancel(row)}>
101
+            <a href="#" style={{ color: 'red' }}>
102
+              取消绑定
103
+            </a>
104
+          </Popconfirm>
105
+        </AuthButton>
103 106
       ),
104 107
     },
105 108
   ];

+ 7
- 4
src/pages/building/Edit/Panorama/Form.jsx View File

@@ -1,9 +1,10 @@
1 1
 import React, { useState } from 'react';
2 2
 import { Button, Form, Input, Select, Radio, notification } from 'antd';
3 3
 import ImageUpload from '@/components/XForm/ImageUpload';
4
-import ModalForm from '../components/ModalForm';
4
+import AuthButton from '@/components/AuthButton'
5 5
 import request from '@/utils/request';
6 6
 import apis from '@/services/apis';
7
+import ModalForm from '../components/ModalForm';
7 8
 
8 9
 const fullWidth = { width: '100%' };
9 10
 const { Option } = Select;
@@ -83,9 +84,11 @@ const AMForm = props => {
83 84
         })(<Input />)}
84 85
       </Form.Item>
85 86
       <Form.Item label=" " colon={false} style={{ marginTop: '2em' }}>
86
-        <Button style={{ marginLeft: '4em' }} type="primary" htmlType="submit">
87
-          保存
88
-        </Button>
87
+        <AuthButton name="building.panorama.add">
88
+          <Button style={{ marginLeft: '4em' }} type="primary" htmlType="submit">
89
+            保存
90
+          </Button>
91
+        </AuthButton>
89 92
         <Button style={{ marginLeft: '2em' }} onClick={props.onCancel}>
90 93
           取消
91 94
         </Button>

+ 8
- 6
src/pages/building/Edit/Panorama/List.jsx View File

@@ -3,6 +3,7 @@ import { Button, Table, notification, Popconfirm } from 'antd';
3 3
 import request from '@/utils/request';
4 4
 import apis from '@/services/apis';
5 5
 import { getImgURL } from '@/utils/image';
6
+import AuthButton from '@/components/AuthButton'
6 7
 
7 8
 export default props => {
8 9
   const { data,loading } = props;
@@ -41,12 +42,13 @@ export default props => {
41 42
       dataIndex: 'apartmentId',
42 43
       key: 'apartmentId',
43 44
       render: (_, record) => (
44
-        <Popconfirm title="确定要进行删除操作 ?" onConfirm={() => props.onDelete(record)}>
45
-         
46
-          <Button type="link" style={{ color: 'red' }}>
47
-            删除
48
-          </Button>
49
-        </Popconfirm>
45
+        <AuthButton name="building.panorama.delete">
46
+          <Popconfirm title="确定要进行删除操作 ?" onConfirm={() => props.onDelete(record)}>
47
+            <Button type="link" style={{ color: 'red' }}>
48
+              删除
49
+            </Button>
50
+          </Popconfirm>
51
+        </AuthButton>
50 52
       ),
51 53
     },
52 54
   ];

+ 8
- 5
src/pages/building/Edit/Panorama/index.jsx View File

@@ -1,9 +1,10 @@
1 1
 import React, { useState, useEffect } from 'react';
2 2
 import { Button, notification } from 'antd';
3
-import Form from './Form';
4
-import List from './List';
3
+import AuthButton from '@/components/AuthButton'
5 4
 import request from '@/utils/request';
6 5
 import apis from '@/services/apis';
6
+import Form from './Form';
7
+import List from './List';
7 8
 
8 9
 export default props => {
9 10
   const { history } = props;
@@ -72,9 +73,11 @@ export default props => {
72 73
   return (
73 74
     <div>
74 75
       <div>
75
-        <Button type="primary" onClick={() => setVisible(true)}>
76
-          新增全景
77
-        </Button>
76
+        <AuthButton name="building.panorama.add">
77
+          <Button type="primary" onClick={() => setVisible(true)}>
78
+            新增全景
79
+          </Button>
80
+        </AuthButton>
78 81
       </div>
79 82
       <Form
80 83
         visible={visible}

+ 6
- 5
src/pages/building/Edit/SpecialRoom/Form.jsx View File

@@ -1,11 +1,12 @@
1 1
 import React,{useEffect} from 'react'
2 2
 import { Button, Form, Input, DatePicker,notification } from 'antd'
3 3
 import moment from 'moment'
4
+import request from '@/utils/request';
5
+import apis from '@/services/apis';
6
+import AuthButton from '@/components/AuthButton'
4 7
 import ModalForm from '../components/ModalForm'
5 8
 import InputNumber from '../components/InputNumber'
6 9
 import { validMinNum } from '../utils'
7
-import request from '@/utils/request';
8
-import apis from '@/services/apis';
9 10
 
10 11
 const fullWidth = { width: '100%' }
11 12
 
@@ -16,7 +17,6 @@ const AMForm = (props) => {
16 17
 
17 18
   useEffect(() => {
18 19
     if (data) {
19
-      console.log(data, '-----------------');
20 20
       // data.trendTime=moment(data.trendTime)
21 21
       data.time=[moment(data.startTime),moment(data.endTime)]
22 22
       setFieldsValue(data);
@@ -30,7 +30,6 @@ const AMForm = (props) => {
30 30
         console.error(err);
31 31
         return;
32 32
       }
33
-      console.log(values, '-----------------');
34 33
       values.buildingId = props.buildingId;
35 34
       values.startTime = values.time[0]
36 35
       values.endTime = values.time[1]
@@ -124,7 +123,9 @@ const AMForm = (props) => {
124 123
         })(<InputNumber min={0} precision={0.01} step={1} placeholder="请填写节省总价" addonAfter="元"/>)}
125 124
       </Form.Item>
126 125
       <Form.Item label=" " colon={false} style={{marginTop: '2em'}}>
127
-        <Button style={{marginLeft: '4em'}} type="primary" htmlType="submit">保存</Button>
126
+        <AuthButton name="building.special.edit">
127
+          <Button style={{marginLeft: '4em'}} type="primary" htmlType="submit">保存</Button>
128
+        </AuthButton>
128 129
         <Button style={{marginLeft: '2em'}} onClick={props.onCancel}>取消</Button>
129 130
       </Form.Item>
130 131
     </ModalForm>

+ 12
- 7
src/pages/building/Edit/SpecialRoom/List.jsx View File

@@ -4,6 +4,7 @@ import TableList from '@/components/TableList';
4 4
 import request from '@/utils/request';
5 5
 import apis from '@/services/apis';
6 6
 import moment from 'moment';
7
+import AuthButton from '@/components/AuthButton'
7 8
 
8 9
 export default (props) => {
9 10
   const { data = {}, onChangePageNum,loading } = props;
@@ -44,13 +45,17 @@ export default (props) => {
44 45
       key: 'apartmentId',
45 46
       render: (_, record) => (
46 47
         <>
47
-          <Button type="link" onClick={() => props.onEdit(record)}>编辑</Button>
48
-          <Popconfirm
49
-            title="确定要进行删除操作 ?"
50
-            onConfirm={() => props.onDelete(record)}
51
-          >
52
-            <Button type="link" style={{ color: 'red' }}>删除</Button>
53
-          </Popconfirm>
48
+          <AuthButton name="building.special.edit">
49
+            <Button type="link" onClick={() => props.onEdit(record)}>编辑</Button>
50
+          </AuthButton>
51
+          <AuthButton name="building.special.delete">
52
+            <Popconfirm
53
+              title="确定要进行删除操作 ?"
54
+              onConfirm={() => props.onDelete(record)}
55
+            >
56
+              <Button type="link" style={{ color: 'red' }}>删除</Button>
57
+            </Popconfirm>
58
+          </AuthButton>
54 59
         </>
55 60
       ),
56 61
     },

+ 6
- 3
src/pages/building/Edit/SpecialRoom/index.jsx View File

@@ -1,9 +1,10 @@
1 1
 import React, { useState, useEffect } from 'react'
2 2
 import { Button,notification } from 'antd'
3
-import Form from './Form'
4
-import List from './List'
3
+import AuthButton from '@/components/AuthButton'
5 4
 import request from '@/utils/request';
6 5
 import apis from '@/services/apis';
6
+import Form from './Form'
7
+import List from './List'
7 8
 
8 9
 export default (props) => {
9 10
 
@@ -69,7 +70,9 @@ export default (props) => {
69 70
   return (
70 71
     <div>
71 72
       <div>
72
-        <Button type="primary" onClick={() => setVisible({visible:true})}>新增特价房</Button>
73
+        <AuthButton name="building.special.add">
74
+          <Button type="primary" onClick={() => setVisible({visible:true})}>新增特价房</Button>
75
+        </AuthButton>
73 76
       </div>
74 77
       <Form visibleData={visible} buildingId={id} onCancel={() => setVisible({visible:false})} onSuccess={onSuccess}  />
75 78
       <List data={data} buildingId={id} loading={loading} onChangePageNum={onChangePageNum} onDelete={onDelete} onEdit={onEdit}/>

+ 2
- 2
src/pages/building/Edit/index.jsx View File

@@ -65,11 +65,11 @@ export default (props) => {
65 65
           </div>
66 66
         </TabPane>
67 67
         <TabPane tab="海报图片" key="5">
68
-          <Poster target={target} {...props} />
68
+          <Poster target={target} rights="building.poster.save" {...props} />
69 69
         </TabPane>
70 70
         <TabPane tab="分享设置" key="6">
71 71
           <div className={styles['tab-wrapper']} style={{maxWidth: '800px'}}>
72
-            <Share target={target} {...props} />
72
+            <Share target={target} rights="building.share.save" {...props} />
73 73
           </div>
74 74
         </TabPane>
75 75
       </Tabs>

+ 6
- 1
src/pages/building/List/index.jsx View File

@@ -3,6 +3,7 @@ import React, { useMemo, useRef, useCallback, useState } from 'react'
3 3
 import { Button, notification, Spin } from 'antd'
4 4
 import { router } from 'umi'
5 5
 import QueryTable from '@/components/QueryTable'
6
+import AuthButton from '@/components/AuthButton'
6 7
 import request from '@/utils/request'
7 8
 import apis from '@/services/apis'
8 9
 import getSearchFields from './searchFields'
@@ -47,7 +48,11 @@ export default (props) => {
47 48
 
48 49
   const actionRender = () => {
49 50
     const gotoAdd = () => router.push('/building/add')
50
-    return <Button type="primary" icon="plus" onClick={gotoAdd}>新增</Button>
51
+    return (
52
+      <AuthButton name="building.add">
53
+        <Button type="primary" icon="plus" onClick={gotoAdd}>新增</Button>
54
+      </AuthButton>
55
+    )
51 56
   }
52 57
 
53 58
   return (

+ 3
- 3
src/pages/building/List/tableColumns.js View File

@@ -36,7 +36,7 @@ export default ({page, onPublish, onDelete}) => [
36 36
     key: 'buildingName',
37 37
     align: 'center',
38 38
     render: (t, row) => (
39
-      <AuthButton name="admin.building.update" noRight={t}>
39
+      <AuthButton name="building.detail" noRight={t}>
40 40
         <Button
41 41
           type="link"
42 42
           onClick={() => router.push({
@@ -74,10 +74,10 @@ export default ({page, onPublish, onDelete}) => [
74 74
     key: 'options',
75 75
     align: 'center',
76 76
     render: withActions((_, row) => [
77
-      <AuthButton name="admin.building.public" noRight={null}>
77
+      <AuthButton name="building.publish" noRight={null}>
78 78
         <OperButton onClick={() => onPublish(row)}>{row.status === 1 ? '取消发布' : '发布'}</OperButton>
79 79
       </AuthButton>,
80
-      <AuthButton name="admin.building.delete" noRight={null}>
80
+      <AuthButton name="building.delete" noRight={null}>
81 81
         <OperButton.Confirm
82 82
           title="确认删除?"
83 83
           content="删除之后不可恢复"

+ 12
- 10
src/pages/building/type/edi.jsx View File

@@ -1,6 +1,7 @@
1 1
 import React, {  useEffect } from 'react';
2 2
 import { Input, Button, Form, Card, notification } from 'antd';
3 3
 import router from 'umi/router';
4
+import AuthButton from '@/components/AuthButton';
4 5
 import Styles from './style.less';
5 6
 import request from '../../../utils/request';
6 7
 import apis from '../../../services/apis';
@@ -91,16 +92,17 @@ function body(props) {
91 92
           })(<Input placeholder="名称" />)}
92 93
         </Form.Item>
93 94
         <Form.Item style={{ display: 'flex', justifyContent: 'space-between' }}>
94
-          <Button
95
-            type="primary"
96
-            htmlType="submit"
97
-            className={Styles.addButton}
98
-            style={{ margin: '0' }}
99
-          >
100
-            确定
101
-          </Button>
102
-          &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
103
-          <Button onClick={() => router.go(-1)}>取消</Button>
95
+          <AuthButton name="building.type.submit">
96
+            <Button
97
+              type="primary"
98
+              htmlType="submit"
99
+              className={Styles.addButton}
100
+              style={{ margin: '0' }}
101
+            >
102
+              确定
103
+            </Button>
104
+          </AuthButton>
105
+          <Button style={{marginLeft: '2em'}} onClick={() => router.go(-1)}>取消</Button>
104 106
         </Form.Item>
105 107
       </Form>
106 108
     </Card>

+ 2
- 2
src/pages/building/type/index.jsx View File

@@ -45,10 +45,10 @@ export default function BuildType() {
45 45
       key: 'row',
46 46
       align: 'center',
47 47
       render: withActions((_, record) => [
48
-        <AuthButton name="admin.tdBuildingType.delete" noRight={null}>
48
+        <AuthButton name="building.type.delete" noRight={null}>
49 49
           <EditIcon text="删除" type="delete" onClick={() => deleteType(record)} />
50 50
         </AuthButton>,
51
-        <AuthButton name="admin.tdBuildingType.update" noRight={null}>
51
+        <AuthButton name="building.type.edit" noRight={null}>
52 52
           <EditIcon text="编辑" type="edit" onClick={() => toEdi(record.buildingTypeId)} />
53 53
         </AuthButton>,
54 54
       ]),

+ 7
- 8
src/pages/customer/Customer/PrivateCustomer/index.jsx View File

@@ -159,11 +159,13 @@ const PrivateCustomer = () => {
159 159
         align: 'center',
160 160
         width: '20%',
161 161
         render: withActions((_, record) => [
162
-          <Button type="link" onClick={() => toCustomerDateil(record)}>
163
-            查看详情
164
-          </Button>,
162
+          <AuthButton name="customer.detail">
163
+            <Button type="link" onClick={() => toCustomerDateil(record)}>
164
+              查看详情
165
+            </Button>
166
+          </AuthButton>,
165 167
           // <EditIcon color="#FF4A4A" text="查看详情" onClick={() => toCustomerDateil(record)} />,
166
-          <AuthButton name="admin.customer.recommend.edit.id.put" noRight={null}>
168
+          <AuthButton name="customer.status.change" noRight={null}>
167 169
             <Button
168 170
               type="link"
169 171
               onClick={() => {
@@ -175,15 +177,12 @@ const PrivateCustomer = () => {
175 177
                   },
176 178
                 });
177 179
               }}
178
-
179
-              // });
180
-              // onClick={() => handShowModel(record, actionList.changeStatus)}
181 180
             >
182 181
               变更状态
183 182
             </Button>
184 183
           </AuthButton>,
185 184
 
186
-          <AuthButton name="admin.customer.recommend.belong" noRight={null}>
185
+          <AuthButton name="customer.belong.change" noRight={null}>
187 186
             <Button type="link" onClick={() => handShowModel(record, actionList.attribution)}>
188 187
               调整归属
189 188
             </Button>

+ 8
- 10
src/pages/customer/Customer/PublicCustomer/index.jsx View File

@@ -166,18 +166,16 @@ const PublicCustomer = () => {
166 166
         dataIndex: 'customerId',
167 167
         key: 'customerId',
168 168
         align: 'center',
169
-       
169
+
170 170
         render: withActions((_, record) => [
171
-          <Button  type="link" onClick={() => publicCustomerDetail(record)}>
172
-            查看详情
173
-          </Button>,
171
+          <AuthButton name="customer.detail">
172
+            <Button  type="link" onClick={() => publicCustomerDetail(record)}>
173
+              查看详情
174
+          </Button>
175
+          </AuthButton>,
174 176
 
175
-          <AuthButton name="admin.customer.assign" noRight={null}>
176
-            <Button
177
-        
178
-              type="link"
179
-              onClick={() => handShowModel(record, actionList.assistConsultant)}
180
-            >
177
+          <AuthButton name="customer.consultant.dispatch" noRight={null}>
178
+            <Button type="link" onClick={() => handShowModel(record, actionList.assistConsultant)}>
181 179
               分配置业顾问
182 180
             </Button>
183 181
           </AuthButton>,

+ 18
- 13
src/pages/recommend/channel/audit.jsx View File

@@ -20,8 +20,9 @@ import {
20 20
 } from 'antd';
21 21
 import ImageUpload from '@/components/XForm/ImageUpload';
22 22
 import moment from 'moment';
23
-import request from '../../../utils/request';
24
-import apis from '../../../services/apis';
23
+import AuthButton from '@/components/AuthButton';
24
+import request from '@/utils/request';
25
+import apis from '@/services/apis';
25 26
 import { router } from 'umi';
26 27
 
27 28
 import Attribution from './components/attribution';
@@ -186,17 +187,21 @@ function body(props) {
186 187
         <Form.Item style={{ display: 'flex', justifyContent: 'center' }}>
187 188
           {data.status === '1' && (
188 189
             <>
189
-              <Button type="primary" htmlType="submit">
190
-                确定
191
-              </Button>
192
-              <Button
193
-                type="danger"
194
-                ghost
195
-                style={{ marginLeft: '4em' }}
196
-                onClick={() => submitDate({ status: '2' })}
197
-              >
198
-                无效
199
-              </Button>
190
+              <AuthButton name="customer.channel.report">
191
+                <Button type="primary" htmlType="submit">
192
+                  确定
193
+                </Button>
194
+              </AuthButton>
195
+              <AuthButton name="customer.channel.report">
196
+                <Button
197
+                  type="danger"
198
+                  ghost
199
+                  style={{ marginLeft: '4em' }}
200
+                  onClick={() => submitDate({ status: '2' })}
201
+                >
202
+                  无效
203
+                </Button>
204
+              </AuthButton>
200 205
             </>
201 206
           )}
202 207
           <Button style={{ marginLeft: '4em' }} onClick={() => router.goBack(-1)}>

+ 12
- 9
src/pages/recommend/channel/index.jsx View File

@@ -1,8 +1,8 @@
1 1
 import React, { useState } from 'react';
2 2
 import {  Avatar, Button,message } from 'antd';
3 3
 import moment from 'moment';
4
-import request from '../../../utils/request';
5
-import apis from '../../../services/apis';
4
+import request from '@/utils/request';
5
+import apis from '@/services/apis';
6 6
 import QueryTable from '@/components/QueryTable'
7 7
 import { router } from 'umi';
8 8
 import AuthButton from '@/components/AuthButton';
@@ -112,15 +112,18 @@ function Recommend(props) {
112 112
       dataIndex: 'customerId',
113 113
       key: 'customerId',
114 114
       render: (_, record) => (
115
-        <>{record.status === '1' ?<Button type='link' onClick={() => {
116
-          toAudit(record.channelCustomerId)
117
-          }}>到访确认</Button>:
118
-          <Button type='link' onClick={() => {
119
-            toAudit(record.channelCustomerId)
120
-            }}>查看详情</Button>
115
+        <>{record.status === '1' ? (
116
+          <AuthButton name="customer.channel.report">
117
+            <Button type='link' onClick={() => toAudit(record.channelCustomerId)}>到访确认</Button>
118
+          </AuthButton>
119
+        ): (
120
+          <AuthButton name="customer.channel.detail">
121
+            <Button type='link' onClick={() => toAudit(record.channelCustomerId)}>查看详情</Button>
122
+          </AuthButton>
123
+        )
121 124
           }
122 125
           {/* {
123
-            <AuthButton name="admin.customer.recommend.verify.id.put" noRight={null}>
126
+            <AuthButton name="customer.channel.report" noRight={null}>
124 127
               {record.verifyStatus === 0 ? <span style={{ color: 'rgba(239,39,58,1)', cursor: 'pointer' }} onClick={() => toAudit(record.customerId)}>审核</span> : ''}
125 128
             </AuthButton>
126 129
           } */}

+ 15
- 8
src/pages/recommend/customer/audit.jsx View File

@@ -1,9 +1,10 @@
1 1
 import React, { useState, useEffect } from 'react';
2 2
 import { Form, Icon, Input, Button, DatePicker, Select, Card, Row, Col, Pagination, Alert, Table, Avatar, Radio, Upload, message, notification } from 'antd';
3 3
 import ImageUpload from '@/components/XForm/ImageUpload';
4
+import AuthButton from '@/components/AuthButton';
4 5
 import moment from 'moment';
5
-import request from '../../../utils/request';
6
-import apis from '../../../services/apis';
6
+import request from '@/utils/request';
7
+import apis from '@/services/apis';
7 8
 import { router } from 'umi';
8 9
 
9 10
 import Attribution from './components/attribution'
@@ -182,12 +183,18 @@ function body(props) {
182 183
           )}
183 184
         </Form.Item>
184 185
         <Form.Item style={{ display: 'flex', justifyContent: 'center' }}>
185
-          {data.status==='1'&&<><Button type="primary" htmlType="submit" >
186
-            确定
187
-          </Button>
188
-          <Button type="danger" ghost style={{marginLeft: '4em'}} onClick={() => submitDate({ status: '2' })}>
189
-            无效
190
-          </Button></>}
186
+          {data.status==='1'&& <>
187
+            <AuthButton name="customer.common.verify">
188
+              <Button type="primary" htmlType="submit" >
189
+                确定
190
+              </Button>
191
+            </AuthButton>
192
+            <AuthButton name="customer.common.verify">
193
+              <Button type="danger" ghost style={{marginLeft: '4em'}} onClick={() => submitDate({ status: '2' })}>
194
+                无效
195
+              </Button>
196
+            </AuthButton>
197
+          </>}
191 198
           <Button style={{marginLeft: '4em'}} onClick={() => router.goBack(-1)}>
192 199
             取消
193 200
           </Button>

+ 10
- 8
src/pages/recommend/customer/index.jsx View File

@@ -1,8 +1,8 @@
1 1
 import React, { useState } from 'react';
2 2
 import {  Avatar, Button,message } from 'antd';
3 3
 import moment from 'moment';
4
-import request from '../../../utils/request';
5
-import apis from '../../../services/apis';
4
+import request from '@/utils/request';
5
+import apis from '@/services/apis';
6 6
 import QueryTable from '@/components/QueryTable'
7 7
 import { router } from 'umi';
8 8
 import AuthButton from '@/components/AuthButton';
@@ -112,12 +112,14 @@ function Recommend(props) {
112 112
       dataIndex: 'customerId',
113 113
       key: 'customerId',
114 114
       render: (_, record) => (
115
-        <>{record.status === '1' ?<Button type='link' onClick={() => {
116
-          toAudit(record.channelCustomerId)
117
-          }}>审核</Button>:
118
-          <Button type='link' onClick={() => {
119
-            toAudit(record.channelCustomerId)
120
-            }}>查看详情</Button>
115
+        <>{record.status === '1' ? (
116
+          <AuthButton name="customer.channel.verify">
117
+            <Button type='link' onClick={() => toAudit(record.channelCustomerId)}>审核</Button>
118
+          </AuthButton>
119
+        ) : (
120
+          <Button type='link' onClick={() => toAudit(record.channelCustomerId)}>查看详情</Button>
121
+        )
122
+          
121 123
           }
122 124
           {/* {
123 125
             <AuthButton name="admin.customer.recommend.verify.id.put" noRight={null}>

+ 10
- 9
src/pages/staff/Role/Edit/index.jsx View File

@@ -2,6 +2,7 @@ import React, { useState, useEffect } from 'react';
2 2
 import { Checkbox, Input, Card, Form, Button, Row, Col, Spin, message } from 'antd';
3 3
 import { connect } from 'dva';
4 4
 import XForm, { FieldTypes } from '@/components/XForm';
5
+import AuthButton from '@/components/AuthButton';
5 6
 import request from '@/utils/request';
6 7
 import router from 'umi/router';
7 8
 import apis from '@/services/apis';
@@ -166,13 +167,13 @@ const Poster = props => {
166 167
     }
167 168
   }
168 169
   const gridStyle1 = {
169
-    width: '16%',
170
+    width: '20%',
170 171
     textAlign: 'left',
171 172
     height: '72px',
172 173
     padding:'24px'
173 174
   };
174 175
   const gridStyle2 = {
175
-    width: '84%',
176
+    width: '80%',
176 177
     textAlign: 'left',
177 178
     height: '72px',
178 179
   };
@@ -217,7 +218,7 @@ const Poster = props => {
217 218
     <Card>
218 219
       <div>
219 220
       <Spin spinning={ loading } size="large">
220
-        <Form labelCol={{ span: 6 }} wrapperCol={{ span: 12 }} onSubmit={handleSubmit}>
221
+        <Form labelCol={{ span: 2 }} wrapperCol={{ span: 18 }} onSubmit={handleSubmit}>
221 222
           <Form.Item label="角色名称">
222 223
             {getFieldDecorator('roleName', {
223 224
               rules: [{ required: true, message: '请输入角色名称' }],
@@ -227,9 +228,7 @@ const Poster = props => {
227 228
           {userMenus.map(item => (
228 229
             (item.parentCode === '-1') &&
229 230
             <Row >
230
-              <Col span={6}>
231
-              </Col>
232
-              <Col span={18}>
231
+              <Col offset={2} span={18}>
233 232
 
234 233
                 <Card title={<Checkbox checked={dataMenuId.includes(item.menuId)} onChange={handleMenuChange(item)}>{item.name}</Checkbox>} bordered style={{ width: '100%', alignItems: 'center',margin:'10px 0', boxShadow:'3px 3px 10px  rgba(0,0,0,0.15)',borderRadius:'8px'}} >
235 234
                   {
@@ -259,9 +258,11 @@ const Poster = props => {
259 258
             </Row>
260 259
           ))}
261 260
           <Form.Item wrapperCol={{ span: 15, offset: 7 }} style={{ marginTop: '10px' }}>
262
-            <Button type="primary" htmlType="submit">
263
-              保存
264
-          </Button>
261
+            <AuthButton name="role.submit">
262
+              <Button type="primary" htmlType="submit">
263
+                保存
264
+              </Button>
265
+            </AuthButton>
265 266
             <Button onClick = {toRoleList} style={{ marginLeft: '20px' }}>
266 267
               取消
267 268
           </Button>

+ 3
- 3
src/pages/staff/Role/List/index.jsx View File

@@ -119,11 +119,11 @@ const header = props => {
119 119
         return record.isAdmin ? [] :
120 120
           [
121 121
             record.status === 1 ?
122
-            <AuthButton name="admin.role.publish" noRight={null}>
122
+            <AuthButton name="role.delete" noRight={null}>
123 123
               <EditIcon type="delete" text="删除" onClick={() => stop(record.roleId, record.status)} />
124 124
             </AuthButton> : null,
125 125
 
126
-            <AuthButton name="admin.role.put" noRight={null}>
126
+            <AuthButton name="role.edit" noRight={null}>
127 127
               <EditIcon text="编辑" type="edit" onClick={() => toEditRole(record.roleId)} />
128 128
             </AuthButton>,
129 129
           ]
@@ -134,7 +134,7 @@ const header = props => {
134 134
 
135 135
   return (
136 136
     <Card>
137
-      <AuthButton name="admin.role.add" noRight={null}>
137
+      <AuthButton name="role.add" noRight={null}>
138 138
         <Button type="primary"  onClick={addRole}>新增</Button>
139 139
       </AuthButton>
140 140
       <div style={{marginTop:'20px'}}>

+ 1
- 0
src/pages/staff/staff/Edit/index.jsx View File

@@ -5,6 +5,7 @@ import router from 'umi/router';
5 5
 import { FieldTypes, createForm } from '@/components/XForm';
6 6
 import apis from '@/services/apis';
7 7
 import request from '@/utils/request';
8
+import AuthButton from '@/components/AuthButton';
8 9
 import BuildingSelection from '../components/BuildingSelection';
9 10
 
10 11
 const { TextArea } = Input;

+ 4
- 4
src/pages/staff/staff/list/index.jsx View File

@@ -206,11 +206,11 @@ export default props => {
206 206
       align: 'center',
207 207
       render: withActions(
208 208
         (_, row) => [
209
-          <AuthButton name="admin.building.public" noRight={null}>
209
+          <AuthButton name="staff.stop" noRight={null}>
210 210
             <OperButton onClick={confirm(row)}>{row.status === 1 ? '停用' : '启用'}</OperButton>
211 211
           </AuthButton>,
212
-          <AuthButton name="admin.building.delete" noRight={null}>
213
-               <OperButton onClick={() => toEdit(row)}>编辑</OperButton>
212
+          <AuthButton name="staff.edit" noRight={null}>
213
+            <OperButton onClick={() => toEdit(row)}>编辑</OperButton>
214 214
           </AuthButton>,
215 215
         ],
216 216
         { noMargin: true },
@@ -220,7 +220,7 @@ export default props => {
220 220
 
221 221
   const actionRender = () => {
222 222
     return (
223
-      <AuthButton name="admin.tdBuildingType.add" noRight={null}>
223
+      <AuthButton name="staff.add" noRight={null}>
224 224
         <Button type="primary" icon="plus" onClick={() => toEdit()}>
225 225
           新增
226 226
         </Button>

+ 3
- 2
src/utils/request.js View File

@@ -46,8 +46,8 @@ request.interceptors.request.use((url, options) => {
46 46
 
47 47
   return (
48 48
     {
49
-      url: 'https://xlk.njyz.tech' + apiURL,
50
-      // url: apiURL,
49
+      // url: 'https://xlk.njyz.tech' + apiURL,
50
+      url: apiURL,
51 51
       options: {
52 52
         ...opts,
53 53
         headers: {
@@ -56,6 +56,7 @@ request.interceptors.request.use((url, options) => {
56 56
           ...authHeader,
57 57
           ...actionHeader,
58 58
           ...headers,
59
+          'X-ACTION': 'admin',  // 先写死
59 60
         },
60 61
         data,
61 62
         requestType: data instanceof FormData ? 'form' : 'json',