|
|
|
@ -17,6 +17,8 @@ import NoneDatas from '../component/NoneDatas';
|
|
|
|
|
import LoadingSpin from '../../../common/LoadingSpin';
|
|
|
|
|
import Contentquestionbank from "./Contentquestionbank";
|
|
|
|
|
import Listjihe from "./Listjihe";
|
|
|
|
|
import Certifiedprofessional from "../../modals/Certifiedprofessional";
|
|
|
|
|
import QuestionModalPicture from '../component/QuestionModalPicture.js'
|
|
|
|
|
const { TabPane } = Tabs;
|
|
|
|
|
const Search = Input.Search;
|
|
|
|
|
class Contentpart extends Component {
|
|
|
|
@ -25,25 +27,114 @@ class Contentpart extends Component {
|
|
|
|
|
this.state = {
|
|
|
|
|
page:1,
|
|
|
|
|
chakanjiexibool:false,
|
|
|
|
|
mydisplay:false,
|
|
|
|
|
occupation:2,
|
|
|
|
|
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) => {
|
|
|
|
|
// console.log('==============>>>>>>>>>>>>',url);
|
|
|
|
|
// setUrl(url);
|
|
|
|
|
this.setState({
|
|
|
|
|
url:url
|
|
|
|
|
})
|
|
|
|
|
}
|
|
|
|
|
handleClose=()=>{
|
|
|
|
|
this.setState({
|
|
|
|
|
url:'',
|
|
|
|
|
})
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
chakanjiexibool=(index)=>{
|
|
|
|
|
if(this.props.current_user.professional_certification===false&&this.state.isysladmins===false){
|
|
|
|
|
this.HideAddcoursestypess(2);
|
|
|
|
|
return
|
|
|
|
|
}
|
|
|
|
|
this.props.chakanjiexibool(index);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
showmodels=(e)=>{
|
|
|
|
|
if(this.props.current_user.professional_certification===false&&this.state.isysladmins===false){
|
|
|
|
|
this.HideAddcoursestypess(2);
|
|
|
|
|
return
|
|
|
|
|
}
|
|
|
|
|
this.props.showmodels(e)
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
showmodelsInaudit=(e)=>{
|
|
|
|
|
if(this.props.current_user.professional_certification===false&&this.state.isysladmins===false){
|
|
|
|
|
this.HideAddcoursestypess(2);
|
|
|
|
|
return
|
|
|
|
|
}
|
|
|
|
|
this.props.showmodelsInaudit(e)
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
showmodelysl=(e)=>{
|
|
|
|
|
if(this.props.current_user.professional_certification===false&&this.state.isysladmins===false){
|
|
|
|
|
this.HideAddcoursestypess(2);
|
|
|
|
|
return
|
|
|
|
|
}
|
|
|
|
|
this.props.showmodelysl(e)
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
componentDidUpdate(prevProps) {
|
|
|
|
|
if(prevProps.current_user !== this.props.current_user) {
|
|
|
|
|
|
|
|
|
|
const isysladmins=this.props&&this.props.current_user&&this.props.current_user.admin?this.props.current_user.admin:false;
|
|
|
|
|
const is_teacher=this.props&&this.props.current_user&&this.props.current_user.is_teacher?this.props.current_user.is_teacher:false;
|
|
|
|
|
let isysladmins=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){
|
|
|
|
|
isysladmins=true;
|
|
|
|
|
}
|
|
|
|
|
else if(this.props.current_user.business){
|
|
|
|
|
isysladmins=true;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
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{
|
|
|
|
@ -52,7 +143,26 @@ class Contentpart extends Component {
|
|
|
|
|
this.props.callback(defaultActiveKeys);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
HideAddcoursestypess=(i)=>{
|
|
|
|
|
console.log("调用了");
|
|
|
|
|
this.setState({
|
|
|
|
|
mydisplay:true,
|
|
|
|
|
occupation:i,
|
|
|
|
|
})
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
mydisplayHidedel=()=>{
|
|
|
|
|
this.setState({
|
|
|
|
|
mydisplay:false,
|
|
|
|
|
})
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
xinzenw=(e)=>{
|
|
|
|
|
//只限制了教师
|
|
|
|
|
if(this.props.current_user.professional_certification===false&&this.state.isysladmins===false){
|
|
|
|
|
this.HideAddcoursestypess(2);
|
|
|
|
|
return
|
|
|
|
|
}
|
|
|
|
|
var urls="";
|
|
|
|
|
if(this.props.discipline_id){
|
|
|
|
|
// if(urls==="?"){
|
|
|
|
@ -95,13 +205,32 @@ class Contentpart extends Component {
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
render() {
|
|
|
|
|
let {page}=this.state;
|
|
|
|
|
let {page,mydisplay,url}=this.state;
|
|
|
|
|
let {defaultActiveKey,item_type,booljupyterurls}=this.props;
|
|
|
|
|
const defaultActiveKeys=defaultActiveKey+'';
|
|
|
|
|
const isysladmins=this.props&&this.props.current_user&&this.props.current_user.admin?this.props.current_user.admin:false;
|
|
|
|
|
const is_teacher=this.props&&this.props.current_user&&this.props.current_user.is_teacher?this.props.current_user.is_teacher:false;
|
|
|
|
|
let isysladmins=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){
|
|
|
|
|
isysladmins=true;
|
|
|
|
|
}
|
|
|
|
|
else if(this.props.current_user.business){
|
|
|
|
|
isysladmins=true;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}catch (e) {
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
const content = (
|
|
|
|
|
<div className="questiontypes" style={{
|
|
|
|
@ -136,12 +265,38 @@ class Contentpart extends Component {
|
|
|
|
|
);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
//console.log("Contentpart.js");
|
|
|
|
|
//console.log(this.props.defaultActiveKey);
|
|
|
|
|
// console.log("Contentpart.js");
|
|
|
|
|
// console.log(this.props.current_user.professional_certification);
|
|
|
|
|
|
|
|
|
|
return (
|
|
|
|
|
<div className=" clearfix mt25">
|
|
|
|
|
<div className="educontent mt10 pb20 w1200s">
|
|
|
|
|
{url?
|
|
|
|
|
<QuestionModalPicture {...this.props} {...this.state} handleClose={()=>this.handleClose()}></QuestionModalPicture>
|
|
|
|
|
:
|
|
|
|
|
""
|
|
|
|
|
}
|
|
|
|
|
{
|
|
|
|
|
mydisplay===true?
|
|
|
|
|
<Certifiedprofessional {...this.props} {...this.state} ModalCancelsy={this.mydisplayHidedel} />
|
|
|
|
|
|
|
|
|
|
:""
|
|
|
|
|
}
|
|
|
|
|
{
|
|
|
|
|
mydisplay===true?
|
|
|
|
|
<style>
|
|
|
|
|
{
|
|
|
|
|
`
|
|
|
|
|
body{
|
|
|
|
|
overflow:hidden!important;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
`
|
|
|
|
|
}
|
|
|
|
|
</style>
|
|
|
|
|
|
|
|
|
|
:""
|
|
|
|
|
}
|
|
|
|
|
<div className="w1200ms contentparttit" style={{
|
|
|
|
|
position: "relative",
|
|
|
|
|
}}>
|
|
|
|
@ -166,7 +321,7 @@ class Contentpart extends Component {
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
{
|
|
|
|
|
isysladmins===true||(is_teacher===true&&professional_certification===true)?
|
|
|
|
|
isysladmins===true||is_teacher===true?
|
|
|
|
|
<Tabs activeKey={defaultActiveKeys} onChange={(e)=>this.props.callback(e)}>
|
|
|
|
|
<TabPane tab="公共" key="1">
|
|
|
|
|
</TabPane>
|
|
|
|
@ -192,7 +347,7 @@ class Contentpart extends Component {
|
|
|
|
|
`
|
|
|
|
|
|
|
|
|
|
.xaxisreverseorder .ant-input-group-addon{
|
|
|
|
|
width: 60px !important;
|
|
|
|
|
width: 48px !important;
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
@ -214,7 +369,7 @@ class Contentpart extends Component {
|
|
|
|
|
<div className="xaxisreverseorder">
|
|
|
|
|
{
|
|
|
|
|
defaultActiveKey===0||defaultActiveKey==="0"?
|
|
|
|
|
isysladmins===true||(is_teacher===true&&professional_certification===true)?
|
|
|
|
|
isysladmins===true||is_teacher===true?
|
|
|
|
|
this.props.Isitapopup&&this.props.Isitapopup==="true"?
|
|
|
|
|
""
|
|
|
|
|
:
|
|
|
|
@ -247,7 +402,7 @@ class Contentpart extends Component {
|
|
|
|
|
defaultActiveKey===0||defaultActiveKey==="0"?
|
|
|
|
|
this.props.Isitapopup&&this.props.Isitapopup==="true"?
|
|
|
|
|
<Search
|
|
|
|
|
style={isysladmins===true||(is_teacher===true&&professional_certification)?{ marginRight:"0px"}:{marginRight:"0px"}}
|
|
|
|
|
style={isysladmins===true||is_teacher===true?{ marginRight:"0px"}:{marginRight:"0px"}}
|
|
|
|
|
className={"xaxisreverseorder searchwidth"}
|
|
|
|
|
placeholder="请输入题目名称、内容"
|
|
|
|
|
enterButton
|
|
|
|
@ -256,7 +411,7 @@ class Contentpart extends Component {
|
|
|
|
|
onSearch={ (value)=>this.props.setdatafuns(value)} />
|
|
|
|
|
:
|
|
|
|
|
<Search
|
|
|
|
|
style={isysladmins===true||(is_teacher===true&&professional_certification)?{ marginRight:"30px"}:{marginRight:"0px"}}
|
|
|
|
|
style={isysladmins===true||is_teacher===true?{ marginRight:"30px"}:{marginRight:"0px"}}
|
|
|
|
|
className={"xaxisreverseorder searchwidth"}
|
|
|
|
|
placeholder="请输入题目名称、内容"
|
|
|
|
|
enterButton
|
|
|
|
@ -320,9 +475,12 @@ class Contentpart extends Component {
|
|
|
|
|
pages={this.props.pages}
|
|
|
|
|
getitem_basketss={(id)=>this.props.getitem_basketss(id)}
|
|
|
|
|
getitem_baskets={(e)=>this.props.getitem_baskets(e)}
|
|
|
|
|
showmodels={(e)=>this.props.showmodels(e)}
|
|
|
|
|
showmodelysl={(e)=>this.props.showmodelysl(e)}
|
|
|
|
|
showmodelsInaudit={(e)=>this.props.showmodelsInaudit(e)}
|
|
|
|
|
showmodels={(e)=>this.showmodels(e)}
|
|
|
|
|
showmodelysl={(e)=>this.showmodelysl(e)}
|
|
|
|
|
showmodelsInaudit={(e)=>this.showmodelsInaudit(e)}
|
|
|
|
|
handleShowUploadImage={(e)=>this.handleShowUploadImage(e)}
|
|
|
|
|
handleClose={()=>this.handleClose()}
|
|
|
|
|
|
|
|
|
|
>
|
|
|
|
|
|
|
|
|
|
</Listjihe>
|
|
|
|
|