傅行帆 5 лет назад
Родитель
Сommit
a04486ce9c
2 измененных файлов: 55 добавлений и 22 удалений
  1. 27
    11
      src/pages/statistical/building/detail.jsx
  2. 28
    11
      src/pages/statistical/building/index.jsx

+ 27
- 11
src/pages/statistical/building/detail.jsx Просмотреть файл

109
       })
109
       })
110
   }
110
   }
111
 
111
 
112
+   //重置搜索
113
+  handleReset = () => {
114
+    daterange = []
115
+    this.props.form.resetFields();
116
+  }
117
+
112
   render() {
118
   render() {
113
     const columns = [
119
     const columns = [
114
         {
120
         {
142
         },
148
         },
143
       ];
149
       ];
144
 
150
 
151
+    const { getFieldDecorator } = this.props.form;
145
     return (
152
     return (
146
     <div>
153
     <div>
154
+      <Form layout="inline">
147
       <Radio.Group buttonStyle="solid" defaultValue="a">
155
       <Radio.Group buttonStyle="solid" defaultValue="a">
148
           <Radio.Button value="c" onClick={() => this.getDataOf(0)}>今日</Radio.Button>
156
           <Radio.Button value="c" onClick={() => this.getDataOf(0)}>今日</Radio.Button>
149
           <Radio.Button value="a" onClick={() => this.getDataOf(7)}>最近7天</Radio.Button>
157
           <Radio.Button value="a" onClick={() => this.getDataOf(7)}>最近7天</Radio.Button>
150
           <Radio.Button value="b" onClick={() => this.getDataOf(30)}>最近1月</Radio.Button>
158
           <Radio.Button value="b" onClick={() => this.getDataOf(30)}>最近1月</Radio.Button>
151
         </Radio.Group>
159
         </Radio.Group>
152
-        <RangePicker
153
-          style={{ paddingLeft: '30px' }}
154
-          ranges={{
155
-            Today: [moment(), moment()],
156
-            'This Month': [moment().startOf('month'), moment().endOf('month')],
157
-          }}
158
-          onChange={(_dates, dateStrings) => this.onChangetime(_dates, dateStrings)}
159
-        />
160
+        <Form.Item>
161
+        {getFieldDecorator('time', {
162
+            initialValue: [],
163
+            rules: [{ required: true, message: '请上传封面图1' }],
164
+        })(
165
+          <RangePicker
166
+            style={{ paddingLeft: '30px' }}
167
+            ranges={{
168
+              Today: [moment(), moment()],
169
+              'This Month': [moment().startOf('month'), moment().endOf('month')],
170
+            }}
171
+            onChange={(_dates, dateStrings) => this.onChangetime(_dates, dateStrings)}
172
+          />
173
+        )}
174
+        </Form.Item>
160
         <Button type="primary" htmlType="submit" style={{ marginLeft: '30px' }} onClick={() => this.datalist()}>
175
         <Button type="primary" htmlType="submit" style={{ marginLeft: '30px' }} onClick={() => this.datalist()}>
161
           查询
176
           查询
162
         </Button>
177
         </Button>
163
-        <Button type="danger" onClick={() => router.go(-1)} style={{ marginBottom: '18px', marginLeft: '30px' }}>重置</Button>
164
-
178
+        <Button type="danger" onClick={this.handleReset} style={{ marginBottom: '18px', marginLeft: '30px' }}>重置</Button>
179
+        </Form>
165
         <StatsChartLine title={this.state.buildingName} data={this.state.barData} />
180
         <StatsChartLine title={this.state.buildingName} data={this.state.barData} />
166
         <Row>
181
         <Row>
167
             <Col span={22}>
182
             <Col span={22}>
179
     )
194
     )
180
   }
195
   }
181
 }
196
 }
197
+const WrappedHeader = Form.create({ name: 'record' })(buildingDetailStats);
182
 
198
 
183
-export default buildingDetailStats
199
+export default WrappedHeader

+ 28
- 11
src/pages/statistical/building/index.jsx Просмотреть файл

125
     });
125
     });
126
   }
126
   }
127
 
127
 
128
+  //重置搜索
129
+  handleReset = () => {
130
+    daterange = []
131
+    this.props.form.resetFields();
132
+  }
133
+
128
   render() {
134
   render() {
129
     const columns = [
135
     const columns = [
130
         {
136
         {
170
         },
176
         },
171
       ];
177
       ];
172
 
178
 
179
+    const { getFieldDecorator } = this.props.form;
173
     return (
180
     return (
174
     <div>
181
     <div>
182
+      <Form layout="inline">
175
       <Radio.Group buttonStyle="solid" defaultValue="a">
183
       <Radio.Group buttonStyle="solid" defaultValue="a">
176
           <Radio.Button value="c" onClick={() => this.getDataOf(0)}>今日</Radio.Button>
184
           <Radio.Button value="c" onClick={() => this.getDataOf(0)}>今日</Radio.Button>
177
           <Radio.Button value="a" onClick={() => this.getDataOf(7)}>最近7天</Radio.Button>
185
           <Radio.Button value="a" onClick={() => this.getDataOf(7)}>最近7天</Radio.Button>
178
           <Radio.Button value="b" onClick={() => this.getDataOf(30)}>最近1月</Radio.Button>
186
           <Radio.Button value="b" onClick={() => this.getDataOf(30)}>最近1月</Radio.Button>
179
         </Radio.Group>
187
         </Radio.Group>
180
-        <RangePicker
181
-          style={{ paddingLeft: '30px' }}
182
-          ranges={{
183
-            Today: [moment(), moment()],
184
-            'This Month': [moment().startOf('month'), moment().endOf('month')],
185
-          }}
186
-          onChange={(_dates, dateStrings) => this.onChangetime(_dates, dateStrings)}
187
-        />
188
+        <Form.Item>
189
+        {getFieldDecorator('time', {
190
+            initialValue: [],
191
+            rules: [{ required: true, message: '请上传封面图1' }],
192
+        })(
193
+          <RangePicker
194
+              style={{ paddingLeft: '30px' }}
195
+              ranges={{
196
+                Today: [moment(), moment()],
197
+                'This Month': [moment().startOf('month'), moment().endOf('month')],
198
+              }}
199
+              onChange={(_dates, dateStrings) => this.onChangetime(_dates, dateStrings)}
200
+            />
201
+        )}
202
+        </Form.Item>
188
         <Button type="primary" htmlType="submit" style={{ marginLeft: '30px' }} onClick={() => this.datalist()}>
203
         <Button type="primary" htmlType="submit" style={{ marginLeft: '30px' }} onClick={() => this.datalist()}>
189
           查询
204
           查询
190
         </Button>
205
         </Button>
191
-        <Button type="danger" onClick={() => router.go(-1)} style={{ marginBottom: '18px', marginLeft: '30px' }}>重置</Button>
192
-
206
+        <Button type="danger" onClick={this.handleReset} style={{ marginBottom: '18px', marginLeft: '30px' }}>重置</Button>
207
+        </Form>
193
         <Row>
208
         <Row>
194
             <Col span={12}>
209
             <Col span={12}>
195
                 <StatsChart title="项目公客排行" data={this.state.barData.gkBarMap} />
210
                 <StatsChart title="项目公客排行" data={this.state.barData.gkBarMap} />
225
   }
240
   }
226
 }
241
 }
227
 
242
 
228
-export default buildingStats
243
+const WrappedHeader = Form.create({ name: 'record' })(buildingStats);
244
+
245
+export default WrappedHeader