Merge pull request '代码库二级页面子目录更改,代码库二级页面子目录文件更改' (#83) from hc1913847458/forgeplus-react:feature_repo_second_page into feature_repo_second_page

This commit is contained in:
jasder 2021-09-28 16:07:57 +08:00
commit 9e322cff79
10 changed files with 86 additions and 70 deletions

View File

@ -1949,7 +1949,9 @@ a.decoration {
} }
.mr20 { .mr20 {
margin-right: 20px; margin-right: 10px;
margin-left: 10px;
float: left;
} }
.mr25 { .mr25 {
@ -1957,7 +1959,7 @@ a.decoration {
} }
.mr30 { .mr30 {
margin-right: 30px; margin-right: 10px;
} }
.mr35 { .mr35 {

View File

@ -1,8 +1,8 @@
@font-face { @font-face {
font-family: "iconfont"; /* Project id 2340181 */ font-family: "iconfont"; /* Project id 2340181 */
src: url('iconfont.woff2?t=1632792244115') format('woff2'), src: url('iconfont.woff2?t=1632638897939') format('woff2'),
url('iconfont.woff?t=1632792244115') format('woff'), url('iconfont.woff?t=1632638897939') format('woff'),
url('iconfont.ttf?t=1632792244115') format('truetype'); url('iconfont.ttf?t=1632638897939') format('truetype');
} }
.iconfont { .iconfont {
@ -13,18 +13,6 @@
-moz-osx-font-smoothing: grayscale; -moz-osx-font-smoothing: grayscale;
} }
.icon-wenjian7:before {
content: "\e8e0";
}
.icon-xiangyoujiantou:before {
content: "\e8de";
}
.icon-xiangzuojiantou:before {
content: "\e8df";
}
.icon-a-liulanicon2x:before { .icon-a-liulanicon2x:before {
content: "\e8dd"; content: "\e8dd";
} }

File diff suppressed because one or more lines are too long

View File

@ -5,27 +5,6 @@
"css_prefix_text": "icon-", "css_prefix_text": "icon-",
"description": "", "description": "",
"glyphs": [ "glyphs": [
{
"icon_id": "24656750",
"name": "文件",
"font_class": "wenjian7",
"unicode": "e8e0",
"unicode_decimal": 59616
},
{
"icon_id": "630094",
"name": "向右箭头",
"font_class": "xiangyoujiantou",
"unicode": "e8de",
"unicode_decimal": 59614
},
{
"icon_id": "630095",
"name": "向左箭头",
"font_class": "xiangzuojiantou",
"unicode": "e8df",
"unicode_decimal": 59615
},
{ {
"icon_id": "24600282", "icon_id": "24600282",
"name": "浏览icon@2x", "name": "浏览icon@2x",

Binary file not shown.

Binary file not shown.

Binary file not shown.

View File

@ -176,6 +176,7 @@ function CoderDepot(props){
} }
}).then((result) => { }).then((result) => {
if (result) { if (result) {
console.log(result)
let en = result.data.entries; let en = result.data.entries;
if(en.type){ if(en.type){
setDirInfo(undefined); setDirInfo(undefined);
@ -349,23 +350,36 @@ function CoderDepot(props){
branchList={projectDetail && projectDetail.branches && projectDetail.branches.list} branchList={projectDetail && projectDetail.branches && projectDetail.branches.list}
></SelectBranch> ></SelectBranch>
: :
<span>分支<span className="color-grey-6">{branchName || defaultBranch}</span></span> <span>分支<span className="color-grey-6">{branchName || defaultBranch}</span></span>
} }
</div> </div>
<AlignCenter className="mr20"> {
<Link to={`/${owner}/${projectsId}/branches`} className="iconBtn"> treeValuePath && treeValuePath.length > 0 ?
<i className="iconfont icon-master_icon font-16"></i> <Path
<span>分支</span> identifier={projectDetail && projectDetail.identifier}
<span>{projectDetail && projectDetail.branches && projectDetail.branches.total_count}</span> treeValuePath={treeValuePath}
</Link> returnUlr={returnUlr}
</AlignCenter> returnMain={returnMain}
<AlignCenter className="mr20"> getPathUrl={getPathUrl}
<Link to={`/${owner}/${projectsId}/tags`} className="iconBtn"> />
<i className="iconfont icon-biaoqianicon font-16"></i> :
<span>标签</span> <div>
<span>{projectDetail && projectDetail.tags && projectDetail.tags.total_count}</span> <AlignCenter className="mr20">
</Link> <Link to={`/${owner}/${projectsId}/branches`} className="iconBtn">
</AlignCenter> <i className="iconfont icon-master_icon font-16"></i>
<span>分支</span>
<span>{projectDetail && projectDetail.branches && projectDetail.branches.total_count}</span>
</Link>
</AlignCenter>
<AlignCenter className="mr20">
<Link to={`/${owner}/${projectsId}/tags`} className="iconBtn">
<i className="iconfont icon-biaoqianicon font-16"></i>
<span>标签</span>
<span>{projectDetail && projectDetail.tags && projectDetail.tags.total_count}</span>
</Link>
</AlignCenter>
</div>
}
</AlignCenter> </AlignCenter>
<AlignCenter className="depotBtn"> <AlignCenter className="depotBtn">
{ {
@ -419,16 +433,6 @@ function CoderDepot(props){
</div> </div>
} }
<ul className="listtablebody"> <ul className="listtablebody">
{
treeValuePath && treeValuePath.length > 0 &&
<Path
identifier={projectDetail && projectDetail.identifier}
treeValuePath={treeValuePath}
returnUlr={returnUlr}
returnMain={returnMain}
getPathUrl={getPathUrl}
/>
}
{ {
dirInfo && dirInfo.length > 0 && dirInfo && dirInfo.length > 0 &&
dirInfo.map((item,key)=>{ dirInfo.map((item,key)=>{
@ -462,11 +466,11 @@ function CoderDepot(props){
(dirInfo && dirInfo.length === 0) && !fileInfo ? <Nodata _html="暂未发现文件"/> :"" (dirInfo && dirInfo.length === 0) && !fileInfo ? <Nodata _html="暂未发现文件"/> :""
} }
{/* readme文件显示(显示文件详情时不显示readme文件) */} {/* readme文件显示(显示文件详情时不显示readme文件) */}
{ dirInfo && (readme && readme.content) ? <ReadMe ChangeFile={ChangeFile} readme={readme} operate={props && (props.isManager || props.isDeveloper) && projectDetail.type !==2 } history={props.history} /> :"" } { (readme && readme.content) ? <ReadMe ChangeFile={ChangeFile} readme={readme} operate={props && (props.isManager || props.isDeveloper) && projectDetail.type !==2 } history={props.history} /> :"" }
</div> </div>
</LongWidth> </LongWidth>
{ {
!fileInfo && (!(treeValuePath && treeValuePath.length > 0) && !fileInfo) &&
<ShortWidth> <ShortWidth>
<Gap style={{paddingLeft:"30px"}}> <Gap style={{paddingLeft:"30px"}}>
<div className="panelmenu"> <div className="panelmenu">

View File

@ -1,3 +1,4 @@
import { result } from 'lodash';
import React from 'react'; import React from 'react';
@ -12,6 +13,7 @@ function CoderDepotPath({treeValuePath , returnUlr , returnMain , getPathUrl , i
{identifier} {identifier}
</a> </a>
{treeValuePath.map((item, key) => { {treeValuePath.map((item, key) => {
console.log(result)
return ( return (
<React.Fragment> <React.Fragment>
{ {

View File

@ -4,12 +4,14 @@ import UserSubmitComponent from "./UserSubmitComponent";
import "./index.css"; import "./index.css";
import "./editor.css"; import "./editor.css";
import { edit } from "marked/src/helpers";
class m_editor extends Component { class m_editor extends Component {
constructor(props) { constructor(props) {
super(props); super(props);
this.state = { this.state = {
editorValue: this.props.content, editorValue: this.props.content,
prevHeight:0
}; };
} }
componentDidUpdate=(prevProps)=>{ componentDidUpdate=(prevProps)=>{
@ -41,19 +43,57 @@ class m_editor extends Component {
folding: true, folding: true,
foldingStrategy: "indentation", // 代码可分小段折叠 foldingStrategy: "indentation", // 代码可分小段折叠
automaticLayout: true, // 自适应布局 automaticLayout: true, // 自适应布局
// overviewRulerBorder: false, // 不要滚动条的边框 overviewRulerBorder: false, // 不要滚动条的边框
// scrollBeyondLastLine: false, // 取消代码后面一大段空白 scrollBeyondLastLine: false, // 取消代码后面一大段空白
minimap: { minimap: {
// 不要小地图 // 不要小地图
enabled: false, enabled: false,
}, },
}; };
const handleEditorMount = (editor, monaco) => {
editor.onDidChangeModelDecorations(() => {
updateEditorHeight(); // typing
requestAnimationFrame(updateEditorHeight); //folding
});
const updateEditorHeight = () => {
const editorElement = editor.getDomNode();
if (!editorElement) {
return;
}
const padding = 40;
const lineHeight = editor.getOption(
monaco.editor.EditorOption.lineHeight
);
const lineCount = editor.getModel().getLineCount() || 1;
const height =
editor.getTopForLineNumber(lineCount + 1) +
lineHeight +
padding;
if (this.state.prevHeight !== height) {
this.serState({
prevHeight:height
})
// setPrevHeight(height);
editorElement.style.height = `${height}px`;
editor.layout();
}
};
};
return ( return (
<React.Fragment> <React.Fragment>
<div> <div>
<div className="branchTable" style={{border:"1px solid #eee"}}> <div className="">
<Editor <Editor
height="400px" // height={this.state.x}
language={language ? language : "plaintext"} language={language ? language : "plaintext"}
theme={"vs-grey"} theme={"vs-grey"}
placeholder="请输入内容" placeholder="请输入内容"
@ -61,6 +101,7 @@ class m_editor extends Component {
options={editor_options} options={editor_options}
onChange={this.changeEditor} onChange={this.changeEditor}
editorWillMount={this.editorWillMount} editorWillMount={this.editorWillMount}
editorDidMount={handleEditorMount}
/> />
</div> </div>
{!readOnly && ( {!readOnly && (