版本库优化

dev_aliyun2
杨树明 5 years ago committed by harry
parent ba02a008cd
commit 6cf8a80157

@ -17,14 +17,14 @@ const timeStamp = () => {
/*
带trace的默认折叠起来的控制台输出
第一个参数最好传入string类型的标识接着可以跟任意类型任意个数的参数各个参数都会打印到控制台
*/
*/
export function trace_collapse(content) {
if (console.groupCollapsed) {
console.groupCollapsed(typeof content == 'string' ? content : 'trace_collapse');
log.trace(arguments);
console.groupEnd();
// console.groupCollapsed(typeof content == 'string' ? content : 'trace_collapse');
// log.trace(arguments);
// console.groupEnd();
} else {
trace(content)
// trace(content)
}
}

@ -364,11 +364,11 @@ class TPMIndex extends Component {
} else if (e.key === "2") {
this.props.history.replace(`/shixuns/${id}/propaedeutics`);
}else if(e.key==="3"){
window.location.href=`/shixuns/${id}/repository`;
// this.props.history.replace(`/shixuns/${id}/repository`);
// window.location.href=`/shixuns/${id}/repository`;
this.props.history.push(`/shixuns/${id}/repository`);
}else if(e.key==="4"){
window.location.href=`/shixuns/${id}/secret_repository`;
// this.props.history.replace(`/shixuns/${id}/secret_repository`);
// window.location.href=`/shixuns/${id}/secret_repository`;
this.props.history.push(`/shixuns/${id}/secret_repository`);
}else if(e.key==="5"){
this.props.history.replace(`/shixuns/${id}/collaborators`);
} else if (e.key === "6") {

@ -27,7 +27,7 @@ class TPMRepositoryComponent extends Component {
}
}
this.state = {
listItemtype:false,
listItemtypes:false,
repositoryLoading: true,
pathArray: pathArray,
isContentWidth100: this._isFileInPathArray(pathArray)
@ -37,9 +37,11 @@ class TPMRepositoryComponent extends Component {
componentDidUpdate(prevProps, prevState) {
if (this.props.secret_repository_tab != prevProps.secret_repository_tab) {
this.setState({
listItemtype:false,
listItemtypes:false,
})
this.fetchRepo()
console.log(this.props)
console.log(this.state)
this.fetchRepo(0)
}
}
@ -180,7 +182,11 @@ class TPMRepositoryComponent extends Component {
this.props.setpathArray(newPathArray)
let urlNewPathArray = newPathArray;
let fileInPathArray = false;
if (newPathArray.length&&!type) {
if (newPathArray.length&&!type&&typeof listItem != 'number') {
fileInPathArray = this.nameTypeMap[newPathArray[newPathArray.length - 1]] ? this.nameTypeMap[newPathArray[newPathArray.length - 1]] !== 'tree'
: (listItem ? listItem.type !== 'tree' : this._isFileName( newPathArray[newPathArray.length - 1] ))
@ -224,6 +230,7 @@ class TPMRepositoryComponent extends Component {
}
// 初始化时repo接口完毕后需要看是否需要fetchCode
if (fileInPathArray&&!type) {
//
this.fetchCode(newPathArray)

@ -255,7 +255,7 @@ class RepositoryAddFile extends Component {
})(
<span>
<span> </span><span><Input value={this.state.path} placeholder="文件名称或文件路径" className="fl" style={{ width: 200 }} size="large" onInput={(e)=>this.setinput(e)}/></span><span className={" ml10 fl"}>
提示1.输入 /文件名可以创建一个新文件2.输入 /新文件夹名/新文件名 可以创建新文件夹和新文件</span>
提示1.输入 文件名 可以创建一个新文件2.输入 新文件夹名/新文件名 可以创建新文件夹和新文件</span>
</span>
)}
</Form.Item>

@ -126,8 +126,8 @@ class RepositoryCodeEditor extends Component {
})
}
setCohetepaperbool=(sum)=>{
console.log(sum)
console.log(this.props.pathArray)
// console.log(sum)
// console.log(this.props.pathArray)
this.props.oncodechanner(sum)
}
render() {

Loading…
Cancel
Save