Bläddra i källkod

Merge branch 'master' of http://git.ycjcjy.com/zhiyuxing/estateagents-admin-manager

傅行帆 5 år sedan
förälder
incheckning
17f9098427

Binär
src/assets/bottom.png Visa fil


Binär
src/assets/yinhao.png Visa fil


+ 111
- 39
src/pages/activity/editActivity.jsx Visa fil

@@ -1,5 +1,5 @@
1 1
 import React, { useState, useEffect } from 'react';
2
-import { Form, Input, Button, Icon, Select, Tabs, Radio, DatePicker,message } from 'antd';
2
+import { Form, Input, Button, Icon, Select, Tabs, Radio, DatePicker, message } from 'antd';
3 3
 import { FormattedMessage } from 'umi-plugin-react/locale';
4 4
 import styles from '../style/GoodsList.less';
5 5
 import moment from 'moment';
@@ -8,37 +8,42 @@ import BuildSelect from '../../components/SelectButton/BuildSelect'
8 8
 import XForm, { FieldTypes } from '../../components/XForm';
9 9
 import Wangedit from '../../components/Wangedit/Wangedit'
10 10
 import request from '../../utils/request'
11
+import PosterBottom from '../../assets/bottom.png'
12
+import yinhao from '../../assets/yinhao.png'
13
+import ImageUploader from '../../components/XForm/ImageUpload';
14
+import logo from '../../assets/logo.png';
11 15
 
12 16
 const { MonthPicker, RangePicker, WeekPicker } = DatePicker;
17
+
13 18
 /**
14 19
  *
15 20
  *
16 21
  * @param {*} props
17 22
  * @returns
18 23
  */
