dev_aliyun_beta
杨树林 6 years ago
commit c37f7718a8

@ -83,4 +83,4 @@ $(document).on("turbolinks:before-cache", function () {
// }); // });
$(function () { $(function () {
}); });

@ -0,0 +1,10 @@
class Admins::ImportCourseMembersController < Admins::BaseController
def create
return render_error('请上传正确的文件') if params[:file].blank? || !params[:file].is_a?(ActionDispatch::Http::UploadedFile)
result = Admins::ImportCourseMemberService.call(params[:file].to_io)
render_ok(result)
rescue Admins::ImportCourseMemberService::Error => ex
render_error(ex)
end
end

@ -0,0 +1,8 @@
class Wechats::JsSdkSignaturesController < ApplicationController
def create
signature = Util::Wechat.js_sdk_signature(params[:url], params[:noncestr], params[:timestamp])
render_ok(signature: signature)
rescue Util::Wechat::Error => ex
render_error(ex.message)
end
end

@ -0,0 +1,20 @@
class Admins::ImportCourseMemberExcel < BaseImportXlsx
Data = Struct.new(:student_id, :name, :course_id, :role, :course_group_name, :school_id)
def read_each(&block)
sheet.each_row_streaming(pad_cells: true, offset: 1) do |row|
data = row.map(&method(:cell_value))[0..5]
block.call Data.new(*data)
end
end
private
def check_sheet_valid!
raise_import_error('请按照模板格式导入') if sheet.row(1).size != 6
end
def cell_value(obj)
obj&.cell_value&.to_s&.strip
end
end

@ -0,0 +1,74 @@
module Util::Wechat
BASE_SITE = 'https://api.weixin.qq.com'.freeze
Error = Class.new(StandardError)
class << self
attr_accessor :appid, :secret
def js_sdk_signature(url, noncestr, timestamp)
str = { jsapi_ticket: jsapi_ticket, noncestr: noncestr, timestamp: timestamp, url: url }.to_query
Digest::SHA1.hexdigest(str)
end
def access_token
# 7200s 有效时间
Rails.cache.fetch(access_token_cache_key, expires_in: 100.minutes) do
result = request(:get, '/cgi-bin/token', appid: appid, secret: secret, grant_type: 'client_credential')
result['access_token']
end
end
def refresh_access_token
Rails.cache.delete(access_token_cache_key)
access_token
end
def jsapi_ticket
# 7200s 有效时间
Rails.cache.fetch(jsapi_ticket_cache_key, expires_in: 100.minutes) do
result = request(:get, '/cgi-bin/ticket/getticket', access_token: access_token, type: 'jsapi')
result['ticket']
end
end
def refresh_jsapi_ticket
Rails.cache.delete(jsapi_ticket_cache_key)
jsapi_ticket
end
def access_token_cache_key
"#{base_cache_key}/access_token"
end
def jsapi_ticket_cache_key
"#{base_cache_key}/jsapi_ticket"
end
def base_cache_key
"wechat/#{appid}"
end
private
def request(method, url, **params)
Rails.logger.error("[wechat] request: #{method} #{url} #{params.inspect}")
client = Faraday.new(url: BASE_SITE)
response = client.public_send(method, url, params)
result = JSON.parse(response.body)
Rails.logger.error("[wechat] response:#{response.status} #{result.inspect}")
if response.status != 200
raise Error, result.inspect
end
if result['errcode'].present? && result['errcode'].to_i.nonzero?
raise Error, result.inspect
end
result
end
end
end

@ -0,0 +1,63 @@
class Admins::ImportCourseMemberService < ApplicationService
Error = Class.new(StandardError)
attr_reader :file, :result
def initialize(file)
@file = file
@result = { success: 0, fail: [] }
end
def call
raise Error, '文件不存在' if file.blank?
excel = Admins::ImportCourseMemberExcel.new(file)
excel.read_each(&method(:create_course_member))
result
rescue ApplicationImport::Error => ex
raise Error, ex.message
end
private
def create_course_member(data)
raise '课堂角色必须为 2、3、4' unless [2, 3, 4].include?(data.role.to_i)
user = User.joins(:user_extension).where(user_extensions: { student_id: data.student_id, school_id: data.school_id }).first
raise '该学号的用户不存在' if user.blank?
course = Course.find_by(id: data.course_id)
raise '该课堂不存在' if course.blank?
course_group = nil
if data.course_group_name.present?
course_group = course.course_groups.find_or_create_by!(name: data.course_group_name)
end
member = course.course_members.find_by(user_id: user.id, role: data.role.to_i)
# 如果已是课堂成员且是学生身份and不在指定的分班则移动到该分班
if member.present? && member.role == :STUDENT && course_group && member.course_group_id != course_group&.id
member.update!(course_group_id: course_group&.id)
elsif member.blank?
course.course_members.create!(user_id: user.id, role: data.role.to_i, course_group_id: course_group&.id)
extra =
case data.role.to_i
when 2 then 9
when 3 then 7
else 10
end
Tiding.create!(user_id: user.id, trigger_user_id: course.tea_id, container_id: course.id,
container_type: 'TeacherJoinCourse', belong_container_id: course.id,
belong_container_type: 'Course', tiding_type: 'System', extra: extra)
end
result[:success] += 1
rescue Exception => ex
fail_data = data.as_json
fail_data[:data] = fail_data.values.join(',')
fail_data[:message] = ex.message
result[:fail] << fail_data
end
end

@ -6,6 +6,9 @@ defaults: &defaults
cate_id: '-1' cate_id: '-1'
callback_url: 'http://47.96.87.25:48080/api/callbacks/aliyun_vod.json' callback_url: 'http://47.96.87.25:48080/api/callbacks/aliyun_vod.json'
signature_key: 'test12345678' signature_key: 'test12345678'
wechat:
appid: 'test'
secret: 'test'
development: development:
<<: *defaults <<: *defaults

@ -4,7 +4,7 @@ aliyun_vod_config = {}
begin begin
config = Rails.application.config_for(:configuration) config = Rails.application.config_for(:configuration)
aliyun_vod_config = config['aliyun_vod'] aliyun_vod_config = config['aliyun_vod']
raise 'oauth wechat config missing' if aliyun_vod_config.blank? raise 'aliyun vod config missing' if aliyun_vod_config.blank?
rescue => ex rescue => ex
raise ex if Rails.env.production? raise ex if Rails.env.production?

@ -0,0 +1,16 @@
wechat_config = {}
begin
config = Rails.application.config_for(:configuration)
wechat_config = config['wechat']
raise 'wechat config missing' if wechat_config.blank?
rescue => ex
raise ex if Rails.env.production?
puts %Q{\033[33m [warning] wechat config or configuration.yml missing,
please add it or execute 'cp config/configuration.yml.example config/configuration.yml' \033[0m}
wechat_config = {}
end
Util::Wechat.appid = wechat_config['appid']
Util::Wechat.secret = wechat_config['secret']

File diff suppressed because it is too large Load Diff

@ -1,6 +1,7 @@
import React, { Component } from 'react'; import React, { Component } from 'react';
import { SnackbarHOC } from 'educoder'; import { SnackbarHOC } from 'educoder';
import {BrowserRouter as Router,Route,Switch} from 'react-router-dom'; import {BrowserRouter as Router,Route,Switch} from 'react-router-dom';
import { withRouter } from 'react-router'
import Loadable from 'react-loadable'; import Loadable from 'react-loadable';
import Loading from '../../Loading'; import Loading from '../../Loading';
import axios from 'axios'; import axios from 'axios';
@ -264,6 +265,12 @@ const GraduationTasksSubmiteditApp=Loadable({
loading: Loading, loading: Loading,
}) })
//排序
const Ordering=Loadable({
loader: () => import('../../modules/courses/ordering/Ordering'),
loading: Loading,
});
class CoursesIndex extends Component{ class CoursesIndex extends Component{
constructor(props) { constructor(props) {
super(props) super(props)
@ -290,6 +297,13 @@ class CoursesIndex extends Component{
componentDidMount(){ componentDidMount(){
// this.updataleftNav() // this.updataleftNav()
this.historyArray = []
this.props.history.listen( location => {
console.log(location)
this.historyArray.unshift(location.pathname)
this.historyArray.length = 2;
//Do your stuff here
});
} }
updataleftNav=()=>{ updataleftNav=()=>{
@ -424,6 +438,7 @@ class CoursesIndex extends Component{
render() { render() {
const common = { const common = {
previousPathName: this.historyArray && this.historyArray[1]
// isAdmin: this.isAdmin, // isAdmin: this.isAdmin,
// isStudent: this.isStudent, // isStudent: this.isStudent,
// isAdminOrStudent: this.isAdminOrStudent, // isAdminOrStudent: this.isAdminOrStudent,
@ -442,27 +457,32 @@ class CoursesIndex extends Component{
// console.log(commons) // console.log(commons)
return ( return (
<Switch {...this.props}> <Switch {...this.props}>
{/*排序*/}
<Route path="/courses/:coursesId/ordering/:ordering_type/:main_id"
render={
(props) => (<Ordering {...this.props} {...props} {...this.state} />)
}
></Route>
{/* 资源列表页 */} {/* 资源列表页 */}
<Route path="/courses/:coursesId/file/:Id" exact <Route path="/courses/:coursesId/file/:Id" exact
render={ render={
(props) => (<ListPageIndex {...this.props} {...props} {...this.state} />) (props) => (<ListPageIndex {...this.props} {...props} {...this.state} {...common}/>)
} }
></Route> ></Route>
<Route path="/courses/:coursesId/files/:main_id" <Route path="/courses/:coursesId/files/:main_id"
render={ render={
(props) => (<ListPageIndex {...this.props} {...props} {...this.state} />) (props) => (<ListPageIndex {...this.props} {...props} {...this.state} {...common}/>)
} }
></Route> ></Route>
<Route exact path="/courses/:coursesId/boards/:boardId" <Route exact path="/courses/:coursesId/boards/:boardId"
render={ render={
(props) => (<ListPageIndex {...this.props} {...props} {...this.state} />) (props) => (<ListPageIndex {...this.props} {...props} {...this.state} {...common}/>)
} }
></Route> ></Route>
{/*课堂讨论*/} {/*课堂讨论*/}
<Route path="/courses/:coursesId/boards/:boardId" <Route path="/courses/:coursesId/boards/:boardId"
render={ render={
(props) => (<BoardIndex {...this.props} {...props} {...this.state} />) (props) => (<BoardIndex {...this.props} {...props} {...this.state} {...common}/>)
} }
></Route> ></Route>
@ -470,19 +490,19 @@ class CoursesIndex extends Component{
{/* 毕设问答 */} {/* 毕设问答 */}
<Route path="/courses/:coursesId/graduation_topics/postwork/new" <Route path="/courses/:coursesId/graduation_topics/postwork/new"
render={ render={
(props) => (<GraduateTopicPostWorksNew {...this.props} {...props} {...this.state} />) (props) => (<GraduateTopicPostWorksNew {...this.props} {...props} {...this.state} {...common}/>)
} }
></Route> ></Route>
{/* 毕设选题新建页 */} {/* 毕设选题新建页 */}
<Route path="/courses/:coursesId/graduation_topics/new" <Route path="/courses/:coursesId/graduation_topics/new"
render={ render={
(props) => (<GraduateTopicNew {...this.props} {...props} {...this.state} />) (props) => (<GraduateTopicNew {...this.props} {...props} {...this.state} {...common}/>)
}></Route> }></Route>
{/* 毕设选题编辑页*/} {/* 毕设选题编辑页*/}
<Route path="/courses/:coursesId/graduation_topics/:topicId/edit" <Route path="/courses/:coursesId/graduation_topics/:topicId/edit"
render={ render={
(props) => (<GraduateTopicNew {...this.props} {...props} {...this.state} />) (props) => (<GraduateTopicNew {...this.props} {...props} {...this.state} {...common}/>)
}></Route> }></Route>
{/* 毕设选题详情页 */} {/* 毕设选题详情页 */}
@ -495,7 +515,7 @@ class CoursesIndex extends Component{
{/* 毕设选题列表 */} {/* 毕设选题列表 */}
<Route path="/courses/:coursesId/graduation_topics/:Id" exact <Route path="/courses/:coursesId/graduation_topics/:Id" exact
render={ render={
(props) => (<ListPageIndex {...this.props} {...props} {...this.state} />) (props) => (<ListPageIndex {...this.props} {...props} {...this.state} {...common}/>)
}></Route> }></Route>
@ -503,21 +523,21 @@ class CoursesIndex extends Component{
{/* 作品评阅 https://www.trustie.net/issues/19981 */} {/* 作品评阅 https://www.trustie.net/issues/19981 */}
<Route path="/courses/:coursesId/graduation_tasks/:category_id/appraise" <Route path="/courses/:coursesId/graduation_tasks/:category_id/appraise"
render={ render={
(props) => (<GraduationTasksappraise {...this.props} {...props} {...this.state} />) (props) => (<GraduationTasksappraise {...this.props} {...props} {...this.state} {...common}/>)
} }
></Route> ></Route>
{/* 新建作品 */} {/* 新建作品 */}
<Route path="/courses/:coursesId/graduation_tasks/:category_id/:task_Id/works/new" <Route path="/courses/:coursesId/graduation_tasks/:category_id/:task_Id/works/new"
render={ render={
(props) => (<GraduationTasksSubmitnewApp {...this.props} {...props} {...this.state} />) (props) => (<GraduationTasksSubmitnewApp {...this.props} {...props} {...this.state} {...common}/>)
} }
></Route> ></Route>
{/* 修改作品 */} {/* 修改作品 */}
<Route path="/courses/:coursesId/graduation_tasks/:category_id/:work_Id/works/edit" <Route path="/courses/:coursesId/graduation_tasks/:category_id/:work_Id/works/edit"
render={ render={
(props) => (<GraduationTasksSubmiteditApp {...this.props} {...props} {...this.state} />) (props) => (<GraduationTasksSubmiteditApp {...this.props} {...props} {...this.state} {...common}/>)
} }
></Route> ></Route>
@ -525,20 +545,20 @@ class CoursesIndex extends Component{
<Route path="/courses/:coursesId/graduation_tasks/:category_id/:task_Id/setting" <Route path="/courses/:coursesId/graduation_tasks/:category_id/:task_Id/setting"
render={ render={
(props) => (<GraduationTaskssetting {...this.props} {...props} {...this.state} />) (props) => (<GraduationTaskssetting {...this.props} {...props} {...this.state} {...common}/>)
} }
></Route> ></Route>
<Route path="/courses/:coursesId/graduation_tasks/:category_id/:task_Id/questions" <Route path="/courses/:coursesId/graduation_tasks/:category_id/:task_Id/questions"
render={ render={
(props) => (<GraduationTasksquestions {...this.props} {...props} {...this.state} />) (props) => (<GraduationTasksquestions {...this.props} {...props} {...this.state} {...common}/>)
}></Route> }></Route>
<Route path="/courses/:coursesId/graduation_tasks/:category_id/:task_Id/list" <Route path="/courses/:coursesId/graduation_tasks/:category_id/:task_Id/list"
render={ render={
(props) => (<GraduationTaskssettinglist {...this.props} {...props} {...this.state} />) (props) => (<GraduationTaskssettinglist {...this.props} {...props} {...this.state} {...common}/>)
} }
></Route> ></Route>
@ -547,7 +567,7 @@ class CoursesIndex extends Component{
{/* 修改毕设任务 https://www.trustie.net/issues/19981 */} {/* 修改毕设任务 https://www.trustie.net/issues/19981 */}
<Route path="/courses/:coursesId/graduation_tasks/:category_id/edit" <Route path="/courses/:coursesId/graduation_tasks/:category_id/edit"
render={ render={
(props) => (<GraduationTaskseditApp {...this.props} {...props} {...this.state} />) (props) => (<GraduationTaskseditApp {...this.props} {...props} {...this.state} {...common}/>)
} }
></Route> ></Route>
@ -555,7 +575,7 @@ class CoursesIndex extends Component{
{/* 新建毕设任务 https://www.trustie.net/issues/19981 */} {/* 新建毕设任务 https://www.trustie.net/issues/19981 */}
<Route path="/courses/:coursesId/graduation_tasks/:category_id/new" <Route path="/courses/:coursesId/graduation_tasks/:category_id/new"
render={ render={
(props) => (<GraduationTasksnewApp {...this.props} {...props} {...this.state} />) (props) => (<GraduationTasksnewApp {...this.props} {...props} {...this.state} {...common}/>)
} }
></Route> ></Route>
@ -563,87 +583,87 @@ class CoursesIndex extends Component{
{/* 毕设任务列表 https://www.trustie.net/issues/19981 */} {/* 毕设任务列表 https://www.trustie.net/issues/19981 */}
<Route path="/courses/:coursesId/graduation_tasks/:Id" exact <Route path="/courses/:coursesId/graduation_tasks/:Id" exact
render={ render={
(props) => (<ListPageIndex {...this.props} {...props} {...this.state} />) (props) => (<ListPageIndex {...this.props} {...props} {...this.state} {...common}/>)
} }
></Route> ></Route>
{/*/!* 毕业设计主 https://www.trustie.net/issues/19981 *!/*/} {/*/!* 毕业设计主 https://www.trustie.net/issues/19981 *!/*/}
{/*<Route path="/courses/:coursesId/graduation"*/} {/*<Route path="/courses/:coursesId/graduation"*/}
{/*render={*/} {/*render={*/}
{/*(props) => (<GraduationTopics {...this.props} {...props} {...this.state} />)*/} {/*(props) => (<GraduationTopics {...this.props} {...props} {...this.state} {...common}/>)*/}
{/*}*/} {/*}*/}
{/*></Route>*/} {/*></Route>*/}
{/*/!* 资源子目录 https://www.trustie.net/issues/19917 *!/*/} {/*/!* 资源子目录 https://www.trustie.net/issues/19917 *!/*/}
{/*<Route path="/courses/:coursesId/attachment/attachment/:attachmentId"*/} {/*<Route path="/courses/:coursesId/attachment/attachment/:attachmentId"*/}
{/*render={*/} {/*render={*/}
{/*(props) => (<Files {...this.props} {...props} {...this.state} />)*/} {/*(props) => (<Files {...this.props} {...props} {...this.state} {...common}/>)*/}
{/*}*/} {/*}*/}
{/*></Route>*/} {/*></Route>*/}
{/* 教师列表*/} {/* 教师列表*/}
<Route path="/courses/:coursesId/teachers" <Route path="/courses/:coursesId/teachers"
render={ render={
(props) => (<ListPageIndex {...this.props} {...props} {...this.state} />) (props) => (<ListPageIndex {...this.props} {...props} {...this.state} {...common}/>)
} }
></Route> ></Route>
{/* 学生列表*/} {/* 学生列表*/}
<Route path="/courses/:coursesId/students" <Route path="/courses/:coursesId/students"
render={ render={
(props) => (<ListPageIndex {...this.props} {...props} {...this.state} />) (props) => (<ListPageIndex {...this.props} {...props} {...this.state} {...common}/>)
} }
></Route> ></Route>
{/* 分班列表 */} {/* 分班列表 */}
<Route path="/courses/:coursesId/course_groups/:course_group_id" <Route path="/courses/:coursesId/course_groups/:course_group_id"
render={ render={
(props) => (<ListPageIndex {...this.props} {...props} {...this.state} />) (props) => (<ListPageIndex {...this.props} {...props} {...this.state} {...common}/>)
} }
></Route> ></Route>
{/* 普通作业 */} {/* 普通作业 */}
<Route path="/courses/:coursesId/common_homeworks/:category_id" exact <Route path="/courses/:coursesId/common_homeworks/:category_id" exact
render={ render={
(props) => (<ListPageIndex {...this.props} {...props} {...this.state} />) (props) => (<ListPageIndex {...this.props} {...props} {...this.state} {...common}/>)
} }
></Route> ></Route>
{/* 分组作业 */} {/* 分组作业 */}
<Route path="/courses/:coursesId/group_homeworks/:category_id" exact <Route path="/courses/:coursesId/group_homeworks/:category_id" exact
render={ render={
(props) => (<ListPageIndex {...this.props} {...props} {...this.state} />) (props) => (<ListPageIndex {...this.props} {...props} {...this.state} {...common}/>)
} }
></Route> ></Route>
{/* 普通作业 */} {/* 普通作业 */}
<Route path="/courses/:coursesId/common_homeworks/" strict <Route path="/courses/:coursesId/common_homeworks/" strict
render={ render={
(props) => (<CommonWork {...this.props} {...props} {...this.state} />) (props) => (<CommonWork {...this.props} {...props} {...this.state} {...common}/>)
} }
></Route> ></Route>
{/* 分组作业 */} {/* 分组作业 */}
<Route path="/courses/:coursesId/group_homeworks/" strict <Route path="/courses/:coursesId/group_homeworks/" strict
render={ render={
(props) => (<GroupWork {...this.props} {...props} {...this.state} />) (props) => (<GroupWork {...this.props} {...props} {...this.state} {...common}/>)
} }
></Route> ></Route>
{/* 问卷答题 */} {/* 问卷答题 */}
<Route path="/courses/:coursesId/polls/:pollId/users/:login" <Route path="/courses/:coursesId/polls/:pollId/users/:login"
render={ render={
(props) => (<PollInfo {...this.props} {...props} {...this.state} />) (props) => (<PollInfo {...this.props} {...props} {...this.state} {...common}/>)
} }
></Route> ></Route>
{/* 问卷详情 */} {/* 问卷详情 */}
<Route path="/courses/:coursesId/polls/:pollId/detail" <Route path="/courses/:coursesId/polls/:pollId/detail"
render={ render={
(props) => (<PollDetail {...this.props} {...props} {...this.state} />) (props) => (<PollDetail {...this.props} {...props} {...this.state} {...common}/>)
} }
></Route> ></Route>
{/* 问卷新建 */} {/* 问卷新建 */}
<Route path="/courses/:coursesId/polls/:pollid/:news" <Route path="/courses/:coursesId/polls/:pollid/:news"
render={ render={
(props) => (<PollNew {...this.props} {...props} {...this.state} />) (props) => (<PollNew {...this.props} {...props} {...this.state} {...common}/>)
} }
></Route> ></Route>
{/*/!* 问卷编辑 *!/*/} {/*/!* 问卷编辑 *!/*/}
@ -655,7 +675,7 @@ class CoursesIndex extends Component{
{/* 问卷 */} {/* 问卷 */}
<Route path="/courses/:coursesId/polls/:Id" <Route path="/courses/:coursesId/polls/:Id"
render={ render={
(props) => (<ListPageIndex {...this.props} {...props} {...this.state} />) (props) => (<ListPageIndex {...this.props} {...props} {...this.state} {...common}/>)
} }
></Route> ></Route>
@ -663,20 +683,20 @@ class CoursesIndex extends Component{
{/* 试卷查看/评阅 */} {/* 试卷查看/评阅 */}
<Route exact path="/courses/:coursesId/exercises/:Id/users/:userId" <Route exact path="/courses/:coursesId/exercises/:Id/users/:userId"
render={ render={
(props)=>(<ExerciseReviewAndAnswer {...this.props} {...props} {...this.state} />) (props)=>(<ExerciseReviewAndAnswer {...this.props} {...props} {...this.state} {...common}/>)
} }
></Route> ></Route>
{/*试卷新建 */} {/*试卷新建 */}
<Route exact path="/courses/:coursesId/exercises/new" <Route exact path="/courses/:coursesId/exercises/new"
render={ render={
(props) => (<ExerciseNew {...this.props} {...props} {...this.state} />) (props) => (<ExerciseNew {...this.props} {...props} {...this.state} {...common}/>)
} }
></Route> ></Route>
{/*试卷新建 */} {/*试卷新建 */}
<Route exact path="/courses/:coursesId/exercises/:Id/edit" <Route exact path="/courses/:coursesId/exercises/:Id/edit"
render={ render={
(props) => (<ExerciseNew {...this.props} {...props} {...this.state} />) (props) => (<ExerciseNew {...this.props} {...props} {...this.state} {...common}/>)
} }
></Route> ></Route>
@ -684,7 +704,7 @@ class CoursesIndex extends Component{
<Route path="/courses/:coursesId/exercises/:Id/student_exercise_list" <Route path="/courses/:coursesId/exercises/:Id/student_exercise_list"
render={ render={
(props) => (<Testpapersettinghomepage {...this.props} {...props} {...this.state} />) (props) => (<Testpapersettinghomepage {...this.props} {...props} {...this.state} {...common}/>)
} }
></Route> ></Route>
@ -693,14 +713,14 @@ class CoursesIndex extends Component{
<Route <Route
path="/courses/:coursesId/exercises/:Id/Studentshavecompletedthelist" path="/courses/:coursesId/exercises/:Id/Studentshavecompletedthelist"
render={ render={
(props) => (<Studentshavecompletedthelist {...this.props} {...props} {...this.state} />) (props) => (<Studentshavecompletedthelist {...this.props} {...props} {...this.state} {...common}/>)
} }
> >
</Route> </Route>
{/* 试卷 */} {/* 试卷 */}
<Route path="/courses/:coursesId/exercises/:Id" <Route path="/courses/:coursesId/exercises/:Id"
render={ render={
(props) => (<ListPageIndex {...this.props} {...props} {...this.state} />) (props) => (<ListPageIndex {...this.props} {...props} {...this.state} {...common}/>)
} }
></Route> ></Route>
@ -708,65 +728,65 @@ class CoursesIndex extends Component{
{/*实训查重详情*/} {/*实训查重详情*/}
<Route path="/courses/:coursesId/shixun_homeworks/:homeworkid/review_detail/:userid" <Route path="/courses/:coursesId/shixun_homeworks/:homeworkid/review_detail/:userid"
render={ render={
(props) => (<ShixunWorkDetails {...this.props} {...props} {...this.state} />) (props) => (<ShixunWorkDetails {...this.props} {...props} {...this.state} {...common}/>)
} }
></Route> ></Route>
<Route path="/courses/:coursesId/shixun_homework/:homeworkid/review_detail/:userid" <Route path="/courses/:coursesId/shixun_homework/:homeworkid/review_detail/:userid"
render={ render={
(props) => (<ShixunWorkDetails {...this.props} {...props} {...this.state} />) (props) => (<ShixunWorkDetails {...this.props} {...props} {...this.state} {...common}/>)
} }
></Route> ></Route>
{/*实训查重列表*/} {/*实训查重列表*/}
<Route path="/courses/:coursesId/shixun_homeworks/:homeworkid/student_work" <Route path="/courses/:coursesId/shixun_homeworks/:homeworkid/student_work"
render={ render={
(props) => (<ShixunHomeworkPage {...this.props} {...props} {...this.state} />) (props) => (<ShixunHomeworkPage {...this.props} {...props} {...this.state} {...common}/>)
} }
></Route> ></Route>
<Route path="/courses/:coursesId/shixun_homework/:homeworkid/student_work" <Route path="/courses/:coursesId/shixun_homework/:homeworkid/student_work"
render={ render={
(props) => (<ShixunHomeworkPage {...this.props} {...props} {...this.state} />) (props) => (<ShixunHomeworkPage {...this.props} {...props} {...this.state} {...common}/>)
} }
></Route> ></Route>
{/*实训报告*/} {/*实训报告*/}
<Route path="/courses/:coursesId/shixun_homeworks/:homeworkid/shixun_work_report" <Route path="/courses/:coursesId/shixun_homeworks/:homeworkid/shixun_work_report"
render={ render={
(props) => (<ShixunWorkReport {...this.props} {...props} {...this.state} />) (props) => (<ShixunWorkReport {...this.props} {...props} {...this.state} {...common}/>)
} }
></Route> ></Route>
<Route path="/courses/:coursesId/shixun_homework/:homeworkid/shixun_work_report" <Route path="/courses/:coursesId/shixun_homework/:homeworkid/shixun_work_report"
render={ render={
(props) => (<ShixunWorkReport {...this.props} {...props} {...this.state} />) (props) => (<ShixunWorkReport {...this.props} {...props} {...this.state} {...common}/>)
} }
></Route> ></Route>
{/*教师列表*/} {/*教师列表*/}
<Route path="/courses/:coursesId/shixun_homeworks/:homeworkid/list" <Route path="/courses/:coursesId/shixun_homeworks/:homeworkid/list"
render={ render={
(props) => (<ShixunHomeworkPage {...this.props} {...props} {...this.state} />) (props) => (<ShixunHomeworkPage {...this.props} {...props} {...this.state} {...common}/>)
} }
></Route> ></Route>
<Route path="/courses/:coursesId/shixun_homework/:homeworkid/list" <Route path="/courses/:coursesId/shixun_homework/:homeworkid/list"
render={ render={
(props) => (<ShixunHomeworkPage {...this.props} {...props} {...this.state} />) (props) => (<ShixunHomeworkPage {...this.props} {...props} {...this.state} {...common}/>)
} }
></Route> ></Route>
{/*实训作业page*/} {/*实训作业page*/}
<Route path="/courses/:coursesId/shixun_homeworks/:homeworkid/Page" <Route path="/courses/:coursesId/shixun_homeworks/:homeworkid/Page"
render={ render={
(props) => (<ShixunHomeworkPage {...this.props} {...props} {...this.state} />) (props) => (<ShixunHomeworkPage {...this.props} {...props} {...this.state} {...common}/>)
} }
></Route> ></Route>
{/*实训作业设置*/} {/*实训作业设置*/}
<Route path="/courses/:coursesId/shixun_homeworks/:homeworkid/settings" <Route path="/courses/:coursesId/shixun_homeworks/:homeworkid/settings"
render={ render={
(props) => (<ShixunHomeworkPage {...this.props} {...props} {...this.state} />) (props) => (<ShixunHomeworkPage {...this.props} {...props} {...this.state} {...common}/>)
} }
></Route> ></Route>
<Route path="/courses/:coursesId/shixun_homework/:homeworkid/settings" <Route path="/courses/:coursesId/shixun_homework/:homeworkid/settings"
render={ render={
(props) => (<ShixunHomeworkPage {...this.props} {...props} {...this.state} />) (props) => (<ShixunHomeworkPage {...this.props} {...props} {...this.state} {...common}/>)
} }
></Route> ></Route>
{/*/!*实训作品列表教师*!/*/} {/*/!*实训作品列表教师*!/*/}
@ -805,21 +825,21 @@ class CoursesIndex extends Component{
{/*实训作业问答主目录*/} {/*实训作业问答主目录*/}
<Route path="/courses/:coursesId/shixun_homeworks/:homeworkid/questions" <Route path="/courses/:coursesId/shixun_homeworks/:homeworkid/questions"
render={ render={
(props) => (<ShixunHomeworkPage {...this.props} {...props} {...this.state} />) (props) => (<ShixunHomeworkPage {...this.props} {...props} {...this.state} {...common}/>)
} }
></Route> ></Route>
{/*实训作业问答子目录*/} {/*实训作业问答子目录*/}
<Route path="/courses/:coursesId/shixun_homework/:homeworkid/questions" <Route path="/courses/:coursesId/shixun_homework/:homeworkid/questions"
render={ render={
(props) => (<ShixunHomeworkPage {...this.props} {...props} {...this.state} />) (props) => (<ShixunHomeworkPage {...this.props} {...props} {...this.state} {...common}/>)
} }
></Route> ></Route>
{/*新建课堂*/} {/*新建课堂*/}
<Route path="/courses/new" <Route path="/courses/new"
render={ render={
(props) => (<WrappedCoursesNewApp {...this.props} {...props} {...this.state} />) (props) => (<WrappedCoursesNewApp {...this.props} {...props} {...this.state} {...common}/>)
} }
></Route> ></Route>
{/*新建精品课堂*/} {/*新建精品课堂*/}
@ -827,47 +847,47 @@ class CoursesIndex extends Component{
{/*id 是否是私有或者公有*/} {/*id 是否是私有或者公有*/}
<Route path="/courses/news/:subjectid/newgold/:id" <Route path="/courses/news/:subjectid/newgold/:id"
render={ render={
(props) => (<WrappedCoursesNewAppGoldclass {...this.props} {...props} {...this.state} />) (props) => (<WrappedCoursesNewAppGoldclass {...this.props} {...props} {...this.state} {...common}/>)
} }
></Route> ></Route>
{/*修改精品课堂*/} {/*修改精品课堂*/}
<Route path="/courses/:coursesId/newgolds/settings" <Route path="/courses/:coursesId/newgolds/settings"
render={ render={
(props) => (<WrappedCoursesNewAppGoldclass {...this.props} {...props} {...this.state} />) (props) => (<WrappedCoursesNewAppGoldclass {...this.props} {...props} {...this.state} {...common}/>)
} }
></Route> ></Route>
{/*修改课堂*/} {/*修改课堂*/}
<Route path="/courses/:coursesId/settings" <Route path="/courses/:coursesId/settings"
render={ render={
(props) => (<WrappedCoursesNewApp {...this.props} {...props} {...this.state} />) (props) => (<WrappedCoursesNewApp {...this.props} {...props} {...this.state} {...common}/>)
} }
></Route> ></Route>
{/* 实训作业子页面*/} {/* 实训作业子页面*/}
<Route path="/courses/:coursesId/shixun_homework/:category_id" <Route path="/courses/:coursesId/shixun_homework/:category_id"
render={ render={
(props) => (<ListPageIndex {...this.props} {...props} {...this.state} />) (props) => (<ListPageIndex {...this.props} {...props} {...this.state} {...common}/>)
} }
></Route> ></Route>
{/* 实训作业页面*/} {/* 实训作业页面*/}
<Route path="/courses/:coursesId/shixun_homeworks/:main_id" <Route path="/courses/:coursesId/shixun_homeworks/:main_id"
render={ render={
(props) => (<ListPageIndex {...this.props} {...props} {...this.state} />) (props) => (<ListPageIndex {...this.props} {...props} {...this.state} {...common}/>)
} }
></Route> ></Route>
{/*/!*实训作业and课堂详情页*!/*/} {/*/!*实训作业and课堂详情页*!/*/}
<Route path="/courses/:coursesId" <Route path="/courses/:coursesId"
render={ render={
(props) => (<ListPageIndex {...this.props} {...props} {...this.state} />) (props) => (<ListPageIndex {...this.props} {...props} {...this.state} {...common}/>)
} }
></Route> ></Route>
{/*课堂首页*/} {/*课堂首页*/}
<Route path="/courses" <Route path="/courses"
render={ render={
(props) => (<CoursesHome {...this.props} {...props} {...this.state} />) (props) => (<CoursesHome {...this.props} {...props} {...this.state} {...common}/>)
} }
></Route> ></Route>
{/*<Route exact path="/courses" component={CoursesHome} {...this.props} {...props} {...this.state} ></Route>*/} {/*<Route exact path="/courses" component={CoursesHome} {...this.props} {...props} {...this.state} ></Route>*/}
@ -877,4 +897,4 @@ class CoursesIndex extends Component{
} }
} }
export default ImageLayerOfCommentHOC({imgSelector: '.imageLayerParent img, .imageLayerParent .imageTarget', parentSelector: '.newMain'}) (CNotificationHOC() ( SnackbarHOC() ( TPMIndexHOC(CoursesIndex) ))); export default withRouter(ImageLayerOfCommentHOC({imgSelector: '.imageLayerParent img, .imageLayerParent .imageTarget', parentSelector: '.newMain'}) (CNotificationHOC() ( SnackbarHOC() ( TPMIndexHOC(CoursesIndex) ))));

@ -181,15 +181,16 @@ class BoardsNew extends Component{
} }
// 附件相关 START // 附件相关 START
handleChange = (info) => { handleChange = (info) => {
let fileList = info.fileList; if (info.file.status === 'uploading' || info.file.status === 'done' || info.file.status === 'removed') {
this.setState({ fileList: appendFileSizeToUploadFileAll(fileList) let fileList = info.fileList;
}); this.setState({ fileList: appendFileSizeToUploadFileAll(fileList) });
}
} }
onAttachmentRemove = (file) => { onAttachmentRemove = (file) => {
if(file.response!=undefined){ if(!file.percent || file.percent == 100){
confirm({ this.props.confirm({
// title: '确定要删除这个附件吗?', // title: '确定要删除这个附件吗?',
title: '是否确认删除?', content: '是否确认删除?',
okText: '确定', okText: '确定',
cancelText: '取消', cancelText: '取消',

@ -218,7 +218,8 @@ class CommonWorkAppraise extends Component{
</a> </a>
<span className="color656565 mt2 color-grey-6 font-12 mr8">{item.filesize}</span> <span className="color656565 mt2 color-grey-6 font-12 mr8">{item.filesize}</span>
{/*{item.delete===true?<i className="font-14 iconfont icon-guanbi " id={item.id} aria-hidden="true" onClick={()=>this.onAttachmentRemove(item.id)}></i>:""}*/} {/*{item.delete===true?<i className="font-14 iconfont icon-guanbi " id={item.id} aria-hidden="true" onClick={()=>this.onAttachmentRemove(item.id)}></i>:""}*/}
{item.delete===true?<i className="font-14 iconfont icon-guanbi " style={{display: 'none'}} id={item.id} aria-hidden="true" onClick={()=>this.onAttachmentRemove(item.id)}></i>:""} {item.delete===true?<i className="font-14 iconfont icon-guanbi " id={item.id} aria-hidden="true" onClick={()=>this.onAttachmentRemove(item.id)}></i>:""}
{/* style={{display: 'none'}} */}
</div> </div>
) )
})} })}

@ -291,7 +291,7 @@ class CommonWorkPost extends Component{
} }
// 附件相关 START // 附件相关 START
handleChange = (info) => { handleChange = (info) => {
if (info.file.status === 'uploading' || info.file.status === 'done') { if (info.file.status === 'uploading' || info.file.status === 'done' || info.file.status === 'removed') {
let fileList = info.fileList; let fileList = info.fileList;
this.setState({ fileList: appendFileSizeToUploadFileAll(fileList) }); this.setState({ fileList: appendFileSizeToUploadFileAll(fileList) });
@ -320,11 +320,19 @@ class CommonWorkPost extends Component{
// ModalSave: ()=>this.deleteAttachment(file), // ModalSave: ()=>this.deleteAttachment(file),
// ModalCancel:this.cancelAttachment // ModalCancel:this.cancelAttachment
// }) // })
if(file.response!=undefined){
this.deleteAttachment(file) if(!file.percent || file.percent == 100){
this.props.confirm({
content: '是否确认删除?',
onOk: () => {
this.deleteAttachment(file)
},
onCancel() {
console.log('Cancel');
},
});
return false; return false;
} }
} }
cancelAttachment=()=>{ cancelAttachment=()=>{

@ -3,7 +3,8 @@ import { Input, InputNumber, Form, Button, Checkbox, Upload, Icon, message, Moda
import axios from 'axios' import axios from 'axios'
import '../css/busyWork.css' import '../css/busyWork.css'
import '../css/Courses.css' import '../css/Courses.css'
import { WordsBtn, getUrl, ConditionToolTip, appendFileSizeToUploadFile, appendFileSizeToUploadFileAll } from 'educoder' import { WordsBtn, getUrl, ConditionToolTip, appendFileSizeToUploadFile, appendFileSizeToUploadFileAll
, getUploadActionUrl } from 'educoder'
import TPMMDEditor from '../../tpm/challengesnew/TPMMDEditor'; import TPMMDEditor from '../../tpm/challengesnew/TPMMDEditor';
import CBreadcrumb from '../common/CBreadcrumb' import CBreadcrumb from '../common/CBreadcrumb'
@ -234,16 +235,20 @@ class NewWork extends Component{
} }
handleContentUploadChange = (info) => { handleContentUploadChange = (info) => {
let contentFileList = info.fileList; if (info.file.status === 'uploading' || info.file.status === 'done' || info.file.status === 'removed') {
this.setState({ contentFileList: appendFileSizeToUploadFileAll(contentFileList) }); let contentFileList = info.fileList;
this.setState({ contentFileList: appendFileSizeToUploadFileAll(contentFileList) });
}
} }
handleAnswerUploadChange = (info) => { handleAnswerUploadChange = (info) => {
let answerFileList = info.fileList; if (info.file.status === 'uploading' || info.file.status === 'done' || info.file.status === 'removed') {
this.setState({ answerFileList: appendFileSizeToUploadFileAll(answerFileList) }); let answerFileList = info.fileList;
this.setState({ answerFileList: appendFileSizeToUploadFileAll(answerFileList) });
}
} }
onAttachmentRemove = (file, stateName) => { onAttachmentRemove = (file, stateName) => {
if(file.response!=undefined){ if(!file.percent || file.percent == 100){
this.props.confirm({ this.props.confirm({
content: '是否确认删除?', content: '是否确认删除?',
@ -331,7 +336,7 @@ class NewWork extends Component{
// https://github.com/ant-design/ant-design/issues/15505 // https://github.com/ant-design/ant-design/issues/15505
// showUploadList={false},然后外部拿到 fileList 数组自行渲染列表。 // showUploadList={false},然后外部拿到 fileList 数组自行渲染列表。
// showUploadList: false, // showUploadList: false,
action: `${getUrl()}/api/attachments.json`, action: `${getUploadActionUrl()}`,
onChange: this.handleContentUploadChange, onChange: this.handleContentUploadChange,
onRemove: (file) => this.onAttachmentRemove(file, 'contentFileList'), onRemove: (file) => this.onAttachmentRemove(file, 'contentFileList'),
beforeUpload: (file) => { beforeUpload: (file) => {

@ -1,5 +1,5 @@
import React, {Component} from "react"; import React, {Component} from "react";
import { WordsBtn,on, off, trigger,markdownToHTML,getImageUrl} from 'educoder'; import { WordsBtn,on, off, trigger,MarkdownToHtml,getImageUrl} from 'educoder';
import { import {
Button, Button,
Checkbox, Checkbox,
@ -73,7 +73,8 @@ class Groupjobbandetails extends Component {
datas.description===""? datas.description===""?
<NoneData></NoneData> <NoneData></NoneData>
: :
<div id="MakedownHTML"className="markdown-body yslquesHeigth yslquesmarkdowntext" dangerouslySetInnerHTML={{__html: markdownToHTML(datas.description).replace(/▁/g, "▁▁▁")}}/> <MarkdownToHtml content={datas.description} selector="work_content" className="mb10"></MarkdownToHtml>
// <div id="MakedownHTML"className="markdown-body yslquesHeigth yslquesmarkdowntext" dangerouslySetInnerHTML={{__html: markdownToHTML(datas.description).replace(/▁/g, "▁▁▁")}}/>
) )
} }
{/*<div id="MakedownHTML"className="markdown-body yslquesHeigth yslquesmarkdowntext" dangerouslySetInnerHTML={{__html: markdownToHTML(datas&&datas.description).replace(/▁/g, "▁▁▁")}}/>*/} {/*<div id="MakedownHTML"className="markdown-body yslquesHeigth yslquesmarkdowntext" dangerouslySetInnerHTML={{__html: markdownToHTML(datas&&datas.description).replace(/▁/g, "▁▁▁")}}/>*/}

@ -1,6 +1,6 @@
import React, {Component} from "react"; import React, {Component} from "react";
import {Link, NavLink} from 'react-router-dom'; import {Link, NavLink} from 'react-router-dom';
import {WordsBtn, ActionBtn} from 'educoder'; import {WordsBtn, ActionBtn,MarkdownToHtml} from 'educoder';
import axios from 'axios'; import axios from 'axios';
import { import {
notification notification

@ -1,5 +1,5 @@
import React, {Component} from "react"; import React, {Component} from "react";
import { WordsBtn,on, off, trigger,markdownToHTML,getImageUrl} from 'educoder'; import { WordsBtn,on, off, trigger,MarkdownToHtml,getImageUrl} from 'educoder';
import { import {
Button, Button,
Checkbox, Checkbox,
@ -72,7 +72,9 @@ class Completetopicdetails extends Component {
datas.description===""? datas.description===""?
<NoneData></NoneData> <NoneData></NoneData>
: :
<div id="MakedownHTML"className="markdown-body yslquesHeigth yslquesmarkdowntext" dangerouslySetInnerHTML={{__html: markdownToHTML(datas.description).replace(/▁/g, "▁▁▁")}}/> <MarkdownToHtml content={datas.description} selector="work_content" className="mb10"></MarkdownToHtml>
// <div id="MakedownHTML"className="markdown-body yslquesHeigth yslquesmarkdowntext" dangerouslySetInnerHTML={{__html: markdownToHTML(datas.description).replace(/▁/g, "▁▁▁")}}/>
) )
} }
{/*<div id="MakedownHTML"className="markdown-body yslquesHeigth yslquesmarkdowntext" dangerouslySetInnerHTML={{__html: markdownToHTML(datas&&datas.description).replace(/▁/g, "▁▁▁")}}/>*/} {/*<div id="MakedownHTML"className="markdown-body yslquesHeigth yslquesmarkdowntext" dangerouslySetInnerHTML={{__html: markdownToHTML(datas&&datas.description).replace(/▁/g, "▁▁▁")}}/>*/}

@ -73,7 +73,7 @@ class AccessoryModal extends Component{
// ModalCancel:this.cancelAttachment // ModalCancel:this.cancelAttachment
// }) // })
// return false; // return false;
if(file.response!=undefined){ if(!file.percent || file.percent == 100){
this.deleteAttachment(file); this.deleteAttachment(file);
} }
} }

@ -64,7 +64,7 @@ class AccessoryModal2 extends Component{
// ModalCancel:this.cancelAttachment // ModalCancel:this.cancelAttachment
// }) // })
// return false; // return false;
if(file.response!=undefined){ if(!file.percent || file.percent == 100){
this.deleteAttachment(file); this.deleteAttachment(file);
} }

@ -296,7 +296,7 @@ class Selectsetting extends Component{
onAttachmentRemove = (file) => { onAttachmentRemove = (file) => {
if(file.response!=undefined){ if(!file.percent || file.percent == 100){
const url = `/attachments/${file.response ? file.response.id : file.uid}.json` const url = `/attachments/${file.response ? file.response.id : file.uid}.json`
axios.delete(url, { axios.delete(url, {
}) })

@ -132,7 +132,7 @@ class Sendresource extends Component{
onAttachmentRemove = (file) => { onAttachmentRemove = (file) => {
if(file.response!=undefined){ if(!file.percent || file.percent == 100){
const url = `/attachments/${file.response ? file.response.id : file.uid}.json` const url = `/attachments/${file.response ? file.response.id : file.uid}.json`
axios.delete(url, { axios.delete(url, {
}) })

@ -1,80 +1,81 @@
.polllisthover:hover { .polllisthover:hover {
box-shadow: 0px 2px 6px rgba(51,51,51,0.09); box-shadow: 0px 2px 6px rgba(51,51,51,0.09);
opacity: 1; opacity: 1;
border-radius: 2px; border-radius: 2px;
} }
.workList_Item{ .workList_Item{
/* padding:20px 30px; */ /* padding:20px 30px; */
display: flex; display: flex;
background-color: #fff; background-color: #fff;
margin-bottom: 20px; margin-bottom: 20px;
padding-top: 10px; padding-top: 10px;
} }
p span{ p span{
cursor: default; cursor: default;
} }
.mt-5{ margin-top:-5px;} .mt-5{ margin-top:-5px;}
/* <20><><EFBFBD>ѡ<EFBFBD><D1A1>tab */ /* <20><><EFBFBD>ѡ<EFBFBD><D1A1>tab */
.bankNav li{ .bankNav li{
float: left; float: left;
margin-right: 20px; margin-right: 20px;
} }
.bankNav li:last-child{ .bankNav li:last-child{
margin-right: 0px; margin-right: 0px;
} }
.bankNav li.active a{ .bankNav li.active a{
color: #fff!important; color: #fff!important;
background-color: #4CACFF; background-color: #4CACFF;
} }
.bankNav li a{ .bankNav li a{
display: block; display: block;
padding:0px 10px; padding:0px 10px;
height: 28px; height: 28px;
line-height: 28px; line-height: 28px;
background-color: #F5F5F5; background-color: #F5F5F5;
border-radius: 36px; border-radius: 36px;
color: #666666!important; color: #666666!important;
} }
.task_menu_ul{ .task_menu_ul{
width: 600px; width: 600px;
} }
.task_menu_ul .ant-menu-item,.task_menu_ul .ant-menu-submenu-title{ .task_menu_ul .ant-menu-item,.task_menu_ul .ant-menu-submenu-title{
padding:0px; padding:0px;
margin-right: 30px; margin-right: 30px;
line-height: 68px; line-height: 68px;
font-size: 16px; font-size: 16px;
} }
.ant-menu{ .ant-menu{
color: #05101a; color: #05101a;
} }
.task_menu_ul .ant-menu-horizontal{ .task_menu_ul .ant-menu-horizontal{
border-bottom: none; border-bottom: none;
} }
.task_menu_ul .ant-menu-horizontal > .ant-menu-item:hover{ .task_menu_ul .ant-menu-horizontal > .ant-menu-item:hover{
border-bottom:2px solid transparent; border-bottom:2px solid transparent;
} }
.task_menu_ul .ant-menu-horizontal > .ant-menu-item-selected{ .task_menu_ul .ant-menu-horizontal > .ant-menu-item-selected{
border-bottom: 2px solid #4CACFF !important; border-bottom: 2px solid #4CACFF !important;
} }
.sourceTag a{ .sourceTag a{
display: block; display: block;
float: left; float: left;
background-color:#E5F3FF; background-color:#E5F3FF;
padding: 0px 10px; padding: 0px 10px;
height: 24px; height: 24px;
line-height: 24px; line-height: 24px;
color: #4E7A9B; color: #4E7A9B;
margin:5px 0px 5px 10px; margin:5px 0px 5px 10px;
} }
.sourceTag a.active{ .sourceTag a.active{
color: #FFFFFF;background-color:#4CACFF; color: #FFFFFF;background-color:#4CACFF;
} }

@ -53,11 +53,15 @@ class ExerciseDisplay extends Component{
componentDidMount = () => { componentDidMount = () => {
const Id = this.props.match.params.Id const Id = this.props.match.params.Id
if (Id) { if (Id) {
const url = `/exercises/${Id}.json` const url = `/${this.props.urlPath || 'exercises'}/${Id}.json`
axios.get(url) axios.get(url)
.then((response) => { .then((response) => {
if (response.data.status == 0) { if (response.data.exercise) {
this.setState({...response.data}) response.data.exercise.exercise_description = response.data.exercise.exercise_description || response.data.exercise.description
response.data.exercise.exercise_name = response.data.exercise.exercise_name || response.data.exercise.name
response.data.exercise.exercise_status = response.data.exercise.exercise_status == undefined ? 1 : response.data.exercise.exercise_status
this.setState({...response.data})
this.props.detailFetchCallback && this.props.detailFetchCallback(response);
} }
}) })
.catch(function (error) { .catch(function (error) {

@ -116,7 +116,7 @@ class GraduationTasksSubmitedit extends Component{
this.setState({ fileList:appendFileSizeToUploadFileAll(fileList) }); this.setState({ fileList:appendFileSizeToUploadFileAll(fileList) });
} }
if (info.file.status === 'done') { if (info.file.status === 'done' || info.file.status === 'removed') {
let fileList = info.fileList; let fileList = info.fileList;
this.setState({ fileList:appendFileSizeToUploadFileAll(fileList) }); this.setState({ fileList:appendFileSizeToUploadFileAll(fileList) });
} }
@ -157,7 +157,7 @@ class GraduationTasksSubmitedit extends Component{
} }
onAttachmentRemove = (file) => { onAttachmentRemove = (file) => {
if(file.response!=undefined){ if(!file.percent || file.percent == 100){
let {attachments,fileList}=this.state; let {attachments,fileList}=this.state;
const url = `/attachments/${file}.json` const url = `/attachments/${file}.json`
axios.delete(url, { axios.delete(url, {

@ -125,7 +125,7 @@ class GraduationTasksSubmitnew extends Component{
this.setState({ fileList:appendFileSizeToUploadFileAll(fileList) }); this.setState({ fileList:appendFileSizeToUploadFileAll(fileList) });
} }
if (info.file.status === 'done') { if (info.file.status === 'done' || info.file.status === 'removed') {
let fileList = info.fileList; let fileList = info.fileList;
this.setState({ fileList:appendFileSizeToUploadFileAll(fileList) }); this.setState({ fileList:appendFileSizeToUploadFileAll(fileList) });
} }
@ -146,7 +146,7 @@ class GraduationTasksSubmitnew extends Component{
// }, // },
// }); // });
// return false; // return false;
if(file.response!=undefined){ if(!file.percent || file.percent == 100){
this.setState({ this.setState({
Modalstype:true, Modalstype:true,
Modalstopval:'确定要删除这个附件吗?', Modalstopval:'确定要删除这个附件吗?',

@ -88,7 +88,7 @@ class GraduationTasksappraiseMainEditor extends Component{
this.setState({ fileList }); this.setState({ fileList });
} }
onAttachmentRemove = (file, stateName) => { onAttachmentRemove = (file, stateName) => {
if(file.response!=undefined){ if(!file.percent || file.percent == 100){
this.props.confirm({ this.props.confirm({
content: '确定要删除这个附件吗?', content: '确定要删除这个附件吗?',
okText: '确定', okText: '确定',

@ -150,7 +150,7 @@ class GraduationTasksedit extends Component{
} }
onAttachmentRemove = (file) => { onAttachmentRemove = (file) => {
if(file.response!=undefined){ if(!file.percent || file.percent == 100){
// debugger // debugger
this.cancelAttachment(); this.cancelAttachment();
const url = `/attachments/${file.response ? file.response.id : file.uid}.json` const url = `/attachments/${file.response ? file.response.id : file.uid}.json`

@ -173,7 +173,7 @@ class GraduationTasksnew extends Component {
} }
onAttachmentRemove = (file) => { onAttachmentRemove = (file) => {
if(file.response!=undefined){ if(!file.percent || file.percent == 100){
const url = `/attachments/${file.response ? file.response.id : file.uid}.json` const url = `/attachments/${file.response ? file.response.id : file.uid}.json`
// const url = `/attachments/${file}.json` // const url = `/attachments/${file}.json`
axios.delete(url, {}) axios.delete(url, {})

@ -216,7 +216,7 @@ class GraduateTopicNew extends Component{
} }
onAttachmentRemove = (file) => { onAttachmentRemove = (file) => {
if(file.response!=undefined){ if(!file.percent || file.percent == 100){
confirm({ confirm({
title: '确定要删除这个附件吗?', title: '确定要删除这个附件吗?',
okText: '确定', okText: '确定',

@ -163,7 +163,7 @@ class GraduateTopicPostWorksNew extends Component{
this.setState({ fileList }); this.setState({ fileList });
} }
onAttachmentRemove = (file) => { onAttachmentRemove = (file) => {
if(file.response!=undefined){ if(!file.percent || file.percent == 100){
confirm({ confirm({
title: '确定要删除这个附件吗?', title: '确定要删除这个附件吗?',
okText: '确定', okText: '确定',

@ -1,5 +1,5 @@
import React, {Component} from "react"; import React, {Component} from "react";
import { WordsBtn,on, off, trigger,markdownToHTML,getImageUrl} from 'educoder'; import { WordsBtn,on, off, trigger,MarkdownToHtml,getImageUrl} from 'educoder';
import { import {
Button, Button,
Checkbox, Checkbox,
@ -74,7 +74,8 @@ class Groupjobbandetails extends Component {
datas.description===""? datas.description===""?
<NoneData></NoneData> <NoneData></NoneData>
: :
<div id="MakedownHTML"className="markdown-body yslquesHeigth yslquesmarkdowntext" dangerouslySetInnerHTML={{__html: markdownToHTML(datas.description).replace(/▁/g, "▁▁▁")}}/> <MarkdownToHtml content={datas.description} selector="work_content" className="mb10"></MarkdownToHtml>
// <div id="MakedownHTML"className="markdown-body yslquesHeigth yslquesmarkdowntext" dangerouslySetInnerHTML={{__html: markdownToHTML(datas.description).replace(/▁/g, "▁▁▁")}}/>
) )
} }
{/*<div id="MakedownHTML"className="markdown-body yslquesHeigth yslquesmarkdowntext" dangerouslySetInnerHTML={{__html: markdownToHTML(datas&&(datas.description===null?"无":datas.description==="null"?"无":datas.description)).replace(/▁/g, "▁▁▁")}}/>*/} {/*<div id="MakedownHTML"className="markdown-body yslquesHeigth yslquesmarkdowntext" dangerouslySetInnerHTML={{__html: markdownToHTML(datas&&(datas.description===null?"无":datas.description==="null"?"无":datas.description)).replace(/▁/g, "▁▁▁")}}/>*/}

@ -1,5 +1,5 @@
import React, {Component} from "react"; import React, {Component} from "react";
import { WordsBtn,on, off, trigger,markdownToHTML,getImageUrl} from 'educoder'; import { WordsBtn,on, off, trigger,MarkdownToHtml,getImageUrl} from 'educoder';
import { import {
Button, Button,
Checkbox, Checkbox,
@ -71,7 +71,8 @@ class Groupjobquesanswer extends Component {
datas.reference_answer===""? datas.reference_answer===""?
<NoneData></NoneData> <NoneData></NoneData>
: :
<div id="MakedownHTML"className="markdown-body yslquesHeigth yslquesmarkdowntext" dangerouslySetInnerHTML={{__html: markdownToHTML(datas.reference_answer).replace(/▁/g, "▁▁▁")}}/> <MarkdownToHtml content={datas.reference_answer} selector="work_content" className="mb10"></MarkdownToHtml>
// <div id="MakedownHTML"className="markdown-body yslquesHeigth yslquesmarkdowntext" dangerouslySetInnerHTML={{__html: markdownToHTML(datas.reference_answer).replace(/▁/g, "▁▁▁")}}/>
) )
} }
{/*<div id="MakedownHTML"className="markdown-body yslquesHeigth yslquesmarkdowntext" dangerouslySetInnerHTML={{__html: markdownToHTML(datas&&(datas.description===null?"无":datas.description==="null"?"无":datas.description)).replace(/▁/g, "▁▁▁")}}/>*/} {/*<div id="MakedownHTML"className="markdown-body yslquesHeigth yslquesmarkdowntext" dangerouslySetInnerHTML={{__html: markdownToHTML(datas&&(datas.description===null?"无":datas.description==="null"?"无":datas.description)).replace(/▁/g, "▁▁▁")}}/>*/}

@ -73,7 +73,7 @@ class CreateGroupByImportModal extends Component{
} }
onAttachmentRemove = (file) => { onAttachmentRemove = (file) => {
if(file.response!=undefined){ if(!file.percent || file.percent == 100){
this.props.confirm({ this.props.confirm({
content: '是否确认删除?', content: '是否确认删除?',

@ -0,0 +1,109 @@
.color4CACFF{
color: #4CACFF !important;
}
.orderingbox{
width:1200px;
height:80px;
background:rgba(255,255,255,1);
box-shadow:3px 3px 3px rgba(237,237,237,1);
opacity:1;
border-radius:2px 2px 0px 0px;
padding: 24px;
box-sizing: border-box;
line-height: 34px;
}
.orderingbtnright{
width: 90px;
height: 38px;
background: rgba(255,255,255,1);
border: 1px solid rgba(228,228,228,1);
box-shadow: 0px 1px 1px rgba(0,0,0,0.16);
opacity: 1;
border-radius: 4px;
}
.orderingbtnleft{
width: 90px;
height: 38px;
background: rgba(76,172,255,1);
box-shadow: 0px 1px 1px rgba(0,0,0,0.16);
opacity: 1;
border-radius: 4px;
}
.pd1323s{
padding: 10px 6px 25px 40px;
cursor: pointer;
}
.orderSection{
height: 80px;
padding-top: 16px;
}
.ordermidbox{
width: 960px;
height: 120px;
background: rgba(255,255,255,1);
/* border: 1px solid rgba(205,205,205,1); */
opacity: 1;
margin-left:142px;
}
.orderfonttop{
font-size: 16px !important;
font-family: Microsoft YaHei;
font-weight: bold;
line-height: 28px;
color: rgba(5,16,26,1);
opacity: 1;
}
.orderfontbom{
font-size:14px;
font-family:Microsoft YaHei;
font-weight:400;
line-height:25px;
color:rgba(153,153,153,1);
opacity:1;
}
.ordermidbox:hover {
box-shadow: 0px 2px 6px rgba(51,51,51,0.09);
opacity: 1;
}
.mb200{
margin-bottom: 200px;
}
.maxwidth865s{
max-width: 865px;
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
}
.maxwidth795 {
max-width:795px;
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
display: inline-block;
}
.ordermidbox:active{
background:rgba(248,247,255,1);
border:1px solid rgba(76,172,255,1);
}
.ordermidbox:focus{
background:rgba(248,247,255,1);
border:1px solid rgba(76,172,255,1);
}
.ordermiddiv{
min-height: 500px;
}

@ -0,0 +1,296 @@
import React,{ Component } from "react";
import { Input,Checkbox,Table, Pagination, Modal,Menu, Tooltip,Spin,Breadcrumb,Button } from "antd";
import { WordsBtn,on, off, trigger } from 'educoder';
import { DragDropContext,Draggable, Droppable} from 'react-beautiful-dnd';
import axios from'axios';
import Modals from '../../modals/Modals';
import '../css/members.css';
import '../css/busyWork.css';
import './Ordering.css';
import NoneData from "../coursesPublic/NoneData";
const reorder = (list, startIndex, endIndex) => {
const result = Array.from(list);
const [removed] = result.splice(startIndex, 1);
result.splice(endIndex, 0, removed);
return result;
};
class Ordering extends Component{
constructor(props){
super(props);
this.state={
isSpin:false,
antIcon:false,
datas:undefined,
windowsscrollTop:false,
newtask_ids:[]
}
}
componentDidMount() {
this.setState({
isSpin:true
})
let coursesId=this.props.match.params.coursesId;
let ordering_type=this.props.match.params.ordering_type;
let url=`/courses/${coursesId}/tasks_list.json`;
axios.get((url),{params:{
container_type:ordering_type
}}).then((result)=>{
if(result){
this.setState({
datas:result.data.tasks,
isSpin:false
})
}
}).catch((error)=>{
console.log(error);
this.setState({
isSpin:false
})
})
window.addEventListener('scroll', this.handleScroll.bind(this)) //监听滚动
// window.addEventListener('resize', this.handleResize.bind(this)) //监听窗口大小改变
}
// componentWillUnmount() { //一定要最后移除监听器以防多个组件之间导致this的指向紊乱
// window.removeEventListener('scroll', this.handleScroll.bind(this))
// window.removeEventListener('resize', this.handleResize.bind(this))
// }
handleScroll=(e)=>{
// console.log(
// '浏览器滚动事件',
// e.srcElement.scrollingElement.scrollTop,
// e.srcElement.scrollingElement.scrollHeight
// )
//e.srcElement.scrollingElement.scrollTop为距离滚动条顶部高度
// e.srcElement.scrollingElement.scrollHeight为整个文档高度
if(e.srcElement.scrollingElement.scrollTop>60){
this.setState({
windowsscrollTop:true,
})
}
if(e.srcElement.scrollingElement.scrollTop===0){
this.setState({
windowsscrollTop:false
})
}
}
//
// handleResize = e => {
// console.log('浏览器窗口大小改变事件', e.target.innerWidth)
// }
onDragEnd=(result)=>{
if(result.destination!=null&&result.destination!=undefined){
let {datas}=this.state;
if (!result.destination) {
console.log('dropped outside the list')
return;
}
if (result.destination.index === result.source.index) {
console.log('the same')
return;
}
const shixuns_list = reorder(
datas,
result.source.index,
result.destination.index
);
let newtask_ids=[]
shixuns_list.map((item,key)=>{
newtask_ids.push(item.task_id)
})
this.setState({
datas:shixuns_list,
newtask_ids:newtask_ids
})
}
}
updatalist=()=>{
let {datas,newtask_ids,isSpin}=this.state;
if(newtask_ids.length===0){
this.props.showNotification("请先移动需要排序的实训作业任务");
return
}
if(isSpin===true){
return
}
this.setState({
isSpin:true
})
let coursesId=this.props.match.params.coursesId;
let ordering_type=this.props.match.params.ordering_type;
let url=`/courses/${coursesId}/update_task_position.json`;
axios.post(url,{
container_type:ordering_type,
task_ids:newtask_ids
}).then((result)=>{
if(result.data.status===0){
this.props.showNotification(result.data.message);
this.setState({
isSpin:false,
datas:datas,
newtask_ids:[]
});
}else{
this.setState({
isSpin:false,
});
}
}).catch((error)=>{
this.setState({
isSpin:false,
});
})
}
goback=()=>{
window.location.href=`/courses/${this.props.match.params.coursesId}/shixun_homeworks/${this.props.match.params.main_id}`
}
render(){
let {
datas,
Modalstype,
windowsscrollTop,
}=this.state;
let main_id=this.props.match.params.main_id;
let category_id=this.props.match.params.category_id;
console.log(this.props)
console.log(window)
let positiontype=null;
if(windowsscrollTop===true){
positiontype={position:'fixed',zIndex:'9000',left:'20%',top: '0px'}
}else{
positiontype={}
}
return(
<div className={"mb200"}>
{/*提示*/}
{Modalstype&&Modalstype===true?<Modals
modalsType={this.state.Modalstype}
modalsTopval={this.state.Modalstopval}
modalCancel={this.state.ModalCancel}
modalSave={this.state.ModalSave}
modalsBottomval={this.state.ModalsBottomval}
loadtype={this.state.Loadtype}
antIcon={this.state.antIcon}
/>:""}
<div className="educontent clearfix">
{windowsscrollTop===false?<div className={"mt20 mb20"}>
<Breadcrumb separator=">">
<Breadcrumb.Item href={this.props.current_user&&this.props.current_user.first_category_url}>{this.props.current_user&&this.props.current_user.course_name}</Breadcrumb.Item>
<Breadcrumb.Item href={`/courses/${this.props.match.params.coursesId}/shixun_homeworks/${this.props.match.params.main_id}`}>实训作业</Breadcrumb.Item>
<Breadcrumb.Item>调整排序</Breadcrumb.Item>
</Breadcrumb>
</div>:""}
<p className="clearfix bor-bottom-greyE edu-back-white orderingbox"
style={positiontype}
>
<span>温馨提示请在列表中长按鼠标左键进行拖放排序完成排序后请点击保存</span>
<Button className="fr orderingbtnleft" type="primary" onClick={()=>this.updatalist()}>保存</Button>
<Button className="fr mr30 orderingbtnright" onClick={()=>this.goback()}>取消</Button>
</p>
</div>
<Spin size="large" spinning={this.state.isSpin} >
<DragDropContext onDragEnd={this.onDragEnd} >
<Droppable droppableId={this.props.match.params.ordering_type}>
{(provided, snapshot) => (
<div
ref={provided.innerRef}
{...provided.droppableProps}
className={"educontent mb50 mt40 droppableul ordermiddiv"}
onScroll={this.contentViewScrolledit}
>
{datas===undefined?"":
datas.map((item, index) => {
return (
<Draggable
key={item.task_id}
draggableId={item.task_id}
index={index}
className={"TabsWarps"}
>
{(provided, snapshot) => (
<div className={"mt30 edu-back-white pd1323s relativef ordermidbox"}
key={index}
ref={provided.innerRef}
{...provided.draggableProps}
{...provided.dragHandleProps}
>
<div className={"clearfix"}>
<div className={"item-body"}>
<div className={"clearfix ds pr orderSection"}>
<p title={item.task_name} className="font-16 color-dark maxwidth865s orderfonttop"
href={`/courses/${this.props.match.params.coursesId}/shixun_homeworks/${item.task_id}/list?tab=0`}>{item.task_name}</p>
<p className={"color-grey panel-lightgrey mt16 "}>
<span className="topicswidth400">
<span className="topsics100 color-grey9 orderfontbom mr20 maxwidth795">{item.user_name}</span>
<span className="mr50 color-grey9 orderfontbom maxwidth795">{item.category}</span>
</span>
</p>
</div>
</div>
</div>
</div>
)}
</Draggable>
)
})
}
</div>
)}
</Droppable>
</DragDropContext>
{
datas===undefined?"":datas.length===0? <NoneData></NoneData>:""
}
</Spin>
</div>
)
}
}
export default Ordering;

@ -1014,6 +1014,7 @@ class PollNewQuestbank extends Component {
return; return;
} }
if(object.question.max_choices){ if(object.question.max_choices){
if(object.question.max_choices>0){ if(object.question.max_choices>0){
if(object.question.min_choices){ if(object.question.min_choices){
@ -1244,6 +1245,7 @@ class PollNewQuestbank extends Component {
return; return;
} }
if(object.question.max_choices){ if(object.question.max_choices){
if(object.question.max_choices>0){ if(object.question.max_choices>0){
if(object.question.min_choices){ if(object.question.min_choices){
@ -1563,6 +1565,8 @@ class PollNewQuestbank extends Component {
return; return;
} }
if(object.question.max_choices){ if(object.question.max_choices){
if(object.question.max_choices>0){ if(object.question.max_choices>0){
if(object.question.min_choices){ if(object.question.min_choices){
@ -1594,6 +1598,7 @@ class PollNewQuestbank extends Component {
} }
} }
var questiontwo = {}; var questiontwo = {};
var other = []; var other = [];
var option = []; var option = [];
@ -1764,6 +1769,8 @@ class PollNewQuestbank extends Component {
return; return;
} }
if(object.question.max_choices){ if(object.question.max_choices){
if(object.question.max_choices>0){ if(object.question.max_choices>0){
if(object.question.min_choices){ if(object.question.min_choices){
@ -1958,8 +1965,8 @@ class PollNewQuestbank extends Component {
question_title: object.question.question_title, question_title: object.question.question_title,
question_type: number, question_type: number,
is_necessary: object.question.is_necessary, is_necessary: object.question.is_necessary,
max_choices: max_choicess===undefined?length:max_choicess===null?length:max_choicess===0?length:max_choicess, max_choices: max_choicess===undefined||max_choicess===null||max_choicess===0||max_choicess==="0"?null:max_choicess,
min_choices: min_choicess===undefined?2:min_choicess===null?2:min_choicess===0?2:min_choicess, min_choices: min_choicess===undefined||min_choicess===null||min_choicess===0||min_choicess==="0"?null:min_choicess,
question_answers: option, question_answers: option,
question_other_answer: null, question_other_answer: null,
insert_id: insert_id insert_id: insert_id
@ -2030,8 +2037,8 @@ class PollNewQuestbank extends Component {
question_title: object.question.question_title, question_title: object.question.question_title,
question_type: number, question_type: number,
is_necessary: object.question.is_necessary, is_necessary: object.question.is_necessary,
max_choices: max_choicess===undefined?length:max_choicess===null?length:max_choicess===0?length:max_choicess, max_choices: max_choicess===undefined||max_choicess===null||max_choicess===0||max_choicess==="0"?null:max_choicess,
min_choices: min_choicess===undefined?2:min_choicess===null?2:min_choicess===0?2:min_choicess, min_choices: min_choicess===undefined||min_choicess===null||min_choicess===0||min_choicess==="0"?null:min_choicess,
question_answers: option, question_answers: option,
question_other_answer: null, question_other_answer: null,
}; };
@ -2401,11 +2408,10 @@ class PollNewQuestbank extends Component {
}) })
// } // }
} }
//最大值 //最大值
HandleGradationGroupChangeee = (value, index, minchoices, length) => { HandleGradationGroupChangeee = (value, index,minchoices,length) => {
// console.log("2112"); // console.log("2112");
// console.log(value); // console.log(value);
// console.log(minchoices); // console.log(minchoices);
@ -2439,6 +2445,7 @@ class PollNewQuestbank extends Component {
this.setState({ this.setState({
adddom: arr adddom: arr
}) })
// console.log(this.state.adddom);
} }
//提交题目//没有就创建新的题库新建问newz题和保存题目不一样不能同时保存 这里只是新建 和编辑 标题和须知 //提交题目//没有就创建新的题库新建问newz题和保存题目不一样不能同时保存 这里只是新建 和编辑 标题和须知
@ -2968,13 +2975,8 @@ class PollNewQuestbank extends Component {
className="color-grey-9 fl">{item.question.question_type === 1 ? "单选题" : item.question.question_type === 2 ? "多选题" : "主观题"}</span> className="color-grey-9 fl">{item.question.question_type === 1 ? "单选题" : item.question.question_type === 2 ? "多选题" : "主观题"}</span>
<span <span
className=" ml10">{item.question.is_necessary === 1 ? "(必答)" : item.question.question_type === 2 ? "(选答)" : "(选答)"}</span> className=" ml10">{item.question.is_necessary === 1 ? "(必答)" : item.question.question_type === 2 ? "(选答)" : "(选答)"}</span>
{ <span style={{color: "#4B4B4B"}}
item.question.question_type === 2? className="font-16 mt10 ml10">{(item.question.min_choices === undefined && item.question.max_choices === undefined ? "不限制" : item.question.min_choices === null && item.question.max_choices === null ? "不限制" : item.question.min_choices === 0 && item.question.max_choices === 0 ? "": item.question.min_choices === "null" && item.question.max_choices === "null" ? "不限制" : item.question.min_choices === item.question.max_choices && item.question.max_choices === item.question.min_choices ? "可选"+(item.question.max_choices)+"项" : "可选" +(item.question.min_choices===undefined||item.question.min_choices===null||item.question.min_choices===""||item.question.min_choices==="null"?2:item.question.min_choices) + "-" + (item.question.max_choices===undefined||item.question.max_choices===null||item.question.max_choices===""||item.question.max_choices==="null"?item.question.answers.length:item.question.max_choices) + "项")}</span>
<span style={{color: "#4B4B4B"}}
className="font-16 mt10 ml10">{(item.question.min_choices === undefined && item.question.max_choices === undefined ? "不限制" : item.question.min_choices === null && item.question.max_choices === null ? "不限制" : item.question.min_choices === 0 && item.question.max_choices === 0 ? "": item.question.min_choices === "null" && item.question.max_choices === "null" ? "不限制" : item.question.min_choices === item.question.max_choices && item.question.max_choices === item.question.min_choices ? "可选"+(item.question.max_choices)+"项" : "可选" +(item.question.min_choices===undefined||item.question.min_choices===null||item.question.min_choices===""||item.question.min_choices==="null"?2:item.question.min_choices) + "-" + (item.question.max_choices===undefined||item.question.max_choices===null||item.question.max_choices===""||item.question.max_choices==="null"?item.question.answers.length:item.question.max_choices) + "项")}</span>
: ""
}
{ {
polls_status === undefined || polls_status === 1 ? polls_status === undefined || polls_status === 1 ?
<span className="fr"> <span className="fr">
@ -3168,12 +3170,12 @@ class PollNewQuestbank extends Component {
{ {
itemo.question.answers[itemo.question.answers.length - 1].answer_text === "其他" && itemo.question.answers.length - 2 === indext ? itemo.question.answers[itemo.question.answers.length - 1].answer_text === "其他" && itemo.question.answers.length - 2 === indext ?
<a className="lineh-40 ml10" <a className="lineh-40"
onClick={() => this.Ewoption(itemo.question.id, itemo)}><Tooltip onClick={() => this.Ewoption(itemo.question.id, itemo)}><Tooltip
title="新增" placement={"bottom"}><i title="新增" placement={"bottom"}><i
className="color-green font-18 iconfont icon-roundaddfill"></i></Tooltip></a> className="color-green font-18 iconfont icon-roundaddfill"></i></Tooltip></a>
: itemo.question.answers.length - 1 === indext ? : itemo.question.answers.length - 1 === indext ?
<a className="lineh-40 ml10" <a className="lineh-40"
onClick={() => this.Ewoption(itemo.question.id, itemo)}><Tooltip onClick={() => this.Ewoption(itemo.question.id, itemo)}><Tooltip
title="新增" placement={"bottom"}><i title="新增" placement={"bottom"}><i
className="color-green font-18 iconfont icon-roundaddfill"></i></Tooltip></a> className="color-green font-18 iconfont icon-roundaddfill"></i></Tooltip></a>
@ -3182,7 +3184,7 @@ class PollNewQuestbank extends Component {
} }
</span> </span>
: indext === 1 && itemo.question.answers.length === 2 || indext === 1 && itemo.question.answers.length === 3 ? : indext === 1 && itemo.question.answers.length === 2 || indext === 1 && itemo.question.answers.length === 3 ?
<a className="lineh-40 ml10" <a className="lineh-40"
onClick={() => this.Ewoption(itemo.question.id, itemo)}><Tooltip onClick={() => this.Ewoption(itemo.question.id, itemo)}><Tooltip
title="新增" placement={"bottom"}><i title="新增" placement={"bottom"}><i
className="color-green font-18 iconfont icon-roundaddfill"></i></Tooltip></a> : "" className="color-green font-18 iconfont icon-roundaddfill"></i></Tooltip></a> : ""
@ -3231,7 +3233,7 @@ class PollNewQuestbank extends Component {
<span <span
className="color-grey-6 mr20 font-16 lineh-40 fl">可选</span> className="color-grey-6 mr20 font-16 lineh-40 fl">可选</span>
<div className="mr40 flex1 "> <div className="mr40 flex1 ">
{/*可选最小*/} {/*可选最小1*/}
<style> <style>
{ {
` `
@ -3250,7 +3252,6 @@ class PollNewQuestbank extends Component {
<Select className="fl w100" <Select className="fl w100"
onChange={(value) => this.HandleGradationGroupChangee(value, indexo, itemo.question.max_choices, itemo.question.answers.length)} onChange={(value) => this.HandleGradationGroupChangee(value, indexo, itemo.question.max_choices, itemo.question.answers.length)}
value={itemo.question.min_choices === null || itemo.question.min_choices === undefined ||itemo.question.min_choices === "null"|| itemo.question.min_choices === 0 || itemo.question.min_choices === "0"?"0": itemo.question.min_choices} value={itemo.question.min_choices === null || itemo.question.min_choices === undefined ||itemo.question.min_choices === "null"|| itemo.question.min_choices === 0 || itemo.question.min_choices === "0"?"0": itemo.question.min_choices}
> >
<Option value={String("0")}>--</Option> <Option value={String("0")}>--</Option>
{itemo.question.answers === undefined ? "" : itemo.question.answers.map((itemt, indext) => { {itemo.question.answers === undefined ? "" : itemo.question.answers.map((itemt, indext) => {
@ -3262,7 +3263,7 @@ class PollNewQuestbank extends Component {
</Select> </Select>
<span <span
className="ml10 mr10 color-grey-6 lineh-40 fl">~</span> className="ml10 mr10 color-grey-6 lineh-40 fl">~</span>
{/*可选最大*/} {/*可选最大1*/}
<Select className="fl w100" <Select className="fl w100"
onChange={(value) => this.HandleGradationGroupChangeee(value, indexo, itemo.question.min_choices,itemo.question.answers.length)} onChange={(value) => this.HandleGradationGroupChangeee(value, indexo, itemo.question.min_choices,itemo.question.answers.length)}
value={itemo.question.max_choices === null || itemo.question.max_choices === undefined ||itemo.question.max_choices === "null"|| itemo.question.max_choices === 0 || itemo.question.max_choices === "0"?"0": itemo.question.max_choices} value={itemo.question.max_choices === null || itemo.question.max_choices === undefined ||itemo.question.max_choices === "null"|| itemo.question.max_choices === 0 || itemo.question.max_choices === "0"?"0": itemo.question.max_choices}
@ -3477,12 +3478,12 @@ class PollNewQuestbank extends Component {
className="iconfont icon-htmal5icon19 font-22 color-grey-c"></i></Tooltip></a> className="iconfont icon-htmal5icon19 font-22 color-grey-c"></i></Tooltip></a>
{ {
itemo.question.answers[itemo.question.answers.length - 1].answer_text === "其他" && itemo.question.answers.length - 2 === indext ? itemo.question.answers[itemo.question.answers.length - 1].answer_text === "其他" && itemo.question.answers.length - 2 === indext ?
<a className="lineh-40 ml10" <a className="lineh-40"
onClick={() => this.Ewoption(itemo.question.id, itemo)}><Tooltip onClick={() => this.Ewoption(itemo.question.id, itemo)}><Tooltip
title="新增" placement={"bottom"}><i title="新增" placement={"bottom"}><i
className="color-green font-18 iconfont icon-roundaddfill"></i></Tooltip></a> className="color-green font-18 iconfont icon-roundaddfill"></i></Tooltip></a>
: itemo.question.answers.length - 1 === indext ? : itemo.question.answers.length - 1 === indext ?
<a className="lineh-40 ml10" <a className="lineh-40"
onClick={() => this.Ewoption(itemo.question.id, itemo)}><Tooltip onClick={() => this.Ewoption(itemo.question.id, itemo)}><Tooltip
title="新增" placement={"bottom"}><i title="新增" placement={"bottom"}><i
className="color-green font-18 iconfont icon-roundaddfill"></i></Tooltip></a> className="color-green font-18 iconfont icon-roundaddfill"></i></Tooltip></a>
@ -3492,7 +3493,7 @@ class PollNewQuestbank extends Component {
} }
</span> </span>
: indext === 1 && itemo.question.answers.length === 2 || indext === 1 && itemo.question.answers.length === 3 ? : indext === 1 && itemo.question.answers.length === 2 || indext === 1 && itemo.question.answers.length === 3 ?
<a className="lineh-40 ml10" <a className="lineh-40 "
onClick={() => this.Ewoption(itemo.question.id, itemo)}><Tooltip onClick={() => this.Ewoption(itemo.question.id, itemo)}><Tooltip
title="新增" placement={"bottom"}><i title="新增" placement={"bottom"}><i
className="color-green font-18 iconfont icon-roundaddfill"></i></Tooltip></a> : "" className="color-green font-18 iconfont icon-roundaddfill"></i></Tooltip></a> : ""
@ -3541,7 +3542,7 @@ class PollNewQuestbank extends Component {
<span <span
className="color-grey-6 mr20 font-16 lineh-40 fl">可选</span> className="color-grey-6 mr20 font-16 lineh-40 fl">可选</span>
<div className="mr40 flex1 "> <div className="mr40 flex1 ">
{/*可选最小*/} {/*可选最小2*/}
<style> <style>
{ {
` `
@ -3571,7 +3572,7 @@ class PollNewQuestbank extends Component {
</Select> </Select>
<span <span
className="ml10 mr10 color-grey-6 lineh-40 fl">~</span> className="ml10 mr10 color-grey-6 lineh-40 fl">~</span>
{/*可选最大*/} {/*可选最大2*/}
<Select className="fl w100" <Select className="fl w100"
onChange={(value) => this.HandleGradationGroupChangeee(value, indexo, itemo.question.min_choices,itemo.question.answers.length)} onChange={(value) => this.HandleGradationGroupChangeee(value, indexo, itemo.question.min_choices,itemo.question.answers.length)}
value={itemo.question.max_choices === null || itemo.question.max_choices === undefined ||itemo.question.max_choices === "null"|| itemo.question.max_choices === 0 || itemo.question.max_choices === "0"?"0": itemo.question.max_choices} value={itemo.question.max_choices === null || itemo.question.max_choices === undefined ||itemo.question.max_choices === "null"|| itemo.question.max_choices === 0 || itemo.question.max_choices === "0"?"0": itemo.question.max_choices}
@ -3790,14 +3791,14 @@ class PollNewQuestbank extends Component {
className="iconfont icon-htmal5icon19 font-22 color-grey-c "></i></Tooltip></a> className="iconfont icon-htmal5icon19 font-22 color-grey-c "></i></Tooltip></a>
{ {
itemo.question.answers[itemo.question.answers.length - 1].answer_text === "其他" && itemo.question.answers.length - 2 === indext ? itemo.question.answers[itemo.question.answers.length - 1].answer_text === "其他" && itemo.question.answers.length - 2 === indext ?
<a className="lineh-40 ml10" <a className="lineh-40"
onClick={() => this.Ewoption(itemo.question.id, itemo)}><Tooltip onClick={() => this.Ewoption(itemo.question.id, itemo)}><Tooltip
title="新增" title="新增"
placement={"bottom"}><i placement={"bottom"}><i
className="color-green font-18 iconfont icon-roundaddfill"></i></Tooltip></a> className="color-green font-18 iconfont icon-roundaddfill"></i></Tooltip></a>
: :
itemo.question.answers.length - 1 === indext ? itemo.question.answers.length - 1 === indext ?
<a className="lineh-40 ml10" <a className="lineh-40"
onClick={() => this.Ewoption(itemo.question.id, itemo)}><Tooltip onClick={() => this.Ewoption(itemo.question.id, itemo)}><Tooltip
title="新增" title="新增"
placement={"bottom"}><i placement={"bottom"}><i
@ -3809,7 +3810,7 @@ class PollNewQuestbank extends Component {
} }
</span> </span>
: indext === 1 && itemo.question.answers.length === 2 || indext === 1 && itemo.question.answers.length === 3 ? : indext === 1 && itemo.question.answers.length === 2 || indext === 1 && itemo.question.answers.length === 3 ?
<a className="lineh-40 ml10" <a className="lineh-40"
onClick={() => this.Ewoption(itemo.question.id, itemo)}><Tooltip onClick={() => this.Ewoption(itemo.question.id, itemo)}><Tooltip
title="新增" title="新增"
placement={"bottom"}><i placement={"bottom"}><i
@ -3860,7 +3861,7 @@ class PollNewQuestbank extends Component {
<span <span
className="color-grey-6 mr20 font-16 lineh-40 fl">可选</span> className="color-grey-6 mr20 font-16 lineh-40 fl">可选</span>
<div className="mr40 flex1 "> <div className="mr40 flex1 ">
{/*可选最小*/} {/*可选最小3*/}
<style> <style>
{ {
` `
@ -3879,7 +3880,6 @@ class PollNewQuestbank extends Component {
<Select className="fl w100" <Select className="fl w100"
onChange={(value) => this.HandleGradationGroupChangee(value, indexo, itemo.question.max_choices, itemo.question.answers.length)} onChange={(value) => this.HandleGradationGroupChangee(value, indexo, itemo.question.max_choices, itemo.question.answers.length)}
value={itemo.question.min_choices === null || itemo.question.min_choices === undefined ||itemo.question.min_choices === "null"|| itemo.question.min_choices === 0 || itemo.question.min_choices === "0"?"0": itemo.question.min_choices} value={itemo.question.min_choices === null || itemo.question.min_choices === undefined ||itemo.question.min_choices === "null"|| itemo.question.min_choices === 0 || itemo.question.min_choices === "0"?"0": itemo.question.min_choices}
> >
<Option value={String("0")}>--</Option> <Option value={String("0")}>--</Option>
{itemo.question.answers === undefined ? "" : itemo.question.answers.map((itemt, indext) => { {itemo.question.answers === undefined ? "" : itemo.question.answers.map((itemt, indext) => {
@ -3891,7 +3891,7 @@ class PollNewQuestbank extends Component {
</Select> </Select>
<span <span
className="ml10 mr10 color-grey-6 lineh-40 fl">~</span> className="ml10 mr10 color-grey-6 lineh-40 fl">~</span>
{/*可选最大*/} {/*可选最大3*/}
<Select className="fl w100" <Select className="fl w100"
onChange={(value) => this.HandleGradationGroupChangeee(value, indexo, itemo.question.min_choices,itemo.question.answers.length)} onChange={(value) => this.HandleGradationGroupChangeee(value, indexo, itemo.question.min_choices,itemo.question.answers.length)}
value={itemo.question.max_choices === null || itemo.question.max_choices === undefined ||itemo.question.max_choices === "null"|| itemo.question.max_choices === 0 || itemo.question.max_choices === "0"?"0": itemo.question.max_choices} value={itemo.question.max_choices === null || itemo.question.max_choices === undefined ||itemo.question.max_choices === "null"|| itemo.question.max_choices === 0 || itemo.question.max_choices === "0"?"0": itemo.question.max_choices}

@ -1,5 +1,5 @@
import React, {Component} from "react"; import React, {Component} from "react";
import { WordsBtn,on, off, trigger,markdownToHTML,getImageUrl} from 'educoder'; import { WordsBtn,on, off, trigger,MarkdownToHtml,getImageUrl} from 'educoder';
import { import {
Button, Button,
Checkbox, Checkbox,
@ -30,7 +30,7 @@ class Generaljobanswer extends Component {
console.log("componentDidMount"); console.log("componentDidMount");
// let query = this.props.location.pathname; // let query = this.props.location.pathname;
// const type = query.split('/'); // const type = query.split('/');
// this.setState({ // this.setState({n
// shixuntypes:type[3] // shixuntypes:type[3]
// }) // })
// this.props.triggerRef(this); // this.props.triggerRef(this);
@ -70,7 +70,9 @@ class Generaljobanswer extends Component {
datas.reference_answer===""? datas.reference_answer===""?
<NoneData></NoneData> <NoneData></NoneData>
: :
<div id="MakedownHTML"className="markdown-body yslquesHeigth yslquesmarkdowntext" dangerouslySetInnerHTML={{__html: markdownToHTML(datas.reference_answer).replace(/▁/g, "▁▁▁")}}/> <MarkdownToHtml content={datas.reference_answer} selector="work_content" className="mb10"></MarkdownToHtml>
// <div id="MakedownHTML"className="markdown-body yslquesHeigth yslquesmarkdowntext" dangerouslySetInnerHTML={{__html: markdownToHTML(datas.reference_answer).replace(/▁/g, "▁▁▁")}}/>
) )
} }
{/*<div id="MakedownHTML"className="markdown-body yslquesHeigth yslquesmarkdowntext" dangerouslySetInnerHTML={{__html: markdownToHTML(datas&&(datas.reference_answer===null?"无":datas.reference_answer==="null"?"无":datas.reference_answer)).replace(/▁/g, "▁▁▁")}}/>*/} {/*<div id="MakedownHTML"className="markdown-body yslquesHeigth yslquesmarkdowntext" dangerouslySetInnerHTML={{__html: markdownToHTML(datas&&(datas.reference_answer===null?"无":datas.reference_answer==="null"?"无":datas.reference_answer)).replace(/▁/g, "▁▁▁")}}/>*/}

@ -1,5 +1,5 @@
import React, {Component} from "react"; import React, {Component} from "react";
import { WordsBtn,on, off, trigger,markdownToHTML,getImageUrl} from 'educoder'; import { WordsBtn,on, off, trigger,markdownToHTML, MarkdownToHtml ,getImageUrl} from 'educoder';
import { import {
Button, Button,
Checkbox, Checkbox,
@ -67,7 +67,8 @@ class Generaljobdetails extends Component {
<NoneData></NoneData> <NoneData></NoneData>
:datas&&datas.description===""? :datas&&datas.description===""?
<NoneData></NoneData>: <NoneData></NoneData>:
<div id="MakedownHTML"className="markdown-body yslquesHeigth yslquesmarkdowntext" dangerouslySetInnerHTML={{__html: markdownToHTML(datas.description).replace(/▁/g, "▁▁▁")}}/> <MarkdownToHtml content={datas.description} selector="work_content" className="mb10"></MarkdownToHtml>
// <div id="MakedownHTML "className="markdown-body yslquesHeigth yslquesmarkdowntext" dangerouslySetInnerHTML={{__html: markdownToHTML(datas.description).replace(/▁/g, "▁▁▁")}}/>
) )
} }
<div className="mt16px"> <div className="mt16px">

@ -26,4 +26,5 @@
} }
.mt16px{ .mt16px{
margin-top: 16px; margin-top: 16px;
padding-bottom: 30px;
} }

@ -2499,6 +2499,8 @@ class Listofworksstudentone extends Component {
// console.log(data); // console.log(data);
// console.log(datas); // console.log(datas);
// console.log(this.props.isAdmin()); // console.log(this.props.isAdmin());
console.log("学生老师列表");
return ( return (
this.props.isAdmin() === true ? this.props.isAdmin() === true ?
( (

@ -1,7 +1,7 @@
import React,{ Component } from "react"; import React,{ Component } from "react";
import { Input,Checkbox,Table, Pagination, Modal,Menu, Tooltip,Spin } from "antd"; import { Input,Checkbox,Table, Pagination, Modal,Menu, Tooltip,Spin } from "antd";
import { WordsBtn,on, off, trigger } from 'educoder'; import { WordsBtn,on, off, trigger } from 'educoder';
import CourseLayoutcomponent from '../common/CourseLayoutComponent'; import {BrowserRouter as Router,Route,Switch,Link} from 'react-router-dom';
import axios from'axios'; import axios from'axios';
import HomeworkModal from "../coursesPublic/HomeworkModal"; import HomeworkModal from "../coursesPublic/HomeworkModal";
import ShixunModal from "../coursesPublic/ShixunModal"; import ShixunModal from "../coursesPublic/ShixunModal";
@ -936,6 +936,7 @@ class ShixunHomework extends Component{
let main_id=this.props.match.params.main_id; let main_id=this.props.match.params.main_id;
let category_id=this.props.match.params.category_id; let category_id=this.props.match.params.category_id;
return( return(
<React.Fragment > <React.Fragment >
<div> <div>
@ -1036,6 +1037,13 @@ class ShixunHomework extends Component{
{/*<span className="font-18 fl color-dark-21">{datas&&datas.category_name===undefined||datas&&datas.category_name===null?datas&&datas.main_category_name:datas&&datas.category_name+" 作业列表"}</span>*/} {/*<span className="font-18 fl color-dark-21">{datas&&datas.category_name===undefined||datas&&datas.category_name===null?datas&&datas.main_category_name:datas&&datas.category_name+" 作业列表"}</span>*/}
<span className="font-18 fl color-dark-21">实训作业</span> <span className="font-18 fl color-dark-21">实训作业</span>
<li className="fr"> <li className="fr">
{this.props.isAdmin()===true?datas&&datas.category_name===undefined||datas&&datas.category_name===null?
<span>
<WordsBtn style="blue" className={"mr30 font-16"}>
<Link className="color4CACFF" to={`/courses/${this.props.match.params.coursesId}/ordering/shixun_homework/${main_id&&main_id}`}>调整排序</Link>
</WordsBtn>
</span>:"":""}
{this.props.isAdmin()===true?datas&&datas.category_name===undefined||datas&&datas.category_name===null? {this.props.isAdmin()===true?datas&&datas.category_name===undefined||datas&&datas.category_name===null?
<span> <span>
<WordsBtn style="blue" onClick={()=>this.addDir()} className={"mr30 font-16"}>添加目录</WordsBtn> <WordsBtn style="blue" onClick={()=>this.addDir()} className={"mr30 font-16"}>添加目录</WordsBtn>

@ -553,7 +553,7 @@ class MemoNew extends Component {
return attachments; return attachments;
} }
handleChange = (info) => { handleChange = (info) => {
if (info.file.status === 'uploading' || info.file.status === 'done') { if (info.file.status === 'uploading' || info.file.status === 'done' || info.file.status === 'removed') {
let fileList = info.fileList; let fileList = info.fileList;
this.setState({ this.setState({
fileList: appendFileSizeToUploadFileAll(fileList) fileList: appendFileSizeToUploadFileAll(fileList)
@ -561,7 +561,7 @@ class MemoNew extends Component {
} }
} }
onAttachmentRemove = (file) => { onAttachmentRemove = (file) => {
if(file.response!=undefined){ if(!file.percent || file.percent == 100){
this.props.confirm({ this.props.confirm({
// title: '确定要删除这个附件吗?', // title: '确定要删除这个附件吗?',
content: '是否确认删除?', content: '是否确认删除?',

@ -47,7 +47,7 @@ class CaseNew extends Component{
// 上传附件-删除确认框 // 上传附件-删除确认框
onAttachmentRemove = (file, stateName) => { onAttachmentRemove = (file, stateName) => {
if(file.response!=undefined){ if(!file.percent || file.percent == 100){
this.props.confirm({ this.props.confirm({
content: '是否确认删除?', content: '是否确认删除?',
onOk: () => { onOk: () => {
@ -92,7 +92,7 @@ class CaseNew extends Component{
} }
// 上传附件-change // 上传附件-change
handleContentUploadChange = (info) => { handleContentUploadChange = (info) => {
if (info.file.status === 'done' || info.file.status === 'uploading') { if (info.file.status === 'done' || info.file.status === 'uploading' || info.file.status === 'removed') {
let contentFileList = info.fileList; let contentFileList = info.fileList;
this.setState({ contentFileList: appendFileSizeToUploadFileAll(contentFileList)}); this.setState({ contentFileList: appendFileSizeToUploadFileAll(contentFileList)});
let list = appendFileSizeToUploadFileAll(contentFileList); let list = appendFileSizeToUploadFileAll(contentFileList);

@ -30,8 +30,6 @@ class Topic_bank extends Component {
<div className="newMain clearfix"> <div className="newMain clearfix">
<Switch> <Switch>
{/*众包首页*/}
<Route path="/topicbank/:username/:topicstype" <Route path="/topicbank/:username/:topicstype"
render={ render={
(props) => (<PackageIndex {...this.props} {...props} {...this.state} />) (props) => (<PackageIndex {...this.props} {...props} {...this.state} />)

@ -1384,7 +1384,7 @@ export default class TPMsettings extends Component {
} }
onAttachmentRemove = (file) => { onAttachmentRemove = (file) => {
if(file.response!=undefined){ if(!file.percent || file.percent == 100){
confirm({ confirm({
title: '确定要删除这个附件吗?', title: '确定要删除这个附件吗?',
okText: '确定', okText: '确定',

@ -772,7 +772,7 @@ class Newshixuns extends Component {
} }
onAttachmentRemove = (file) => { onAttachmentRemove = (file) => {
if(file.response!=undefined){ if(!file.percent || file.percent == 100){
confirm({ confirm({
title: '确定要删除这个附件吗?', title: '确定要删除这个附件吗?',
okText: '确定', okText: '确定',

@ -118,7 +118,7 @@ class InfosBanner extends Component{
to={`/users/${username}/videos`}>视频</Link> to={`/users/${username}/videos`}>视频</Link>
</li>} </li>}
自己的主页且不是学生显示题库按钮 {/*自己的主页且不是学生显示题库按钮*/}
{ user_id===targetuserid&&user_type!="学生"?<li className={`${moduleName == 'topics' ? 'active' : '' }`}> { user_id===targetuserid&&user_type!="学生"?<li className={`${moduleName == 'topics' ? 'active' : '' }`}>
<Link <Link
onClick={() => this.setState({moduleName: 'topics'})} onClick={() => this.setState({moduleName: 'topics'})}

@ -79,7 +79,8 @@ class InfosTopics extends Component{
} }
}).then((response) => { }).then((response) => {
this.setState({ this.setState({
data:response.data data:response.data,
checkBoxValues:[]
}) })
}).catch((error) => { }).catch((error) => {
@ -90,12 +91,13 @@ class InfosTopics extends Component{
searchCategory=(type)=>{ searchCategory=(type)=>{
this.setState({ this.setState({
category:type category:type,
course_list_id:undefined,
}) })
let types=this.props.match.params.topicstype; let types=this.props.match.params.topicstype;
let { category,course_list_id,sort_by,sort_direction,page}=this.state; let { category,course_list_id,sort_by,sort_direction,page}=this.state;
this.searchAlldata(types,type,course_list_id,sort_by,sort_direction,page) this.searchAlldata(types,type,undefined,sort_by,sort_direction,page)
} }
searchCourselistid=(id)=>{ searchCourselistid=(id)=>{
@ -333,15 +335,28 @@ class InfosTopics extends Component{
{ {
` `
::-webkit-scrollbar-thumb {
background-color: #cde5fe;
box-shadow: 0px 0px black;
}
::-webkit-scrollbar-track {
-webkit-box-shadow: inset 0 0 6px rgba(0, 0, 0, 0);
background-color: #fff;
}
.shaiContent li.shaiItem { .shaiContent li.shaiItem {
padding: 3px 15px; padding: 0px 15px;
float: left; float: left;
border-radius: 4px; border-radius: 4px;
color: #4C4C4C; color: #4C4C4C;
cursor: pointer; cursor: pointer;
margin-right: 20px; margin-right: 20px;
display: block; display: block;
margin-bottom: 5px; margin-bottom: 0px;
color: #666;
} }
.mr38{ .mr38{
@ -371,7 +386,7 @@ class InfosTopics extends Component{
<div className="clearfix topicsbox"> <div className="clearfix topicsbox">
{types==="publicly"?<div className={"topcschild"}> {types==="publicly"?<div className={"topcschild"}>
<a className={types==="personal"?"topicstopfont fr topcsactive":"topicstopfont fr"} <a className={types==="personal"?"topicstopfont fr topcsactive":"topicstopfont fr"}
href={`/users/${username}/topics/personal`}>个人题库</a> href={`/users/${username}/topics/personal`}>我的题库</a>
<a className={types==="publicly"?"topicstopfont fl topcsactive":"topicstopfont fl"} <a className={types==="publicly"?"topicstopfont fl topcsactive":"topicstopfont fl"}
>公共题库</a> >公共题库</a>
</div>:<div className={"topcschild"}> </div>:<div className={"topcschild"}>
@ -394,9 +409,9 @@ class InfosTopics extends Component{
</div> </div>
<div className={"shaiContent"}> <div className={data===undefined?"":data.course_list===undefined||data.course_list.length===0?"shaiContent mb45":"shaiContent"}>
<div className="fl pr topicsItem pagetype mb20"> <li className={course_list_id===undefined?"shaiItem shixun_repertoire active fl":"shaiItem shixun_repertoire fl"} onClick={()=>this.searchCourselistid(undefined)}>全部</li>
<li className={course_list_id===undefined?"shaiItem shixun_repertoire active":"shaiItem shixun_repertoire"} onClick={()=>this.searchCourselistid(undefined)}>全部</li> <div className="fl pr topicsItem mb20">
{data===undefined?"":data.course_list===undefined||data.course_list.length===0?"":data.course_list.map((item,key)=>{ {data===undefined?"":data.course_list===undefined||data.course_list.length===0?"":data.course_list.map((item,key)=>{
return( return(
<li key={key} className={course_list_id===item.id?"shaiItem shixun_repertoire active":"shaiItem shixun_repertoire"} onClick={()=>this.searchCourselistid(item.id)}>{item.name}</li> <li key={key} className={course_list_id===item.id?"shaiItem shixun_repertoire active":"shaiItem shixun_repertoire"} onClick={()=>this.searchCourselistid(item.id)}>{item.name}</li>
@ -471,32 +486,36 @@ class InfosTopics extends Component{
{item.is_public===true?<span className="edu-filter-btn ml15 fl typestyle mt3 topiscfilterbtn">公开</span>:""} {item.is_public===true?<span className="edu-filter-btn ml15 fl typestyle mt3 topiscfilterbtn">公开</span>:""}
{types==="personal"&&item.is_public===false?user_id===targetuserid&&user_type!="学生"?<a className="btn colorblue mr25 fr font-16" onClick={()=>this.openTopics(item.id)}>设为公开</a>:"":""}
<div className="cl"></div> <div className="cl"></div>
<p className="color-grey panel-lightgrey mt16 fl"> <p className="color-grey panel-lightgrey mt16 fl">
<span className={types==="personal"?"topicswidth300":"topicswidth400"}> <span className={"topicswidth600"}>
{types==="publicly"?<span className="topsics100 color-grey9">{item.creator_name}</span>:""} {types==="publicly"?<span className="topsics135 color-grey9 mr50">{item.creator_name}</span>:""}
<span className="mr50 color-grey9">{item.quotes_count} 次引用</span> <span className="mr50 color-grey9">{item.quotes_count} 次引用</span>
<span className="mr50 color-grey9">{item.solve_count} 次答题</span> <span className="mr50 color-grey9">{item.solve_count} 次答题</span>
<span className="mr50 color-grey9">{moment(item.updated_at).fromNow()}</span> <span className="mr50 color-grey9">{moment(item.updated_at).fromNow()}</span>
</span> </span>
<span className="topicsbtn">{item.course_list_name}</span> {item.course_list_name===null?"":<span className={"topsicrelative topsicinline"} title={item.course_list_name}>
<div className={types==="personal"?"topicsbtn topsicsmax550":"topsicsmax550 topicsbtn"}>{item.course_list_name}</div>
</span>}
</p> </p>
<div className="homepagePostSetting homepagePostSettingname topscisright"> <div className="homepagePostSetting homepagePostSettingname topscisright">
{types==="personal"?user_id===targetuserid&&user_type!="学生"? {types==="personal"?user_id===targetuserid&&user_type!="学生"?
<a className="btn colorblue mr25 font-16 fr" <a className="btn colorblue mr25 font-16 fr"
href={category==="normal"?`/banks/normal/${item.id}/edit`: href={category==="normal"?`/banks/normal/${item.id}/edit`:
category==="group"?`/banks/group/${item.id}/edit`: category==="group"?`/banks/group/${item.id}/edit`:
category==="poll"?`/banks/poll/${item.id}/edit`: category==="poll"?`/banks/poll/${item.id}/edit`:
category==="exercise"?`/banks/exercise/${item.id}/edit`: category==="exercise"?`/banks/exercise/${item.id}/edit`:
category==="gtask"?`/banks/gtask/${item.id}/edit`: category==="gtask"?`/banks/gtask/${item.id}/edit`:
category==="gtopic"?`/banks/gtopic/${item.id}/edit`:"" category==="gtopic"?`/banks/gtopic/${item.id}/edit`:""
} }
>编辑</a> >编辑</a>
:"":""} :"":""}
{types==="personal"&&item.is_public===false?user_id===targetuserid&&user_type!="学生"?<a className="btn colorblue mr25 fr font-16" onClick={()=>this.openTopics(item.id)}>设为公开</a>:"":""}
</div> </div>
</div> </div>
</div> </div>

@ -93,7 +93,7 @@ class BanksIndex extends Component{
{ {
crumbData && crumbData &&
<Breadcrumb separator=">" className="breadcrumb mt22"> <Breadcrumb separator=">" className="breadcrumb mt22">
<Breadcrumb.Item href="/users/innov/topics/personal">题库</Breadcrumb.Item> <Breadcrumb.Item href="/users/innov/topics/personal">{ crumbData && crumbData.is_public == true ? '公共' : '我的' }题库</Breadcrumb.Item>
{ {
crumbData.crumbArray && crumbData.crumbArray.map((item,key)=>{ crumbData.crumbArray && crumbData.crumbArray.map((item,key)=>{
return( return(
@ -107,7 +107,11 @@ class BanksIndex extends Component{
{ {
crumbData &&<p className="clearfix mt10 mb10 "> crumbData &&<p className="clearfix mt10 mb10 ">
<span className="fl font-24 color-grey-3 task-hide lineh-30" style={{maxWidth:'800px'}}>{crumbData && crumbData.title}</span> <span className="fl font-24 color-grey-3 task-hide lineh-30" style={{maxWidth:'800px'}}>{crumbData && crumbData.title}</span>
<span className="bank_is_public">{crumbData.is_public == true ? '公开':'私有'}</span> { crumbData.is_public == true ?
<span className="bank_is_public">公开</span>
:
<span className="bank_is_private">私有</span>
}
</p> } </p> }
@ -145,6 +149,13 @@ class BanksIndex extends Component{
/>) />)
} }
}></Route> }></Route>
<Route path='/banks/exercise/:Id'
render={
(props) => {
return (<BanksTabIndex {...this.props} {...props} {...this.state} {...common}
/>)
}
}></Route>
<Route path='/banks/gtopic/:bankId/edit' <Route path='/banks/gtopic/:bankId/edit'
render={ render={

@ -17,6 +17,11 @@ const PollBanks = Loadable({
loader: () => import('./PollBanksContent'), loader: () => import('./PollBanksContent'),
loading: Loading, loading: Loading,
}) })
// 试卷详情
const ExerciseBanksDetail = Loadable({
loader: () => import('./ExerciseBanksDetail'),
loading: Loading,
});
class BanksTabIndex extends Component{ class BanksTabIndex extends Component{
constructor(props){ constructor(props){
@ -53,7 +58,13 @@ class BanksTabIndex extends Component{
></BanksMenu> ></BanksMenu>
} }
<Switch {...this.props}> <Switch {...this.props}>
<Route path='/banks/exercise/:Id'
render={
(props) => {
return (<ExerciseBanksDetail {...this.props} {...props} {...this.state} {...common}
/>)
}
}></Route>
<Route path='/banks/gtopic/:bankId' <Route path='/banks/gtopic/:bankId'
render={ render={

@ -0,0 +1,54 @@
import React, { Component } from 'react';
import axios from 'axios'
import ExerciseDisplay from '../../../courses/exercise/ExerciseDisplay'
class ExerciseBanksDetail extends Component{
constructor(props){
super(props);
this.state={
}
}
componentDidMount = () =>{
}
detailFetchCallback = (result) => {
let Id=this.props.match.params.Id;
const crumbData={
title: result.data.exercise && result.data.exercise.name,
is_public: result.data.exercise && result.data.exercise.is_public,
crumbArray:[
{content:'详情'},
]
}
const menuData={
tab:'0',//tab选中的index
menuArray:[//tab以及tab路由
{to:`/banks/exercise/${Id}`,content:'内容详情'}
],
category:'exercise',//
tos: `/banks/exercise/${Id}/edit`,
id: Id,
}
this.props.initPublic(crumbData,menuData);
}
render(){
let { pollDetail } = this.state
return(
<div>
<ExerciseDisplay {...this.props} {...this.state}
urlPath = {'exercise_banks'}
detailFetchCallback={this.detailFetchCallback}
>
</ExerciseDisplay>
</div>
)
}
}
export default ExerciseBanksDetail

@ -126,7 +126,7 @@ class BanksMenu extends Component{
<span className="fr mt18"> <span className="fr mt18">
<WordsBtn onClick={()=>this.deletecheckBoxValues(banksMenu&&banksMenu.id,banksMenu&&banksMenu.category)}style="blue" className="ml20 font-16">删除</WordsBtn> <WordsBtn onClick={()=>this.deletecheckBoxValues(banksMenu&&banksMenu.id,banksMenu&&banksMenu.category)}style="blue" className="ml20 font-16">删除</WordsBtn>
<WordsBtn to={banksMenu&&banksMenu.category==='poll'?banksMenu.tos:""} style="blue" className="ml20 font-16">编辑</WordsBtn> <WordsBtn to={ banksMenu.tos ? banksMenu.tos:""} style="blue" className="ml20 font-16">编辑</WordsBtn>
<WordsBtn onClick={()=>this.sendTopics()} style="blue" className="ml20 font-16">发送</WordsBtn> <WordsBtn onClick={()=>this.sendTopics()} style="blue" className="ml20 font-16">发送</WordsBtn>
</span> </span>
</div> </div>

@ -241,14 +241,28 @@
cursor: default; cursor: default;
} }
.bank_is_public{ .bank_is_public{
background: #E4F2FE; background: #84B6EB;
float: left; float: left;
height: 30px; height: 24px;
line-height: 30px; line-height: 24px;
padding:0px 20px;
color: #fff;
font-size: 16px;
margin-left: 10px;
border-radius:20px;
margin-top:3px;
}
.bank_is_private{
background: #56B998;
float: left;
height: 24px;
line-height: 24px;
padding:0px 20px; padding:0px 20px;
color: #4CACFF; color: #fff;
font-size: 16px; font-size: 16px;
margin-left: 10px; margin-left: 10px;
border-radius:20px;
margin-top:3px;
} }
.topicsbox{ .topicsbox{
width: 1200px; width: 1200px;
@ -292,6 +306,7 @@
font-weight: 400; font-weight: 400;
cursor: pointer; cursor: pointer;
line-height: 55px; line-height: 55px;
color: #666;
} }
.alltopisc{ .alltopisc{
@ -333,8 +348,8 @@
opacity: 1; opacity: 1;
border-radius: 2px; border-radius: 2px;
} }
.topicswidth400{ .topicswidth600{
width: 400px; mac-width: 600px;
display: inline-block; display: inline-block;
} }
.topicswidth300{ .topicswidth300{
@ -351,13 +366,13 @@
.topscisright{ .topscisright{
right: 0px; right: 0px;
top: 50px; top: 64px;
display: block; display: block;
position: absolute; position: absolute;
} }
.topsics100{ .topsics135{
width: 100px; max-width: 135px;
display: inline-block; display: inline-block;
} }
@ -380,4 +395,31 @@
font-weight: 400; font-weight: 400;
color: rgba(51,51,51,1); color: rgba(51,51,51,1);
line-height: 35px; line-height: 35px;
}
.topicsItem{
max-width: 1050px;
max-height: 115px;
overflow-y: auto;
}
.mb45{
margin-bottom: 45px!important;
}
.topsicsmax550{
max-width: 550px;
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
position: absolute;
top: -16px;
}
.topsicrelative{
position: relative;
}
.topsicinline{
display: inline-block;
} }

@ -3761,8 +3761,3 @@ a.singlepublishtwo{
/*width: auto !important;*/ /*width: auto !important;*/
/*max-width: 600px !important;*/ /*max-width: 600px !important;*/
/*}*/ /*}*/
.topicsItem{
max-width: 1138px;
max-height: 110px;
overflow-y: auto;
}
Loading…
Cancel
Save