content: // 加载 React 相关组件
  import React, { Component } from 'react';
  // 加载 Ant Design 相关组件
  import { Icon } from 'antd';
  // 加载 Dva 相关组件
  import { connect } from 'dva';
  // 加载样式
  import Styles from '../styles/StudentLayout.less';
  // 加载自定义组件
  import CourseAttendance from '../components/Student/CourseAttendance';
  import AttendanceConfirm from '../components/Student/AttendanceConfirm';
  import SetPassword from '../components/SetPassword';
  import AttendanceResult from '../components/Student/AttendanceResult';
  
  // 创建 StudentLayout 相关组件
  class StudentLayout extends Component {
    // 构造方法
    constructor(props) {
      super(props);
      this.state = {
        selectedKey: 1, // 设置选中的菜单项
        displayComponent: '', // 设置显示的组件
      };
    }
    // 获取显示组件方法
    getDisplayComponent(selectedKey) {
      let displayComponent = '';
      switch (selectedKey * 1) {
        // 课程考勤页面
        case 1: displayComponent = (
          <CourseAttendance
            parentThis={this}
            confirmAttendanceMessage={this.confirmAttendanceMessage}
            handleLoadingLayoutSwitch={this.props.handleLoadingLayoutSwitch}
            handleChangeDisplayComponent={this.props.handleChangeDisplayComponent}
          />
        ); break;
        // 考勤统计页面
        case 2: displayComponent = <AttendanceResult />; break;
        // 修改密码页面
        case 3: displayComponent = <SetPassword />; break;
      }
      return displayComponent;
    }
    // 选择菜单按钮事件
    handleSelectMenu(selectedKey) {
      this.setState({
        selectedKey: selectedKey,
        displayComponent: this.getDisplayComponent(selectedKey),
      });
    }
    // 组件加载前预处理方法
    componentWillMount() {
      this.handleSelectMenu(1); // 默认选中"课程考勤页面"
    }
    // 取消本次考勤方法
    cancelAttendance() {
      this.handleSelectMenu(1);
    }
    // 确认考勤信息方法
    confirmAttendanceMessage(teacherCourseData) {
      this.setState({
        selectedKey: 4,
        displayComponent: (
          <AttendanceConfirm
            parentThis={this}
            teacherCourseData={teacherCourseData}
            cancelAttendance={this.cancelAttendance.bind(this)}
            handleLoadingLayoutSwitch={this.props.handleLoadingLayoutSwitch.bind(this)}
            handleChangeDisplayComponent={this.props.handleChangeDisplayComponent}
            handleSelectMenu={this.handleSelectMenu}
          />
        ),
      });
    }
    // 组件渲染方法
    render() {
      return (
        <div className={Styles['student-layout']}>
          <nav>
            <button
              className={this.state.selectedKey === 1 ? Styles['button-active'] : ''}
              onClick={this.handleSelectMenu.bind(this, 1)}
            >
              <Icon type='schedule' /><br />
              <span>课程考勤</span>
            </button>
            <button
              className={this.state.selectedKey === 2 ? Styles['button-active'] : ''}
              onClick={this.handleSelectMenu.bind(this, 2)}
            >
              <Icon type='bar-chart' /><br />
              <span>考勤结果</span>
            </button>
            <button
              className={this.state.selectedKey === 3 ? Styles['button-active'] : ''}
              onClick={this.handleSelectMenu.bind(this, 3)}
            >
              <Icon type='setting' /><br />
              <span>修改密码</span>
            </button>
          </nav>
          {this.state.displayComponent}
        </div>
      );
    }
  }
  
  // 定义待绑定的数据
  const mapStateProps = (store) => {
    return {
      mapLoginData: store.getLoginData,
    };
  };
  
  // 导出组件
  export default connect(mapStateProps)(StudentLayout);