瀏覽代碼

Merge branch 'v3.5.1' into dev

魏超 5 年之前
父節點
當前提交
29edd84d41

+ 50
- 23
src/pages/building/list/add/components/base.jsx 查看文件

@@ -125,7 +125,7 @@ function AddBuilding(props) {
125 125
   }
126 126
 
127 127
   /**
128
-   * 把 xxx,xxx,xxx  这样的格式转换成 [{ tagName: xxx, delete: true }, { tagName: xxx, delete: true }]
128
+   * 把 xxx,xxx,xxx  这样的格式转换成 [{ tagName: xxx, delete: true, automatic: false }, { tagName: xxx, delete: true, automatic: false }]
129 129
    * @param {*} str
130 130
    * @return 如果返回 str 为空 或者 非 string,则返回 str 本身,否则返回转换成功的数组
131 131
    */
@@ -139,11 +139,11 @@ function AddBuilding(props) {
139 139
   }
140 140
 
141 141
   /**
142
-   * 把 [xxx,xxx,xxx]  这样的格式转换成 [{ tagName: xxx, delete: true }, { tagName: xxx, delete: true }]
142
+   * 把 [xxx,xxx,xxx]  这样的格式转换成 [{ tagName: xxx, delete: true, automatic: false }, { tagName: xxx, delete: true, automatic: false }]
143 143
    * @param {*} arr
144 144
    */
145 145
   function arrayTransition(arr) {
146
-    return arr.map(x => ({ tagName: x, delete: true }))
146
+    return arr.map(x => ({ tagName: x, delete: true, automatic: false }))
147 147
   }
148 148
 
149 149
   function handleSubmit(e) {
@@ -181,22 +181,22 @@ function AddBuilding(props) {
181 181
     }
182 182
 
183 183
     if (data.buildingTransport) {
184
-      data.buildingTransport = data.buildingTransport.filter(f => f.delete === true).map(x => x.tagName).join(',')
184
+      data.buildingTransport = tagFilter(data.buildingTransport, 'Transport')
185 185
     }
186 186
     if (data.buildingMall) {
187
-      data.buildingMall = data.buildingMall.filter(f => f.delete === true).map(x => x.tagName).join(',')
187
+      data.buildingMall = tagFilter(data.buildingMall, 'Mall')
188 188
     }
189 189
     if (data.buildingEdu) {
190
-      data.buildingEdu = data.buildingEdu.filter(f => f.delete === true).map(x => x.tagName).join(',')
190
+      data.buildingEdu = tagFilter(data.buildingEdu, 'Edu')
191 191
     }
192 192
     if (data.buildingHospital) {
193
-      data.buildingHospital = data.buildingHospital.filter(f => f.delete === true).map(x => x.tagName).join(',')
193
+      data.buildingHospital = tagFilter(data.buildingHospital, 'Hospital')
194 194
     }
195 195
     if (data.buildingBank) {
196
-      data.buildingBank = data.buildingBank.filter(f => f.delete === true).map(x => x.tagName).join(',')
196
+      data.buildingBank = tagFilter(data.buildingBank, 'Bank')
197 197
     }
198 198
     if (data.buildingRestaurant) {
199
-      data.buildingRestaurant = data.buildingRestaurant.filter(f => f.delete === true).map(x => x.tagName).join(',')
199
+      data.buildingRestaurant = tagFilter(data.buildingRestaurant, 'Restaurant')
200 200
     }
201 201
 
202 202
     const api = data.buildingId === undefined ? apis.building.addBuilding : apis.building.updateBuilding
@@ -209,6 +209,33 @@ function AddBuilding(props) {
209 209
     })
210 210
   }
211 211
 
