diff --git a/public/react/src/modules/ecs/subroute/ecCompletion_calculation/EcCompletionCalculation.js b/public/react/src/modules/ecs/subroute/ecCompletion_calculation/EcCompletionCalculation.js index 14e104e05..7723278a3 100644 --- a/public/react/src/modules/ecs/subroute/ecCompletion_calculation/EcCompletionCalculation.js +++ b/public/react/src/modules/ecs/subroute/ecCompletion_calculation/EcCompletionCalculation.js @@ -497,8 +497,7 @@ class EcCompletionCalculation extends Component {

{ Spintype===true?}/>:"" } - - + { target_list.length===0&&Spintype===false?
  • -- diff --git a/public/react/src/modules/ecs/subroute/ecCourseSupports/EcCourseSupports.js b/public/react/src/modules/ecs/subroute/ecCourseSupports/EcCourseSupports.js deleted file mode 100644 index 0523e0e24..000000000 --- a/public/react/src/modules/ecs/subroute/ecCourseSupports/EcCourseSupports.js +++ /dev/null @@ -1,656 +0,0 @@ -import React, { Component } from 'react'; - -import { BrowserRouter as Router, Route, Link, Switch } from "react-router-dom"; - -import classNames from 'classnames' - -import axios from 'axios'; - -import { TPMIndexHOC } from '../../../tpm/TPMIndexHOC'; - -import { SnackbarHOC } from 'educoder' - -import { Select,message,Modal,Input,Spin,Icon,Tooltip } from 'antd'; - -import EcTitleCourseEvaluations from '../../ecTitle/ecTitle' - -import 'antd/dist/antd.css'; - -import '../../css/ecCourseSupports.css'; - -const $ = window.$; -class EcCourseSupports extends Component { - constructor(props) { - super(props) - this.state={ - data:'', - ec_courses_list:[], - editcourse:[{"weigths": 0, - "ec_course_name":'', - "top_relation": false, - "ec_course_id":'' - }], - editnum:0, - index:0, - ec_graduation_subitem_id:0, - ec_year_id:0, - schooldata:{}, - spinning:true, - ecComponentState:'EcCourseSupports', - supportid:null, - Editkey:null, - titlemessage:"提示", - Supportstype:false, - Supportslist:'', - Supportssum:false, - Supportsclass:false - } - } - - componentWillMount(){ - this.setState({ - ec_year_id:this.props.match.params.ec_year_id, - major_school_id:this.props.match.params.major_school_id - }) - window.document.title = '课程体系 vs 毕业要求'; - } - - UpdateClassData=()=>{ - let ec_year_id=this.props.match.params.ec_year_id; - - this.setState({ - ec_year_id:ec_year_id - }) - const jol =`/ec_major_schools/get_navigation_data?ec_year_id=`+ec_year_id; - axios.get(jol, { - withCredentials: true, - }) - .then((response) => { - if(response.status===200){ - // if(response.data.allow_visit===false){ - // window.location.href="/403" - // } - this.setState({ - schooldata:response.data - }) - } - }) - .catch(function (error) { - console.log(error); - }); - - - const url = `/ec_course_supports?ec_year_id=`+ec_year_id; - axios.get(url, { - withCredentials: true, - }) - .then((response) => { - if(response.status===200){ - this.setState({ - data:response.data - }) - } - if(response.data.course_support_data.length===0){ - this.setState({ - Supportstype:true, - Supportslist:'数据为空,请去毕业要求——>毕业要求指标点分解列表配置数据' - }) - } - }) - .catch(function (error) { - console.log(error); - }); - - // this.setState({ - // data:{course_count: 14, - // course_support_data: [ - // {course_data: [{ - // name: "军事课堂", - // top_relation: true, - // weigths: 0.1 - // }, { - // name: "大学生心理健康教育", - // top_relation: true, - // weigths: 0.2 - // }], - // ec_graduation_subitem_id: 2, - // num_total: 2, - // sequence_num: "1-1", - // weights_total: 0.30000000000000004, - // }, - // ], - // course_url: "/ec_major_schools/1/academic_years/1/ec_course_setting", - // ec_year_id: 1, - // max_support_count: 12, - // subitems_count: 7, - // subitems_url: "/ec_major_schools/1/academic_years/1/graduation_requirement" - // } - // }) - - } - componentDidMount(){ - this.setState({ - ec_year_id:this.props.match.params.ec_year_id, - major_school_id:this.props.match.params.major_school_id - }) - this.UpdateClassData(); - - } - EditSupportCourse=(key,e)=>{ - $('#school_major_list').scrollLeft(0); - let id=e.target.id; - id=parseInt(id); - - let subindex =e.target.getAttribute("subindex"); - const url = `/ec_course_supports/edit_require_vs_course?subitem_id=`+id - axios.get(url, { - withCredentials: true, - }) - .then((response) => { - - if(response.status===200){ - var support_data; - if(response.data.edit_support_data.length>0){ - support_data=response.data.edit_support_data; - }else if(response.data.edit_support_data.length===0){ - support_data=[{weights: 0,top_relation: false,ec_course_name:'',ec_course_id:''}]; - } - - this.setState({ - ec_courses_list:response.data.ec_courses_list, - editcourse:support_data, - index:subindex, - ec_graduation_subitem_id:id, - Supportssum:false, - Supportsclass:false, - }) - - let {editcourse} =this.state; - let neweditcourse=editcourse; - let newnum=0; - for(var j=0;j{ - let {editcourse} =this.state; - let neweditcourse=editcourse; - let newadd = {weigths: 0,top_relation: false,ec_course_name:'',ec_course_id:''}; - neweditcourse.push(newadd); - this.setState({ - editcourse:neweditcourse - }) - } - editcourse=(neweditcourse)=>{ - this.setState({ - editcourse:neweditcourse - }) - - } - - Deletcourse=(e)=>{ - // 删除 - // let id =e.target.getAttribute("index"); - let {editcourse} = this.state; - let neweditcourse=editcourse; - neweditcourse.splice(e,1); - let newnum=0; - for(var j=0;j{ - let {editcourse} = this.state; - let neweditcourse=editcourse; - var id=e.target.id; - var value=parseFloat(e.target.value); - if(isNaN(value)){ - value="" - } - var x = String(value).indexOf('.') + 1; - var y = String(value).length - x; - if(y > 2){ - this.setState({ - // Supportstype:true, - Supportslist:'请精确到2位数', - Supportssum:true - }) - return - } - - - const person = new Object (); - person.weigths=value; - person.ec_course_id= neweditcourse[id].ec_course_id; - person.ec_course_name=neweditcourse[id].ec_course_name; - person.top_relation=neweditcourse[id].top_relation; - - - neweditcourse[id]=person; - - let newnum=0; - for(var j=0;j1){ - this.setState({ - // Supportstype:true, - Supportslist:'权重之和不能大于1', - Supportssum:true - }) - } - - } - handleChange=(e)=> { - - let {editcourse} = this.state; - let value=`${e[0]}`; - value=parseInt(value) - let neweditcourse=editcourse; - let num=`${e[1]}`; - num=parseInt(num) - - for(var z=0;z{ - - let {editcourse} = this.state; - let neweditcourse=editcourse; - let id =e.target.getAttribute("itindex"); - for(var i=0;i<1;i++){ - neweditcourse[id].top_relation=false; - } - - this.editcourse(neweditcourse); - } - - relevancebottom=(e)=>{ - - let {editcourse} = this.state; - let neweditcourse=editcourse; - let id =e.target.getAttribute("itindex"); - for(var i=0;i<1;i++){ - neweditcourse[id].top_relation=true; - } - - this.editcourse(neweditcourse); - } - focus() { - this.inputNumberRef.focus(); - } - - blur() { - this.inputNumberRef.blur(); - } - CancelSupports=()=>{ - this.setState({ - Editkey:null, - Supportssum:false, - Supportsclass:false, - }) - } - SubmitClassData=()=>{ - let {editcourse,editnum,ec_graduation_subitem_id,ec_year_id} = this.state; - if(editcourse.length===0){ - this.setState({ - // Supportstype:true, - Supportslist:'保存失败,至少保留一个课程', - Supportssum:true - }) - return - } - if(editnum>1||editnum===0){ - this.setState({ - // Supportstype:true, - Supportslist:'保存失败,权重大于1或为空', - Supportssum:true - }) - return - } - for(var p=0; p { - - if(response.data.status===0){ - this.setState({ - Editkey:null, - Supportslist:response.data.messsage, - Supportstype:true, - Supportssum:false, - Supportsclass:false, - }) - this.UpdateClassData(); - }else if(response.data.status===-1){ - this.setState({ - Supportslist:"参数错误", - Supportstype:true, - Supportssum:false, - Supportsclass:false, - }) - } - }).catch((error) => { - console.log(error) - }) - } - Deletcourses=(key)=>{ - this.setState({ - supportid:key, - Supportslist:"您确定要删除吗?", - Supportstype:true - }) - } - hideSupports=()=>{ - this.setState({ - Supportstype:false, - supportid:null, - Supportslist:"", - }) - } - render() { - const Option = Select.Option; - let {data,ec_courses_list,editcourse,editnum,index,ec_year_id,schooldata,ecComponentState,hidesupport,supportid,Editkey,titlemessage,Supportstype,Supportslist,Supportssum,Supportsclass,major_school_id} = this.state; - var list = (length) => { - var res = []; - for(var i = 0; i < length; i++) { - res.push( -
    支撑课程 -
    (权值) -
    -
    ) - } - return res - } - - return ( -
    - -
    -
    {Supportslist}
    -
    - -
    - - -
    - - - -
    - -
    - 课程体系对毕业要求的支撑 - {/* 导出培养目标 */} - - 导出课程体系支撑矩阵 - -
    用矩阵图的形式说明本专业课程体系对毕业要求的支撑关系 window.elasticLayer(3534)} >查看详情
    - -
    -
    - 毕业要求指标点({data.subitems_count} - 课程体系({data.course_count} -
    - -
    - -
    - -

    1200? 140*data.max_support_count : 1200+"px"}}> - 毕业要求指标点 - {list(data.max_support_count<5||data.max_support_count===undefined?5:data.max_support_count)} - 合计 -

    -
    - { - data.course_support_data===undefined? }/>:data.course_support_data.map((item,key)=>{ - - return ( -
  • 1134 ? 136*data.max_support_count : 1134+"px",margin: '0px 0px'}}> - - {item.sequence_num} - - - - { - item.course_data.map((t,kes)=>{ - return( - -
    {t.name.length>12?t.name.substring(0, 10)+"...":t.name}
    -
    ({t.weigths})
    -
    - ) - - }) - } - - -
    -
    -
    {item.num_total===0?" ":item.num_total}
    -
    {Math.round(item.weights_total*100)/100===0?" ":(Math.round(item.weights_total*100)/100)}
    -
    -
    - {data.is_manager===false?"": - - } -
    -
    - -
    - -

    - -

    - 指标点 {index} - 支撑课程 - - 权重(∑=1) - (精确到两位小数) - - 关联度最高 -

    - -
    - - { - editcourse.map((it,key)=>{ - - return( -
    - - - - -
    - -
    - - - - -
    - - - -
    - -
    - ) - }) - } - -
    - {Supportslist} -
    - 合计: {editcourse.length} - 合计: {editnum} -
    - -
    -
    保存
    -
    取消
    -
    - -

    - - -
  • - ) - }) - } - - - - - - ); - } -} - -export default SnackbarHOC() ( TPMIndexHOC ( ecCourseSupports ) ); - diff --git a/public/react/src/modules/ecs/subroute/ecStudentList/EcStudentList.js b/public/react/src/modules/ecs/subroute/ecStudentList/EcStudentList.js new file mode 100644 index 000000000..37dcb0b31 --- /dev/null +++ b/public/react/src/modules/ecs/subroute/ecStudentList/EcStudentList.js @@ -0,0 +1,430 @@ +import React, { Component } from 'react'; + +import axios from 'axios'; +import { Spin } from 'antd'; + +import { TPMIndexHOC } from '../../../tpm/TPMIndexHOC'; + +import { SnackbarHOC } from 'educoder' + +import { Pagination,Upload,Modal,Checkbox } from 'antd'; + +import EcTitleCourseEvaluations from '../../ecTitle/ecTitle' + +import 'antd/dist/antd.css'; + +import './ecStudentList.css'; + +const $ = window.$; + +class EcStudentList extends Component { + constructor(props) { + super(props) + this.state={ + schooldata:{}, + majorschoollist:undefined, + titlemessage:"提示", + ecComponentState:"ecStudentList", + visible:false, + Modallist:'', + Modallisttypes:0, + studentall:false, + student_id:undefined, + Modallisttypess:0, + ismanager:false, + isSpin:false + } + } + componentDidMount(){ + window.document.title = '学生列表'; + let major_id=this.props.match.params.major_id; + let year_id=this.props.match.params.year_id; + + const jol =`/ec_major_schools/get_navigation_data?ec_year_id=`+year_id; + axios.get(jol, { + withCredentials: true, + }).then((response) => { + + if(response.status===200){ + // if(response.data.allow_visit===false){ + // window.location.href="/403" + // } + this.setState({ + schooldata:response.data + }) + } + }) + .catch(function (error) { + console.log(error); + }); + + const url ='/ec_major_schools/'+major_id+'/academic_years/'+year_id+'/student_lists_data'; + axios.get(url, { + withCredentials: true, + }).then((response) => { + if(response.status===200){ + this.setState({ + majorschoollist:response.data, + ismanager:response.data.ismanager, + }) + } + }) + .catch(function (error) { + console.log(error); + }); + // let majorschoollist={ + // ec_students: [{index: 1, student_name: "同意", student_id: "s20111458"}, + // {index: 1, student_name: "同意", student_id: "s20111458"}, + // {index: 2, student_name: "涛哥", student_id: "2011554f4"}, + // {index: 3, student_name: "例如", student_id: "20154787b"}, + // {index: 4, student_name: "问问", student_id: "201548580014"}, + // {index: 5, student_name: "嗯嗯", student_id: "2015748912321234"}, + // {index: 6, student_name: "让人", student_id: "20157456"}, + // {index: 7, student_name: "方法", student_id: "20159658"}, + // {index: 8, student_name: "全球", student_id: "20159632"}, + // {index: 9, student_name: "是说", student_id: "20154512"}, + // {index: 10, student_name: "谷歌", student_id: "20157932"}, + // {index: 11, student_name: "版本", student_id: "20159635"}, + // {index: 12, student_name: "捏捏", student_id: "20153451"}, + // ], + // import_url: "/ec_major_schools/3/academic_years/10/import_students", + // show_name: true, + // template_url: "/attachments/download/227528/01_学生列表导入模板.xls", + // total_page: 1 + // } + // this.setState({ + // majorschoollist:majorschoollist + // }) + } + uploadcomponentDidMount(){ + let major_id=this.props.match.params.major_id; + let year_id=this.props.match.params.year_id; + const url ='/ec_major_schools/'+major_id+'/academic_years/'+year_id+'/student_lists_data'; + axios.get(url, { + withCredentials: true, + }).then((response) => { + if(response.status===200){ + this.setState({ + majorschoollist:response.data, + ismanager:response.data.ismanager, + }) + } + }) + .catch(function (error) { + console.log(error); + }); + } + + + windowsgoblack=()=>{ + window.history.go(-1) + } + + + uploadfile=(file)=>{ + this.setState({isSpin:true}) + let {majorschoollist}=this.state; + let Url =majorschoollist.import_url; + const form = new FormData(); + form.append('file', file.file); + axios.post(Url,form + ).then((response) => { + if(response.data.status===1){ + // message.success('已成功导入'+response.data.count+"条数据!"); + this.setState({ + // titlemessage: response.data.message+"(支撑关系变更)", + Modallist: '已成功导入'+response.data.count+"条数据!", + Modallisttype:true, + Modallisttypes:1, + isSpin:false + }) + }else if(response.data.status===0){ + // message.warning(response.data.message); + this.setState({ + // titlemessage: response.data.message+"(支撑关系变更)", + Modallist:response.data.message, + Modallisttype:true, + Modallisttypes:0, + isSpin:false + }) + } + }).catch((error) => { + console.log(error) + }) + } + hidemodeldelete=()=>{ + let {Modallisttypes}=this.state; + this.setState({ + Modallisttype:false, + Modallist:'', + Modallisttypess:0 + }) + if(Modallisttypes===1){ + // window.location.reload(); + this.uploadcomponentDidMount(); + } + } + + showecStudentList=(page)=>{ + let major_id=this.props.match.params.major_id; + let year_id=this.props.match.params.year_id; + const url ='/ec_major_schools/'+major_id+'/academic_years/'+year_id+'/student_lists_data?page='+page; + axios.get(url, { + withCredentials: true, + }).then((response) => { + if(response.status===200){ + this.setState({ + majorschoollist:response.data, + ismanager:response.data.ismanager, + }) + } + }).catch(function (error) { + console.log(error); + }); + } + + onChangestudentall=(e)=>{ + let {majorschoollist}=this.state; + let mewmajorschoollist=majorschoollist + for(var i=0; i{ + let {majorschoollist,studentall}=this.state; + let mewmajorschoollist=majorschoollist; + let newstudentall=studentall; + if(e.target.checked===false){ + newstudentall=false + } + for(var i=0; i{ + let {majorschoollist,studentall} =this.state; + let studentalltype=0 + for(var i=0; i{ + let {majorschoollist,studentall} =this.state; + let major_id=this.props.match.params.major_id; + let year_id=this.props.match.params.year_id; + let newstudent_id=[]; + if(studentall===false){ + for(var i=0; i { + if(response.data.status===1){ + this.setState({ + // Modallist: "删除成功!", + // Modallisttype:true, + Modallisttypes:1, + Modallisttypess:0 + }) + this.hidemodeldelete(); + } + }).catch((error) => { + console.log(error) + }) + } + + render() { + let {schooldata, + majorschoollist, + Modallisttype, + titlemessage, + Modallist, + studentall, + student_id, + Modallisttypess, + ismanager + }=this.state; + // ec_students: [] + // import_url: "/ec_major_schools/:1/academic_years/:1/import_students" + // template_url: "javascript:void(0);" + // total_page: 0 + const uploadProps = { + name: 'file', + + onPreview(file) { + // dispatch({ type: `${nameSpace}/updateState`, payload: { uploadPreviewVisible: true, uploadPreviewImage: file.url || file.thumbUrl } }); + }, + onChange(file) { + // dispatch({ type: `${nameSpace}/updateState`, payload: { fileList: fileList } }); + }, + onRemove(option) { + }, + customRequest: file => { + this.uploadfile(file) + } + } + return ( +
    + +
    +
    {Modallist}
    +
    +
    + 取消 + { + Modallisttypess===0?确定:确定 + } + +
    +
    +
    + + +
    + 学生列表 + 返回 +
    + +
    + +
    学生列表( + {majorschoollist===undefined?"":majorschoollist.total_student} + ) +
    提供模板支持导入学生信息(请先下载模板) window.elasticLayer(3533)}>查看详情
    +
    + +
    + {ismanager===false?"": + 请使用导入模板(点击下载),将本学年所有参与的学生导入系统,以便录入教学活动相关数据 + } + + {ismanager===false?"": + 导入 + } + +
    + +
    + {ismanager===false?"":
    + 删除 +
    } +
    + +
    +

    + + + 序号 + + 姓名 + 学号 +

    + + +
      + { + majorschoollist===undefined? +
      +

      +

      学生数据为空,请导入数据

      +
      + :majorschoollist.ec_students.length===0? +
      +

      +

      学生数据为空,请导入数据

      +
      :majorschoollist.ec_students.map((item,key)=>{ + // console.log(item) + return( +
    • + + + {item.index} + + {item.student_name} + {item.student_id} +
    • + ) + }) + } + +
    + +
    + { + majorschoollist===undefined?"":majorschoollist.total_page===0||majorschoollist.total_student<51?"": + } +
    +
    +
    +
    +
    + +
    + + ) + + } +} + +export default SnackbarHOC() ( TPMIndexHOC ( EcStudentList ) ); \ No newline at end of file diff --git a/public/react/src/modules/ecs/subroute/ecStudentList/ecStudentList.css b/public/react/src/modules/ecs/subroute/ecStudentList/ecStudentList.css new file mode 100644 index 000000000..0dfc22b99 --- /dev/null +++ b/public/react/src/modules/ecs/subroute/ecStudentList/ecStudentList.css @@ -0,0 +1,44 @@ +.pagelistStudentList{ + position: absolute; + padding-left: 40%; +} + +.relative{ + position: relative; +} +.changestudent{ + position: absolute; + top: 13px; + left: 50px; +} +.changestudents{ + position: absolute; + top: -1px; + left: 50px; +} +.padbottom{ + padding-bottom: 0px; +} + +.deletelist{ + margin-top: 10px; + margin-bottom: 10px; +} + +.deletelist:hover{ + color:#afafaf !important; +} + +.deletebth{ + width:64px; + height:24px; + border:1px solid #afafaf; + border-radius:2px; + color:#afafaf; + background:#fff; + line-height:24px; +} + +.mt60{ + margin-top:60px; +} \ No newline at end of file diff --git a/public/react/src/modules/ecs/subroute/ecStudentList/nodata.png b/public/react/src/modules/ecs/subroute/ecStudentList/nodata.png new file mode 100644 index 000000000..15a9e522f Binary files /dev/null and b/public/react/src/modules/ecs/subroute/ecStudentList/nodata.png differ