mast_item_banktwo
杨树林 5 years ago
parent 8fda4061b7
commit 047307ddbe

@ -42,9 +42,9 @@ if (isDev) {
window.location.search.indexOf('debug=a') != -1 ? 'admin' : parsed.debug || 'admin'
}
// 超管
debugType="admin";
// debugType="admin";
// 老师
// debugType="teacher";
debugType="teacher";
// 学生
// debugType="student";

@ -164,10 +164,11 @@ class NewMyShixunModel extends Component {
//初始化
componentDidMount() {
let isysladmins=false;
const is_teacher=this.props&&this.props.current_user&&this.props.current_user.is_teacher?this.props.current_user.is_teacher:false;
let is_teacher=this.props&&this.props.current_user&&this.props.current_user.is_teacher?this.props.current_user.is_teacher:false;
const professional_certification=this.props&&this.props.current_user&&this.props.current_user.professional_certification?this.props.current_user.professional_certification:false;
let {defaultActiveKey} = this.props;
var defaultActiveKeys=defaultActiveKey;
try {
if(this.props){
if(this.props.current_user){
if(this.props.current_user.admin){
@ -177,6 +178,15 @@ class NewMyShixunModel extends Component {
isysladmins=true;
}
}
}
if(is_teacher===false){
if(this.props.current_user.user_identity !=="学生"){
//专业人士
is_teacher=true
}
}
}catch (e) {
}
if(isysladmins===true||(is_teacher===true&&professional_certification===true)){
@ -219,10 +229,11 @@ class NewMyShixunModel extends Component {
componentDidUpdate(prevProps) {
if(prevProps.current_user !== this.props.current_user) {
let isysladmins=false;
const is_teacher=this.props&&this.props.current_user&&this.props.current_user.is_teacher?this.props.current_user.is_teacher:false;
let is_teacher=this.props&&this.props.current_user&&this.props.current_user.is_teacher?this.props.current_user.is_teacher:false;
const professional_certification=this.props&&this.props.current_user&&this.props.current_user.professional_certification?this.props.current_user.professional_certification:false;
let {defaultActiveKey} = this.props;
var defaultActiveKeys=defaultActiveKey;
try {
if(this.props){
if(this.props.current_user){
if(this.props.current_user.admin){
@ -233,6 +244,16 @@ class NewMyShixunModel extends Component {
}
}
}
if(is_teacher===false){
if(this.props.current_user.user_identity !=="学生"){
//专业人士
is_teacher=true
}
}
}catch (e) {
}
if(isysladmins===true||(is_teacher===true&&professional_certification===true)){
defaultActiveKeys="0"

@ -21,6 +21,7 @@ import NoneData from './component/NoneData';
import './questioncss/questioncom.css';
import SiderBars from "../question/component/SiderBars";
import QuestionModalys from "./component/QuestionModalys";
import Certifiedprofessional from "../modals/Certifiedprofessional";
var Undoclickable=true;
class Question extends Component {
@ -70,6 +71,8 @@ class Question extends Component {
isVisible: false,
selectionbools:false,
chakanjiexiboolindex:"无",
mydisplay:false,
occupation:2,
@ -806,11 +809,38 @@ class Question extends Component {
});
}
HideAddcoursestypess=(i)=>{
console.log("调用了");
this.setState({
mydisplay:true,
occupation:i,
})
}
mydisplayHidedel=()=>{
this.setState({
mydisplay:false,
})
}
//跳转
gotopaperreview=()=>{
let isysladmins=false;
if(this.props){
if(this.props.current_user){
if(this.props.current_user.admin){
isysladmins=true;
}
else if(this.props.current_user.business){
isysladmins=true;
}
}
}
if(this.props.current_user.professional_certification===false&&isysladmins===false){
this.HideAddcoursestypess(2);
return
}
this.props.history.replace("/paperreview/artificial");
}
@ -845,7 +875,7 @@ class Question extends Component {
page, per_page, items_count, Headertop, visible, placement, modalsType, modalsTypes,basket_list,
completion_questions_count, judgement_questions_count, multiple_questions_count, practical_questions_count,
program_questions_count, single_questions_count, subjective_questions_count,selectionbools,
modalsTypeInaudit
modalsTypeInaudit,mydisplay
} = this.state;
const Datacount = completion_questions_count + judgement_questions_count
@ -856,6 +886,7 @@ class Question extends Component {
let isysladmins=false;
const is_teacher=this.props&&this.props.current_user&&this.props.current_user.is_teacher?this.props.current_user.is_teacher:false;
const professional_certification=this.props&&this.props.current_user&&this.props.current_user.professional_certification?this.props.current_user.professional_certification:false;
try {
if(this.props){
if(this.props.current_user){
if(this.props.current_user.admin){
@ -866,9 +897,33 @@ class Question extends Component {
}
}
}
}catch (e) {
}
return (
<div className="newMain clearfix" ref={this.saveContainer}>
{
mydisplay===true?
<Certifiedprofessional {...this.props} {...this.state} ModalCancelsy={this.mydisplayHidedel} />
:""
}
{
mydisplay===true?
<style>
{
`
body{
overflow:hidden!important;
}
`
}
</style>
:""
}
{
visible===true?
<style>

@ -29,12 +29,27 @@ class Contentpart extends Component {
chakanjiexibool:false,
mydisplay:false,
occupation:2,
url: ""
url: "",
isysladmins:false,
}
}
//初始化
componentDidMount(){
let isysladmins=false;
if(this.props){
if(this.props.current_user){
if(this.props.current_user.admin){
isysladmins=true;
}
else if(this.props.current_user.business){
isysladmins=true;
}
}
}
this.setState({
isysladmins:isysladmins
})
}
handleShowUploadImage = (url) => {
@ -51,7 +66,7 @@ class Contentpart extends Component {
}
chakanjiexibool=(index)=>{
if(this.props.current_user.professional_certification===false){
if(this.props.current_user.professional_certification===false&&this.state.isysladmins===false){
this.HideAddcoursestypess(2);
return
}
@ -59,7 +74,7 @@ class Contentpart extends Component {
}
showmodels=(e)=>{
if(this.props.current_user.professional_certification===false){
if(this.props.current_user.professional_certification===false&&this.state.isysladmins===false){
this.HideAddcoursestypess(2);
return
}
@ -67,7 +82,7 @@ class Contentpart extends Component {
}
showmodelsInaudit=(e)=>{
if(this.props.current_user.professional_certification===false){
if(this.props.current_user.professional_certification===false&&this.state.isysladmins===false){
this.HideAddcoursestypess(2);
return
}
@ -75,7 +90,7 @@ class Contentpart extends Component {
}
showmodelysl=(e)=>{
if(this.props.current_user.professional_certification===false){
if(this.props.current_user.professional_certification===false&&this.state.isysladmins===false){
this.HideAddcoursestypess(2);
return
}
@ -91,10 +106,11 @@ class Contentpart extends Component {
if(prevProps.current_user !== this.props.current_user) {
let isysladmins=false;
const is_teacher=this.props&&this.props.current_user&&this.props.current_user.is_teacher?this.props.current_user.is_teacher:false;
let is_teacher=this.props&&this.props.current_user&&this.props.current_user.is_teacher?this.props.current_user.is_teacher:false;
const professional_certification=this.props&&this.props.current_user&&this.props.current_user.professional_certification?this.props.current_user.professional_certification:false;
let {defaultActiveKey} = this.props;
var defaultActiveKeys=defaultActiveKey;
try {
if(this.props){
if(this.props.current_user){
if(this.props.current_user.admin){
@ -106,6 +122,19 @@ class Contentpart extends Component {
}
}
if(is_teacher===false){
if(this.props.current_user.user_identity !=="学生"){
//专业人士
is_teacher=true
}
}
}catch (e) {
}
this.setState({
isysladmins:isysladmins
})
if(isysladmins===true||(is_teacher===true&&professional_certification===true)){
defaultActiveKeys="0"
}else{
@ -130,7 +159,7 @@ class Contentpart extends Component {
xinzenw=(e)=>{
//只限制了教师
if(this.props.current_user.professional_certification===false){
if(this.props.current_user.professional_certification===false&&this.state.isysladmins===false){
this.HideAddcoursestypess(2);
return
}
@ -180,8 +209,15 @@ class Contentpart extends Component {
let {defaultActiveKey,item_type,booljupyterurls}=this.props;
const defaultActiveKeys=defaultActiveKey+'';
let isysladmins=false;
const is_teacher=this.props&&this.props.current_user&&this.props.current_user.is_teacher?this.props.current_user.is_teacher:false;
let is_teacher=this.props&&this.props.current_user&&this.props.current_user.is_teacher?this.props.current_user.is_teacher:false;
const professional_certification=this.props&&this.props.current_user&&this.props.current_user.professional_certification?this.props.current_user.professional_certification:false;
try {
if(is_teacher===false){
if(this.props.current_user.user_identity !=="学生"){
//专业人士
is_teacher=true
}
}
if(this.props){
if(this.props.current_user){
if(this.props.current_user.admin){
@ -192,6 +228,9 @@ class Contentpart extends Component {
}
}
}
}catch (e) {
}
const content = (
<div className="questiontypes" style={{

@ -36,12 +36,26 @@ class Listjihe extends Component {
url: "",
mydisplay:false,
occupation:2,
isysladmins:false,
}
}
//初始化
componentDidMount() {
let isysladmins=false;
if(this.props){
if(this.props.current_user){
if(this.props.current_user.admin){
isysladmins=true;
}
else if(this.props.current_user.business){
isysladmins=true;
}
}
}
this.setState({
isysladmins:isysladmins
})
}
handleShowUploadImage = (url) => {
@ -72,8 +86,15 @@ class Listjihe extends Component {
exam_id: this.props.exam_id === undefined ? "" : parseInt(this.props.exam_id),
}
}
if(this.props.current_user.professional_certification===false&&this.state.isysladmins===false){
this.HideAddcoursestypess(2);
return
}
this.getitem_baskets(data);
}
getitem_baskets=(data)=>{
this.props.getitem_baskets(data);
}
//撤销
Selectingpracticaltrainings = (id) => {
@ -83,7 +104,7 @@ class Listjihe extends Component {
seturls(url){
if(this.props.current_user.professional_certification===false){
if(this.props.current_user.professional_certification===false&&this.state.isysladmins===false){
this.HideAddcoursestypess(2);
return
}

Loading…
Cancel
Save