张延森 5 år sedan
förälder
incheckning
6c8cc3c547

+ 39
- 20
config/config.js Visa fil

@@ -124,7 +124,8 @@ export default {
124 124
                 },
125 125
                 {
126 126
                   path: '/building/list/add',
127
-                  name: '', // 项目添加
127
+                  name: '项目添加', // 项目添加
128
+                  hideInMenu: true,
128 129
                   component: './building/list/add/index',
129 130
                 },
130 131
                 {
@@ -134,7 +135,8 @@ export default {
134 135
                 },
135 136
                 {
136 137
                   path: '/building/type/edi',
137
-                  name: '',
138
+                  name: '项目类型编辑',
139
+                  hideInMenu: true,
138 140
                   component: './building/type/edi',
139 141
                 },
140 142
               ],
@@ -151,7 +153,8 @@ export default {
151 153
                 },
152 154
                 {
153 155
                   path: '/customer/customerlist/customerDetail',
154
-                  name: '',
156
+                  name: '客户编辑',
157
+                  hideInMenu: true,
155 158
                   component: './customer/customerlist/customerDetail',
156 159
                 },
157 160
                 {
@@ -171,7 +174,8 @@ export default {
171 174
                 },
172 175
                 {
173 176
                   path: '/customer/recommendCustomer/audit',
174
-                  name: '', //审核
177
+                  name: '客户审核', 
178
+                  hideInMenu: true,
175 179
                   component: './customer/recommendCustomer/audit',
176 180
                 },
177 181
                 {
@@ -198,7 +202,8 @@ export default {
198 202
                 },
199 203
                 {
200 204
                   path: '/integralMall/editGoods',
201
-                  name: '',
205
+                  name: '商品编辑',
206
+                  hideInMenu: true,
202 207
                   component: './integralMall/editGoods',
203 208
                 },
204 209
                 {
@@ -213,7 +218,8 @@ export default {
213 218
                 },
214 219
                 {
215 220
                   path: '/integralMall/verifyList',
216
-                  name: '',
221
+                  name: '商品核销列表',
222
+                  hideInMenu: true,
217 223
                   component: './integralMall/verifyList',
218 224
                 },
219 225
               ],
@@ -230,12 +236,14 @@ export default {
230 236
                 },
231 237
                 {
232 238
                   path: '/channel/addChannel',
233
-                  name: '',
239
+                  name: '添加渠道',
240
+                  hideInMenu: true,
234 241
                   component: './channel/addChannel',
235 242
                 },
236 243
                 {
237 244
                   path: '/channel/editChannel',
238
-                  name: '',
245
+                  name: '编辑渠道',
246
+                  hideInMenu: true,
239 247
                   component: './channel/editChannel',
240 248
                 },
241 249
                 {
@@ -245,12 +253,14 @@ export default {
245 253
                 },
246 254
                 {
247 255
                   path: '/channel/recommendClients',
248
-                  name: '',
256
+                  name: '渠道推荐',
257
+                  hideInMenu: true,
249 258
                   component: './channel/recommendClients',
250 259
                 },
251 260
                 {
252 261
                   path: '/channel/InviteClients',
253
-                  name: '',
262
+                  name: '邀请客户',
263
+                  hideInMenu: true,
254 264
                   component: './channel/InviteClients',
255 265
                 },
256 266
               ],
@@ -267,7 +277,8 @@ export default {
267 277
                 },
268 278
                 {
269 279
                   path: '/news/type/editNews',
270
-                  name: '',
280
+                  name: '编辑资讯类型',
281
+                  hideInMenu: true,
271 282
                   component: './news/type/editNews',
272 283
                 },
273 284
                 {
@@ -277,7 +288,8 @@ export default {
277 288
                 },
278 289
                 {
279 290
                   path: '/news/list/editNewsList',
280
-                  name: '',
291
+                  name: '编辑资讯',
292
+                  hideInMenu: true,
281 293
                   component: './news/list/editNewsList',
282 294
                 },
283 295
               ],
@@ -294,12 +306,14 @@ export default {
294 306
                 },
295 307
                 {
296 308
                   path: '/activity/editActivity',
297
-                  name: '',
309
+                  name: '编辑活动',
310
+                  hideInMenu: true,
298 311
                   component: './activity/editActivity',
299 312
                 },
300 313
                 {
301 314
                   path: '/activity/SignList',
302
-                  name: '',
315
+                  name: '报名列表',
316
+                  hideInMenu: true,
303 317
                   component: './activity/SignList',
304 318
                 },
305 319
               ],
@@ -316,7 +330,8 @@ export default {
316 330
                 },
317 331
                 {
318 332
                   path: '/staff/editStaff',
319
-                  name: '',
333
+                  name: '编辑员工',
334
+                  hideInMenu: true,
320 335
                   component: './staff/list/editStaff',
321 336
                 },
322 337
 
@@ -327,7 +342,8 @@ export default {
327 342
                 },
328 343
                 {
329 344
                   path: '/staff/editRole',
330
-                  name: '',
345
+                  name: '编辑角色',
346
+                  hideInMenu: true,
331 347
                   component: './staff/list/editRole',
332 348
                 },
333 349
 
@@ -345,7 +361,8 @@ export default {
345 361
                 },
346 362
                 {
347 363
                   path: '/carouselFigure/editCarousel',
348
-                  name: '',
364
+                  name: '轮播图编辑',
365
+                  hideInMenu: true,
349 366
                   component: './carouselFigure/editCarousel',
350 367
                 },
351 368
                 {
@@ -355,7 +372,8 @@ export default {
355 372
                 },
356 373
                 {
357 374
                   path: '/carouselFigure/editAdvertising',
358
-                  name: '',
375
+                  name: '开屏广告编辑',
376
+                  hideInMenu: true,
359 377
                   component: './carouselFigure/editAdvertising',
360 378
                 },
361 379
               ],
@@ -387,7 +405,8 @@ export default {
387 405
                 },
388 406
                 {
389 407
                   path: '/system/editPolicy',
390
-                  name: '',
408
+                  name: '购房政策编辑',
409
+                  hideInMenu: true,
391 410
                   component: './system/editPolicy',
392 411
                 },
393 412
               ],
