Bladeren bron

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

Your Name 3 jaren geleden
bovenliggende
commit
1b3e185046
43 gewijzigde bestanden met toevoegingen van 1280 en 1007 verwijderingen
  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 Bestand weergeven

@@ -22,7 +22,8 @@ import LivePlatSelect from '@/components/SelectButton/LivePlatSelect';
22 22
 import CitySelect3 from '@/components/SelectButton/CitySelect3';
23 23
 import ImageUpload from '@/components/XForm/ImageUpload';
24 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 28
 const { Option } = Select;
28 29
 
@@ -55,7 +56,7 @@ const header = props => {
55 56
   };
56 57
 
57 58
   const cancelPage = () => {
58
-    router.go('-1')
59
+    router.go('-1');
59 60
   };
60 61
 
61 62
   //打开新页面
@@ -178,7 +179,7 @@ const header = props => {
178 179
           {getFieldDecorator('isNewHouse', {
179 180
             valuePropName: 'checked',
180 181
             initialValue: liveActivityData.isNewHouse || false,
181
-          })(<Switch/>)}
182
+          })(<Switch />)}
182 183
         </Form.Item>
183 184
         {/* <Form.Item label="直播小程序">
184 185
           {getFieldDecorator('liveApp', {
@@ -200,17 +201,12 @@ const header = props => {
200 201
           <Navigate onClick={openIndexImg}>不知道怎么填?查看说明</Navigate>
201 202
         </Form.Item> */}
202 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 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 210
           {getFieldDecorator('listImg', {
215 211
             initialValue: liveActivityData.listImg,
216 212
             rules: [{ required: true, message: '请上传封面图1' }],
@@ -222,7 +218,10 @@ const header = props => {
222 218
             rules: [{ required: true, message: '请上传封面图2' }],
223 219
           })(<ImageUpload />)}
224 220
         </Form.Item> */}
