import React, { PureComponent } from 'react'; import { connect } from 'dva'; import { Button, Col, Form, Input, Row } from 'antd'; import Panel from '../../../components/Panel'; import Grid from '../../../components/Sword/Grid'; import { DEPT_LIST } from '../../../actions/dept'; import { tenantMode } from '../../../defaultSettings'; const FormItem = Form.Item; @connect(({ dept, loading }) => ({ dept, loading: loading.models.dept, })) @Form.create() class Dept extends PureComponent { // ============ 查询 =============== handleSearch = params => { const { dispatch } = this.props; dispatch(DEPT_LIST(params)); }; // ============ 查询表单 =============== renderSearchForm = onReset => { const { form } = this.props; const { getFieldDecorator } = form; return ( {getFieldDecorator('deptName')()} {getFieldDecorator('tenantCode')()} {getFieldDecorator('fullName')()}
); }; render() { const code = 'dept'; const { form, loading, dept: { data }, } = this.props; const columns = [ { title: '租户编号', dataIndex: 'tenantCode', }, { title: '部门名称', dataIndex: 'deptName', }, { title: '部门全称', dataIndex: 'fullName', }, { title: '排序', dataIndex: 'sort', }, ]; if (!tenantMode) { columns.splice(0, 1); } return ( ); } } export default Dept;