diff --git a/app/controllers/colleges_controller.rb b/app/controllers/colleges_controller.rb index 51a8b7123..707255866 100644 --- a/app/controllers/colleges_controller.rb +++ b/app/controllers/colleges_controller.rb @@ -44,8 +44,8 @@ class CollegesController < ApplicationController (SELECT count(c.id) FROM courses c, course_members m WHERE c.id != 1309 and m.course_id = c.id AND m.user_id=users.id AND m.role in (1,2,3) and c.school_id = #{current_school.id} AND c.is_delete = 0) as course_count FROM `users`, user_extensions ue where ue.school_id=#{current_school.id} and users.id=ue.user_id and ue.identity=0 ORDER BY publish_shixun_count desc, course_count desc, id desc LIMIT 10") # ).order("publish_shixun_count desc, experience desc").limit(10) - @teacher_count = UserExtension.where(school_id: current_school.id) - .select('SUM(IF(identity=0, 1, 0)) AS teachers_count').first.teachers_count + # @teacher_count = UserExtension.where(school_id: current_school.id) + # .select('SUM(IF(identity=0, 1, 0)) AS teachers_count').first.teachers_count @teachers = @teachers.map do |teacher| course_ids = Course.find_by_sql("SELECT c.id FROM courses c, course_members m WHERE c.id != 1309 and m.course_id = c.id AND m.role in (1,2,3) AND m.user_id=#{teacher.id} AND c.is_delete = 0 and c.school_id = #{current_school.id}") @@ -99,7 +99,7 @@ class CollegesController < ApplicationController @course_count = courses.size courses = courses.left_joins(practice_homeworks: { student_works: { myshixun: :games } }) - .select('courses.id, courses.name, courses.is_end, sum(games.evaluate_count) evaluating_count') + .select('courses.id, courses.name, courses.is_end, IFNULL(sum(games.evaluate_count), 0) evaluating_count') .group('courses.id').order('is_end asc, evaluating_count desc') @courses = paginate courses @@ -117,7 +117,7 @@ class CollegesController < ApplicationController # 学生实训 def student_shixun - @student_count = User.joins(:user_extension).where(user_extensions: { school_id: current_school.id, identity: 1 }).count + # @student_count = User.joins(:user_extension).where(user_extensions: { school_id: current_school.id, identity: 1 }).count @students = User.joins(:user_extension).where(user_extensions: { school_id: current_school.id, identity: 1 }).includes(:user_extension).order('experience desc').limit(10) student_ids = @students.map(&:id) @@ -158,7 +158,7 @@ class CollegesController < ApplicationController return true if current_user.admin_or_business? # 超级管理员|运营 return true if current_college.is_a?(Department) && current_college.member?(current_user) # 部门管理员 return true if current_user.is_teacher? && current_user.school_id == current_school.id # 学校老师 - return true if current_school.customers.exists? && current_user.partner&.partner_customers&.exists?(customer_id: current_school.customer_id) + # return true if current_school.customers.exists? && current_user.partner&.partner_customers&.exists?(customer_id: current_school.customer_id) false end diff --git a/app/controllers/homework_commons_controller.rb b/app/controllers/homework_commons_controller.rb index 8a1c07ddf..638971dfc 100644 --- a/app/controllers/homework_commons_controller.rb +++ b/app/controllers/homework_commons_controller.rb @@ -167,7 +167,11 @@ class HomeworkCommonsController < ApplicationController if params[:work_status].present? params_work_status = params[:work_status] work_status = params_work_status.map{|status| status.to_i} - @student_works = @student_works.where(compelete_status: work_status) + if @homework.homework_type == "practice" + @student_works = @student_works.where(compelete_status: work_status) + else + @student_works = @student_works.where(work_status: work_status) + end end # 分班情况 diff --git a/app/models/curriculum.rb b/app/models/curriculum.rb deleted file mode 100644 index 0b78814bc..000000000 --- a/app/models/curriculum.rb +++ /dev/null @@ -1,4 +0,0 @@ -class Curriculum < ApplicationRecord - belongs_to :curriculum_direction - has_many :knowledge_points, dependent: :destroy -end diff --git a/app/models/curriculum_direction.rb b/app/models/curriculum_direction.rb deleted file mode 100644 index 1c9211559..000000000 --- a/app/models/curriculum_direction.rb +++ /dev/null @@ -1,4 +0,0 @@ -class CurriculumDirection < ApplicationRecord - has_many :curriculums - has_many :knowledge_points -end diff --git a/app/models/item_bank.rb b/app/models/item_bank.rb index 32c349e34..8078a55e0 100644 --- a/app/models/item_bank.rb +++ b/app/models/item_bank.rb @@ -3,8 +3,6 @@ class ItemBank < ApplicationRecord # item_type: 0 单选 1 多选 2 判断 3 填空 4 简答 5 实训 6 编程 enum item_type: { SINGLE: 0, MULTIPLE: 1, JUDGMENT: 2, COMPLETION: 3, SUBJECTIVE: 4, PRACTICAL: 5, PROGRAM: 6 } - belongs_to :curriculum - belongs_to :curriculum_direction belongs_to :user has_one :item_analysis, dependent: :destroy diff --git a/app/models/knowledge_point.rb b/app/models/knowledge_point.rb deleted file mode 100644 index 3d75b66a1..000000000 --- a/app/models/knowledge_point.rb +++ /dev/null @@ -1,5 +0,0 @@ -class KnowledgePoint < ApplicationRecord - belongs_to :curriculum_direction - belongs_to :curriculum - has_many :knowledge_point_containers, dependent: :destroy -end diff --git a/app/models/knowledge_point_container.rb b/app/models/knowledge_point_container.rb deleted file mode 100644 index ea73d00e7..000000000 --- a/app/models/knowledge_point_container.rb +++ /dev/null @@ -1,3 +0,0 @@ -class KnowledgePointContainer < ApplicationRecord - belongs_to :knowledge_point -end diff --git a/app/views/colleges/student_shixun.json.jbuilder b/app/views/colleges/student_shixun.json.jbuilder index 431603afa..97e418148 100644 --- a/app/views/colleges/student_shixun.json.jbuilder +++ b/app/views/colleges/student_shixun.json.jbuilder @@ -7,4 +7,4 @@ json.teachers @students do |student| json.grade student.grade json.experience student.experience end -json.student_count @student_count \ No newline at end of file +# json.student_count @student_count \ No newline at end of file diff --git a/app/views/colleges/teachers.json.jbuilder b/app/views/colleges/teachers.json.jbuilder index 29b383fa4..1308f0cf4 100644 --- a/app/views/colleges/teachers.json.jbuilder +++ b/app/views/colleges/teachers.json.jbuilder @@ -8,4 +8,4 @@ json.teachers @teachers do |teacher| json.complete_rate teacher['complete_rate'] json.publish_shixun_count teacher['publish_shixun_count'] end -json.teacher_count @teacher_count \ No newline at end of file +# json.teacher_count @teacher_count \ No newline at end of file diff --git a/db/migrate/20191218070922_create_curriculum_directions.rb b/db/migrate/20191218070922_create_curriculum_directions.rb deleted file mode 100644 index 9203aa435..000000000 --- a/db/migrate/20191218070922_create_curriculum_directions.rb +++ /dev/null @@ -1,9 +0,0 @@ -class CreateCurriculumDirections < ActiveRecord::Migration[5.2] - def change - create_table :curriculum_directions do |t| - t.string :name - - t.timestamps - end - end -end diff --git a/db/migrate/20191218071017_create_curriculums.rb b/db/migrate/20191218071017_create_curriculums.rb deleted file mode 100644 index 885f2a676..000000000 --- a/db/migrate/20191218071017_create_curriculums.rb +++ /dev/null @@ -1,10 +0,0 @@ -class CreateCurriculums < ActiveRecord::Migration[5.2] - def change - create_table :curriculums do |t| - t.string :name - t.references :curriculum_direction, index: true - - t.timestamps - end - end -end diff --git a/db/migrate/20191218071111_create_knowledge_points.rb b/db/migrate/20191218071111_create_knowledge_points.rb deleted file mode 100644 index 2f748d266..000000000 --- a/db/migrate/20191218071111_create_knowledge_points.rb +++ /dev/null @@ -1,11 +0,0 @@ -class CreateKnowledgePoints < ActiveRecord::Migration[5.2] - def change - create_table :knowledge_points do |t| - t.string :name - t.references :curriculum_direction, index: true - t.references :curriculum, index: true - - t.timestamps - end - end -end diff --git a/db/migrate/20191218071343_create_knowledge_point_containers.rb b/db/migrate/20191218071343_create_knowledge_point_containers.rb deleted file mode 100644 index 0b6944ea7..000000000 --- a/db/migrate/20191218071343_create_knowledge_point_containers.rb +++ /dev/null @@ -1,12 +0,0 @@ -class CreateKnowledgePointContainers < ActiveRecord::Migration[5.2] - def change - create_table :knowledge_point_containers do |t| - t.references :knowledge_point - t.integer :container_id - t.string :container_type - - t.timestamps - end - add_index :knowledge_point_containers, [:knowledge_point_id, :container_id, :container_type], name: "container_index", unique: true - end -end diff --git a/public/react/src/App.js b/public/react/src/App.js index 93b293e36..199847b7b 100644 --- a/public/react/src/App.js +++ b/public/react/src/App.js @@ -300,6 +300,11 @@ const Developer = Loadable({ loader: () => import('./modules/developer'), loading: Loading }) +// 学院统计 +const College = Loadable({ + loader: () => import('./college/College'), + loading: Loading +}) // 开发者编辑模块 const NewOrEditTask = Loadable({ @@ -614,7 +619,10 @@ class App extends Component { {/*/>*/} - + () + }/> {/* jupyter */} + () } /> + () diff --git a/public/react/src/college/College.js b/public/react/src/college/College.js new file mode 100644 index 000000000..eaed9747c --- /dev/null +++ b/public/react/src/college/College.js @@ -0,0 +1,1259 @@ +import React, {Component} from "react"; +import {Link, NavLink} from 'react-router-dom'; +import {WordsBtn, ActionBtn,SnackbarHOC,getImageUrl} from 'educoder'; +import axios from 'axios'; +import { + notification, + Spin, + Table, + Pagination, +} from "antd"; +import Colleagechart from './colleagechart/Colleagechart' +import Colleagechartzu from './colleagechart/Colleagechartzu' +import {TPMIndexHOC} from "../modules/tpm/TPMIndexHOC"; +import NoneData from './../modules/courses/coursesPublic/NoneData'; + +import './colleagecss/colleage.css'; +import Shixunechart from "../modules/courses/shixunHomework/shixunreport/Shixunechart"; +class College extends Component { + constructor(props) { + super(props); + // this.answerMdRef = React.createRef(); + this.state = { + coursesloading:false, + columns: [ + { + title: '名称', + dataIndex: 'name', + key: 'name', + align: 'center', + className: "edu-txt-center font-14 maxnamewidth247", + render: (text, record) => ( + { + record.name + } + ) + }, + { + title: '管理教师', + dataIndex: 'teachers', + key: 'teachers', + align: 'center', + className: "edu-txt-center font-14 maxnamewidth340", + render: (text, record) => ( + + { + record.teachers + } + + ) + }, + { + title: '评测次数', + dataIndex: 'times', + key: 'times', + align: 'center', + className: "edu-txt-center font-14 maxnamewidth175", + render: (text, record) => ( + + { + record.evaluating_count + } + + ), + }, + { + title: '学生', + key: 'student', + dataIndex: 'student', + align: 'center', + className: "edu-txt-center font-14 maxnamewidth255", + render: (text, record) => ( + + { + record.student_count + } + + ) + }, + { + title: '实训作业', + dataIndex: 'training', + key: 'training', + align: 'center', + className: "edu-txt-center font-14", + render: (text, record) => ( + + { + record.shixun_work_count + } + + ) + + }, + { + title: '资源', + dataIndex: 'resources', + key: 'resources', + align: 'center', + className: "edu-txt-center font-14", + render: (text, record) => ( + + { + record.attachment_count + } + + ), + }, + { + title: '帖子', + dataIndex: 'posts', + key: 'posts', + align: 'center', + className: "edu-txt-center font-14", + render: (text, record) => ( + { + record.message_count + } + ) + }, + { + title: '其它任务', + dataIndex: 'othertasks', + key: 'othertasks', + align: 'center', + className: "edu-txt-center font-14", + render: (text, record) => ( + + { + record.other_work_count + } + + ) + }, + { + title: '状态', + dataIndex: 'states', + key: 'states', + align: 'center', + className: "edu-txt-center font-14", + render: (text, record) => ( + + { + record.is_end? + "已结束" + : + "正在进行" + } + + ) + }, + { + title: '时间', + dataIndex: 'timemy', + key: 'timemy', + align: 'center', + className: "edu-txt-center font-14", + render: (text, record) => ( + + { + record.activity_time + } + + ) + }, + ], + page:1, + limit:10, + total_users:50, + teachersloading:false, + teacherranking:[ + { + title: '排名', + dataIndex: 'ranking', + key: 'ranking', + align: 'center', + className: "edu-txt-center font-14", + render: (text, record) => ( + + { + record.id + } + + ) + }, + { + title: '姓名', + dataIndex: 'name', + key: 'name', + align: 'center', + className: "edu-txt-center font-14 maxnamewidth105", + render: (text, record) => ( + { + record.name + } + + ) + }, + { + title: '管理课堂', + dataIndex: 'classroom', + key: 'classroom', + align: 'center', + className: "edu-txt-center font-14 maxnamewidth175", + render: (text, record) => ( + + { + record.course_count + } + + ), + }, + { + title: '已发布实训作业', + key: 'assignment', + dataIndex: 'assignment', + align: 'center', + className: "edu-txt-center font-14 maxnamewidth255", + render: (text, record) => ( + + { + record.shixun_work_count + } + + ) + }, + { + title: '未发布实训作业', + dataIndex: 'released', + key: 'released', + align: 'center', + className: "edu-txt-center font-14", + render: (text, record) => ( + + { + record.un_shixun_work_count + } + + ) + + }, + { + title: '学生数', + dataIndex: 'studentnumber', + key: 'studentnumber', + align: 'center', + className: "edu-txt-center font-14", + render: (text, record) => ( + + { + record.student_count + } + + ), + }, + { + title: '完成率', + dataIndex: 'completionrate', + key: 'completionrate', + align: 'center', + className: "edu-txt-center font-14", + render: (text, record) => ( + + { + record.complete_rate+"%" + } + + ) + }, + { + title: '发布实训', + dataIndex: 'releasetraining', + key: 'releasetraining', + align: 'center', + className: "edu-txt-center font-14", + render: (text, record) => ( + + { + record.publish_shixun_count + } + + ) + } + ], + studentranking:[ + { + title: '排名', + dataIndex: 'ranking', + key: 'ranking', + align: 'center', + className: "edu-txt-center font-14", + width:'100px', + render: (text, record) => ( + + { + record.id===1? + :record.id===2? + + :record.id===3? + + :record.id + } + + ) + }, + { + title: '姓名', + dataIndex: 'name', + key: 'name', + align: 'center', + className: "edu-txt-center font-14 maxnamewidth105", + width:'100px', + render: (text, record) => ( + { + record.name + } + + ) + }, + { + title: '学号', + dataIndex: 'studentid', + key: 'studentid', + align: 'center', + className: "edu-txt-center font-14 maxnamewidth175", + render: (text, record) => ( + + { + record.student_id + } + + ), + }, + { + title: '完成实训', + key: 'training', + dataIndex: 'training', + align: 'center', + className: "edu-txt-center font-14 maxnamewidth255", + render: (text, record) => ( + + { + record.shixun_count + } + + ) + }, + { + title: '在学实训', + dataIndex: 'learning', + key: 'learning', + align: 'center', + className: "edu-txt-center font-14", + render: (text, record) => ( + + { + record.study_shixun_count + } + + ) + + }, + { + title: '金币', + dataIndex: 'goldcoin', + key: 'goldcoin', + align: 'center', + className: "edu-txt-center font-14", + render: (text, record) => ( + + { + record.grade + } + + ), + }, + { + title: '经验值', + dataIndex: 'empirical', + key: 'empirical', + align: 'center', + className: "edu-txt-center font-14", + render: (text, record) => ( + + { + record.experience + } + + ) + }, + ], + school:"", + teachers_count:null, + students_count:null, + courses_count:null, + shixuns_count:null, + shixun_report_count:null, + shixun_time:null, + courses:null, + course_count:0, + pages:1, + limits:10, + teachers:null, + teacher_count:0, + students:null, + student_count:0, + shixun_chart_data:null, + shixun_chart_datanames:null, + studentionsnames:null, + studentionsvalues:null + } + + } + + + componentDidMount(){ + console.log("College"); + console.log(this.props.match.params.id); + this.gettop(); + this.Numberofinternshipreports(); + this.Actualcombattimeoftrainees(); + this.Classnumber(1,10); + this.Teacherranking(1,10); + this.Studentranking(1,10); + this.Onlinetraining(); + this.Hottest(); + } + //头部 + gettop=()=>{ + const id =this.props.match.params.id; + const url=`/colleges/${id}/statistics.json`; + axios.get(url).then((response) => { + if(response===null||response===undefined){ + this.setState({ + teachers_count:0, + students_count:0, + courses_count:0, + shixuns_count:0, + school:"", + }) + return + } + if (response.data.status === 403||response.data.status === 401||response.data.status === 500) { + this.setState({ + teachers_count:0, + students_count:0, + courses_count:0, + shixuns_count:0, + school:"", + }) + }else{ + this.setState({ + teachers_count:response.data.teachers_count, + students_count:response.data.students_count, + courses_count:response.data.courses_count, + shixuns_count:response.data.shixuns_count, + school:response.data.school, + }) + } + }).catch((error) => { + console.log(error) + this.setState({ + teachers_count:0, + students_count:0, + courses_count:0, + shixuns_count:0, + school:"", + }) + }); + } + + //获取实训报告数 + Numberofinternshipreports=()=>{ + const id =this.props.match.params.id; + const url=`/colleges/${id}/shixun_report_count.json`; + axios.get(url).then((response) => { + if(response===null||response===undefined){ + this.setState({ + shixun_report_count:0, + }) + return + } + if (response.data.status === 403||response.data.status === 401||response.data.status === 500) { + this.setState({ + shixun_report_count:0, + }) + }else{ + if (response.data.status === -1){ + this.setState({ + shixun_report_count:0, + }) + return + } + this.setState({ + shixun_report_count:response.data.shixun_report_count, + }) + } + }).catch((error) => { + console.log(error) + this.setState({ + shixun_report_count:0, + }) + }); + } + + //学员实战时间 + Actualcombattimeoftrainees=()=>{ + const id =this.props.match.params.id; + const url=`/colleges/${id}/shixun_time.json`; + axios.get(url).then((response) => { + if(response===null||response===undefined){ + this.setState({ + shixun_time:0, + }) + return + } + if (response.data.status === 403||response.data.status === 401||response.data.status === 500) { + this.setState({ + shixun_time:0, + }) + }else{ + if (response.data.status === -1){ + this.setState({ + shixun_time:0, + }) + return + } + this.setState({ + shixun_time:response.data.shixun_time, + }) + } + }).catch((error) => { + console.log(error) + this.setState({ + shixun_time:0, + }) + }); + } + + //课堂信息 + Classnumber=(page,per_page)=>{ + const id =this.props.match.params.id; + const url=`/colleges/${id}/course_statistics.json`; + this.setState({ + coursesloading:true + }) + axios.get(url,{params:{ + page:page, + per_page:per_page, + } + }).then((response) => { + if(response===null||response===undefined){ + this.setState({ + courses:[], + course_count:0 + }) + return + } + if (response.data.status === 403||response.data.status === 401||response.data.status === 500) { + this.setState({ + courses:[], + course_count:0 + }) + }else{ + if (response.data.status === -1){ + this.setState({ + courses:[], + course_count:0 + }) + return + } + this.setState({ + courses:response.data.courses, + course_count:response.data.course_count, + page:page, + limit:per_page + }) + } + this.setState({ + coursesloading:false + }) + }).catch((error) => { + this.setState({ + courses:[], + course_count:0, + coursesloading:false + }) + }); + } + + //教师排名 + Teacherranking=(page,per_page)=>{ + const id =this.props.match.params.id; + const url=`/colleges/${id}/teachers.json`; + this.setState({ + teachersloading:true + }) + axios.get(url,{params:{ + page:page, + per_page:per_page, + } + }).then((response) => { + if(response===null||response===undefined){ + this.setState({ + teachers:[], + teacher_count:0 + }) + return + } + if (response.data.status === 403||response.data.status === 401||response.data.status === 500) { + this.setState({ + teachers:[], + teacher_count:0 + }) + }else{ + if (response.data.status === -1){ + this.setState({ + teachers:[], + teacher_count:0 + }) + return + } + let teachers=[]; + if(response.data.teachers){ + for(let i=0;i { + this.setState({ + teachers:[], + teacher_count:0, + teachersloading:false + }) + }); + } + //学生排名 + + Studentranking=(page,per_page)=>{ + const id =this.props.match.params.id; + const url=`/colleges/${id}/student_shixun.json`; + this.setState({ + studentsloading:true + }) + axios.get(url,{params:{ + page:page, + per_page:per_page, + } + }).then((response) => { + if(response===null||response===undefined){ + this.setState({ + students:[], + student_count:0, + }) + return + } + if (response.data.status === 403||response.data.status === 401||response.data.status === 500) { + this.setState({ + students:[], + student_count:0, + }) + }else{ + if (response.data.status === -1){ + this.setState({ + students:[], + student_count:0, + }) + return + } + let students=[]; + if(response.data.teachers){ + for(let i=0;i { + this.setState({ + students:[], + student_count:0, + studentsloading:false + }) + }); + } + + //在线实训情况 + Onlinetraining=()=>{ + const id =this.props.match.params.id; + const url=`/colleges/${id}/shixun_chart_data.json`; + axios.get(url).then((response) => { + if (response.data.status === 403||response.data.status === 401||response.data.status === 500) { + this.setState({ + shixun_chart_data:[], + shixun_chart_datanames:[] + }) + }else{ + if (response.data.status === -1){ + this.setState({ + shixun_chart_data:[], + shixun_chart_datanames:[] + }) + return + } + + this.setState({ + shixun_chart_data:response.data.data, + shixun_chart_datanames:response.data.names + }) + } + }).catch((error) => { + this.setState({ + shixun_chart_data:[], + shixun_chart_datanames:[] + }) + }); + } + //最热测评 + Hottest=()=>{ + const id =this.props.match.params.id; + const url=`/colleges/${id}/student_hot_evaluations.json`; + axios.get(url).then((response) => { + if (response.data.status === 403||response.data.status === 401||response.data.status === 500) { + this.setState({ + studentionsnames: [], + studentionsvalues: [] + }) + }else { + if (response.data.status === -1) { + this.setState({ + studentionsnames: [], + studentionsvalues: [] + }) + return + } + this.setState({ + studentionsnames: response.data.names, + studentionsvalues: response.data.values + }) + } + }).catch((error) => { + this.setState({ + studentionsnames: [], + studentionsvalues: [] + }) + }); + } + + table1handleChange(){ + + } + + //塞选 + paginationonChange=(pageNumber)=>{ + this.Classnumber(pageNumber,10); + } + + paginationonChanges=(pageNumber)=>{ + this.Teacherranking(pageNumber,10); + } + paginationonChangess=(pageNumber)=>{ + this.Studentranking(pageNumber,10); + } + render() { + let {columns,page,limit,total_users,teacherranking,studentranking, + teachers_count,students_count, courses_count, shixuns_count,shixun_report_count,shixun_time,courses,course_count,school,teachers, + pages,limits, teacher_count,teachersloading,coursesloading,pagess,limitss,studentsloading,students,student_count,shixun_chart_data, + shixun_chart_datanames, studentionsnames,studentionsvalues + } = this.state; + + return ( +
+
+
+
{school}
+
+
+ {/*//教师1*/} +
+ 教师 +
+
+ {teachers_count?teachers_count:0} +
+
+ +
+
+ 学生 +
+
+ {students_count?students_count:0} +
+
+ +
+
+ 课堂 +
+
+ {courses_count?courses_count:0} +
+
+ +
+
+ 共建实训 +
+
+ {shixuns_count?shixuns_count:0} +
+
+ {/*//教师2*/} + + + + +
+
+
+
+

+ 基本使用情况 +

+ {/*基本使用情况1*/} +
+

+ 教师 +

+

+ 学生 +

+

+ 课堂 +

+

+ 共建实训 +

+

+ 实习报告 +

+

+ 学员实战时间 +

+
+ + + {/*基本使用情况2*/} +
+
+ { + teachers_count? +
{teachers_count}
+ : + + } +
+
+ { + students_count? +
{students_count}
+ : + + } +
+
+ { + courses_count? +
{courses_count}
+ : + + } +
+
+ { + shixuns_count? +
{shixuns_count}
+ : + + } +
+
+ { + shixun_report_count? +
{shixun_report_count}
+ : + + } +
+
+ { + shixun_time? +
{shixun_time}
+ : + + } +
+
+ {/*基本使用情况3结束*/} +
+ + +
+

+ 课堂 +

+ { + courses===null? +
+ +
+ + : + JSON.stringify(courses) === "[]" ? + + + + : +
+
+ +
+ {courses === undefined ? "" : } + + + { + course_count>=11? +
+
+ +
+ +
+ :"" + } + + + } + + + + + +
+
+

+ 教师排名 +

+ { + teachers===null? +
+ +
+ + : + JSON.stringify(teachers) === "[]" ? + + + + : +
+ +
+ {teachers === undefined ? "" :
} + + + } + + + + {/*
*/} + {/*
*/} + {/* */} + {/*
*/} + + {/*
*/} + + +
+

+ 在线实训情况 +

+ { + shixun_chart_data===null? +
+ +
+ + : + JSON.stringify(shixun_chart_data) === "[]" ? + + + + : + + + + } + +
+
+ + + +
+
+

+ 学生排名 +

+ { + students === null ? +
+ +
+ + : + JSON.stringify(students) === "[]" ? + + + + : +
+ +
+ {students === undefined ? "" :
} + + + } + {/*
*/} + {/*
*/} + {/* */} + {/*
*/} + + {/*
*/} + + + + +
+ +
+

+ 最热评测 +

+ { + studentionsnames===null? +
+ +
+ + : + JSON.stringify(studentionsnames) === "[]" ? + + + + : + + + + } + + +
+
+ + + ) + } +} +export default SnackbarHOC() (TPMIndexHOC ( College )); + + diff --git a/public/react/src/college/colleagechart/Colleagechart.js b/public/react/src/college/colleagechart/Colleagechart.js new file mode 100644 index 000000000..1e2767f5a --- /dev/null +++ b/public/react/src/college/colleagechart/Colleagechart.js @@ -0,0 +1,84 @@ +import React, {Component} from "react"; +import {WordsBtn} from 'educoder'; +import {Table} from "antd"; +import {Link,Switch,Route,Redirect} from 'react-router-dom'; +const echarts = require('echarts'); + + + +function startechart(data,datanane){ + var effChart = echarts.init(document.getElementById('shixun_skill_chart')); + + var option = { + + tooltip : { + trigger: 'item', + formatter: "{a}
{b} : {c} ({d}%)" + }, + legend: { + // orient: 'vertical', + // top: 'middle', + bottom: 40, + left: 'center', + data: datanane + }, + series : [ + { + type: 'pie', + radius : '65%', + center: ['50%', '35%'], + selectedMode: 'single', + data:data, + itemStyle: { + emphasis: { + shadowBlur: 10, + shadowOffsetX: 0, + shadowColor: 'rgba(0, 0, 0, 0.5)' + } + } + } + ] + }; + effChart.setOption(option); +} +class Colleagechart extends Component { + + constructor(props) { + super(props); + this.state = { + } + } + + componentDidMount() { + startechart(this.props.data,this.props.datanane) + } + + + componentDidUpdate = (prevProps) => { + if (prevProps.data!= this.props.data) { + startechart(this.props.data,this.props.datanane) + } + } + + + render() { + let {data}=this.props; + + return ( +
+ +
+
+ + + + +
+ + ) + } +} + +export default Colleagechart; diff --git a/public/react/src/college/colleagechart/Colleagechartzu.js b/public/react/src/college/colleagechart/Colleagechartzu.js new file mode 100644 index 000000000..c65d2f6f2 --- /dev/null +++ b/public/react/src/college/colleagechart/Colleagechartzu.js @@ -0,0 +1,149 @@ +import React, {Component} from "react"; +import {WordsBtn} from 'educoder'; +import {Table} from "antd"; +import {Link,Switch,Route,Redirect} from 'react-router-dom'; +const echarts = require('echarts'); + + + +function startechart(names, values){ + var effChart = echarts.init(document.getElementById('shixun_skill_charts')); + + var Color = ['#962e66', '#623363', '#CCCCCC', '#9A9A9A', '#FF8080', '#FF80C2', '#B980FF', '#80B9FF', '#6FE9FF', '#4DE8B4', '#F8EF63', '#FFB967']; + + var option = { + backgroundColor: '#fff', + grid: { + left: '3%', + right: '4%', + bottom: '10%', + containLabel: true + }, + + tooltip: { + show: "true", + trigger: 'item', + formatter: '{c0}', + backgroundColor: 'rgba(0,0,0,0.7)', // 背景 + padding: [8, 10], //内边距 + extraCssText: 'box-shadow: 0 0 3px rgba(255, 255, 255, 0.4);', //添加阴影 + axisPointer: { // 坐标轴指示器,坐标轴触发有效 + type: 'shadow' // 默认为直线,可选为:'line' | 'shadow' + } + }, + xAxis: { + type: 'value', + axisTick: { + show: false + }, + axisLine: { + show: true, + lineStyle: { + color: '#CCCCCC' + } + }, + splitLine: { + show: false, + lineStyle: { + color: '#CCCCCC' + } + }, + axisLabel: { + textStyle: { + color: '#656565', + fontWeight: 'normal', + fontSize: '12' + }, + formatter: '{value}' + } + }, + yAxis: { + type: 'category', + axisLine: { + lineStyle: { + color: '#cccccc' + } + }, + splitLine: { + show: false + }, + axisTick: { + show: false + }, + splitArea: { + show: false + }, + axisLabel: { + inside: false, + textStyle: { + color: '#656565', + fontWeight: 'normal', + fontSize: '12' + } + }, + data: names + }, + series: [{ + name: '', + type: 'bar', + itemStyle: { + normal: { + show: true, + color: function(params) { + return Color[params.dataIndex] + }, + barBorderRadius: 50, + borderWidth: 0, + borderColor: '#333' + } + }, + barGap: '0%', + barCategoryGap: '50%', + data: values + } + + ] + }; + effChart.setOption(option); +} +class Colleagechartzu extends Component { + + constructor(props) { + super(props); + this.state = { + } + } + + componentDidMount() { + startechart(this.props.data,this.props.datavule) + } + + + componentDidUpdate = (prevProps) => { + if (prevProps.data!= this.props.data) { + startechart(this.props.data,this.props.datavule) + } + } + + + render() { + let {data}=this.props; + + return ( +
+ +
+
+ + + + +
+ + ) + } +} + +export default Colleagechartzu; diff --git a/public/react/src/college/colleagecss/colleage.css b/public/react/src/college/colleagecss/colleage.css new file mode 100644 index 000000000..031396896 --- /dev/null +++ b/public/react/src/college/colleagecss/colleage.css @@ -0,0 +1,213 @@ +.yslstatistic-header { + width: 100%; + height: 240px; + background-image: url('/images/educoder/statistics.jpg'); + background-size: 100% 100%; +} +.yslborder{ + border: 1px solid; +} +.yslstatistic-header-title{ + flex: 1; + display: flex; + align-items: center; + color: #4CACFF; + font-size: 32px; +} +.yslstatistic-header-content{ + width: 100%; + display: flex; + justify-content: space-around; +} +.yslstatistic-header-item{ + margin-bottom: 22px; + display: flex; + flex-direction: column; + align-items: center; + color: #fff; +} +.yslstatistic-header-item-label{ + color: #989898; +} + +.yslstatistic-base-item-label{ + width: 200px; + text-align: center; + font-size: 16px; + height: 48px; + line-height: 48px; + color: #686868; + background: #F5F5F5; + border-top: 1px solid #EBEBEB; +} +.yslstatistic-base-item-labels{ + width: 200px; + text-align: center; + height: 100px; + line-height: 100px; + background: #ffffff; + border-top: 1px solid #EBEBEB; + border-bottom: 1px solid #EBEBEB; +} +.yslstatistic-base-item-labelsp{ + color: #000000; + font-size: 24px; +} +.yslstatistic-base-item-labelsspan{ + color: #000000; + margin-left: 5px; + font-size: 16px; +} +.jibenshiyong100{ + width: 100%; +} + +.yslstatistic-header-item-content{ + font-size: 24px; +} +/* 中间居中 */ +.intermediatecenter{ + display: flex; + flex-direction: column; + align-items: center; + justify-content: center; +} +/* 简单居中 */ +.intermediatecenterysls{ + display: flex; + align-items: center; +} +.spacearound{ + display: flex; + justify-content: space-around; + +} +.spacebetween{ + display: flex; + justify-content: space-between; +} +/* 头顶部居中 */ +.topcenter{ + display: -webkit-flex; + flex-direction: column; + align-items: center; + +} + + +/* x轴正方向排序 */ +/* 一 二 三 四 五 六 七 八 */ +.sortinxdirection{ + display: flex; + flex-direction:row; +} +/* x轴反方向排序 */ +/* 八 七 六 五 四 三 二 一 */ +.xaxisreverseorder{ + display: flex; + flex-direction:row-reverse; +} +/* 垂直布局 正方向*/ +/* 一 + 二 + 三 + 四 + 五 + 六 + 七 + 八 */ +.verticallayout{ + display: flex; + flex-direction:column; +} +/* 垂直布局 反方向*/ +.reversedirection{ + display: flex; + flex-direction:column-reverse; +} + +.h4{ + font-size: 1.5rem; + font-weight: 500 !important; +} +.ysllinjibenshiyong{ + font-weight: 500; + line-height: 1.2; + padding: 2rem 1.25rem; + border-bottom: unset; + background:#fff; +} +.linjibenshiyong{ + font-weight: 500; + line-height: 1.2; + padding: 2rem 1.25rem; + border-bottom: unset; + background:#fff; + box-shadow:0px 6px 12px 0px rgba(0,0,0,0.1); + border-radius:2px; +} +.yslslinjibenshiyong{ + font-weight: 500; + line-height: 1.2; + border-bottom: unset; + box-shadow:0px 6px 12px 0px rgba(0,0,0,0.1); + border-radius:2px; +} +.yinyin{ + background: #fff; + box-shadow:0px 6px 12px 0px rgba(0,0,0,0.1); + border-radius:2px; +} +.edu-back-eeee{ + background:#EEEEEE !important; +} +.mt-4{ + margin-top: 1.5rem !important; +} + +.statistic-label{ + padding: 2rem 1.25rem; + font-size: 1.5rem; + font-weight: 400 !important; +} +.mb50{ + padding-bottom: 50px !important; +} +.mt40{ + margin-top: 40px; +} +.mb80{ + margin-bottom: 80px; +} +.task-hide{overflow:hidden; white-space: nowrap; text-overflow:ellipsis;} +a:hover{ + color:#0056b3; +} +.color-blue{ + color: #4CACFF; +} + +.color-huang{ + color:#ffc107 !important +} +.maxnamewidth105{ + max-width: 105px; + overflow:hidden; + text-overflow:ellipsis; + white-space:nowrap; + cursor: default; +} +.maxnamewidth247{ + max-width: 247px; + overflow:hidden; + text-overflow:ellipsis; + white-space:nowrap; + cursor: default; +} +.maxnamewidth340{ + max-width: 340px; + overflow:hidden; + text-overflow:ellipsis; + white-space:nowrap; + cursor: default; +} diff --git a/spec/models/curriculum_direction_spec.rb b/spec/models/curriculum_direction_spec.rb deleted file mode 100644 index 40cab64ca..000000000 --- a/spec/models/curriculum_direction_spec.rb +++ /dev/null @@ -1,5 +0,0 @@ -require 'rails_helper' - -RSpec.describe CurriculumDirection, type: :model do - pending "add some examples to (or delete) #{__FILE__}" -end diff --git a/spec/models/curriculum_spec.rb b/spec/models/curriculum_spec.rb deleted file mode 100644 index b03089a91..000000000 --- a/spec/models/curriculum_spec.rb +++ /dev/null @@ -1,5 +0,0 @@ -require 'rails_helper' - -RSpec.describe Curriculum, type: :model do - pending "add some examples to (or delete) #{__FILE__}" -end diff --git a/spec/models/knowledge_point_container_spec.rb b/spec/models/knowledge_point_container_spec.rb deleted file mode 100644 index 3e151062f..000000000 --- a/spec/models/knowledge_point_container_spec.rb +++ /dev/null @@ -1,5 +0,0 @@ -require 'rails_helper' - -RSpec.describe KnowledgePointContainer, type: :model do - pending "add some examples to (or delete) #{__FILE__}" -end diff --git a/spec/models/knowledge_point_spec.rb b/spec/models/knowledge_point_spec.rb deleted file mode 100644 index d85138a0f..000000000 --- a/spec/models/knowledge_point_spec.rb +++ /dev/null @@ -1,5 +0,0 @@ -require 'rails_helper' - -RSpec.describe KnowledgePoint, type: :model do - pending "add some examples to (or delete) #{__FILE__}" -end