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
 let allBtns = [];
3
 let allBtns = [];
4
 let current = [];
4
 let current = [];
5
 
5
 
6
-const AuthButton = ({ children, name, noRight }) => {
6
+const AuthButton = ({ children, name, noRight = null }) => {
7
   const btn = allBtns.filter(x => x.code === name)[0]
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
   const hasRight = current.filter(x => x.code === name)[0]  
12
   const hasRight = current.filter(x => x.code === name)[0]  

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

1
 import React, { useEffect, useState } from 'react'
1
 import React, { useEffect, useState } from 'react'
2
 import { Button, Form, Input, message } from 'antd'
2
 import { Button, Form, Input, message } from 'antd'
3
 import ImageUpload from '@/components/XForm/ImageUpload'
3
 import ImageUpload from '@/components/XForm/ImageUpload'
4
+import AuthButton from '@/components/AuthButton'
4
 import { fetch, apis } from '@/utils/request'
5
 import { fetch, apis } from '@/utils/request'
5
 
6
 
6
 const formItemLayout = {
7
 const formItemLayout = {
19
 const updateData = fetch(apis.activity.updatePoster)
20
 const updateData = fetch(apis.activity.updatePoster)
20
 
21
 
21
 const PosterForm = (props) => {
22
 const PosterForm = (props) => {
22
-  const { form, targetId, targetType } = props
23
+  const { form, targetId, targetType, rights } = props
23
   const { getFieldDecorator, resetFields, setFieldsValue, validateFields } = form
24
   const { getFieldDecorator, resetFields, setFieldsValue, validateFields } = form
24
 
25
 
25
   const [formData, setFormData] = useState()
26
   const [formData, setFormData] = useState()
91
       </Form.Item>
92
       </Form.Item>
92
       <Form.Item label="海报描述">
93
       <Form.Item label="海报描述">
93
       {getFieldDecorator('posterDescription')(<Input.TextArea row={4} />)}
94
       {getFieldDecorator('posterDescription')(<Input.TextArea row={4} />)}
94
-      </Form.Item>
95
+      </Form.Item>*/}
95
       <Form.Item label=" " colon={false} style={{marginTop: '2em'}}>
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
     </Form>
102
     </Form>
100
   )
103
   )
101
 }
104
 }

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

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

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

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

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

1
 import React, { useState, useEffect } from 'react';
1
 import React, { useState, useEffect } from 'react';
2
 import { Input, Button, Card, Form, notification, message } from 'antd';
2
 import { Input, Button, Card, Form, notification, message } from 'antd';
3
 import router from 'umi/router';
3
 import router from 'umi/router';
4
+import AuthButton from '@/components/AuthButton'
4
 // import Styles from './style.less';
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
 import { fetch } from '@/utils/request';
9
 import { fetch } from '@/utils/request';
9
 import pinyin from 'pinyin';
10
 import pinyin from 'pinyin';
10
 
11
 
193
           {...tailFormItemLayout}
194
           {...tailFormItemLayout}
194
           style={{ display: 'flex', justifyContent: 'space-between' }}
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
           &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
202
           &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
200
           <Button onClick={() => router.go(-1)}>取消</Button>
203
           <Button onClick={() => router.go(-1)}>取消</Button>
201
         </Form.Item>
204
         </Form.Item>

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

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

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

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

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

1
 import React, { useEffect, useState } from 'react';
1
 import React, { useEffect, useState } from 'react';
2
 import { Button, Collapse, Popconfirm } from 'antd';
2
 import { Button, Collapse, Popconfirm } from 'antd';
3
 import ImageListUpload from '@/components/XForm/ImageListUpload';
3
 import ImageListUpload from '@/components/XForm/ImageListUpload';
4
+import AuthButton from '@/components/AuthButton'
4
 
5
 
5
 const { Panel } = Collapse;
6
 const { Panel } = Collapse;
6
 
7
 
35
 
36
 
36
   const Extra = item => (
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
 import React, { useState, useEffect, useRef } from 'react';
1
 import React, { useState, useEffect, useRef } from 'react';
2
 import { Button, Modal, message, Input } from 'antd';
2
 import { Button, Modal, message, Input } from 'antd';
3
 import request, { apis } from '@/utils/request';
3
 import request, { apis } from '@/utils/request';
4
+import AuthButton from '@/components/AuthButton'
4
 import Form from './Form';
5
 import Form from './Form';
5
 import List from './List';
6
 import List from './List';
6
 import ModalForm from '../components/ModalForm';
7
 import ModalForm from '../components/ModalForm';
135
   return (
136
   return (
136
     <div>
137
     <div>
137
       <div>
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
       </div>
144
       </div>
142
       <Form
145
       <Form
143
         visible={visible}
146
         visible={visible}

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

1
 import React, { useEffect, useState } from 'react';
1
 import React, { useEffect, useState } from 'react';
2
 import { Button, Form, Input, message, Select } from 'antd';
2
 import { Button, Form, Input, message, Select } from 'antd';
3
 import ImageUpload from '@/components/XForm/ImageUpload';
3
 import ImageUpload from '@/components/XForm/ImageUpload';
4
+import AuthButton from '@/components/AuthButton'
4
 import { fetch, apis } from '@/utils/request';
5
 import { fetch, apis } from '@/utils/request';
5
 import ModalForm from '../components/ModalForm';
6
 import ModalForm from '../components/ModalForm';
6
 import InputNumber from '../components/InputNumber';
7
 import InputNumber from '../components/InputNumber';
158
         })(<InputNumber min={0} step={1} style={fullWidth} />)}
159
         })(<InputNumber min={0} step={1} style={fullWidth} />)}
