Merge branch 'master' of https://bdgit.educoder.net/Hjqreturn/educoder
commit
57ddb15bcc
@ -0,0 +1,103 @@
|
||||
function Base64() {
|
||||
|
||||
// private property
|
||||
_keyStr = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=";
|
||||
|
||||
// public method for encoding
|
||||
this.encode = function (input) {
|
||||
var output = "";
|
||||
var chr1, chr2, chr3, enc1, enc2, enc3, enc4;
|
||||
var i = 0;
|
||||
input = _utf8_encode(input);
|
||||
while (i < input.length) {
|
||||
chr1 = input.charCodeAt(i++);
|
||||
chr2 = input.charCodeAt(i++);
|
||||
chr3 = input.charCodeAt(i++);
|
||||
enc1 = chr1 >> 2;
|
||||
enc2 = ((chr1 & 3) << 4) | (chr2 >> 4);
|
||||
enc3 = ((chr2 & 15) << 2) | (chr3 >> 6);
|
||||
enc4 = chr3 & 63;
|
||||
if (isNaN(chr2)) {
|
||||
enc3 = enc4 = 64;
|
||||
} else if (isNaN(chr3)) {
|
||||
enc4 = 64;
|
||||
}
|
||||
output = output +
|
||||
_keyStr.charAt(enc1) + _keyStr.charAt(enc2) +
|
||||
_keyStr.charAt(enc3) + _keyStr.charAt(enc4);
|
||||
}
|
||||
return output;
|
||||
}
|
||||
|
||||
// public method for decoding
|
||||
this.decode = function (input) {
|
||||
var output = "";
|
||||
var chr1, chr2, chr3;
|
||||
var enc1, enc2, enc3, enc4;
|
||||
var i = 0;
|
||||
input = input.replace(/[^A-Za-z0-9\+\/\=]/g, "");
|
||||
while (i < input.length) {
|
||||
enc1 = _keyStr.indexOf(input.charAt(i++));
|
||||
enc2 = _keyStr.indexOf(input.charAt(i++));
|
||||
enc3 = _keyStr.indexOf(input.charAt(i++));
|
||||
enc4 = _keyStr.indexOf(input.charAt(i++));
|
||||
chr1 = (enc1 << 2) | (enc2 >> 4);
|
||||
chr2 = ((enc2 & 15) << 4) | (enc3 >> 2);
|
||||
chr3 = ((enc3 & 3) << 6) | enc4;
|
||||
output = output + String.fromCharCode(chr1);
|
||||
if (enc3 != 64) {
|
||||
output = output + String.fromCharCode(chr2);
|
||||
}
|
||||
if (enc4 != 64) {
|
||||
output = output + String.fromCharCode(chr3);
|
||||
}
|
||||
}
|
||||
output = _utf8_decode(output);
|
||||
return output;
|
||||
}
|
||||
|
||||
// private method for UTF-8 encoding
|
||||
_utf8_encode = function (string) {
|
||||
string = string.replace(/\r\n/g,"\n");
|
||||
var utftext = "";
|
||||
for (var n = 0; n < string.length; n++) {
|
||||
var c = string.charCodeAt(n);
|
||||
if (c < 128) {
|
||||
utftext += String.fromCharCode(c);
|
||||
} else if((c > 127) && (c < 2048)) {
|
||||
utftext += String.fromCharCode((c >> 6) | 192);
|
||||
utftext += String.fromCharCode((c & 63) | 128);
|
||||
} else {
|
||||
utftext += String.fromCharCode((c >> 12) | 224);
|
||||
utftext += String.fromCharCode(((c >> 6) & 63) | 128);
|
||||
utftext += String.fromCharCode((c & 63) | 128);
|
||||
}
|
||||
|
||||
}
|
||||
return utftext;
|
||||
}
|
||||
|
||||
// private method for UTF-8 decoding
|
||||
_utf8_decode = function (utftext) {
|
||||
var string = "";
|
||||
var i = 0;
|
||||
var c = c1 = c2 = 0;
|
||||
while ( i < utftext.length ) {
|
||||
c = utftext.charCodeAt(i);
|
||||
if (c < 128) {
|
||||
string += String.fromCharCode(c);
|
||||
i++;
|
||||
} else if((c > 191) && (c < 224)) {
|
||||
c2 = utftext.charCodeAt(i+1);
|
||||
string += String.fromCharCode(((c & 31) << 6) | (c2 & 63));
|
||||
i += 2;
|
||||
} else {
|
||||
c2 = utftext.charCodeAt(i+1);
|
||||
c3 = utftext.charCodeAt(i+2);
|
||||
string += String.fromCharCode(((c & 15) << 12) | ((c2 & 63) << 6) | (c3 & 63));
|
||||
i += 3;
|
||||
}
|
||||
}
|
||||
return string;
|
||||
}
|
||||
}
|
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
@ -0,0 +1,52 @@
|
||||
import React, { useState } from 'react'
|
||||
import moment from 'moment'
|
||||
// import Example from './TestHooks'
|
||||
function CommonWorkAppraiseReviseAttachments(props) {
|
||||
const { revise_attachments, revise_reason, atta_update_time, atta_update_user} = props
|
||||
if (!revise_attachments) return ''
|
||||
return (
|
||||
<React.Fragment>
|
||||
{/* {Example()} */}
|
||||
{revise_attachments.length===0?"":<div className={"stud-class-set bor-top-greyE padding20-30 edu-back-white"}>
|
||||
<style>{`
|
||||
.color-grey:hover i {
|
||||
display: inline !important;
|
||||
}
|
||||
`}</style>
|
||||
<div className={"color-grey-6 mb10 font-16"}>
|
||||
补交附件
|
||||
</div>
|
||||
|
||||
{/* {age} */}
|
||||
|
||||
<div className={"ml20"}>
|
||||
{revise_reason}
|
||||
</div>
|
||||
{revise_attachments.map((item,key)=>{
|
||||
return(
|
||||
<div className="color-grey" key={key}>
|
||||
<a className="color-grey ml20">
|
||||
<i className="font-14 color-green iconfont icon-fujian mr8" aria-hidden="true"></i>
|
||||
</a>
|
||||
<a href={item.url}
|
||||
className="mr12 color9B9B imageTarget" length="58">
|
||||
{item.title}
|
||||
</a>
|
||||
<span className="color656565 mt2 color-grey-6 font-12 mr8">{item.filesize}</span>
|
||||
{item.delete===true?<i className="font-14 iconfont icon-guanbi " style={{display: 'none'}} id={item.id} aria-hidden="true" onClick={()=>this.onAttachmentRemove(item.id)}></i>:""}
|
||||
</div>
|
||||
)
|
||||
})}
|
||||
<div className={"color-grey-6 clearfix lineh-25 ml20"}>
|
||||
<span className={"color9B9B fr"}>更新</span>
|
||||
<span className={"fr font-13 mr10 ml10"}>{atta_update_user}</span>
|
||||
<span className={"color9B9B fr"}>
|
||||
{moment(atta_update_time).format('YYYY-MM-DD HH:mm')==="Invalid date"?"":moment(atta_update_time).format('YYYY-MM-DD HH:mm')}
|
||||
</span>
|
||||
</div>
|
||||
</div>}
|
||||
</React.Fragment>
|
||||
)
|
||||
|
||||
}
|
||||
export default CommonWorkAppraiseReviseAttachments;
|
@ -0,0 +1,26 @@
|
||||
// import React, { useState, useEffect } from 'react'
|
||||
|
||||
|
||||
// function Example() {
|
||||
// const [state, setState] = useState({counter: 0})
|
||||
// useEffect(() => {
|
||||
// console.log(' cdm')
|
||||
|
||||
// return () => {
|
||||
// console.log(' cwum')
|
||||
// };
|
||||
// })
|
||||
// const add1ToCounter = () => {
|
||||
// const newCounterValue = state.counter + 1
|
||||
// setState({ counter: newCounterValue })
|
||||
// }
|
||||
// return (
|
||||
// <div>
|
||||
// <p>{state.counter}</p>
|
||||
// <button onClick={add1ToCounter}>
|
||||
// Click me
|
||||
// </button>
|
||||
// </div>
|
||||
// )
|
||||
// }
|
||||
// export default Example
|
File diff suppressed because it is too large
Load Diff
@ -1,21 +0,0 @@
|
||||
import {Base64} from 'js-base64';
|
||||
import axios from 'axios';
|
||||
|
||||
|
||||
// 导出实习报告批量zip 、xlsx 类型
|
||||
export function Internshipreportsy (url,struy,types,stingtype){
|
||||
axios.get((url),{responseType: 'blob'}).then((response) => {
|
||||
const blob = new Blob([response.data], { type: stingtype });
|
||||
const downloadElement = document.createElement('a');
|
||||
const href = window.URL.createObjectURL(blob);
|
||||
const string = Base64.decode(response.headers['content-disposition'].split('=')[1]);
|
||||
downloadElement.href = href;
|
||||
downloadElement.download = string+struy+types;
|
||||
document.body.appendChild(downloadElement);
|
||||
downloadElement.click();
|
||||
document.body.removeChild(downloadElement) ;// 下载完成移除元素
|
||||
window.URL.revokeObjectURL(href) // 释放掉blob对象
|
||||
}).catch((error) => {
|
||||
console.log(error)
|
||||
});
|
||||
}
|
@ -0,0 +1,143 @@
|
||||
import React,{ Component } from "react";
|
||||
import {Checkbox,Input,Table, Pagination,Menu} from "antd";
|
||||
import {Link,NavLink} from 'react-router-dom';
|
||||
import { WordsBtn ,ActionBtn} from 'educoder';
|
||||
import axios from 'axios';
|
||||
import '../css/members.css';
|
||||
import "../common/formCommon.css";
|
||||
import '../css/Courses.css';
|
||||
import './style.css';
|
||||
import '../css/busyWork.css'
|
||||
import '../poll/pollStyle.css'
|
||||
import Listofworks from "./Listofworks";
|
||||
import Listofworksstudentone from './Listofworksstudentone'
|
||||
import Trainingjobsetting from './Trainingjobsetting'
|
||||
import Workquestionandanswer from './Workquestionandanswer'
|
||||
import CoursesListType from '../coursesPublic/CoursesListType';
|
||||
import ShixunStudentWork from "./ShixunStudentWork";
|
||||
|
||||
class ShixunHomeworkPage extends Component {
|
||||
constructor(props) {
|
||||
super(props);
|
||||
this.state={
|
||||
tab:["0"],
|
||||
jobsettingsdata:undefined,
|
||||
teacherdata:undefined,
|
||||
}
|
||||
|
||||
}
|
||||
//切换tab
|
||||
ChangeTab=(e)=>{
|
||||
console.log(e);
|
||||
this.setState({
|
||||
tab:e
|
||||
})
|
||||
}
|
||||
Getdataback = (jobsettingsdata,teacherdata)=>{
|
||||
this.setState({
|
||||
jobsettingsdata:jobsettingsdata,
|
||||
teacherdata:teacherdata,
|
||||
})
|
||||
}
|
||||
componentDidMount() {
|
||||
const query =this.props.location.search;
|
||||
const type = query.split('?tab=');
|
||||
// let sum = []
|
||||
// sum.push(type[1])
|
||||
// console.log("componentDidMountcomponentDidMount");
|
||||
// console.log(sum);
|
||||
this.setState({
|
||||
tab:type,
|
||||
})
|
||||
let querys = this.props.location.pathname;
|
||||
const types = querys.split('/');
|
||||
this.setState({
|
||||
shixuntypes: types[3]
|
||||
})
|
||||
}
|
||||
|
||||
render() {
|
||||
let {tab,jobsettingsdata,teacherdata}=this.state;
|
||||
const isAdmin =this.props.isAdmin();
|
||||
return (
|
||||
<div className="newMain clearfix " >
|
||||
<div className={"educontent mb20"} style={{width:"1200px"}}>
|
||||
|
||||
<div className="educontent mb20">
|
||||
<p className="clearfix mb20 mt10">
|
||||
<ActionBtn className=" btn colorgrey fl hovercolorblue "
|
||||
to={`/courses/${this.props.match.params.coursesId}/students`}>{jobsettingsdata === undefined ? "" : jobsettingsdata.data.course_name}</ActionBtn>
|
||||
<span className="color-grey-9 fl ml3 mr3">></span>
|
||||
<ActionBtn
|
||||
className=" btn colorgrey fl hovercolorblue "
|
||||
to={`/courses/${this.props.match.params.coursesId}/${this.state.shixuntypes}/${jobsettingsdata === undefined ? "" : jobsettingsdata.data.category.category_id===undefined?"":jobsettingsdata.data.category.category_id}`}>{jobsettingsdata === undefined ? "" : jobsettingsdata.data.category.category_name}</ActionBtn>
|
||||
<span className="color-grey-9 fl ml3 mr3">></span>
|
||||
<WordsBtn className="fl">作业详情</WordsBtn>
|
||||
</p>
|
||||
</div>
|
||||
<div className="educontent mb20">
|
||||
<p className=" fl color-black summaryname" style={{heigth:"33px"}}>
|
||||
{teacherdata === undefined ? "" : teacherdata.homework_name}
|
||||
</p>
|
||||
<CoursesListType
|
||||
typelist={teacherdata === undefined ? [""] : teacherdata.homework_status}
|
||||
/>
|
||||
<a className="color-grey-9 fr font-16 summaryname ml20 mr20"
|
||||
href={`/courses/${this.props.match.params.coursesId}/${this.state.shixuntypes}/${jobsettingsdata === undefined ? "" : jobsettingsdata.data.category.category_id===undefined?"": jobsettingsdata.data.category.category_id}`}>返回</a>
|
||||
<a className="color-grey-9 fr font-16 mr20"
|
||||
href={`/shixuns/${teacherdata === undefined ? "" : teacherdata.shixun_identifier}/challenges`}
|
||||
target={"_blank"}>实训详情</a>
|
||||
|
||||
|
||||
</div>
|
||||
|
||||
|
||||
{
|
||||
// 教师列表
|
||||
parseInt(tab)===0 ? (isAdmin===true ?
|
||||
<Listofworks {...this.props} {...this.state} ChangeTab={(e)=>this.ChangeTab(e)} Getdataback={(jobsettingsdata,teacherdata)=>this.Getdataback(jobsettingsdata,teacherdata)} ></Listofworks>
|
||||
:
|
||||
<Listofworksstudentone {...this.props} {...this.state} ChangeTab={(e)=>this.ChangeTab(e)} Getdataback={(jobsettingsdata,teacherdata)=>this.Getdataback(jobsettingsdata,teacherdata)} ></Listofworksstudentone>)
|
||||
:
|
||||
parseInt(tab)===1 ?<Workquestionandanswer {...this.props} {...this.state} ChangeTab={(e)=>this.ChangeTab(e)} Getdataback={(jobsettingsdata,teacherdata)=>this.Getdataback(jobsettingsdata,teacherdata)} ></Workquestionandanswer>
|
||||
:
|
||||
parseInt(tab)===2? <ShixunStudentWork {...this.props} {...this.state} ChangeTab={(e)=>this.ChangeTab(e)} Getdataback={(jobsettingsdata,teacherdata)=>this.Getdataback(jobsettingsdata,teacherdata)} ></ShixunStudentWork>
|
||||
:
|
||||
<Trainingjobsetting {...this.props} {...this.state} ChangeTab={(e)=>this.ChangeTab(e)} Getdataback={(jobsettingsdata,teacherdata)=>this.Getdataback(jobsettingsdata,teacherdata)} ></Trainingjobsetting>
|
||||
}
|
||||
</div>
|
||||
</div>
|
||||
)
|
||||
}
|
||||
}
|
||||
|
||||
export default ShixunHomeworkPage;
|
||||
|
||||
// <div className="edu-back-white mt10" >
|
||||
// <div className="stud-class-set bor-bottom-greyE ">
|
||||
// <div className=" clearfix edu-back-white pl30 pr30">
|
||||
// <div className="fl task_menu_ul">
|
||||
// {this.props.isAdmin() === true ?
|
||||
//
|
||||
// <Menu mode="horizontal" selectedKeys={tab} onClick={(e)=>this.changeTab(e)}>
|
||||
// <Menu.Item key="0">作品列表</Menu.Item>
|
||||
// <Menu.Item key="1">作业回答</Menu.Item>
|
||||
// <Menu.Item key="2">代码查重</Menu.Item>
|
||||
// <Menu.Item key="3">设置</Menu.Item>
|
||||
// </Menu>
|
||||
// :
|
||||
// <Menu mode="horizontal" selectedKeys={tab} onClick={(e)=>this.changeTab(e)}>
|
||||
// <Menu.Item key="0">作品列表</Menu.Item>
|
||||
// <Menu.Item key="1">作业回答</Menu.Item>
|
||||
// <Menu.Item key="2">代码查重</Menu.Item>
|
||||
// </Menu>
|
||||
// }
|
||||
//
|
||||
// </div>
|
||||
// </div>
|
||||
{/* </div>*/}
|
||||
|
||||
|
||||
|
||||
|
||||
{/*</div>*/}
|
Loading…
Reference in new issue