212
+  /**
213
+   * 过滤 tag
214
+   * @param {*} tags 
215
+   */
216
+  function tagFilter(tags, keyType) {
217
+    console.log(tags)
218
+    if (!tags) {
219
+      return null
220
+    }
221
+
222
+    // 过滤 tag 更新 useState()
223
+
224
+    // 获取地图周边
225
+    const automaticTag = tags.filter(f => f.automatic === true).map(x => x.tagName)
226
+    const determineTag = poi.map(p => {
227
+      if (p.key === keyType) {
228
+        if (typeof p.data === 'string') {
229
+          p.data = JSON.parse(p.data).filter(f => automaticTag.includes(f.name))
230
+        }
231
+      }
232
+      return p
233
+    })
234
+
235
+    setPoi(determineTag)
236
+    return tags.filter(f => f.automatic === false).map(x => x.tagName).join(',')
237
+  }
238
+
212 239
   // 视频文件上传前 回调
213 240
   function fileUploadBeforeUpload(file, fileList) {
214 241
     // console.log('视频文件上传前 回调: ', file, fileList)
@@ -274,7 +301,7 @@ function AddBuilding(props) {
274 301
   }
275 302
 
276 303
   function setFormMapScopeTagValue(keyType, item) {
277
-    const tag = item.data.map(t => ({ tagName: t.name, delete: false }))
304
+    const tag = item.data.map(t => ({ tagName: t.name, delete: true, automatic: true }))
278 305
     switch (keyType) {
279 306
       case POI_TYPES_KETY.Transport:
280 307
         const buildingTransportValue = (stringHandleTag(buildingData.buildingTransport) || [])
@@ -345,8 +372,8 @@ function AddBuilding(props) {
345 372
               ],
346 373
             })(<Input />)}
347 374
           </Form.Item>
348
-          <Form.Item label="项目动态" >
349
-            {getFieldDecorator('dynamic')(<Input />)}
375
+          <Form.Item label="项目说明" >
376
+            {getFieldDecorator('dynamic')(<Input placeholder="项目动态等,不超过15个字" maxLength = "15"/>)}
350 377
           </Form.Item>
351 378
           <Form.Item label="物业类型" >
