From ed96dab91fbac7159525fe557af2ecdd135c791d Mon Sep 17 00:00:00 2001
From: liuwh <liuwh@hugeinfo.com.cn>
Date: Mon, 23 Mar 2020 14:21:40 +0800
Subject: [PATCH] 1
---
SunshineIns/src/page/PoliceSecurity.jsx | 100 ++++++++++++++++++++++++++++++--------------------
1 files changed, 60 insertions(+), 40 deletions(-)
diff --git a/SunshineIns/src/page/PoliceSecurity.jsx b/SunshineIns/src/page/PoliceSecurity.jsx
index dbb8f47..e3cfaa5 100644
--- a/SunshineIns/src/page/PoliceSecurity.jsx
+++ b/SunshineIns/src/page/PoliceSecurity.jsx
@@ -2,6 +2,7 @@
import HeadView from '../view/HeadView';
import TableBtnView from '../view/TableBtnView';
+import CommonSearchForm from '../view/CommonSearchForm';
import { Input, Button, DatePicker, Divider, message, Popconfirm, Select, Badge, Tooltip } from 'antd';
import moment from 'moment';
import Fetch from '../fetch';
@@ -22,10 +23,10 @@
super(props);
this.state = {
data: [],
- formdata: {
+ formData: {
+ __key: Date.now(),
page: 1,
size: 10,
- type:3,
},
resetKey: Date.now(),
loading: false
@@ -37,10 +38,20 @@
this.getData();
}
- getData = () => {
- const { formdata } = this.state;
+ setFormData = data => {
+ console.log('form', data);
+ this.setState({
+ formData: data,
+ });
+ }
+
+ searchonClick = data => {
+ console.log('form', data);
+ this.setState({
+ formData: data,
+ });
this.setState({ loading: true })
- Fetch.entryQuery({ ...formdata })
+ Fetch.entryQuery({ ...data, type: 3 })
.then(res => {
console.log(res)
for (var i = 0; i < res.rows.length; i++) {
@@ -48,25 +59,40 @@
}
this.setState({
data: res.rows,
- loading: false
+ loading: false
+ });
+ });
+ }
+
+ getData = () => {
+ this.setState({ loading: true })
+ Fetch.entryQuery({ ...this.state.formData, type: 3 })
+ .then(res => {
+ console.log(res)
+ for (var i = 0; i < res.rows.length; i++) {
+ res.rows[i]['index'] = i + 1;
+ }
+ this.setState({
+ data: res.rows,
+ loading: false
});
});
}
onInputChange = ({ target: { value, name } }) => {
- this.setState(({ formdata }) => ({
- formdata: {
- ...formdata,
+ this.setState(({ formData }) => ({
+ formData: {
+ ...formData,
[name]: value
}
}))
}
showModal = (id) => {
- this.props.history.push("/entry/ExamineEdit/" + id);
+ this.props.history.push("/entry/policeSecurityEdit/" + id);
}
Seaech = () => {
- const { formdata } = this.state;
- Fetch.getSweeping(formdata)
+ const { formData } = this.state;
+ Fetch.getSweeping(formData)
.then(res => {
for (var i = 0; i < res.length; i++) {
res[i]['index'] = i + 1;
@@ -79,7 +105,7 @@
Reset = () => {
this.setState({
resetKey: Date.now(),
- formdata: {}
+ formData: {}
}, this.getData);
}
@@ -121,7 +147,7 @@
dataIndex: 'status',
key: 'status',
render: text => (
- text == 1 ? <Badge style={{ backgroundColor: '#6C757C' }} count={'待处理'} /> : text == 2 ? <Badge style={{ backgroundColor: '#F1C40F' }} count={'已受理'} /> : <Badge style={{ backgroundColor: '#2ECC71' }} count={'已反馈'} />
+ text == 1 ? <Badge style={{ backgroundColor: '#6C757C' }} count={'待处理'} /> : text == 2 ? <Badge style={{ backgroundColor: '#F1C40F' }} count={'检察院已审核'} /> : <Badge style={{ backgroundColor: '#2ECC71' }} count={'已反馈'} />
)
}, {
title: '操作',
@@ -132,35 +158,29 @@
</span>
),
}];
- const { data, loading, resetKey } = this.state;
+ const { data, loading, resetKey, formData } = this.state;
return (
<div className="app-page">
<HeadView history={this.props.history} />
- <TableBtnView key={resetKey} style={{marginTop:"20px"}}>
- <Select
- style={{ width: 200 }}
- placeholder="根据举报性质查询"
- onChange={(value) => this.onInputChange({ target: { name: 'nature', value } })}
- >
- <Option value="1">涉黑涉恶违法犯罪行为</Option>
- <Option value="2">涉黑涉恶违法犯罪保护伞</Option>
- <Option value="3">其他</Option>
- </Select>
- <Input placeholder="根据内容模糊查询" style={{ width: "200px" }} name='content' onChange={this.onInputChange} />
- <Select
- style={{ width: 200 }}
- placeholder="根据状态查询"
- onChange={(value) => this.onInputChange({ target: { name: 'status', value } })}
- >
- <Option value="2">已回复</Option>
- <Option value="1">待回复</Option>
- </Select>
-
- <DatePicker onChange={(_, value) => this.onInputChange({ target: { name: 'createTime', value } })} placeholder="根据创建时间查询" />
- <Button type="primary" onClick={this.Seaech}>查询</Button>
- <Button onClick={this.Reset}>重置</Button>
- </TableBtnView>
- <TableView columns={columns} data={data} pageSize='10' size='default' loading={loading} />
+ <div style={{ background: '#fff', margin: 20 }}>
+ <CommonSearchForm
+ {...this.props}
+ formData={formData}
+ setFormData={this.setFormData}
+ searchonClick={this.searchonClick}
+ pathName={this.props.location.pathname}
+ data={[
+ { type: 'input', name: '申请人', label: '申请人', key: 'createrName' },
+ {
+ type: 'rangePicker',
+ label: '申请时间',
+ name: JSON.stringify(['开始时间', '结束时间']),
+ key: JSON.stringify(['startTime', 'endTime']),
+ keylistName: 'rangeTimelist',
+ },
+ ]} />
+ <TableView columns={columns} data={data} pageSize='10' size='default' loading={loading} />
+ </div>
</div>
);
}
--
Gitblit v1.8.0