超算资讯-待审核列表增加状态展示
This commit is contained in:
parent
3315fce039
commit
6ca16de71b
|
|
@ -1,7 +1,4 @@
|
|||
.customvipBox{
|
||||
font-family: 'alibaba PuHuiTi';
|
||||
background-image: url(../../img/custom/bc.png);
|
||||
background-size: 100%;
|
||||
.customPublic{
|
||||
.project-cate-title {
|
||||
font-family: "DouyinSans";
|
||||
font-weight: 700;
|
||||
|
|
@ -9,6 +6,11 @@
|
|||
text-align: center;
|
||||
padding:80px 0 20px;
|
||||
}
|
||||
}
|
||||
.customvipBox{
|
||||
font-family: 'alibaba PuHuiTi';
|
||||
background-image: url(../../img/custom/bc.png);
|
||||
background-size: 100%;
|
||||
.statistics-cards{
|
||||
width: 80%;
|
||||
margin: 25px auto;
|
||||
|
|
|
|||
|
|
@ -0,0 +1,133 @@
|
|||
import React , { useState , useEffect } from 'react';
|
||||
import {getUniqueIdentifier,getUserName,getBrowserPlatform,getBrowserBrand} from '../../utils';
|
||||
import { Menu , Spin , Skeleton, Button, Dropdown } from 'antd';
|
||||
import { getNewsAllList , getNewsHotList , setZoneVisits } from '../../api';
|
||||
import { tempConfig, tempEnum } from '../../tempInfo';
|
||||
import { Link } from 'react-router-dom';
|
||||
import "../../index.scss";
|
||||
import "./index.less";
|
||||
|
||||
|
||||
|
||||
function NewsIndex(props){
|
||||
const { id, temp, role, history, sectionCmsTitle } = props;
|
||||
const [ mainList , setMainList ] = useState(undefined);
|
||||
const [ menuH , setMenuH ] = useState(true);
|
||||
const [ hotList , setHotList ] = useState(undefined);
|
||||
const [ isSpin , setIsSpin ] = useState(true);
|
||||
const [ newCateId , setNewCateId ] = useState(undefined);
|
||||
const { deptId = "NSCC" , cateId } = props.match.params;
|
||||
|
||||
useEffect(()=>{
|
||||
let uuid = getUniqueIdentifier()
|
||||
let url = props.location.pathname
|
||||
let platform = getBrowserPlatform()
|
||||
let browser = getBrowserBrand()
|
||||
let username = getUserName(props.current_user)
|
||||
let remark = ` 操作系统:${platform};浏览器:${browser};`
|
||||
setZoneVisits({url,username,uuid,remark})
|
||||
},[])
|
||||
|
||||
const menu = (
|
||||
<Menu>
|
||||
<Menu.Item>
|
||||
<a onClick={()=>{history.push(`/zone/${deptId}/news/add?type=richEditor`)}}>富文本编辑器</a>
|
||||
</Menu.Item>
|
||||
<Menu.Item>
|
||||
<a onClick={()=>{history.push(`/zone/${deptId}/news/add?type=mdEditor`)}}>MD编辑器</a>
|
||||
</Menu.Item>
|
||||
</Menu>
|
||||
);
|
||||
|
||||
useEffect(()=>{
|
||||
if(id) {
|
||||
setIsSpin(true);
|
||||
if (temp === tempEnum.zone) {
|
||||
getMainList();
|
||||
} else {
|
||||
getCateList();
|
||||
}
|
||||
getHotList();
|
||||
}
|
||||
},[id])
|
||||
|
||||
function getMainList(){
|
||||
getNewsAllList(id).then(result=>{
|
||||
if(result){
|
||||
let rows = result.data.rows;
|
||||
setMainList(rows);
|
||||
if (temp !== tempEnum.zone) {
|
||||
selectCate(rows[0].id)
|
||||
}
|
||||
setTimeout(() => {
|
||||
let ele = document.getElementById("menus");
|
||||
if(ele){
|
||||
let h = ele.clientHeight;
|
||||
setMenuH(h>56);
|
||||
}
|
||||
setIsSpin(false);
|
||||
}, 100);
|
||||
}
|
||||
}).catch(error=>{})
|
||||
}
|
||||
|
||||
function getCateList() {
|
||||
const url = `${httpUrl}/cms/doc/open/zone/${id}/dirList`;
|
||||
axios.get(url).then(result=>{
|
||||
if(result){
|
||||
let rows = result.data.rows;
|
||||
setMainList(rows);
|
||||
// 隐藏判断原因:首页查看全部跳转过来后要默认选择指定的cateID而不是第一个
|
||||
// if (temp !== tempEnum.zone) {
|
||||
selectCate(cateId || (rows[0] && rows[0].id))
|
||||
// }
|
||||
setIsSpin(false);
|
||||
}
|
||||
}).catch(error=>{})
|
||||
}
|
||||
|
||||
function getHotList(){
|
||||
getNewsHotList(id,{
|
||||
pageSize:15,pageNum:1
|
||||
}).then(result=>{
|
||||
if(result){
|
||||
setHotList(result.data.rows);
|
||||
}
|
||||
}).catch(error=>{})
|
||||
}
|
||||
const nsccTitle = (title, delay=0.1, classname)=> <div className={`project-cate-title fadeInChar ${classname}`}>
|
||||
{title && title.split("").map((char, index) => (
|
||||
<span key={index} className="title-char" style={{ animationDelay: `${delay + index * 0.1}s` }}>
|
||||
{char}
|
||||
</span>
|
||||
))}
|
||||
</div>
|
||||
return(
|
||||
<div className="customNews customPublic">
|
||||
<div className="width1600">
|
||||
<div className='titleButBox'>
|
||||
{ nsccTitle(`${sectionCmsTitle}` +" " + " 动态全揽") }
|
||||
{role && role.role !== "None" &&
|
||||
<div className='createButs mt5'>
|
||||
{role.role === "Member" ? <Button type="primary" ghost className='mr20'>
|
||||
<Link to={`/zone/${deptId}/news/self`}> 我的资讯</Link>
|
||||
</Button>:""}
|
||||
<Dropdown overlay={menu}><Button icon='plus' type="primary" ghost>新建</Button></Dropdown>
|
||||
</div>
|
||||
}
|
||||
</div>
|
||||
{
|
||||
mainList && mainList.length>0 &&
|
||||
<Menu mode={"horizontal"} id="menus" selectedKeys={[cateId||"0"]} style={{justifyContent:menuH?"flex-start":"center"}}>
|
||||
<Menu.Item key={"0"}><Link to={`/zone/${deptId}/news`}>全部</Link></Menu.Item>
|
||||
{mainList.map((i,k)=>{
|
||||
return <Menu.Item key={`${i.id}`}><Link to={`/zone/${deptId}/news/${i.id}`}>{i.name}</Link></Menu.Item>
|
||||
})
|
||||
}
|
||||
</Menu>
|
||||
}
|
||||
</div>
|
||||
</div>
|
||||
)
|
||||
}
|
||||
export default NewsIndex;
|
||||
|
|
@ -86,15 +86,15 @@ function CustomVip(props){
|
|||
}
|
||||
setApplyVisible(!applyVisible)
|
||||
}
|
||||
const nsccTitle = (title, delay=0.1, classname)=> <div className={`project-cate-title fadeInChar ${classname}`}>
|
||||
{title && title.split("").map((char, index) => (
|
||||
<span key={index} className="title-char" style={{ animationDelay: `${delay + index * 0.1}s` }}>
|
||||
{char}
|
||||
</span>
|
||||
))}
|
||||
</div>
|
||||
const nsccTitle = (title, delay=0.1, classname)=> <div className={`project-cate-title fadeInChar ${classname}`}>
|
||||
{title && title.split("").map((char, index) => (
|
||||
<span key={index} className="title-char" style={{ animationDelay: `${delay + index * 0.1}s` }}>
|
||||
{char}
|
||||
</span>
|
||||
))}
|
||||
</div>
|
||||
return(
|
||||
<div className='customvipBox'>
|
||||
<div className='customvipBox customPublic'>
|
||||
<MemberApply visible={applyVisible} onOk={ onOk } onCancel={() => setApplyVisible(!applyVisible)} current_user={props.current_user}/>
|
||||
<div className={`width1600`}>
|
||||
{ nsccTitle(sectionMemberTitle) }
|
||||
|
|
|
|||
|
|
@ -1,5 +1,5 @@
|
|||
import React,{ useState, useEffect } from 'react';
|
||||
import { Breadcrumb , Spin , Pagination , Modal, Button } from 'antd';
|
||||
import { Breadcrumb , Spin , Pagination , Modal, Button , Tag } from 'antd';
|
||||
import { Link } from 'react-router-dom';
|
||||
import { getNewsMyList , getSourceMyList , getSourceManage , delNewsMyList , delNews , delSourceMyList , delManageSource , getProjectMyList , removeProject , getManageProjectMyList , deleteMemberProject } from '../api';
|
||||
import moment from 'moment';
|
||||
|
|
@ -169,6 +169,16 @@ function SelfList(props){
|
|||
},
|
||||
});
|
||||
}
|
||||
|
||||
const auditTypeEnom = {
|
||||
create: '发布',
|
||||
update: '编辑',
|
||||
delete: '删除'
|
||||
}
|
||||
|
||||
const statueName =(auditType)=>{
|
||||
return auditType ? <span className={`auditTag ${auditType}`}>{auditTypeEnom[auditType]}</span> : ''
|
||||
}
|
||||
return(
|
||||
<div className="selfBoxContent">
|
||||
<Modal
|
||||
|
|
@ -215,12 +225,15 @@ function SelfList(props){
|
|||
return(
|
||||
<li>
|
||||
<div>
|
||||
<div className='mb5'>
|
||||
<div className='mb5 df-center'>
|
||||
{
|
||||
source==="projects"?<a href={i.projectURL}>{i.name}</a>
|
||||
:
|
||||
<Link to={`/zone/${deptId}/${source==="source"?"source":"newdetail"}/${i.id}`} className="s-name task-hide">{i.name}</Link>
|
||||
}
|
||||
{
|
||||
source === "news" && status === 0 && i.auditType && <span>{statueName(i.auditType.split('-')[0])}</span>
|
||||
}
|
||||
</div>
|
||||
{i.remark && status===2 && <div>驳回理由:{i.remark}</div>}
|
||||
<div className="s-info mt10">
|
||||
|
|
|
|||
|
|
@ -15,7 +15,7 @@ function beforeFetch(actionUrl){
|
|||
|
||||
service.interceptors.request.use(request => {
|
||||
let deptId = sessionStorage.getItem('deptId');
|
||||
// request.headers.Authorization = '6a4b63adc957f362ee53b81388a7a63c6e2ac2ef'
|
||||
// request.headers.Authorization = '2a0eeb5fb55166b080faba4fbc153d104630630e'
|
||||
if (deptId) {
|
||||
// 用于权限区分
|
||||
request.headers['Dept-Id'] = deptId
|
||||
|
|
|
|||
Binary file not shown.
|
After Width: | Height: | Size: 4.3 KiB |
Binary file not shown.
|
After Width: | Height: | Size: 4.1 KiB |
Binary file not shown.
|
After Width: | Height: | Size: 4.3 KiB |
|
|
@ -101,6 +101,10 @@ const Main = Loadable({
|
|||
loader: () => import("./Pages/main"),
|
||||
loading: Loading,
|
||||
});
|
||||
const CustomNews = Loadable({
|
||||
loader: () => import("./Pages/custom/newsIndex"),
|
||||
loading: Loading,
|
||||
});
|
||||
|
||||
const Help = Loadable({
|
||||
loader: () => import("./Pages/help"),
|
||||
|
|
@ -234,6 +238,12 @@ function Index(props){
|
|||
<NewsCreate {...props} {...p} id={id} temp={ temp } data={data} role={role}/>
|
||||
)}
|
||||
></Route>
|
||||
{/* <Route
|
||||
path="/zone/NSCC/news/:cateId"
|
||||
render={(p) => (
|
||||
<CustomNews {...props} {...p} id={id} temp={ temp } role={role} sectionCmsTitle={data && data.sectionCmsTitle}/>
|
||||
)}
|
||||
></Route> */}
|
||||
<Route
|
||||
path="/zone/:deptId/news/:cateId"
|
||||
render={(p) => (
|
||||
|
|
@ -323,6 +333,12 @@ function Index(props){
|
|||
<ProjectCateList {...props} {...p} id={id} temp={ temp } data={data} role={role}/>
|
||||
)}
|
||||
></Route>
|
||||
{/* <Route
|
||||
path="/zone/NSCC/news"
|
||||
render={(p) => (
|
||||
<CustomNews {...props} {...p} id={id} temp={ temp } role={role} sectionCmsTitle={data && data.sectionCmsTitle}/>
|
||||
)}
|
||||
></Route> */}
|
||||
<Route
|
||||
path="/zone/:deptId/projects"
|
||||
render={(p) => (
|
||||
|
|
|
|||
|
|
@ -1,5 +1,24 @@
|
|||
@import './theme.scss';
|
||||
|
||||
.auditTag{
|
||||
margin-left: 10px;
|
||||
background-image: url(./img/create.png);
|
||||
background-size: 100% 100%;
|
||||
font-family: "DouyinSans";
|
||||
height: 21px;
|
||||
line-height: 20px;
|
||||
padding: 0px 8px;
|
||||
background-size: 100% 100%;
|
||||
color: #fff;
|
||||
text-align: center;
|
||||
display: block;
|
||||
font-size: 12px;
|
||||
&.update{
|
||||
background-image: url(./img/update.png);
|
||||
}
|
||||
&.delete{
|
||||
background-image: url(./img/delete.png);
|
||||
}
|
||||
}
|
||||
// 按钮
|
||||
.zone_apply_button {
|
||||
flex-grow: 0;
|
||||
|
|
|
|||
Loading…
Reference in New Issue