ソースを参照

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

魏超 5 年 前
コミット
1ceb690bf9
共有2 個のファイルを変更した15 個の追加2 個の削除を含む
  1. 12
    0
      src/components/Wangedit/Wangedit.jsx
  2. 3
    2
      src/pages/building/list/add/components/buildingProjectType.jsx

+ 12
- 0
src/components/Wangedit/Wangedit.jsx ファイルの表示

55
       }
55
       }
56
     }
56
     }
57
   }
57
   }
58
+
59
+  /**
60
+   *增加这个 shouldComponentUpdate 生命函数
61
+    处理自动聚焦到富文本上
62
+   *
63
+   * @param {*} nextProps
64
+   * @returns
65
+   * @memberof Wangedit
66
+   */
67
+  shouldComponentUpdate(nextProps) {
68
+    return nextProps.value !== this.editor.txt.html()
69
+  }
58
 }
70
 }
59
 
71
 
60
 export default Wangedit
72
 export default Wangedit

+ 3
- 2
src/pages/building/list/add/components/buildingProjectType.jsx ファイルの表示

61
           position: 'relative',
61
           position: 'relative',
62
           border: '1px solid #eee',
62
           border: '1px solid #eee',
63
           borderRadius: '4px',
63
           borderRadius: '4px',
64
-          marginTop:'16px'
64
+          marginTop: '16px',
65
         }}>
65
         }}>
66
 
66
 
67
           <p style={{ padding: '20px', borderBottom: '1px solid #eee' }}>{this.props.type.buildingTypeName || ''}  <Button type="link" style={{ position: 'absolute', right: '16px' }} icon="close" onClick={() => this.close()} /></p>
67
           <p style={{ padding: '20px', borderBottom: '1px solid #eee' }}>{this.props.type.buildingTypeName || ''}  <Button type="link" style={{ position: 'absolute', right: '16px' }} icon="close" onClick={() => this.close()} /></p>
140
     const updateProjectDate = this.updateProjectType(tempDate)
140
     const updateProjectDate = this.updateProjectType(tempDate)
141
     console.log('updateProjectDate: ', updateProjectDate)
141
     console.log('updateProjectDate: ', updateProjectDate)
142
     this.setState({ data: updateProjectDate })
142
     this.setState({ data: updateProjectDate })
143
+    this.setState({ defaultCheckboxValue: updateProjectDate.map(item => item.buildingTypeId) })
143
   }
144
   }
144
 
145
 
145
   onClose = e => {
146
   onClose = e => {
239
           onOk={this.handleOk}
240
           onOk={this.handleOk}
240
           onCancel={this.handleCancel}
241
           onCancel={this.handleCancel}
241
         >
242
         >
242
-          <Checkbox.Group options={this.state.projectType.map(item => ({ label: item.buildingTypeName, value: item.buildingTypeId }))} defaultValue={this.state.defaultCheckboxValue} onChange={e => this.onCheckboxChange(e)} />
243
+          <Checkbox.Group options={this.state.projectType.map(item => ({ label: item.buildingTypeName, value: item.buildingTypeId }))} onChange={e => this.onCheckboxChange(e)} value={this.state.defaultCheckboxValue}/>
243
         </Modal>
244
         </Modal>
244
         <Row type="flex" justify="space-between">
245
         <Row type="flex" justify="space-between">
245
           {
246
           {