diff --git a/app/controllers/application_controller.rb b/app/controllers/application_controller.rb
index 64d03cbac..254d04cfd 100644
--- a/app/controllers/application_controller.rb
+++ b/app/controllers/application_controller.rb
@@ -24,8 +24,8 @@ class ApplicationController < ActionController::Base
# 所有请求必须合法签名
def check_sign
Rails.logger.info("66666 #{params}")
- suffix = request.url.split(".").last
- suffix_arr = ["xls", "xlsx"] # excel文件先注释
+ suffix = request.url.split(".").last.split("?").first
+ suffix_arr = ["xls", "xlsx", "pdf"] # excel文件先注释
unless suffix_arr.include?(suffix)
if params[:client_key].present?
randomcode = params[:randomcode]
diff --git a/app/controllers/discusses_controller.rb b/app/controllers/discusses_controller.rb
index 6b21526dd..e7d692de5 100644
--- a/app/controllers/discusses_controller.rb
+++ b/app/controllers/discusses_controller.rb
@@ -14,14 +14,14 @@ class DiscussesController < ApplicationController
@disscuss_count = Discuss.where(:dis_id => @container.id, :dis_type => @container.class.to_s, :root_id => nil).count
disscusses = Discuss.where(:dis_id => @container.id, :dis_type => @container.class.to_s,
:root_id => nil)
- @discusses = disscusses.limit(LIMIT).joins("left join games on discusses.challenge_id = games.challenge_id and discusses.user_id = games.user_id")
- .select("discusses.*, games.identifier").includes(:user, :praise_treads).offset(offset)
+ @discusses = disscusses.joins("left join games on discusses.challenge_id = games.challenge_id and discusses.user_id = games.user_id")
+ .select("discusses.*, games.identifier").includes(:user, :praise_treads)
else
disscusses = Discuss.where("dis_id = :dis_id and dis_type = :dis_type and root_id is null and
(discusses.hidden = :hidden or discusses.user_id = :user_id)",
{dis_id: @container.id, dis_type: @container.class.to_s, hidden: false, user_id: current_user.id})
@disscuss_count = disscusses.count("discusses.id")
- @discusses = disscusses.limit(LIMIT).includes(:user, :praise_treads).offset(offset)
+ @discusses = disscusses.includes(:user, :praise_treads).limit(LIMIT).offset(offset)
end
@current_user = current_user
diff --git a/app/controllers/gits_controller.rb b/app/controllers/gits_controller.rb
index bbb0e293e..0767eab02 100644
--- a/app/controllers/gits_controller.rb
+++ b/app/controllers/gits_controller.rb
@@ -1,5 +1,5 @@
class GitsController < ApplicationController
-
+ skip_before_action :check_sign
# 说明:
# 以下Git认证只针对新版git,Gitlab的Git认证不走该控制器
# 思路:
@@ -39,7 +39,7 @@ class GitsController < ApplicationController
# 用户是否对对象拥有权限
system_user = User.find_by_login(input_username) || User.find_by_mail(input_username) || User.find_by_phone(input_username)
# 如果用户名密码错误
- if system_user && !system_user.check_password?(input_password)
+ if system_user.blank? || system_user && !system_user.check_password?(input_password)
uid_logger_error("git start: password is wrong")
result = false
else
diff --git a/app/controllers/homework_commons_controller.rb b/app/controllers/homework_commons_controller.rb
index e26e67a93..a4d34a1c8 100644
--- a/app/controllers/homework_commons_controller.rb
+++ b/app/controllers/homework_commons_controller.rb
@@ -1377,12 +1377,12 @@ class HomeworkCommonsController < ApplicationController
tip_exception(-1, "作业还未发布,不能评阅") if @homework_detail_manual.comment_status == 0
tip_exception("请至少输入一个评阅") if params[:comment].blank? && params[:hidden_comment].blank?
ActiveRecord::Base.transaction do
- work_ids = @homework.student_works.where(user_id: @course.teacher_group_user_ids(current_user.id)).pluck(:id)
+ work_ids = @homework.student_works.where(work_status: [1, 2], user_id: @course.teacher_group_user_ids(current_user.id)).pluck(:id)
has_comment_ids = ShixunWorkComment.where(challenge_id: 0, student_work_id: work_ids, batch_comment: 0).pluck(:student_work_id)
batch_comment_works = ShixunWorkComment.where(challenge_id: 0, student_work_id: work_ids, batch_comment: 1)
batch_comment_works.update_all(comment: params[:comment], hidden_comment: params[:hidden_comment])
work_ids = work_ids - has_comment_ids - batch_comment_works.pluck(:student_work_id)
- @homework.student_works.where(work_status: 0, id: work_ids).update_all(work_status: 1, commit_time: @homework.end_time, update_time: Time.now, work_score: 0, final_score: 0)
+ # @homework.student_works.where(work_status: 0, id: work_ids).update_all(work_status: 1, commit_time: @homework.end_time, update_time: Time.now, work_score: 0, final_score: 0)
HomeworkBatchCommentJob.perform_later(params[:comment], params[:hidden_comment], work_ids, @homework.id, current_user.id)
normal_status("评阅成功")
end
diff --git a/app/controllers/polls_controller.rb b/app/controllers/polls_controller.rb
index 08d0da42f..3e6914dee 100644
--- a/app/controllers/polls_controller.rb
+++ b/app/controllers/polls_controller.rb
@@ -792,12 +792,12 @@ class PollsController < ApplicationController
if the_group_setting_status == 2
poll_group_params = {
:publish_time => the_group_setting.publish_time,
- :end_time => poll_end_time
+ :end_time => poll_end_time < Time.now ? the_group_setting.end_time : poll_end_time
}
elsif the_group_setting_status == 3
poll_group_params = {
:publish_time => the_group_setting.publish_time,
- :end_time => the_group_setting.end_time
+ :end_time => poll_end_time
}
end
the_group_setting.update_attributes(poll_group_params)
diff --git a/public/react/src/common/UrlTool.js b/public/react/src/common/UrlTool.js
index 8c3317cf6..33c91fb89 100644
--- a/public/react/src/common/UrlTool.js
+++ b/public/react/src/common/UrlTool.js
@@ -1,4 +1,8 @@
+import React from "react";
import md5 from 'md5';
+import {Input} from "antd";
+const { Search } = Input;
+
const $ = window.$;
const isDev = window.location.port == 3007;
export const TEST_HOST = "https://test-newweb.educoder.net"
@@ -128,7 +132,13 @@ export function getTaskUrlById(id) {
export function getRandomcode(url) {
Railsgettimes()
let anewopens=md5(newopens+newtimestamp);
- return `${url}?randomcode=${newtimestamp}&client_key=${anewopens}`
+
+ if (url.indexOf('?') == -1) {
+ return `${url}?randomcode=${newtimestamp}&client_key=${anewopens}`
+ }else {
+ return `${url}&randomcode=${newtimestamp}&client_key=${anewopens}`
+ }
+
}
export function htmlEncode(str) {
@@ -144,3 +154,15 @@ export function htmlEncode(str) {
s = s.replace(/\"/g, """);
return s;
}
+
+export function publicSearchs(Placeholder,onSearch,onInputs,onChanges,loadings) {
+ return()
+}
\ No newline at end of file
diff --git a/public/react/src/common/educoder.js b/public/react/src/common/educoder.js
index 126a42e87..35abfc7fe 100644
--- a/public/react/src/common/educoder.js
+++ b/public/react/src/common/educoder.js
@@ -2,7 +2,7 @@
// export { default as OrderStateUtil } from '../routes/Order/components/OrderStateUtil';
-export { getImageUrl as getImageUrl, getUrl as getUrl, getRandomcode as getRandomcode,getUrlmys as getUrlmys, getUrl2 as getUrl2, setImagesUrl as setImagesUrl
+export { getImageUrl as getImageUrl, getUrl as getUrl, publicSearchs as publicSearchs,getRandomcode as getRandomcode,getUrlmys as getUrlmys, getUrl2 as getUrl2, setImagesUrl as setImagesUrl
, getUploadActionUrl as getUploadActionUrl,getUploadActionUrltwo as getUploadActionUrltwo ,getUploadActionUrlthree as getUploadActionUrlthree, getUploadActionUrlOfAuth as getUploadActionUrlOfAuth
, getTaskUrlById as getTaskUrlById, TEST_HOST ,htmlEncode as htmlEncode } from './UrlTool';
export { default as queryString } from './UrlTool2';
diff --git a/public/react/src/modules/courses/Resource/index.js b/public/react/src/modules/courses/Resource/index.js
index ce4fb8dc2..501176882 100644
--- a/public/react/src/modules/courses/Resource/index.js
+++ b/public/react/src/modules/courses/Resource/index.js
@@ -230,7 +230,8 @@ class Fileslists extends Component{
filesId:list.id,
name:list.name,
course_is_public:result.data.data.course_is_public,
- isSpin:false
+ isSpin:false,
+ page:page
})
}
}
@@ -423,7 +424,7 @@ class Fileslists extends Component{
onPressEnter = () => {
let {searchValue}=this.state;
let{pagesize,page,tagname,sort,sorttype,coursesecondcategoryid}=this.state;
- this.getfileslist(pagesize,page,tagname,searchValue,sort,sorttype,coursesecondcategoryid);
+ this.getfileslist(pagesize,1,tagname,searchValue,sort,sorttype,coursesecondcategoryid);
}
onInputSearchChange = (e) => {
@@ -850,6 +851,7 @@ class Fileslists extends Component{
searchValue={ searchValue }
// searchtype={this.props.isAdmin||this.props.isStudent ?true:false}
onInputSearchChange={this.onInputSearchChange}
+ allowClearonChange={this.onInputSearchChange}
firstRowRight={
{/*{this.props.isAdmin()?parseInt(this.props.match.params.main_id)===parseInt(this.props.coursesids)?this.addDir()} className={"mr30 font-16"}>新建目录:"":""}*/}
diff --git a/public/react/src/modules/courses/boards/index.js b/public/react/src/modules/courses/boards/index.js
index 5cfbbeba3..ea49e862b 100644
--- a/public/react/src/modules/courses/boards/index.js
+++ b/public/react/src/modules/courses/boards/index.js
@@ -346,6 +346,7 @@ class Boards extends Component{
title={boardName || "帖子列表"}
searchValue={ searchValue }
onInputSearchChange={this.onInputSearchChange}
+ allowClearonChange={this.onInputSearchChange}
showSearchInput={messages.length >= 10}
searchPlaceholder={ '请输入帖子名称进行搜索' }
firstRowRight={
diff --git a/public/react/src/modules/courses/busyWork/CommonWorkList.js b/public/react/src/modules/courses/busyWork/CommonWorkList.js
index ca93833bb..d60f68b22 100644
--- a/public/react/src/modules/courses/busyWork/CommonWorkList.js
+++ b/public/react/src/modules/courses/busyWork/CommonWorkList.js
@@ -1,28 +1,17 @@
import React,{Component} from "react";
import { Form, Select, Input, Button,Checkbox,Upload,Icon,message,Modal, Table, Divider, Tag,DatePicker,Radio,Tooltip,Spin, Pagination} from "antd";
-import {Link} from 'react-router-dom';
-import locale from 'antd/lib/date-picker/locale/zh_CN';
-import {WordsBtn, ConditionToolTip, queryString, getImageUrl, on, off, NoneData, sortDirections} from 'educoder';
+import {WordsBtn, ConditionToolTip, queryString, publicSearchs, on, off, NoneData, sortDirections} from 'educoder';
import axios from 'axios';
-import Modals from '../../modals/Modals';
-import CoursesListType from '../coursesPublic/CoursesListType';
-import HomeworkModal from "../coursesPublic/HomeworkModal";
import CheckAllGroup from '../common/button/CheckAllGroup'
import moment from 'moment';
import CheckCodeModal from '../coursesPublic/modal/CheckCodeModal'
-import '../css/Courses.css'
-import WorkDetailPageHeader from './common/WorkDetailPageHeader'
+import '../css/Courses.css';
import PublishRightnow from './PublishRightnow'
import ModulationModal from "../coursesPublic/ModulationModal";
import AccessoryModal from "../coursesPublic/AccessoryModal";
import LeaderIcon from './common/LeaderIcon'
-const { Option} = Select;
-const CheckboxGroup = Checkbox.Group;
-const confirm = Modal.confirm;
-let GraduationTasksnewtype=true;
const $ = window.$;
const Search = Input.Search;
-const RadioGroup = Radio.Group;
function renderScore(score, content) {
let color = '#747A7F'
@@ -414,6 +403,7 @@ class CommonWorkList extends Component{
left_time: {},
category: {},
b_order: 'desc',
+ searchtypes:false
}
}
onTablePagination = (page) => {
@@ -423,10 +413,26 @@ class CommonWorkList extends Component{
}
onSearchValue = (val) => {
+ if (val === ""||val===undefined) {
+ this.setState({
+ search: undefined,
+ searchtypes:false
+ })
+ }else{
+ this.setState({
+ searchtypes:true
+ })
+ }
this.fetchList()
}
onSearchValueInput = (e) => {
- this.setState({search: e.target.value})
+ if (e.target.value === ""||e.target.value===undefined) {
+ this.setState({
+ search: undefined,
+ })
+ } else {
+ this.setState({search: e.target.value})
+ }
}
componentDidMount() {
@@ -789,13 +795,14 @@ class CommonWorkList extends Component{
{/* value={search} */}
-
+ {/**/}
+ {publicSearchs("请输入姓名或学号搜索",this.onSearchValue,this.onSearchValueInput,this.onSearchValueInput)}
}
@@ -859,7 +866,10 @@ class CommonWorkList extends Component{
diff --git a/public/react/src/modules/courses/busyWork/commonWork.js b/public/react/src/modules/courses/busyWork/commonWork.js
index d114b6777..ffc2e0c34 100644
--- a/public/react/src/modules/courses/busyWork/commonWork.js
+++ b/public/react/src/modules/courses/busyWork/commonWork.js
@@ -1,28 +1,22 @@
import React,{ Component } from "react";
import { Input,Checkbox,Menu,Pagination,Spin} from "antd";
-import CourseLayoutcomponent from '../common/CourseLayoutComponent';
import UseBank from './UseBank'
-
import '../css/members.css'
import '../css/busyWork.css'
-
-import CoursesListType from '../coursesPublic/CoursesListType'
import CommonWorkItem from './CommonWorkItem'
import PublishRightnow from './PublishRightnow'
import ConnectProject from './ConnectProject'
-
import { WordsBtn, on, off } from 'educoder'
import Modals from '../../modals/Modals'
import NoneData from "../coursesPublic/NoneData"
import Titlesearchsection from '../common/titleSearch/TitleSearchSection';
import { RouteHOC } from './common'
-
import axios from 'axios';
import _ from 'lodash'
-const Search = Input.Search;
-const map={1:"普通作业",2:"",3:"分组作业"}
-const COMMON_WORK = 1
+// const Search = Input.Search;
+// const map={1:"普通作业",2:"",3:"分组作业"}
+// const COMMON_WORK = 1
// const COMMON_WORK = 2
class commonWork extends Component{
constructor(props){
@@ -47,13 +41,12 @@ class commonWork extends Component{
inputStudent=(e)=>{
this.setState({
search:e.target.value,
- page:1
})
}
//搜索查询
searchStudent=()=>{
let {page,search,order}=this.state;
- this.getList(page,search,order);
+ this.getList(1,search,order);
}
openConnectionProject = (work) => {
this.refs['connectProject'].openConnectionProject(work)
@@ -134,11 +127,14 @@ class commonWork extends Component{
mainList:result.data,
totalCount:result.data.task_count,
isSpin:false,
+ page:page,
...result.data
})
}
}).catch((error)=>{
- console.log(error);
+ this.setState({
+ isSpin:false
+ })
})
}
//筛选条件
@@ -325,7 +321,7 @@ class commonWork extends Component{
console.log(error)
})
}
-
+
render(){
let {
@@ -396,7 +392,7 @@ class commonWork extends Component{
// searchtype={this.props.isAdmin||this.props.isStudent ?true:false}
onInputSearchChange={this.inputStudent}
onPressEnter={this.searchStudent}
-
+ allowClearonChange={this.inputStudent}
firstRowRight={
{ isAdmin && this.createCommonWork(1)}>新建}
diff --git a/public/react/src/modules/courses/common/titleSearch/TitleSearchSection.js b/public/react/src/modules/courses/common/titleSearch/TitleSearchSection.js
index c71ef38ea..479c8595b 100644
--- a/public/react/src/modules/courses/common/titleSearch/TitleSearchSection.js
+++ b/public/react/src/modules/courses/common/titleSearch/TitleSearchSection.js
@@ -1,8 +1,5 @@
import React,{ Component } from "react";
-import { Input } from "antd";
-
-const Search = Input.Search;
-
+import {publicSearchs} from 'educoder';
class Titlesearchsection extends Component{
constructor(props){
super(props);
@@ -14,7 +11,7 @@ class Titlesearchsection extends Component{
render(){
let { addGroup } = this.state;
const { firstRowRight, secondRowLeft,firstRowMid, secondRowBotton,thirdRow, title, onInputSearchChange
- , searchValue, onPressEnter, searchPlaceholder, showSearchInput } = this.props;
+ , searchValue, onPressEnter, searchPlaceholder, allowClearonChange } = this.props;
return(
- 暂时还没有相关数据哦!
+ {searchtypes===true?"抱歉没有您要搜索的内容,请换个词语试试看":"暂时还没有相关数据哦!"}
)
}
diff --git a/public/react/src/modules/courses/exercise/Exercise.js b/public/react/src/modules/courses/exercise/Exercise.js
index dec8a1cff..faef2a531 100644
--- a/public/react/src/modules/courses/exercise/Exercise.js
+++ b/public/react/src/modules/courses/exercise/Exercise.js
@@ -1,11 +1,10 @@
import React,{ Component } from "react";
-import { Input,Checkbox,Table, Pagination, Modal,Menu, Tooltip,Spin } from "antd";
-import CourseLayoutcomponent from '../common/CourseLayoutComponent';
+import {Checkbox, Pagination,Menu,Spin } from "antd";
import ExerciseListItem from './ExerciseListItem'
import axios from 'axios';
import Modals from '../../modals/Modals';
import '../css/members.css'
-import { WordsBtn,on, off, trigger } from 'educoder'
+import { WordsBtn,on, publicSearchs } from 'educoder'
import '../css/busyWork.css'
import _ from 'lodash';
import moment from 'moment'
@@ -14,8 +13,6 @@ import ImmediatelyPublish from "../poll/pollPublicBtn/ImmediatelyPublish";
import ImmediatelyEnd from "../poll/pollPublicBtn/ImmediatelyEnd";
import NoneData from "../coursesPublic/NoneData";
import HomeworkModal from "../coursesPublic/HomeworkModal";
-const Search = Input.Search;
-
class Exercise extends Component{
constructor(props){
@@ -93,17 +90,20 @@ class Exercise extends Component{
exercises:result.data.exercises,
checkAllValue:false,
checkBoxValues:[],
- isSpin:false
+ isSpin:false,
+ page:page
})
}).catch((error)=>{
- console.log(error);
+ this.setState({
+ isSpin:false,
+ })
})
}
inputStudent=(e)=>{
this.setState({
- StudentList_value:e.target.value
+ StudentList_value:e.target.value,
})
}
// 搜索
@@ -505,12 +505,13 @@ class Exercise extends Component{
未发布:{exercises_counts && exercises_counts.exercises_unpublish_counts}个
-
+ {publicSearchs("请输入名称进行搜索",this.searchInfo,this.inputStudent,this.inputStudent)}
+ {/**/}
diff --git a/public/react/src/modules/courses/exercise/Exercisesetting.js b/public/react/src/modules/courses/exercise/Exercisesetting.js
index bf900eb2f..b58f1c4e5 100644
--- a/public/react/src/modules/courses/exercise/Exercisesetting.js
+++ b/public/react/src/modules/courses/exercise/Exercisesetting.js
@@ -132,6 +132,7 @@ class Exercisesetting extends Component{
// 已有设置数据的查询
getSettingInfo=()=>{
+ this.props.Commonheadofthetestpapers()
let Id=this.props.match.params.Id;
let url=`/exercises/${Id}/exercise_setting.json`;
axios.get(url).then((result)=>{
diff --git a/public/react/src/modules/courses/exercise/Testpapersettinghomepage.js b/public/react/src/modules/courses/exercise/Testpapersettinghomepage.js
index ca4a0758a..47f42405d 100644
--- a/public/react/src/modules/courses/exercise/Testpapersettinghomepage.js
+++ b/public/react/src/modules/courses/exercise/Testpapersettinghomepage.js
@@ -61,7 +61,7 @@ class Testpapersettinghomepage extends Component{
}
//试卷公用头部
Commonheadofthetestpaper=()=>{
- console.log("Commonheadofthetestpaper 试卷公用头部");
+ // console.log("Commonheadofthetestpaper 试卷公用头部");
var exercise_id = this.props.match.params.Id;
var url = `/exercises/${exercise_id}/common_header.json`;
axios.get(url).then((response) => {
@@ -475,7 +475,7 @@ class Testpapersettinghomepage extends Component{
}
{
- parseInt(tab[0])==3 ? :""
+ parseInt(tab[0])==3 ? :""
}
diff --git a/public/react/src/modules/courses/graduation/tasks/index.js b/public/react/src/modules/courses/graduation/tasks/index.js
index c316035ee..c10fdc5fc 100644
--- a/public/react/src/modules/courses/graduation/tasks/index.js
+++ b/public/react/src/modules/courses/graduation/tasks/index.js
@@ -1,7 +1,6 @@
import React,{ Component } from "react";
-import { Input, Checkbox, Menu,Pagination,Spin} from "antd";
+import { Checkbox, Menu,Pagination,Spin} from "antd";
import {Link} from 'react-router-dom';
-import CourseLayoutcomponent from '../../common/CourseLayoutComponent';
import Titlesearchsection from '../../common/titleSearch/TitleSearchSection';
import HomeworkModal from "../../coursesPublic/HomeworkModal";
import { WordsBtn } from 'educoder';
@@ -10,7 +9,6 @@ import moment from 'moment';
import GraduateTaskItem from './GraduateTaskItem';
import TaskPublishModal from "./TaskPublishModal";
import Modals from '../../../modals/Modals';
-import UseBank from "../../busyWork/UseBank";
import '../../css/members.css';
import '../style.css';
import NoneData from "../../coursesPublic/NoneData";
@@ -65,7 +63,9 @@ class GraduationTasks extends Component{
})
}
}).catch(function (error) {
- console.log(error);
+ this.setState({
+ isSpin:false
+ })
});
}
@@ -286,7 +286,7 @@ class GraduationTasks extends Component{
onInputSearchChange = (e) => {
this.setState({
- searchValue:e.target.value
+ searchValue:e.target.value,
})
if (this.timeoutHandler) {
@@ -405,7 +405,8 @@ class GraduationTasks extends Component{
let {page,order}=this.state;
this.setState({
- search:value
+ search:value,
+ isSpin:true
})
this.fetchAll(value,page,order);
@@ -662,6 +663,7 @@ class GraduationTasks extends Component{
title="毕设任务"
searchValue={searchValue}
onInputSearchChange={this.onInputSearchChange}
+ allowClearonChange={this.onInputSearchChange}
firstRowRight={
{/*{this.props.isAdmin() ? this.addDir()}>题库选用:""}*/}
diff --git a/public/react/src/modules/courses/graduation/topics/index.js b/public/react/src/modules/courses/graduation/topics/index.js
index 5116b0b12..b77b4c096 100644
--- a/public/react/src/modules/courses/graduation/topics/index.js
+++ b/public/react/src/modules/courses/graduation/topics/index.js
@@ -1,15 +1,13 @@
import React,{ Component } from "react";
import {Checkbox, Menu, Pagination,Spin} from "antd";
-import CourseLayoutcomponent from '../../common/CourseLayoutComponent'
import Titlesearchsection from '../../common/titleSearch/TitleSearchSection'
import DownloadMessageysl from "../../../modals/DownloadMessageysl";
-import { WordsBtn } from 'educoder'
+import { WordsBtn ,getRandomcode} from 'educoder'
import NoneData from '../../coursesPublic/NoneData'
import Modals from "../../../modals/Modals"
import axios from 'axios'
-import UseBank from '../../busyWork/UseBank'
import _ from 'lodash'
@@ -85,12 +83,15 @@ class Boards extends Component{
topicList:response.data.graduation_topic,
totalCount:response.data.graduation_topic_count,
course_public:response.data.course_public,
- isSpin:false
+ isSpin:false,
+ page:page
})
}
})
.catch(function (error) {
- console.log(error);
+ this.setState({
+ isSpin:false
+ })
});
}
componentDidMount = () => {
@@ -117,10 +118,11 @@ class Boards extends Component{
onInputSearchChange = (e) => {
this.setState({
- searchValue:e.target.value
+ searchValue:e.target.value,
})
}
+
// 全选or反选
onCheckAll = (e) => {
this.setState({
@@ -353,7 +355,7 @@ onBoardsNew=()=>{
}
}else {
this.props.showNotification(`正在下载中`);
- window.open("/api"+url, '_blank');
+ window.open(getRandomcode("/api"+url), '_blank');
}
}).catch((error) => {
console.log(error)
@@ -408,6 +410,7 @@ onBoardsNew=()=>{
title="毕设选题"
searchValue={ searchValue }
onInputSearchChange={this.onInputSearchChange}
+ allowClearonChange={this.onInputSearchChange}
firstRowRight=
{ isAdmin ?
(
diff --git a/public/react/src/modules/courses/members/CourseGroupList.js b/public/react/src/modules/courses/members/CourseGroupList.js
index 48bc2efcd..f489dac0a 100644
--- a/public/react/src/modules/courses/members/CourseGroupList.js
+++ b/public/react/src/modules/courses/members/CourseGroupList.js
@@ -136,6 +136,7 @@ function CourseGroupList(props) {
title={"分班列表"}
searchValue={ searchValue }
onInputSearchChange={onInputSearchChange}
+ allowClearonChange={onInputSearchChange}
showSearchInput={total_count >= 10}
searchPlaceholder={ '请输入分班名称进行搜索' }
firstRowRight={
diff --git a/public/react/src/modules/courses/poll/Poll.js b/public/react/src/modules/courses/poll/Poll.js
index 447b454e4..dd0166e29 100644
--- a/public/react/src/modules/courses/poll/Poll.js
+++ b/public/react/src/modules/courses/poll/Poll.js
@@ -1,6 +1,6 @@
import React,{ Component } from "react";
-import { Input,Checkbox,Table, Pagination, Modal,Menu, Tooltip ,Spin} from "antd";
-import {WordsBtn, on, off, trigger } from 'educoder';
+import {Checkbox, Pagination,Menu ,Spin} from "antd";
+import {WordsBtn, on, off, publicSearchs } from 'educoder';
import HomeworkModal from "../coursesPublic/HomeworkModal";
import AddcoursesNav from "../coursesPublic/AddcoursesNav";
import ImmediatelyPublish from './pollPublicBtn/ImmediatelyPublish';
@@ -15,8 +15,6 @@ import Modals from '../../modals/Modals';
import axios from 'axios';
import moment from 'moment';
-const Search = Input.Search;
-
class Poll extends Component{
constructor(props){
@@ -66,7 +64,7 @@ class Poll extends Component{
inputStudent=(e)=>{
this.setState({
- StudentList_value:e.target.value
+ StudentList_value:e.target.value,
})
}
@@ -125,7 +123,8 @@ class Poll extends Component{
course_types:result.data.course_types,
polls_counts:result.data.polls_counts,
isSpin:false,
- checkBoxValues: bank_checkValue ? bank_checkValue : []
+ checkBoxValues: bank_checkValue ? bank_checkValue : [],
+ page:page
})
}
}).catch((error)=>{
@@ -524,12 +523,13 @@ class Poll extends Component{
未发布:{polls_counts && polls_counts.polls_unpublish_counts}个
-
+ {publicSearchs("请输入名称进行搜索",this.searchInfo,this.inputStudent,this.inputStudent)}
+ {/**/}
diff --git a/public/react/src/modules/courses/poll/PollDetailIndex.js b/public/react/src/modules/courses/poll/PollDetailIndex.js
index 38cc3796e..d064fc284 100644
--- a/public/react/src/modules/courses/poll/PollDetailIndex.js
+++ b/public/react/src/modules/courses/poll/PollDetailIndex.js
@@ -68,6 +68,23 @@ class PollDetailIndex extends Component{
}
}
+ newgetPollInfo=()=>{
+ // console.log(this.props);
+ let pollId=this.props.match.params.pollId;
+ let url=`/polls/${pollId}/common_header.json`
+ axios.get(url).then((result)=>{
+ if(result.status==200){
+ this.setState({
+ pollDetail:result.data,
+ user_permission:result.data.user_permission,
+ polls_status:result.data.polls_status,
+ })
+ }
+ }).catch((error)=>{
+ console.log(error);
+ })
+
+ }
componentDidMount(){
const query =this.props.location.search;
@@ -259,7 +276,7 @@ class PollDetailIndex extends Component{
}
{
//设置
- parseInt(tab[0])==3 &&
+ parseInt(tab[0])==3 &&
}
diff --git a/public/react/src/modules/courses/poll/PollDetailTabForth.js b/public/react/src/modules/courses/poll/PollDetailTabForth.js
index 44a09adae..f5c49f0fe 100644
--- a/public/react/src/modules/courses/poll/PollDetailTabForth.js
+++ b/public/react/src/modules/courses/poll/PollDetailTabForth.js
@@ -112,7 +112,7 @@ class PollDetailTabForth extends Component{
// 已有设置数据的查询
getSettingInfo=()=>{
- this.props.getPollInfo();
+ this.props.newgetPollInfo();
let pollId=this.props.match.params.pollId;
let url=`/polls/${pollId}/poll_setting.json`;
axios.get(url).then((result)=>{
@@ -197,6 +197,7 @@ class PollDetailTabForth extends Component{
this.props.form.validateFieldsAndScroll((err, values) => {
if(!err){
+
// 第一次进行问卷设置或者勾选了统一设置
let{unitSetting}=this.state
if(unitSetting==true){
diff --git a/public/react/src/modules/courses/shixunHomework/Listofworksstudentone.js b/public/react/src/modules/courses/shixunHomework/Listofworksstudentone.js
index fee00d4eb..8c73793f1 100644
--- a/public/react/src/modules/courses/shixunHomework/Listofworksstudentone.js
+++ b/public/react/src/modules/courses/shixunHomework/Listofworksstudentone.js
@@ -1,6 +1,6 @@
import React, {Component} from "react";
import CoursesListType from '../coursesPublic/CoursesListType';
-import {WordsBtn, ActionBtn, sortDirections} from 'educoder';
+import {WordsBtn, publicSearchs, sortDirections} from 'educoder';
import {
Form,
Select,
@@ -65,6 +65,7 @@ class Listofworksstudentone extends Component {
//关卡得分final_score
this.state = {
+ searchtypes:false,
jobsettingsdata: undefined,
endTime: "2018/11/10 17:10:00",
type: "day",
@@ -2588,6 +2589,7 @@ class Listofworksstudentone extends Component {
challenges_count: result.data.challenges_count,
homework_status: result.data.homework_status,
answer_open_evaluation:result.data.answer_open_evaluation,
+ page:page
});
allow_lates=result.data.allow_late;
answer_open_evaluation=result.data.answer_open_evaluation;
@@ -2959,10 +2961,9 @@ class Listofworksstudentone extends Component {
}
//搜索学生 文字输入
inputSearchValuest = (e) => {
- // console.log(e.target.value)
- if (e.target.value === "") {
+ if (e.target.value === ""||e.target.value===undefined) {
this.setState({
- searchtext: undefined
+ searchtext: undefined,
})
} else {
this.setState({
@@ -2983,8 +2984,9 @@ class Listofworksstudentone extends Component {
loadingstate: true,
page: 1,
limit: 20,
+ searchtypes:true
})
- this.Startsortingt(this.state.orders, this.state.course_groupyslstwo, this.state.checkedValuesineinfo, value, 1, 20, this.state.myorders);
+ this.Startsortingt(this.state.orders, this.state.course_groupyslstwo, this.state.checkedValuesineinfo, value, 1, 20, this.state.myorders);
// console.log(value)
@@ -3576,12 +3578,18 @@ class Listofworksstudentone extends Component {
:
homework_status && homework_status.length === 0 ?
-
+
:
homework_status && homework_status.length > 0 && homework_status[0] === "未发布" ?
-
+
:
@@ -3664,15 +3672,16 @@ class Listofworksstudentone extends Component {
{/*}*/}
{/*}*/}
- this.onSearchKeywordKeyUpt(e)}
- onInput={this.inputSearchValuest}
- onSearch={this.searchValuest}
- >
+ {/* this.onSearchKeywordKeyUpt(e)}*/}
+ {/* onInput={this.inputSearchValuest}*/}
+ {/* onSearch={this.searchValuest}*/}
+ {/*>*/}
+ {publicSearchs("请输入姓名或学号搜索",this.searchValuest,this.inputSearchValuest,this.inputSearchValuest)}
作品状态:
@@ -3760,7 +3769,7 @@ class Listofworksstudentone extends Component {
-
暂时还没有相关数据哦!
+
{this.state.searchtypes===false?"暂时还没有相关数据哦!":"抱歉没有您要搜索的内容,请换个词语试试看"}
@@ -3769,9 +3778,9 @@ class Listofworksstudentone extends Component {
- {datajs === undefined ? "" :
}
+
+ {datajs === undefined ? "" : }
+
+
}
@@ -3898,12 +3910,18 @@ class Listofworksstudentone extends Component {
{
homework_status && homework_status.length && homework_status.length === 0 ?
-
+
:
homework_status && homework_status.length > 0 && homework_status && homework_status[0] === "未发布" ?
-
+
:
@@ -4029,7 +4047,7 @@ class Listofworksstudentone extends Component {
-
暂时还没有相关数据哦!
+
{this.state.searchtypes===false?"暂时还没有相关数据哦!":"抱歉没有您要搜索的内容,请换个词语试试看"}
@@ -4069,12 +4087,18 @@ class Listofworksstudentone extends Component {
{
homework_status && homework_status.length === 0 ?
-
+
:
homework_status && homework_status.length > 0 && homework_status && homework_status[0] === "未发布" ?
-
+
:
@@ -4226,9 +4250,9 @@ class Listofworksstudentone extends Component {
- {datas === undefined ? "" :
}
+ {datas === undefined ? "" :
+
+
+
+ }
{
@@ -4270,7 +4298,7 @@ class Listofworksstudentone extends Component {
-
暂时还没有相关数据哦!
+
{this.state.searchtypes===false?"暂时还没有相关数据哦!":"抱歉没有您要搜索的内容,请换个词语试试看"}
diff --git a/public/react/src/modules/courses/shixunHomework/ShixunStudentWork.js b/public/react/src/modules/courses/shixunHomework/ShixunStudentWork.js
index 7fe9f868e..772d88e19 100644
--- a/public/react/src/modules/courses/shixunHomework/ShixunStudentWork.js
+++ b/public/react/src/modules/courses/shixunHomework/ShixunStudentWork.js
@@ -1,6 +1,6 @@
import React, {Component} from "react";
import CoursesListType from '../coursesPublic/CoursesListType';
-import {WordsBtn, ActionBtn, sortDirections} from 'educoder';
+import {WordsBtn, getRandomcode, sortDirections} from 'educoder';
import ShixunWorkModal from './Shixunworkdetails/ShixunWorkModal';
import HomeworkModal from "../coursesPublic/HomeworkModal";
import OneSelfOrderModal from "../coursesPublic/OneSelfOrderModal";
@@ -622,7 +622,7 @@ class ShixunStudentWork extends Component {
}
}else {
this.props.showNotification(`正在下载中`);
- window.open("/api"+url, '_blank');
+ window.open(getRandomcode("/api"+url), '_blank');
}
}).catch((error) => {
console.log(error)
diff --git a/public/react/src/modules/courses/shixunHomework/ShixunWorkReport.js b/public/react/src/modules/courses/shixunHomework/ShixunWorkReport.js
index 10b12eb0a..90e6e6a4f 100644
--- a/public/react/src/modules/courses/shixunHomework/ShixunWorkReport.js
+++ b/public/react/src/modules/courses/shixunHomework/ShixunWorkReport.js
@@ -1,5 +1,5 @@
import React, {Component} from "react";
-import {WordsBtn,markdownToHTML,ActionBtn,queryString,downloadFile,getImageUrl} from 'educoder';
+import {WordsBtn,markdownToHTML,getRandomcode,queryString,downloadFile,getImageUrl} from 'educoder';
import { Form, Select, Input, Button,Checkbox,Upload,Icon,message,Modal, Table, Divider,InputNumber, Tag,DatePicker,Radio,Tooltip,Spin} from "antd";
import {Link,Switch,Route,Redirect} from 'react-router-dom';
import axios from 'axios';
@@ -76,7 +76,7 @@ class ShixunWorkReport extends Component {
// this.props.slowDownload(url)
//
// this.props.showNotification(`正在下载中`);
- window.open("/api"+url+"?disposition=inline", '_blank');
+ window.open(getRandomcode("/api"+url+"?disposition=inline"), '_blank');
this.setState({ isspinning: false })
}
}).catch((error) => {
diff --git a/public/react/src/modules/courses/shixunHomework/Trainingjobsetting.js b/public/react/src/modules/courses/shixunHomework/Trainingjobsetting.js
index 03ae5ec33..d15e8eaab 100644
--- a/public/react/src/modules/courses/shixunHomework/Trainingjobsetting.js
+++ b/public/react/src/modules/courses/shixunHomework/Trainingjobsetting.js
@@ -1,7 +1,7 @@
import React, {Component} from "react";
import CoursesListType from '../coursesPublic/CoursesListType';
import HomeworkModal from "../coursesPublic/HomeworkModal";
-import {WordsBtn, ActionBtn, handleDateString, getImageUrl} from 'educoder';
+import {WordsBtn, getRandomcode, handleDateString, getImageUrl} from 'educoder';
import PollDetailTabForthRules from '../poll/PollDetailTabForthRules';
import ShixunWorkModal from './Shixunworkdetails/ShixunWorkModal';
import {
@@ -2263,7 +2263,7 @@ class Trainingjobsetting extends Component {
}
} else {
this.props.showNotification(`正在下载中`);
- window.open("/api" + url, '_blank');
+ window.open(getRandomcode("/api" + url), '_blank');
}
}).catch((error) => {
console.log(error)
diff --git a/public/react/src/modules/courses/shixunHomework/Workquestionandanswer.js b/public/react/src/modules/courses/shixunHomework/Workquestionandanswer.js
index 1dccb298b..4e3e692e1 100644
--- a/public/react/src/modules/courses/shixunHomework/Workquestionandanswer.js
+++ b/public/react/src/modules/courses/shixunHomework/Workquestionandanswer.js
@@ -1,6 +1,6 @@
import React, {Component} from "react";
import CoursesListType from '../coursesPublic/CoursesListType';
-import {WordsBtn, ActionBtn, markdownToHTML} from 'educoder';
+import {WordsBtn, getRandomcode, markdownToHTML} from 'educoder';
import {
Form,
Select,
@@ -413,7 +413,7 @@ class Workquestionandanswer extends Component {
}
}else {
this.props.showNotification(`正在下载中`);
- window.open("/api"+url, '_blank');
+ window.open(getRandomcode("/api"+url), '_blank');
}
}).catch((error) => {
console.log(error)
diff --git a/public/react/src/modules/courses/shixunHomework/shixunHomework.js b/public/react/src/modules/courses/shixunHomework/shixunHomework.js
index 4705e7a8f..d4a2d7b87 100644
--- a/public/react/src/modules/courses/shixunHomework/shixunHomework.js
+++ b/public/react/src/modules/courses/shixunHomework/shixunHomework.js
@@ -1,12 +1,10 @@
import React,{ Component } from "react";
-import { Input,Checkbox,Table, Pagination, Modal,Menu, Tooltip,Spin } from "antd";
-import { WordsBtn,on, off, trigger } from 'educoder';
-import {BrowserRouter as Router,Route,Switch,Link} from 'react-router-dom';
+import { Input,Checkbox, Pagination,Menu,Spin } from "antd";
+import { WordsBtn,on, trigger ,publicSearchs} from 'educoder';
+import {Link} from 'react-router-dom';
import axios from'axios';
import HomeworkModal from "../coursesPublic/HomeworkModal";
-import OneSelfOrderModal from "../coursesPublic/OneSelfOrderModal";
-import ShixunModal from "../coursesPublic/ShixunModal";
-import PathModal from "../coursesPublic/PathModal";
+
import NewShixunModel from '../coursesPublic/NewShixunModel';
import AddcoursesNav from "../coursesPublic/AddcoursesNav";
import Modals from '../../modals/Modals';
@@ -16,8 +14,6 @@ import '../css/busyWork.css'
import ShixunhomeWorkItem from "./ShixunhomeWorkItem";
import NoneData from "../coursesPublic/NoneData";
-const Search = Input.Search;
-
class ShixunHomework extends Component{
constructor(props){
super(props);
@@ -198,16 +194,20 @@ class ShixunHomework extends Component{
if(result.status===200){
this.setState({
datas:result.data,
- isSpin:false
+ isSpin:false,
+ page:page
})
}
}else{
this.setState({
- isSpin:false
+ isSpin:false,
})
}
}).catch((error)=>{
console.log(error);
+ this.setState({
+ isSpin:false
+ })
})
}
@@ -644,19 +644,21 @@ class ShixunHomework extends Component{
}
SearchCoursenames=(e)=>{
-
this.setState({
- Coursename:e.target.value
+ Coursename:e.target.value,
})
-
}
+
+
SearchCoursename=(value)=>{
+
let {page,order}=this.state;
this.setState({
- Coursename:value
+ Coursename:value,
+ isSpin:true,
})
- this.homeworkupdatalist(value,page,order);
+ this.homeworkupdatalist(value,1,order);
}
@@ -1030,7 +1032,6 @@ class ShixunHomework extends Component{
}=this.state;
let main_id=this.props.match.params.main_id;
- let category_id=this.props.match.params.category_id;
return(
@@ -1212,12 +1213,15 @@ class ShixunHomework extends Component{
- this.SearchCoursename(value)}
- >
+ {publicSearchs("请输入名称进行搜索",value => this.SearchCoursename(value),this.SearchCoursenames,(e)=>this.SearchCoursenames(e))}
+ {/* this.SearchCoursename(value)}*/}
+ {/* onChange={(e)=>this.allowClearonChange(e)}*/}
+ {/* allowClear={true}*/}
+ {/*>*/}
@@ -1380,14 +1384,3 @@ class ShixunHomework extends Component{
}
}
export default ShixunHomework;
-// {/**/}
-// {/*
*/}
-// {/*
*/}
-// {/*
暂时还没有相关数据哦!
*/}
-// {/*
*/}
\ No newline at end of file
diff --git a/public/react/src/modules/ecs/EcSetting/CourseSupports/index.js b/public/react/src/modules/ecs/EcSetting/CourseSupports/index.js
index 6aee871be..4dbc63c95 100644
--- a/public/react/src/modules/ecs/EcSetting/CourseSupports/index.js
+++ b/public/react/src/modules/ecs/EcSetting/CourseSupports/index.js
@@ -1,7 +1,7 @@
import React, { Component } from 'react';
import { BrowserRouter as Router, Route, Link, Switch } from "react-router-dom";
-
+import {getRandomcode} from 'educoder';
import axios from 'axios';
import { Select,message,Modal,Input,Spin,Icon,Tooltip } from 'antd';
@@ -550,7 +550,7 @@ class CourseSupports extends Component {
}
}else {
this.props.showNotification(`正在下载中`);
- window.open("/api"+url, '_blank');
+ window.open(getRandomcode("/api"+url), '_blank');
}
}).catch((error) => {
console.log(error)
diff --git a/public/react/src/modules/modals/DownloadMessage.js b/public/react/src/modules/modals/DownloadMessage.js
index 4655d7478..f01fe14c1 100644
--- a/public/react/src/modules/modals/DownloadMessage.js
+++ b/public/react/src/modules/modals/DownloadMessage.js
@@ -1,5 +1,5 @@
import React, { Component } from 'react';
-import {getImageUrl} from 'educoder';
+import {getRandomcode} from 'educoder';
import { Modal} from 'antd';
import axios from 'axios';
@@ -57,7 +57,7 @@ class DownloadMessage extends Component {
}
}else {
this.props.showNotification(`正在下载中`);
- window.open("/api"+url, '_blank');
+ window.open(getRandomcode("/api"+url), '_blank');
}
}).catch((error) => {
console.log(error)
diff --git a/public/react/src/modules/page/MainContent.js b/public/react/src/modules/page/MainContent.js
index a1b7566d0..175ea7bc0 100644
--- a/public/react/src/modules/page/MainContent.js
+++ b/public/react/src/modules/page/MainContent.js
@@ -41,6 +41,7 @@ class MainContent extends Component {
hideCodeEvaluate = () => {
const vncContainer = this.refs['vncContainer']
if (vncContainer) {
+ // console.log('点击的关闭按钮')
vncContainer.onBottomDrawerClose && vncContainer.onBottomDrawerClose()
}
}
@@ -124,7 +125,7 @@ class MainContent extends Component {
}
>
-
+
@@ -179,7 +180,9 @@ class MainContent extends Component {
-
+
diff --git a/public/react/src/modules/page/VNC.css b/public/react/src/modules/page/VNC.css
index 1180baf76..58a45d735 100644
--- a/public/react/src/modules/page/VNC.css
+++ b/public/react/src/modules/page/VNC.css
@@ -39,6 +39,47 @@
user-select: none;
}
+.btn_test_case,
+.btn_test_case_active{
+ display: inline-block;
+ position: absolute;
+ width: 56px;
+ height: 28px;
+ bottom: 23px;
+ line-height: 28px;
+ background: rgba(42,58,79,1);
+ z-index: 10;
+ left: 50%;
+ margin-left: -28px;
+ border-bottom-left-radius: 100px;
+ border-bottom-right-radius: 100px;
+ color: #fff;
+ text-align: center;
+ cursor: pointer;
+ opacity: .4;
+ transition: all .3s;
+}
+
+.btn_test_case:hover,
+.btn_test_case_active:hover{
+ opacity: 1;
+}
+.btn_test_case .btn-arrow{
+ position: relative;
+ font-size: 12px;
+ line-height: 28px;
+ bottom: 2px;
+}
+
+.btn_test_case_active{
+ bottom: 203px;
+ z-index: 10000;
+
+}
+.btn_test_case_active .btn-arrow{
+ bottom: 4px;
+}
+
@keyframes mymove
{
from {right:0px;}
diff --git a/public/react/src/modules/page/VNCContainer.js b/public/react/src/modules/page/VNCContainer.js
index aa4d82e78..30e439e8d 100644
--- a/public/react/src/modules/page/VNCContainer.js
+++ b/public/react/src/modules/page/VNCContainer.js
@@ -204,6 +204,10 @@ class VNCContainer extends Component {
render() {
const { challenge, vnc_url, git_url } = this.props
+ const _classCtx = this.state.bottomDrawer ? 'btn_test_case_active' : 'btn_test_case';
+ const _classes = this.state.bottomDrawer
+ ? `iconfont icon-xiajiantou btn-arrow`
+ : 'iconfont icon-shangjiantou btn-arrow';
const secondDrawerChildren = this.renderSecondDrawerChildren();
return (
@@ -352,9 +356,16 @@ class VNCContainer extends Component {
>
{ this.props.codeEvaluate }
- 测试集
+ >测试集 */}
+
+ {/* */}
+
+
diff --git a/public/react/src/modules/page/VNCDisplay.js b/public/react/src/modules/page/VNCDisplay.js
index 536ba43cb..98c4cb5e7 100644
--- a/public/react/src/modules/page/VNCDisplay.js
+++ b/public/react/src/modules/page/VNCDisplay.js
@@ -135,11 +135,13 @@ class VNCDisplay extends Component {