|
@@ -1,5 +1,5 @@
|
|
|
import React from 'react';
|
|
|
-import { Spin, Button, Tabs, Table, message, Modal,Tooltip } from 'antd';
|
|
|
+import { Spin, Button, Tabs, Table, message, Modal, Tooltip } from 'antd';
|
|
|
import ajax from 'jquery/src/ajax/xhr.js'
|
|
|
import $ from 'jquery/src/ajax';
|
|
|
|
|
@@ -14,13 +14,13 @@ const TabPane = Tabs.TabPane;
|
|
|
const MessageModal = React.createClass({
|
|
|
getInitialState() {
|
|
|
return {
|
|
|
- unreadData:[],
|
|
|
- unreadDataType:'0',
|
|
|
- dataSourceType:'1',
|
|
|
- unreadDataIndex:0,
|
|
|
+ unreadData: [],
|
|
|
+ unreadDataType: '0',
|
|
|
+ dataSourceType: '1',
|
|
|
+ unreadDataIndex: 0,
|
|
|
newVisible: false,
|
|
|
loading: false,
|
|
|
- categoryArr:[],
|
|
|
+ categoryArr: [],
|
|
|
pagination: {
|
|
|
defaultCurrent: 1,
|
|
|
defaultPageSize: 10,
|
|
@@ -60,9 +60,9 @@ const MessageModal = React.createClass({
|
|
|
title: '内容',
|
|
|
dataIndex: 'content',
|
|
|
key: 'content',
|
|
|
- width:1189,
|
|
|
+ width: 1189,
|
|
|
render: (text, record) => {
|
|
|
- return(
|
|
|
+ return (
|
|
|
<Tooltip placement="topLeft" title={text}>
|
|
|
<div style={{
|
|
|
width: 1189,
|
|
@@ -80,16 +80,16 @@ const MessageModal = React.createClass({
|
|
|
title: "操作",
|
|
|
dataIndex: "abc",
|
|
|
key: "abc",
|
|
|
- width:150,
|
|
|
+ width: 150,
|
|
|
render: (text, record) => {
|
|
|
let contractNo = '';
|
|
|
- if((record.noticeType === 14 || record.noticeType === 40) && record.content.indexOf('合同编号-') !== -1){
|
|
|
+ if ((record.noticeType === 14 || record.noticeType === 40) && record.content.indexOf('合同编号-') !== -1) {
|
|
|
let arr = record.content.split('合同编号-');
|
|
|
contractNo = arr[1].match(/(\S*), 订单编号/)[1];
|
|
|
}
|
|
|
return (
|
|
|
record.noticeType === 48 || record.noticeType === 49 ?
|
|
|
- <Button type="primary" onClick={()=>{
|
|
|
+ <Button type="primary" onClick={() => {
|
|
|
this.category();
|
|
|
record.id = record.uid;
|
|
|
this.setState({
|
|
@@ -98,7 +98,7 @@ const MessageModal = React.createClass({
|
|
|
});
|
|
|
}}>立即跟进</Button> :
|
|
|
record.noticeType === 14 || record.noticeType === 40 ?
|
|
|
- <Button disabled={!contractNo} type="primary" onClick={(e)=>{
|
|
|
+ <Button disabled={!contractNo} type="primary" onClick={(e) => {
|
|
|
e.stopPropagation();
|
|
|
let input = document.getElementById("copyText1");
|
|
|
input.value = contractNo;
|
|
@@ -107,7 +107,7 @@ const MessageModal = React.createClass({
|
|
|
message.success('复制成功')
|
|
|
}}>
|
|
|
复制合同号
|
|
|
- </Button> : null
|
|
|
+ </Button> : null
|
|
|
)
|
|
|
}
|
|
|
}
|
|
@@ -136,9 +136,9 @@ const MessageModal = React.createClass({
|
|
|
title: '内容',
|
|
|
dataIndex: 'content',
|
|
|
key: 'content',
|
|
|
- width:610,
|
|
|
+ width: 610,
|
|
|
render: (text, record) => {
|
|
|
- return(
|
|
|
+ return (
|
|
|
<Tooltip placement="topLeft" title={text}>
|
|
|
<div style={{
|
|
|
width: 610,
|
|
@@ -156,16 +156,16 @@ const MessageModal = React.createClass({
|
|
|
title: "操作",
|
|
|
dataIndex: "abc",
|
|
|
key: "abc",
|
|
|
- width:150,
|
|
|
+ width: 150,
|
|
|
render: (text, record) => {
|
|
|
let contractNo = '';
|
|
|
- if((record.noticeType === 14 || record.noticeType === 40) && record.content.indexOf('合同编号-') !== -1){
|
|
|
+ if ((record.noticeType === 14 || record.noticeType === 40) && record.content.indexOf('合同编号-') !== -1) {
|
|
|
let arr = record.content.split('合同编号-');
|
|
|
contractNo = arr[1].match(/(\S*), 订单编号/)[1];
|
|
|
}
|
|
|
return (
|
|
|
record.noticeType === 48 || record.noticeType === 49 ?
|
|
|
- <Button type="primary" onClick={()=>{
|
|
|
+ <Button type="primary" onClick={() => {
|
|
|
this.category();
|
|
|
record.id = record.uid;
|
|
|
this.setState({
|
|
@@ -174,7 +174,7 @@ const MessageModal = React.createClass({
|
|
|
});
|
|
|
}}>立即跟进</Button> :
|
|
|
record.noticeType === 14 || record.noticeType === 40 ?
|
|
|
- <Button disabled={!contractNo} type="primary" onClick={(e)=>{
|
|
|
+ <Button disabled={!contractNo} type="primary" onClick={(e) => {
|
|
|
e.stopPropagation();
|
|
|
let input = document.getElementById("copyText1");
|
|
|
input.value = contractNo;
|
|
@@ -183,7 +183,7 @@ const MessageModal = React.createClass({
|
|
|
message.success('复制成功')
|
|
|
}}>
|
|
|
复制合同号
|
|
|
- </Button> : null
|
|
|
+ </Button> : null
|
|
|
)
|
|
|
}
|
|
|
}
|
|
@@ -200,12 +200,12 @@ const MessageModal = React.createClass({
|
|
|
data: []
|
|
|
};
|
|
|
},
|
|
|
- closeDesc(){
|
|
|
+ closeDesc() {
|
|
|
this.setState({
|
|
|
- categoryArr:[],
|
|
|
- followData:'',
|
|
|
- visitModul:false
|
|
|
- },()=>{
|
|
|
+ categoryArr: [],
|
|
|
+ followData: '',
|
|
|
+ visitModul: false
|
|
|
+ }, () => {
|
|
|
this.loadReaded(this.state.pagination.current);
|
|
|
})
|
|
|
},
|
|
@@ -239,166 +239,166 @@ const MessageModal = React.createClass({
|
|
|
});
|
|
|
},
|
|
|
//主菜单请求
|
|
|
- mainMenu(){
|
|
|
- this.setState({
|
|
|
- loading:true
|
|
|
- });
|
|
|
- $.ajax({
|
|
|
- method: "get",
|
|
|
+ mainMenu() {
|
|
|
+ this.setState({
|
|
|
+ loading: true
|
|
|
+ });
|
|
|
+ $.ajax({
|
|
|
+ method: "get",
|
|
|
dataType: "json",
|
|
|
crossDomain: false,
|
|
|
url: globalConfig.context + "/api/admin/selectNavList",
|
|
|
data: {
|
|
|
|
|
|
},
|
|
|
- success:function(data){
|
|
|
- if (!data.data) {
|
|
|
- if (data.error && data.error.length) {
|
|
|
- message.warning(data.error[0].message);
|
|
|
- return;
|
|
|
- };
|
|
|
- };
|
|
|
- this.setState({
|
|
|
- menu:data.data
|
|
|
- });
|
|
|
+ success: function (data) {
|
|
|
+ if (!data.data) {
|
|
|
+ if (data.error && data.error.length) {
|
|
|
+ message.warning(data.error[0].message);
|
|
|
+ return;
|
|
|
+ };
|
|
|
+ };
|
|
|
+ this.setState({
|
|
|
+ menu: data.data
|
|
|
+ });
|
|
|
}.bind(this),
|
|
|
- }).always(function(data){
|
|
|
- this.setState({
|
|
|
- loading:false
|
|
|
- })
|
|
|
- }.bind(this))
|
|
|
+ }).always(function (data) {
|
|
|
+ this.setState({
|
|
|
+ loading: false
|
|
|
+ })
|
|
|
+ }.bind(this))
|
|
|
},
|
|
|
- finId(text){
|
|
|
- var data=this.state.menu||[];
|
|
|
- var rid='';
|
|
|
- switch(text) {
|
|
|
- case 1:
|
|
|
- data.map(function(nub, index) {
|
|
|
- if(nub.url.indexOf('demand') != -1) {
|
|
|
- rid = nub.id;
|
|
|
- }
|
|
|
- });
|
|
|
- break;
|
|
|
- case 2:
|
|
|
- data.map(function(nub, index) {
|
|
|
- if(nub.url.indexOf('demand') != -1) {
|
|
|
- rid = nub.id;
|
|
|
- }
|
|
|
- });
|
|
|
- break;
|
|
|
- case 3:
|
|
|
- data.map(function(nub, index) {
|
|
|
- if(nub.url.indexOf('achievement') != -1) {
|
|
|
- rid = nub.id;
|
|
|
- }
|
|
|
- });
|
|
|
- break;
|
|
|
- case 4:
|
|
|
- data.map(function(nub, index) {
|
|
|
- if(nub.url.indexOf('achievement') != -1) {
|
|
|
- rid = nub.id;
|
|
|
- }
|
|
|
- });
|
|
|
- break;
|
|
|
- case 5:
|
|
|
- data.map(function(nub, index) {
|
|
|
- if(nub.url.indexOf('order') != -1) {
|
|
|
- rid = nub.id;
|
|
|
- }
|
|
|
- });
|
|
|
- break;
|
|
|
- case 6:
|
|
|
- data.map(function(nub, index) {
|
|
|
- if(nub.url.indexOf('order') != -1) {
|
|
|
- rid = nub.id;
|
|
|
- }
|
|
|
- });
|
|
|
- break;
|
|
|
- case 7:
|
|
|
- data.map(function(nub, index) {
|
|
|
- if(nub.url.indexOf('servicesManage') != -1) {
|
|
|
- rid = nub.id;
|
|
|
- }
|
|
|
- });
|
|
|
- break;
|
|
|
- default:
|
|
|
- rid='';
|
|
|
- }
|
|
|
- return rid;
|
|
|
+ finId(text) {
|
|
|
+ var data = this.state.menu || [];
|
|
|
+ var rid = '';
|
|
|
+ switch (text) {
|
|
|
+ case 1:
|
|
|
+ data.map(function (nub, index) {
|
|
|
+ if (nub.url.indexOf('demand') != -1) {
|
|
|
+ rid = nub.id;
|
|
|
+ }
|
|
|
+ });
|
|
|
+ break;
|
|
|
+ case 2:
|
|
|
+ data.map(function (nub, index) {
|
|
|
+ if (nub.url.indexOf('demand') != -1) {
|
|
|
+ rid = nub.id;
|
|
|
+ }
|
|
|
+ });
|
|
|
+ break;
|
|
|
+ case 3:
|
|
|
+ data.map(function (nub, index) {
|
|
|
+ if (nub.url.indexOf('achievement') != -1) {
|
|
|
+ rid = nub.id;
|
|
|
+ }
|
|
|
+ });
|
|
|
+ break;
|
|
|
+ case 4:
|
|
|
+ data.map(function (nub, index) {
|
|
|
+ if (nub.url.indexOf('achievement') != -1) {
|
|
|
+ rid = nub.id;
|
|
|
+ }
|
|
|
+ });
|
|
|
+ break;
|
|
|
+ case 5:
|
|
|
+ data.map(function (nub, index) {
|
|
|
+ if (nub.url.indexOf('order') != -1) {
|
|
|
+ rid = nub.id;
|
|
|
+ }
|
|
|
+ });
|
|
|
+ break;
|
|
|
+ case 6:
|
|
|
+ data.map(function (nub, index) {
|
|
|
+ if (nub.url.indexOf('order') != -1) {
|
|
|
+ rid = nub.id;
|
|
|
+ }
|
|
|
+ });
|
|
|
+ break;
|
|
|
+ case 7:
|
|
|
+ data.map(function (nub, index) {
|
|
|
+ if (nub.url.indexOf('servicesManage') != -1) {
|
|
|
+ rid = nub.id;
|
|
|
+ }
|
|
|
+ });
|
|
|
+ break;
|
|
|
+ default:
|
|
|
+ rid = '';
|
|
|
+ }
|
|
|
+ return rid;
|
|
|
},
|
|
|
//跳转详情
|
|
|
- setStore(record){
|
|
|
- localStorage.setItem('newData',{});
|
|
|
- let ids = record.noticeType;
|
|
|
- let rid = this.finId(ids) || "";
|
|
|
- var urls='',
|
|
|
- dataJson={};
|
|
|
- switch (ids) {
|
|
|
+ setStore(record) {
|
|
|
+ localStorage.setItem('newData', {});
|
|
|
+ let ids = record.noticeType;
|
|
|
+ let rid = this.finId(ids) || "";
|
|
|
+ var urls = '',
|
|
|
+ dataJson = {};
|
|
|
+ switch (ids) {
|
|
|
case 1:
|
|
|
- urls = "/admin/demand.html?rid=" + rid +"#techDemandAudit";
|
|
|
+ urls = "/admin/demand.html?rid=" + rid + "#techDemandAudit";
|
|
|
dataJson = {
|
|
|
- "id":record.uid,
|
|
|
- //"id":"3f93588b-332e-4353-bbfd-f1451b4b390c",
|
|
|
- "dataCategory":"0"
|
|
|
+ "id": record.uid,
|
|
|
+ //"id":"3f93588b-332e-4353-bbfd-f1451b4b390c",
|
|
|
+ "dataCategory": "0"
|
|
|
};
|
|
|
break;
|
|
|
case 2:
|
|
|
- urls = "/admin/demand.html?rid=" + rid+ "#techDemandPublish";
|
|
|
+ urls = "/admin/demand.html?rid=" + rid + "#techDemandPublish";
|
|
|
dataJson = {
|
|
|
- "id":record.uid,
|
|
|
- //"id":"40f77e32-29fa-4a85-a6f0-7c4986bdc5e3",
|
|
|
- "dataCategory":'1'
|
|
|
+ "id": record.uid,
|
|
|
+ //"id":"40f77e32-29fa-4a85-a6f0-7c4986bdc5e3",
|
|
|
+ "dataCategory": '1'
|
|
|
};
|
|
|
- break ;
|
|
|
+ break;
|
|
|
case 3:
|
|
|
- urls = "/admin/achievement.html?rid=" + rid +"#techAchievementAudit";
|
|
|
- dataJson = {
|
|
|
- "id":record.uid,
|
|
|
- //"id":"f09d5c08-4a8b-48a6-9753-86006f1a53cb",
|
|
|
- "ownerType":'1'
|
|
|
- };
|
|
|
- break ;
|
|
|
+ urls = "/admin/achievement.html?rid=" + rid + "#techAchievementAudit";
|
|
|
+ dataJson = {
|
|
|
+ "id": record.uid,
|
|
|
+ //"id":"f09d5c08-4a8b-48a6-9753-86006f1a53cb",
|
|
|
+ "ownerType": '1'
|
|
|
+ };
|
|
|
+ break;
|
|
|
case 4:
|
|
|
urls = "/admin/achievement.html?rid=" + rid + "#techAchievementPublish";
|
|
|
dataJson = {
|
|
|
- "id":record.uid,
|
|
|
- //"id":"953c9ef7-6cf6-4ab7-af89-c01521998fed",
|
|
|
- "ownerType":'1'
|
|
|
- };
|
|
|
- break ;
|
|
|
+ "id": record.uid,
|
|
|
+ //"id":"953c9ef7-6cf6-4ab7-af89-c01521998fed",
|
|
|
+ "ownerType": '1'
|
|
|
+ };
|
|
|
+ break;
|
|
|
case 5:
|
|
|
urls = "/admin/order.html?rid=" + rid + "#myService";
|
|
|
- dataJson = {
|
|
|
- "orderNo":record.orderNo
|
|
|
- //"orderNo":"175557414077480960"
|
|
|
- };
|
|
|
- break ;
|
|
|
+ dataJson = {
|
|
|
+ "orderNo": record.orderNo
|
|
|
+ //"orderNo":"175557414077480960"
|
|
|
+ };
|
|
|
+ break;
|
|
|
case 6:
|
|
|
urls = "/admin/order.html?rid=" + rid + "#mySettlement";
|
|
|
- dataJson = {
|
|
|
- "orderNo":record.orderNo
|
|
|
- //"orderNo":"180714111314051072"
|
|
|
- };
|
|
|
- break ;
|
|
|
+ dataJson = {
|
|
|
+ "orderNo": record.orderNo
|
|
|
+ //"orderNo":"180714111314051072"
|
|
|
+ };
|
|
|
+ break;
|
|
|
case 7:
|
|
|
urls = "/admin/servicesManage/projectOrder.html?rid=" + rid + "#projectManage";
|
|
|
- dataJson = {
|
|
|
- //"id":record.id,
|
|
|
- "id":"69e2d8ca984240a4b9c90daac69fe5e3",
|
|
|
- "buyerType":"1"
|
|
|
- };
|
|
|
- break ;
|
|
|
- default :
|
|
|
- urls:'#';
|
|
|
- dataJson = {};
|
|
|
- };
|
|
|
- console.log(rid);
|
|
|
- if(rid){
|
|
|
- var data = dataJson;
|
|
|
- var newData = JSON.stringify(data);
|
|
|
- localStorage.setItem('newData',newData);
|
|
|
- window.location.href = globalConfig.context +urls;
|
|
|
- }
|
|
|
+ dataJson = {
|
|
|
+ //"id":record.id,
|
|
|
+ "id": "69e2d8ca984240a4b9c90daac69fe5e3",
|
|
|
+ "buyerType": "1"
|
|
|
+ };
|
|
|
+ break;
|
|
|
+ default:
|
|
|
+ urls: '#';
|
|
|
+ dataJson = {};
|
|
|
+ };
|
|
|
+ console.log(rid);
|
|
|
+ if (rid) {
|
|
|
+ var data = dataJson;
|
|
|
+ var newData = JSON.stringify(data);
|
|
|
+ localStorage.setItem('newData', newData);
|
|
|
+ window.location.href = globalConfig.context + urls;
|
|
|
+ }
|
|
|
},
|
|
|
loadReaded(pageNo) {
|
|
|
this.state.data = [];
|
|
@@ -413,7 +413,7 @@ const MessageModal = React.createClass({
|
|
|
data: {
|
|
|
pageNo: pageNo || 1,
|
|
|
pageSize: this.state.pagination.pageSize,
|
|
|
- type:this.state.unreadDataType,
|
|
|
+ type: this.state.unreadDataType,
|
|
|
}
|
|
|
}).done((data) => {
|
|
|
if (!data.data) {
|
|
@@ -470,24 +470,24 @@ const MessageModal = React.createClass({
|
|
|
if (data.error && data.error.length) {
|
|
|
message.warning(data.error[0].message);
|
|
|
return;
|
|
|
- }else{
|
|
|
- let arr = data.data.filter(v=>v.list.length > 0)
|
|
|
- if(arr.length) {
|
|
|
+ } else {
|
|
|
+ let arr = data.data.filter(v => v.list.length > 0)
|
|
|
+ if (arr.length) {
|
|
|
this.setState({
|
|
|
newVisible: true
|
|
|
});
|
|
|
}
|
|
|
- let index = data.data.findIndex(v=>v.list.length > 0);
|
|
|
- if(index >= 0){
|
|
|
+ let index = data.data.findIndex(v => v.list.length > 0);
|
|
|
+ if (index >= 0) {
|
|
|
data.data[index].isRead = true;
|
|
|
this.setState({
|
|
|
- unreadDataType: index ? data.data[index]['id']+'' : '0',
|
|
|
- unreadDataIndex:index,
|
|
|
+ unreadDataType: data.data[index]['id'] + '',
|
|
|
+ unreadDataIndex: index,
|
|
|
});
|
|
|
- }else{
|
|
|
+ } else {
|
|
|
this.setState({
|
|
|
- unreadDataType: data.data[0]['id']+'',
|
|
|
- unreadDataIndex:'0',
|
|
|
+ unreadDataType: data.data[0]['id'] + '',
|
|
|
+ unreadDataIndex: '0',
|
|
|
});
|
|
|
}
|
|
|
this.setState({
|
|
@@ -506,11 +506,11 @@ const MessageModal = React.createClass({
|
|
|
this.mainMenu();
|
|
|
},
|
|
|
handleOk() {
|
|
|
- let arr = this.state.unreadData.filter(v=>v.list.length > 0 && !v.isRead);
|
|
|
- if(arr.length > 0){
|
|
|
+ let arr = this.state.unreadData.filter(v => v.list.length > 0 && !v.isRead);
|
|
|
+ if (arr.length > 0) {
|
|
|
message.warning('还存在未读消息,请查看后再关闭当前页面!');
|
|
|
return;
|
|
|
- }else{
|
|
|
+ } else {
|
|
|
this.loadUnread();
|
|
|
this.setState({
|
|
|
newVisible: false
|
|
@@ -519,121 +519,124 @@ const MessageModal = React.createClass({
|
|
|
},
|
|
|
render() {
|
|
|
return (
|
|
|
- <div className="set-content">
|
|
|
- <div className="set-title" style={{ marginBottom: 10 }}>
|
|
|
- <span style={{ fontWeight: 900, fontSize: 16 }}>信息中心</span>
|
|
|
- </div>
|
|
|
- <Spin spinning={this.state.loading} className="spin-box">
|
|
|
- <Tabs defaultActiveKey={this.state.unreadDataType} activeKey={this.state.unreadDataType} onChange={v=>{
|
|
|
- let index = this.state.unreadData.findIndex(d=>d.id == v);
|
|
|
- this.state.unreadData[index].isRead = true;
|
|
|
- this.setState({
|
|
|
- unreadDataIndex:index,
|
|
|
- unreadData:this.state.unreadData,
|
|
|
- unreadDataType:v
|
|
|
- },()=>{
|
|
|
- if(this.state.dataSourceType === '2'){
|
|
|
- this.loadReaded()
|
|
|
- }
|
|
|
- })
|
|
|
- }}>
|
|
|
- {
|
|
|
- this.state.unreadData.map((v)=>(
|
|
|
- <Tabs.TabPane
|
|
|
- key={v.id+''}
|
|
|
- tab={<div>
|
|
|
- {v.list.length === 0 || v.isRead ? null : <div style={{width:'8px',height:"8px",borderRadius:'8px',background:'#f00',position: 'absolute',right: '5px', top: '2px'}}/>}
|
|
|
- {v.name}
|
|
|
- </div>
|
|
|
- }/>
|
|
|
- ))
|
|
|
- }
|
|
|
- </Tabs>
|
|
|
- <Tabs defaultActiveKey="1" type="card" tabPosition='left' value={this.state.dataSourceType} onChange={(v)=>{
|
|
|
- this.setState({
|
|
|
- dataSourceType:v
|
|
|
- })
|
|
|
- if(v === '2'){
|
|
|
- this.loadReaded()
|
|
|
- }
|
|
|
- }}>
|
|
|
- <Tabs.TabPane tab={'未读'} key="1">
|
|
|
- <Table
|
|
|
- bordered
|
|
|
- columns={this.state.columns}
|
|
|
- dataSource={this.state.unreadData[this.state.unreadDataIndex] ? this.state.unreadData[this.state.unreadDataIndex].list : []}
|
|
|
- pagination={false}
|
|
|
- />
|
|
|
- </Tabs.TabPane>
|
|
|
- <Tabs.TabPane tab="已读" key="2">
|
|
|
- <Table
|
|
|
- bordered
|
|
|
- columns={this.state.columns}
|
|
|
- dataSource={this.state.dataSource}
|
|
|
- pagination={this.state.pagination}
|
|
|
- />
|
|
|
- </Tabs.TabPane>
|
|
|
- </Tabs>
|
|
|
- </Spin>
|
|
|
- <Modal
|
|
|
- maskClosable={false}
|
|
|
- style={{ position: "relative" }}
|
|
|
- title="消息提醒"
|
|
|
- visible={this.state.newVisible}
|
|
|
- width={1400}
|
|
|
- closable={false}
|
|
|
- footer={null}
|
|
|
- >
|
|
|
+ <div className="set-content">
|
|
|
+ <div className="set-title" style={{ marginBottom: 10 }}>
|
|
|
+ <span style={{ fontWeight: 900, fontSize: 16 }}>信息中心</span>
|
|
|
+ </div>
|
|
|
<Spin spinning={this.state.loading} className="spin-box">
|
|
|
- <Tabs defaultActiveKey={this.state.unreadDataType} activeKey={this.state.unreadDataType} onChange={v=>{
|
|
|
- let index = this.state.unreadData.findIndex(d=>d.id == v);
|
|
|
+ <Tabs defaultActiveKey={this.state.unreadDataType} activeKey={this.state.unreadDataType} onChange={v => {
|
|
|
+ let index = this.state.unreadData.findIndex(d => d.id == v);
|
|
|
this.state.unreadData[index].isRead = true;
|
|
|
this.setState({
|
|
|
- unreadDataIndex:index,
|
|
|
- unreadData:this.state.unreadData,
|
|
|
- unreadDataType:v
|
|
|
+ unreadDataIndex: index,
|
|
|
+ unreadData: this.state.unreadData,
|
|
|
+ unreadDataType: v
|
|
|
+ }, () => {
|
|
|
+ if (this.state.dataSourceType === '2') {
|
|
|
+ this.loadReaded()
|
|
|
+ }
|
|
|
})
|
|
|
}}>
|
|
|
{
|
|
|
- this.state.unreadData.map((v)=>(
|
|
|
+ this.state.unreadData.map((v) => (
|
|
|
<Tabs.TabPane
|
|
|
- key={v.id+''}
|
|
|
+ key={v.id + ''}
|
|
|
tab={<div>
|
|
|
- {v.list.length === 0 || v.isRead ? null : <div style={{width:'8px',height:"8px",borderRadius:'8px',background:'#f00',position: 'absolute',right: '5px', top: '2px'}}/>}
|
|
|
+ {v.list.length === 0 || v.isRead ? null : <div style={{ width: '8px', height: "8px", borderRadius: '8px', background: '#f00', position: 'absolute', right: '5px', top: '2px' }} />}
|
|
|
{v.name}
|
|
|
</div>
|
|
|
- }/>
|
|
|
+ } />
|
|
|
))
|
|
|
}
|
|
|
</Tabs>
|
|
|
- <Table
|
|
|
- columns={this.state.columns1}
|
|
|
- dataSource={this.state.unreadData[this.state.unreadDataIndex] ? this.state.unreadData[this.state.unreadDataIndex].list : []}
|
|
|
- pagination={false}
|
|
|
- scroll={{ y: 600, x: 1000 }}
|
|
|
- />
|
|
|
+ <Tabs defaultActiveKey="1" type="card" tabPosition='left' value={this.state.dataSourceType} onChange={(v) => {
|
|
|
+ this.setState({
|
|
|
+ dataSourceType: v
|
|
|
+ })
|
|
|
+ if (v === '2') {
|
|
|
+ this.loadReaded()
|
|
|
+ }
|
|
|
+ }}>
|
|
|
+ <Tabs.TabPane tab={'未读'} key="1">
|
|
|
+ <Table
|
|
|
+ bordered
|
|
|
+ columns={this.state.columns}
|
|
|
+ dataSource={this.state.unreadData[this.state.unreadDataIndex] ? this.state.unreadData[this.state.unreadDataIndex].list : []}
|
|
|
+ pagination={false}
|
|
|
+ />
|
|
|
+ </Tabs.TabPane>
|
|
|
+ <Tabs.TabPane tab="已读" key="2">
|
|
|
+ <Table
|
|
|
+ bordered
|
|
|
+ columns={this.state.columns}
|
|
|
+ dataSource={this.state.dataSource}
|
|
|
+ pagination={this.state.pagination}
|
|
|
+ />
|
|
|
+ </Tabs.TabPane>
|
|
|
+ </Tabs>
|
|
|
</Spin>
|
|
|
- <Button
|
|
|
- onClick={this.handleOk}
|
|
|
- type={"primary"}
|
|
|
- style={{
|
|
|
- position: "relative",
|
|
|
- left: "50%",
|
|
|
- transform: "translateX(-50%)",
|
|
|
- bottom: -10
|
|
|
- }}
|
|
|
- >
|
|
|
- 我已阅读以上信息
|
|
|
- </Button>
|
|
|
- </Modal>
|
|
|
- <FollowDetail
|
|
|
- categoryArr={this.state.categoryArr}
|
|
|
- followData={this.state.followData}
|
|
|
- visitModul={this.state.visitModul}
|
|
|
- closeDesc={this.closeDesc}
|
|
|
- />
|
|
|
- <textarea id='copyText1' style={{opacity:0}}/>
|
|
|
- </div>
|
|
|
+ <Modal
|
|
|
+ maskClosable={false}
|
|
|
+ style={{ position: "relative" }}
|
|
|
+ title="消息提醒"
|
|
|
+ visible={this.state.newVisible}
|
|
|
+ width={1400}
|
|
|
+ closable={false}
|
|
|
+ footer={null}
|
|
|
+ >
|
|
|
+ <Spin spinning={this.state.loading} className="spin-box">
|
|
|
+ <Tabs
|
|
|
+ defaultActiveKey={this.state.unreadDataType}
|
|
|
+ activeKey={this.state.unreadDataType}
|
|
|
+ onChange={v => {
|
|
|
+ let index = this.state.unreadData.findIndex(d => d.id == v);
|
|
|
+ this.state.unreadData[index].isRead = true;
|
|
|
+ this.setState({
|
|
|
+ unreadDataIndex: index,
|
|
|
+ unreadData: this.state.unreadData,
|
|
|
+ unreadDataType: v
|
|
|
+ })
|
|
|
+ }}>
|
|
|
+ {
|
|
|
+ this.state.unreadData.map((v) => (
|
|
|
+ <Tabs.TabPane
|
|
|
+ key={v.id + ''}
|
|
|
+ tab={<div>
|
|
|
+ {v.list.length === 0 || v.isRead ? null : <div style={{ width: '8px', height: "8px", borderRadius: '8px', background: '#f00', position: 'absolute', right: '5px', top: '2px' }} />}
|
|
|
+ {v.name}
|
|
|
+ </div>
|
|
|
+ } />
|
|
|
+ ))
|
|
|
+ }
|
|
|
+ </Tabs>
|
|
|
+ <Table
|
|
|
+ columns={this.state.columns1}
|
|
|
+ dataSource={this.state.unreadData[this.state.unreadDataIndex] ? this.state.unreadData[this.state.unreadDataIndex].list : []}
|
|
|
+ pagination={false}
|
|
|
+ scroll={{ y: 600, x: 1000 }}
|
|
|
+ />
|
|
|
+ </Spin>
|
|
|
+ <Button
|
|
|
+ onClick={this.handleOk}
|
|
|
+ type={"primary"}
|
|
|
+ style={{
|
|
|
+ position: "relative",
|
|
|
+ left: "50%",
|
|
|
+ transform: "translateX(-50%)",
|
|
|
+ bottom: -10
|
|
|
+ }}
|
|
|
+ >
|
|
|
+ 我已阅读以上信息
|
|
|
+ </Button>
|
|
|
+ </Modal>
|
|
|
+ <FollowDetail
|
|
|
+ categoryArr={this.state.categoryArr}
|
|
|
+ followData={this.state.followData}
|
|
|
+ visitModul={this.state.visitModul}
|
|
|
+ closeDesc={this.closeDesc}
|
|
|
+ />
|
|
|
+ <textarea id='copyText1' style={{ opacity: 0 }} />
|
|
|
+ </div>
|
|
|
);
|
|
|
}
|
|
|
});
|
|
@@ -642,35 +645,35 @@ const Content = React.createClass({
|
|
|
getInitialState() {
|
|
|
return {
|
|
|
loading: false,
|
|
|
- component:'<div></div>'
|
|
|
+ component: '<div></div>'
|
|
|
};
|
|
|
},
|
|
|
- getKey(key){
|
|
|
- switch(key){
|
|
|
+ getKey(key) {
|
|
|
+ switch (key) {
|
|
|
case 'normal':
|
|
|
require.ensure([], () => {
|
|
|
this.setState({
|
|
|
component: <MessageModal />,
|
|
|
});
|
|
|
});
|
|
|
- break;
|
|
|
+ break;
|
|
|
case "contacts":
|
|
|
- let Module = require('./contacts/index').default;
|
|
|
+ let Module = require('./contacts/index').default;
|
|
|
require.ensure([], () => {
|
|
|
this.setState({
|
|
|
component: <Module />,
|
|
|
});
|
|
|
});
|
|
|
- break;
|
|
|
+ break;
|
|
|
default:
|
|
|
- require.ensure([], () => {
|
|
|
- let Module = require('../module').default;
|
|
|
- this.setState({
|
|
|
- component:<Module />
|
|
|
- });
|
|
|
- });
|
|
|
+ require.ensure([], () => {
|
|
|
+ let Module = require('../module').default;
|
|
|
+ this.setState({
|
|
|
+ component: <Module />
|
|
|
+ });
|
|
|
+ });
|
|
|
}
|
|
|
- window.location.hash=key;
|
|
|
+ window.location.hash = key;
|
|
|
},
|
|
|
componentWillMount() {
|
|
|
if (window.location.hash) {
|