From 5acddbdb6b6d48a08b52602fd232993fd5c3715d Mon Sep 17 00:00:00 2001
From: Mr Ke <kelq@hugeinfo.com.cn>
Date: Mon, 27 Apr 2020 15:51:27 +0800
Subject: [PATCH] 增加接收情况tabs列表

---
 src/components/page/index/rulesList/index.jsx |   44 +++++++++++++++++++++++++++++++++++---------
 1 files changed, 35 insertions(+), 9 deletions(-)

diff --git a/src/components/page/index/rulesList/index.jsx b/src/components/page/index/rulesList/index.jsx
index 3fb2a6f..9802320 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,19 +36,26 @@
 
   componentDidMount() { }
 
-  cancle = (id) => {
+  link = (id) => {
     console.log(id)
-  //   // this.props.history.push("/document/create?id=" + id);
-  this.props.history.push({ pathname: "/document/create/"+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: 'documentContent', width: '40%', 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> }
     ];
   }
 
@@ -57,8 +66,13 @@
     });
   }
 
+  onTabsChange = (key) => {
+    console.log(key);
+  }
+
+
   render() {
-    const { formData } = this.state;
+    const { formData, visible, documentId } = this.state;
 
     let tableParams = {
       url: `api/document/getNotice`,
@@ -72,6 +86,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