225
-        <Form.Item label="详情图" help="建议尺寸:750*1456px以上,格式:jpg,用于:直播活动详情页,点击可跳转到直播间">
221
+        <Form.Item
222
+          label="详情图"
223
+          help="建议尺寸:750*1456px以上,格式:jpg,用于:直播活动详情页,点击可跳转到直播间"
224
+        >
226 225
           {getFieldDecorator('detailTypeImg', {
227 226
             initialValue: liveActivityData.detailTypeImg,
228 227
             rules: [{ required: true, message: '请上传详情图' }],
@@ -246,9 +245,12 @@ const header = props => {
246 245
           )}
247 246
         </Form.Item>
248 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 254
           <Button onClick={() => router.go(-1)}>取消</Button>
253 255
         </Form.Item>
254 256
       </Form>

+ 8
- 4
src/pages/Live/LiveActivity/List/index.jsx Bestand weergeven

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

+ 126
- 92
src/pages/Live/LiveActivity/add/index.jsx Bestand weergeven

@@ -1,48 +1,65 @@
1 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 20
 import { FormattedMessage } from 'umi-plugin-react/locale';
4 21
 import XForm, { FieldTypes } from '@/components/XForm';
5 22
 import router from 'umi/router';
6 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 30
 import Navigate from '@/components/Navigate';
14 31
 import apis from '@/services/apis';
15 32
 import request from '@/utils/request';
16 33
 import AuthButton from '@/components/AuthButton';
17 34
 import Prompt from 'umi/prompt';
18
-import WxWorkLivingRoom from '@/components/LivingRoom/WxWork'
35
+import WxWorkLivingRoom from '@/components/LivingRoom/WxWork';
19 36
 
20 37
 const { Option } = Select;
21 38
 const { MonthPicker, RangePicker, WeekPicker } = DatePicker;
22 39
 
23
-let cityId = ''
40
+let cityId = '';
24 41
 
25 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 49
     router.push({
33 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 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 65
   function disabledDate(current) {
@@ -50,26 +67,30 @@ const header = props => {
50 67
     return current && current < moment().endOf('day');
51 68
   }
52 69
 
53
-  function handleSubmit (e) {
70
+  function handleSubmit(e) {
54 71
     e.preventDefault();
55 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 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,12 +103,12 @@ const header = props => {
82 103
         <Form.Item label="所属城市">
83 104
           {getFieldDecorator('cityId', {
84 105
             rules: [{ required: true, message: ' 请选择所属城市' }],
85
-          })(<CitySelect3 buildingId={props.form.getFieldValue('buildingId')}/>)}
106
+          })(<CitySelect3 buildingId={props.form.getFieldValue('buildingId')} />)}
86 107
         </Form.Item>
87 108
         <Form.Item label="所属楼盘">
88 109
           {getFieldDecorator('buildingId', {
89 110
             rules: [{ required: true, message: ' 请选择所属楼盘' }],
90
-          })(<BuildSelect2 cityId={props.form.getFieldValue('cityId')}/>)}
111
+          })(<BuildSelect2 cityId={props.form.getFieldValue('cityId')} />)}
91 112
         </Form.Item>
92 113
         <Form.Item label="直播活动标题">
93 114
           {getFieldDecorator('liveActivityTitle', {
@@ -96,29 +117,44 @@ const header = props => {
96 117
         </Form.Item>
97 118
         <Form.Item label="直播开始时间">
98 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 134
         </Form.Item>
107 135
         <Form.Item label="直播结束时间">
108 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 152
         </Form.Item>
117 153
         <Form.Item label="是否新房">
118 154
           {getFieldDecorator('isNewHouse', {
119 155
             valuePropName: 'checked',
120
-            initialValue:  false,
121
-          })(<Switch defaultChecked={false}/>)}
156
+            initialValue: false,
157
+          })(<Switch defaultChecked={false} />)}
122 158
         </Form.Item>
123 159
 
124 160
         {/* <Form.Item label="直播小程序">
@@ -132,19 +168,15 @@ const header = props => {
132 168
           })(<Input maxLength={1000} placeholder="点击右侧按钮查看如何获取房间参数" style={{width:'680px'}}/>)}<Navigate onClick={openIndexImg}>不知道怎么填?查看说明</Navigate>
133 169
         </Form.Item> */}
134 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 174
         </Form.Item>
141 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 180
         {/* <Form.Item label="封面图2" help="建议尺寸:750*250px,比例3:1,格式:jpg,用于:项目详情页">
149 181
               {getFieldDecorator('detailImg', {
150 182
                   rules: [{ required: true, message: '请上传封面图2' }],
@@ -152,41 +184,43 @@ const header = props => {
152 184
                 <ImageUpload />,
153 185
               )}
154 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 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 199
         </Form.Item>
169 200
         <Form.Item label="发布状态">
170 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 209
         </Form.Item>
177 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 218
         </Form.Item>
185 219
       </Form>
186 220
     </Card>
187
-  )
188
-}
221
+  );
222
+};
189 223
 
190 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 Bestand weergeven

@@ -24,6 +24,7 @@ import CitySelect3 from '@/components/SelectButton/CitySelect3';
24 24
 import ImageUpload from '@/components/XForm/ImageUpload';
25 25
 import request from '@/utils/request';
26 26
 import Navigate from '@/components/Navigate';
27
+import AuthButton from '@/components/AuthButton';
27 28
 
28 29
 const header = props => {
29 30
   console.log(props);
@@ -168,9 +169,12 @@ const header = props => {
168 169
         </Form.Item>
169 170
 
170 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 178
           <Button onClick={() => router.go(-1)}>取消</Button>
175 179
         </Form.Item>
176 180
       </Form>

+ 18
- 17
src/pages/Live/video/List/index.jsx Bestand weergeven

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

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

+ 22
- 16
src/pages/activity/SignupActivity/index.jsx Bestand weergeven

@@ -24,7 +24,7 @@ import apis from '@/services/apis';
24 24
 import request from '@/utils/request';
25 25
 import QueryTable from '@/components/QueryTable';
26 26
 
27
-const type= 'dymic'
27
+const type = 'dymic';
28 28
 
29 29
 const SignupActivity = props => {
30 30
   const ref = useRef();
@@ -190,9 +190,11 @@ const SignupActivity = props => {
190 190
       align: 'center',
191 191
       width: '20%',
192 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,7 +260,7 @@ const SignupActivity = props => {
258 260
       key: 'handle',
259 261
       align: 'center',
260 262
       render: withActions((x, row) => [
261
-        <AuthButton name="admin.buildingDynamic.send.dynamicId.put" noRight={null}>
263
+        <AuthButton name="activity.enroll.publish" noRight={null}>
262 264
           <EditIcon
263 265
             type={row.status === 1 ? 'cancel' : 'publish'}
264 266
             text={row.status === 1 ? '取消发布' : '发布'}
@@ -269,19 +271,21 @@ const SignupActivity = props => {
269 271
         // //   <EditIcon type="look" text="查看详情" onClick={toSignupActivityDetail(row.dynamicId)} />,
270 272
 
271 273
         row.activityStatus === 0 ? (
272
-          <AuthButton name="admin.buildingDynamic.finish.put" noRight={null}>
274
+          <AuthButton name="activity.enroll.finish" noRight={null}>
273 275
             <EditIcon type="end" text="结束活动" onClick={finishDynamic.bind(this, row)} />
274 276
           </AuthButton>
275 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 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 289
             <EditIcon
286 290
               type="edit"
287 291
               text="编辑"
@@ -295,9 +299,11 @@ const SignupActivity = props => {
295 299
 
296 300
   const actionRender = () => {
297 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,7 +316,7 @@ const SignupActivity = props => {
310 316
       columns={columns}
311 317
       postData={data => {
312 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 320
         return data;
315 321
       }}
316 322
       actionRender={actionRender}

+ 1
- 1
src/pages/activity/SignupActivity/registrationRecord.jsx Bestand weergeven

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

+ 8
- 7
src/pages/activity/groupRoomActivity/edit/Basic.jsx Bestand weergeven

@@ -7,6 +7,7 @@ import BuildSelect from '@/components/SelectButton/BuildSelect2';
7 7
 import Wangedit from '@/components/Wangedit/Wangedit';
8 8
 import request from '@/utils/request';
9 9
 import ImageUploader from '@/components/XForm/ImageUpload';
10
+import AuthButton from '@/components/AuthButton';
10 11
 
11 12
 const { RangePicker } = DatePicker;
12 13
 
@@ -253,10 +254,7 @@ const BasicForm = props => {
253 254
             ],
254 255
           })(<Input type="number" min={1} />)}
255 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 259
         <Form.Item label="活动详情">{getFieldDecorator('desc')(<Wangedit />)}</Form.Item>
262 260
         <Form.Item label="报名时间">
@@ -281,9 +279,12 @@ const BasicForm = props => {
281 279
           <span style={{ marginLeft: 30, color: 'grey' }}>数字越大越靠前</span>
282 280
         </Form.Item>
283 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 288
           &nbsp;&nbsp;&nbsp;&nbsp;
288 289
           <Button onClick={() => cancelPage()}>取消</Button>
289 290
         </Form.Item>

+ 22
- 16
src/pages/activity/groupRoomActivity/index.jsx Bestand weergeven

@@ -24,7 +24,7 @@ import apis from '@/services/apis';
24 24
 import request from '@/utils/request';
25 25
 import QueryTable from '@/components/QueryTable';
26 26
 
27
-const type= 'house'
27
+const type = 'house';
28 28
 
29 29
 const GroupRoomActivity = props => {
30 30
   const ref = useRef();
@@ -190,9 +190,11 @@ const GroupRoomActivity = props => {
190 190
       align: 'center',
191 191
       width: '20%',
192 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,7 +260,7 @@ const GroupRoomActivity = props => {
258 260
       key: 'handle',
259 261
       align: 'center',
260 262
       render: withActions((x, row) => [
261
-        <AuthButton name="admin.buildingDynamic.send.dynamicId.put" noRight={null}>
263
+        <AuthButton name="activity.group.publish" noRight={null}>
262 264
           <EditIcon
263 265
             type={row.status === 1 ? 'cancel' : 'publish'}
264 266
             text={row.status === 1 ? '取消发布' : '发布'}
@@ -269,7 +271,7 @@ const GroupRoomActivity = props => {
269 271
         // //   <EditIcon type="look" text="查看详情" onClick={toSignupActivityDetail(row.dynamicId)} />,
270 272
 
271 273
         row.activityStatus === 0 ? (
272
-          <AuthButton name="admin.buildingDynamic.finish.put" noRight={null}>
274
+          <AuthButton name="activity.group.finish" noRight={null}>
273 275
             <EditIcon type="end" text="结束活动" onClick={finishDynamic.bind(this, row)} />
274 276
           </AuthButton>
275 277
         ) : null,
@@ -282,18 +284,20 @@ const GroupRoomActivity = props => {
282 284
         //   />
283 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 295
         //   <AuthButton name="admin.buildingDynamic.dataRecord" noRight={null}>
292 296
         //     <EditIcon type="record" text="数据记录" onClick={toDataReacord(row.dynamicId)} />
293 297
         //   </AuthButton>,
294 298
 
295 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 301
             <EditIcon
298 302
               type="edit"
299 303
               text="编辑"
@@ -307,9 +311,11 @@ const GroupRoomActivity = props => {
307 311
 
308 312
   const actionRender = () => {
309 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,7 +328,7 @@ const GroupRoomActivity = props => {
322 328
       columns={columns}
323 329
       postData={data => {
324 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 332
         return data;
327 333
       }}
328 334
       actionRender={actionRender}

+ 3
- 3
src/pages/activity/groupRoomActivity/registrationRecord.jsx Bestand weergeven

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

+ 7
- 3
src/pages/activity/lookHouseActivity/edit/Basic.jsx Bestand weergeven

@@ -7,6 +7,7 @@ import BuildSelect from '@/components/SelectButton/BuildSelect2';
7 7
 import Wangedit from '@/components/Wangedit/Wangedit';
8 8
 import request from '@/utils/request';
9 9
 import ImageUploader from '@/components/XForm/ImageUpload';
10
+import AuthButton from '@/components/AuthButton';
10 11
 
11 12
 const { RangePicker } = DatePicker;
12 13
 const type = 'look'
@@ -280,9 +281,12 @@ const BasicForm = props => {
280 281
           <span style={{ marginLeft: 30, color: 'grey' }}>数字越大越靠前</span>
281 282
         </Form.Item>
282 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 290
           &nbsp;&nbsp;&nbsp;&nbsp;
287 291
           <Button onClick={() => cancelPage()}>取消</Button>
288 292
         </Form.Item>

+ 15
- 12
src/pages/activity/lookHouseActivity/index.jsx Bestand weergeven

@@ -24,7 +24,7 @@ import apis from '@/services/apis';
24 24
 import request from '@/utils/request';
25 25
 import QueryTable from '@/components/QueryTable';
26 26
 
27
-const type= 'look'
27
+const type = 'look';
28 28
 
29 29
 const LookHouseActivity = props => {
30 30
   const ref = useRef();
@@ -75,7 +75,6 @@ const LookHouseActivity = props => {
75 75
     });
76 76
   };
77 77
 
78
-
79 78
   //   推首页
80 79
   const homeDynamic = row => () => {
81 80
     const home = Math.abs(row.home - 1);
@@ -177,9 +176,11 @@ const LookHouseActivity = props => {
177 176
       align: 'center',
178 177
       width: '20%',
179 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,7 +246,7 @@ const LookHouseActivity = props => {
245 246
       key: 'handle',
246 247
       align: 'center',
247 248
       render: withActions((x, row) => [
248
-        <AuthButton name="admin.buildingDynamic.send.dynamicId.put" noRight={null}>
249
+        <AuthButton name="activity.look.publish" noRight={null}>
249 250
           <EditIcon
250 251
             type={row.status === 1 ? 'cancel' : 'publish'}
251 252
             text={row.status === 1 ? '取消发布' : '发布'}
@@ -254,13 +255,13 @@ const LookHouseActivity = props => {
254 255
         </AuthButton>,
255 256
 
256 257
         row.activityStatus === 0 ? (
257
-          <AuthButton name="admin.buildingDynamic.finish.put" noRight={null}>
258
+          <AuthButton name="activity.look.finish" noRight={null}>
258 259
             <EditIcon type="end" text="结束活动" onClick={finishDynamic.bind(this, row)} />
259 260
           </AuthButton>
260 261
         ) : null,
261 262
 
262 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 265
             <EditIcon
265 266
               type="edit"
266 267
               text="编辑"
@@ -274,9 +275,11 @@ const LookHouseActivity = props => {
274 275
 
275 276
   const actionRender = () => {
276 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,7 +292,7 @@ const LookHouseActivity = props => {
289 292
       columns={columns}
290 293
       postData={data => {
291 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 296
         return data;
294 297
       }}
295 298
       actionRender={actionRender}

+ 1
- 1
src/pages/activity/lookHouseActivity/registrationRecord.jsx Bestand weergeven

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

+ 4
- 4
src/pages/carouselFigure/advertisingList.jsx Bestand weergeven

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

+ 4
- 4
src/pages/carouselFigure/carouselFigureList.jsx Bestand weergeven

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

+ 1
- 1
src/pages/carouselFigure/customImg/list.jsx Bestand weergeven

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

+ 9
- 0
src/pages/carouselFigure/editAdvertising.jsx Bestand weergeven

@@ -14,6 +14,7 @@ import SelectGroup from './SelectGroup';
14 14
 import SelectH5 from './SelectH5';
15 15
 import SalesBatchGroup from './SalesBatchGroup';
16 16
 import LiveGroup from './LiveGroup';
17
+import InstitutionSelect from '@/components/SelectButton/InstitutionSelect';
17 18
 /**
18 19
  *
19 20
  *
@@ -203,6 +204,14 @@ const createEditor = () => {
203 204
         value: data.cityId,
204 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 216
         label: '开屏广告',
208 217
         name: 'image',

+ 67
- 56
src/pages/channel/Channel/Edit/index.jsx Bestand weergeven

@@ -1,114 +1,125 @@
1 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 16
 import router from 'umi/router';
4 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 21
 const { TextArea } = Input;
9 22
 const { Option } = Select;
10 23
 
11 24
 const header = props => {
12
-   const {id} = props.location.query
25
+  const { id } = props.location.query;
13 26
 
14 27
   // eslint-disable-next-line react-hooks/rules-of-hooks
15 28
   useEffect(() => {
16
-      if(id){
17
-        getById()
18
-      }
19
-    
20
-  }, [])
21
-
29
+    if (id) {
30
+      getById();
31
+    }
32
+  }, []);
22 33
 
23 34
   // 查询当前信息
24 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 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 71
   function handleSubmit(e) {
57 72
     e.preventDefault();
58 73
     props.form.validateFields((err, values) => {
59 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 81
   const { getFieldDecorator } = props.form;
68 82
 
69 83
   return (
70 84
     <Card>
71 85
       <Form labelCol={{ span: 6 }} wrapperCol={{ span: 12 }} onSubmit={handleSubmit}>
72
-
73 86
         <Form.Item label="城市公司">
74
-          {getFieldDecorator('institutionId',{
87
+          {getFieldDecorator('institutionId', {
75 88
             rules: [{ required: true, message: '请选择城市公司' }],
76
-          })(
77
-            <InstitutionSelect />
78
-          )}
89
+          })(<InstitutionSelect />)}
79 90
         </Form.Item>
80 91
         <Form.Item label="渠道名称">
81 92
           {getFieldDecorator('channelName', {
82 93
             rules: [{ required: true, message: '请输入渠道名称' }],
83
-          })(<Input  />)}
94
+          })(<Input />)}
84 95
         </Form.Item>
85 96
         <Form.Item label="联系人">
86 97
           {getFieldDecorator('channelContact', {
87 98
             rules: [{ required: true, message: ' 请输入联系人' }],
88
-          })(<Input  />)}
99
+          })(<Input />)}
89 100
         </Form.Item>
90 101
         <Form.Item label="联系电话">
91 102
           {getFieldDecorator('contactTel', {
92 103
             rules: [{ required: true, message: '请输入联系电话' }],
93
-          })(<Input  />)}
104
+          })(<Input />)}
94 105
         </Form.Item>
95 106
         <Form.Item label="说明描述">
96
-          {getFieldDecorator('explain', {
97
-          })(<TextArea  rows={8} />)}
107
+          {getFieldDecorator('explain', {})(<TextArea rows={8} />)}
98 108
         </Form.Item>
99 109
         <Form.Item wrapperCol={{ span: 15, offset: 6 }}>
100
-       
110
+          <AuthButton name="channel.submit" noRight={null}>
101 111
             <Button type="primary" htmlType="submit">
102 112
               保存
113
+            </Button>
114
+          </AuthButton>
115
+
116
+          <Button onClick={() => router.go(-1)} style={{ marginLeft: '20px' }}>
117
+            取消
103 118
           </Button>
104
-            <Button  onClick={()=>router.go(-1)} style={{marginLeft:'20px'}}>
105
-              取消
106
-          </Button>
107
- 
108 119
         </Form.Item>
109 120
       </Form>
110 121
     </Card>
111
-  )
112
-}
122
+  );
123
+};
113 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 Bestand weergeven

@@ -59,7 +59,6 @@ function toNewCustomer(record) {
59 59
 }
60 60
 
61 61
 export default function ChannelList(props) {
62
-
63 62
   const ref = useRef();
64 63
 
65 64
   // 跳编辑页面
@@ -72,16 +71,16 @@ export default function ChannelList(props) {
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 76
       .then(response => {
78 77
         message.info('删除成功');
79 78
         ref.current.reload();
80 79
         // getList({ pageNum: pageNum, pageSize: 10, ...fieldsValue });
81 80
       })
82 81
       .catch(error => {});
83
- }
84
- 
82
+  };
83
+
85 84
   const searchFields = [
86 85
     {
87 86
       name: 'channelId',
@@ -112,7 +111,9 @@ export default function ChannelList(props) {
112 111
       key: 'channelName',
113 112
       align: 'center',
114 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,23 +152,29 @@ export default function ChannelList(props) {
151 152
       dataIndex: 'edit',
152 153
       key: 'edit',
153 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 165
   const actionRender = () => {
161 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 175
   return (
169 176
     <QueryTable
170
-    ref={ref}
177
+      ref={ref}
171 178
       rowKey="channelList"
172 179
       api={apis.channelList.getList}
173 180
       searchFields={searchFields}

+ 21
- 41
src/pages/channel/independentList/index.jsx Bestand weergeven

@@ -143,44 +143,24 @@ class ModalTable extends React.Component {
143 143
         title: '状态',
144 144
         // eslint-disable-next-line consistent-return
145 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 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 149
           if (records.status === 2) {
175 150
             return '到访';
176 151
           }
177 152
           if (records.status === 3) {
178
-            return '认';
153
+            return '认筹';
179 154
           }
180 155
           if (records.status === 4) {
181 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,16 +517,16 @@ function body(props) {
537 517
                 <a style={{ color: 'rgba(239,39,58,1)' }} onClick={() => Invite(record)}>邀请经纪人</a>
538 518
               </AuthButton> */}
539 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,7 +551,7 @@ function body(props) {
571 551
       <Form
572 552
         layout="inline"
573 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 556
         <Form.Item>
577 557
           {getFieldDecorator('channelId')(
@@ -602,11 +582,11 @@ function body(props) {
602 582
           )}
603 583
         </Form.Item>
604 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 586
             <Button type="primary" htmlType="submit">
607 587
               搜索
608 588
             </Button>
609
-          </AuthButton>
589
+          {/* </AuthButton> */}
610 590
           <Button style={{ marginLeft: 8 }} onClick={handleReset}>
611 591
             重置
612 592
           </Button>

+ 102
- 143
src/pages/course/Edit/index.jsx Bestand weergeven

@@ -5,6 +5,7 @@ import FileUpload from '@/components/XForm/FileUpload';
5 5
 import Wangedit from '@/components/Wangedit/Wangedit';
6 6
 import router from 'umi/router';
7 7
 import { fetch, apis } from '@/utils/request';
8
+import AuthButton from '@/components/AuthButton';
8 9
 
9 10
 const FormItem = Form.Item;
10 11
 const Option = Select.Option;
@@ -14,18 +15,17 @@ const updateCurriculumData = fetch(apis.course.alterCourse);
14 15
 const goBack = () => router.goBack(-1);
15 16
 
16 17
 const CurriculumForm = React.forwardRef((props, ref) => {
17
-  const [loading, setLoading] = useState(false);//防止多次点击 定义loadind
18
+  const [loading, setLoading] = useState(false); //防止多次点击 定义loadind
18 19
   // const [formData, setFormData] = useState({});//提交表单的数据
19
-  const [contentType, setContentType] = useState(0);//单选。初始默认显示0 富文本框。点击视频, 渲染1
20
+  const [contentType, setContentType] = useState(0); //单选。初始默认显示0 富文本框。点击视频, 渲染1
20 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 25
   const formItemLayout = {
25 26
     //布局
26 27
     labelCol: { span: 6 },
27 28
     wrapperCol: { span: 14 },
28
-
29 29
   };
30 30
 
31 31
   const fileUploadBeforeUpload = (file, fileList) => {
@@ -40,7 +40,7 @@ const CurriculumForm = React.forwardRef((props, ref) => {
40 40
     });
41 41
   };
42 42
 
43
-  const handleSubmit = (e) => {
43
+  const handleSubmit = e => {
44 44
     e.preventDefault();
45 45
     validateFields((err, values) => {
46 46
       if (err) {
@@ -48,7 +48,7 @@ const CurriculumForm = React.forwardRef((props, ref) => {
48 48
         //字符验证未填写---返回
49 49
       }
50 50
 
51
-      setLoading(true);//loading开始
51
+      setLoading(true); //loading开始
52 52
       if (values.curriculumUrl) {
53 53
         values.curriculumUrl = values.curriculumUrl[0];
54 54
       }
@@ -57,123 +57,101 @@ const CurriculumForm = React.forwardRef((props, ref) => {
57 57
         updateCurriculumData({
58 58
           data: {
59 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 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 92
         res.curriculumUrl = [res.curriculumUrl];
88 93
       }
89
-      setFieldsValue(res)
94
+      setFieldsValue(res);
90 95
       // setFormData(res)
91 96
       // setContentType(res.type)
92
-    })
93
-  }, [])
97
+    });
98
+  }, []);
94 99
 
95 100
   useEffect(() => {
96 101
     if (curriculumId) {
97
-      getCourseData({curriculumId})//第一次渲染前//获取id
102
+      getCourseData({ curriculumId }); //第一次渲染前//获取id
98 103
     }
99
-  }, [curriculumId])//第二次id一样不执行
104
+  }, [curriculumId]); //第二次id一样不执行
100 105
 
101 106
   // useEffect(() => {
102 107
   //   if (formData) {//1.form表单数据{2} 执行。无变更不执行
103 108
   //     setFieldsValue(formData)
104 109
   //   }
105 110
   // }, [formData])//2.有变更跟的话
106
-  
107 111
 
108 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 121
               <Option value="1">经纪人</Option>
121 122
               <Option value="2">置业顾问</Option>
122 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 155
       <FormItem label="详情">
178 156
         {
179 157
         getFieldDecorator('type'),{
@@ -189,51 +167,32 @@ const CurriculumForm = React.forwardRef((props, ref) => {
189 167
         }
190 168
 
191 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 194
     </Card>
235
-  
236
-  )
237
-})
195
+  );
196
+});
238 197
 
239 198
 export default Form.create({})(CurriculumForm);

+ 11
- 8
src/pages/course/list/index.jsx Bestand weergeven

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

+ 1
- 1
src/pages/customer/Customer/PrivateCustomer/index.jsx Bestand weergeven

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

+ 1
- 1
src/pages/customer/Customer/PublicCustomer/index.jsx Bestand weergeven

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

+ 45
- 36
src/pages/findRoom/addedValueService/audit.jsx Bestand weergeven

@@ -1,10 +1,11 @@
1 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 3
 import moment from 'moment';
4 4
 import request from '@/utils/request';
5 5
 import apis from '@/services/apis';
6 6
 // import Styles from './style.less';
7 7
 import { router } from 'umi';
8
+import AuthButton from '@/components/AuthButton';
8 9
 
9 10
 const { TextArea } = Input;
10 11
 const { Option } = Select;
@@ -41,8 +42,8 @@ function body(props) {
41 42
   // eslint-disable-next-line react-hooks/rules-of-hooks
42 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 48
   useEffect(() => {
48 49
     if (id !== '') {
@@ -56,8 +57,7 @@ function body(props) {
56 57
       if (res) {
57 58
         const b = {};
58 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 61
           //   b[x.key] = [x.resultId];
62 62
           //   return;
63 63
           // }
@@ -121,7 +121,7 @@ function body(props) {
121 121
         onSubmit={e => handleSubmit(e)}
122 122
         style={{ width: '800px', margin: 'auto' }}
123 123
       >
124
-       <Form.Item label="客户姓名">
124
+        <Form.Item label="客户姓名">
125 125
           {getFieldDecorator('nickname')(<Input placeholder="客户姓名" disabled />)}
126 126
         </Form.Item>
127 127
         <Form.Item label="客户电话">
@@ -159,9 +159,9 @@ function body(props) {
159 159
               <Option value={3}>70~90m²</Option>
160 160
               <Option value={4}>90~110m²</Option>
161 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 165
             </Select>,
166 166
           )}
167 167
         </Form.Item>
@@ -174,7 +174,6 @@ function body(props) {
174 174
               <Option value={3}>包工不包料</Option>
175 175
               <Option value={4}>施工包辅材不包主材</Option>
176 176
               <Option value={5}>全包</Option>
177
-             
178 177
             </Select>,
179 178
           )}
180 179
         </Form.Item>
@@ -182,29 +181,29 @@ function body(props) {
182 181
         <Form.Item label="家装侧重点">
183 182
           {getFieldDecorator('important')(
184 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 190
             </Checkbox.Group>,
192 191
           )}
193 192
         </Form.Item>
194
-         <Form.Item label="家装风格">
193
+        <Form.Item label="家装风格">
195 194
           {getFieldDecorator('style')(
196 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 207
             </Checkbox.Group>,
209 208
           )}
210 209
         </Form.Item>
@@ -219,7 +218,6 @@ function body(props) {
219 218
               <Checkbox value={'温馨舒适'}>温馨舒适</Checkbox>
220 219
               <Checkbox value={'品质生活'}>品质生活</Checkbox>
221 220
               <Checkbox value={'其他'}>其他</Checkbox>
222
-            
223 221
             </Checkbox.Group>,
224 222
           )}
225 223
         </Form.Item>
@@ -269,21 +267,32 @@ function body(props) {
269 267
             </Checkbox.Group>,
270 268
           )}
271 269
         </Form.Item> */}
272
-  
273
-      
270
+
274 271
         <Form.Item label="回访备注">
275 272
           {getFieldDecorator('auditRemark', {
276 273
             rules: [{ required: true, message: '请输入回访备注!' }], //v3x必填
277 274
           })(<TextArea placeholder="回访备注" disabled={type === 'detail'} rows={7} />)}
278 275
         </Form.Item>
279 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 295
           </Button>
285
-          &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
286
-          <Button onClick={() => submitDate({ status: '2' })}>无效</Button></>}
287 296
         </Form.Item>
288 297
       </Form>
289 298
     </Card>

+ 83
- 53
src/pages/findRoom/addedValueService/index.jsx Bestand weergeven

@@ -3,9 +3,9 @@ import { Avatar, Button } from 'antd';
3 3
 import moment from 'moment';
4 4
 import request from '../../../utils/request';
5 5
 import apis from '../../../services/apis';
6
-import QueryTable from '@/components/QueryTable'
6
+import QueryTable from '@/components/QueryTable';
7 7
 import { router } from 'umi';
8
-
8
+import AuthButton from '@/components/AuthButton';
9 9
 
10 10
 /**
11 11
  *
@@ -14,62 +14,57 @@ import { router } from 'umi';
14 14
  * @returns
15 15
  */
16 16
 
17
-
18
-
19
-
20 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 21
     router.push({
25 22
       pathname: '/findRoom/addedValueService/audit',
26 23
       query: {
27 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 43
   function exportRecommendCustomer() {
49
-    setExportLoding(true)
44
+    setExportLoding(true);
50 45
     request({
51 46
       ...apis.customer.customerRecommendRecommenderExport,
52 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 56
   function download(data) {
62 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 69
   const columns = [
75 70
     {
@@ -98,37 +93,63 @@ function Recommend() {
98 93
       key: 'gender',
99 94
       align: 'center',
100 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 103
       title: '房屋现状',
105
-      dataIndex: 'intentArea',//意向区域
104
+      dataIndex: 'intentArea', //意向区域
106 105
       key: 'intentArea',
107 106
       align: 'center',
108 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 117
       title: '装修预算',
114 118
       dataIndex: 'maxPrice',
115 119
       key: 'maxPrice',
116 120
       align: 'center',
117
-     
118 121
     },
119 122
     {
120 123
       title: '提交时间',
121 124
       dataIndex: 'createdTime',
122 125
       key: 'createdTime',
123 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 136
       title: '状态',
128 137
       dataIndex: 'status',
129 138
       key: 'status',
130 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 155
       title: '操作',
@@ -137,13 +158,24 @@ function Recommend() {
137 158
       align: 'center',
138 159
 
139 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 180
   const searchFields = [
149 181
     {
@@ -173,15 +205,15 @@ function Recommend() {
173 205
       label: '状态',
174 206
       placeholder: '请选择状态',
175 207
       type: 'select',
176
-      placeholder: '全部',//错误
208
+      placeholder: '全部', //错误
177 209
       options: [
178 210
         { label: '全部', value: '' },
179 211
         { label: '待回访', value: '0' },
180 212
         { label: '已回访', value: '1' },
181
-        { label: '无效', value: '2' }
182
-      ]
213
+        { label: '无效', value: '2' },
214
+      ],
183 215
     },
184
-  ]
216
+  ];
185 217
   const actionRender = () => {
186 218
     return (
187 219
       <Button type="danger" loading={exportLoding} onClick={() => exportRecommendCustomer()}>
@@ -199,15 +231,13 @@ function Recommend() {
199 231
         searchFields={searchFields}
200 232
         columns={columns}
201 233
         postData={data => {
202
-        
203
-          data.type='4'
234
+          data.type = '4';
204 235
           return data;
205 236
         }}
206 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 Bestand weergeven

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

+ 80
- 57
src/pages/findRoom/buyRoom/index.jsx Bestand weergeven

@@ -3,9 +3,9 @@ import { Avatar, Button } from 'antd';
3 3
 import moment from 'moment';
4 4
 import request from '../../../utils/request';
5 5
 import apis from '../../../services/apis';
6
-import QueryTable from '@/components/QueryTable'
6
+import QueryTable from '@/components/QueryTable';
7 7
 import { router } from 'umi';
8
-
8
+import AuthButton from '@/components/AuthButton';
9 9
 
10 10
 /**
11 11
  *
@@ -14,62 +14,57 @@ import { router } from 'umi';
14 14
  * @returns
15 15
  */
16 16
 
17
-
18
-
19
-
20 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 21
     router.push({
25 22
       pathname: '/findRoom/buyRoom/audit',
26 23
       query: {
27 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 43
   function exportRecommendCustomer() {
49
-    setExportLoding(true)
44
+    setExportLoding(true);
50 45
     request({
51 46
       ...apis.customer.customerRecommendRecommenderExport,
52 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 56
   function download(data) {
62 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 69
   const columns = [
75 70
     {
@@ -98,37 +93,57 @@ function Recommend() {
98 93
       key: 'gender',
99 94
       align: 'center',
100 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 103
       title: '意向区域',
105
-      dataIndex: 'name',//意向区域
104
+      dataIndex: 'name', //意向区域
106 105
       key: 'name',
107 106
       align: 'center',
108 107
       // render: (_, record) => <><span>{record.area = '江苏省南京市秦淮区'}</span></>,
109
-
110 108
     },
111 109
     {
112 110
       title: '购房预算',
113 111
       dataIndex: 'maxPrice',
114 112
       key: 'maxPrice',
115 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 117
       title: '提交时间',
121 118
       dataIndex: 'createdTime',
122 119
       key: 'createdTime',
123 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 130
       title: '状态',
128 131
       dataIndex: 'status',
129 132
       key: 'status',
130 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 149
       title: '操作',
@@ -137,13 +152,24 @@ function Recommend() {
137 152
       align: 'center',
138 153
 
139 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 174
   const searchFields = [
149 175
     {
@@ -173,15 +199,15 @@ function Recommend() {
173 199
       label: '状态',
174 200
       placeholder: '请选择状态',
175 201
       type: 'select',
176
-      placeholder: '全部',//错误
202
+      placeholder: '全部', //错误
177 203
       options: [
178 204
         { label: '全部', value: '' },
179 205
         { label: '待回访', value: '0' },
180 206
         { label: '已回访', value: '1' },
181
-        { label: '无效', value: '2' }
182
-      ]
207
+        { label: '无效', value: '2' },
208
+      ],
183 209
     },
184
-  ]
210
+  ];
185 211
   const actionRender = () => {
186 212
     return (
187 213
       <Button type="danger" loading={exportLoding} onClick={() => exportRecommendCustomer()}>
@@ -197,22 +223,19 @@ function Recommend() {
197 223
         // recommendCustomer
198 224
         api={apis.searchHouse.list}
199 225
         searchFields={searchFields}
200
-        
201 226
         postData={data => {
202
-        
203
-          data.type='1'
227
+          data.type = '1';
204 228
           return data;
205 229
         }}
206 230
         columns={columns}
207 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 Bestand weergeven

@@ -5,6 +5,7 @@ import request from '@/utils/request';
5 5
 import apis from '@/services/apis';
6 6
 // import Styles from './style.less';
7 7
 import { router } from 'umi';
8
+import AuthButton from '@/components/AuthButton';
8 9
 
9 10
 const { TextArea } = Input;
10 11
 const { Option } = Select;
@@ -56,7 +57,6 @@ function body(props) {
56 57
       if (res) {
57 58
         const b = {};
58 59
         JSON.parse(res?.questionnaire)?.map(x => {
59
-         
60 60
           if (x.key === 'maxPrice') {
61 61
             b[x.key] = x.result / 10000;
62 62
             return;
@@ -68,7 +68,6 @@ function body(props) {
68 68
           }
69 69
         });
70 70
 
71
-        
72 71
         props.form.setFieldsValue({
73 72
           ...res,
74 73
           reportDate: moment(res.reportDate),
@@ -176,23 +175,25 @@ function body(props) {
176 175
           })(<TextArea placeholder="回访备注" disabled={type === 'detail'} rows={7} />)}
177 176
         </Form.Item>
178 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 197
         </Form.Item>
197 198
       </Form>
198 199
     </Card>

+ 15
- 3
src/pages/findRoom/overseas/index.jsx Bestand weergeven

@@ -5,7 +5,7 @@ import request from '../../../utils/request';
5 5
 import apis from '../../../services/apis';
6 6
 import QueryTable from '@/components/QueryTable'
7 7
 import { router } from 'umi';
8
-
8
+import AuthButton from '@/components/AuthButton';
9 9
 
10 10
 /**
11 11
  *
@@ -137,8 +137,20 @@ function Recommend() {
137 137
       align: 'center',
138 138
 
139 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 Bestand weergeven

@@ -5,6 +5,7 @@ import request from '@/utils/request';
5 5
 import apis from '@/services/apis';
6 6
 // import Styles from './style.less';
7 7
 import { router } from 'umi';
8
+import AuthButton from '@/components/AuthButton';
8 9
 
9 10
 const { TextArea } = Input;
10 11
 const { Option } = Select;
@@ -201,17 +202,29 @@ function body(props) {
201 202
         </Form.Item>
202 203
         <Form.Item label="回访备注">
203 204
           {getFieldDecorator('auditRemark', {
204
-            rules: [{ required: true, message: '请输入回访备注!' }], //v3x必填
205
+            rules: [{ required: true, message: '请输入回访备注!' }], 
205 206
           })(<TextArea placeholder="回访备注" disabled={type === 'detail'} rows={7} />)}
206 207
         </Form.Item>
207 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 227
           </Button>
213
-          &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
214
-          <Button onClick={() => submitDate({ status: '2' })}>无效</Button></>}
215 228
         </Form.Item>
216 229
       </Form>
217 230
     </Card>

+ 16
- 4
src/pages/findRoom/rent/index.jsx Bestand weergeven

@@ -5,7 +5,7 @@ import request from '../../../utils/request';
5 5
 import apis from '../../../services/apis';
6 6
 import QueryTable from '@/components/QueryTable'
7 7
 import { router } from 'umi';
8
-
8
+import AuthButton from '@/components/AuthButton';
9 9
 
10 10
 /**
11 11
  *
@@ -137,9 +137,21 @@ function Recommend() {
137 137
       align: 'center',
138 138
 
139 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 Bestand weergeven

@@ -226,7 +226,7 @@ export default props => {
226 226
       align: 'center',
227 227
       render: withActions(
228 228
         (_, row) => [
229
-          <AuthButton name="admin.taNews.publish" noRight={null}>
229
+          <AuthButton name="news.publish" noRight={null}>
230 230
             <OperButton
231 231
               onClick={() =>
232 232
                 cancelRelease(
@@ -244,18 +244,18 @@ export default props => {
244 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 245
           // </AuthButton>
246 246
           row.newsStatus === 0 && (
247
-            <AuthButton name="admin.taNews.top" noRight={null}>
247
+            <AuthButton name="news.add" noRight={null}>
248 248
               <OperButton onClick={() => topNews(row.weight, row.newsId)}>
249 249
                 {row.weight === 1 ? '取消置顶' : '置顶'}
250 250
               </OperButton>
251 251
             </AuthButton>
252 252
           ),
253 253
 
254
-          <AuthButton name="admin.taNews.id.put" noRight={null}>
254
+          <AuthButton name="news.edit" noRight={null}>
255 255
             <OperButton onClick={() => toEditList(row.newsId)}>编辑</OperButton>
256 256
           </AuthButton>,
257 257
 
258
-          <AuthButton name="admin.taNews.id.delete" noRight={null}>
258
+          <AuthButton name="news.delete" noRight={null}>
259 259
             <OperButton.Confirm
260 260
               title="确认删除?"
261 261
               content="删除之后不可恢复"
@@ -271,9 +271,11 @@ export default props => {
271 271
   ];
272 272
   const actionRender = () => {
273 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 Bestand weergeven

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

+ 59
- 43
src/pages/news/type/editNews.jsx Bestand weergeven

@@ -1,35 +1,50 @@
1 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 16
 import { FormattedMessage } from 'umi-plugin-react/locale';
4
-import BuildSelect from '../../../components/SelectButton/BuildSelect'
17
+import BuildSelect from '../../../components/SelectButton/BuildSelect';
5 18
 import XForm, { FieldTypes } from '../../../components/XForm';
6 19
 import router from 'umi/router';
7 20
 import apis from '../../../services/apis';
8
-import request from '../../../utils/request'
21
+import request from '../../../utils/request';
9 22
 
10 23
 const { TextArea } = Input;
11 24
 const { Option } = Select;
12 25
 
13 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 31
     useEffect(() => {
19 32
       getNewsData(newsId);
20
-    },[])
33
+    }, []);
21 34
 
22
-  // 查询列表
23
-  const getNewsData = (newsId) => {
24
-    request({
35
+    // 查询列表
36
+    const getNewsData = newsId => {
37
+      request({
25 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 50
   const fields = [
@@ -38,9 +53,7 @@ const header = props => {
38 53
       name: 'buildingId',
39 54
       render: <BuildSelect />,
40 55
       value: newsData.buildingId,
41
-      rules: [
42
-        {required: true, message: '请选择所属项目'},
43
-      ]
56
+      rules: [{ required: true, message: '请选择所属项目' }],
44 57
     },
45 58
     {
46 59
       label: '类型图',
@@ -54,40 +67,43 @@ const header = props => {
54 67
       name: 'newsTypeName',
55 68
       type: FieldTypes.Text,
56 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 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 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 95
   const cancelPage = () => {
82 96
     router.push({
83 97
       pathname: '/news/type/NewsType',
84 98
     });
85
-  }
99
+  };
86 100
 
87 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 108
 const WrappedNormalLoginForm = Form.create({ name: 'header' })(header);
93
-export default WrappedNormalLoginForm
109
+export default WrappedNormalLoginForm;

+ 30
- 24
src/pages/staff/Organization/index.jsx Bestand weergeven

@@ -21,6 +21,7 @@ import TreedataFrom from './form';
21 21
 import TreedataAdd from './addForm';
22 22
 import { connect } from 'dva';
23 23
 import { add } from 'lodash';
24
+import AuthButton from '@/components/AuthButton';
24 25
 
25 26
 const { TreeNode, DirectoryTree } = Tree;
26 27
 const FormItem = Form.Item;
@@ -172,25 +173,34 @@ const Organization = props => {
172 173
   const getTitle = item => {
173 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,11 +219,7 @@ const Organization = props => {
209 219
   return (
210 220
     <>
211 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 223
       </Card>
218 224
       <Modal
219 225
         title={type == 'add' ? '新增' : '编辑'}

+ 198
- 145
src/pages/staff/Role/Edit/index.jsx Bestand weergeven

@@ -6,10 +6,10 @@ import AuthButton from '@/components/AuthButton';
6 6
 import request from '@/utils/request';
7 7
 import router from 'umi/router';
8 8
 import apis from '@/services/apis';
9
+import AuthButton from '@/components/AuthButton';
9 10
 
10 11
 const { TextArea } = Input;
11 12
 
12
-
13 13
 /**
14 14
  *
15 15
  *
@@ -19,67 +19,72 @@ const { TextArea } = Input;
19 19
 const Poster = props => {
20 20
   const userMenus = props.user.currentUser.menus;
21 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 31
   const [loading, setLoading] = useState(false);
32 32
 
33 33
   useEffect(() => {
34 34
     // 新增和编辑用一个页面
35 35
     if (props.location.query) {
36
-      const { id } = props.location.query
36
+      const { id } = props.location.query;
37 37
       if (id) {
38
-        buttonAndMenuList('', id)
38
+        buttonAndMenuList('', id);
39 39
       }
40 40
     }
41 41
     // menuList({ pageNum: 1, pageSize: 100 })
42
-    buttonList({ pageNum: 1, pageSize: 100 })
43
-  }, [])
42
+    buttonList({ pageNum: 1, pageSize: 100 });
43
+  }, []);
44 44
   // 当前所有的菜单
45 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 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 67
   // 根据角色id查询当前的菜单及其按钮
65 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 90
   // const [menus, setMenus] = useState([]);
@@ -87,40 +92,42 @@ const Poster = props => {
87 92
   const [menus, setMenus] = useState([]);
88 93
   const [but, setBut] = useState([]);
89 94
 
90
-  const addMenus = m => setMenus([...menus, m])
95
+  const addMenus = m => setMenus([...menus, m]);
91 96
   const delMenus = m => setMenus(menus.filter(x => x.menuId !== m.menuId));
92 97
 
93 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 111
     let checkedMenus = [
107 112
       ...currentCheckedMenus,
108 113
       ...userMenus.filter(x => leftCheckedMenusIds.some(it => it == x.menuId)),
109
-    ]
114
+    ];
110 115
 
111 116
     // 如果子菜单全部取消选择, 那么根菜单也取消选择
112 117
     // 如果子菜单有一个选中, 那么根菜单也选中
113 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 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 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 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 129
           if (rootMenu) {
123
-            checkedMenus.push(rootMenu)
130
+            checkedMenus.push(rootMenu);
124 131
           }
125 132
         }
126 133
       }
@@ -128,49 +135,57 @@ const Poster = props => {
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 157
   // 判断menus是否有值
142
-  const addBut = m => setBut([...but, m])
158
+  const addBut = m => setBut([...but, m]);
143 159
   const delBut = m => setBut(but.filter(x => x.menuId !== m.menuId));
144 160
   const handleButChange = m => e => {
145
-
146 161
     // 如果有一个按钮选中, 那么对应的菜单也需要选中
147 162
     // 如果没有一个兄弟节点选中, 不做任何处理
148 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 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 176
     if (e.target.checked) {
162
-      setDataButtonId(dataButtonId.concat(m.btnId))
163
-      addBut(m)
177
+      setDataButtonId(dataButtonId.concat(m.btnId));
178
+      addBut(m);
164 179
     } else {
165 180
       setDataButtonId(dataButtonId.filter(item => item !== m.btnId));
166
-      delBut(m)
181
+      delBut(m);
167 182
     }
168
-  }
183
+  };
169 184
   const gridStyle1 = {
170 185
     width: '20%',
171 186
     textAlign: 'left',
172 187
     height: '72px',
173
-    padding:'24px'
188
+    padding: '24px',
174 189
   };
175 190
   const gridStyle2 = {
176 191
     width: '80%',
@@ -179,99 +194,137 @@ const Poster = props => {
179 194
   };
180 195
 
181 196
   function toRoleList() {
182
-    router.go('-1')
197
+    router.go('-1');
183 198
   }
184 199
 
185 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 212
   function handleSubmit(e) {
197 213
     e.preventDefault();
198 214
     props.form.validateFields((err, values) => {
199 215
       if (values.roleName === undefined || values.roleName === '') {
200
-        message.error('请输入角色名称')
201
-        return
216
+        message.error('请输入角色名称');
217
+        return;
202 218
       }
203 219
 
204 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 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 241
   const { getFieldDecorator } = props.form;
216
-  
242
+
217 243
   return (
218 244
     <Card>
219 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 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 324
         </Spin>
272 325
       </div>
273 326
     </Card>
274
-  )
275
-}
327
+  );
328
+};
276 329
 const WrappedNormalLoginForm = Form.create({ name: 'Poster' })(Poster);
277 330
 export default connect(({ user }) => ({ user }))(WrappedNormalLoginForm);

+ 25
- 20
src/pages/staff/staff/Edit/index.jsx Bestand weergeven

@@ -71,9 +71,13 @@ const StaffEdit = props => {
71 71
   }, []);
72 72
 
73 73
   const handleSubmit = val => {
74
-    console.log(val,userId,'----------111------------')
74
+    console.log(val, userId, '----------111------------');
75 75
     // val.institutionIdLis =  val?.institutionIdLis?.split(',')
76 76
     // console.log(val,userId,'----------------------')
77
+    if (val.loginName) {
78
+      val.loginName = val.phone;
79
+    }
80
+
77 81
     if (userId) {
78 82
       request({ ...apis.staff.updateTaUser, urlData: { id: userId }, data: val })
79 83
         .then(data => {
@@ -156,7 +160,7 @@ const StaffEdit = props => {
156 160
           message: '请输入正确的电话号码',
157 161
         },
158 162
       ],
159
-      help: '登录账号为手机号  默认密码:12345',
163
+      help: '登录账号为手机号  默认密码:123456',
160 164
     },
161 165
 
162 166
     {
@@ -206,7 +210,7 @@ const StaffEdit = props => {
206 210
     {
207 211
       label: '组织机构',
208 212
       name: 'institutionIdLis',
209
-      render: <InstitutionSelect multiple/>,
213
+      render: <InstitutionSelect multiple />,
210 214
       value: userData.institutionIdLis,
211 215
       rules: [{ required: true, message: '组织机构' }],
212 216
     },
@@ -221,26 +225,27 @@ const StaffEdit = props => {
221 225
     {
222 226
       label: '授权项目',
223 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 246
       value: userData.buildingIds,
240 247
       hidden: () => isConsultant,
241
-      rules: [
242
-        { required: true, message: '请选择授权项目' },
243
-      ]
248
+      rules: [{ required: true, message: '请选择授权项目' }],
244 249
     },
245 250
     {
246 251
       label: '简介',

+ 9
- 5
src/pages/system/Sellhouse/houseTypes/Newindex.jsx Bestand weergeven

@@ -1,10 +1,11 @@
1 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 3
 import { connect } from 'dva';
4 4
 import XForm, { FieldTypes } from '@/components/XForm';
5 5
 import request from '@/utils/request';
6 6
 import router from 'umi/router';
7 7
 import apis from '@/services/apis';
8
+import AuthButton from '@/components/AuthButton';
8 9
 
9 10
 const { TextArea } = Input;
10 11
 
@@ -114,12 +115,15 @@ const Poster = props => {
114 115
         <Form.Item label="顺序">
115 116
           {getFieldDecorator('sort', {
116 117
             initialValue: data.sort,
117
-          })(<InputNumber  style={{ width: '500px' }} />)}
118
+          })(<InputNumber style={{ width: '500px' }} />)}
118 119
         </Form.Item>
119 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 127
           <Button style={{ marginLeft: '20px' }} onClick={Backcom}>
124 128
             取消
125 129
           </Button>

+ 3
- 3
src/pages/system/Sellhouse/houseTypes/index.jsx Bestand weergeven

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

+ 128
- 87
src/pages/system/Sellhouse/index.jsx Bestand weergeven

@@ -12,30 +12,33 @@ import apis from '@/services/apis';
12 12
 import request from '@/utils/request';
13 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 18
   useEffect(() => {
19 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 35
     router.push({
33 36
       pathname: '/news/Sellhouse/Edit',
34 37
       query: {
35
-        policyId
38
+        policyId,
36 39
       },
37 40
     });
38
-  }
41
+  };
39 42
 
40 43
   /**
41 44
    *
@@ -49,14 +52,18 @@ const header = (props) => {
49 52
       dataIndex: 'policyImg',
50 53
       key: 'policyImg',
51 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 58
       title: '标题',
56 59
       dataIndex: 'title',
57 60
       key: 'title',
58 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 69
       title: '副标题',
@@ -81,150 +88,184 @@ const header = (props) => {
81 88
       dataIndex: 'createDate',
82 89
       key: 'createDate',
83 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 98
       title: '热点',
88 99
       dataIndex: 'isHot',
89 100
       key: 'isHot',
90 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 109
       title: '状态',
95 110
       dataIndex: 'publishStatus',
96 111
       key: 'publishStatus',
97 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 121
       title: '操作',
103 122
       dataIndex: 'handle',
104 123
       key: 'handle',
105 124
       align: 'center',
106 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 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 140
         </AuthButton>,
114
-        
115
-        <AuthButton name="admin.taPolicy.id.put" noRight={null}>
141
+
142
+        <AuthButton name="encyclopedias.edit" noRight={null}>
116 143
           <EditIcon type="edit" text="编辑" onClick={toEditPolicy(row.policyId)}></EditIcon>
117 144
         </AuthButton>,
118 145
 
119
-        <AuthButton name="admin.taPolicy.id.delete" noRight={null}>
146
+        <AuthButton name="encyclopedias.delete" noRight={null}>
120 147
           <EditIcon type="delete" text="删除" onClick={deletePolicy(row.policyId)}></EditIcon>
121 148
         </AuthButton>,
122
-      ])
149
+      ]),
123 150
     },
124 151
   ];
125 152
 
126 153
   // 删除
127
-  const deletePolicy = (policyId) => () => {
154
+  const deletePolicy = policyId => () => {
128 155
     Modal.confirm({
129 156
       title: '购房政策会被删除,小程序端和后台都无法再看到',
130 157
       okText: '确定',
131 158
       cancelText: '取消',
132 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 190
     if (row.publishStatus === 1) {
161
-      row.publishStatus = 0
191
+      row.publishStatus = 0;
162 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 199
     Modal.confirm({
167 200
       title: title,
168 201
       okText: '确定',
169 202
       cancelText: '取消',
170 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 223
   const handleSubmit = (e, props) => {
191 224
     e.preventDefault();
192 225
     props.form.validateFields((err, values) => {
193 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 234
   return (
202
-
203 235
     <Card>
204 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 238
         <Form.Item>
211 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 243
           </AuthButton>
216 244
         </Form.Item>
217 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 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 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 265
       </div>
225 266
     </Card>
226
-  )
227
-}
267
+  );
268
+};
228 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 Bestand weergeven

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