Browse Source

Merge branch 'master' of http://git.ycjcjy.com/marketing/pc-admin

Your Name 3 years ago
parent
commit
1b3e185046
43 changed files with 1280 additions and 1007 deletions
  1. 19
    17
      src/pages/Live/LiveActivity/Edit/components/base.jsx
  2. 8
    4
      src/pages/Live/LiveActivity/List/index.jsx
  3. 126
    92
      src/pages/Live/LiveActivity/add/index.jsx
  4. 7
    3
      src/pages/Live/video/Edit/index.jsx
  5. 18
    17
      src/pages/Live/video/List/index.jsx
  6. 12
    12
      src/pages/activity/SignupActivity/edit/Basic.jsx
  7. 22
    16
      src/pages/activity/SignupActivity/index.jsx
  8. 1
    1
      src/pages/activity/SignupActivity/registrationRecord.jsx
  9. 8
    7
      src/pages/activity/groupRoomActivity/edit/Basic.jsx
  10. 22
    16
      src/pages/activity/groupRoomActivity/index.jsx
  11. 3
    3
      src/pages/activity/groupRoomActivity/registrationRecord.jsx
  12. 7
    3
      src/pages/activity/lookHouseActivity/edit/Basic.jsx
  13. 15
    12
      src/pages/activity/lookHouseActivity/index.jsx
  14. 1
    1
      src/pages/activity/lookHouseActivity/registrationRecord.jsx
  15. 4
    4
      src/pages/carouselFigure/advertisingList.jsx
  16. 4
    4
      src/pages/carouselFigure/carouselFigureList.jsx
  17. 1
    1
      src/pages/carouselFigure/customImg/list.jsx
  18. 9
    0
      src/pages/carouselFigure/editAdvertising.jsx
  19. 67
    56
      src/pages/channel/Channel/Edit/index.jsx
  20. 21
    14
      src/pages/channel/Channel/List/index.jsx
  21. 21
    41
      src/pages/channel/independentList/index.jsx
  22. 102
    143
      src/pages/course/Edit/index.jsx
  23. 11
    8
      src/pages/course/list/index.jsx
  24. 1
    1
      src/pages/customer/Customer/PrivateCustomer/index.jsx
  25. 1
    1
      src/pages/customer/Customer/PublicCustomer/index.jsx
  26. 45
    36
      src/pages/findRoom/addedValueService/audit.jsx
  27. 83
    53
      src/pages/findRoom/addedValueService/index.jsx
  28. 20
    8
      src/pages/findRoom/buyRoom/audit.jsx
  29. 80
    57
      src/pages/findRoom/buyRoom/index.jsx
  30. 20
    19
      src/pages/findRoom/overseas/audit.jsx
  31. 15
    3
      src/pages/findRoom/overseas/index.jsx
  32. 19
    6
      src/pages/findRoom/rent/audit.jsx
  33. 16
    4
      src/pages/findRoom/rent/index.jsx
  34. 9
    7
      src/pages/news/list/List.jsx
  35. 4
    4
      src/pages/news/type/NewsType.jsx
  36. 59
    43
      src/pages/news/type/editNews.jsx
  37. 30
    24
      src/pages/staff/Organization/index.jsx
  38. 198
    145
      src/pages/staff/Role/Edit/index.jsx
  39. 25
    20
      src/pages/staff/staff/Edit/index.jsx
  40. 9
    5
      src/pages/system/Sellhouse/houseTypes/Newindex.jsx
  41. 3
    3
      src/pages/system/Sellhouse/houseTypes/index.jsx
  42. 128
    87
      src/pages/system/Sellhouse/index.jsx
  43. 6
    6
      src/pages/system/housingPolicy/List/index.jsx

+ 19
- 17
src/pages/Live/LiveActivity/Edit/components/base.jsx View File

22
 import CitySelect3 from '@/components/SelectButton/CitySelect3';
22
 import CitySelect3 from '@/components/SelectButton/CitySelect3';
23
 import ImageUpload from '@/components/XForm/ImageUpload';
23
 import ImageUpload from '@/components/XForm/ImageUpload';
24
 import request from '@/utils/request';
24
 import request from '@/utils/request';
25
-import WxWorkLivingRoom from '@/components/LivingRoom/WxWork'
25
+import WxWorkLivingRoom from '@/components/LivingRoom/WxWork';
26
+import AuthButton from '@/components/AuthButton';
26
 
27
 
27
 const { Option } = Select;
28
 const { Option } = Select;
28
 
29
 
55
   };
56
   };
56
 
57
 
57
   const cancelPage = () => {
58
   const cancelPage = () => {
58
-    router.go('-1')
59
+    router.go('-1');
59
   };
60
   };
60
 
61
 
61
   //打开新页面
62
   //打开新页面
178
           {getFieldDecorator('isNewHouse', {
179
           {getFieldDecorator('isNewHouse', {
179
             valuePropName: 'checked',
180
             valuePropName: 'checked',
180
             initialValue: liveActivityData.isNewHouse || false,
181
             initialValue: liveActivityData.isNewHouse || false,
181
-          })(<Switch/>)}
182
+          })(<Switch />)}
182
         </Form.Item>
183
         </Form.Item>
183
         {/* <Form.Item label="直播小程序">
184
         {/* <Form.Item label="直播小程序">
184
           {getFieldDecorator('liveApp', {
185
           {getFieldDecorator('liveApp', {
200
           <Navigate onClick={openIndexImg}>不知道怎么填?查看说明</Navigate>
201
           <Navigate onClick={openIndexImg}>不知道怎么填?查看说明</Navigate>
201
         </Form.Item> */}
202
         </Form.Item> */}
202
         <Form.Item label="选择直播间">
203
         <Form.Item label="选择直播间">
203
-          {
204
-            getFieldDecorator('liveRoomParam', {
205
-              initialValue: liveActivityData.liveRoomParam,
206
-              rules: [{ required: true, message: '请选择直播间' }],
207
-            })(<WxWorkLivingRoom placeholder="请选择直播间"/>)
208
-          }
204
+          {getFieldDecorator('liveRoomParam', {
205
+            initialValue: liveActivityData.liveRoomParam,
206
+            rules: [{ required: true, message: '请选择直播间' }],
207
+          })(<WxWorkLivingRoom placeholder="请选择直播间" />)}
209
         </Form.Item>
208
         </Form.Item>
210
-        <Form.Item
211
-          label="封面图"
212
-          help="建议尺寸:335px*201px,比例5:3,格式:jpg,用于:活动列表"
213
-        >
209
+        <Form.Item label="封面图" help="建议尺寸:335px*201px,比例5:3,格式:jpg,用于:活动列表">
214
           {getFieldDecorator('listImg', {
210
           {getFieldDecorator('listImg', {
215
             initialValue: liveActivityData.listImg,
211
             initialValue: liveActivityData.listImg,
216
             rules: [{ required: true, message: '请上传封面图1' }],
212
             rules: [{ required: true, message: '请上传封面图1' }],
222
             rules: [{ required: true, message: '请上传封面图2' }],
218
             rules: [{ required: true, message: '请上传封面图2' }],
223
           })(<ImageUpload />)}
219
           })(<ImageUpload />)}
224
         </Form.Item> */}
220
         </Form.Item> */}
225
-        <Form.Item label="详情图" help="建议尺寸:750*1456px以上,格式:jpg,用于:直播活动详情页,点击可跳转到直播间">
221
+        <Form.Item
222
+          label="详情图"
223
+          help="建议尺寸:750*1456px以上,格式:jpg,用于:直播活动详情页,点击可跳转到直播间"
224
+        >
226
           {getFieldDecorator('detailTypeImg', {
225
           {getFieldDecorator('detailTypeImg', {
227
             initialValue: liveActivityData.detailTypeImg,
226
             initialValue: liveActivityData.detailTypeImg,
228
             rules: [{ required: true, message: '请上传详情图' }],
227
             rules: [{ required: true, message: '请上传详情图' }],
246
           )}
245
           )}
247
         </Form.Item>
246
         </Form.Item>
248
         <Form.Item wrapperCol={{ span: 15, offset: 7 }}>
247
         <Form.Item wrapperCol={{ span: 15, offset: 7 }}>
249
-          <Button type="primary" htmlType="submit" style={{ marginRight: '20px' }}>
250
-            确定
251
-          </Button>
248
+          <AuthButton name="live.edit.submit" noRight={null}>
249
+            <Button type="primary" htmlType="submit" style={{ marginRight: '20px' }}>
250
+              确定
251
+            </Button>
252
+          </AuthButton>
253
+
252
           <Button onClick={() => router.go(-1)}>取消</Button>
254
           <Button onClick={() => router.go(-1)}>取消</Button>
253
         </Form.Item>
255
         </Form.Item>
254
       </Form>
256
       </Form>

+ 8
- 4
src/pages/Live/LiveActivity/List/index.jsx View File

116
       dataIndex: 'liveActivityTitle',
116
       dataIndex: 'liveActivityTitle',
117
       key: 'liveActivityTitle',
117
       key: 'liveActivityTitle',
118
       align: 'center',
118
       align: 'center',
119
-      render: (x, row) => <Navigate onClick={toAddLive(row)}>{row.liveActivityTitle}</Navigate>,
119
+      render: (x, row) => (
120
+        <AuthButton name="live.edit" noRight={row.liveActivityTitle}>
121
+          <Navigate onClick={toAddLive(row)}>{row.liveActivityTitle}</Navigate>
122
+        </AuthButton>
123
+      ),
120
     },
124
     },
121
     {
125
     {
122
       title: '所属城市',
126
       title: '所属城市',
212
         //   <EditIcon type="record" text="数据记录" onClick={toDataReacord(record)} />
216
         //   <EditIcon type="record" text="数据记录" onClick={toDataReacord(record)} />
213
         // </AuthButton>,
217
         // </AuthButton>,
214
 
218
 
215
-        <AuthButton name="admin.live.detail.get" noRight={null}>
219
+        <AuthButton name="live.edit" noRight={null}>
216
           <EditIcon type="look" text="查看详情" onClick={toAddLive(record)} />
220
           <EditIcon type="look" text="查看详情" onClick={toAddLive(record)} />
217
         </AuthButton>,
221
         </AuthButton>,
218
       ]),
222
       ]),
305
         </Form.Item>
309
         </Form.Item>
306
       </Form>
310
       </Form>
307
 
311
 
308
-      <AuthButton name="admin.live.add.post" noRight={null}>
312
+      <AuthButton name="live.add" noRight={null}>
309
         <Button type="danger" style={{ margin: '20px 0' }} onClick={toAddLive()}>
313
         <Button type="danger" style={{ margin: '20px 0' }} onClick={toAddLive()}>
310
           新增
314
           新增
311
         </Button>
315
         </Button>
312
       </AuthButton>
316
       </AuthButton>
313
-      <AuthButton name="admin.live.del" noRight={null}>
317
+      <AuthButton name="live.delete" noRight={null}>
314
         <Button type="primary" onClick={toDelLiveActivity()} style={{ marginLeft: '30px' }}>
318
         <Button type="primary" onClick={toDelLiveActivity()} style={{ marginLeft: '30px' }}>
315
           删除
319
           删除
316
         </Button>
320
         </Button>

+ 126
- 92
src/pages/Live/LiveActivity/add/index.jsx View File

1
 import React, { useState, useEffect } from 'react';
1
 import React, { useState, useEffect } from 'react';
2
-import { Form, Input, Button, Icon, Select, message, Table, Divider, Tag, Pagination, Modal, DatePicker, Radio, Switch, InputNumber, Card } from 'antd';
2
+import {
3
+  Form,
4
+  Input,
5
+  Button,
6
+  Icon,
7
+  Select,
8
+  message,
9
+  Table,
10
+  Divider,
11
+  Tag,
12
+  Pagination,
13
+  Modal,
14
+  DatePicker,
15
+  Radio,
16
+  Switch,
17
+  InputNumber,
18
+  Card,
19
+} from 'antd';
3
 import { FormattedMessage } from 'umi-plugin-react/locale';
20
 import { FormattedMessage } from 'umi-plugin-react/locale';
4
 import XForm, { FieldTypes } from '@/components/XForm';
21
 import XForm, { FieldTypes } from '@/components/XForm';
5
 import router from 'umi/router';
22
 import router from 'umi/router';
6
 import moment from 'moment';
23
 import moment from 'moment';
7
-import SelectCity from '@/components/SelectButton/CitySelect'
8
-import BuildSelect2 from '@/components/SelectButton/BuildSelect2'
9
-import LivePlatSelect from '@/components/SelectButton/LivePlatSelect'
10
-import CitySelect3 from '@/components/SelectButton/CitySelect3'
11
-import ImageUpload from '@/components/XForm/ImageUpload'
12
-import Wangedit from '@/components/Wangedit/Wangedit'
24
+import SelectCity from '@/components/SelectButton/CitySelect';
25
+import BuildSelect2 from '@/components/SelectButton/BuildSelect2';
26
+import LivePlatSelect from '@/components/SelectButton/LivePlatSelect';
27
+import CitySelect3 from '@/components/SelectButton/CitySelect3';
28
+import ImageUpload from '@/components/XForm/ImageUpload';
29
+import Wangedit from '@/components/Wangedit/Wangedit';
13
 import Navigate from '@/components/Navigate';
30
 import Navigate from '@/components/Navigate';
14
 import apis from '@/services/apis';
31
 import apis from '@/services/apis';
15
 import request from '@/utils/request';
32
 import request from '@/utils/request';
16
 import AuthButton from '@/components/AuthButton';
33
 import AuthButton from '@/components/AuthButton';
17
 import Prompt from 'umi/prompt';
34
 import Prompt from 'umi/prompt';
18
-import WxWorkLivingRoom from '@/components/LivingRoom/WxWork'
35
+import WxWorkLivingRoom from '@/components/LivingRoom/WxWork';
19
 
36
 
20
 const { Option } = Select;
37
 const { Option } = Select;
21
 const { MonthPicker, RangePicker, WeekPicker } = DatePicker;
38
 const { MonthPicker, RangePicker, WeekPicker } = DatePicker;
22
 
39
 
23
-let cityId = ''
40
+let cityId = '';
24
 
41
 
25
 const header = props => {
42
 const header = props => {
26
-  const { salesBatchId } = props.location.query
27
-  console.log(salesBatchId)
28
-  const [ saleBatchData, setSaleBatchData ] = useState({})
29
-  const [showHelp, setShowHelp] = useState(false)
43
+  const { salesBatchId } = props.location.query;
44
+  console.log(salesBatchId);
45
+  const [saleBatchData, setSaleBatchData] = useState({});
46
+  const [showHelp, setShowHelp] = useState(false);
30
 
47
 
31
-  const cancelPage = () =>{
48
+  const cancelPage = () => {
32
     router.push({
49
     router.push({
33
       pathname: '/activity/liveActivity/list',
50
       pathname: '/activity/liveActivity/list',
34
     });
51
     });
35
-  }
52
+  };
36
 
53
 
37
-   //打开新页面
38
-   const openIndexImg = () => {
39
-    const newWin=window.open('about:blank');
40
-    newWin.location.href="http://njcj.oss-cn-shanghai.aliyuncs.com/%E6%95%99%E7%A8%8B.png"
41
-  }
54
+  //打开新页面
55
+  const openIndexImg = () => {
56
+    const newWin = window.open('about:blank');
57
+    newWin.location.href = 'http://njcj.oss-cn-shanghai.aliyuncs.com/%E6%95%99%E7%A8%8B.png';
58
+  };
42
 
59
 
43
   function highlightsTypeChange(e) {
60
   function highlightsTypeChange(e) {
44
-    console.log(e.target.value,"ee")
45
-    setTypeState(e.target.value)
61
+    console.log(e.target.value, 'ee');
62
+    setTypeState(e.target.value);
46
   }
63
   }
47
 
64
 
48
   function disabledDate(current) {
65
   function disabledDate(current) {
50
     return current && current < moment().endOf('day');
67
     return current && current < moment().endOf('day');
51
   }
68
   }
52
 
69
 
53
-  function handleSubmit (e) {
70
+  function handleSubmit(e) {
54
     e.preventDefault();
71
     e.preventDefault();
55
     props.form.validateFields((err, values) => {
72
     props.form.validateFields((err, values) => {
56
-      if (!err){
57
-        let {liveTime, ...submitValue} = values
58
-        submitValue.liveStartDate = moment(submitValue.liveStartDate._d).format('YYYY-MM-DD HH:mm:ss')
59
-        submitValue.liveEndDate = moment(submitValue.liveEndDate._d).format('YYYY-MM-DD HH:mm:ss')
60
-        
61
-        if (values.liveStartDate > values.liveEndDate){
62
-          message.info("直播结束时间大于开始时间")
73
+      if (!err) {
74
+        let { liveTime, ...submitValue } = values;
75
+        submitValue.liveStartDate = moment(submitValue.liveStartDate._d).format(
76
+          'YYYY-MM-DD HH:mm:ss',
77
+        );
78
+        submitValue.liveEndDate = moment(submitValue.liveEndDate._d).format('YYYY-MM-DD HH:mm:ss');
79
+
80
+        if (values.liveStartDate > values.liveEndDate) {
81
+          message.info('直播结束时间大于开始时间');
63
           return;
82
           return;
64
         }
83
         }
65
 
84
 
66
-        request({ ...apis.taliveActivity.addTaLiveActivity, data: { ...submitValue },}).then((data) => {
67
-          message.info("保存成功")
68
-          console.log(data,"datattttttt")
69
-          router.go('-1');
70
-        }).catch((err) => {
71
-          message.info(err.msg || err.message)
72
-        })
85
+        request({ ...apis.taliveActivity.addTaLiveActivity, data: { ...submitValue } })
86
+          .then(data => {
87
+            message.info('保存成功');
88
+            console.log(data, 'datattttttt');
89
+            router.go('-1');
90
+          })
91
+          .catch(err => {
92
+            message.info(err.msg || err.message);
93
+          });
73
       }
94
       }
74
     });
95
     });
75
   }
96
   }
82
         <Form.Item label="所属城市">
103
         <Form.Item label="所属城市">
83
           {getFieldDecorator('cityId', {
104
           {getFieldDecorator('cityId', {
84
             rules: [{ required: true, message: ' 请选择所属城市' }],
105
             rules: [{ required: true, message: ' 请选择所属城市' }],
85
-          })(<CitySelect3 buildingId={props.form.getFieldValue('buildingId')}/>)}
106
+          })(<CitySelect3 buildingId={props.form.getFieldValue('buildingId')} />)}
86
         </Form.Item>
107
         </Form.Item>
87
         <Form.Item label="所属楼盘">
108
         <Form.Item label="所属楼盘">
88
           {getFieldDecorator('buildingId', {
109
           {getFieldDecorator('buildingId', {
89
             rules: [{ required: true, message: ' 请选择所属楼盘' }],
110
             rules: [{ required: true, message: ' 请选择所属楼盘' }],
90
-          })(<BuildSelect2 cityId={props.form.getFieldValue('cityId')}/>)}
111
+          })(<BuildSelect2 cityId={props.form.getFieldValue('cityId')} />)}
91
         </Form.Item>
112
         </Form.Item>
92
         <Form.Item label="直播活动标题">
113
         <Form.Item label="直播活动标题">
93
           {getFieldDecorator('liveActivityTitle', {
114
           {getFieldDecorator('liveActivityTitle', {
96
         </Form.Item>
117
         </Form.Item>
97
         <Form.Item label="直播开始时间">
118
         <Form.Item label="直播开始时间">
98
           {getFieldDecorator('liveStartDate', {
119
           {getFieldDecorator('liveStartDate', {
99
-                rules: [
100
-                  {
101
-                    required: true,
102
-                    message: '请选择直播开始时间',
103
-                  },
104
-                ],
105
-              })(<DatePicker placeholder="预计开始时间"style={{ width: '500px' }}format="YYYY-MM-DD HH:mm:ss" showTime={{ format: 'HH:mm:ss' }}/>)}
120
+            rules: [
121
+              {
122
+                required: true,
123
+                message: '请选择直播开始时间',
124
+              },
125
+            ],
126
+          })(
127
+            <DatePicker
128
+              placeholder="预计开始时间"
129
+              style={{ width: '500px' }}
130
+              format="YYYY-MM-DD HH:mm:ss"
131
+              showTime={{ format: 'HH:mm:ss' }}
132
+            />,
133
+          )}
106
         </Form.Item>
134
         </Form.Item>
107
         <Form.Item label="直播结束时间">
135
         <Form.Item label="直播结束时间">
108
           {getFieldDecorator('liveEndDate', {
136
           {getFieldDecorator('liveEndDate', {
109
-                rules: [
110
-                  {
111
-                    required: true,
112
-                    message: '请选择直播结束时间',
113
-                  },
114
-                ],
115
-              })(<DatePicker placeholder="预计结束时间" disabledDate={disabledDate} style={{ width: '500px' }}format="YYYY-MM-DD HH:mm:ss" showTime={{ format: 'HH:mm:ss' }}/>)}
137
+            rules: [
138
+              {
139
+                required: true,
140
+                message: '请选择直播结束时间',
141
+              },
142
+            ],
143
+          })(
144
+            <DatePicker
145
+              placeholder="预计结束时间"
146
+              disabledDate={disabledDate}
147
+              style={{ width: '500px' }}
148
+              format="YYYY-MM-DD HH:mm:ss"
149
+              showTime={{ format: 'HH:mm:ss' }}
150
+            />,
151
+          )}
116
         </Form.Item>
152
         </Form.Item>
117
         <Form.Item label="是否新房">
153
         <Form.Item label="是否新房">
118
           {getFieldDecorator('isNewHouse', {
154
           {getFieldDecorator('isNewHouse', {
119
             valuePropName: 'checked',
155
             valuePropName: 'checked',
120
-            initialValue:  false,
121
-          })(<Switch defaultChecked={false}/>)}
156
+            initialValue: false,
157
+          })(<Switch defaultChecked={false} />)}
122
         </Form.Item>
158
         </Form.Item>
123
 
159
 
124
         {/* <Form.Item label="直播小程序">
160
         {/* <Form.Item label="直播小程序">
132
           })(<Input maxLength={1000} placeholder="点击右侧按钮查看如何获取房间参数" style={{width:'680px'}}/>)}<Navigate onClick={openIndexImg}>不知道怎么填?查看说明</Navigate>
168
           })(<Input maxLength={1000} placeholder="点击右侧按钮查看如何获取房间参数" style={{width:'680px'}}/>)}<Navigate onClick={openIndexImg}>不知道怎么填?查看说明</Navigate>
133
         </Form.Item> */}
169
         </Form.Item> */}
134
         <Form.Item label="选择直播间">
170
         <Form.Item label="选择直播间">
135
-          {
136
-            getFieldDecorator('liveRoomParam', {
137
-              rules: [{ required: true, message: '请选择直播间' }],
138
-            })(<WxWorkLivingRoom placeholder="请选择直播间" />)
139
-          }
171
+          {getFieldDecorator('liveRoomParam', {
172
+            rules: [{ required: true, message: '请选择直播间' }],
173
+          })(<WxWorkLivingRoom placeholder="请选择直播间" />)}
140
         </Form.Item>
174
         </Form.Item>
141
         <Form.Item label="封面图" help="建议尺寸:335px*201px,比例5:3,格式:jpg,用于:活动列表">
175
         <Form.Item label="封面图" help="建议尺寸:335px*201px,比例5:3,格式:jpg,用于:活动列表">
142
-              {getFieldDecorator('listImg', {
143
-                  rules: [{ required: true, message: '请上传封面图1' }],
144
-              })(
145
-                <ImageUpload />,
146
-              )}
147
-        </Form.Item>  
176
+          {getFieldDecorator('listImg', {
177
+            rules: [{ required: true, message: '请上传封面图1' }],
178
+          })(<ImageUpload />)}
179
+        </Form.Item>
148
         {/* <Form.Item label="封面图2" help="建议尺寸:750*250px,比例3:1,格式:jpg,用于:项目详情页">
180
         {/* <Form.Item label="封面图2" help="建议尺寸:750*250px,比例3:1,格式:jpg,用于:项目详情页">
149
               {getFieldDecorator('detailImg', {
181
               {getFieldDecorator('detailImg', {
150
                   rules: [{ required: true, message: '请上传封面图2' }],
182
                   rules: [{ required: true, message: '请上传封面图2' }],
152
                 <ImageUpload />,
184
                 <ImageUpload />,
153
               )}
185
               )}
154
         </Form.Item>   */}
186
         </Form.Item>   */}
155
-        <Form.Item label="详情图" help="建议尺寸:750*1456px以上,格式:jpg,用于:直播活动详情页,点击可跳转到直播间">
156
-              {getFieldDecorator('detailTypeImg', {
157
-                  rules: [{ required: true, message: '请上传详情图' }],
158
-              })(
159
-                <ImageUpload />,
160
-              )}
161
-        </Form.Item>      
187
+        <Form.Item
188
+          label="详情图"
189
+          help="建议尺寸:750*1456px以上,格式:jpg,用于:直播活动详情页,点击可跳转到直播间"
190
+        >
191
+          {getFieldDecorator('detailTypeImg', {
192
+            rules: [{ required: true, message: '请上传详情图' }],
193
+          })(<ImageUpload />)}
194
+        </Form.Item>
162
         <Form.Item label="权重">
195
         <Form.Item label="权重">
163
-              {getFieldDecorator('weight', {
164
-                  rules: [{ required: true, message: '请设置权重' }],
165
-              })(
166
-                <InputNumber placeholder="权重越大越靠前" style={{width:'150px'}}/>
167
-              )}
196
+          {getFieldDecorator('weight', {
197
+            rules: [{ required: true, message: '请设置权重' }],
198
+          })(<InputNumber placeholder="权重越大越靠前" style={{ width: '150px' }} />)}
168
         </Form.Item>
199
         </Form.Item>
169
         <Form.Item label="发布状态">
200
         <Form.Item label="发布状态">
170
           {getFieldDecorator('status', {
201
           {getFieldDecorator('status', {
171
-              rules: [{ required: true, message: '请选择发布状态' }],
172
-            })(<Select placeholder="发布状态" style={{ width: '300px' }}>
173
-            <Option value="0">否</Option>
174
-            <Option value="1">是</Option>
175
-          </Select>)}
202
+            rules: [{ required: true, message: '请选择发布状态' }],
203
+          })(
204
+            <Select placeholder="发布状态" style={{ width: '300px' }}>
205
+              <Option value="0">否</Option>
206
+              <Option value="1">是</Option>
207
+            </Select>,
208
+          )}
176
         </Form.Item>
209
         </Form.Item>
177
         <Form.Item wrapperCol={{ span: 15, offset: 7 }}>
210
         <Form.Item wrapperCol={{ span: 15, offset: 7 }}>
178
-          <Button type="primary" htmlType="submit"style={{marginRight:'20px'}}>
179
-            确定
180
-          </Button>
181
-          <Button onClick={() => router.go(-1)}>
182
-            取消
183
-          </Button>
211
+          <AuthButton name="live.add.submit" noRight={null}>
212
+            <Button type="primary" htmlType="submit" style={{ marginRight: '20px' }}>
213
+              确定
214
+            </Button>
215
+          </AuthButton>
216
+
217
+          <Button onClick={() => router.go(-1)}>取消</Button>
184
         </Form.Item>
218
         </Form.Item>
185
       </Form>
219
       </Form>
186
     </Card>
220
     </Card>
187
-  )
188
-}
221
+  );
222
+};
189
 
223
 
190
 const WrappedHeader = Form.create({ name: 'header' })(header);
224
 const WrappedHeader = Form.create({ name: 'header' })(header);
191
 
225
 
192
-export default WrappedHeader
226
+export default WrappedHeader;

+ 7
- 3
src/pages/Live/video/Edit/index.jsx View File

24
 import ImageUpload from '@/components/XForm/ImageUpload';
24
 import ImageUpload from '@/components/XForm/ImageUpload';
25
 import request from '@/utils/request';
25
 import request from '@/utils/request';
26
 import Navigate from '@/components/Navigate';
26
 import Navigate from '@/components/Navigate';
27
+import AuthButton from '@/components/AuthButton';
27
 
28
 
28
 const header = props => {
29
 const header = props => {
29
   console.log(props);
30
   console.log(props);
168
         </Form.Item>
169
         </Form.Item>
169
 
170
 
170
         <Form.Item wrapperCol={{ span: 15, offset: 7 }}>
171
         <Form.Item wrapperCol={{ span: 15, offset: 7 }}>
171
-          <Button type="primary" htmlType="submit" style={{ marginRight: '20px' }}>
172
-            确定
173
-          </Button>
172
+          <AuthButton name="video.submit" noRight={null}>
173
+            <Button type="primary" htmlType="submit" style={{ marginRight: '20px' }}>
174
+              确定
175
+            </Button>
176
+          </AuthButton>
177
+
174
           <Button onClick={() => router.go(-1)}>取消</Button>
178
           <Button onClick={() => router.go(-1)}>取消</Button>
175
         </Form.Item>
179
         </Form.Item>
176
       </Form>
180
       </Form>

+ 18
- 17
src/pages/Live/video/List/index.jsx View File

37
     });
37
     });
