评分调整

dev_cs
杨树明 5 years ago
parent 2d9afb5ac8
commit ed9b322893

@ -355,4 +355,10 @@ input{
.editlybuttonbox{
margin-bottom: 30px;
margin-right: 3%;
}
.Importclassroomdata{
top: 30px;
position: absolute;
right: 0px;
}

@ -34,7 +34,13 @@ class CourseSupports extends Component {
Supportslist:'',
Supportssum:false,
Supportsclass:false,
Supportsclasskey:undefined
Supportsclasskey:undefined,
neweditcourse:[{"weights": 0,
"ec_course_name":'',
"top_relation": false,
"ec_course_id":''
}],
max_support_count:0
}
}
@ -58,15 +64,25 @@ class CourseSupports extends Component {
axios.get(url)
.then((response) => {
if(response.status===200){
this.setState({
data:response.data
})
console.log(response.data.graduation_subitems.length)
if(response.data.graduation_subitems.length===0){
this.setState({
Supportstype:true,
data:response.data,
Supportslist:'数据为空,请去毕业要求——>毕业要求指标点分解列表配置数据'
})
}else{
let datas=response.data.graduation_subitems;
let listlength=[]
datas.map((item,key)=>{
listlength.push(item.course_supports.length)
})
let max_support_count=Math.max(...listlength);
this.setState({
max_support_count:max_support_count,
data:response.data
})
}
}
@ -108,7 +124,7 @@ class CourseSupports extends Component {
id=parseInt(id);
let subindex =e.target.getAttribute("subindex");
debugger
// const url = `/ec_course_supports/edit_require_vs_course?subitem_id=`+id
// axios.get(url)
// .then((response) => {
@ -155,14 +171,18 @@ class CourseSupports extends Component {
if(item.course_supports.length>0){
this.setState({
editcourse:item.course_supports,
neweditcourse:item.course_supports,
Editkey:key,
index:subindex,
ec_graduation_subitem_id:id,
})
}else if(item.course_supports.length===0){
this.setState({
editcourse:[{weights: 0,top_relation: false,ec_course_name:'',ec_course_id:''}],
neweditcourse:[{weights: 0,top_relation: false,ec_course_name:'',ec_course_id:''}],
Editkey:key,
index:subindex,
ec_graduation_subitem_id:id,
})
}
@ -197,7 +217,12 @@ class CourseSupports extends Component {
Addcourse=(e)=>{
let {editcourse} =this.state;
let neweditcourse=editcourse;
let arr=new Array();
editcourse.map((item,key)=>{
arr.push(item)
})
let neweditcourse=arr;
let newadd = {weights: 0,top_relation: false,ec_course_name:'',ec_course_id:''};
neweditcourse.push(newadd);
this.setState({
@ -215,29 +240,49 @@ class CourseSupports extends Component {
// 删除
// 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].weights===undefined){
newnum=0
}else{
newnum=newnum+neweditcourse[j].weights;
}
}
newnum= Math.round(newnum*100)/100;
this.setState({
Supportstype:false,
supportid:null,
Supportslist:"",
editcourse:neweditcourse,
editnum:newnum
})
let arr=new Array();
editcourse.map((item,key)=>{
arr.push(item)
})
let neweditcourse=arr;
if(neweditcourse.length>1){
neweditcourse.splice(e,1);
let newnum=0;
for(var j=0;j<neweditcourse.length;j++){
if(neweditcourse[j].weights===undefined){
newnum=0
}else{
newnum=newnum+neweditcourse[j].weights;
}
}
newnum= Math.round(newnum*100)/100;
this.setState({
Supportstype:false,
supportid:null,
Supportslist:"",
editcourse:neweditcourse,
editnum:newnum
})
}else{
this.setState({
// Supportstype:true,
Supportslist:'删除失败,至少保留一个课程',
})
}
}
enterweight=(e)=>{
let {editcourse} = this.state;
let neweditcourse=editcourse;
let arr=new Array();
editcourse.map((item,key)=>{
arr.push(item)
})
let neweditcourse=arr;
var id=e.target.id;
var value=parseFloat(e.target.value);
if(isNaN(value)){
@ -301,9 +346,15 @@ class CourseSupports extends Component {
handleChange=(e)=> {
let {editcourse} = this.state;
let value=`${e[0]}`;
value=parseInt(value)
let neweditcourse=editcourse;
let arr=new Array();
editcourse.map((item,key)=>{
arr.push(item)
})
let neweditcourse=arr;
let value=`${e[0]}`;
value=parseInt(value)
let num=`${e[1]}`;
num=parseInt(num)
@ -327,7 +378,13 @@ class CourseSupports extends Component {
relevancetop=(e)=>{
let {editcourse} = this.state;
let neweditcourse=editcourse;
let arr=new Array();
editcourse.map((item,key)=>{
arr.push(item)
})
let neweditcourse=arr;
let id =e.target.getAttribute("itindex");
for(var i=0;i<1;i++){
neweditcourse[id].top_relation=false;
@ -339,7 +396,11 @@ class CourseSupports extends Component {
relevancebottom=(e)=>{
let {editcourse} = this.state;
let neweditcourse=editcourse;
let arr=new Array();
editcourse.map((item,key)=>{
arr.push(item)
})
let neweditcourse=arr;
let id =e.target.getAttribute("itindex");
for(var i=0;i<1;i++){
neweditcourse[id].top_relation=true;
@ -355,14 +416,20 @@ class CourseSupports extends Component {
this.inputNumberRef.blur();
}
CancelSupports=()=>{
let{editcourse,neweditcourse}=this.state;
//
// console.log(editcourse)
// console.log(neweditcourse)
this.setState({
Editkey:null,
Supportssum:false,
Supportsclass:false,
editcourse:neweditcourse
})
}
SubmitClassData=()=>{
let {editcourse,editnum,ec_graduation_subitem_id,ec_year_id} = this.state;
let {editcourse,editnum,ec_graduation_subitem_id} = this.state;
if(editcourse.length===0){
this.setState({
// Supportstype:true,
@ -409,35 +476,39 @@ class CourseSupports extends Component {
}
})
var Url = '/ec_course_supports';
var Url = `/ec_years/${this.props.match.params.ec_year_id}/graduation_course_supports.json`;
axios.post(Url, {
ec_year_id: ec_year_id,
ec_graduation_subitem_id:ec_graduation_subitem_id,
course: editcourse
},
{
withCredentials: true
graduation_subitem_id :ec_graduation_subitem_id,
course_supports: editcourse
}
).then((response) => {
if(response.data.status===0){
this.setState({
Editkey:null,
Supportslist:response.data.messsage,
Supportstype:true,
Supportssum:false,
Supportsclass:false,
Supportsclasskey:undefined,
})
this.UpdateClassData();
if(response.data.id===ec_graduation_subitem_id){
// this.setState({
// Editkey:null,
// Supportslist:"保存成功",
// Supportstype:true,
// Supportssum:false,
// Supportsclass:false,
// Supportsclasskey:undefined,
// })
this.UpdateClassData();
this.setState({
Editkey:null,
Supportssum:false,
Supportsclass:false,
})
}else if(response.data.status===-1){
this.setState({
Supportslist:"参数错误",
Supportstype:true,
Supportssum:false,
Supportsclass:false,
Supportsclasskey:undefined,
})
// this.setState({
// Supportslist:"参数错误",
// Supportstype:true,
// Supportssum:false,
// Supportsclass:false,
// Supportsclasskey:undefined,
// })
}
}).catch((error) => {
console.log(error)
@ -457,9 +528,37 @@ class CourseSupports extends Component {
Supportslist:"",
})
}
confirmysl(url){
axios.get(url + '?export=true').then((response) => {
if(response.data.status&&response.data.status===-1){
}else if(response.data.status&&response.data.status===-2){
if(response.data.message === "100"){
// 已超出文件导出的上限数量100 ),建议:
this.setState({
DownloadType:true,
DownloadMessageval:100
})
}else {
//因附件资料超过500M
this.setState({
DownloadType:true,
DownloadMessageval:500
})
}
}else {
this.props.showNotification(`正在下载中`);
window.open("/api"+url, '_blank');
}
}).catch((error) => {
console.log(error)
});
}
render() {
const Option = Select.Option;
let {data,ec_courses_list,editcourse,editnum,index,ec_year_id,Supportsclasskey,ecComponentState,hidesupport,supportid,Editkey,titlemessage,Supportstype,Supportslist,Supportssum,Supportsclass,major_school_id} = this.state;
let {max_support_count,data,ec_courses_list,editcourse,editnum,index,ec_year_id,Supportsclasskey,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++) {
@ -472,6 +571,11 @@ class CourseSupports extends Component {
return res
}
let toptiebox={width: 126.6*max_support_count+"px"};
let ismidbox={width:123.82*max_support_count+"px",margin:'0px 0px'};
console.log(this.props)
return (
<div className="newMain clearfix">
<Modal
@ -497,7 +601,7 @@ class CourseSupports extends Component {
</Modal>
<div className="educontent mb290">
<div className="educontent mb20">
@ -506,8 +610,10 @@ class CourseSupports extends Component {
<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>
<a className="white-btn edu-blueback-btn fr mb10 mr10" onClick={()=>this.confirmysl(`/ec_years/${this.props.match.params.ec_year_id}/graduation_course_supports.xlsx`)}>导出课程体系支撑矩阵</a>
</span>
<div className="color-grey-9 mr10">用矩阵图的形式说明本专业课程体系对毕业要求的支撑关系 <a className={"color-blue"} onClick={() => window.elasticLayer(3534)} >查看详情</a></div>
@ -521,9 +627,9 @@ class CourseSupports extends Component {
<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"}}>
<p className="clearfix" style={toptiebox}>
<span className="color-666 finishtarget">毕业要求指标点</span>
{list(data.max_support_count<5||data.max_support_count===undefined?5:data.max_support_count)}
{list(max_support_count<5||max_support_count===undefined?5:max_support_count)}
<span className="column-1 operationright color-666"
style={{
paddingLeft: '28px'
@ -535,7 +641,7 @@ class CourseSupports extends Component {
data.graduation_subitems===undefined? <Spin delay={500} className="Spinlarge" indicator={<Icon type="loading" style={{ fontSize: 30 }} spin />}/>:data.graduation_subitems.map((item,key)=>{
return (
<li className={data.graduation_subitems.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'}}>
<li className={data.graduation_subitems.length===key+1?"clearfix mb10":"clearfix"} key={key} style={ismidbox}>
<Tooltip placement="bottom" title={item.sequence_title}>
<span className="column-1 columnlocation" style={{display:Editkey!=key?"block":'none',width: '95px', paddingLeft: '23px'}}>{item.graduation_requirement_position+"-"+item.position}</span>
</Tooltip>
@ -550,7 +656,7 @@ class CourseSupports extends Component {
display:Editkey!=key?"block":'none',
marginRight: '-1px'
}}>
<div data-tip-down={t.ec_course_name} className={t.top_relation===true?"DDred columnbox":"columnbox"}
<div title={t.ec_course_name} className={t.top_relation===true?"DDred columnbox":"columnbox"}
style={{textAlign: 'center'}}
>{t.ec_course_name.length>12?t.ec_course_name.substring(0, 10)+"...":t.ec_course_name}</div>
<div className={t.top_relation===true?"DDred":""}
@ -569,27 +675,34 @@ class CourseSupports extends Component {
<div className="width20">{Math.round(item.weights_total*100)/100===0?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.graduation_requirement_position+"-"+item.position} onClick={this.EditSupportCourse.bind(this,key)}></i>
{data.is_manager===false?"":<a className="editSubentry" title="编辑">
<i className="iconfont icon-bianjidaibeijing color-green" id={item.id} subindex={item.graduation_requirement_position+"-"+item.position} 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">
<style>
{
`
.ListTableLine li{ background: rgb(255, 255, 255);}
`
}
</style>
{Editkey===key?
<p className="ListTableLine" id="school_ListTableLine" style={ismidbox} >
<div style={{width: '1134px'}}>
<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>
<span className="column-1 ml50">关联度最高</span>
</p>
<div className="clearfix editorModify">
<div className="clearfix editorModify">
{Supportsclass===true?<style>
{
`
@ -599,77 +712,75 @@ class CourseSupports extends Component {
`
}
</style>:""}
{
editcourse.map((it,key)=>{
return(
<div className="mb15" key={key}>
<Select className={Supportsclasskey===key?"showredfont 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={[qva.id,key,qva.name]}>{qva.name}</Option>
)
})
}
</Select>
<Input
type="number"
size="large"
className={Supportssum===true?"inputWeight bor-red":"inputWeight"}
id={key}
value={it.weights}
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 color-red" id="error_tip" style={{display:Supportssum===true||Supportsclass===true?'inline':'none'}}>{Supportslist}</span>
<div className="clearfix editorModify">
{
editcourse.map((it,key)=>{
return(
<div className="mb15" key={key}>
<Select className={Supportsclasskey===key?"showredfont 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={[qva.id,key,qva.name]}>{qva.name}</Option>
)
})
}
</Select>
<Input
type="number"
size="large"
className={Supportssum===true?"inputWeight bor-red":"inputWeight"}
id={key}
value={it.weights}
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">
{editcourse.length===1?"":<a className="mr15 delSubentry" title="删除">
<i className="iconfont icon-shanchu color-grey-c font-15" onClick={()=>this.Deletcourses(key)}></i>
</a>}
<a className="newAddSubentry" title="添加"
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 color-red" 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 editlybuttonbox">
<div className="defalutSubmitbtn fr" onClick={this.SubmitClassData}>保存</div>
<div className="defalutCancelbtn fr mr20" onClick={this.CancelSupports}>取消</div>
</div>
</p>
style={{
width: '580px',
paddingLeft: '37px',
display: 'inline-block'
}}
>合计: <span>{editcourse.length}</span></span>
<span className="ml30">合计: <span>{editnum}</span></span>
</div>
<div className="right editlybuttonbox">
<div className="defalutSubmitbtn fr" onClick={this.SubmitClassData}>保存</div>
<div className="defalutCancelbtn fr mr20" onClick={this.CancelSupports}>取消</div>
</div>
</div>
</p>:""}
</li>
)
})

@ -14,13 +14,7 @@ import UpgradeModals from '../modals/UpgradeModals';
import { SnackbarHOC , getImageUrl, configShareForIndex} from 'educoder';
import Slider from '@icedesign/base/lib/slider';
import '@icedesign/base/lib/slider/style.js';
import Rating from '@icedesign/base/lib/rating';
import '@icedesign/base/lib/rating/style.js';
import { Slider ,Rating} from "@icedesign/base";
import './home.css';

@ -6,7 +6,7 @@ import {BrowserRouter as Router, Route, Link, Switch} from "react-router-dom";
// import "antd/dist/antd.css";
import Rating from '@icedesign/base/lib/rating';
import { Rating } from "@icedesign/base";
import axios from 'axios';

@ -10,19 +10,13 @@ import classNames from 'classnames';
import {getImageUrl,setImagesUrl, toPath} from 'educoder';
import { Spin,Icon } from 'antd';
import { Rating ,Pagination} from "@icedesign/base";
import 'antd/lib/pagination/style/index.css';
import './shixunCss/shixunCard.css';
import Rating from '@icedesign/base/lib/rating';
import Pagination from '@icedesign/base/lib/pagination';
// 引入业务组件样式
import '@icedesign/base/lib/pagination/style.js';
import '@icedesign/base/lib/rating/style.js';
import { Tooltip } from 'antd';

Loading…
Cancel
Save