159
       </Form.Item>
160
       </Form.Item>
160
       <Form.Item label=" " colon={false} style={{ marginTop: '2em' }}>
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
         <Button style={{ marginLeft: '2em' }} onClick={props.onCancel}>
167
         <Button style={{ marginLeft: '2em' }} onClick={props.onCancel}>
165
           取消
168
           取消
166
         </Button>
169
         </Button>

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

1
 import React from 'react'
1
 import React from 'react'
2
 import { Button, Table, Popconfirm } from 'antd'
2
 import { Button, Table, Popconfirm } from 'antd'
3
+import AuthButton from '@/components/AuthButton'
3
 import moment from 'moment'
4
 import moment from 'moment'
4
 
5
 
5
 const saleType = [
6
 const saleType = [
87
       key: 'apartmentId',
88
       key: 'apartmentId',
88
       render: (_, record) => (
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
 import React, { useEffect, useState, useRef } from 'react'
1
 import React, { useEffect, useState, useRef } from 'react'
2
 import { Button, message } from 'antd'
2
 import { Button, message } from 'antd'
3
 import { fetch, apis } from '@/utils/request'
3
 import { fetch, apis } from '@/utils/request'
4
+import AuthButton from '@/components/AuthButton'
4
 import Form from './Form'
5
 import Form from './Form'
5
 import List from './List'
6
 import List from './List'
6
 
7
 
62
   return (
63
   return (
63
     <div>
64
     <div>
64
       <div>
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
       </div>
69
       </div>
67
       <Form buildingId={id} visible={visible} onCancel={() => setVisible(false)} formData={apartmentRef.current} onSuccess={handleSuccess} />
70
       <Form buildingId={id} visible={visible} onCancel={() => setVisible(false)} formData={apartmentRef.current} onSuccess={handleSuccess} />
68
       <List loading={loading} dataSource={list} onEdit={handleEdit} onDelete={handleDelete} />
71
       <List loading={loading} dataSource={list} onEdit={handleEdit} onDelete={handleDelete} />

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

7
 import SelectCity from '@/components/SelectButton/CitySelect'
7
 import SelectCity from '@/components/SelectButton/CitySelect'
8
 import AreaSelect from '@/components/SelectButton/AreaSelect'
8
 import AreaSelect from '@/components/SelectButton/AreaSelect'
9
 import InstitutionSelect from '@/components/SelectButton/InstitutionSelect'
9
 import InstitutionSelect from '@/components/SelectButton/InstitutionSelect'
10
+import AuthButton from '@/components/AuthButton'
10
 import { POI_TYPES_KETY, POI_TYPES, getPoiData } from '@/utils/map'
11
 import { POI_TYPES_KETY, POI_TYPES, getPoiData } from '@/utils/map'
11
 import Amap from '../components/Amap'
12
 import Amap from '../components/Amap'
12
 import BuildingType from '../components/BuildingTypeSelect'
13
 import BuildingType from '../components/BuildingTypeSelect'
444
         </Form.Item> */}
445
         </Form.Item> */}
445
 
446
 
446
         <Form.Item label=" " colon={false}>
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
           <Button style={{marginLeft: '2em'}} onClick={() => router.go(-1)}>
453
           <Button style={{marginLeft: '2em'}} onClick={() => router.go(-1)}>
451
               取消
454
               取消
452
           </Button>
455
           </Button>

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

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

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

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

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

1
 import React from 'react';
1
 import React from 'react';
2
 import { Button, Table,Popconfirm  } from 'antd';
2
 import { Button, Table,Popconfirm  } from 'antd';
3
+import AuthButton from '@/components/AuthButton'
3
 import moment from 'moment'
4
 import moment from 'moment'
4
 
5
 
5
 export default props => {
6
 export default props => {
29
       key: 'apartmentId',
30
       key: 'apartmentId',
30
       render: (_, record) => (
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
             </Button>
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
 import React, { useEffect, useState } from 'react';
1
 import React, { useEffect, useState } from 'react';
2
 import { Button, notification } from 'antd';
2
 import { Button, notification } from 'antd';
3
+import AuthButton from '@/components/AuthButton'
3
 import Form from './Form';
4
 import Form from './Form';
4
 import List from './List';
5
 import List from './List';
5
 
6
 
71
   return (
72
   return (
72
     <div>
73
     <div>
73
       <div>
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
       </div>
80
       </div>
78
       <Form visibleData={visible} buildingId={id} onCancel={() => setVisible({visible:false})} onSuccess={onSuccess} />
81
       <Form visibleData={visible} buildingId={id} onCancel={() => setVisible({visible:false})} onSuccess={onSuccess} />
79
       <List data={data} buildingId={id} loading={loading} onChangePageNum={onChangePageNum} onDelete={onDelete} onEdit={onEdit}/>
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
 import { Input, Popconfirm, Table, Typography,notification } from 'antd';
2
 import { Input, Popconfirm, Table, Typography,notification } from 'antd';
3
 import request from '@/utils/request';
3
 import request from '@/utils/request';
4
 import apis from '@/services/apis';
4
 import apis from '@/services/apis';
5
-import Styles from './style.less';
5
+import AuthButton from '@/components/AuthButton'
6
 import { getImgURL } from '@/utils/image';
6
 import { getImgURL } from '@/utils/image';
7
+import Styles from './style.less';
7
 
8
 
8
 const { Text } = Typography;
9
 const { Text } = Typography;
9
 
10
 
95
       title: '操作',
96
       title: '操作',
96
       key: 'action',
97
       key: 'action',
97
       render: (_, row) => (
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
 import React, { useState } from 'react';
1
 import React, { useState } from 'react';
2
 import { Button, Form, Input, Select, Radio, notification } from 'antd';
2
 import { Button, Form, Input, Select, Radio, notification } from 'antd';
3
 import ImageUpload from '@/components/XForm/ImageUpload';
3
 import ImageUpload from '@/components/XForm/ImageUpload';
4
-import ModalForm from '../components/ModalForm';
4
+import AuthButton from '@/components/AuthButton'
5
 import request from '@/utils/request';
5
 import request from '@/utils/request';
6
 import apis from '@/services/apis';
6
 import apis from '@/services/apis';
7
+import ModalForm from '../components/ModalForm';
7
 
8
 
8
 const fullWidth = { width: '100%' };
9
 const fullWidth = { width: '100%' };
9
 const { Option } = Select;
10
 const { Option } = Select;
83
         })(<Input />)}
84
         })(<Input />)}
84
       </Form.Item>
85
       </Form.Item>
85
       <Form.Item label=" " colon={false} style={{ marginTop: '2em' }}>
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
         <Button style={{ marginLeft: '2em' }} onClick={props.onCancel}>
92
         <Button style={{ marginLeft: '2em' }} onClick={props.onCancel}>
90
           取消
93
           取消
91
         </Button>
94
         </Button>

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

3
 import request from '@/utils/request';
3
 import request from '@/utils/request';
4
 import apis from '@/services/apis';
4
 import apis from '@/services/apis';
5
 import { getImgURL } from '@/utils/image';
5
 import { getImgURL } from '@/utils/image';
6
+import AuthButton from '@/components/AuthButton'
6
 
7
 
7
 export default props => {
8
 export default props => {
8
   const { data,loading } = props;
9
   const { data,loading } = props;
41
       dataIndex: 'apartmentId',
42
       dataIndex: 'apartmentId',
42
       key: 'apartmentId',
43
       key: 'apartmentId',
43
       render: (_, record) => (
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
 import React, { useState, useEffect } from 'react';
1
 import React, { useState, useEffect } from 'react';
2
 import { Button, notification } from 'antd';
2
 import { Button, notification } from 'antd';
3
-import Form from './Form';
4
-import List from './List';
3
+import AuthButton from '@/components/AuthButton'
5
 import request from '@/utils/request';
4
 import request from '@/utils/request';
6
 import apis from '@/services/apis';
5
 import apis from '@/services/apis';
6
+import Form from './Form';
7
+import List from './List';
7
 
8
 
8
 export default props => {
9
 export default props => {
9
   const { history } = props;
10
   const { history } = props;
72
   return (
73
   return (
73
     <div>
74
     <div>
74
       <div>
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
       </div>
81
       </div>
79
       <Form
82
       <Form
80
         visible={visible}
83
         visible={visible}

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

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

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

4
 import request from '@/utils/request';
4
 import request from '@/utils/request';
5
 import apis from '@/services/apis';
5
 import apis from '@/services/apis';
6
 import moment from 'moment';
6
 import moment from 'moment';
7
+import AuthButton from '@/components/AuthButton'
7
 
8
 
8
 export default (props) => {
9
 export default (props) => {
9
   const { data = {}, onChangePageNum,loading } = props;
10
   const { data = {}, onChangePageNum,loading } = props;
44
       key: 'apartmentId',
45
       key: 'apartmentId',
45
       render: (_, record) => (
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
 import React, { useState, useEffect } from 'react'
1
 import React, { useState, useEffect } from 'react'
2
 import { Button,notification } from 'antd'
2
 import { Button,notification } from 'antd'
3
-import Form from './Form'
4
-import List from './List'
3
+import AuthButton from '@/components/AuthButton'
5
 import request from '@/utils/request';
4
 import request from '@/utils/request';
6
 import apis from '@/services/apis';
5
 import apis from '@/services/apis';
6
+import Form from './Form'
7
+import List from './List'
7
 
8
 
8
 export default (props) => {
9
 export default (props) => {
9
 
10
 
69
   return (
70
   return (
70
     <div>
71
     <div>
71
       <div>
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
       </div>
76
       </div>
74
       <Form visibleData={visible} buildingId={id} onCancel={() => setVisible({visible:false})} onSuccess={onSuccess}  />
77
       <Form visibleData={visible} buildingId={id} onCancel={() => setVisible({visible:false})} onSuccess={onSuccess}  />
75
       <List data={data} buildingId={id} loading={loading} onChangePageNum={onChangePageNum} onDelete={onDelete} onEdit={onEdit}/>
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
           </div>
65
           </div>
66
         </TabPane>
66
         </TabPane>
67
         <TabPane tab="海报图片" key="5">
67
         <TabPane tab="海报图片" key="5">
68
-          <Poster target={target} {...props} />
68
+          <Poster target={target} rights="building.poster.save" {...props} />
69
         </TabPane>
69
         </TabPane>
70
         <TabPane tab="分享设置" key="6">
70
         <TabPane tab="分享设置" key="6">
71
           <div className={styles['tab-wrapper']} style={{maxWidth: '800px'}}>
71
           <div className={styles['tab-wrapper']} style={{maxWidth: '800px'}}>
72
-            <Share target={target} {...props} />
72
+            <Share target={target} rights="building.share.save" {...props} />
73
           </div>
73
           </div>
74
         </TabPane>
74
         </TabPane>
75
       </Tabs>
75
       </Tabs>

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

3
 import { Button, notification, Spin } from 'antd'
3
 import { Button, notification, Spin } from 'antd'
4
 import { router } from 'umi'
4
 import { router } from 'umi'
5
 import QueryTable from '@/components/QueryTable'
5
 import QueryTable from '@/components/QueryTable'
6
+import AuthButton from '@/components/AuthButton'
6
 import request from '@/utils/request'
7
 import request from '@/utils/request'
7
 import apis from '@/services/apis'
8
 import apis from '@/services/apis'
8
 import getSearchFields from './searchFields'
9
 import getSearchFields from './searchFields'
47
 
48
 
48
   const actionRender = () => {
49
   const actionRender = () => {
49
     const gotoAdd = () => router.push('/building/add')
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
   return (
58
   return (

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

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

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

1
 import React, {  useEffect } from 'react';
1
 import React, {  useEffect } from 'react';
2
 import { Input, Button, Form, Card, notification } from 'antd';
2
 import { Input, Button, Form, Card, notification } from 'antd';
3
 import router from 'umi/router';
3
 import router from 'umi/router';
4
+import AuthButton from '@/components/AuthButton';
4
 import Styles from './style.less';
5
 import Styles from './style.less';
5
 import request from '../../../utils/request';
6
 import request from '../../../utils/request';
6
 import apis from '../../../services/apis';
7
 import apis from '../../../services/apis';
91
           })(<Input placeholder="名称" />)}
92
           })(<Input placeholder="名称" />)}
92
         </Form.Item>
93
         </Form.Item>
93
         <Form.Item style={{ display: 'flex', justifyContent: 'space-between' }}>
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
         </Form.Item>
106
         </Form.Item>
105
       </Form>
107
       </Form>
106
     </Card>
108
     </Card>

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

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

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

159
         align: 'center',
159
         align: 'center',
160
         width: '20%',
160
         width: '20%',
161
         render: withActions((_, record) => [
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
           // <EditIcon color="#FF4A4A" text="查看详情" onClick={() => toCustomerDateil(record)} />,
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
             <Button
169
             <Button
168
               type="link"
170
               type="link"
169
               onClick={() => {
171
               onClick={() => {
175
                   },
177
                   },
176
                 });
178
                 });
177
               }}
179
               }}
178
-
179
-              // });
180
-              // onClick={() => handShowModel(record, actionList.changeStatus)}
181
             >
180
             >
182
               变更状态
181
               变更状态
183
             </Button>
182
             </Button>
184
           </AuthButton>,
183
           </AuthButton>,
185
 
184
 
186
-          <AuthButton name="admin.customer.recommend.belong" noRight={null}>
185
+          <AuthButton name="customer.belong.change" noRight={null}>
187
             <Button type="link" onClick={() => handShowModel(record, actionList.attribution)}>
186
             <Button type="link" onClick={() => handShowModel(record, actionList.attribution)}>
188
               调整归属
187
               调整归属
189
             </Button>
188
             </Button>

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

166
         dataIndex: 'customerId',
166
         dataIndex: 'customerId',
167
         key: 'customerId',
167
         key: 'customerId',
168
         align: 'center',
168
         align: 'center',
169
-       
169
+
170
         render: withActions((_, record) => [
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
             </Button>
180
             </Button>
183
           </AuthButton>,
181
           </AuthButton>,

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

20
 } from 'antd';
20
 } from 'antd';
21
 import ImageUpload from '@/components/XForm/ImageUpload';
21
 import ImageUpload from '@/components/XForm/ImageUpload';
22
 import moment from 'moment';
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
 import { router } from 'umi';
26
 import { router } from 'umi';
26
 
27
 
27
 import Attribution from './components/attribution';
28
 import Attribution from './components/attribution';
186
         <Form.Item style={{ display: 'flex', justifyContent: 'center' }}>
187
         <Form.Item style={{ display: 'flex', justifyContent: 'center' }}>
187
           {data.status === '1' && (
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
           <Button style={{ marginLeft: '4em' }} onClick={() => router.goBack(-1)}>
207
           <Button style={{ marginLeft: '4em' }} onClick={() => router.goBack(-1)}>

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

1
 import React, { useState } from 'react';
1
 import React, { useState } from 'react';
2
 import {  Avatar, Button,message } from 'antd';
2
 import {  Avatar, Button,message } from 'antd';
3
 import moment from 'moment';
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
 import QueryTable from '@/components/QueryTable'
6
 import QueryTable from '@/components/QueryTable'
7
 import { router } from 'umi';
7
 import { router } from 'umi';
8
 import AuthButton from '@/components/AuthButton';
8
 import AuthButton from '@/components/AuthButton';
112
       dataIndex: 'customerId',
112
       dataIndex: 'customerId',
113
       key: 'customerId',
113
       key: 'customerId',
114
       render: (_, record) => (
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
               {record.verifyStatus === 0 ? <span style={{ color: 'rgba(239,39,58,1)', cursor: 'pointer' }} onClick={() => toAudit(record.customerId)}>审核</span> : ''}
127
               {record.verifyStatus === 0 ? <span style={{ color: 'rgba(239,39,58,1)', cursor: 'pointer' }} onClick={() => toAudit(record.customerId)}>审核</span> : ''}
125
             </AuthButton>
128
             </AuthButton>
126
           } */}
129
           } */}

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

1
 import React, { useState, useEffect } from 'react';
1
 import React, { useState, useEffect } from 'react';
2
 import { Form, Icon, Input, Button, DatePicker, Select, Card, Row, Col, Pagination, Alert, Table, Avatar, Radio, Upload, message, notification } from 'antd';
2
 import { Form, Icon, Input, Button, DatePicker, Select, Card, Row, Col, Pagination, Alert, Table, Avatar, Radio, Upload, message, notification } from 'antd';
3
 import ImageUpload from '@/components/XForm/ImageUpload';
3
 import ImageUpload from '@/components/XForm/ImageUpload';
4
+import AuthButton from '@/components/AuthButton';
4
 import moment from 'moment';
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
 import { router } from 'umi';
8
 import { router } from 'umi';
8
 
9
 
9
 import Attribution from './components/attribution'
10
 import Attribution from './components/attribution'
182
           )}
183
           )}
183
         </Form.Item>
184
         </Form.Item>
184
         <Form.Item style={{ display: 'flex', justifyContent: 'center' }}>
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
           <Button style={{marginLeft: '4em'}} onClick={() => router.goBack(-1)}>
198
           <Button style={{marginLeft: '4em'}} onClick={() => router.goBack(-1)}>
192
             取消
199
             取消
193
           </Button>
200
           </Button>

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

1
 import React, { useState } from 'react';
1
 import React, { useState } from 'react';
2
 import {  Avatar, Button,message } from 'antd';
2
 import {  Avatar, Button,message } from 'antd';
3
 import moment from 'moment';
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
 import QueryTable from '@/components/QueryTable'
6
 import QueryTable from '@/components/QueryTable'
7
 import { router } from 'umi';
7
 import { router } from 'umi';
8
 import AuthButton from '@/components/AuthButton';
8
 import AuthButton from '@/components/AuthButton';
112
       dataIndex: 'customerId',
112
       dataIndex: 'customerId',
113
       key: 'customerId',
113
       key: 'customerId',
114
       render: (_, record) => (
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
             <AuthButton name="admin.customer.recommend.verify.id.put" noRight={null}>
125
             <AuthButton name="admin.customer.recommend.verify.id.put" noRight={null}>

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

2
 import { Checkbox, Input, Card, Form, Button, Row, Col, Spin, message } from 'antd';
2
 import { Checkbox, Input, Card, Form, Button, Row, Col, Spin, message } from 'antd';
3
 import { connect } from 'dva';
3
 import { connect } from 'dva';
4
 import XForm, { FieldTypes } from '@/components/XForm';
4
 import XForm, { FieldTypes } from '@/components/XForm';
5
+import AuthButton from '@/components/AuthButton';
5
 import request from '@/utils/request';
6
 import request from '@/utils/request';
6
 import router from 'umi/router';
7
 import router from 'umi/router';
7
 import apis from '@/services/apis';
8
 import apis from '@/services/apis';
166
     }
167
     }
167
   }
168
   }
168
   const gridStyle1 = {
169
   const gridStyle1 = {
169
-    width: '16%',
170
+    width: '20%',
170
     textAlign: 'left',
171
     textAlign: 'left',
171
     height: '72px',
172
     height: '72px',
172
     padding:'24px'
173
     padding:'24px'
173
   };
174
   };
174
   const gridStyle2 = {
175
   const gridStyle2 = {
175
-    width: '84%',
176
+    width: '80%',
176
     textAlign: 'left',
177
     textAlign: 'left',
177
     height: '72px',
178
     height: '72px',
178
   };
179
   };
217
     <Card>
218
     <Card>
218
       <div>
219
       <div>
219
       <Spin spinning={ loading } size="large">
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
           <Form.Item label="角色名称">
222
           <Form.Item label="角色名称">
222
             {getFieldDecorator('roleName', {
223
             {getFieldDecorator('roleName', {
223
               rules: [{ required: true, message: '请输入角色名称' }],
224
               rules: [{ required: true, message: '请输入角色名称' }],
227
           {userMenus.map(item => (
228
           {userMenus.map(item => (
228
             (item.parentCode === '-1') &&
229
             (item.parentCode === '-1') &&
229
             <Row >
230
             <Row >
230
-              <Col span={6}>
231
-              </Col>
232
-              <Col span={18}>
231
+              <Col offset={2} span={18}>
233
 
232
 
234
                 <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'}} >
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
             </Row>
258
             </Row>
260
           ))}
259
           ))}
261
           <Form.Item wrapperCol={{ span: 15, offset: 7 }} style={{ marginTop: '10px' }}>
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
             <Button onClick = {toRoleList} style={{ marginLeft: '20px' }}>
266
             <Button onClick = {toRoleList} style={{ marginLeft: '20px' }}>
266
               取消
267
               取消
267
           </Button>
268
           </Button>

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

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

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

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

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

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

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

46
 
46
 
47
   return (
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
       options: {
51
       options: {
52
         ...opts,
52
         ...opts,
53
         headers: {
53
         headers: {
56
           ...authHeader,
56
           ...authHeader,
57
           ...actionHeader,
57
           ...actionHeader,
58
           ...headers,
58
           ...headers,
59
+          'X-ACTION': 'admin',  // 先写死
59
         },
60
         },
60
         data,
61
         data,
61
         requestType: data instanceof FormData ? 'form' : 'json',
62
         requestType: data instanceof FormData ? 'form' : 'json',