Merge remote-tracking branch 'origin/dev_aliyun' into dev_aliyun

dev_hss
杨树明 5 years ago
commit d8a3eb1ea2

@ -1,11 +1,12 @@
class Users::QuestionBanksController < Users::BaseController class Users::QuestionBanksController < Users::BaseController
before_action :require_login before_action :require_login
before_action :private_user_resources! skip_before_action :check_observed_user_exists!
# before_action :private_user_resources!
before_action :check_query_params! before_action :check_query_params!
before_action :check_user_permission! before_action :check_user_permission!
def index def index
service = Users::QuestionBankService.new(observed_user, query_params) service = Users::QuestionBankService.new(User.current, query_params)
question_banks = service.call question_banks = service.call
@count = question_banks.count @count = question_banks.count

@ -1,35 +0,0 @@
#coding=utf-8
module SessionExtenstions
module EntryExtension
def compressed?
@compressed
end
def value
if @value
begin
Marshal.load(compressed? ? Zlib::Inflate.inflate(@value) : @value)
rescue TypeError
compressed? ? Zlib::Inflate.inflate(@value) : @value
end
end
end
def size
if @value.nil?
0
else
@value.bytesize
end
end
end
end
ActiveSupport::Cache::Entry.const_set("DEFAULT_COMPRESS_LIMIT", 1)
ActiveSupport::Cache::Entry.send(:prepend, SessionExtenstions::EntryExtension)

@ -55,12 +55,14 @@ Rails.application.routes.draw do
get :homepage_info get :homepage_info
end end
get :question_banks, on: :collection, to: 'users/question_banks#index'
scope module: :users do scope module: :users do
resources :courses, only: [:index] resources :courses, only: [:index]
resources :shixuns, only: [:index] resources :shixuns, only: [:index]
resources :projects, only: [:index] resources :projects, only: [:index]
resources :subjects, only: [:index] resources :subjects, only: [:index]
resources :question_banks, only: [:index] # resources :question_banks, only: [:index]
resource :experience_records, only: [:show] resource :experience_records, only: [:show]
resource :grade_records, only: [:show] resource :grade_records, only: [:show]
resource :watch, only: [:create, :destroy] resource :watch, only: [:create, :destroy]

