forked from Gitlink/forgeplus-react
issue
This commit is contained in:
parent
633a452bf6
commit
d801f2c1c4
|
|
@ -55,7 +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">
|
||||
<!-- <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 || [];
|
||||
|
|
|
|||
|
|
@ -80,6 +80,7 @@ function Source(props){
|
|||
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>
|
||||
|
|
@ -127,18 +128,20 @@ function Source(props){
|
|||
{sourceList.map((i,k)=>{
|
||||
return(
|
||||
<div className="source_lists_card" key={k}>
|
||||
<Link to={`/zone/${deptId}/source/${i.id}`} className="task-hide">{i.name}</Link>
|
||||
<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.introduction}
|
||||
{i.summary}
|
||||
</p>
|
||||
<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 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>
|
||||
)
|
||||
})
|
||||
|
|
@ -153,7 +156,7 @@ function Source(props){
|
|||
{
|
||||
total > limit &&
|
||||
<div style={{textAlign:'center',padding:"20px 0px"}}>
|
||||
<Pagination pageSize={limit} total={total} current={page} onChange={(p)=>setPage(p)} showQuickJumper/>
|
||||
<Pagination pageSize={limit} total={total} current={page} onChange={(p)=>{setPage(p);window.scrollTo(0,450);}} showQuickJumper/>
|
||||
</div>
|
||||
}
|
||||
</div>
|
||||
|
|
|
|||
|
|
@ -6,6 +6,7 @@ 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){
|
||||
|
|
@ -46,7 +47,7 @@ function SourceDetail(props){
|
|||
<img src={SourceFile} alt="" width="20px" className="mr12"/>
|
||||
<span className="task-hide">{i.fileOriginName}</span>
|
||||
<span>{i.fileSizeInfo}</span>
|
||||
<a href={`/file/open/download/${i.fileId}`} download className="f_b_load primaryColor">下载</a>
|
||||
<a href={`${httpUrl}/file/open/download/${i.fileId}`} download className="f_b_load primaryColor">下载</a>
|
||||
</li>
|
||||
)
|
||||
})
|
||||
|
|
|
|||
|
|
@ -1340,7 +1340,8 @@
|
|||
font-size:15px;
|
||||
min-width: 190px;
|
||||
&.task-hide{
|
||||
min-width: 400px;
|
||||
width: 500px;
|
||||
margin-right: 20px;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -714,10 +714,14 @@
|
|||
height: 22px;
|
||||
line-height: 22px;
|
||||
}
|
||||
.load_count{
|
||||
position: absolute;
|
||||
right: 0px;
|
||||
top:17px;
|
||||
.s_infos{
|
||||
display: flex;
|
||||
align-items: center;
|
||||
margin-top: 10px;
|
||||
.load_count{
|
||||
margin-right: 10px;
|
||||
min-width: 68px;
|
||||
}
|
||||
}
|
||||
.desc{
|
||||
margin-top: 15px;
|
||||
|
|
@ -731,7 +735,6 @@
|
|||
font-size:14px;
|
||||
line-height:26px;
|
||||
height:26px;
|
||||
margin-top: 10px;
|
||||
&::before{
|
||||
position: absolute;
|
||||
content: "";
|
||||
|
|
|
|||
|
|
@ -168,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{
|
||||
|
|
@ -182,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,{
|
||||
|
|
@ -242,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{
|
||||
|
|
@ -270,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,否则取原有值
|
||||
|
|
@ -282,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);
|
||||
};
|
||||
|
|
|
|||
|
|
@ -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}
|
||||
|
|
|
|||
Loading…
Reference in New Issue