19
- const Edit = (props) => {
20
-  const [ tab, changeTab ] = useState('basic')
24
+const Edit = (props) => {
25
+  const [tab, changeTab] = useState('basic')
21 26
   const dynamicId = props.location.query.dynamicId
22
-  const [ dynamicData, setDynamicData ] = useState({})
23
-  if(dynamicId){
27
+  const [dynamicData, setDynamicData] = useState({})
28
+  if (dynamicId) {
24 29
     useEffect(() => {
25 30
       getDynamicData(dynamicId);
26
-    },[])
31
+    }, [])
27 32
 
28
-  // 查询列表
29
-  const getDynamicData = (dynamicId) => {
30
-    request({
33
+    // 查询列表
34
+    const getDynamicData = (dynamicId) => {
35
+      request({
31 36
         url: '/api/admin/buildingDynamic/Details',
32 37
         method: 'GET',
33 38
         params: { dynamicId },
34
-    }).then((data) => {
39
+      }).then((data) => {
35 40
         console.log(data)
36 41
         setDynamicData(data)
37
-    })
38
-  }
42
+      })
43
+    }
39 44
   }
40 45
 
41
-  const cancelPage = () =>{
46
+  const cancelPage = () => {
42 47
     router.push({
43 48
       pathname: '/activity/ActivityList',
44 49
     });
@@ -52,7 +57,7 @@ const { MonthPicker, RangePicker, WeekPicker } = DatePicker;
52 57
         render: <BuildSelect />,
53 58
         value: dynamicData.buildingId,
54 59
         rules: [
55
-          {required: true, message: '请选择所属项目'},
60
+          { required: true, message: '请选择所属项目' },
56 61
         ]
57 62
       },
58 63
       {
@@ -67,16 +72,16 @@ const { MonthPicker, RangePicker, WeekPicker } = DatePicker;
67 72
         type: FieldTypes.Text,
68 73
         value: dynamicData.title,
69 74
         rules: [
70
-          {required: true, message: '请输入活动标题'},
75
+          { required: true, message: '请输入活动标题' },
71 76
         ]
72 77
       },
73 78
       {
74 79
         label: '活动时间',
75 80
         name: 'activityTime',
76 81
         type: FieldTypes.RangePicker,
77
-        value: dynamicData.startDate != null ?  [moment(dynamicData.startDate,'YYYY-MM-DD'),moment(dynamicData.endDate,'YYYY-MM-DD')] : null,
82
+        value: dynamicData.startDate != null ? [moment(dynamicData.startDate, 'YYYY-MM-DD'), moment(dynamicData.endDate, 'YYYY-MM-DD')] : null,
78 83
         rules: [
79
-          {required: true, message: '请选择活动时间'},
84
+          { required: true, message: '请选择活动时间' },
80 85
         ]
81 86
       },
82 87
       {
@@ -85,7 +90,7 @@ const { MonthPicker, RangePicker, WeekPicker } = DatePicker;
85 90
         type: FieldTypes.Text,
86 91
         value: dynamicData.address,
87 92
         rules: [
88
-          {required: true, message: '请输入活动地点'},
93
+          { required: true, message: '请输入活动地点' },
89 94
         ]
90 95
       },
91 96
       {
@@ -94,7 +99,7 @@ const { MonthPicker, RangePicker, WeekPicker } = DatePicker;
94 99
         type: FieldTypes.Text,
95 100
         value: dynamicData.enlistNum,
96 101
         rules: [
97
-          {required: true, message: '请输入活动人数'},
102
+          { required: true, message: '请输入活动人数' },
98 103
         ]
99 104
       },
100 105
       {
@@ -107,24 +112,24 @@ const { MonthPicker, RangePicker, WeekPicker } = DatePicker;
107 112
         label: '是否需要报名',
108 113
         name: 'isEnlist',
109 114
         render: <Radio.Group name="radiogroup">
110
-                  <Radio value={1}>是</Radio>
111
-                  <Radio value={0}>否</Radio>
112
-                </Radio.Group>,
113
-        value: dynamicData.isEnlist != null ? dynamicData.isEnlist-0 : 1,
115
+          <Radio value={1}>是</Radio>
116
+          <Radio value={0}>否</Radio>
117
+        </Radio.Group>,
118
+        value: dynamicData.isEnlist != null ? dynamicData.isEnlist - 0 : 1,
114 119
       },
115 120
       {
116 121
         label: '报名时间',
117 122
         name: 'signupTime',
118 123
         type: FieldTypes.RangePicker,
119
-        value: dynamicData.enlistStart != null ?  [moment(dynamicData.enlistStart,'YYYY-MM-DD'),moment(dynamicData.enlistEnd,'YYYY-MM-DD')] : null,
124
+        value: dynamicData.enlistStart != null ? [moment(dynamicData.enlistStart, 'YYYY-MM-DD'), moment(dynamicData.enlistEnd, 'YYYY-MM-DD')] : null,
120 125
         rules: [
121
-          {required: true, message: '请选择报名时间'},
126
+          { required: true, message: '请选择报名时间' },
122 127
         ]
123 128
       },
124 129
     ]
125
-  
126
-    const handleSubmit = val => { 
127
-      let {activityTime,signupTime, ...submitValue} = val
130
+
131
+    const handleSubmit = val => {
132
+      let { activityTime, signupTime, ...submitValue } = val
128 133
       const [startDate, endDate] = activityTime
129 134
       submitValue.startDate = moment(startDate).format('YYYY-MM-DD');
130 135
       submitValue.endDate = moment(endDate).format('YYYY-MM-DD');
@@ -132,7 +137,7 @@ const { MonthPicker, RangePicker, WeekPicker } = DatePicker;
132 137
       submitValue.enlistStart = moment(enlistStart).format('YYYY-MM-DD');
133 138
       submitValue.enlistEnd = moment(enlistEnd).format('YYYY-MM-DD');
134 139
       console.log('submit data --->', submitValue)
135
-      if(dynamicId){
140
+      if (dynamicId) {
136 141
         submitValue.dynamicId = dynamicId
137 142
         request({
138 143
           url: '/api/admin/buildingDynamic/update',
@@ -143,7 +148,7 @@ const { MonthPicker, RangePicker, WeekPicker } = DatePicker;
143 148
         }).catch((err) => {
144 149
           message.info(err.msg || err.message)
145 150
         })
146
-      }else{
151
+      } else {
147 152
         request({
148 153
           url: '/api/admin/buildingDynamic/add',
149 154
           method: 'POST',
@@ -155,16 +160,83 @@ const { MonthPicker, RangePicker, WeekPicker } = DatePicker;
155 160
         })
156 161
       }
157 162
     }
158
-    
163
+
159 164
     return <XForm onSubmit={handleSubmit} onCancel={cancelPage} fields={fields}></XForm>
160 165
   }
161
-  
166
+
162 167
   const Poster = (props) => {
163
-   return <div>Poster</div>
168
+
169
+    return <div style={{ display: 'flex' }}>
170
+      <div style={{ width: '420px', height: '900px', display: 'inline-block', marginTop: '30px' }}>
171
+        <div style={{ width: '375px', height: '785px', backgroundColor: '#fff', boxShadow: '0px 0px 16px 6px rgba(0,0,0,0.15)', position: 'relative', margin: '0 auto' }}>
172
+
173
+          <img style={{ width: '100%', height: '300px' }} src="http://img0.imgtn.bdimg.com/it/u=4246326797,2657995307&fm=26&gp=0.jpg" alt="" />
174
+
175
+          <div style={{ display: 'flex', alignItems: 'center', marginTop: '-24px' }}>
176
+            <img style={{ width: '70px', height: '70px', border: '4px solid #fff', borderRadius: '35px', marginLeft: '16px' }} src="http://img0.imgtn.bdimg.com/it/u=3463541938,2540701974&fm=26&gp=0.jpg" alt="" />
177
+            <span style={{ color: '#222', fontWeight: '600', margin: '24px 10px 0 14px', fontSize: '17px' }}>喵喵</span>
178
+            <span style={{ color: '#999', marginTop: '25px', fontSize: '17px' }}>邀您阅读</span>
179
+            <span style={{ color: '#999', margin: '25px 0 0 60px', fontSize: '17px' }}>2019.09.21</span>
180
+          </div>
181
+          <p style={{
182
+            margin: '10px 20px', fontSize: '20px', color: '#222', fontWeight: '600',
183
+            display: '-webkit-box', lineClamp: '3', height: '60px',
184
+            WebkitLineClamp: '2',
185
+            WebkitBoxOrient: 'vertical',
186
+            overflow: 'hidden',
187
+            textOverflow: 'ellipsis'
188
+          }}>破晓·内容生态下半场的版权到企业高峰论坛会议破晓·内容生态下半场的版权到企业高峰论坛活动</p>
189
+
190
+          <img src={yinhao} style={{ width: '30px', marginLeft: '10px' }} alt="" />
191
+          <p style={{
192
+            margin: '16px 20px 28px 20px', fontSize: '17px', color: '#999',
193
+            display: '-webkit-box', lineClamp: '3', height: '76px',
194
+            WebkitLineClamp: '3',
195
+            WebkitBoxOrient: 'vertical',
196
+            overflow: 'hidden',
197
+            textOverflow: 'ellipsis'
198
+          }}>活动描述:破晓·内容生态下半场的版权到企业高峰论坛活动破晓·内容生态下半场的版权到企业高峰论坛活动破晓·内容生态下半场的版权到企业高峰论坛活动</p>
199
+          <img src={PosterBottom} style={{ width: '100%' }} alt="" />
200
+        </div>
201
+        <p style={{ textAlign: 'center', fontSize: '19px', color: '#666', marginTop: '30px' }}>海报模板</p>
202
+      </div>
203
+      <div></div>
204
+    </div>
164 205
   }
165
- 
206
+
166 207
   const Share = (props) => {
167
-    return <div>Share</div>
208
+    const fields = [
209
+      {
210
+        label: '分享模板',
211
+        name: 'buildingId',
212
+        render: () => <div style={{ margin: ' 10px 20px' }}>
213
+          <p style={{ display: 'flex', alignItems: 'center', fontSize: '14px', color: '#999', margin: '0', lineHeight: '0' }}><img src={logo} style={{ width: '22px', marginRight: '10px' }} />知与行互动</p>
214
+          <p style={{ fontSize: '16px', color: '#222', fontWeight: '600', margin: '0' }}>置业V客厅 精准获客平台</p>
215
+          <img style={{ width: '200px', height: '140px' }} src="http://house.china.com.cn/nanjing/UserFiles/20171124/11070256.jpg" alt="" />
216
+        </div>,
217
+      },
218
+      {
219
+        label: '海报标题',
220
+        name: 'newsTypeName',
221
+        type: FieldTypes.Text,
222
+        value: '',
223
+        rules: [
224
+          { required: true, message: '请输入咨询名称' },
225
+        ]
226
+      },
227
+      {
228
+        label: '类型图',
229
+        name: 'newsTypeImg',
230
+        type: FieldTypes.ImageUploader,
231
+        value: 'newsTypeImg',
232
+      },
233
+    ]
234
+    const handleSubmit = (values) => {
235
+
236
+    }
237
+    return <div>
238
+      <XForm onSubmit={handleSubmit} onCancel={cancelPage} fields={fields}></XForm>
239
+    </div>
168 240
   }
169 241
 
170 242
   return (
@@ -177,13 +249,13 @@ const { MonthPicker, RangePicker, WeekPicker } = DatePicker;
177 249
         </Radio.Group>
178 250
       </div>
179 251
       <div>
180
-        { tab === 'basic' && <Basic /> }
181
-        { tab === 'poster' && <Poster /> }
182
-        { tab === 'share' && <Share /> }
252
+        {tab === 'basic' && <Basic />}
253
+        {tab === 'poster' && <Poster />}
254
+        {tab === 'share' && <Share />}
183 255
       </div>
184 256
     </div>
185 257
   );
186
- }
258
+}
187 259
 