352 379
             {getFieldDecorator('propertyType')(
@@ -377,7 +404,7 @@ function AddBuilding(props) {
377 404
               </Select>,
378 405
             )}
379 406
           </Form.Item>
380
-          <Form.Item label="项目视频" help="视频仅支持mp4格式,建议图片尺寸:750*600,比例5:4,用于楼盘详情">
407
+          <Form.Item label="项目视频" help="视频仅支持mp4格式,建议尺寸:750*600,比例5:4,用于楼盘详情">
381 408
             {getFieldDecorator('videoUrl')(
382 409
               // disabled={fileUploadDisabled}
383 410
               <FileUpload accept=".mp4" beforeUpload={fileUploadBeforeUpload} label="上传视频" size={1} />,
@@ -417,9 +444,9 @@ function AddBuilding(props) {
417 444
           <Form.Item label="排序" >
418 445
             {getFieldDecorator('orderNo')(<Input />)}
419 446
           </Form.Item>
420
-          <Form.Item label="优惠信息" >
447
+          {/* <Form.Item label="优惠信息" >
421 448
             {getFieldDecorator('discount')(<Input />)}
422
-          </Form.Item>
449
+          </Form.Item> */}
423 450
           <Form.Item label="首页推荐" >
424 451
             {getFieldDecorator('isMain', {
425 452
               initialValue: 1,
@@ -437,11 +464,11 @@ function AddBuilding(props) {
437 464
               <SelectCity />,
438 465
             )}
439 466
           </Form.Item>
440
-          <Form.Item label="楼盘区域" >
467
+          {/* <Form.Item label="楼盘区域" >
441 468
             {getFieldDecorator('buildingArea', {
442 469
               rules: [{ required: true, message: '请输入楼盘区域' }],
443 470
             })(<Input />)}
444
-          </Form.Item>
471
+          </Form.Item> */}
445 472
           <Form.Item label="项目地址" >
446 473
             {getFieldDecorator('address', {
447 474
               rules: [{ required: true, message: '请输入项目地址' }],
@@ -518,13 +545,13 @@ function AddBuilding(props) {
518 545
           <Form.Item label="装修标准" >
519 546
             {getFieldDecorator('decoration')(<Input />)}
520 547
           </Form.Item>
521
-          <Form.Item label="交房时间" >
548
+          {/* <Form.Item label="交房时间" >
522 549
             {getFieldDecorator('receivedDate')(<DatePicker />)}
523
-          </Form.Item>
524
-          <Form.Item label="产权年限" >
550
+          </Form.Item> */}
551
+          {/* <Form.Item label="产权年限" >
525 552
             {getFieldDecorator('rightsYear')(<InputNumber />)}
526
-          </Form.Item>
527
-          <Form.Item label="预售许可证" >
553
+          </Form.Item> */}
554
+          {/* <Form.Item label="预售许可证" >
528 555
             {getFieldDecorator('preSalePermit')(
529 556
               <ImageUpload />,
530 557
             )}
@@ -533,7 +560,7 @@ function AddBuilding(props) {
533 560
             {getFieldDecorator('remark')(
534 561
               <Wangedit />,
535 562
             )}
536
-          </Form.Item>
563
+          </Form.Item> */}
537 564
           <Form.Item style={{ width: '400px', margin: 'auto', display: 'flex', justifyContent: 'space-between' }}>
538 565
             <Button type="primary" htmlType="submit">
539 566
                 确定

+ 2
- 1
src/pages/building/list/add/components/modalImage.jsx 查看文件

@@ -206,7 +206,8 @@ class ModalImage extends React.Component {
206 206
               </Form.Item>
207 207
               <Form.Item label="套内面积" help="单位 ㎡">
208 208
                 {getFieldDecorator('insideArea', {
209
-                  rules: [{ required: true, message: '请填写套内面积' },
209
+                  rules: [
210
+                    // { required: true, message: '请填写套内面积' },
210 211
                           {
211 212
                             pattern: new RegExp('^[0-9]*$'),
212 213
                             message: '只允许输入数字',

+ 6
- 2
src/pages/building/list/add/components/tags.jsx 查看文件

@@ -1,6 +1,11 @@
1 1
 import React from 'react'
2 2
 import { Tag, Input, Tooltip, Icon } from 'antd';
3 3
 
4
+/**
5
+ * 数据格式:[{ tagName: inputValue, delete: true, automatic: false }]
6
+ * @param delete 是否删除
7
+ * @param automatic 是否自动数据(比如获取地图数据就是自动的true,手动输入的是手动false)
8
+ */
4 9
 class EditableTagGroup extends React.Component {
5 10
   state = {
6 11
     inputVisible: false,
@@ -46,8 +51,7 @@ class EditableTagGroup extends React.Component {
46 51
     const tagList = tags.map(x => x.tagName)
47 52
     if (inputValue && tagList.indexOf(inputValue) === -1) {
48 53
       // 如果有新的值,就把这个值追加到 tags 原本值的后面,在通过onChange事件传递出去
49
-      console.log(tags.concat([{ tagName: inputValue, delete: true }]))
50
-      this.toggleOnChange(tags.concat([{ tagName: inputValue, delete: true }]))
54
+      this.toggleOnChange(tags.concat([{ tagName: inputValue, delete: true, automatic: false }]))
51 55
     }
52 56
 
53 57
     this.setState({

+ 10
- 10
src/pages/staff/list/editStaff.jsx 查看文件

@@ -174,16 +174,16 @@ const Edit = (props) => {
174 174
     //   </Select>,
175 175
     //   value: userData.taTags,
176 176
     // },
177
-    {
178
-      label: '地址',
179
-      name: 'address',
180
-      type: FieldTypes.Text,
181
-      placeholder: '请输入地址',
182
-      value: userData.address,
183
-      rules: [
184
-        { required: true, message: '请输入地址' },
185
-      ]
186
-    },
177
+    // {
178
+    //   label: '地址',
179
+    //   name: 'address',
180
+    //   type: FieldTypes.Text,
181
+    //   placeholder: '请输入地址',
182
+    //   value: userData.address,
183
+    //   rules: [
184
+    //     { required: true, message: '请输入地址' },
185
+    //   ]
186
+    // },
187 187
     {
188 188
       label: '授权项目',
189 189
       name: 'buildingId',