Merge branches 'dev_aliyun' and 'dev_ec' of https://bdgit.educoder.net/Hjqreturn/educoder into dev_aliyun

dev_ec
杨树明 5 years ago
commit 00d8eea156

@ -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: "source-map", // 开启调试
devtool: "source-map", // 开启调试
// 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.

@ -22,14 +22,14 @@ let hashTimeout
// TODO 开发期多个身份切换
let debugType =""
if (isDev) {
const _search = window.location.search;
let parsed = {};
if (_search) {
parsed = queryString.parse(_search);
}
debugType = window.location.search.indexOf('debug=t') != -1 ? 'teacher' :
window.location.search.indexOf('debug=s') != -1 ? 'student' :
window.location.search.indexOf('debug=a') != -1 ? 'admin' : parsed.debug || 'admin'
const _search = window.location.search;
let parsed = {};
if (_search) {
parsed = queryString.parse(_search);
}
debugType = window.location.search.indexOf('debug=t') != -1 ? 'teacher' :
window.location.search.indexOf('debug=s') != -1 ? 'student' :
window.location.search.indexOf('debug=a') != -1 ? 'admin' : parsed.debug || 'admin'
}
window._debugType = debugType;
export function initAxiosInterceptors(props) {
@ -217,7 +217,7 @@ function initOnlineOfflineListener() {
description:
'网络恢复正常,感谢使用。',
})
});
});
$(window).bind("offline", () => {
notification.destroy()

@ -0,0 +1,124 @@
import React, { Component } from 'react';
import classNames from 'classnames'
import axios from 'axios';
import { Table, Divider, Tag, Checkbox, InputNumber, Spin, Icon, Tooltip } from 'antd';
class SelectTable extends Component {
constructor(props) {
super(props)
this.state={
}
}
componentDidMount(){
}
render() {
const { match, columns, tableData } = this.props
if (!tableData || !tableData.length) return '';
return (
<table className="edu-pop-table-all edu-txt-center color-grey-6 interval-td" cellspacing="0" cellpadding="0">
<tbody>
<tr>
{columns.map((item, index) => {
if (index == 0) return <td className="gaugeOutfit"><span>{columns[0][0]}</span><span>{columns[0][1]}</span></td>;
return (
<Tooltip title={item}>
<td >{this.props.columnName || '目标'}{index}</td>
</Tooltip>
)
})}
{/* <td data-tip-down=";">1</td>
<td data-tip-down="掌握计算机系统的分析和设计的基本方法;">目标2</td>
<td data-tip-down="具有研究开发计算机软、硬件的基本能力;">目标3</td>
<td data-tip-down="了解计算机科学与技术的发展动态;">目标4</td>
<td data-tip-down="掌握文献检索、资料查询的基本方法,具有获取信息的能力。">目标5</td> */}
</tr>
{ tableData.map((item, rowIndex) => {
const cells = item.map((cell, colIndex) => {
// placement="bottom"
if(colIndex == 0) return <Tooltip title={cell}>
<td >指标点{this.props.firstColIndexArray ? this.props.firstColIndexArray[rowIndex] : rowIndex + 1}</td>
</Tooltip>
return (<Tooltip title={!!cell ? '取消支撑' : '选择支撑'} >
<td onClick={() => this.props.onCellClick(rowIndex, colIndex , !!cell)}>
<i className={`iconfont icon-gouxuan ${!!cell ? 'color-green' : 'color-grey-eb'} font-16 mr5`}></i>
</td>
</Tooltip>)
})
return (
<tr className="sustainLine editTd">
{cells}
</tr>
)
})}
{/* <tr className="sustainLine editTd">
<td data-tip-down="工程知识能够将数学、自然科学、工程基础和专业知识用于解决复杂工程问题。1212">指标点1</td>
<td data-tip-down="取消支撑" data-req-id="77" data-to-id="80">
<i className="iconfont icon-gouxuan color-green font-16 mr5"></i>
</td>
<td data-tip-down="选择支撑" data-req-id="77" data-to-id="81">
<i className="iconfont icon-gouxuan color-grey-eb font-16 mr5"></i>
</td>
<td data-tip-down="选择支撑" data-req-id="77" data-to-id="82">
<i className="iconfont icon-gouxuan color-grey-eb font-16 mr5"></i>
</td>
<td data-tip-down="取消支撑" data-req-id="77" data-to-id="83">
<i className="iconfont icon-gouxuan color-green font-16 mr5"></i>
</td>
<td data-tip-down="取消支撑" data-req-id="77" data-to-id="84">
<i className="iconfont icon-gouxuan color-green font-16 mr5"></i>
</td>
</tr> */}
{/* <tr className="sustainLine editTd">
<td data-tip-down="具有识别、表达、分析复杂工程问题并得出有效结论的能力。">指标点2</td>
<td data-tip-down="选择支撑" data-req-id="78" data-to-id="80">
<i className="iconfont icon-gouxuan color-grey-eb font-16 mr5"></i>
</td>
<td data-tip-down="选择支撑" data-req-id="78" data-to-id="81">
<i className="iconfont icon-gouxuan color-grey-eb font-16 mr5"></i>
</td>
<td data-tip-down="选择支撑" data-req-id="78" data-to-id="82">
<i className="iconfont icon-gouxuan color-grey-eb font-16 mr5"></i>
</td>
<td data-tip-down="选择支撑" data-req-id="78" data-to-id="83">
<i className="iconfont icon-gouxuan color-grey-eb font-16 mr5"></i>
</td>
<td data-tip-down="选择支撑" data-req-id="78" data-to-id="84">
<i className="iconfont icon-gouxuan color-grey-eb font-16 mr5"></i>
</td>
</tr>
<tr className="sustainLine editTd">
<td data-tip-down="具备设计和开发针对复杂工程问题的解决方案的能力。">指标点3</td>
<td data-tip-down="选择支撑" data-req-id="79" data-to-id="80">
<i className="iconfont icon-gouxuan color-grey-eb font-16 mr5"></i>
</td>
<td data-tip-down="选择支撑" data-req-id="79" data-to-id="81">
<i className="iconfont icon-gouxuan color-grey-eb font-16 mr5"></i>
</td>
<td data-tip-down="取消支撑" data-req-id="79" data-to-id="82">
<i className="iconfont icon-gouxuan color-green font-16 mr5"></i>
</td>
<td data-tip-down="选择支撑" data-req-id="79" data-to-id="83">
<i className="iconfont icon-gouxuan color-grey-eb font-16 mr5"></i>
</td>
<td data-tip-down="选择支撑" data-req-id="79" data-to-id="84">
<i className="iconfont icon-gouxuan color-grey-eb font-16 mr5"></i>
</td>
</tr> */}
</tbody>
</table>
);
}
}
export default (SelectTable) ;

@ -0,0 +1,163 @@
import React, { Component } from 'react';
import classNames from 'classnames'
import axios from 'axios';
import { Table, Divider, Tag, Checkbox, InputNumber, Spin, Icon } from 'antd';
import SelectTable from './SelectTable'
import update from 'immutability-helper'
const testState = {
"graduation_requirements": [
{
"id": 1,
"position": 1,
"content": "毕业要求一"
},
{
"id": 2,
"position": 2,
"content": "毕业要求二"
}
],
"training_subitems": [
{
"id": 1,
"content": "培养目标一"
},
{
"id": 2,
"content": "培养目标二"
}
],
"requirement_support_objectives": [
{
"graduation_requirement_id": 1,
"training_subitem_id": 1
},
{
"graduation_requirement_id": 2,
"training_subitem_id": 2
},
]
}
class RequirementVsObjective extends Component {
constructor(props) {
super(props)
this.state={
// ...testState
}
}
componentDidMount(){
// this.init()
// return;
const yearId = this.props.match.params.yearId
const url = `/ec_years/${yearId}/requirement_support_objectives.json`
axios.get(url).then((response) => {
if (response.data.graduation_requirements) {
this.setState( {...response.data} , () => {
this.init()
})
}
}).catch((e) => {
})
}
init = () => {
this.graduationRequirementsIdIndexMap = {}
this.trainingSubitemsIdIndexMap = {}
this.state.graduation_requirements.forEach((item, index) => {
this.graduationRequirementsIdIndexMap[item.id] = index
})
this.state.training_subitems.forEach((item, index) => {
// 对应table的列数
this.trainingSubitemsIdIndexMap[item.id] = index + 1
})
const tableData = []
this.state.graduation_requirements.forEach((item, index) => {
tableData.push([item.content, ...Array(this.state.training_subitems.length)])
})
this.state.requirement_support_objectives.forEach(item => {
tableData[this.graduationRequirementsIdIndexMap[item.graduation_requirement_id]][this.trainingSubitemsIdIndexMap[item.training_subitem_id]]
= true
})
this.setState({ tableData })
}
onCellClick = (rowIndex, colIndex, select) => {
console.log( rowIndex, colIndex, select )
const ec_graduation_requirement_id = this.state.graduation_requirements[rowIndex].id
const ec_training_subitem_id = this.state.training_subitems[colIndex - 1].id
const yearId = this.props.match.params.yearId
const url = `/ec_years/${yearId}/requirement_support_objectives.json`
const method = select ? axios.delete : axios.post
method(url,
select ? {
params: {
ec_graduation_requirement_id,
ec_training_subitem_id
}
} : {
ec_graduation_requirement_id,
ec_training_subitem_id
}
).then((response) => {
if (response.data.status == 0) {
this.setState(
(prevState) => ({
tableData : update(prevState.tableData, {[rowIndex]: {[colIndex]: {$set: select ? false : true}}})
})
)
this.props.showNotification(`${select ? '取消' : '选择'}成功`)
}
}).catch((e) => {
})
if (select) { // 取消
} else { // 选择
}
}
render() {
const { match, history, current_user } = this.props
const { tableData, training_subitems, graduation_requirements, is_manager } = this.state
const columns = training_subitems && [['毕业要求', '培养目标'], ...training_subitems.map(item => item.content)]
const columnIdIndexMap = {}
console.log(columns, tableData)
return (
<div className="educontent requirementVsObjective" style={{ background: '#fff' }}>
<ul className="clearfix padding20-30 bor-bottom-greyE backgroundFFF"
style={{ 'marginBottom': '0px' }} >
<li className="fl">
<p className="font-18 courseSystem"> 毕业要求对培养目标的支撑 </p>
<p>
<span className="color-grey-9 mr10">用矩阵图的形式说明本专业毕业要求对培养目标的支撑关系鼠标左键单击单元格即可</span>
<a href="javascript:void(0)" onClick={() => window.elasticLayer(3531)} className="color-blue">查看详情</a>
</p>
</li>
<a href={`/api/ec_years/${this.props.yearId}/requirement_support_objectives.xlsx`} target="_blank"
className="ant-btn ant-btn-primary color-white fr mt20">导出矩阵</a>
</ul>
<div className="padding20-30" style={{ background: '#fff' }}>
<p className="clearfix mb20">
<span className="fl mr30"><i className="iconfont icon-gouxuan color-green font-16 mr5"></i></span>
<span className="fl"><i className="iconfont icon-gouxuan color-grey-eb font-16 mr5"></i></span>
</p>
<SelectTable
columns={columns}
tableData={tableData}
onCellClick={this.onCellClick}
></SelectTable>
</div>
</div>
);
}
}
export default (RequirementVsObjective) ;

@ -0,0 +1,134 @@
import React, { Component } from 'react';
import classNames from 'classnames'
import axios from 'axios';
import { Table, Divider, Tag, Checkbox, InputNumber, Spin, Icon } from 'antd';
import SelectTable from '../RequirementVsObjective/SelectTable'
import update from 'immutability-helper'
class RequirementVsObjective extends Component {
constructor(props) {
super(props)
this.state={
}
}
componentDidMount(){
// this.init()
// return;
const yearId = this.props.match.params.yearId
const url = `/ec_years/${yearId}/subitem_support_standards.json`
axios.get(url).then((response) => {
if (response.data.graduation_subitems) {
this.setState( {...response.data} , () => {
this.init()
})
}
}).catch((e) => {
})
}
init = () => {
this.graduationRequirementsIdIndexMap = {}
this.trainingSubitemsIdIndexMap = {}
this.state.graduation_subitems.forEach((item, index) => {
this.graduationRequirementsIdIndexMap[item.id] = index
})
this.state.graduation_standards.forEach((item, index) => {
// 对应table的列数
this.trainingSubitemsIdIndexMap[item.id] = index + 1
})
const tableData = []
const firstColIndexArray = []
this.state.graduation_subitems.forEach((item, index) => {
tableData.push([item.content, ...Array(this.state.graduation_standards.length)])
firstColIndexArray.push(`${item.position}-${item.graduation_requirement_position}`)
})
this.state.subitem_support_standards.forEach(item => {
tableData[this.graduationRequirementsIdIndexMap[item.graduation_subitem_id]][this.trainingSubitemsIdIndexMap[item.graduation_standard_id]]
= true
})
this.setState({ tableData, firstColIndexArray })
}
onCellClick = (rowIndex, colIndex, select) => {
console.log( rowIndex, colIndex, select )
const ec_graduation_subitem_id = this.state.graduation_subitems[rowIndex].id
const ec_graduation_standard_id = this.state.graduation_standards[colIndex - 1].id
const yearId = this.props.match.params.yearId
const url = `/ec_years/${yearId}/subitem_support_standards.json`
const method = select ? axios.delete : axios.post
method(url,
select ? {
params: {
ec_graduation_subitem_id,
ec_graduation_standard_id
}
} : {
ec_graduation_subitem_id,
ec_graduation_standard_id
}
).then((response) => {
if (response.data.status == 0) {
this.setState(
(prevState) => ({
tableData : update(prevState.tableData, {[rowIndex]: {[colIndex]: {$set: select ? false : true}}})
})
)
this.props.showNotification(`${select ? '取消' : '选择'}成功`)
}
}).catch((e) => {
})
if (select) { // 取消
} else { // 选择
}
}
render() {
const { match, history, current_user } = this.props
const { tableData, graduation_standards, graduation_subitems, is_manager, firstColIndexArray } = this.state
const columns = graduation_standards && [['毕业要求', '通用标准'], ...graduation_standards.map(item => item.content)]
const columnIdIndexMap = {}
console.log(columns, tableData)
return (
<div className="educontent requirementVsObjective" style={{ background: '#fff' }}>
<ul className="clearfix padding20-30 bor-bottom-greyE backgroundFFF"
style={{ 'marginBottom': '0px' }} >
<li className="fl">
<p className="font-18 courseSystem"> 毕业要求对通用标准的支撑 </p>
<p>
<span className="color-grey-9 mr10">用矩阵图的形式说明本专业毕业要求对12项通用标准的覆盖关系鼠标左键单击单元格即可</span>
<a href="javascript:void(0)" onClick={() => window.elasticLayer(3532)} className="color-blue">查看详情</a>
</p>
</li>
<a href={`/api/ec_years/${this.props.yearId}/subitem_support_standards.xlsx`} target="_blank"
className="ant-btn ant-btn-primary color-white fr mt20">导出矩阵</a>
</ul>
<div className="padding20-30" style={{ background: '#fff' }}>
<p className="clearfix mb20">
<span className="fl mr30"><i className="iconfont icon-gouxuan color-green font-16 mr5"></i></span>
<span className="fl"><i className="iconfont icon-gouxuan color-grey-eb font-16 mr5"></i></span>
</p>
<SelectTable
columns={columns}
tableData={tableData}
columnName="标准"
onCellClick={this.onCellClick}
firstColIndexArray={firstColIndexArray}
></SelectTable>
</div>
</div>
);
}
}
export default (RequirementVsObjective) ;

@ -19,6 +19,11 @@ const Curriculum=Loadable({
loader: () => import('../../../modules/ecs/curriculum/Curriculum'),
loading: Loading,
});
const CurriculumSubpage=Loadable({
loader: () => import('../../../modules/ecs/curriculum/CurriculumSubpage'),
loading: Loading,
});
const TrainingObjective=Loadable({
loader: () => import('./TrainingObjective/index'),
loading: Loading,
@ -31,6 +36,19 @@ const CourseSupports=Loadable({
loader: () => import('./CourseSupports/index'),
loading: Loading,
});
const ReachCalculationInfo=Loadable({
loader: () => import('./reachCalculationInfo/index'),
loading: Loading,
});
const RequirementVsObjective=Loadable({
loader: () => import('./RequirementVsObjective/index'),
loading: Loading,
});
const RequirementVsStandard=Loadable({
loader: () => import('./RequirementVsStandard/index'),
loading: Loading,
});
class EcSetting extends React.Component {
constructor (props) {
@ -65,11 +83,11 @@ class EcSetting extends React.Component {
let type = stepTypes[stepIndex];
this.setState({ stepIndex: stepIndex });
if(type==="courses"){
this.props.history.push(`/ecs/major_schools/${majorId}/years/${yearId}/${type}/ec_course_support_setting/1`);
}else {
// if(type==="courses"){
// this.props.history.push(`/ecs/major_schools/${majorId}/years/${yearId}/${type}/ec_course_support_setting/1`);
// }else {
this.props.history.push(`/ecs/major_schools/${majorId}/years/${yearId}/${type}`);
}
// }
}
setupStep = () => {
@ -122,20 +140,32 @@ class EcSetting extends React.Component {
render={ (props) => (<TrainingObjective {...this.props} {...props} {...this.state} />) }></Route>
<Route extra path='/ecs/major_schools/:majorId/years/:yearId/graduation_requirement'
render={ (props) => (<GraduationRequirement {...this.props} {...props} {...this.state} />) }></Route>
<Route extra path='/ecs/major_schools/:majorId/years/:yearId/graduation_requirement'
render={ (props) => (<GraduationRequirement {...this.props} {...props} {...this.state} />) }></Route>
{/* 毕业要求对培养目标的支撑 */}
<Route extra path='/ecs/major_schools/:majorId/years/:yearId/requirement_vs_objective'
render={ (props) => (<RequirementVsObjective {...this.props} {...props} {...this.state} />) }></Route>
{/* 毕业要求对通用标准的支撑 */}
<Route extra path='/ecs/major_schools/:majorId/years/:yearId/requirement_vs_standard'
render={ (props) => (<RequirementVsStandard {...this.props} {...props} {...this.state} />) }></Route>
{/*学生*/}
<Route extra path='/ecs/major_schools/:majorId/years/:yearId/students'
render={ (props) => (<EcStudentList {...this.props} {...props} {...this.state} />) }></Route>
{/*课程体系*/}
<Route extra path='/ecs/major_schools/:majorId/years/:yearId/courses'
<Route extra path='/ecs/major_schools/:majorId/years/:yearId/courses/subpage'
render={ (props) => (<Curriculum {...this.props} {...props} {...this.state} />) }></Route>
{/*课程体系资源子页面Subpage*/}
<Route extra path='/ecs/major_schools/:majorId/years/:yearId/courses'
render={ (props) => (<CurriculumSubpage {...this.props} {...props} {...this.state} />) }></Route>
{/*课程体系VS毕业要求*/}
<Route extra path='/ecs/major_schools/:major_school_id/years/:ec_year_id/requirement_vs_courses'
render={ (props) => (<CourseSupports {...this.props} {...props} {...this.state} />) }></Route>
{/*达成度评价结果*/}
<Route extra path='/ecs/major_schools/:major_school_id/years/:ec_year_id/reach_calculation_info'
render={ (props) => (<ReachCalculationInfo {...this.props} {...props} {...this.state} />) }></Route>
</Switch>
)
}

File diff suppressed because one or more lines are too long

@ -0,0 +1,74 @@
.newMain {
height: 100%;
}
.contentWrap {
height: 100%;
overflow: auto;
}
.bor-bottom-greyE {
border-bottom: 1px solid #EEEEEE!important;
}
.padding20-30 {
padding: 20px 30px;
box-sizing: border-box;
}
.clearfix {
clear: both;
zoom: 1;
}
.bor-bottom-greyE {
border-bottom: 1px solid #EEEEEE!important;
}
.courseSystem, .SystemParameters {
font-family: MicrosoftYaHei;
font-weight: 400;
line-height: 45px;
}
.courseSystem {
font-size: 18px;
color: #05101a;
}
.font-18 {
font-size: 18px!important;
}
.fl {
float: left!important;
}
.backgroundFFF{
background: #FFF;
}
.ant-table-body table thead tr th{
background: #FFF;
}
.ant-table-body table .ant-table-thead :nth-child(1) th{
border-right: 1px solid #e8e8e8;
}
.ant-table-body table .ant-table-thead :nth-child(1) :nth-child(4){
/* border-right: 1px solid transparent; */
}
.ant-table-body table .ant-table-thead :nth-child(2) th{
border-top: 1px solid #e8e8e8;
border-right: 1px solid #e8e8e8;
}
.ant-table-bordered .ant-table-thead > tr > th, .ant-table-bordered .ant-table-tbody > tr > td {
text-align: center;
}
.graduatesRequirement .ant-table-wrapper {
padding: 20px 10px;
background: #fff;
margin-top: -16px;
margin-bottom: 40px;
}
.graduatesRequirement .ant-table-thead > tr.ant-table-row-hover:not(.ant-table-expanded-row) > td,
.graduatesRequirement .ant-table-tbody > tr.ant-table-row-hover:not(.ant-table-expanded-row) > td,
.graduatesRequirement .ant-table-thead > tr:hover:not(.ant-table-expanded-row) > td,
.graduatesRequirement .ant-table-tbody > tr:hover:not(.ant-table-expanded-row) > td {
background: transparent !important;
}
.mt60{
margin-top:60px;
}

@ -9,6 +9,61 @@ const Home = CustomLoadable(() => import('./Home/index'));
const EcYear = CustomLoadable(() => import('./EcYear/index'));
const EcSetting = CustomLoadable(() => import('./EcSetting/index'));
const $ = window.$
//工程认证各个页面的查看详情弹层
function elasticLayer(forumId){
if (window.__memo) {
doElasticLayer(window.__memo, true)
return;
}
if (!forumId) return;
var url = 'https://www.educoder.net/api/memos/' + forumId
$.ajax({
url: url,
type: 'get',
success: function(res) {
console.log(res)
doElasticLayer(res.memo)
}
});
// document.body.addEventListener('touchmove',bodyScroll,false);
// $('body').css({'position':'fixed',"width":"100%"});
}
function doElasticLayer(memo, rendered){
if (rendered) {
$(".layerContent").show();
$(".newMain").hide();
return;
}
window.__memo = memo
var content = memo.content
var subject = memo.subject
var html='<div class="layerContent"><div class="educontent">' +
'<p class="clearfix pt25 pb25 color-grey-3 bor-bottom-greyE"><span class="fl font-24">'+ subject +'</span>' +
'<a href="javascript:void(0)" onclick="removeElasticLayer();" class="fr font-16 mt5">返回</a></p>' +
'<div id="MDContent"><textarea style="display:none">'
+ content +
'</textarea></div>'
$(".newMain").after(html).hide();
editormd.markdownToHTML("MDContent", {
htmlDecode: "style,script,iframe", // you can filter tags decode
taskList: true,
tex: true, // 默认不解析
flowChart: true, // 默认不解析
sequenceDiagram: true // 默认不解析
});
}
function removeElasticLayer(){
$(".layerContent").hide();
$(".newMain").show();
}
window.elasticLayer = elasticLayer
window.doElasticLayer = doElasticLayer
window.removeElasticLayer = removeElasticLayer
class Ecs extends React.Component {
render() {

@ -0,0 +1,91 @@
import React, { Component } from 'react';
import { Modal } from 'antd';
export function ECModalHOC(options = {}) {
return function wrap(WrappedComponent) {
return class Wrapper extends Component {
constructor(props) {
super(props);
this.state = {
titlemessage: '',
Modallist: false,
Modallisttype: false,
singleButton: false
}
}
// 全局的modal this.props.showModal 调用即可
showModal = (title, content, okCallback) => {
this.okCallback = okCallback;
this.setState({
titlemessage: title,
Modallist: content,
Modallisttype: true,
singleButton: false,
})
}
showSingleButtonModal = (title, content) => {
this.setState({
titlemessage: title,
Modallist: content,
Modallisttype: true,
singleButton: true,
})
}
onCancel = () => {
this.setState({
Modallisttype:false
})
}
hidemodeldelete = () => {
if (this.okCallback) {
this.okCallback()
}
this.onCancel()
}
render() {
const { titlemessage, Modallisttype, Modallist, singleButton } = this.state;
return (
<React.Fragment>
<Modal
title={titlemessage}
// visible={modeldelet===true&&listid===list.id?true:false}
visible={Modallisttype}
className={"ecmodeldelet"}
closable={false}
footer={null}
>
<div className="task-popup-content" >
<div className="task-popup-text-center font-14">{Modallist}</div>
</div>
{ singleButton ? <div className="task-popup-submit clearfix"
style={{ textAlign: 'center' }}>
<a className="task-btn task-btn-orange"
onClick={this.onCancel}
>知道啦</a>
</div> : <div className="task-popup-submit clearfix">
<a onClick={this.onCancel} className="task-btn fl">取消</a>
<a className="task-btn task-btn-orange fr"
onClick={this.hidemodeldelete}
>确定</a>
</div> }
</Modal>
<WrappedComponent {...this.props}
showModal={ this.showModal }
showSingleButtonModal={ this.showSingleButtonModal }
>
</WrappedComponent>
</React.Fragment>
)
}
}
}
}

@ -9,7 +9,12 @@
font-family:MicrosoftYaHei;
font-weight:400;
color:#05101A !important;
}
.marginleft76{
margin-left: 76px;
}
#SystemParameters{
height: 81px;
line-height: 40px;
@ -160,6 +165,9 @@ input{
margin-left: 8px;
padding-left: 25px !important;
}
.percentages{
margin-left: 8px;
}
.Coursetitle{
margin-bottom:0px !important;
}
@ -167,6 +175,11 @@ input{
padding-left: 30px !important;
width: 70px !important;
}
.textaligncenters{
width: 133px !important;
display: block;
float: left;
}
.ml72{
margin-left:72px;
}
@ -213,6 +226,10 @@ input{
width: 589px !important;
display: inline-block;
}
.evaluationdataClassy{
width: 589px !important;
display: inline-block;
}
.absolute{
position:absolute;
}
@ -246,12 +263,22 @@ input{
padding: 10px 0px !important;
margin: 0px 20px !important;
}
.newSystem .newtarget_scoreclassysl{
padding: 10px 0px !important;
}
.mynewtarget_scoreclassysls{
padding: 10px 20px!important;
}
.newSystem .newtarget_target{
padding: 10px 0px !important;
margin: 0px 30px !important;
border-bottom:1px solid transparent !important;
}
.newSystem .newtarget_targets{
padding: 10px 0px !important;
border-bottom:1px solid transparent !important;
}
.nowrap329{
max-width: 329px !important;
@ -263,9 +290,9 @@ input{
min-width: 329px !important;
}
.ListTableLine li>.column-500{
max-width: 360px !important;
max-width: 366px !important;
text-align: left;
min-width: 360px !important;
min-width: 366px !important;
}
.color-666{
color:#666666 !important;

@ -234,6 +234,10 @@ input{
.color-05101A{
color:#05101A !important;
}
/*边框*/
bordertopsolid{
border:1px solid #000;
}
.ec_graduation_name{
margin-right:20px !important;
}

@ -36,7 +36,10 @@ const EcCompletionCalculation =Loadable({
loader: () => import('../subroute/ecCompletion_calculation/EcCompletionCalculation'),
loading: Loading,
});
const EcCourseSupportSetting =Loadable({
loader: () => import('../subroute/ecCourseSupportSetting/index'),
loading: Loading,
});
class Curriculum extends Component {
//课程体系
@ -56,6 +59,7 @@ class Curriculum extends Component {
// window.document.title = '课程达成评价结果';
}
componentDidMount(){
console.log("Curriculum");
console.log(this.props);
}
sync_course_data=()=>{
@ -91,7 +95,16 @@ class Curriculum extends Component {
// })
}
bindRef = ref => {
console.log(ref);
// console.log("调用了子对象1");
this.child = ref
};
newrightcalculatebuttonysl=(child)=>{
// console.log("调用了子对象2");
// console.log(child);
child.newrightcalculatebutton();
}
onAclick=(i)=>{
console.log("onAclick");
console.log(i);
@ -112,6 +125,8 @@ class Curriculum extends Component {
};
Ontitine=(s)=>{
console.log("CurriculumCurriculum");
console.log(s);
if(s==="ec_course_support_setting"){
this.setState({
titine:1,
@ -208,10 +223,10 @@ class Curriculum extends Component {
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>
<a className="white-btn edu-blueback-btn fr mb10 mr10 mt9" target="_blank" href={`/ec_courses/${ec_course_id}/course_targets.xlsx`}>导出评价详情</a>
</span>
<span className={ismanager===false?"none":"right newrightcalculatebuttons fr mb10 mr20 "}
onClick={this.newrightcalculatebutton}>计算</span>
onClick={()=>this.newrightcalculatebuttonysl(this.child)}>计算</span>
</span>
:titine===4?
<span className="fr ml20 SystemParameters" style={{color: '#989898'}}>各环节平均得分*占比之和/各环节总分*占比之和</span>
@ -230,20 +245,20 @@ class Curriculum extends Component {
<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/subpage/:type/1'
render={ (props) => (<EcCourseSupportSetting {...this.props} {...props} {...this.state} Ontitine={(i)=>this.Ontitine(i)} />) }></Route>
{/*课程考核方式与数据来源*/}
<Route extra path='/ecs/major_schools/:majorId/years/:yearId/courses/:type/2'
<Route extra path='/ecs/major_schools/:majorId/years/:yearId/courses/subpage/: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'
<Route extra path='/ecs/major_schools/:majorId/years/:yearId/courses/subpage/:type/3'
render={ (props) => (<Curriculumtwo {...this.props} {...props} {...this.state} Ontitine={(i)=>this.Ontitine(i)}/>) }></Route>
{/*4课程目标评价方法*/}
<Route extra path='/ecs/major_schools/:majorId/years/:yearId/courses/:type/4'
{/*4课程目标评价方法*/ }
<Route extra path='/ecs/major_schools/:majorId/years/:yearId/courses/subpage/:type/4'
render={ (props) => (<EcCourseEvaluationsbottom {...this.props} {...props} {...this.state} Ontitine={(i)=>this.Ontitine(i)}/>) }></Route>
{/*5课程达成评价结果*/}
<Route extra path='/ecs/major_schools/:majorId/years/:yearId/courses/:type/5'
render={ (props) => (<EcCompletionCalculation {...this.props} {...props} {...this.state} Ontitine={(i)=>this.Ontitine(i)}/>) }></Route>
<Route extra path='/ecs/major_schools/:majorId/years/:yearId/courses/subpage/:type/5'
render={ (props) => (<EcCompletionCalculation {...this.props} {...props} {...this.state} Ontitine={(i)=>this.Ontitine(i)} triggerRef={this.bindRef}/>) }></Route>
</Switch>
</div>
</div>

@ -0,0 +1,35 @@
import React, { Component } from 'react';
class CurriculumSubpage extends Component {
//测试用
constructor(props) {
super(props)
// console.log(props);
}
componentWillMount(){
}
componentDidMount(){
// 起始页面
// console.log(this.props);
console.log("CurriculumSubpage");
console.log(this.props.match.params);
}
Curriculumstructure=()=>{
this.props.history.push(`/ecs/major_schools/${this.props.match.params.majorId}/years/${this.props.match.params.yearId}/courses/subpage/ec_course_support_setting/1`);
}
render() {
// console.log("Curriculumtwo");
// console.log(this.props);
return (
<div className="educontent fl">
<span onClick={()=>this.Curriculumstructure()}>点我进去课程体系</span>
</div>
)
}
}
export default CurriculumSubpage;

@ -42,7 +42,12 @@ class EcCompletionCalculation extends Component {
course_total_scoreaverage:0,
calculatesetype:false,
Spintype:false,
ismanager:false
ismanager:false,
course_achievement:"--",
course_rate:"--",
score_levels:[],
score_levelsdata:[],
hife:"/ecs/major_schools/3/years/60/requirement_vs_courses",
}
}
@ -51,26 +56,55 @@ class EcCompletionCalculation extends Component {
}
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,
})
console.log("componentDidMount");
console.log("EcCompletionCalculation");
// console.log(this.props);
// 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;
const ec_course_id=706;
const url =`/ec_courses/${ec_course_id}/evaluation.json`;
axios.get(url)
.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
})
this.setState({
schooldata:response.data,
ec_course_id:ec_course_id,
// 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_subitem_evaluations,
target_list:response.data.course_targets,
// target_score:response.data.target_score,
ec_course_targets_count:response.data.course_targets.length,
course_achievement:response.data.course_achievement,
course_rate:response.data.course_rate,
score_levels:response.data.score_levels,
// score_levelsdata:response.data.course_targets.score_levels,
// morelisttype:newmorelisttype,
// course_total_scoreaverage:course_total_scoreaverage,
// ismanager:response.data.is_manager
})
// console.log("componentDidMount");
// console.log(response.data.score_levels);
// console.log(response.data.course_targets.score_levels);
}
})
.catch(function (error) {
console.log(error);
});
this.props.Ontitine("competition_calculation_info");
try {
this.props.triggerRef(this);
}catch (e) {
}
}
targetsget_navigation_data=(ec_year_id,ec_course_id)=>{
@ -101,10 +135,11 @@ class EcCompletionCalculation extends Component {
}
UpdateClassData=(key)=>{
let {calculatetype} =this.state;
let ec_course_id =this.props.match.params.ec_course_id;
// let ec_course_id =this.props.match.params.ec_course_id;
this.setState({
ec_course_id:ec_course_id
})
const ec_course_id=706;
const Arl =`/ec_courses/`+ec_course_id+`/calculation_info_data`;
axios.get(Arl, {
withCredentials: true,
@ -138,19 +173,29 @@ class EcCompletionCalculation extends Component {
}
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
})
// 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_subitem_evaluations,
target_list:response.data.course_targets,
// target_score:response.data.target_score,
ec_course_targets_count:response.data.course_targets.length,
course_achievement:response.data.course_achievement,
course_rate:response.data.course_rate,
score_levels:response.data.score_levels,
// score_levelsdata:,
// morelisttype:newmorelisttype,
// course_total_scoreaverage:course_total_scoreaverage,
// ismanager:response.data.is_manager
});
// console.log("componentDidMount");
// console.log(response.data.score_levels_map);
// Object.getOwnPropertyNames(response.data.score_levels_map).forEach(function(val) {
// console.log("正在循环");
// console.log(val);
// });
// console.log(response.data.course_targets.score_levels);
// ec_course_targets:response.data.ec_course_targets,
this.targetsget_navigation_data(response.data.ec_year_id,ec_course_id)
if(calculatetype===true){
@ -263,25 +308,29 @@ class EcCompletionCalculation extends Component {
}
newrightcalculatebutton=()=>{
console.log("调用了计算");
this.setState({
Spintype:true
})
let {ec_course_id}=this.state;
const Orl =`/ec_courses/`+ec_course_id+`/sync_data`;
axios.get(Orl, {
withCredentials:true,
})
// let {ec_course_id}=this.state;
const ec_course_id=706;
// const Orl =`/ec_courses/`+ec_course_id+`/sync_data`;
const Orl =`/ec_courses/${ec_course_id}/evaluation.json`;
axios.get(Orl)
.then((response) => {
if(response.data.status===1){
this.setState({
calculatetype:true,
completiontype:true,
completionlist:'计算成功',
calculatesetype:true,
Spintype:false
})
this.UpdateClassData(true);
if(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)
@ -295,14 +344,14 @@ class EcCompletionCalculation extends Component {
})
}
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 {Spintype,calculatesetype,ec_course_id,course_total_scoreaverage,score_levels,ec_course_targets_count,course_achievement,schooldata,course_rate,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>)
target_listres.push(<span className="column-1 color-666" key={i}>目标{i+1}</span>)
}
return target_listres
}
@ -311,28 +360,30 @@ class EcCompletionCalculation extends Component {
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_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 TargetresContentList = (data,value) => {
let target_listres = [];
if(data){
if(data.length>0){
for(var i=0;i<data.length;i++){
console.log("TargetresContentList");
if(data[i].id===value[0]){
target_listres.push(<span className={i===0?" column-1 color-green":" column-1 color-green"} key={i}><i class="iconfont icon-gouxuan color-green font-16 mr5"></i></span>)
} else{
target_listres.push(<span className={i===0?" column-1 color-666":"column-1 color-666"} key={i}><i class="iconfont icon-guanbi font-14 mr5"></i></span>)
}
}
}
}
// target_listres.reverse()
return target_listres
};
@ -393,7 +444,9 @@ class EcCompletionCalculation extends Component {
}
return target_listres
}
}
};
// console.log(ec_course_targets_count);
// console.log("EcCompletionCalculation");
return (
<div className="newMain clearfix">
<Modal
@ -429,7 +482,7 @@ class EcCompletionCalculation extends Component {
</Modal>
<div className="educontent mb290">
<div className="educontent">
{/*<EcTitleCourseEvaluations*/}
{/* {...this.props}*/}
@ -481,7 +534,7 @@ class EcCompletionCalculation extends Component {
{/* </span>*/}
{/* </div>*/}
{/*</div>*/}
{/*课程目标*/}
<div className="ListTableLine newSystem mb20" id="school_major_list">
<p className="clearfix padding10im" >
@ -511,10 +564,10 @@ class EcCompletionCalculation extends Component {
<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>
<span className={item.status==="not_achieved"?"column-1 operationright Systemnum":"column-1 operationright color-green"}>{item.status==="not_achieved"?"未达成":"已达成"}</span>
<span className="column-1 operationright color-05101A ">{item.standard_grade}</span>
<span className="column-1 operationright">{item.actually_grade}</span>
<span className="column-1 operationright">{item.weight}</span>
</li>
)
@ -523,7 +576,7 @@ class EcCompletionCalculation extends Component {
</div>
{/*毕业要求指标点达成评价结果*/}
<div className="edu-back-white eacourse">
<div className="padding1030" id="training_objective_contents">
@ -540,6 +593,7 @@ class EcCompletionCalculation extends Component {
<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>
@ -560,52 +614,103 @@ class EcCompletionCalculation extends Component {
<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>
<span className="column-1 operationright"> <a href={`/ecs/major_schools/${this.props.match.params.majorId}/years/${this.props.match.params.yearId}/requirement_vs_courses`} style={{color:'rgb(76, 172, 255)'}}>立即配置</a></span>
{TargetresContentList(5,[2,2,2,2,2])}
</li>
:""
}
<style>
{
`
.myliysls{
display: flex;
flex-direction:initial;
        }
`
}
</style>
{
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>
<li key={key} className="clearfix lipadding20im myliysls" style={{minWidth: ec_course_targets_count > 5 ? (76*(ec_course_targets_count+4)+380+15):1200+"px"}}>
<div className="myliysls">
<span className="column-1 color-666 mr16">毕业要求</span>
</div>
<span className="column-500 ">{item.ec_subitem_content}</span>
<div className="myliysls" >
{TargetresList(ec_course_targets_count)}
</p>
</div>
<div className="myliysls">
<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>
</div>
</li>
)
}
}):""
}
{/*mynewtarget_scoreclassysls*/}
<style>
{
`
.myliysls{
display: flex;
flex-direction:initial;
        }
`
}
</style>
<div className="">
{
Spintype===false?graduation_list.map((item,key)=>{
return(
<li key={key} className="clearfix lipadding20im myliysls" style={{minWidth: ec_course_targets_count > 5 ? (76*(ec_course_targets_count+4)+380+15):1200+"px"}}>
<div className="myliysls ">
<span className="column-1 color-05101A mr16" >{key+1}</span>
</div>
<span className="column-500 color-05101A" data-tip-down={item.content}>{item.content}</span>
<div className="myliysls">
{TargetresContentList(target_list,item.support_course_target_ids)}
</div>
<div className="myliysls">
{item.weights===null||item.weights===undefined||item.weights==="0.00"||item.weights===0.00||item.weights===0?<span className="column-1 " ><a href={`/ecs/major_schools/${this.props.match.params.majorId}/years/${this.props.match.params.yearId}/requirement_vs_courses`} style={{color:'rgb(76, 172, 255)'}}>立即配置</a></span>:<span className="column-1 " style={{textAlign:"center"}}>{item.weights}</span>}
<span className="column-1 " style={{textAlign:"center"}}>{item.actually_achievement===null?0:item.actually_achievement}</span>
<span className="column-1 color-05101A" style={{textAlign:"center"}}>{item.objective_achievement===null?0:item.objective_achievement}</span>
<span className={item.status==="not_achieved"?"column-1 Systemnum mrj15":"column-1 color-green mrj15"} style={{textAlign:"center"}}>{item.status==="not_achieved"?"未完成":"完成"}</span>
</div>
</li>
// <li className={key+1===target_list.length?"clearfix newtarget_scoreclass 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.content}</span>
// <span className={item.status==="not_achieved"?"column-1 operationright Systemnum mrj15":"column-1 operationright color-green mrj15"} style={{textAlign:"left"}}>{item.status==="not_achieved"?"未完成":"完成"}</span>
// <span className="column-1 operationright color-05101A" style={{textAlign:"left"}}>{item.objective_achievement===null?0:item.objective_achievement}</span>
// <span className="column-1 operationright" style={{textAlign:"left"}}>{item.actually_achievement===null?0:item.actually_achievement}</span>
// {item.weights===null||item.weights===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" style={{textAlign:"left"}}>{item.weights}</span>}
// {TargetresContentList(ec_course_targets_count,item.target_position)}
// </li>
)
}):""
}
</div>
{
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">
@ -652,9 +757,9 @@ class EcCompletionCalculation extends Component {
{/*<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>:""
}
{
course_rate===undefined||course_rate===null||course_rate===""||course_rate==="0"||course_rate===0? <span className="column-1 operationright">--</span>:<span className="column-1 color-red operationright">{course_rate}</span>
}
</li>:""
}
{/*style={{width: 113*(total_rate_data+4)>1136?113*(total_rate_data+4):1136+"px"}}*/}
@ -687,7 +792,7 @@ class EcCompletionCalculation extends Component {
{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>
course_achievement===undefined||course_achievement===null||course_achievement===""||course_achievement==="0"||course_achievement===0? <span className="column-1 operationright">--</span>:<span className="column-1 color-red operationright">{course_achievement}</span>
}
</li>:""
}
@ -716,47 +821,63 @@ class EcCompletionCalculation extends Component {
<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>
{
score_levels&&score_levels.map((i,k)=>{
return(
<span className="column-1 color-666">{i.description}</span>
)
})
}
</p>
{
Spintype===false?target_score.map((i,k)=>{
Spintype===false?target_list.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>
<span className="column-1 color-05101A">{i.standard_grade}</span>
<span className="column-1 colorFF6800">{i.maximum_score===null || i.maximum_score===undefined ||i.maximum_score===""?"--":i.maximum_score}</span>
<span className="column-1 color-green">{i.minimum_score===null || i.minimum_score===undefined || i.minimum_score===""?"--":i.minimum_score}</span>
{
i.score_levels.map((j,l)=>{
return(
<span key={l} className="column-1 color-05101A">
<div>{j.count}</div>
<div className="color999">{j.rate===null||j.rate===undefined||j.rate===""||j.rate===0?0.00:j.rate}%</div>
</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>
)
@ -764,8 +885,8 @@ class EcCompletionCalculation extends Component {
}
{ Spintype===true?<Spin className="Spinlarge" indicator={<Icon type="loading" style={{ fontSize: 30 }} spin />}/>:"" }
{target_score.length===0&&Spintype===false?
{target_list.length===0&&Spintype===false?
<li className={"clearfix newtarget_scoreclass lipadding10im"}>
<span className="column-1 color-05101A">--</span>
<span className="column-1 color-05101A">--</span>

@ -16,7 +16,7 @@ import 'antd/dist/antd.css';
import '../../css/ecCourseEvaluations.css';
import EcTitleCourseEvaluations from "../../ecTitle/ecTitle";
import './eccourseevalut.css'
const $ = window.$;
// 课程目标评价方法
@ -48,21 +48,23 @@ class EcCourseEvaluationsbottom extends Component {
meweacoursetype:false,
newshowredvalue:false,
percentagetype:false,
ismanager:false
ismanager:true
}
}
getec_course_achievement_methods=()=>{
const {newec_course_idbottom}=this.state;
if(newec_course_idbottom!=undefined){
const url = `/ec_course_achievement_methods?ec_course_id=`+newec_course_idbottom;
// const url ='ec_courses/:course_id/course_targets.json';
// const url = `/ec_course_achievement_methods?ec_course_id=`+newec_course_idbottom;
const url =`/ec_courses/${course_id}/course_targets/course_achievement_methods.json`;
axios.get(url, {
withCredentials: true,
})
.then((response)=>{
this.setState({
achievement_list:response.data.achievement_list,
achievement_list:response.data.course_targets,
spinningstate:false,
ismanager:response.data.is_manager
ismanager:true
})
}).catch(function (error) {
console.log(error);
@ -70,11 +72,11 @@ class EcCourseEvaluationsbottom extends Component {
}
// this.setState({
// achievement_list:[
// {target_evaluate_data: [
// {course_achievement_methods: [
// {
// evaluate_id: 24,
// evaluate_name: "期末考试",
// evaluation_relates_data: [
// course_evaluation_subitems: [
// {evaluation_relates_id: 31, evaluation_relates_name: "期末考试1目标1考题"},
// {evaluation_relates_id: 32, evaluation_relates_name: "期末考试1目标2考题"}
// ],
@ -113,25 +115,27 @@ class EcCourseEvaluationsbottom extends Component {
});
}
componentDidMount(){
let ec_course_id=this.props.match.params.ec_course_id;
const url = `/ec_course_achievement_methods?ec_course_id=`+ec_course_id;
axios.get(url, {
withCredentials: true,
})
let ec_course_id=this.props.match.params.ec_course_id;
const course_id = 706
const url =`/ec_courses/${course_id}/course_targets/with_achievement_methods.json`;
// /ec_courses//course_targets/course_achievement_methods.json
// const url = `/ec_course_achievement_methods?ec_course_id=`+course_id;
axios.get(url)
.then((response)=>{
this.setState({
achievement_list:response.data.achievement_list,
achievement_list:response.data.course_targets,
spinningstate:false,
ismanager:response.data.is_manager
ismanager:true
})
}).catch(function (error) {
console.log(error);
});
this.getNavigationData(ec_course_id);
// this.getNavigationData(ec_course_id);
this.setState({
newec_course_idbottom:ec_course_id
newec_course_idbottom:course_id
})
this.props.Ontitine("evaluation_methods");
}
editecCourseEvaluationslist=(e)=>{
let id =e.target.getAttribute("target_id");
@ -226,7 +230,7 @@ class EcCourseEvaluationsbottom extends Component {
newec_course_target_id:id,
methodologytype:true,
ec_course_target_name:response.data.ec_course_target_name,
ismanager:response.data.is_manager
ismanager:true
})
// this.setState({
@ -427,15 +431,16 @@ class EcCourseEvaluationsbottom extends Component {
EvaluationsSaveonloadgetdata=(id)=>{
const url = `/ec_course_achievement_methods?ec_course_id=`+id
const course_id = 706;
const url = `/ec_courses/${course_id}/course_targets/with_achievement_methods.json`;
axios.get(url, {
withCredentials: true,
})
.then((response)=>{
this.setState({
achievement_list:response.data.achievement_list,
achievement_list:response.data.course_targets,
spinningstate:false,
ismanager:response.data.is_manager
ismanager:true
})
}).catch(function (error) {
@ -554,7 +559,9 @@ class EcCourseEvaluationsbottom extends Component {
}
var Url = '/ec_course_achievement_methods/create_evaluation_methods';
// var Url = '/ec_course_achievement_methods/create_evaluation_methods';
var Url = '/ec_courses/:course_id/course_targets/:target_id/course_achievement_methods.json';
axios.post(Url, {
ec_course_target_id: newec_course_target_id,
achievement_methods:achievement_methods
@ -575,7 +582,7 @@ class EcCourseEvaluationsbottom extends Component {
achievement_methods:undefined,
eacoursesavetypes:false,
newshowredvalue:false,
ismanager:response.data.is_manager
ismanager:true
})
// $("#ecCourseEvaluationsbottomsubmit").hide();
// $("#SystemParametersbottom").hide();
@ -662,6 +669,8 @@ class EcCourseEvaluationsbottom extends Component {
percentagetype,
ismanager
} = this.state;
// console.log("EcCourseEvaluationsbottom12345");
// console.log(achievement_list);
return (
<div className="newMain clearfix">
<div className="educontent mb50">
@ -760,35 +769,35 @@ class EcCourseEvaluationsbottom extends Component {
</p>
{
achievement_list.length===0?<Spin spinning={spinningstate} className="Spinlarge" indicator={<Icon type="loading" style={{ fontSize: 30 }} spin />}/>:achievement_list.map((item,key)=>{
achievement_list===undefined?"":achievement_list&&achievement_list.length===0?<Spin spinning={spinningstate} className="Spinlarge" indicator={<Icon type="loading" style={{ fontSize: 30 }} spin />}/>:achievement_list&&achievement_list.map((item,key)=>{
return(
<div key={key} >
{
item.target_evaluate_data.length===0?
<li key={key} className="clearfix" style={{width:"1140px"}}>
<div style={{ width:'99.8%'}} style={{display:parseInt(target_id)===item.target_id?"none":"block"}}>
<span className="column-1 mt4 textaligncenter"><span>{key+1}</span></span>
item.course_achievement_methods.length===0?
<li key={key} className="clearfix" >
<div style={{ width:'99.8%'}} className={"yslpadding"} style={{display:parseInt(target_id)===item.id?"none":"block"}}>
<span className="column-1 mt4 textaligncenters"><span>{key+1}</span></span>
<span>
<span className="column-1 ml80 mt4">
<span className="column-1 textaligncenters mt4">
<span></span>
</span>
<span className="column-1 ml80 color99 mt4 newtextaligncenter">
<span className="column-1 ml15 textaligncenters color99 mt4 newtextaligncenter evaluationdataClassy">
<span></span>
</span>
<span className="column-1 operationright mt4">
<div className="operationColumn">
<div className="right operationalter nulleditSubentry" style={{display:ismanager===false?'none':'block'}}>
<a className="mr16 editSubentry" data-tip-down="编辑" ><i target_id={item.target_id} name={key} onClick={this.editecCourseEvaluationslist.bind(this)} className="iconfont icon-bianjidaibeijing color-green" ></i></a>
<a className="mr16 editSubentry" data-tip-down="编辑" ><i target_id={item.id} name={key} onClick={this.editecCourseEvaluationslist.bind(this)} className="iconfont icon-bianjidaibeijing color-green" ></i></a>
</div>
</div>
</span>
<span className="column-1 ml15 operationright mt4 percentage">
<span className="column-1 operationright mt4 percentages">
<div></div>
</span>
<span className="column-1 ml15 operationright mt4">
<span className="column-1 mr20 operationright mt4">
<div className="ColorF68"></div>
</span>
@ -797,9 +806,9 @@ class EcCourseEvaluationsbottom extends Component {
{/* 修改start*/}
<div className="ListTableLine newSystem" id="EvaluationsList">
<div style={{display:parseInt(target_id)===item.target_id?"block":"none"}} >
<div style={{display:parseInt(target_id)===item.id?"block":"none"}} >
{/* <div className="edu-back-white eacourse" id="SystemParametersbottom" style={{display:parseInt(sequenceid)===key?"block":"none"}}> */}
<div className="edu-back-white eacourse" id="SystemParametersbottom" style={{display:parseInt(target_id)===item.target_id?"block":"none"}}>
<div className="edu-back-white eacourse" id="SystemParametersbottom" style={{display:parseInt(target_id)===item.id?"block":"none"}}>
<div className="padding20-30" id="SystemParameters" style={{paddingLeft:'0px'}}>
{/* <span className="fl SystemParameters">课程目标{sequenceid}{ec_course_target_name}</span> */}
<span className="fl SystemParameters">课程目标{key+1}{ec_course_target_name}</span>
@ -883,20 +892,20 @@ class EcCourseEvaluationsbottom extends Component {
</li>
:item.target_evaluate_data.map((i,k)=>{
:item.course_achievement_methods.map((i,k)=>{
return(
<li key={key} className={achievement_list.length-1===key?item.target_evaluate_data.length-1===k?"clearfix":"bordereaeaea clearfix":item.target_evaluate_data.length-1===k?"bordereaeaeas clearfix":" bordereaeaea clearfix" } style={{width:"1140px",display:parseInt(target_id)===item.target_id&&methodologytype===true?item.target_evaluate_data.length-1===k?'block':"none":"block"}}>
<div style={{ width:'99.8%'}} style={{display:parseInt(target_id)===item.target_id&&methodologytype===true?"none":"block"}} >
<span className="column-1 mt4 textaligncenter absolute"><span>{key-k===key?key+1:""}</span></span>
<li key={key} className={achievement_list&&achievement_list.length-1===key?item.course_achievement_methods.length-1===k?"clearfix yslinitials ":" yslinitials bordereaeaea clearfix":item.course_achievement_methods.length-1===k?" yslinitials bordereaeaeas clearfix":" yslinitials bordereaeaea clearfix" } style={{display:parseInt(target_id)===item.target_id&&methodologytype===true?item.course_achievement_methods.length-1===k?'block':"none":"block"}}>
<div style={{ width:'99.8%'}} className={"yslpadding"} style={{display:parseInt(target_id)===item.target_id&&methodologytype===true?"none":"block"}} >
<span className="column-1 mt4 textaligncenters">{key-k===key?key+1:""}</span>
<span>
<span className="column-1 ml100 mt4 absolute">
<span>{i.evaluate_name}</span>
<span className="column-1 textaligncenters mt4 ">
{i.course_evaluation.name}
</span>
<span className="column-1 ml80 color99 mt4 newtextaligncenter evaluationdataClass" style={{marginLeft: '72px'}}>
<span className="column-1 ml15 textaligncenters color99 mt4 newtextaligncenter evaluationdataClassy" >
{
i.evaluation_relates_data.map((y,e)=>{
i.course_evaluation_subitems.map((y,e)=>{
return(
<div key={y} className="boxinline">{y.evaluation_relates_name+" "} </div>
<div key={y} >{y.name+" "} </div>
)
})
}
@ -919,11 +928,11 @@ class EcCourseEvaluationsbottom extends Component {
}
<span className="column-1 ml15 operationright mt4 percentage">
<span className="column-1 operationright mt4 percentages">
<div>{i.percentage+"%"}</div>
</span>
<span className="column-1 ml15 operationright mt4">
<span className="column-1 mr20 operationright mt4">
<div className="ColorF68">{i.score}</div>
</span>
@ -931,8 +940,8 @@ class EcCourseEvaluationsbottom extends Component {
</div>
{/* 修改start*/}
<div className="ListTableLine newSystem" id="EvaluationsList">
<div style={{display:parseInt(target_id)===item.target_id&&item.target_evaluate_data.length-1===k?"block":"none"}} >
<div className="edu-back-white eacourse" id="SystemParametersbottom" style={{display:parseInt(target_id)===item.target_id&&item.target_evaluate_data.length-1===k?"block":"none"}}>
<div style={{display:parseInt(target_id)===item.target_id&&item.course_achievement_methods.length-1===k?"block":"none"}} >
<div className="edu-back-white eacourse" id="SystemParametersbottom" style={{display:parseInt(target_id)===item.target_id&&item.course_achievement_methods.length-1===k?"block":"none"}}>
<div className="padding20-30" id="SystemParameters" style={{paddingLeft:'0px'}}>
{/* <span className="fl SystemParameters">课程目标{sequenceid}{ec_course_target_name}</span> */}
<span className="fl SystemParameters">课程目标{key+1}{ec_course_target_name}</span>

@ -0,0 +1,8 @@
.yslinitials{
display: flex;
flex-direction:initial;
}
.yslpadding{
padding: 0px 30px;
}

@ -0,0 +1,476 @@
import React, { Component } from 'react';
import moment from 'moment'
import { getUrl } from 'educoder'
import { Form, Input, Icon, Button, Select, InputNumber } from 'antd';
const { TextArea } = Input;
const { Option } = Select;
let _url_origin = getUrl()
const $ = window.$
// https://www.educoder.net/stylesheets/css/common.css?1546618720
if (!window['EcLoaded']) {
$('head').append( $('<link rel="stylesheet" type="text/css" />')
.attr('href', `${_url_origin}/stylesheets/css/common.css?1525440977`) );
window['EcLoaded'] = true
}
let id = 0;
/**
target_id
position
target_weight
target_contents
subitem_id
index
subitem_contents
*/
const data =
[{"position":0,"target_weight":0.02,"target_contents":"12","standard_grade":2,"subitem_id":"65"},{"position":3,"target_id":"0","target_weight":0.1,"target_contents":"理解数据管理技术和数据库技术的发展,区分不同数据模型的作用和特点,描述数据库系统的类型、结构、数据独立性。","standard_grade":60,"subitem_id":"66"},{"position":4,"target_weight":1,"target_contents":"22","standard_grade":33,"subitem_id":"66"},{"position":11,"target_id":"1","target_weight":0.1,"target_contents":"理解数据管理技术和数据库技术的发展,区分不同数据模型的作用和特点,描述数据库系统的类型、结构、数据独立性。","standard_grade":61,"subitem_id":"65"}]
;
let _data = [
{
target_id: 0,
position: 1,
target_weight: 0.1,
target_contents: '理解数据管理技术和数据库技术的发展,区分不同数据模型的作用和特点,描述数据库系统的类型、结构、数据独立性。',
standard_grade: 60,
// biyeYaoqiuZhibiaodian: '<label>1-2</label>:能够运用相关的工程基础和专业知识辨别材料生产中出现的技术、工艺、质量等问题',
"subitem_id": 64,
"index": "1-1",
"subitem_contents": "能够运用相关的工程基础和专业知识辨别材料生产中出现的技术、工艺、质量等问题"
},
{
target_id: 1,
position: 2,
target_weight: 0.1,
target_contents: '理解数据管理技术和数据库技术的发展,区分不同数据模型的作用和特点,描述数据库系统的类型、结构、数据独立性。',
standard_grade: 61,
// biyeYaoqiuZhibiaodian: '<label>1-2</label>:能够运用相关的工程基础和专业知识辨别材料生产中出现的技术、工艺、质量等问题',
"subitem_id": 65,
"index": "1-2",
"subitem_contents": "222能够运用相关的工程基础和专业知识辨别材料生产中出现的技术、工艺、质量等问题"
}
]
const item = {}
class EditableCourseSupportSetting extends Component {
constructor(props) {
super(props)
this.state = {
addOrDeleting: false,
errorMsg: ''
}
}
onRemove = (k) => {
let fValues = this.props.form.getFieldsValue();
if (
// fValues.standard_grade[k] && fValues.standard_grade[k] != 75
// || fValues.subitem_id[k]
// ||
fValues.target_contents[k]
// || fValues.target_weight[k]
) {
this.props.showModal('提示', '确定要删除吗?', () => {
this.remove(k)
})
} else {
this.remove(k)
}
}
remove = (k) => {
const { form } = this.props;
// can use data-binding to get
const keys = form.getFieldValue('keys');
// We need at least one passenger
// if (keys.length === 1) {
// return;
// }
if (keys.length === 1) {
this.setState({ errorMsg: '至少得保留一条数据' })
return;
}
// 清除悬浮tip
window.$('.data-tip-down').hide()
console.log('remove :' , k , this.position2Target_idMap[k])
delete this.position2Target_idMap[k]
// can use data-binding to set
form.setFieldsValue({
keys: keys.filter(key => key !== k),
});
}
_reverseMap = (map) => {
let newMap = {}
for (var k in map) {
newMap[map[k]] = k;
}
return newMap
}
addIfNewKeyExist = (newKey, index_arg) => {
this.setState({ addOrDeleting: true })
const { form } = this.props;
const keys = form.getFieldValue('keys');
/**
[0,1,2,3]
['11', '22', '33', '44']
->
[0,1,2,3,4]
['11', '22', empty, '33', '44']
*/
const target_weight = form.getFieldValue('target_weight');
const target_contents = form.getFieldValue('target_contents');
const standard_grade = form.getFieldValue('standard_grade');
const subitem_id = form.getFieldValue('subitem_id');
keys.splice(index_arg, 0, newKey);
// position2Target_idMap
// {1:2, 2:3, 3:4, 4:6 } --> {1:2, 2:3, 3:7, 4:4, 5:6 }
// 更新key/position 映射到target_id的map
// 两次revers用这个结构达到给position加1的效果
let reverseMap = this._reverseMap(this.position2Target_idMap);
for (let i = index_arg ; i < keys.length; i++) {
if(keys[i] === keys[i+1]) { // 找到开始+1的行
continue;
}
let target_id = this.position2Target_idMap[keys[i]];
reverseMap[target_id] = parseInt(reverseMap[target_id]) + 1;
keys[i] = keys[i] + 1;
}
for (let i = 0 ; i < keys.length - 1; i++) {
if (keys[i] == keys[i + 1]) {
debugger;
}
}
this.position2Target_idMap = this._reverseMap(reverseMap);
target_weight.splice(newKey, 0, undefined);
target_contents.splice(newKey, 0, undefined);
standard_grade.splice(newKey, 0, undefined);
subitem_id.splice(newKey, 0, undefined);
setTimeout(() => {
form.setFieldsValue({
target_weight,
target_contents,
standard_grade,
subitem_id
});
window.$('.data-tip-down').hide()
this.setState({ addOrDeleting: false })
}, 300)
form.setFieldsValue({
keys: keys
});
}
add = (k, index) => {
this.setState({ errorMsg: '' })
const { form } = this.props;
// can use data-binding to get
const keys = form.getFieldValue('keys');
let nextKeys ;
let newKey = k + 1;
const newKeyIndex = keys.indexOf(newKey)
if (newKeyIndex != -1) {
// 新key存在将新key位置及以后的row后移直到找到一个之后的空位置
this.addIfNewKeyExist(newKey, index)
} else { // 如果这个新key不存在
// keys[newIndex] = newKey
keys.splice(index === 0 && k === -1 ? 0 : index, 0, newKey);
}
// can use data-binding to set
// important! notify form to detect changes
form.setFieldsValue({
keys: keys,
});
}
handleSubmit = (e) => {
if (!this.props.is_manager) {
this.props.showModal('提示', '您没权限编辑,请联系管理员。')
return;
}
this.setState({ errorMsg: '' })
e.preventDefault && e.preventDefault();
this.props.form.validateFieldsAndScroll((err, values) => {
if (!err) {
let keysLen = values.keys.length
if (keysLen < 1) {
this.setState({ errorMsg: '至少得保留一条数据' })
}
var data = []
while( keysLen-- ) {
data.push({})
}
for (var valKey in values) {
let dataIndex = 0
values[valKey].forEach( (item,index) => {
let _val = values[valKey][index];
if (_val || _val == 0) {
data[dataIndex][valKey === 'keys' ? 'position' : valKey] = _val
if (valKey === 'keys' && (this.position2Target_idMap[_val] || this.position2Target_idMap[_val] === 0) ) {
data[dataIndex].target_id = this.position2Target_idMap[_val]
}
dataIndex++;
}
})
}
console.log('Received values of form: ', values, data);
let totalWeight = 0;
values.target_weight.forEach(item => {
if (item) {
totalWeight += item
}
})
// 精度问题 0.2 + 0.7 = 0.8999999999
if (parseInt((totalWeight * 100).toFixed(1)) != 100) {
this.setState({ errorMsg: '请先保证权重和等于1' })
return;
}
this.props.updateCourseTargets(data)
} else {
const keyRowNumMap = {}
let rowNum = 1;
for (var key in values.target_contents) {
keyRowNumMap[key] = rowNum;
rowNum++;
}
// err.target_contents[1].errors[0]
// {message: "请填入目标内容", field: "target_contents[1]"}
for (var key in err) {
for (var _k in err[key]) {
let errorObj = err[key][_k].errors[0];
let _key = errorObj.field.match(`[(0-9)]`)
this.setState({ errorMsg: `${keyRowNumMap[_key]}行,${errorObj.message}` })
return;
// console.log(`第${keyRowNumMap[_key]}行,${errorObj.message}`);
}
}
}
});
}
componentDidMount = () => {
this.position2Target_idMap = {}
const { form } = this.props;
const data = this.props.course_targets
let target_weight = []
let target_contents = []
let standard_grade = []
// let biyeYaoqiuZhibiaodian = []
let subitem_id = []
let keys = []
data.forEach(item => {
keys.push(item.position);
target_weight[item.position] = (item.target_weight)
target_contents[item.position] = (item.target_contents);
standard_grade[item.position] = (item.standard_grade);
// biyeYaoqiuZhibiaodian[item.position] = (item.biyeYaoqiuZhibiaodian);
subitem_id[item.position] = item.subitem_id ? (item.subitem_id).toString() : item.subitem_id;
this.position2Target_idMap[item.position] = item.target_id
})
form.setFieldsValue({
keys
});
setTimeout(() => {
form.setFieldsValue({
// keys,
target_weight,
target_contents,
standard_grade,
// biyeYaoqiuZhibiaodian,
subitem_id,
});
// this.forceUpdate()
}, 3000)
}
render() {
const { getFieldDecorator, getFieldValue } = this.props.form;
const { requirements } = this.props;
const { addOrDeleting } = this.state;
const formItemLayout = {
labelCol: {
xs: { span: 24 },
sm: { span: 4 },
},
wrapperCol: {
xs: { span: 24 },
sm: { span: 20 },
},
};
const formItemLayoutWithOutLabel = {
wrapperCol: {
xs: { span: 24, offset: 0 },
sm: { span: 20, offset: 4 },
},
};
getFieldDecorator('keys', { initialValue: [] });
const keys = getFieldValue('keys');
const formItems = keys.map((k, index) => (
<li className="clearfix" key={ k }>
<Form.Item
{...(index === 0 ? formItemLayout : formItemLayoutWithOutLabel)}
// label={index === 0 ? 'Passengers' : ''}
required={false}
key={k}
style={{ 'display': 'flex' }}
>
<span className="column-1">{ index + 1 }</span>
<span className="column-1">
{getFieldDecorator(`target_weight[${k}]`, {
// validateTrigger: ['onChange', 'onBlur'],
rules: [{
required: true,
whitespace: true,
type: 'number',
message: "请填入权重",
}],
})(
<InputNumber placeholder="权重" precision={2} step={0.01} min={0.01} max={1} style={{ width: '100%', marginRight: 8 }} />
)}
</span>
<span className="column-3">
{getFieldDecorator(`target_contents[${k}]`, {
// validateTrigger: ['onChange', 'onBlur'],
rules: [{
required: true,
// whitespace: true,
message: "请填入目标内容",
}],
})(
<TextArea autosize placeholder="" style={{ width: '100%', marginRight: 8 }} />
)}
</span>
<span className="column-2 edu-txt-center">
{getFieldDecorator(`standard_grade[${k}]`, {
initialValue: 75,
// validateTrigger: ['onChange', 'onBlur'],
rules: [{
required: true,
// whitespace: true,
// type: 'integer',
message: "请先填写达成标准分",
}],
})(
<InputNumber placeholder="" step={1} min={0} max={100} style={{ width: '80%', marginRight: 8 }} />
)}
</span>
{/* <Input placeholder="" style={{ width: '80%', marginRight: 8 }} /> */}
<span className="column-3">
{ getFieldDecorator(`subitem_id[${k}]`, {
// validateTrigger: ['onChange', 'onBlur'],
rules: [{
required: true,
// whitespace: true,
// type: 'array',
message: "请先选择毕业要求指标点",
}],
})(
<Select
// mode="multiple"
// dropdownMatchSelectWidth={ false }
style={{ width: '100%', marginRight: 8 }}
>
{ requirements.map((item, index) => {
return ( <Option value={item.subitem_id.toString()} title={item.subitem_contents}>
{item.index} : {item.subitem_contents}
</Option> )
}) }
</Select>
)}
</span>
<span className="column-1 edu-txt-right">
{ !addOrDeleting && <a href="javascript:void(0)"
onClick={() => { this.onRemove(k) }}
className="color-grey-c mr15" data-tip-down="删除">
<i className="iconfont icon-shanchu font-15"></i>
</a> }
{ !addOrDeleting && <a href="javascript:void(0)"
onClick={() => { this.add(k, index + 1) }}
className="color-green show-FillTable"
data-tip-down="添加">
<i className="iconfont icon-tianjiafangda"
></i>
</a> }
</span>
</Form.Item>
</li>
));
return (
<Form onSubmit={this.handleSubmit}>
<div className="ListTableLine" id="show-Target-table">
<p className="clearfix">
<span className="column-1"></span>
<span className="column-1">权重</span>
<span className="column-3">课程目标内容</span>
<span className="column-2 edu-txt-center">达成标准()</span>
<span className="column-3">对应毕业要求指标点</span>
{ !addOrDeleting && <span className="column-1 edu-txt-right"
>
<a href="javascript:void(0)" className="color-green show-FillTable"
onClick={ () => { this.add(-1, 0) }} data-tip-down="添加">
<i className="iconfont icon-tianjiafangda"></i></a>
</span> }
</p>
{formItems}
</div>
{/* <Form.Item {...formItemLayoutWithOutLabel}>
<Button type="dashed" onClick={ () => { this.add(keys.length === 0 ? -1 : keys[keys.length - 1], keys.length - 1) }}
style={{ width: '60%' }}>
<Icon type="plus" /> Add field
</Button>
</Form.Item>
<Form.Item {...formItemLayoutWithOutLabel}>
<Button type="primary" htmlType="submit">Submit</Button>
</Form.Item> */}
<p class="clearfix" style={{ marginTop: '10px'}}>
{ this.state.errorMsg && <span class="c_red none ml30" id="error_tip" style={{ display: 'inline'}}>
{this.state.errorMsg}
</span> }
<a href="javascript:void(0)" class="defalutSubmitbtn mr20 fr" onClick={this.handleSubmit}>保存</a>
<a href="javascript:void(0)" class="defalutCancelbtn mr20 fr" onClick={() => { this.props.setEditableMode(false) } }>取消</a>
</p>
</Form>
);
}
}
const WrappedEditableCourseSupportSetting = Form.create({ name: 'dynamic_form_item' })(EditableCourseSupportSetting);
export default WrappedEditableCourseSupportSetting;

@ -0,0 +1,150 @@
import React, { Component } from 'react';
import moment from 'moment'
import EditableCourseSupportSetting from './EditableCourseSupportSetting'
import { Form, Input, Icon, Button, Select } from 'antd';
const { Option } = Select;
const data = [
{
id: 0,
ecPosition: 1,
target_weight: 0.1,
target_contents: '理解数据管理技术和数据库技术的发展,区分不同数据模型的作用和特点,描述数据库系统的类型、结构、数据独立性。',
standard_grade: 60,
subitem_contents: '<label>1-2</label>:能够运用相关的工程基础和专业知识辨别材料生产中出现的技术、工艺、质量等问题'
},
{
id: 1,
ecPosition: 2,
target_weight: 0.1,
target_contents: '理解数据管理技术和数据库技术的发展,区分不同数据模型的作用和特点,描述数据库系统的类型、结构、数据独立性。',
standard_grade: 60,
subitem_contents: '<label>1-2</label>:能够运用相关的工程基础和专业知识辨别材料生产中出现的技术、工艺、质量等问题'
}
]
class ShowTableCourseSupportSetting extends Component {
componentDidMount = () => {
const course_targets = this.props.course_targets;
}
render() {
const course_targets = this.props.course_targets;
const is_manager = this.props.year && this.props.year.can_manager;
return (
<div className="ListTableLine" id="show-Target-table">
<p className="clearfix">
<span className="column-1"></span>
<span className="column-1">权重</span>
<span className="column-3">课程目标内容</span>
<span className="column-2 edu-txt-center">达成标准()</span>
<span className="column-3">对应毕业要求指标点</span>
<span className="column-1 edu-txt-right">
{/* <a href="javascript:void(0)" className="color-green show-FillTable" data-tip-down="">
<i className="iconfont icon-tianjiafangda"></i>
</a> */}
{ is_manager && <a href="javascript:void(0)"
onClick={() => { this.props.setEditableMode(true)} }
class="color-green EditCourse" data-id="5" data-tip-down="编辑">
<i class="iconfont icon-bianjidaibeijing"></i>
</a> }
</span>
</p>
<div id="course_targets_list">
{ course_targets.map((item, index) => {
return ( <li className="clearfix" key={index}>
<span className="column-1">{ index + 1 }</span>
<span className="column-1">{ item.target_weight}</span>
<span className="column-3">{ item.target_contents}</span>
<span className="column-2 edu-txt-center">{ item.standard_grade }</span>
<span className="column-3">
<input type="hidden" value="70"></input>
{/* { item.subitem_id } */}
{item.index} : {item.subitem_contents}
</span>
{/* <span className="column-1 edu-txt-right">
<a href="javascript:void(0)" onclick="delete_confirm_box_2('/ec_course_targets/26', '确定要删除该课程目标吗')" className="color-grey-c mr15" data-tip-down="删除"><i className="iconfont icon-shanchu font-15"></i></a>
<a href="javascript:void(0)" className="color-green EditCourse" data-id="26" data-tip-down="编辑"><i className="iconfont icon-bianjidaibeijing"></i></a>
</span> */}
</li> )
})}
{/* <li className="clearfix">
<span className="column-1">1</span>
<span className="column-1">0.1</span>
<span className="column-3">理解数据管理技术和数据库技术的发展区分不同数据模型的作用和特点描述数据库系统的类型结构数据独立性</span>
<span className="column-2 edu-txt-center">75</span>
<span className="column-3">
<input type="hidden" value="70"></input>
<label>1-2</label>
</span>
<span className="column-1 edu-txt-right">
<a href="javascript:void(0)" onclick="delete_confirm_box_2('/ec_course_targets/26', '确定要删除该课程目标吗')" className="color-grey-c mr15" data-tip-down="删除"><i className="iconfont icon-shanchu font-15"></i></a>
<a href="javascript:void(0)" className="color-green EditCourse" data-id="26" data-tip-down="编辑"><i className="iconfont icon-bianjidaibeijing"></i></a>
</span>
</li>
<li className="clearfix">
<span className="column-1">2</span>
<span className="column-1">0.1</span>
<span className="column-3">理解数据库系统管理和保护的基本概念和技术应用系统提供的数据库管理方法和保护功能</span>
<span className="column-2 edu-txt-center">75</span>
<span className="column-3">
<input type="hidden" value="70"></input>
<label>1-2</label>
</span>
<span className="column-1 edu-txt-right">
<a href="javascript:void(0)" onclick="delete_confirm_box_2('/ec_course_targets/27', '确定要删除该课程目标吗')" className="color-grey-c mr15" data-tip-down="删除"><i className="iconfont icon-shanchu font-15"></i></a>
<a href="javascript:void(0)" className="color-green EditCourse" data-id="27" data-tip-down="编辑"><i className="iconfont icon-bianjidaibeijing"></i></a>
</span>
</li>
<li className="clearfix">
<span className="column-1">3</span>
<span className="column-1">0.1</span>
<span className="column-3">理解关系模型的概念和特点应用关系代数表达式描述数据的查询操作</span>
<span className="column-2 edu-txt-center">75</span>
<span className="column-3">
<input type="hidden" value="70"></input>
<label>1-2</label>
</span>
<span className="column-1 edu-txt-right">
<a href="javascript:void(0)" onclick="delete_confirm_box_2('/ec_course_targets/28', '确定要删除该课程目标吗')" className="color-grey-c mr15" data-tip-down="删除"><i className="iconfont icon-shanchu font-15"></i></a>
<a href="javascript:void(0)" className="color-green EditCourse" data-id="28" data-tip-down="编辑"><i className="iconfont icon-bianjidaibeijing"></i></a>
</span>
</li>
<li className="clearfix">
<span className="column-1">4</span>
<span className="column-1">0.35</span>
<span className="column-3">安装配置和选择主流的数据库管理系统运用SQL语言实施数据库解决方案包括数据定义数据更新和数据查询等</span>
<span className="column-2 edu-txt-center">75</span>
<span className="column-3">
<input type="hidden" value="84"></input>
<label>5-1</label>使
</span>
<span className="column-1 edu-txt-right">
<a href="javascript:void(0)" onclick="delete_confirm_box_2('/ec_course_targets/29', '确定要删除该课程目标吗')" className="color-grey-c mr15" data-tip-down="删除"><i className="iconfont icon-shanchu font-15"></i></a>
<a href="javascript:void(0)" className="color-green EditCourse" data-id="29" data-tip-down="编辑"><i className="iconfont icon-bianjidaibeijing"></i></a>
</span>
</li>
<li className="clearfix">
<span className="column-1">5</span>
<span className="column-1">0.35</span>
<span className="column-3">针对计算机工程问题综合运用数据库设计知识设计规范的数据库解决方案</span>
<span className="column-2 edu-txt-center">75</span>
<span className="column-3">
<input type="hidden" value="76"></input>
<label>3-1</label>
</span>
<span className="column-1 edu-txt-right">
<a href="javascript:void(0)" onclick="delete_confirm_box_2('/ec_course_targets/30', '确定要删除该课程目标吗')" className="color-grey-c mr15" data-tip-down="删除"><i className="iconfont icon-shanchu font-15"></i></a>
<a href="javascript:void(0)" className="color-green EditCourse" data-id="30" data-tip-down="编辑"><i className="iconfont icon-bianjidaibeijing"></i></a>
</span>
</li> */}
</div>
</div>
);
}
}
export default ShowTableCourseSupportSetting;

@ -0,0 +1,294 @@
import React, { Component } from 'react';
import moment from 'moment'
import EditableCourseSupportSetting from './EditableCourseSupportSetting'
import ShowTableCourseSupportSetting from './ShowTableCourseSupportSetting'
import { Form, Input, Icon, Button, Select } from 'antd';
// import EcTitleCourseEvaluations from '../ecTitle/ecTitle'
import { SnackbarHOC, getUrl } from 'educoder'
import axios from 'axios'
import 'antd/dist/antd.css';
// import '../css/ecCourseEvaluations.css'
import './style.scss'
import { ECModalHOC } from '../../common/ECModalHOC'
const { Option } = Select;
// TODO 公共方法 或 抽取到顶层组件
let _url_origin = getUrl()
const $ = window.$
// https://www.educoder.net/stylesheets/educoder/edu-all.css?1546618720
// if (!window['EcCourseSupportSettingLoaded']) {
// $('head').append( $('<link rel="stylesheet" type="text/css" />')
// .attr('href', `${_url_origin}/stylesheets/educoder/edu-all.css?1525440977`) );
// window['EcCourseSupportSettingLoaded'] = true
// }
class EcCourseSupportSetting extends Component {
constructor(props) {
super(props)
this.state = {
editableMode: false,
requirements: []
}
}
updateCourseTargets = (course_targets) => {
const ec_course_id = this.props.match.params.ec_course_id;
const url = `/ec_courses/${ec_course_id}/crud_targets`
// 后台数据存的weigths
course_targets.forEach( (item,index) => {
course_targets[index].weigths = item.target_weight
delete course_targets[index].target_weight
})
axios.post(url, {
"targets": course_targets
}
).then((response) => {
if (!response.data || response.data.status == -1) {
this.props.showModal('提示', '接口异常或无数据')
return ;
}
let map = this.getSubitemIdMap()
course_targets.forEach( (item,index) => {
course_targets[index].target_weight = item.weigths
course_targets[index].index = map[item.subitem_id].index
course_targets[index].subitem_contents = map[item.subitem_id].subitem_contents
delete course_targets[index].weigths
})
// subitem_contents
this.setState({ course_targets })
this.setEditableMode(false)
}).catch((error) => {
console.log(error)
})
}
getSubitemIdMap = () => {
if (!this.state.requirements) {
return {}
}
let map = {}
this.state.requirements.forEach( (item,index) => {
map[item.subitem_id] = item
})
return map;
}
fetchRequirements = () => {
const url = `/ec_years/${this.props.year.id}/graduation_subitems.json`
axios.get(url, {
})
.then((response) => {
if (response.data && response.data.graduation_subitems) {
const requirements = response.data.graduation_subitems.map((item, index) => {
return {
index: `${item.graduation_requirement_position}-${item.position}`,
subitem_contents: item.content,
subitem_id: item.id,
}
})
this.setState({ requirements })
} else {
this.props.showModal('提示', '接口异常或无数据')
// 服务端返回的数据有误
}
})
.catch(function (error) {
console.log(error);
});
}
fetchCourseTargets = () => {
const ec_course_id = this.props.match.params.ec_course_id;
//这里给了一个默认的参数。。。。。。。。。。。。。
const course_id = 706
const url = `/ec_courses/${course_id}/course_targets.json`
// `/ec_courses/${ec_course_id}/ec_course_support_setting_data`
axios.get(url, {
})
.then((response) => {
if (response.data && response.data.course_targets) {
if (response.data.course_targets.length === 0) {
response.data.course_targets = [
{"target_contents":"","target_weight":'',"position": 1,"standard_grade":75,"subitem_id":"","index":"","subitem_contents":""},
{"target_contents":"","target_weight":'',"position": 2,"standard_grade":75,"subitem_id":"","index":"","subitem_contents":""},
{"target_contents":"","target_weight":'',"position": 3,"standard_grade":75,"subitem_id":"","index":"","subitem_contents":""},
]
this.setEditableMode(true)
} else {
response.data.course_targets = response.data.course_targets.map((item, index) => {
const graduation_subitem = item.graduation_subitem
return {
index: `${graduation_subitem.position}-${graduation_subitem.graduation_requirement_position}`,
position: index + 1,
standard_grade: item.standard_grade,
subitem_contents: graduation_subitem.content,
subitem_id: graduation_subitem.id,
target_contents: item.content,
target_id: item.id,
target_weight: item.weight
}
})
}
this.setState({ ...response.data })
} else {
this.props.showModal('提示', '接口异常或无数据')
// 服务端返回的数据有误
}
})
.catch(function (error) {
console.log(error);
});
// test data
// this.setState({ ...fake_data })
}
getNavigationData=(ec_course_id)=>{
return;
// const jol =`/ec_major_schools/get_navigation_data?ec_year_id=`+ec_year_id+"&ec_course_id="+ec_course_id;
const jol =`/ec_major_schools/get_navigation_data?ec_course_id=`+ec_course_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);
});
}
componentDidMount = () => {
// console.log('componentDidMountEcCourseSupportSetting');
// console.log(this.props);
// console.log(this.props.match);
// console.log(this.props.match.params);
// console.log(this.props.match.params.ec_course_id);
this.fetchCourseTargets();
const ec_course_id = this.props.match.params.ec_course_id;
this.getNavigationData(ec_course_id);
this.props.Ontitine("ec_course_support_setting");
}
setEditableMode = (mode) => {
if (mode) {
this.fetchRequirements()
}
this.setState({ editableMode: mode })
}
render() {
let { editableMode, schooldata, is_manager } = this.state;
if (!schooldata) schooldata = {}
const course_targets = this.state.course_targets;
return (
<React.Fragment>
{/* <div className="newMain clearfix courseSupport">
<div className="educontent mb50 mt60">
</div>
</div> */}
{/* <EcTitleCourseEvaluations
{...this.props}
schooldata={schooldata}
ecComponentState={'ecCompletion'}
ecpath={"ec_course_support_setting"}
></EcTitleCourseEvaluations> */}
{/* <p class="clearfix padding20-30 bor-bottom-greyE">
<span class="fl font-18">
<a href="/ec_major_schools/1/academic_years/1/ec_course_setting" class="color-grey-9">课程体系</a>
<span class="color-grey-9"> &gt; </span>
{schooldata && ( schooldata.ec_course_name || '')}
</span>
<a href="/ec_courses/1/export_ec_course_targets.xls" class="white-btn edu-blueback-btn fr"
style={{ 'marginTop': '4px' }}
>导出课程目标</a>
</p> */}
{/* <div className="edu-back-white eacourse">
<p className="clearfix padding20-30 bor-bottom-greyE" id="SystemParametersP">
<a href={schooldata.course_setting_url} className="TrainingLecturer color-grey-9">课程体系 </a> >
<a className="TrainingTheory major_name"> {schooldata.ec_course_name}</a>
<span className="Importclassroomdata" style={{top: '22px'}}>
<a className="white-btn edu-blueback-btn fr mb10 mr10"
href={`/ec_courses/${this.props.match.params.ec_course_id}/export_ec_course_targets?format=xls`}
>导出课程目标</a>
</span>
</p>
<div style={{padding: '20px 21px'}} id="SystemParameters" className={"SystemParameters"}>
<a className="fl SystemParameters color4CACFF" style={{display:schooldata.ec_course_support_setting_url===null?"none":"block",marginLeft: '8px' }}
href={schooldata.ec_course_support_setting_url}>1.课程目标</a>
<a className="fl SystemParameters4CACFF ml40 color4D4D4D"
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 SystemParameters4CACFF ml40 color4D4D4D"
style={{display:schooldata.evaluation_methods_url===null?"none":"block"}}
href={schooldata.evaluation_methods_url}>4.课程目标评价方法</a>
<a className="fl SystemParameters ml40 color4D4D4D"
style={{display:schooldata.competition_calculation_info_url===null?"none":"block"}}
href={schooldata.competition_calculation_info_url}>5.课程达成评价结果</a>
</div>
</div> */}
{/* && is_manager */}
<div>
{ course_targets&&course_targets.length>=0 ? (editableMode ?
<EditableCourseSupportSetting
setEditableMode={this.setEditableMode}
{...this.props}
{...this.state}
updateCourseTargets={this.updateCourseTargets}
></EditableCourseSupportSetting>
: <ShowTableCourseSupportSetting
setEditableMode={this.setEditableMode}
{...this.props}
{...this.state}
></ShowTableCourseSupportSetting> ) : ''
}
</div>
{/* <EditableCourseSupportSetting
setEditableMode={this.setEditableMode}
></EditableCourseSupportSetting>
<ShowTableCourseSupportSetting
setEditableMode={this.setEditableMode}
></ShowTableCourseSupportSetting> */}
</React.Fragment>
);
}
}
export default ECModalHOC() ( SnackbarHOC() ( ( EcCourseSupportSetting ) ) );

@ -0,0 +1,44 @@
.courseSupport .ant-form-item-children {
display: flex;
}
/* @media (min-width: 576px) */
.courseSupport .ant-col-sm-offset-4 {
margin-left: 0;
}
.courseSupport .ant-form-explain {
display: none;
}
.courseSupport .ant-form-item {
margin-bottom: 6px;
}
.courseSupport textarea.ant-input {
min-height: 35px;
}
.courseSupport .ListTableLine .column-1 {
flex: 0 0 100px;
}
.courseSupport .ListTableLine .column-2 {
flex: 0 0 180px;
}
.courseSupport .ListTableLine .column-3 {
flex: 0 0 330px;
}
.SystemParameters {
min-height: 60px;
}
p {
margin-bottom: 0px;
}
div#show-Target-table {
background: #fff;
}
/* 火狐select宽度会根据长度变 */
.courseSupport .ant-select-selection--single {
max-width: 317px
}

@ -1,13 +1,12 @@
import React, { Component } from 'react';
import axios from 'axios';
import { Spin } from 'antd';
import { TPMIndexHOC } from '../../../tpm/TPMIndexHOC';
import { SnackbarHOC,getImageUrl } from 'educoder'
import { Pagination,Upload,Modal,Checkbox } from 'antd';
import { Pagination,Upload,Modal,Checkbox,Spin } from 'antd';
import EcTitleCourseEvaluations from '../../ecTitle/ecTitle'
@ -31,65 +30,94 @@ class EcStudentList extends Component {
student_id:undefined,
Modallisttypess:0,
ismanager:false,
isSpin:false
isSpin:false,
pages:1,
per_pages:20,
total_student:0,
Myschoolstudents:[],
}
}
componentDidMount(){
window.document.title = '学生列表';
let major_id=this.props.match.params.major_id;
let year_id=this.props.match.params.year_id;
// const url ='/ec_major_schools/'+major_id+'/academic_years/'+year_id+'/student_lists_data';
// axios.get(url, {
// withCredentials: true,
// }).then((response) => {
// if(response.status===200){
// this.setState({
// majorschoollist:response.data,
// ismanager:response.data.ismanager,
// })
// }
// })
// .catch(function (error) {
// console.log(error);
// });
// let majorschoollist={
// ec_students: [{index: 1, student_name: "同意", student_id: "s20111458"},
// {index: 1, student_name: "同意", student_id: "s20111458"},
// {index: 2, student_name: "涛哥", student_id: "2011554f4"},
// {index: 3, student_name: "例如", student_id: "20154787b"},
// {index: 4, student_name: "问问", student_id: "201548580014"},
// {index: 5, student_name: "嗯嗯", student_id: "2015748912321234"},
// {index: 6, student_name: "让人", student_id: "20157456"},
// {index: 7, student_name: "方法", student_id: "20159658"},
// {index: 8, student_name: "全球", student_id: "20159632"},
// {index: 9, student_name: "是说", student_id: "20154512"},
// {index: 10, student_name: "谷歌", student_id: "20157932"},
// {index: 11, student_name: "版本", student_id: "20159635"},
// {index: 12, student_name: "捏捏", student_id: "20153451"},
// ],
// import_url: "/ec_major_schools/3/academic_years/10/import_students",
// show_name: true,
// template_url: "/attachments/download/227528/01_学生列表导入模板.xls",
// total_page: 1
// }
// this.setState({
// majorschoollist:majorschoollist
// })
let major_id=this.props.match.params.majorId;
let year_id=this.props.match.params.yearId;
const url ='/ec_years/'+year_id+'/students.json';
axios.get(url, {params: {
page:this.state.pages,
per_page:this.state.per_pages,
}}).then((response) => {
if(response){
if(response.status){
if(response.status===200){
this.setState({
total_student:response.data.count,
majorschoollist:response.data,
ismanager:response.data.ismanager,
});
try {
if(response.data.students.length>0){
var mst=response.data.students;
for(var i=0;i<mst.length;i++){
mst[i].istrue=false;
}
this.setState({
Myschoolstudents:mst
});
}
}catch (e) {
this.setState({
Myschoolstudents:[]
});
}
}
}
}
})
.catch(function (error) {
console.log(error);
});
}
uploadcomponentDidMount(){
let major_id=this.props.match.params.major_id;
let year_id=this.props.match.params.year_id;
const url ='/ec_major_schools/'+major_id+'/academic_years/'+year_id+'/student_lists_data';
axios.get(url, {
withCredentials: true,
}).then((response) => {
if(response.status===200){
this.setState({
majorschoollist:response.data,
ismanager:response.data.ismanager,
})
let major_id=this.props.match.params.majorId;
let year_id=this.props.match.params.yearId;
const url ='/ec_years/'+year_id+'/students.json';
axios.get(url, {params: {
page: this.state.pages,
per_page: this.state.per_pages,
}
}
).then((response) => {
if(response){
if(response.status){
if(response.status===200){
this.setState({
total_student:response.data.count,
majorschoollist:response.data,
ismanager:response.data.ismanager,
});
try {
if(response.data.students.length>0){
var mst=response.data.students;
for(var i=0;i<mst.length;i++){
mst[i].istrue=false;
}
this.setState({
Myschoolstudents:mst
});
}
}catch (e) {
this.setState({
Myschoolstudents:[]
});
}
}
}
}
})
.catch(function (error) {
console.log(error);
@ -103,29 +131,37 @@ class EcStudentList extends Component {
uploadfile=(file)=>{
console.log("导入的文件");
console.log(file);
this.setState({isSpin:true})
let {majorschoollist}=this.state;
let Url =majorschoollist.import_url;
let year_id=this.props.match.params.yearId;
let Url ='/ec_years/'+year_id+'/students/import.json';
const config = {
headers: { "Content-Type": "multipart/form-data" }
};
const form = new FormData();
form.append('file', file.file);
axios.post(Url,form
).then((response) => {
if(response.data.status===1){
,config).then((response) => {
if(response.data.status===0){
// message.success('已成功导入'+response.data.count+"条数据!");
this.setState({
// titlemessage: response.data.message+"(支撑关系变更)",
Modallist: '已成功导入'+response.data.count+"条数据!",
Modallist: '已成功导入'+response.data.success_count+"条数据!",
Modallisttype:true,
Modallisttypes:1,
Modallisttypess:0,
isSpin:false
})
}else if(response.data.status===0){
}else{
// message.warning(response.data.message);
this.setState({
// titlemessage: response.data.message+"(支撑关系变更)",
Modallist:response.data.message,
Modallisttype:true,
Modallisttypes:0,
Modallisttypess:0,
isSpin:false
})
}
@ -133,8 +169,7 @@ class EcStudentList extends Component {
console.log(error)
})
}
hidemodeldelete=()=>{
let {Modallisttypes}=this.state;
hidemodeldelete=(Modallisttypes)=>{
this.setState({
Modallisttype:false,
Modallist:'',
@ -147,59 +182,83 @@ class EcStudentList extends Component {
}
showecStudentList=(page)=>{
let major_id=this.props.match.params.major_id;
let year_id=this.props.match.params.year_id;
const url ='/ec_major_schools/'+major_id+'/academic_years/'+year_id+'/student_lists_data?page='+page;
axios.get(url, {
withCredentials: true,
}).then((response) => {
if(response.status===200){
this.setState({
majorschoollist:response.data,
ismanager:response.data.ismanager,
})
let major_id=this.props.match.params.majorId;
let year_id=this.props.match.params.yearId;
const url ='/ec_years/'+year_id+'/students.json';
axios.get(url, {params: {
page:page,
per_page:this.state.per_pages,
}}).then((response) => {
if(response){
if(response.status){
if(response.status===200){
this.setState({
total_student:response.data.count,
majorschoollist:response.data,
ismanager:response.data.ismanager,
pages:page,
});
try {
if(response.data.students.length>0){
var mst=response.data.students;
for(var i=0;i<mst.length;i++){
mst[i].istrue=false;
}
this.setState({
Myschoolstudents:mst
});
}
}catch (e) {
this.setState({
Myschoolstudents:[]
});
}
}
}
}
}).catch(function (error) {
console.log(error);
});
}
};
//全选
onChangestudentall=(e)=>{
let {majorschoollist}=this.state;
let mewmajorschoollist=majorschoollist
for(var i=0; i<mewmajorschoollist.ec_students.length; i++){
mewmajorschoollist.ec_students[i].istrue=e.target.checked
let {Myschoolstudents}=this.state;
let mewmajorschoollist=Myschoolstudents
for(var i=0; i<mewmajorschoollist.length; i++){
mewmajorschoollist[i].istrue=e.target.checked
}
this.setState({
studentall:e.target.checked,
majorschoollist:mewmajorschoollist
Myschoolstudents:mewmajorschoollist
})
}
};
//单选
onChangestudent=(e)=>{
let {majorschoollist,studentall}=this.state;
let mewmajorschoollist=majorschoollist;
let {Myschoolstudents,studentall}=this.state;
let mewmajorschoollist=Myschoolstudents;
let newstudentall=studentall;
if(e.target.checked===false){
newstudentall=false
}
for(var i=0; i<mewmajorschoollist.ec_students.length; i++){
if(i===e.target.index&&e.target.id===mewmajorschoollist.ec_students[i].student_id){
mewmajorschoollist.ec_students[i].istrue=e.target.checked
for(var i=0; i<mewmajorschoollist.length; i++){
if(i===e.target.index&&e.target.id===mewmajorschoollist[i].student_id){
mewmajorschoollist[i].istrue=e.target.checked
}
}
this.setState({
student_id:e.target.id,
majorschoollist:mewmajorschoollist,
studentall:newstudentall
studentall:newstudentall,
Myschoolstudents:mewmajorschoollist
})
}
};
// 删除提示
deletelistbth=()=>{
let {majorschoollist,studentall} =this.state;
let {Myschoolstudents,studentall} =this.state;
let studentalltype=0
for(var i=0; i<majorschoollist.ec_students.length; i++){
if(majorschoollist.ec_students[i].istrue===true){
for(var i=0; i<Myschoolstudents.length; i++){
if(Myschoolstudents[i].istrue===true){
studentalltype=1
}
}
@ -215,32 +274,33 @@ class EcStudentList extends Component {
Modallisttype:true
})
}
}
};
//删除学生
deletelistbthenters=()=>{
let {majorschoollist,studentall} =this.state;
let major_id=this.props.match.params.major_id;
let year_id=this.props.match.params.year_id;
debugger
let {Myschoolstudents,studentall} =this.state;
let major_id=this.props.match.params.majorId;
let year_id=this.props.match.params.yearId;
let newstudent_id=[];
if(studentall===false){
for(var i=0; i<majorschoollist.ec_students.length; i++){
if(majorschoollist.ec_students[i].istrue===true){
newstudent_id.push(majorschoollist.ec_students[i].student_id)
for(var i=0; i<Myschoolstudents.length; i++){
if(Myschoolstudents[i].istrue===true){
newstudent_id.push(Myschoolstudents[i].id)
}
}
}
let url ='/ec_major_schools/'+major_id+'/academic_years/'+year_id+'/destroy_students'
let url ='/ec_years/'+year_id+'/students.json'
axios.delete(url,{data:{
all:studentall,
student_ids:newstudent_id,
ids:newstudent_id,
}}).then((response) => {
if(response.data.status===1){
if(response.data.status===0){
this.setState({
// Modallist: "删除成功!",
// Modallisttype:true,
Modallisttypes:1,
Modallisttypess:0
})
this.hidemodeldelete();
this.hidemodeldelete(1);
}
}).catch((error) => {
console.log(error)
@ -256,12 +316,10 @@ class EcStudentList extends Component {
studentall,
student_id,
Modallisttypess,
ismanager
total_student,
ismanager,
Myschoolstudents
}=this.state;
// ec_students: []
// import_url: "/ec_major_schools/:1/academic_years/:1/import_students"
// template_url: "javascript:void(0);"
// total_page: 0
const uploadProps = {
name: 'file',
@ -278,128 +336,154 @@ class EcStudentList extends Component {
}
}
return (
<div className="newMain clearfix">
<Modal
title={titlemessage}
// visible={modeldelet===true&&listid===list.id?true:false}
visible={Modallisttype}
className={"ecmodeldelet"}
closable={false}
footer={null}
>
<div className="task-popup-content">
<div className="task-popup-text-center font-14">{Modallist}</div>
</div>
<div className="task-popup-submit clearfix">
<a onClick={this.hidemodeldelete} className="task-btn fl">取消</a>
{
Modallisttypess===0?<a className="task-btn task-btn-orange fr"
onClick={this.hidemodeldelete}
>确定</a>:<a className="task-btn task-btn-orange fr"
onClick={this.deletelistbthenters}
>确定</a>
}
</div>
</Modal>
<div className="educontent mb290">
<div className="clearfix padding20-30 bor-bottom-greyE mb10 edu-back-white">
<span className="fl font-18 courseSystem ">学生列表</span>
<a className="fr font-15 courseSystem" onClick={this.windowsgoblack}>返回</a>
</div>
<div className="edu-back-white eacourse">
<div className="clearfix padding20-30 bor-bottom-greyE"><span
className=" font-18 courseSystem">学生列表
{majorschoollist===undefined?"":majorschoollist.total_student}
</span>
<div className="color-grey-9 mr10">提供模板支持导入学生信息(请先下载模板) <a className={"color-blue"} onClick={() => window.elasticLayer(3533)}>查看详情</a></div>
</div>
<div className="padding20-30 padbottom" id="training_objective_contents">
{ismanager===false?"":
<span className="mr30">请使用导入模板<a href={majorschoollist===undefined?"":majorschoollist.template_url} className="color-green"><i className="iconfont icon-fujian mr5 color-green font-16"></i></a>便</span>
}
<a className="white-btn edu-orangeback-btn fr mr10" >
{ismanager===false?"":<Upload
{...uploadProps}
showUploadList={false}
style={{color:'#fff'}}
>
导入
</Upload>}
</a>
</div>
<div id="training_objective_contents" className='deletelist' >
{ismanager===false?"":<div className="white-btn deletebth ml30 mr10" onClick={this.deletelistbth}>
删除
</div>}
</div>
<Spin spinning={this.state.isSpin}>
<div className="ListTableLine minH-560 edu-back-white mb80" id="listContent">
<p className="clearfix">
<span className="column-No column-2 relative">
<Checkbox
className={'mr20 changestudent'}
checked={studentall===true?true:false}
onChange={this.onChangestudentall}></Checkbox>
序号
</span>
<span className="column-2" style={{display:majorschoollist===undefined?"":majorschoollist.show_name===false?"none":'inline-block'}}>姓名</span>
<span className="column-2">学号</span>
</p>
<ul>
{
majorschoollist===undefined?
<div className="edu-txt-center color-grey-9 pt50">
<p className="mb20"><img className="edu-nodata-img mb20" src={getImageUrl("images/educoder/nodata.png")} /></p>
<p>学生数据为空请导入数据</p>
</div>
:majorschoollist.ec_students.length===0?
<div className="edu-txt-center color-grey-9 pt50">
<p className="mb20"><img className="edu-nodata-img mb20" src={getImageUrl("images/educoder/nodata.png")}/></p>
<p>学生数据为空请导入数据</p>
</div>:majorschoollist.ec_students.map((item,key)=>{
// console.log(item)
return(
<li className="clearfix" key={key}>
<span className="column-No column-2 relative">
<Checkbox
className={'mr20 changestudents'}
checked={item.istrue===true?true:false}
key={key}
index={key}
onChange={this.onChangestudent} id={item.student_id}></Checkbox>
{item.index}
</span>
<span className="column-2" style={{display:majorschoollist===undefined?"none":majorschoollist.show_name===false?"none":'inline-block'}}>{item.student_name}</span>
<span className="column-2">{item.student_id}</span>
</li>
)
})
}
</ul>
<div style={{width:'100%',position: 'relative'}}>
{
majorschoollist===undefined?"":majorschoollist.total_page===0||majorschoollist.total_student<51?"": <Pagination size="small" className={"pagelistStudentList mt30"} pageSize={50} showQuickJumper defaultCurrent={1} total={majorschoollist.total_student} onChange={this.showecStudentList} />
}
</div>
</div>
</Spin>
</div>
</div>
</div>
<div className="newMain clearfix">
<Modal
title={titlemessage}
// visible={modeldelet===true&&listid===list.id?true:false}
visible={Modallisttype}
className={"ecmodeldelet"}
closable={false}
footer={null}
>
<div className="task-popup-content">
<div className="task-popup-text-center font-14">{Modallist}</div>
</div>
<div className="task-popup-submit clearfix">
<a onClick={()=>this.hidemodeldelete(1)} className="task-btn fl">取消</a>
{
Modallisttypess===0?<a className="task-btn task-btn-orange fr"
onClick={()=>this.hidemodeldelete(1)}
>确定</a>:<a className="task-btn task-btn-orange fr"
onClick={this.deletelistbthenters}
>确定</a>
}
</div>
</Modal>
<div className="educontent mb290">
<div className="clearfix padding20-30 bor-bottom-greyE mb10 edu-back-white">
<span className="fl font-18 courseSystem ">学生列表</span>
<a className="fr font-15 courseSystem" onClick={this.windowsgoblack}>返回</a>
</div>
<div className="edu-back-white ">
<div className="clearfix padding20-30 bor-bottom-greyE"><span
className=" font-18 courseSystem">学生列表
{total_student}
</span>
<div className="color-grey-9 mr10">提供模板支持导入学生信息(请先下载模板)
{/*<a className={"color-blue"} onClick={() => window.elasticLayer(3533)}>查看详情</a>*/}
</div>
</div>
<div className="padding20-30 padbottom" id="training_objective_contents">
{ismanager===false?"":
<span className="mr30">请使用导入模板<a href={'/attachments/download/279190/01_学生列表导入模板2.0.xls'} className="color-green"><i className="iconfont icon-fujian mr5 color-green font-16"></i></a>便</span>
}
<a className="white-btn edu-orangeback-btn fr mr10" >
{ismanager===false?"":<Upload
{...uploadProps}
showUploadList={false}
style={{color:'#fff'}}
>
导入
</Upload>}
</a>
</div>
<div id="training_objective_contents" className='deletelist' >
{ismanager===false?"":<div className="white-btn deletebth ml30 mr10" onClick={this.deletelistbth}>
删除
</div>}
</div>
<Spin spinning={this.state.isSpin}>
<div>
<div className="ListTableLine minH-500 edu-back-white" id="listContent">
<p className="clearfix">
<span className="column-No column-2 relative">
<Checkbox
className={'mr20 changestudent'}
checked={studentall===true?true:false}
onChange={this.onChangestudentall}></Checkbox>
序号
</span>
<span className="column-2">姓名</span>
<span className="column-2">学号</span>
</p>
<style>{
`
.myslispan{
display: flex;
flex-direction:initial;
}
`
}</style>
<ul>
{
Myschoolstudents===undefined?
<div className="edu-txt-center color-grey-9 pt50">
<p className="mb20"><img className="edu-nodata-img mb20" src={getImageUrl("images/educoder/nodata.png")} /></p>
<p>学生数据为空请导入数据</p>
</div>
:Myschoolstudents&&Myschoolstudents.length===0?
<div className="edu-txt-center color-grey-9 pt50">
<p className="mb20"><img className="edu-nodata-img mb20" src={getImageUrl("images/educoder/nodata.png")}/></p>
<p>学生数据为空请导入数据</p>
</div>:Myschoolstudents&&Myschoolstudents.map((item,key)=>{
// console.log(item)
return(
<li className="clearfix myslispan" key={key}>
<div className="column-No column-2 relative">
<Checkbox
className={'mr20 changestudents'}
checked={item.istrue===true?true:false}
key={key}
index={key}
onChange={this.onChangestudent} id={item.student_id}></Checkbox>
{item.index}
</div>
<div className="column-2" >{item.name}</div>
<div className="column-2">{item.student_id}</div>
</li>
)
})
}
</ul>
</div>
</div>
<style>
{
`
.idpagin{
width: 100% !important;
display: flex;
justify-content: center;
}
`
}
</style>
<div style={{width:'100%',position: 'relative'}}>
{
majorschoollist&&majorschoollist.students&&majorschoollist.students.length===0?"":
<Pagination className={"pagelistStudentList mt30 idpagin"}
showQuickJumper current={this.state.pages}
onChange={this.showecStudentList} pageSize={20}
total={majorschoollist&&majorschoollist.count}></Pagination>
}
</div>
</Spin>
</div>
</div>
</div>
)
}
}
export default SnackbarHOC() (EcStudentList);
export default SnackbarHOC() (EcStudentList);

@ -1,6 +1,5 @@
.pagelistStudentList{
position: absolute;
padding-left: 40%;
}
.relative{

@ -3739,7 +3739,8 @@ a.singlepublishtwo{
}
.ant-tooltip{
max-width: 100% !important;
/* 这里会存在很长的字符串,如果不折行会影响阅读 */
max-width: 600px !important;
}
.square-main p{

Loading…
Cancel
Save