After Width: | Height: | Size: 10 KiB |
After Width: | Height: | Size: 14 KiB |
After Width: | Height: | Size: 9.6 KiB |
After Width: | Height: | Size: 24 KiB |
After Width: | Height: | Size: 2.6 KiB |
After Width: | Height: | Size: 2.6 KiB |
After Width: | Height: | Size: 1.2 KiB |
After Width: | Height: | Size: 27 KiB |
After Width: | Height: | Size: 154 KiB |
@ -0,0 +1,9 @@
|
||||
/*!
|
||||
* Cropper.js v1.5.2
|
||||
* https://fengyuanchen.github.io/cropperjs
|
||||
*
|
||||
* Copyright 2015-present Chen Fengyuan
|
||||
* Released under the MIT license
|
||||
*
|
||||
* Date: 2019-06-30T06:01:02.389Z
|
||||
*/.cropper-container{direction:ltr;font-size:0;line-height:0;position:relative;-ms-touch-action:none;touch-action:none;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none}.cropper-container img{display:block;height:100%;image-orientation:0deg;max-height:none!important;max-width:none!important;min-height:0!important;min-width:0!important;width:100%}.cropper-canvas,.cropper-crop-box,.cropper-drag-box,.cropper-modal,.cropper-wrap-box{bottom:0;left:0;position:absolute;right:0;top:0}.cropper-canvas,.cropper-wrap-box{overflow:hidden}.cropper-drag-box{background-color:#fff;opacity:0}.cropper-modal{background-color:#000;opacity:.5}.cropper-view-box{display:block;height:100%;outline:1px solid #39f;outline-color:rgba(51,153,255,.75);overflow:hidden;width:100%}.cropper-dashed{border:0 dashed #eee;display:block;opacity:.5;position:absolute}.cropper-dashed.dashed-h{border-bottom-width:1px;border-top-width:1px;height:33.33333%;left:0;top:33.33333%;width:100%}.cropper-dashed.dashed-v{border-left-width:1px;border-right-width:1px;height:100%;left:33.33333%;top:0;width:33.33333%}.cropper-center{display:block;height:0;left:50%;opacity:.75;position:absolute;top:50%;width:0}.cropper-center:after,.cropper-center:before{background-color:#eee;content:" ";display:block;position:absolute}.cropper-center:before{height:1px;left:-3px;top:0;width:7px}.cropper-center:after{height:7px;left:0;top:-3px;width:1px}.cropper-face,.cropper-line,.cropper-point{display:block;height:100%;opacity:.1;position:absolute;width:100%}.cropper-face{background-color:#fff;left:0;top:0}.cropper-line{background-color:#39f}.cropper-line.line-e{cursor:ew-resize;right:-3px;top:0;width:5px}.cropper-line.line-n{cursor:ns-resize;height:5px;left:0;top:-3px}.cropper-line.line-w{cursor:ew-resize;left:-3px;top:0;width:5px}.cropper-line.line-s{bottom:-3px;cursor:ns-resize;height:5px;left:0}.cropper-point{background-color:#39f;height:5px;opacity:.75;width:5px}.cropper-point.point-e{cursor:ew-resize;margin-top:-3px;right:-3px;top:50%}.cropper-point.point-n{cursor:ns-resize;left:50%;margin-left:-3px;top:-3px}.cropper-point.point-w{cursor:ew-resize;left:-3px;margin-top:-3px;top:50%}.cropper-point.point-s{bottom:-3px;cursor:s-resize;left:50%;margin-left:-3px}.cropper-point.point-ne{cursor:nesw-resize;right:-3px;top:-3px}.cropper-point.point-nw{cursor:nwse-resize;left:-3px;top:-3px}.cropper-point.point-sw{bottom:-3px;cursor:nesw-resize;left:-3px}.cropper-point.point-se{bottom:-3px;cursor:nwse-resize;height:20px;opacity:1;right:-3px;width:20px}@media (min-width:768px){.cropper-point.point-se{height:15px;width:15px}}@media (min-width:992px){.cropper-point.point-se{height:10px;width:10px}}@media (min-width:1200px){.cropper-point.point-se{height:5px;opacity:.75;width:5px}}.cropper-point.point-se:before{background-color:#39f;bottom:-50%;content:" ";display:block;height:200%;opacity:0;position:absolute;right:-50%;width:200%}.cropper-invisible{opacity:0}.cropper-bg{background-image:url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQAQMAAAAlPW0iAAAAA3NCSVQICAjb4U/gAAAABlBMVEXMzMz////TjRV2AAAACXBIWXMAAArrAAAK6wGCiw1aAAAAHHRFWHRTb2Z0d2FyZQBBZG9iZSBGaXJld29ya3MgQ1M26LyyjAAAABFJREFUCJlj+M/AgBVhF/0PAH6/D/HkDxOGAAAAAElFTkSuQmCC")}.cropper-hide{display:block;height:0;position:absolute;width:0}.cropper-hidden{display:none!important}.cropper-move{cursor:move}.cropper-crop{cursor:crosshair}.cropper-disabled .cropper-drag-box,.cropper-disabled .cropper-face,.cropper-disabled .cropper-line,.cropper-disabled .cropper-point{cursor:not-allowed}
|
@ -1,7 +1,19 @@
|
||||
/**
|
||||
EDU_ADMIN = 1 # 超级管理员
|
||||
EDU_BUSINESS = 2 # 运营人员
|
||||
EDU_SHIXUN_MANAGER = 3 # 实训管理员
|
||||
EDU_SHIXUN_MEMBER = 4 # 实训成员
|
||||
EDU_CERTIFICATION_TEACHER = 5 # 平台认证的老师
|
||||
EDU_GAME_MANAGER = 6 # TPI的创建者
|
||||
EDU_TEACHER = 7 # 平台老师,但是未认证
|
||||
EDU_NORMAL = 8 # 普通用户
|
||||
*/
|
||||
|
||||
export const EDU_ADMIN = 1 // 超级管理员
|
||||
export const EDU_SHIXUN_MANAGER = 2 // 实训管理员
|
||||
export const EDU_SHIXUN_MEMBER = 3 // 实训成员
|
||||
export const EDU_CERTIFICATION_TEACHER = 4 // 平台认证的老师
|
||||
export const EDU_GAME_MANAGER = 5 // TPI的创建者
|
||||
export const EDU_TEACHER = 6 // 平台老师,但是未认证
|
||||
export const EDU_NORMAL = 7 // 普通用户
|
||||
export const EDU_BUSINESS = 2 // # 运营人员
|
||||
export const EDU_SHIXUN_MANAGER = 3 // 实训管理员
|
||||
export const EDU_SHIXUN_MEMBER = 4 // 实训成员
|
||||
export const EDU_CERTIFICATION_TEACHER = 5 // 平台认证的老师
|
||||
export const EDU_GAME_MANAGER = 6 // TPI的创建者
|
||||
export const EDU_TEACHER = 7 // 平台老师,但是未认证
|
||||
export const EDU_NORMAL = 8 // 普通用户
|
@ -0,0 +1,17 @@
|
||||
import React from 'react'
|
||||
|
||||
export const themes = {
|
||||
light: {
|
||||
foreground: '#000000',
|
||||
background: '#eeeeee',
|
||||
foreground_select: '#4CACFF'
|
||||
},
|
||||
dark: {
|
||||
foreground: '#ffffff',
|
||||
background: '#222222',
|
||||
},
|
||||
};
|
||||
|
||||
export const ThemeContext = React.createContext(
|
||||
themes.light // default value
|
||||
);
|
@ -0,0 +1,48 @@
|
||||
import React, { useState, useEffect, memo } from 'react';
|
||||
import ImageLayer from '../../modules/page/layers/ImageLayer';
|
||||
import { isImageExtension } from 'educoder';
|
||||
const $ = window.$;
|
||||
function ImageLayerHook(props) {
|
||||
const [showImage, setShowImage] = useState(false)
|
||||
const [imageSrc, setImageSrc] = useState('')
|
||||
|
||||
const { parentSel, childSel, watchPropsArray } = props
|
||||
|
||||
const onImageLayerClose = () => {
|
||||
setShowImage(false)
|
||||
setImageSrc('')
|
||||
}
|
||||
const onDelegateClick = (event) => {
|
||||
const imageSrc = event.target.src || event.target.getAttribute('src') || event.target.getAttribute('href')
|
||||
// 判断imageSrc是否是图片
|
||||
const fileName = event.target.innerHTML.trim()
|
||||
if (isImageExtension(imageSrc.trim()) || isImageExtension(fileName) || event.target.tagName == 'IMG' || imageSrc.indexOf('base64,') != -1) {
|
||||
// 非回复里的头像图片; 非emoticons
|
||||
if (imageSrc.indexOf('/images/avatars/User') === -1 &&
|
||||
imageSrc.indexOf('kindeditor/plugins/emoticons') === -1 ) {
|
||||
setShowImage(true)
|
||||
setImageSrc(imageSrc)
|
||||
}
|
||||
event.stopPropagation()
|
||||
event.preventDefault && event.preventDefault()
|
||||
event.originalEvent.preventDefault()
|
||||
// event.originalEvent.stopPropagation()
|
||||
// event.originalEvent.cancelBubble = true
|
||||
return false;
|
||||
}
|
||||
}
|
||||
useEffect(() => {
|
||||
$(parentSel)
|
||||
.delegate(childSel, "click", onDelegateClick);
|
||||
|
||||
return () => {
|
||||
$(parentSel).undelegate(childSel, "click", onDelegateClick )
|
||||
}
|
||||
})
|
||||
|
||||
return (
|
||||
<ImageLayer showImage={showImage} imageSrc={imageSrc} onImageLayerClose={onImageLayerClose}></ImageLayer>
|
||||
)
|
||||
}
|
||||
|
||||
export default memo(ImageLayerHook)
|
After Width: | Height: | Size: 32 KiB |
After Width: | Height: | Size: 29 KiB |
@ -1,272 +0,0 @@
|
||||
import React,{ Component } from "react";
|
||||
import { Modal,Checkbox,notification} from "antd";
|
||||
import axios from 'axios';
|
||||
|
||||
class ShixunWorkModal extends Component{
|
||||
constructor(props){
|
||||
super(props);
|
||||
this.state={
|
||||
course_groups:undefined,
|
||||
limit:10,
|
||||
page:1,
|
||||
group_ids:undefined,
|
||||
group_list:undefined
|
||||
}
|
||||
}
|
||||
componentDidMount() {
|
||||
|
||||
let url="/homework_commons/"+this.props.match.params.homeworkid+"/group_list.json";
|
||||
|
||||
axios.get(url,{params:{
|
||||
limit:10,
|
||||
page:1,
|
||||
}
|
||||
}).then((response) => {
|
||||
if(response.data.group_list===undefined){
|
||||
this.setState({
|
||||
course_groups:response.data,
|
||||
group_list:undefined
|
||||
})
|
||||
}else{
|
||||
this.setState({
|
||||
course_groups:response.data,
|
||||
group_list:response.data.group_list
|
||||
})
|
||||
}
|
||||
|
||||
}).catch((error) => {
|
||||
console.log(error)
|
||||
});
|
||||
|
||||
|
||||
}
|
||||
|
||||
//勾选实训
|
||||
shixunhomeworkedit=(checkedValues)=>{
|
||||
let{group_list}=this.state;
|
||||
if(checkedValues.length===group_list.length){
|
||||
this.setState({
|
||||
onChangetype:true,
|
||||
group_ids:checkedValues
|
||||
})
|
||||
}else{
|
||||
this.setState({
|
||||
group_ids:checkedValues,
|
||||
onChangetype:false
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
contentViewScroll=(e)=>{
|
||||
//滑动到底判断
|
||||
if(e.currentTarget.scrollHeight-e.currentTarget.scrollTop===e.currentTarget.clientHeight){
|
||||
let {page,limit,group_list}=this.state;
|
||||
let newpage=page+1;
|
||||
let newgroup_list=group_list;
|
||||
|
||||
let url="/homework_commons/"+this.props.match.params.homeworkid+"/group_list.json";
|
||||
|
||||
axios.get(url,{params:{
|
||||
limit:limit,
|
||||
page:newpage,
|
||||
}
|
||||
}).then((response) => {
|
||||
response.data. course_groups.group_list&&response.data.group_list.map((item,key)=>{
|
||||
newgroup_list.push(item)
|
||||
})
|
||||
this.setState({
|
||||
course_groups:response.data,
|
||||
group_list:newgroup_list,
|
||||
page:newpage
|
||||
})
|
||||
}).catch((error) => {
|
||||
console.log(error)
|
||||
});
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
onChange=(e)=>{
|
||||
let{group_list}=this.state;
|
||||
|
||||
let {data}=this.props;
|
||||
if(e.target.checked===true){
|
||||
if(data&&data.length===0){
|
||||
let id=[]
|
||||
group_list.forEach((item,key)=>{
|
||||
id.push(item.id)
|
||||
})
|
||||
this.setState({
|
||||
group_ids:id,
|
||||
onChangetype:e.target.checked
|
||||
})
|
||||
}else{
|
||||
let id=[]
|
||||
group_list.forEach((item,key)=>{
|
||||
id.push(item.id)
|
||||
})
|
||||
this.setState({
|
||||
group_ids:id,
|
||||
onChangetype:e.target.checked
|
||||
})
|
||||
}
|
||||
}else{
|
||||
this.setState({
|
||||
group_ids:[],
|
||||
onChangetype:e.target.checked
|
||||
})
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
isSave=()=>{
|
||||
let{group_ids}=this.state;
|
||||
let url="/homework_commons/"+this.props.match.params.homeworkid+"/homework_code_repeat.json";
|
||||
axios.post(url, {
|
||||
group_ids: group_ids,
|
||||
})
|
||||
.then((response) => {
|
||||
if (response.data.status === 0) {
|
||||
this.props.updatas()
|
||||
this.props.issCancel()
|
||||
notification.open({
|
||||
message:"提示",
|
||||
description: response.data.message
|
||||
});
|
||||
console.log(this.props)
|
||||
}else if(response.data.status === -1){
|
||||
notification.open({
|
||||
message:"提示",
|
||||
description: response.data.message
|
||||
});
|
||||
}else if(response.data.status === -2){
|
||||
notification.open({
|
||||
message:"提示",
|
||||
description: response.data.message
|
||||
});
|
||||
}else if(response.data.status === -3){
|
||||
notification.open({
|
||||
message:"提示",
|
||||
description: response.data.message
|
||||
});
|
||||
}else if(response.data.status === -4){
|
||||
notification.open({
|
||||
message:"提示",
|
||||
description: response.data.message
|
||||
});
|
||||
}
|
||||
})
|
||||
.catch(function (error) {
|
||||
console.log(error);
|
||||
});
|
||||
}
|
||||
|
||||
issCancel=()=>{
|
||||
this.props.issCancel()
|
||||
}
|
||||
|
||||
render(){
|
||||
let {course_groups,group_ids,onChangetype,group_list}=this.state;
|
||||
// let {data}=this.props;
|
||||
// console.log(group_list)
|
||||
// console.log(course_groups)
|
||||
return(
|
||||
<div>
|
||||
<Modal
|
||||
keyboard={false}
|
||||
className={"HomeworkModal"}
|
||||
title={this.props.modalname}
|
||||
visible={this.props.visible}
|
||||
closable={false}
|
||||
footer={null}
|
||||
destroyOnClose={true}
|
||||
>
|
||||
<div className="task-popup-content">
|
||||
|
||||
<style>{`
|
||||
.greybackHead{
|
||||
padding:0px 30px;
|
||||
}
|
||||
.fontlefts{text-align: left;}
|
||||
`}</style>
|
||||
<ul className="clearfix edu-txt-center">
|
||||
<li className="fl paddingleft22 fontlefts" style={{width:'150px'}}>分班名称</li>
|
||||
<li className="fl edu-txt-left" style={{width:'150px'}}>有效作品数</li>
|
||||
<li className="fl" style={{width:'100px'}}>上次查重时间</li>
|
||||
</ul>
|
||||
|
||||
{course_groups===undefined?"":
|
||||
<ul className="upload_select_box fl clearfix mt10 mb10" tyle={{"overflow-y":"auto"}}id="search_not_members_list"
|
||||
|
||||
onScroll={this.contentViewScroll}
|
||||
>
|
||||
|
||||
|
||||
<Checkbox.Group style={{ width: '100%' }} onChange={this.shixunhomeworkedit} value={group_ids}>
|
||||
{
|
||||
group_list===undefined?
|
||||
|
||||
<div className="clearfix edu-txt-center lineh-40 bor-bottom-greyE">
|
||||
<li className="fl" style={{width: '100px'}}>
|
||||
<Checkbox
|
||||
className="fl task-hide edu-txt-left"
|
||||
name="shixun_homework[]"
|
||||
value={course_groups.ungroup_list.id}
|
||||
>
|
||||
<label style={{"textAlign": "left", "color": "#05101A"}}
|
||||
className="task-hide color-grey-name" title="frerere">{course_groups.ungroup_list.name}</label>
|
||||
</Checkbox>
|
||||
</li>
|
||||
<li className="fl" style={{width: '150px'}}>
|
||||
{course_groups.ungroup_list.works_count}
|
||||
</li>
|
||||
<li className="fl" style={{width: '160px'}}>
|
||||
{course_groups.ungroup_list.last_review_time}
|
||||
</li>
|
||||
</div>
|
||||
|
||||
:
|
||||
group_list&&group_list.map((item,key)=>{
|
||||
return(
|
||||
<div className="clearfix edu-txt-center lineh-40 bor-bottom-greyE" key={key}>
|
||||
<li className="fl" style={{width: '100px'}}>
|
||||
<Checkbox
|
||||
className="fl task-hide edu-txt-left"
|
||||
name="shixun_homework[]"
|
||||
value={item.id}
|
||||
>
|
||||
<label style={{"textAlign": "left", "color": "#05101A"}}
|
||||
className="task-hide color-grey-name" title="frerere">{item.name}</label>
|
||||
</Checkbox>
|
||||
</li>
|
||||
<li className="fl" style={{width: '150px'}}>
|
||||
{item.works_count}
|
||||
</li>
|
||||
<li className="fl" style={{width: '160px'}}>
|
||||
{item.last_review_time}
|
||||
</li>
|
||||
</div>
|
||||
)
|
||||
})
|
||||
}
|
||||
</Checkbox.Group>
|
||||
</ul>
|
||||
}
|
||||
<div className={"clearfix"}>
|
||||
<Checkbox checked={onChangetype} onChange={this.onChange} className={"ml10"}>{onChangetype===true?"清除":"全选"}</Checkbox>
|
||||
</div>
|
||||
|
||||
<div className="clearfix mt30 edu-txt-center mb10">
|
||||
<a className="task-btn color-white mr30" onClick={this.issCancel}>取消</a>
|
||||
<a className="task-btn task-btn-orange" onClick={this.isSave}>确认</a>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</Modal>
|
||||
</div>
|
||||
)
|
||||
}
|
||||
}
|
||||
export default ShixunWorkModal;
|
@ -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
|