fix 代码二级页面issue修改
This commit is contained in:
parent
a64887d420
commit
89bfb3a986
|
@ -1949,7 +1949,9 @@ a.decoration {
|
|||
}
|
||||
|
||||
.mr20 {
|
||||
margin-right: 20px;
|
||||
margin-right: 10px;
|
||||
margin-left: 10px;
|
||||
float: left;
|
||||
}
|
||||
|
||||
.mr25 {
|
||||
|
@ -1957,7 +1959,7 @@ a.decoration {
|
|||
}
|
||||
|
||||
.mr30 {
|
||||
margin-right: 30px;
|
||||
margin-right: 10px;
|
||||
}
|
||||
|
||||
.mr35 {
|
||||
|
|
|
@ -1,8 +1,8 @@
|
|||
@font-face {
|
||||
font-family: "iconfont"; /* Project id 2340181 */
|
||||
src: url('iconfont.woff2?t=1632792244115') format('woff2'),
|
||||
url('iconfont.woff?t=1632792244115') format('woff'),
|
||||
url('iconfont.ttf?t=1632792244115') format('truetype');
|
||||
src: url('iconfont.woff2?t=1632638897939') format('woff2'),
|
||||
url('iconfont.woff?t=1632638897939') format('woff'),
|
||||
url('iconfont.ttf?t=1632638897939') format('truetype');
|
||||
}
|
||||
|
||||
.iconfont {
|
||||
|
@ -13,18 +13,6 @@
|
|||
-moz-osx-font-smoothing: grayscale;
|
||||
}
|
||||
|
||||
.icon-wenjian7:before {
|
||||
content: "\e8e0";
|
||||
}
|
||||
|
||||
.icon-xiangyoujiantou:before {
|
||||
content: "\e8de";
|
||||
}
|
||||
|
||||
.icon-xiangzuojiantou:before {
|
||||
content: "\e8df";
|
||||
}
|
||||
|
||||
.icon-a-liulanicon2x:before {
|
||||
content: "\e8dd";
|
||||
}
|
||||
|
|
File diff suppressed because one or more lines are too long
|
@ -5,27 +5,6 @@
|
|||
"css_prefix_text": "icon-",
|
||||
"description": "",
|
||||
"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",
|
||||
"name": "浏览icon@2x",
|
||||
|
|
Binary file not shown.
Binary file not shown.
Binary file not shown.
|
@ -176,6 +176,7 @@ function CoderDepot(props){
|
|||
}
|
||||
}).then((result) => {
|
||||
if (result) {
|
||||
console.log(result)
|
||||
let en = result.data.entries;
|
||||
if(en.type){
|
||||
setDirInfo(undefined);
|
||||
|
@ -349,23 +350,36 @@ function CoderDepot(props){
|
|||
branchList={projectDetail && projectDetail.branches && projectDetail.branches.list}
|
||||
></SelectBranch>
|
||||
:
|
||||
<span>分支:<span className="color-grey-6">{branchName || defaultBranch}</span></span>
|
||||
<span>分支:<span className="color-grey-6">{branchName || defaultBranch}</span></span>
|
||||
}
|
||||
</div>
|
||||
<AlignCenter className="mr20">
|
||||
<Link to={`/${owner}/${projectsId}/branches`} className="iconBtn">
|
||||
<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>
|
||||
{
|
||||
treeValuePath && treeValuePath.length > 0 ?
|
||||
<Path
|
||||
identifier={projectDetail && projectDetail.identifier}
|
||||
treeValuePath={treeValuePath}
|
||||
returnUlr={returnUlr}
|
||||
returnMain={returnMain}
|
||||
getPathUrl={getPathUrl}
|
||||
/>
|
||||
:
|
||||
<div>
|
||||
<AlignCenter className="mr20">
|
||||
<Link to={`/${owner}/${projectsId}/branches`} className="iconBtn">
|
||||
<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 className="depotBtn">
|
||||
{
|
||||
|
@ -419,16 +433,6 @@ function CoderDepot(props){
|
|||
</div>
|
||||
}
|
||||
<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.map((item,key)=>{
|
||||
|
@ -462,11 +466,11 @@ function CoderDepot(props){
|
|||
(dirInfo && dirInfo.length === 0) && !fileInfo ? <Nodata _html="暂未发现文件"/> :""
|
||||
}
|
||||
{/* 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>
|
||||
</LongWidth>
|
||||
{
|
||||
!fileInfo &&
|
||||
(!(treeValuePath && treeValuePath.length > 0) && !fileInfo) &&
|
||||
<ShortWidth>
|
||||
<Gap style={{paddingLeft:"30px"}}>
|
||||
<div className="panelmenu">
|
||||
|
|
|
@ -1,3 +1,4 @@
|
|||
import { result } from 'lodash';
|
||||
import React from 'react';
|
||||
|
||||
|
||||
|
@ -12,6 +13,7 @@ function CoderDepotPath({treeValuePath , returnUlr , returnMain , getPathUrl , i
|
|||
{identifier}
|
||||
</a>
|
||||
{treeValuePath.map((item, key) => {
|
||||
console.log(result)
|
||||
return (
|
||||
<React.Fragment>
|
||||
{
|
||||
|
|
|
@ -4,12 +4,14 @@ import UserSubmitComponent from "./UserSubmitComponent";
|
|||
|
||||
import "./index.css";
|
||||
import "./editor.css";
|
||||
import { edit } from "marked/src/helpers";
|
||||
|
||||
class m_editor extends Component {
|
||||
constructor(props) {
|
||||
super(props);
|
||||
this.state = {
|
||||
editorValue: this.props.content,
|
||||
prevHeight:0
|
||||
};
|
||||
}
|
||||
componentDidUpdate=(prevProps)=>{
|
||||
|
@ -41,19 +43,57 @@ class m_editor extends Component {
|
|||
folding: true,
|
||||
foldingStrategy: "indentation", // 代码可分小段折叠
|
||||
automaticLayout: true, // 自适应布局
|
||||
// overviewRulerBorder: false, // 不要滚动条的边框
|
||||
// scrollBeyondLastLine: false, // 取消代码后面一大段空白
|
||||
overviewRulerBorder: false, // 不要滚动条的边框
|
||||
scrollBeyondLastLine: false, // 取消代码后面一大段空白
|
||||
minimap: {
|
||||
// 不要小地图
|
||||
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 (
|
||||
|
||||
|
||||
<React.Fragment>
|
||||
<div>
|
||||
<div className="branchTable" style={{border:"1px solid #eee"}}>
|
||||
<div className="">
|
||||
<Editor
|
||||
height="400px"
|
||||
// height={this.state.x}
|
||||
language={language ? language : "plaintext"}
|
||||
theme={"vs-grey"}
|
||||
placeholder="请输入内容"
|
||||
|
@ -61,6 +101,7 @@ class m_editor extends Component {
|
|||
options={editor_options}
|
||||
onChange={this.changeEditor}
|
||||
editorWillMount={this.editorWillMount}
|
||||
editorDidMount={handleEditorMount}
|
||||
/>
|
||||
</div>
|
||||
{!readOnly && (
|
||||
|
|
Loading…
Reference in New Issue