版本库优化

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

@ -20,11 +20,11 @@ const timeStamp = () => {
*/ */
export function trace_collapse(content) { export function trace_collapse(content) {
if (console.groupCollapsed) { if (console.groupCollapsed) {
console.groupCollapsed(typeof content == 'string' ? content : 'trace_collapse'); // console.groupCollapsed(typeof content == 'string' ? content : 'trace_collapse');
log.trace(arguments); // log.trace(arguments);
console.groupEnd(); // console.groupEnd();
} else { } else {
trace(content) // trace(content)
} }
} }

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

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

@ -255,7 +255,7 @@ class RepositoryAddFile extends Component {
})( })(
<span> <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"}> <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> </span>
)} )}
</Form.Item> </Form.Item>

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

Loading…
Cancel
Save