@@ -455,7 +474,7 @@ export default {
455 474
 
456 475
   proxy: {
457 476
     '/api/': {
458
-      target: 'http://192.168.0.11:8080/',
477
+      target: 'http://192.168.0.84:8080/',
459 478
       changeOrigin: true,
460 479
       // pathRewrite: { '^/server': '' },
461 480
     },

+ 74
- 0
src/components/XForm/ImageListUpload.jsx Visa fil

@@ -0,0 +1,74 @@
1
+import React from 'react';
2
+import { Upload, Icon, Modal } from 'antd';
3
+import './style.less';
4
+import { uploaderProps } from '../../utils/upload';
5
+
6
+function getBase64(file) {
7
+  return new Promise((resolve, reject) => {
8
+    const reader = new FileReader();
9
+    reader.readAsDataURL(file);
10
+    reader.onload = () => resolve(reader.result);
11
+    reader.onerror = error => reject(error);
12
+  });
13
+}
14
+
15
+class ImageListUpload extends React.Component {
16
+  state = {
17
+    previewVisible: false,
18
+    previewImage: '',
19
+    fileList: [],
20
+  };
21
+
22
+  handleCancel = () => this.setState({ previewVisible: false });
23
+
24
+  handlePreview = async file => {
25
+    if (!file.url && !file.preview) {
26
+      file.preview = await getBase64(file.originFileObj);
27
+    }
28
+
29
+    this.setState({
30
+      previewImage: file.url || file.preview,
31
+      previewVisible: true,
32
+    });
33
+  };
34
+
35
+  handleChange = ({ fileList }) => {
36
+    this.setState({ fileList })
37
+    if (typeof this.props.onChange === 'function') {
38
+      // return item.response.url
39
+      const images = fileList.filter(item => item.status === 'done')
40
+      this.props.onChange(images.map(item => item.response.url))
41
+    }
42
+  };
43
+
44
+  render() {
45
+    const { previewVisible, previewImage, fileList } = this.state;
46
+
47
+    const { value } = this.props
48
+
49
+    const uploadButton = (
50
+      <div>
51
+        <Icon type="plus" />
52
+        <div className="ant-upload-text">Upload</div>
53
+      </div>
54
+    );
55
+    return (
56
+      <div className="clearfix">
57
+        <Upload
58
+          listType="picture-card"
59
+          fileList={fileList || value}
60
+          onPreview={this.handlePreview}
61
+          onChange={this.handleChange}
62
+          { ...uploaderProps }
63
+        >
64
+          {fileList.length >= 8 ? null : uploadButton}
65
+        </Upload>
66
+        <Modal visible={previewVisible} footer={null} onCancel={this.handleCancel}>
67
+          <img alt="example" style={{ width: '100%' }} src={previewImage} />
68
+        </Modal>
69
+      </div>
70
+    );
71
+  }
72
+}
73
+
74
+export default ImageListUpload;

+ 13
- 0
src/components/XForm/style.css Visa fil

@@ -0,0 +1,13 @@
1
+:global .avatar-uploader > .ant-upload {
2
+  width: 128px;
3
+  height: 128px;
4
+}
5
+/* you can make up upload button and sample style by using stylesheets */
6
+.ant-upload-select-picture-card i {
7
+  font-size: 32px;
8
+  color: #999;
9
+}
10
+.ant-upload-select-picture-card .ant-upload-text {
11
+  margin-top: 8px;
12
+  color: #666;
13
+}

+ 12
- 0
src/components/XForm/style.less Visa fil

@@ -6,3 +6,15 @@
6 6
     }
7 7
   }
8 8
 }
9
+
10
+
11
+/* you can make up upload button and sample style by using stylesheets */
12
+.ant-upload-select-picture-card i {
13
+  font-size: 32px;
14
+  color: #999;
15
+}
16
+
17
+.ant-upload-select-picture-card .ant-upload-text {
18
+  margin-top: 8px;
19
+  color: #666;
20
+}

