工程认证开发

dev_cs
杨树林 5 years ago
parent 06ffbb390a
commit c41458686d

@ -32,7 +32,7 @@ module.exports = {
// See the discussion in https://github.com/facebookincubator/create-react-app/issues/343.s
// devtool: "cheap-module-eval-source-map",
// 开启调试
devtool: "eval", // 开启调试
// devtool: "eval", // 开启调试
// These are the "entry points" to our application.
// This means they will be the "root" imports that are included in JS bundle.
// The first two entry points enable "hot" CSS and auto-refreshes for JS.

@ -5,7 +5,7 @@
"dependencies": {
"@icedesign/base": "^0.2.5",
"@novnc/novnc": "^1.1.0",
"antd": "^3.20.1",
"antd": "^3.23.2",
"array-flatten": "^2.1.2",
"autoprefixer": "7.1.6",
"axios": "^0.18.0",

@ -46,7 +46,7 @@ export function initAxiosInterceptors(props) {
// wy
proxy="https://pre-newweb.educoder.net";
proxy="https://test-newweb.educoder.net";
proxy="http://192.168.2.63:3001/";
proxy="http://192.168.2.63:3001";
// wy
// proxy="http://192.168.2.63:3001"

@ -6,7 +6,7 @@ import axios from 'axios';
import './index.scss';
import CustomLoadable from "../../../CustomLoadable";
import Curriculum from "../../../modules/ecs/curriculum/Curriculum"
const { Step } = Steps;
const TrainingObjective = CustomLoadable(() => import('./TrainingObjective/index'))
@ -98,6 +98,12 @@ class EcSetting extends React.Component {
<Switch>
<Route extra path='/ecs/major_schools/:majorId/years/:yearId/training_objectives'
render={ (props) => (<TrainingObjective {...this.props} {...props} {...this.state} />) }></Route>
{/*课程体系*/}
<Route extra path='/ecs/major_schools/:majorId/years/:yearId/courses'
render={ (props) => (<Curriculum {...this.props} {...props} {...this.state} />) }></Route>
{/*课程体系VS毕业要求*/}
<Route extra path='/ecs/major_schools/:majorId/years/:yearId/requirement_vs_courses'
render={ (props) => (<TrainingObjective {...this.props} {...props} {...this.state} />) }></Route>
</Switch>
)
}

@ -227,6 +227,17 @@ input{
right: 18px;
top: 26px;
}
.Importclassroomdatas{
position: absolute;
right: 375px!important;
top: 122px !important;
}
.Importclassroomdatass {
position: absolute;
right: 375px !important;
top: 248px !important;
}
#SystemParameters{
position: relative;
}

@ -25,6 +25,12 @@ color:rgba(5,16,26,1);
line-height:45px;
color:rgba(50,50,50,1);
}
.SystemParametersysls{
font-size:14px;
font-family:MicrosoftYaHei;
font-weight:400;
color:rgba(50,50,50,1);
}
.Systemnum{
font-size:14px;
font-family:MicrosoftYaHei;
@ -247,18 +253,28 @@ input{
.graduateRequirement .clearfix .column-1 {
width: 76px!important;
}
.newrightcalculatebutton{
width: 50px;
height: 25px;
border: 1px solid rgba(76,172,255,1);
border-radius: 1px;
line-height: 25px;
text-align: center;
margin-top: 7px;
cursor: pointer;
color: rgba(76,172,255,1);
}
height: 25px;
border: 1px solid rgba(76,172,255,1);
border-radius: 1px;
line-height: 25px;
text-align: center;
margin-top: 7px;
cursor: pointer;
color: rgba(76,172,255,1);
}
.newrightcalculatebuttons{
width: 50px;
height: 25px;
border: 1px solid rgba(76,172,255,1);
border-radius: 1px;
line-height: 25px;
text-align: center;
margin-top:9px;
cursor: pointer;
color: rgba(76,172,255,1);
}
.columnbox{
height: 53px;
overflow: hidden;

@ -0,0 +1,245 @@
import React, { Component } from 'react';
import classNames from 'classnames'
import axios from 'axios';
import { TPMIndexHOC } from '../../tpm/TPMIndexHOC';
import { SnackbarHOC } from 'educoder'
import { message,Modal,Spin,Icon} from 'antd';
import 'antd/dist/antd.css';
import EcTitleCourseEvaluations from '../ecTitle/ecTitle'
import '../css/ecCourseSupports.css';
import '../css/ecCourseEvaluations.css';
import {
BrowserRouter as Router,
Route,
Switch
} from 'react-router-dom';
import Loadable from 'react-loadable';
import Loading from "../../../Loading";
const Curriculumtwo = Loadable({
loader: () => import('./Curriculumtwo'),
loading: Loading,
})
const $ = window.$;
class Curriculum extends Component {
//课程体系
constructor(props) {
super(props)
this.state= {
classcalue:5,
newec_course_idbottom:"",
course_name:undefined,
course_url:"a",
ecmanager:true,
titine:1,
}
}
componentWillMount(){
// window.document.title = '课程达成评价结果';
}
componentDidMount(){
console.log(this.props);
}
sync_course_data=()=>{
// this.setState({listSpin:true})
// let ec_course_id=this.props.match.params.ec_course_id;
// let Url ='/ec_course_achievement_methods/sync_course_data';
// axios.post(Url, {
// ec_course_id:ec_course_id
// },
// {
// withCredentials: true
// }
// ).then((response) => {
// if(response.data.status===0){
// this.setState({
// // titlemessage: response.data.message+"(支撑关系变更)",
// Modallist: response.data.message,
// Modallisttype:true,
// listSpin:false
// })
// this.UpdateEvaluations();
// }else if(response.data.status===-1){
// this.setState({
// // titlemessage: response.data.message+"(支撑关系变更)",
// Modallist: response.data.message,
// Modallisttype:true,
// listSpin:false
// })
//
// }
// }).catch((error) => {
// console.log(error)
// })
}
onAclick=(i)=>{
console.log("onAclick");
console.log(i);
if(i===1){
this.props.history.push(this.props.match.url+"/ec_course_support_setting/1");
}else if(i===2){
this.props.history.push(this.props.match.url+"/ec_course_reach_setting/2");
}else if(i===3){
this.props.history.push(this.props.match.url+"/score_level/3");
}else if(i===4){
this.props.history.push(this.props.match.url+"/evaluation_methods/4");
}else{
this.props.history.push(this.props.match.url+"/competition_calculation_info/5");
}
this.setState({
titine:i,
})
};
Ontitine=(s)=>{
if(s==="ec_course_support_setting"){
this.setState({
titine:1,
})
}else if(s==="ec_course_reach_setting"){
this.setState({
titine:2,
})
}else if(s==="score_level"){
this.setState({
titine:3,
})
}else if(s==="evaluation_methods"){
this.setState({
titine:4,
})
}else if(s==="competition_calculation_info"){
this.setState({
titine:5,
})
}
};
associatedclass=()=>{
};
deleteassociatedclass=()=>{
}
render() {
let {newec_course_idbottom,titine,classcalue,course_name,course_url,ecmanager,Spintype,calculatesetype,ec_course_id,course_total_scoreaverage,ec_course_targets_count,schooldata,ecComponentState,course_total_score,total_rate_data,ec_course_targets,graduation_list,target_list,target_score,evaluate_result,morelisttype,titlemessage,completiontype,completionlist,ismanager} = this.state;
// console.log("Curriculum");
// console.log(this.props);
console.log(titine);
return (
<div className="educontent">
<div className="newMain clearfix">
<div className="edu-back-white eacourse">
<div className="clearfix padding20-30 bor-bottom-greyE">
<a href={schooldata&&schooldata.course_setting_url} className="color-grey-9 TrainingLecturer">课程体系</a> >
<a className="TrainingTheory major_name"> {schooldata&&schooldata.ec_course_name} 达成评价详情</a>
{/* <a href="javascript:void(0)" className="fr white-btn edu-blueback-btn mt4">导出培养目标</a> */}
<div className="color-grey-9 mr10">系统根据课程目标课程考核方式与课程目标评价方法一键计算评价课程目标的达成情况 <a className={"color-blue"} onClick={() => window.elasticLayer(3533)}>查看详情</a></div>
{
titine === 4 ?
<span className="Importclassroomdatas" style={{top: '22px'}}>
<a className="white-btn edu-blueback-btn fr mb10 mr10 mt7" target="_blank"
href={'/ec_courses/' + newec_course_idbottom + '/export_ec_course_targets?format=xls'}>导出评价方法</a>
</span>
:titine === 1 ?
<span className="Importclassroomdatas" style={{top: '22px'}}>
<a className="white-btn edu-blueback-btn fr mb10 mr10 mt7"
href={`/ec_courses/${this.props.match.params.ec_course_id}/export_ec_course_targets?format=xls`}
>导出课程目标</a>
</span>
:titine===2?
<div className={"Importclassroomdatas"}>
<span className="" >
<a className="white-btn edu-blueback-btn fr mr10 mt7" style={{top: '22px',display:ecmanager===false?"none":"block"}} target="_blank" href={'/ec_courses/'+ec_course_id+'/export_ec_course_targets?format=xls'}>导出考核方法</a>
</span>
<a className="white-btn edu-blueline-btn fr mr10 mt7 mr20"
onClick={this.associatedclass}
style={{display: course_url === "" && ecmanager === true ? "block" : "none"}}
>关联课堂</a>
<a className="white-btn edu-blueline-btn fr mr10 mt7 mr20"
onClick={this.deleteassociatedclass}
style={{display:course_url!=""&&ecmanager===true?"block":"none"}}
>取消关联</a>
</div>
:""
}
</div>
<div className="padding20-30"style={titine===2||titine===3?{height:"100px"}:{height:"80px"}}
>
<a className="fl SystemParameters" style={titine===1?{display:schooldata&&schooldata.ec_course_support_setting_url===null?"none":"block",color:'#4CACFF'}:{display:schooldata&&schooldata.ec_course_support_setting_url===null?"none":"block",color:'#4D4D4D'}}
onClick={()=>this.onAclick(1)}>1.课程目标</a>
<a className="fl SystemParameters ml40"
style={titine===2?{display:schooldata&&schooldata.ec_course_reach_setting_url===null?"none":"block",color:'#4CACFF'}:{display:schooldata&&schooldata.ec_course_reach_setting_url===null?"none":"block",color:'#4D4D4D'}}
onClick={()=>this.onAclick(2)}>2.课程考核方式与数据来源</a>
<a className="fl SystemParameters4CACFF ml40 "
style={titine===3?{color:'#4CACFF'}:{display:"block",color:'#4D4D4D'}}
onClick={()=>this.onAclick(3)}>3.成绩等级设置</a>
<a className="fl SystemParameters ml40"
style={titine===4?{display:schooldata&&schooldata.evaluation_methods_url===null?"none":"block",color:'#4CACFF'}:{display:schooldata&&schooldata.evaluation_methods_url===null?"none":"block",color:'#4D4D4D'}}
onClick={()=>this.onAclick(4)}
>4.课程目标评价方法</a>
<a className="fl SystemParameters ml40 "
style={titine===5?{display:schooldata&&schooldata.competition_calculation_info_url===null?"none":"block",color:'#4CACFF'}:{display:schooldata&&schooldata.competition_calculation_info_url===null?"none":"block",color:'#4D4D4D'}}
onClick={()=>this.onAclick(5)}
>5.课程达成评价结果</a>
{
titine===5?
<span>
<span className={ismanager===false?"none":""} style={{top: "26px"}}>
<a className="white-btn edu-blueback-btn fr mb10 mr10 mt9" target="_blank" href={"/ec_courses/"+ec_course_id+"/export_evaluation_result.xls"}>导出评价详情</a>
</span>
<span className={ismanager===false?"none":"right newrightcalculatebuttons fr mb10 mr10 "}
onClick={this.newrightcalculatebutton}>计算</span>
</span>
:titine===4?
<span className="fr ml20 SystemParameters" style={{color: '#989898'}}>各环节平均得分*占比之和/各环节总分*占比之和</span>
:titine===3?
<span className="fl SystemParametersysls" style={{display:course_name===null||course_name===undefined?"block":"none",
padding: '0px 0px 0px 0px',textAlign: 'left',width: '100%',color:'#989898'}}>将学生的成绩转换成对应的等级</span>
:titine===2?
<span>
<span className="fl" style={{display:course_name===null||course_name===undefined?"block":"none",padding: '0px 0px 0px 0px',textAlign: 'left',width: '100%',color: '#989898'}}>请在完成配置后使用各项成绩导入模板将本学年所有参与的学生成绩数据导入系统</span>
<span className="Importclassroomdatass" style={{display:course_url===""||ecmanager===false?"none":"block",}}><a onClick={this.sync_course_data} className="white-btn edu-orangeback-btn fr mt2 mr10" style={{width:'112px'}}>导入课堂数据</a></span>
</span>
:""
}
</div>
</div>
<Switch>
{/*Curriculumtwo 测试用*/}
{/*课程目标*/}
<Route extra path='/ecs/major_schools/:majorId/years/:yearId/courses/:type/1'
render={ (props) => (<Curriculumtwo {...this.props} {...props} {...this.state} Ontitine={(i)=>this.Ontitine(i)} />) }></Route>
{/*课程考核方式与数据来源*/}
<Route extra path='/ecs/major_schools/:majorId/years/:yearId/courses/:type/2'
render={ (props) => (<Curriculumtwo {...this.props} {...props} {...this.state} Ontitine={(i)=>this.Ontitine(i)}/>) }></Route>
{/*成绩等级设置*/}
<Route extra path='/ecs/major_schools/:majorId/years/:yearId/courses/:type/3'
render={ (props) => (<Curriculumtwo {...this.props} {...props} {...this.state} Ontitine={(i)=>this.Ontitine(i)}/>) }></Route>
{/*课程目标评价方法*/}
<Route extra path='/ecs/major_schools/:majorId/years/:yearId/courses/:type/4'
render={ (props) => (<Curriculumtwo {...this.props} {...props} {...this.state} Ontitine={(i)=>this.Ontitine(i)}/>) }></Route>
{/*课程达成评价结果*/}
<Route extra path='/ecs/major_schools/:majorId/years/:yearId/courses/:type/5'
render={ (props) => (<Curriculumtwo {...this.props} {...props} {...this.state} Ontitine={(i)=>this.Ontitine(i)}/>) }></Route>
</Switch>
</div>
</div>
)
}
}
export default Curriculum;

@ -0,0 +1,32 @@
import React, { Component } from 'react';
class Curriculumtwo extends Component {
//测试用
constructor(props) {
super(props)
// console.log(props);
}
componentWillMount(){
}
componentDidMount(){
// console.log(this.props);
console.log("Curriculumtwo");
console.log(this.props.match.params.type);
this.props.Ontitine(this.props.match.params.type);
}
render() {
// console.log("Curriculumtwo");
// console.log(this.props);
return (
<div className="educontent fl">
<span>测试</span>
</div>
)
}
}
export default Curriculumtwo;

@ -1,814 +0,0 @@
import React, { Component } from 'react';
import classNames from 'classnames'
import axios from 'axios';
import { TPMIndexHOC } from '../../tpm/TPMIndexHOC';
import { SnackbarHOC } from 'educoder'
import { message,Modal,Spin,Icon} from 'antd';
import 'antd/dist/antd.css';
import EcTitleCourseEvaluations from '../ecTitle/ecTitle'
import '../css/ecCourseSupports.css';
import '../css/ecCourseEvaluations.css';
const $ = window.$;
class EcCompletionCalculation extends Component {
constructor(props) {
super(props)
this.state={
schooldata:{},
ecComponentState:"ecCompletion",
course_total_score:[],
ec_course_targets:0,
graduation_list:[],
target_list:[],
target_score:[],
evaluate_result:"",
ec_course_targets_count:0,
new_target_ec_year_id:0,
total_rate_data:undefined,
calculatetype:false,
ec_course_id:0,
morelisttype:false,
titlemessage:"提示",
completiontype:false,
completionlist:"",
course_total_scoreaverage:0,
calculatesetype:false,
Spintype:false,
ismanager:false
}
}
componentWillMount(){
window.document.title = '课程达成评价结果';
}
componentDidMount(){
let ec_course_id =this.props.match.params.ec_course_id;
this.UpdateClassData(true);
const Url =`/ec_major_schools/get_navigation_data?ec_course_id=`+ec_course_id;
axios.get(Url, {
withCredentials: true,
})
.then((response) => {
if(response.status===200){
// if(response.data.allow_visit===false){
// window.location.href="/403"
// }
this.setState({
schooldata:response.data,
ec_course_id:ec_course_id
})
}
})
.catch(function (error) {
console.log(error);
});
}
targetsget_navigation_data=(ec_year_id,ec_course_id)=>{
const Url =`/ec_major_schools/get_navigation_data?ec_year_id=`+ec_year_id+"&ec_course_id="+ec_course_id;
axios.get(Url, {
withCredentials: true,
})
.then((response) => {
if(response.status===200){
// if(response.data.allow_visit===false){
// window.location.href="/403"
// }
this.setState({
schooldata:response.data,
ec_course_id:ec_course_id
})
}
})
.catch(function (error) {
console.log(error);
});
}
showmorelist=()=>{
this.setState({
morelisttype:false
})
this.UpdateClassData(false)
}
UpdateClassData=(key)=>{
let {calculatetype} =this.state;
let ec_course_id =this.props.match.params.ec_course_id;
this.setState({
ec_course_id:ec_course_id
})
const Arl =`/ec_courses/`+ec_course_id+`/calculation_info_data`;
axios.get(Arl, {
withCredentials: true,
})
.then((response) => {
if(response.status===200){
// var list=[];
// if(key===true){
// for(var i=0; i<response.data.course_total_score.length;i++){
// if(i<10){
// list.push(response.data.course_total_score[i])
// }
// }
// }else{
// list=response.data.course_total_score
// }
// let newgraduation_list= response.data.graduation_list.reverse();
let newmorelisttype=false;
if(response.data.course_total_score>10){
newmorelisttype=true
}
let course_total_scoreaverage;
let newlist=response.data.course_total_score[response.data.course_total_score.length-1].total_rate;
for(var i=0; i<newlist.length;i++){
if(i===newlist.length-1){
course_total_scoreaverage=newlist[i].total_score
}
}
this.setState({
evaluate_result:response.data.evaluate_result,
course_total_score:response.data.course_total_score[response.data.course_total_score.length-1].total_rate,
total_rate_data:response.data.course_total_score[response.data.course_total_score.length-1].total_rate.length,
graduation_list:response.data.graduation_list,
target_list:response.data.target_list,
target_score:response.data.target_score,
ec_course_targets_count:response.data.ec_course_targets_count,
morelisttype:newmorelisttype,
course_total_scoreaverage:course_total_scoreaverage,
ismanager:response.data.is_manager
})
// ec_course_targets:response.data.ec_course_targets,
this.targetsget_navigation_data(response.data.ec_year_id,ec_course_id)
if(calculatetype===true){
this.setState({
calculatetype:false,
completiontype:true,
completionlist:'刷新列表数据成功',
calculatesetype:true
})
}
}
})
.catch(function (error) {
console.log(error);
});
//
// let newcourse_total_score=[
// {
// student_scores:{
// name: "黎子豪",
// student_number: "13408100113",
// target_info: [
// {position: 1, score: 73.3},
// {position: 2, score: 71.8},
// {position: 3, score: 92.2},
// {position: 4, score: 82.1},
// {position: 5, score: 87.7}
// ],
// total_score: 81.4
// }
// },{
// total_rate:[
// {position: 1, score: 65.35, rate: 0.1},
// {position: 2, score: 68.81, rate: 0.1},
// {position: 3, score: 68.34, rate: 0.1},
// {position: 4, score: 78.09, rate: 0.35},
// {position: 5, score: 77, rate: 0.35},
// {total_score: 74.5},
// ]
// }
// ]
//
// var list=[];
// if(key===true){
// for(var i=0; i<newcourse_total_score.length;i++){
// if(i<10){
// list.push(newcourse_total_score[i])
// }
// }
// }else{
// list=newcourse_total_score
// }
// let graduation_list=[
// {
// ec_graduation_name: "5-1",
// ec_subitem_content: "能够针对计算机系统的设计、开发、部署、运行和维护等方面的复杂工程问题,开发、选择与使用恰当的技术、资源、现代工程工具和信息技术工具,进行科学合理的预测与模拟,并充分认识到问题的复杂性与解决手段的局限性。",
// reach_real_target: 0.078,
// reach_target: 0.07,
// result: "达成",
// target_position: [0, 0, 0, 1, 0],
// weight: 0.1
// }
// ]
// let newgraduation_list= graduation_list.reverse();
// this.setState({
// course_total_score:list,
// total_rate_data:newcourse_total_score[newcourse_total_score.length-1].total_rate.length,
// graduation_list:newgraduation_list,
// evaluate_result:false,
// target_list:[
// {
// content: "理解数据管理技术和数据库技术的发展,区分不同数据模型的作用和特点,描述数据库系统的类型、结构、数据独立性。",
// real_grade: 65.35,
// result: "达成",
// standard_grade: 65,
// weigths: 0.1
// }
// ],
// target_score:[
// {average_score: 65.35,
// ec_course_targets_count: 5,
// from50: [9, 20.45],
// from60: [13, 29.55],
// from70: [14, 31.82],
// from80: [3, 6.82],
// from90: [1, 2.27],
// from_down: [4, 0.09],
// graduation_list: [],
// low_score: 40,
// top_score: 93.4}
// ],
// ec_course_targets_count:5
//
// })
// if(calculatetype===true){
// message.success('刷新列表数据成功!');
// this.setState({
// calculatetype:false,
// completiontype:true,
// completionlist:'刷新列表数据成功!'
// })
// }
}
newrightcalculatebutton=()=>{
this.setState({
Spintype:true
})
let {ec_course_id}=this.state;
const Orl =`/ec_courses/`+ec_course_id+`/sync_data`;
axios.get(Orl, {
withCredentials:true,
})
.then((response) => {
if(response.data.status===1){
this.setState({
calculatetype:true,
completiontype:true,
completionlist:'计算成功',
calculatesetype:true,
Spintype:false
})
this.UpdateClassData(true);
}
})
.catch(function (error) {
console.log(error)
});
}
hidecompletion=()=>{
this.setState({
completiontype:false,
completionlist:"",
calculatesetype:false
})
}
render() {
let {Spintype,calculatesetype,ec_course_id,course_total_scoreaverage,ec_course_targets_count,schooldata,ecComponentState,course_total_score,total_rate_data,ec_course_targets,graduation_list,target_list,target_score,evaluate_result,morelisttype,titlemessage,completiontype,completionlist,ismanager} = this.state;
let TargetresList = (length) => {
let target_listres = [];
for(let i = 0; i < length; i++) {
// target_listres.push(<span className="column-1 operationleft color-666" key={i}>目标{length-i}</span>)
// target_listres.push(<span className="column-2 operationleft color-666" key={i}>目标{i+1}</span>)
target_listres.push(<span className="column-1 operationright color-666" key={i}>目标{length-i}</span>)
}
return target_listres
}
let TargetresLists = (length) => {
let target_listress = [];
for(let i = 0; i < length; i++) {
// target_listres.push(<span className="column-1 operationleft color-666" key={i}>目标{length-i}</span>)
target_listress.push(<span className="column-2 operationleft color-666" key={i}>目标{i+1}</span>)
// target_listres.push(<span className="column-1 operationright color-666" key={i}>目标{length-i}</span>)
}
return target_listress
}
let TargetresContentList = (length,value) => {
let target_listres = [];
if(value!=undefined){
for(let i = 0; i < length; i++) {
if(value[i]===1){
target_listres.push(<span className="column-1 operationright color-green" key={i}><i class="iconfont icon-gouxuan color-green font-16 mr5"></i></span>)
}else{
target_listres.push(<span className="column-1 operationright color-666" key={i}><i class="iconfont icon-guanbi font-14 mr5"></i></span>)
}
}
target_listres.reverse()
return target_listres
}
}
let Total_rate_dataList = (value) => {
let target_listres = [];
if(value!=undefined){
for(let i = 0; i < value.length; i++) {
if(i===value.length-1){
target_listres.push(<span className="column-1 operationright" key={i}>
{/*<div className="color-red">{value[i].total_score}</div>*/}
<div className="color-red">100%</div>
</span>)
}else{
target_listres.push(<span className={i===0?" column-2 operationleft":"column-2 operationleft"} key={i}>
{/*<div>{value[i].score}</div>*/}
{/*<div className="color-redFF">占比{(value[i].rate*100).toFixed(2)}%</div>*/}
<div>
{(value[i].rate*100).toFixed(2)}%
</div>
</span>)
}
}
return target_listres
}else{
target_listres.push(<span className="column-1 operationright">
{/*<div className="color-red">{value[i].total_score}</div>*/}
<div className="">--</div>
</span>)
return target_listres
}
}
let newTotal_rate_dataList = (length,value) => {
let target_listres = [];
if(value!=undefined){
for(let i = 0; i < value.length; i++) {
// if(i===0){
// target_listres.push(<span className="column-2 color-05101A" key={i}>
// <div>{value[i].score.toFixed(2)}</div>
// </span>)
// }else{
// target_listres.push(<span className="column-2 color-05101A" key={i}>
// <div>{value[i].score.toFixed(2)}</div>
// </span>)
// }
if(i<value.length-1){
target_listres.push(<span className="column-2 color-05101A" key={i}>
<div>{value[i].score.toFixed(2)}</div>
</span>)
}
}
return target_listres
}
}
return (
<div className="newMain clearfix">
<Modal
title={titlemessage}
visible={completiontype}
className={"ecmodeldelet"}
closable={false}
footer={null}
>
<div className="task-popup-content">
<div className="task-popup-text-center font-14">{completionlist}</div>
</div>
{
calculatesetype===true?
<div className="task-popup-submit clearfix"
style={{width:'69px'}}
>
<a className="task-btn task-btn-orange fr"
style={{fontWeight: '400'}}
onClick={this.hidecompletion}
>知道啦</a>
</div>
:
<div className="task-popup-submit clearfix">
<a onClick={this.hidecompletion} className="task-btn fl">取消</a>
<a className="task-btn task-btn-orange fr"
onClick={this.hidecompletion}
>确定</a>
</div>
}
</Modal>
<div className="educontent mb290">
<EcTitleCourseEvaluations
{...this.props}
schooldata={schooldata}
ecComponentState={'ecCompletion'}
ecpath={"show"}
/>
<div className="edu-back-white eacourse">
<div className="clearfix padding20-30 bor-bottom-greyE">
<a href={schooldata.course_setting_url} className="color-grey-9 TrainingLecturer">课程体系</a> >
<a className="TrainingTheory major_name"> {schooldata.ec_course_name} 达成评价详情</a>
{/* <a href="javascript:void(0)" className="fr white-btn edu-blueback-btn mt4">导出培养目标</a> */}
<div className="color-grey-9 mr10">系统根据课程目标课程考核方式与课程目标评价方法一键计算评价课程目标的达成情况 <a className={"color-blue"} onClick={() => window.elasticLayer(3533)}>查看详情</a></div>
</div>
<div className="padding20-30" id="training_objective_contents"
style={{
position: 'relative'
}}
>
<a className="fl SystemParameters" style={{display:schooldata.ec_course_support_setting_url===null?"none":"block"}}
href={schooldata.ec_course_support_setting_url}>1.课程目标</a>
<a className="fl SystemParameters ml40"
style={{display:schooldata.ec_course_reach_setting_url===null?"none":"block"}}
href={schooldata.ec_course_reach_setting_url}>2.课程考核方式与数据来源</a>
<a className="fl SystemParameters4CACFF ml40 color4D4D4D"
href={schooldata.score_level_setting_url}
>3.成绩等级设置</a>
<a className="fl SystemParameters ml40"
style={{display:schooldata.evaluation_methods_url===null?"none":"block"}}
href={schooldata.evaluation_methods_url}>4.课程目标评价方法</a>
<a className="fl SystemParameters ml40"
style={{display:schooldata.competition_calculation_info_url===null?"none":"block",color:'#4CACFF'}}
href={schooldata.competition_calculation_info_url}>5.课程达成评价结果</a>
{/* <span className="right ml20 SystemParameters">
{
evaluate_result===false?<span className="Systemnum">未达成</span>:<span className="Systemnum color-green"></span>
}
</span> */}
<span className={ismanager===false?"none":"right newrightcalculatebutton"}
style={{
marginLeft: '26px',
position: 'absolute',
right: '157px'
}}
onClick={this.newrightcalculatebutton}>计算</span>
<span className={ismanager===false?"none":"Importclassroomdata"} style={{top: "26px"}}>
<a className="white-btn edu-blueback-btn fr mb10 mr10" target="_blank" href={"/ec_courses/"+ec_course_id+"/export_evaluation_result.xls"}>导出评价详情</a>
</span>
</div>
</div>
<div className="ListTableLine newSystem mb20" id="school_major_list">
<p className="clearfix padding10im" >
<span className="column-1 color-666">课程目标</span>
<span className="column-1 operationright color-666">达成结果</span>
<span className="column-1 operationright color-666">达成标准()</span>
<span className="column-1 operationright color-666">实际达成</span>
<span className="column-1 operationright color-666">权重</span>
</p>
{ Spintype===true?<Spin className="Spinlarge" indicator={<Icon type="loading" style={{ fontSize: 30 }} spin />}/>:"" }
{ target_list.length===0&&Spintype===false?
<li className={ "clearfix newtarget_scoreclass lipadding10im"}>
<span className="column-1 color-05101A">--</span>
<span className="column-575 color-05101A">--</span>
<span className={"column-1 operationright Systemnum"}>--</span>
<span className="column-1 operationright color-05101A">--</span>
<span className="column-1 operationright">--</span>
<span className="column-1 operationright">--</span>
</li>:""}
{Spintype===false?target_list.map((item,key)=>{
return(
<li className={key+1===target_list.length?"clearfix newtarget_target lipadding10im":"clearfix newtarget_scoreclass lipadding10im"} key={key}>
<span className="column-1 color-05101A">{key+1}</span>
<span className="column-575 color-05101A">{item.content}</span>
<span className={item.result==="未达成"?"column-1 operationright Systemnum":"column-1 operationright color-green"}>{item.result}</span>
<span className="column-1 operationright color-05101A">{item.standard_grade}</span>
<span className="column-1 operationright">{item.real_grade}</span>
<span className="column-1 operationright">{item.weigths}</span>
</li>
)
}):""
}
</div>
<div className="edu-back-white eacourse">
<div className="padding1030" id="training_objective_contents">
<span className="fl SystemParameters lineheight60" style={{height:'46px'}}>毕业要求指标点达成评价结果</span>
<span className="right ml20 SystemParameters" style={{height:'46px'}}><span className="color-green"><i class="iconfont icon-gouxuan color-green font-16 mr5"></i></span> <i class="iconfont icon-guanbi font-14 mr5"></i></span>
</div>
</div>
<div className="ListTableLine newSystem mb20 graduateRequirement " id="school_major_list">
{
graduation_list.length===0?
<p className="clearfix lipadding20im" style={{minWidth:'1200px'}}>
<span className="column-1 color-666 mr16">毕业要求</span>
<span className="nowrap329">{5}</span>
<span className="column-1 operationright color-666">达成结果</span>
<span className="column-1 operationright color-666">达成目标值</span>
<span className="column-1 operationright color-666">达成实际值</span>
<span className="column-1 operationright color-666">课程权重</span>
{TargetresList(5)}
</p>
:""
}
{ Spintype===true?<Spin className="Spinlarge" indicator={<Icon type="loading" style={{ fontSize: 30 }} spin />}/>:"" }
{
graduation_list.length===0&&Spintype===false?
<li className={'clearfix newtarget_scoreclass marlr19'} style={{minWidth:'1137px'}}>
{/* <span className="column-1 color-05101A ec_graduation_name">{item.ec_graduation_name}</span> */}
<span className="column-1 color-05101A ec_graduation_name">{1}</span>
<span className="column-500 color-05101A">{"--"}</span>
<span className={"column-1 operationright Systemnum mrj15"}>{"--"}</span>
<span className="column-1 operationright color-05101A">{"--"}</span>
<span className="column-1 operationright">{"--"}</span>
<span className="column-1 operationright"> <a href={schooldata.requirement_vs_courses} style={{color:'rgb(76, 172, 255)'}}>立即配置</a></span>
{TargetresContentList(5,[2,2,2,2,2])}
</li>
:""
}
{
Spintype===false?graduation_list.map((item,key)=>{
if(key===0){
return(
<p key={key} className="clearfix lipadding20im" style={{minWidth: ec_course_targets_count > 5 ? (76*(ec_course_targets_count+4)+380+15):1200+"px"}}>
<span className="column-1 color-666 mr16">毕业要求</span>
<span className="nowrap329">{item.ec_subitem_content}</span>
<span className="column-1 operationright color-666">达成结果</span>
<span className="column-1 operationright color-666">达成目标值</span>
<span className="column-1 operationright color-666">达成实际值</span>
<span className="column-1 operationright color-666">课程权重</span>
{TargetresList(ec_course_targets_count)}
</p>
)
}
}):""
}
{
Spintype===false?graduation_list.map((item,key)=>{
return(
<li className={key+1===target_list.length?"clearfix newtarget_target marlr19":"clearfix newtarget_scoreclass marlr19"} key={key} style={{minWidth: ec_course_targets_count > 5 ? (76*(ec_course_targets_count+4)+380):1200+"px"}}>
{/* <span className="column-1 color-05101A ec_graduation_name">{item.ec_graduation_name}</span> */}
<span className="column-1 color-05101A ec_graduation_name">{key+1}</span>
<span className="column-500 color-05101A" data-tip-down={item.content}>{item.ec_subitem_content}</span>
<span className={item.result==="未达成"?"column-1 operationright Systemnum mrj15":"column-1 operationright color-green mrj15"}>{item.result}</span>
<span className="column-1 operationright color-05101A">{item.reach_target===null?0:item.reach_target}</span>
<span className="column-1 operationright">{item.reach_real_target===null?0:item.reach_real_target}</span>
{item.weight===null||item.weight===0?<span className="column-1 operationright" ><a href={schooldata.requirement_vs_courses} style={{color:'rgb(76, 172, 255)'}}>立即配置</a></span>:<span className="column-1 operationright">{item.weight}</span>}
{TargetresContentList(ec_course_targets_count,item.target_position)}
</li>
)
}):""
}
</div>
<div className="edu-back-white eacourse">
<div className="padding1030" id="training_objective_contents">
<span className="fl SystemParameters lineheight60" style={{height:'46px'}}>课程总评成绩表</span>
</div>
</div>
<div className="ListTableLine newSystem mb20" id="school_major_list">
<p className="clearfix padding10im" style={{width: total_rate_data > 5 ? (180 * total_rate_data+226+16) : 1200+"px"}}>
{/*<span className="column-1 color-666 mr16 width86">序号</span>*/}
<span className="column-1 color-666 mr16 width86">课程目标</span>
{/*<span className="column-1 color-666 mr16">姓名</span>*/}
{/*<span className="column-1 color-666 mr16">学号</span>*/}
{TargetresLists(total_rate_data-1)}
<span className="column-1 operationright color-666">总评成绩</span>
</p>
{/*style={{width: 113*(total_rate_data+4)>1136?113*(total_rate_data+4.5):1136+"px"}}*/}
{
// course_total_score.map((i,k)=>{
// if(k===course_total_score.length-1){
// return(
// <li className={"clearfix newtarget_scoreclass lipadding10im margin64px"} key={k} style={{width: 113*(total_rate_data+4)>1200?(113*(total_rate_data+4.5))+63:1200+"px"}}>
// <span className="column-1 color-05101A mr16 width86">占比</span>
// {/*colorTransparent*/}
// {/*<span className="column-1 color-05101A ec_graduation_name mr16 colorTransparent"> 平均数 </span>*/}
// {/*<span className="column-1 color-05101A ec_graduation_name mr16 colorTransparent "> 平均数 </span>*/}
// {/* {Total_rate_dataList(total_rate_data-1,i.total_rate)}
// </li>
// )
// }
// }) */}
}
{ Spintype===true?<Spin className="Spinlarge" indicator={<Icon type="loading" style={{ fontSize: 30 }} spin />}/>:"" }
{
Spintype===false? <li className={"clearfix newtarget_scoreclass lipadding10im margin64px"} style={{width: total_rate_data > 5 ? (180 * total_rate_data+226+16) : 1200 + "px"}}>
<span className="column-1 color-05101A mr16 width86">占比</span>
{/*colorTransparent*/}
{/*<span className="column-1 color-05101A ec_graduation_name mr16 colorTransparent"> 平均数 </span>*/}
{/*<span className="column-1 color-05101A ec_graduation_name mr16 colorTransparent "> 平均数 </span>*/}
{Total_rate_dataList(course_total_score)}
{
course_total_score.length===0? <span className="column-1 operationright">--</span>:""
}
</li>:""
}
{/*style={{width: 113*(total_rate_data+4)>1136?113*(total_rate_data+4):1136+"px"}}*/}
{
// course_total_score.map((i,k)=>{
// if(k!=course_total_score.length-1){
// return(
// <li className={"clearfix newtarget_scoreclass lipadding10im"} style={{width: 113*(total_rate_data+4)>1200?(113*(total_rate_data+4.5))+63:1200+"px"}}>
// {/*<span className="column-1 color-05101A mr16 width86">{k+1}</span>*/}
// <span className="column-1 color-05101A mr16 width86">平均分</span>
// {/*<span className="column-1 color-05101A ec_graduation_name mr16">{i.student_scores.name}</span>*/}
// {/*<span className="column-1 color999 ec_graduation_name mr16 ">{i.student_scores.student_number}</span>*/}
// {newTotal_rate_dataList(total_rate_data-1,i.student_scores.target_info)}
// <span className="column-1 color-red operationright">{i.student_scores.total_score.toFixed(2)}</span>
// </li>
// )
// }
// })
}
{
Spintype===false?<li className={"clearfix newtarget_scoreclass lipadding10im bordereaeaea"} style={{width: 113*(total_rate_data+4)>1200?(113*(total_rate_data+4.5))+63:1200+"px"}}>
{/*<span className="column-1 color-05101A mr16 width86">{k+1}</span>*/}
<span className="column-1 color-05101A mr16 width86">平均分</span>
{/*<span className="column-1 color-05101A ec_graduation_name mr16">{i.student_scores.name}</span>*/}
{/*<span className="column-1 color999 ec_graduation_name mr16 ">{i.student_scores.student_number}</span>*/}
{newTotal_rate_dataList(course_total_score-1,course_total_score)}
{/* <span className="column-1 color-red operationright">{course_total_score.length===0?"":course_total_score[course_total_score-1].total_score}</span> */}
{
course_total_score.length===0? <span className="column-1 operationright">--</span>:<span className="column-1 color-red operationright">{course_total_scoreaverage}</span>
}
</li>:""
}
<li class="clearfix newtarget_scoreclass" style={{width: 113*(total_rate_data+4)>1136?113*(total_rate_data+4):1136+"px",display:morelisttype===true?"block":"none"}}>
<a className={"ecmorelist"} onClick={()=>this.showmorelist()}>加载更多</a>
</li>
</div>
<div className="edu-back-white eacourse">
<div className="padding1030" id="training_objective_contents">
<span className="fl SystemParameters lineheight60" style={{height:'46px'}}>课程目标成绩分析</span>
</div>
</div>
<div className="ListTableLine newSystem mb20" id="school_major_list">
<p className="clearfix padding10im">
<span className="column-1 color-666">课程目标</span>
<span className="column-1 color-666">平均分</span>
<span className="column-1 color-666">最高分数</span>
<span className="column-1 color-666">最低分数</span>
<span className="column-1 color-666">90分以上</span>
<span className="column-1 color-666">80-89</span>
<span className="column-1 color-666">70-79</span>
<span className="column-1 color-666">60-69</span>
<span className="column-1 color-666">50-59</span>
<span className="column-1 color-666">低于50分</span>
</p>
{
Spintype===false?target_score.map((i,k)=>{
return(
<li className={"clearfix newtarget_scoreclass lipadding10im"} key={k}>
<span className="column-1 color-05101A">{k+1}</span>
<span className="column-1 color-05101A">{i.average_score}</span>
<span className="column-1 colorFF6800">{i.top_score}</span>
<span className="column-1 color-green">{i.low_score}</span>
<span className="column-1 color-05101A">
<div>{i.from90[0]}</div>
<div className="color999">{(i.from90[1]).toFixed(2)}%</div>
</span>
<span className="column-1 color-05101A">
<div>{i.from80[0]}</div>
<div className="color999">{(i.from80[1]).toFixed(2)}%</div>
</span>
<span className="column-1 color-05101A">
<div>{i.from70[0]}</div>
<div className="color999">{(i.from70[1]).toFixed(2)}%</div>
</span>
<span className="column-1 color-05101A">
<div>{i.from60[0]}</div>
<div className="color999">{(i.from60[1]).toFixed(2)}%</div>
</span>
<span className="column-1 color-05101A">
<div>{i.from50[0]}</div>
<div className="color999">{(i.from50[1]).toFixed(2)}%</div>
</span>
<span className="column-1 color-05101A">
<div>{i.from_down[0]}</div>
<div className="color999">{(i.from_down[1]).toFixed(2)}%</div>
</span>
</li>
)
}):""
}
{ Spintype===true?<Spin className="Spinlarge" indicator={<Icon type="loading" style={{ fontSize: 30 }} spin />}/>:"" }
{target_score.length===0&&Spintype===false?
<li className={"clearfix newtarget_scoreclass lipadding10im"}>
<span className="column-1 color-05101A">--</span>
<span className="column-1 color-05101A">--</span>
<span className="column-1 colorFF6800">--</span>
<span className="column-1 color-green">--</span>
<span className="column-1 color-05101A">
<div>--</div>
<div className="color999">--%</div>
</span>
<span className="column-1 color-05101A">
<div>--</div>
<div className="color999">--%</div>
</span>
<span className="column-1 color-05101A">
<div>--</div>
<div className="color999">--%</div>
</span>
<span className="column-1 color-05101A">
<div>--</div>
<div className="color999">--%</div>
</span>
<span className="column-1 color-05101A">
<div>--</div>
<div className="color999">--%</div>
</span>
<span className="column-1 color-05101A">
<div>--</div>
<div className="color999">--%</div>
</span>
</li>:""}
</div>
</div>
</div>
);
}
}
export default SnackbarHOC() ( TPMIndexHOC ( EcCompletionCalculation ) );

@ -0,0 +1,814 @@
import React, { Component } from 'react';
import classNames from 'classnames'
import axios from 'axios';
import { TPMIndexHOC } from '../../../tpm/TPMIndexHOC';
import { SnackbarHOC } from 'educoder'
import { message,Modal,Spin,Icon} from 'antd';
import 'antd/dist/antd.css';
import EcTitleCourseEvaluations from '../../ecTitle/ecTitle'
import '../../css/ecCourseSupports.css';
import '../../css/ecCourseEvaluations.css';
const $ = window.$;
class EcCompletionCalculation extends Component {
constructor(props) {
super(props)
this.state={
schooldata:{},
ecComponentState:"ecCompletion",
course_total_score:[],
ec_course_targets:0,
graduation_list:[],
target_list:[],
target_score:[],
evaluate_result:"",
ec_course_targets_count:0,
new_target_ec_year_id:0,
total_rate_data:undefined,
calculatetype:false,
ec_course_id:0,
morelisttype:false,
titlemessage:"提示",
completiontype:false,
completionlist:"",
course_total_scoreaverage:0,
calculatesetype:false,
Spintype:false,
ismanager:false
}
}
componentWillMount(){
window.document.title = '课程达成评价结果';
}
componentDidMount(){
let ec_course_id =this.props.match.params.ec_course_id;
this.UpdateClassData(true);
const Url =`/ec_major_schools/get_navigation_data?ec_course_id=`+ec_course_id;
axios.get(Url, {
withCredentials: true,
})
.then((response) => {
if(response.status===200){
// if(response.data.allow_visit===false){
// window.location.href="/403"
// }
this.setState({
schooldata:response.data,
ec_course_id:ec_course_id
})
}
})
.catch(function (error) {
console.log(error);
});
}
targetsget_navigation_data=(ec_year_id,ec_course_id)=>{
const Url =`/ec_major_schools/get_navigation_data?ec_year_id=`+ec_year_id+"&ec_course_id="+ec_course_id;
axios.get(Url, {
withCredentials: true,
})
.then((response) => {
if(response.status===200){
// if(response.data.allow_visit===false){
// window.location.href="/403"
// }
this.setState({
schooldata:response.data,
ec_course_id:ec_course_id
})
}
})
.catch(function (error) {
console.log(error);
});
}
showmorelist=()=>{
this.setState({
morelisttype:false
})
this.UpdateClassData(false)
}
UpdateClassData=(key)=>{
let {calculatetype} =this.state;
let ec_course_id =this.props.match.params.ec_course_id;
this.setState({
ec_course_id:ec_course_id
})
const Arl =`/ec_courses/`+ec_course_id+`/calculation_info_data`;
axios.get(Arl, {
withCredentials: true,
})
.then((response) => {
if(response.status===200){
// var list=[];
// if(key===true){
// for(var i=0; i<response.data.course_total_score.length;i++){
// if(i<10){
// list.push(response.data.course_total_score[i])
// }
// }
// }else{
// list=response.data.course_total_score
// }
// let newgraduation_list= response.data.graduation_list.reverse();
let newmorelisttype=false;
if(response.data.course_total_score>10){
newmorelisttype=true
}
let course_total_scoreaverage;
let newlist=response.data.course_total_score[response.data.course_total_score.length-1].total_rate;
for(var i=0; i<newlist.length;i++){
if(i===newlist.length-1){
course_total_scoreaverage=newlist[i].total_score
}
}
this.setState({
evaluate_result:response.data.evaluate_result,
course_total_score:response.data.course_total_score[response.data.course_total_score.length-1].total_rate,
total_rate_data:response.data.course_total_score[response.data.course_total_score.length-1].total_rate.length,
graduation_list:response.data.graduation_list,
target_list:response.data.target_list,
target_score:response.data.target_score,
ec_course_targets_count:response.data.ec_course_targets_count,
morelisttype:newmorelisttype,
course_total_scoreaverage:course_total_scoreaverage,
ismanager:response.data.is_manager
})
// ec_course_targets:response.data.ec_course_targets,
this.targetsget_navigation_data(response.data.ec_year_id,ec_course_id)
if(calculatetype===true){
this.setState({
calculatetype:false,
completiontype:true,
completionlist:'刷新列表数据成功',
calculatesetype:true
})
}
}
})
.catch(function (error) {
console.log(error);
});
//
// let newcourse_total_score=[
// {
// student_scores:{
// name: "黎子豪",
// student_number: "13408100113",
// target_info: [
// {position: 1, score: 73.3},
// {position: 2, score: 71.8},
// {position: 3, score: 92.2},
// {position: 4, score: 82.1},
// {position: 5, score: 87.7}
// ],
// total_score: 81.4
// }
// },{
// total_rate:[
// {position: 1, score: 65.35, rate: 0.1},
// {position: 2, score: 68.81, rate: 0.1},
// {position: 3, score: 68.34, rate: 0.1},
// {position: 4, score: 78.09, rate: 0.35},
// {position: 5, score: 77, rate: 0.35},
// {total_score: 74.5},
// ]
// }
// ]
//
// var list=[];
// if(key===true){
// for(var i=0; i<newcourse_total_score.length;i++){
// if(i<10){
// list.push(newcourse_total_score[i])
// }
// }
// }else{
// list=newcourse_total_score
// }
// let graduation_list=[
// {
// ec_graduation_name: "5-1",
// ec_subitem_content: "能够针对计算机系统的设计、开发、部署、运行和维护等方面的复杂工程问题,开发、选择与使用恰当的技术、资源、现代工程工具和信息技术工具,进行科学合理的预测与模拟,并充分认识到问题的复杂性与解决手段的局限性。",
// reach_real_target: 0.078,
// reach_target: 0.07,
// result: "达成",
// target_position: [0, 0, 0, 1, 0],
// weight: 0.1
// }
// ]
// let newgraduation_list= graduation_list.reverse();
// this.setState({
// course_total_score:list,
// total_rate_data:newcourse_total_score[newcourse_total_score.length-1].total_rate.length,
// graduation_list:newgraduation_list,
// evaluate_result:false,
// target_list:[
// {
// content: "理解数据管理技术和数据库技术的发展,区分不同数据模型的作用和特点,描述数据库系统的类型、结构、数据独立性。",
// real_grade: 65.35,
// result: "达成",
// standard_grade: 65,
// weigths: 0.1
// }
// ],
// target_score:[
// {average_score: 65.35,
// ec_course_targets_count: 5,
// from50: [9, 20.45],
// from60: [13, 29.55],
// from70: [14, 31.82],
// from80: [3, 6.82],
// from90: [1, 2.27],
// from_down: [4, 0.09],
// graduation_list: [],
// low_score: 40,
// top_score: 93.4}
// ],
// ec_course_targets_count:5
//
// })
// if(calculatetype===true){
// message.success('刷新列表数据成功!');
// this.setState({
// calculatetype:false,
// completiontype:true,
// completionlist:'刷新列表数据成功!'
// })
// }
}
newrightcalculatebutton=()=>{
this.setState({
Spintype:true
})
let {ec_course_id}=this.state;
const Orl =`/ec_courses/`+ec_course_id+`/sync_data`;
axios.get(Orl, {
withCredentials:true,
})
.then((response) => {
if(response.data.status===1){
this.setState({
calculatetype:true,
completiontype:true,
completionlist:'计算成功',
calculatesetype:true,
Spintype:false
})
this.UpdateClassData(true);
}
})
.catch(function (error) {
console.log(error)
});
}
hidecompletion=()=>{
this.setState({
completiontype:false,
completionlist:"",
calculatesetype:false
})
}
render() {
let {Spintype,calculatesetype,ec_course_id,course_total_scoreaverage,ec_course_targets_count,schooldata,ecComponentState,course_total_score,total_rate_data,ec_course_targets,graduation_list,target_list,target_score,evaluate_result,morelisttype,titlemessage,completiontype,completionlist,ismanager} = this.state;
let TargetresList = (length) => {
let target_listres = [];
for(let i = 0; i < length; i++) {
// target_listres.push(<span className="column-1 operationleft color-666" key={i}>目标{length-i}</span>)
// target_listres.push(<span className="column-2 operationleft color-666" key={i}>目标{i+1}</span>)
target_listres.push(<span className="column-1 operationright color-666" key={i}>目标{length-i}</span>)
}
return target_listres
}
let TargetresLists = (length) => {
let target_listress = [];
for(let i = 0; i < length; i++) {
// target_listres.push(<span className="column-1 operationleft color-666" key={i}>目标{length-i}</span>)
target_listress.push(<span className="column-2 operationleft color-666" key={i}>目标{i+1}</span>)
// target_listres.push(<span className="column-1 operationright color-666" key={i}>目标{length-i}</span>)
}
return target_listress
}
let TargetresContentList = (length,value) => {
let target_listres = [];
if(value!=undefined){
for(let i = 0; i < length; i++) {
if(value[i]===1){
target_listres.push(<span className="column-1 operationright color-green" key={i}><i class="iconfont icon-gouxuan color-green font-16 mr5"></i></span>)
}else{
target_listres.push(<span className="column-1 operationright color-666" key={i}><i class="iconfont icon-guanbi font-14 mr5"></i></span>)
}
}
target_listres.reverse()
return target_listres
}
}
let Total_rate_dataList = (value) => {
let target_listres = [];
if(value!=undefined){
for(let i = 0; i < value.length; i++) {
if(i===value.length-1){
target_listres.push(<span className="column-1 operationright" key={i}>
{/*<div className="color-red">{value[i].total_score}</div>*/}
<div className="color-red">100%</div>
</span>)
}else{
target_listres.push(<span className={i===0?" column-2 operationleft":"column-2 operationleft"} key={i}>
{/*<div>{value[i].score}</div>*/}
{/*<div className="color-redFF">占比{(value[i].rate*100).toFixed(2)}%</div>*/}
<div>
{(value[i].rate*100).toFixed(2)}%
</div>
</span>)
}
}
return target_listres
}else{
target_listres.push(<span className="column-1 operationright">
{/*<div className="color-red">{value[i].total_score}</div>*/}
<div className="">--</div>
</span>)
return target_listres
}
}
let newTotal_rate_dataList = (length,value) => {
let target_listres = [];
if(value!=undefined){
for(let i = 0; i < value.length; i++) {
// if(i===0){
// target_listres.push(<span className="column-2 color-05101A" key={i}>
// <div>{value[i].score.toFixed(2)}</div>
// </span>)
// }else{
// target_listres.push(<span className="column-2 color-05101A" key={i}>
// <div>{value[i].score.toFixed(2)}</div>
// </span>)
// }
if(i<value.length-1){
target_listres.push(<span className="column-2 color-05101A" key={i}>
<div>{value[i].score.toFixed(2)}</div>
</span>)
}
}
return target_listres
}
}
return (
<div className="newMain clearfix">
<Modal
title={titlemessage}
visible={completiontype}
className={"ecmodeldelet"}
closable={false}
footer={null}
>
<div className="task-popup-content">
<div className="task-popup-text-center font-14">{completionlist}</div>
</div>
{
calculatesetype===true?
<div className="task-popup-submit clearfix"
style={{width:'69px'}}
>
<a className="task-btn task-btn-orange fr"
style={{fontWeight: '400'}}
onClick={this.hidecompletion}
>知道啦</a>
</div>
:
<div className="task-popup-submit clearfix">
<a onClick={this.hidecompletion} className="task-btn fl">取消</a>
<a className="task-btn task-btn-orange fr"
onClick={this.hidecompletion}
>确定</a>
</div>
}
</Modal>
<div className="educontent mb290">
<EcTitleCourseEvaluations
{...this.props}
schooldata={schooldata}
ecComponentState={'ecCompletion'}
ecpath={"show"}
/>
<div className="edu-back-white eacourse">
<div className="clearfix padding20-30 bor-bottom-greyE">
<a href={schooldata.course_setting_url} className="color-grey-9 TrainingLecturer">课程体系</a> >
<a className="TrainingTheory major_name"> {schooldata.ec_course_name} 达成评价详情</a>
{/* <a href="javascript:void(0)" className="fr white-btn edu-blueback-btn mt4">导出培养目标</a> */}
<div className="color-grey-9 mr10">系统根据课程目标课程考核方式与课程目标评价方法一键计算评价课程目标的达成情况 <a className={"color-blue"} onClick={() => window.elasticLayer(3533)}>查看详情</a></div>
</div>
<div className="padding20-30" id="training_objective_contents"
style={{
position: 'relative'
}}
>
<a className="fl SystemParameters" style={{display:schooldata.ec_course_support_setting_url===null?"none":"block"}}
href={schooldata.ec_course_support_setting_url}>1.课程目标</a>
<a className="fl SystemParameters ml40"
style={{display:schooldata.ec_course_reach_setting_url===null?"none":"block"}}
href={schooldata.ec_course_reach_setting_url}>2.课程考核方式与数据来源</a>
<a className="fl SystemParameters4CACFF ml40 color4D4D4D"
href={schooldata.score_level_setting_url}
>3.成绩等级设置</a>
<a className="fl SystemParameters ml40"
style={{display:schooldata.evaluation_methods_url===null?"none":"block"}}
href={schooldata.evaluation_methods_url}>4.课程目标评价方法</a>
<a className="fl SystemParameters ml40"
style={{display:schooldata.competition_calculation_info_url===null?"none":"block",color:'#4CACFF'}}
href={schooldata.competition_calculation_info_url}>5.课程达成评价结果</a>
{/* <span className="right ml20 SystemParameters">
{
evaluate_result===false?<span className="Systemnum">未达成</span>:<span className="Systemnum color-green"></span>
}
</span> */}
<span className={ismanager===false?"none":"right newrightcalculatebutton"}
style={{
marginLeft: '26px',
position: 'absolute',
right: '157px'
}}
onClick={this.newrightcalculatebutton}>计算</span>
<span className={ismanager===false?"none":"Importclassroomdata"} style={{top: "26px"}}>
<a className="white-btn edu-blueback-btn fr mb10 mr10" target="_blank" href={"/ec_courses/"+ec_course_id+"/export_evaluation_result.xls"}>导出评价详情</a>
</span>
</div>
</div>
<div className="ListTableLine newSystem mb20" id="school_major_list">
<p className="clearfix padding10im" >
<span className="column-1 color-666">课程目标</span>
<span className="column-1 operationright color-666">达成结果</span>
<span className="column-1 operationright color-666">达成标准()</span>
<span className="column-1 operationright color-666">实际达成</span>
<span className="column-1 operationright color-666">权重</span>
</p>
{ Spintype===true?<Spin className="Spinlarge" indicator={<Icon type="loading" style={{ fontSize: 30 }} spin />}/>:"" }
{ target_list.length===0&&Spintype===false?
<li className={ "clearfix newtarget_scoreclass lipadding10im"}>
<span className="column-1 color-05101A">--</span>
<span className="column-575 color-05101A">--</span>
<span className={"column-1 operationright Systemnum"}>--</span>
<span className="column-1 operationright color-05101A">--</span>
<span className="column-1 operationright">--</span>
<span className="column-1 operationright">--</span>
</li>:""}
{Spintype===false?target_list.map((item,key)=>{
return(
<li className={key+1===target_list.length?"clearfix newtarget_target lipadding10im":"clearfix newtarget_scoreclass lipadding10im"} key={key}>
<span className="column-1 color-05101A">{key+1}</span>
<span className="column-575 color-05101A">{item.content}</span>
<span className={item.result==="未达成"?"column-1 operationright Systemnum":"column-1 operationright color-green"}>{item.result}</span>
<span className="column-1 operationright color-05101A">{item.standard_grade}</span>
<span className="column-1 operationright">{item.real_grade}</span>
<span className="column-1 op erationright">{item.weigths}</span>
</li>
)
}):""
}
</div>
<div className="edu-back-white eacourse">
<div className="padding1030" id="training_objective_contents">
<span className="fl SystemParameters lineheight60" style={{height:'46px'}}> 毕业要求指标点达成评价结果</span>
<span className="right ml20 SystemParameters" style={{height:'46px'}}><span className="color-green"><i class="iconfont icon-gouxuan color-green font-16 mr5"></i></span> <i class="iconfont icon-guanbi font-14 mr5"></i></span>
</div>
</div>
<div className="ListTableLine newSystem mb20 graduateRequirement " id="school_major_list">
{
graduation_list.length===0?
<p className="clearfix lipadding20im" style={{minWidth:'1200px'}}>
<span className="column-1 color-666 mr16">毕业要求</span>
<span className="nowrap329">{5}</span>
<span className="column-1 operationright color-666">达成结果</span>
<span className="column-1 operationright color-666">达成目标值</span>
<span className="column-1 operationright color-666">达成实际值</span>
<span className="column-1 operationright color-666">课程权重</span>
{TargetresList(5)}
</p>
:""
}
{ Spintype===true?<Spin className="Spinlarge" indicator={<Icon type="loading" style={{ fontSize: 30 }} spin />}/>:"" }
{
graduation_list.length===0&&Spintype===false?
<li className={'clearfix newtarget_scoreclass marlr19'} style={{minWidth:'1137px'}}>
{/* <span className="column-1 color-05101A ec_graduation_name">{item.ec_graduation_name}</span> */}
<span className="column-1 color-05101A ec_graduation_name">{1}</span>
<span className="column-500 color-05101A">{"--"}</span>
<span className={"column-1 operationright Systemnum mrj15"}>{"--"}</span>
<span className="column-1 operationright color-05101A">{"--"}</span>
<span className="column-1 operationright">{"--"}</span>
<span className="column-1 operationright"> <a href={schooldata.requirement_vs_courses} style={{color:'rgb(76, 172, 255)'}}>立即配置</a></span>
{TargetresContentList(5,[2,2,2,2,2])}
</li>
:""
}
{
Spintype===false?graduation_list.map((item,key)=>{
if(key===0){
return(
<p key={key} className="clearfix lipadding20im" style={{minWidth: ec_course_targets_count > 5 ? (76*(ec_course_targets_count+4)+380+15):1200+"px"}}>
<span className="column-1 color-666 mr16">毕业要求</span>
<span className="nowrap329">{item.ec_subitem_content}</span>
<span className="column-1 operationright color-666">达成结果</span>
<span className="column-1 operationright color-666">达成目标值</span>
<span className="column-1 operationright color-666">达成实际值</span>
<span className="column-1 operationright color-666">课程权重</span>
{TargetresList(ec_course_targets_count)}
</p>
)
}
}):""
}
{
Spintype===false?graduation_list.map((item,key)=>{
return(
<li className={key+1===target_list.length?"clearfix newtarget_target marlr19":"clearfix newtarget_scoreclass marlr19"} key={key} style={{minWidth: ec_course_targets_count > 5 ? (76*(ec_course_targets_count+4)+380):1200+"px"}}>
{/* <span className="column-1 color-05101A ec_graduation_name">{item.ec_graduation_name}</span> */}
<span className="column-1 color-05101A ec_graduation_name">{key+1}</span>
<span className="column-500 color-05101A" data-tip-down={item.content}>{item.ec_subitem_content}</span>
<span className={item.result==="未达成"?"column-1 operationright Systemnum mrj15":"column-1 operationright color-green mrj15"}>{item.result}</span>
<span className="column-1 operationright color-05101A">{item.reach_target===null?0:item.reach_target}</span>
<span className="column-1 operationright">{item.reach_real_target===null?0:item.reach_real_target}</span>
{item.weight===null||item.weight===0?<span className="column-1 operationright" ><a href={schooldata.requirement_vs_courses} style={{color:'rgb(76, 172, 255)'}}>立即配置</a></span>:<span className="column-1 operationright">{item.weight}</span>}
{TargetresContentList(ec_course_targets_count,item.target_position)}
</li>
)
}):""
}
</div>
<div className="edu-back-white eacourse">
<div className="padding1030" id="training_objective_contents">
<span className="fl SystemParameters lineheight60" style={{height:'46px'}}>课程总评成绩表</span>
</div>
</div>
<div className="ListTableLine newSystem mb20" id="school_major_list">
<p className="clearfix padding10im" style={{width: total_rate_data > 5 ? (180 * total_rate_data+226+16) : 1200+"px"}}>
{/*<span className="column-1 color-666 mr16 width86">序号</span>*/}
<span className="column-1 color-666 mr16 width86">课程目标</span>
{/*<span className="column-1 color-666 mr16">姓名</span>*/}
{/*<span className="column-1 color-666 mr16">学号</span>*/}
{TargetresLists(total_rate_data-1)}
<span className="column-1 operationright color-666">总评成绩</span>
</p>
{/*style={{width: 113*(total_rate_data+4)>1136?113*(total_rate_data+4.5):1136+"px"}}*/}
{
// course_total_score.map((i,k)=>{
// if(k===course_total_score.length-1){
// return(
// <li className={"clearfix newtarget_scoreclass lipadding10im margin64px"} key={k} style={{width: 113*(total_rate_data+4)>1200?(113*(total_rate_data+4.5))+63:1200+"px"}}>
// <span className="column-1 color-05101A mr16 width86">占比</span>
// {/*colorTransparent*/}
// {/*<span className="column-1 color-05101A ec_graduation_name mr16 colorTransparent"> 平均数 </span>*/}
// {/*<span className="column-1 color-05101A ec_graduation_name mr16 colorTransparent "> 平均数 </span>*/}
// {/* {Total_rate_dataList(total_rate_data-1,i.total_rate)}
// </li>
// )
// }
// }) */}
}
{ Spintype===true?<Spin className="Spinlarge" indicator={<Icon type="loading" style={{ fontSize: 30 }} spin />}/>:"" }
{
Spintype===false? <li className={"clearfix newtarget_scoreclass lipadding10im margin64px"} style={{width: total_rate_data > 5 ? (180 * total_rate_data+226+16) : 1200 + "px"}}>
<span className="column-1 color-05101A mr16 width86">占比</span>
{/*colorTransparent*/}
{/*<span className="column-1 color-05101A ec_graduation_name mr16 colorTransparent"> 平均数 </span>*/}
{/*<span className="column-1 color-05101A ec_graduation_name mr16 colorTransparent "> 平均数 </span>*/}
{Total_rate_dataList(course_total_score)}
{
course_total_score.length===0? <span className="column-1 operationright">--</span>:""
}
</li>:""
}
{/*style={{width: 113*(total_rate_data+4)>1136?113*(total_rate_data+4):1136+"px"}}*/}
{
// course_total_score.map((i,k)=>{
// if(k!=course_total_score.length-1){
// return(
// <li className={"clearfix newtarget_scoreclass lipadding10im"} style={{width: 113*(total_rate_data+4)>1200?(113*(total_rate_data+4.5))+63:1200+"px"}}>
// {/*<span className="column-1 color-05101A mr16 width86">{k+1}</span>*/}
// <span className="column-1 color-05101A mr16 width86">平均分</span>
// {/*<span className="column-1 color-05101A ec_graduation_name mr16">{i.student_scores.name}</span>*/}
// {/*<span className="column-1 color999 ec_graduation_name mr16 ">{i.student_scores.student_number}</span>*/}
// {newTotal_rate_dataList(total_rate_data-1,i.student_scores.target_info)}
// <span className="column-1 color-red operationright">{i.student_scores.total_score.toFixed(2)}</span>
// </li>
// )
// }
// })
}
{
Spintype===false?<li className={"clearfix newtarget_scoreclass lipadding10im bordereaeaea"} style={{width: 113*(total_rate_data+4)>1200?(113*(total_rate_data+4.5))+63:1200+"px"}}>
{/*<span className="column-1 color-05101A mr16 width86">{k+1}</span>*/}
<span className="column-1 color-05101A mr16 width86">平均分</span>
{/*<span className="column-1 color-05101A ec_graduation_name mr16">{i.student_scores.name}</span>*/}
{/*<span className="column-1 color999 ec_graduation_name mr16 ">{i.student_scores.student_number}</span>*/}
{newTotal_rate_dataList(course_total_score-1,course_total_score)}
{/* <span className="column-1 color-red operationright">{course_total_score.length===0?"":course_total_score[course_total_score-1].total_score}</span> */}
{
course_total_score.length===0? <span className="column-1 operationright">--</span>:<span className="column-1 color-red operationright">{course_total_scoreaverage}</span>
}
</li>:""
}
<li class="clearfix newtarget_scoreclass" style={{width: 113*(total_rate_data+4)>1136?113*(total_rate_data+4):1136+"px",display:morelisttype===true?"block":"none"}}>
<a className={"ecmorelist"} onClick={()=>this.showmorelist()}>加载更多</a>
</li>
</div>
<div className="edu-back-white eacourse">
<div className="padding1030" id="training_objective_contents">
<span className="fl SystemParameters lineheight60" style={{height:'46px'}}>课程目标成绩分析</span>
</div>
</div>
<div className="ListTableLine newSystem mb20" id="school_major_list">
<p className="clearfix padding10im">
<span className="column-1 color-666">课程目标</span>
<span className="column-1 color-666">平均分</span>
<span className="column-1 color-666">最高分数</span>
<span className="column-1 color-666">最低分数</span>
<span className="column-1 color-666">90分以上</span>
<span className="column-1 color-666">80-89</span>
<span className="column-1 color-666">70-79</span>
<span className="column-1 color-666">60-69</span>
<span className="column-1 color-666">50-59</span>
<span className="column-1 color-666">低于50分</span>
</p>
{
Spintype===false?target_score.map((i,k)=>{
return(
<li className={"clearfix newtarget_scoreclass lipadding10im"} key={k}>
<span className="column-1 color-05101A">{k+1}</span>
<span className="column-1 color-05101A">{i.average_score}</span>
<span className="column-1 colorFF6800">{i.top_score}</span>
<span className="column-1 color-green">{i.low_score}</span>
<span className="column-1 color-05101A">
<div>{i.from90[0]}</div>
<div className="color999">{(i.from90[1]).toFixed(2)}%</div>
</span>
<span className="column-1 color-05101A">
<div>{i.from80[0]}</div>
<div className="color999">{(i.from80[1]).toFixed(2)}%</div>
</span>
<span className="column-1 color-05101A">
<div>{i.from70[0]}</div>
<div className="color999">{(i.from70[1]).toFixed(2)}%</div>
</span>
<span className="column-1 color-05101A">
<div>{i.from60[0]}</div>
<div className="color999">{(i.from60[1]).toFixed(2)}%</div>
</span>
<span className="column-1 color-05101A">
<div>{i.from50[0]}</div>
<div className="color999">{(i.from50[1]).toFixed(2)}%</div>
</span>
<span className="column-1 color-05101A">
<div>{i.from_down[0]}</div>
<div className="color999">{(i.from_down[1]).toFixed(2)}%</div>
</span>
</li>
)
}):""
}
{ Spintype===true?<Spin className="Spinlarge" indicator={<Icon type="loading" style={{ fontSize: 30 }} spin />}/>:"" }
{target_score.length===0&&Spintype===false?
<li className={"clearfix newtarget_scoreclass lipadding10im"}>
<span className="column-1 color-05101A">--</span>
<span className="column-1 color-05101A">--</span>
<span className="column-1 colorFF6800">--</span>
<span className="column-1 color-green">--</span>
<span className="column-1 color-05101A">
<div>--</div>
<div className="color999">--%</div>
</span>
<span className="column-1 color-05101A">
<div>--</div>
<div className="color999">--%</div>
</span>
<span className="column-1 color-05101A">
<div>--</div>
<div className="color999">--%</div>
</span>
<span className="column-1 color-05101A">
<div>--</div>
<div className="color999">--%</div>
</span>
<span className="column-1 color-05101A">
<div>--</div>
<div className="color999">--%</div>
</span>
<span className="column-1 color-05101A">
<div>--</div>
<div className="color999">--%</div>
</span>
</li>:""}
</div>
</div>
</div>
);
}
}
export default SnackbarHOC() ( TPMIndexHOC ( EcCompletionCalculation ) );

@ -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<neweditcourse.length;j++){
if(neweditcourse[j].weigths===undefined){
newnum=0
}else{
newnum=newnum+neweditcourse[j].weigths;
}
}
newnum= Math.round(newnum*100)/100;
this.setState({
editnum:newnum
})
}
})
.catch(function (error) {
console.log(error);
});
this.setState({
Editkey:key
})
// $("#school_ListTableLine").show();
// let offsettop=$("#school_ListTableLine").position().top||$("#school_ListTableLine").scrollTop || $("#school_ListTableLine").pageYOffset;
// window.scrollTo(0, offsettop)
}
Addcourse=(e)=>{
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<neweditcourse.length;j++){
if(neweditcourse[j].weigths===undefined){
newnum=0
}else{
newnum=newnum+neweditcourse[j].weigths;
}
}
newnum= Math.round(newnum*100)/100;
this.setState({
Supportstype:false,
supportid:null,
Supportslist:"",
editcourse:neweditcourse,
editnum:newnum
})
}
enterweight=(e)=>{
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;j<neweditcourse.length;j++){
if(neweditcourse[j].weigths===undefined){
newnum=newnum+0;
}else if(neweditcourse[j].weigths===""){
newnum=newnum+0;
}else{
newnum=newnum+neweditcourse[j].weigths;
}
}
newnum= Math.round(newnum*100)/100;
this.setState({
editnum:newnum,
editcourse:neweditcourse
})
if(newnum>1){
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<editcourse.length;z++){
if(neweditcourse[z].ec_course_name===`${e[2]}`){
this.setState({
Supportstype:true,
Supportslist:"请勿选择重复的支持课程"
})
return
}
}
for(var i=0;i<1;i++){
neweditcourse[num].ec_course_id=value;
neweditcourse[num].ec_course_name=`${e[2]}`
}
this.editcourse(neweditcourse);
}
relevancetop=(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=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<editcourse.length;p++){
if(editcourse[p].weigths===""){
editcourse[p].weigths=0;
}
if(editcourse[p].ec_course_id===""){
this.setState({
// Supportstype:true,
Supportslist:'保存失败,课程不能为空',
Supportsclass:true
})
return
}
}
var Url = '/ec_course_supports';
axios.post(Url, {
ec_year_id: ec_year_id,
ec_graduation_subitem_id:ec_graduation_subitem_id,
course: editcourse
},
{
withCredentials: true
}
).then((response) => {
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( <span key={i} className="column-1 color-666">
<div style={{lineHeight: '20px'}}>支撑课程
<br/> 权值
</div>
</span>)
}
return res
}
return (
<div className="newMain clearfix">
<Modal
title={titlemessage}
// Supportstype
visible={Supportstype}
className={"ecmodeldelet"}
closable={false}
footer={null}
>
<div className="task-popup-content">
<div className="task-popup-text-center font-14">{Supportslist}</div>
</div>
<div className="task-popup-submit clearfix">
<a onClick={this.hideSupports} className="task-btn fl">取消</a>
{ supportid===null?<a className="task-btn task-btn-orange fr"
onClick={this.hideSupports}
>确定</a>:
<a className="task-btn task-btn-orange fr"
onClick={()=>this.Deletcourse(supportid)}
>确定</a>}
</div>
</Modal>
<div className="educontent mb290">
<EcTitleCourseEvaluations
{...this.props}
schooldata={schooldata}
ecComponentState={ecComponentState}
ecpath={"requirement_vs_courses"}
/>
<div className="edu-back-white eacourse">
<div className="clearfix padding20-30 bor-bottom-greyE" style={{position:'relative'}}>
<span className="font-18 courseSystem">课程体系对毕业要求的支撑</span>
{/* <a href="javascript:void(0)" className="fr white-btn edu-blueback-btn mt4">导出培养目标</a> */}
<span className={data.is_manager===false?"none":"Importclassroomdata"} style={{top: '29px'}}>
<a className="white-btn edu-blueback-btn fr mb10 mr10" target="_blank" href={'/ec_major_schools/'+major_school_id+'/academic_years/'+ec_year_id+'/export_course_requirements?format=xls'}>导出课程体系支撑矩阵</a>
</span>
<div className="color-grey-9 mr10">用矩阵图的形式说明本专业课程体系对毕业要求的支撑关系 <a className={"color-blue"} onClick={() => window.elasticLayer(3534)} >查看详情</a></div>
</div>
<div className="padding20-30" id="training_objective_contents">
<span className="fl SystemParameters" >毕业要求指标点<a href={data.subitems_url}><span className="Systemnum">{data.subitems_count}</span></a></span>
<span className="fl ml20 SystemParameters">课程体系<a href={data.course_url}><span className="Systemnum">{data.course_count}</span></a></span>
</div>
</div>
<div className="ListTableLine" id="school_major_list" style={{overflow:'auto'}}>
<p className="clearfix" style={{width: 120*data.max_support_count>1200? 140*data.max_support_count : 1200+"px"}}>
<span className="color-666 finishtarget">毕业要求指标点</span>
{list(data.max_support_count<5||data.max_support_count===undefined?5:data.max_support_count)}
<span className="column-1 operationright color-666"
style={{
paddingLeft: '28px'
}}
>合计</span>
</p>
<div className="paddingLF" style={{background:'#fff'}}>
{
data.course_support_data===undefined? <Spin delay={500} className="Spinlarge" indicator={<Icon type="loading" style={{ fontSize: 30 }} spin />}/>:data.course_support_data.map((item,key)=>{
return (
<li className={data.course_support_data.length===key+1?"clearfix mb10":"clearfix"} key={key} style={{width: 120*data.max_support_count > 1134 ? 136*data.max_support_count : 1134+"px",margin: '0px 0px'}}>
<Tooltip placement="bottom" title={item.sequence_title}>
<span className="column-1 columnlocation" style={{display:Editkey!=key?"block":'none',width: '95px', paddingLeft: '23px'}}>{item.sequence_num}</span>
</Tooltip>
{
item.course_data.map((t,kes)=>{
return(
<span key={kes} className="column-1"
style={{
display:Editkey!=key?"block":'none',
marginRight: '-1px'
}}>
<div data-tip-down={t.name} className={t.top_relation===true?"DDred columnbox":"columnbox"}
style={{textAlign: 'center'}}
>{t.name.length>12?t.name.substring(0, 10)+"...":t.name}</div>
<div className={t.top_relation===true?"DDred":""}
style={{textAlign: 'center'}}
>{t.weigths}</div>
</span>
)
})
}
<span className="column-1 operationright" style={{display:Editkey!=key?"block":'none',width:'75px'}}>
<div className="operationColumn">
<div className="left">
<div className="width20 columnbox">{item.num_total===0?" ":item.num_total}</div>
<div className="width20">{Math.round(item.weights_total*100)/100===0?" ":(Math.round(item.weights_total*100)/100)}</div>
</div>
<div className="left operationalter">
{data.is_manager===false?"":<a className="editSubentry" data-tip-down="编辑">
<i className="iconfont icon-bianjidaibeijing color-green" id={item.ec_graduation_subitem_id} subindex={item.sequence_num} onClick={this.EditSupportCourse.bind(this,key)}></i>
</a>}
</div>
</div>
</span>
<p className="ListTableLine" id="school_ListTableLine" style={{width: '1134px',display:Editkey===key?"block":'none'}} >
<p className="clearfix SystemModifythelist">
<span className="ml6" style={{width:'77px'}}>指标点 {index}</span>
<span className="column-4">支撑课程</span>
<span className="column-2 ml93">
<span> 权重(=1)</span>
<span className="Systempoint">精确到两位小数</span>
</span>
<span className="column-1 ml50">关联度最高</span>
</p>
<div className="clearfix editorModify">
{
editcourse.map((it,key)=>{
return(
<div className="mb15" key={key}>
<Select className={Supportsclass===true?"bor-red heightimportant":"heightimportant"} showSearch value={it.ec_course_name} onChange={this.handleChange}>
{
ec_courses_list.map((qva,qk)=>{
return(
<Option value={[qva.id,key,qva.name]} key={qk}>{qva.name}</Option>
)
})
}
</Select>
<Input
type="number"
size="large"
className={Supportssum===true?"inputWeight bor-red":"inputWeight"}
id={key}
value={it.weigths}
onInput={this.enterweight.bind(this)}
/>
<div className="SetTheAssociated">
<div className="SetTheAssociatedchild">
<i className="iconfont icon-gouxuan gouxuanbule" style={{display:it.top_relation===false?'none':'block'}} itindex={key} onClick={this.relevancetop.bind(this)}></i>
<i className="iconfont icon-gouxuan gouxuanwhite" style={{display:it.top_relation===false?'block':'none'}} itindex={key} onClick={this.relevancebottom.bind(this)}></i>
</div>
<div className="left operatebutton">
<a className="mr15 delSubentry" data-tip-down="删除">
<i className="iconfont icon-shanchu color-grey-c font-15" onClick={()=>this.Deletcourses(key)}></i>
</a>
<a className="newAddSubentry" data-tip-down="添加"
style={{display:key===editcourse.length-1?"inline-block":'none'}}
><i className="iconfont icon-tianjiafangda color-green" onClick={this.Addcourse}></i></a>
</div>
</div>
</div>
)
})
}
</div>
<span className="c_red none ml35" id="error_tip" style={{display:Supportssum===true||Supportsclass===true?'inline':'none'}}>{Supportslist}</span>
<div className="clearfix editorModify">
<span className="column-1"
style={{
width: '580px',
paddingLeft: '37px',
display: 'inline-block'
}}
>合计: <span>{editcourse.length}</span></span>
<span className="ml30">合计: <span>{editnum}</span></span>
</div>
<div className="right editglybuttonboxs">
<div className="defalutSubmitbtn fr" onClick={this.SubmitClassData}>保存</div>
<div className="defalutCancelbtn fr mr20" onClick={this.CancelSupports}>取消</div>
</div>
</p>
</li>
)
})
}
</div>
</div>
</div>
</div>
);
}
}
export default SnackbarHOC() ( TPMIndexHOC ( ecCourseSupports ) );

