import React, { Component } from 'react'; import moment from 'moment'; import { connect } from 'dva'; import { Form, Card, Select, List, Tag, Icon, Avatar, Row, Col, Button } from 'antd'; import StandardFormRow from '../../components/StandardFormRow'; import TagSelect from '../../components/TagSelect'; import styles from './Articles.less'; const { Option } = Select; const FormItem = Form.Item; const pageSize = 5; @Form.create() @connect(({ list, loading }) => ({ list, loading: loading.models.list, })) export default class SearchList extends Component { componentDidMount() { this.fetchMore(); } setOwner = () => { const { form } = this.props; form.setFieldsValue({ owner: ['wzj'], }); } fetchMore = () => { this.props.dispatch({ type: 'list/appendFetch', payload: { count: pageSize, }, }); } render() { const { form, list: { list }, loading } = this.props; const { getFieldDecorator } = form; const owners = [ { id: 'wzj', name: '我自己', }, { id: 'wjh', name: '吴家豪', }, { id: 'zxx', name: '周星星', }, { id: 'zly', name: '赵丽颖', }, { id: 'ym', name: '姚明', }, ]; const IconText = ({ type, text }) => ( {text} ); const ListContent = ({ data: { content, updatedAt, avatar, owner, href } }) => (
{content}
{owner} 发布在 {href} {moment(updatedAt).format('YYYY-MM-DD hh:mm')}
); const formItemLayout = { wrapperCol: { xs: { span: 24 }, sm: { span: 24 }, md: { span: 12 }, }, }; const loadMore = list.length > 0 ? (
) : null; return (
{getFieldDecorator('category')( 类目一 类目二 类目三 类目四 类目五 类目六 类目七 类目八 类目九 类目十 类目十一 类目十二 )} {getFieldDecorator('owner', { initialValue: ['wjh', 'zxx'], })( )} 只看自己的 {getFieldDecorator('user', {})( )} {getFieldDecorator('rate', {})( )}
( , , , ]} extra={
} > {item.title} )} description={ Ant Design 设计语言 蚂蚁金服 } /> )} />
); } }