merge
|
|
@ -55,6 +55,7 @@
|
|||
<script src="%PUBLIC_URL%js/codemirror/merge/merge.js"></script>
|
||||
<script src="%PUBLIC_URL%js/alex/moment.js"></script>
|
||||
<script src="https://gw.alipayobjects.com/os/lib/alipay/alex/2.0.19/bundle/alex.all.global.min.js"></script>
|
||||
<!-- <meta name="viewport" content="width=device-width, user-scalable=no,initial-scale=1.0,maximum-scale=1.0,minimum-scale=1.0"> -->
|
||||
<%= htmlWebpackPlugin.tags.bodyTags %>
|
||||
<script>
|
||||
var _hmt = _hmt || [];
|
||||
|
|
|
|||
|
|
@ -1,6 +1,5 @@
|
|||
import React , { useState , useEffect } from 'react';
|
||||
import { Menu } from 'antd';
|
||||
import banner from '../img/mainbanner.png'
|
||||
import { Link } from 'react-router-dom';
|
||||
import { tempConfig } from '../tempInfo';
|
||||
import TopEdition from './TopEdition'
|
||||
|
|
@ -18,6 +17,7 @@ function PublicBanner(props){
|
|||
const info = /[A-Za-z0-9]{0,}\/news/g;
|
||||
const infodetail = /[A-Za-z0-9]{0,}\/newdetail/g;
|
||||
const project = /[A-Za-z0-9]{0,}\/projects/g;
|
||||
const source = /[A-Za-z0-9]{0,}\/source/g;
|
||||
const vip = /[A-Za-z0-9]{0,}\/VIP/g;
|
||||
if(pathname === `/zone/${deptId}`){
|
||||
setKey("1");
|
||||
|
|
@ -25,6 +25,9 @@ function PublicBanner(props){
|
|||
else if(project.test(pathname)){
|
||||
setKey("2");
|
||||
}
|
||||
else if(source.test(pathname)){
|
||||
setKey("3");
|
||||
}
|
||||
else if(info.test(pathname) || infodetail.test(pathname)){
|
||||
setKey("4");
|
||||
}
|
||||
|
|
@ -48,7 +51,7 @@ function PublicBanner(props){
|
|||
<Menu mode={"horizontal"} selectedKeys={[key]}>
|
||||
<Menu.Item key={"1"}><Link to={`/zone/${deptId}`}><img src={require(`../img/${temp}Menu1.png`)} alt="" width="29px"/>首页</Link></Menu.Item>
|
||||
<Menu.Item key={"2"}><Link to={`/zone/${deptId}/projects`}><img src={require(`../img/${temp}Menu2.png`)} alt="" width="34px"/>开源项目</Link></Menu.Item>
|
||||
{/* <Menu.Item key={"3"}><img src={Menu3} alt="" width="33px"/>资源发布</Menu.Item> */}
|
||||
<Menu.Item key={"3"}><Link to={`/zone/${deptId}/source`}><img src={require(`../img/${temp}Menu3.png`)} alt="" width="33px"/>资源发布</Link></Menu.Item>
|
||||
<Menu.Item key={"4"}><Link to={`/zone/${deptId}/news`}><img src={require(`../img/${temp}Menu4.png`)} alt="" width="32px"/>{ tempConfig[temp].mainTitle }</Link></Menu.Item>
|
||||
{/* <Menu.Item key={"5"}><img src={Menu5} alt="" width="27px"/>Sig小组</Menu.Item> */}
|
||||
<Menu.Item key={"6"}><Link to={`/zone/${deptId}/VIP`}><img src={require(`../img/${temp}Menu6.png`)} alt="" width="36px"/>{ tempConfig[temp].member }</Link></Menu.Item>
|
||||
|
|
|
|||
|
|
@ -166,7 +166,7 @@ function HeaderPage(props){
|
|||
<span className="item_index">1</span>
|
||||
<Link to={`/zone/${deptId}/newdetail/${newsList[0].id}`} className="new_first_title task-hide">{newsList[0].name}</Link>
|
||||
</p>
|
||||
<p className="new_first_desc mt20 task-hide-2">{newsList[0].summary}</p>
|
||||
<p className="new_first_desc mt20 task-hide">{newsList[0].summary}</p>
|
||||
<p className="font-13 zone_n_value mt20" style={{color:"#8d95a3"}}>
|
||||
<span className="flexCenter">
|
||||
<img src={shijian} alt="" className="mr3" />
|
||||
|
|
|
|||
|
|
@ -0,0 +1,168 @@
|
|||
import React , { useEffect , useState } from 'react';
|
||||
import { Input , Pagination, Spin } from 'antd';
|
||||
import SourceIcon from '../img/sourceIcon.png';
|
||||
import { Link } from 'react-router-dom';
|
||||
import axios from 'axios';
|
||||
import { getSourceTypeList , getSourceList , getSourceZoneList } from '../api';
|
||||
import Nodata from '../../Nodata';
|
||||
import ImgGreen from '../img/green_nodata.png';
|
||||
import '../indexZone1.scss';
|
||||
|
||||
const { Search } = Input;
|
||||
|
||||
function Source(props){
|
||||
const { deptId } = props.match.params;
|
||||
const [ sourceList , setSourceList ] = useState(undefined);
|
||||
const [ zoneList , setZoneList ] = useState(undefined);
|
||||
const [ typeList , setTypeList ] = useState(undefined);
|
||||
const [ chooseZoneId , setChooseZoneId ] = useState(undefined);
|
||||
const [ chooseTypeId , setChooseTypeId ] = useState(undefined);
|
||||
const [ page , setPage ] = useState(1);
|
||||
const [ total , setTotal ] = useState(0);
|
||||
const [ search , setSearch ] = useState(undefined);
|
||||
const [ isSpin , setIsSpin ] = useState(true);
|
||||
const limit = 20;
|
||||
const { id , temp } = props;
|
||||
|
||||
|
||||
useEffect(()=>{
|
||||
id && getLists();
|
||||
},[id,chooseTypeId,chooseZoneId,page,search])
|
||||
|
||||
useEffect(()=>{
|
||||
id && getZoneList();
|
||||
id && getTypeList();
|
||||
},[id])
|
||||
|
||||
function getZoneList(){
|
||||
getSourceZoneList(id).then(response=>{
|
||||
if(response && response.data){
|
||||
setZoneList(response.data.rows);
|
||||
}
|
||||
}).catch(error=>{})
|
||||
}
|
||||
|
||||
function getTypeList(){
|
||||
getSourceTypeList(id).then(response=>{
|
||||
if(response && response.data){
|
||||
setTypeList(response.data.rows);
|
||||
}
|
||||
}).catch(error=>{})
|
||||
}
|
||||
|
||||
function getLists(){
|
||||
setIsSpin(true);
|
||||
getSourceList({
|
||||
id,pageSize:limit,pageNum:page,typeId:chooseTypeId,domainId:chooseZoneId,name:search
|
||||
}).then(response=>{
|
||||
if(response){
|
||||
setSourceList(response.data.rows);
|
||||
setTotal(response.data.total);
|
||||
setIsSpin(false);
|
||||
}
|
||||
}).catch(error=>{})
|
||||
}
|
||||
|
||||
|
||||
function onSourceSearch(value){
|
||||
setSearch(value);
|
||||
setPage(1);
|
||||
}
|
||||
|
||||
return(
|
||||
<div className={`${temp}_source_box`}>
|
||||
<div className="source_h">
|
||||
<p className="in_title">资源发布</p>
|
||||
<div style={{marginTop:"30px",textAlign:"center"}}>
|
||||
<Search
|
||||
placeholder="请输入资源名称"
|
||||
onSearch={onSourceSearch}
|
||||
style={{width:'645px',borderColor:"#fff",boxShadow:"0px 0px 10px rgba(61, 85, 183, 0.1)"}}
|
||||
size="large"
|
||||
className="source_search_box"
|
||||
allowClear
|
||||
enterButton={temp === "zone" ? <span><i className="iconfont icon-sousuo5 font-15"/>搜索</span> :undefined}
|
||||
/>
|
||||
</div>
|
||||
</div>
|
||||
<div className="sources">
|
||||
<div className="source_left_ul">
|
||||
{
|
||||
zoneList && zoneList.length>0&&
|
||||
<ul className="source_l_u">
|
||||
<p>资源领域</p>
|
||||
<div>
|
||||
<li onClick={()=>{setChooseZoneId(undefined);window.scrollTo(0,450)}} className={!chooseZoneId ?"active":""}>全部</li>
|
||||
{
|
||||
zoneList.map((i,k)=>{
|
||||
return(
|
||||
<li key={k} onClick={()=>{setChooseZoneId(i.id);window.scrollTo(0,450)}} className={chooseZoneId && chooseZoneId === i.id ? "active":"" }>{i.name}</li>
|
||||
)
|
||||
})
|
||||
}
|
||||
</div>
|
||||
</ul>
|
||||
}
|
||||
{
|
||||
typeList && typeList.length>0 &&
|
||||
<ul className="source_l_u">
|
||||
<p className="borderRight">资源类别</p>
|
||||
<div>
|
||||
<li onClick={()=>{setChooseTypeId(undefined);window.scrollTo(0,450)}} className={!chooseTypeId ?"active":""}>全部</li>
|
||||
{
|
||||
typeList.map((i,k)=>{
|
||||
return(
|
||||
<li key={k} onClick={()=>{setChooseTypeId(i.id);window.scrollTo(0,450)}} className={chooseTypeId && chooseTypeId === i.id ? "active":"" }>{i.name}</li>
|
||||
)
|
||||
})
|
||||
}
|
||||
</div>
|
||||
</ul>
|
||||
}
|
||||
</div>
|
||||
<Spin spinning={isSpin}>
|
||||
<div className="s_m_list">
|
||||
{
|
||||
sourceList && sourceList.length > 0 &&
|
||||
<div className="source_lists">
|
||||
{sourceList.map((i,k)=>{
|
||||
return(
|
||||
<div className="source_lists_card" key={k}>
|
||||
<Link to={`/zone/${deptId}/source/${i.id}`} onClick={()=>{window.scrollTo(0,450)}} className="task-hide">{i.name}</Link>
|
||||
<p className="task-hide-2 desc">
|
||||
{i.summary}
|
||||
</p>
|
||||
<div className="s_infos">
|
||||
<p className="load_count">
|
||||
<img src={SourceIcon} alt="" width="18px" className="mr5"/><span style={{color:"#5e6685"}}>{i.downloadCount}</span>
|
||||
</p>
|
||||
{temp === "zone1" && <p className="load_source">
|
||||
<span>{i.domainName}</span>
|
||||
<span>{i.typeName}</span>
|
||||
</p>
|
||||
}
|
||||
</div>
|
||||
</div>
|
||||
)
|
||||
})
|
||||
}
|
||||
</div>
|
||||
}
|
||||
{sourceList && sourceList.length === 0 &&
|
||||
<div style={{textAlign:'center'}}>
|
||||
<Nodata _html="暂无数据" img={temp === "zone1" ? ImgGreen : undefined}/>
|
||||
</div>
|
||||
}
|
||||
{
|
||||
total > limit &&
|
||||
<div style={{textAlign:'center',padding:"20px 0px"}}>
|
||||
<Pagination pageSize={limit} total={total} current={page} onChange={(p)=>{setPage(p);window.scrollTo(0,450);}} showQuickJumper/>
|
||||
</div>
|
||||
}
|
||||
</div>
|
||||
</Spin>
|
||||
</div>
|
||||
</div>
|
||||
)
|
||||
}
|
||||
export default Source;
|
||||
|
|
@ -0,0 +1,72 @@
|
|||
import React , { useEffect , useState } from 'react';
|
||||
import { Breadcrumb } from 'antd';
|
||||
import SourceFile from '../img/sourceFile.png';
|
||||
import RenderHtml from '../../../components/render-html';
|
||||
import { getSourceDetail } from '../api';
|
||||
import { Link } from 'react-router-dom';
|
||||
import axios from 'axios';
|
||||
import { Base64 } from 'js-base64';
|
||||
import { httpUrl } from '../fetch';
|
||||
|
||||
|
||||
function SourceDetail(props){
|
||||
const { deptId , sourceid } = props.match.params;
|
||||
const [ detail , setDetail ] = useState(undefined);
|
||||
|
||||
useEffect(()=>{
|
||||
if(sourceid){
|
||||
getDetails();
|
||||
}
|
||||
},[sourceid])
|
||||
|
||||
function getDetails(){
|
||||
getSourceDetail(sourceid).then(response=>{
|
||||
if(response){
|
||||
setDetail(response.data.data);
|
||||
}
|
||||
}).catch(error=>{})
|
||||
}
|
||||
|
||||
return(
|
||||
<div className="boxmain"style={{paddingBottom:"40px"}}>
|
||||
<Breadcrumb separator=">" style={{paddingTop:"20px"}}>
|
||||
<Breadcrumb.Item><Link className="primaryColor" to={`/zone/${deptId}/source`}>资源列表</Link></Breadcrumb.Item>
|
||||
<Breadcrumb.Item>详情页</Breadcrumb.Item>
|
||||
</Breadcrumb>
|
||||
{
|
||||
detail &&
|
||||
<div className="source_detail_box">
|
||||
<div className="s_d_title">{detail.name}</div>
|
||||
{
|
||||
detail.fileList && detail.fileList.length > 0 &&
|
||||
<ul className="files_box">
|
||||
{
|
||||
detail.fileList.map((i,k)=>{
|
||||
return(
|
||||
<li>
|
||||
<img src={SourceFile} alt="" width="20px" className="mr12"/>
|
||||
<span className="task-hide">{i.fileOriginName}</span>
|
||||
<span>{i.fileSizeInfo}</span>
|
||||
<a href={`${httpUrl}/file/open/download/${i.fileId}`} download className="f_b_load primaryColor">下载</a>
|
||||
</li>
|
||||
)
|
||||
})
|
||||
}
|
||||
</ul>
|
||||
}
|
||||
|
||||
{ detail.introduction &&
|
||||
<div style={{padding:"20px 0px"}}>
|
||||
<RenderHtml
|
||||
className="source_detail imageLayerParent"
|
||||
value={detail.introduction ? Base64.decode(detail.introduction):""}
|
||||
url={props.history.location}
|
||||
/>
|
||||
</div>
|
||||
}
|
||||
</div>
|
||||
}
|
||||
</div>
|
||||
)
|
||||
}
|
||||
export default SourceDetail;
|
||||
|
|
@ -98,4 +98,31 @@ export function applyJoin(id,data) {
|
|||
method: 'post',
|
||||
data: data
|
||||
});
|
||||
}
|
||||
|
||||
// 资源模块
|
||||
export function getSourceTypeList(id){
|
||||
return fetch({
|
||||
url:`/zone/open/${id}/resourceType/list`,
|
||||
method: 'get',
|
||||
})
|
||||
}
|
||||
export function getSourceZoneList(id){
|
||||
return fetch({
|
||||
url:`/zone/open/${id}/resourceDomain/list`,
|
||||
method: 'get',
|
||||
})
|
||||
}
|
||||
export function getSourceList(params){
|
||||
return fetch({
|
||||
url:`/zone/open/${params.id}/resource/list`,
|
||||
method: 'get',
|
||||
params
|
||||
})
|
||||
}
|
||||
export function getSourceDetail(id){
|
||||
return fetch({
|
||||
url:`/zone/open/resource/detail/${id}`,
|
||||
method: 'get'
|
||||
})
|
||||
}
|
||||
|
After Width: | Height: | Size: 127 KiB |
|
After Width: | Height: | Size: 39 KiB |
|
After Width: | Height: | Size: 623 B |
|
After Width: | Height: | Size: 959 B |
|
After Width: | Height: | Size: 5.1 KiB |
|
Before Width: | Height: | Size: 1.8 KiB After Width: | Height: | Size: 1.8 KiB |
|
|
@ -15,10 +15,18 @@ import "slick-carousel/slick/slick.css";
|
|||
import "slick-carousel/slick/slick-theme.css";
|
||||
import { tempEnum } from "./tempInfo";
|
||||
|
||||
const SourceDetail = Loadable({
|
||||
loader: () => import("./Pages/sourceDetail"),
|
||||
loading: Loading,
|
||||
});
|
||||
const VIP = Loadable({
|
||||
loader: () => import("./Pages/zoneVIP"),
|
||||
loading: Loading,
|
||||
});
|
||||
const Source = Loadable({
|
||||
loader: () => import("./Pages/source"),
|
||||
loading: Loading,
|
||||
});
|
||||
const HeaderPage = Loadable({
|
||||
loader: () => import("./Pages/headerPage"),
|
||||
loading: Loading,
|
||||
|
|
@ -115,6 +123,18 @@ function Index(props){
|
|||
<NewsDetail {...props} {...p} id={id} temp={ temp }/>
|
||||
)}
|
||||
></Route>
|
||||
<Route
|
||||
path="/zone/:deptId/source/:sourceid"
|
||||
render={(p) => (
|
||||
<SourceDetail {...props} {...p} id={id} temp={ temp }/>
|
||||
)}
|
||||
></Route>
|
||||
<Route
|
||||
path="/zone/:deptId/source"
|
||||
render={(p) => (
|
||||
<Source {...props} {...p} id={id} temp={ temp }/>
|
||||
)}
|
||||
></Route>
|
||||
<Route
|
||||
path="/zone/:deptId/VIP"
|
||||
render={(p) => (
|
||||
|
|
|
|||
|
|
@ -1224,4 +1224,129 @@
|
|||
line-height: 32px;
|
||||
margin-bottom: 8px!important;
|
||||
}
|
||||
}
|
||||
.zone_source_box{
|
||||
padding-bottom: 40px;
|
||||
.source_h{
|
||||
background-color: rgba(240, 244, 255, 0.94);
|
||||
padding:56px 0px;
|
||||
box-sizing: border-box;
|
||||
min-height: 278px;
|
||||
}
|
||||
.source_search_box{
|
||||
.ant-input-lg{
|
||||
border-color: #fff;
|
||||
}
|
||||
}
|
||||
.sources{
|
||||
display: flex;
|
||||
align-items: flex-start;
|
||||
padding:40px 0px;
|
||||
width: 1200px;
|
||||
margin: 0px auto;
|
||||
background-color: #f7f9fc;
|
||||
border: 2px solid #ffffff;
|
||||
border-radius: 4px;
|
||||
margin-top: -70px;
|
||||
box-sizing: border-box;
|
||||
.ant-spin-nested-loading{
|
||||
flex: 1;
|
||||
}
|
||||
.source_left_ul{
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
align-items: flex-end;
|
||||
padding:5px 0px;
|
||||
p,li{
|
||||
height: 60px;
|
||||
line-height: 60px;
|
||||
padding-left: 34px;
|
||||
width: 215px;
|
||||
}
|
||||
p.borderRight{
|
||||
border-right: 2px solid #fff;
|
||||
}
|
||||
p{
|
||||
font-weight:700;
|
||||
color:#1f2329;
|
||||
font-size:18px;
|
||||
}
|
||||
li{
|
||||
border-right: 3px solid #fff;
|
||||
font-weight:500;
|
||||
color:#3d485d;
|
||||
cursor: pointer;
|
||||
font-size:16px;
|
||||
&.active{
|
||||
border-color: var(--primary-color);
|
||||
color: var(--primary-color);
|
||||
background-image:linear-gradient(89.9deg,rgba(70, 106, 255, 0) 0%,rgba(70, 106, 255, 0.09) 100%);
|
||||
}
|
||||
}
|
||||
}
|
||||
.source_lists{
|
||||
width: 100%;
|
||||
display: flex;
|
||||
flex-wrap: wrap;
|
||||
.source_lists_card{
|
||||
margin-left: 29px;
|
||||
width: 286px;
|
||||
min-height: 180px;
|
||||
background-color: rgba(255, 255, 255, 0.986);
|
||||
padding:20px;
|
||||
margin-bottom: 29px;
|
||||
position: relative;
|
||||
background-image: url(./img/sourceCardBack.png);
|
||||
background-size: 100% 100%;
|
||||
border-radius: 2px;
|
||||
box-shadow: 0px 0px 11px rgba(197, 197,197, 0.1);
|
||||
a.task-hide{
|
||||
color:#1f2329;
|
||||
font-size:16px;
|
||||
height: 28px;
|
||||
line-height: 28px;
|
||||
display: block;
|
||||
margin-bottom: 15px;
|
||||
}
|
||||
.desc{
|
||||
color:#4c5876;
|
||||
height: 54px;
|
||||
line-height: 27px;
|
||||
margin-bottom: 14px!important;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
.source_detail_box{
|
||||
background-color: #fff;
|
||||
padding:10px 35px 30px;
|
||||
.s_d_title{
|
||||
padding:25px 0px;
|
||||
border-bottom: 1px dashed rgba(141, 149, 172, 0.27);
|
||||
color:#1f2329;
|
||||
font-size:22px;
|
||||
margin-bottom: 20px!important;
|
||||
}
|
||||
.files_box{
|
||||
padding:11px 30px;
|
||||
background-color:#f6f8fa;
|
||||
li{
|
||||
display: flex;
|
||||
align-items: center;
|
||||
height: 42px;
|
||||
&>span{
|
||||
color:#3d485d;
|
||||
font-size:15px;
|
||||
min-width: 190px;
|
||||
&.task-hide{
|
||||
width: 500px;
|
||||
margin-right: 20px;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
.primaryColor{
|
||||
color: var(--primary-color)!important;
|
||||
}
|
||||
|
|
@ -106,7 +106,6 @@
|
|||
}
|
||||
.new_first_desc {
|
||||
opacity: 0.8;
|
||||
height: 20px;
|
||||
color: #ffffff;
|
||||
font-size: 14px;
|
||||
line-height: 27px;
|
||||
|
|
@ -171,11 +170,9 @@
|
|||
background-color:#07a583;
|
||||
}
|
||||
}
|
||||
.zone_new_two {
|
||||
margin-left: 38%;
|
||||
}
|
||||
.zone_new_three{
|
||||
display: flex;
|
||||
justify-content: space-evenly;
|
||||
& > div:not(:first-child) {
|
||||
margin-left: 50px;
|
||||
}
|
||||
|
|
@ -206,6 +203,10 @@
|
|||
}
|
||||
}
|
||||
}
|
||||
.zone_new_two {
|
||||
margin-left: 38%;
|
||||
justify-content: flex-start;
|
||||
}
|
||||
}
|
||||
.zone_projects{
|
||||
background-image:linear-gradient(180deg,#f1f4fa 0%,#ffffff 100%);
|
||||
|
|
@ -645,4 +646,123 @@
|
|||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
.zone1_source_box{
|
||||
padding-bottom: 30px;
|
||||
.source_h{
|
||||
padding-top: 40px;
|
||||
width: 100%;
|
||||
height:280px;
|
||||
background-image:linear-gradient(180deg,#f4f6fb 0%,#e8ebf1 100%);
|
||||
}
|
||||
.sources{
|
||||
margin-top: -97px;
|
||||
.source_left_ul{
|
||||
width: 1200px;
|
||||
margin:0px auto;
|
||||
background-color:#fefefe;
|
||||
border-radius:4px;
|
||||
padding:30px 30px 6px;
|
||||
.source_l_u{
|
||||
display: flex;
|
||||
margin-bottom: 12px!important;
|
||||
align-items: flex-start;
|
||||
&>p{
|
||||
font-weight:400;
|
||||
color:#1f2329;
|
||||
font-size:16px;
|
||||
line-height:22px;
|
||||
height:22px;
|
||||
margin-right: 20px;
|
||||
}
|
||||
&>div{
|
||||
flex:1;
|
||||
display: flex;
|
||||
flex-wrap: wrap;
|
||||
li{
|
||||
cursor: pointer;
|
||||
margin:0px 18px 12px!important;
|
||||
font-weight:400;
|
||||
color:#3d485d;
|
||||
font-size:16px;
|
||||
line-height:22px;
|
||||
height:22px;
|
||||
&.active{
|
||||
color: var(--primary-color);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
.s_m_list{
|
||||
width: 1200px;
|
||||
margin: 30px auto 0px;
|
||||
background-color: #fff;
|
||||
.source_lists{
|
||||
padding:0px 30px;
|
||||
.source_lists_card{
|
||||
position: relative;
|
||||
padding: 20px 0px 16px;
|
||||
border-bottom: 1px dashed rgba(170, 175, 190,0.43);
|
||||
&:last-child{
|
||||
border-bottom: none;
|
||||
}
|
||||
a.task-hide{
|
||||
display: block;
|
||||
padding-right: 100px;
|
||||
color:#1f2329;
|
||||
font-size:16px;
|
||||
height: 22px;
|
||||
line-height: 22px;
|
||||
}
|
||||
.s_infos{
|
||||
display: flex;
|
||||
align-items: center;
|
||||
margin-top: 10px;
|
||||
.load_count{
|
||||
margin-right: 10px;
|
||||
min-width: 68px;
|
||||
}
|
||||
}
|
||||
.desc{
|
||||
margin-top: 15px;
|
||||
color:#4c5876;
|
||||
line-height:26px;
|
||||
}
|
||||
.load_source{
|
||||
position: relative;
|
||||
padding-left: 14px;
|
||||
color:#8d95ac;
|
||||
font-size:14px;
|
||||
line-height:26px;
|
||||
height:26px;
|
||||
&::before{
|
||||
position: absolute;
|
||||
content: "";
|
||||
background-color: var(--primary-color);
|
||||
width: 8px;
|
||||
height: 8px;
|
||||
border-radius: 50%;
|
||||
left: 0px;
|
||||
top:50%;
|
||||
margin-top: -4px;
|
||||
}
|
||||
&>span:last-child{
|
||||
padding-left: 21px;
|
||||
position: relative;
|
||||
&::before{
|
||||
position: absolute;
|
||||
left: 10px;
|
||||
height: 12px;
|
||||
top: 1px;
|
||||
content: "";
|
||||
width: 1px;
|
||||
background-color: #8d95ac;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -372,7 +372,7 @@ function CoderDepot(props){
|
|||
// 如果项目是fork的项目,pr自动指向源仓库,否则指向本仓库默认分支
|
||||
function compare() {
|
||||
if (projectDetail && projectDetail.fork_info) {
|
||||
urlLink(`/${projectDetail.fork_info.fork_project_user_login}/${projectDetail.fork_info.fork_project_identifier}/compare/${turnbar(branchName || defaultBranch)}...${owner + ':' + turnbar(branchName || defaultBranch)}`)
|
||||
urlLink(`/${projectDetail.fork_info.fork_project_user_login}/${projectDetail.fork_info.fork_project_identifier}/compare/${turnbar(branchName || defaultBranch)}...${owner +'/' + projectsId + ':' + turnbar(branchName || defaultBranch)}`)
|
||||
} else {
|
||||
urlLink(`/${owner}/${projectsId}/compare/${turnbar(defaultBranch)}...${turnbar(branchName || defaultBranch)}`);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -0,0 +1,40 @@
|
|||
import React ,{ useEffect , useState } from 'react';
|
||||
import { Modal , Form } from 'antd';
|
||||
import './index.scss';
|
||||
|
||||
function ForkSelfModal(props){
|
||||
const { visible , onCancel , onSuccess } = props;
|
||||
|
||||
return(
|
||||
<Modal
|
||||
visible={visible}
|
||||
onCancel={onCancel}
|
||||
title={'Fork项目'}
|
||||
closable
|
||||
width="648px"
|
||||
>
|
||||
<div className="self_box">
|
||||
<p style={{color:"#1f2329",fontSize:"15px"}}>您希望将项目Fork至何处?</p>
|
||||
<div className="self_b_list">
|
||||
<div className="self_b_card">
|
||||
<ul className="s_b_ul">
|
||||
<img className="info_img" src="https://testforgeplus.trustie.net/images/avatars/User/36480?t=1686645429" alt="" />
|
||||
<li>
|
||||
<p style={{marginBottom:'10px!important'}}>
|
||||
<span className="s_info_name">蒋宇航</span>
|
||||
<span className="s_info_tag onwer">个人</span>
|
||||
<span style={{color:'rgba(216, 98, 7, 1)',marginLeft:"12px"}}><i className="iconfont icon-erciqueren_icon mr3 font-15"></i>存在同名/同标识项目</span>
|
||||
</p>
|
||||
<p style={{color:'#4c5b76'}}>handsome@qq.com</p>
|
||||
</li>
|
||||
</ul>
|
||||
<div>
|
||||
<p style={{color:'#202d40',marginTop:'18px'}}>当前用户已存在同名/同标识项目:<a className="color-blue">https://www.gitlink.org.cn/forgeplus/issues/2615</a>请使用/修改新项目名称与标识完成本次fork</p>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</Modal>
|
||||
)
|
||||
}
|
||||
export default ForkSelfModal;
|
||||
|
|
@ -51,7 +51,14 @@ function getBranchParams(pathname) {
|
|||
if (pullObj.indexOf(':') > -1) {
|
||||
// 存在源仓库
|
||||
const [pullOwner, pullBranch] = pullObj.split(':');
|
||||
result.pullOwner = pullOwner;
|
||||
if(pullOwner.indexOf("/")>-1){
|
||||
const [ ownerO , onwerP ] = pullOwner.split('/');
|
||||
result.pullOwner = ownerO;
|
||||
result.pullIdentity = onwerP;
|
||||
}else{
|
||||
result.pullOwner = pullOwner;
|
||||
}
|
||||
|
||||
result.pullBranch = pullBranch;
|
||||
} else {
|
||||
result.pullBranch = pullObj;
|
||||
|
|
@ -129,8 +136,8 @@ class CreateMerge extends Component {
|
|||
//获取新建合并请求数据
|
||||
getMergeInfo = (branchParams,init) => {
|
||||
this.setState({ isSpin: true });
|
||||
const { pullOwner, pullBranch, mergeOwner, mergeBranch, projectId } = branchParams;
|
||||
const url = `/${pullOwner}/${projectId}/pulls/new.json`;
|
||||
const { pullOwner, pullBranch, mergeOwner, mergeBranch, projectId , pullIdentity } = branchParams;
|
||||
const url = `/${pullOwner}/${pullIdentity || projectId}/pulls/new.json`;
|
||||
axios.get(url).then((result) => {
|
||||
if (result) {
|
||||
if(init){
|
||||
|
|
@ -161,9 +168,9 @@ class CreateMerge extends Component {
|
|||
};
|
||||
|
||||
checkBranch=async(branchParams)=>{
|
||||
const { mergeBranch , mergeOwner, projectId , pullBranch ,pullOwner} = branchParams;
|
||||
const { mergeBranch , mergeOwner, projectId , pullBranch ,pullOwner,pullIdentity} = branchParams;
|
||||
let getbranch =await this.getBranchList(mergeOwner,projectId,pullBranch,mergeBranch,"merge");
|
||||
let checkpull =await this.getBranchList(pullOwner,projectId,pullBranch,mergeBranch,"pull");
|
||||
let checkpull =await this.getBranchList(pullOwner,pullIdentity || projectId,pullBranch,mergeBranch,"pull");
|
||||
if(getbranch && checkpull){
|
||||
this.compareProject(mergeOwner === pullOwner, branchParams,1);
|
||||
}else{
|
||||
|
|
@ -175,12 +182,12 @@ class CreateMerge extends Component {
|
|||
|
||||
// compare接口,获取分支对比信息
|
||||
compareProject = (sameProject, branchParams ,page) => {
|
||||
const { pullOwner, pullBranch, mergeOwner, mergeBranch, projectId } = branchParams;
|
||||
const { pullOwner, pullBranch, mergeOwner, mergeBranch, projectId , pullIdentity } = branchParams;
|
||||
let url = `/${mergeOwner}/${projectId}/compare`;
|
||||
if (sameProject) {
|
||||
url += `/${Base64.encode(returnbar(pullBranch))}...${Base64.encode(returnbar(mergeBranch))}.json`;
|
||||
} else {
|
||||
url += `/${Base64.encode(returnbar(mergeBranch))}...${pullOwner}/${projectId}:${Base64.encode(returnbar(pullBranch))}.json`;
|
||||
url += `/${Base64.encode(returnbar(mergeBranch))}...${pullOwner}/${pullIdentity || projectId}:${Base64.encode(returnbar(pullBranch))}.json`;
|
||||
}
|
||||
axios
|
||||
.get(url,{
|
||||
|
|
@ -235,11 +242,11 @@ class CreateMerge extends Component {
|
|||
}
|
||||
if(type === "merge" && mfilter){
|
||||
const {projectDetail,location,history}=this.props;
|
||||
const { pullOwner, pullBranch, mergeOwner, mergeBranch, projectId } =
|
||||
const { pullOwner, pullBranch, mergeOwner, mergeBranch, projectId , pullIdentity } =
|
||||
getBranchParams(location.pathname);
|
||||
// 如果进来的第一次,查到目标分支不存在,自动切换到目标仓库默认分支
|
||||
if (pullOwner !== mergeOwner && pullBranch=== mergeBranch) {
|
||||
let _url = `/${mergeOwner}/${projectId}/compare/${(projectDetail?projectDetail.default_branch:'master')}...${pullOwner}:${(pullBranch)}`;
|
||||
let _url = `/${mergeOwner}/${projectId}/compare/${(projectDetail?projectDetail.default_branch:'master')}...${pullOwner}/${pullIdentity || projectId}:${(pullBranch)}`;
|
||||
history.push(_url);
|
||||
return false;
|
||||
}else{
|
||||
|
|
@ -263,7 +270,7 @@ class CreateMerge extends Component {
|
|||
|
||||
// 切换分支事件
|
||||
selectBrach = (type, value) => {
|
||||
const { pullOwner, pullBranch, mergeOwner, mergeBranch, projectId } =
|
||||
const { pullOwner, pullBranch, mergeOwner, mergeBranch, projectId , pullIdentity } =
|
||||
getBranchParams(this.props.location.pathname);
|
||||
let _url = `/${mergeOwner}/${projectId}/compare/`;
|
||||
// type为pull时,pullBranch取value,否则取原有值
|
||||
|
|
@ -275,7 +282,7 @@ class CreateMerge extends Component {
|
|||
_url += `${turnbar(_mergeBranch)}...${turnbar(_pullBranch)}`;
|
||||
} else {
|
||||
// 如果仓库不同, compare/目标分支...源分支
|
||||
_url += `${turnbar(_mergeBranch)}...${pullOwner}:${turnbar(_pullBranch)}`;
|
||||
_url += `${turnbar(_mergeBranch)}...${pullOwner}/${pullIdentity || projectId}:${turnbar(_pullBranch)}`;
|
||||
}
|
||||
this.props.history.push(_url);
|
||||
};
|
||||
|
|
@ -283,7 +290,7 @@ class CreateMerge extends Component {
|
|||
// 切换仓库响应事件,目前仅目标分支可切换仓库
|
||||
selectProjectName = (value, isChangeProject, initPro) => {
|
||||
const { projects_names, id } = isChangeProject ? this.state : initPro;
|
||||
const { pullOwner, pullBranch } = getBranchParams(
|
||||
const { pullOwner, pullBranch , pullIdentity , projectId } = getBranchParams(
|
||||
this.props.location.pathname
|
||||
);
|
||||
let arr =
|
||||
|
|
@ -302,6 +309,7 @@ class CreateMerge extends Component {
|
|||
merge_user_login: is_fork
|
||||
? projects_names[0].project_user_login
|
||||
: undefined,
|
||||
merge_project_identifier:pullIdentity||projectId
|
||||
},
|
||||
});
|
||||
// 加上是否需要切换url判断
|
||||
|
|
@ -315,7 +323,7 @@ class CreateMerge extends Component {
|
|||
);
|
||||
} else {
|
||||
this.props.history.push(
|
||||
`/${login}/${identifier}/compare/${branch}...${pullOwner}:${turnbar(pullBranch)}`
|
||||
`/${login}/${identifier}/compare/${branch}...${pullOwner}/${pullIdentity || projectId}:${turnbar(pullBranch)}`
|
||||
);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -233,7 +233,7 @@ class merge extends Component {
|
|||
const { projectsId,owner } = this.props.match.params;
|
||||
let branch = turnbar(defaultBranch) || "master";
|
||||
if (projectDetail && projectDetail.fork_info) {
|
||||
this.props.history.push(`/${projectDetail.fork_info.fork_project_user_login}/${projectDetail.fork_info.fork_project_identifier}/compare/${branch}...${owner + ':' + branch}`)
|
||||
this.props.history.push(`/${projectDetail.fork_info.fork_project_user_login}/${projectDetail.fork_info.fork_project_identifier}/compare/${branch}...${owner + '/' + projectsId +':' + branch}`)
|
||||
} else {
|
||||
this.props.history.push(`/${owner}/${projectsId}/compare/${branch}...${branch}`);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -180,6 +180,7 @@ class MergeForm extends Component {
|
|||
is_original: data && data.is_original,
|
||||
fork_project_id: data && data.fork_project_id,
|
||||
merge_user_login: data && data.merge_user_login,
|
||||
merge_project_identifier:data && data.merge_project_identifier,
|
||||
files_count,
|
||||
commits_count,
|
||||
receivers_login:atWhoLoginList,
|
||||
|
|
|
|||
|
|
@ -65,7 +65,7 @@ class m_editor extends Component {
|
|||
{!readOnly ?
|
||||
<CodeMirror
|
||||
placeholder="请输入内容"
|
||||
value={md ? editorValue : Base64.decode(editorValue)}
|
||||
value={editorValue}
|
||||
options={editor_options}
|
||||
onChange={this.changeEditor}
|
||||
/> :
|
||||
|
|
|
|||
|
|
@ -17,8 +17,6 @@ function MilepostDetail(props){
|
|||
const [ closedCount , setClosedCount ] = useState(0);
|
||||
const [ openedCount , setOpenedCount ] = useState(0);
|
||||
|
||||
const[ aboutMe , setAboutMe ] = useState("aboutme");
|
||||
const[ keyword , setKeyword ] = useState(undefined);
|
||||
|
||||
const [ category , setCategory] = useState("opened");
|
||||
|
||||
|
|
@ -32,6 +30,8 @@ function MilepostDetail(props){
|
|||
const [ total , setTotal ] = useState(undefined);
|
||||
const [ issuesCount, setIssueCount] = useState(undefined);
|
||||
|
||||
const [ chooseValue, setChooseValue ] = useState(undefined);
|
||||
|
||||
const menuRef = useRef(null);
|
||||
const { projectsId, mileId , owner } = props.match.params;
|
||||
const {current_user, projectDetail, showLoginDialog, history} = props;
|
||||
|
|
@ -47,8 +47,8 @@ function MilepostDetail(props){
|
|||
}
|
||||
|
||||
useEffect(()=>{
|
||||
Init();
|
||||
},[aboutMe, keyword, category, page, limit])
|
||||
Init(chooseValue);
|
||||
},[category, page, limit])
|
||||
|
||||
useEffect(()=>{
|
||||
updateDocumentTitle()
|
||||
|
|
@ -91,20 +91,6 @@ function MilepostDetail(props){
|
|||
}).then(error=>{console.log("error:",error)})
|
||||
}
|
||||
|
||||
// 第一个下拉搜索
|
||||
const menu = (
|
||||
<Menu selectedKeys={[`${aboutMe}`]} onClick={chooseAboutMe}>
|
||||
<Menu.Item key={"all"}>全部</Menu.Item>
|
||||
<Menu.Item key={"aboutme"}><Tooltip title="指我创建的、我负责的和@我的疑修">与我相关</Tooltip></Menu.Item>
|
||||
<Menu.Item key={"assignedme"}>我负责的</Menu.Item>
|
||||
<Menu.Item key={"authoredme"}>我创建的</Menu.Item>
|
||||
<Menu.Item key={"atme"}>@我的</Menu.Item>
|
||||
</Menu>
|
||||
)
|
||||
function chooseAboutMe(e){
|
||||
setCategory("all");
|
||||
setAboutMe(e.key);
|
||||
}
|
||||
|
||||
// 全选所有issue
|
||||
function chooseAll(e){
|
||||
|
|
@ -156,16 +142,20 @@ function MilepostDetail(props){
|
|||
// 切换页码
|
||||
function changepage(page){
|
||||
setPage(page);
|
||||
window.scrollTo(0,0);
|
||||
}
|
||||
|
||||
function chooseFunc(ids){
|
||||
if(allValue && allValue.length>0){
|
||||
// 将ids保存下来以便修改
|
||||
setUpdateIds(ids);
|
||||
setChooseValue(undefined);
|
||||
}else{
|
||||
const {sort_by} = ids;
|
||||
const params = {...ids, ...sortBy[sort_by]}
|
||||
Init(params);
|
||||
setChooseValue(params);
|
||||
page===1 && Init(params);
|
||||
setPage(1);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -766,7 +766,7 @@ export default ({ mdID, onChange, onCMBeforeChange, onCMBlur, error = false, cla
|
|||
{quoteVisible && QuoteDiv }
|
||||
{atWhoVisible && atWhoList}
|
||||
<textarea style={{ display: 'none' }} id={editorBodyId} name="content"></textarea>
|
||||
<div className="CodeMirror cm-s-defualt"></div>
|
||||
<div className="CodeMirror cm-s-defualt" style={{ display: 'none' }}></div>
|
||||
</div>
|
||||
</div>
|
||||
{showResizeBar ? <a ref={resizeBarEl} className='editor-resize'></a> : null}
|
||||
|
|
|
|||