Merge branch 'topic_bank' of https://bdgit.educoder.net/Hjqreturn/educoder into topic_bank

topic_bank
caicai8 5 years ago
commit 309223d5b8

1
.gitignore vendored

@ -37,6 +37,7 @@
/public/react/node_modules/
/public/react/config/stats.json
/public/react/stats.json
/public/react/.idea/*
/public/npm-debug.log

@ -303,7 +303,7 @@ class CoursesController < ApplicationController
def destroy
if @course.is_delete == 0
@course.delete!
Tiding.create!(user_id: @course.tea_id, trigger_user_id: 1, container_id: @course.id,
Tiding.create!(user_id: @course.tea_id, trigger_user_id: 0, container_id: @course.id,
container_type: 'Course', tiding_type: 'Delete', extra: @course.name)
normal_status(0, "成功")
else

@ -82,7 +82,9 @@ class HomeworkCommonsController < ApplicationController
end
@task_count = @homework_commons.size
@homework_commons = @homework_commons.order("position DESC").page(page).per(15)
order_str = @homework_type == 4 ? "position DESC" : "IF(ISNULL(homework_commons.publish_time),0,1), homework_commons.publish_time DESC,
homework_commons.created_at DESC"
@homework_commons = @homework_commons.order(order_str).page(page).per(15)
if @homework_type == 4
@homework_commons = @homework_commons.includes(:homework_detail_manual, :published_settings, :shixuns)

@ -55,7 +55,7 @@ class ProjectPackagesController < ApplicationController
package.destroy!
Tiding.create!(user_id: package.creator_id, trigger_user_id: 1, container_id: package.id,
Tiding.create!(user_id: package.creator_id, trigger_user_id: 0, container_id: package.id,
container_type: 'ProjectPackage', tiding_type: 'Destroyed', extra: package.title)
render_ok

@ -1,6 +1,6 @@
class Wechats::JsSdkSignaturesController < ApplicationController
def create
timestamp = (Time.now.to_f * 1000).to_i
timestamp = Time.now.to_i
noncestr = ('A'..'z').to_a.sample(8).join
signature = Util::Wechat.js_sdk_signature(params[:url], noncestr, timestamp)

@ -7,7 +7,8 @@ module Util::Wechat
attr_accessor :appid, :secret
def js_sdk_signature(url, noncestr, timestamp)
str = { jsapi_ticket: jsapi_ticket, noncestr: noncestr, timestamp: timestamp, url: url }.to_query
data = { jsapi_ticket: jsapi_ticket, noncestr: noncestr, timestamp: timestamp, url: url }
str = data.map { |k, v| "#{k}=#{v}" }.join('&')
Digest::SHA1.hexdigest(str)
end

@ -337,7 +337,7 @@ class Course < ApplicationRecord
#创建课程后,给该用户发送消息
def send_tiding
self.tidings << Tiding.new(user_id: tea_id, trigger_user_id: 1, belong_container_id: id,
self.tidings << Tiding.new(user_id: tea_id, trigger_user_id: 0, belong_container_id: id,
belong_container_type: 'Course', tiding_type: 'System')
end

@ -28,7 +28,7 @@ class CourseMessage < ApplicationRecord
def send_deal_tiding deal_status
# 发送申请处理结果消息
Tiding.create!(
user_id: course_message_id, trigger_user_id: 1, container_id: course_id, container_type: 'DealCourse',
user_id: course_message_id, trigger_user_id: 0, container_id: course_id, container_type: 'DealCourse',
belong_container: course, extra: content.to_i == 2 ? '9' : '7', tiding_type: 'System', status: deal_status
)
# 将申请消息置为已处理

@ -25,7 +25,7 @@ class Libraries::AgreeApplyService < ApplicationService
private
def notify_library_author!
Tiding.create!(user_id: library.user_id, trigger_user_id: 1,
Tiding.create!(user_id: library.user_id, trigger_user_id: 0,
container_id: library.id, container_type: 'Library',
tiding_type: 'System', status: 1)
end

@ -32,7 +32,7 @@ class Libraries::RefuseApplyService < ApplicationService
private
def notify_library_author!
Tiding.create!(user_id: library.user_id, trigger_user_id: 1,
Tiding.create!(user_id: library.user_id, trigger_user_id: 0,
container_id: library.id, container_type: 'Library',
tiding_type: 'System', status: 2, extra: library_apply.reason)
end

@ -29,7 +29,7 @@ class ProjectPackages::AgreeApplyService < ApplicationService
Tiding.where(container_id: package.id, container_type: 'ProjectPackage',
tiding_type: 'Apply', status: 0).update_all(status: 1)
Tiding.create!(user_id: package.creator_id, trigger_user_id: 1,
Tiding.create!(user_id: package.creator_id, trigger_user_id: 0,
container_id: package.id, container_type: 'ProjectPackage',
tiding_type: 'System', status: 1)
end

@ -16,7 +16,7 @@ class ProjectPackages::EndBiddingService < ApplicationService
private
def send_bidding_end_notify!
Tiding.create!(user_id: package.creator_id, trigger_user_id: 1,
Tiding.create!(user_id: package.creator_id, trigger_user_id: 0,
container_id: package.id, container_type: 'ProjectPackage', tiding_type: 'BiddingEnd')
end

@ -31,7 +31,7 @@ class ProjectPackages::RefuseApplyService < ApplicationService
Tiding.where(container_id: package.id, container_type: 'ProjectPackage',
tiding_type: 'Apply', status: 0).update_all(status: 1)
Tiding.create!(user_id: package.creator_id, trigger_user_id: 1,
Tiding.create!(user_id: package.creator_id, trigger_user_id: 0,
container_id: package.id, container_type: 'ProjectPackage',
tiding_type: 'System', status: 2, extra: apply.reason)
end

@ -71,7 +71,7 @@ class ProjectPackages::SaveService < ApplicationService
end
def send_create_notify!
Tiding.create!(user_id: package.creator_id, trigger_user_id: 1,
Tiding.create!(user_id: package.creator_id, trigger_user_id: 0,
container_id: package.id, container_type: 'ProjectPackage', tiding_type: 'Created')
end

@ -28,7 +28,7 @@ class Videos::AgreeApplyService < ApplicationService
private
def notify_video_author!
Tiding.create!(user_id: video.user_id, trigger_user_id: 1,
Tiding.create!(user_id: video.user_id, trigger_user_id: 0,
container_id: video.id, container_type: 'Video',
tiding_type: 'System', status: 1)
end

@ -31,7 +31,7 @@ class Videos::RefuseApplyService < ApplicationService
private
def notify_video_author!
Tiding.create!(user_id: video.user_id, trigger_user_id: 1,
Tiding.create!(user_id: video.user_id, trigger_user_id: 0,
container_id: video.id, container_type: 'Video',
tiding_type: 'System', status: 2, extra: video_apply.reason)
end

@ -83,6 +83,7 @@ a.edu-txt-w80,.edu-txt-w80{ width:80px; display: inline-block;text-align: center
.font-20{ font-size: 20px!important;}
.font-22{ font-size: 22px!important;}
.font-24{ font-size: 24px!important;}
.font-25{ font-size: 25px!important;}
.font-26{ font-size: 26px!important;}
.font-28{ font-size: 28px!important;}
.font-30{ font-size: 30px!important;}

@ -18,7 +18,7 @@ json.time tiding.how_long_time
json.new_tiding tiding.unread?(@onclick_time)
json.trigger_user do
if tiding.trigger_user_id.zero?
if tiding.trigger_user_id.zero? || (tiding.trigger_user_id == 1 && tiding.tiding_type == 'System')
json.id 0
json.name "系统"
json.login ""

@ -103,6 +103,7 @@ a:hover.link-color-grey03{color:#3498db!important;}
.font-18{ font-size: 18px!important;}
.font-20{ font-size: 20px!important;}
.font-22{ font-size: 22px!important;}
.font-25{ font-size: 25px!important;}
.font-24{ font-size: 24px!important;}
.font-28{ font-size: 28px!important;}
.font-30{ font-size: 30px!important;}

@ -103,6 +103,7 @@ a:hover.link-color-grey03{color:#3498db!important;}
.font-18{ font-size: 18px!important;}
.font-20{ font-size: 20px!important;}
.font-22{ font-size: 22px!important;}
.font-25{ font-size: 25px!important;}
.font-24{ font-size: 24px!important;}
.font-28{ font-size: 28px!important;}
.font-30{ font-size: 30px!important;}

@ -297,8 +297,9 @@ class App extends Component {
const wx = window.wx
const url = '/wechats/js_sdk_signature.json'
const currentUrl = window.location.href.split('#')[0]
// window.encodeURIComponent()
axios.post(url, {
url: currentUrl,
url: window.__testUrl || currentUrl,
}).then((response) => {
console.log('got res')
const data = response.data;
@ -306,7 +307,7 @@ class App extends Component {
debug: false,
appId: data.appid,
timestamp: data.timestamp,
nonceStr: data.nonceStr,
nonceStr: data.noncestr,
signature: data.signature,
jsApiList: [
'onMenuShareTimeline',//

@ -110,6 +110,19 @@ class NewWorkForm extends Component{
{/* min={has_commit ? init_max_num : (min_num == undefined ? 2 : min_num + 1) } */}
// 已有提交作品,人数范围只能扩大
const { has_commit, max_num, init_max_num, min_num, init_min_num } = this.state;
if (!min_num) {
this.props.showNotification('最小人数不能为空');
return;
} else if (min_num < 1) {
this.props.showNotification('最小人数不能小于1');
return;
} else if (!max_num) {
this.props.showNotification('最大人数不能为空');
return;
} else if (max_num < min_num) {
this.props.showNotification('最大人数不能小于最小人数');
return;
}
if (has_commit) {
if (max_num < init_max_num || min_num > init_min_num) {
this.props.showNotification(`已有提交作品,人数范围只能扩大(原设置为:${init_min_num} - ${init_max_num})`)
@ -237,9 +250,9 @@ class NewWorkForm extends Component{
}
max_num_change = (val) => {
if (val < 2) {
this.setState({
max_num: 2,
})
// this.setState({
// max_num: 2,
// })
return;
}
const { min_num } = this.state;
@ -248,12 +261,31 @@ class NewWorkForm extends Component{
min_num: val <= min_num ? val - 1 : min_num
})
}
personNumValidator = (rule, value, callback) => {
const { min_num, max_num } = this.state;
const form = this.props.form;
if (!min_num) {
callback('最小人数不能为空');
} else if (min_num < 1) {
callback('最小人数不能小于1');
} else if (!max_num) {
callback('最大人数不能为空');
} else if (max_num < min_num) {
callback('最大人数不能小于最小人数');
} else {
callback();
}
}
min_num_change = (val) => {
this.setState({ min_num: val })
}
base_on_project_change = () => {
this.setState({ base_on_project: !this.state.base_on_project })
}
componentDidMount() {
window.$('.groupSetting .ant-form-item-label > label').addClass('ant-form-item-required')
}
render(){
let {typeId,coursesId,pageType}=this.props.match.params;
const { getFieldDecorator } = this.props.form;
@ -411,11 +443,13 @@ class NewWorkForm extends Component{
{ isGroup &&
<Form.Item
label="分组设置"
className="AboutInputForm"
className="AboutInputForm groupSetting"
>
{getFieldDecorator('personNum', {
rules: [{
required: false
// required: true,
// message: '人数不能为空'
// validator: this.personNumValidator
// required: true, message: '请输入最小人数和最大人数'
}],
})(
@ -447,6 +481,7 @@ class NewWorkForm extends Component{
</p>
</div>
)}
</Form.Item>
}
<div className="edu-back-white">

@ -76,6 +76,7 @@ class commonWork extends Component{
}
componentDidUpdate(prevProps, prevState) {
if (prevProps.match.path != this.props.match.path) {
this.clearSelection()
this._getList()
}
}
@ -226,7 +227,7 @@ class commonWork extends Component{
}
clearSelection = () => {
this.setState({ checkBoxValues: [] })
this.setState({ checkBoxValues: [], checkAll: false })
}
//
onSetPublic = () => {

@ -67,11 +67,10 @@ class Groupjobbandetails extends Component {
<div className="yslquestionbank1">
{
datas&&(datas.description===null||datas.description==="null"||datas.description===""?
datas.description===null||datas.description==="null"||datas.description===""?
""
:
<MarkdownToHtml content={datas.description} selector="work_content" className="mb10 yslquesHeigth"></MarkdownToHtml>
)
}
<div className="mt24">
{datas.attachments === undefined || datas.attachments === null || datas.attachments === ""? "" :

@ -75,10 +75,10 @@ class Completetaskpage extends Component {
const menuData={
tab:'0',//tab选中的index
menuArray:[//tab以及tab路由
{to:`/banks/gtask/${workids}/${this.props.match.params.type}`,content:'内容详情'},
{to:`/banks/gtask/${workids}/${this.props.match.params.type}?tab=0`,content:'内容详情'},
],
category:'gtask',//毕设选题
tos:`/banks/gtask/${workids}/edit/${this.props.match.params.type}`,
tos:`/banks/gtask/${workids}/edit/${this.props.match.params.type}?tab=0`,
id:workids,
is_public:response && response.data && response.data.is_public,
type:this.props.match.params.type,

@ -70,10 +70,10 @@ class CompletetopicdePage extends Component {
const menuData={
tab:'0',//tab选中的index
menuArray:[//tab以及tab路由
{to:`/banks/gtopic/${workids}/${this.props.match.params.type}`,content:'内容详情'},
{to:`/banks/gtopic/${workids}/${this.props.match.params.type}?tab=0`,content:'内容详情'},
],
category:'gtopic',//毕设选题
tos:`/banks/gtopic/${workids}/edit/${this.props.match.params.type}`,
tos:`/banks/gtopic/${workids}/edit/${this.props.match.params.type}?tab=0`,
id:workids,
is_public:response && response.data && response.data.is_public,
type:this.props.match.params.type,

@ -64,7 +64,7 @@ class Completetopicdetails extends Component {
<div className="bor-bottom-greyE">
<div className="yslquestionbank1">
{
datas&&(datas.description===null?
datas.description===null?
""
:datas.description==="null"?
""
@ -73,25 +73,24 @@ class Completetopicdetails extends Component {
""
:
<MarkdownToHtml content={datas.description} selector="work_content" className="mb10 yslquesHeigth"></MarkdownToHtml>
)
}
{datas.attachment_list === undefined ?
(datas.description===undefined || datas.description===null?
(datas.description===undefined || datas.description===null||datas.description===""?
<NoneData></NoneData>
:
""
)
:
datas.attachment_list === null ?
(datas.description===undefined || datas.description===null?
(datas.description===undefined || datas.description===null||datas.description===""?
<NoneData></NoneData>
:
""
)
:
datas.attachment_list.length === 0 ?
(datas.description===undefined || datas.description===null?
(datas.description===undefined || datas.description===null||datas.description===""?
<NoneData></NoneData>
:
""

@ -67,17 +67,16 @@ class Groupjobbandetails extends Component {
<div className=" clearfix edu-back-white " ref='targetElementTrainingjobsetting' style={{margin: "auto", minWidth:"1200px"}}>
<div className="yslquestionbank1">
{
datas&&(datas.description===null?
<NoneData></NoneData>
:datas.description==="null"?
<NoneData></NoneData>
datas.description===null?
""
:datas.description==="null"?
""
:
datas.description===""?
<NoneData></NoneData>
""
:
<MarkdownToHtml content={datas.description} selector="work_content" className="mb10 yslquesHeigth"></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, "▁▁▁")}}/>*/}
{/*{datas.attachments === undefined ? "" : datas.attachments.map((item, key) => {*/}
@ -85,13 +84,38 @@ class Groupjobbandetails extends Component {
{/* <GroupPackage key={key} attachments={item}></GroupPackage>*/}
{/* )*/}
{/*})}*/}
{datas.attachments === undefined ?
(datas.description === undefined || datas.description === undefined || datas.description === "" ?
<NoneData></NoneData>
:
""
)
:
datas.attachments=== "" ?
(datas.description === undefined || datas.description === undefined || datas.description === "" ?
<NoneData></NoneData>
:
""
)
:
datas.attachments=== null ?
(datas.description === undefined || datas.description === undefined || datas.description === "" ?
<NoneData></NoneData>
:
""
)
:
datas.attachments.length === 0 ?
(datas.description === undefined || datas.description === undefined || datas.description === "" ?
<NoneData></NoneData>
:
""
)
:
<div className="mt24">
{datas.attachments === undefined ? "" :
<AttachmentsList {...this.state} {...this.props} attachments={datas.attachments} ></AttachmentsList>}
<AttachmentsList {...this.state} {...this.props} attachments={datas.attachments} ></AttachmentsList>
</div>
}
<GroupPackage2 datas={datas} bool={true}></GroupPackage2>
</div>

@ -79,11 +79,11 @@ class GroupjobbankPage extends Component {
const menuData={
tab:'0',//tab选中的index
menuArray:[//tab以及tab路由
{to:`/banks/group/${workids}/${this.props.match.params.type}/details`,content:'内容详情'},
{to:`/banks/group/${workids}/${this.props.match.params.type}/answer`,content:'参考答案'}
{to:`/banks/group/${workids}/${this.props.match.params.type}?tab=0`,content:'内容详情'},
{to:`/banks/group/${workids}/${this.props.match.params.type}/answer?tab=1`,content:'参考答案'}
],
category:'group',//毕设选题
tos:`/banks/group/${workids}/edit/${this.props.match.params.type}`,
tos:`/banks/group/${workids}/edit/${this.props.match.params.type}?tab=0`,
id:workids,
is_public:response && response.data && response.data.is_public,
type:this.props.match.params.type,

@ -64,7 +64,7 @@ class Groupjobquesanswer extends Component {
<div className=" clearfix edu-back-white " ref='targetElementTrainingjobsetting' style={{margin: "auto", minWidth:"1200px"}}>
<div className="yslquestionbank1">
{
datas&&(datas.reference_answer===null?
datas.reference_answer===null?
""
:datas.reference_answer==="null"?
"" :
@ -72,25 +72,31 @@ class Groupjobquesanswer extends Component {
""
:
<MarkdownToHtml content={datas.reference_answer} selector="work_content" className="mb10 yslquesHeigth"></MarkdownToHtml>
)
}
{datas.reference_attachments === undefined ?
(datas.reference_answer===undefined || datas.reference_answer===null?
(datas.reference_answer===undefined || datas.reference_answer===null|| datas.reference_answer===""?
<NoneData></NoneData>
:
""
)
:
datas.reference_attachments === "" ?
(datas.reference_answer===undefined || datas.reference_answer===null|| datas.reference_answer===""?
<NoneData></NoneData>
:
""
)
:
datas.reference_attachments === null ?
(datas.reference_answer===undefined || datas.reference_answer===null?
(datas.reference_answer===undefined || datas.reference_answer===null|| datas.reference_answer===""?
<NoneData></NoneData>
:
""
)
:
datas.reference_attachments.length === 0 ?
(datas.reference_answer===undefined || datas.reference_answer===null?
(datas.reference_answer===undefined || datas.reference_answer===null|| datas.reference_answer===""?
<NoneData></NoneData>
:
""

@ -1032,7 +1032,7 @@ class PollNew extends Component {
if(object.question.max_choices){
if(object.question.max_choices>0){
if (object.question.max_choices < object.question.min_choices) {
this.props.showNotification(`可选的最大限制不能小于最小限制`);
this.props.showNotification(`可选:最小和最大限制须同时为数值或者“--"`);
return;
}
}
@ -1252,7 +1252,7 @@ class PollNew extends Component {
if(object.question.max_choices){
if(object.question.max_choices>0){
if (object.question.max_choices < object.question.min_choices) {
this.props.showNotification(`可选的最大限制不能小于最小限制`);
this.props.showNotification(`可选:最小和最大限制须同时为数值或者“--"`);
return;
}
}
@ -1573,7 +1573,7 @@ class PollNew extends Component {
if(object.question.max_choices){
if(object.question.max_choices>0){
if (object.question.max_choices < object.question.min_choices) {
this.props.showNotification(`可选的最大限制不能小于最小限制`);
this.props.showNotification(`可选:最小和最大限制须同时为数值或者“--"`);
return;
}
}
@ -1784,7 +1784,7 @@ class PollNew extends Component {
if(object.question.max_choices){
if(object.question.max_choices>0){
if (object.question.max_choices < object.question.min_choices) {
this.props.showNotification(`可选的最大限制不能小于最小限制`);
this.props.showNotification(`可选:最小和最大限制须同时为数值或者“--"`);
return;
}
}

@ -3249,7 +3249,7 @@ class PollNewQuestbank extends Component {
// )
// ""
// :
itemo.question.answers.length > 2 &&indext>1?
itemo.question.answers.length > 2 &&indext>=1?
<span>
{
indext > 1 ?
@ -3482,6 +3482,7 @@ class PollNewQuestbank extends Component {
</div>
</div> : "")
:
// 编辑
<div className="bor-bottom-greyE problemShow" >
{resultDom}
{this.state.Newdisplay === false ?
@ -3525,8 +3526,8 @@ class PollNewQuestbank extends Component {
onInput={(e) => this.HandleInputTopic(e, indexo)}>{itemo.question.question_title}</TextArea>
}
{itemo.question.answers === undefined ? "" : itemo.question.answers.map((itemt, indext) => {
console.log("chishiyong1");
console.log(itemo.question.answers[itemo.question.answers.length - 1]);
// console.log("chishiyong1");
// console.log(itemo.question.answers[itemo.question.answers.length - 1]);
// var bools=true;
// if(){
//
@ -3576,7 +3577,7 @@ class PollNewQuestbank extends Component {
// title="新增" placement={"bottom"}><i
// className="color-green font-18 iconfont icon-roundaddfill"></i></Tooltip></a>
// :"")
itemo.question.answers.length > 2 && indext>1 ?
itemo.question.answers.length > 2 && indext>=1 ?
<span>
{
indext > 1 ?

@ -57,7 +57,10 @@ class Generaljobanswer extends Component {
render() {
let{datas}=this.props
let{datas}=this.props;
console.log("Generaljobanswer");
console.log(datas.reference_attachments);
console.log(datas.reference_answer);
return (
<div className=" clearfix edu-back-white " ref='targetElementTrainingjobsetting' style={{margin: "auto", minWidth:"1200px"}}>
<div className="yslquestionbank1">
@ -82,7 +85,7 @@ class Generaljobanswer extends Component {
{/*</div>*/}
{
datas&&(datas.reference_answer===null?
datas.reference_answer===null?
""
:datas.reference_answer==="null"?
"" :
@ -90,25 +93,32 @@ class Generaljobanswer extends Component {
""
:
<MarkdownToHtml content={datas.reference_answer} selector="work_content" className="mb10 yslquesHeigth "></MarkdownToHtml>
)
}
{datas.reference_attachments === undefined ?
(datas.reference_answer===undefined || datas.reference_answer===null?
(datas.reference_answer===undefined || datas.reference_answer===undefined|| datas.reference_answer===""?
<NoneData></NoneData>
:
""
)
:
datas.reference_attachments === "" ?
(datas.reference_answer===undefined || datas.reference_answer===undefined|| datas.reference_answer===""?
<NoneData></NoneData>
:
""
)
:
datas.reference_attachments === null ?
(datas.reference_answer===undefined || datas.reference_answer===null?
(datas.reference_answer===undefined || datas.reference_answer===undefined|| datas.reference_answer===""?
<NoneData></NoneData>
:
""
)
:
datas.reference_attachments.length === 0 ?
(datas.reference_answer===undefined || datas.reference_answer===null?
(datas.reference_answer===undefined || datas.reference_answer===undefined|| datas.reference_answer===""?
<NoneData></NoneData>
:
""

@ -79,11 +79,11 @@ class Generaljobbankdetails extends Component {
const menuData={
tab:'0',//tab选中的index
menuArray:[//tab以及tab路由
{to:`/banks/normal/${workids}/${this.props.match.params.type}/details`,content:'内容详情'},
{to:`/banks/normal/${workids}/${this.props.match.params.type}/answer`,content:'参考答案'}
{to:`/banks/normal/${workids}/${this.props.match.params.type}?tab=0`,content:'内容详情'},
{to:`/banks/normal/${workids}/${this.props.match.params.type}/answer?tab=1`,content:'参考答案'}
],
category:'normal',//毕设选题
tos:`/banks/normal/${workids}/edit/${this.props.match.params.type}`,
tos:`/banks/normal/${workids}/edit/${this.props.match.params.type}?tab=0`,
id:workids,
is_public:response && response.data && response.data.is_public,
type:this.props.match.params.type,

@ -62,20 +62,49 @@ class Generaljobdetails extends Component {
<div className=" clearfix edu-back-white " ref='targetElementTrainingjobsetting' style={{margin: "auto", minWidth:"1200px"}}>
<div className="yslquestionbank1">
{
datas&&(datas.description===null?
<NoneData></NoneData>
datas.description===null?
""
:datas.description==="null"?
<NoneData></NoneData>
""
:datas&&datas.description===""?
<NoneData></NoneData>:
""
:
<MarkdownToHtml content={datas.description} selector="work_content" className="mb10 yslquesHeigth"></MarkdownToHtml>
// <div id="MakedownHTML "className="markdown-body yslquesHeigth yslquesmarkdowntext" dangerouslySetInnerHTML={{__html: markdownToHTML(datas.description).replace(/▁/g, "▁▁▁")}}/>
}
{datas.attachments === undefined ?
(datas.description === undefined || datas.description === undefined || datas.description === "" ?
<NoneData></NoneData>
:
""
)
:
datas.attachments=== "" ?
(datas.description === undefined || datas.description === undefined || datas.description === "" ?
<NoneData></NoneData>
:
""
)
:
datas.attachments=== null ?
(datas.description === undefined || datas.description === undefined || datas.description === "" ?
<NoneData></NoneData>
:
""
)
:
datas.attachments.length === 0 ?
(datas.description === undefined || datas.description === undefined || datas.description === "" ?
<NoneData></NoneData>
:
""
)
:
<div className="mt16px">
<AttachmentsList {...this.state} {...this.props}
attachments={datas.attachments}></AttachmentsList>
</div>
}
<div className="mt16px">
{datas.attachments === undefined ? "" :
<AttachmentsList {...this.state} {...this.props} attachments={datas.attachments} ></AttachmentsList>}
</div>
</div>
</div>

@ -1,5 +1,5 @@
import React,{ Component } from "react";
import { Modal,Radio,Input,Tooltip,Checkbox,Select, Row,Col } from "antd";
import { Modal,Radio,Input,Tooltip,Checkbox,Select, Row,Col ,Spin} from "antd";
import axios from 'axios';
const { Search } = Input;
class SendTopics extends Component{
@ -9,7 +9,8 @@ class SendTopics extends Component{
courses:[],
search:null,
Radiolist:undefined,
showcheck:false
showcheck:false,
smallisSpin:false
}
}
@ -54,13 +55,17 @@ class SendTopics extends Component{
}
submitInfo=()=>{
this.setState({
smallisSpin:true
})
let{Radiolist}=this.state;
let url=`/question_banks/send_to_course.json`;
let object_id=this.props.checkBoxValues;
let object_type=this.props.category;
if(Radiolist===undefined){
this.setState({
showcheck:true
showcheck:true,
smallisSpin:false
})
}else{
axios.post(url,{
@ -69,6 +74,9 @@ class SendTopics extends Component{
course_id:Radiolist
}
).then((result)=>{
this.setState({
smallisSpin:false
})
if(result.data.status===0){
this.props.showNotification(result.data.message)
this.props.topicscancelmodel()
@ -78,12 +86,15 @@ class SendTopics extends Component{
}
}).catch((error)=>{
console.log(error)
this.setState({
smallisSpin:false
})
})
}
}
render(){
let{courses,Radiolist,showcheck}= this.state;
let{courses,Radiolist,showcheck,smallisSpin}= this.state;
const radioStyle = {
display: 'block',
@ -108,6 +119,7 @@ class SendTopics extends Component{
height:221px;
overflow-y: auto;
}
`
}
</style>
@ -151,9 +163,9 @@ class SendTopics extends Component{
</div>
{showcheck===true?<div className={"color-red mt10"}>请先选择课堂</div>:""}
<div className="mt20 clearfix edu-txt-center">
<a onClick={()=>this.props.topicscancelmodel()} className="pop_close task-btn mr30">取消</a>
<a className="task-btn task-btn-orange" onClick={()=>this.submitInfo()}>确定</a>
<div className="mt20 clearfix edu-txt-center" >
<a onClick={()=>this.props.topicscancelmodel()} className="pop_close task-btn mr30 ">取消</a>
<a className="task-btn task-btn-orange" onClick={()=>this.submitInfo()}>确定</a>
</div>
</div>
</Modal>

@ -70,11 +70,24 @@ class InfosTopics extends Component{
// }else{
//
// }
let user_id=this.props.match.params&&this.props.match.params.username;
this.setState({
isSpin:true
})
let types=this.props.match.params.topicstype;
let user_id="";
if(types==="publicly"){
user_id=this.props.current_user&&this.props.current_user.login;
}else{
user_id=this.props.match.params&&this.props.match.params.username;
}
if(user_id!=undefined){
console.log(user_id)
let {per_page}=this.state;
let url=`/users/${user_id}/question_banks.json`;
axios.get(url,{params:{
axios.get(encodeURI(url),{params:{
type,
object_type:category,
course_list_id,
@ -86,10 +99,13 @@ class InfosTopics extends Component{
}).then((response) => {
this.setState({
data:response.data,
checkBoxValues:[]
checkBoxValues:[],
isSpin:false
})
}).catch((error) => {
this.setState({
isSpin:false
})
});
}
}
@ -390,6 +406,14 @@ class InfosTopics extends Component{
.marright0{
margin-right: 0px !important;
}
.gongkais{
min-width: 50px;
height: 22px !important;
line-height: 22px !important;
color: #fff !important;
margin-top: 4px;
}
`
}
</style>
@ -398,14 +422,14 @@ class InfosTopics extends Component{
<div className="clearfix topicsbox">
{types==="publicly"?<div className={"topcschild"}>
<a className={types==="personal"?"topicstopfont fr ":"topicstopfont fr topcsactive"}
href={`/users/${username}/topics/personal`}>我的题库</a>
href={`/users/${this.props.current_user&&this.props.current_user.login}/topics/personal`}>我的题库</a>
<div className={types==="publicly"?"topicstopfont fl ":"topicstopfont fl topcsactive"}
>公共题库</div>
</div>:<div className={"topcschild"}>
<div className={types==="personal"?"topicstopfont fl ":"topicstopfont fl topcsactive"}
>我的题库</div>
<a className={types==="publicly"?"topicstopfont fr ":"topicstopfont fr topcsactive"}
href={`/topicbank/${username}/publicly`}
href={`/topicbank/${this.props.current_user&&this.props.current_user.login}/publicly`}
>公共题库</a>
</div>}
@ -449,7 +473,7 @@ class InfosTopics extends Component{
</div>
{isshowprofes===false?<div className="clearfix font-12 mt20">
{isshowprofes===false?data&&data.count===undefined?"":data&&data.count===0?"":<div className="clearfix font-12 mt20">
<p className="font-12 ml5 fl">
<span className="fl color-grey-9 mr20"> <span className={"color-orange"}>{data&&data.count===undefined?0:data&&data.count}</span> </span>
<span className="fr color-grey-9">已选择 <span className={"color-orange"}>{checkBoxValues.length}</span> ()</span>
@ -491,23 +515,23 @@ class InfosTopics extends Component{
<div className="clearfix">
<div className="item-body">
<div className="clearfix ds pr pt5 contentSection" >
<div className="clearfix ds pr pt10 contentSection" >
{user_type!="学生"?<Checkbox value={item.id} key={item.id} className={"fl mt5"}></Checkbox>:""}
<a title={item.name.length>55?item.name:""} className="ml10 fl mt3 font-16 color-dark maxwidth900" href={
category==="normal"?`/banks/normal/${item.id}/${types}/details`:
category==="group"?`/banks/group/${item.id}/${types}/details`:
category==="normal"?`/banks/normal/${item.id}/${types}?tab=0`:
category==="group"?`/banks/group/${item.id}/${types}?tab=0`:
category==="poll"?`/banks/poll/${item.id}/${types}`:
category==="exercise"?`/banks/exercise/${item.id}/${types}`:
category==="gtask"?`/banks/gtask/${item.id}/${types}`:
category==="gtopic"?`/banks/gtopic/${item.id}/${types}`:""
category==="gtask"?`/banks/gtask/${item.id}/${types}?tab=0`:
category==="gtopic"?`/banks/gtopic/${item.id}/${types}?tab=0`:""
}
>
{item.name}
</a>
{item.is_public===true?types==="publicly"?"":<span className="edu-filter-btn edu-filter-btn-4CACFF ml15 fl typestyle mt3">公开</span>:""}
{item.is_public===true?types==="publicly"?"":<span className="edu-filter-btn edu-filter-btn-4CACFF ml15 fl gongkais">公开</span>:""}

@ -136,7 +136,7 @@ class BanksIndex extends Component{
}
{
crumbData &&<p className="clearfix mt20 mb30 ">
crumbData &&<p className="clearfix mt15 mb10 ">
<span className="fl font-24 color-grey-3 task-hide lineh-30" style={{maxWidth:'800px'}}>{crumbData && crumbData.title}</span>
{ crumbData.is_public == true ?
<span className="bank_is_public">公开</span>

@ -27,7 +27,7 @@ class ExerciseBanksDetail extends Component{
const menuData={
tab:'0',//tab选中的index
menuArray:[//tab以及tab路由
{to:`/banks/exercise/${Id}/${this.props.match.params.type}`,content:'内容详情'}
{to:`/banks/exercise/${Id}/${this.props.match.params.type}?tab=0`,content:'内容详情'}
],
category:'exercise',//
tos: `/banks/exercise/${Id}/edit/${this.props.match.params.type}`,

@ -25,7 +25,7 @@ class GtaskBanksEdit extends Component {
title:'编辑',
is_public:result && result.data && result.data.is_public,
crumbArray:[
{to:`/banks/gtask/${workId}/${this.props.match.params.type}`,content:'详情'},
{to:`/banks/gtask/${workId}/${this.props.match.params.type}?tab=0`,content:'详情'},
{content:'编辑'}
]
}
@ -59,7 +59,7 @@ class GtaskBanksEdit extends Component {
});
}
toWorkDetail = () => {
this.props.history.push(`/banks/gtask/${this.props.match.params.workId}/${this.props.match.params.type}`);
this.props.history.push(`/banks/gtask/${this.props.match.params.workId}/${this.props.match.params.type}?tab=0`);
this.props.initPublic(undefined);
}
onCancel = () => {

@ -24,7 +24,7 @@ class GtopicBanksEdit extends Component{
title:'编辑',
is_public:result && result.data.selected_data && result.data.selected_data.is_public,
crumbArray:[
{to:`/banks/gtopic/${bankId}/${this.props.match.params.type}`,content:'详情'},
{to:`/banks/gtopic/${bankId}/${this.props.match.params.type}?tab=0`,content:'详情'},
{content:'编辑'}
]
}
@ -47,7 +47,7 @@ class GtopicBanksEdit extends Component{
axios.put(url,params).then((result)=>{
if(result){
this.props.showNotification('保存成功!');
this.props.history.push(`/banks/gtopic/${bankId}/${this.props.match.params.type}`);
this.props.history.push(`/banks/gtopic/${bankId}/${this.props.match.params.type}?tab=0`);
}
}).catch((error)=>{
console.log(error);
@ -56,7 +56,7 @@ class GtopicBanksEdit extends Component{
// 取消
editCancel = () =>{
this.props.history.push(`/banks/gtopic/${this.props.match.params.bankId}/${this.props.match.params.type}`);
this.props.history.push(`/banks/gtopic/${this.props.match.params.bankId}/${this.props.match.params.type}?tab=0`);
this.props.initPublic(undefined);
}

@ -26,7 +26,7 @@ class HomeworkBanksEdit extends Component {
title:'编辑',
is_public:result && result.data && result.data.is_public,
crumbArray:[
{to:`/banks/${this.getModuleName()}/${workId}/${this.props.match.params.type}`,content:'详情'},
{to:`/banks/${this.getModuleName()}/${workId}/${this.props.match.params.type}?tab=0`,content:'详情'},
{content:'编辑'}
]
}
@ -64,7 +64,7 @@ class HomeworkBanksEdit extends Component {
return this.props.isGroup ? 'group' : 'normal'
}
toWorkDetail = () => {
this.props.history.push(`/banks/${this.getModuleName()}/${this.props.match.params.workId}/${this.props.match.params.type}`)
this.props.history.push(`/banks/${this.getModuleName()}/${this.props.match.params.workId}/${this.props.match.params.type}?tab=0`)
this.props.initPublic(undefined);
}
onCancel = () => {

@ -25,10 +25,32 @@ class BanksMenu extends Component{
})
}
componentDidMount() {
let { banksMenu} = this.props;
this.setState({
tab:banksMenu && banksMenu.tab?[String(banksMenu.tab)]:['0'],
})
debugger
try {
const query = this.props.location.search;
const type = query.split('?tab=');
if(type[1]===undefined){
this.setState({
tab:['0'],
});
}else{
if(type[1]==="0"){
this.setState({
tab:['0'],
});
}else if(type[1]==="1"){
this.setState({
tab:['1'],
});
}
}
}catch (e) {
this.setState({
tab:['0'],
});
}
}
topicscancelmodel=()=>{

@ -338,7 +338,7 @@
}
.topicsbtn{
padding: 3px 15px;
padding: 0px 15px;
border-radius: 2px;
/*color: #4C4C4C;*/
cursor: pointer;

@ -108,6 +108,7 @@ a:hover.link-color-grey03{color:#3498db!important;}
.font-18{ font-size: 18px!important;}
.font-20{ font-size: 20px!important;}
.font-22{ font-size: 22px!important;}
.font-25{ font-size: 25px!important;}
.font-24{ font-size: 24px!important;}
.font-28{ font-size: 28px!important;}
.font-30{ font-size: 30px!important;}

@ -82,6 +82,7 @@ a.edu-txt-w80,.edu-txt-w80{ width:80px; display: inline-block;text-align: center
.font-18{ font-size: 18px!important;}
.font-20{ font-size: 20px!important;}
.font-22{ font-size: 22px!important;}
.font-25{ font-size: 25px!important;}
.font-24{ font-size: 24px!important;}
.font-26{ font-size: 26px!important;}
.font-28{ font-size: 28px!important;}

Loading…
Cancel
Save