@ -0,0 +1,656 @@
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<neweditcourse.length;j++){
if(neweditcourse[j].weigths===undefined){
newnum=0
}else{
newnum=newnum+neweditcourse[j].weigths;
}
}
newnum= Math.round(newnum*100)/100;
this.setState({
editnum:newnum
})
}
})
.catch(function (error) {
console.log(error);
});
this.setState({
Editkey:key
})
// $("#school_ListTableLine").show();
// let offsettop=$("#school_ListTableLine").position().top||$("#school_ListTableLine").scrollTop || $("#school_ListTableLine").pageYOffset;
// window.scrollTo(0, offsettop)
}
Addcourse=(e)=>{
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<neweditcourse.length;j++){
if(neweditcourse[j].weigths===undefined){
newnum=0
}else{
newnum=newnum+neweditcourse[j].weigths;
}
}
newnum= Math.round(newnum*100)/100;
this.setState({
Supportstype:false,
supportid:null,
Supportslist:"",
editcourse:neweditcourse,
editnum:newnum
})
}
enterweight=(e)=>{
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;j<neweditcourse.length;j++){
if(neweditcourse[j].weigths===undefined){
newnum=newnum+0;
}else if(neweditcourse[j].weigths===""){
newnum=newnum+0;
}else{
newnum=newnum+neweditcourse[j].weigths;
}
}
newnum= Math.round(newnum*100)/100;
this.setState({
editnum:newnum,
editcourse:neweditcourse
})
if(newnum>1){
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<editcourse.length;z++){
if(neweditcourse[z].ec_course_name===`${e[2]}`){
this.setState({
Supportstype:true,
Supportslist:"请勿选择重复的支持课程"
})
return
}
}
for(var i=0;i<1;i++){
neweditcourse[num].ec_course_id=value;
neweditcourse[num].ec_course_name=`${e[2]}`
}
this.editcourse(neweditcourse);
}
relevancetop=(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=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<editcourse.length;p++){
if(editcourse[p].weigths===""){
editcourse[p].weigths=0;
}
if(editcourse[p].ec_course_id===""){
this.setState({
// Supportstype:true,
Supportslist:'保存失败,课程不能为空',
Supportsclass:true
})
return
}
}
var Url = '/ec_course_supports';
axios.post(Url, {
ec_year_id: ec_year_id,
ec_graduation_subitem_id:ec_graduation_subitem_id,
course: editcourse
},
{
withCredentials: true
}
).then((response) => {
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( <span key={i} className="column-1 color-666">
<div style={{lineHeight: '20px'}}>支撑课程
<br/> 权值
</div>
</span>)
}
return res
}
return (
<div className="newMain clearfix">
<Modal
title={titlemessage}
// Supportstype
visible={Supportstype}
className={"ecmodeldelet"}
closable={false}
footer={null}
>
<div className="task-popup-content">
<div className="task-popup-text-center font-14">{Supportslist}</div>
</div>
<div className="task-popup-submit clearfix">
<a onClick={this.hideSupports} className="task-btn fl">取消</a>
{ supportid===null?<a className="task-btn task-btn-orange fr"
onClick={this.hideSupports}
>确定</a>:
<a className="task-btn task-btn-orange fr"
onClick={()=>this.Deletcourse(supportid)}
>确定</a>}
</div>
</Modal>
<div className="educontent mb290">
<EcTitleCourseEvaluations
{...this.props}
schooldata={schooldata}
ecComponentState={ecComponentState}
ecpath={"requirement_vs_courses"}
/>
<div className="edu-back-white eacourse">
<div className="clearfix padding20-30 bor-bottom-greyE" style={{position:'relative'}}>
<span className="font-18 courseSystem">课程体系对毕业要求的支撑</span>
{/* <a href="javascript:void(0)" className="fr white-btn edu-blueback-btn mt4">导出培养目标</a> */}
<span className={data.is_manager===false?"none":"Importclassroomdata"} style={{top: '29px'}}>
<a className="white-btn edu-blueback-btn fr mb10 mr10" target="_blank" href={'/ec_major_schools/'+major_school_id+'/academic_years/'+ec_year_id+'/export_course_requirements?format=xls'}>导出课程体系支撑矩阵</a>
</span>
<div className="color-grey-9 mr10">用矩阵图的形式说明本专业课程体系对毕业要求的支撑关系 <a className={"color-blue"} onClick={() => window.elasticLayer(3534)} >查看详情</a></div>
</div>
<div className="padding20-30" id="training_objective_contents">
<span className="fl SystemParameters" >毕业要求指标点<a href={data.subitems_url}><span className="Systemnum">{data.subitems_count}</span></a></span>
<span className="fl ml20 SystemParameters">课程体系<a href={data.course_url}><span className="Systemnum">{data.course_count}</span></a></span>
</div>
</div>
<div className="ListTableLine" id="school_major_list" style={{overflow:'auto'}}>
<p className="clearfix" style={{width: 120*data.max_support_count>1200? 140*data.max_support_count : 1200+"px"}}>
<span className="color-666 finishtarget">毕业要求指标点</span>
{list(data.max_support_count<5||data.max_support_count===undefined?5:data.max_support_count)}
<span className="column-1 operationright color-666"
style={{
paddingLeft: '28px'
}}
>合计</span>
</p>
<div className="paddingLF" style={{background:'#fff'}}>
{
data.course_support_data===undefined? <Spin delay={500} className="Spinlarge" indicator={<Icon type="loading" style={{ fontSize: 30 }} spin />}/>:data.course_support_data.map((item,key)=>{
return (
<li className={data.course_support_data.length===key+1?"clearfix mb10":"clearfix"} key={key} style={{width: 120*data.max_support_count > 1134 ? 136*data.max_support_count : 1134+"px",margin: '0px 0px'}}>
<Tooltip placement="bottom" title={item.sequence_title}>
<span className="column-1 columnlocation" style={{display:Editkey!=key?"block":'none',width: '95px', paddingLeft: '23px'}}>{item.sequence_num}</span>
</Tooltip>
{
item.course_data.map((t,kes)=>{
return(
<span key={kes} className="column-1"
style={{
display:Editkey!=key?"block":'none',
marginRight: '-1px'
}}>
<div data-tip-down={t.name} className={t.top_relation===true?"DDred columnbox":"columnbox"}
style={{textAlign: 'center'}}
>{t.name.length>12?t.name.substring(0, 10)+"...":t.name}</div>
<div className={t.top_relation===true?"DDred":""}
style={{textAlign: 'center'}}
>{t.weigths}</div>
</span>
)
})
}
<span className="column-1 operationright" style={{display:Editkey!=key?"block":'none',width:'75px'}}>
<div className="operationColumn">
<div className="left">
<div className="width20 columnbox">{item.num_total===0?" ":item.num_total}</div>
<div className="width20">{Math.round(item.weights_total*100)/100===0?" ":(Math.round(item.weights_total*100)/100)}</div>
</div>
<div className="left operationalter">
{data.is_manager===false?"":<a className="editSubentry" data-tip-down="编辑">
<i className="iconfont icon-bianjidaibeijing color-green" id={item.ec_graduation_subitem_id} subindex={item.sequence_num} onClick={this.EditSupportCourse.bind(this,key)}></i>
</a>}
</div>
</div>
</span>
<p className="ListTableLine" id="school_ListTableLine" style={{width: '1134px',display:Editkey===key?"block":'none'}} >
<p className="clearfix SystemModifythelist">
<span className="ml6" style={{width:'77px'}}>指标点 {index}</span>
<span className="column-4">支撑课程</span>
<span className="column-2 ml93">
<span> 权重(=1)</span>
<span className="Systempoint">精确到两位小数</span>
</span>
<span className="column-1 ml50">关联度最高</span>
</p>
<div className="clearfix editorModify">
{
editcourse.map((it,key)=>{
return(
<div className="mb15" key={key}>
<Select className={Supportsclass===true?"bor-red heightimportant":"heightimportant"} showSearch value={it.ec_course_name} onChange={this.handleChange}>
{
ec_courses_list.map((qva,qk)=>{
return(
<Option value={[qva.id,key,qva.name]} key={qk}>{qva.name}</Option>
)
})
}
</Select>
<Input
type="number"
size="large"
className={Supportssum===true?"inputWeight bor-red":"inputWeight"}
id={key}
value={it.weigths}
onInput={this.enterweight.bind(this)}
/>
<div className="SetTheAssociated">
<div className="SetTheAssociatedchild">
<i className="iconfont icon-gouxuan gouxuanbule" style={{display:it.top_relation===false?'none':'block'}} itindex={key} onClick={this.relevancetop.bind(this)}></i>
<i className="iconfont icon-gouxuan gouxuanwhite" style={{display:it.top_relation===false?'block':'none'}} itindex={key} onClick={this.relevancebottom.bind(this)}></i>
</div>
<div className="left operatebutton">
<a className="mr15 delSubentry" data-tip-down="删除">
<i className="iconfont icon-shanchu color-grey-c font-15" onClick={()=>this.Deletcourses(key)}></i>
</a>
<a className="newAddSubentry" data-tip-down="添加"
style={{display:key===editcourse.length-1?"inline-block":'none'}}
><i className="iconfont icon-tianjiafangda color-green" onClick={this.Addcourse}></i></a>
</div>
</div>
</div>
)
})
}
</div>
<span className="c_red none ml35" id="error_tip" style={{display:Supportssum===true||Supportsclass===true?'inline':'none'}}>{Supportslist}</span>
<div className="clearfix editorModify">
<span className="column-1"
style={{
width: '580px',
paddingLeft: '37px',
display: 'inline-block'
}}
>合计: <span>{editcourse.length}</span></span>
<span className="ml30">合计: <span>{editnum}</span></span>
</div>
<div className="right editglybuttonboxs">
<div className="defalutSubmitbtn fr" onClick={this.SubmitClassData}>保存</div>
<div className="defalutCancelbtn fr mr20" onClick={this.CancelSupports}>取消</div>
</div>
</p>
</li>
)
})
}
</div>
</div>
</div>
</div>
);
}
}
export default SnackbarHOC() ( TPMIndexHOC ( ecCourseSupports ) );
Loading…
Cancel
Save