4 files added
16 files modified
| | |
| | | import fetch from './_fetch'; |
| | | import { message } from 'antd'; |
| | | export default () => fetch(`api/activity/finds?`) |
| | | export default ({ activityType, activityStatus, startTime, endTime }) => fetch(`api/activity/finds?activityType=${activityType||''}&activityStatus=${activityStatus || ''}&startTime=${startTime || ''}&endTime=${endTime || ''}`) |
| | | .then( |
| | | json => json.data |
| | | ) |
| | |
| | | import fetch from './_fetch'; |
| | | import { message } from 'antd'; |
| | | export default ({page,size, type}) => fetch(`api/entry/query?rows=${size}&page=${page}&type=${type}`) |
| | | export default ({page,size, type, status,startTime,endTime,createrName}) => fetch(`api/entry/query?rows=${size||''}&page=${page||''}&type=${type||''}&status=${status||''}&startTime=${startTime||''}&endTime=${endTime||''}&createrName=${createrName||''}`) |
| | | .then( |
| | | json => json |
| | | ) |
| | |
| | | import entryQuery from './entryQuery'; |
| | | import attachmentDownload from './attachmentDownload'; |
| | | import entryAudit from './entryAudit'; |
| | | import signinfo from './signinfo'; |
| | | |
| | | export default { |
| | | domain, |
| | |
| | | entrySave, |
| | | entryQuery, |
| | | attachmentDownload, |
| | | entryAudit |
| | | entryAudit, |
| | | signinfo |
| | | }; |
New file |
| | |
| | | import fetch from './_fetch'; |
| | | import { message } from 'antd'; |
| | | |
| | | export default (id) => fetch(`/api/activity/signInfo?id=${id}`) |
| | | .catch(error => message.error('信息加载失败,请联系管理员', 2)); |
| | |
| | | import fetch from './_fetch'; |
| | | import { message } from 'antd'; |
| | | export default ({page,size}) => fetch(`api/social/query?size=${size}&page=${page}`) |
| | | export default ({page,size, taskType, status, startTime,endTime}) => fetch(`api/social/query?size=${size}&page=${page}&taskType=${taskType}&status=${status}&startTime=${startTime}&endTime=${endTime}`) |
| | | .then( |
| | | json => json |
| | | ) |
| | |
| | | <Switch> |
| | | <Route path="/bus/attachment/:busId/:attachmentId" component={AttTree} /> |
| | | <Route path="/bus/attachment/:busId" component={AttTree} /> |
| | | <Route path='/questionnaire/newly' component={null} /> |
| | | <Route path='/signIn/:id' component={null} /> |
| | | <Route component={Menu} /> |
| | | </Switch> |
| | | <Switch> |
| | |
| | | /** |
| | | * 徐祥健<xuxj@hugeinfo.com.cn> |
| | | * 2018年8月28日 10:41 |
| | | * |
| | | */ |
| | | |
| | | |
| | | import React from 'react'; |
| | | |
| | | import HeadView from '../view/HeadView'; |
| | | import TableBtnView from '../view/TableBtnView'; |
| | | import { Divider, Modal, message, Tooltip, Progress } from 'antd' |
| | | import CommonSearchForm from '../view/CommonSearchForm'; |
| | | import { Divider, Modal, message, Button, Progress } from 'antd' |
| | | import moment from 'moment' |
| | | import Fetch from '../fetch'; |
| | | import { domain } from '../fetch/_fetch'; |
| | |
| | | return "普法预约"; |
| | | } |
| | | } |
| | | |
| | | const taskNodeIds = { |
| | | 'act_1': '南检活动', |
| | | 'act_2': '法治培训', |
| | | 'act_3': '普法预约', |
| | | } |
| | | |
| | | const activityTypeList = [ |
| | | 'act_1', |
| | | 'act_2', |
| | | 'act_3', |
| | | ] |
| | | |
| | | const activityStatusIds = { |
| | | 0: '未发布', |
| | | 1: '报名中', |
| | | 2: '活动中', |
| | | 3: '已结束', |
| | | 100: '已摇号', |
| | | } |
| | | |
| | | const activityStatusList = [ |
| | | 0, |
| | | 1, |
| | | 2, |
| | | 3, |
| | | 100, |
| | | ] |
| | | export default class ActiveManage extends React.Component { |
| | | constructor(props) { |
| | | super(props); |
| | | this.state = { |
| | | data: [], |
| | | resetKey: Date.now() |
| | | resetKey: Date.now(), |
| | | loading:false, |
| | | formData: { |
| | | __key: Date.now(), |
| | | activityType: '', |
| | | activityStatus: '', |
| | | startTime: '', |
| | | endTime: '', |
| | | } |
| | | }; |
| | | } |
| | | |
| | |
| | | document.title = '活动管理'; |
| | | this.getData(); |
| | | } |
| | | |
| | | setFormData = data => { |
| | | console.log('form', data); |
| | | this.setState({ |
| | | formData: data, |
| | | }); |
| | | } |
| | | |
| | | searchonClick = data => { |
| | | console.log('form', data); |
| | | this.setState({ |
| | | formData: data, |
| | | }); |
| | | this.getData(); |
| | | } |
| | | |
| | | getData = () => { |
| | | // this.setState({ |
| | | // data: [] |
| | | // }); |
| | | Fetch.activeManage() |
| | | this.setState({loading:true}) |
| | | Fetch.activeManage({ ...this.state.formData }) |
| | | .then(res => { |
| | | for (var i = 0; i < res.length; i++) { |
| | | res[i]['index'] = i + 1; |
| | | } |
| | | this.setState({ |
| | | data: res |
| | | data: res, |
| | | loading:false |
| | | }); |
| | | }); |
| | | } |
| | |
| | | this.props.history.push("/activeManageEdit/" + id); |
| | | } |
| | | |
| | | signIn= (id) => { |
| | | signIn = (id) => { |
| | | window.open('index.html#/signIn/' + id); |
| | | } |
| | | |
| | |
| | | <Divider type="vertical" /> |
| | | <label className='theme-color' onClick={() => this.deleteItems(record.id)} style={{ cursor: 'pointer' }}>删除</label> |
| | | </span> |
| | | : |
| | | record.status == 2 ? |
| | | : |
| | | record.status == 2 ? |
| | | <span> |
| | | <label className='theme-color' onClick={() => this.showModal(record.id)} style={{ cursor: 'pointer' }}>查看</label> |
| | | <Divider type="vertical" /> |
| | | <label className='theme-color' onClick={() => this.signIn(record.id)} style={{ cursor: 'pointer' }}>签到上墙</label> |
| | | </span> |
| | | : |
| | | <span><label className='theme-color' onClick={() => this.showModal(record.id)} style={{ cursor: 'pointer' }}>查看</label></span> |
| | | : |
| | | <span><label className='theme-color' onClick={() => this.showModal(record.id)} style={{ cursor: 'pointer' }}>查看</label></span> |
| | | |
| | | ) |
| | | ), |
| | | }]; |
| | | const { data, resetKey } = this.state; |
| | | const { data, resetKey, formData, loading } = this.state; |
| | | return ( |
| | | <div className="app-page"> |
| | | <div className="app-page" > |
| | | <HeadView history={this.props.history} /> |
| | | <TableBtnView key={-resetKey} type="infoManage" name='活动一览' btnName='活动发布' onClick={() => this.showModal('new')}> |
| | | </TableBtnView> |
| | | <TableView columns={columns} data={data} pageSize='10' size='default' /> |
| | | <div style={{ marginLeft: '90%', marginBottom: '20px', marginTop: '20px' }}> |
| | | <Button type="primary" size='large' onClick={() => this.showModal('new')}>活动发布</Button> |
| | | </div> |
| | | {/* <TableBtnView key={-resetKey} type="infoManage" name='活动一览' btnName='活动发布' onClick={() => this.showModal('new')}> |
| | | </TableBtnView> */} |
| | | <div style={{ background: '#fff', margin: 20 }}> |
| | | <CommonSearchForm |
| | | {...this.props} |
| | | formData={formData} |
| | | setFormData={this.setFormData} |
| | | searchonClick={this.searchonClick} |
| | | pathName={this.props.location.pathname} |
| | | data={[ |
| | | { |
| | | type: 'select', name: '活动类型', label: '活动类型', key: 'activityType', list: activityTypeList.map(key => ({ |
| | | id: key, |
| | | name: taskNodeIds[key] |
| | | })), |
| | | }, |
| | | { |
| | | type: 'select', name: '活动状态', label: '活动状态', key: 'activityStatus', list: activityStatusList.map(key => ({ |
| | | id: key, |
| | | name: activityStatusIds[key] |
| | | })), |
| | | }, |
| | | { |
| | | 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> |
| | | ); |
| | | } |
| | |
| | | */ |
| | | import React from 'react'; |
| | | |
| | | import { Row, Col, Input, DatePicker, Button, Modal, Upload, Icon, message, Divider, TimePicker, Badge, Select, Popconfirm, Spin } from 'antd'; |
| | | import { Row, Col, Input, DatePicker, Button, Modal, Upload, Icon, message, Divider, TimePicker, Badge, Select, Popconfirm, Spin, Breadcrumb } from 'antd'; |
| | | const { TextArea } = Input; |
| | | import HeadView from '../view/HeadView'; |
| | | import BusDetailView from '../view/BusDetailView'; |
| | | import TableView from '../view/TableView'; |
| | | import ImageBoxView from '../view/ImageBoxView' |
| | | // 引入编辑器以及编辑器样式 |
| | | import BraftEditor from 'braft-editor' |
| | | import 'braft-editor/dist/index.css' |
| | | import Fetch from '../fetch'; |
| | | import moment from 'moment'; |
| | | const format = 'HH:mm'; |
| | |
| | | disabled: true, |
| | | status: '', |
| | | loading: false, |
| | | code: '', |
| | | editorState: BraftEditor.createEditorState(null) |
| | | }; |
| | | } |
| | | |
| | |
| | | if (endTime == null) { |
| | | endTime = Date.now(); |
| | | } |
| | | console.log |
| | | this.setState({ |
| | | savedate: { |
| | | ...res.activity, |
| | |
| | | endHour: moment(endTime).format(format), |
| | | activityType: res.activity.activityType || 'act_1', |
| | | }, |
| | | code: res.code || '', |
| | | editorState: BraftEditor.createEditorState(res.activity.course), |
| | | activityType: res.activity.activityType || 'act_1', |
| | | status: res.activity.activityStatus || '', |
| | | disabled: res.activity.activityStatus == 0 ? false : true, |
| | |
| | | ) |
| | | } |
| | | |
| | | uploadFn = (param) => { |
| | | |
| | | const serverURL = domain + 'api/v1/attachment/upload' |
| | | const xhr = new XMLHttpRequest |
| | | const fd = new FormData() |
| | | const successFn = (response) => { |
| | | // 假设服务端直接返回文件上传后的地址 |
| | | // 上传成功后调用param.success并传入上传后的文件地址 |
| | | //Pz |
| | | const res = JSON.parse(xhr.responseText); |
| | | param.success({ |
| | | url: domain + 'api/v1/attachment/image/' + res[0].id, |
| | | meta: { |
| | | id: res[0].id, |
| | | title: res[0].name, |
| | | alt: res[0].name, |
| | | loop: true, // 指定音视频是否循环播放 |
| | | autoPlay: true, // 指定音视频是否自动播放 |
| | | controls: true, // 指定音视频是否显示控制栏 |
| | | poster: domain + 'api/v1/attachment/image/' + res[0].id, // 指定视频播放器的封面 |
| | | } |
| | | }) |
| | | } |
| | | |
| | | |
| | | const progressFn = (event) => { |
| | | // 上传进度发生变化时调用param.progress |
| | | param.progress(event.loaded / event.total * 100) |
| | | } |
| | | |
| | | const errorFn = (response) => { |
| | | // 上传发生错误时调用param.error |
| | | param.error({ |
| | | msg: 'unable to upload.' |
| | | }) |
| | | } |
| | | xhr.upload.addEventListener("progress", progressFn, false) |
| | | xhr.addEventListener("load", successFn, false) |
| | | xhr.addEventListener("error", errorFn, false) |
| | | xhr.addEventListener("abort", errorFn, false) |
| | | fd.append('file', param.file) |
| | | xhr.open('POST', serverURL, true) |
| | | xhr.send(fd) |
| | | } |
| | | |
| | | handleEditorChange = (editorState) => { |
| | | this.setState({ editorState }) |
| | | } |
| | | |
| | | submitContent = () => { |
| | | // 在编辑器获得焦点时按下ctrl+s会执行此方法 |
| | | // 编辑器内容提交到服务端之前,可直接调用editorState.toHTML()来获取HTML格式的内容 |
| | | const htmlContent = this.state.editorState.toHTML() |
| | | this.setState(({ savedate }) => ({ |
| | | savedate: { |
| | | ...savedate, |
| | | course: htmlContent |
| | | } |
| | | })) |
| | | } |
| | | |
| | | handleCancel = () => this.setState({ previewVisible: false }) |
| | | render() { |
| | | const { savedate, previewVisible, previewImage, fileList, dateSource, hitList, activityType, disabled, loading } = this.state; |
| | | const { savedate, previewVisible, previewImage,editorState, fileList, dateSource, code, hitList, activityType, disabled, loading } = this.state; |
| | | console.log('disabled', disabled) |
| | | const props = { |
| | | action: domain + 'api/v1/attachment/materials?entityId=' + savedate.id, |
| | |
| | | <div className="app-page"> |
| | | <Spin spinning={loading}> |
| | | <HeadView history={this.props.history} /> |
| | | <Breadcrumb style={{ padding: '20px' }}> |
| | | <Breadcrumb.Item><a href="index.html#/activeManage">活动管理</a></Breadcrumb.Item> |
| | | <Breadcrumb.Item>活动发布</Breadcrumb.Item> |
| | | </Breadcrumb> |
| | | <BusDetailView type='活动发布' > |
| | | <div style={divStyle}> |
| | | <Row type="flex" align='middle' justify="space-around"> |
| | |
| | | </div> |
| | | |
| | | { |
| | | code && <div style={divStyle}> |
| | | <Row type="flex" align='middle' justify="space-around"> |
| | | <Col span={6} pull={0} style={{ textAlign: 'center' }}><span>活动二维码</span></Col> |
| | | <Col span={18} push={0} ><img style={{ width: '150px', height: '150px' }} src={`data:image/png;base64,${code}`} /></Col> |
| | | </Row> |
| | | </div> |
| | | |
| | | } |
| | | |
| | | <div style={divStyle}> |
| | | <Row type="flex" align='top' justify="space-around"> |
| | | <Col span={6} pull={0} style={{ textAlign: 'center' }}><span>活动进程</span></Col> |
| | | <Col span={18} push={0} style={{ border: 'solid 1px rgba(0, 0, 0, 0.25)', borderRadius: '5PX' }} > |
| | | <BraftEditor |
| | | value={editorState} |
| | | disabled={disabled} |
| | | placeholder='请输入活动进程' |
| | | media={{ |
| | | allowPasteImage: true, // 是否允许直接粘贴剪贴板图片(例如QQ截图等)到编辑器 |
| | | image: true, // 开启图片插入功能 |
| | | video: false, // 开启视频插入功能 |
| | | audio: false, // 开启音频插入功能 |
| | | uploadFn: this.uploadFn |
| | | }} |
| | | excludeControls={['emoji']} |
| | | onChange={this.handleEditorChange} |
| | | onSave={this.submitContent} |
| | | onBlur={this.submitContent} |
| | | /> |
| | | </Col> |
| | | </Row> |
| | | </div> |
| | | |
| | | { |
| | | activityType == 'act_1' ? (dateSource.length > 0 ? |
| | | <div style={divStyle}> |
| | | <Divider orientation="left" style={{ margin: '20px', width: '97%' }}>报名人员信息</Divider> |
| | |
| | | |
| | | import HeadView from '../view/HeadView'; |
| | | import TableBtnView from '../view/TableBtnView'; |
| | | import CommonSearchForm from '../view/CommonSearchForm'; |
| | | import TableView from '../view/TableView'; |
| | | import { Input, Button, DatePicker, Divider, message, Popconfirm, Select, Badge, Tooltip } from 'antd'; |
| | | import moment from 'moment'; |
| | | import Fetch from '../fetch'; |
| | | import TableView from '../view/TableView'; |
| | | const Option = Select.Option; |
| | | function typeOfName(type) { |
| | | switch (type) { |
| | |
| | | return "已反馈"; |
| | | } |
| | | } |
| | | |
| | | const activityStatusIds = { |
| | | 1: '待处理', |
| | | 2: '已受理', |
| | | 3: '已反馈', |
| | | } |
| | | |
| | | const activityStatusList = [ |
| | | 1, |
| | | 2, |
| | | 3, |
| | | ] |
| | | export default class ApplyFor extends React.Component { |
| | | constructor(props) { |
| | | super(props); |
| | | this.state = { |
| | | data: [], |
| | | formdata: { |
| | | formData: { |
| | | __key: Date.now(), |
| | | page: 1, |
| | | size: 10, |
| | | type:1, |
| | | }, |
| | | resetKey: Date.now(), |
| | | loading: false |
| | |
| | | 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:1 }) |
| | | .then(res => { |
| | | console.log(res) |
| | | for (var i = 0; i < res.rows.length; i++) { |
| | |
| | | } |
| | | this.setState({ |
| | | data: res.rows, |
| | | loading:false |
| | | loading: false |
| | | }); |
| | | }); |
| | | } |
| | | |
| | | getData = () => { |
| | | this.setState({ loading: true }) |
| | | Fetch.entryQuery({ ...this.state.formData,type:1 }) |
| | | .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 |
| | | }); |
| | | }); |
| | | } |
| | |
| | | </span> |
| | | ), |
| | | }]; |
| | | const { data, loading, resetKey } = this.state; |
| | | const { data, loading, resetKey, formData } = this.state; |
| | | return ( |
| | | <div className="app-page"> |
| | | <HeadView history={this.props.history} /> |
| | | <div style={{ marginLeft: '90%', marginBottom: '20px', marginTop: '20px' }}> |
| | | <Button type="primary" size='large' onClick={() => this.showModal('new')}>添加申请</Button> |
| | | </div> |
| | | {/* <Breadcrumb style={{ padding: '20px' }}> |
| | | <Breadcrumb.Item><a href="">后台中心</a></Breadcrumb.Item> |
| | | <Breadcrumb.Item>社会关护</Breadcrumb.Item> |
| | | </Breadcrumb> */} |
| | | <TableBtnView name={''} key={resetKey}> |
| | | <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: 'select', name: '状态', label: '活动状态', key: 'status', list: activityStatusList.map(key => ({ |
| | | id: key, |
| | | name: activityStatusIds[key] |
| | | })), |
| | | }, |
| | | { |
| | | 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> |
| | | ); |
| | | } |
| | |
| | | |
| | | import React from 'react'; |
| | | |
| | | import { Row, Col, Input, DatePicker, Button, Modal, Upload, Icon, message, Divider, TimePicker, Badge, Select, Popconfirm, Spin } from 'antd'; |
| | | import { Row, Col, Input, DatePicker, Button, Modal, Upload, Icon, message, Divider, Breadcrumb, Badge, Select, Popconfirm, Spin } from 'antd'; |
| | | const { TextArea } = Input; |
| | | import HeadView from '../view/HeadView'; |
| | | import BusDetailView from '../view/BusDetailView'; |
| | |
| | | <div className="app-page"> |
| | | <Spin spinning={loading}> |
| | | <HeadView history={this.props.history} /> |
| | | <Breadcrumb style={{ padding: '20px' }}> |
| | | <Breadcrumb.Item><a href="index.html#/entry/applyFor">入职查询</a></Breadcrumb.Item> |
| | | <Breadcrumb.Item>入职申请</Breadcrumb.Item> |
| | | </Breadcrumb> |
| | | <BusDetailView type='入职申请' > |
| | | <div style={divStyle}> |
| | | <Row type="flex" align='middle' justify="space-around"> |
| | |
| | | |
| | | import HeadView from '../view/HeadView'; |
| | | import TableBtnView from '../view/TableBtnView'; |
| | | import CommonSearchForm from '../view/CommonSearchForm'; |
| | | import { Input, Button, DatePicker, Divider, message, Popconfirm, Select, Badge } from 'antd'; |
| | | import moment from 'moment'; |
| | | import Fetch from '../fetch'; |
| | |
| | | return "心理疏导"; |
| | | } |
| | | } |
| | | |
| | | const taskNodeIds = { |
| | | 1: '跟踪帮教', |
| | | 2: '合适成年人', |
| | | 3: '社会调查', |
| | | 4: '心理疏导', |
| | | } |
| | | |
| | | const activityTypeList = [ |
| | | 1, |
| | | 2, |
| | | 3, |
| | | ] |
| | | const activityStatusIds = { |
| | | 0: '未开始', |
| | | 1: '进行中', |
| | | 2: '已结束', |
| | | 99: '结束', |
| | | } |
| | | |
| | | const activityStatusList = [ |
| | | 1, |
| | | 2, |
| | | 3, |
| | | ] |
| | | export default class CareList extends React.Component { |
| | | constructor(props) { |
| | | super(props); |
| | | this.state = { |
| | | data: [], |
| | | formdata: { |
| | | formData: { |
| | | __key: Date.now(), |
| | | page: 1, |
| | | size: 10, |
| | | }, |
| | |
| | | } |
| | | |
| | | componentDidMount() { |
| | | |
| | | document.title = '社会关护管理'; |
| | | this.getData(); |
| | | } |
| | | |
| | | setFormData = data => { |
| | | console.log('form', data); |
| | | this.setState({ |
| | | formData: data, |
| | | }); |
| | | } |
| | | |
| | | searchonClick = data => { |
| | | console.log('form', data); |
| | | this.setState({ |
| | | formData: data, |
| | | }); |
| | | this.getData(); |
| | | } |
| | | |
| | | getData = () => { |
| | | const { formdata } = this.state; |
| | | Fetch.socialQuery({ ...formdata }) |
| | | const { formData } = this.state; |
| | | this.setState({loading:true}) |
| | | Fetch.socialQuery({ ...formData }) |
| | | .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 |
| | | data: res.rows, |
| | | loading:false, |
| | | }); |
| | | }); |
| | | } |
| | | onInputChange = ({ target: { value, name } }) => { |
| | | this.setState(({ formdata }) => ({ |
| | | formdata: { |
| | | ...formdata, |
| | | this.setState(({ formData }) => ({ |
| | | formData: { |
| | | ...formData, |
| | | [name]: value |
| | | } |
| | | })) |
| | |
| | | } |
| | | |
| | | 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; |
| | |
| | | Reset = () => { |
| | | this.setState({ |
| | | resetKey: Date.now(), |
| | | formdata: {} |
| | | formData: {} |
| | | }, this.getData); |
| | | } |
| | | |
| | |
| | | key: 'status', |
| | | render: text => ( |
| | | text == 0 ? |
| | | <Badge style={{ backgroundColor: '#6C757C' }} count={'未开始'} /> :text == 1 ? <Badge count={'F1C40F'} style={{ backgroundColor: '#6C757C' }} /> : <Badge count={'已结束'} style={{ backgroundColor: '#2ECC71' }} /> |
| | | <Badge style={{ backgroundColor: '#6C757C' }} count={'已结束'} /> : text == 1 ? <Badge count={'进行中'} style={{ backgroundColor: '#6C757C' }} />: text == 2 ? <Badge count={'进行中'} style={{ backgroundColor: '#6C757C' }} /> : <Badge count={'已结束'} style={{ backgroundColor: '#2ECC71' }} /> |
| | | ) |
| | | }, { |
| | | title: '创建时间', |
| | |
| | | key: 'createTime', |
| | | render: text => <span>{moment(text).format("YYYY-MM-DD HH:mm")}</span> |
| | | }, { |
| | | title: '开始时间', |
| | | dataIndex: 'startTime', |
| | | key: 'startTime', |
| | | render: text => <span>{moment(text).format("YYYY-MM-DD HH:mm")}</span> |
| | | }, { |
| | | title: '结束时间', |
| | | dataIndex: 'endTime', |
| | | key: 'endTime', |
| | | render: text => <span>{moment(text).format("YYYY-MM-DD HH:mm")}</span> |
| | | },{ |
| | | title: '操作', |
| | | key: 'action', |
| | | render: (text, record) => ( |
| | |
| | | <a href="#">删除</a> |
| | | </Popconfirm> |
| | | { |
| | | record.status==1? |
| | | <React.Fragment> |
| | | <Divider type="vertical" /> |
| | | <a onClick={() => this.showModal(record.id)}>结束任务</a> |
| | | </React.Fragment>:'' |
| | | record.status == 1 ? |
| | | <React.Fragment> |
| | | <Divider type="vertical" /> |
| | | <a onClick={() => this.showModal(record.id)}>结束任务</a> |
| | | </React.Fragment> : '' |
| | | } |
| | | </span> |
| | | ), |
| | | }]; |
| | | const { data, loading, resetKey } = this.state; |
| | | const { data, loading, resetKey, formData } = this.state; |
| | | return ( |
| | | <div className="app-page"> |
| | | <HeadView history={this.props.history} /> |
| | |
| | | <Breadcrumb.Item><a href="">后台中心</a></Breadcrumb.Item> |
| | | <Breadcrumb.Item>社会关护</Breadcrumb.Item> |
| | | </Breadcrumb> */} |
| | | <TableBtnView name={''} key={resetKey}> |
| | | <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: 'select', name: '任务类型', label: '任务类型', key: 'taskType', list: activityTypeList.map(key => ({ |
| | | id: key, |
| | | name: taskNodeIds[key] |
| | | })), |
| | | }, |
| | | { |
| | | type: 'select', name: '状态', label: '状态', key: 'status', list: activityStatusList.map(key => ({ |
| | | id: key, |
| | | name: activityStatusIds[key] |
| | | })), |
| | | }, |
| | | { |
| | | 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> |
| | | ); |
| | | } |
| | |
| | | |
| | | import React from 'react'; |
| | | |
| | | import { Row, Col, Input, DatePicker, Button, Modal, Upload, Icon, message, Divider, TimePicker, Badge, Select, Popconfirm, Spin } from 'antd'; |
| | | import { Row, Col, Input, DatePicker, Button, Modal, Upload, Icon, message, Breadcrumb, TimePicker, Badge, Select, Popconfirm, Spin } from 'antd'; |
| | | const { TextArea } = Input; |
| | | import HeadView from '../view/HeadView'; |
| | | import BusDetailView from '../view/BusDetailView'; |
| | |
| | | <div className="app-page"> |
| | | <Spin spinning={loading}> |
| | | <HeadView history={this.props.history} /> |
| | | <Breadcrumb style={{ padding: '20px' }}> |
| | | <Breadcrumb.Item><a href="index.html#/entry/applyFor">社会关护管理</a></Breadcrumb.Item> |
| | | <Breadcrumb.Item>社会关护管理活动</Breadcrumb.Item> |
| | | </Breadcrumb> |
| | | <BusDetailView type='社会关护管理活动' > |
| | | <div style={divStyle}> |
| | | <Row type="flex" align='middle' justify="space-around"> |
| | |
| | | |
| | | 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'; |
| | |
| | | super(props); |
| | | this.state = { |
| | | data: [], |
| | | formdata: { |
| | | formData: { |
| | | __key: Date.now(), |
| | | page: 1, |
| | | size: 10, |
| | | type:2, |
| | | }, |
| | | resetKey: Date.now(), |
| | | loading: false |
| | |
| | | this.getData(); |
| | | } |
| | | |
| | | getData = () => { |
| | | const { formdata } = this.state; |
| | | Fetch.entryQuery({ ...formdata }) |
| | | 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({ ...data, type: 2 }) |
| | | .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 |
| | | data: res.rows, |
| | | loading: false |
| | | }); |
| | | }); |
| | | } |
| | | |
| | | getData = () => { |
| | | this.setState({ loading: true }) |
| | | console.log(this.state.formData) |
| | | Fetch.entryQuery({ ...this.state.formData, type: 2 }) |
| | | .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); |
| | | } |
| | | |
| | | Seaech = () => { |
| | | const { formdata } = this.state; |
| | | Fetch.getSweeping(formdata) |
| | | .then(res => { |
| | | for (var i = 0; i < res.length; i++) { |
| | | res[i]['index'] = i + 1; |
| | | } |
| | | this.setState({ |
| | | data: res |
| | | }); |
| | | }); |
| | | } |
| | | Reset = () => { |
| | | this.setState({ |
| | | resetKey: Date.now(), |
| | | formdata: {} |
| | | }, this.getData); |
| | | } |
| | | |
| | | confirm = (e) => { |
| | |
| | | </span> |
| | | ), |
| | | }]; |
| | | const { data, loading, resetKey } = this.state; |
| | | const { data, loading, resetKey, formData } = this.state; |
| | | console.log(formData) |
| | | return ( |
| | | <div className="app-page"> |
| | | <HeadView history={this.props.history} /> |
| | | <TableBtnView name={''} 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> |
| | | ); |
| | | } |
| | |
| | | |
| | | import React from 'react'; |
| | | |
| | | import { Row, Col, Input, DatePicker, Button, Modal, Upload, Icon, message, Divider, TimePicker, Badge, Select, Popconfirm, Spin } from 'antd'; |
| | | import { Row, Col, Input, DatePicker, Button, Modal, Upload, Icon, message, Divider, Breadcrumb, Badge, Select, Popconfirm, Spin } from 'antd'; |
| | | const { TextArea } = Input; |
| | | import HeadView from '../view/HeadView'; |
| | | import BusDetailView from '../view/BusDetailView'; |
| | |
| | | <div className="app-page"> |
| | | <Spin spinning={loading}> |
| | | <HeadView history={this.props.history} /> |
| | | <Breadcrumb style={{ padding: '20px' }}> |
| | | <Breadcrumb.Item><a href="index.html#/entry/applyFor">检察院审核</a></Breadcrumb.Item> |
| | | <Breadcrumb.Item>检察院审核详情</Breadcrumb.Item> |
| | | </Breadcrumb> |
| | | <BusDetailView type='检察院审核' > |
| | | <div style={divStyle}> |
| | | <Row type="flex" align='middle' justify="space-around"> |
| | |
| | | |
| | | 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'; |
| | |
| | | super(props); |
| | | this.state = { |
| | | data: [], |
| | | formdata: { |
| | | formData: { |
| | | __key: Date.now(), |
| | | page: 1, |
| | | size: 10, |
| | | type:3, |
| | | }, |
| | | resetKey: Date.now(), |
| | | loading: false |
| | |
| | | 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++) { |
| | |
| | | } |
| | | 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 |
| | | } |
| | | })) |
| | |
| | | } |
| | | |
| | | 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; |
| | |
| | | Reset = () => { |
| | | this.setState({ |
| | | resetKey: Date.now(), |
| | | formdata: {} |
| | | formData: {} |
| | | }, this.getData); |
| | | } |
| | | |
| | |
| | | </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> |
| | | ); |
| | | } |
| | |
| | | import React from 'react'; |
| | | import { Input, Button, DatePicker, Divider, message, Popconfirm, Select, Badge } from 'antd'; |
| | | import { Icon, Button, DatePicker, Divider, Affix, Spin, Card, Row, Col } from 'antd'; |
| | | |
| | | import Fetch from '../fetch'; |
| | | import sign from './../asset/image/sign.png'; |
| | | import moment from 'moment'; |
| | | |
| | | |
| | | const format = 'YYYY-MM-DD HH:mm'; |
| | | |
| | | const list = [ |
| | | { name: '一号' }, |
| | | { name: '二号' }, |
| | | { name: '三号' }, |
| | | { name: '四号' }, |
| | | { name: '五号' }, |
| | | { name: '六号' }, |
| | | { name: '七号' }, |
| | | ] |
| | | export default class SignIn extends React.Component { |
| | | constructor(props) { |
| | | super(props); |
| | | this.state = { |
| | | data: [], |
| | | |
| | | personList: [], |
| | | activityName: '', |
| | | code: '', |
| | | loading: false, |
| | | }; |
| | | } |
| | | |
| | | componentDidMount() { |
| | | |
| | | document.title = '签到上墙'; |
| | | // this.getData(); |
| | | this.getData(); |
| | | } |
| | | |
| | | getData = () => { |
| | | |
| | | // signinfo |
| | | const { id } = this.props.match.params; |
| | | this.setState({ loading: true }) |
| | | Fetch.signinfo(id) |
| | | .then(res => { |
| | | console.log(res) |
| | | this.setState({ |
| | | code: res.data.code, |
| | | personList: res.data.personList, |
| | | activityName: res.data.activityName, |
| | | loading: false, |
| | | }); |
| | | }) |
| | | } |
| | | |
| | | |
| | | render() { |
| | | |
| | | const { data, loading, resetKey } = this.state; |
| | | |
| | | const { code, loading, personList, activityName } = this.state; |
| | | return ( |
| | | <div className="app-page"> |
| | | 签到上墙 |
| | | <Spin spinning={loading}> |
| | | <Affix style={{ position: 'absolute', top: 520, right: 20 }}> |
| | | <Card> |
| | | < img style={{ width: '150px', height: '150px' }} src={`data:image/png;base64,${code}`} alt=""></img> |
| | | </Card> |
| | | </Affix> |
| | | <Card style={{ margin: "8%" }}> |
| | | <div> |
| | | <Row type="flex" justify="center" align="middle" style={{ borderBottom: '1px solid #D8D8D8' }}> |
| | | <Col style={{ color: '#3D444D', fontSize: 26, fontWeight: 'bold', lineHeight: '75px' }}> |
| | | {activityName} |
| | | </Col> |
| | | </Row> |
| | | </div> |
| | | |
| | | <div style={{ display: 'flex' }}> |
| | | { |
| | | personList.length > 0 ? personList.map((item, index) => ( |
| | | <div style={{ display: 'flex', flexWrap: 'wrap', flexDirection: 'column', width: '168px', height: '168px', justifyContent: 'center', alignItems: 'center',color:'#fff',textAlign:'center',lineHeight:'150px' }} key={index}> |
| | | <img src={item.imgUrl} style={{ width: '150px', height: '150px' }} /> |
| | | { |
| | | item.signStatus !== 3 ? |
| | | <div style={{ width: '150px', height: '150px', backgroundColor: '#000', opacity: '0.2', position: 'absolute' }}>未签到</div> : '' |
| | | } |
| | | { |
| | | item.signStatus == 3 ? |
| | | // <div style={{ width: '150px', height: '50px', color:'#000', position: 'absolute' }}>签到时间:{moment(item.updateTime).format(format)}</div> : '' |
| | | <div style={{ width: '150px', height: '150px', color:'#000', position: 'absolute', display:'flex',justifyContent:'flex-end' }}><Icon type="check-circle" style={{fontSize:'32px'}} theme="twoTone" twoToneColor="#52c41a" /></div> : '' |
| | | } |
| | | </div> |
| | | )) : <span>暂无数据</span> |
| | | } |
| | | </div> |
| | | </Card> |
| | | </Spin> |
| | | </div> |
| | | ); |
| | | } |
| | |
| | | |
| | | import React from 'react'; |
| | | |
| | | import { Row, Col, Input, DatePicker, Button, Modal, Upload, Icon, message, Divider, TimePicker, Badge, Select, Popconfirm, Spin } from 'antd'; |
| | | import { Row, Col, Input, DatePicker, Button, Modal, Upload, Icon, message, Divider, Breadcrumb, Badge, Select, Popconfirm, Spin } from 'antd'; |
| | | const { TextArea } = Input; |
| | | import HeadView from '../view/HeadView'; |
| | | import BusDetailView from '../view/BusDetailView'; |
| | |
| | | <div className="app-page"> |
| | | <Spin spinning={loading}> |
| | | <HeadView history={this.props.history} /> |
| | | <Breadcrumb style={{ padding: '20px' }}> |
| | | <Breadcrumb.Item><a href="index.html#/entry/applyFor">检察院审核</a></Breadcrumb.Item> |
| | | <Breadcrumb.Item>检察院审核详情</Breadcrumb.Item> |
| | | </Breadcrumb> |
| | | <BusDetailView type='公安审核' > |
| | | <div style={divStyle}> |
| | | <Row type="flex" align='middle' justify="space-around"> |
New file |
| | |
| | | import React from 'react'; |
| | | import './style.scss'; |
| | | import { |
| | | Row, |
| | | Col, |
| | | Form, |
| | | Input, |
| | | Button, |
| | | Select, |
| | | DatePicker, |
| | | |
| | | } from 'antd'; |
| | | const { RangePicker } = DatePicker; |
| | | import { FormComponentProps } from 'antd/lib/form'; |
| | | import { RouteComponentProps } from 'react-router-dom'; |
| | | import moment from 'moment'; |
| | | |
| | | class CommonSearchForm extends React.Component { |
| | | constructor(props) { |
| | | super(props); |
| | | this.state = { |
| | | showModal: false, |
| | | }; |
| | | } |
| | | |
| | | componentDidMount() { |
| | | // 回车事件 |
| | | // document.addEventListener('keydown', this.onkeydown); |
| | | } |
| | | |
| | | componentWillUnmount() { |
| | | // window.removeEventListener("keydown", this.onkeydown.bind(this)); |
| | | } |
| | | |
| | | onkeydown = (e) => { |
| | | if (e.keyCode === 13) { |
| | | this.onClick('search'); |
| | | } |
| | | } |
| | | |
| | | onClick = type => { |
| | | const { pathName } = this.props; |
| | | let data; |
| | | switch (type) { |
| | | case 'search': |
| | | data = { ...this.props.formData, __key: Date.now() }; |
| | | this.props.searchonClick(data); |
| | | // if (pathName) { |
| | | // this.props.history.push(pathName + '?' + Object.entries(data) |
| | | // .map(([k, v]) => `${k}=${v}`) |
| | | // .join('&')); |
| | | // } |
| | | return; |
| | | case 'reset': |
| | | data = { __key: Date.now(), page: 1, size: 10 }; |
| | | this.props.searchonClick(data); |
| | | if (pathName) { |
| | | this.props.history.push(pathName + '?' + Object.entries(data) |
| | | .map(([k, v]) => `${k}=${v}`) |
| | | .join('&')); |
| | | } |
| | | return; |
| | | case 'build': |
| | | return; |
| | | } |
| | | }; |
| | | |
| | | handleInput = ({ target: { name, value } }) => { |
| | | this.props.setFormData({ ...this.props.formData, [name]: value }); |
| | | }; |
| | | |
| | | handleSelectChange = name => { |
| | | return value => { |
| | | this.handleInput({ target: { name, value } }); |
| | | }; |
| | | }; |
| | | |
| | | rangePickerChange = (name, key, m, d) => { |
| | | if (m.length > 0) { |
| | | this.props.setFormData({ |
| | | ...this.props.formData, |
| | | [name]: d.join(','), |
| | | [JSON.parse(key)[0]]: d[0], |
| | | [JSON.parse(key)[1]]: d[1], |
| | | }); |
| | | } else { |
| | | this.props.setFormData({ |
| | | ...this.props.formData, |
| | | [name]: undefined, |
| | | [JSON.parse(key)[0]]: '', |
| | | [JSON.parse(key)[1]]: '', |
| | | }); |
| | | } |
| | | }; |
| | | |
| | | datePickerChange = (name, v) => { |
| | | this.props.setFormData({ |
| | | ...this.props.formData, |
| | | [name]: v, |
| | | }); |
| | | }; |
| | | |
| | | |
| | | |
| | | render() { |
| | | const { formData, data, children } = this.props; |
| | | console.log(formData) |
| | | console.log(data) |
| | | return ( |
| | | <div className="common-search-form-main"> |
| | | <Row type="flex" align="middle" gutter={20}> |
| | | {/* <Row type="flex" align="bottom"> */} |
| | | {/* <Col span={20}> |
| | | <Row gutter={20}> */} |
| | | {data.length > 0 && |
| | | data.map(item => ( |
| | | <React.Fragment> |
| | | {(() => { |
| | | switch (item.type) { |
| | | case 'select': |
| | | return ( |
| | | <Col span={4}> |
| | | <Form.Item label={item.label}> |
| | | <Select |
| | | style={{ width: '100%' }} |
| | | placeholder={item.name} |
| | | value={formData[item.key]} |
| | | allowClear |
| | | onChange={this.handleSelectChange(item.key)}> |
| | | {item.list && |
| | | item.list.map(item => ( |
| | | <Select.Option |
| | | value={item.id} |
| | | key={item.id}> |
| | | {item.name} |
| | | </Select.Option> |
| | | ))} |
| | | </Select> |
| | | </Form.Item> |
| | | </Col> |
| | | ); |
| | | case 'input': |
| | | return ( |
| | | <Col span={4}> |
| | | <Form.Item label={item.label}> |
| | | <Input |
| | | placeholder={item.name} |
| | | name={item.key} |
| | | value={formData[item.key]} |
| | | onChange={this.handleInput} |
| | | /> |
| | | </Form.Item> |
| | | </Col> |
| | | ); |
| | | case 'datePicker': |
| | | return ( |
| | | <Col span={4}> |
| | | <Form.Item label={item.label}> |
| | | <DatePicker |
| | | style={{ width: '100%' }} |
| | | placeholder={item.name} |
| | | onChange={(date, dateString) => { |
| | | this.datePickerChange(item.key, dateString); |
| | | }} |
| | | value={formData[item.key] ? moment(formData[item.key], 'YYYY-MM-DD') : undefined} |
| | | /> |
| | | </Form.Item> |
| | | </Col> |
| | | ); |
| | | case 'rangePicker': |
| | | return ( |
| | | <Col span={6}> |
| | | <Form.Item label={item.label}> |
| | | <RangePicker |
| | | ranges={{ |
| | | Today: [moment(), moment()], |
| | | 'This Month': [ |
| | | moment().startOf('month'), |
| | | moment().endOf('month'), |
| | | ], |
| | | }} |
| | | // defaultValue={[moment(monthStartDate, 'YYYY/MM/DD'), moment(monthEndDate, 'YYYY/MM/DD')]} |
| | | value={ |
| | | item.keylistName && |
| | | formData[item.keylistName] && |
| | | typeof formData[item.keylistName] == 'string' |
| | | ? formData[item.keylistName] |
| | | .split(',') |
| | | .map(item => moment(item, 'YYYY-MM-DD')) |
| | | : [] |
| | | } |
| | | onChange={(date, dateString) => { |
| | | this.rangePickerChange( |
| | | item.keylistName, |
| | | item.key, |
| | | date, |
| | | dateString |
| | | ); |
| | | }} |
| | | placeholder={JSON.parse(item.name)} |
| | | /> |
| | | </Form.Item> |
| | | </Col> |
| | | ); |
| | | case 'br': |
| | | return ( |
| | | <Col span={24} style={{ marginBottom: '10px' }} /> |
| | | ); |
| | | default: |
| | | return null; |
| | | } |
| | | })()} |
| | | </React.Fragment> |
| | | ))} |
| | | {/* </Row> */} |
| | | {/* </Col> */} |
| | | |
| | | <Col> |
| | | <Row type="flex" gutter={20} align="middle" style={{ marginBottom: 5 }}> |
| | | <Col> |
| | | <Button |
| | | type="primary" |
| | | onClick={() => { |
| | | this.onClick('search'); |
| | | }}> |
| | | 查询 |
| | | </Button> |
| | | </Col> |
| | | <Col> |
| | | <Button |
| | | onClick={() => { |
| | | this.onClick('reset'); |
| | | }}> |
| | | 重置 |
| | | </Button> |
| | | </Col> |
| | | { |
| | | children && |
| | | <Col> |
| | | {children} |
| | | </Col> |
| | | } |
| | | </Row> |
| | | </Col> |
| | | </Row> |
| | | </div > |
| | | ); |
| | | } |
| | | } |
| | | |
| | | export default Form.create({ |
| | | onValuesChange: (props, changed, values) => { }, |
| | | })(CommonSearchForm); |
New file |
| | |
| | | .common-search-form-main { |
| | | padding: 15px; |
| | | .ant-form-item { |
| | | margin-bottom: 0 !important; |
| | | display: flex; |
| | | } |
| | | .ant-form-item-control-wrapper { |
| | | flex: 1; |
| | | } |
| | | // .ant-form-item-label{ |
| | | // width: 70px !important; |
| | | // } |
| | | } |