From bc58fcd79d36c5bc526502786d42a54b2069d610 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9D=A8=E6=A0=91=E6=98=8E?= <775174143@qq.com> Date: Mon, 24 Jun 2019 13:54:00 +0800 Subject: [PATCH] =?UTF-8?q?=E8=B0=83=E6=95=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- public/react/public/css/edu-all.css | 2 +- .../courses/common/CNotificationHOC.js | 9 + .../courses/coursesDetail/CoursesBanner.js | 27 +- .../courses/coursesPublic/Addcourses.js | 27 +- .../courses/coursesPublic/PathModal.js | 490 +++--- .../courses/coursesPublic/SelectResource.js | 7 +- .../courses/coursesPublic/SelectSetting.js | 10 +- .../courses/coursesPublic/ShixunModal.js | 638 ++++---- .../coursesPublic/modal/ShixunModal2.js | 4 +- .../courses/coursesPublic/sendResource.js | 9 +- .../react/src/modules/courses/css/Courses.css | 5 + .../tasks/GraduationTasksSubmitedit.js | 56 +- .../react/src/modules/forums/RightSection.css | 105 +- .../paths/PathDetail/DetailCardsEditAndAdd.js | 1235 +++++++-------- .../PathDetail/DetailCardsEditAndEdit.js | 1403 +++++++++-------- public/react/src/modules/tpm/TPMIndexHOC.js | 2 + public/stylesheets/educoder/edu-all.css | 2 +- 17 files changed, 2049 insertions(+), 1982 deletions(-) diff --git a/public/react/public/css/edu-all.css b/public/react/public/css/edu-all.css index 9b9bf6960..e1a4640c8 100644 --- a/public/react/public/css/edu-all.css +++ b/public/react/public/css/edu-all.css @@ -296,7 +296,7 @@ label.infolabel{display: block;float: left;width: 56px;text-align: right;margin- .subshaicontent a{float: left;margin-right: 20px;color: #999;cursor: pointer} -.search-new{width: 248px;height:32px;position: relative} +.search-new{width: 248px;height:32px;position: relative;margin-right: 35px;} .search-span{display: block;position: absolute;width: 100%;height: 100%;left:0px;top:0px;background-color: #F4F4F4;border: 1px solid #EAEAEA; border-radius: 4px;z-index: 1} .search-new-input{height: 32px;padding-left: 5px;width: 225px;border: none;box-sizing: border-box;background: none;outline: none;position: absolute;left:0px;top:1px;z-index: 2} .search-new img,.search-new a,.search-new .searchicon{cursor: pointer;position: absolute;right:2px;top:2px;z-index: 2} diff --git a/public/react/src/modules/courses/common/CNotificationHOC.js b/public/react/src/modules/courses/common/CNotificationHOC.js index 89908223a..6be60db3f 100644 --- a/public/react/src/modules/courses/common/CNotificationHOC.js +++ b/public/react/src/modules/courses/common/CNotificationHOC.js @@ -28,6 +28,14 @@ export function CNotificationHOC(options = {}) { notification.open(data); } + bytesToSize = (bytes) => { + if (bytes === 0) return '0 B'; + let k = 1024, + sizes = ['B', 'KB', 'MB', 'GB', 'TB', 'PB', 'EB', 'ZB', 'YB'], + i = Math.floor(Math.log(bytes) / Math.log(k)); + return (bytes / Math.pow(k, i)). toFixed(2) + ' ' + sizes[i]; + } + configNotification = (placement) => { placement && notification.config({ placement: placement, @@ -127,6 +135,7 @@ export function CNotificationHOC(options = {}) { this.getNowFormatDates(value,type)} configNotification={ this.configNotification } confirm={ this.confirm } diff --git a/public/react/src/modules/courses/coursesDetail/CoursesBanner.js b/public/react/src/modules/courses/coursesDetail/CoursesBanner.js index f113209c4..d1b077bbf 100644 --- a/public/react/src/modules/courses/coursesDetail/CoursesBanner.js +++ b/public/react/src/modules/courses/coursesDetail/CoursesBanner.js @@ -431,7 +431,9 @@ class CoursesBanner extends Component {
{coursedata.switch_to_student === true ? - + 由教师/助教身份切换至学生
可进行提交作品、答题等操作 + }> this.switchidentity(1)} > 切换为学生 @@ -439,7 +441,9 @@ class CoursesBanner extends Component { :""} {coursedata.switch_to_teacher === true ? - + 由学生身份切换至教师
拥有添加成员、发布作业等管理权限 + }> this.switchidentity(2)} > 切换为老师 @@ -447,7 +451,9 @@ class CoursesBanner extends Component { {coursedata.switch_to_assistant === true ? - + 由学生身份切换至助教
拥有添加成员、发布作业等管理权限 + }> this.switchidentity(3)} > 切换为助教 @@ -486,7 +492,9 @@ class CoursesBanner extends Component { 学生 {coursedata.student_count} + className={coursedata.credit===null?"color-white fl font-16 bannerurlis":"color-white fl font-16 bannerurli"}> + {coursedata.student_count} + @@ -550,10 +558,13 @@ class CoursesBanner extends Component { {coursedata.code_halt === true? "已停用" : coursedata.invite_code} {coursedata.code_halt === true ? "" : - 成员可以通过邀请码主动加入课堂
- 点击立刻复制邀请码 - + coursedata.code_halt === true?
+																			邀请码已停用
+ 成员不能主动加入课堂 +
:
+																			成员可以通过邀请码主动加入课堂
+ 点击立刻复制邀请码 +
}> { diff --git a/public/react/src/modules/courses/coursesPublic/Addcourses.js b/public/react/src/modules/courses/coursesPublic/Addcourses.js index d0afc4b5b..f3212d9bd 100644 --- a/public/react/src/modules/courses/coursesPublic/Addcourses.js +++ b/public/react/src/modules/courses/coursesPublic/Addcourses.js @@ -119,14 +119,29 @@ class Addcourses extends Component{ } submitasyn=(course_id)=>{ + let{professor}=this.state; + if(professor===1){ + this.setState({ + loadtype:true, + modalsType:true, + modalsTopval:"申请已提交,请等待审核", + modalSave:(course_id)=>this.submitasyns(course_id), + Addcoursestype:false + }) + this.props.hideAddcoursestype(); + }else{ + // let{course_id}=this.state; + this.setState({ + Addcoursestype:false + }) + this.props.hideAddcoursestype(); + window.location.href ="/courses/"+course_id+"/students"; + } - // let{course_id}=this.state; - this.setState({ - Addcoursestype:false - }) - this.props.hideAddcoursestype(); - window.location.href ="/courses/"+course_id+"/students"; } + submitasyns=(course_id)=>{ + window.location.href ="/courses/"+course_id+"/students"; + } submittojoinclass=()=>{ let {invite_code,professor,assistant_professor,student}=this.state; diff --git a/public/react/src/modules/courses/coursesPublic/PathModal.js b/public/react/src/modules/courses/coursesPublic/PathModal.js index 6bf85f3d2..787c70d3e 100644 --- a/public/react/src/modules/courses/coursesPublic/PathModal.js +++ b/public/react/src/modules/courses/coursesPublic/PathModal.js @@ -1,246 +1,246 @@ -import React,{ Component } from "react"; -import { Modal,Checkbox,Select,Input,Tooltip } from "antd"; -import axios from'axios'; -import Loading from '@icedesign/base/lib/loading'; -import '@icedesign/base/lib/loading/style.js'; -import Modals from '../../modals/Modals'; - -const Option = Select.Option; -const Search = Input.Search; -class PathModal extends Component{ - constructor(props){ - super(props); - this.state={ - StudentList_value:"", - Searchvalue:undefined, - type:'all', - page:1, - patheditarry:undefined - } - } - - hidecouseShixunModal=()=>{ - this.props.hidecouseShixunModal() - } - - //tag - changeTag=(types)=>{ - let {Searchvalue}=this.state; - this.setState({ - type:types, - page:1, - }) - this.props.funshixunpathlist(Searchvalue,types,true,1) - } - - //搜索 - SenttotheValue=(e)=>{ - this.setState({ - Searchvalue:e.target.value - }) - } - SenttotheSearch=(value)=>{ - let{type}=this.state; - this.setState({ - page:1, - }) - this.props.funshixunpathlist(value,type,true,1) - } - - - //勾选实训 - shixunhomeworkedit=(list)=>{ - this.setState({ - patheditarry:list - }) - // this.props.funpatheditarry(newpatheditarry) - } - - contentViewScrolledit=(e)=>{ - //滑动到底判断 - - if(e.currentTarget.scrollHeight-e.currentTarget.scrollTop===e.currentTarget.clientHeight){ - - let {Searchvalue,type,page,shixunpathlist}=this.state; - let newpage=page+1 - this.props.funshixunpathlist(Searchvalue,type,true,newpage) - this.setState({ - page:newpage - }) - - } - - } - //提交 - savecouseShixunModal=()=>{ - let {patheditarry}=this.state; - let {coursesId,Coursename,page,order,category_id,datas}=this.props; - let url="/courses/"+coursesId+"/homework_commons/create_subject_homework.json"; - if(patheditarry===undefined){ - this.setState({ - patheditarrytype:true, - patheditarryvalue:"请先选择实训课程" - }) - return - }else if(patheditarry.length===0){ - this.setState({ - patheditarrytype:true, - patheditarryvalue:"请先选择实训课程" - }) - return - } - axios.post(url, { - // category_id: datas&&datas.category_name===undefined||datas&&datas.category_name===null?undefined:category_id, - subject_ids:patheditarry, - } - ).then((response) => { - if(response.data.status===-1){ - // this.setState({ - // Modalstype:true, - // Modalstopval:response.data.message, - // ModalsBottomval:"", - // ModalSave:this.cancelmodel, - // Loadtype:true - // }) - this.props.showNotification(response.data.message) - - }else{ - // this.homeworkstart - //调用立即发布弹窗 - this.props.hidecouseShixunModal(); - this.props.courseshomeworkstart(response.data.category_id,response.data.homework_ids) - // this.props.showNotification("选用成功") - // this.props.showNotification(response.data.message) - // this.props.homeworkupdatalists(Coursename,page,order); - } - - // if(response.status===200) { - // this.props.courseshomeworkstart(response.data.category_id,response.data.homework_ids) - // } - - - }).catch((error) => { - console.log(error) - }) - } - render(){ - let {Searchvalue,type,Modalstype}=this.state; - let {visible,shixunmodallist,hometypepvisible,newshixunmodallist}=this.props; - - - return( -
- {/*提示*/} - {Modalstype&&Modalstype===true?:""} - - - -
- { shixunmodallist && shixunmodallist.tags.length===0?"":} -
- - - {shixunmodallist === undefined ? "":shixunmodallist.subjects_count} - 个实训 - -
- this.SenttotheSearch(value)} - style={{width: '100%'}} - /> -
-
-
    -
  • 实训路径名称
  • -
  • 已发布实训数
  • -
  • 使用人数
  • -
  • -
- - - -
- - - { - newshixunmodallist&&newshixunmodallist.map((item,key)=>{ - return( -
-
  • - - - -
  • -
  • {item.shixun_count}
  • -
  • {item.myshixun_count}
  • - -
  • 详情
  • -
    -
    - ) - }) - } -
    -
    -
    - { this.state.patheditarrytype===true?{this.state.patheditarryvalue}:""} -
    - 取消 - 确定 -
    -
    -
    -
    -
    - ) - } -} +import React,{ Component } from "react"; +import { Modal,Checkbox,Select,Input,Tooltip } from "antd"; +import axios from'axios'; +import Loading from '@icedesign/base/lib/loading'; +import '@icedesign/base/lib/loading/style.js'; +import Modals from '../../modals/Modals'; + +const Option = Select.Option; +const Search = Input.Search; +class PathModal extends Component{ + constructor(props){ + super(props); + this.state={ + StudentList_value:"", + Searchvalue:undefined, + type:'all', + page:1, + patheditarry:undefined + } + } + + hidecouseShixunModal=()=>{ + this.props.hidecouseShixunModal() + } + + //tag + changeTag=(types)=>{ + let {Searchvalue}=this.state; + this.setState({ + type:types, + page:1, + }) + this.props.funshixunpathlist(Searchvalue,types,true,1) + } + + //搜索 + SenttotheValue=(e)=>{ + this.setState({ + Searchvalue:e.target.value + }) + } + SenttotheSearch=(value)=>{ + let{type}=this.state; + this.setState({ + page:1, + }) + this.props.funshixunpathlist(value,type,true,1) + } + + + //勾选实训 + shixunhomeworkedit=(list)=>{ + this.setState({ + patheditarry:list + }) + // this.props.funpatheditarry(newpatheditarry) + } + + contentViewScrolledit=(e)=>{ + //滑动到底判断 + + if(e.currentTarget.scrollHeight-e.currentTarget.scrollTop===e.currentTarget.clientHeight){ + + let {Searchvalue,type,page,shixunpathlist}=this.state; + let newpage=page+1 + this.props.funshixunpathlist(Searchvalue,type,true,newpage) + this.setState({ + page:newpage + }) + + } + + } + //提交 + savecouseShixunModal=()=>{ + let {patheditarry}=this.state; + let {coursesId,Coursename,page,order,category_id,datas}=this.props; + let url="/courses/"+coursesId+"/homework_commons/create_subject_homework.json"; + if(patheditarry===undefined){ + this.setState({ + patheditarrytype:true, + patheditarryvalue:"请先选择实训课程" + }) + return + }else if(patheditarry.length===0){ + this.setState({ + patheditarrytype:true, + patheditarryvalue:"请先选择实训课程" + }) + return + } + axios.post(url, { + // category_id: datas&&datas.category_name===undefined||datas&&datas.category_name===null?undefined:category_id, + subject_ids:patheditarry, + } + ).then((response) => { + if(response.data.status===-1){ + // this.setState({ + // Modalstype:true, + // Modalstopval:response.data.message, + // ModalsBottomval:"", + // ModalSave:this.cancelmodel, + // Loadtype:true + // }) + this.props.showNotification(response.data.message) + + }else{ + // this.homeworkstart + //调用立即发布弹窗 + this.props.hidecouseShixunModal(); + this.props.courseshomeworkstart(response.data.category_id,response.data.homework_ids) + // this.props.showNotification("选用成功") + // this.props.showNotification(response.data.message) + // this.props.homeworkupdatalists(Coursename,page,order); + } + + // if(response.status===200) { + // this.props.courseshomeworkstart(response.data.category_id,response.data.homework_ids) + // } + + + }).catch((error) => { + console.log(error) + }) + } + render(){ + let {Searchvalue,type,Modalstype}=this.state; + let {visible,shixunmodallist,hometypepvisible,newshixunmodallist}=this.props; + + + return( +
    + {/*提示*/} + {Modalstype&&Modalstype===true?:""} + + + +
    + { shixunmodallist && shixunmodallist.tags.length===0?"":} +
    + + + {shixunmodallist === undefined ? "":shixunmodallist.subjects_count} + 个实训 + +
    + this.SenttotheSearch(value)} + style={{width: '115%'}} + /> +
    +
    +
      +
    • 实训路径名称
    • +
    • 已发布实训数
    • +
    • 使用人数
    • +
    • +
    + + + +
    + + + { + newshixunmodallist&&newshixunmodallist.map((item,key)=>{ + return( +
    +
  • + + + +
  • +
  • {item.shixun_count}
  • +
  • {item.myshixun_count}
  • + +
  • 详情
  • +
    +
    + ) + }) + } +
    +
    +
    + { this.state.patheditarrytype===true?{this.state.patheditarryvalue}:""} +
    + 取消 + 确定 +
    +
    +
    +
    +
    + ) + } +} export default PathModal; \ No newline at end of file diff --git a/public/react/src/modules/courses/coursesPublic/SelectResource.js b/public/react/src/modules/courses/coursesPublic/SelectResource.js index 1b400b800..878395144 100644 --- a/public/react/src/modules/courses/coursesPublic/SelectResource.js +++ b/public/react/src/modules/courses/coursesPublic/SelectResource.js @@ -285,6 +285,11 @@ class Selectresource extends Component{ padding: 0 30px; padding-top:30px; } + .search-news{ + width: 237px!important; + height: 30px; + margin-bottom: 30px; + } `}
    @@ -292,7 +297,7 @@ class Selectresource extends Component{
  • this.changeTag("all")} className={ type==="all" ? "active edu-filter-cir-grey font-12":"edu-filter-cir-grey font-12"}>全部
  • this.changeTag("my")} className={ type==="my" ? " active edu-filter-cir-grey font-12":"edu-filter-cir-grey font-12"}>我的资源
  • -
    +
    - {item.response===undefined?"":isNaN(bytesToSize(item.response.filesize))?"":bytesToSize(item.response.filesize)} + {item.response===undefined?"":isNaN(this.props.bytesToSize(item.response.filesize))?"":this.props.bytesToSize(item.response.filesize)} { - - let newpatheditarry=[]; - if (this.props.singleChoose == true) { - if (list.length > 0) { - newpatheditarry.push(list[list.length - 1]) - } - } else { - for(var i=0; i{ - //滑动到底判断 - - if(e.currentTarget.scrollHeight-e.currentTarget.scrollTop===e.currentTarget.clientHeight){ - - let {Searchvalue,type,page}=this.state; - let newpage=page+1 - this.props.funshixunmodallist(Searchvalue,type,true,newpage) - this.setState({ - page:newpage - }) - - } - - } - - //搜索 - SenttotheValue=(e)=>{ - this.setState({ - Searchvalue:e.target.value - }) - } - SenttotheSearch=(value)=>{ - let{type}=this.state; - this.setState({ - page:1, - }) - - this.props.funshixunmodallist(value,type,true,1) - this.props.funpatheditarry([]) - } - - //tag - changeTag=(types)=>{ - let {Searchvalue}=this.state; - this.setState({ - type:types, - page:1, - }) - - this.props.funshixunmodallist(Searchvalue,types,true,1) - this.props.funpatheditarry([]) - } - - - hidecouseShixunModal=()=>{ - this.props.hidecouseShixunModal() - } - - savecouseShixunModal=()=>{ - let {coursesId,patheditarry,datas}=this.props; - - let{category_id}=this.state; - if (this.props.chooseShixun) { - this.props.chooseShixun(patheditarry) - return; - } - if(patheditarry.length===0){ - this.setState({ - shixunmodelchke:true, - chekicmessage:"请先选择实训" - }) - - return - } - let url="/courses/"+coursesId+"/homework_commons/create_shixun_homework.json"; - axios.post(url, { - category_id:this.props.category_id===null||this.props.category_id===undefined?undefined:parseInt(this.props.category_id), - shixun_ids:patheditarry, - } - ).then((response) => { - if(response.data.status===-1){ - // this.props.showNotification(response.data.message) - - }else{ - this.props.courseshomeworkstart(response.data.category_id,response.data.homework_ids) - this.props.hidecouseShixunModal() - } - - // category_id: 3 - // homework_ids: (5) [9171, 9172, 9173, 9174, 9175] - }).catch((error) => { - console.log(error) - }) - } - - selectCloseList=(value)=>{ - this.setState({ - category_id:value - }) - } - render(){ - let {Searchvalue,type,category_id}=this.state; - let {visible,shixunmodallist,hometypepvisible,newshixunmodallist,patheditarry}=this.props; - const antIcon = ; - // console.log(patheditarry) - return( -
    - - - - - {/**/} - {/*{*/} - {/*shixunmodallist === undefined ? "":shixunmodallist.homework_category.length>0?
    */} - - {/*
    选择目录名称:
    */} - {/*
    */} - {/**/} - {/*{ shixunmodallist.main_category.map((item,key)=>{*/} - {/*return(*/} - {/**/} - {/*)*/} - {/*})*/} - {/*}*/} - - {/*{*/} - {/*shixunmodallist.homework_category.map((item,key)=>{*/} - {/*return(*/} - {/**/} - {/*)*/} - {/*})*/} - {/*}*/} - - {/**/} - {/*
    */} - - {/*
    :""}*/} - -
    - - -
    - - - {shixunmodallist === undefined ? "":shixunmodallist.shixuns_count} - 个实训 - -
    - this.SenttotheSearch(value)} - style={{width: '100%'}} - /> -
    -
    - { - - } -
      -
    • 实训名称
    • -
    • 使用院校
    • -
    • 使用人数
    • -
    • 评价等级
    • -
    • -
    - - - -
    - - {/**/} - - { - newshixunmodallist === undefined ? "": newshixunmodallist.map((item,key)=>{ - return( -
    -
  • - - {item.shixun_name} - -
  • -
  • {item.school_users}
  • -
  • {item.myshixuns_count}
  • -
  • {item.preference}
  • - -
  • 详情
  • -
    -
    - ) - }) - } -
    - {/*
    */} -
    -
    -
    - {this.state.shixunmodelchke===true?{this.state.chekicmessage}:""} -
    - 取消 - 确定 -
    -
    -
    - ) - } -} +import React,{ Component } from "react"; +import { Modal,Checkbox,Select,Input,Tooltip,Spin,Icon} from "antd"; +import axios from'axios'; +// import Loading from '@icedesign/base/lib/loading'; +// import '@icedesign/base/lib/loading/style.js'; + +const Option = Select.Option; +const Search = Input.Search; +class ShixunModal extends Component{ + constructor(props){ + super(props); + this.state={ + Searchvalue:undefined, + type:'all', + category_id:0, + page:1 + } + } + componentDidMount() { + + + } + + //勾选实训 + shixunhomeworkedit=(list)=>{ + + let newpatheditarry=[]; + if (this.props.singleChoose == true) { + if (list.length > 0) { + newpatheditarry.push(list[list.length - 1]) + } + } else { + for(var i=0; i{ + //滑动到底判断 + + if(e.currentTarget.scrollHeight-e.currentTarget.scrollTop===e.currentTarget.clientHeight){ + + let {Searchvalue,type,page}=this.state; + let newpage=page+1 + this.props.funshixunmodallist(Searchvalue,type,true,newpage) + this.setState({ + page:newpage + }) + + } + + } + + //搜索 + SenttotheValue=(e)=>{ + this.setState({ + Searchvalue:e.target.value + }) + } + SenttotheSearch=(value)=>{ + let{type}=this.state; + this.setState({ + page:1, + }) + + this.props.funshixunmodallist(value,type,true,1) + this.props.funpatheditarry([]) + } + + //tag + changeTag=(types)=>{ + let {Searchvalue}=this.state; + this.setState({ + type:types, + page:1, + }) + + this.props.funshixunmodallist(Searchvalue,types,true,1) + this.props.funpatheditarry([]) + } + + + hidecouseShixunModal=()=>{ + this.props.hidecouseShixunModal() + } + + savecouseShixunModal=()=>{ + let {coursesId,patheditarry,datas}=this.props; + + let{category_id}=this.state; + if (this.props.chooseShixun) { + this.props.chooseShixun(patheditarry) + return; + } + if(patheditarry.length===0){ + this.setState({ + shixunmodelchke:true, + chekicmessage:"请先选择实训" + }) + + return + } + let url="/courses/"+coursesId+"/homework_commons/create_shixun_homework.json"; + axios.post(url, { + category_id:this.props.category_id===null||this.props.category_id===undefined?undefined:parseInt(this.props.category_id), + shixun_ids:patheditarry, + } + ).then((response) => { + if(response.data.status===-1){ + // this.props.showNotification(response.data.message) + + }else{ + this.props.courseshomeworkstart(response.data.category_id,response.data.homework_ids) + this.props.hidecouseShixunModal() + } + + // category_id: 3 + // homework_ids: (5) [9171, 9172, 9173, 9174, 9175] + }).catch((error) => { + console.log(error) + }) + } + + selectCloseList=(value)=>{ + this.setState({ + category_id:value + }) + } + render(){ + let {Searchvalue,type,category_id}=this.state; + let {visible,shixunmodallist,hometypepvisible,newshixunmodallist,patheditarry}=this.props; + const antIcon = ; + // console.log(patheditarry) + return( +
    + + + + + {/**/} + {/*{*/} + {/*shixunmodallist === undefined ? "":shixunmodallist.homework_category.length>0?
    */} + + {/*
    选择目录名称:
    */} + {/*
    */} + {/**/} + {/*{ shixunmodallist.main_category.map((item,key)=>{*/} + {/*return(*/} + {/**/} + {/*)*/} + {/*})*/} + {/*}*/} + + {/*{*/} + {/*shixunmodallist.homework_category.map((item,key)=>{*/} + {/*return(*/} + {/**/} + {/*)*/} + {/*})*/} + {/*}*/} + + {/**/} + {/*
    */} + + {/*
    :""}*/} + +
    + + +
    + + + {shixunmodallist === undefined ? "":shixunmodallist.shixuns_count} + 个实训 + +
    + this.SenttotheSearch(value)} + style={{width: '115%'}} + /> +
    +
    + { + + } +
      +
    • 实训名称
    • +
    • 使用院校
    • +
    • 使用人数
    • +
    • 评价等级
    • +
    • +
    + + + +
    + + {/**/} + + { + newshixunmodallist === undefined ? "": newshixunmodallist.map((item,key)=>{ + return( +
    +
  • + + {item.shixun_name} + +
  • +
  • {item.school_users}
  • +
  • {item.myshixuns_count}
  • +
  • {item.preference}
  • + +
  • 详情
  • +
    +
    + ) + }) + } +
    + {/*
    */} +
    +
    +
    + {this.state.shixunmodelchke===true?{this.state.chekicmessage}:""} +
    + 取消 + 确定 +
    +
    +
    + ) + } +} export default ShixunModal; \ No newline at end of file diff --git a/public/react/src/modules/courses/coursesPublic/modal/ShixunModal2.js b/public/react/src/modules/courses/coursesPublic/modal/ShixunModal2.js index 1cb47ae7e..d01c8d986 100644 --- a/public/react/src/modules/courses/coursesPublic/modal/ShixunModal2.js +++ b/public/react/src/modules/courses/coursesPublic/modal/ShixunModal2.js @@ -230,11 +230,11 @@ class ShixunModal extends Component{
    this.SenttotheSearch(value)} - style={{width: '100%'}} + style={{width: '115%'}} />
    diff --git a/public/react/src/modules/courses/coursesPublic/sendResource.js b/public/react/src/modules/courses/coursesPublic/sendResource.js index 544c44286..bdd597495 100644 --- a/public/react/src/modules/courses/coursesPublic/sendResource.js +++ b/public/react/src/modules/courses/coursesPublic/sendResource.js @@ -22,13 +22,6 @@ function disabledDateTime() { }; } -function bytesToSize(bytes) { - if (bytes === 0) return '0 B'; - let k = 1024, - sizes = ['B', 'KB', 'MB', 'GB', 'TB', 'PB', 'EB', 'ZB', 'YB'], - i = Math.floor(Math.log(bytes) / Math.log(k)); - return (bytes / Math.pow(k, i)). toFixed(2) + ' ' + sizes[i]; -} const dateFormat="YYYY-MM-DD HH:mm"; class Sendresource extends Component{ constructor(props){ @@ -456,7 +449,7 @@ class Sendresource extends Component{ {item.name} - {item.response===undefined?"":isNaN(bytesToSize(item.response.filesize))?"":bytesToSize(item.response.filesize)} + {item.response===undefined?"":isNaN(this.props.bytesToSize(item.response.filesize))?"":this.props.bytesToSize(item.response.filesize)} { + //onAttachmentRemove = (file) => { // confirm({ // title: '确定要删除这个附件吗?', @@ -228,14 +228,14 @@ class GraduationTasksSubmitedit extends Component{ // }); // return false; - this.setState({ - Modalstype:true, - Modalstopval:'确定要删除这个附件吗?', - ModalSave: ()=>this.deleteAttachment(file), - ModalCancel:this.cancelAttachment - }) - return false; - } + // this.setState({ + // Modalstype:true, + // Modalstopval:'确定要删除这个附件吗?', + // ModalSave: ()=>this.deleteAttachment(file), + // ModalCancel:this.cancelAttachment + // }) + // return false; + //} cancelAttachment=()=>{ this.setState({ @@ -246,8 +246,8 @@ class GraduationTasksSubmitedit extends Component{ }) } - deleteAttachment = (file) => { - let {attachments}=this.state; + onAttachmentRemove = (file) => { + let {attachments,fileList}=this.state; const url = `/attachments/${file.uid===undefined?file.id:file.uid}.json` axios.delete(url, { }) @@ -426,7 +426,7 @@ class GraduationTasksSubmitedit extends Component{ multiple: true, // https://github.com/ant-design/ant-design/issues/15505 // showUploadList={false},然后外部拿到 fileList 数组自行渲染列表。 - // showUploadList: false, + showUploadList: false, action: `${getUrl()}/api/attachments.json`, onChange: this.handleChange, onRemove: this.onAttachmentRemove, @@ -553,7 +553,37 @@ class GraduationTasksSubmitedit extends Component{ ) })} - + + {this.state.fileList.length===0?"":this.state.fileList.map((item,key)=>{ + return( +

    + + + + + {item.name} + + + {item.response===undefined?"":isNaN(this.props.bytesToSize(item.response.filesize))?"":this.props.bytesToSize(item.response.filesize)} + + +

    + ) + })} diff --git a/public/react/src/modules/forums/RightSection.css b/public/react/src/modules/forums/RightSection.css index 3efe0bc43..73994ae24 100644 --- a/public/react/src/modules/forums/RightSection.css +++ b/public/react/src/modules/forums/RightSection.css @@ -1,52 +1,53 @@ -/* 右侧搜索区域*/ -.searchFor .searchCon { - width: 215px; -} - -.search-new { - width:237px!important; - height: 30px; - margin-bottom: 30px; -} - .search-new-input { - padding-left: 16px; - height: 30px; - } - .search-span { - border-radius: 17px; - } - -.search-new img { - right: 10px; -} - - -/* 右侧 热门标签 */ -.HotLabelList a{display: block;float: left;padding: 0px 9px;height: 28px;line-height: 28px;border-radius: 14px;background-color: #f5f5f5;color: #666;margin-right: 10px;margin-bottom: 9px;} -.HotLabelList a.selected { - background: #4CACFF; - color: #fff; -} - - - -/* 右侧 热门问题 */ -.hotQuestionItem{padding:20px 0px;border-bottom: 1px solid #eee;} -.questiontName{max-width: 100%;display: block;} - - - -/* 用户信息-UserSection*/ -.user_default_btn {width: 114px;} -.userPrivateName{line-height: 25px;margin-bottom: 9px;} -.userPrivatePost{line-height: 20px;} -.noteDetailTitle{line-height: 38px;font-size: 24px;font-weight: normal;text-align:justify } - -.noteDetailNum{float: left;padding:0px 12px;position: relative;color: #999!important;height: 28px;line-height: 26px;} -.noteDetailNum.rightline:after{position: absolute;content: '';right: 0px;width: 1px;background-color: #EAEAEA;height: 8px;top:10px;} - -/*帖子详情点赞*/ -.noteDetailPoint{width: 100px;height: 70px;background-color: #4cacff;border-radius: 35px;color: #FFFFff;text-align: center;margin: 0px auto;box-sizing: border-box;padding: 2px 0px;cursor: pointer; line-height: 22px; - padding-top: 12px;} -.Pointed{background-color:#f0f0f0;color: #b3b3b3; cursor: default} -.notefileDownload{height: 25px;line-height: 22px;} +/* 右侧搜索区域*/ +.searchFor .searchCon { + width: 215px; +} + +.search-new { + width:237px!important; + height: 30px; + margin-bottom: 30px; + margin-right: 35px; +} + .search-new-input { + padding-left: 16px; + height: 30px; + } + .search-span { + border-radius: 17px; + } + +.search-new img { + right: 10px; +} + + +/* 右侧 热门标签 */ +.HotLabelList a{display: block;float: left;padding: 0px 9px;height: 28px;line-height: 28px;border-radius: 14px;background-color: #f5f5f5;color: #666;margin-right: 10px;margin-bottom: 9px;} +.HotLabelList a.selected { + background: #4CACFF; + color: #fff; +} + + + +/* 右侧 热门问题 */ +.hotQuestionItem{padding:20px 0px;border-bottom: 1px solid #eee;} +.questiontName{max-width: 100%;display: block;} + + + +/* 用户信息-UserSection*/ +.user_default_btn {width: 114px;} +.userPrivateName{line-height: 25px;margin-bottom: 9px;} +.userPrivatePost{line-height: 20px;} +.noteDetailTitle{line-height: 38px;font-size: 24px;font-weight: normal;text-align:justify } + +.noteDetailNum{float: left;padding:0px 12px;position: relative;color: #999!important;height: 28px;line-height: 26px;} +.noteDetailNum.rightline:after{position: absolute;content: '';right: 0px;width: 1px;background-color: #EAEAEA;height: 8px;top:10px;} + +/*帖子详情点赞*/ +.noteDetailPoint{width: 100px;height: 70px;background-color: #4cacff;border-radius: 35px;color: #FFFFff;text-align: center;margin: 0px auto;box-sizing: border-box;padding: 2px 0px;cursor: pointer; line-height: 22px; + padding-top: 12px;} +.Pointed{background-color:#f0f0f0;color: #b3b3b3; cursor: default} +.notefileDownload{height: 25px;line-height: 22px;} diff --git a/public/react/src/modules/paths/PathDetail/DetailCardsEditAndAdd.js b/public/react/src/modules/paths/PathDetail/DetailCardsEditAndAdd.js index 3ac61cb1e..393c28c9f 100644 --- a/public/react/src/modules/paths/PathDetail/DetailCardsEditAndAdd.js +++ b/public/react/src/modules/paths/PathDetail/DetailCardsEditAndAdd.js @@ -1,618 +1,619 @@ -import React, { Component } from 'react'; -import {getImageUrl} from 'educoder'; -import {Modal,Input,Checkbox,Tooltip} from "antd"; -import { DragDropContext , Draggable, Droppable} from 'react-beautiful-dnd'; -import Modals from '../../modals/Modals'; -import Loading from '@icedesign/base/lib/loading'; -import '@icedesign/base/lib/loading/style.js'; -import '../ShixunPaths.css'; -import axios from 'axios'; -const $ = window.$; -const Search = Input.Search; - -//a little function to help us with reordering the result -const reorder = (list, startIndex, endIndex) => { - // console.log(list) - // console.log(startIndex) - // console.log(endIndex) - - let newlist=list; - const result = Array.from(newlist); - const [removed] = result.splice(startIndex, 1); - result.splice(endIndex, 0, removed); - - return result; -}; - -const getItemStyle = (isDragging, draggableStyle) => ({ - // change background colour if dragging - background: isDragging ? '#dceeff' : '', - // styles we need to apply on draggables - ...draggableStyle, -}); - -class DetailCardsEditAndAdd extends Component{ - constructor(props){ - super(props); - this.state={ - selectShixun:false, - editPanel:false, - search:"", - type:0, - page:1, - ChooseShixunList:undefined, - hometypepvisible:true, - shixuns_listedit:undefined, - shixuns_listeditlist:[], - patheditarry:[], - stage_descriptions:undefined, - stage_names:undefined, - delectfunvalue:undefined, - Modalstype:false, - Modalstopval:"", - Modalsbottomval:"", - ChooseShixunListshixun_list:undefined, - stage_nametype:false, - descriptiontype:false - } - this.onDragEnd = this.onDragEnd.bind(this); - } - //选择实训弹框 - AddShixunBox = () =>{ - this.setState({ - selectShixun:true, - patheditarry:[] - }) - this.changeTag(0,""); - } - - //关闭选择实训弹框 - cloasShixunBox =()=>{ - this.setState({ - selectShixun:false, - patheditarry:[] - }) - } - clickShixunchoose=()=>{ - - let{patheditarry,shixuns_listeditlist}=this.state - let newshixuns_listedit=[]; - let list=shixuns_listeditlist - - if(patheditarry.length===0){ - this.setState({ - Modalstype:true, - Modalstopval:'请选择实训', - cardsModalsave:this.cardsModalsave - }) - - return - } - - let url='/paths/append_to_stage.json' - axios.post(url,{ - shixun_id:patheditarry - }).then((response) => { - let newshixun_lists=response.data.shixun_lists; - - for(var z=0; z { - console.log(error) - }); - - } - - //点击新建阶段 - addStage=()=>{ - this.props.editeditbuttomtypes(); - this.setState({ - editPanel:true - }) - - } - //取消新建阶段 - cancelAddState = () =>{ - this.setState({ - editPanel:false, - stage_names:undefined, - stage_descriptions:undefined, - shixuns_listeditlist:[], - shixuns_listedit:undefined - }) - this.props.getPathCardsLists(); - } - - searchNameInput=(e)=>{ - this.setState({ - search:e.target.value - }) - } - - //打开选择实训弹框初始化tag标签和列表 - changeTag=(id,search)=>{ - this.setState({ - hometypepvisible:true - }) - let pathId=this.props.pathid; - let {page}=this.state; - let url='/paths/'+pathId+'/choose_subject_shixun.json?page='+page - if(search!="" && search!=undefined){ - url+="&search="+search; - } - if(id!=0){ - url+="&type="+id; - } - axios.get(url).then((result)=>{ - if(result.status===200){ - this.setState({ - ChooseShixunList:result.data, - hometypepvisible:false, - type:id, - ChooseShixunListshixun_list:result.data.shixun_list - }) - } - }).catch((error)=>{ - console.log(error); - }) - } - - //勾选实训 - shixunhomeworkedit=(list)=>{ - - let newpatheditarry=[]; - for(var i=0; i{ - - this.setState({ - stage_names:e.target.value - }) - - } - - updatastage_descriptions=(e)=>{ - - this.setState({ - stage_descriptions:e.target.value - }) - - } - - //删除实训 - shixunslisteditdelect=(e)=>{ - this.setState({ - Modalstype:true, - Modalstopval:'是否删除该实训?', - Modalsbottomval:'', - delectfunvalue:e.target.id - }) - } - shixunslisteditdelectfun=()=>{ - let {delectfunvalue}=this.state; - let sum = parseInt(delectfunvalue); - let {shixuns_listedit,shixuns_listeditlist} =this.state; - let newshixuns_listedit=shixuns_listedit - let newshixuns_listeditlist=shixuns_listeditlist - newshixuns_listedit.splice(sum, 1); - newshixuns_listeditlist.splice(sum, 1); - this.setState({ - shixuns_listedit:newshixuns_listedit, - shixuns_listeditlist:newshixuns_listeditlist - }) - this.setState({ - Modalstype:false, - Modalstopval:'', - Modalsbottomval:'', - delectfunvalue:undefined - }) - } - cardsModalcancel=()=>{ - this.setState({ - Modalstype:false, - Modalstopval:'', - Modalsbottomval:'', - delectfunvalue:undefined - }) - } - - //保存 - clickShixunsaves=()=>{ - let{stage_names,stage_descriptions,shixuns_listeditlist}=this.state; - let newstage_descriptions=stage_descriptions; - - if(stage_names===""||stage_names===undefined){ - - this.setState({ - stage_nametype:true - }) - - return - }else{ - this.setState({ - stage_nametype:false - }) - } - - if(newstage_descriptions!=undefined){ - - if(newstage_descriptions.length>300){ - - this.setState({ - descriptiontype:true - }) - - return - } - }else{ - newstage_descriptions="" - } - - - - let pathId=this.props.pathid; - let url='/stages.json?subject_id='+pathId - axios.post(url, { - name:stage_names, - description:newstage_descriptions, - shixun_id:shixuns_listeditlist - }).then((response) => { - // window.location.href = "/paths/" + response.data.subject_id - this.props.getPathCardsLists(); - - this.cancelAddState(); - this.setState({ - stage_nametype:false, - descriptiontype:false - }) - }).catch((error) => { - console.log(error) - }); - } - - - contentViewScrolladd=(e)=>{ - - //滑动到底判断 - if(e.currentTarget.scrollHeight-e.currentTarget.scrollTop===e.currentTarget.clientHeight){ - // console.log("到达底部"); - this.setState({ - hometypepvisible:true - }) - let pathId=this.props.pathid; - let {search,page,type,ChooseShixunListshixun_list}=this.state; - let newpage=page+1; - let newChooseShixunListshixun_list=ChooseShixunListshixun_list; - let url='/paths/'+pathId+'/choose_subject_shixun.json?page='+newpage - if(search!="" && search!=undefined){ - url+="&search="+search; - } - if(type!=0){ - url+="&type="+type; - } - axios.get(url).then((result)=>{ - if(result.status===200){ - let list =result.data.shixun_list; - - for(var i=0; i{ - console.log(error); - }) - } - - } - onDragEnd (result) { - - let {shixuns_listedit,shixuns_listeditlist} =this.state; - const listedit = reorder( - shixuns_listedit, - result.source.index, - result.destination.index - ); - const listeditlist = reorder( - shixuns_listeditlist, - result.source.index, - result.destination.index - ); - this.setState({ - shixuns_listedit:listedit, - shixuns_listeditlist:listeditlist - }) - } - - - render(){ - let {selectShixun, - editPanel, - ChooseShixunList, - type, - page, - search, - hometypepvisible, - stage_descriptions, - stage_names, - shixuns_listedit, - delectfunvalue, - Modalstype, - Modalstopval, - Modalsbottomval, - ChooseShixunListshixun_list, - stage_nametype, - descriptiontype} = this.state - - - return( -
    - - - - { editPanel && -
    -
    -

    - - - - 第{this.props.sum}部分 - {/**/} -

    -
    -

    章节名称

    -
    - * -
    - -
    名称不能为空
    -
    -
    必填项
    -
    -

    描述

    -
    - -
    描述不能超多最大限制300个字符
    -
    - -

    - - - 选择实训 - 选择下面实训后,可以通过拖拽进行排序调整 -

    - - {selectShixun===true?:""} - - - -
    - -
    - - - {ChooseShixunList && ChooseShixunList.shixuns_count} - 个实训 - -
    - this.changeTag(`${type}`,`${search}`)} - > -
    -
    -
      -
    • 实训名称
    • -
    • 使用院校
    • -
    • 使用人数
    • -
    • 评价等级
    • -
    • -
    - - -
    - - { - ChooseShixunListshixun_list && ChooseShixunListshixun_list.map((item,key)=>{ - return( -
    -
  • - - - -
  • -
  • {item.school_users}
  • -
  • {item.myshixuns_count}
  • -
  • {item.preference}
  • -
  • 详情
  • -
    - ) - }) - } -
    -
    -
    - 取消 - 确定 -
    -
    -
    -
    -
    - - {/* 可拖拽选择实训列表*/} - {shixuns_listedit===undefined?'': - - - - {(provided, snapshot) => ( -
    - {shixuns_listedit.map((item,key)=>{ - return( - - {(provided, snapshot) => ( -
    - -
  • - - - - - - - - - - {this.props.sum+1}-{key+1}  {item.shixun_name} - - - - - -
  • - -
  • - - - -
  • - {provided.placeholder} -
    - )} -
    - )})} -
    - )} -
    -
    - } - - {/*老版本实训新建卡片*/} - {/*
    */} - {/*
    */} - {/*×*/} - {/*Shixun0*/} - {/*
    */} - {/*

    frerere

    */} - {/*
    */} - {/*
    */} - {/*
    */} - -

    -

    - 取消 - 保存 -
    -

    - -
    -
    - } - - {this.props.detailInfoList===undefined?"":this.props.detailInfoList.allow_statistics===true?editPanel===false?
    - +点击新建阶段(选择1至多个实训项目,组成一个阶段) -
    :'':''} -
    - ) - } -} +import React, { Component } from 'react'; +import {getImageUrl} from 'educoder'; +import {Modal,Input,Checkbox,Tooltip} from "antd"; +import { DragDropContext , Draggable, Droppable} from 'react-beautiful-dnd'; +import Modals from '../../modals/Modals'; +import Loading from '@icedesign/base/lib/loading'; +import '@icedesign/base/lib/loading/style.js'; +import '../ShixunPaths.css'; +import axios from 'axios'; +const $ = window.$; +const Search = Input.Search; + +//a little function to help us with reordering the result +const reorder = (list, startIndex, endIndex) => { + // console.log(list) + // console.log(startIndex) + // console.log(endIndex) + + let newlist=list; + const result = Array.from(newlist); + const [removed] = result.splice(startIndex, 1); + result.splice(endIndex, 0, removed); + + return result; +}; + +const getItemStyle = (isDragging, draggableStyle) => ({ + // change background colour if dragging + background: isDragging ? '#dceeff' : '', + // styles we need to apply on draggables + ...draggableStyle, +}); + +class DetailCardsEditAndAdd extends Component{ + constructor(props){ + super(props); + this.state={ + selectShixun:false, + editPanel:false, + search:"", + type:0, + page:1, + ChooseShixunList:undefined, + hometypepvisible:true, + shixuns_listedit:undefined, + shixuns_listeditlist:[], + patheditarry:[], + stage_descriptions:undefined, + stage_names:undefined, + delectfunvalue:undefined, + Modalstype:false, + Modalstopval:"", + Modalsbottomval:"", + ChooseShixunListshixun_list:undefined, + stage_nametype:false, + descriptiontype:false + } + this.onDragEnd = this.onDragEnd.bind(this); + } + //选择实训弹框 + AddShixunBox = () =>{ + this.setState({ + selectShixun:true, + patheditarry:[] + }) + this.changeTag(0,""); + } + + //关闭选择实训弹框 + cloasShixunBox =()=>{ + this.setState({ + selectShixun:false, + patheditarry:[] + }) + } + clickShixunchoose=()=>{ + + let{patheditarry,shixuns_listeditlist}=this.state + let newshixuns_listedit=[]; + let list=shixuns_listeditlist + + if(patheditarry.length===0){ + this.setState({ + Modalstype:true, + Modalstopval:'请选择实训', + cardsModalsave:this.cardsModalsave + }) + + return + } + + let url='/paths/append_to_stage.json' + axios.post(url,{ + shixun_id:patheditarry + }).then((response) => { + let newshixun_lists=response.data.shixun_lists; + + for(var z=0; z { + console.log(error) + }); + + } + + //点击新建阶段 + addStage=()=>{ + this.props.editeditbuttomtypes(); + this.setState({ + editPanel:true + }) + + } + //取消新建阶段 + cancelAddState = () =>{ + this.setState({ + editPanel:false, + stage_names:undefined, + stage_descriptions:undefined, + shixuns_listeditlist:[], + shixuns_listedit:undefined + }) + this.props.getPathCardsLists(); + } + + searchNameInput=(e)=>{ + this.setState({ + search:e.target.value + }) + } + + //打开选择实训弹框初始化tag标签和列表 + changeTag=(id,search)=>{ + this.setState({ + hometypepvisible:true + }) + let pathId=this.props.pathid; + let {page}=this.state; + let url='/paths/'+pathId+'/choose_subject_shixun.json?page='+page + if(search!="" && search!=undefined){ + url+="&search="+search; + } + if(id!=0){ + url+="&type="+id; + } + axios.get(url).then((result)=>{ + if(result.status===200){ + this.setState({ + ChooseShixunList:result.data, + hometypepvisible:false, + type:id, + ChooseShixunListshixun_list:result.data.shixun_list + }) + } + }).catch((error)=>{ + console.log(error); + }) + } + + //勾选实训 + shixunhomeworkedit=(list)=>{ + + let newpatheditarry=[]; + for(var i=0; i{ + + this.setState({ + stage_names:e.target.value + }) + + } + + updatastage_descriptions=(e)=>{ + + this.setState({ + stage_descriptions:e.target.value + }) + + } + + //删除实训 + shixunslisteditdelect=(e)=>{ + this.setState({ + Modalstype:true, + Modalstopval:'是否删除该实训?', + Modalsbottomval:'', + delectfunvalue:e.target.id + }) + } + shixunslisteditdelectfun=()=>{ + let {delectfunvalue}=this.state; + let sum = parseInt(delectfunvalue); + let {shixuns_listedit,shixuns_listeditlist} =this.state; + let newshixuns_listedit=shixuns_listedit + let newshixuns_listeditlist=shixuns_listeditlist + newshixuns_listedit.splice(sum, 1); + newshixuns_listeditlist.splice(sum, 1); + this.setState({ + shixuns_listedit:newshixuns_listedit, + shixuns_listeditlist:newshixuns_listeditlist + }) + this.setState({ + Modalstype:false, + Modalstopval:'', + Modalsbottomval:'', + delectfunvalue:undefined + }) + } + cardsModalcancel=()=>{ + this.setState({ + Modalstype:false, + Modalstopval:'', + Modalsbottomval:'', + delectfunvalue:undefined + }) + } + + //保存 + clickShixunsaves=()=>{ + let{stage_names,stage_descriptions,shixuns_listeditlist}=this.state; + let newstage_descriptions=stage_descriptions; + + if(stage_names===""||stage_names===undefined){ + + this.setState({ + stage_nametype:true + }) + + return + }else{ + this.setState({ + stage_nametype:false + }) + } + + if(newstage_descriptions!=undefined){ + + if(newstage_descriptions.length>300){ + + this.setState({ + descriptiontype:true + }) + + return + } + }else{ + newstage_descriptions="" + } + + + + let pathId=this.props.pathid; + let url='/stages.json?subject_id='+pathId + axios.post(url, { + name:stage_names, + description:newstage_descriptions, + shixun_id:shixuns_listeditlist + }).then((response) => { + // window.location.href = "/paths/" + response.data.subject_id + this.props.getPathCardsLists(); + + this.cancelAddState(); + this.setState({ + stage_nametype:false, + descriptiontype:false + }) + }).catch((error) => { + console.log(error) + }); + } + + + contentViewScrolladd=(e)=>{ + + //滑动到底判断 + if(e.currentTarget.scrollHeight-e.currentTarget.scrollTop===e.currentTarget.clientHeight){ + // console.log("到达底部"); + this.setState({ + hometypepvisible:true + }) + let pathId=this.props.pathid; + let {search,page,type,ChooseShixunListshixun_list}=this.state; + let newpage=page+1; + let newChooseShixunListshixun_list=ChooseShixunListshixun_list; + let url='/paths/'+pathId+'/choose_subject_shixun.json?page='+newpage + if(search!="" && search!=undefined){ + url+="&search="+search; + } + if(type!=0){ + url+="&type="+type; + } + axios.get(url).then((result)=>{ + if(result.status===200){ + let list =result.data.shixun_list; + + for(var i=0; i{ + console.log(error); + }) + } + + } + onDragEnd (result) { + + let {shixuns_listedit,shixuns_listeditlist} =this.state; + const listedit = reorder( + shixuns_listedit, + result.source.index, + result.destination.index + ); + const listeditlist = reorder( + shixuns_listeditlist, + result.source.index, + result.destination.index + ); + this.setState({ + shixuns_listedit:listedit, + shixuns_listeditlist:listeditlist + }) + } + + + render(){ + let {selectShixun, + editPanel, + ChooseShixunList, + type, + page, + search, + hometypepvisible, + stage_descriptions, + stage_names, + shixuns_listedit, + delectfunvalue, + Modalstype, + Modalstopval, + Modalsbottomval, + ChooseShixunListshixun_list, + stage_nametype, + descriptiontype} = this.state + + + return( +
    + + + + { editPanel && +
    +
    +

    + + + + 第{this.props.sum}部分 + {/**/} +

    +
    +

    章节名称

    +
    + * +
    + +
    名称不能为空
    +
    +
    必填项
    +
    +

    描述

    +
    + +
    描述不能超多最大限制300个字符
    +
    + +

    + + + 选择实训 + 选择下面实训后,可以通过拖拽进行排序调整 +

    + + {selectShixun===true?:""} + + + +
    + +
    + + + {ChooseShixunList && ChooseShixunList.shixuns_count} + 个实训 + +
    + this.changeTag(`${type}`,`${search}`)} + style={{width: '115%'}} + > +
    +
    +
      +
    • 实训名称
    • +
    • 使用院校
    • +
    • 使用人数
    • +
    • 评价等级
    • +
    • +
    + + +
    + + { + ChooseShixunListshixun_list && ChooseShixunListshixun_list.map((item,key)=>{ + return( +
    +
  • + + + +
  • +
  • {item.school_users}
  • +
  • {item.myshixuns_count}
  • +
  • {item.preference}
  • +
  • 详情
  • +
    + ) + }) + } +
    +
    +
    + 取消 + 确定 +
    +
    +
    +
    +
    + + {/* 可拖拽选择实训列表*/} + {shixuns_listedit===undefined?'': + + + + {(provided, snapshot) => ( +
    + {shixuns_listedit.map((item,key)=>{ + return( + + {(provided, snapshot) => ( +
    + +
  • + + + + + + + + + + {this.props.sum+1}-{key+1}  {item.shixun_name} + + + + + +
  • + +
  • + + + +
  • + {provided.placeholder} +
    + )} +
    + )})} +
    + )} +
    +
    + } + + {/*老版本实训新建卡片*/} + {/*
    */} + {/*
    */} + {/*×*/} + {/*Shixun0*/} + {/*
    */} + {/*

    frerere

    */} + {/*
    */} + {/*
    */} + {/*
    */} + +

    +

    + 取消 + 保存 +
    +

    + +
    +
    + } + + {this.props.detailInfoList===undefined?"":this.props.detailInfoList.allow_statistics===true?editPanel===false?
    + +点击新建阶段(选择1至多个实训项目,组成一个阶段) +
    :'':''} +
    + ) + } +} export default DetailCardsEditAndAdd; \ No newline at end of file diff --git a/public/react/src/modules/paths/PathDetail/DetailCardsEditAndEdit.js b/public/react/src/modules/paths/PathDetail/DetailCardsEditAndEdit.js index 8b33bb793..63263dfc1 100644 --- a/public/react/src/modules/paths/PathDetail/DetailCardsEditAndEdit.js +++ b/public/react/src/modules/paths/PathDetail/DetailCardsEditAndEdit.js @@ -1,702 +1,703 @@ -import React, { Component } from 'react'; -import {getImageUrl} from 'educoder'; -import {Modal,Input,Checkbox,Tooltip} from "antd"; -import { DragDropContext,Draggable, Droppable} from 'react-beautiful-dnd'; -import Modals from '../../modals/Modals'; -import Loading from '@icedesign/base/lib/loading'; -import '@icedesign/base/lib/loading/style.js'; -import '../ShixunPaths.css'; -import axios from 'axios'; -const $ = window.$; -const Search = Input.Search; - - -//a little function to help us with reordering the result -const reorder = (list, startIndex, endIndex) => { - // console.log(list) - // console.log(startIndex) - // console.log(endIndex) - - let newlist=list; - const result = Array.from(newlist); - const [removed] = result.splice(startIndex, 1); - result.splice(endIndex, 0, removed); - - return result; -}; - -const getItemStyle = (isDragging, draggableStyle) => ({ - // change background colour if dragging - background: isDragging ? '#dceeff' : '', - // styles we need to apply on draggables - ...draggableStyle, -}); - - -class DetailCardsEditAndEdit extends Component{ - constructor(props){ - super(props); - this.state={ - selectShixun:false, - editPanel:true, - search:"", - type:0, - page:1, - ChooseShixunList:undefined, - hometypepvisible:true, - shixuns_listedit:undefined, - patheditarry:[], - stage_name:undefined, - stage_description:undefined, - stageid:undefined, - Modalstype:false, - Modalstopval:'', - Modalsbottomval:'', - delectfunvalue:undefined, - ChooseShixunListshixun_list:undefined, - stage_nametype:false, - descriptiontype:false - } - this.onDragEnd = this.onDragEnd.bind(this); - } - //选择实训弹框 - AddShixunBox = () =>{ - this.setState({ - selectShixun:true, - patheditarry:[] - }) - this.changeTag(0,""); - } - //关闭选择实训弹框 - cloasShixunBox =()=>{ - this.setState({ - selectShixun:false, - patheditarry:[] - }) - } - - searchNameInput=(e)=>{ - this.setState({ - search:e.target.value - }) - } - - //打开选择实训弹框初始化tag标签和列表 - changeTag(id,search){ - this.setState({ - hometypepvisible:true - }) - let pathId=this.props.pathid; - let {page}=this.state; - let url='/paths/'+pathId+'/choose_subject_shixun.json?page='+page - if(search!="" && search!=undefined){ - url+="&search="+search; - } - if(id!=0){ - url+="&type="+id; - } - axios.get(url).then((result)=>{ - if(result.status===200){ - this.setState({ - ChooseShixunList:result.data, - hometypepvisible:false, - type:id, - search:search, - ChooseShixunListshixun_list:result.data.shixun_list - }) - } - }).catch((error)=>{ - console.log(error); - }) - } - - shixunhomeworkedit=(list)=>{ - - let newpatheditarry=[]; - for(var i=0; i{ - - this.setState({ - stage_name:e.target.value - }) - - } - - updatastage_description=(e)=>{ - - this.setState({ - stage_description:e.target.value - }) - - } - - clickShixunchoose=()=>{ - - let{patheditarry,shixuns_listedit,shixuns_listeditlist}=this.state - let newshixuns_listedit=shixuns_listedit; - let list=shixuns_listeditlist - - if(patheditarry.length===0){ - this.setState({ - Modalstype:true, - Modalstopval:'请选择实训', - - }) - - return - } - - let url='/paths/append_to_stage.json' - axios.post(url,{ - shixun_id:patheditarry - }).then((response) => { - let newshixun_lists=response.data.shixun_lists; - - - for(var j=0; j { - console.log(error) - }); - - } - - //保存 - clickShixunsave=()=>{ - let{stage_name,stage_description,stageid,shixuns_listeditlist}=this.state; - let newstage_descriptions=stage_description; - - if(stage_name===""||stage_name===undefined){ - - this.setState({ - stage_nametype:true - }) - - return - } - if(newstage_descriptions!=undefined){ - - if(newstage_descriptions.length>300){ - - this.setState({ - descriptiontype:true - }) - - return - } - }else{ - newstage_descriptions="" - } - - - - let url='/stages/'+stageid+'.json' - axios.put(url, { - name:stage_name, - description:newstage_descriptions, - shixun_id:shixuns_listeditlist - }).then((response) => { - // window.location.href = "/paths/" + response.data.subject_id - this.setState({ - stage_name:undefined, - stage_description:undefined, - shixuns_listeditlist:[], - shixuns_listedit:undefined, - stage_nametype:false, - descriptiontype:false - }) - this.props.updatapathCardsedits() - }).catch((error) => { - console.log(error) - }); - } - - //删除实训 - shixunslisteditdelect=(e)=>{ - - this.setState({ - Modalstype:true, - Modalstopval:'是否删除该实训?', - Modalsbottomval:'', - delectfunvalue:e.target.id - }) - - } - - shixunslisteditdelectfun=()=>{ - let{delectfunvalue}=this.state; - let sum = parseInt(delectfunvalue); - let {shixuns_listedit,shixuns_listeditlist} =this.state; - let newshixuns_listedit=shixuns_listedit - let newshixuns_listeditlist=shixuns_listeditlist - newshixuns_listedit.splice(sum, 1); - newshixuns_listeditlist.splice(sum, 1); - this.setState({ - shixuns_listedit:newshixuns_listedit, - shixuns_listeditlist:newshixuns_listeditlist, - Modalstype:false, - Modalstopval:' ', - Modalsbottomval:'', - delectfunvalue:undefined - }) - } - - - cardsModalcancel=()=>{ - this.setState({ - Modalstype:false, - Modalstopval:'', - Modalsbottomval:'', - delectfunvalue:undefined - }) - } - cardsModalsave=()=>{ - this.setState({ - Modalstype:false, - Modalstopval:'', - Modalsbottomval:'' - }) - } - - - - onDragStart = () => { - /*...*/ - }; - onDragUpdate = () => { - /*...*/ - } - - - onDragEnd (result) { - - let {shixuns_listedit,shixuns_listeditlist} =this.state; - const listedit = reorder( - shixuns_listedit, - result.source.index, - result.destination.index - ); - const listeditlist = reorder( - shixuns_listeditlist, - result.source.index, - result.destination.index - ); - this.setState({ - shixuns_listedit:listedit, - shixuns_listeditlist:listeditlist - }) - } - - contentViewScrolledit=(e)=>{ - //滑动到底判断 - - if(e.currentTarget.scrollHeight-e.currentTarget.scrollTop===e.currentTarget.clientHeight){ - this.setState({ - hometypepvisible:true - }) - // console.log("到达底部"); - - let {page,type,search,ChooseShixunListshixun_list}=this.state; - - let newpage=page+1; - - let pathId=this.props.pathid; - - let newChooseShixunListshixun_list=ChooseShixunListshixun_list; - - let url='/paths/'+pathId+'/choose_subject_shixun.json?page='+newpage - - if(search!="" && search!=undefined){ - url+="&search="+search; - } - - if(type!=0){ - url+="&type="+type; - } - axios.get(url).then((result)=>{ - if(result.status===200){ - - let list =result.data.shixun_list; - - for(var i=0; i{ - console.log(error); - }) - - } - - } - - - render(){ - let {selectShixun, - editPanel, - ChooseShixunList, - type, - page, - search, - hometypepvisible, - shixuns_listedit, - patheditarry, - stage_name, - stage_description, - Modalstype, - Modalstopval, - Modalsbottomval, - delectfunvalue, - ChooseShixunListshixun_list, - stage_nametype, - descriptiontype - } = this.state - - return( -
    - this.cardsModalsave():()=>this.shixunslisteditdelectfun()} - > - - - { this.props.idsum===this.props.keys&&this.props.pathCardsedittype===true? - -
    - -
    -

    - {/**/} - {/**/} - {/**/} - - {/**/} -

    -
    - {/*

    章节名称

    */} -
    - * -
    - -
    名称不能为空
    -
    -
    必填项
    -
    -

    描述

    -
    - -
    描述不能超多最大限制300个字符
    -
    -

    - - 选择实训 - - 选择下面实训后,可以通过拖拽进行排序调整 -

    - - {selectShixun===true?:""} - - - - -
    - -
    - - - {ChooseShixunList && ChooseShixunList.shixuns_count} - 个实训 - -
    - this.changeTag(`${type}`,`${search}`)} - > -
    -
    -
      -
    • 实训名称
    • -
    • 使用院校
    • -
    • 使用人数
    • -
    • 评价等级
    • -
    • -
    - - -
    - - { - ChooseShixunListshixun_list && ChooseShixunListshixun_list.map((item,key)=>{ - return( -
    -
  • - - - -
  • -
  • {item.school_users}
  • -
  • {item.myshixuns_count}
  • -
  • {item.preference}
  • -
  • 详情
  • -
    - ) - }) - } -
    -
    -
    - 取消 - 确定 -
    -
    -
    -
    -
    - - {/* 可拖拽选择实训列表*/} - {shixuns_listedit===undefined?'': - - - - {(provided, snapshot) => ( -
    - {shixuns_listedit.map((item,key)=>{ - return( - - {(provided, snapshot) => ( -
    - -
  • - - - - - - - - - - {this.props.idsum+1}-{key+1}  {item.shixun_name} - - - - - -
  • - -
  • - - - -
  • - {provided.placeholder} -
    - )} -
    - )})} -
    - )} -
    -
    - } - - {/*
    */} - {/*
    */} - {/*×*/} - {/*Shixun0*/} - {/*
    */} - {/*

    frerere

    */} - {/*
    */} - {/*
    */} - {/*
    */} - - - {/*

    */} - {/*取消*/} - {/*保存*/} - {/*

    */} - -

    -

    - 取消 - 保存 -
    -

    - - -
    -
    - :''} -
    - ) - } -} -export default DetailCardsEditAndEdit; - - - - - -// { -// shixuns_listedit===undefined?'':shixuns_listedit.map((item,key)=>{ -// return( -//
    -// -//
  • -// -// -// -// -// -// -// -// -// -// {this.props.idsum+1}-{key+1}  {item.shixun_name} -// -// -// -// -// -//
  • -// -//
  • -// -// -// -//
  • -// -//
    -// ) -// }) +import React, { Component } from 'react'; +import {getImageUrl} from 'educoder'; +import {Modal,Input,Checkbox,Tooltip} from "antd"; +import { DragDropContext,Draggable, Droppable} from 'react-beautiful-dnd'; +import Modals from '../../modals/Modals'; +import Loading from '@icedesign/base/lib/loading'; +import '@icedesign/base/lib/loading/style.js'; +import '../ShixunPaths.css'; +import axios from 'axios'; +const $ = window.$; +const Search = Input.Search; + + +//a little function to help us with reordering the result +const reorder = (list, startIndex, endIndex) => { + // console.log(list) + // console.log(startIndex) + // console.log(endIndex) + + let newlist=list; + const result = Array.from(newlist); + const [removed] = result.splice(startIndex, 1); + result.splice(endIndex, 0, removed); + + return result; +}; + +const getItemStyle = (isDragging, draggableStyle) => ({ + // change background colour if dragging + background: isDragging ? '#dceeff' : '', + // styles we need to apply on draggables + ...draggableStyle, +}); + + +class DetailCardsEditAndEdit extends Component{ + constructor(props){ + super(props); + this.state={ + selectShixun:false, + editPanel:true, + search:"", + type:0, + page:1, + ChooseShixunList:undefined, + hometypepvisible:true, + shixuns_listedit:undefined, + patheditarry:[], + stage_name:undefined, + stage_description:undefined, + stageid:undefined, + Modalstype:false, + Modalstopval:'', + Modalsbottomval:'', + delectfunvalue:undefined, + ChooseShixunListshixun_list:undefined, + stage_nametype:false, + descriptiontype:false + } + this.onDragEnd = this.onDragEnd.bind(this); + } + //选择实训弹框 + AddShixunBox = () =>{ + this.setState({ + selectShixun:true, + patheditarry:[] + }) + this.changeTag(0,""); + } + //关闭选择实训弹框 + cloasShixunBox =()=>{ + this.setState({ + selectShixun:false, + patheditarry:[] + }) + } + + searchNameInput=(e)=>{ + this.setState({ + search:e.target.value + }) + } + + //打开选择实训弹框初始化tag标签和列表 + changeTag(id,search){ + this.setState({ + hometypepvisible:true + }) + let pathId=this.props.pathid; + let {page}=this.state; + let url='/paths/'+pathId+'/choose_subject_shixun.json?page='+page + if(search!="" && search!=undefined){ + url+="&search="+search; + } + if(id!=0){ + url+="&type="+id; + } + axios.get(url).then((result)=>{ + if(result.status===200){ + this.setState({ + ChooseShixunList:result.data, + hometypepvisible:false, + type:id, + search:search, + ChooseShixunListshixun_list:result.data.shixun_list + }) + } + }).catch((error)=>{ + console.log(error); + }) + } + + shixunhomeworkedit=(list)=>{ + + let newpatheditarry=[]; + for(var i=0; i{ + + this.setState({ + stage_name:e.target.value + }) + + } + + updatastage_description=(e)=>{ + + this.setState({ + stage_description:e.target.value + }) + + } + + clickShixunchoose=()=>{ + + let{patheditarry,shixuns_listedit,shixuns_listeditlist}=this.state + let newshixuns_listedit=shixuns_listedit; + let list=shixuns_listeditlist + + if(patheditarry.length===0){ + this.setState({ + Modalstype:true, + Modalstopval:'请选择实训', + + }) + + return + } + + let url='/paths/append_to_stage.json' + axios.post(url,{ + shixun_id:patheditarry + }).then((response) => { + let newshixun_lists=response.data.shixun_lists; + + + for(var j=0; j { + console.log(error) + }); + + } + + //保存 + clickShixunsave=()=>{ + let{stage_name,stage_description,stageid,shixuns_listeditlist}=this.state; + let newstage_descriptions=stage_description; + + if(stage_name===""||stage_name===undefined){ + + this.setState({ + stage_nametype:true + }) + + return + } + if(newstage_descriptions!=undefined){ + + if(newstage_descriptions.length>300){ + + this.setState({ + descriptiontype:true + }) + + return + } + }else{ + newstage_descriptions="" + } + + + + let url='/stages/'+stageid+'.json' + axios.put(url, { + name:stage_name, + description:newstage_descriptions, + shixun_id:shixuns_listeditlist + }).then((response) => { + // window.location.href = "/paths/" + response.data.subject_id + this.setState({ + stage_name:undefined, + stage_description:undefined, + shixuns_listeditlist:[], + shixuns_listedit:undefined, + stage_nametype:false, + descriptiontype:false + }) + this.props.updatapathCardsedits() + }).catch((error) => { + console.log(error) + }); + } + + //删除实训 + shixunslisteditdelect=(e)=>{ + + this.setState({ + Modalstype:true, + Modalstopval:'是否删除该实训?', + Modalsbottomval:'', + delectfunvalue:e.target.id + }) + + } + + shixunslisteditdelectfun=()=>{ + let{delectfunvalue}=this.state; + let sum = parseInt(delectfunvalue); + let {shixuns_listedit,shixuns_listeditlist} =this.state; + let newshixuns_listedit=shixuns_listedit + let newshixuns_listeditlist=shixuns_listeditlist + newshixuns_listedit.splice(sum, 1); + newshixuns_listeditlist.splice(sum, 1); + this.setState({ + shixuns_listedit:newshixuns_listedit, + shixuns_listeditlist:newshixuns_listeditlist, + Modalstype:false, + Modalstopval:' ', + Modalsbottomval:'', + delectfunvalue:undefined + }) + } + + + cardsModalcancel=()=>{ + this.setState({ + Modalstype:false, + Modalstopval:'', + Modalsbottomval:'', + delectfunvalue:undefined + }) + } + cardsModalsave=()=>{ + this.setState({ + Modalstype:false, + Modalstopval:'', + Modalsbottomval:'' + }) + } + + + + onDragStart = () => { + /*...*/ + }; + onDragUpdate = () => { + /*...*/ + } + + + onDragEnd (result) { + + let {shixuns_listedit,shixuns_listeditlist} =this.state; + const listedit = reorder( + shixuns_listedit, + result.source.index, + result.destination.index + ); + const listeditlist = reorder( + shixuns_listeditlist, + result.source.index, + result.destination.index + ); + this.setState({ + shixuns_listedit:listedit, + shixuns_listeditlist:listeditlist + }) + } + + contentViewScrolledit=(e)=>{ + //滑动到底判断 + + if(e.currentTarget.scrollHeight-e.currentTarget.scrollTop===e.currentTarget.clientHeight){ + this.setState({ + hometypepvisible:true + }) + // console.log("到达底部"); + + let {page,type,search,ChooseShixunListshixun_list}=this.state; + + let newpage=page+1; + + let pathId=this.props.pathid; + + let newChooseShixunListshixun_list=ChooseShixunListshixun_list; + + let url='/paths/'+pathId+'/choose_subject_shixun.json?page='+newpage + + if(search!="" && search!=undefined){ + url+="&search="+search; + } + + if(type!=0){ + url+="&type="+type; + } + axios.get(url).then((result)=>{ + if(result.status===200){ + + let list =result.data.shixun_list; + + for(var i=0; i{ + console.log(error); + }) + + } + + } + + + render(){ + let {selectShixun, + editPanel, + ChooseShixunList, + type, + page, + search, + hometypepvisible, + shixuns_listedit, + patheditarry, + stage_name, + stage_description, + Modalstype, + Modalstopval, + Modalsbottomval, + delectfunvalue, + ChooseShixunListshixun_list, + stage_nametype, + descriptiontype + } = this.state + + return( +
    + this.cardsModalsave():()=>this.shixunslisteditdelectfun()} + > + + + { this.props.idsum===this.props.keys&&this.props.pathCardsedittype===true? + +
    + +
    +

    + {/**/} + {/**/} + {/**/} + + {/**/} +

    +
    + {/*

    章节名称

    */} +
    + * +
    + +
    名称不能为空
    +
    +
    必填项
    +
    +

    描述

    +
    + +
    描述不能超多最大限制300个字符
    +
    +

    + + 选择实训 + + 选择下面实训后,可以通过拖拽进行排序调整 +

    + + {selectShixun===true?:""} + + + + +
    + +
    + + + {ChooseShixunList && ChooseShixunList.shixuns_count} + 个实训 + +
    + this.changeTag(`${type}`,`${search}`)} + style={{width: '115%'}} + > +
    +
    +
      +
    • 实训名称
    • +
    • 使用院校
    • +
    • 使用人数
    • +
    • 评价等级
    • +
    • +
    + + +
    + + { + ChooseShixunListshixun_list && ChooseShixunListshixun_list.map((item,key)=>{ + return( +
    +
  • + + + +
  • +
  • {item.school_users}
  • +
  • {item.myshixuns_count}
  • +
  • {item.preference}
  • +
  • 详情
  • +
    + ) + }) + } +
    +
    +
    + 取消 + 确定 +
    +
    +
    +
    +
    + + {/* 可拖拽选择实训列表*/} + {shixuns_listedit===undefined?'': + + + + {(provided, snapshot) => ( +
    + {shixuns_listedit.map((item,key)=>{ + return( + + {(provided, snapshot) => ( +
    + +
  • + + + + + + + + + + {this.props.idsum+1}-{key+1}  {item.shixun_name} + + + + + +
  • + +
  • + + + +
  • + {provided.placeholder} +
    + )} +
    + )})} +
    + )} +
    +
    + } + + {/*
    */} + {/*
    */} + {/*×*/} + {/*Shixun0*/} + {/*
    */} + {/*

    frerere

    */} + {/*
    */} + {/*
    */} + {/*
    */} + + + {/*

    */} + {/*取消*/} + {/*保存*/} + {/*

    */} + +

    +

    + 取消 + 保存 +
    +

    + + +
    +
    + :''} +
    + ) + } +} +export default DetailCardsEditAndEdit; + + + + + +// { +// shixuns_listedit===undefined?'':shixuns_listedit.map((item,key)=>{ +// return( +//
    +// +//
  • +// +// +// +// +// +// +// +// +// +// {this.props.idsum+1}-{key+1}  {item.shixun_name} +// +// +// +// +// +//
  • +// +//
  • +// +// +// +//
  • +// +//
    +// ) +// }) // } \ No newline at end of file diff --git a/public/react/src/modules/tpm/TPMIndexHOC.js b/public/react/src/modules/tpm/TPMIndexHOC.js index 77d2e13bb..7845a1526 100644 --- a/public/react/src/modules/tpm/TPMIndexHOC.js +++ b/public/react/src/modules/tpm/TPMIndexHOC.js @@ -183,10 +183,12 @@ export function TPMIndexHOC(WrappedComponent) { // return false return this.state.coursedata&&this.state.coursedata.course_identity === 0 } + // 管理员等 isAdminOrCreator = () => { // return this.state.coursedata&&this.state.coursedata.course_identity >= 0 && return this.state.coursedata&&this.state.coursedata.course_identity < 3 } + // 助教等 isAdminOrTeacher = () => { // return this.state.coursedata&&this.state.coursedata.course_identity >= 0 && return this.state.coursedata&&this.state.coursedata.course_identity < 4 diff --git a/public/stylesheets/educoder/edu-all.css b/public/stylesheets/educoder/edu-all.css index 7b649f704..db85e9337 100644 --- a/public/stylesheets/educoder/edu-all.css +++ b/public/stylesheets/educoder/edu-all.css @@ -296,7 +296,7 @@ label.infolabel{display: block;float: left;width: 56px;text-align: right;margin- .subshaicontent a{float: left;margin-right: 20px;color: #999;cursor: pointer} -.search-new{width: 248px;height:32px;position: relative} +.search-new{width: 248px;height:32px;position: relative;margin-right: 35px;} .search-span{display: block;position: absolute;width: 100%;height: 100%;left:0px;top:0px;background-color: #F4F4F4;border: 1px solid #EAEAEA; border-radius: 4px;z-index: 1} .search-new-input{height: 32px;padding-left: 5px;width: 225px;border: none;box-sizing: border-box;background: none;outline: none;position: absolute;left:0px;top:1px;z-index: 2} .search-new img,.search-new a,.search-new .searchicon{cursor: pointer;position: absolute;right:2px;top:2px;z-index: 2}