From c0c820559b46f3a5ede6fbd7f66e77d09981829f Mon Sep 17 00:00:00 2001 From: Mr Ke <kelq@hugeinfo.com.cn> Date: Wed, 29 Apr 2020 11:56:31 +0800 Subject: [PATCH] 提升菜单栏体验,升级公共查询表单组件 --- src/components/page/index/rulesList/index.jsx | 47 +++++++++++++++++++++++++++++++++++------------ 1 files changed, 35 insertions(+), 12 deletions(-) diff --git a/src/components/page/index/rulesList/index.jsx b/src/components/page/index/rulesList/index.jsx index 3fb2a6f..ee82d16 100644 --- a/src/components/page/index/rulesList/index.jsx +++ b/src/components/page/index/rulesList/index.jsx @@ -6,13 +6,14 @@ /** 工作制度 */ import React, { ReactNode, ReactEventHandler, Component } from 'react'; -import { Button } from 'antd'; +import { Button, Modal, Tabs, List, Avatar } from 'antd'; import TableView from '../../../common/TableView'; import SearchFormView from '../../../common/SearchFormView'; import moment from 'moment'; +import FindAlreadyReadOrNotView from '../../../common/FindAlreadyReadOrNotView'; import './index.scss'; - +const { TabPane } = Tabs; export default class RulesList extends Component { constructor(props) { @@ -26,6 +27,7 @@ title: '', page: 1, size: 10, + visible: false//modal的可视化状态 }, }; } @@ -34,31 +36,40 @@ componentDidMount() { } - cancle = (id) => { - console.log(id) - // // this.props.history.push("/document/create?id=" + id); - this.props.history.push({ pathname: "/document/create/"+id }); + link = (id) => { + this.props.history.push({ pathname: "/document/detail/" + id }); + } + + emoveTAG = (str) => { + return str.replace(/<[^>]+>/g, ""); } renderColumns = () => { return [ - { title: '标题', dataIndex: 'documentTitle' }, - { title: '通知内容', dataIndex: 'documentContent' }, - { title: '接受情况', dataIndex: 'groupType', render: (cur, item) => <span>{item.readNumber || 0}/{item.noticeNumber || 0}</span> }, + { title: '标题', dataIndex: 'documentTitle', ellipsis: true }, + { + title: '通知内容', dataIndex: 'documentContent', ellipsis: true, render: (cur, item) => { + return cur ? this.emoveTAG(cur) : '无' + } + }, + { title: '接受情况', dataIndex: 'groupType', render: (cur, item) => <a onClick={() => { this.setState({ visible: true, documentId: item.id }) }}> <span>{item.readNumber || 0}/{item.noticeNumber || 0}</span></a> }, { title: '发布时间', dataIndex: 'createTime', render: (cur, item) => cur !== "" && cur != null ? moment(cur).format("YYYY-MM-DD HH:mm") : "" }, - { title: '操作', render: (text, record) => <a onClick={() => this.cancle(record.id)}>查看</a> } + { title: '操作', render: (text, record) => <a onClick={() => this.link(record.id)}>查看</a> } ]; } setFormData = data => { - console.log('form', data); this.setState({ formData: data, }); } + onTabsChange = (key) => { + } + + render() { - const { formData } = this.state; + const { formData, visible, documentId } = this.state; let tableParams = { url: `api/document/getNotice`, @@ -72,6 +83,18 @@ } return ( <div className="rules-list-main"> + <Modal + visible={visible} + onCancel={() => this.setState({ visible: false })} + footer={null} + title="接收情况" + > + { + documentId && + <FindAlreadyReadOrNotView key={documentId} documentId={documentId} /> + } + + </Modal> <SearchFormView formData={formData} setFormData={this.setFormData} -- Gitblit v1.8.0