diff --git a/public/react/src/App.js b/public/react/src/App.js index d4c70e6aa..1a1af02d9 100644 --- a/public/react/src/App.js +++ b/public/react/src/App.js @@ -263,7 +263,7 @@ class App extends Component { {/**/} {/*认证*/} - {/**/} + {/*403*/} diff --git a/public/react/src/common/components/markdown/DMDEditor.js b/public/react/src/common/components/markdown/DMDEditor.js index ef86b49e7..b9435176f 100644 --- a/public/react/src/common/components/markdown/DMDEditor.js +++ b/public/react/src/common/components/markdown/DMDEditor.js @@ -39,18 +39,29 @@ class DMDEditor extends Component{ onChange = (val) => { // this.setState({ value: val }) this.props.onChange(val) + if (this.state.showError == true) { + this.setState({showError: false}) + } + } + showError = () => { + this.mdRef.current.showError() + this.setState({showError: true}) } render(){ - const { mdMode } = this.state; + const { mdMode, showError } = this.state; const { initValue } = this.props; - + let _style = {} + if (showError) { + _style.border = '1px solid red' + } + _style = Object.assign(_style, {display: mdMode == true ? 'none' : '', color: initValue? '': '#999', alignItems: 'center', wordBreak: 'break-all'}) return(
diff --git a/public/react/src/modules/comment/Comment.css b/public/react/src/modules/comment/Comment.css index 2f85846b6..f21a9c8cf 100644 --- a/public/react/src/modules/comment/Comment.css +++ b/public/react/src/modules/comment/Comment.css @@ -238,6 +238,7 @@ width: 100%; word-wrap: break-word; margin-bottom: 4px; + margin-top: 4px; } .childComment .break_word_comments{ line-height: 22px; diff --git a/public/react/src/modules/comment/CommentItemMDEditor.js b/public/react/src/modules/comment/CommentItemMDEditor.js index 3c89d0800..98afa4228 100644 --- a/public/react/src/modules/comment/CommentItemMDEditor.js +++ b/public/react/src/modules/comment/CommentItemMDEditor.js @@ -96,7 +96,7 @@ class CommentItemMDEditor extends Component { } render() { - const { match, history, item, user } = this.props + const { match, history, item, user, buttonText } = this.props if (!item) { return
} @@ -111,7 +111,7 @@ class CommentItemMDEditor extends Component {
@@ -1354,10 +1355,11 @@ export default class TPMsettings extends Component { -

执行命令不能为空

@@ -1369,6 +1371,7 @@ export default class TPMsettings extends Component { value={Compilecommandvalue} onInput={this.Compilecommand} id="compile_command" + style={{width:'100%'}} > diff --git a/public/react/src/modules/tpm/challengesnew/TPMMDEditor.js b/public/react/src/modules/tpm/challengesnew/TPMMDEditor.js index 223065864..46f3a4128 100644 --- a/public/react/src/modules/tpm/challengesnew/TPMMDEditor.js +++ b/public/react/src/modules/tpm/challengesnew/TPMMDEditor.js @@ -239,7 +239,9 @@ export default class TPMMDEditor extends Component { } __editorName.cm.on("change", (_cm, changeObj) => { that.contentChanged = true; - + if (that.state.showError) { + that.setState({showError: false}) + } that.onEditorChange() }) that.props.onCMBlur && __editorName.cm.on('blur', () => { @@ -256,6 +258,9 @@ export default class TPMMDEditor extends Component { }, this); } + showError = () => { + this.setState({showError: true}) + } onEditorChange = () => { if (!this.answers_editormd) return; const val = this.answers_editormd.getValue(); @@ -297,14 +302,18 @@ export default class TPMMDEditor extends Component { render() { let { - choice_url, + showError } = this.state; let { mdID, className, noStorage } = this.props; + let _style = {} + if (showError) { + _style.border = '1px solid red' + } return ( -
+
{/* padding10-20 */} -
+
diff --git a/public/react/src/modules/tpm/challengesnew/TPMevaluation.js b/public/react/src/modules/tpm/challengesnew/TPMevaluation.js index 73262de74..00141188f 100644 --- a/public/react/src/modules/tpm/challengesnew/TPMevaluation.js +++ b/public/react/src/modules/tpm/challengesnew/TPMevaluation.js @@ -381,7 +381,7 @@ export default class TPMevaluation extends Component { // }) // } savegetfilepath=(value)=>{ - let {selectpath} = this.state + let {selectpath,saveshixunfilepath} = this.state // let newarr =selectpatharr; // let arrtype=false; // let arrsum=0; @@ -403,9 +403,28 @@ export default class TPMevaluation extends Component { // newselectpath=newselectpath+newarr[z]+ ";" // } - // let newselectpath=selectpath+value+ ";" - let newselectpath=value + + let newselectpath; + + if(saveshixunfilepath==="shixunfilepathplay"){ + newselectpath=value + }else{ + const type = selectpath.split(';'); + let types=false; + for(var i=0; i -

+

列表中没有? 申请新建

diff --git a/public/react/src/modules/tpm/shixunchild/Collaborators/Collaborators.js b/public/react/src/modules/tpm/shixunchild/Collaborators/Collaborators.js index 07c9f960f..d629a1c5b 100644 --- a/public/react/src/modules/tpm/shixunchild/Collaborators/Collaborators.js +++ b/public/react/src/modules/tpm/shixunchild/Collaborators/Collaborators.js @@ -33,6 +33,7 @@ class Collaborators extends Component { Collaboratorsvisible: false, Collaboratorsvisibleadmin: false, value: 1, + page: 1, Searchadmin: [], allChangechecked: false, Collaboratorslist: [], @@ -155,6 +156,9 @@ class Collaborators extends Component { } onSearchadmin = (value) => { let {collaboratorList,user_name,school_name} = this.state; + this.setState({ + Searchadmin: [], + }) // if (value === "") { // this.setState({ // Searchadmin: [], @@ -172,7 +176,7 @@ class Collaborators extends Component { if (response.data.status === 403||response.data.status === 401||response.data.status === 500) { }else{ - let newlist = response.data; + let newlist = response.data.users; for (var i = 0; i < newlist.length; i++) { newlist[i].checked = false } @@ -336,7 +340,48 @@ class Collaborators extends Component { collaboratorListsumtype:false }) } - render() { + + + contentViewScrolledit=(e)=>{ + //滑动到底判断 + + if(e.currentTarget.scrollHeight-e.currentTarget.scrollTop===e.currentTarget.clientHeight){ + let {page,collaboratorList,user_name,school_name,Searchadmin} = this.state; + let newpage=page+1; + let newSearchadmin=Searchadmin + let id = this.props.match.params.shixunId; + let url = "/shixuns/" + id + "/add_collaborators.json"; + axios.get(url,{params:{ + user_name:user_name , + school_name:school_name, + page:newpage + }}).then((response) => { + if (response.data.status === 403||response.data.status === 401||response.data.status === 500) { + + }else{ + let newlist = response.data.users; + for (var i = 0; i < newlist.length; i++) { + newlist[i].checked = false + newSearchadmin.push(newlist[i]) + } + + console.log(newSearchadmin) + this.setState({ + Searchadmin: newSearchadmin, + collaboratorList: collaboratorList, + page:newpage + }) + } + + }).catch((error) => { + console.log(error) + }); + + } + + } + + render() { let { collaboratorList, Collaboratorsvisible, @@ -445,13 +490,13 @@ class Collaborators extends Component { >搜索

姓名 - 呢称 + 职业 单位

-
    +
      {Searchadmin.length === 0 ?
    • 请试试搜索一下
    • : Searchadmin.map((item, key) => { @@ -460,10 +505,12 @@ class Collaborators extends Component { this.selectChangenickname(e, key)} id={item.user_id}> - {item.nickname} + {item.nickname} {item.identify} {item.school_name} + title={item.school_name} + style={{width: '150px'}} + className="span3 color-grey fl edu-txt-w260 task-hide ml50 task-hide" >{item.school_name} ) }) diff --git a/public/react/src/scripts/concat.js b/public/react/src/scripts/concat.js index 3a40eef91..67e8d4836 100644 --- a/public/react/src/scripts/concat.js +++ b/public/react/src/scripts/concat.js @@ -97,3 +97,51 @@ return; // var uglified = uglify.minify(['file1.js', 'file2.js', 'file3.js']); + + +/** + 优化 + underscore被单独加载了,去掉'D:\\Code\\trustieplus\\public\\react\\public\\js\\editormd\\underscore.min.js', + marked + raphaeljs sequence diagrams 1.0.4 + + + 统计 js_min_all加载的js: + https://github.com/paulmillr/es6-shim + jQuery v1.8.3 jquery.com + Underscore.js 1.8.2 + marked v0.3.3 + ??? + Raphaël 2.1.3 - JavaScript Vector Library + flowchart, v1.3.4 + editormd.js + CodeMirror + cm active-line.js + cm mode javascript + cm merge.js + CodeMirror addon hint + cm showHint + cm anyword-hint + CodeMirror python + CodeMirror c-like(java) + CodeMirror matchbrackets + + + + ???——> + // Copyright (C) 2006 Google Inc. + // + // Licensed under the Apache License, Version 2.0 (the "License"); + // you may not use this file except in compliance with the License. + // You may obtain a copy of the License at + // + // http://www.apache.org/licenses/LICENSE-2.0 + // + // Unless required by applicable law or agreed to in writing, software + // distributed under the License is distributed on an "AS IS" BASIS, + // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + // See the License for the specific language governing permissions and + // limitations under the License. + + + */ \ No newline at end of file