forked from Gitlink/forgeplus-react
对接后端数据
This commit is contained in:
parent
e4005a03b3
commit
3f6165585d
|
@ -258,3 +258,9 @@ export function publicSearchs(Placeholder,onSearch,onInputs,onChanges,loadings)
|
|||
allowClear={true}
|
||||
></Search>)
|
||||
}
|
||||
|
||||
export function getUrlToken(name, str) {
|
||||
const reg = new RegExp(`(^|&)${ name}=([^&]*)(&|$)`);
|
||||
const r = str.substr(1).match(reg);
|
||||
if (r != null) return decodeURIComponent(r[2]); return null;
|
||||
}
|
|
@ -6,7 +6,7 @@ export {
|
|||
getUploadLogoActionUrl as getUploadLogoActionUrl,
|
||||
getImageUrl as getImageUrl,getImage as getImage, getmyUrl as getmyUrl, getRandomNumber as getRandomNumber, getUrl as getUrl, publicSearchs as publicSearchs, getRandomcode as getRandomcode, getUrlmys as getUrlmys, getUrl2 as getUrl2, setImagesUrl as setImagesUrl
|
||||
, getUploadActionUrl as getUploadActionUrl, getUploadActionUrltwo as getUploadActionUrltwo, getUploadActionUrlthree as getUploadActionUrlthree, getUploadActionUrlOfAuth as getUploadActionUrlOfAuth
|
||||
, getTaskUrlById as getTaskUrlById, TEST_HOST, htmlEncode as htmlEncode, getupload_git_file as getupload_git_file, getcdnImageUrl as getcdnImageUrl,getTestImage as getTestImage,getLogoImageUrl as getLogoImageUrl
|
||||
, getTaskUrlById as getTaskUrlById, TEST_HOST, htmlEncode as htmlEncode, getupload_git_file as getupload_git_file, getcdnImageUrl as getcdnImageUrl,getTestImage as getTestImage,getLogoImageUrl as getLogoImageUrl,getUrlToken as getUrlToken
|
||||
} from './UrlTool';
|
||||
|
||||
export { setmiyah as setmiyah } from './Component';
|
||||
|
|
|
@ -2,7 +2,7 @@ import React, { memo, useState, useEffect } from 'react';
|
|||
import { Collapse, Button } from 'antd';
|
||||
import moment from 'moment';
|
||||
import Line from '../Line';
|
||||
import { getTaskCategory } from '../../military/task/api';
|
||||
import { getTaskCategory, getTaskAdminList } from '../../military/task/api';
|
||||
import { taskModeIdArr } from '../../military/task/static';
|
||||
|
||||
import './index.scss';
|
||||
|
@ -51,11 +51,27 @@ function getSomeDayAfter(initailDate, nDay) {
|
|||
return moment(new Date(initailDate).setDate(new Date(initailDate).getDate() + nDay)).format('YYYY-MM-DD');
|
||||
}
|
||||
|
||||
function FifthSection({ fifth,history }) {
|
||||
function FifthSection({ fifth, history }) {
|
||||
|
||||
const [taskCategoryArr, setTaskCategoryArr] = useState([]);
|
||||
const [taskArr, serTaskArr] = useState(taskArrMock);
|
||||
|
||||
useEffect(() => {
|
||||
const params = {
|
||||
curPage: 1,
|
||||
pageSize: 3,
|
||||
orderBy: 'visitsDesc',
|
||||
isDelete: '0',
|
||||
recommend: '1',
|
||||
};
|
||||
getTaskAdminList(params).then(data => {
|
||||
if (data) {
|
||||
serTaskArr(data.rows);
|
||||
}
|
||||
})
|
||||
}, []);
|
||||
|
||||
|
||||
// 获取分类数据
|
||||
useEffect(() => {
|
||||
getTaskCategory().then(data => {
|
||||
|
@ -102,6 +118,11 @@ function FifthSection({ fifth,history }) {
|
|||
});
|
||||
}, []);
|
||||
|
||||
function goTask(item){
|
||||
history.push(`/task?type=${item.id}`)
|
||||
// console.log(item);
|
||||
}
|
||||
|
||||
|
||||
return (
|
||||
<React.Fragment>
|
||||
|
@ -110,7 +131,7 @@ function FifthSection({ fifth,history }) {
|
|||
<ul className="icon-circle">
|
||||
{
|
||||
taskCategoryArr.map((item, i) => {
|
||||
return (<li key={item.id}>
|
||||
return (<li key={item.id} onClick={()=>{goTask(item)}}>
|
||||
<i className={`iconfont icon-${item.icon}`}></i>
|
||||
<span>{item.name}</span>
|
||||
</li>)
|
||||
|
@ -145,7 +166,7 @@ function FifthSection({ fifth,history }) {
|
|||
taskArr.map((item, i) => {
|
||||
return (
|
||||
<Panel header={item.name} key={i + 1 + ''}>
|
||||
<p className="collapse-des">{item.name}</p>
|
||||
<p className="collapse-des ellipsis-2" dangerouslySetInnerHTML={{ __html: item.description }}></p>
|
||||
<div className="collapse-content">
|
||||
<p className="collapse-content-item">
|
||||
<i className="iconfont icon-quxiaoguanzhu"></i>
|
||||
|
@ -163,86 +184,21 @@ function FifthSection({ fifth,history }) {
|
|||
<i className="iconfont icon-quxiaoguanzhu"></i>
|
||||
<span >截止时间</span>
|
||||
<span className="collapse-content-time">{getSomeDayAfter(item.publishedAt || item.createdAt, item.collectingDays)}</span>
|
||||
<Button className="collapse-detail" onClick={() => { history.push(`/task/taskDetail/${item.id}`) }}>详情</Button>
|
||||
</p>
|
||||
</div>
|
||||
</Panel>
|
||||
)
|
||||
})
|
||||
}
|
||||
{/* <Panel header="多样化目标识别及网络化协同控制仿真验证模块开发" key="1">
|
||||
<p className="collapse-des">研发配置要求为包含网络化协同控制仿真验证与多样化目标识别仿真验证模块的1套软件和1份测试报告。</p>
|
||||
<div className="collapse-content">
|
||||
<p className="collapse-content-item">
|
||||
<i className="iconfont icon-quxiaoguanzhu"></i>
|
||||
<span >单人悬赏</span>
|
||||
<span className="collapse-content-money">¥ 240000</span>
|
||||
</p>
|
||||
|
||||
<p className="collapse-content-item">
|
||||
<i className="iconfont icon-quxiaoguanzhu"></i>
|
||||
<span >发布时间</span>
|
||||
<span className="collapse-content-time">2021-05-20</span>
|
||||
</p>
|
||||
|
||||
<p className="collapse-content-item">
|
||||
<i className="iconfont icon-quxiaoguanzhu"></i>
|
||||
<span >截止时间</span>
|
||||
<span className="collapse-content-time">2021-06-20</span>
|
||||
</p>
|
||||
</div>
|
||||
</Panel>
|
||||
|
||||
<Panel header="开源项目群体智能学习数据集征集" key="2">
|
||||
<p className="collapse-des">研发配置要求为包含网络化协同控制仿真验证与多样化目标识别仿真验证模块的1套软件和1份测试报告。</p>
|
||||
<div className="collapse-content">
|
||||
<p className="collapse-content-item">
|
||||
<i className="iconfont icon-quxiaoguanzhu"></i>
|
||||
<span >单人悬赏</span>
|
||||
<span className="collapse-content-money">¥ 240000</span>
|
||||
</p>
|
||||
|
||||
<p className="collapse-content-item">
|
||||
<i className="iconfont icon-quxiaoguanzhu"></i>
|
||||
<span >发布时间</span>
|
||||
<span className="collapse-content-time">2021-05-20</span>
|
||||
</p>
|
||||
|
||||
<p className="collapse-content-item">
|
||||
<i className="iconfont icon-quxiaoguanzhu"></i>
|
||||
<span >截止时间</span>
|
||||
<span className="collapse-content-time">2021-06-20</span>
|
||||
</p>
|
||||
</div>
|
||||
</Panel>
|
||||
<Panel header="机器人仿真的高效碰撞检测算法" key="3">
|
||||
<p className="collapse-des">研发配置要求为包含网络化协同控制仿真验证与多样化目标识别仿真验证模块的1套软件和1份测试报告。</p>
|
||||
<div className="collapse-content">
|
||||
<p className="collapse-content-item">
|
||||
<i className="iconfont icon-quxiaoguanzhu"></i>
|
||||
<span >单人悬赏</span>
|
||||
<span className="collapse-content-money">¥ 240000</span>
|
||||
</p>
|
||||
|
||||
<p className="collapse-content-item">
|
||||
<i className="iconfont icon-quxiaoguanzhu"></i>
|
||||
<span >发布时间</span>
|
||||
<span className="collapse-content-time">2021-05-20</span>
|
||||
</p>
|
||||
|
||||
<p className="collapse-content-item">
|
||||
<i className="iconfont icon-quxiaoguanzhu"></i>
|
||||
<span >截止时间</span>
|
||||
<span className="collapse-content-time">2021-06-20</span>
|
||||
</p>
|
||||
</div>
|
||||
</Panel> */}
|
||||
</Collapse>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
<div className="text-center">
|
||||
<Button className="homepage-btn " type="primary" onClick={()=>{history.push('/task')}}>寻找创客 <i className="iconfont icon-gengduoicon"></i></Button>
|
||||
<Button className="homepage-btn " type="primary" onClick={() => { history.push('/task') }}>寻找创客 <i className="iconfont icon-gengduoicon"></i></Button>
|
||||
</div>
|
||||
|
||||
<svg className="waves waves-low "
|
||||
|
|
|
@ -301,6 +301,8 @@ $bgcolorlist:#254dea #e33230 #0766fb #f02c66 #6038ff #f85e55 #c13cff #2cb840 #57
|
|||
line-height: 28px;
|
||||
font-weight: 400;
|
||||
margin-bottom: 0.5em !important;
|
||||
|
||||
|
||||
}
|
||||
.collapse-content {
|
||||
padding: 12px;
|
||||
|
@ -308,6 +310,7 @@ $bgcolorlist:#254dea #e33230 #0766fb #f02c66 #6038ff #f85e55 #c13cff #2cb840 #57
|
|||
border-radius: 4px;
|
||||
|
||||
.collapse-content-item {
|
||||
position: relative;
|
||||
height: 30px;
|
||||
line-height: 30px;
|
||||
font-weight: 400;
|
||||
|
@ -324,6 +327,13 @@ $bgcolorlist:#254dea #e33230 #0766fb #f02c66 #6038ff #f85e55 #c13cff #2cb840 #57
|
|||
margin-left: 16px;
|
||||
}
|
||||
}
|
||||
|
||||
.collapse-detail{
|
||||
color: #4154f1;
|
||||
border-color: #4154f1;
|
||||
position: absolute;
|
||||
right: 20px;
|
||||
}
|
||||
.waves {
|
||||
position: relative;
|
||||
bottom: -10px;
|
||||
|
|
|
@ -2,7 +2,6 @@ import React, { memo, useEffect, useState } from 'react';
|
|||
import { Button } from 'antd';
|
||||
import './index.scss';
|
||||
|
||||
// import circle from '../img/circle.png';
|
||||
import circle from '../img/1-circle.png';
|
||||
import code1 from '../img/1-code.png';
|
||||
import codeBed from '../img/1-code-bed.png';
|
||||
|
@ -40,6 +39,15 @@ function FirstSection({ first }) {
|
|||
}, [first]);
|
||||
|
||||
|
||||
function goNext(){
|
||||
window.scrollTo({
|
||||
letf:0,
|
||||
top:document.querySelector(".home-second-section").offsetTop,
|
||||
behavior:"smooth"
|
||||
}
|
||||
)
|
||||
}
|
||||
|
||||
return (
|
||||
<div className={`grid-picture ${first ? "active" : ""}`}>
|
||||
<div className="homepage-main website-content">
|
||||
|
@ -54,29 +62,26 @@ function FirstSection({ first }) {
|
|||
</div>
|
||||
<div className="website-des">红山开源是一个依托互联网群体智慧实现世界范围内资源深度融合、开放共享和协同创新的开源社区,是集开源项目演化发展、科研任务众包、竞赛组织选拔和社区开放交流为一体的创新科研服务平台。红山开源致力于打造一个“开放、汇聚、协同、众创”的生态空间。
|
||||
</div>
|
||||
<Button className="website-more homepage-btn" type="primary">了解详情</Button>
|
||||
<Button className="website-more homepage-btn" type="primary" onClick={goNext}>了解详情</Button>
|
||||
</div>
|
||||
|
||||
<div className={`play-img ${circulation}`}>
|
||||
<img className="play-text3" src={text3}></img>
|
||||
<img className="play-text4" src={text4}></img>
|
||||
<img className="play-logo" src={logo}></img>
|
||||
<img id="playGlass" className="play-glass" src={glass}></img>
|
||||
|
||||
<img className="play-code-bed" src={codeBed}></img>
|
||||
<img className="play-code1" src={code1}></img>
|
||||
|
||||
<img className="play-circle" src={circle}></img>
|
||||
<img alt="images-not_found" className="play-text3" src={text3}></img>
|
||||
<img alt="images-not_found" className="play-text4" src={text4}></img>
|
||||
<img alt="images-not_found" className="play-logo" src={logo}></img>
|
||||
<img alt="images-not_found" id="playGlass" className="play-glass" src={glass}></img>
|
||||
<img alt="images-not_found" className="play-code-bed" src={codeBed}></img>
|
||||
<img alt="images-not_found" className="play-code1" src={code1}></img>
|
||||
<img alt="images-not_found" className="play-circle" src={circle}></img>
|
||||
<div className="play-circle-circle1"></div>
|
||||
<div className="play-circle-circle2"></div>
|
||||
<div className="play-circle-circle3"></div>
|
||||
|
||||
<img className="play-box4" src={box4}></img>
|
||||
<img className="play-box3" src={box3}></img>
|
||||
<img className="play-box2" src={box2}></img>
|
||||
<img className="play-box1" src={box1}></img>
|
||||
<img className="play-text1" src={text1}></img>
|
||||
<img className="play-text2" src={text2}></img>
|
||||
<img alt="images-not_found" className="play-box4" src={box4}></img>
|
||||
<img alt="images-not_found" className="play-box3" src={box3}></img>
|
||||
<img alt="images-not_found" className="play-box2" src={box2}></img>
|
||||
<img alt="images-not_found" className="play-box1" src={box1}></img>
|
||||
<img alt="images-not_found" className="play-text1" src={text1}></img>
|
||||
<img alt="images-not_found" className="play-text2" src={text2}></img>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
@ -91,7 +96,6 @@ function FirstSection({ first }) {
|
|||
<use xlinkHref="#gentle-wave" x="48" y="3" fill="rgba(255,255,255,0.5)" />
|
||||
<use xlinkHref="#gentle-wave" x="48" y="5" fill="rgba(255,255,255,0.4)" />
|
||||
<use xlinkHref="#gentle-wave" x="48" y="7" fill="#fff" /> */}
|
||||
|
||||
{/* <use xlinkHref="#wave-path" x="50" y="0" fill="rgba(255,255,255,0.7" /> */}
|
||||
<use xlinkHref="#wave-path" x="50" y="3" fill="rgba(255,255,255,0.6)" />
|
||||
<use xlinkHref="#wave-path" x="50" y="0" fill="rgba(255,255,255,0.45)" />
|
||||
|
|
|
@ -4,12 +4,14 @@ import React, { memo } from "react";
|
|||
import './index.scss';
|
||||
|
||||
function HomeFooter() {
|
||||
let chromesettingArray = JSON.parse(localStorage.getItem('chromesetting'));
|
||||
let footerHtml= chromesettingArray.footer;
|
||||
|
||||
return (
|
||||
<div className="home-footer homePage">
|
||||
<div className="arc"></div>
|
||||
<div className="homepage-main footer-main">
|
||||
{/* <img className="logo" src={logo} alt="红山开源"></img> */}
|
||||
<p>
|
||||
<div className="homepage-main footer-main" dangerouslySetInnerHTML={{__html:footerHtml}}>
|
||||
{/* <p>
|
||||
<span className="mr15"><i className="iconfont icon-weibiaoti- font-16"></i>+86-010-66357650</span>
|
||||
<span className="mr15"><i className="iconfont icon-xiazai18 font-16"></i> 北京市海淀区西三环北路72号</span>
|
||||
<span className="footer-email mr15"><i className="iconfont icon-mail font-16"></i>osredm@163.com</span>
|
||||
|
@ -21,18 +23,8 @@ function HomeFooter() {
|
|||
<img className="police-img" src="https://forge.osredm.com/police.png" />京公网安备 11010802034576 号</a>
|
||||
<a className="police-number" href="https://beian.miit.gov.cn/#/Integrated/index">京ICP备2021005060</a>
|
||||
</p>
|
||||
</div>
|
||||
{/* <p className="mb10">
|
||||
style="width: 100%;height: 92px;background-color: #323232;color: #ccc;padding-top: 25px;"
|
||||
<span className="mr15"><i className="iconfont icon-weibiaoti- font-16"></i>+86-010-66357650</span>
|
||||
<span className="mr15"><i className="iconfont icon-mail font-16"></i>osredm@163.com</span>
|
||||
<span className="mr15"><i className="iconfont icon-xiazai18 font-16"></i> 北京市海淀区西三环北路72号</span>
|
||||
</p>
|
||||
<p>版权所有:红山开源社区
|
||||
<a href="http://www.beian.gov.cn/portal/registerSystemInfo?recordcode=11010802034576" style="color: #ccc; margin-right: 20px;">
|
||||
<img src="https://forge.osredm.com/police.png" style="width: 16px;border-radius: 10px;margin-right: 3px" />京公网安备 11010802034576 号</a>
|
||||
<a href="https://beian.miit.gov.cn/#/Integrated/index" style="color: #ccc">京ICP备2021005060</a>
|
||||
</p> */}
|
||||
*/}
|
||||
</div>
|
||||
</div>
|
||||
)
|
||||
}
|
||||
|
|
|
@ -25,7 +25,7 @@
|
|||
flex-direction: column;
|
||||
justify-content: center;
|
||||
align-items: center;
|
||||
height: 25vh;
|
||||
height: 18vh;
|
||||
font-size: 12px;
|
||||
font-family: PingFangSC-Regular, PingFang SC;
|
||||
font-weight: 400;
|
||||
|
@ -51,4 +51,8 @@
|
|||
margin-right: 2px;
|
||||
}
|
||||
}
|
||||
|
||||
.footerbottom{
|
||||
background-color:#162046 !important;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -70,9 +70,9 @@ function SecondSection({ second ,main_web_site_url}) {
|
|||
<i className="iconfont icon-quxiaoguanzhu"></i>
|
||||
</h3>
|
||||
|
||||
<h4 className="community-left-tit" onClick={() => { goDetail(leftItem.fake_id) }}>{leftItem.title}</h4>
|
||||
<h4 className="community-left-tit link" onClick={() => { goDetail(leftItem.fake_id) }}>{leftItem.title}</h4>
|
||||
|
||||
<div className="community-left-content">
|
||||
<div className="community-left-content ellipsis-8">
|
||||
{leftItem.content}
|
||||
</div>
|
||||
|
||||
|
@ -89,11 +89,11 @@ function SecondSection({ second ,main_web_site_url}) {
|
|||
<div className="news-slide-item" key={i}>
|
||||
<div className="slide-title" onClick={() => { goDetail(item.fake_id) }}>
|
||||
<span className="order-num">{i + 1}</span>
|
||||
<h3 className="slide-title-content ellipsis-1">{item.title}</h3>
|
||||
<h3 className="slide-title-content ellipsis-1 link">{item.title}</h3>
|
||||
<span className={`slide-tag slide-tag-${item.type}`}>{item.tag}</span>
|
||||
</div>
|
||||
<p className="ellipsis-2">{item.content}</p>
|
||||
<span className="news-time">{item.created_time}</span>
|
||||
<span className="news-time">{item.created_time && item.created_time.split(' ')[0]}</span>
|
||||
</div>
|
||||
)
|
||||
})
|
||||
|
|
|
@ -25,7 +25,7 @@ let setting = {
|
|||
}
|
||||
|
||||
|
||||
function SeventhSection({main_web_site_url}) {
|
||||
function SeventhSection({ main_web_site_url }) {
|
||||
|
||||
const [list, setList] = useState([]);
|
||||
|
||||
|
@ -55,7 +55,7 @@ function SeventhSection({main_web_site_url}) {
|
|||
<div className="clients">
|
||||
{
|
||||
list.map((item, i) => {
|
||||
return (<img className="client" key={i} src={getTestImage(item.image_url)} onClick={() => { goDetail(item.fake_login) }} alt="images-not_found" />)
|
||||
return (<img className="client link" key={i} src={getTestImage(item.image_url)} onClick={() => { goDetail(item.fake_login) }} alt="images-not_found" />)
|
||||
})
|
||||
}
|
||||
<i className="start-icon iconfont icon-a-shuangyinhao12x"></i>
|
||||
|
@ -66,18 +66,18 @@ function SeventhSection({main_web_site_url}) {
|
|||
{
|
||||
list.map((item, i) => {
|
||||
return (<div className="issue-item" key={i} >
|
||||
<img className="author-head" src={getTestImage(item.image_url)} onClick={() => { goDetail(item.fake_login) }} alt="images-not_found"/>
|
||||
<span className="issue-author" onClick={() => { goDetail(item.fake_login) }}>{item.name}</span>
|
||||
<img className="author-head link" src={getTestImage(item.image_url)} onClick={() => { goDetail(item.fake_login) }} alt="images-not_found" />
|
||||
<span className="issue-author link" onClick={() => { goDetail(item.fake_login) }}>{item.name}</span>
|
||||
<h3 className="issue-title ellipsis-1">{item.announcement}</h3>
|
||||
<p className="issue-content ellipsis-5">{item.content}</p>
|
||||
<span className="issue-time">{item.created_time&&item.created_time.split(' ')[0]}</span>
|
||||
<span className="issue-time">{item.created_time && item.created_time.split(' ')[0]}</span>
|
||||
</div>)
|
||||
})
|
||||
}
|
||||
|
||||
</Slider>
|
||||
|
||||
<Button className="homepage-btn" type="primary" onClick={() => { window.open(`${main_web_site_url}/forums`)}}>参与交流 <i className="iconfont icon-gengduoicon"></i></Button>
|
||||
<Button className="homepage-btn" type="primary" onClick={() => { window.open(`${main_web_site_url}/forums`) }}>参与交流 <i className="iconfont icon-gengduoicon"></i></Button>
|
||||
|
||||
</div>
|
||||
|
||||
|
|
|
@ -12,12 +12,13 @@
|
|||
height: 500px;
|
||||
left: 0;
|
||||
bottom: 40px;
|
||||
z-index: 10;
|
||||
// z-index: 10;
|
||||
.client {
|
||||
position: absolute;
|
||||
width: 100px;
|
||||
height: 100px;
|
||||
border-radius: 50%;
|
||||
z-index: 100;
|
||||
}
|
||||
|
||||
.client:nth-child(1) {
|
||||
|
@ -60,10 +61,12 @@
|
|||
top: 50px;
|
||||
left: 280px;
|
||||
transform: rotateY(180deg);
|
||||
z-index: 100;
|
||||
}
|
||||
.end-icon {
|
||||
bottom: 130px;
|
||||
right: 330px;
|
||||
z-index: 100;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -47,9 +47,9 @@ function SixthSection({ sixth, main_web_site_url }) {
|
|||
<div className="des-item" key={i}>
|
||||
<img className="des-item-img" alt="竞赛" src={iconArr[i]}></img>
|
||||
<div className="des-item-content">
|
||||
<h4 className="des-item-title ellipsis-1" onClick={() => { goDetail(item.id) }}>{item.title}</h4>
|
||||
<h4 className="des-item-title ellipsis-1 link" onClick={() => { goDetail(item.id) }}>{item.title}</h4>
|
||||
<p className="des-item-time">竞赛时间:{item.start_time && item.start_time.split(' ')[0]}-{item.end_time && item.end_time.split(' ')[0]}</p>
|
||||
<p className="des-item-intro ellipsis-2">赛事简介: {item.content}</p>
|
||||
<p className="des-item-intro ellipsis-2">赛事简介: {item.content||'暂无简介'}</p>
|
||||
</div>
|
||||
</div>
|
||||
)
|
||||
|
|
|
@ -20,7 +20,7 @@
|
|||
-webkit-box-orient: vertical;
|
||||
}
|
||||
|
||||
// 8行省略号
|
||||
// 5行省略号
|
||||
.ellipsis-5 {
|
||||
text-overflow: -o-ellipsis-lastline;
|
||||
overflow: hidden;
|
||||
|
@ -31,6 +31,21 @@
|
|||
-webkit-box-orient: vertical;
|
||||
}
|
||||
|
||||
// 8行省略号
|
||||
.ellipsis-8 {
|
||||
text-overflow: -o-ellipsis-lastline;
|
||||
overflow: hidden;
|
||||
text-overflow: ellipsis;
|
||||
display: -webkit-box;
|
||||
-webkit-line-clamp: 8;
|
||||
line-clamp:8;
|
||||
-webkit-box-orient: vertical;
|
||||
}
|
||||
|
||||
.link{
|
||||
cursor: pointer;
|
||||
}
|
||||
|
||||
.ant-btn-primary {
|
||||
background-color: #4154f1;
|
||||
border-color: #4154f1;
|
||||
|
|
|
@ -1,10 +1,10 @@
|
|||
import React, { useEffect, useState,memo } from 'react';
|
||||
import React, { useEffect, useState, memo } from 'react';
|
||||
import classNames from 'classnames';
|
||||
import './index.scss';
|
||||
|
||||
export default memo((props) => {
|
||||
const { title, options, changeOptionId, type ,size} = props;
|
||||
const [option, setOption] = useState({ code: "", dicItemName: "" ,dicItemCode:""});
|
||||
const { title, options, changeOptionId, type, size, defaultOption } = props;
|
||||
const [option, setOption] = useState(defaultOption || { code: "", dicItemName: "", dicItemCode: "" });
|
||||
|
||||
useEffect(() => {
|
||||
changeOptionId(option, type);
|
||||
|
@ -12,13 +12,13 @@ export default memo((props) => {
|
|||
|
||||
return (
|
||||
|
||||
<div className={classNames({"choose-box":true,"choose-box-big":size})}>
|
||||
<div className={classNames({ "choose-box": true, "choose-box-big": size })}>
|
||||
<div className="choose-title">{title}</div>
|
||||
<div className="choose-list">
|
||||
<div className={classNames({ "choose-item-checked": option.dicItemCode === "", "choose-item": true })} key={"all"} onClick={() => { setOption({ dicItemCode: "", dicItemName: "" }) }}>全部</div>
|
||||
{
|
||||
options.map((item) => {
|
||||
return <div className={classNames({ "choose-item-checked": option.dicItemCode === item.dicItemCode, "choose-item": true })} key={item.dicItemCode} onClick={() => { setOption(item) }} >{item.dicItemName}</div>
|
||||
return <div className={classNames({ "choose-item-checked": option.dicItemCode == item.dicItemCode, "choose-item": true })} key={item.dicItemCode} onClick={() => { setOption(item) }} >{item.dicItemName}</div>
|
||||
})
|
||||
}
|
||||
</div>
|
||||
|
|
|
@ -160,6 +160,13 @@ export function deleteTask(id, isDelete) {
|
|||
});
|
||||
}
|
||||
|
||||
//推荐
|
||||
export function recommendTask(id, recommend) {
|
||||
return fetch({
|
||||
url: '/api/tasks/backend/changeTaskRecommendedStatus/' + id + '?recommend=' + recommend,
|
||||
method: 'PUT',
|
||||
});
|
||||
}
|
||||
|
||||
//新增成果
|
||||
export function addPaper(data) {
|
||||
|
|
|
@ -4,7 +4,7 @@ import { Input, Select, Button, Form, DatePicker, Table, Pagination, Modal } fro
|
|||
import { Link } from "react-router-dom";
|
||||
|
||||
import { paperCheckStatusArr, publishModeArr, taskStatusAllArr, showUserModeArr, main_web_site_url } from '../static';
|
||||
import { getTaskAdminList, changeShowUserMode, deleteTask } from '../api';
|
||||
import { getTaskAdminList, changeShowUserMode, deleteTask, recommendTask } from '../api';
|
||||
import '../index.scss';
|
||||
import './index.scss';
|
||||
const format = "YYYY-MM-DD HH:mm:ss";
|
||||
|
@ -29,6 +29,7 @@ export default Form.create()(({ form, showNotification, match, history }) => {
|
|||
const [publishMode, setPublishMode] = useState('');
|
||||
const [showUserMode, setShowUserMode] = useState('');
|
||||
const [isDelete, setIsDelete] = useState('0');
|
||||
const [recommend, setRecommend] = useState('');
|
||||
|
||||
const [sort, setSort] = useState('Desc');
|
||||
const [order, setOrder] = useState('createdAt');
|
||||
|
@ -48,6 +49,7 @@ export default Form.create()(({ form, showNotification, match, history }) => {
|
|||
pageSize: 10,
|
||||
orderBy: order + sort,
|
||||
isDelete,
|
||||
recommend,
|
||||
};
|
||||
setLoading(true);
|
||||
getTaskAdminList(params).then(data => {
|
||||
|
@ -57,7 +59,7 @@ export default Form.create()(({ form, showNotification, match, history }) => {
|
|||
}
|
||||
setLoading(false);
|
||||
})
|
||||
}, [statusString, order, sort, publishMode, showUserMode, curPage, searchObj, isDelete, reload]);
|
||||
}, [statusString, order, sort, publishMode, showUserMode, curPage, searchObj, isDelete, reload ,recommend]);
|
||||
|
||||
|
||||
const helper = useCallback(
|
||||
|
@ -205,8 +207,13 @@ export default Form.create()(({ form, showNotification, match, history }) => {
|
|||
<React.Fragment>
|
||||
|
||||
{
|
||||
isDelete == '0' ? <Button className="mr5 font-12" type="danger" size="small" onClick={() => { deletItem(record.id, '1') }}>隐藏</Button>
|
||||
: <Button className="mr5 font-12" type="primary" size="small" onClick={() => { deletItem(record.id, '0') }}>恢复</Button>
|
||||
isDelete == '0' ? <Button className="mr5 font-12" type="danger" size="small" onClick={() => { deleteItem(record.id, '1') }}>隐藏</Button>
|
||||
: <Button className="mr5 font-12" type="primary" size="small" onClick={() => { deleteItem(record.id, '0') }}>恢复</Button>
|
||||
}
|
||||
|
||||
{
|
||||
record.recommend ? <Button className="mr5 font-12" type="danger" size="small" onClick={() => { recommendItem(record.id, '0') }}>撤销推荐</Button>
|
||||
: <Button className="mr5 font-12" type="primary" size="small" onClick={() => { recommendItem(record.id, '1') }}>首页推荐</Button>
|
||||
}
|
||||
|
||||
{/* <Link className="line_1 color-grey3" to={`/task/taskDetail/${record.taskId}`}>查看</Link> */}
|
||||
|
@ -216,8 +223,24 @@ export default Form.create()(({ form, showNotification, match, history }) => {
|
|||
]
|
||||
}, [isDelete]);
|
||||
|
||||
function recommendItem(id, recommend) {
|
||||
Modal.confirm({
|
||||
title: "警告",
|
||||
content: recommend == '0' ? "确认撤销该推荐吗 ?撤销后首页中将不再展示该任务" : "确认推荐吗?推荐后,用户可以在首页看到推荐任务中点击量前三的任务!",
|
||||
okText: '确定',
|
||||
cancelText: '取消',
|
||||
onOk() {
|
||||
recommendTask(id, recommend).then(res => {
|
||||
if (res.message === 'success') {
|
||||
showNotification('操作成功!');
|
||||
setReload(Math.random());
|
||||
}
|
||||
});
|
||||
},
|
||||
});
|
||||
}
|
||||
|
||||
function deletItem(id, isDelete) {
|
||||
function deleteItem(id, isDelete) {
|
||||
Modal.confirm({
|
||||
title: "警告",
|
||||
content: isDelete == '0' ? "确认恢复该任务吗?恢复后用户可以重新看到该任务!" : "确认隐藏?隐藏后用户无法看到该任务!",
|
||||
|
@ -261,7 +284,16 @@ export default Form.create()(({ form, showNotification, match, history }) => {
|
|||
const changeShow = useCallback((isDelete) => {
|
||||
setIsDelete(isDelete);
|
||||
setCurPage(1);
|
||||
})
|
||||
});
|
||||
|
||||
const changeRecommend = useCallback((recommend) => {
|
||||
if (recommend === 'all') {
|
||||
setRecommend('');
|
||||
} else {
|
||||
setRecommend(recommend);
|
||||
}
|
||||
setCurPage(1);
|
||||
});
|
||||
|
||||
function downloadFile() {
|
||||
window.open(main_web_site_url + '/admin/tasks.xlsx');
|
||||
|
@ -334,6 +366,19 @@ export default Form.create()(({ form, showNotification, match, history }) => {
|
|||
</Select>
|
||||
</Form.Item>
|
||||
|
||||
<Form.Item className="inline-form" label="是否推荐">
|
||||
<Select
|
||||
style={{ width: '200px' }}
|
||||
showArrow
|
||||
onChange={changeRecommend}
|
||||
defaultValue='all'
|
||||
>
|
||||
<Option key={'all'} >全部</Option>
|
||||
<Option key={'0'} >未推荐</Option>
|
||||
<Option key={'1'} >已推荐</Option>
|
||||
</Select>
|
||||
</Form.Item>
|
||||
|
||||
<Form.Item className="inline-form" label="排序">
|
||||
<Select
|
||||
style={{ width: '200px' }}
|
||||
|
|
|
@ -389,7 +389,7 @@ export default Form.create()(
|
|||
<div className="clearfix tasks_status_father mb30" style={{ background: "#FAFAFA" }}>
|
||||
|
||||
<ul className="tasks_status clearfix">
|
||||
<li className="active"><span>发布任务</span></li>
|
||||
<li className="active"><span>需求提报</span></li>
|
||||
|
||||
{process('成果提交', 3, detailData.collectingDays)}
|
||||
|
||||
|
|
|
@ -268,7 +268,7 @@ export default Form.create()(forwardRef(({ current_user, form, showNotification,
|
|||
<div className="head-navigation">
|
||||
<Link to="/task">创客空间 ></Link>
|
||||
<Link to="/task">任务大厅 ></Link>
|
||||
<span >发布任务 </span>
|
||||
<span >需求提报 </span>
|
||||
</div>
|
||||
<p className="font-18 font-bd mb15">任务提交</p>
|
||||
|
||||
|
@ -423,7 +423,7 @@ export default Form.create()(forwardRef(({ current_user, form, showNotification,
|
|||
|
||||
<div className="task-setting-days">
|
||||
<div className="timing_task">
|
||||
<div className="mbt10 color-grey-9 lineh-35"><span className="inline-span active">发布任务</span></div>
|
||||
<div className="mbt10 color-grey-9 lineh-35"><span className="inline-span active">需求提报</span></div>
|
||||
<div className="color-grey-9 ">自主提交:立即发布</div>
|
||||
<div className="color-grey-9 ">统筹任务:遴选后发布</div>
|
||||
</div>
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
import React, { useCallback, useEffect, useState } from 'react';
|
||||
import { Input, Button, Modal } from 'antd';
|
||||
import moment from 'moment';
|
||||
import { formatDuring } from 'educoder';
|
||||
import { formatDuring, getUrlToken } from 'educoder';
|
||||
import ChooseNav from '../../components/chooseNav';
|
||||
import SortBox from '../../components/sortBox';
|
||||
import ItemListTask from '../components/itemListTask';
|
||||
|
@ -10,12 +10,15 @@ import { getTaskList, getTaskCategory, getCompanyInfo } from '../api';
|
|||
import '../index.scss';
|
||||
const Search = Input.Search;
|
||||
|
||||
export default ({ history, current_user, showLoginDialog }) => {
|
||||
console.log(current_user);
|
||||
|
||||
export default ({ history, current_user, showLoginDialog, location }) => {
|
||||
// console.log(current_user);
|
||||
|
||||
let initType = getUrlToken('type', location.search) || '';
|
||||
|
||||
const [loading, setLoading] = useState(false);
|
||||
const [taskCategoryArr, setTaskCategoryArr] = useState([]);
|
||||
const [categoryId, setCategoryId] = useState('');
|
||||
const [categoryId, setCategoryId] = useState(initType);
|
||||
const [taskModeId, setTaskModeId] = useState('');
|
||||
const [expiredStartTime, setExpiredStartTime] = useState('');
|
||||
const [expiredEndTime, setExpiredEndTime] = useState('');
|
||||
|
@ -160,7 +163,7 @@ export default ({ history, current_user, showLoginDialog }) => {
|
|||
});
|
||||
} else {
|
||||
Modal.info({
|
||||
content: '您没有权限发布任务'
|
||||
content: '您没有权限需求提报'
|
||||
});
|
||||
}
|
||||
}
|
||||
|
@ -177,6 +180,7 @@ export default ({ history, current_user, showLoginDialog }) => {
|
|||
options={taskCategoryArr}
|
||||
changeOptionId={changeOptionId}
|
||||
size='big'
|
||||
defaultOption={{ code: initType || "", dicItemName: "", dicItemCode: initType || "" }}
|
||||
/>
|
||||
|
||||
<ChooseNav
|
||||
|
@ -223,7 +227,7 @@ export default ({ history, current_user, showLoginDialog }) => {
|
|||
onSearch={(value) => { setSearchInput(value); setCurPage(1); }}
|
||||
/>
|
||||
|
||||
<Button className="mr20 font-12" type="primary" onClick={goAdd}><i className="iconfont icon-zaibianji font-12 mr3"></i>发布任务</Button>
|
||||
<Button className="mr20 font-12" type="primary" onClick={goAdd}><i className="iconfont icon-zaibianji font-12 mr3"></i>需求提报</Button>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
|
Loading…
Reference in New Issue