+ 13
- 0
src/components/XForm/style.wxss Visa fil

@@ -0,0 +1,13 @@
1
+:global .avatar-uploader > .ant-upload {
2
+  width: 128px;
3
+  height: 128px;
4
+}
5
+/* you can make up upload button and sample style by using stylesheets */
6
+.ant-upload-select-picture-card i {
7
+  font-size: 32px;
8
+  color: #999;
9
+}
10
+.ant-upload-select-picture-card .ant-upload-text {
11
+  margin-top: 8px;
12
+  color: #666;
13
+}

+ 71
- 61
src/global.less Visa fil

@@ -47,77 +47,87 @@ ol {
47 47
   }
48 48
 }
49 49
 
50
-.ant-pro-global-header{
50
+.ant-layout-header .ant-pro-global-header{
51 51
   background:#393C39;
52 52
 }
53
-.ant-pro-sider-menu-sider.light .ant-pro-sider-menu-logo{
53
+.ant-layout .ant-pro-sider-menu-sider.light .ant-pro-sider-menu-logo{
54 54
   background:#EF273A;
55 55
   box-shadow: none;
56 56
   border: none;
57
-}
58
-.ant-input-affix-wrapper .ant-input-prefix{
59
-  left:7px;
60
-}
61
-.ant-input-affix-wrapper .ant-input:not(:first-child) {
62
-  padding-left: 40px;
63
-}
64
-.ant-pro-global-header-trigger{
65
-  display: none;
66
-}
67
-.ant-pro-sider-menu-sider.light{
68
-  box-shadow: none;
69
-  .ant-pro-sider-menu-logo h1{
70
-    color: #fff;
57
+  a{
58
+    h1{
59
+      color: #fff;
60
+    }
71 61
   }
72 62
 }
73
-.ant-pro-page-header-wrap-page-header-warp{
74
-  background:rgba(240,240,240,1);
75
-}
76
-.ant-menu:not(.ant-menu-horizontal) .ant-menu-item-selected{
77
-  background:rgb(230, 227, 227);
78
-  border: none;
79
-}
80
-.ant-menu-inline .ant-menu-selected::after, .ant-menu-inline .ant-menu-item-selected::after{
81
-  opacity: 0;
82
-}
83
-.ant-menu-inline > .ant-menu-item{
84
-  height: 45px;
85
-  line-height: 45px;
86
-  font-size: 16px;
87
-  margin: 0;
88
-}
89
-.ant-menu.ant-pro-sider-menu{
90
-  padding: 0!important;
91
-}
92
-
93
-.ant-breadcrumb + .ant-page-header-heading{
94
-  display: none;
63
+.antd-pro-layouts-user-layout-container{
64
+  .ant-input-affix-wrapper .ant-input-prefix{
65
+    left:7px;
66
+  }
67
+  .ant-input-affix-wrapper .ant-input:not(:first-child) {
68
+    padding-left: 40px;
69
+  }
95 70
 }
96
-.ant-page-header{
97
-  height: 50px;
98
-  padding:0 30px;
99
-  line-height: 50px;
71
+ 
72
+.ant-layout{
73
+  .ant-pro-global-header-trigger{
74
+    display: none;
75
+  }
76
+  .ant-pro-sider-menu-sider.light{
77
+    box-shadow: none;
78
+    .ant-pro-sider-menu-logo h1{
79
+      color: #fff;
80
+    }
81
+  }
82
+  .ant-pro-page-header-wrap-page-header-warp{
83
+    background:rgba(240,240,240,1);
84
+  }
85
+   .ant-menu:not(.ant-menu-horizontal)  .ant-menu-item-selected{
86
+    background:rgb(230, 227, 227)!important;
87
+    border: none!important;
88
+  }
89
+  .ant-menu-inline .ant-menu-selected::after, .ant-menu-inline .ant-menu-item-selected::after{
90
+    opacity: 0;
91
+  }
92
+  .ant-menu-inline > .ant-menu-item{
93
+    height: 45px;
94
+    line-height: 45px;
95
+    font-size: 16px;
96
+    margin: 0;
97
+  }
98
+  .ant-menu.ant-pro-sider-menu{
99
+    padding: 0!important;
100
+  }
100 101
   
101
-  .ant-breadcrumb{
102
-    color: #333;
102
+  .ant-breadcrumb + .ant-page-header-heading{
103
+    display: none;
103 104
   }
104
-}
105
-.ant-pro-sider-menu-logo img{
106
-  height: 41px;
107
-}
108
-.ant-tabs.ant-tabs-card .ant-tabs-card-bar .ant-tabs-tab-active {
109
-  color: #FF7E48;
110
-}
111
-.ant-table{
112
-  line-height: 3;
113
-}
114
-.ant-modal-header{
115
-  border-bottom: none;
116
-  .ant-modal-title{
117
-    font-size: 24px;
105
+  .ant-page-header{
106
+    height: 50px;
107
+    padding:0 30px;
118 108
     line-height: 50px;
109
+    
110
+    .ant-breadcrumb{
111
+      color: #333;
112
+    }
113
+  }
114
+  .ant-pro-sider-menu-logo img{
115
+    height: 41px;
116
+  }
117
+  .ant-tabs.ant-tabs-card .ant-tabs-card-bar .ant-tabs-tab-active {
118
+    color: #FF7E48;
119
+  }
120
+  .ant-table{
121
+    line-height: 3;
122
+  }
123
+  .ant-modal-header{
124
+    border-bottom: none;
125
+    .ant-modal-title{
126
+      font-size: 24px;
127
+      line-height: 50px;
128
+    }
129
+  }
130
+  .ant-modal-footer{
131
+    border-top:none;
119 132
   }
120 133
 }
121
-.ant-modal-footer{
122
-  border-top:none;
123
-}

+ 9
- 4
src/pages/activity/editActivity.jsx Visa fil

@@ -26,9 +26,7 @@ const { TextArea } = Input;
26 26
  * @returns
27 27
  */
28 28
 const Edit = (props) => {
29
-  const [tab, changeTab] = useState('poster')
30
-
31
-  // const [tab, changeTab] = useState('basic')
29
+  const [tab, changeTab] = useState('basic')
32 30
   const dynamicId = props.location.query.dynamicId
33 31
   const [dynamicData, setDynamicData] = useState({})
34 32
   if (dynamicId) {
@@ -175,6 +173,13 @@ const Edit = (props) => {
175 173
     const [textAreaValue, changeTextArea] = useState('')
176 174
     const [imgValue, changeImg] = useState('')
177 175
 
176
+    const submitPoster  = () => {
177
+      console.log(inputValue)
178
+      console.log(textAreaValue)
179
+      console.log(imgValue)
180
+      console.log(dynamicId)
181
+    }
182
+
178 183
     return <div>
179 184
       <div style={{ display: 'flex' }}>
180 185
         <div style={{ width: '420px', height: '900px', display: 'inline-block', marginTop: '30px' }}>
@@ -225,7 +230,7 @@ const Edit = (props) => {
225 230
 
226 231
         </div>
227 232
       </div>
228
-      <Button type="primary" onClick={() => router.go(-1)} style={{ margin: '40px 40px 40px 30vw' }}> 确定</Button>
233
+      <Button type="primary" onClick={submitPoster} style={{ margin: '40px 40px 40px 30vw' }}> 确定</Button>
229 234
       <Button onClick={() => router.go(-1)}>取消</Button>
230 235
     </div>
231 236
 

+ 60
- 13
src/pages/building/list/add/components/base.jsx Visa fil

@@ -1,11 +1,12 @@
1 1
 import React, { useState, useEffect } from 'react';
2
-import { Form, Icon, Input, Button, DatePicker, Select, Card, Row, Col, Pagination, Alert, Radio, Tag, Tooltip, Tabs, InputNumber } from 'antd';
2
+import { Form, Icon, Input, Button, DatePicker, Select, Card, Row, Col, Pagination, Alert, Radio, Tag, Tooltip, Tabs, InputNumber, notification } 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 8
 import ImageUpload from '../../../../../components/XForm/ImageUpload'
9
+import ImageListUpload from '../../../../../components/XForm/ImageListUpload'
9 10
 import Wangedit from '../../../../../components/Wangedit/Wangedit'
10 11
 import TagGroup from './tags'
11 12
 
@@ -23,21 +24,67 @@ const formItemLayout = {
23 24
   },
24 25
 };
25 26
 
27
+
28
+function openNotificationWithIcon(type, message) {
29
+  notification[type]({
30
+    message,
31
+    description:
32
+      '',
33
+  });
34
+}
35
+
36
+
26 37
 function AddBuilding(props) {
27 38
   const { getFieldDecorator } = props.form;
28 39
 
40
+  if (props.building.buildingId !== undefined) {
41
+    const { buildingId } = props.building
42
+    if (buildingId !== '') {
43
+      // eslint-disable-next-line react-hooks/rules-of-hooks
44
+      useEffect(() => {
45
+        getById(buildingId)
46
+      }, [])
47
+    }
48
+  }
49
+
50
+   // 获取详情信息
51
+   function getById(currentId) {
52
+    const { url, method } = apis.building.buildingGetById
53
+    const tempUrl = url.substring(0, url.lastIndexOf('id')).concat(currentId)
54
+
55
+    request({ url: tempUrl, method }).then(res => {
56
+      res.openingDate = moment(res.openingDate)
57
+      res.receivedDate = moment(res.receivedDate)
58
+      props.form.setFieldsValue(res)
59
+    })
60
+  }
61
+
29 62
   function handleSubmit(e) {
30 63
     e.preventDefault();
31 64
     props.form.validateFieldsAndScroll((err, values) => {
32 65
       if (!err) {
33
-        console.log('Received values of form: ', values);
66
+        addBuilding(values)
34 67
       }
35 68
     });
36 69
   }
37 70
 
71
+  function addBuilding(data) {
72
+    data.openingDate = moment(data.openingDate, 'yyyy-MM-dd HH:mm:ss')
73
+    data.receivedDate = moment(data.receivedDate, 'yyyy-MM-dd HH:mm:ss')
74
+    data.buildingProjectType = []
75
+    // 项目主图
76
+    data.img = data.avatarImage && data.avatarImage.map((item, index) => ({ imgType: 'banner', url: item, orderNo: index + 1 }))
77
+
78
+    request({ ...apis.building.addBuilding, data: { ...data } }).then(() => {
79
+      openNotificationWithIcon('success', '操作成功')
80
+    }).catch(err => {
81
+      openNotificationWithIcon('error', err.message)
82
+    })
83
+  }
84
+
38 85
   return (
39 86
         <Form {...formItemLayout} onSubmit={handleSubmit}>
40
-          <Form.Item label="楼盘编号">
87
+          <Form.Item label="楼盘编号" hasFeedback>
41 88
             {getFieldDecorator('code')(<Input />)}
42 89
           </Form.Item>
43 90
           <Form.Item label="楼盘名称" hasFeedback>
@@ -47,13 +94,13 @@ function AddBuilding(props) {
47 94
             {getFieldDecorator('name')(<Input />)}
48 95
           </Form.Item>
49 96
           <Form.Item label="项目类型" hasFeedback>
50
-            {getFieldDecorator('name')(<Input />)}
97
+            {getFieldDecorator('buildingProjectType')(<Input />)}
51 98
           </Form.Item>
52 99
           <Form.Item label="均价" hasFeedback>
53 100
             {getFieldDecorator('price')(<Input />)}
54 101
           </Form.Item>
55 102
           <Form.Item label="开盘时间" hasFeedback>
56
-            {getFieldDecorator('openingDate')(<DatePicker />)}
103
+            {getFieldDecorator('openingDate')(<DatePicker format="YYYY/MM/DD" />)}
57 104
           </Form.Item>
58 105
           <Form.Item label="电话" hasFeedback>
59 106
             {getFieldDecorator('tel')(<Input />)}
@@ -79,17 +126,17 @@ function AddBuilding(props) {
79 126
             )}
80 127
           </Form.Item>
81 128
           <Form.Item label="项目主图" hasFeedback>
82
-            {getFieldDecorator('tags')(
83
-              <ImageUpload />,
129
+            {getFieldDecorator('avatarImage')(
130
+              <ImageListUpload />,
84 131
             )}
85 132
           </Form.Item>
86 133
           <Form.Item label="地址图片" hasFeedback>
87
-            {getFieldDecorator('tags')(
134
+            {getFieldDecorator('mapImg')(
88 135
               <ImageUpload />,
89 136
             )}
90 137
           </Form.Item>
91 138
           <Form.Item label="海报底图" hasFeedback>
92
-            {getFieldDecorator('tags')(
139
+            {getFieldDecorator('poster')(
93 140
               <ImageUpload />,
94 141
             )}
95 142
           </Form.Item>
@@ -123,11 +170,11 @@ function AddBuilding(props) {
123 170
           <Form.Item label="项目坐标" hasFeedback>
124 171
             {getFieldDecorator('coordinate')(<Input disabled />)}
125 172
           </Form.Item>
126
-          <Form.Item label="项目地址" hasFeedback>
127
-            {getFieldDecorator('coordinate')(<Input />)}
173
+          <Form.Item label="地图位置" hasFeedback>
174
+            {(<Input />)}
128 175
           </Form.Item>
129 176
           <Form.Item label="周边交通" hasFeedback>
130
-            {getFieldDecorator('buildingArea')(
177
+            {getFieldDecorator('buildingTransport')(
131 178
               <TagGroup />,
132 179
             )}
133 180
           </Form.Item>
@@ -184,7 +231,7 @@ function AddBuilding(props) {
184 231
             {getFieldDecorator('rightsYear')(<InputNumber />)}
185 232
           </Form.Item>
186 233
           <Form.Item label="预售许可证" hasFeedback>
187
-            {getFieldDecorator('decoration')(
234
+            {getFieldDecorator('preSalePermit')(
188 235
               <ImageUpload />,
189 236
             )}
190 237
           </Form.Item>

+ 1
- 1
src/pages/building/list/add/components/imageSet.jsx Visa fil

@@ -138,7 +138,7 @@ function imageSet(props) {
138 138
 
139 139
       {/* 编辑页 */}
140 140
       {/*  onSuccess是子组件传递事件信息  */}
141
-      <ModalImage visibleData={visibleData} key={visibleData.apartmentId} onSuccess={getList}/>
141
+      <ModalImage visibleData={visibleData} key={1} onSuccess={getList}/>
142 142
     </>
143 143
   )
144 144
 }

+ 1
- 1
src/pages/building/list/add/components/modalImage.jsx Visa fil

@@ -89,7 +89,7 @@ class ModalImage extends React.Component {
89 89
     const { url, method } = apis.building.buildingApartmentGetById
90 90
     const tempUrl = url.substring(0, url.lastIndexOf('id')).concat(apartmentId)
91 91
 
92
-    request({ url: tempUrl, method , params: { ...params } }).then(res => {
92
+    request({ url: tempUrl, method, params: { ...params } }).then(res => {
93 93
       // res.img = res.buildingImgList.map((item, _) => item.url)
94 94
       res.img = res.buildingImgList[0].url
95 95
       this.props.form.setFieldsValue(res)

+ 15
- 1
src/pages/building/list/add/components/tags.jsx Visa fil

@@ -34,15 +34,29 @@ class EditableTagGroup extends React.Component {
34 34
       inputVisible: false,
35 35
       inputValue: '',
36 36
     });
37
+
38
+    if (typeof this.props.onChange === 'function') {
39
+      const tempTags = tags.join(',')
40
+      this.props.onChange(tempTags);
41
+    }
37 42
   };
38 43
 
39 44
   saveInputRef = input => (this.input = input);
40 45
 
41 46
   render() {
42 47
     const { tags, inputVisible, inputValue } = this.state;
48
+
49
+    const { value } = this.props
50
+    let data = []
51
+    if (value !== undefined && value !== null) {
52
+      data = value.split(',')
53
+    } else {
54
+      data = tags
55
+    }
56
+
43 57
     return (
44 58
       <div>
45
-        {tags.map((tag, index) => {
59
+        {data.map((tag, index) => {
46 60
           const isLongTag = tag.length > 20;
47 61
           const tagElem = (
48 62
             <Tag key={tag} closable onClose={() => this.handleClose(tag)}>

+ 10
- 21
src/pages/building/list/add/index.jsx Visa fil

@@ -29,35 +29,24 @@ const formItemLayout = {
29 29
 };
30 30
 
31 31
 function AddBuilding(props) {
32
-  // eslint-disable-next-line react-hooks/rules-of-hooks
33
-  const [dataSource, setDataSource] = useState({ records: [] })
34
-
35
-  const [buildingAreaTags, setBuildingAreaTags] = useState({ tags: ['Unremovable', 'Tag 2', 'Tag 3'], inputVisible: false, inputValue: '' })
36
-
37
-
38
-  const { getFieldDecorator } = props.form;
39
-
40
-  function handleSubmit(e) {
41
-    e.preventDefault();
42
-    props.form.validateFieldsAndScroll((err, values) => {
43
-      if (!err) {
44
-        console.log('Received values of form: ', values);
45
-      }
46
-    });
47
-  }
48
-
49 32
   function tabsCallback(key) {
50 33
     console.log(key);
51 34
   }
52 35
 
36
+  console.log(props.location)
37
+
53 38
   return (
54 39
     <Tabs defaultActiveKey="1" onChange={tabsCallback}>
55 40
       <TabPane tab="基本信息" key="1">
56
-        <Base />
57
-      </TabPane>
58
-      <TabPane tab="图片" key="2">
59
-        <ImageSet building={{ buildingId: '159fd19bb973b6972c10fbebf07ddeb1' }} />
41
+        <Base building={{ buildingId: props.location.query && props.location.query.id }} />
60 42
       </TabPane>
43
+      {
44
+        props.location.query.id &&
45
+        <TabPane tab="图片" key="2">
46
+          {/* '159fd19bb973b6972c10fbebf07ddeb1' */}
47
+          <ImageSet building={{ buildingId: props.location.query && props.location.query.id }} />
48
+        </TabPane>
49
+      }
61 50
     </Tabs>
62 51
   )
63 52
 }

+ 87
- 8
src/pages/building/list/index.jsx Visa fil

@@ -1,5 +1,5 @@
1 1
 import React, { useState, useEffect } from 'react';
2
-import { Form, Icon, Input, Button, DatePicker, Select, Card, Row, Col, Pagination, Alert } from 'antd';
2
+import { Form, Icon, Input, Button, DatePicker, Select, Card, Row, Col, Pagination, Alert, notification, Modal } from 'antd';
3 3
 import moment from 'moment';
4 4
 import request from '../../../utils/request';
5 5
 import apis from '../../../services/apis';
@@ -13,6 +13,14 @@ const { Meta } = Card;
13 13
 
14 14
 const tempDate = [{ code: 's101' }]
15 15
 
16
+function openNotificationWithIcon(type, message) {
17
+  notification[type]({
18
+    message,
19
+    description:
20
+      '',
21
+  });
22
+}
23
+
16 24
 /**
17 25
  *卡片
18 26
  *
@@ -21,6 +29,76 @@ const tempDate = [{ code: 's101' }]
21 29
 function CartBody(props) {
22 30
   const { data } = props
23 31
 
32
+
33
+  function toEdi(record) {
34
+    router.push({
35
+      pathname: '/building/list/add',
36
+      query: {
37
+        id: record.buildingId,
38
+      },
39
+    })
40
+  }
41
+
42
+  /**
43
+   *发布 取消 发布
44
+   *
45
+   * @param {*} record
46
+   */
47
+  function pulicAndUnPulic(record) {
48
+    const modal = Modal.confirm();
49
+    const buidingStatus = record.status === 1 ? 2 : 1
50
+    const title = record.status === 1 ? '确认取消发布此数据?' : '确认发布此数据?'
51
+
52
+    modal.update({
53
+      content: title,
54
+      okText: '确认',
55
+      cancelText: '关闭',
56
+      onOk: () => {
57
+        request({ ...apis.building.updateStatus, data: { id: record.buildingId, status: buidingStatus } }).then(() => {
58
+          openNotificationWithIcon('success', '操作成功')
59
+          props.onSuccess()
60
+        }).catch(err => {
61
+          openNotificationWithIcon('error', err.message)
62
+        })
63
+
64
+        modal.destroy();
65
+      },
66
+      onCancel: () => {
67
+        modal.destroy();
68
+      },
69
+    });
70
+  }
71
+
72
+  /**
73
+   *删除楼盘
74
+   *
75
+   * @param {*} record
76
+   */
77
+  function deleteBuilding(record) {
78
+    const { url, method } = apis.building.deleteBuilding
79
+    const tempUrl = url.substring(0, url.lastIndexOf('id')).concat(record.buildingId)
80
+
81
+    const modal = Modal.confirm();
82
+    modal.update({
83
+      content: '确定删除此楼盘?',
84
+      okText: '确认',
85
+      cancelText: '关闭',
86
+      onOk: () => {
87
+        request({ url: tempUrl, method }).then(() => {
88
+          openNotificationWithIcon('success', '操作成功')
89
+          props.onSuccess()
90
+        }).catch(err => {
91
+          openNotificationWithIcon('error', err.message)
92
+        })
93
+
94
+        modal.destroy();
95
+      },
96
+      onCancel: () => {
97
+        modal.destroy();
98
+      },
99
+    });
100
+  }
101
+
24 102
   return (
25 103
           <Card
26 104
             hoverable
@@ -31,7 +109,7 @@ function CartBody(props) {
31 109
             <p className={Styles.cardText}>
32 110
               <span className={Styles.title}>楼盘编号</span>
33 111
               <span >:{ data.code }</span>
34
-              <span className={Styles.ediText}>
112
+              <span className={Styles.ediText} onClick={() => toEdi(data)}>
35 113
                 编辑
36 114
                 <Icon type="form" style={{ color: '#C0C4CC', marginLeft: '10px' }} />
37 115
               </span>
@@ -52,20 +130,21 @@ function CartBody(props) {
52 130
             </p>
53 131
             <p className={Styles.cardItem}>
54 132
               <span className={Styles.title}>发布状态</span>
55
-              <span >:{ data.status === '1' ? '已发布' : '未发布' }</span>
133
+              <span >:{ data.status === 1 ? '已发布' : '未发布' }</span>
56 134
             </p>
57 135
             <p className={Styles.cardItem}>
58 136
               <span className={Styles.title}>录入时间</span>
59 137
               <span >:{ data.createDate }</span>
60 138
             </p>
61 139
             <p style={{ margin: '15px 0', position: 'relative', fontSize: '18px' }}>
62
-              <span style={{ color: '#1990FF' }}>
63
-                取消发布
140
+              <span style={{ color: '#1990FF' }} onClick={() => pulicAndUnPulic(data)}>
141
+                {/* 已发布的时候,需要显示取消发布的字样 */}
142
+                { data.status === 1 ? '取消发布' : '发布' }
64 143
                 <Icon type="close-circle" style={{ color: '#C0C4CC', marginLeft: '8px' }} />
65 144
               </span>
66 145
               <span style={{
67 146
                 color: '#FF4A4A', position: 'absolute', right: '0',
68
-              }} >
147
+              }} onClick={() => deleteBuilding(data)}>
69 148
                 删除
70 149
                 <Icon type="rest" style={{ color: '#C0C4CC', marginLeft: '8px' }} />
71 150
               </span>
@@ -213,9 +292,9 @@ function body(props) {
213 292
       {/* 卡片内容,显示楼盘项目  */}
214 293
       <Row style={{ padding: ' 0 10px' }}>
215 294
         {
216
-          dataSource.records.map((item, index) => (
295
+          dataSource.records.map((item, _) => (
217 296
               <Col span={8}>
218
-                <CartBody data={item} key={item.buildingId}/>
297
+                <CartBody data={item} key={item.buildingId} onSuccess={getList}/>
219 298
               </Col>
220 299
             ))
221 300
         }

+ 1
- 0
src/pages/channel/channelList.jsx Visa fil

@@ -109,6 +109,7 @@ const header = props => {
109 109
   const [data, setData] = useState({ channelNmae: [], result: [] })
110 110
   // eslint-disable-next-line react-hooks/rules-of-hooks
111 111
   useEffect(() => {
112
+    localStorage.removeItem('value');
112 113
     getList({ pageNum: 1, pageSize: 10 })
113 114
   }, [])
114 115
 

+ 3
- 4
src/pages/customer/independentList/index.jsx Visa fil

@@ -374,11 +374,10 @@ function body(props) {
374 374
         <>
375 375
           {
376 376
             <>
377
-              <sapn style={{ color: 'rgba(239,39,58,1)' }}>查看详细</sapn>
377
+              {/* <sapn style={{ color: 'rgba(239,39,58,1)' }}>查看详细</sapn> */}
378
+              <a style={{ color: 'rgba(239,39,58,1)' }} onClick={() => Invite(record)}>邀请经纪人</a>
378 379
               &nbsp;&nbsp;&nbsp;&nbsp;
379
-              <sapn style={{ color: 'rgba(239,39,58,1)' }} onClick={() => Invite(record)}>邀请经纪人</sapn>
380
-              &nbsp;&nbsp;&nbsp;&nbsp;
381
-              <sapn style={{ color: 'rgba(239,39,58,1)' }} onClick={() => gM(record)}>推荐客户</sapn>
380
+              <a style={{ color: 'rgba(239,39,58,1)' }} onClick={() => gM(record)}>推荐客户</a>
382 381
             </>
383 382
           }
384 383
         </>

+ 25
- 11
src/pages/staff/list/editRole.jsx Visa fil

@@ -1,12 +1,11 @@
1
-import React, { useState } from 'react';
2
-
1
+import React, { useState, useEffect } from 'react';
3 2
 import { Checkbox, Row, Col, Input, Menu, Dropdown, Button, Icon, message, Table, Tooltip, Tabs, Radio, Divider, Tag, DatePicker, Select, Form, Alert, Card } from 'antd';
4 3
 import { FormattedMessage } from 'umi-plugin-react/locale';
5 4
 import styles from '../../style/GoodsList.less';
6 5
 import XForm, { FieldTypes } from '../../../components/XForm';
7
-import Wangedit from '../../../components/Wangedit/Wangedit'
6
+import Wangedit from '../../../components/Wangedit/Wangedit';
7
+import request from '../../../utils/request';
8 8
 import channels from './channelList.less';
9
-
10 9
 import Tagss from '../components/Tagss.jsx';
11 10
 
12 11
 const { TextArea } = Input;
@@ -19,9 +18,24 @@ const { TextArea } = Input;
19 18
  * @returns
20 19
  */
21 20
 const Edit = (props) => {
22
-
23
-
24
-
21
+  const [data, setData] = useState({ data: [] })
22
+ // 获取当前所有菜单
23
+  useEffect(() => {
24
+    localStorage.removeItem('value');
25
+    menuList({ pageNum: 1, pageSize: 100 })
26
+  }, [])
27
+
28
+  function menuList(params) {
29
+    request({
30
+      url: '/api/admin/menuList',
31
+      method: 'GET',
32
+      params: { ...params },
33
+  // eslint-disable-next-line no-shadow
34
+  }).then(data => {
35
+      console.log(data)
36
+      setData(data)
37
+  })
38
+  }
25 39
   // const [tab, changeTab] = useState('basic')
26 40
 
27 41
   const Permission = [
@@ -99,7 +113,7 @@ const Edit = (props) => {
99 113
   // }
100 114
   // const [Card] = useState('Poster')
101 115
 
102
-  const Poster = (props) => {
116
+  const Poster = props => {
103 117
 
104 118
     const dataSource = [
105 119
 
@@ -135,10 +149,10 @@ const Edit = (props) => {
135 149
 {/* <Checkbox>{Permission[index]}</Checkbox> */}
136 150
     return <>
137 151
       <div style={{}}>
138
-
152
+      {Array.from(data).map(Item =>
153
+                <Checkbox value={ Item.menuId }> { Item.name } </Checkbox>,
154
+              )}
139 155
         {Permission.map((item, index) => (
140
-
141
-
142 156
           <Card title={<Checkbox>{Permission[index]}</Checkbox>} bordered={true} style={{ width: '100%' }}>
143 157
             
144 158
               {dataSource.map((items, indexs) => (

+ 16
- 0
src/services/apis.js Visa fil

@@ -22,6 +22,22 @@ export default {
22 22
       method: 'GET',
23 23
       url: `${prefix}/buildinglist`,
24 24
     },
25
+    updateStatus: {
26
+      method: 'PUT',
27
+      url: `${prefix}/building/update/status`,
28
+    },
29
+    addBuilding: {
30
+      method: 'POST',
31
+      url: `${prefix}/building/add`,
32
+    },
33
+    buildingGetById: {
34
+      method: 'GET',
35
+      url: `${prefix}/buildingSelectId/id`,
36
+    },
37
+    deleteBuilding: {
38
+      method: 'DELETE',
39
+      url: `${prefix}/building/delete/id`,
40
+    },
25 41
     buildingApartment: {
26 42
       method: 'GET',
27 43
       url: `${prefix}/buildingApartment/buildingId/id`,