超算开源项目首页改版

This commit is contained in:
caishi 2026-04-30 16:15:43 +08:00
parent a513dbad34
commit 9588e7e8c9
28 changed files with 387 additions and 140 deletions

View File

@ -8,7 +8,7 @@ export const FlowBorderButton = ({
onClick,
...restProps
}) => {
return <a className={`flowBorderButton ${className}`}>
return <a className={`flowBorderButton ${className}`} onClick={onClick}>
<div class="flowBorder"></div>
{children}
</a>

View File

@ -56,7 +56,7 @@ function MemberApply(props){
)}
</Form.Item>
<Form.Item label="会员头像" name="imageUrl" required>
<UploadImage maxSize={ 5 } getImageUrl={ (url) => setImageUrl(url) } url={ getImageUrlAbsolute(`/${current_user.image_url}`)} action={ getZoneUrl(`/api/cms/common/upload`) } />
<UploadImage maxSize={ 5 } getImageUrl={ (url) => setImageUrl(url) } url={ getImageUrlAbsolute(`/${current_user.image_url}`)} action={ getZoneUrl(`/api/file/common/upload`) } />
</Form.Item>
<Form.Item label="会员简介" name="introduction">
{getFieldDecorator("introduction",{

View File

@ -137,14 +137,14 @@ function Main(props){
<div className={isNSCC ? "width1600" : "boxmain"}>
<div className='titleButBox'>
<p className="in_title">{sectionCmsTitle}</p>
{role && role.role !== "None" && <div className='createButs mt10'>
{role.role === "Member" && <Button type="primary" ghost className='mr20'>
<Link to={`/zone/${deptId}/news/self`}>我的文章</Link>
</Button>}
{role.role === "Member" ? <Dropdown overlay={menu}>
<Button icon='plus' type="primary" ghost>新建</Button>
</Dropdown> : <Button type="primary" ghost onClick={()=>{window.open(role.docManageUrl)}}>管理资讯</Button>}
</div>}
{role && role.role !== "None" &&
<div className='createButs mt10'>
<Button type="primary" ghost className='mr20'>
<Link to={`/zone/${deptId}/news/self`}>{role.role === "Member" ? "我的资讯" : "管理资讯"}</Link>
</Button>
<Dropdown overlay={menu}><Button icon='plus' type="primary" ghost>新建</Button></Dropdown>
</div>
}
</div>
{
mainList && mainList.length>0 &&

View File

@ -12,7 +12,6 @@ import { httpUrl } from '../fetch';
function NewsCreate(props){
const {history, id, role, current_user} = props;
const temp = props.temp;
const { getFieldDecorator, validateFields , setFieldsValue, setFields } = props.form;
const { deptId, id: newsId } = props.match.params;
const pathname = props.location.pathname;
@ -22,7 +21,7 @@ function NewsCreate(props){
const [dirList, setDirList] = useState(undefined);
const [loading, setLoading] = useState(false);
const [isEdit, setIsEdit] = useState(false);
const { sectionCmsTitle } = props.data;
const sectionCmsTitle = props.data && props.data.sectionCmsTitle;
const layout = {
labelCol: { span: 2 },
wrapperCol: { span: 14 },
@ -129,7 +128,7 @@ function NewsCreate(props){
<div className='boxmain pt30 newsCreateBox pb100'>
<Breadcrumb separator=">">
<Breadcrumb.Item href={`/zone/${deptId}/news`}>{ sectionCmsTitle }</Breadcrumb.Item>
<Breadcrumb.Item>{isEdit ? '编辑' : '新建'}文章</Breadcrumb.Item>
<Breadcrumb.Item>{isEdit ? '编辑' : '新建'}资讯</Breadcrumb.Item>
</Breadcrumb>
<div className='formBox'>
<Form {...layout} onSubmit={submit}>
@ -161,7 +160,7 @@ function NewsCreate(props){
</Select>
)}
</Form.Item>
<Form.Item label="文章标签">
<Form.Item label="标签">
{getFieldDecorator("keywords", {
rules:[{type: 'string', max: 30, message: "请精简文章标签最大长度30"}],
})(

View File

@ -243,7 +243,7 @@ function ProjectCateDetail(props) {
{lists.map((item, key) => (
<div key={key} className='project-list-item'>
<div className='df-center-between mb40'>
<div className='font-18 font-bd project-list-item-title'>{item.projectProperties && item.projectProperties.name && item.projectProperties.name.split("/").pop()}</div>
<div className='font-18 font-bd project-list-item-title'>{item.projectProperties && item.projectProperties.fromOwner}/{item.projectProperties && item.projectProperties.name && item.projectProperties.name.split("/").pop()}</div>
<img src={icon7} width={42} />
</div>
{item.projectProperties && item.projectProperties.description && (

View File

@ -1,6 +1,7 @@
import { useState, useEffect, Fragment } from 'react';
import { projectCateConfig } from '../projectCateConfig';
import icon6 from '../../../img/project/icon6.png'
import main6 from '../../../img/project/6_f_m.png'
import GlowButton from '../../../../../components/button';
import Nodata from '../../../../Nodata';
import { Divider } from 'antd';
@ -26,42 +27,43 @@ function CategorySection({ category, index, zoneId, nsccTitle }) {
const layoutType = getLayoutType(index);
//
const renderProjects = (showBtn) => {
const renderProjects = (showBtn,range) => {
console.log("-------------",category.name,showBtn, range && range[0]);
if (!projects || projects.length === 0) {
return <Nodata _html="暂无数据" />;
}
return projects.map((item, pIndex) => (
<div key={`${index}_${pIndex}`} className='cate-project-card'>
<div className='font-18 project-list-item-title mb20'>
<a href={item.projectURL} className='font-bd'>{item.projectProperties && item.projectProperties.name && item.projectProperties.name.split("/").pop()}</a>
{!showBtn && <i className='iconfont icon-jiantou21 font-16 ml10'></i>}
</div>
{item.projectProperties && item.projectProperties.description && (
return projects.map((item, pIndex)=>{
console.log(category.name,pIndex,range && pIndex === range[0]);
return(
(!range || (range && pIndex >= range[0] && pIndex < range[1])) ? <div key={`${index}_${pIndex}`} className='cate-project-card'>
<div className='font-18 project-list-item-title mb20'>
<a href={item.projectURL} className='font-bd'>{item.projectProperties && item.projectProperties.fromOwner}/{item.projectProperties && item.projectProperties.name && item.projectProperties.name.split("/").pop()}</a>
{!showBtn && <i className='iconfont icon-jiantou21 font-16 ml10'></i>}
</div>
<div className="in_b_desc task-hide opacity8 font-15 mb15">
{item.projectProperties.description}
{item.projectProperties && item.projectProperties.description}
</div>
)}
{item.projectProperties && item.projectProperties.topics && (
<ul className="project-list-item-tag mb20">
{item.projectProperties.topics.split(",").map((t, k) => (
<li key={k}>{t}</li>
))}
</ul>
)}
<div className='df-center-between font-13 opacity8'>
<div>
{item.projectType && <span>{item.projectType}</span>}
{item.projectProperties && item.projectProperties.language && <Fragment>
<Divider type="vertical" style={{ height: '0.7em' }} />
<span>{item.projectProperties.language}</span>
</Fragment>}
{item.projectProperties && item.projectProperties.topics && (
<ul className="project-list-item-tag mb20">
{item.projectProperties.topics.split(",").map((t, k) => (
<li key={k}>{t}</li>
))}
</ul>
)}
<div className='df-center-between font-13 opacity8'>
<div>
{item.projectType && <span>{item.projectType}</span>}
{item.projectProperties && item.projectProperties.language && <Fragment>
<Divider type="vertical" style={{ height: '0.7em' }} />
<span>{item.projectProperties.language}</span>
</Fragment>}
</div>
{item.projectProperties && item.projectProperties.timeAgo && <span>更新于{item.projectProperties.timeAgo}</span>}
</div>
{item.projectProperties && item.projectProperties.timeAgo && <span>更新于{item.projectProperties.timeAgo}</span>}
</div>
{!!showBtn && <a className='font-15 project-list-item-btn' href={item.projectURL}>查看详情<i className='iconfont icon-zuojiantou1 ml5 font-12'></i></a>}
</div>
));
{!!showBtn && <a className='font-15 project-list-item-btn' href={item.projectURL}>查看详情<i className='iconfont icon-zuojiantou1 ml5 font-12'></i></a>}
</div>:""
)
})
};
@ -98,7 +100,7 @@ function CategorySection({ category, index, zoneId, nsccTitle }) {
<div className="project_cate_home_part3">
{nsccTitle(category.name, 0.3, "pt80 center")}
<div className='center font-20 mb50'>{cateConfig.description}</div>
<div className='project-cate-1600 df'>
<div className='project-cate-1600 df projectCateContent'>
<div className='project_cate_home_part3_left'>
<div className='font-16 font-bd mb20'>天文及固体地球物理研究</div>
{["天文地球物理是超算重要应用,研究宇宙及地球深部问题", "研究多尺度耦合,数据量大,向计算驱动转型", "超算助力科研模拟,支撑基础研究与灾害预警"].map((point, pIndex) => (
@ -121,8 +123,47 @@ function CategorySection({ category, index, zoneId, nsccTitle }) {
{layoutType === 'layout-3' && (
<div className="project_cate_home_part4">
{parter_title()}
<div className='project_cate_home_part4_list project-cate-1600'>
<div className="cate_project_list_box">
{renderProjects(true)}
</div>
</div>
</div>
)}
{ layoutType ==="layout-4" && <div className="project_cate_home_part5">
{parter_title()}
<div className='project-cate-1600 df cate_project_list_box'>
{renderProjects(true,[0,1])}
<div className='df newLeftMainCard'>
{renderProjects(false,[1,5])}
</div>
</div>
</div>}
{
layoutType ==="layout-5" && <div className='project_cate_home_part6'>
{parter_title()}
<div className='project-cate-1600 df cate_project_list_box'>
<div className='cateSixMain'>
<div className='cateSixMainBox'><img src={main6} width={"100%"}/></div>
</div>
{renderProjects(true)}
</div>
</div>
}
{
layoutType ==="layout-6" && <div className='project_cate_home_part7'>
<div className='project-cate-1600 df toolCateHead'>
<div className='toolCateFlex'>
{nsccTitle(category.name, 0.3)}
<div className='font-20'>{cateConfig.description}</div>
</div>
<GlowButton href={`/zone/NSCC/projects/${category.id}?name=${category.name}`} className="NSCC_project_btn blue_image font-15">查看更多<i className='iconfont icon-arrowRight font-16 ml5'></i></GlowButton>
</div>
<div className='project-cate-1600 df cate_project_list_box'>
{renderProjects(false)}
</div>
</div>
}
</Fragment>
);
}

View File

@ -20,9 +20,9 @@ function ProjectCateList(props) {
const [ visible ,setVisible ] =useState(false);
const statsData = [
{ label: '开源项目', value: statistics?.projectCount || 0, suffix: '个' },
{ label: '领域分类', value: statistics?.categoryCount || 0, suffix: '个' },
{ label: '行业应用场景', value: statistics?.applicationCount || 0, suffix: '个' },
{ label: '贡献者', value: statistics?.contributorCount || 0, suffix: '个' }
{ label: '领域分类', value: statistics?.categoryCount || 6, suffix: '个' },
{ label: '行业应用场景', value: statistics?.applicationCount || 19, suffix: '个' },
{ label: '贡献者', value: statistics?.communityUserCount || 0, suffix: '个' }
];
// 访
@ -76,7 +76,7 @@ function ProjectCateList(props) {
function getStatistics() {
getZoneStatistics(id).then(result => {
if (result && result.data) {
setStatistics(result.data);
setStatistics(result.data.data);
}
});
}
@ -106,7 +106,7 @@ function ProjectCateList(props) {
return (
<div className="project_cate_home project-cate-page">
<AddProjects id={id} visible={visible} typeList={typeList} onCancel={()=>setVisible(false)} role={role && role.role} onFresh={()=>{}}/>
<AddProjects id={id} visible={visible} typeList={typeList} onCancel={()=>setVisible(false)} role={role && role.role} onFresh={()=>{getTypeList();}}/>
{/* 数据统计部分 */}
<div className='project_cate_home_part1'>
{nsccTitle("数聚开源力量,实时见证开源生态的每一次进化", 0.1, "center pt80")}
@ -125,8 +125,10 @@ function ProjectCateList(props) {
{role && role.role !== "None" && <div className='center pt20'>
<GlowButton href={`/zone/NSCC/projects/self`} className="NSCC_project_btn blue_image font-15 mr50">{role.role === "Member" ? "我的项目" : "管理项目" }<i className='iconfont icon-arrowRight font-16 ml5'></i></GlowButton>
<FlowBorderButton className='NSCC_project_btn font-15' onClick={(e)=>{
console.log("3333333333");
setVisible(true);
e.stopPropagation();
setVisible(true)
}}>添加项目<i className='iconfont icon-arrowRight font-16 ml5'></i></FlowBorderButton>
</div>}
</div>
@ -152,11 +154,9 @@ function ProjectCateList(props) {
{/* 底部区域 */}
<div className="footer-section">
<div className="footer-content center">
<div className="footer-content project-cate-1600">
<div className="footer-title">共同构建超算开源生态</div>
<div className="footer-action mt50">
<a href="#" className="submit-project-btn">提交项目</a>
</div>
<a href="#" className="submit-project-btn">提交项目<i className='iconfont icon-arrowRight font-16 ml5'/></a>
</div>
</div>
</div>

View File

@ -96,6 +96,9 @@
padding-bottom: 80px;
background-image: url('../../../img/project/cate_page_3.png');
background-size: 100% 100%;
.projectCateContent{
background-color: #fff;
}
.project_cate_home_part3_left{
padding: 40px;
width:582px;
@ -104,7 +107,9 @@
background-size: 100% 100%;
}
.project_cate_home_part3_right{
background-color: #FFFFFF;
background-image: url("../../../img/project/cate_4_c.png");
background-position: 100% 0px;
background-size: 200% 100%;
padding: 25px;
}
.cate_project_list_box{
@ -126,6 +131,189 @@
}
}
.project_cate_home_part4{
padding-bottom: 80px;
background-image: url('../../../img/project/cate_page_4.png');
background-size: 100% 100%;
.project_cate_home_part4_list{
border-radius:15px;
padding:25px;
background-color: rgba(255, 255, 255, 0.16);
margin-top: 40px;
.cate_project_list_box{
display: flex;
gap: 20px;
flex-wrap: wrap;
.cate-project-card{
flex: 0 0 calc(33.7% - 20px);
background-color: #ffffff;
border-radius:15px;
padding:40px;
&:hover{
background-image: url('../../../img/project/cate_page_card.png');
background-size: 101% 100%;
background-position: -2px -2px;
}
}
}
}
}
.project_cate_home_part5{
background: url('../../../img/project/ffbc.png') 100% 50% no-repeat;
background-position: top;
padding-top: 60px;
.cate_project_list_box{
padding: 40px 0 80px;
>.cate-project-card{
width: 30%;
margin-right: 20px;
background: url('../../../img/project/5_h_b.png') 98% 98% no-repeat;
color: #fff;
justify-content: flex-start;
padding:50px 80px 50px 45px;
background-size: 100% 100%;
.project-list-item-title{
a{
color: #fff;
}
}
.project-list-item-btn{
width: 160px;
background: unset;
background-color: #fff!important;
color:#091221!important;
font-size:15px;
}
}
}
.newLeftMainCard{
background: url('../../../img/project/cate_3_c.png') #fff no-repeat;
background-position: right;
background-repeat: no-repeat;
background-size: 120% 100%;
flex-wrap: wrap;
padding:15px;
border-radius: 12px;
flex: 1;
position: relative;
&::after{
position: absolute;
content: "";
left: 50%;
width:1px;
height:100%;
background:linear-gradient(270.06deg,rgba(231, 240, 255, 0.17) 0%,#e8f1ff 53.58%,rgba(231, 240, 255, 0.35) 97.98%);
top: 0;
}
.cate-project-card{
width: 50%;
border-radius: 12px;
position: relative;
.project-list-item-title .icon-jiantou21.iconfont {
color: #091221;
}
&:hover{
background-image: url('../../../img/project/project3.png');
background-size: 100% 100%;
}
&:nth-child(1)::before,&:nth-child(2)::before{
position: absolute;
content: "";
left: -15px;
height:1px;
background:linear-gradient(270.06deg,rgba(231, 240, 255, 0.17) 0%,#e8f1ff 53.58%,rgba(231, 240, 255, 0.35) 97.98%);
bottom: 0;
right: 0;
}
&:nth-child(2)::before{
right: -15px;
}
}
}
}
.project_cate_home_part6{
background: url('../../../img/project/ffbc.png') 100% 50% no-repeat;
background-position: bottom;
padding-bottom: 80px;
padding-top: 70px;
background-size: 100% 100%;
.cate_project_list_box{
flex-wrap: wrap;
margin-top: 40px;
.cateSixMain{
background: url('../../../img/project/6_f_b.png') 100% 100% no-repeat;
padding:20px;
box-sizing: border-box;
width: 43.7%;
margin-bottom: 20px;
background-size: 100% 100%;
margin-right: 20px;
.cateSixMainBox{
overflow: hidden;
}
img{
transition: 0.5s;
}
&:hover{
img{
transform: scale(1.05);
}
}
}
.cate-project-card{
width: calc(50% - 20px);
margin-right: 20px;
background-color: #fff;
margin-bottom: 20px;
&:hover{
background: url('../../../img/project/6_h.png') -4px -2px no-repeat;
background-size: 102% 101%;
}
&:nth-child(2),&:nth-child(3){
width: calc(27.5% - 20px);
}
}
}
}
.project_cate_home_part7{
padding:90px 0 80px;
background-image: url('../../../img/project/7_b.png');
background-size: 100% 100%;
.toolCateHead{
align-items: center;
background-image: url('../../../img/project/7_h_b.png');
background-size: 100% 100%;
padding:0 60px;
height: 182px;
.toolCateFlex{
flex: 1;
}
}
.cate_project_list_box{
padding:40px 50px;
background: url('../../../img/project/7_l_b.png') -20px 17px #fff;
background-size: 103% 100%;
flex-wrap: wrap;
.cate-project-card{
margin-right: 45px;
width: calc(33% - 30px);
&:nth-child(3n){
margin-right: 0px;
}
.icon-jiantou21{
color: #091221!important;
}
&:hover{
background-image: url('../../../img/project/project3.png');
background-size: 100% 100%;
}
}
}
}
.statistics-cards {
width: 80%;
margin: 25px auto;
@ -161,10 +349,6 @@
position: relative;
&:hover {
.project-list-item-btn {
opacity: 1 !important;
bottom: 35px;
}
.project-list-item-title {
.icon-jiantou21 {
top: 0px;
@ -174,7 +358,10 @@
}
}
}
.in_b_desc{
height: 30px;
line-height: 30px;
}
.project-list-item-title .icon-jiantou21 {
color: white;
opacity: 0;
@ -199,18 +386,18 @@
}
}
.project-list-item-btn {
width: 90%;
position: absolute;
bottom: 0px;
background: #091221;
width: 100%;
border-radius: 6px;
color: #ffffff;
color:#091221;
text-align: center;
padding: 1px 0;
opacity: 0;
transition: all .3s ease;
height: 38px;
line-height: 38px;
margin-top: 35px;
background:linear-gradient(272.02deg,rgba(10, 145, 255, 0.12) 0.05%,rgba(43, 103, 238, 0.12) 55.23%,rgba(133, 110, 250, 0.12) 99.86%);
&:hover {
background-color: #091221;
color: #fff;
.iconfont {
display: inline-block;
animation: arrow-move 1.2s ease-in-out infinite;
@ -741,33 +928,39 @@
// 底部区域
.footer-section {
background: linear-gradient(135deg, #091221 0%, #1a2535 100%);
padding: 80px 0;
margin-top: 80px;
height: 300px;
display: flex;
flex-direction: column;
align-items: flex-start;
justify-content: center;
background-image: url('../../../img/project/footer.png');
background-size: 100% 100%;
.footer-content {
.footer-title {
font-size: 32px;
font-weight: bold;
color: #ffffff;
margin-bottom: 50px;
margin-bottom: 40px;
}
.footer-action {
.submit-project-btn {
display: inline-block;
padding: 15px 50px;
background: linear-gradient(90deg, #1E6BFF 0%, #3B8DFF 100%);
color: #ffffff;
border-radius: 30px;
font-size: 18px;
font-weight: bold;
text-decoration: none;
transition: all 0.3s ease;
.submit-project-btn {
display: inline-flex;
justify-content: center;
width: 160px;
height: 44px;
line-height: 44px;
text-align: center;
background-color: #ffffff;
color:#091221;
border-radius: 8px;
font-size: 15px;
text-decoration: none;
transition: all 0.3s ease;
&:hover {
transform: translateY(-2px);
box-shadow: 0px 5px 15px rgba(30, 107, 255, 0.3);
&:hover {
.iconfont {
animation: arrow-move 1.2s ease-in-out infinite;
}
}
}

View File

@ -95,7 +95,7 @@ function SearchIndex(props){
<p className='viptitle task-hide' dangerouslySetInnerHTML={{__html:i.content}} />
</div>
</div>
<Link to={``} className="rnLink">立即查看<i className="iconfont font-12 icon-arrowRight ml5" /></Link>
<Link to={`/${i.extendData && i.extendData.username}`} className="rnLink">立即查看<i className="iconfont font-12 icon-arrowRight ml5" /></Link>
</div> : type==="resource" ? <div>
{/* #资源聚合 */}
<p className='findName task-hide' dangerouslySetInnerHTML={{__html:i.title}} />

View File

@ -1,7 +1,7 @@
import React,{ useState, useEffect } from 'react';
import { Breadcrumb , Spin , Pagination , Modal, Button } from 'antd';
import { Link } from 'react-router-dom';
import { getNewsMyList , getSourceMyList , delNewsMyList , delSourceMyList , getProjectMyList , removeProject , getManageProjectMyList , deleteMemberProject } from '../api';
import { getNewsMyList , getSourceMyList , getSourceManage , delNewsMyList , delNews , delSourceMyList , delManageSource , getProjectMyList , removeProject , getManageProjectMyList , deleteMemberProject } from '../api';
import moment from 'moment';
import nodata from '../img/nodata.png';
import { tempEnum } from '../tempInfo';
@ -86,22 +86,27 @@ function SelfList(props){
setIsSpin(false);
}
function getSource(){
getSourceMyList({
async function getSource(){
let result ={};
let params = {
auditStatus:status,
zoneId:id,
pageSize:limit,
pageNum:page
}).then(result=>{
let rows = result.data && result.data.rows;
if(rows && rows.length>0){
setList(rows);
}else{
setList([]);
}
setTotal(result.data.total);
setIsSpin(false);
})
}
if(role && role.role === "Member"){
result = await getSourceMyList(params)
}else{
result = await getSourceManage(params)
}
let rows = result.data && result.data.rows;
if(rows && rows.length>0){
setList(rows);
}else{
setList([]);
}
setTotal(result.data.total);
setIsSpin(false);
}
function getNew(){
@ -125,23 +130,25 @@ function SelfList(props){
setVisible(false);
setDeleId(undefined);
}
function sureFunc(){
if(source){
delSourceMyList(deleId).then(response=>{
async function sureFunc(){
if(source === "source"){
const response =(role && role.role==="Member") ? await delSourceMyList(deleId) : await delManageSource(deleId);
if(response){
setVisible(false);
props.showNotification("删除成功!");
getSource();
})
}
}else{
delNewsMyList(deleId).then(response=>{
const response =(role && role.role==="Member") ? await delNewsMyList(deleId) : await delNews(deleId);
if(response){
setVisible(false);
if(status ===1){
props.showNotification("提交成功!");
}else{
props.showNotification("删除成功!");
getNew();
}
})
getNew();
}
}
}
@ -164,7 +171,7 @@ function SelfList(props){
<Modal
visible={visible}
width="456px"
title={`申请删除${source==="source"?"资源":source==="news"?"文章":"项目"}`}
title={`申请删除${source==="source"?"资源":source==="news"?"资讯":"项目"}`}
onCancel={cancelFunc}
footer={null}
className="delSModal"
@ -172,7 +179,7 @@ function SelfList(props){
<div className="delBoxCon">
<i className="iconfont icon-shanchu_tc_icon font-22 mr15" style={{color:"#ca0002"}}></i>
<div>
<p className="font-15 mb15 mt5" style={{color:"#202d40"}}>确定删除该{source==="source"?"资源":source==="news"?"文章":"项目"}?</p>
<p className="font-15 mb15 mt5" style={{color:"#202d40"}}>确定删除该{source==="source"?"资源":source==="news"?"资讯":"项目"}?</p>
{(source || (!source && status === 1 && (data && data.docNeedAudit===1))) && <p style={{color:"#5f6872"}}>{source?"删除后所有资源文件将被清除,请谨慎操作":"此操作将提交删除申请,管理员同意申请后该文章将被删除"}</p> }
</div>
</div>
@ -183,7 +190,7 @@ function SelfList(props){
</Modal>
<Breadcrumb separator=">" style={{paddingTop:"20px"}}>
<Breadcrumb.Item><Link className="primaryColor" to={pathname.replace("/self","")}>{ source==="source"?sectionResourceTitle:source==="news"?sectionCmsTitle:sectionProjectTitle }</Link></Breadcrumb.Item>
<Breadcrumb.Item>我的{source==="source"?"资源":source==="news"?"文章":"项目"}</Breadcrumb.Item>
<Breadcrumb.Item>我的{source==="source"?"资源":source==="news"?"资讯":"项目"}</Breadcrumb.Item>
</Breadcrumb>
<ul className="selfMenu">
<li onClick={()=>setStatus(1)} className={status===1?"active":""}>已发布</li>
@ -216,7 +223,7 @@ function SelfList(props){
<div className="s-info mt10">
<span>
<span>{i.domainName || i.dirName}</span>
{ (i.domainName || i.dirName) && (i.timeAgo || i.createTime) && <span className="ml10 mr15">|</span>}
{(i.domainName || i.dirName) && <span className="ml10 mr15">|</span> }
<span><i className="iconfont icon-a-31shijian mr5 font-15"></i>{i.timeAgo || moment(i.createTime).format("YYYY/MM/DD")}</span>
</span>
<span className="s-info-right">

View File

@ -97,14 +97,6 @@ function Source(props){
setPage(1);
}
function addSource(){
if(role && role.role === "Manager"){
window.open(role.resourceManageUrl);
}else{
history.push(`/zone/${deptId}/source/add`)
}
}
return(
<div className={`${temp}_source_box ${isNSCC ? "NSCC_source_box" : ""}`}>
<div className="source_h">
@ -128,10 +120,10 @@ function Source(props){
enterButton={temp === "zone" ? <span><i className="iconfont icon-sousuo5 font-15"/>搜索</span> :undefined}
/>}
{role && role.role !== "None" && <div className='createButs ml20'>
{role.role === "Member" && <Button size='large' type="primary" ghost className='mr20'>
<Link to={`/zone/${deptId}/source/self`}>我的资源</Link>
</Button>}
<Button size='large' icon={role.role === "Member" && 'plus'} type="primary" ghost onClick={addSource}>{role.role === "Member" ? '新建' : '管理资源'}</Button>
<Button size='large' type="primary" ghost className='mr20'>
<Link to={`/zone/${deptId}/source/self`}>{role.role === "Member" ? '我的' : '管理'}资源</Link>
</Button>
<Button size='large' icon={'plus'} type="primary" href={`/zone/${deptId}/source/add`} ghost>新建</Button>
</div>}
</div>
</div>

View File

@ -3,7 +3,7 @@ import { Breadcrumb, Button, Form, Icon, Input, message, Select, Upload } from '
import { getZoneUrl } from 'educoder';
import '../index.scss';
import { Link } from 'react-router-dom';
import { getTypeByFileId, getSourceZoneList, addResource, getSourceDetailByAu , getSourceDetailByM , updateMyResource , updateManageResource } from '../api';
import { getTypeByFileId, getSourceZoneList, addResource , addManageResource, getSourceDetailByAu , getSourceDetailByM , updateMyResource , updateManageResource } from '../api';
function SourceCreate(props){
const {history, id, role, current_user} = props;
@ -111,15 +111,14 @@ function SourceCreate(props){
}
return;
}
addResource(params).then((res)=>{
const {data:{code, msg, data}} = res;
if(code === 200){
message.success("提交成功");
history.push(`/zone/${deptId}/source/${data.id}`);
}else{
message.error(msg || '提交失败,请联系管理员!')
}
})
let res = (role && role.role === "Member") ? await addResource(params) : await addManageResource(params);
const {data:{code, msg, data}} = res;
if(code === 200){
message.success("提交成功");
history.push(`/zone/${deptId}/source/${data.id}`);
}else{
message.error(msg || '提交失败,请联系管理员!')
}
})
}

View File

@ -225,6 +225,14 @@ export function addResource(data) {
data: data
});
}
// 保存资源(管理员)
export function addManageResource(data){
return fetch({
url: `/zone/resource`,
method: 'post',
data: data
});
}
export function getSourceTypeList(id){
return fetch({
url:`/zone/open/${id}/resourceType/list`,
@ -339,7 +347,14 @@ export function updateDoc(id, data) {
data: data
});
}
// 获取待审核、已通过、未通过资源列表
export function getSourceManage(params){
return fetch({
url:`/zone/resource/list`,
method: 'get',
params
})
}
// 获取资源详细信息(需要用户权限)
export function getSourceDetailByAu(id){
return fetch({

View File

@ -14,8 +14,8 @@ function beforeFetch(actionUrl){
const service = axios.create(config);
service.interceptors.request.use(request => {
let deptId = sessionStorage.getItem('deptId')
// request.headers.Authorization = '752c217562d13940a37e20d2f48c186e5bc56323'
let deptId = sessionStorage.getItem('deptId');
// request.headers.Authorization = 'c2361e926a027ef8f6beeca3bc03daf905b5685e'
if (deptId) {
// 用于权限区分
request.headers['Dept-Id'] = deptId

Binary file not shown.

After

Width:  |  Height:  |  Size: 190 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 411 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.7 MiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 265 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 326 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 428 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 189 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 419 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 377 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.1 MiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 252 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.0 MiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 898 KiB

View File

@ -175,6 +175,8 @@ function Index(props){
}
setData(data);
document.title= data && data.mainTitle;
// deptIdheader
sessionStorage.setItem('deptId', data.deptId)
if(data && data.id){
setId(data.id);
@ -182,8 +184,6 @@ function Index(props){
getRole(data.id)
}
configShareForCustom(data.mainTitle, data.subTitle, data.introductionImage)
// deptIdheader
sessionStorage.setItem('deptId', data.deptId)
setSeoMeta(`${data.name},`, data.name, data.subTitle, `/zone/${deptId}`)
}
}).catch(console.error())
@ -203,6 +203,7 @@ function Index(props){
if(current_user && current_user.login){
getCurrentRole(id).then(res=>{
setRole(res.data.data);
sessionStorage.setItem('deptId', res.data.data.deptId);
}).catch(error=>{})
}
}