|
@@ -0,0 +1,137 @@
|
|
|
|
+import react, { PureComponent } from 'react';
|
|
|
|
+import { connect } from 'dva';
|
|
|
|
+import { routerRedux } from 'dva/router';
|
|
|
|
+import { Card, Row, Col, Table, Select, Input, Button, Form, Popconfirm } from 'antd';
|
|
|
|
+import moment from 'moment';
|
|
|
|
+import PageHeaderLayout from '../../layouts/PageHeaderLayout';
|
|
|
|
+import styles from '../GlobalList.less';
|
|
|
|
+
|
|
|
|
+@connect(state => ({
|
|
|
|
+ campus: state.campus,
|
|
|
|
+}))
|
|
|
|
+export default class CampusList extends PureComponent {
|
|
|
|
+ render() {
|
|
|
|
+ const { campus } = this.props;
|
|
|
|
+ const search = ({
|
|
|
|
+ field,
|
|
|
|
+ keyword,
|
|
|
|
+ addPower,
|
|
|
|
+ onSearch,
|
|
|
|
+ onAdd
|
|
|
|
+ }) => {
|
|
|
|
+ const searchGroupProps = {
|
|
|
|
+ field,
|
|
|
|
+ keyword,
|
|
|
|
+ size: 'large',
|
|
|
|
+ select: true,
|
|
|
|
+ selectOptions: [{
|
|
|
|
+ value: 'name', name: '校区名称'
|
|
|
|
+ },{
|
|
|
|
+ value: 'code', name: '校区编号'
|
|
|
|
+ },{
|
|
|
|
+ value: 'contactName', name: '联系人'
|
|
|
|
+ },{
|
|
|
|
+ value: 'mobile', name: '手机号',
|
|
|
|
+ },{
|
|
|
|
+ value: 'address', name: '联系地址'
|
|
|
|
+ }],
|
|
|
|
+ selectProps: {
|
|
|
|
+ defaultValue: field || 'name',
|
|
|
|
+ },
|
|
|
|
+ onSearch: (value) => {
|
|
|
|
+ onSearch(value);
|
|
|
|
+ },
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ const tablePagination = {
|
|
|
|
+ total: campus.totalSize,
|
|
|
|
+ current: campus.pageNo,
|
|
|
|
+ pageSize: campus.pageSize,
|
|
|
|
+ showSizeChanger: true,
|
|
|
|
+ showQuickJumper: true,
|
|
|
|
+ showTotal: (total) => { return `共 ${total} 条` }
|
|
|
|
+ };
|
|
|
|
+ const tableColumns = [{
|
|
|
|
+ title: '校区编号',
|
|
|
|
+ dataIndex: 'code',
|
|
|
|
+ key: 'code',
|
|
|
|
+ },{
|
|
|
|
+ title: '校区名称',
|
|
|
|
+ dataIndex: 'name',
|
|
|
|
+ key: 'name',
|
|
|
|
+ },{
|
|
|
|
+ title: '联系人',
|
|
|
|
+ dataIndex: 'contactName',
|
|
|
|
+ key: 'contactName',
|
|
|
|
+ },{
|
|
|
|
+ title: '电话',
|
|
|
|
+ dataIndex: 'mobile',
|
|
|
|
+ key: 'mobile',
|
|
|
|
+ },{
|
|
|
|
+ title: '地址',
|
|
|
|
+ dataIndex: 'address',
|
|
|
|
+ key: 'address',
|
|
|
|
+ },{
|
|
|
|
+ title: '添加时间',
|
|
|
|
+ dataIndex: 'gmtCreated',
|
|
|
|
+ key: 'gmtCreated',
|
|
|
|
+ render: (text, record) => (
|
|
|
|
+ <div>{moment(text).format('YYYY-MM-DD')}</div>
|
|
|
|
+ )
|
|
|
|
+ },{
|
|
|
|
+ title: '操作',
|
|
|
|
+ dataIndex: 'operation',
|
|
|
|
+ key: 'operation',
|
|
|
|
+ fixed: 'right',
|
|
|
|
+ render: (text, record) => (
|
|
|
|
+ <div>
|
|
|
|
+ <a href="#">详情</a>
|
|
|
|
+ <span className={styles.splitLine} />
|
|
|
|
+ <a href="#">编辑</a>
|
|
|
|
+ <span className={styles.splitLine} />
|
|
|
|
+ <Popconfirm
|
|
|
|
+ placement="top"
|
|
|
|
+ cancelText="取消"
|
|
|
|
+ okText="确定"
|
|
|
|
+ title="确定删除?"
|
|
|
|
+ >
|
|
|
|
+ <a href="#">删除</a>
|
|
|
|
+ </Popconfirm>
|
|
|
|
+ </div>
|
|
|
|
+ )
|
|
|
|
+ }];
|
|
|
|
+ return (
|
|
|
|
+ <PageHeaderLayout
|
|
|
|
+ >
|
|
|
|
+ <Card>
|
|
|
|
+ {/*
|
|
|
|
+ <Row gutter={{ xs: 8, sm: 16, md: 24, lg: 32 }}>
|
|
|
|
+ <Col span={12} style={{ marginBottom: 16 }}>
|
|
|
|
+ <Input.Group compact>
|
|
|
|
+ <Select style={{ width: '25%' }} defaultValue="0">
|
|
|
|
+ <Option value="0">校区编号</Option>
|
|
|
|
+ <Option value="1">校区名称</Option>
|
|
|
|
+ </Select>
|
|
|
|
+ <Input style={{ width: '55%' }} placeholder="请输入" />
|
|
|
|
+ <Button style={{ width: '20%' }} type="primary" icon="search">搜索</Button>
|
|
|
|
+ </Input.Group>
|
|
|
|
+ </Col>
|
|
|
|
+ <Col span={4} offset={8} style={{ marginBottom: 16, textAlign: 'right' }}>
|
|
|
|
+ <Button type="ghost" icon="plus-circle">新建</Button>
|
|
|
|
+ </Col>
|
|
|
|
+ </Row>
|
|
|
|
+ */}
|
|
|
|
+ <Table
|
|
|
|
+ bordered={false}
|
|
|
|
+ rowKey={record => record.id}
|
|
|
|
+ loading={campus.listLoading}
|
|
|
|
+ columns={tableColumns}
|
|
|
|
+ dataSource={campus.list}
|
|
|
|
+ pagination={tablePagination}
|
|
|
|
+ scroll={{ x: 1000 }}
|
|
|
|
+ />
|
|
|
|
+ </Card>
|
|
|
|
+ </PageHeaderLayout>
|
|
|
|
+ );
|
|
|
|
+ }
|
|
|
|
+}
|