Browse Source

修复bug

魏熙美 5 years ago
parent
commit
a4bb76b649

+ 1
- 1
src/components/SelectButton/CitySelect.jsx View File

@@ -30,7 +30,7 @@ const CitySelect = (props) => {
30 30
   }
31 31
 
32 32
   return (
33
-      <Select value={props.value} style={{ width: '180px' }} placeholder="请选择城市" onChange={props.onChange}>
33
+      <Select showSearch value={props.value} style={{ width: '180px' }} placeholder="请选择城市" onChange={props.onChange}>
34 34
           {data.map(city => (
35 35
             <Option key={city.id} value={city.id}>{city.name}</Option>
36 36
           ))}

+ 18
- 6
src/pages/building/list/add/components/base.jsx View File

@@ -60,6 +60,9 @@ function AddBuilding(props) {
60 60
       if (res.receivedDate !== null) {
61 61
         res.receivedDate = moment(res.receivedDate)
62 62
       }
63
+      if (res.buildingTag !== null) {
64
+        res.tag = res.buildingTag.map((item, _) => item.tagName)
65
+      }
63 66
 
64 67
       res.avatarImage = res.buildingImg.map(item => item.url)
65 68
       props.form.setFieldsValue(res)
@@ -80,6 +83,9 @@ function AddBuilding(props) {
80 83
     data.receivedDate = moment(data.receivedDate, 'yyyy-MM-dd HH:mm:ss')
81 84
     // 项目主图
82 85
     data.img = data.avatarImage && data.avatarImage.map((item, index) => ({ imgType: 'banner', url: item, orderNo: index + 1 }))
86
+    if (data.tag) {
87
+      data.tag = data.tag.map((item, _) => ({ tagName: item }))
88
+    }
83 89
 
84 90
     const api = data.buildingId === undefined ? apis.building.addBuilding : apis.building.updateBuilding
85 91
     request({ ...api, data: { ...data } }).then(() => {
@@ -108,7 +114,7 @@ function AddBuilding(props) {
108 114
             {getFieldDecorator('buildingProjectType')(<BudildingProjectType />)}
109 115
           </Form.Item>
110 116
           <Form.Item label="均价" hasFeedback>
111
-            {getFieldDecorator('price')(<Input />)}
117
+            {getFieldDecorator('price')(<Input type="number" style={{ width: '210px' }}/>)}m²/元
112 118
           </Form.Item>
113 119
           <Form.Item label="开盘时间"  hasFeedback>
114 120
             {getFieldDecorator('openingDate')(<DatePicker format="YYYY/MM/DD" />)}
@@ -128,12 +134,18 @@ function AddBuilding(props) {
128 134
             )}
129 135
           </Form.Item>
130 136
           <Form.Item label="销售状态" hasFeedback>
131
-            {getFieldDecorator('marketStatus')(<Input />)}
137
+            {getFieldDecorator('marketStatus')(
138
+              <Select placeholder="销售状态" style={{ width: '1016px' }}>
139
+                <Option value="待定">待定</Option>
140
+                <Option value="在售">在售</Option>
141
+                <Option value="售完">售完</Option>
142
+              </Select>,
143
+            )}
132 144
           </Form.Item>
133
-          <Form.Item label="标签" hasFeedback style={{ display: 'none' }}>
134
-            {getFieldDecorator('tags')(
135
-              <Select mode="multiple" placeholder="标签" style={{ width: '1016px' }}>
136
-                <Option value="未知">未知</Option>
145
+          <Form.Item label="项目标签" hasFeedback>
146
+            {getFieldDecorator('tag')(
147
+              <Select mode="tags" placeholder="输入后选中" style={{ width: '1016px' }}>
148
+                
137 149
               </Select>,
138 150
             )}
139 151
           </Form.Item>

+ 2
- 2
src/pages/building/list/add/components/imageSet.jsx View File

@@ -94,7 +94,7 @@ function imageSet(props) {
94 94
 
95 95
   const columns = [
96 96
     {
97
-      title: '名称',
97
+      title: '户型名称',
98 98
       dataIndex: 'apartmentName',
99 99
       key: 'apartmentName',
100 100
     },
@@ -136,7 +136,7 @@ function imageSet(props) {
136 136
 
137 137
   return (
138 138
     <>
139
-      <Button type="primary" onClick={() => showEdi()}>新增户型</Button>
139
+      <Button type="primary" onClick={() => showEdi()}>新增户型</Button>
140 140
       <Table dataSource={data} columns={columns} pagination={false} rowKey="imageSet" />
141 141
 
142 142
       {/* 编辑页 */}

+ 1
- 1
src/pages/building/list/add/index.jsx View File

@@ -49,7 +49,7 @@ function AddBuilding(props) {
49 49
           props.location.query.id &&
50 50
           (
51 51
             <>
52
-              <Radio.Button value="image">图片</Radio.Button>
52
+              <Radio.Button value="image">户型库</Radio.Button>
53 53
               <Radio.Button value="poster">海报图片</Radio.Button>
54 54
               <Radio.Button value="share">分享设置</Radio.Button>
55 55
             </>