38
   };
38
   };
39
 
39
 
40
-
41
   const onPublish = row => {
40
   const onPublish = row => {
42
-   
43
     request({ ...apis.video.publish, urlData: { id: row.videoId } })
41
     request({ ...apis.video.publish, urlData: { id: row.videoId } })
44
       .then(() => {
42
       .then(() => {
45
-        message.success( '操作成功');
43
+        message.success('操作成功');
46
         // setLoading(false);
44
         // setLoading(false);
47
         ref.current.reload();
45
         ref.current.reload();
48
       })
46
       })
49
       .catch(err => {
47
       .catch(err => {
50
         console.error(err);
48
         console.error(err);
51
-        message.error( '操作失败');
49
+        message.error('操作失败');
52
       });
50
       });
53
   };
51
   };
54
 
52
 
55
   const onDelete = row => {
53
   const onDelete = row => {
56
-
57
     request({ ...apis.video.delete, urlData: { id: row.videoId } })
54
     request({ ...apis.video.delete, urlData: { id: row.videoId } })
58
       .then(() => {
55
       .then(() => {
59
-        message.success( '删除成功');
56
+        message.success('删除成功');
60
         // setLoading(false);
57
         // setLoading(false);
61
         ref.current.reload();
58
         ref.current.reload();
62
       })
59
       })
63
       .catch(err => {
60
       .catch(err => {
64
         console.error(err);
61
         console.error(err);
65
-        message.error( '操作失败');
62
+        message.error('操作失败');
66
       });
63
       });
67
   };
64
   };
68
 
65
 
82
       align: 'center',
79
       align: 'center',
83
       width: '20%',
80
       width: '20%',
84
       render: (x, row) => (
81
       render: (x, row) => (
85
-        <Navigate onClick={() => toVideoEdit(row)}>
86
-          <Typography.Text ellipsis>{x}</Typography.Text>
87
-        </Navigate>
82
+        <AuthButton name="video.publish" noRight={x}>
83
+          <Navigate onClick={() => toVideoEdit(row)}>
84
+            <Typography.Text ellipsis>{x}</Typography.Text>
85
+          </Navigate>
86
+        </AuthButton>
88
       ),
87
       ),
89
     },
88
     },
90
     {
89
     {
102
       dataIndex: 'lookNum',
101
       dataIndex: 'lookNum',
103
       key: 'lookNum',
102
       key: 'lookNum',
104
       align: 'center',
103
       align: 'center',
105
-      render: (x, row) =>x||0
104
+      render: (x, row) => x || 0,
106
     },
105
     },