188 260
 
189 261
 

+ 4
- 10
src/pages/building/list/add/components/base.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, Radio, Tag, Tooltip, Tabs } from 'antd';
2
+import { Form, Icon, Input, Button, DatePicker, Select, Card, Row, Col, Pagination, Alert, Radio, Tag, Tooltip, Tabs, InputNumber } from 'antd';
3 3
 import moment from 'moment';
4 4
 import request from '../../../../../utils/request';
5 5
 import apis from '../../../../../services/apis';
@@ -24,12 +24,6 @@ const formItemLayout = {
24 24
 };
25 25
 
26 26
 function AddBuilding(props) {
27
-  // eslint-disable-next-line react-hooks/rules-of-hooks
28
-  const [dataSource, setDataSource] = useState({ records: [] })
29
-
30
-  const [buildingAreaTags, setBuildingAreaTags] = useState({ tags: ['Unremovable', 'Tag 2', 'Tag 3'], inputVisible: false, inputValue: '' })
31
-
32
-
33 27
   const { getFieldDecorator } = props.form;
34 28
 
35 29
   function handleSubmit(e) {
@@ -80,7 +74,7 @@ function AddBuilding(props) {
80 74
           <Form.Item label="标签" hasFeedback>
81 75
             {getFieldDecorator('tags')(
82 76
               <Select mode="multiple" placeholder="标签" style={{ width: '1016px' }}>
83
-              <Option value="未知">未知</Option>
77
+                <Option value="未知">未知</Option>
84 78
               </Select>,
85 79
             )}
86 80
           </Form.Item>
@@ -172,7 +166,7 @@ function AddBuilding(props) {
172 166
             {getFieldDecorator('parkingRate')(<Input />)}
173 167
           </Form.Item>
174 168
           <Form.Item label="规划户数" hasFeedback>
175
-            {getFieldDecorator('familyNum')(<Input />)}
169
+            {getFieldDecorator('familyNum')(<InputNumber />)}
176 170
           </Form.Item>
177 171
           <Form.Item label="物业公司" hasFeedback>
178 172
             {getFieldDecorator('serviceCompany')(<Input />)}
@@ -187,7 +181,7 @@ function AddBuilding(props) {
187 181
             {getFieldDecorator('receivedDate')(<DatePicker />)}
188 182
           </Form.Item>
189 183
           <Form.Item label="产权年限" hasFeedback>
190
-            {getFieldDecorator('rightsYear')(<Input />)}
184
+            {getFieldDecorator('rightsYear')(<InputNumber />)}
191 185
           </Form.Item>
192 186
           <Form.Item label="预售许可证" hasFeedback>
193 187
             {getFieldDecorator('decoration')(

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

@@ -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 ModalImage from './modalImage';
8 9
 
9 10
 
10 11
 const saleType = [
@@ -32,6 +33,9 @@ function imageSet(props) {
32 33
   // eslint-disable-next-line react-hooks/rules-of-hooks
33 34
   const [data, setData] = useState([])
34 35
 
36
+  // eslint-disable-next-line react-hooks/rules-of-hooks
37
+  const [visibleData, setVisibleData] = useState({ visible: false, apartmentId: '', buildingId: '' })
38
+
35 39
   // eslint-disable-next-line react-hooks/rules-of-hooks
36 40
   useEffect(() => {
37 41
     getList()
@@ -46,7 +50,6 @@ function imageSet(props) {
46 50
   }
47 51
 
48 52
   function getList(params) {
49
-    console.log(props)
50 53
     // 网路请求
51 54
     const { url, method } = apis.building.buildingApartment
52 55
     const tempUrl = url.substring(0, url.lastIndexOf('id')).concat(props.building.buildingId)
@@ -54,7 +57,34 @@ function imageSet(props) {
54 57
     request({ url: tempUrl, method, params: { ...params } }).then(res => {
55 58
       setData(res)
56 59
     }).catch(err => {
57
-      openNotificationWithIcon('error', err)
60
+      openNotificationWithIcon('error', err.message)
61
+    })
62
+  }
63
+
64
+  /**
65
+   *打开编辑页
66
+   *
67
+   * @param {*} record
68
+   */
69
+  function showEdi(record) {
70
+    setVisibleData({ visible: true, apartmentId: record === undefined ? '' : record.apartmentId, buildingId: props.building.buildingId })
71
+  }
72
+
73
+  /**
74
+   * 删除
75
+   *
76
+   * @param {*} record
77
+   */
78
+  function deleteApartment(record) {
79
+    // 网路请求
80
+    const { url, method } = apis.building.buildingApartmentDelete
81
+    const tempUrl = url.substring(0, url.lastIndexOf('id')).concat(record.apartmentId)
82
+
83
+    request({ url: tempUrl, method }).then(res => {
84
+      getList()
85
+      openNotificationWithIcon('error', '操作成功')
86
+    }).catch(err => {
87
+      openNotificationWithIcon('error', err.message)
58 88
     })
59 89
   }
60 90
 
@@ -94,8 +124,8 @@ function imageSet(props) {
94 124
       key: 'apartmentId',
95 125
       render: (_, record) => (
96 126
         <>
97
-          <Button type="link" style={{ color: 'red' }}>编辑</Button>
98
-          <Button type="link" style={{ color: 'red' }}>删除</Button>
127
+          <Button type="link" style={{ color: 'red' }} onClick={() => showEdi(record)}>编辑</Button>
128
+          <Button type="link" style={{ color: 'red' }} onClick={() => deleteApartment(record)}>删除</Button>
99 129
         </>
100 130
       ),
101 131
     },
@@ -103,8 +133,12 @@ function imageSet(props) {
103 133
 
104 134
   return (
105 135
     <>
106
-      <Button type="primary">新增图片库</Button>
136
+      <Button type="primary" onClick={() => showEdi()}>新增图片库</Button>
107 137
       <Table dataSource={data} columns={columns} pagination={false} />
138
+
139
+      {/* 编辑页 */}
140
+      {/*  onSuccess是子组件传递事件信息  */}
141
+      <ModalImage visibleData={visibleData} key={visibleData.apartmentId} onSuccess={getList}/>
108 142
     </>
109 143
   )
110 144
 }

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

@@ -0,0 +1,223 @@
1
+import React, { useState, useEffect } from 'react';
2
+import { Form, Icon, Input, Button, DatePicker, Select, Card, Row, Col, Pagination, Alert, Table, Avatar, Radio, Modal, Descriptions, notification } from 'antd';
3
+import moment from 'moment';
4
+import request from '../../../../../utils/request';
5
+import apis from '../../../../../services/apis';
6
+import Styles from '../style.less';
7
+import ImageUpload from '../../../../../components/XForm/ImageUpload'
8
+import Wangedit from '../../../../../components/Wangedit/Wangedit'
9
+
10
+
11
+const { Option } = Select;
12
+// eslint-disable-next-line @typescript-eslint/no-unused-vars
13
+const { Meta } = Card;
14
+
15
+const { TextArea } = Input;
16
+
17
+
18
+const formItemLayout = {
19
+  labelCol: {
20
+    xs: { span: 24 },
21
+    sm: { span: 2 },
22
+  },
23
+  wrapperCol: {
24
+    xs: { span: 24 },
25
+    sm: { span: 16 },
26
+  },
27
+};
28
+
29
+const saleType = [
30
+  {
31
+    id: 1,
32
+    name: '待定',
33
+  },
34
+  {
35
+    id: 2,
36
+    name: '售罄',
37
+  },
38
+  {
39
+    id: 3,
40
+    name: '在售',
41
+  },
42
+]
43
+
44
+/**
45
+ * 图片信息
46
+ *
47
+ * @param {*} props
48
+ * @returns
49
+ */
50
+class ModalImage extends React.Component {
51
+  constructor(props) {
52
+    super(props);
53
+    this.state = {
54
+       visibleData: { visible: false, apartmentId: '', buildingId: '' },
55
+    }
56
+  }
57
+
58
+  // 挂载之后
59
+  // componentDidMount() {
60
+  //
61
+  // }
62
+
63
+  componentDidUpdate(preProps, preState) {
64
+    console.log(this.props.visibleData)
65
+    if (this.props.visibleData.visible !== preState.visibleData.visible) {
66
+      this.getById()
67
+      this.setState({ visibleData: this.props.visibleData });
68
+    }
69
+  }
70
+
71
+  // 弹框确定按钮
72
+  // eslint-disable-next-line react/sort-comp
73
+  handleOk() {
74
+    this.setState({ visibleData: { visible: false, apartmentId: '', buildingId: '' } })
75
+  }
76
+
77
+  // 弹框取消按钮
78
+  handleCancel() {
79
+    this.setState({ visibleData: { visible: false, apartmentId: '', buildingId: '' } })
80
+  }
81
+
82
+  getById(params) {
83
+    const { apartmentId } = this.props.visibleData
84
+    if (apartmentId === '' || apartmentId === undefined) {
85
+      return
86
+    }
87
+
88
+    // 网路请求
89
+    const { url, method } = apis.building.buildingApartmentGetById
90
+    const tempUrl = url.substring(0, url.lastIndexOf('id')).concat(apartmentId)
91
+
92
+    request({ url: tempUrl, method , params: { ...params } }).then(res => {
93
+      // res.img = res.buildingImgList.map((item, _) => item.url)
94
+      res.img = res.buildingImgList[0].url
95
+      this.props.form.setFieldsValue(res)
96
+    }).catch(err => {
97
+     this.openNotificationWithIcon('error', err)
98
+    })
99
+  }
100
+
101
+  openNotificationWithIcon = (type, message) => {
102
+    notification[type]({
103
+      message,
104
+      description:
105
+        '',
106
+    });
107
+  };
108
+
109
+  // 提交
110
+  handleSubmit(e) {
111
+    e.preventDefault();
112
+    this.props.form.validateFields((err, values) => {
113
+      if (!err) {
114
+        this.submitData(values)
115
+      }
116
+    });
117
+  }
118
+
119
+  submitData(data) {
120
+    // TODO 这里应该是要支持多图,但是封装的控件没有
121
+    data.img = [{ imgType: 'aparment', url: data.img, orderNo: 1 }]
122
+    data.buildingId = this.props.visibleData.buildingId;
123
+    const api = data.apartmentId !== undefined ? apis.building.buildingApartmentUpdate : apis.building.buildingApartmentAdd;
124
+
125
+    // 网路请求
126
+    request({ ...api, data: { ...data } }).then(() => {
127
+      // eslint-disable-next-line no-unused-expressions
128
+      this.openNotificationWithIcon('success', '操作成功')
129
+
130
+      // 传递父组件事件
131
+      // onSuccess() 是自定义
132
+      this.props.onSuccess()
133
+
134
+      this.handleCancel()
135
+    }).catch(err => {
136
+      // eslint-disable-next-line no-unused-expressions
137
+      this.openNotificationWithIcon('error', err)
138
+    })
139
+  }
140
+
141
+  /**
142
+   * 取消按钮
143
+   *
144
+   * @memberof ModalImage
145
+   */
146
+  closeModal() {
147
+    this.setState({ visibleData: { visible: false, apartmentId: '', buildingId: '' } })
148
+  }
149
+
150
+  render() {
151
+    const { getFieldDecorator } = this.props.form;
152
+    return (
153
+      <>
154
+        <Modal
155
+            title="图片信息"
156
+            width={1100}
157
+            destroyOnClose="true"
158
+            footer={null}
159
+            visible={this.state.visibleData.visible}
160
+            onOk={() => this.handleOk()}
161
+            onCancel={e => this.handleCancel(e)}
162
+          >
163
+            <Form {...formItemLayout} onSubmit={e => this.handleSubmit(e)}>
164
+              <Form.Item label="编号" style={{ display: 'none' }}>
165
+                  {getFieldDecorator('apartmentId')(<Input />)}
166
+              </Form.Item>
167
+              <Form.Item label="名称">
168
+                {getFieldDecorator('apartmentName')(<Input />)}
169
+              </Form.Item>
170
+              <Form.Item label="类型">
171
+                {getFieldDecorator('apartmentType')(
172
+                  <Select placeholder="类型">
173
+                    <Option value="apart">户型</Option>
174
+                    <Option value="photo">相册</Option>
175
+                  </Select>,
176
+                )}
177
+              </Form.Item>
178
+              <Form.Item label="销售状态">
179
+                {getFieldDecorator('marketStatus')(
180
+                  <Select placeholder="销售状态">
181
+                    {
182
+                      saleType.map((item, _) => <Option value={item.id}>{item.name}</Option>)
183
+                    }
184
+                  </Select>,
185
+                )}
186
+              </Form.Item>
187
+              <Form.Item label="图片">
188
+              {getFieldDecorator('img')(
189
+                <ImageUpload />,
190
+              )}
191
+              </Form.Item>
192
+              <Form.Item label="面积">
193
+                {getFieldDecorator('buildingArea')(<Input />)}
194
+              </Form.Item>
195
+              <Form.Item label="套内面积">
196
+                {getFieldDecorator('insideArea')(<Input />)}
197
+              </Form.Item>
198
+              <Form.Item label="户型总价">
199
+                {getFieldDecorator('apartmentPrice')(<Input />)}
200
+              </Form.Item>
201
+              <Form.Item label="户型简介">
202
+                {getFieldDecorator('apartmentDescription')(
203
+                  <Wangedit />,
204
+                )}
205
+              </Form.Item>
206
+              <Form.Item label="备注">
207
+                {getFieldDecorator('remark')(<TextArea rows={10} />)}
208
+              </Form.Item>
209
+              <Form.Item style={{ width: '400px', margin: 'auto', display: 'flex', justifyContent: 'space-between' }}>
210
+                <Button type="primary" htmlType="submit">保存</Button>
211
+                &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
212
+                <Button onClick={() => this.closeModal()}>取消</Button>
213
+              </Form.Item>
214
+            </Form>
215
+        </Modal>
216
+      </>
217
+    );
218
+  }
219
+}
220
+
221
+const WrappedModalImageForm = Form.create({ name: 'modalImage' })(ModalImage);
222
+
223
+export default WrappedModalImageForm

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

@@ -45,7 +45,7 @@ class EditableTagGroup extends React.Component {
45 45
         {tags.map((tag, index) => {
46 46
           const isLongTag = tag.length > 20;
47 47
           const tagElem = (
48
-            <Tag key={tag} closable={index !== 0} onClose={() => this.handleClose(tag)}>
48
+            <Tag key={tag} closable onClose={() => this.handleClose(tag)}>
49 49
               {isLongTag ? `${tag.slice(0, 20)}...` : tag}
50 50
             </Tag>
51 51
           );

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

@@ -201,12 +201,12 @@ function body(props) {
201 201
           )}
202 202
         </Form.Item>
203 203
         <Form.Item>
204
-          <Button type="primary" htmlType="submit" className={Styles.SubmitButton}>
204
+          <Button type="primary" htmlType="submit">
205 205
             搜索
206 206
           </Button>
207 207
         </Form.Item>
208 208
       </Form>
209
-      <Button type="primary" className={Styles.addButton} onClick={() => toAdd()}>
209
+      <Button type="danger" className={Styles.addButton} onClick={() => toAdd()}>
210 210
         新增楼盘
211 211
       </Button>
212 212
 

+ 0
- 1
src/pages/building/list/style.css Visa fil

@@ -10,7 +10,6 @@
10 10
   border: 1px solid #dbdbdb;
11 11
 }
12 12
 .addButton {
13
-  background: #50be00;
14 13
   border-radius: 4px;
15 14
   border: 0px;
16 15
   margin: 10px 0px;

+ 0
- 1
src/pages/building/list/style.less Visa fil

@@ -10,7 +10,6 @@
10 10
   border: 1px solid #dbdbdb;
11 11
 }
12 12
 .addButton {
13
-  background: #50be00;
14 13
   border-radius: 4px;
15 14
   border: 0px;
16 15
   margin: 10px 0px;

+ 0
- 1
src/pages/building/list/style.wxss Visa fil

@@ -10,7 +10,6 @@
10 10
   border: 1px solid #dbdbdb;
11 11
 }
12 12
 .addButton {
13
-  background: #50be00;
14 13
   border-radius: 4px;
15 14
   border: 0px;
16 15
   margin: 10px 0px;

+ 1
- 1
src/pages/channel/brokerList.jsx Visa fil

@@ -54,7 +54,7 @@ const columns = [
54 54
     dataIndex: 'sex',
55 55
     key: 'sex',
56 56
     align: 'center',
57
-    render: (text, list) => <a style={ { color: '#66B3FF' } } >{ list.sex === 1 ? '男' : '女' }</a>,
57
+    render: (text, list) => <a>{ list.sex === 1 ? '男' : '女' }</a>,
58 58
   },
59 59
   {
60 60
     title: '推荐客户',

+ 6
- 6
src/pages/channel/channelList.jsx Visa fil

@@ -59,20 +59,20 @@ const columns = [
59 59
   },
60 60
   {
61 61
     title: '经纪人数',
62
-    dataIndex: 'agentsNum',
63
-    key: 'agentsNum',
62
+    dataIndex: 'brokerCount',
63
+    key: 'brokerCount',
64 64
     align: 'center',
65 65
   },
66 66
   {
67 67
     title: '推荐客户有效',
68
-    dataIndex: 'recommendEffective',
69
-    key: 'recommendEffective',
68
+    dataIndex: 'recommendCount',
69
+    key: 'recommendCount',
70 70
     align: 'center',
71 71
   },
72 72
   {
73 73
     title: '邀请经济人',
74
-    dataIndex: 'agentsInvite',
75
-    key: 'agentsInvite',
74
+    dataIndex: 'inviteCount',
75
+    key: 'inviteCount',
76 76
     align: 'center',
77 77
   },
78 78
   {

+ 6
- 2
src/pages/channel/editChannel.jsx Visa fil

@@ -27,7 +27,6 @@ const header = props => {
27 27
 
28 28
   // 编辑
29 29
   function editChannel(data) {
30
-    alert(1111111)
31 30
       request({
32 31
         url: `/api/admin/channel/${props.location.query.id}`,
33 32
         method: 'PUT',
@@ -48,6 +47,11 @@ const header = props => {
48 47
       }
49 48
     });
50 49
   }
50
+  function go() {
51
+    router.push({
52
+      pathname: '/channel/channelList',
53
+    });
54
+  }
51 55
 
52 56
   const { getFieldDecorator } = props.form;
53 57
 
@@ -77,7 +81,7 @@ const header = props => {
77 81
           <Button type="primary" htmlType="submit">
78 82
             保存
79 83
           </Button>
80
-          <Button className={channels.formButton} onClick = {() => router.go(-1)} type="primary" htmlType="submit">
84
+          <Button className={channels.formButton} onClick = { go } type="primary" htmlType="submit">
81 85
             取消
82 86
           </Button>
83 87
         </Form.Item>

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

@@ -26,6 +26,22 @@ export default {
26 26
       method: 'GET',
27 27
       url: `${prefix}/buildingApartment/buildingId/id`,
28 28
     },
29
+    buildingApartmentGetById: {
30
+      method: 'GET',
31
+      url: `${prefix}/buildingApartment/id`,
32
+    },
33
+    buildingApartmentUpdate: {
34
+      method: 'PUT',
35
+      url: `${prefix}/buildingApartment/update`,
36
+    },
37
+    buildingApartmentAdd: {
38
+      method: 'POST',
39
+      url: `${prefix}/buildingApartment/add`,
40
+    },
41
+    buildingApartmentDelete: {
42
+      method: 'DELETE',
43
+      url: `${prefix}/apartment/deleted/id`,
44
+    },
29 45
   },
30 46
   buildingType: {
31 47
     getList: {