@ -100,6 +100,7 @@ class NewWorkForm extends Component{
const courseId = this.state.course_id || this.props.match.params.coursesId ; const courseId = this.state.course_id || this.props.match.params.coursesId ;
this.props.form.validateFieldsAndScroll((err, values) => { this.props.form.validateFieldsAndScroll((err, values) => {
if(err && err.personNum) delete err.personNum;
console.log(values) console.log(values)
const mdContnet = this.contentMdRef.current.getValue().trim(); const mdContnet = this.contentMdRef.current.getValue().trim();
console.log(mdContnet) console.log(mdContnet)
@ -135,7 +136,7 @@ class NewWorkForm extends Component{
} }
// const errKeys = Object.keys(err); // || errKeys.length == 1 && errKeys[0] == 'content' && mdContnet // const errKeys = Object.keys(err); // || errKeys.length == 1 && errKeys[0] == 'content' && mdContnet
if (!err) { if (!err || Object.keys(err).length == 0) {
if (this.state.isEdit) { if (this.state.isEdit) {
this.doEdit(courseId, values) this.doEdit(courseId, values)
} else { } else {
@ -450,12 +451,13 @@ class NewWorkForm extends Component{
className="AboutInputForm groupSetting" className="AboutInputForm groupSetting"
> >
{getFieldDecorator('personNum', { {getFieldDecorator('personNum', {
rules: [{ validateTrigger: 'onNone',
// rules: [{
// required: true, // required: true,
// message: '人数不能为空' // message: '人数不能为空'
// validator: this.personNumValidator // validator: this.personNumValidator
// required: true, message: '请输入最小人数和最大人数' // required: true, message: '请输入最小人数和最大人数'
}], // }],
})( })(
<div> <div>
<p className="clearfix"> <p className="clearfix">

@ -53,7 +53,7 @@ class ModalWrapper extends Component{
{this.props.checkBoxValuestype===true?<div className={"mt10 color-red"}> {this.props.checkBoxValuestype===true?<div className={"mt10 color-red"}>
请先选择课堂 请先选择课堂
</div>:""} </div>:""}
<div className="mt30 marginauto clearfix edu-txt-center"> <div className="mt20 marginauto clearfix edu-txt-center">
<a onClick={this.onCancel} className="pop_close task-btn mr30">{ cancelText || '取消' }</a> <a onClick={this.onCancel} className="pop_close task-btn mr30">{ cancelText || '取消' }</a>
<a onClick={this.onOk} className="task-btn task-btn-orange" id="submit_send_shixun">{ okText || "确定" }</a> <a onClick={this.onOk} className="task-btn task-btn-orange" id="submit_send_shixun">{ okText || "确定" }</a>
</div> </div>

@ -216,7 +216,9 @@ class Bullsubdirectory extends Component{
let{description,whethertoeditysl,addonAfter,eduintits,informs,isSpinysl} =this.state; let{description,whethertoeditysl,addonAfter,eduintits,informs,isSpinysl} =this.state;
let{myname,mydescription,id}=this.props; let{myname,mydescription,id}=this.props;
const {getFieldDecorator} = this.props.form; const {getFieldDecorator} = this.props.form;
console.log("Bullsubdirectory");
console.log(this.props.isAdmin());
console.log(this.props.yslbool);
return( return(
<React.Fragment > <React.Fragment >
<div > <div >
@ -239,10 +241,13 @@ class Bullsubdirectory extends Component{
<div> <div>
<span className="fr yslbianji" style={{marginRight:"17px"}}> <span className="fr yslbianji" style={{marginRight:"17px"}}>
{ {
this.props.isClassManagement() === true ? this.props.isAdmin() === true ?
(this.props.yslbool===false? (this.props.yslbool===false?
<Tooltip placement="bottom" title={<div>
编辑
</div>}>
<i className="iconfont icon-bianji1 newbianji1" onClick={()=>this.bianji(true)}></i> <i className="iconfont icon-bianji1 newbianji1" onClick={()=>this.bianji(true)}></i>
</Tooltip>
: :
"" ""
) )
@ -251,10 +256,13 @@ class Bullsubdirectory extends Component{
</span> </span>
<span className="fr yslbianji" style={{marginRight:"22px"}}> <span className="fr yslbianji" style={{marginRight:"22px"}}>
{ {
this.props.isClassManagement() === true ? this.props.isAdmin() === true ?
(this.props.yslbool===false? (this.props.yslbool===false?
<Tooltip placement="bottom" title={<div>
删除
</div>}>
<i className="iconfont icon-shanchu newbianji1" style={{ color: "#4CACFF"}} onClick={()=>this.setModeltrue(true)}></i> <i className="iconfont icon-shanchu newbianji1" style={{ color: "#4CACFF"}} onClick={()=>this.setModeltrue(true)}></i>
</Tooltip>
: :
"" ""
) )

@ -82,11 +82,16 @@ class GroupPackage extends Component {
</p> </p>
} }
{ {
datas&&datas.group_info&&datas.group_info.base_on_project? datas&&datas.group_info&&datas.group_info.base_on_project===1?
<p> <p>
<span className="ysltextcolor66">基于项目实施</span> <span className="ysltextcolor66">基于项目实施</span>
<span className="ysltextcolor05">学生必须在本平台创建项目项目管理员可以提交作品</span> <span className="ysltextcolor05">学生必须在本平台创建项目项目管理员可以提交作品</span>
</p> </p>
:datas&&datas.group_info&&datas.group_info.base_on_project===0?
<p>
<span className="ysltextcolor66">不基于项目</span>
<span className="ysltextcolor05">无需在平台创建项目任意小组成员均可以提交作品</span>
</p>
:"" :""
} }
</div> </div>

@ -89,7 +89,7 @@ function CourseGroupChooser({ course_groups, isAdminOrCreator = true, item, inde
<p className="drop_down_btn"> <p className="drop_down_btn">
<a href="javascript:void(0)" className="color-grey-6" <a href="javascript:void(0)" className="color-grey-6"
onClick={() => trigger('groupAdd')} onClick={() => trigger('groupAdd')}
>添加分班...</a> >添加分班</a>
</p> </p>
</ul> </ul>
) )

@ -65,16 +65,22 @@ function CourseGroupChooserModal({ course_groups = [], isAdminOrCreator, item, i
className="courseGroupChooserModal" className="courseGroupChooserModal"
> >
<style>{` <style>{`
.courseGroupChooserModal .ant-modal-body{
padding:20px 30px;
}
.courseGroupChooserModal .description { .courseGroupChooserModal .description {
font-size: 16px; font-size: 16px;
text-align: center; text-align: center;
margin-bottom: 20px; margin-bottom: 20px;
} }
.courseGroupChooserModal .marginauto{
margin-top:10px!important;
}
.courseGroupChooserModal .drop_down_menu { .courseGroupChooserModal .drop_down_menu {
position: relative; position: relative;
top: auto; top: auto;
box-shadow: none; box-shadow: none;
padding-top: 12px; padding:0px;
} }
.courseGroupChooserModal .drop_down_menu .mainGroup{ .courseGroupChooserModal .drop_down_menu .mainGroup{
background: #f2f9ff; background: #f2f9ff;
@ -95,9 +101,15 @@ function CourseGroupChooserModal({ course_groups = [], isAdminOrCreator, item, i
padding: 0px; padding: 0px;
} }
.courseGroupChooserModal .drop_down_menu .drop_down_btn { .courseGroupChooserModal .drop_down_menu .drop_down_btn {
height: 26px;
line-height: 26px;
padding: 0px 20px; padding: 0px 20px;
margin: 0; margin: 0;
} }
.mainGroup .drop_down_menu .drop_down_btn{
height: 26px;
line-height: 26px;
}
`}</style> `}</style>
{/* <React.Fragment> {/* <React.Fragment>
<React.Fragment> */} <React.Fragment> */}

@ -16,6 +16,7 @@ class AboutUs extends React.Component {
} }
componentDidMount(){ componentDidMount(){
window.document.title = "关于我们";
this.getContent(); this.getContent();
} }

@ -16,6 +16,7 @@ class Agreement extends React.Component {
} }
componentDidMount(){ componentDidMount(){
window.document.title = "服务协议";
this.getContent(); this.getContent();
} }

@ -17,6 +17,7 @@ class ContactUs extends React.Component {
} }
componentDidMount(){ componentDidMount(){
window.document.title = "联系我们";
this.getData(); this.getData();
} }

@ -21,6 +21,7 @@ class Cooperatives extends React.Component {
} }
componentDidMount(){ componentDidMount(){
window.document.title = "合作伙伴";
this.getCooperatives(); this.getCooperatives();
} }

@ -13,6 +13,10 @@ class Feedback extends React.Component {
super(props); super(props);
} }
componentDidMount() {
window.document.title = "意见反馈";
}
componentDidUpdate(prevProps) { componentDidUpdate(prevProps) {
if (prevProps.current_user !== this.props.current_user) { if (prevProps.current_user !== this.props.current_user) {
if(!this.props.checkIfLogin()) { if(!this.props.checkIfLogin()) {

@ -16,6 +16,7 @@ class HelpCenter extends React.Component {
} }
componentDidMount(){ componentDidMount(){
window.document.title = "帮助中心";
this.getContent(); this.getContent();
} }

@ -227,10 +227,6 @@
left:0px; left:0px;
background: #4CACFF; background: #4CACFF;
} }
.square-Item{
height: 295px;
}
/* 题库相关 */ /* 题库相关 */
.breadcrumb{ .breadcrumb{
height: 18px; height: 18px;

Loading…
Cancel
Save