107
     {
106
     {
108
       title: '归属楼盘',
107
       title: '归属楼盘',
123
       key: 'handle',
122
       key: 'handle',
124
       align: 'center',
123
       align: 'center',
125
       render: withActions((x, row) => [
124
       render: withActions((x, row) => [
126
-        <AuthButton name="admin.buildingDynamic.update.put" noRight={null}>
125
+        <AuthButton name="video.edit" noRight={null}>
127
           <OperButton onClick={() => toVideoEdit(row)}>编辑</OperButton>
126
           <OperButton onClick={() => toVideoEdit(row)}>编辑</OperButton>
128
           {/* <EditIcon
127
           {/* <EditIcon
129
         type="edit"
128
         type="edit"
132
       /> */}
131
       /> */}
133
         </AuthButton>,
132
         </AuthButton>,
134
 
133
 
135
-        <AuthButton name="admin.buildingDynamic.send.dynamicId.put" noRight={null}>
134
+        <AuthButton name="video.publish" noRight={null}>
136
           <OperButton onClick={() => onPublish(row)}>
135
           <OperButton onClick={() => onPublish(row)}>
137
             {row.isPublish ? '取消发布' : '发布'}
136
             {row.isPublish ? '取消发布' : '发布'}
138
           </OperButton>
137
           </OperButton>
143
           /> */}
142
           /> */}
144
         </AuthButton>,
143
         </AuthButton>,
145
 
144
 
146
-        <AuthButton name="admin.building.delete" noRight={null}>
145
+        <AuthButton name="video.delete" noRight={null}>
147
           <OperButton.Confirm
146
           <OperButton.Confirm
148
             title="确认删除?"
147
             title="确认删除?"
149
             content="删除之后不可恢复"
148
             content="删除之后不可恢复"
158
 
157
 
159
   const actionRender = () => {
158
   const actionRender = () => {
160
     return (
159
     return (
161
-      <Button type="primary" icon="plus" onClick={() => toVideoEdit()}>
162
-        新增
163
-      </Button>
160
+      <AuthButton name="video.add" noRight={null}>
161
+        <Button type="primary" icon="plus" onClick={() => toVideoEdit()}>
162
+          新增
163
+        </Button>
164
+      </AuthButton>
164
     );
165
     );
165
   };
166
   };
166
 
167
 

+ 12
- 12
src/pages/activity/SignupActivity/edit/Basic.jsx View File

7
 import Wangedit from '@/components/Wangedit/Wangedit';
7
 import Wangedit from '@/components/Wangedit/Wangedit';
8
 import request from '@/utils/request';
8
 import request from '@/utils/request';
9
 import ImageUploader from '@/components/XForm/ImageUpload';
9
 import ImageUploader from '@/components/XForm/ImageUpload';
10
+import AuthButton from '@/components/AuthButton';
10
 
11
 
11
 const { RangePicker } = DatePicker;
12
 const { RangePicker } = DatePicker;
12
 
13
 
30
     setIsEnlist(e.target.value);
31
     setIsEnlist(e.target.value);
31
   };
32
   };
32
 
33
 
33
-  const { dynamicId,type } = props;
34
+  const { dynamicId, type } = props;
34
 
35
 
35
   // 查询详情
36
   // 查询详情
36
   const getDynamicData = dynamicId => {
37
   const getDynamicData = dynamicId => {
90
           values.enlistEnd = moment(enlistEnd).format('YYYY-MM-DD HH:mm');
91
           values.enlistEnd = moment(enlistEnd).format('YYYY-MM-DD HH:mm');
91
         }
92
         }
92
 
93
 
93
-        values.type = type
94
+        values.type = type;
94
         if (dynamicId) {
95
         if (dynamicId) {
95
           const checks = checkTime();
96
           const checks = checkTime();
96
           if (checks != true) {
97
           if (checks != true) {
103
             message.info('活动人数必须大于已报名人数');
104
             message.info('活动人数必须大于已报名人数');
104
             return;
105
             return;
105
           }
106
           }
106
-          
107
+
107
           values.dynamicId = dynamicId;
108
           values.dynamicId = dynamicId;
108
           request({ ...apis.activity.update, data: values })
109
           request({ ...apis.activity.update, data: values })
109
             .then(data => {
110
             .then(data => {
117
           request({ ...apis.activity.add, data: { ...values } })
118
           request({ ...apis.activity.add, data: { ...values } })
118
             .then(data => {
119
             .then(data => {
119
               message.info('保存成功');
120
               message.info('保存成功');
120
-              router.go(-1)
121
+              router.go(-1);
121
             })
122
             })
122
             .catch(err => {
123
             .catch(err => {
123
               message.info(err.msg || err.message);
124
               message.info(err.msg || err.message);
133
   const { getFieldDecorator } = props.form;
134
   const { getFieldDecorator } = props.form;
134
   return (
135
   return (
135
     <>
136
     <>
136
-      <Form {...formItemLayout} onSubmit={handleSubmit} style={{maxWidth: '1000px'}}>
137
+      <Form {...formItemLayout} onSubmit={handleSubmit} style={{ maxWidth: '1000px' }}>
137
         <Form.Item label="所属项目">
138
         <Form.Item label="所属项目">
138
           {getFieldDecorator('buildingId', {
139
           {getFieldDecorator('buildingId', {
139
             rules: [
140
             rules: [
144
             ],
145
             ],
145
           })(<BuildSelect disabled={disable} />)}
146
           })(<BuildSelect disabled={disable} />)}
146
         </Form.Item>
147
         </Form.Item>
147
-        <Form.Item
148
-          label="活动封面图"
149
-          help="建议图片尺寸:690px*388px,比例16:9,格式:jpg"
150
-        >
148
+        <Form.Item label="活动封面图" help="建议图片尺寸:690px*388px,比例16:9,格式:jpg">
151
           {getFieldDecorator('listImgUrl', {
149
           {getFieldDecorator('listImgUrl', {
152
             rules: [
150
             rules: [
153
               {
151
               {
271
           <span style={{ marginLeft: 30, color: 'grey' }}>数字越大越靠前</span>
269
           <span style={{ marginLeft: 30, color: 'grey' }}>数字越大越靠前</span>
272
         </Form.Item>
270
         </Form.Item>
273
         <Form.Item wrapperCol={{ span: 12, offset: 8 }}>
271
         <Form.Item wrapperCol={{ span: 12, offset: 8 }}>
274
-          <Button type="primary" htmlType="submit">
275
-            确认
276
-          </Button>
272
+          <AuthButton name="activity.enroll.submit" noRight={null}>
273
+            <Button type="primary" htmlType="submit">
274
+              确认
275
+            </Button>
276
+          </AuthButton>
277
           &nbsp;&nbsp;&nbsp;&nbsp;
277
           &nbsp;&nbsp;&nbsp;&nbsp;
278
           <Button onClick={() => cancelPage()}>取消</Button>
278
           <Button onClick={() => cancelPage()}>取消</Button>
279
         </Form.Item>
279
         </Form.Item>

+ 22
- 16
src/pages/activity/SignupActivity/index.jsx View File

24
 import request from '@/utils/request';
24
 import request from '@/utils/request';
25
 import QueryTable from '@/components/QueryTable';
25
 import QueryTable from '@/components/QueryTable';
26
 
26
 
27
-const type= 'dymic'
27
+const type = 'dymic';
28
 
28
 
29
 const SignupActivity = props => {
29
 const SignupActivity = props => {
30
   const ref = useRef();
30
   const ref = useRef();
190
       align: 'center',
190
       align: 'center',
191
       width: '20%',
191
       width: '20%',
192
       render: (x, row) => (
192
       render: (x, row) => (
193
-        <Navigate onClick={toSignupActivityDetail(row.dynamicId)}>
194
-          <Typography.Text ellipsis>{row.title}</Typography.Text>
195
-        </Navigate>
193
+        <AuthButton name="activity.enroll.detail" noRight={null}>
194
+          <Navigate onClick={toSignupActivityDetail(row.dynamicId)}>
195
+            <Typography.Text ellipsis>{row.title}</Typography.Text>
196
+          </Navigate>
197
+        </AuthButton>
196
       ),
198
       ),
197
     },
199
     },
198
     {
200
     {
258
       key: 'handle',
260
       key: 'handle',
259
       align: 'center',
261
       align: 'center',
260
       render: withActions((x, row) => [
262
       render: withActions((x, row) => [
261
-        <AuthButton name="admin.buildingDynamic.send.dynamicId.put" noRight={null}>
263
+        <AuthButton name="activity.enroll.publish" noRight={null}>
262
           <EditIcon
264
           <EditIcon
263
             type={row.status === 1 ? 'cancel' : 'publish'}
265
             type={row.status === 1 ? 'cancel' : 'publish'}
264
             text={row.status === 1 ? '取消发布' : '发布'}
266
             text={row.status === 1 ? '取消发布' : '发布'}
269
         // //   <EditIcon type="look" text="查看详情" onClick={toSignupActivityDetail(row.dynamicId)} />,
271
         // //   <EditIcon type="look" text="查看详情" onClick={toSignupActivityDetail(row.dynamicId)} />,
270
 
272
 
271
         row.activityStatus === 0 ? (
273
         row.activityStatus === 0 ? (
272
-          <AuthButton name="admin.buildingDynamic.finish.put" noRight={null}>
274
+          <AuthButton name="activity.enroll.finish" noRight={null}>
273
             <EditIcon type="end" text="结束活动" onClick={finishDynamic.bind(this, row)} />
275
             <EditIcon type="end" text="结束活动" onClick={finishDynamic.bind(this, row)} />
274
           </AuthButton>
276
           </AuthButton>
275
         ) : null,
277
         ) : null,
276
 
278
 
277
-        <EditIcon
278
-          type={row.home === 1 ? 'cancel' : 'top'}
279
-          text={row.home === 1 ? '取消推首页' : '推荐首页'}
280
-          onClick={homeDynamic(row)}
281
-        />,
279
+        <AuthButton name="activity.enroll.index" noRight={null}>
280
+          <EditIcon
281
+            type={row.home === 1 ? 'cancel' : 'top'}
282
+            text={row.home === 1 ? '取消推首页' : '推荐首页'}
283
+            onClick={homeDynamic(row)}
284
+          />
285
+        </AuthButton>,
282
 
286
 
283
         row.activityStatus === 0 || row.activityStatus === 1 ? (
287
         row.activityStatus === 0 || row.activityStatus === 1 ? (
284
-          <AuthButton name="admin.buildingDynamic.update.put" noRight={null}>
288
+          <AuthButton name="activity.enroll.edit" noRight={null}>
285
             <EditIcon
289
             <EditIcon
286
               type="edit"
290
               type="edit"
287
               text="编辑"
291
               text="编辑"
295
 
299
 
296
   const actionRender = () => {
300
   const actionRender = () => {
297
     return (
301
     return (
298
-      <Button type="primary" icon="plus" onClick={() => toSignupActivityEdit()}>
299
-        新增
300
-      </Button>
302
+      <AuthButton name="activity.enroll.add" noRight={null}>
303
+        <Button type="primary" icon="plus" onClick={() => toSignupActivityEdit()}>
304
+          新增
305
+        </Button>
306
+      </AuthButton>
301
     );
307
     );
302
   };
308
   };
303
 
309
 
310
       columns={columns}
316
       columns={columns}
311
       postData={data => {
317
       postData={data => {
312
         data.time && (data.time = `${moment(data.time).format('YYYY-MM-DDT00:00:00.000')}Z`);
318
         data.time && (data.time = `${moment(data.time).format('YYYY-MM-DDT00:00:00.000')}Z`);
313
-        data.type=type
319
+        data.type = type;
314
         return data;
320
         return data;
315
       }}
321
       }}
316
       actionRender={actionRender}
322
       actionRender={actionRender}

+ 1
- 1
src/pages/activity/SignupActivity/registrationRecord.jsx View File

200
         columns={columns}
200
         columns={columns}
201
         pagination={{ total: data.total, onChange: changePageNum }}
201
         pagination={{ total: data.total, onChange: changePageNum }}
202
         loading={loading}
202
         loading={loading}
203
-        rowKey="activity"
203
+        rowKey="enlistId"
204
       />
204
       />
205
       {/* <div style={{ display: 'flex', justifyContent: 'flex-end', marginTop: '30px' }}>
205
       {/* <div style={{ display: 'flex', justifyContent: 'flex-end', marginTop: '30px' }}>
206
         <Pagination showQuickJumper defaultCurrent={1} total={data.total} onChange={changePageNum} current={data.current}/>
206
         <Pagination showQuickJumper defaultCurrent={1} total={data.total} onChange={changePageNum} current={data.current}/>

+ 8
- 7
src/pages/activity/groupRoomActivity/edit/Basic.jsx View File

7
 import Wangedit from '@/components/Wangedit/Wangedit';
7
 import Wangedit from '@/components/Wangedit/Wangedit';
8
 import request from '@/utils/request';
8
 import request from '@/utils/request';
9
 import ImageUploader from '@/components/XForm/ImageUpload';
9
 import ImageUploader from '@/components/XForm/ImageUpload';
10
+import AuthButton from '@/components/AuthButton';
10
 
11
 
11
 const { RangePicker } = DatePicker;
12
 const { RangePicker } = DatePicker;
12
 
13
 
253
             ],
254
             ],
254
           })(<Input type="number" min={1} />)}
255
           })(<Input type="number" min={1} />)}
255
         </Form.Item> */}
256
         </Form.Item> */}
256
-        <Form.Item label="团房价">
257
-          {getFieldDecorator('groupBuyPrice', {
258
-          })(<Input />)}
259
-        </Form.Item>
257
+        <Form.Item label="团房价">{getFieldDecorator('groupBuyPrice', {})(<Input />)}</Form.Item>
260
 
258
 
261
         <Form.Item label="活动详情">{getFieldDecorator('desc')(<Wangedit />)}</Form.Item>
259
         <Form.Item label="活动详情">{getFieldDecorator('desc')(<Wangedit />)}</Form.Item>
262
         <Form.Item label="报名时间">
260
         <Form.Item label="报名时间">
281
           <span style={{ marginLeft: 30, color: 'grey' }}>数字越大越靠前</span>
279
           <span style={{ marginLeft: 30, color: 'grey' }}>数字越大越靠前</span>
282
         </Form.Item>
280
         </Form.Item>
283
         <Form.Item wrapperCol={{ span: 12, offset: 8 }}>
281
         <Form.Item wrapperCol={{ span: 12, offset: 8 }}>
284
-          <Button type="primary" htmlType="submit">
285
-            确认
286
-          </Button>
282
+          <AuthButton name="activity.group.submit" noRight={null}>
283
+            <Button type="primary" htmlType="submit">
284
+              确认
285
+            </Button>
286
+           
287
+          </AuthButton>
287
           &nbsp;&nbsp;&nbsp;&nbsp;
288
           &nbsp;&nbsp;&nbsp;&nbsp;
288
           <Button onClick={() => cancelPage()}>取消</Button>
289
           <Button onClick={() => cancelPage()}>取消</Button>
289
         </Form.Item>
290
         </Form.Item>

+ 22
- 16
src/pages/activity/groupRoomActivity/index.jsx View File

24
 import request from '@/utils/request';
24
 import request from '@/utils/request';
25
 import QueryTable from '@/components/QueryTable';
25
 import QueryTable from '@/components/QueryTable';
26
 
26
 
27
-const type= 'house'
27
+const type = 'house';
28
 
28
 
29
 const GroupRoomActivity = props => {
29
 const GroupRoomActivity = props => {
30
   const ref = useRef();
30
   const ref = useRef();
190
       align: 'center',
190
       align: 'center',
191
       width: '20%',
191
       width: '20%',
192
       render: (x, row) => (
192
       render: (x, row) => (
193
-        <Navigate onClick={toSignupActivityDetail(row.dynamicId)}>
194
-          <Typography.Text ellipsis>{row.title}</Typography.Text>
195
-        </Navigate>
193
+        <AuthButton name="activity.group.detail" noRight={row.title}>
194
+          <Navigate onClick={toSignupActivityDetail(row.dynamicId)}>
195
+            <Typography.Text ellipsis>{row.title}</Typography.Text>
196
+          </Navigate>
197
+        </AuthButton>
196
       ),
198
       ),
197
     },
199
     },
198
     {
200
     {
258
       key: 'handle',
260
       key: 'handle',
259
       align: 'center',
261
       align: 'center',
260
       render: withActions((x, row) => [
262
       render: withActions((x, row) => [
261
-        <AuthButton name="admin.buildingDynamic.send.dynamicId.put" noRight={null}>
263
+        <AuthButton name="activity.group.publish" noRight={null}>
262
           <EditIcon
264
           <EditIcon
263
             type={row.status === 1 ? 'cancel' : 'publish'}
265
             type={row.status === 1 ? 'cancel' : 'publish'}
264
             text={row.status === 1 ? '取消发布' : '发布'}
266
             text={row.status === 1 ? '取消发布' : '发布'}
269
         // //   <EditIcon type="look" text="查看详情" onClick={toSignupActivityDetail(row.dynamicId)} />,
271
         // //   <EditIcon type="look" text="查看详情" onClick={toSignupActivityDetail(row.dynamicId)} />,
270
 
272
 
271
         row.activityStatus === 0 ? (
273
         row.activityStatus === 0 ? (
272
-          <AuthButton name="admin.buildingDynamic.finish.put" noRight={null}>
274
+          <AuthButton name="activity.group.finish" noRight={null}>
273
             <EditIcon type="end" text="结束活动" onClick={finishDynamic.bind(this, row)} />
275
             <EditIcon type="end" text="结束活动" onClick={finishDynamic.bind(this, row)} />
274
           </AuthButton>
276
           </AuthButton>
275
         ) : null,
277
         ) : null,
282
         //   />
284
         //   />
283
         // </AuthButton>,
285
         // </AuthButton>,
284
 
286
 
285
-        <EditIcon
286
-          type={row.home === 1 ? 'cancel' : 'top'}
287
-          text={row.home === 1 ? '取消推首页' : '推荐首页'}
288
-          onClick={homeDynamic(row)}
289
-        />,
287
+        <AuthButton name="activity.group.index" noRight={null}>
288
+          <EditIcon
289
+            type={row.home === 1 ? 'cancel' : 'top'}
290
+            text={row.home === 1 ? '取消推首页' : '推荐首页'}
291
+            onClick={homeDynamic(row)}
292
+          />
293
+        </AuthButton>,
290
 
294
 
291
         //   <AuthButton name="admin.buildingDynamic.dataRecord" noRight={null}>
295
         //   <AuthButton name="admin.buildingDynamic.dataRecord" noRight={null}>
292
         //     <EditIcon type="record" text="数据记录" onClick={toDataReacord(row.dynamicId)} />
296
         //     <EditIcon type="record" text="数据记录" onClick={toDataReacord(row.dynamicId)} />
293
         //   </AuthButton>,
297
         //   </AuthButton>,
294
 
298
 
295
         row.activityStatus === 0 || row.activityStatus === 1 ? (
299
         row.activityStatus === 0 || row.activityStatus === 1 ? (
296
-          <AuthButton name="admin.buildingDynamic.update.put" noRight={null}>
300
+          <AuthButton name="activity.group.edit" noRight={null}>
297
             <EditIcon
301
             <EditIcon
298
               type="edit"
302
               type="edit"
299
               text="编辑"
303
               text="编辑"
307
 
311
 
308
   const actionRender = () => {
312
   const actionRender = () => {
309
     return (
313
     return (
310
-      <Button type="primary" icon="plus" onClick={() => toSignupActivityEdit()}>
311
-        新增
312
-      </Button>
314
+      <AuthButton name="activity.group.add" noRight={null}>
315
+        <Button type="primary" icon="plus" onClick={() => toSignupActivityEdit()}>
316
+          新增
317
+        </Button>
318
+      </AuthButton>
313
     );
319
     );
314
   };
320
   };
315
 
321
 
322
       columns={columns}
328
       columns={columns}
323
       postData={data => {
329
       postData={data => {
324
         data.time && (data.time = `${moment(data.time).format('YYYY-MM-DDT00:00:00.000')}Z`);
330
         data.time && (data.time = `${moment(data.time).format('YYYY-MM-DDT00:00:00.000')}Z`);
325
-        data.type=type
331
+        data.type = type;
326
         return data;
332
         return data;
327
       }}
333
       }}
328
       actionRender={actionRender}
334
       actionRender={actionRender}

+ 3
- 3
src/pages/activity/groupRoomActivity/registrationRecord.jsx View File

195
           导出
195
           导出
196
         </Button>
196
         </Button>
197
       </div>
197
       </div>
198
-      {/* <Table
198
+      <Table
199
         dataSource={data.list.data}
199
         dataSource={data.list.data}
200
         columns={columns}
200
         columns={columns}
201
         pagination={{ total: data.total, onChange: changePageNum }}
201
         pagination={{ total: data.total, onChange: changePageNum }}
202
         loading={loading}
202
         loading={loading}
203
-        rowKey="activity"
204
-      /> */}
203
+        rowKey="enlistId"
204
+      />
205
       {/* <div style={{ display: 'flex', justifyContent: 'flex-end', marginTop: '30px' }}>
205
       {/* <div style={{ display: 'flex', justifyContent: 'flex-end', marginTop: '30px' }}>
206
         <Pagination showQuickJumper defaultCurrent={1} total={data.total} onChange={changePageNum} current={data.current}/>
206
         <Pagination showQuickJumper defaultCurrent={1} total={data.total} onChange={changePageNum} current={data.current}/>
207
       </div> */}
207
       </div> */}

+ 7
- 3
src/pages/activity/lookHouseActivity/edit/Basic.jsx View File

7
 import Wangedit from '@/components/Wangedit/Wangedit';
7
 import Wangedit from '@/components/Wangedit/Wangedit';
8
 import request from '@/utils/request';
8
 import request from '@/utils/request';
9
 import ImageUploader from '@/components/XForm/ImageUpload';
9
 import ImageUploader from '@/components/XForm/ImageUpload';
10
+import AuthButton from '@/components/AuthButton';
10
 
11
 
11
 const { RangePicker } = DatePicker;
12
 const { RangePicker } = DatePicker;
12
 const type = 'look'
13
 const type = 'look'
280
           <span style={{ marginLeft: 30, color: 'grey' }}>数字越大越靠前</span>
281
           <span style={{ marginLeft: 30, color: 'grey' }}>数字越大越靠前</span>
281
         </Form.Item>
282
         </Form.Item>
282
         <Form.Item wrapperCol={{ span: 12, offset: 8 }}>
283
         <Form.Item wrapperCol={{ span: 12, offset: 8 }}>
283
-          <Button type="primary" htmlType="submit">
284
-            确认
285
-          </Button>
284
+        <AuthButton name="activity.look.submit" noRight={null}>
285
+            <Button type="primary" htmlType="submit">
286
+              确认
287
+            </Button>
288
+           
289
+          </AuthButton>
286
           &nbsp;&nbsp;&nbsp;&nbsp;
290
           &nbsp;&nbsp;&nbsp;&nbsp;
287
           <Button onClick={() => cancelPage()}>取消</Button>
291
           <Button onClick={() => cancelPage()}>取消</Button>
288
         </Form.Item>
292
         </Form.Item>

+ 15
- 12
src/pages/activity/lookHouseActivity/index.jsx View File

24
 import request from '@/utils/request';
24
 import request from '@/utils/request';
25
 import QueryTable from '@/components/QueryTable';
25
 import QueryTable from '@/components/QueryTable';
26
 
26
 
27
-const type= 'look'
27
+const type = 'look';
28
 
28
 
29
 const LookHouseActivity = props => {
29
 const LookHouseActivity = props => {
30
   const ref = useRef();
30
   const ref = useRef();
75
     });
75
     });
76
   };
76
   };
77
 
77
 
78
-
79
   //   推首页
78
   //   推首页
80
   const homeDynamic = row => () => {
79
   const homeDynamic = row => () => {
81
     const home = Math.abs(row.home - 1);
80
     const home = Math.abs(row.home - 1);
177
       align: 'center',
176
       align: 'center',
178
       width: '20%',
177
       width: '20%',
179
       render: (x, row) => (
178
       render: (x, row) => (
180
-        <Navigate onClick={toSignupActivityDetail(row.dynamicId)}>
181
-          <Typography.Text ellipsis>{row.title}</Typography.Text>
182
-        </Navigate>
179
+        <AuthButton name="activity.look.detail" noRight={row.title}>
180
+          <Navigate onClick={toSignupActivityDetail(row.dynamicId)}>
181
+            <Typography.Text ellipsis>{row.title}</Typography.Text>
182
+          </Navigate>
183
+        </AuthButton>
183
       ),
184
       ),
184
     },
185
     },
185
     {
186
     {
245
       key: 'handle',
246
       key: 'handle',
246
       align: 'center',
247
       align: 'center',
247
       render: withActions((x, row) => [
248
       render: withActions((x, row) => [
248
-        <AuthButton name="admin.buildingDynamic.send.dynamicId.put" noRight={null}>
249
+        <AuthButton name="activity.look.publish" noRight={null}>
249
           <EditIcon
250
           <EditIcon
250
             type={row.status === 1 ? 'cancel' : 'publish'}
251
             type={row.status === 1 ? 'cancel' : 'publish'}
251
             text={row.status === 1 ? '取消发布' : '发布'}
252
             text={row.status === 1 ? '取消发布' : '发布'}
254
         </AuthButton>,
255
         </AuthButton>,
255
 
256
 
256
         row.activityStatus === 0 ? (
257
         row.activityStatus === 0 ? (
257
-          <AuthButton name="admin.buildingDynamic.finish.put" noRight={null}>
258
+          <AuthButton name="activity.look.finish" noRight={null}>
258
             <EditIcon type="end" text="结束活动" onClick={finishDynamic.bind(this, row)} />
259
             <EditIcon type="end" text="结束活动" onClick={finishDynamic.bind(this, row)} />
259
           </AuthButton>
260
           </AuthButton>
260
         ) : null,
261
         ) : null,
261
 
262
 
262
         row.activityStatus === 0 || row.activityStatus === 1 ? (
263
         row.activityStatus === 0 || row.activityStatus === 1 ? (
263
-          <AuthButton name="admin.buildingDynamic.update.put" noRight={null}>
264
+          <AuthButton name="activity.look.edit" noRight={null}>
264
             <EditIcon
265
             <EditIcon
265
               type="edit"
266
               type="edit"
266
               text="编辑"
267
               text="编辑"
274
 
275
 
275
   const actionRender = () => {
276
   const actionRender = () => {
276
     return (
277
     return (
277
-      <Button type="primary" icon="plus" onClick={() => toSignupActivityEdit()}>
278
-        新增
279
-      </Button>
278
+      <AuthButton name="activity.look.add" noRight={null}>
279
+        <Button type="primary" icon="plus" onClick={() => toSignupActivityEdit()}>
280
+          新增
281
+        </Button>
282
+      </AuthButton>
280
     );
283
     );
281
   };
284
   };
282
 
285
 
289
       columns={columns}
292
       columns={columns}
290
       postData={data => {
293
       postData={data => {
291
         data.time && (data.time = `${moment(data.time).format('YYYY-MM-DDT00:00:00.000')}Z`);
294
         data.time && (data.time = `${moment(data.time).format('YYYY-MM-DDT00:00:00.000')}Z`);
292
-        data.type=type
295
+        data.type = type;
293
         return data;
296
         return data;
294
       }}
297
       }}
295
       actionRender={actionRender}
298
       actionRender={actionRender}

+ 1
- 1
src/pages/activity/lookHouseActivity/registrationRecord.jsx View File

200
         columns={columns}
200
         columns={columns}
201
         pagination={{ total: data.total, onChange: changePageNum }}
201
         pagination={{ total: data.total, onChange: changePageNum }}
202
         loading={loading}
202
         loading={loading}
203
-        rowKey="activity"
203
+        rowKey="enlistId"
204
       />
204
       />
205
       {/* <div style={{ display: 'flex', justifyContent: 'flex-end', marginTop: '30px' }}>
205
       {/* <div style={{ display: 'flex', justifyContent: 'flex-end', marginTop: '30px' }}>
206
         <Pagination showQuickJumper defaultCurrent={1} total={data.total} onChange={changePageNum} current={data.current}/>
206
         <Pagination showQuickJumper defaultCurrent={1} total={data.total} onChange={changePageNum} current={data.current}/>

+ 4
- 4
src/pages/carouselFigure/advertisingList.jsx View File

97
       key: 'handle',
97
       key: 'handle',
98
       align: 'center',
98
       align: 'center',
99
       render: withActions((x, row) => [
99
       render: withActions((x, row) => [
100
-        <AuthButton name="admin.advert.publish" noRight={null}>
100
+        <AuthButton name="ad.screen.publish" noRight={null}>
101
           <EditIcon text={row.status === 1 ? '下架' : '上架'} type={row.status === 1 ? 'down' : 'up'}  onClick={changeStatus(row)} />
101
           <EditIcon text={row.status === 1 ? '下架' : '上架'} type={row.status === 1 ? 'down' : 'up'}  onClick={changeStatus(row)} />
102
         </AuthButton>,
102
         </AuthButton>,
103
-        <AuthButton name="admin.advert.put" noRight={null}>
103
+        <AuthButton name="ad.screen.edit" noRight={null}>
104
           <EditIcon text="编辑" type="edit" onClick={toEdit(row.contentId)} />
104
           <EditIcon text="编辑" type="edit" onClick={toEdit(row.contentId)} />
105
         </AuthButton>,
105
         </AuthButton>,
106
-        <AuthButton name="admin.advert.delete" noRight={null}>
106
+        <AuthButton name="ad.screen.delete" noRight={null}>
107
           <EditIcon text="删除" type="delete" onClick={deleteCarouse(row.contentId)}/>
107
           <EditIcon text="删除" type="delete" onClick={deleteCarouse(row.contentId)}/>
108
         </AuthButton>,
108
         </AuthButton>,
109
       ])
109
       ])
270
             </Button>
270
             </Button>
271
         </Form.Item>
271
         </Form.Item>
272
       </Form>
272
       </Form>
273
-      <AuthButton name="admin.advert.post" noRight={null}>
273
+      <AuthButton name="ad.screen.add" noRight={null}>
274
         <Button type='primary' onClick={toEdit()} style={{margin:'20px 0'}}>新增</Button>
274
         <Button type='primary' onClick={toEdit()} style={{margin:'20px 0'}}>新增</Button>
275
       </AuthButton>
275
       </AuthButton>
276
       <Table dataSource={data.records} columns={columns} pagination={false} rowKey="advertisingList" />
276
       <Table dataSource={data.records} columns={columns} pagination={false} rowKey="advertisingList" />

+ 4
- 4
src/pages/carouselFigure/carouselFigureList.jsx View File

140
       key: 'handle',
140
       key: 'handle',
141
       align: 'center',
141
       align: 'center',
142
       render: withActions((x, row) => [
142
       render: withActions((x, row) => [
143
-        <AuthButton name="admin.extendContent.publish" noRight={null}>
143
+        <AuthButton name="ad.carousel.publish" noRight={null}>
144
           <EditIcon
144
           <EditIcon
145
             type={row.status === 1 ? 'down' : 'up'}
145
             type={row.status === 1 ? 'down' : 'up'}
146
             text={row.status === 1 ? '下架' : '上架'}
146
             text={row.status === 1 ? '下架' : '上架'}
148
           />
148
           />
149
         </AuthButton>,
149
         </AuthButton>,
150
 
150
 
151
-        <AuthButton name="admin.extendContent.id.put" noRight={null}>
151
+        <AuthButton name="ad.carousel.edit" noRight={null}>
152
           <EditIcon text="编辑" type="edit" onClick={toEditCarouse(row.contentId)} />
152
           <EditIcon text="编辑" type="edit" onClick={toEditCarouse(row.contentId)} />
153
         </AuthButton>,
153
         </AuthButton>,
154
 
154
 
155
-        <AuthButton name="admin.extendContent.delete" noRight={null}>
155
+        <AuthButton name="ad.carousel.deletee" noRight={null}>
156
           <EditIcon text="删除" type="delete" onClick={deleteCarouse(row.contentId)} />
156
           <EditIcon text="删除" type="delete" onClick={deleteCarouse(row.contentId)} />
157
         </AuthButton>,
157
         </AuthButton>,
158
       ]),
158
       ]),
325
         </Form.Item>
325
         </Form.Item>
326
       </Form>
326
       </Form>
327
       <div style={{textAlign:'right'}}>
327
       <div style={{textAlign:'right'}}>
328
-        <AuthButton name="admin.extendContent.post" noRight={null}>
328
+        <AuthButton name="ad.carousel.add" noRight={null}>
329
           <Button type="primary" onClick={toEditCarouse()} style={{ margin: '20px 0' }}>
329
           <Button type="primary" onClick={toEditCarouse()} style={{ margin: '20px 0' }}>
330
             新增
330
             新增
331
           </Button>
331
           </Button>

+ 1
- 1
src/pages/carouselFigure/customImg/list.jsx View File

65
           dataIndex="handle"
65
           dataIndex="handle"
66
           key="handle"
66
           key="handle"
67
           render={withActions((text, record) => [
67
           render={withActions((text, record) => [
68
-            <AuthButton name="admin.custom.put" noRight={null}>
68
+            <AuthButton name="ad.other.edit" noRight={null}>
69
               <EditIcon text="编辑" type="edit" onClick={toEditCustom(record.imgId, record.imgType)}></EditIcon>
69
               <EditIcon text="编辑" type="edit" onClick={toEditCustom(record.imgId, record.imgType)}></EditIcon>
70
             </AuthButton>,
70
             </AuthButton>,
71
           ])}
71
           ])}

+ 9
- 0
src/pages/carouselFigure/editAdvertising.jsx View File

14
 import SelectH5 from './SelectH5';
14
 import SelectH5 from './SelectH5';
15
 import SalesBatchGroup from './SalesBatchGroup';
15
 import SalesBatchGroup from './SalesBatchGroup';
16
 import LiveGroup from './LiveGroup';
16
 import LiveGroup from './LiveGroup';
17
+import InstitutionSelect from '@/components/SelectButton/InstitutionSelect';
17
 /**
18
 /**
18
  *
19
  *
19
  *
20
  *
203
         value: data.cityId,
204
         value: data.cityId,
204
         rules: [{ required: true, message: '请选择展示城市' }],
205
         rules: [{ required: true, message: '请选择展示城市' }],
205
       },
206
       },
207
+      {
208
+        label: '城市公司',
209
+        name: 'institutionId',
210
+        render: <InstitutionSelect />,
211
+        // hidden: () => isHaveActive,
212
+        value: data.institutionId,
213
+        rules: [{ required: true, message: '请选择城市公司' }],
214
+      },
206
       {
215
       {
207
         label: '开屏广告',
216
         label: '开屏广告',
208
         name: 'image',
217
         name: 'image',

+ 67
- 56
src/pages/channel/Channel/Edit/index.jsx View File

1
 import React, { useState, useEffect } from 'react';
1
 import React, { useState, useEffect } from 'react';
2
-import { Input, Menu, Dropdown, Button, Icon, message, Table, Divider, Card, Select, Form, Alert } from 'antd';
2
+import {
3
+  Input,
4
+  Menu,
5
+  Dropdown,
6
+  Button,
7
+  Icon,
8
+  message,
9
+  Table,
10
+  Divider,
11
+  Card,
12
+  Select,
13
+  Form,
14
+  Alert,
15
+} from 'antd';
3
 import router from 'umi/router';
16
 import router from 'umi/router';
4
 import apis from '@/services/apis';
17
 import apis from '@/services/apis';
5
-import request from '@/utils/request'
6
-import InstitutionSelect from '@/components/SelectButton/InstitutionSelect'
18
+import request from '@/utils/request';
19
+import InstitutionSelect from '@/components/SelectButton/InstitutionSelect';
7
 
20
 
8
 const { TextArea } = Input;
21
 const { TextArea } = Input;
9
 const { Option } = Select;
22
 const { Option } = Select;
10
 
23
 
11
 const header = props => {
24
 const header = props => {
12
-   const {id} = props.location.query
25
+  const { id } = props.location.query;
13
 
26
 
14
   // eslint-disable-next-line react-hooks/rules-of-hooks
27
   // eslint-disable-next-line react-hooks/rules-of-hooks
15
   useEffect(() => {
28
   useEffect(() => {
16
-      if(id){
17
-        getById()
18
-      }
19
-    
20
-  }, [])
21
-
29
+    if (id) {
30
+      getById();
31
+    }
32
+  }, []);
22
 
33
 
23
   // 查询当前信息
34
   // 查询当前信息
24
   function getById(params) {
35
   function getById(params) {
25
-    request({ ...apis.channelList.getById, urlData: { id: id } }).then((data) => {
26
-      props.form.setFieldsValue(data)
27
-    }).catch((err) => {
28
-      console.log(err)
29
-      message.info(err.msg || err.message)
30
-    })
36
+    request({ ...apis.channelList.getById, urlData: { id: id } })
37
+      .then(data => {
38
+        props.form.setFieldsValue(data);
39
+      })
40
+      .catch(err => {
41
+        console.log(err);
42
+        message.info(err.msg || err.message);
43
+      });
31
   }
44
   }
32
 
45
 
33
   // 编辑
46
   // 编辑
34
   function editChannel(data) {
47
   function editChannel(data) {
35
-      if(id){
36
-        request({ ...apis.channelList.editChannel, urlData: { id: id }, data: { ...data } }).then((data) => {
37
-            message.info('修改成功')
38
-            router.go(-1)
39
-          }).catch((err) => {
40
-            console.log(err)
41
-            message.info(err.msg || err.message)
42
-          })
43
-      }else{
44
-        request({ ...apis.channelList.addChannel, data: { ...data } }).then((data) => {
45
-            message.info('添加成功')
46
-            router.go(-1)
47
-          }).catch((err) => {
48
-            console.log(err)
49
-            message.info(err.msg || err.message)
50
-          })
51
-      }
52
-  
48
+    if (id) {
49
+      request({ ...apis.channelList.editChannel, urlData: { id: id }, data: { ...data } })
50
+        .then(data => {
51
+          message.info('修改成功');
52
+          router.go(-1);
53
+        })
54
+        .catch(err => {
55
+          console.log(err);
56
+          message.info(err.msg || err.message);
57
+        });
58
+    } else {
59
+      request({ ...apis.channelList.addChannel, data: { ...data } })
60
+        .then(data => {
61
+          message.info('添加成功');
62
+          router.go(-1);
63
+        })
64
+        .catch(err => {
65
+          console.log(err);
66
+          message.info(err.msg || err.message);
67
+        });
68
+    }
53
   }
69
   }
54
 
70
 
55
-
56
   function handleSubmit(e) {
71
   function handleSubmit(e) {
57
     e.preventDefault();
72
     e.preventDefault();
58
     props.form.validateFields((err, values) => {
73
     props.form.validateFields((err, values) => {
59
       if (!err) {
74
       if (!err) {
60
-        console.log('values', values)
61
-        editChannel({ ...values })
75
+        console.log('values', values);
76
+        editChannel({ ...values });
62
       }
77
       }
63
     });
78
     });
64
   }
79
   }
65
 
80
 
66
-
67
   const { getFieldDecorator } = props.form;
81
   const { getFieldDecorator } = props.form;
68
 
82
 
69
   return (
83
   return (
70
     <Card>
84
     <Card>
71
       <Form labelCol={{ span: 6 }} wrapperCol={{ span: 12 }} onSubmit={handleSubmit}>
85
       <Form labelCol={{ span: 6 }} wrapperCol={{ span: 12 }} onSubmit={handleSubmit}>
72
-
73
         <Form.Item label="城市公司">
86
         <Form.Item label="城市公司">
74
-          {getFieldDecorator('institutionId',{
87
+          {getFieldDecorator('institutionId', {
75
             rules: [{ required: true, message: '请选择城市公司' }],
88
             rules: [{ required: true, message: '请选择城市公司' }],
76
-          })(
77
-            <InstitutionSelect />
78
-          )}
89
+          })(<InstitutionSelect />)}
79
         </Form.Item>
90
         </Form.Item>
80
         <Form.Item label="渠道名称">
91
         <Form.Item label="渠道名称">
81
           {getFieldDecorator('channelName', {
92
           {getFieldDecorator('channelName', {
82
             rules: [{ required: true, message: '请输入渠道名称' }],
93
             rules: [{ required: true, message: '请输入渠道名称' }],
83
-          })(<Input  />)}
94
+          })(<Input />)}
84
         </Form.Item>
95
         </Form.Item>
85
         <Form.Item label="联系人">
96
         <Form.Item label="联系人">
86
           {getFieldDecorator('channelContact', {
97
           {getFieldDecorator('channelContact', {
87
             rules: [{ required: true, message: ' 请输入联系人' }],
98
             rules: [{ required: true, message: ' 请输入联系人' }],
88
-          })(<Input  />)}
99
+          })(<Input />)}
89
         </Form.Item>
100
         </Form.Item>
90
         <Form.Item label="联系电话">
101
         <Form.Item label="联系电话">
91
           {getFieldDecorator('contactTel', {
102
           {getFieldDecorator('contactTel', {
92
             rules: [{ required: true, message: '请输入联系电话' }],
103
             rules: [{ required: true, message: '请输入联系电话' }],
93
-          })(<Input  />)}
104
+          })(<Input />)}
94
         </Form.Item>
105
         </Form.Item>
95
         <Form.Item label="说明描述">
106
         <Form.Item label="说明描述">
96
-          {getFieldDecorator('explain', {
97
-          })(<TextArea  rows={8} />)}
107
+          {getFieldDecorator('explain', {})(<TextArea rows={8} />)}
98
         </Form.Item>
108
         </Form.Item>
99
         <Form.Item wrapperCol={{ span: 15, offset: 6 }}>
109
         <Form.Item wrapperCol={{ span: 15, offset: 6 }}>
100
-       
110
+          <AuthButton name="channel.submit" noRight={null}>
101
             <Button type="primary" htmlType="submit">
111
             <Button type="primary" htmlType="submit">
102
               保存
112
               保存
113
+            </Button>
114
+          </AuthButton>
115
+
116
+          <Button onClick={() => router.go(-1)} style={{ marginLeft: '20px' }}>
117
+            取消
103
           </Button>
118
           </Button>
104
-            <Button  onClick={()=>router.go(-1)} style={{marginLeft:'20px'}}>
105
-              取消
106
-          </Button>
107
- 
108
         </Form.Item>
119
         </Form.Item>
109
       </Form>
120
       </Form>
110
     </Card>
121
     </Card>
111
-  )
112
-}
122
+  );
123
+};
113
 const WrappedNormalLoginForm = Form.create({ name: 'header' })(header);
124
 const WrappedNormalLoginForm = Form.create({ name: 'header' })(header);
114
-export default WrappedNormalLoginForm
125
+export default WrappedNormalLoginForm;

+ 21
- 14
src/pages/channel/Channel/List/index.jsx View File

59
 }
59
 }
60
 
60
 
61
 export default function ChannelList(props) {
61
 export default function ChannelList(props) {
62
-
63
   const ref = useRef();
62
   const ref = useRef();
64
 
63
 
65
   // 跳编辑页面
64
   // 跳编辑页面
72
     });
71
     });
73
   }
72
   }
74
 
73
 
75
- const  onDelete =(row)=> {
76
-  request({ ...apis.channelList.deleteChannel, urlData: { id: row.channelId } })
74
+  const onDelete = row => {
75
+    request({ ...apis.channelList.deleteChannel, urlData: { id: row.channelId } })
77
       .then(response => {
76
       .then(response => {
78
         message.info('删除成功');
77
         message.info('删除成功');
79
         ref.current.reload();
78
         ref.current.reload();
80
         // getList({ pageNum: pageNum, pageSize: 10, ...fieldsValue });
79
         // getList({ pageNum: pageNum, pageSize: 10, ...fieldsValue });
81
       })
80
       })
82
       .catch(error => {});
81
       .catch(error => {});
83
- }
84
- 
82
+  };
83
+
85
   const searchFields = [
84
   const searchFields = [
86
     {
85
     {
87
       name: 'channelId',
86
       name: 'channelId',
112
       key: 'channelName',
111
       key: 'channelName',
113
       align: 'center',
112
       align: 'center',
114
       render: (text, record) => (
113
       render: (text, record) => (
115
-        <Navigate to={`/channel/Channel/Edit?id=${record.channelId}`}>{text}</Navigate>
114
+        <AuthButton name="channel.edit" noRight={text}>
115
+          <Navigate to={`/channel/Channel/Edit?id=${record.channelId}`}>{text}</Navigate>
116
+        </AuthButton>
116
       ),
117
       ),
117
     },
118
     },
118
     {
119
     {
151
       dataIndex: 'edit',
152
       dataIndex: 'edit',
152
       key: 'edit',
153
       key: 'edit',
153
       align: 'center',
154
       align: 'center',
154
-      render: (text, record) =>  <Button type='link' onClick={()=>onDelete(record)}>删除</Button>
155
-
156
-
155
+      render: (text, record) => (
156
+        <AuthButton name="channel.delete" noRight={null}>
157
+          <Button type="link" onClick={() => onDelete(record)}>
158
+            删除
159
+          </Button>
160
+        </AuthButton>
161
+      ),
157
     },
162
     },
158
   ];
163
   ];
159
- 
164
+
160
   const actionRender = () => {
165
   const actionRender = () => {
161
     return (
166
     return (
162
-      <Button type="primary" icon="plus" onClick={() => toedit()}>
163
-        新增
164
-      </Button>
167
+      <AuthButton name="channel.add" noRight={null}>
168
+        <Button type="primary" icon="plus" onClick={() => toedit()}>
169
+          新增
170
+        </Button>
171
+      </AuthButton>
165
     );
172
     );
166
   };
173
   };
167
 
174
 
168
   return (
175
   return (
169
     <QueryTable
176
     <QueryTable
170
-    ref={ref}
177
+      ref={ref}
171
       rowKey="channelList"
178
       rowKey="channelList"
172
       api={apis.channelList.getList}
179
       api={apis.channelList.getList}
173
       searchFields={searchFields}
180
       searchFields={searchFields}

+ 21
- 41
src/pages/channel/independentList/index.jsx View File

143
         title: '状态',
143
         title: '状态',
144
         // eslint-disable-next-line consistent-return
144
         // eslint-disable-next-line consistent-return
145
         render: (text, records) => {
145
         render: (text, records) => {
146
-          console.log('retrun', records);
147
-          //     if (records.status === 1) { return '报备' }
148
-          // if (records.status === 2) { return '推荐' }
149
-          // if (records.status === 3) { return '认购' }
150
-          // if (records.status === 4) { return '签约' }
151
-          // if (records.verifyStatus === 1) { return '待审核' }
152
-          // if (records.verifyStatus === 2) { return '审核同意' }
153
-          // if (records.verifyStatus === 3) { return '签约' }
154
-          // if (records.status === 1) { if(records.reportRecommendStatus === 1) {return '报备'} if(records.reportRecommendStatus === 2) {return '推荐'}  }
155
-          // if (records.status === 2) { return '到访' }
156
-          // if (records.status === 3) { return '认购' }
157
-          // if (records.status === 4) { return '签约' }
158
-          // if (records.verifyStatus === 1) { return '待审核' }
159
-          // if (records.verifyStatus === 2) { return '审核同意' }
160
-          // if (records.verifyStatus === 3) { return '签约' }
161
           if (records.status === 1) {
146
           if (records.status === 1) {
162
-            if (records.verifyStatus === 0) {
163
-              return '待审核';
164
-            }
165
-            if (records.verifyStatus === 1) {
166
-              return '报备';
167
-            }
168
-            // if (records.reportRecommendStatus === 1) { return '报备' }
169
-            // if (records.reportRecommendStatus === 2) { return '推荐' }}
170
-            if (records.verifyStatus === 2) {
171
-              return '审核驳回';
172
-            }
147
+            return '报备';
173
           }
148
           }
174
           if (records.status === 2) {
149
           if (records.status === 2) {
175
             return '到访';
150
             return '到访';
176
           }
151
           }
177
           if (records.status === 3) {
152
           if (records.status === 3) {
178
-            return '认';
153
+            return '认筹';
179
           }
154
           }
180
           if (records.status === 4) {
155
           if (records.status === 4) {
181
             return '签约';
156
             return '签约';
182
           }
157
           }
183
-          // reportRecommendStatus
158
+          if (records.status === 5) {
159
+            return '结佣';
160
+          }
161
+          // if (records.status === 6) {
162
+          //   return '报废';
163
+          // }
184
         },
164
         },
185
       },
165
       },
186
     ];
166
     ];
537
                 <a style={{ color: 'rgba(239,39,58,1)' }} onClick={() => Invite(record)}>邀请经纪人</a>
517
                 <a style={{ color: 'rgba(239,39,58,1)' }} onClick={() => Invite(record)}>邀请经纪人</a>
538
               </AuthButton> */}
518
               </AuthButton> */}
539
               {/* &nbsp;&nbsp;&nbsp;&nbsp; */}
519
               {/* &nbsp;&nbsp;&nbsp;&nbsp; */}
540
-              {/* <AuthButton name="admin.customer.recommend.id.get" noRight={null}> */}
541
-              <Button type="link" onClick={() => gM(record)}>
542
-                推荐客户
543
-              </Button>
544
-              {/* </AuthButton> */}
545
-              {/* <AuthButton name="admin.customer.recommend.id.get" noRight={null}> */}
546
-              <Button type="link" onClick={() => onDelete(record)}>
547
-                删除
548
-              </Button>
549
-              {/* </AuthButton> */}
520
+              <AuthButton name="channel.customer.list" noRight={null}>
521
+                <Button type="link" onClick={() => gM(record)}>
522
+                  推荐客户
523
+                </Button>
524
+              </AuthButton>
525
+              <AuthButton name="channel.disable" noRight={null}>
526
+                <Button type="link" onClick={() => onDelete(record)}>
527
+                  删除
528
+                </Button>
529
+              </AuthButton>
550
             </>
530
             </>
551
           }
531
           }
552
         </>
532
         </>
571
       <Form
551
       <Form
572
         layout="inline"
552
         layout="inline"
573
         onSubmit={e => handleSubmit(e, props)}
553
         onSubmit={e => handleSubmit(e, props)}
574
-        style={{ display: 'flex', alignItems: 'center',marginBottom:'20px' }}
554
+        style={{ display: 'flex', alignItems: 'center', marginBottom: '20px' }}
575
       >
555
       >
576
         <Form.Item>
556
         <Form.Item>
577
           {getFieldDecorator('channelId')(
557
           {getFieldDecorator('channelId')(
602
           )}
582
           )}
603
         </Form.Item>
583
         </Form.Item>
604
         <Form.Item style={{ position: 'absolute', right: '38px' }}>
584
         <Form.Item style={{ position: 'absolute', right: '38px' }}>
605
-          <AuthButton name="admin.major.search" noRight={null}>
585
+          {/* <AuthButton name="admin.major.search" noRight={null}> */}
606
             <Button type="primary" htmlType="submit">
586
             <Button type="primary" htmlType="submit">
607
               搜索
587
               搜索
608
             </Button>
588
             </Button>
609
-          </AuthButton>
589
+          {/* </AuthButton> */}
610
           <Button style={{ marginLeft: 8 }} onClick={handleReset}>
590
           <Button style={{ marginLeft: 8 }} onClick={handleReset}>
611
             重置
591
             重置
612
           </Button>
592
           </Button>

+ 102
- 143
src/pages/course/Edit/index.jsx View File

5
 import Wangedit from '@/components/Wangedit/Wangedit';
5
 import Wangedit from '@/components/Wangedit/Wangedit';
6
 import router from 'umi/router';
6
 import router from 'umi/router';
7
 import { fetch, apis } from '@/utils/request';
7
 import { fetch, apis } from '@/utils/request';
8
+import AuthButton from '@/components/AuthButton';
8
 
9
 
9
 const FormItem = Form.Item;
10
 const FormItem = Form.Item;
10
 const Option = Select.Option;
11
 const Option = Select.Option;
14
 const goBack = () => router.goBack(-1);
15
 const goBack = () => router.goBack(-1);
15
 
16
 
16
 const CurriculumForm = React.forwardRef((props, ref) => {
17
 const CurriculumForm = React.forwardRef((props, ref) => {
17
-  const [loading, setLoading] = useState(false);//防止多次点击 定义loadind
18
+  const [loading, setLoading] = useState(false); //防止多次点击 定义loadind
18
   // const [formData, setFormData] = useState({});//提交表单的数据
19
   // const [formData, setFormData] = useState({});//提交表单的数据
19
-  const [contentType, setContentType] = useState(0);//单选。初始默认显示0 富文本框。点击视频, 渲染1
20
+  const [contentType, setContentType] = useState(0); //单选。初始默认显示0 富文本框。点击视频, 渲染1
20
   const { form, history } = props;
21
   const { form, history } = props;
21
-  const { getFieldDecorator, setFieldsValue, validateFields,getFieldValue } = form;
22
-  const { curriculumId } = history.location.query || {}
23
-  
22
+  const { getFieldDecorator, setFieldsValue, validateFields, getFieldValue } = form;
23
+  const { curriculumId } = history.location.query || {};
24
+
24
   const formItemLayout = {
25
   const formItemLayout = {
25
     //布局
26
     //布局
26
     labelCol: { span: 6 },
27
     labelCol: { span: 6 },
27
     wrapperCol: { span: 14 },
28
     wrapperCol: { span: 14 },
28
-
29
   };
29
   };
30
 
30
 
31
   const fileUploadBeforeUpload = (file, fileList) => {
31
   const fileUploadBeforeUpload = (file, fileList) => {
40
     });
40
     });
41
   };
41
   };
42
 
42
 
43
-  const handleSubmit = (e) => {
43
+  const handleSubmit = e => {
44
     e.preventDefault();
44
     e.preventDefault();
45
     validateFields((err, values) => {
45
     validateFields((err, values) => {
46
       if (err) {
46
       if (err) {
48
         //字符验证未填写---返回
48
         //字符验证未填写---返回
49
       }
49
       }
50
 
50
 
51
-      setLoading(true);//loading开始
51
+      setLoading(true); //loading开始
52
       if (values.curriculumUrl) {
52
       if (values.curriculumUrl) {
53
         values.curriculumUrl = values.curriculumUrl[0];
53
         values.curriculumUrl = values.curriculumUrl[0];
54
       }
54
       }
57
         updateCurriculumData({
57
         updateCurriculumData({
58
           data: {
58
           data: {
59
             ...values,
59
             ...values,
60
-            curriculumId
60
+            curriculumId,
61
           },
61
           },
62
-          urlData: { id: curriculumId }
63
-        }).then(() => {
64
-          setLoading(false);
65
-          message.success('数据更新成功');
66
-          goBack()
67
-        }).catch((err) => {
68
-          setLoading(false);//loading消失
69
-          message.error(err.message || err);
62
+          urlData: { id: curriculumId },
70
         })
63
         })
64
+          .then(() => {
65
+            setLoading(false);
66
+            message.success('数据更新成功');
67
+            goBack();
68
+          })
69
+          .catch(err => {
70
+            setLoading(false); //loading消失
71
+            message.error(err.message || err);
72
+          });
71
       } else {
73
       } else {
72
-        saveCurriculumData({ data: values }).then(() => {
73
-          setLoading(false);
74
-          message.success('数据保存成功');
75
-          goBack()
76
-        }).catch((err) => {
77
-          setLoading(false);//loading消失
78
-          message.error(err.message || err);
79
-        })
74
+        saveCurriculumData({ data: values })
75
+          .then(() => {
76
+            setLoading(false);
77
+            message.success('数据保存成功');
78
+            goBack();
79
+          })
80
+          .catch(err => {
81
+            setLoading(false); //loading消失
82
+            message.error(err.message || err);
83
+          });
80
       }
84
       }
81
     });
85
     });
82
-  }
86
+  };
83
 
87
 
84
-  const getCourseData = useCallback(({ curriculumId }) => {//函数结果存 初始化运行一次,等待调用。
85
-    getCurriculumData({urlData: { id: curriculumId }}).then((res) => {
86
-      if(res.curriculumUrl){
88
+  const getCourseData = useCallback(({ curriculumId }) => {
89
+    //函数结果存 初始化运行一次,等待调用。
90
+    getCurriculumData({ urlData: { id: curriculumId } }).then(res => {
91
+      if (res.curriculumUrl) {
87
         res.curriculumUrl = [res.curriculumUrl];
92
         res.curriculumUrl = [res.curriculumUrl];
88
       }
93
       }
89
-      setFieldsValue(res)
94
+      setFieldsValue(res);
90
       // setFormData(res)
95
       // setFormData(res)
91
       // setContentType(res.type)
96
       // setContentType(res.type)
92
-    })
93
-  }, [])
97
+    });
98
+  }, []);
94
 
99
 
95
   useEffect(() => {
100
   useEffect(() => {
96
     if (curriculumId) {
101
     if (curriculumId) {
97
-      getCourseData({curriculumId})//第一次渲染前//获取id
102
+      getCourseData({ curriculumId }); //第一次渲染前//获取id
98
     }
103
     }
99
-  }, [curriculumId])//第二次id一样不执行
104
+  }, [curriculumId]); //第二次id一样不执行
100
 
105
 
101
   // useEffect(() => {
106
   // useEffect(() => {
102
   //   if (formData) {//1.form表单数据{2} 执行。无变更不执行
107
   //   if (formData) {//1.form表单数据{2} 执行。无变更不执行
103
   //     setFieldsValue(formData)
108
   //     setFieldsValue(formData)
104
   //   }
109
   //   }
105
   // }, [formData])//2.有变更跟的话
110
   // }, [formData])//2.有变更跟的话
106
-  
107
 
111
 
108
   return (
112
   return (
109
-  <Card>
110
-    <Form {...formItemLayout} onSubmit={handleSubmit}>
111
-      {/* 布局提交表单 */}
112
-      <FormItem label="参与对象">
113
-        {
114
-          getFieldDecorator('roleId', {
115
-            rules: [
116
-              { required: true, message: '请选择参与对象' }
117
-            ]
113
+    <Card>
114
+      <Form {...formItemLayout} onSubmit={handleSubmit}>
115
+        {/* 布局提交表单 */}
116
+        <FormItem label="参与对象">
117
+          {getFieldDecorator('roleId', {
118
+            rules: [{ required: true, message: '请选择参与对象' }],
118
           })(
119
           })(
119
-            <Select style={{width:'500px'}}>
120
+            <Select style={{ width: '500px' }}>
120
               <Option value="1">经纪人</Option>
121
               <Option value="1">经纪人</Option>
121
               <Option value="2">置业顾问</Option>
122
               <Option value="2">置业顾问</Option>
122
               <Option value="3">{`置业顾问&经纪人`}</Option>
123
               <Option value="3">{`置业顾问&经纪人`}</Option>
123
-            </Select>
124
-          )
125
-        }
126
-      </FormItem>
127
-      <FormItem label="主图" help="建议尺寸:750px*600px,比例5:4,格式:jpg,用于:列表和详情">
128
-        {
129
-          getFieldDecorator('curriculumImg', {
130
-            rules: [
131
-              { required: true, message: '请上传主图' }
132
-            ]
133
-          })(
134
-            <ImageUpload  />
135
-          )
136
-        }
137
-      </FormItem>
138
-      <FormItem label="课程标题">
139
-        {
140
-          getFieldDecorator('name', {
141
-            rules: [
142
-              { required: true, message: '请输入课程标题' }
143
-            ]
124
+            </Select>,
125
+          )}
126
+        </FormItem>
127
+        <FormItem label="主图" help="建议尺寸:750px*600px,比例5:4,格式:jpg,用于:列表和详情">
128
+          {getFieldDecorator('curriculumImg', {
129
+            rules: [{ required: true, message: '请上传主图' }],
130
+          })(<ImageUpload />)}
131
+        </FormItem>
132
+        <FormItem label="课程标题">
133
+          {getFieldDecorator('name', {
134
+            rules: [{ required: true, message: '请输入课程标题' }],
135
+          })(<Input style={{ width: '500px' }} />)}
136
+        </FormItem>
137
+        <FormItem label="简介">
138
+          {getFieldDecorator('remark', {
139
+            rules: [{ required: true, message: '请填写简介' }],
140
+          })(<Input.TextArea rows="5" style={{ width: '500px' }} />)}
141
+        </FormItem>
142
+
143
+        <FormItem label="详情">
144
+          {getFieldDecorator('type', {
145
+            initialValue: 0,
146
+            rules: [{ required: true, message: '请选择详情类型' }],
144
           })(
147
           })(
145
-            <Input style={{width:'500px'}} />
146
-          )
147
-        }
148
-      </FormItem>
149
-      <FormItem label="简介">
150
-        {
151
-          getFieldDecorator('remark', {
152
-            rules: [
153
-              { required: true, message: '请填写简介' }
154
-            ]
155
-          })(
156
-            <Input.TextArea  rows='5'  style={{width:'500px'}}/>
157
-          )
158
-        }
159
-      </FormItem>
160
-
161
-      <FormItem label="详情">
162
-        {
163
-          getFieldDecorator('type', {
164
-            initialValue:0,
165
-            rules: [
166
-              { required: true, message: '请选择详情类型' }
167
-            ]
168
-          })(
169
-              <Radio.Group style={{width:'500px'}} >
170
-                <Radio value={0}>图文</Radio>
171
-                <Radio value={1}>视频</Radio>
172
-              </Radio.Group>
173
-          )
174
-        }
175
-      </FormItem>
176
-{/*       
148
+            <Radio.Group style={{ width: '500px' }}>
149
+              <Radio value={0}>图文</Radio>
150
+              <Radio value={1}>视频</Radio>
151
+            </Radio.Group>,
152
+          )}
153
+        </FormItem>
154
+        {/*       
177
       <FormItem label="详情">
155
       <FormItem label="详情">
178
         {
156
         {
179
         getFieldDecorator('type'),{
157
         getFieldDecorator('type'),{
189
         }
167
         }
190
 
168
 
191
       </FormItem> */}
169
       </FormItem> */}
192
-  <FormItem label="图文" style={{display:getFieldValue('type')==0?'block':'none'}}>
193
-        {
194
-          getFieldDecorator('content', {
195
-            rules: [
196
-              { required: getFieldValue('type')==0, message: '请输入详情内容' }
197
-            ]
198
-          })(
199
-           <Wangedit style={{width:'500px'}}  /> 
200
-          )
201
-        }
202
-      </FormItem>
203
-       <FormItem label="视频" style={{display:getFieldValue('type')==1?'block':'none'}}>
204
-       {
205
-         getFieldDecorator('curriculumUrl', {
206
-           rules: [
207
-             { required: getFieldValue('type')==1, message: '请上传视频文件' }
208
-           ]
209
-         })(
210
-          <FileUpload accept=".mp4"  label="上传视频" size={1} />,
211
-         )
212
-       }
213
-     </FormItem>
214
-
215
-     
216
-      <FormItem label="权重" >
217
-        {
218
-          getFieldDecorator('weight', 
219
-            )(
220
-            <InputNumber min='0'   />
221
-          )
222
-        }
223
-      </FormItem>
224
-
225
-      <FormItem wrapperCol={{ span: 12, offset: 6 }}>
226
-        <Button loading={loading} type="primary" htmlType="submit">
227
-          保存
228
-        </Button>
229
-        <Button style={{marginLeft: '2em'}} onClick={goBack}>
230
-          取消
231
-        </Button>
232
-      </FormItem>
233
-    </Form>
170
+        <FormItem label="图文" style={{ display: getFieldValue('type') == 0 ? 'block' : 'none' }}>
171
+          {getFieldDecorator('content', {
172
+            rules: [{ required: getFieldValue('type') == 0, message: '请输入详情内容' }],
173
+          })(<Wangedit style={{ width: '500px' }} />)}
174
+        </FormItem>
175
+        <FormItem label="视频" style={{ display: getFieldValue('type') == 1 ? 'block' : 'none' }}>
176
+          {getFieldDecorator('curriculumUrl', {
177
+            rules: [{ required: getFieldValue('type') == 1, message: '请上传视频文件' }],
178
+          })(<FileUpload accept=".mp4" label="上传视频" size={1} />)}
179
+        </FormItem>
180
+
181
+        <FormItem label="权重">{getFieldDecorator('weight')(<InputNumber min="0" />)}</FormItem>
182
+
183
+        <FormItem wrapperCol={{ span: 12, offset: 6 }}>
184
+          <AuthButton name="course.submit" noRight={null}>
185
+            <Button loading={loading} type="primary" htmlType="submit">
186
+              保存
187
+            </Button>
188
+          </AuthButton>
189
+          <Button style={{ marginLeft: '2em' }} onClick={goBack}>
190
+            取消
191
+          </Button>
192
+        </FormItem>
193
+      </Form>
234
     </Card>
194
     </Card>
235
-  
236
-  )
237
-})
195
+  );
196
+});
238
 
197
 
239
 export default Form.create({})(CurriculumForm);
198
 export default Form.create({})(CurriculumForm);

+ 11
- 8
src/pages/course/list/index.jsx View File

24
     });
24
     });
25
   }, []);
25
   }, []);
26
 
26
 
27
-  const onDelete = (data)=>{
27
+  const onDelete = data => {
28
     request({
28
     request({
29
       ...apis.course.deleteCourse,
29
       ...apis.course.deleteCourse,
30
       urlData: { id: data.curriculumId },
30
       urlData: { id: data.curriculumId },
33
       message.info('删除成功');
33
       message.info('删除成功');
34
       ref.current.reload(); //
34
       ref.current.reload(); //
35
     });
35
     });
36
-  }
36
+  };
37
 
37
 
38
   onDelete;
38
   onDelete;
39
 
39
 
147
       align: 'center',
147
       align: 'center',
148
       render: withActions(
148
       render: withActions(
149
         (_, row) => [
149
         (_, row) => [
150
-          <OperButton onClick={() => confirm(row)}>
151
-            {row.isPublish === 0 ? '发布' : '取消发布'}
152
-          </OperButton>,
153
-          <AuthButton name="admin.building.delete" noRight={null}>
150
+          <AuthButton name="course.publish" noRight={null}>
151
+            <OperButton onClick={() => confirm(row)}>
152
+              {row.isPublish === 0 ? '发布' : '取消发布'}
153
+            </OperButton>
154
+          </AuthButton>,
155
+
156
+          <AuthButton name="course.edit" noRight={null}>
154
             <OperButton onClick={() => toEdit(row)}>编辑</OperButton>
157
             <OperButton onClick={() => toEdit(row)}>编辑</OperButton>
155
           </AuthButton>,
158
           </AuthButton>,
156
-          <AuthButton name="admin.building.delete" noRight={null}>
159
+          <AuthButton name="courseg.delete" noRight={null}>
157
             <OperButton.Confirm
160
             <OperButton.Confirm
158
               title="确认删除?"
161
               title="确认删除?"
159
               content="删除之后不可恢复"
162
               content="删除之后不可恢复"
169
   ];
172
   ];
170
   const actionRender = () => {
173
   const actionRender = () => {
171
     return (
174
     return (
172
-      <AuthButton name="admin.newclassType.add" noRight={null}>
175
+      <AuthButton name="course.add" noRight={null}>
173
         <Button type="primary" icon="plus" onClick={() => toEdit()}>
176
         <Button type="primary" icon="plus" onClick={() => toEdit()}>
174
           新增
177
           新增
175
         </Button>
178
         </Button>

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

235
 
235
 
236
   const actionRender = () => {
236
   const actionRender = () => {
237
     return (
237
     return (
238
-      <Button type="danger" loading={exportLoding} onClick={() => exportCustomer()}>
238
+      <Button type='primary' loading={exportLoding} onClick={() => exportCustomer()}>
239
         导出
239
         导出
240
       </Button>
240
       </Button>
241
     );
241
     );

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

195
   const actionRender = () => {
195
   const actionRender = () => {
196
     return (
196
     return (
197
       <>
197
       <>
198
-      <Button type="danger" loading={exportLoding} onClick={() => exportCustomer()}>
198
+      <Button type="primary" loading={exportLoding} onClick={() => exportCustomer()}>
199
           导出
199
           导出
200
         </Button>
200
         </Button>
201
         {/* <AuthButton name="admin.customer.import" noRight={null}>
201
         {/* <AuthButton name="admin.customer.import" noRight={null}>

+ 45
- 36
src/pages/findRoom/addedValueService/audit.jsx View File

1
 import React, { useState, useEffect } from 'react';
1
 import React, { useState, useEffect } from 'react';
2
-import { Form, Input, Button, Card, Radio, notification, Select,Checkbox  } from 'antd';
2
+import { Form, Input, Button, Card, Radio, notification, Select, Checkbox } from 'antd';
3
 import moment from 'moment';
3
 import moment from 'moment';
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 Styles from './style.less';
6
 // import Styles from './style.less';
7
 import { router } from 'umi';
7
 import { router } from 'umi';
8
+import AuthButton from '@/components/AuthButton';
8
 
9
 
9
 const { TextArea } = Input;
10
 const { TextArea } = Input;
10
 const { Option } = Select;
11
 const { Option } = Select;
41
   // eslint-disable-next-line react-hooks/rules-of-hooks
42
   // eslint-disable-next-line react-hooks/rules-of-hooks
42
   const [dataSource, setDataSource] = useState({ picture: '' });
43
   const [dataSource, setDataSource] = useState({ picture: '' });
43
 
44
 
44
-  const { id,type } = props.location.query;
45
-  const disabled= true
45
+  const { id, type } = props.location.query;
46
+  const disabled = true;
46
 
47
 
47
   useEffect(() => {
48
   useEffect(() => {
48
     if (id !== '') {
49
     if (id !== '') {
56
       if (res) {
57
       if (res) {
57
         const b = {};
58
         const b = {};
58
         JSON.parse(res?.questionnaire)?.map(x => {
59
         JSON.parse(res?.questionnaire)?.map(x => {
59
-          
60
-          // if (x.key === 'important' ||x.key === 'special' ||x.key === 'style'||x.key === 'mostImportant') { 
60
+          // if (x.key === 'important' ||x.key === 'special' ||x.key === 'style'||x.key === 'mostImportant') {
61
           //   b[x.key] = [x.resultId];
61
           //   b[x.key] = [x.resultId];
62
           //   return;
62
           //   return;
63
           // }
63
           // }
121
         onSubmit={e => handleSubmit(e)}
121
         onSubmit={e => handleSubmit(e)}
122
         style={{ width: '800px', margin: 'auto' }}
122
         style={{ width: '800px', margin: 'auto' }}
123
       >
123
       >
124
-       <Form.Item label="客户姓名">
124
+        <Form.Item label="客户姓名">
125
           {getFieldDecorator('nickname')(<Input placeholder="客户姓名" disabled />)}
125
           {getFieldDecorator('nickname')(<Input placeholder="客户姓名" disabled />)}
126
         </Form.Item>
126
         </Form.Item>
127
         <Form.Item label="客户电话">
127
         <Form.Item label="客户电话">
159
               <Option value={3}>70~90m²</Option>
159
               <Option value={3}>70~90m²</Option>
160
               <Option value={4}>90~110m²</Option>
160
               <Option value={4}>90~110m²</Option>
161
               <Option value={5}>110~130m²</Option>
161
               <Option value={5}>110~130m²</Option>
162
-              <Option value={6}>130~150m²</Option>  
163
-              <Option value={7}>150~200m²</Option>  
164
-              <Option value={8}>200m²以上</Option>     
162
+              <Option value={6}>130~150m²</Option>
163
+              <Option value={7}>150~200m²</Option>
164
+              <Option value={8}>200m²以上</Option>
165
             </Select>,
165
             </Select>,
166
           )}
166
           )}
167
         </Form.Item>
167
         </Form.Item>
174
               <Option value={3}>包工不包料</Option>
174
               <Option value={3}>包工不包料</Option>
175
               <Option value={4}>施工包辅材不包主材</Option>
175
               <Option value={4}>施工包辅材不包主材</Option>
176
               <Option value={5}>全包</Option>
176
               <Option value={5}>全包</Option>
177
-             
178
             </Select>,
177
             </Select>,
179
           )}
178
           )}
180
         </Form.Item>
179
         </Form.Item>
182
         <Form.Item label="家装侧重点">
181
         <Form.Item label="家装侧重点">
183
           {getFieldDecorator('important')(
182
           {getFieldDecorator('important')(
184
             <Checkbox.Group disabled={disabled}>
183
             <Checkbox.Group disabled={disabled}>
185
-              <Checkbox value='家装价格'>家装价格</Checkbox>
186
-              <Checkbox value='施工品质'>施工品质</Checkbox>
187
-              <Checkbox value='设计感'>设计感</Checkbox>
188
-              <Checkbox value='环保'>环保</Checkbox>
189
-              <Checkbox value='舒适度'>舒适度</Checkbox>
190
-              <Checkbox value='实用度'>实用度</Checkbox>
184
+              <Checkbox value="家装价格">家装价格</Checkbox>
185
+              <Checkbox value="施工品质">施工品质</Checkbox>
186
+              <Checkbox value="设计感">设计感</Checkbox>
187
+              <Checkbox value="环保">环保</Checkbox>
188
+              <Checkbox value="舒适度">舒适度</Checkbox>
189
+              <Checkbox value="实用度">实用度</Checkbox>
191
             </Checkbox.Group>,
190
             </Checkbox.Group>,
192
           )}
191
           )}
193
         </Form.Item>
192
         </Form.Item>
194
-         <Form.Item label="家装风格">
193
+        <Form.Item label="家装风格">
195
           {getFieldDecorator('style')(
194
           {getFieldDecorator('style')(
196
             <Checkbox.Group disabled={disabled}>
195
             <Checkbox.Group disabled={disabled}>
197
-              <Checkbox value='北欧风格'>北欧风格</Checkbox>
198
-              <Checkbox value='简欧风格'>简欧风格</Checkbox>
199
-              <Checkbox value='欧式古典'>欧式古典</Checkbox>
200
-              <Checkbox value='现代简约'>现代简约</Checkbox>
201
-              <Checkbox value='田园风格'>田园风格</Checkbox>
202
-              <Checkbox value='新中式风格'>新中式风格</Checkbox>
203
-              <Checkbox value='地中海风格'>地中海风格</Checkbox>
204
-              <Checkbox value='东南亚风格'>东南亚风格</Checkbox>
205
-              <Checkbox value='美式风格'>美式风格</Checkbox>
206
-              <Checkbox value='日式风格'>日式风格</Checkbox>
207
-              <Checkbox value='混搭风格'>混搭风格</Checkbox>
196
+              <Checkbox value="北欧风格">北欧风格</Checkbox>
197
+              <Checkbox value="简欧风格">简欧风格</Checkbox>
198
+              <Checkbox value="欧式古典">欧式古典</Checkbox>
199
+              <Checkbox value="现代简约">现代简约</Checkbox>
200
+              <Checkbox value="田园风格">田园风格</Checkbox>
201
+              <Checkbox value="新中式风格">新中式风格</Checkbox>
202
+              <Checkbox value="地中海风格">地中海风格</Checkbox>
203
+              <Checkbox value="东南亚风格">东南亚风格</Checkbox>
204
+              <Checkbox value="美式风格">美式风格</Checkbox>
205
+              <Checkbox value="日式风格">日式风格</Checkbox>
206
+              <Checkbox value="混搭风格">混搭风格</Checkbox>
208
             </Checkbox.Group>,
207
             </Checkbox.Group>,
209
           )}
208
           )}
210
         </Form.Item>
209
         </Form.Item>
219
               <Checkbox value={'温馨舒适'}>温馨舒适</Checkbox>
218
               <Checkbox value={'温馨舒适'}>温馨舒适</Checkbox>
220
               <Checkbox value={'品质生活'}>品质生活</Checkbox>
219
               <Checkbox value={'品质生活'}>品质生活</Checkbox>
221
               <Checkbox value={'其他'}>其他</Checkbox>
220
               <Checkbox value={'其他'}>其他</Checkbox>
222
-            
223
             </Checkbox.Group>,
221
             </Checkbox.Group>,
224
           )}
222
           )}
225
         </Form.Item>
223
         </Form.Item>
269
             </Checkbox.Group>,
267
             </Checkbox.Group>,
270
           )}
268
           )}
271
         </Form.Item> */}
269
         </Form.Item> */}
272
-  
273
-      
270
+
274
         <Form.Item label="回访备注">
271
         <Form.Item label="回访备注">
275
           {getFieldDecorator('auditRemark', {
272
           {getFieldDecorator('auditRemark', {
276
             rules: [{ required: true, message: '请输入回访备注!' }], //v3x必填
273
             rules: [{ required: true, message: '请输入回访备注!' }], //v3x必填
277
           })(<TextArea placeholder="回访备注" disabled={type === 'detail'} rows={7} />)}
274
           })(<TextArea placeholder="回访备注" disabled={type === 'detail'} rows={7} />)}
278
         </Form.Item>
275
         </Form.Item>
279
         <Form.Item style={{ display: 'flex', justifyContent: 'center' }}>
276
         <Form.Item style={{ display: 'flex', justifyContent: 'center' }}>
280
-         {type === 'detail'?<Button onClick={()=>{router.go('-1')}}>
277
+          <AuthButton name="house.added.reply.submit" noRight={null}>
278
+            {type !== 'detail' && (
279
+              <>
280
+                <Button type="primary" htmlType="submit">
281
+                  有效
282
+                </Button>
283
+                &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
284
+                <Button onClick={() => submitDate({ status: '2' })}>无效</Button>
285
+              </>
286
+            )}
287
+          </AuthButton>
288
+          &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
289
+          <Button
290
+            onClick={() => {
291
+              router.go('-1');
292
+            }}
293
+          >
281
             返回
294
             返回
282
-          </Button>:<> <Button type="primary" htmlType="submit">
283
-            有效
284
           </Button>
295
           </Button>
285
-          &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
286
-          <Button onClick={() => submitDate({ status: '2' })}>无效</Button></>}
287
         </Form.Item>
296
         </Form.Item>
288
       </Form>
297
       </Form>
289
     </Card>
298
     </Card>

+ 83
- 53
src/pages/findRoom/addedValueService/index.jsx View File

3
 import moment from 'moment';
3
 import moment from 'moment';
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 QueryTable from '@/components/QueryTable'
6
+import QueryTable from '@/components/QueryTable';
7
 import { router } from 'umi';
7
 import { router } from 'umi';
8
-
8
+import AuthButton from '@/components/AuthButton';
9
 
9
 
10
 /**
10
 /**
11
  *
11
  *
14
  * @returns
14
  * @returns
15
  */
15
  */
16
 
16
 
17
-
18
-
19
-
20
 function Recommend() {
17
 function Recommend() {
21
-  const [exportLoding, setExportLoding] = useState(false)
18
+  const [exportLoding, setExportLoding] = useState(false);
22
   //详情页面弹窗配置
19
   //详情页面弹窗配置
23
-  function toAudit(row,type) {
20
+  function toAudit(row, type) {
24
     router.push({
21
     router.push({
25
       pathname: '/findRoom/addedValueService/audit',
22
       pathname: '/findRoom/addedValueService/audit',
26
       query: {
23
       query: {
27
         id: row.id,
24
         id: row.id,
28
-        type:type
25
+        type: type,
29
       },
26
       },
30
-    })
31
-
27
+    });
32
   }
28
   }
33
-//   function toSee(cuurentId) {
34
-//     router.push({
35
-//       pathname: '/home/recommend/auditCopy',
36
-//       query: {
37
-//         id: cuurentId,
38
-//       },
39
-//     })
40
-
41
-//   }
29
+  //   function toSee(cuurentId) {
30
+  //     router.push({
31
+  //       pathname: '/home/recommend/auditCopy',
32
+  //       query: {
33
+  //         id: cuurentId,
34
+  //       },
35
+  //     })
42
 
36
 
37
+  //   }
43
 
38
 
44
   /**
39
   /**
45
    *导出数据(推荐用户)
40
    *导出数据(推荐用户)
46
    *
41
    *
47
    */
42
    */
48
   function exportRecommendCustomer() {
43
   function exportRecommendCustomer() {
49
-    setExportLoding(true)
44
+    setExportLoding(true);
50
     request({
45
     request({
51
       ...apis.customer.customerRecommendRecommenderExport,
46
       ...apis.customer.customerRecommendRecommenderExport,
52
       responseType: 'blob',
47
       responseType: 'blob',
53
-    }).then(response => {
54
-      console.log('exportRecommendCustomer: ', response)
55
-      download(response)
56
-    }).catch(error => {
57
-
58
     })
48
     })
49
+      .then(response => {
50
+        console.log('exportRecommendCustomer: ', response);
51
+        download(response);
52
+      })
53
+      .catch(error => {});
59
   }
54
   }
60
 
55
 
61
   function download(data) {
56
   function download(data) {
62
     if (!data) {
57
     if (!data) {
63
-      return
58
+      return;
64
     }
59
     }
65
-    const url = window.URL.createObjectURL(new Blob([data]))
66
-    const link = document.createElement('a')
67
-    link.style.display = 'none'
68
-    link.href = url
69
-    link.setAttribute('download', '找房需求.xlsx')
70
-    document.body.append(link)
71
-    link.click()
72
-    setExportLoding(false)
60
+    const url = window.URL.createObjectURL(new Blob([data]));
61
+    const link = document.createElement('a');
62
+    link.style.display = 'none';
63
+    link.href = url;
64
+    link.setAttribute('download', '找房需求.xlsx');
65
+    document.body.append(link);
66
+    link.click();
67
+    setExportLoding(false);
73
   }
68
   }
74
   const columns = [
69
   const columns = [
75
     {
70
     {
98
       key: 'gender',
93
       key: 'gender',
99
       align: 'center',
94
       align: 'center',
100
       // eslint-disable-next-line no-nested-ternary
95
       // eslint-disable-next-line no-nested-ternary
101
-      render: (_, record) => <><span>{record.gender === '1' ? '男' : record.gender === '2' ? '女' : '未知'}</span></>,
96
+      render: (_, record) => (
97
+        <>
98
+          <span>{record.gender === '1' ? '男' : record.gender === '2' ? '女' : '未知'}</span>
99
+        </>
100
+      ),
102
     },
101
     },
103
     {
102
     {
104
       title: '房屋现状',
103
       title: '房屋现状',
105
-      dataIndex: 'intentArea',//意向区域
104
+      dataIndex: 'intentArea', //意向区域
106
       key: 'intentArea',
105
       key: 'intentArea',
107
       align: 'center',
106
       align: 'center',
108
       // render: (_, record) => <><span>{record.area = '江苏省南京市秦淮区'}</span></>,
107
       // render: (_, record) => <><span>{record.area = '江苏省南京市秦淮区'}</span></>,
109
-      render: (_, record) => <><span>{JSON.parse(record.questionnaire)?.filter(x=>x.key=='houseStatus')[0]?.result}</span></>,
110
-
108
+      render: (_, record) => (
109
+        <>
110
+          <span>
111
+            {JSON.parse(record.questionnaire)?.filter(x => x.key == 'houseStatus')[0]?.result}
112
+          </span>
113
+        </>
114
+      ),
111
     },
115
     },
112
     {
116
     {
113
       title: '装修预算',
117
       title: '装修预算',
114
       dataIndex: 'maxPrice',
118
       dataIndex: 'maxPrice',
115
       key: 'maxPrice',
119
       key: 'maxPrice',
116
       align: 'center',
120
       align: 'center',
117
-     
118
     },
121
     },
119
     {
122
     {
120
       title: '提交时间',
123
       title: '提交时间',
121
       dataIndex: 'createdTime',
124
       dataIndex: 'createdTime',
122
       key: 'createdTime',
125
       key: 'createdTime',
123
       align: 'center',
126
       align: 'center',
124
-      render: (_, record) => <><span>{record.createdTime && moment(record.createdTime).format('YYYY-MM-DD HH:mm:ss')}</span></>,
127
+      render: (_, record) => (
128
+        <>
129
+          <span>
130
+            {record.createdTime && moment(record.createdTime).format('YYYY-MM-DD HH:mm:ss')}
131
+          </span>
132
+        </>
133
+      ),
125
     },
134
     },
126
     {
135
     {
127
       title: '状态',
136
       title: '状态',
128
       dataIndex: 'status',
137
       dataIndex: 'status',
129
       key: 'status',
138
       key: 'status',
130
       align: 'center',
139
       align: 'center',
131
-      render: (_, record) => <><span>{record.status == '0' ? '待回访' : record.status == '1' ? '已回访' : record.status == '2' ? '无效' : ''}</span></>,
140
+      render: (_, record) => (
141
+        <>
142
+          <span>
143
+            {record.status == '0'
144
+              ? '待回访'
145
+              : record.status == '1'
146
+              ? '已回访'
147
+              : record.status == '2'
148
+              ? '无效'
149
+              : ''}
150
+          </span>
151
+        </>
152
+      ),
132
     },
153
     },
133
     {
154
     {
134
       title: '操作',
155
       title: '操作',
137
       align: 'center',
158
       align: 'center',
138
 
159
 
139
       render: (_, record) => (
160
       render: (_, record) => (
140
-        <>{record.status == '0'?<Button type='link' onClick={() => toAudit(record,'edit')}>审核</Button>:
141
-        <Button type='link' onClick={() => toAudit(record,'detail')}>查看详情</Button>}
161
+        <>
162
+          {record.status == '0' ? (
163
+            <AuthButton name="house.added.reply" noRight={null}>
164
+              <Button type="link" onClick={() => toAudit(record, 'edit')}>
165
+                审核
166
+              </Button>
167
+            </AuthButton>
168
+          ) : (
169
+            <AuthButton name="house.added.detail" noRight={null}>
170
+              <Button type="link" onClick={() => toAudit(record, 'detail')}>
171
+                查看详情
172
+              </Button>
173
+            </AuthButton>
174
+          )}
142
         </>
175
         </>
143
       ),
176
       ),
144
     },
177
     },
145
-  ]
146
-
178
+  ];
147
 
179
 
148
   const searchFields = [
180
   const searchFields = [
149
     {
181
     {
173
       label: '状态',
205
       label: '状态',
174
       placeholder: '请选择状态',
206
       placeholder: '请选择状态',
175
       type: 'select',
207
       type: 'select',
176
-      placeholder: '全部',//错误
208
+      placeholder: '全部', //错误
177
       options: [
209
       options: [
178
         { label: '全部', value: '' },
210
         { label: '全部', value: '' },
179
         { label: '待回访', value: '0' },
211
         { label: '待回访', value: '0' },
180
         { label: '已回访', value: '1' },
212
         { label: '已回访', value: '1' },
181
-        { label: '无效', value: '2' }
182
-      ]
213
+        { label: '无效', value: '2' },
214
+      ],
183
     },
215
     },
184
-  ]
216
+  ];
185
   const actionRender = () => {
217
   const actionRender = () => {
186
     return (
218
     return (
187
       <Button type="danger" loading={exportLoding} onClick={() => exportRecommendCustomer()}>
219
       <Button type="danger" loading={exportLoding} onClick={() => exportRecommendCustomer()}>
199
         searchFields={searchFields}
231
         searchFields={searchFields}
200
         columns={columns}
232
         columns={columns}
201
         postData={data => {
233
         postData={data => {
202
-        
203
-          data.type='4'
234
+          data.type = '4';
204
           return data;
235
           return data;
205
         }}
236
         }}
206
         // actionRender={actionRender}
237
         // actionRender={actionRender}
207
       />
238
       />
208
-
209
     </>
239
     </>
210
   );
240
   );
211
 }
241
 }
212
 
242
 
213
-export default Recommend
243
+export default Recommend;

+ 20
- 8
src/pages/findRoom/buyRoom/audit.jsx View File

5
 import apis from '@/services/apis';
5
 import apis from '@/services/apis';
6
 // import Styles from './style.less';
6
 // import Styles from './style.less';
7
 import { router } from 'umi';
7
 import { router } from 'umi';
8
+import AuthButton from '@/components/AuthButton';
8
 
9
 
9
 const { TextArea } = Input;
10
 const { TextArea } = Input;
10
 const { Option } = Select;
11
 const { Option } = Select;
54
     request({ ...apis.searchHouse.IdHouse, urlData: { id: currentId } }).then(res => {
55
     request({ ...apis.searchHouse.IdHouse, urlData: { id: currentId } }).then(res => {
55
       // res.reportDate = moment(res.reportDate)
56
       // res.reportDate = moment(res.reportDate)
56
       if (res) {
57
       if (res) {
57
-
58
         const b = {};
58
         const b = {};
59
         JSON.parse(res?.questionnaire)?.map(x => {
59
         JSON.parse(res?.questionnaire)?.map(x => {
60
           if (x.key === 'intentArea') {
60
           if (x.key === 'intentArea') {
61
-          
62
             return;
61
             return;
63
           }
62
           }
64
           if (x.key === 'maxPrice') {
63
           if (x.key === 'maxPrice') {
172
             </Select>,
171
             </Select>,
173
           )}
172
           )}
174
         </Form.Item>
173
         </Form.Item>
175
- 
174
+
176
         <Form.Item label="购房目的">
175
         <Form.Item label="购房目的">
177
           {getFieldDecorator('purpose')(
176
           {getFieldDecorator('purpose')(
178
             <Select placeholder="购房目的" disabled={disabled}>
177
             <Select placeholder="购房目的" disabled={disabled}>
268
           })(<TextArea placeholder="回访备注" disabled={type === 'detail'} rows={7} />)}
267
           })(<TextArea placeholder="回访备注" disabled={type === 'detail'} rows={7} />)}
269
         </Form.Item>
268
         </Form.Item>
270
         <Form.Item style={{ display: 'flex', justifyContent: 'center' }}>
269
         <Form.Item style={{ display: 'flex', justifyContent: 'center' }}>
271
-         {type === 'detail'?<Button onClick={()=>{router.go('-1')}}>
270
+          <AuthButton name="house.seach.reply.submit" noRight={null}>
271
+            {type !== 'detail' && (
272
+              <>
273
+                <Button type="primary" htmlType="submit">
274
+                  有效
275
+                </Button>
276
+                &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
277
+                <Button onClick={() => submitDate({ status: '2' })}>无效</Button>
278
+              </>
279
+            )}
280
+          </AuthButton>
281
+          &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
282
+          <Button
283
+            onClick={() => {
284
+              router.go('-1');
285
+            }}
286
+          >
272
             返回
287
             返回
273
-          </Button>:<> <Button type="primary" htmlType="submit">
274
-            有效
275
           </Button>
288
           </Button>
276
-          &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
277
-          <Button onClick={() => submitDate({ status: '2' })}>无效</Button></>}
278
         </Form.Item>
289
         </Form.Item>
279
       </Form>
290
       </Form>
280
     </Card>
291
     </Card>
281
   );
292
   );
282
 }
293
 }
294
+
283
 const HouseCopm = Form.create({ name: 'body' })(body);
295
 const HouseCopm = Form.create({ name: 'body' })(body);
284
 
296
 
285
 export default HouseCopm;
297
 export default HouseCopm;

+ 80
- 57
src/pages/findRoom/buyRoom/index.jsx View File

3
 import moment from 'moment';
3
 import moment from 'moment';
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 QueryTable from '@/components/QueryTable'
6
+import QueryTable from '@/components/QueryTable';
7
 import { router } from 'umi';
7
 import { router } from 'umi';
8
-
8
+import AuthButton from '@/components/AuthButton';
9
 
9
 
10
 /**
10
 /**
11
  *
11
  *
14
  * @returns
14
  * @returns
15
  */
15
  */
16
 
16
 
17
-
18
-
19
-
20
 function Recommend() {
17
 function Recommend() {
21
-  const [exportLoding, setExportLoding] = useState(false)
18
+  const [exportLoding, setExportLoding] = useState(false);
22
   //详情页面弹窗配置
19
   //详情页面弹窗配置
23
-  function toAudit(row,type) {
20
+  function toAudit(row, type) {
24
     router.push({
21
     router.push({
25
       pathname: '/findRoom/buyRoom/audit',
22
       pathname: '/findRoom/buyRoom/audit',
26
       query: {
23
       query: {
27
         id: row.id,
24
         id: row.id,
28
-        type:type
25
+        type: type,
29
       },
26
       },
30
-    })
31
-
27
+    });
32
   }
28
   }
33
-//   function toSee(cuurentId) {
34
-//     router.push({
35
-//       pathname: '/home/recommend/auditCopy',
36
-//       query: {
37
-//         id: cuurentId,
38
-//       },
39
-//     })
40
-
41
-//   }
29
+  //   function toSee(cuurentId) {
30
+  //     router.push({
31
+  //       pathname: '/home/recommend/auditCopy',
32
+  //       query: {
33
+  //         id: cuurentId,
34
+  //       },
35
+  //     })
42
 
36
 
37
+  //   }
43
 
38
 
44
   /**
39
   /**
45
    *导出数据(推荐用户)
40
    *导出数据(推荐用户)
46
    *
41
    *
47
    */
42
    */
48
   function exportRecommendCustomer() {
43
   function exportRecommendCustomer() {
49
-    setExportLoding(true)
44
+    setExportLoding(true);
50
     request({
45
     request({
51
       ...apis.customer.customerRecommendRecommenderExport,
46
       ...apis.customer.customerRecommendRecommenderExport,
52
       responseType: 'blob',
47
       responseType: 'blob',
53
-    }).then(response => {
54
-      console.log('exportRecommendCustomer: ', response)
55
-      download(response)
56
-    }).catch(error => {
57
-
58
     })
48
     })
49
+      .then(response => {
50
+        console.log('exportRecommendCustomer: ', response);
51
+        download(response);
52
+      })
53
+      .catch(error => {});
59
   }
54
   }
60
 
55
 
61
   function download(data) {
56
   function download(data) {
62
     if (!data) {
57
     if (!data) {
63
-      return
58
+      return;
64
     }
59
     }
65
-    const url = window.URL.createObjectURL(new Blob([data]))
66
-    const link = document.createElement('a')
67
-    link.style.display = 'none'
68
-    link.href = url
69
-    link.setAttribute('download', '找房需求.xlsx')
70
-    document.body.append(link)
71
-    link.click()
72
-    setExportLoding(false)
60
+    const url = window.URL.createObjectURL(new Blob([data]));
61
+    const link = document.createElement('a');
62
+    link.style.display = 'none';
63
+    link.href = url;
64
+    link.setAttribute('download', '找房需求.xlsx');
65
+    document.body.append(link);
66
+    link.click();
67
+    setExportLoding(false);
73
   }
68
   }
74
   const columns = [
69
   const columns = [
75
     {
70
     {
98
       key: 'gender',
93
       key: 'gender',
99
       align: 'center',
94
       align: 'center',
100
       // eslint-disable-next-line no-nested-ternary
95
       // eslint-disable-next-line no-nested-ternary
101
-      render: (_, record) => <><span>{record.gender === '1' ? '男' : record.gender === '2' ? '女' : '未知'}</span></>,
96
+      render: (_, record) => (
97
+        <>
98
+          <span>{record.gender === '1' ? '男' : record.gender === '2' ? '女' : '未知'}</span>
99
+        </>
100
+      ),
102
     },
101
     },
103
     {
102
     {
104
       title: '意向区域',
103
       title: '意向区域',
105
-      dataIndex: 'name',//意向区域
104
+      dataIndex: 'name', //意向区域
106
       key: 'name',
105
       key: 'name',
107
       align: 'center',
106
       align: 'center',
108
       // render: (_, record) => <><span>{record.area = '江苏省南京市秦淮区'}</span></>,
107
       // render: (_, record) => <><span>{record.area = '江苏省南京市秦淮区'}</span></>,
109
-
110
     },
108
     },
111
     {
109
     {
112
       title: '购房预算',
110
       title: '购房预算',
113
       dataIndex: 'maxPrice',
111
       dataIndex: 'maxPrice',
114
       key: 'maxPrice',
112
       key: 'maxPrice',
115
       align: 'center',
113
       align: 'center',
116
-      render:(x)=>x&&<span>{x/10000}万</span>
117
-
114
+      render: x => x && <span>{x / 10000}万</span>,
118
     },
115
     },
119
     {
116
     {
120
       title: '提交时间',
117
       title: '提交时间',
121
       dataIndex: 'createdTime',
118
       dataIndex: 'createdTime',
122
       key: 'createdTime',
119
       key: 'createdTime',
123
       align: 'center',
120
       align: 'center',
124
-      render: (_, record) => <><span>{record.createdTime && moment(record.createdTime).format('YYYY-MM-DD HH:mm:ss')}</span></>,
121
+      render: (_, record) => (
122
+        <>
123
+          <span>
124
+            {record.createdTime && moment(record.createdTime).format('YYYY-MM-DD HH:mm:ss')}
125
+          </span>
126
+        </>
127
+      ),
125
     },
128
     },
126
     {
129
     {
127
       title: '状态',
130
       title: '状态',
128
       dataIndex: 'status',
131
       dataIndex: 'status',
129
       key: 'status',
132
       key: 'status',
130
       align: 'center',
133
       align: 'center',
131
-      render: (_, record) => <><span>{record.status == '0' ? '待回访' : record.status == '1' ? '已回访' : record.status == '2' ? '无效' : ''}</span></>,
134
+      render: (_, record) => (
135
+        <>
136
+          <span>
137
+            {record.status == '0'
138
+              ? '待回访'
139
+              : record.status == '1'
140
+              ? '已回访'
141
+              : record.status == '2'
142
+              ? '无效'
143
+              : ''}
144
+          </span>
145
+        </>
146
+      ),
132
     },
147
     },
133
     {
148
     {
134
       title: '操作',
149
       title: '操作',
137
       align: 'center',
152
       align: 'center',
138
 
153
 
139
       render: (_, record) => (
154
       render: (_, record) => (
140
-        <>{record.status == '0'?<Button type='link' onClick={() => toAudit(record,'edit')}>审核</Button>:
141
-        <Button type='link' onClick={() => toAudit(record,'detail')}>查看详情</Button>}
155
+        <>
156
+          {record.status == '0' ? (
157
+            <AuthButton name="house.seach.reply" noRight={null}>
158
+              <Button type="link" onClick={() => toAudit(record, 'edit')}>
159
+                审核
160
+              </Button>
161
+            </AuthButton>
162
+          ) : (
163
+            <AuthButton name="house.seach.detail" noRight={null}>
164
+              <Button type="link" onClick={() => toAudit(record, 'detail')}>
165
+                查看详情
166
+              </Button>
167
+            </AuthButton>
168
+          )}
142
         </>
169
         </>
143
       ),
170
       ),
144
     },
171
     },
145
-  ]
146
-
172
+  ];
147
 
173
 
148
   const searchFields = [
174
   const searchFields = [
149
     {
175
     {
173
       label: '状态',
199
       label: '状态',
174
       placeholder: '请选择状态',
200
       placeholder: '请选择状态',
175
       type: 'select',
201
       type: 'select',
176
-      placeholder: '全部',//错误
202
+      placeholder: '全部', //错误
177
       options: [
203
       options: [
178
         { label: '全部', value: '' },
204
         { label: '全部', value: '' },
179
         { label: '待回访', value: '0' },
205
         { label: '待回访', value: '0' },
180
         { label: '已回访', value: '1' },
206
         { label: '已回访', value: '1' },
181
-        { label: '无效', value: '2' }
182
-      ]
207
+        { label: '无效', value: '2' },
208
+      ],
183
     },
209
     },
184
-  ]
210
+  ];
185
   const actionRender = () => {
211
   const actionRender = () => {
186
     return (
212
     return (
187
       <Button type="danger" loading={exportLoding} onClick={() => exportRecommendCustomer()}>
213
       <Button type="danger" loading={exportLoding} onClick={() => exportRecommendCustomer()}>
197
         // recommendCustomer
223
         // recommendCustomer
198
         api={apis.searchHouse.list}
224
         api={apis.searchHouse.list}
199
         searchFields={searchFields}
225
         searchFields={searchFields}
200
-        
201
         postData={data => {
226
         postData={data => {
202
-        
203
-          data.type='1'
227
+          data.type = '1';
204
           return data;
228
           return data;
205
         }}
229
         }}
206
         columns={columns}
230
         columns={columns}
207
         // actionRender={actionRender}
231
         // actionRender={actionRender}
208
       />
232
       />
209
-
210
     </>
233
     </>
211
   );
234
   );
212
 }
235
 }
213
 
236
 
214
-export default Recommend
237
+export default Recommend;
215
 /**
238
 /**
216
-     * 帮我找房类型 1买房2租房3海外置业4增值服务
217
-     */
218
-//  private Integer type;
239
+ * 帮我找房类型 1买房2租房3海外置业4增值服务
240
+ */
241
+//  private Integer type;

+ 20
- 19
src/pages/findRoom/overseas/audit.jsx View File

5
 import apis from '@/services/apis';
5
 import apis from '@/services/apis';
6
 // import Styles from './style.less';
6
 // import Styles from './style.less';
7
 import { router } from 'umi';
7
 import { router } from 'umi';
8
+import AuthButton from '@/components/AuthButton';
8
 
9
 
9
 const { TextArea } = Input;
10
 const { TextArea } = Input;
10
 const { Option } = Select;
11
 const { Option } = Select;
56
       if (res) {
57
       if (res) {
57
         const b = {};
58
         const b = {};
58
         JSON.parse(res?.questionnaire)?.map(x => {
59
         JSON.parse(res?.questionnaire)?.map(x => {
59
-         
60
           if (x.key === 'maxPrice') {
60
           if (x.key === 'maxPrice') {
61
             b[x.key] = x.result / 10000;
61
             b[x.key] = x.result / 10000;
62
             return;
62
             return;
68
           }
68
           }
69
         });
69
         });
70
 
70
 
71
-        
72
         props.form.setFieldsValue({
71
         props.form.setFieldsValue({
73
           ...res,
72
           ...res,
74
           reportDate: moment(res.reportDate),
73
           reportDate: moment(res.reportDate),
176
           })(<TextArea placeholder="回访备注" disabled={type === 'detail'} rows={7} />)}
175
           })(<TextArea placeholder="回访备注" disabled={type === 'detail'} rows={7} />)}
177
         </Form.Item>
176
         </Form.Item>
178
         <Form.Item style={{ display: 'flex', justifyContent: 'center' }}>
177
         <Form.Item style={{ display: 'flex', justifyContent: 'center' }}>
179
-          {type === 'detail' ? (
180
-            <Button
181
-              onClick={() => {
182
-                router.go('-1');
183
-              }}
184
-            >
185
-              返回
186
-            </Button>
187
-          ) : (
188
-            <>
189
-              <Button type="primary" htmlType="submit">
190
-                有效
191
-              </Button>
192
-              &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
193
-              <Button onClick={() => submitDate({ status: '2' })}>无效</Button>
194
-            </>
195
-          )}
178
+          <AuthButton name="house.abroad.reply.submit" noRight={null}>
179
+            {type !== 'detail' && (
180
+              <>
181
+                <Button type="primary" htmlType="submit">
182
+                  有效
183
+                </Button>
184
+                &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
185
+                <Button onClick={() => submitDate({ status: '2' })}>无效</Button>
186
+              </>
187
+            )}
188
+          </AuthButton>
189
+          &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
190
+          <Button
191
+            onClick={() => {
192
+              router.go('-1');
193
+            }}
194
+          >
195
+            返回
196
+          </Button>
196
         </Form.Item>
197
         </Form.Item>
197
       </Form>
198
       </Form>
198
     </Card>
199
     </Card>

+ 15
- 3
src/pages/findRoom/overseas/index.jsx View File

5
 import apis from '../../../services/apis';
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
-
8
+import AuthButton from '@/components/AuthButton';
9
 
9
 
10
 /**
10
 /**
11
  *
11
  *
137
       align: 'center',
137
       align: 'center',
138
 
138
 
139
       render: (_, record) => (
139
       render: (_, record) => (
140
-        <>{record.status == '0'?<Button type='link' onClick={() => toAudit(record,'edit')}>审核</Button>:
141
-        <Button type='link' onClick={() => toAudit(record,'detail')}>查看详情</Button>}
140
+        <>
141
+          {record.status == '0' ? (
142
+            <AuthButton name="house.abroad.reply" noRight={null}>
143
+              <Button type="link" onClick={() => toAudit(record, 'edit')}>
144
+                审核
145
+              </Button>
146
+            </AuthButton>
147
+          ) : (
148
+            <AuthButton name="house.abroad.detail" noRight={null}>
149
+              <Button type="link" onClick={() => toAudit(record, 'detail')}>
150
+                查看详情
151
+              </Button>
152
+            </AuthButton>
153
+          )}
142
         </>
154
         </>
143
       ),
155
       ),
144
     },
156
     },

+ 19
- 6
src/pages/findRoom/rent/audit.jsx View File

5
 import apis from '@/services/apis';
5
 import apis from '@/services/apis';
6
 // import Styles from './style.less';
6
 // import Styles from './style.less';
7
 import { router } from 'umi';
7
 import { router } from 'umi';
8
+import AuthButton from '@/components/AuthButton';
8
 
9
 
9
 const { TextArea } = Input;
10
 const { TextArea } = Input;
10
 const { Option } = Select;
11
 const { Option } = Select;
201
         </Form.Item>
202
         </Form.Item>
202
         <Form.Item label="回访备注">
203
         <Form.Item label="回访备注">
203
           {getFieldDecorator('auditRemark', {
204
           {getFieldDecorator('auditRemark', {
204
-            rules: [{ required: true, message: '请输入回访备注!' }], //v3x必填
205
+            rules: [{ required: true, message: '请输入回访备注!' }], 
205
           })(<TextArea placeholder="回访备注" disabled={type === 'detail'} rows={7} />)}
206
           })(<TextArea placeholder="回访备注" disabled={type === 'detail'} rows={7} />)}
206
         </Form.Item>
207
         </Form.Item>
207
         <Form.Item style={{ display: 'flex', justifyContent: 'center' }}>
208
         <Form.Item style={{ display: 'flex', justifyContent: 'center' }}>
208
-         {type === 'detail'?<Button onClick={()=>{router.go('-1')}}>
209
+        <AuthButton name="house.rent.reply.submit" noRight={null}>
210
+            {type !== 'detail' && (
211
+              <>
212
+                <Button type="primary" htmlType="submit">
213
+                  有效
214
+                </Button>
215
+                &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
216
+                <Button onClick={() => submitDate({ status: '2' })}>无效</Button>
217
+              </>
218
+            )}
219
+          </AuthButton>
220
+          &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
221
+          <Button
222
+            onClick={() => {
223
+              router.go('-1');
224
+            }}
225
+          >
209
             返回
226
             返回
210
-          </Button>:<> <Button type="primary" htmlType="submit">
211
-            有效
212
           </Button>
227
           </Button>
213
-          &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
214
-          <Button onClick={() => submitDate({ status: '2' })}>无效</Button></>}
215
         </Form.Item>
228
         </Form.Item>
216
       </Form>
229
       </Form>
217
     </Card>
230
     </Card>

+ 16
- 4
src/pages/findRoom/rent/index.jsx View File

5
 import apis from '../../../services/apis';
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
-
8
+import AuthButton from '@/components/AuthButton';
9
 
9
 
10
 /**
10
 /**
11
  *
11
  *
137
       align: 'center',
137
       align: 'center',
138
 
138
 
139
       render: (_, record) => (
139
       render: (_, record) => (
140
-        <>{record.status == '0'?<Button type='link' onClick={() => toAudit(record,'edit')}>审核</Button>:
141
-        <Button type='link' onClick={() => toAudit(record,'detail')}>查看详情</Button>}
142
-        </>
140
+        <>
141
+        {record.status == '0' ? (
142
+          <AuthButton name="house.rent.reply" noRight={null}>
143
+            <Button type="link" onClick={() => toAudit(record, 'edit')}>
144
+              审核
145
+            </Button>
146
+          </AuthButton>
147
+        ) : (
148
+          <AuthButton name="house.rent.detail" noRight={null}>
149
+            <Button type="link" onClick={() => toAudit(record, 'detail')}>
150
+              查看详情
151
+            </Button>
152
+          </AuthButton>
153
+        )}
154
+      </>
143
       ),
155
       ),
144
     },
156
     },
145
   ]
157
   ]

+ 9
- 7
src/pages/news/list/List.jsx View File

226
       align: 'center',
226
       align: 'center',
227
       render: withActions(
227
       render: withActions(
228
         (_, row) => [
228
         (_, row) => [
229
-          <AuthButton name="admin.taNews.publish" noRight={null}>
229
+          <AuthButton name="news.publish" noRight={null}>
230
             <OperButton
230
             <OperButton
231
               onClick={() =>
231
               onClick={() =>
232
                 cancelRelease(
232
                 cancelRelease(
244
           //   <span style={{ position: 'absolute', right: '83px', top: '16px', fontSize: ' 0.106rem', zIndex: 1, color: '#FF7E48', cursor: 'pointer' }} onClick={topNews(data.weight, data.newsId)}>{data.weight === 1 ? '取消置顶' : '置顶'}</span>
244
           //   <span style={{ position: 'absolute', right: '83px', top: '16px', fontSize: ' 0.106rem', zIndex: 1, color: '#FF7E48', cursor: 'pointer' }} onClick={topNews(data.weight, data.newsId)}>{data.weight === 1 ? '取消置顶' : '置顶'}</span>
245
           // </AuthButton>
245
           // </AuthButton>
246
           row.newsStatus === 0 && (
246
           row.newsStatus === 0 && (
247
-            <AuthButton name="admin.taNews.top" noRight={null}>
247
+            <AuthButton name="news.add" noRight={null}>
248
               <OperButton onClick={() => topNews(row.weight, row.newsId)}>
248
               <OperButton onClick={() => topNews(row.weight, row.newsId)}>
249
                 {row.weight === 1 ? '取消置顶' : '置顶'}
249
                 {row.weight === 1 ? '取消置顶' : '置顶'}
250
               </OperButton>
250
               </OperButton>
251
             </AuthButton>
251
             </AuthButton>
252
           ),
252
           ),
253
 
253
 
254
-          <AuthButton name="admin.taNews.id.put" noRight={null}>
254
+          <AuthButton name="news.edit" noRight={null}>
255
             <OperButton onClick={() => toEditList(row.newsId)}>编辑</OperButton>
255
             <OperButton onClick={() => toEditList(row.newsId)}>编辑</OperButton>
256
           </AuthButton>,
256
           </AuthButton>,
257
 
257
 
258
-          <AuthButton name="admin.taNews.id.delete" noRight={null}>
258
+          <AuthButton name="news.delete" noRight={null}>
259
             <OperButton.Confirm
259
             <OperButton.Confirm
260
               title="确认删除?"
260
               title="确认删除?"
261
               content="删除之后不可恢复"
261
               content="删除之后不可恢复"
271
   ];
271
   ];
272
   const actionRender = () => {
272
   const actionRender = () => {
273
     return (
273
     return (
274
-      <Button type="primary" icon="plus" onClick={() => toEditList()}>
275
-        新增
276
-      </Button>
274
+      <AuthButton name="news.add" noRight={null}>
275
+        <Button type="primary" icon="plus" onClick={() => toEditList()}>
276
+          新增
277
+        </Button>
278
+      </AuthButton>
277
     );
279
     );
278
   };
280
   };
279
 
281
 

+ 4
- 4
src/pages/news/type/NewsType.jsx View File

86
       dataIndex: 'newsTypeName',
86
       dataIndex: 'newsTypeName',
87
       key: 'newsTypeName',
87
       key: 'newsTypeName',
88
       align: 'center',
88
       align: 'center',
89
-      render: (text, record) => <Navigate to={`/news/type/editNews?id=${record.newsTypeId}`}>{text}</Navigate>
89
+      // render: (text, record) => <Navigate to={`/news/type/editNews?id=${record.newsTypeId}`}>{text}</Navigate>
90
     },
90
     },
91
     {
91
     {
92
       title: '操作',
92
       title: '操作',
94
       key: 'handle',
94
       key: 'handle',
95
       align: 'center',
95
       align: 'center',
96
       render: withActions((x, row) => [
96
       render: withActions((x, row) => [
97
-        <AuthButton name="admin.taNewsType.id.delete" noRight={null}>
97
+        <AuthButton name="news.type.delete" noRight={null}>
98
           <ConfirmButton type="link" title="确认删除?" onClick={changeNewsStatus(row, row.newsTypeId)}>
98
           <ConfirmButton type="link" title="确认删除?" onClick={changeNewsStatus(row, row.newsTypeId)}>
99
             <EditIcon text="删除" type="delete" />
99
             <EditIcon text="删除" type="delete" />
100
           </ConfirmButton>
100
           </ConfirmButton>
101
         </AuthButton>,
101
         </AuthButton>,
102
-        <AuthButton name="admin.taNewsType.id.put" noRight={null}>
102
+        <AuthButton name="news.type.edit" noRight={null}>
103
           <EditIcon text="编辑" type="edit" onClick={toEditNews(row.newsTypeId)} />
103
           <EditIcon text="编辑" type="edit" onClick={toEditNews(row.newsTypeId)} />
104
         </AuthButton>,
104
         </AuthButton>,
105
       ]),
105
       ]),
132
             </Button>
132
             </Button>
133
         </Form.Item>
133
         </Form.Item>
134
       </Form>
134
       </Form>
135
-      <AuthButton name="admin.taNewsType.post" noRight={null}>
135
+      <AuthButton name="news.type.add" noRight={null}>
136
         <Button type='primary' style={{margin:'20px 0'}} onClick={toEditNews()}>新增</Button>
136
         <Button type='primary' style={{margin:'20px 0'}} onClick={toEditNews()}>新增</Button>
137
       </AuthButton>
137
       </AuthButton>
138
       <Table rowKey="newsType" dataSource={data.records} columns={columns} pagination={false} />
138
       <Table rowKey="newsType" dataSource={data.records} columns={columns} pagination={false} />

+ 59
- 43
src/pages/news/type/editNews.jsx View File

1
 import React, { useState, useEffect } from 'react';
1
 import React, { useState, useEffect } from 'react';
2
-import { Input, Menu, Dropdown, Button, Icon, message, Table, Divider, Tag, Select, Form, Alert } from 'antd';
2
+import {
3
+  Input,
4
+  Menu,
5
+  Dropdown,
6
+  Button,
7
+  Icon,
8
+  message,
9
+  Table,
10
+  Divider,
11
+  Tag,
12
+  Select,
13
+  Form,
14
+  Card,
15
+} from 'antd';
3
 import { FormattedMessage } from 'umi-plugin-react/locale';
16
 import { FormattedMessage } from 'umi-plugin-react/locale';
4
-import BuildSelect from '../../../components/SelectButton/BuildSelect'
17
+import BuildSelect from '../../../components/SelectButton/BuildSelect';
5
 import XForm, { FieldTypes } from '../../../components/XForm';
18
 import XForm, { FieldTypes } from '../../../components/XForm';
6
 import router from 'umi/router';
19
 import router from 'umi/router';
7
 import apis from '../../../services/apis';
20
 import apis from '../../../services/apis';
8
-import request from '../../../utils/request'
21
+import request from '../../../utils/request';
9
 
22
 
10
 const { TextArea } = Input;
23
 const { TextArea } = Input;
11
 const { Option } = Select;
24
 const { Option } = Select;
12
 
25
 
13
 const header = props => {
26
 const header = props => {
14
-  const newsId = props.location.query.id
15
-  console.log("newsId" + newsId);
16
-  const [ newsData, setNewsData ] = useState({})
17
-  if(newsId){
27
+  const newsId = props.location.query.id;
28
+  console.log('newsId' + newsId);
29
+  const [newsData, setNewsData] = useState({});
30
+  if (newsId) {
18
     useEffect(() => {
31
     useEffect(() => {
19
       getNewsData(newsId);
32
       getNewsData(newsId);
20
-    },[])
33
+    }, []);
21
 
34
 
22
-  // 查询列表
23
-  const getNewsData = (newsId) => {
24
-    request({
35
+    // 查询列表
36
+    const getNewsData = newsId => {
37
+      request({
25
         ...apis.newsType.get,
38
         ...apis.newsType.get,
26
-        urlData: { id: newsId }
27
-    }).then((data) => {
28
-        setNewsData(data)
29
-    }).catch((err) => {
30
-      message.error(err.msg || err.message)
31
-    })
32
-  }
39
+        urlData: { id: newsId },
40
+      })
41
+        .then(data => {
42
+          setNewsData(data);
43
+        })
44
+        .catch(err => {
45
+          message.error(err.msg || err.message);
46
+        });
47
+    };
33
   }
48
   }
34
 
49
 
35
   const fields = [
50
   const fields = [
38
       name: 'buildingId',
53
       name: 'buildingId',
39
       render: <BuildSelect />,
54
       render: <BuildSelect />,
40
       value: newsData.buildingId,
55
       value: newsData.buildingId,
41
-      rules: [
42
-        {required: true, message: '请选择所属项目'},
43
-      ]
56
+      rules: [{ required: true, message: '请选择所属项目' }],
44
     },
57
     },
45
     {
58
     {
46
       label: '类型图',
59
       label: '类型图',
54
       name: 'newsTypeName',
67
       name: 'newsTypeName',
55
       type: FieldTypes.Text,
68
       type: FieldTypes.Text,
56
       value: newsData.newsTypeName,
69
       value: newsData.newsTypeName,
57
-      rules: [
58
-        {required: true, message: '请输入资讯名称'},
59
-      ]
70
+      rules: [{ required: true, message: '请输入资讯名称' }],
60
     },
71
     },
61
-  ]
72
+  ];
62
 
73
 
63
-   
64
-  const handleSubmit = (values) => {
65
-    if(newsId){
66
-        values.newsTypeId = newsId
67
-        request({ ...apis.newsType.put, urlData: { id: newsId }, data: { ...values }}).then((data) => {
74
+  const handleSubmit = values => {
75
+    if (newsId) {
76
+      values.newsTypeId = newsId;
77
+      request({ ...apis.newsType.put, urlData: { id: newsId }, data: { ...values } })
78
+        .then(data => {
68
           cancelPage();
79
           cancelPage();
69
-        }).catch((err) => {
70
-          message.error(err.msg || err.message)
71
         })
80
         })
72
-      }else{
73
-        request({ ...apis.newsType.post, data: { ...values } }).then((data) => {
81
+        .catch(err => {
82
+          message.error(err.msg || err.message);
83
+        });
84
+    } else {
85
+      request({ ...apis.newsType.post, data: { ...values } })
86
+        .then(data => {
74
           cancelPage();
87
           cancelPage();
75
-        }).catch((err) => {
76
-          message.error(err.msg || err.message)
77
         })
88
         })
78
-      }
79
-  }
89
+        .catch(err => {
90
+          message.error(err.msg || err.message);
91
+        });
92
+    }
93
+  };
80
 
94
 
81
   const cancelPage = () => {
95
   const cancelPage = () => {
82
     router.push({
96
     router.push({
83
       pathname: '/news/type/NewsType',
97
       pathname: '/news/type/NewsType',
84
     });
98
     });
85
-  }
99
+  };
86
 
100
 
87
   return (
101
   return (
88
-    <XForm onSubmit={handleSubmit} onCancel={cancelPage} fields={fields}></XForm>
89
-  )
90
-}
102
+    <Card>
103
+      <XForm onSubmit={handleSubmit} onCancel={cancelPage} fields={fields}></XForm>
104
+    </Card>
105
+  );
106
+};
91
 
107
 
92
 const WrappedNormalLoginForm = Form.create({ name: 'header' })(header);
108
 const WrappedNormalLoginForm = Form.create({ name: 'header' })(header);
93
-export default WrappedNormalLoginForm
109
+export default WrappedNormalLoginForm;

+ 30
- 24
src/pages/staff/Organization/index.jsx View File

21
 import TreedataAdd from './addForm';
21
 import TreedataAdd from './addForm';
22
 import { connect } from 'dva';
22
 import { connect } from 'dva';
23
 import { add } from 'lodash';
23
 import { add } from 'lodash';
24
+import AuthButton from '@/components/AuthButton';
24
 
25
 
25
 const { TreeNode, DirectoryTree } = Tree;
26
 const { TreeNode, DirectoryTree } = Tree;
26
 const FormItem = Form.Item;
27
 const FormItem = Form.Item;
172
   const getTitle = item => {
173
   const getTitle = item => {
173
     return (
174
     return (
174
       <>
175
       <>
175
-        {item.title}{' '}
176
-        <Icon
177
-          type="plus"
178
-          onClick={e => {
179
-            e.stopPropagation(), add(item);
180
-          }}
181
-        />{' '}
182
-        <Icon
183
-          type="edit"
184
-          onClick={e => {
185
-            e.stopPropagation(), edit(item);
186
-          }}
187
-        />{' '}
188
-        <Icon
189
-          type="delete"
190
-          onClick={e => {
191
-            e.stopPropagation(), onDelete(item);
192
-          }}
193
-        />
176
+        {item.title}
177
+        <AuthButton name="institution.add" noRight={null}>
178
+          <Icon
179
+            type="plus"
180
+            onClick={e => {
181
+              e.stopPropagation(), add(item);
182
+            }}
183
+            style={{marginLeft:'5px'}}
184
+          />
185
+        </AuthButton>
186
+        <AuthButton name="institution.edit" noRight={null}>
187
+          <Icon
188
+            type="edit"
189
+            onClick={e => {
190
+              e.stopPropagation(), edit(item);
191
+            }}
192
+            style={{marginLeft:'5px'}}
193
+          />
194
+        </AuthButton>
195
+        <AuthButton name="institution.delete" noRight={null}>
196
+          <Icon
197
+            type="delete"
198
+            onClick={e => {
199
+              e.stopPropagation(), onDelete(item);
200
+            }}
201
+            style={{marginLeft:'5px'}}
202
+          />
203
+        </AuthButton>
194
       </>
204
       </>
195
     );
205
     );
196
   };
206
   };
209
   return (
219
   return (
210
     <>
220
     <>
211
       <Card style={{ minHeight: '500px' }}>
221
       <Card style={{ minHeight: '500px' }}>
212
-        <Tree
213
-          defaultExpandAll
214
-        >
215
-          {renderTreeNodes(getTreeFrom(user.institutionList) || [])}
216
-        </Tree>
222
+        <Tree defaultExpandAll>{renderTreeNodes(getTreeFrom(user.institutionList) || [])}</Tree>
217
       </Card>
223
       </Card>
218
       <Modal
224
       <Modal
219
         title={type == 'add' ? '新增' : '编辑'}
225
         title={type == 'add' ? '新增' : '编辑'}

+ 198
- 145
src/pages/staff/Role/Edit/index.jsx View File

6
 import request from '@/utils/request';
6
 import request from '@/utils/request';
7
 import router from 'umi/router';
7
 import router from 'umi/router';
8
 import apis from '@/services/apis';
8
 import apis from '@/services/apis';
9
+import AuthButton from '@/components/AuthButton';
9
 
10
 
10
 const { TextArea } = Input;
11
 const { TextArea } = Input;
11
 
12
 
12
-
13
 /**
13
 /**
14
  *
14
  *
15
  *
15
  *
19
 const Poster = props => {
19
 const Poster = props => {
20
   const userMenus = props.user.currentUser.menus;
20
   const userMenus = props.user.currentUser.menus;
21
   const userBtns = props.user.currentUser.buttons;
21
   const userBtns = props.user.currentUser.buttons;
22
-  console.log(userMenus)
22
+  console.log(userMenus);
23
   // 获取当前所有菜单
23
   // 获取当前所有菜单
24
-  const [data, setData] = useState({ data: [] })
25
-  const [buttonData, setButtonData] = useState([])
24
+  const [data, setData] = useState({ data: [] });
25
+  const [buttonData, setButtonData] = useState([]);
26
 
26
 
27
   // 展示要显示的菜单和按钮----(编辑)
27
   // 展示要显示的菜单和按钮----(编辑)
28
-  const [dataMenuId, setDataMenuId] = useState([])
29
-  const [dataButtonId, setDataButtonId] = useState([])
28
+  const [dataMenuId, setDataMenuId] = useState([]);
29
+  const [dataButtonId, setDataButtonId] = useState([]);
30
 
30
 
31
   const [loading, setLoading] = useState(false);
31
   const [loading, setLoading] = useState(false);
32
 
32
 
33
   useEffect(() => {
33
   useEffect(() => {
34
     // 新增和编辑用一个页面
34
     // 新增和编辑用一个页面
35
     if (props.location.query) {
35
     if (props.location.query) {
36
-      const { id } = props.location.query
36
+      const { id } = props.location.query;
37
       if (id) {
37
       if (id) {
38
-        buttonAndMenuList('', id)
38
+        buttonAndMenuList('', id);
39
       }
39
       }
40
     }
40
     }
41
     // menuList({ pageNum: 1, pageSize: 100 })
41
     // menuList({ pageNum: 1, pageSize: 100 })
42
-    buttonList({ pageNum: 1, pageSize: 100 })
43
-  }, [])
42
+    buttonList({ pageNum: 1, pageSize: 100 });
43
+  }, []);
44
   // 当前所有的菜单
44
   // 当前所有的菜单
45
   function menuList(params) {
45
   function menuList(params) {
46
-    request({ ...apis.role.menuList, params: { ...params } }).then((data) => {
47
-      setData(data)
48
-  }).catch((err) => {
49
-      console.log(err)
50
-      message.info(err.msg || err.message)
51
-  })
46
+    request({ ...apis.role.menuList, params: { ...params } })
47
+      .then(data => {
48
+        setData(data);
49
+      })
50
+      .catch(err => {
51
+        console.log(err);
52
+        message.info(err.msg || err.message);
53
+      });
52
   }
54
   }
53
 
55
 
54
   // 所有按钮
56
   // 所有按钮
55
   function buttonList(params) {
57
   function buttonList(params) {
56
-    request({ ...apis.role.buttonList, params: { ...params } }).then((data) => {
57
-      setButtonData(data)
58
-  }).catch((err) => {
59
-      console.log(err)
60
-  })
58
+    request({ ...apis.role.buttonList, params: { ...params } })
59
+      .then(data => {
60
+        setButtonData(data);
61
+      })
62
+      .catch(err => {
63
+        console.log(err);
64
+      });
61
   }
65
   }
62
 
66
 
63
-
64
   // 根据角色id查询当前的菜单及其按钮
67
   // 根据角色id查询当前的菜单及其按钮
65
   function buttonAndMenuList(params, ids) {
68
   function buttonAndMenuList(params, ids) {
66
-    setLoading(true)
67
-    request({ ...apis.role.buttonAndMenuList, urlData: { id: ids }, params: { ...params } }).then(data => {
68
-      setLoading(false)
69
-      props.form.setFieldsValue({ roleName: data.roleName })
70
-      console.log(data)
71
-      setData(data)
72
-
73
-      // 获取所有的权限Id
74
-      if (data.sysMenuList) {
75
-        setDataMenuId(data.sysMenuList.map(item => item && item.menuId))
76
-        // setDataButtonId((data.sysMenuList.map(item => item.sysButtonInMenu && item.sysButtonInMenu.map(btn => btn.btnId).join(',')).filter(f => f !== '').join(',').split(',')).map(a => parseInt(a) ) )
77
-        setDataButtonId(data.sysButtonInMenu.map(item => item && item.btnId))
78
-      }
79
-  }).catch((err) => {
80
-      console.log(err)
81
-      message.info(err.msg || err.message)
82
-  })
69
+    setLoading(true);
70
+    request({ ...apis.role.buttonAndMenuList, urlData: { id: ids }, params: { ...params } })
71
+      .then(data => {
72
+        setLoading(false);
73
+        props.form.setFieldsValue({ roleName: data.roleName });
74
+        console.log(data);
75
+        setData(data);
76
+
77
+        // 获取所有的权限Id
78
+        if (data.sysMenuList) {
79
+          setDataMenuId(data.sysMenuList.map(item => item && item.menuId));
80
+          // setDataButtonId((data.sysMenuList.map(item => item.sysButtonInMenu && item.sysButtonInMenu.map(btn => btn.btnId).join(',')).filter(f => f !== '').join(',').split(',')).map(a => parseInt(a) ) )
81
+          setDataButtonId(data.sysButtonInMenu.map(item => item && item.btnId));
82
+        }
83
+      })
84
+      .catch(err => {
85
+        console.log(err);
86
+        message.info(err.msg || err.message);
87
+      });
83
   }
88
   }
84
 
89
 
85
   // const [menus, setMenus] = useState([]);
90
   // const [menus, setMenus] = useState([]);
87
   const [menus, setMenus] = useState([]);
92
   const [menus, setMenus] = useState([]);
88
   const [but, setBut] = useState([]);
93
   const [but, setBut] = useState([]);
89
 
94
 
90
-  const addMenus = m => setMenus([...menus, m])
95
+  const addMenus = m => setMenus([...menus, m]);
91
   const delMenus = m => setMenus(menus.filter(x => x.menuId !== m.menuId));
96
   const delMenus = m => setMenus(menus.filter(x => x.menuId !== m.menuId));
92
 
97
 
93
   const handleMenuChange = m => e => {
98
   const handleMenuChange = m => e => {
94
     // 如果是根菜单, 把子菜单挑出来
99
     // 如果是根菜单, 把子菜单挑出来
95
-    const isMenuRoot = m.parentCode === '-1'
96
-    const subMenus = isMenuRoot ? userMenus.filter(x => x.parentCode == m.menuId) : []
100
+    const isMenuRoot = m.parentCode === '-1';
101
+    const subMenus = isMenuRoot ? userMenus.filter(x => x.parentCode == m.menuId) : [];
97
     // 把子菜单与当前对象, 同时作为当前操作对象
102
     // 把子菜单与当前对象, 同时作为当前操作对象
98
-    const currentMenus = [ m, ...subMenus ]
103
+    const currentMenus = [m, ...subMenus];
99
     // 先把选中列表中, 当前操作对象去掉
104
     // 先把选中列表中, 当前操作对象去掉
100
-    const leftCheckedMenusIds = dataMenuId.filter(x => !currentMenus.some(it => it.menuId == x))
105
+    const leftCheckedMenusIds = dataMenuId.filter(x => !currentMenus.some(it => it.menuId == x));
101
 
106
 
102
     // 当前选中菜单
107
     // 当前选中菜单
103
-    const currentCheckedMenus = e.target.checked ? currentMenus : []
108
+    const currentCheckedMenus = e.target.checked ? currentMenus : [];
104
 
109
 
105
     // 计算所有选中菜单
110
     // 计算所有选中菜单
106
     let checkedMenus = [
111
     let checkedMenus = [
107
       ...currentCheckedMenus,
112
       ...currentCheckedMenus,
108
       ...userMenus.filter(x => leftCheckedMenusIds.some(it => it == x.menuId)),
113
       ...userMenus.filter(x => leftCheckedMenusIds.some(it => it == x.menuId)),
109
-    ]
114
+    ];
110
 
115
 
111
     // 如果子菜单全部取消选择, 那么根菜单也取消选择
116
     // 如果子菜单全部取消选择, 那么根菜单也取消选择
112
     // 如果子菜单有一个选中, 那么根菜单也选中
117
     // 如果子菜单有一个选中, 那么根菜单也选中
113
     if (!isMenuRoot) {
118
     if (!isMenuRoot) {
114
-      const children = checkedMenus.filter(x => x.menuRoot === m.menuRoot && x.menuId !== m.menuRoot)
119
+      const children = checkedMenus.filter(
120
+        x => x.menuRoot === m.menuRoot && x.menuId !== m.menuRoot,
121
+      );
115
       if (!children || children.length < 1) {
122
       if (!children || children.length < 1) {
116
-        checkedMenus = checkedMenus.filter(x => x.menuId !== m.menuRoot)
123
+        checkedMenus = checkedMenus.filter(x => x.menuId !== m.menuRoot);
117
       } else {
124
       } else {
118
-        const hasRootMenu = checkedMenus.some(x => x.menuId === m.menuRoot)
119
-  
125
+        const hasRootMenu = checkedMenus.some(x => x.menuId === m.menuRoot);
126
+
120
         if (!hasRootMenu) {
127
         if (!hasRootMenu) {
121
-          const rootMenu = userMenus.filter(x => x.menuId === m.menuRoot)[0]
128
+          const rootMenu = userMenus.filter(x => x.menuId === m.menuRoot)[0];
122
           if (rootMenu) {
129
           if (rootMenu) {
123
-            checkedMenus.push(rootMenu)
130
+            checkedMenus.push(rootMenu);
124
           }
131
           }
125
         }
132
         }
126
       }
133
       }
128
 
135
 
129
     // 只要菜单选中, 所属按钮全部选中
136
     // 只要菜单选中, 所属按钮全部选中
130
     // 菜单取消选择, 所有按钮全部取消选择
137
     // 菜单取消选择, 所有按钮全部取消选择
131
-    const currentMenuBtns = currentMenus.reduce((acc, it) => [...acc, ...userBtns.filter(x => x.menuId === it.menuId)], [])
132
-    const currentCheckedMenuBtns = currentCheckedMenus.reduce((acc, it) => [...acc, ...userBtns.filter(x => x.menuId === it.menuId)], [])
133
-    const checkedBtns = dataButtonId.filter(x => !currentMenuBtns.some(it => it.btnId === x)).map(x => userBtns.filter(it => x == it.btnId)[0]).concat(...currentCheckedMenuBtns)
134
-
135
-    setMenus(checkedMenus)
136
-    setDataMenuId(checkedMenus.map(x => x.menuId))
137
-    setDataButtonId(checkedBtns.map(x => x.btnId))
138
-    setBut(checkedBtns)
139
-  }
138
+    const currentMenuBtns = currentMenus.reduce(
139
+      (acc, it) => [...acc, ...userBtns.filter(x => x.menuId === it.menuId)],
140
+      [],
141
+    );
142
+    const currentCheckedMenuBtns = currentCheckedMenus.reduce(
143
+      (acc, it) => [...acc, ...userBtns.filter(x => x.menuId === it.menuId)],
144
+      [],
145
+    );
146
+    const checkedBtns = dataButtonId
147
+      .filter(x => !currentMenuBtns.some(it => it.btnId === x))
148
+      .map(x => userBtns.filter(it => x == it.btnId)[0])
149
+      .concat(...currentCheckedMenuBtns);
150
+
151
+    setMenus(checkedMenus);
152
+    setDataMenuId(checkedMenus.map(x => x.menuId));
153
+    setDataButtonId(checkedBtns.map(x => x.btnId));
154
+    setBut(checkedBtns);
155
+  };
140
 
156
 
141
   // 判断menus是否有值
157
   // 判断menus是否有值
142
-  const addBut = m => setBut([...but, m])
158
+  const addBut = m => setBut([...but, m]);
143
   const delBut = m => setBut(but.filter(x => x.menuId !== m.menuId));
159
   const delBut = m => setBut(but.filter(x => x.menuId !== m.menuId));
144
   const handleButChange = m => e => {
160
   const handleButChange = m => e => {
145
-
146
     // 如果有一个按钮选中, 那么对应的菜单也需要选中
161
     // 如果有一个按钮选中, 那么对应的菜单也需要选中
147
     // 如果没有一个兄弟节点选中, 不做任何处理
162
     // 如果没有一个兄弟节点选中, 不做任何处理
148
     if (e.target.checked) {
163
     if (e.target.checked) {
149
-      const parentMenuId = dataMenuId.filter(x => x === m.menuId)[0]
164
+      const parentMenuId = dataMenuId.filter(x => x === m.menuId)[0];
150
 
165
 
151
       if (!parentMenuId) {
166
       if (!parentMenuId) {
152
-        const parentMenu = userMenus.filter(x => x.menuId === m.menuId)[0]
153
-        const parentMenuRoot = userMenus.filter(x => x.menuId === parentMenu.menuRoot)[0]
167
+        const parentMenu = userMenus.filter(x => x.menuId === m.menuId)[0];
168
+        const parentMenuRoot = userMenus.filter(x => x.menuId === parentMenu.menuRoot)[0];
154
 
169
 
155
-        const checkedMenus = menus.concat(parentMenu).concat(parentMenuRoot)
156
-        setMenus(checkedMenus)
157
-        setDataMenuId(checkedMenus.map(x => x.menuId))
170
+        const checkedMenus = menus.concat(parentMenu).concat(parentMenuRoot);
171
+        setMenus(checkedMenus);
172
+        setDataMenuId(checkedMenus.map(x => x.menuId));
158
       }
173
       }
159
     }
174
     }
160
 
175
 
161
     if (e.target.checked) {
176
     if (e.target.checked) {
162
-      setDataButtonId(dataButtonId.concat(m.btnId))
163
-      addBut(m)
177
+      setDataButtonId(dataButtonId.concat(m.btnId));
178
+      addBut(m);
164
     } else {
179
     } else {
165
       setDataButtonId(dataButtonId.filter(item => item !== m.btnId));
180
       setDataButtonId(dataButtonId.filter(item => item !== m.btnId));
166
-      delBut(m)
181
+      delBut(m);
167
     }
182
     }
168
-  }
183
+  };
169
   const gridStyle1 = {
184
   const gridStyle1 = {
170
     width: '20%',
185
     width: '20%',
171
     textAlign: 'left',
186
     textAlign: 'left',
172
     height: '72px',
187
     height: '72px',
173
-    padding:'24px'
188
+    padding: '24px',
174
   };
189
   };
175
   const gridStyle2 = {
190
   const gridStyle2 = {
176
     width: '80%',
191
     width: '80%',
179
   };
194
   };
180
 
195
 
181
   function toRoleList() {
196
   function toRoleList() {
182
-    router.go('-1')
197
+    router.go('-1');
183
   }
198
   }
184
 
199
 
185
   function updateAuthMenu(data) {
200
   function updateAuthMenu(data) {
186
-    setLoading(true)
187
-    request({ ...apis.role.updateAuthMenu, data: { ...data } }).then((data) => {
188
-      setLoading(false)
189
-      toRoleList()
190
-  }).catch((err) => {
191
-      console.log(err)
192
-  })
201
+    setLoading(true);
202
+    request({ ...apis.role.updateAuthMenu, data: { ...data } })
203
+      .then(data => {
204
+        setLoading(false);
205
+        toRoleList();
206
+      })
207
+      .catch(err => {
208
+        console.log(err);
209
+      });
193
   }
210
   }
194
 
211
 
195
-
196
   function handleSubmit(e) {
212
   function handleSubmit(e) {
197
     e.preventDefault();
213
     e.preventDefault();
198
     props.form.validateFields((err, values) => {
214
     props.form.validateFields((err, values) => {
199
       if (values.roleName === undefined || values.roleName === '') {
215
       if (values.roleName === undefined || values.roleName === '') {
200
-        message.error('请输入角色名称')
201
-        return
216
+        message.error('请输入角色名称');
217
+        return;
202
       }
218
       }
203
 
219
 
204
       if (props.location.query.id !== undefined) {
220
       if (props.location.query.id !== undefined) {
205
-        console.log('menus', menus)
206
-      
207
-        const sumitMenu = userMenus.filter(item => dataMenuId.includes(item.menuId))
208
-        const sumitBtn = buttonData.filter(item => dataButtonId.includes(item.btnId))
209
-        updateAuthMenu({ sysMenu: sumitMenu, name: values.roleName, id: props.location.query.id, sysButton: sumitBtn })
221
+        console.log('menus', menus);
222
+
223
+        const sumitMenu = userMenus.filter(item => dataMenuId.includes(item.menuId));
224
+        const sumitBtn = buttonData.filter(item => dataButtonId.includes(item.btnId));
225
+        updateAuthMenu({
226
+          sysMenu: sumitMenu,
227
+          name: values.roleName,
228
+          id: props.location.query.id,
229
+          sysButton: sumitBtn,
230
+        });
210
       } else {
231
       } else {
211
-        updateAuthMenu({ sysMenu: menus, name: values.roleName, id: props.location.query.id, sysButton: but })
212
-        }
232
+        updateAuthMenu({
233
+          sysMenu: menus,
234
+          name: values.roleName,
235
+          id: props.location.query.id,
236
+          sysButton: but,
237
+        });
238
+      }
213
     });
239
     });
214
   }
240
   }
215
   const { getFieldDecorator } = props.form;
241
   const { getFieldDecorator } = props.form;
216
-  
242
+
217
   return (
243
   return (
218
     <Card>
244
     <Card>
219
       <div>
245
       <div>
220
-      <Spin spinning={ loading } size="large">
221
-        <Form labelCol={{ span: 2 }} wrapperCol={{ span: 18 }} onSubmit={handleSubmit}>
222
-          <Form.Item label="角色名称">
223
-            {getFieldDecorator('roleName', {
224
-              rules: [{ required: true, message: '请输入角色名称' }],
225
-            })(<Input  />)}
226
-
227
-          </Form.Item>
228
-          {userMenus.map(item => (
229
-            (item.parentCode === '-1') &&
230
-            <Row >
231
-              <Col offset={2} span={18}>
232
-
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'}} >
234
-                  {
235
-                    userMenus.map(menu => (
236
-
237
-                      (item.menuId === menu.menuRoot && item.menuId !== menu.menuId) &&
238
-                      <>
239
-                        <Card.Grid style={gridStyle1} >
240
-                          <Checkbox checked={dataMenuId.includes(menu.menuId)} onChange={handleMenuChange(menu)}>{menu.name}</Checkbox>
241
-                        </Card.Grid>
242
-                        <Card.Grid style={gridStyle2}>
243
-                          {buttonData.length > 0 && buttonData.map(btn => (
244
-                            <>
245
-                              {
246
-                                btn.menuId === menu.menuId &&
247
-                                <Checkbox checked={dataButtonId.includes(btn.btnId)} onChange={handleButChange(btn)}>{btn.name}</Checkbox>
248
-                              }
249
-                            </>
250
-                          ))}
251
-                        </Card.Grid>
252
-                      </>
253
-                    ))
254
-                  }
255
-                </Card>
256
-              </Col>
257
-
258
-            </Row>
259
-          ))}
260
-          <Form.Item wrapperCol={{ span: 15, offset: 7 }} style={{ marginTop: '10px' }}>
261
-            <AuthButton name="role.submit">
262
-              <Button type="primary" htmlType="submit">
263
-                保存
246
+        <Spin spinning={loading} size="large">
247
+          <Form labelCol={{ span: 6 }} wrapperCol={{ span: 12 }} onSubmit={handleSubmit}>
248
+            <Form.Item label="角色名称">
249
+              {getFieldDecorator('roleName', {
250
+                rules: [{ required: true, message: '请输入角色名称' }],
251
+              })(<Input />)}
252
+            </Form.Item>
253
+            {userMenus.map(
254
+              item =>
255
+                item.parentCode === '-1' && (
256
+                  <Row>
257
+                    <Col span={6}></Col>
258
+                    <Col span={18}>
259
+                      <Card
260
+                        title={
261
+                          <Checkbox
262
+                            checked={dataMenuId.includes(item.menuId)}
263
+                            onChange={handleMenuChange(item)}
264
+                          >
265
+                            {item.name}
266
+                          </Checkbox>
267
+                        }
268
+                        bordered
269
+                        style={{
270
+                          width: '100%',
271
+                          alignItems: 'center',
272
+                          margin: '10px 0',
273
+                          boxShadow: '3px 3px 10px  rgba(0,0,0,0.15)',
274
+                          borderRadius: '8px',
275
+                        }}
276
+                      >
277
+                        {userMenus.map(
278
+                          menu =>
279
+                            item.menuId === menu.menuRoot &&
280
+                            item.menuId !== menu.menuId && (
281
+                              <>
282
+                                <Card.Grid style={gridStyle1}>
283
+                                  <Checkbox
284
+                                    checked={dataMenuId.includes(menu.menuId)}
285
+                                    onChange={handleMenuChange(menu)}
286
+                                  >
287
+                                    {menu.name}
288
+                                  </Checkbox>
289
+                                </Card.Grid>
290
+                                <Card.Grid style={gridStyle2}>
291
+                                  {buttonData.length > 0 &&
292
+                                    buttonData.map(btn => (
293
+                                      <>
294
+                                        {btn.menuId === menu.menuId && (
295
+                                          <Checkbox
296
+                                            checked={dataButtonId.includes(btn.btnId)}
297
+                                            onChange={handleButChange(btn)}
298
+                                          >
299
+                                            {btn.name}
300
+                                          </Checkbox>
301
+                                        )}
302
+                                      </>
303
+                                    ))}
304
+                                </Card.Grid>
305
+                              </>
306
+                            ),
307
+                        )}
308
+                      </Card>
309
+                    </Col>
310
+                  </Row>
311
+                ),
312
+            )}
313
+            <Form.Item wrapperCol={{ span: 15, offset: 7 }} style={{ marginTop: '10px' }}>
314
+              <AuthButton name="role.submit" noRight={null}>
315
+                <Button type="primary" htmlType="submit">
316
+                  保存
317
+                </Button>
318
+              </AuthButton>
319
+              <Button onClick={toRoleList} style={{ marginLeft: '20px' }}>
320
+                取消
264
               </Button>
321
               </Button>
265
-            </AuthButton>
266
-            <Button onClick = {toRoleList} style={{ marginLeft: '20px' }}>
267
-              取消
268
-          </Button>
269
-          </Form.Item>
270
-        </Form>
322
+            </Form.Item>
323
+          </Form>
271
         </Spin>
324
         </Spin>
272
       </div>
325
       </div>
273
     </Card>
326
     </Card>
274
-  )
275
-}
327
+  );
328
+};
276
 const WrappedNormalLoginForm = Form.create({ name: 'Poster' })(Poster);
329
 const WrappedNormalLoginForm = Form.create({ name: 'Poster' })(Poster);
277
 export default connect(({ user }) => ({ user }))(WrappedNormalLoginForm);
330
 export default connect(({ user }) => ({ user }))(WrappedNormalLoginForm);

+ 25
- 20
src/pages/staff/staff/Edit/index.jsx View File

71
   }, []);
71
   }, []);
72
 
72
 
73
   const handleSubmit = val => {
73
   const handleSubmit = val => {
74
-    console.log(val,userId,'----------111------------')
74
+    console.log(val, userId, '----------111------------');
75
     // val.institutionIdLis =  val?.institutionIdLis?.split(',')
75
     // val.institutionIdLis =  val?.institutionIdLis?.split(',')
76
     // console.log(val,userId,'----------------------')
76
     // console.log(val,userId,'----------------------')
77
+    if (val.loginName) {
78
+      val.loginName = val.phone;
79
+    }
80
+
77
     if (userId) {
81
     if (userId) {
78
       request({ ...apis.staff.updateTaUser, urlData: { id: userId }, data: val })
82
       request({ ...apis.staff.updateTaUser, urlData: { id: userId }, data: val })
79
         .then(data => {
83
         .then(data => {
156
           message: '请输入正确的电话号码',
160
           message: '请输入正确的电话号码',
157
         },
161
         },
158
       ],
162
       ],
159
-      help: '登录账号为手机号  默认密码:12345',
163
+      help: '登录账号为手机号  默认密码:123456',
160
     },
164
     },
161
 
165
 
162
     {
166
     {
206
     {
210
     {
207
       label: '组织机构',
211
       label: '组织机构',
208
       name: 'institutionIdLis',
212
       name: 'institutionIdLis',
209
-      render: <InstitutionSelect multiple/>,
213
+      render: <InstitutionSelect multiple />,
210
       value: userData.institutionIdLis,
214
       value: userData.institutionIdLis,
211
       rules: [{ required: true, message: '组织机构' }],
215
       rules: [{ required: true, message: '组织机构' }],
212
     },
216
     },
221
     {
225
     {
222
       label: '授权项目',
226
       label: '授权项目',
223
       name: 'buildingIds',
227
       name: 'buildingIds',
224
-      render: <Select
225
-        mode="multiple"
226
-        showSearch
227
-        style={{ width: '100%' }}
228
-        placeholder="请选择授权项目"
229
-        filterOption={(input, option) =>
230
-          option.props.children && option.props.children.toLowerCase().indexOf(input.toLowerCase()) >= 0
231
-        }
228
+      render: (
229
+        <Select
230
+          mode="multiple"
231
+          showSearch
232
+          style={{ width: '100%' }}
233
+          placeholder="请选择授权项目"
234
+          filterOption={(input, option) =>
235
+            option.props.children &&
236
+            option.props.children.toLowerCase().indexOf(input.toLowerCase()) >= 0
237
+          }
232
         >
238
         >
233
-        {buildData.map(item => (
234
-          <Select.Option key={item.buildingId} value={item.buildingId}>
235
-            {item.buildingName}
236
-          </Select.Option>
237
-        ))}
238
-      </Select>,
239
+          {buildData.map(item => (
240
+            <Select.Option key={item.buildingId} value={item.buildingId}>
241
+              {item.buildingName}
242
+            </Select.Option>
243
+          ))}
244
+        </Select>
245
+      ),
239
       value: userData.buildingIds,
246
       value: userData.buildingIds,
240
       hidden: () => isConsultant,
247
       hidden: () => isConsultant,
241
-      rules: [
242
-        { required: true, message: '请选择授权项目' },
243
-      ]
248
+      rules: [{ required: true, message: '请选择授权项目' }],
244
     },
249
     },
245
     {
250
     {
246
       label: '简介',
251
       label: '简介',

+ 9
- 5
src/pages/system/Sellhouse/houseTypes/Newindex.jsx View File

1
 import React, { useState, useEffect } from 'react';
1
 import React, { useState, useEffect } from 'react';
2
-import { Checkbox, Input, Card, Form, Button, Row, Col,InputNumber , message } from 'antd';
2
+import { Checkbox, Input, Card, Form, Button, Row, Col, InputNumber, 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 request from '@/utils/request';
5
 import request from '@/utils/request';
6
 import router from 'umi/router';
6
 import router from 'umi/router';
7
 import apis from '@/services/apis';
7
 import apis from '@/services/apis';
8
+import AuthButton from '@/components/AuthButton';
8
 
9
 
9
 const { TextArea } = Input;
10
 const { TextArea } = Input;
10
 
11
 
114
         <Form.Item label="顺序">
115
         <Form.Item label="顺序">
115
           {getFieldDecorator('sort', {
116
           {getFieldDecorator('sort', {
116
             initialValue: data.sort,
117
             initialValue: data.sort,
117
-          })(<InputNumber  style={{ width: '500px' }} />)}
118
+          })(<InputNumber style={{ width: '500px' }} />)}
118
         </Form.Item>
119
         </Form.Item>
119
         <Form.Item style={{ display: 'flex', justifyContent: 'center' }}>
120
         <Form.Item style={{ display: 'flex', justifyContent: 'center' }}>
120
-          <Button type="primary" htmlType="submit">
121
-            保存
122
-          </Button>
121
+          <AuthButton name="encyclopedias.type.submit" noRight={null}>
122
+            <Button type="primary" htmlType="submit">
123
+              保存
124
+            </Button>
125
+          </AuthButton>
126
+
123
           <Button style={{ marginLeft: '20px' }} onClick={Backcom}>
127
           <Button style={{ marginLeft: '20px' }} onClick={Backcom}>
124
             取消
128
             取消
125
           </Button>
129
           </Button>

+ 3
- 3
src/pages/system/Sellhouse/houseTypes/index.jsx View File

68
 
68
 
69
       render: withActions((text, record) => [
69
       render: withActions((text, record) => [
70
      
70
      
71
-          <AuthButton name="admin.role.publish" noRight={null}>
71
+          <AuthButton name="encyclopedias.type.delete" noRight={null}>
72
             <EditIcon type="delete" text="删除" onClick={() => onDelete(record.policyTypeId)} />
72
             <EditIcon type="delete" text="删除" onClick={() => onDelete(record.policyTypeId)} />
73
           </AuthButton>
73
           </AuthButton>
74
        ,
74
        ,
75
 
75
 
76
-        <AuthButton name="admin.role.put" noRight={null}>
76
+        <AuthButton name="encyclopedias.type.edit" noRight={null}>
77
           <EditIcon text="编辑" type="edit" onClick={() => addHouseTypes(record.policyTypeId)} />
77
           <EditIcon text="编辑" type="edit" onClick={() => addHouseTypes(record.policyTypeId)} />
78
         </AuthButton>,
78
         </AuthButton>,
79
       ]),
79
       ]),
88
 
88
 
89
   const actionRender = () => {
89
   const actionRender = () => {
90
     return (
90
     return (
91
-      <AuthButton name="admin.taPolicy.post" noRight={null}>
91
+      <AuthButton name="encyclopedias.type.add" noRight={null}>
92
         <Button type="primary" style={{ margin: '20px 0' }} onClick={()=>addHouseTypes()}>
92
         <Button type="primary" style={{ margin: '20px 0' }} onClick={()=>addHouseTypes()}>
93
           新增
93
           新增
94
         </Button>
94
         </Button>

+ 128
- 87
src/pages/system/Sellhouse/index.jsx View File

12
 import request from '@/utils/request';
12
 import request from '@/utils/request';
13
 // import styles from '../style/GoodsList.less';
13
 // import styles from '../style/GoodsList.less';
14
 
14
 
15
-const header = (props) => {
16
-  const [data, setData] = useState({})
15
+const header = props => {
16
+  const [data, setData] = useState({});
17
 
17
 
18
   useEffect(() => {
18
   useEffect(() => {
19
     getList({ pageNum: 1, pageSize: 10, cityId: '' });
19
     getList({ pageNum: 1, pageSize: 10, cityId: '' });
20
-  }, [])
20
+  }, []);
21
 
21
 
22
   // 查询列表
22
   // 查询列表
23
-  const getList = (params) => {
24
-    request({ ...apis.system.getTaPolicy, params: { ...params,...props.form.getFieldsValue() }, }).then((data) => {
25
-      console.log(data)
26
-      setData(data)
27
-    })
28
-  }
23
+  const getList = params => {
24
+    request({
25
+      ...apis.system.getTaPolicy,
26
+      params: { ...params, ...props.form.getFieldsValue() },
27
+    }).then(data => {
28
+      console.log(data);
29
+      setData(data);
30
+    });
31
+  };
29
 
32
 
30
   // 跳转到编辑商品
33
   // 跳转到编辑商品
31
-  const toEditPolicy = (policyId) => () => {
34
+  const toEditPolicy = policyId => () => {
32
     router.push({
35
     router.push({
33
       pathname: '/news/Sellhouse/Edit',
36
       pathname: '/news/Sellhouse/Edit',
34
       query: {
37
       query: {
35
-        policyId
38
+        policyId,
36
       },
39
       },
37
     });
40
     });
38
-  }
41
+  };
39
 
42
 
40
   /**
43
   /**
41
    *
44
    *
49
       dataIndex: 'policyImg',
52
       dataIndex: 'policyImg',
50
       key: 'policyImg',
53
       key: 'policyImg',
51
       align: 'center',
54
       align: 'center',
52
-      render: (policyImg,row) =><Navigate onClick={toEditPolicy(row.policyId)} ><img src={policyImg} width={93}/></Navigate> ,
55
+      render: (policyImg, row) => <img src={policyImg} width={93} />,
53
     },
56
     },
54
     {
57
     {
55
       title: '标题',
58
       title: '标题',
56
       dataIndex: 'title',
59
       dataIndex: 'title',
57
       key: 'title',
60
       key: 'title',
58
       align: 'center',
61
       align: 'center',
59
-      render: (text, record) => <Navigate to={`/news/Sellhouse/Edit?policyId=${record.policyId}`}>{text}</Navigate>
62
+      render: (text, record) => (
63
+        <AuthButton name="encyclopedias.publish" noRight={text}>
64
+          <Navigate to={`/news/Sellhouse/Edit?policyId=${record.policyId}`}>{text}</Navigate>
65
+        </AuthButton>
66
+      ),
60
     },
67
     },
61
     {
68
     {
62
       title: '副标题',
69
       title: '副标题',
81
       dataIndex: 'createDate',
88
       dataIndex: 'createDate',
82
       key: 'createDate',
89
       key: 'createDate',
83
       align: 'center',
90
       align: 'center',
84
-      render: (createDate) => <><span>{moment(createDate).format('YYYY-MM-DD')}</span></>
91
+      render: createDate => (
92
+        <>
93
+          <span>{moment(createDate).format('YYYY-MM-DD')}</span>
94
+        </>
95
+      ),
85
     },
96
     },
86
     {
97
     {
87
       title: '热点',
98
       title: '热点',
88
       dataIndex: 'isHot',
99
       dataIndex: 'isHot',
89
       key: 'isHot',
100
       key: 'isHot',
90
       align: 'center',
101
       align: 'center',
91
-      render: (x) => <><span>{x === 1 ? '是' : '否'}</span></>
102
+      render: x => (
103
+        <>
104
+          <span>{x === 1 ? '是' : '否'}</span>
105
+        </>
106
+      ),
92
     },
107
     },
93
     {
108
     {
94
       title: '状态',
109
       title: '状态',
95
       dataIndex: 'publishStatus',
110
       dataIndex: 'publishStatus',
96
       key: 'publishStatus',
111
       key: 'publishStatus',
97
       align: 'center',
112
       align: 'center',
98
-      render: (publishStatus) => <><span>{publishStatus === 1 ? '已发布' : '未发布'}</span></>
113
+      render: publishStatus => (
114
+        <>
115
+          <span>{publishStatus === 1 ? '已发布' : '未发布'}</span>
116
+        </>
117
+      ),
99
     },
118
     },
100
-    
119
+
101
     {
120
     {
102
       title: '操作',
121
       title: '操作',
103
       dataIndex: 'handle',
122
       dataIndex: 'handle',
104
       key: 'handle',
123
       key: 'handle',
105
       align: 'center',
124
       align: 'center',
106
       render: withActions((x, row) => [
125
       render: withActions((x, row) => [
107
-        <AuthButton name="admin.taPolicy.publish" noRight={null}>
108
-          <EditIcon type={row.publishStatus === 0 ? 'publish' : 'cancel'} text={row.publishStatus === 0 ? '发布' : '取消发布'} onClick={publicOrNoPublic(row)}></EditIcon>
126
+        <AuthButton name="encyclopedias.publish" noRight={null}>
127
+          <EditIcon
128
+            type={row.publishStatus === 0 ? 'publish' : 'cancel'}
129
+            text={row.publishStatus === 0 ? '发布' : '取消发布'}
130
+            onClick={publicOrNoPublic(row)}
131
+          ></EditIcon>
109
         </AuthButton>,
132
         </AuthButton>,
110
-        
111
-        <AuthButton name="admin.taPolicy.top" noRight={null}>
112
-          <EditIcon type={row.weight === 1 ? 'cancel' : 'top'} text={row.weight === 1 ? '取消置顶' : '置顶'} onClick={topPolicy(row)}></EditIcon>
133
+
134
+        <AuthButton name="encyclopedias.top" noRight={null}>
135
+          <EditIcon
136
+            type={row.weight === 1 ? 'cancel' : 'top'}
137
+            text={row.weight === 1 ? '取消置顶' : '置顶'}
138
+            onClick={topPolicy(row)}
139
+          ></EditIcon>
113
         </AuthButton>,
140
         </AuthButton>,
114
-        
115
-        <AuthButton name="admin.taPolicy.id.put" noRight={null}>
141
+
142
+        <AuthButton name="encyclopedias.edit" noRight={null}>
116
           <EditIcon type="edit" text="编辑" onClick={toEditPolicy(row.policyId)}></EditIcon>
143
           <EditIcon type="edit" text="编辑" onClick={toEditPolicy(row.policyId)}></EditIcon>
117
         </AuthButton>,
144
         </AuthButton>,
118
 
145
 
119
-        <AuthButton name="admin.taPolicy.id.delete" noRight={null}>
146
+        <AuthButton name="encyclopedias.delete" noRight={null}>
120
           <EditIcon type="delete" text="删除" onClick={deletePolicy(row.policyId)}></EditIcon>
147
           <EditIcon type="delete" text="删除" onClick={deletePolicy(row.policyId)}></EditIcon>
121
         </AuthButton>,
148
         </AuthButton>,
122
-      ])
149
+      ]),
123
     },
150
     },
124
   ];
151
   ];
125
 
152
 
126
   // 删除
153
   // 删除
127
-  const deletePolicy = (policyId) => () => {
154
+  const deletePolicy = policyId => () => {
128
     Modal.confirm({
155
     Modal.confirm({
129
       title: '购房政策会被删除,小程序端和后台都无法再看到',
156
       title: '购房政策会被删除,小程序端和后台都无法再看到',
130
       okText: '确定',
157
       okText: '确定',
131
       cancelText: '取消',
158
       cancelText: '取消',
132
       onOk() {
159
       onOk() {
133
-        request({ ...apis.system.deleteTaPolicy, urlData: { id: policyId }, }).then((data) => {
134
-          message.info('操作成功!')
135
-          getList({ pageNum: 1, pageSize: 10, cityId: '' });
136
-        }).catch((err) => {
137
-          console.log(err)
138
-          message.info(err.msg || err.message)
139
-        })
160
+        request({ ...apis.system.deleteTaPolicy, urlData: { id: policyId } })
161
+          .then(data => {
162
+            message.info('操作成功!');
163
+            getList({ pageNum: 1, pageSize: 10, cityId: '' });
164
+          })
165
+          .catch(err => {
166
+            console.log(err);
167
+            message.info(err.msg || err.message);
168
+          });
140
       },
169
       },
141
     });
170
     });
142
-  }
143
-
171
+  };
144
 
172
 
145
   //   置顶
173
   //   置顶
146
-  const topPolicy = (row) => () => {
147
-    const weight = Math.abs(row.weight - 1)
148
-    row.weight = weight
149
-    request({ ...apis.system.updateTaPolicy, urlData: { id: row.policyId }, data: row, }).then((data) => {
150
-      console.log(data)
151
-      message.info('操作成功!')
152
-      getList({ pageNum: 1, pageSize: 10, cityId: '' });
153
-    }).catch((err) => {
154
-      console.log(err)
155
-      message.info(err.msg || err.message)
156
-    })
157
-  }
158
-
159
-  const publicOrNoPublic = (row) => () => {
174
+  const topPolicy = row => () => {
175
+    const weight = Math.abs(row.weight - 1);
176
+    row.weight = weight;
177
+    request({ ...apis.system.updateTaPolicy, urlData: { id: row.policyId }, data: row })
178
+      .then(data => {
179
+        console.log(data);
180
+        message.info('操作成功!');
181
+        getList({ pageNum: 1, pageSize: 10, cityId: '' });
182
+      })
183
+      .catch(err => {
184
+        console.log(err);
185
+        message.info(err.msg || err.message);
186
+      });
187
+  };
188
+
189
+  const publicOrNoPublic = row => () => {
160
     if (row.publishStatus === 1) {
190
     if (row.publishStatus === 1) {
161
-      row.publishStatus = 0
191
+      row.publishStatus = 0;
162
     } else {
192
     } else {
163
-      row.publishStatus = 1
193
+      row.publishStatus = 1;
164
     }
194
     }
165
-    const title = row.publishStatus === 0 ? '购房政策会在小程序端隐藏,后台可继续编辑重新发布' : '确认发布此数据'
195
+    const title =
196
+      row.publishStatus === 0
197
+        ? '购房政策会在小程序端隐藏,后台可继续编辑重新发布'
198
+        : '确认发布此数据';
166
     Modal.confirm({
199
     Modal.confirm({
167
       title: title,
200
       title: title,
168
       okText: '确定',
201
       okText: '确定',
169
       cancelText: '取消',
202
       cancelText: '取消',
170
       onOk() {
203
       onOk() {
171
-        request({ ...apis.system.updateTaPolicy, urlData: { id: row.policyId }, data: row, }).then((data) => {
172
-          console.log(data)
173
-          message.info('操作成功!')
174
-          getList({ pageNum: 1, pageSize: 10, cityId: '' });
175
-        }).catch((err) => {
176
-          console.log(err)
177
-          message.info(err.msg || err.message)
178
-        })
204
+        request({ ...apis.system.updateTaPolicy, urlData: { id: row.policyId }, data: row })
205
+          .then(data => {
206
+            console.log(data);
207
+            message.info('操作成功!');
208
+            getList({ pageNum: 1, pageSize: 10, cityId: '' });
209
+          })
210
+          .catch(err => {
211
+            console.log(err);
212
+            message.info(err.msg || err.message);
213
+          });
179
       },
214
       },
180
     });
215
     });
216
+  };
181
 
217
 
182
-
183
-  }
184
-
185
-  const changePageNum = (pageNumber) => {
186
-    getList({ pageNum: pageNumber, pageSize: 10, ...props.form.getFieldsValue() })
187
-  }
218
+  const changePageNum = pageNumber => {
219
+    getList({ pageNum: pageNumber, pageSize: 10, ...props.form.getFieldsValue() });
220
+  };
188
 
221
 
189
   // 提交事件
222
   // 提交事件
190
   const handleSubmit = (e, props) => {
223
   const handleSubmit = (e, props) => {
191
     e.preventDefault();
224
     e.preventDefault();
192
     props.form.validateFields((err, values) => {
225
     props.form.validateFields((err, values) => {
193
       if (!err) {
226
       if (!err) {
194
-        console.log('提交数据: ', values)
195
-        getList({ pageNum: 1, pageSize: 10, ...values })
227
+        console.log('提交数据: ', values);
228
+        getList({ pageNum: 1, pageSize: 10, ...values });
196
       }
229
       }
197
     });
230
     });
198
-  }
231
+  };
199
 
232
 
200
-  const { getFieldDecorator } = props.form
233
+  const { getFieldDecorator } = props.form;
201
   return (
234
   return (
202
-
203
     <Card>
235
     <Card>
204
       <Form layout="inline" onSubmit={e => handleSubmit(e, props)}>
236
       <Form layout="inline" onSubmit={e => handleSubmit(e, props)}>
205
-        <Form.Item>
206
-          {getFieldDecorator('cityId')(
207
-            <SelectCity allowClear/>,
208
-          )}
209
-        </Form.Item>
237
+        <Form.Item>{getFieldDecorator('cityId')(<SelectCity allowClear />)}</Form.Item>
210
         <Form.Item>
238
         <Form.Item>
211
           <AuthButton name="admin.taPolicy.search" noRight={null}>
239
           <AuthButton name="admin.taPolicy.search" noRight={null}>
212
-            <Button type="primary" htmlType="submit" >
240
+            <Button type="primary" htmlType="submit">
213
               搜索
241
               搜索
214
-          </Button>
242
+            </Button>
215
           </AuthButton>
243
           </AuthButton>
216
         </Form.Item>
244
         </Form.Item>
217
       </Form>
245
       </Form>
218
-      <AuthButton name="admin.taPolicy.post" noRight={null}>
219
-        <Button type="primary" style={{margin:'20px 0'}} onClick={toEditPolicy()}>新增</Button>
246
+      <AuthButton name="encyclopedias.add" noRight={null}>
247
+        <Button type="primary" style={{ margin: '20px 0' }} onClick={toEditPolicy()}>
248
+          新增
249
+        </Button>
220
       </AuthButton>
250
       </AuthButton>
221
-      <Table rowKey="housingPolicy" dataSource={data.records} columns={columns} pagination={false} />
251
+      <Table
252
+        rowKey="housingPolicy"
253
+        dataSource={data.records}
254
+        columns={columns}
255
+        pagination={false}
256
+      />
222
       <div style={{ display: 'flex', justifyContent: 'flex-end', marginTop: '30px' }}>
257
       <div style={{ display: 'flex', justifyContent: 'flex-end', marginTop: '30px' }}>
223
-        <Pagination showQuickJumper defaultCurrent={1} total={data.total} onChange={changePageNum} current={data.current} />
258
+        <Pagination
259
+          showQuickJumper
260
+          defaultCurrent={1}
261
+          total={data.total}
262
+          onChange={changePageNum}
263
+          current={data.current}
264
+        />
224
       </div>
265
       </div>
225
     </Card>
266
     </Card>
226
-  )
227
-}
267
+  );
268
+};
228
 const WrappedHeader = Form.create({ name: 'header' })(header);
269
 const WrappedHeader = Form.create({ name: 'header' })(header);
229
 
270
 
230
-export default WrappedHeader
271
+export default WrappedHeader;

+ 6
- 6
src/pages/system/housingPolicy/List/index.jsx View File

49
       dataIndex: 'policyImg',
49
       dataIndex: 'policyImg',
50
       key: 'policyImg',
50
       key: 'policyImg',
51
       align: 'center',
51
       align: 'center',
52
-      render: (policyImg,row) =><Navigate onClick={toEditPolicy(row.policyId)} ><img src={policyImg} /></Navigate> ,
52
+      render: (policyImg,row) =><img src={policyImg} />,
53
     },
53
     },
54
     {
54
     {
55
       title: '标题',
55
       title: '标题',
84
       key: 'handle',
84
       key: 'handle',
85
       align: 'center',
85
       align: 'center',
86
       render: withActions((x, row) => [
86
       render: withActions((x, row) => [
87
-        <AuthButton name="admin.taPolicy.publish" noRight={null}>
87
+        <AuthButton name="encyclopedias.publish" noRight={null}>
88
           <EditIcon type={row.publishStatus === 0 ? 'publish' : 'cancel'} text={row.publishStatus === 0 ? '发布' : '取消发布'} onClick={publicOrNoPublic(row)}></EditIcon>
88
           <EditIcon type={row.publishStatus === 0 ? 'publish' : 'cancel'} text={row.publishStatus === 0 ? '发布' : '取消发布'} onClick={publicOrNoPublic(row)}></EditIcon>
89
         </AuthButton>,
89
         </AuthButton>,
90
         
90
         
91
-        <AuthButton name="admin.taPolicy.top" noRight={null}>
91
+        <AuthButton name="encyclopedias.top" noRight={null}>
92
           <EditIcon type={row.weight === 1 ? 'cancel' : 'top'} text={row.weight === 1 ? '取消置顶' : '置顶'} onClick={topPolicy(row)}></EditIcon>
92
           <EditIcon type={row.weight === 1 ? 'cancel' : 'top'} text={row.weight === 1 ? '取消置顶' : '置顶'} onClick={topPolicy(row)}></EditIcon>
93
         </AuthButton>,
93
         </AuthButton>,
94
         
94
         
95
-        <AuthButton name="admin.taPolicy.id.put" noRight={null}>
95
+        <AuthButton name="encyclopedias.edit" noRight={null}>
96
           <EditIcon type="edit" text="编辑" onClick={toEditPolicy(row.policyId)}></EditIcon>
96
           <EditIcon type="edit" text="编辑" onClick={toEditPolicy(row.policyId)}></EditIcon>
97
         </AuthButton>,
97
         </AuthButton>,
98
 
98
 
99
-        <AuthButton name="admin.taPolicy.id.delete" noRight={null}>
99
+        <AuthButton name="encyclopedias.delete" noRight={null}>
100
           <EditIcon type="delete" text="删除" onClick={deletePolicy(row.policyId)}></EditIcon>
100
           <EditIcon type="delete" text="删除" onClick={deletePolicy(row.policyId)}></EditIcon>
101
         </AuthButton>,
101
         </AuthButton>,
102
       ])
102
       ])
195
           </AuthButton>
195
           </AuthButton>
196
         </Form.Item>
196
         </Form.Item>
197
       </Form>
197
       </Form>
198
-      <AuthButton name="admin.taPolicy.post" noRight={null}>
198
+      <AuthButton name="encyclopedias.add" noRight={null}>
199
         <Button type="primary" style={{margin:'20px 0'}} onClick={toEditPolicy()}>新增</Button>
199
         <Button type="primary" style={{margin:'20px 0'}} onClick={toEditPolicy()}>新增</Button>
200
       </AuthButton>
200
       </AuthButton>
201
       <Table rowKey="housingPolicy" dataSource={data.records} columns={columns} pagination={false} />
201
       <Table rowKey="housingPolicy" dataSource={data.records} columns={columns} pagination={false} />