diff --git a/public/react/src/App.js b/public/react/src/App.js index b40af3e0b..49c2eab99 100644 --- a/public/react/src/App.js +++ b/public/react/src/App.js @@ -372,7 +372,6 @@ class App extends Component { path="/interesse" component={Interestpage} /> - diff --git a/public/react/src/modules/courses/members/studentsList.js b/public/react/src/modules/courses/members/studentsList.js index 8071e2680..0b9a9dc86 100644 --- a/public/react/src/modules/courses/members/studentsList.js +++ b/public/react/src/modules/courses/members/studentsList.js @@ -595,23 +595,25 @@ class studentsList extends Component{ { isAdmin && !isParent && course_group_id != 0 && this.deleteDir()}>删除分班 } { isAdmin && !isParent && course_group_id != 0 && this.renameDir()}>分班重命名 } + .drop_down_menu li a { + padding: 0px; + font-size: 14px; + } + .drop_down_menu { + width: 93px; + } + .drop_down_menu li { + overflow: visible; + width:100%; + box-sizing:boder-box; + float:unset; + } + .drop_down_menu, .drop_down_normal { + padding-top: 10px; + padding-bottom: 8px; + } + + `} { isAdmin &&
  • 导出 diff --git a/public/react/src/modules/tpm/TPMBanner.js b/public/react/src/modules/tpm/TPMBanner.js index fc9c53be1..0009e1f98 100644 --- a/public/react/src/modules/tpm/TPMBanner.js +++ b/public/react/src/modules/tpm/TPMBanner.js @@ -581,7 +581,7 @@ class TPMBanner extends Component { return ( shixunsDetails===undefined?"": -
    +
    {AccountProfiletype===true? import('./TPMChallengeContainer'), @@ -116,6 +118,13 @@ const TPMUpdatepropaede = Loadable({ }) + +// 版本库添加文件 +const AddFile = Loadable({ + loader: () => import('./shixunchild/Repository/RepositoryAddFile'), + loading: Loading, +}) + const interceptorUrlArray = ['repository.json', 'commits.json', 'propaedeutics.json' , 'challenges.json', 'discusses.json', 'ranking_list.json', 'collaborators.json'] const cacheInterceptorUrlMap = {} @@ -258,15 +267,18 @@ class TPMIndex extends Component { // } render() { - + let url = window.location.href; + let flag = url.indexOf("add_file")>-1; return (
    - - - + { + !flag && + + } + ) }> - () - }> + () + }> + + () + }> {/* */} {/* jfinalshop/WebRoot */} @@ -83,7 +84,12 @@ class Repository extends Component { Git使用指南 - {/* */} + { + this.props.current_user && this.props.current_user.admin ==true ? + +添加文件:"" + } + +
    {/* 用户、最近提交时间 */} { - trees === undefined || trees === null ?
    -
    - -

    暂时还没有相关数据哦!

    -
    -
    : + trees === undefined || trees === null ? :
    {author.name}{ - this.setState({ - visible:true - }) + componentDidMount(){ + let cmOptions = createCMOptions(this.props.mirror_name) + const extend_editor = window.CodeMirror.fromTextArea(window.$('#codemirror-file-edit')[0] + , cmOptions); + + // tpi没setValue也可以 + extend_editor.setValue('') + extend_editor.refresh(); + + // 拖拽也需要用 : window.editor_CodeMirror.refresh() + window.editor_tempCodeMirror = extend_editor; + this.extend_editor = extend_editor; } - cancelAdd = () =>{ - this.setState({ - visible:false + + checkPath= (rule, value, callback) =>{ + if (value.indexOf("/") > -1 && value.length==1 ) { + callback('请输入正确的文件路径'); + }else{ + callback(); + } + } + + handleSubmit = () =>{ + this.props.form.validateFieldsAndScroll((err, values) => { + if(!err){ + let shixunId = this.props.match.params.shixunId; + let url = `/shixuns/${shixunId}/add_file.json` + axios.post(url,{ + path:values.path, + message:values.message, + content:this.extend_editor.getValue() + }).then((result)=>{ + if(result){ + this.props.history.push(`${result.data.url}`) + } + }).catch((error)=>{ + console.log(error); + }) + } }) } render(){ - let { visible } = this.state + const {getFieldDecorator} = this.props.form; + let { shixunId } = this.props.match.params; return( - - +添加文件 - -
    +
    + +

    + + 实训项目 + 版本库 + 添加新文件 + +

    +
    +
    + + {getFieldDecorator('path', { + rules: [ + {required: true, message: "文件名不能为空"}, + { + validator:this.checkPath + }] + })( + + )} + +
    +
    +

    + +

    + +
    + +
    + + {getFieldDecorator('message', { + rules: [{required: true, message: "请输入提交信息"}], + })( + + )} +
    -
    - 取消 - 提交 +
    + + 取消
    - - + + +
    ) } }