dev_tj
杨树明 5 years ago
parent 74f44671f5
commit 308833ea64

@ -1,5 +1,5 @@
import React,{ Component } from "react";
import { ConditionToolTip } from 'educoder'
import { ConditionToolTip,getRandomNumber } from 'educoder'
class AttachmentsList extends Component{
constructor(props){
@ -15,9 +15,9 @@ class AttachmentsList extends Component{
<p key={key} className="clearfix mb3">
<a className="color-grey fl">
<i className="font-14 color-green iconfont icon-fujian mr8"></i>
</a>
</a>
<ConditionToolTip title={item.title} condition={item.title && item.title.length > 30 }>
<a href={item.url} className="mr12 fl task-hide" length="58" target={ item.is_pdf && item.is_pdf == true ? "_blank" : "_self" } style={{"maxWidth":"432px"}}>{item.title}</a>
<a href={item.url+getRandomNumber()} className="mr12 fl task-hide" length="58" target={ item.is_pdf && item.is_pdf == true ? "_blank" : "_self" } style={{"maxWidth":"432px"}}>{item.title}</a>
</ConditionToolTip>
<span className="color-grey mt2 color-grey-6 font-12">{item.filesize}</span>
</p>

@ -1,6 +1,6 @@
import React, { Component } from 'react';
import {Button,Layout,Tabs,Icon, Card, Avatar, Row, Col ,Table,Badge} from 'antd';
import {markdownToHTML,getImageUrl} from 'educoder';
import {markdownToHTML,getImageUrl,getRandomNumber} from 'educoder';
import axios from 'axios';
const { Content } = Layout;
@ -69,7 +69,7 @@ class CompetitionContents extends Component{
const operations = <div>
<Button className={"fr"} type="primary" ghost onClick={()=>this.props.Competitionedit()}>编辑</Button>
<Button className={"fr mr20"} type="primary" ghost>
<a onClick={()=>this.derivefun(`/competitions/${this.props.match.params.identifier}/charts.xlsx`)}>导出</a>
<a onClick={()=>this.derivefun(`/competitions/${this.props.match.params.identifier}/charts.xlsx?${getRandomNumber(true)}`)}>导出</a>
</Button>
</div>
const columns = [

@ -1,5 +1,5 @@
import React, { Component } from 'react';
import { SnackbarHOC } from 'educoder';
import { getRandomNumber } from 'educoder';
import {Link} from 'react-router-dom';
import {BrowserRouter as Router,Route,Switch} from 'react-router-dom';
import Loadable from 'react-loadable';
@ -206,7 +206,7 @@ class CommonWorkDetailIndex extends Component{
}
const isAdmin = this.props.isAdmin()
let exportParams = {}
const isListModule = childModuleName == '作品列表';
// 是列表页
@ -219,12 +219,12 @@ class CommonWorkDetailIndex extends Component{
}
// console.log("普通作业176176176");
// console.log(params);
let exportUrl = `/homework_commons/${workId}/works_list.zip?${queryString.stringify(params)}`
let exportResultUrl = `/homework_commons/${workId}/works_list.xlsx?${queryString.stringify(params)}`
let exportUrl = `/homework_commons/${workId}/works_list.zip?${queryString.stringify(params)}${params?"&"+getRandomNumber(true):getRandomNumber(true)}`
let exportResultUrl = `/homework_commons/${workId}/works_list.xlsx?${queryString.stringify(params)}${params?"&"+getRandomNumber(true):getRandomNumber(true)}`
document.title=course_name === undefined ? "" : course_name;
return (
<div>
<PublishRightnow ref={this.publishModal} showActionButton={false} {...this.props} checkBoxValues={[workId]}
<PublishRightnow ref={this.publishModal} showActionButton={false} {...this.props} checkBoxValues={[workId]}
isPublish={true} doWhenSuccess={this.doWhenSuccess} checkBeforePost={this.saveWorkSetting}
onToPublishClick={this.onToPublishClick}
></PublishRightnow>
@ -234,8 +234,8 @@ class CommonWorkDetailIndex extends Component{
modalCancel={this.Downloadcal}
modalsType={this.state.DownloadType}
/>
<PublishRightnow ref={this.endModal} showActionButton={false} {...this.props} checkBoxValues={[workId]}
isPublish={false} doWhenSuccess={this.doWhenSuccess}></PublishRightnow>
<PublishRightnow ref={this.endModal} showActionButton={false} {...this.props} checkBoxValues={[workId]}
isPublish={false} doWhenSuccess={this.doWhenSuccess}></PublishRightnow>
<div className="newMain clearfix worklist1">
@ -266,7 +266,7 @@ class CommonWorkDetailIndex extends Component{
typelist={homework_status}
typesylename={"mt12"}
/>
{category && <a className="color-grey-6 fr font-16 ml30 mt5 mr20" onClick={this.goback} style={{ marginRight: '26px'}}>返回</a>}
@ -293,24 +293,24 @@ class CommonWorkDetailIndex extends Component{
{ noTab !== true && <div className="stud-class-set bor-bottom-greyE floatSpinParent">
<div className="mt10 clearfix edu-back-white poll_list pl5">
<Link
<Link
onClick={() => this.setState({moduleName: '作品列表'})}
className={`${isListModule ? 'active' : '' } `}
to={`/courses/${courseId}/${moduleEngName}/${workId}/list`}>作品列表</Link>
<Link
<Link
onClick={() => this.setState({moduleName: '作业描述'})}
className={`${childModuleName == '作业描述' ? 'active' : '' } `}
to={`/courses/${courseId}/${moduleEngName}/${workId}/question`}>作业描述</Link>
{view_answer == true && <Link
{view_answer == true && <Link
onClick={() => this.setState({moduleName: '参考答案'})}
className={`${childModuleName == '参考答案' ? 'active' : '' } `}
className={`${childModuleName == '参考答案' ? 'active' : '' } `}
to={`/courses/${courseId}/${moduleEngName}/${workId}/answer`}>参考答案</Link>}
<Link
onClick={() => this.setState({moduleName: '设置'})}
className={`${childModuleName == '设置' ? 'active' : '' } `}
style={{paddingLeft:this.props.isAdmin()?'38px':'20px'}}
to={`/courses/${courseId}/${moduleEngName}/${workId}/setting`}>{this.props.isAdmin()?"设置":"得分规则"}</Link>
{/* { this.props.tabRightComponents } */}
<React.Fragment>
@ -365,16 +365,16 @@ class CommonWorkDetailIndex extends Component{
{isAdmin && <a className={"fr color-blue font-16"} onClick={() => this.props.toEditPage(this.props.match.params, workId)}>编辑作业</a>}
{ //
work_statuses && work_statuses.indexOf('关联项目') != -1 &&
work_statuses && work_statuses.indexOf('关联项目') != -1 &&
<React.Fragment>
<ConnectProject ref="connectProject" {...this.props} connectSuccess={this.connectSuccess}></ConnectProject>
<WordsBtn style="blue" className={` font-16 fr`} onClick={() => this.openConnectionProject({ homework_id: workId })}>关联项目</WordsBtn>
<WordsBtn style="blue" className={` font-16 fr`} onClick={() => this.props.toCreateProject()}>创建项目</WordsBtn>
</React.Fragment>
}
{ //
work_statuses && work_statuses.indexOf('取消关联') != -1 &&
work_statuses && work_statuses.indexOf('取消关联') != -1 &&
<WordsBtn style="blue" className={` font-16 fr`} onClick={() => this.cancelConnectionProject( {homework_id: workId} )}>取消关联</WordsBtn>
}
@ -390,7 +390,7 @@ class CommonWorkDetailIndex extends Component{
{work_statuses && work_statuses.indexOf('修改作品') != -1 && <a className={"fr color-blue font-16"} href={"javascript:void(0)"}
onClick={() => { this.props.toWorkPostPage(this.props.match.params, null, true, work_id)}}
>修改作品</a>}
{work_statuses && work_statuses.indexOf('补交附件') != -1 &&
{work_statuses && work_statuses.indexOf('补交附件') != -1 &&
<React.Fragment>
<AccessoryModal
{...this.props}
@ -406,7 +406,7 @@ class CommonWorkDetailIndex extends Component{
onClick={this.addAccessory}
>补交附件</a>
</React.Fragment>
}
</React.Fragment>
@ -415,7 +415,7 @@ class CommonWorkDetailIndex extends Component{
{/* 内容区 */}
<Switch {...this.props}>
{/* --------------------------------------------------------------------- */}
{/* 作业设置 */}
@ -474,7 +474,7 @@ class CommonWorkDetailIndex extends Component{
</div>
</div>
</div>
)
}
}

@ -1,7 +1,7 @@
import React,{Component} from "react";
import { Form, Select, Input, Button,Checkbox,Icon,message,Modal, Table, Divider, Tag,DatePicker,Radio,Tooltip} from "antd";
import {Link} from 'react-router-dom';
import { WordsBtn, MarkdownToHtml } from 'educoder';
import { WordsBtn, getRandomNumber } from 'educoder';
import axios from 'axios';
import PublishRightnow from '../PublishRightnow'
import AccessoryModal from "../../coursesPublic/AccessoryModal";
@ -44,7 +44,7 @@ class TabRightComponents extends Component{
}
/// 确认是否下载
confirmysl(url){
axios.get(url + '?export=true' ).then((response) => {
axios.get(url + '&export=true' ).then((response) => {
if(response.data.status&&response.data.status===-1){
}else if(response.data.status&&response.data.status===-2){
@ -108,8 +108,8 @@ class TabRightComponents extends Component{
const isAdmin = this.props.isAdmin()
const isSuperAdmin = this.props.isSuperAdmin()
let exportUrl = `/api/homework_commons/${workId}/works_list.zip`
const exportResultUrl = `/api/homework_commons/${workId}/works_list.xlsx`
let exportUrl = `/api/homework_commons/${workId}/works_list.zip${getRandomNumber()}`
const exportResultUrl = `/api/homework_commons/${workId}/works_list.xlsx${getRandomNumber()}`
return(
<React.Fragment>

@ -1,6 +1,6 @@
import React, { Component } from 'react';
import {Button,Layout,Tabs,Icon, Card, Avatar, Row, Col ,Table,Badge} from 'antd';
import {markdownToHTML,getImageUrl} from 'educoder';
import {markdownToHTML,getImageUrl,getRandomNumber} from 'educoder';
import axios from 'axios';
const { Content } = Layout;
@ -69,7 +69,7 @@ class CompetitionContents extends Component{
const operations = <div>
<Button className={"fr"} type="primary" ghost onClick={()=>this.props.Competitionedit()}>编辑</Button>
<Button className={"fr mr20"} type="primary" ghost>
<a onClick={()=>this.derivefun(`/competitions/${this.props.match.params.identifier}/charts.xlsx`)}>导出</a>
<a onClick={()=>this.derivefun(`/competitions/${this.props.match.params.identifier}/charts.xlsx?${getRandomNumber(true)}`)}>导出</a>
</Button>
</div>
const columns = [

@ -1,7 +1,7 @@
import React,{ Component } from "react";
import {Checkbox,Input,Table, Pagination,Menu,Spin} from "antd";
import {Link,NavLink} from 'react-router-dom';
import { WordsBtn ,ActionBtn,queryString,getRandomcode} from 'educoder';
import { WordsBtn ,getRandomNumber,queryString,getRandomcode} from 'educoder';
import CoursesListType from '../coursesPublic/CoursesListType';
import '../css/members.css';
import '../css/busyWork.css';
@ -177,7 +177,7 @@ class Testpapersettinghomepage extends Component{
}
console.log("170");
console.log(params);
const urll=url+`?${queryString.stringify(params)}`;
const urll=url+`?${queryString.stringify(params)}${params?"&"+getRandomNumber(true):getRandomNumber(true)}`;
axios.get(urll+ '&export=true').then((response) => {
if(response===undefined){
return

@ -1,5 +1,5 @@
import React, { Component } from 'react';
import {getRandomNumber,queryString} from 'educoder';
import {getRandomNumber} from 'educoder';
import {Link} from 'react-router-dom';
import {Tooltip,Menu} from 'antd';
import Loadable from 'react-loadable';
@ -519,8 +519,8 @@ class GraduationTaskDetail extends Component{
{this.props.isAdmin()? <li className="li_line drop_down fr color-blue font-16 mt20" style={{"paddingLeft":"0px"}}>
导出<i className="iconfont icon-xiajiantou font-12 ml2"></i>
<ul className="drop_down_menu" style={{"right":"-34px","left":"unset","height":"auto"}}>
<li><a onClick={()=>this.child.confirmysl("/graduation_tasks/"+task_Id+"/tasks_list.xlsx")} className="color-dark">导出成绩</a></li>
<li><a onClick={()=>this.child.confirmysl("/graduation_tasks/"+task_Id+"/tasks_list.zip")} className="color-dark">导出作品附件</a></li>
<li><a onClick={()=>this.child.confirmysl(`/graduation_tasks/"+task_Id+"/tasks_list.xlsx${getRandomNumber()}`)} className="color-dark">导出成绩</a></li>
<li><a onClick={()=>this.child.confirmysl(`/graduation_tasks/"+task_Id+"/tasks_list.zip${getRandomNumber()}`)} className="color-dark">导出作品附件</a></li>
</ul>
</li>:""}
{questionslist.work_status===undefined||questionslist.work_status===null||questionslist.work_status.length===0?"":questionslist.work_status.map((item,key)=>{

@ -873,7 +873,7 @@ class GraduationTaskssettingapp extends Component{
confirmysl(url){
debugger;
console.log(3);
axios.get(url + '?export=true' ).then((response) => {
axios.get(url + '&export=true' ).then((response) => {
if(response === undefined){
return
}

@ -735,7 +735,7 @@ class GraduationTaskssettinglist extends Component{
b_order:b_order,
search:search,
}
axios.get(url + '?export=true',{
axios.get(url + '&export=true',{
params
}).then((response) => {
if(response === undefined){

@ -217,7 +217,7 @@ class GraduationTasksquestions extends Component{
confirmysl(url){
debugger;
console.log(2);
axios.get(url + '?export=true').then((response) => {
axios.get(url + '&export=true').then((response) => {
if(response === undefined){
return
}

@ -4,7 +4,7 @@ import {Checkbox, Menu, Pagination,Spin} from "antd";
import Titlesearchsection from '../../common/titleSearch/TitleSearchSection'
import DownloadMessageysl from "../../../modals/DownloadMessageysl";
import { WordsBtn ,getRandomcode} from 'educoder'
import { WordsBtn ,getRandomcode,getRandomNumber} from 'educoder'
import NoneData from '../../coursesPublic/NoneData'
import Modals from "../../../modals/Modals"
import axios from 'axios'
@ -55,7 +55,7 @@ class Boards extends Component{
let {pageSize}=this.state;
const cid = this.props.match.params.coursesId
let url = `/courses/${cid}/graduation_topics.json?limit=${pageSize}`
if(searchValue!=""){
url+="&search="+searchValue
@ -142,8 +142,8 @@ class Boards extends Component{
checkBoxValues: _.difference(this.state.checkBoxValues, values)
})
}
}
}
onItemClick = (item) => {
const checkBoxValues = this.state.checkBoxValues.slice(0);
const index = checkBoxValues.indexOf(item.id);
@ -198,7 +198,7 @@ class Boards extends Component{
})
}
cancelOperateTopic=()=>{
this.setState({
this.setState({
modalsType:false,
modalsTopval:"",
modalsBottomval:"",
@ -257,7 +257,7 @@ onDelete=(index)=>{
console.log(error)
})
}
}else{
this.setState({
// delType:true,
@ -319,7 +319,7 @@ sureDelTopic=()=>{
}).catch((error)=>{
console.log(error);
})
}
}
}else{
this.setState({
delType:false,
@ -335,7 +335,7 @@ onBoardsNew=()=>{
}
/// 确认是否下载
confirmysl(url){
axios.get(url + '?export=true').then((response) => {
axios.get(url + '&export=true').then((response) => {
if(response.data.status&&response.data.status===-1){
}else if(response.data.status&&response.data.status===-2){
@ -376,12 +376,12 @@ onBoardsNew=()=>{
this.fetchAll(searchValue,page,status);
}
render(){
let {
searchValue,
topicList,
let {
searchValue,
topicList,
data,
course_public,
checkBoxValues,
checkBoxValues,
checkAllValue,
page,
totalCount,
@ -416,7 +416,7 @@ onBoardsNew=()=>{
(<React.Fragment>
{/* 参考普通作业 - 题库选用 */}
{/* <WordsBtn style="blue" className="mr30" onClick={()=>this.useFromBank()}>题库选用</WordsBtn> 正式版没有,先隐藏*/}
< a className={"fl color-blue mr30 font-16"} onClick={(url)=>this.confirmysl(`/courses/${this.props.match.params.coursesId}/graduation_topics/export.xlsx`)}>导出</a>
< a className={"fl color-blue mr30 font-16"} onClick={(url)=>this.confirmysl(`/courses/${this.props.match.params.coursesId}/graduation_topics/export.xlsx?${getRandomNumber(true)}`)}>导出</a>
{/*<p className="fl"><UseBank {...this.props} {...this.state} object_type={"gtopic"} useBankSuccess={this.useBankSuccess}></UseBank></p> 题库选用*/}
<WordsBtn style="blue" className="font-16" onClick={()=>this.onBoardsNew()}>新建</WordsBtn>
</React.Fragment>):""
@ -507,9 +507,9 @@ onBoardsNew=()=>{
:
<div></div>
}
<div>
</div>
<div>
</div>
</React.Fragment>
)
}

@ -1,6 +1,6 @@
import React, {Component} from "react";
import { WordsBtn,on, off, trigger,markdownToHTML,getImageUrl} from 'educoder';
import { WordsBtn,on, off, trigger,markdownToHTML,getRandomNumber} from 'educoder';
import {
Button,
Checkbox,
@ -23,7 +23,8 @@ class GroupPackage extends Component {
}
}
DownloadOpenPdf=(type,url)=>{
type===true?window.open(url):window.location.href=url;
let newurl=url+getRandomNumber();
type===true?window.open(newurl):window.location.href=newurl;
}
componentDidMount() {
console.log("Groupjobquesanswer");

@ -14,7 +14,7 @@ import CourseLayoutcomponent from '../common/CourseLayoutComponent'
import Titlesearchsection from '../common/titleSearch/TitleSearchSection'
import ColorCountText from '../common/titleSearch/ColorCountText'
import { WordsBtn, trigger, on, off, getUrl, downloadFile , sortDirections, NoneData } from 'educoder'
import { WordsBtn, trigger, on, off, getUrl, downloadFile , getRandomNumber, NoneData } from 'educoder'
import Modals from "../../modals/Modals";
import DownloadMessageysl from "../../modals/DownloadMessageysl";
@ -23,7 +23,7 @@ import ChangeRolePop from './ChangeRolePop'
import CourseGroupListTable from './CourseGroupListTable'
import './studentsList.css'
/**
/**
角色数组, CREATOR: 创建者, PROFESSOR: 教师, ASSISTANT_PROFESSOR: 助教, STUDENT: 学生
*/
function CourseGroupList(props) {
@ -36,7 +36,7 @@ function CourseGroupList(props) {
const [listRes, setListRes] = useState({})
const createGroupModalEl = useRef(null);
const courseId = props.match.params.coursesId
const courseId = props.match.params.coursesId
useEffect(() => {
fetchAll()
@ -63,7 +63,7 @@ function CourseGroupList(props) {
}
const onConfirm = async () => {
}
function createGroupImportSuccess() {
}
@ -83,7 +83,7 @@ function CourseGroupList(props) {
}
const confirmysl = (url) => {
axios.get(url + 'export=true').then((response) => {
axios.get(url + '&export=true').then((response) => {
if(response === undefined){
return
}
@ -106,7 +106,7 @@ function CourseGroupList(props) {
console.log(error)
});
}
const isAdmin = props.isAdmin();
const isSuperAdmin = props.isSuperAdmin();
const isParent = true;
@ -121,9 +121,9 @@ function CourseGroupList(props) {
const course_groups = listRes.course_groups
const current_group_id = listRes.current_group_id
let exportUrl = `/courses/${courseId}/export_member_scores_excel.xlsx?`; //总成绩
let exportUrltwo = `/courses/${courseId}/export_couser_info.xlsx?`; //课堂信息
let exportUrlthree = `/courses/${courseId}/export_member_act_score.xlsx?`; //活跃度
let exportUrl = `/courses/${courseId}/export_member_scores_excel.xlsx?${getRandomNumber(true)}`; //总成绩
let exportUrltwo = `/courses/${courseId}/export_couser_info.xlsx?${getRandomNumber(true)}`; //课堂信息
let exportUrlthree = `/courses/${courseId}/export_member_act_score.xlsx?${getRandomNumber(true)}`; //活跃度
return (
<React.Fragment>
<DownloadMessageysl
@ -140,8 +140,8 @@ function CourseGroupList(props) {
showSearchInput={total_count >= 10}
searchPlaceholder={ '请输入分班名称进行搜索' }
firstRowRight={
<React.Fragment>
{ // pageType !== TYPE_STUDENTS &&
<React.Fragment>
{ // pageType !== TYPE_STUDENTS &&
isSuperAdmin && <React.Fragment>
{/* ref="createGroupByImportModal" */}
<CreateGroupByImportModal {...props}
@ -151,12 +151,12 @@ function CourseGroupList(props) {
{/* this.refs['createGroupByImportModal'].setVisible(true) */}
<WordsBtn style="blue" className="mr30" onClick={()=> {createGroupModalEl.current.setVisible(true)}}>导入创建分班</WordsBtn>
</React.Fragment> }
{
// pageType !== TYPE_STUDENTS &&
{
// pageType !== TYPE_STUDENTS &&
!isCourseEnd && isAdmin && <WordsBtn style="blue" className="mr30" onClick={()=>addDir()}>新建分班</WordsBtn> }
{/* {
{/* {
isAdmin && !isParent && course_group_id != 0 && <WordsBtn style="blue" className="mr30" onClick={()=>deleteDir()}>删除分班</WordsBtn> } */}
{/* {
{/* {
isAdmin && !isParent && course_group_id != 0 && <WordsBtn style="blue" className="mr30" onClick={()=>this.renameDir()}>分班重命名</WordsBtn> } */}
<style>{`
.drop_down_menu li a {
@ -210,7 +210,7 @@ function CourseGroupList(props) {
}
onPressEnter={onPressEnter}
></Titlesearchsection>
{!!none_group_member_count && <div className="mt20 E9F8FF padding20-30 pointer" onClick={() => {props.history.push(`/courses/${courseId}/course_groups/0`)}}>
<span>未分班</span>
<span style={{color: '#999999'}}>{none_group_member_count}个学生</span>
@ -219,17 +219,17 @@ function CourseGroupList(props) {
</div>}
<Spin size="large" spinning={isSpin}>
{course_groups && !!course_groups.length ?
{course_groups && !!course_groups.length ?
<div className="mt20 edu-back-white padding20 courseGroupList">
<CourseGroupListTable
course_groups={course_groups}
onOperationSuccess={onOperationSuccess}
current_group_id={current_group_id}
{...props}
></CourseGroupListTable>
</div>:
></CourseGroupListTable>
</div>:
<NoneData></NoneData>}
</Spin>
</React.Fragment>

@ -7,7 +7,7 @@ import CourseLayoutcomponent from '../common/CourseLayoutComponent'
import Titlesearchsection from '../common/titleSearch/TitleSearchSection'
import ColorCountText from '../common/titleSearch/ColorCountText'
import { WordsBtn, trigger, on, off, getUrl, downloadFile , sortDirections } from 'educoder'
import { WordsBtn, trigger, on, off, getUrl, getRandomNumber , sortDirections } from 'educoder'
import Modals from "../../modals/Modals";
import axios from 'axios'
import _ from 'lodash'
@ -24,7 +24,7 @@ const TYPE_COURSE_GOURP_CHILD = 3
const buildColumns = (that,isParent) => {
const { course_groups , sortedInfo } = that.state
let showSorter = isParent==true
const courseId = that.props.match.params.coursesId
const courseId = that.props.match.params.coursesId
const columns=[{
title: '序号',
dataIndex: 'id',
@ -35,7 +35,7 @@ const buildColumns = (that,isParent) => {
render: (id, student, index) => {
return (that.state.page - 1) * 20 + index + 1
}
},
},
// {
// title: '用户id',
// dataIndex: 'login',
@ -48,7 +48,7 @@ const buildColumns = (that,isParent) => {
// title={login && login.length > 10 ? login : ''}
// >{login}</span>
// }
// },
// },
{
title: '姓名',
dataIndex: 'name',
@ -57,7 +57,7 @@ const buildColumns = (that,isParent) => {
width:"10%",
className:"color-grey-6",
render: (name, record) => {
return <a className="color-dark overflowHidden1" target="_blank"
return <a className="color-dark overflowHidden1" target="_blank"
style={{maxWidth: '120px'}} href={`/users/${record.login}`}>{name}</a>
}
}, {
@ -106,7 +106,7 @@ const buildColumns = (that,isParent) => {
}
}
];
if (that.hasGroupModule()) {
that.isStudentPage && columns.push({
title: '分班',
@ -126,7 +126,7 @@ const buildColumns = (that,isParent) => {
if (item.title === "学号") {
columns.splice(key, 1)
return true
}
}
})
}
const isAdmin = that.props.isAdmin()
@ -149,7 +149,7 @@ const buildColumns = (that,isParent) => {
render: (text, record) => {
return (
<React.Fragment>
<WordsBtn onClick={() => that.onDelete(record)} style={'grey'}>删除学生</WordsBtn>
<WordsBtn onClick={() => that.onDelete(record)} style={'grey'}>删除学生</WordsBtn>
{record.member_roles && record.member_roles.length && <ChangeRolePop
style={{ marginLeft: '12px' }}
courseId={courseId}
@ -164,7 +164,7 @@ const buildColumns = (that,isParent) => {
)
},
})
}
return columns;
@ -223,11 +223,11 @@ class studentsList extends Component{
})
}
}else {
// this.props.showNotification(`正在下载中`);
// window.open("/api"+url, '_blank');
this.props.slowDownload(url)
// getUrl() + "/api"+
// const fileUrl = url;
@ -263,7 +263,7 @@ class studentsList extends Component{
DownloadMessageval:undefined
})
}
inputStudent=(e)=>{
this.setState({
StudentList_value:e.target.value
@ -307,7 +307,7 @@ class studentsList extends Component{
modalCancel:false
})
}
onChange=()=>{
}
@ -344,7 +344,7 @@ class studentsList extends Component{
this.fetchCourseGroups()
this.fetchAll()
}
addStudentSuccessListener=(e, data)=>{
const params = JSON.parse(data)
this.props.updataleftNavfun()
@ -358,10 +358,10 @@ class studentsList extends Component{
// console.log('addStudentSuccessListener', data)
}
fetchCourseGroups = () => {
const courseId = this.props.match.params.coursesId
const courseId = this.props.match.params.coursesId
let url = `/courses/${courseId}/all_course_groups.json`
axios.get(url, {
})
.then((response) => {
@ -382,7 +382,7 @@ class studentsList extends Component{
this.setState({checkBoxValues: [], checkAllValue: false })
this.fetchAll(1)
}
}
// 加载了2次
// else if (prevProps.coursesids != this.props.coursesids) {
// this.fetchAll(1)
@ -392,7 +392,7 @@ class studentsList extends Component{
this.setState({
isSpin:true
})
let id = this.props.match.params.coursesId
let id = this.props.match.params.coursesId
let course_group_id = this.props.match.params.course_group_id
const { coursesids } = this.props
@ -424,7 +424,7 @@ class studentsList extends Component{
}
axios.get(encodeURI(url)).then((result)=>{
if (result.data.students) {
this.setState({
this.setState({
students: result.data.students,
total_count: result.data.students_count,
course_group_name: result.data.course_group_name,
@ -468,7 +468,7 @@ class studentsList extends Component{
})
}
onPageChange = (page) => {
this.fetchAll(page)
this.fetchAll(page)
this.setState({ checkAllValue: false })
}
@ -490,7 +490,7 @@ class studentsList extends Component{
return;
}
let id = this.props.match.params.coursesId
let id = this.props.match.params.coursesId
let { order, searchValue }=this.state
let url=`/courses/${id}/transfer_to_course_group.json`;
axios.post((url), {
@ -541,7 +541,7 @@ class studentsList extends Component{
// content: `确认要删除所选的${len}个学生吗?`,
content: `是否确认删除?`,
onOk: () => {
let id = this.props.match.params.coursesId
let id = this.props.match.params.coursesId
let url=`/courses/${id}/delete_from_course.json`;
axios.post((url), {
students: [{course_member_id: record.course_member_id}] // this.state.checkBoxValues.map(item => {return {course_member_id: item} }),
@ -563,7 +563,7 @@ class studentsList extends Component{
trigger('groupAdd', this.props.coursesids)
}
doAddToDir = async () => {
const courseId = this.props.match.params.coursesId
const courseId = this.props.match.params.coursesId
const url = `/courses/${courseId}/join_course_group.json`
const course_group_id = this.props.match.params.course_group_id
@ -578,12 +578,12 @@ class studentsList extends Component{
}
addToDir = (record) => {
this.props.confirm({
content: `是否确认加入分班: ${this.state.course_group_name}?`,
okText: '确认',
cancelText: '取消',
onOk: () => {
this.doAddToDir()
},
@ -604,7 +604,7 @@ class studentsList extends Component{
</div>,
onOk: () => {
const course_group_id = this.props.match.params.course_group_id
const courseId = this.props.match.params.coursesId
const courseId = this.props.match.params.coursesId
const url = `/course_groups/${course_group_id}.json`
axios.delete(url)
@ -616,7 +616,7 @@ class studentsList extends Component{
})
.catch(function (error) {
console.log(error);
});
});
}
})
}
@ -643,7 +643,7 @@ class studentsList extends Component{
const isCourseEnd = this.props.isCourseEnd()
let {
page,
order,
StudentList_value,
stu_new_flag,
@ -662,16 +662,16 @@ class studentsList extends Component{
let currentOrderName = '学生学号排序'
if (order == ORDER_BY_GROUP) {
currentOrderName = '分班名称排序'
}
}
const { coursesids } = this.props
const course_group_id = this.props.match.params.course_group_id
const isParent = !course_group_id || course_group_id == coursesids
const { course_group_name, invite_code } = this.state;
const courseId = this.props.match.params.coursesId
let exportUrl = `/courses/${courseId}/export_member_scores_excel.xlsx?`; //总成绩
let exportUrltwo = `/courses/${courseId}/export_couser_info.xlsx?`; //课堂信息
let exportUrlthree = `/courses/${courseId}/export_member_act_score.xlsx?`; //活跃度
const courseId = this.props.match.params.coursesId
let exportUrl = `/courses/${courseId}/export_member_scores_excel.xlsx?${getRandomNumber(true)}`; //总成绩
let exportUrltwo = `/courses/${courseId}/export_couser_info.xlsx?${getRandomNumber(true)}`; //课堂信息
let exportUrlthree = `/courses/${courseId}/export_member_act_score.xlsx?${getRandomNumber(true)}`; //活跃度
const params = {}
if (course_group_id) {
@ -685,7 +685,7 @@ class studentsList extends Component{
}
let paramsString = ''
for (let key in params) {
paramsString += `${key}=${params[key]}&`
paramsString += `&${key}=${params[key]}&`
}
exportUrl += paramsString;
exportUrltwo+=paramsString;
@ -725,7 +725,7 @@ class studentsList extends Component{
}
)
}
return(
<React.Fragment >
<DownloadMessageysl
@ -735,7 +735,7 @@ class studentsList extends Component{
modalsType={this.state.DownloadType}
/>
<Titlesearchsection
title={isParent ? (pageType == TYPE_STUDENTS ? "全部学生" : "学生列表"):
title={isParent ? (pageType == TYPE_STUDENTS ? "全部学生" : "学生列表"):
<React.Fragment>
<span>
<Tooltip title="返回至分班列表">
@ -756,9 +756,9 @@ class studentsList extends Component{
<i class="iconfont icon-fuzhi font-14 ml10 copybtn" style={{color: '#FF6800', cursor: 'pointer', verticalAlign: 'baseline'}} data-clipboard-text={invite_code} ></i>
</span>
</Tooltip>
</React.Fragment>
</React.Fragment>
}
</React.Fragment>
}
searchValue={ searchValue }
@ -766,24 +766,24 @@ class studentsList extends Component{
showSearchInput={total_count >= 10}
searchPlaceholder={ '请输入姓名、学号进行搜索' }
firstRowRight={
<React.Fragment>
{/* {
// pageType !== TYPE_STUDENTS &&
<React.Fragment>
{/* {
// pageType !== TYPE_STUDENTS &&
!isStudentPage && isSuperAdmin && <React.Fragment>
<CreateGroupByImportModal ref="createGroupByImportModal" {...this.props}
createGroupImportSuccess={this.createGroupImportSuccess}
></CreateGroupByImportModal>
<WordsBtn style="blue" className="mr30" onClick={()=> this.refs['createGroupByImportModal'].setVisible(true)}>导入创建分班</WordsBtn>
</React.Fragment> } */}
{
{
!isStudentPage && isAdmin && !isParent && course_group_id != 0 && <WordsBtn style="blue" className="mr30" onClick={()=>this.deleteDir()}>删除分班</WordsBtn> }
{
{
!isStudentPage && isAdmin && !isParent && course_group_id != 0 && <WordsBtn style="blue" className="mr30" onClick={()=>this.renameDir()}>分班重命名</WordsBtn> }
{
{
!isStudentPage && !isCourseEnd && isAdmin && <WordsBtn style="blue" className="mr30" onClick={()=>this.addDir()}>新建分班</WordsBtn> }
{
{
!isStudentPage && isStudent && !isParent && course_group_id != 0 && <WordsBtn style="blue" className="" onClick={()=>this.addToDir()}>加入分班</WordsBtn> }
<style>{`
.drop_down_menu li a {
@ -854,7 +854,7 @@ class studentsList extends Component{
''
}
{
course_group_id != 0 && course_groups && course_groups.length > 0 &&
course_group_id != 0 && course_groups && course_groups.length > 0 &&
<li key={0} onClick={() => this.moveToGroup({id: 0})}>未分班</li>
}
{ course_groups.filter((item)=> {
@ -865,8 +865,8 @@ class studentsList extends Component{
)
}) }
{ course_groups && course_groups.length > 0 && <Divider className="dividerStyle"></Divider> }
{ isAdmin && !isCourseEnd &&
{ isAdmin && !isCourseEnd &&
<p className="drop_down_btn">
<a href="javascript:void(0)" className="color-grey-6"
onClick={()=>this.addDir()}
@ -876,10 +876,10 @@ class studentsList extends Component{
}
</ul>
</li>}
{/* <li className="drop_down">
{currentOrderName}
{ course_groups && !!course_groups.length &&
{ course_groups && !!course_groups.length &&
<React.Fragment>
<i className="iconfont icon-xiajiantou font-12 ml2"></i>
<ul className="drop_down_normal" style={{width: '124px'}}>
@ -893,7 +893,7 @@ class studentsList extends Component{
</div>
<Spin size="large" spinning={this.state.isSpin}>
<div className="clearfix stu_table">
{students && !!students.length && <Checkbox.Group style={{ width: '100%' }} onChange={this.onCheckBoxChange} value={checkBoxValues}>
{students && !!students.length && <Checkbox.Group style={{ width: '100%' }} onChange={this.onCheckBoxChange} value={checkBoxValues}>
<Table columns={studentlist} dataSource={students} onChange={this.onTableChange} pagination={false}></Table>
</Checkbox.Group> }
</div>

@ -3,7 +3,7 @@ import {Menu} from "antd";
import CoursesListType from '../coursesPublic/CoursesListType';
import { WordsBtn } from 'educoder'
import { WordsBtn,getRandomNumber } from 'educoder'
import PollTabFirst from './PollDetailTabFirst'
import PollTabSecond from './PollDetailTabSecond'
import PollTabThird from './PollDetailTabThird'
@ -112,7 +112,7 @@ class PollDetailIndex extends Component{
/// 确认是否下载
confirmysl(url){
axios.get(url + '?export=true' ).then((response) => {
axios.get(url + '&export=true' ).then((response) => {
if(response.data.status&&response.data.status===-1){
}else if(response.data.status&&response.data.status===-2){
@ -239,7 +239,7 @@ class PollDetailIndex extends Component{
</li>
:""
} */}
<a className="fl color-blue font-16" onClick={(url)=>this.confirmysl("/polls/"+this.props.match.params.pollId+"/commit_result.xlsx")} href="javascript:void(0);">导出统计</a>
<a className="fl color-blue font-16" onClick={(url)=>this.confirmysl(`/polls/${this.props.match.params.pollId}/commit_result.xlsx?${getRandomNumber(true)}`)} href="javascript:void(0);">导出统计</a>
</span>
}
{

@ -1,6 +1,6 @@
import React, {Component} from "react";
import CoursesListType from '../coursesPublic/CoursesListType';
import {WordsBtn, publicSearchs, sortDirections} from 'educoder';
import {getRandomNumber, publicSearchs, sortDirections} from 'educoder';
import {
Form,
Select,
@ -3383,12 +3383,12 @@ class Listofworksstudentone extends Component {
daochushixunbaogao = () => {
let url = `/zip/shixun_report?homework_common_id=${this.props.match.params.homeworkid}&work_status=${this.state.course_groupyslstwo === undefined || this.state.course_groupyslstwo === null ? "" : this.state.course_groupyslstwo}&course_group=${this.state.checkedValuesineinfo === undefined || this.state.checkedValuesineinfo === null ? "" : this.state.checkedValuesineinfo}&search=${this.state.searchtext === undefined || this.state.searchtext === null ? "" : this.state.searchtext}`
let url = `/zip/shixun_report${getRandomNumber()}homework_common_id=${this.props.match.params.homeworkid}&work_status=${this.state.course_groupyslstwo === undefined || this.state.course_groupyslstwo === null ? "" : this.state.course_groupyslstwo}&course_group=${this.state.checkedValuesineinfo === undefined || this.state.checkedValuesineinfo === null ? "" : this.state.checkedValuesineinfo}&search=${this.state.searchtext === undefined || this.state.searchtext === null ? "" : this.state.searchtext}`
this.confirmysl(url);
}
daochuzuoye = () => {
let url = `/homework_commons/${this.props.match.params.homeworkid}/works_list.xlsx?course_group=${this.state.checkedValuesineinfo === undefined || this.state.checkedValuesineinfo === null ? "" : this.state.checkedValuesineinfo}&work_status=${this.state.course_groupyslstwo === undefined || this.state.course_groupyslstwo === null ? "" : this.state.course_groupyslstwo}&search=${this.state.searchtext === undefined || this.state.searchtext === null ? "" : this.state.searchtext}`
let url = `/homework_commons/${this.props.match.params.homeworkid}/works_list.xlsx${getRandomNumber()}course_group=${this.state.checkedValuesineinfo === undefined || this.state.checkedValuesineinfo === null ? "" : this.state.checkedValuesineinfo}&work_status=${this.state.course_groupyslstwo === undefined || this.state.course_groupyslstwo === null ? "" : this.state.course_groupyslstwo}&search=${this.state.searchtext === undefined || this.state.searchtext === null ? "" : this.state.searchtext}`
this.confirmysl(url);
}

@ -1,6 +1,6 @@
import React, {Component} from "react";
import CoursesListType from '../coursesPublic/CoursesListType';
import {WordsBtn, getRandomcode, sortDirections} from 'educoder';
import {getRandomNumber, getRandomcode, sortDirections} from 'educoder';
import ShixunWorkModal from './Shixunworkdetails/ShixunWorkModal';
import HomeworkModal from "../coursesPublic/HomeworkModal";
import OneSelfOrderModal from "../coursesPublic/OneSelfOrderModal";
@ -594,12 +594,12 @@ class ShixunStudentWork extends Component {
}
daochuzuoye =() =>{
let url = `/homework_commons/${this.props.match.params.homeworkid}/works_list.xlsx`;
let url = `/homework_commons/${this.props.match.params.homeworkid}/works_list.xlsx${getRandomNumber()}`;
this.confirmysl(url);
}
confirmysl(url){
axios.get(url + '?export=true').then((response) => {
axios.get(url + '&export=true').then((response) => {
if(response === undefined){
return
}

@ -1,7 +1,7 @@
import React, {Component} from "react";
import CoursesListType from '../coursesPublic/CoursesListType';
import HomeworkModal from "../coursesPublic/HomeworkModal";
import {WordsBtn, getRandomcode, handleDateString, getImageUrl} from 'educoder';
import {getRandomNumber, getRandomcode, handleDateString, getImageUrl} from 'educoder';
import PollDetailTabForthRules from '../poll/PollDetailTabForthRules';
import ShixunWorkModal from './Shixunworkdetails/ShixunWorkModal';
import {
@ -2252,12 +2252,12 @@ class Trainingjobsetting extends Component {
daochushixunbaogao = () => {
let url = `/zip/shixun_report?homework_common_id=${this.props.match.params.homeworkid}`;
this.confirmysl(url, url + '&export=true');
this.confirmysl(url, url + `&export=true${getRandomNumber(true)}`);
}
daochuzuoye = () => {
let url = `/homework_commons/${this.props.match.params.homeworkid}/works_list.xlsx`;
this.confirmysl(url, url + '?export=true');
this.confirmysl(url, url + `?export=true&${getRandomNumber(true)}`);
}
confirmysl(url, urlWithExport) {

@ -1,6 +1,6 @@
import React, {Component} from "react";
import CoursesListType from '../coursesPublic/CoursesListType';
import {WordsBtn, getRandomcode, markdownToHTML} from 'educoder';
import {getRandomNumber, getRandomcode, markdownToHTML} from 'educoder';
import {
Form,
Select,
@ -381,12 +381,12 @@ class Workquestionandanswer extends Component {
daochushixunbaogao=()=>{
let url =`/zip/shixun_report?homework_common_id=${this.props.match.params.homeworkid}`;
this.confirmysl(url, url + '&export=true');
this.confirmysl(url, url + `&export=true${getRandomNumber(true)}`);
}
daochuzuoye =() =>{
let url = `/homework_commons/${this.props.match.params.homeworkid}/works_list.xlsx`;
this.confirmysl(url, url + '?export=true');
this.confirmysl(url, url + `?export=true&${getRandomNumber(true)}`);
}
confirmysl(url, urlWithExport){

@ -1,6 +1,7 @@
import React from 'react';
import PropTypes from "prop-types";
import { Link } from 'react-router-dom';
import {getRandomNumber} from 'educoder';
import { Spin, Button, Input, Divider, Icon, Tooltip, Form, message, Modal } from 'antd';
import axios from 'axios';
import _ from 'lodash'
@ -233,7 +234,7 @@ class GraduationRequirement extends React.Component {
<Link to="/forums/3530" target="_blank" className="link ml10">查看详情</Link>
</div>
</div>
<a href={`/api/ec_years/${this.props.yearId}/ec_graduation_requirements.xlsx`} target="_blank" className="ant-btn ant-btn-primary color-white">导出毕业要求</a>
<a href={`/api/ec_years/${this.props.yearId}/ec_graduation_requirements.xlsx${getRandomNumber()}`} target="_blank" className="ant-btn ant-btn-primary color-white">导出毕业要求</a>
</div>
<Divider/>

@ -1,7 +1,7 @@
import React, { Component } from 'react';
import classNames from 'classnames'
import {getRandomNumber} from 'educoder';
import axios from 'axios';
import { Table, Divider, Tag, Checkbox, InputNumber, Spin, Icon } from 'antd';
@ -48,7 +48,7 @@ class RequirementVsObjective extends Component {
// ...testState
}
}
componentDidMount(){
// this.init()
// return;
@ -58,7 +58,7 @@ class RequirementVsObjective extends Component {
axios.get(url).then((response) => {
if (response.data.graduation_requirements) {
this.setState( {...response.data} , () => {
this.init()
this.init()
})
}
}).catch((e) => {
@ -92,7 +92,7 @@ class RequirementVsObjective extends Component {
const yearId = this.props.match.params.yearId
const url = `/ec_years/${yearId}/requirement_support_objectives.json`
const method = select ? axios.delete : axios.post
method(url,
method(url,
select ? {
params: {
ec_graduation_requirement_id,
@ -105,7 +105,7 @@ class RequirementVsObjective extends Component {
).then((response) => {
if (response.data.status == 0) {
this.setState(
(prevState) => ({
(prevState) => ({
tableData : update(prevState.tableData, {[rowIndex]: {[colIndex]: {$set: select ? false : true}}})
})
)
@ -128,7 +128,7 @@ class RequirementVsObjective extends Component {
const columnIdIndexMap = {}
console.log(columns, tableData)
return (
<div className="educontent requirementVsObjective" style={{ background: '#fff' }}>
<ul className="clearfix padding20-30 bor-bottom-greyE backgroundFFF"
style={{ 'marginBottom': '0px' }} >
@ -140,7 +140,7 @@ class RequirementVsObjective extends Component {
</p>
</li>
<a href={`/api/ec_years/${this.props.yearId}/requirement_support_objectives.xlsx`} target="_blank"
<a href={`/api/ec_years/${this.props.yearId}/requirement_support_objectives.xlsx${getRandomNumber()}`} target="_blank"
className="ant-btn ant-btn-primary color-white fr mt20">导出矩阵</a>
</ul>
<div className="padding20-30" style={{ background: '#fff' }}>
@ -155,7 +155,7 @@ class RequirementVsObjective extends Component {
></SelectTable>
</div>
</div>
);
}
}

@ -1,7 +1,7 @@
import React, { Component } from 'react';
import classNames from 'classnames'
import {getRandomNumber} from 'educoder'
import axios from 'axios';
import { Table, Divider, Tag, Checkbox, InputNumber, Spin, Icon } from 'antd';
@ -12,10 +12,10 @@ class RequirementVsObjective extends Component {
constructor(props) {
super(props)
this.state={
}
}
componentDidMount(){
// this.init()
// return;
@ -25,7 +25,7 @@ class RequirementVsObjective extends Component {
axios.get(url).then((response) => {
if (response.data.graduation_subitems) {
this.setState( {...response.data} , () => {
this.init()
this.init()
})
}
}).catch((e) => {
@ -61,7 +61,7 @@ class RequirementVsObjective extends Component {
const yearId = this.props.match.params.yearId
const url = `/ec_years/${yearId}/subitem_support_standards.json`
const method = select ? axios.delete : axios.post
method(url,
method(url,
select ? {
params: {
ec_graduation_subitem_id,
@ -74,7 +74,7 @@ class RequirementVsObjective extends Component {
).then((response) => {
if (response.data.status == 0) {
this.setState(
(prevState) => ({
(prevState) => ({
tableData : update(prevState.tableData, {[rowIndex]: {[colIndex]: {$set: select ? false : true}}})
})
)
@ -97,7 +97,7 @@ class RequirementVsObjective extends Component {
const columnIdIndexMap = {}
console.log(columns, tableData)
return (
<div className="educontent requirementVsObjective" style={{ background: '#fff' }}>
<ul className="clearfix padding20-30 bor-bottom-greyE backgroundFFF"
style={{ 'marginBottom': '0px' }} >
@ -109,7 +109,7 @@ class RequirementVsObjective extends Component {
</p>
</li>
<a href={`/api/ec_years/${this.props.yearId}/subitem_support_standards.xlsx`} target="_blank"
<a href={`/api/ec_years/${this.props.yearId}/subitem_support_standards.xlsx${getRandomNumber()}`} target="_blank"
className="ant-btn ant-btn-primary color-white fr mt20">导出矩阵</a>
</ul>
<div className="padding20-30" style={{ background: '#fff' }}>
@ -126,7 +126,7 @@ class RequirementVsObjective extends Component {
></SelectTable>
</div>
</div>
);
}
}

@ -2,6 +2,7 @@ import React from 'react';
import PropTypes from "prop-types";
import { Link } from 'react-router-dom';
import { Spin, Button, Input, Divider, Icon, Tooltip, Form, message } from 'antd';
import {getRandomNumber} from 'educoder';
import axios from 'axios';
import './index.scss';
@ -157,7 +158,7 @@ class TrainingObjective extends React.Component {
<Link to="/forums/3529" target="_blank" className="link ml10">查看详情</Link>
</div>
</div>
<a href={`/api/ec_years/${this.props.yearId}/ec_training_objectives.xlsx`} target="_blank" className="ant-btn ant-btn-primary color-white">导出培养目标</a>
<a href={`/api/ec_years/${this.props.yearId}/ec_training_objectives.xlsx${getRandomNumber()}`} target="_blank" className="ant-btn ant-btn-primary color-white">导出培养目标</a>
</div>
<Divider/>
@ -191,7 +192,7 @@ class TrainingObjective extends React.Component {
</div>
)
}
<div className="training-objective-items">
<div className="training-objective-items-head">
<div className="no-column">分项</div>

@ -1,6 +1,8 @@
import React, { Component } from 'react';
import classNames from 'classnames'
import classNames from 'classnames';
import {getRandomNumber} from 'educoder';
import axios from 'axios';
@ -166,7 +168,7 @@ const buildColumns = (that) => {
const _i_remain = index % 3;
// 未达成
const obj = {
children: row.status ? <span style={{color: '#29BD88'}}>达成</span>
children: row.status ? <span style={{color: '#29BD88'}}>达成</span>
: <span style={{color: '#FF6800'}}>未达成</span>,
props: {},
};
@ -233,14 +235,14 @@ function getTableData(data_args) {
// 一个course数组的数据组合成三行table数据
innerItem.course_data.forEach((course, courseIndex) => {
nameRowData[`c${courseIndex + 1}`] = course.course_name;
targetValueRowData[`c${courseIndex + 1}`] = course.target_value && course.target_value.toFixed
targetValueRowData[`c${courseIndex + 1}`] = course.target_value && course.target_value.toFixed
? course.target_value.toFixed(3) : course.target_value ;
if (course.target_value) {
target_value_total = target_value_total + course.target_value
}
realValueRowData[`c${courseIndex + 1}`] = course.real_value && course.real_value.toFixed
realValueRowData[`c${courseIndex + 1}`] = course.real_value && course.real_value.toFixed
? course.real_value.toFixed(3) : course.real_value ;
if (course.real_value) {
real_value_total = real_value_total + course.real_value
@ -259,7 +261,7 @@ function getTableData(data_args) {
return tableData;
}
// new
function getTableData(data_args) {
function getTableData(data_args) {
let tableData = []
// 最大课程数量,根据这个值动态渲染课程列数
maxCouseCount = 0;
@ -274,16 +276,16 @@ let tableData = []
// 一个course数组的数据组合成三行table数据
innerItem.course_supports.forEach((course, courseIndex) => {
nameRowData[`c${courseIndex + 1}`] = course.course_name;
targetValueRowData[`c${courseIndex + 1}`] = course.reach_criteria
// course.target_value && course.target_value.toFixed
// course.target_value && course.target_value.toFixed
// ? course.target_value.toFixed(3) : course.target_value ;
// if (course.target_value) {
// target_value_total = target_value_total + course.target_value
// }
realValueRowData[`c${courseIndex + 1}`] = course.actually_reach
// course.real_value && course.real_value.toFixed
// course.real_value && course.real_value.toFixed
// ? course.real_value.toFixed(3) : course.real_value ;
// if (course.real_value) {
// real_value_total = real_value_total + course.real_value
@ -496,7 +498,7 @@ class GraduatesRequirement extends Component {
}
}
onDaChengYuZhiChange = (value) => {
if ( (!window.event || window.event.type == 'blur')
if ( (!window.event || window.event.type == 'blur')
&& this.state.daChengYuZhi > 1 && value == 1) {
this.props.showSingleButtonModal('提示', '达成阈值必须小于等于1')
}
@ -526,7 +528,7 @@ class GraduatesRequirement extends Component {
axios.post(url, {
reach_criteria : this.state.daChengYuZhi
}).then((response) => {
if( response.data.status === 0 ) {
this.setState({ daChengYuZhiSaved: this.state.daChengYuZhi })
this.setDaChengYuZhiEditableMode(false)
@ -537,7 +539,7 @@ class GraduatesRequirement extends Component {
console.log(error)
})
}
componentDidMount(){
window.document.title = '达成度评价结果';
@ -569,7 +571,7 @@ class GraduatesRequirement extends Component {
// const url = `ec_courses/7/get_calculation_data`
// const url = `/ec_courses/get_calculation_data?ec_year_id=${ec_year_id}`
const url = `/ec_years/${ec_year_id}/reach_evaluation.json`
// num_array = getNumArray(testData.calculation_data);
// num_array = getNumArray(testData.calculation_data);
// tableData = getTableData(testData.calculation_data)
// return
@ -578,8 +580,8 @@ class GraduatesRequirement extends Component {
})
.then((response) => {
if (response.data.graduation_requirements) {
num_array = getNumArray(response.data.graduation_requirements);
tableData = getTableData(response.data.graduation_requirements)
num_array = getNumArray(response.data.graduation_requirements);
tableData = getTableData(response.data.graduation_requirements)
// 先计算再触发render
this.setState({
calculationData: response.data.calculation_data,
@ -590,7 +592,7 @@ class GraduatesRequirement extends Component {
calculating: false,
})
}
})
.catch(function (error) {
@ -604,7 +606,7 @@ class GraduatesRequirement extends Component {
return;
}
this.setState({ calculating: true })
var Url = '/ec_courses/sync_all_course_data';
/**
@ -615,14 +617,14 @@ class GraduatesRequirement extends Component {
axios.post(Url, {
course_ids: this.state.course_ids
}).then((response) => {
// 计算需要一定的时间,让按钮转动
// 计算需要一定的时间,让按钮转动
if( response.data.status === 1 ) {
let ec_year_id = this.props.match.params.ec_year_id;
this.fetchData(ec_year_id);
this.props.showSingleButtonModal('提示', '计算完毕')
} else {
}
}).catch((error) => {
this.setState({ calculating: false })
@ -641,7 +643,7 @@ class GraduatesRequirement extends Component {
// showCalculateButton = true;
// }
return (
<div className="educontent graduatesRequirement">
<ul className="clearfix padding20-30 bor-bottom-greyE backgroundFFF"
@ -659,62 +661,62 @@ class GraduatesRequirement extends Component {
<p class="clearfix padding20-30 bor-bottom-greyE backgroundFFF"
style={{ 'paddingBottom': '12px' }}>
<span class="fl font-14">达成阈值</span>
{ daChengYuZhiEditableMode ?
{ daChengYuZhiEditableMode ?
<React.Fragment>
<InputNumber value={daChengYuZhi} onChange={this.onDaChengYuZhiChange}
size="small" min={0} max={1} step={0.01} ></InputNumber>
<span onClick={this.saveDaChengYuZhi}
<span onClick={this.saveDaChengYuZhi}
style={{color: '#4CACFF', marginLeft: '4px', cursor: 'pointer', fontSize: '13px'}}>确定
</span>
<span onClick={ this.onDaChengYuZhiCancel }
style={{color: '#d1d1d1', marginLeft: '4px', cursor: 'pointer', fontSize: '13px'}} >取消
</span>
</React.Fragment>
:
:
<React.Fragment>
<span class="color-orange fl" id="ReachStandardNum">{daChengYuZhiSaved}</span>
{/* data-tip-down="编辑" */}
<i
<i
onClick={() => { this.setDaChengYuZhiEditableMode(true) }}
class="iconfont icon-bianjidaibeijing color-green" idkey="0"
style={{ float: 'left', marginTop: '-3px', marginLeft: '3px', cursor: 'pointer' }}></i>
</React.Fragment>
}
{/* <a class="mr20 editSubentry" style={{display: 'block'}}>
</a> */}
<a href="javascript:void(0)"
class="white-btn edu-orangeback-btn fr mr10"
href={`/api/ec_years/${this.state.ec_year_id}/reach_evaluation.xlsx`}
<a href="javascript:void(0)"
class="white-btn edu-orangeback-btn fr mr10"
href={`/api/ec_years/${this.state.ec_year_id}/reach_evaluation.xlsx${getRandomNumber()}`}
>导出</a>
{/* /ec_major_schools/3/academic_years/5/export_reach_requirements_data.xls
let major_school_id =this.props.match.params.major_school_id;
let ec_year_id =this.props.match.params.ec_year_id;
*/}
{ showCalculateButton && ( this.state.calculating === true ?
{ showCalculateButton && ( this.state.calculating === true ?
<a href="javascript:void(0)" class="white-btn edu-grayback-btn mr20 fr">
计算中...
</a> :
</a> :
<a href="javascript:void(0)" class="white-btn edu-orangeline-btn mr20 fr" onClick={this.onCalculate}>
计算
</a> )
}
</p>
{/* { this.state.calculating == true ?
{/* { this.state.calculating == true ?
<Spin delay={500} className="Spinlarge" indicator={<Icon type="loading" style={{ fontSize: 30 }} spin />}></Spin>
: }   */}
<Table bordered loading={ this.state.calculating }
columns={buildColumns(this)} dataSource={tableData} pagination={false}
scroll={{ y: 530 }}
scroll={{ y: 530 }}
></Table>
</div>
);
}
}

@ -1,23 +1,13 @@
import React, { Component } from 'react';
import classNames from 'classnames'
import axios from 'axios';
import { TPMIndexHOC } from '../../tpm/TPMIndexHOC';
import { SnackbarHOC } from 'educoder'
import { message,Modal,Spin,Icon} from 'antd';
import {getRandomNumber} from 'educoder';
import 'antd/dist/antd.css';
import EcTitleCourseEvaluations from '../ecTitle/ecTitle'
import '../css/ecCourseSupports.css';
import '../css/ecCourseEvaluations.css';
import {
BrowserRouter as Router,
Route,
Switch
} from 'react-router-dom';
@ -223,7 +213,7 @@ class Curriculum extends Component {
titine===5?
<span>
<span className={ismanager===false?"none":""} style={{top: "26px"}}>
<a className="white-btn edu-blueback-btn fr mb10 mr10 mt9" target="_blank" href={`/ec_courses/${ec_course_id}/course_targets.xlsx`}>导出评价详情</a>
<a className="white-btn edu-blueback-btn fr mb10 mr10 mt9" target="_blank" href={`/ec_courses/${ec_course_id}/course_targets.xlsx${getRandomNumber()}`}>导出评价详情</a>
</span>
<span className={ismanager===false?"none":"right newrightcalculatebuttons fr mb10 mr20 "}
onClick={()=>this.newrightcalculatebuttonysl(this.child)}>计算</span>

Loading…
Cancel
Save