|
|
|
@ -55,39 +55,41 @@ class Shixuninformation extends Component {
|
|
|
|
|
|
|
|
|
|
componentDidUpdate(prevProps, prevState) {
|
|
|
|
|
if (prevProps.data != this.props.data) {
|
|
|
|
|
if (this.props.data&&this.props.data.shixun) {
|
|
|
|
|
|
|
|
|
|
if (this.props.data ) {
|
|
|
|
|
if (this.props.data.shixun){
|
|
|
|
|
this.setState({
|
|
|
|
|
shixunName: this.props.data.shixun&&this.props.data.shixun.name,
|
|
|
|
|
trainee:this.props.data.shixun&&this.props.data.shixun.trainee,
|
|
|
|
|
choice_main_type: this.props.data.shixun&&this.props.data.shixun.choice_main_type,
|
|
|
|
|
choice_small_type: this.props.data.shixun&&this.props.data.shixun.choice_small_type,
|
|
|
|
|
choice_standard_scripts:this.props.data.shixun&&this.props.data.shixun.choice_standard_scripts,
|
|
|
|
|
shixunmemoMDvalue: this.props.data.shixun&&this.props.data.shixun.evaluate_script,
|
|
|
|
|
simichecked: this.props.data.shixun&&this.props.data.shixun.is_secret_repository,
|
|
|
|
|
shixun_service_configs: this.props.data.shixun&&this.props.data.shixun.shixun_service_configs,
|
|
|
|
|
standard_scripts:this.props.data.shixun&&this.props.data.shixun.standard_scripts,
|
|
|
|
|
shixun_service_configlist:this.props.data.shixun&&this.props.data.shixun.shixun_service_configs,
|
|
|
|
|
})
|
|
|
|
|
|
|
|
|
|
if(this.props.data.shixun&&this.props.data.shixun.choice_standard_scripts===null){
|
|
|
|
|
shixunName: this.props.data && this.props.data.shixun.name,
|
|
|
|
|
trainee: this.props.data && this.props.data.shixun.trainee,
|
|
|
|
|
choice_main_type: this.props.data && this.props.data.shixun.choice_main_type,
|
|
|
|
|
choice_small_type: this.props.data && this.props.data.shixun.choice_small_type,
|
|
|
|
|
choice_standard_scripts: this.props.data && this.props.data.shixun.choice_standard_scripts,
|
|
|
|
|
shixunmemoMDvalue: this.props.data && this.props.data.shixun.evaluate_script,
|
|
|
|
|
simichecked: this.props.data && this.props.data.shixun.is_secret_repository,
|
|
|
|
|
shixun_service_configs: this.props.data && this.props.data.shixun.shixun_service_configs,
|
|
|
|
|
standard_scripts: this.props.data && this.props.data.shixun.standard_scripts,
|
|
|
|
|
shixun_service_configlist: this.props.data && this.props.data.shixun.shixun_service_configs,
|
|
|
|
|
})
|
|
|
|
|
|
|
|
|
|
if (this.props.data && this.props.data.shixun.choice_standard_scripts === null) {
|
|
|
|
|
this.setState({
|
|
|
|
|
choice_standard_scripts:{id: this.props.data.shixun&&this.props.data.shixun.standard_scripts[0].id, value: ""},
|
|
|
|
|
choice_standard_scriptssum:this.props.data.shixun&&this.props.data.shixun.standard_scripts[0].id
|
|
|
|
|
choice_standard_scripts: {id: this.props.data && this.props.data.shixun.standard_scripts[0].id, value: ""},
|
|
|
|
|
choice_standard_scriptssum: this.props.data && this.props.data.shixun.standard_scripts[0].id
|
|
|
|
|
})
|
|
|
|
|
this.props.form.setFieldsValue({
|
|
|
|
|
selectscripts:this.props.data.shixun&&this.props.data.shixun.standard_scripts[0].id
|
|
|
|
|
selectscripts: this.props.data && this.props.data.shixun.standard_scripts[0].id
|
|
|
|
|
})
|
|
|
|
|
this.get_mirror_script(this.props.data.shixun&&this.props.data.shixun.standard_scripts[0].id)
|
|
|
|
|
}else{
|
|
|
|
|
this.get_mirror_script(this.props.data && this.props.data.shixun.standard_scripts[0].id)
|
|
|
|
|
} else {
|
|
|
|
|
this.props.form.setFieldsValue({
|
|
|
|
|
selectscripts:this.props.data.shixun&&this.props.data.shixun.choice_standard_scripts
|
|
|
|
|
selectscripts: this.props.data && this.props.data.shixun.choice_standard_scripts
|
|
|
|
|
})
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
let newlist = ""
|
|
|
|
|
this.props.data.shixun&&this.props.data.shixun.choice_small_type.map((item, key) => {
|
|
|
|
|
this.props.data.shixun.small_type.map((i,k)=>{
|
|
|
|
|
if (item===i.id) {
|
|
|
|
|
this.props.data && this.props.data.shixun.choice_small_type.map((item, key) => {
|
|
|
|
|
this.props.data && this.props.data.shixun.small_type.map((i, k) => {
|
|
|
|
|
if (item === i.id) {
|
|
|
|
|
newlist = newlist + `${i.description}`
|
|
|
|
|
}
|
|
|
|
|
})
|
|
|
|
@ -96,21 +98,22 @@ class Shixuninformation extends Component {
|
|
|
|
|
subvalues: newlist
|
|
|
|
|
})
|
|
|
|
|
|
|
|
|
|
this.props.data.shixun&&this.props.data.shixun.main_type.map((item,key)=>{
|
|
|
|
|
if(item.id===this.props.data.shixun&&this.props.data.shixun.choice_main_type){
|
|
|
|
|
this.props.data && this.props.data.shixun.main_type.map((item, key) => {
|
|
|
|
|
if (item.id === this.props.data && this.props.data.shixun.choice_main_type) {
|
|
|
|
|
this.setState({
|
|
|
|
|
mainvalues:item.description,
|
|
|
|
|
mainvalues: item.description,
|
|
|
|
|
})
|
|
|
|
|
}
|
|
|
|
|
})
|
|
|
|
|
|
|
|
|
|
this.props.form.setFieldsValue({
|
|
|
|
|
name:this.props.data.shixun&&this.props.data.shixun.name,
|
|
|
|
|
trainee: this.props.data.shixun&&this.props.data.shixun.trainee,
|
|
|
|
|
selectleft: this.props.data.shixun&&this.props.data.shixun.choice_main_type,
|
|
|
|
|
selectright:this.props.data.shixun&&this.props.data.shixun.choice_small_type,
|
|
|
|
|
name: this.props.data && this.props.data.shixun.name,
|
|
|
|
|
trainee: this.props.data && this.props.data.shixun.trainee,
|
|
|
|
|
selectleft: this.props.data && this.props.data.shixun.choice_main_type,
|
|
|
|
|
selectright: this.props.data && this.props.data.shixun.choice_small_type,
|
|
|
|
|
})
|
|
|
|
|
this.contentMdRef.current.setValue(this.props.data.shixun&&this.props.data.shixun.description);
|
|
|
|
|
this.contentMdRef.current.setValue(this.props.data && this.props.data.shixun.description);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
@ -713,7 +716,7 @@ class Shixuninformation extends Component {
|
|
|
|
|
}
|
|
|
|
|
render() {
|
|
|
|
|
|
|
|
|
|
let operateauthority = this.props.identity === 1 ? true : this.props.identity < 5 && this.props.data.shixun.status == 0 ? true : false;
|
|
|
|
|
|
|
|
|
|
// console.log(operateauthority)
|
|
|
|
|
const {getFieldDecorator} = this.props.form;
|
|
|
|
|
const { fileList, choice_standard_scripts, postapplyvisible, shixunmemoMDvalue} = this.state;
|
|
|
|
@ -754,7 +757,7 @@ class Shixuninformation extends Component {
|
|
|
|
|
return isLt150M;
|
|
|
|
|
},
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
let operateauthority = this.props.identity === 1 ? true : this.props.identity < 5 && this.props.data&&this.props.data.shixun.status == 0 ? true : false;
|
|
|
|
|
return (
|
|
|
|
|
<div>
|
|
|
|
|
<div className="educontent mb50 edu-back-white padding10-20">
|
|
|
|
@ -841,7 +844,9 @@ class Shixuninformation extends Component {
|
|
|
|
|
>
|
|
|
|
|
|
|
|
|
|
{
|
|
|
|
|
this.props.data === undefined ? "" : this.props.data.shixun&&this.props.data.shixun.main_type.map((item, key) => {
|
|
|
|
|
this.props.data === undefined ? "" : this.props.shixunsDetails&&this.props.shixunsDetails.is_jupyter === true?this.props.data.shixun&&this.props.data.shixun.main_type.map((item, key) => {
|
|
|
|
|
let itemtype=item.type_name.toLowerCase().indexOf('jupyter'.toLowerCase())
|
|
|
|
|
if(itemtype>-1) {
|
|
|
|
|
return (
|
|
|
|
|
<Option value={item.id} key={key} name={item.description}>
|
|
|
|
|
<Tooltip placement="right" title={item.description === "" ? "无描述" : item.description}>
|
|
|
|
@ -849,7 +854,23 @@ class Shixuninformation extends Component {
|
|
|
|
|
</Tooltip>
|
|
|
|
|
</Option>
|
|
|
|
|
)
|
|
|
|
|
})
|
|
|
|
|
}
|
|
|
|
|
}):""
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
{
|
|
|
|
|
this.props.data === undefined ? "" : this.props.shixunsDetails&&this.props.shixunsDetails.is_jupyter === false?this.props.data.shixun&&this.props.data.shixun.main_type.map((item, key) => {
|
|
|
|
|
let itemtype=item.type_name.toLowerCase().indexOf('jupyter'.toLowerCase())
|
|
|
|
|
if(itemtype===-1) {
|
|
|
|
|
return (
|
|
|
|
|
<Option value={item.id} key={key} name={item.description}>
|
|
|
|
|
<Tooltip placement="right" title={item.description === "" ? "无描述" : item.description}>
|
|
|
|
|
{item.type_name}
|
|
|
|
|
</Tooltip>
|
|
|
|
|
</Option>
|
|
|
|
|
)
|
|
|
|
|
}
|
|
|
|
|
}):""
|
|
|
|
|
}
|
|
|
|
|
</Select>
|
|
|
|
|
|
|
|
|
|