import React from 'react'; import { Switch, Route, Link } from 'react-router-dom'; import { Steps, Breadcrumb } from 'antd'; import axios from 'axios'; import './index.scss'; import CustomLoadable from "../../../CustomLoadable"; import Loadable from 'react-loadable'; import Loading from "../../../Loading"; const { Step } = Steps; const steps = ["培养目标", "毕业要求", "培养目标VS毕业要求", "毕业要求VS通用标准", "学生", "课程体系", "课程体系VS毕业要求", "达成度评价结果"]; const stepTypes = ["training_objectives", "graduation_requirement", "requirement_vs_objective", "requirement_vs_standard", "students", "courses", "requirement_vs_courses", "reach_calculation_info"]; const EcStudentList=Loadable({ loader: () => import('../subroute/ecStudentList/EcStudentList'), loading: Loading, }); 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, }); const GraduationRequirement=Loadable({ loader: () => import('./GraduationRequirement/index'), loading: Loading, }); 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) { super(props); this.state = { schoolId: null, majorId: props.match.params.majorId, yearId: props.match.params.yearId, year: null, stepIndex: 0, } } componentDidMount() { this.setupStep(); this.getYearDetail(); } getYearDetail = () => { let { majorId, yearId } = this.state; axios.get(`/ec_major_schools/${majorId}/ec_years/${yearId}.json`).then(res => { if(res){ this.setState({ year: res.data, schoolId: res.data.school_id }) } }).catch(e => console.log(e)) } onStepChange = (stepIndex) => { let { majorId, yearId } = this.state; 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 { this.props.history.push(`/ecs/major_schools/${majorId}/years/${yearId}/${type}`); // } } setupStep = () => { let type = this.props.match.params.type; let stepIndex = stepTypes.indexOf(type); this.setState({ stepIndex: stepIndex }); } render() { let { year, schoolId, majorId, yearId } = this.state; let { stepIndex } = this.state; return (
{ year && year.school_name } { year && year.major_name } {year && year.year}届
{ steps.map((title, index) => { return ( ) }) }
{ year && ( () }> () }> () }> {/* 毕业要求对培养目标的支撑 */} () }> {/* 毕业要求对通用标准的支撑 */} () }> {/*学生*/} () }> {/*课程体系*/} () }> {/*课程体系资源子页面Subpage*/} () }> {/*课程体系VS毕业要求*/} () }> {/*达成度评价结果*/} () }> ) }
) } } export default EcSetting