diff --git a/public/react/src/modules/courses/coursesDetail/CoursesLeftNav.js b/public/react/src/modules/courses/coursesDetail/CoursesLeftNav.js index eaefd50e9..1c53a1efb 100644 --- a/public/react/src/modules/courses/coursesDetail/CoursesLeftNav.js +++ b/public/react/src/modules/courses/coursesDetail/CoursesLeftNav.js @@ -1097,7 +1097,8 @@ class Coursesleftnav extends Component{ item.type==="board"?: item.type==="course_group"?: item.type==="statistics"?: - item.type==="video"?:"" + item.type==="attendance"?: + item.type==="video"?:"" } {/*||this.props.location.pathname===this.state.url&&key===this.state.indexs*/} @@ -1238,7 +1239,7 @@ class Coursesleftnav extends Component{ item.type==="attachment"?: item.type==="board"?: item.type==="course_group"?: - + item.type==="attendance"?: item.type==="video"?: item.type==="statistics"?:"" } diff --git a/public/react/src/modules/courses/signin/component/NoneDatas.js b/public/react/src/modules/courses/signin/component/NoneDatas.js new file mode 100644 index 000000000..c36cc29d1 --- /dev/null +++ b/public/react/src/modules/courses/signin/component/NoneDatas.js @@ -0,0 +1,36 @@ +import React, { Component } from 'react'; +import { getImageUrl , getUrl } from 'educoder'; + +class NoneDatas extends Component{ + constructor(props) { + super(props) + } + render(){ + const { style } = this.props; + return( +
+ + +

暂无相关数据

+
+ ) + } +} +export default NoneDatas; diff --git a/public/react/src/modules/courses/signin/component/Teacherentry.js b/public/react/src/modules/courses/signin/component/Teacherentry.js index 0e35595b9..9359717b8 100644 --- a/public/react/src/modules/courses/signin/component/Teacherentry.js +++ b/public/react/src/modules/courses/signin/component/Teacherentry.js @@ -1,6 +1,8 @@ import React,{ Component } from "react"; import '../css/signincdi.css'; import { Progress } from 'antd'; +import axios from 'axios'; + //条目 class Teacherentry extends Component{ //条目组件 @@ -41,33 +43,33 @@ class Teacherentry extends Component{
- 已签到22 /应签到55 + 已签到22 / 应签到55
-
+
-
+
签到发起人:
-
+
胡一菲
-
+
签到方式:
-
+
二维码签到
-
+
开始结束时间:
-
+
2010-03-10 10:00-11:00
@@ -75,23 +77,34 @@ class Teacherentry extends Component{
{ isAdmin===true? +
+
截止
+
删除
+
+ : ( - this.props.defaultActiveKey==="0"? + this.props.defaultActiveKey==="1"?
-
截止
-
删除
+ +
+ 签到 +
:
-
截止
-
删除
-
- ) - : -
+ {/*
*/} + {/* 正常签到*/} + {/*
*/} + {/*
*/} + {/* 请假*/} + {/*
*/} -
+
+ 旷课 +
+
+ ) }
diff --git a/public/react/src/modules/courses/signin/component/teachercomponent/Teaccomponent.js b/public/react/src/modules/courses/signin/component/teachercomponent/Teaccomponent.js index 426f30dcf..fee014477 100644 --- a/public/react/src/modules/courses/signin/component/teachercomponent/Teaccomponent.js +++ b/public/react/src/modules/courses/signin/component/teachercomponent/Teaccomponent.js @@ -1,6 +1,10 @@ import React,{ Component } from "react"; import '../../css/signincdi.css'; +import axios from 'axios'; import Teacherentry from "../Teacherentry"; +import NoneDatas from '../NoneDatas'; +import Listjihe from "../../../../question/component/Listjihe"; + //在线学习 class Teaccomponent extends Component{ //教师正在签到 @@ -8,14 +12,20 @@ class Teaccomponent extends Component{ super(props); this.state={ - + mydatas:[] } } componentDidMount() { + this.setState({ + mydatas:this.props.datas + }) } + + + componentDidUpdate = (prevProps) => { @@ -24,11 +34,21 @@ class Teaccomponent extends Component{ render(){ + let mydatas=this.props.datas?this.props.datas:[]; return( - - - +
+ { + mydatas.length>0? + mydatas.map((object, index) => { + return ( + + ) + }) + : + + } +
) } diff --git a/public/react/src/modules/courses/signin/css/signincdi.css b/public/react/src/modules/courses/signin/css/signincdi.css index 1457fc693..4eb325dce 100644 --- a/public/react/src/modules/courses/signin/css/signincdi.css +++ b/public/react/src/modules/courses/signin/css/signincdi.css @@ -91,6 +91,9 @@ .ws80s{ width: 80%; } +.ws50s{ + width: 50%; +} .hs30s{ height: 30%; } @@ -239,3 +242,80 @@ color:rgba(245,108,108,1); margin-right: 30px; } + +.qiandaobutton{ + font-size:16px; + font-family:Microsoft YaHei; + font-weight:400; + color:rgba(255,255,255,1); + text-align: center; + line-height: 40px; + width:100px; + height:40px; + background:rgba(64,158,255,1); + border-radius:4px; +} + +.zcqiandao{ + width:100px; + height:40px; + border:1px solid rgba(38,199,201,1); + border-radius:4px; + font-size:16px; + font-family:Microsoft YaHei; + font-weight:400; + color:rgba(38,199,201,1); + text-align: center; + line-height: 40px; + +} +.qjqiandao{ + width:100px; + height:40px; + border:1px solid #EAAE4E; + border-radius:4px; + font-size:16px; + font-family:Microsoft YaHei; + font-weight:400; + color:#EAAE4E; + text-align: center; + line-height: 40px; + + +} + +.kkqiandao{ + width:100px; + height:40px; + border:1px solid #FF835C; + border-radius:4px; + font-size:16px; + font-family:Microsoft YaHei; + font-weight:400; + color:#FF835C; + text-align: center; + line-height: 40px; + +} +.h40s{ + line-height: 40px ; +} +.mt40{ + margin-top: 40px !important; +} + +.h500{ + min-height: 500px; +} +.kkp{ + font-size:14px; + font-family:Microsoft YaHei; + font-weight:400; +} +.pr32{ + padding-right: 32px; +} + +.mr20r{ + margin-right: 20px; +} diff --git a/public/react/src/modules/courses/signin/mymain/Signinmain.js b/public/react/src/modules/courses/signin/mymain/Signinmain.js index 0684304fb..4b1d3052c 100644 --- a/public/react/src/modules/courses/signin/mymain/Signinmain.js +++ b/public/react/src/modules/courses/signin/mymain/Signinmain.js @@ -3,6 +3,8 @@ import '../css/signincdi.css'; import { Tabs } from 'antd'; import Teachers_signin from '../teacher/Teachers_signin'; import Students_signin from '../student/Students_signin'; +import axios from 'axios'; + const { TabPane } = Tabs; // 主签到目录 主签到目录 class Signinmain extends Component{ @@ -30,13 +32,10 @@ class Signinmain extends Component{ return( -
- +
- -
) diff --git a/public/react/src/modules/courses/signin/teacher/Teachers_signin.js b/public/react/src/modules/courses/signin/teacher/Teachers_signin.js index 101816a9d..9b2529474 100644 --- a/public/react/src/modules/courses/signin/teacher/Teachers_signin.js +++ b/public/react/src/modules/courses/signin/teacher/Teachers_signin.js @@ -6,6 +6,8 @@ import Createsignmodel from '../model/Createsignmodel'; import Studentssignmodels from "../model/Studentssignmodel"; import Qrcodesignin from "../model/Qrcodesignin"; import Signinstatistics from "../Signinstatistics/Signinstatistics"; +import axios from 'axios'; + const { TabPane } = Tabs; //在线学习 class Students_signin extends Component{ @@ -15,14 +17,21 @@ class Students_signin extends Component{ this.state={ visible:false, page:1, - per_page:20, + limit:5, count:50, defaultActiveKey:"1", + attendances_count:0, + datas:[] } } componentDidMount() { - + let data={ + key:"1", + page:1, + limit:5 + } + this.gogetdatas(data); } componentDidUpdate = (prevProps) => { @@ -34,6 +43,47 @@ class Students_signin extends Component{ console.log(key); this.setState({ defaultActiveKey: key, + page:1, + limit:5 + }) + let data={ + key:key, + page:1, + limit:5 + } + if(key==="1" || key ==="2"){ + this.gogetdatas(data); + } + } + + gogetdatas =(mydata)=>{ + const coureid=this.props.match.params.coursesId; + let urls = `/courses/${coureid}/attendances.json`; + let arry={} + if(mydata.key==="1" || mydata.key ===1){ + arry={ + page:mydata.page, + limit:mydata.limit, + }; + }else if(mydata.key==="2" || mydata.key ===2){ + arry={ + history:true, + page:mydata.page, + limit:mydata.limit, + } + } + axios.get(urls, { + params: arry + }).then((response) => { + console.log(response); + if(response){ + if(response.data){ + this.setState({ + attendances_count:response.data.attendances_count, + datas:response.data.attendances + }) + } + } }) } @@ -61,12 +111,22 @@ class Students_signin extends Component{ this.setState({ page: pageNumber, }) + + let data={ + key:this.state.defaultActiveKey, + page:pageNumber, + limit:5 + } + this.gogetdatas(data); + } render(){ - let {page,per_page,count,defaultActiveKey} =this.state + let {page,per_page,count,defaultActiveKey,limit,attendances_count,datas} =this.state; + const isAdmin =this.props.isAdmin(); + return( @@ -94,21 +154,41 @@ class Students_signin extends Component{

共3个签到正在进行

- + + +
+ pageSize={limit} + total={attendances_count}>
-

共3个签到正在进行

- +
+

共3个签到正在进行

+ { + isAdmin===false? +
+

旷课:2

+

请假:2

+

正常签到:10

+ +
+ : + "" + } +
+ + + + + +
+ pageSize={limit} + total={attendances_count}>
@@ -117,11 +197,28 @@ class Students_signin extends Component{ {...this.state} /> + { + isAdmin===true? + + Content of Tab Pane 3 + + : + "" + } +

this.Qrcodesignintypefun()}>创建签到

+ { + isAdmin? +
+ +

this.Createsign()}>创建签到

+
+ :"" + }
diff --git a/public/react/src/modules/question/component/Contentpart.js b/public/react/src/modules/question/component/Contentpart.js index e3f5259e5..5cafe5937 100644 --- a/public/react/src/modules/question/component/Contentpart.js +++ b/public/react/src/modules/question/component/Contentpart.js @@ -429,7 +429,8 @@ class Contentpart extends Component { ) - })} + }) + }