|
|
|
@ -45,7 +45,7 @@ class Shixuninformation extends Component {
|
|
|
|
|
Compilecommandvalue: "",
|
|
|
|
|
shixun_service_configs: undefined,
|
|
|
|
|
fileList:[],
|
|
|
|
|
loading:false
|
|
|
|
|
loading:false,
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
@ -57,35 +57,35 @@ class Shixuninformation extends Component {
|
|
|
|
|
if (prevProps.data != this.props.data) {
|
|
|
|
|
if (this.props.data) {
|
|
|
|
|
this.setState({
|
|
|
|
|
shixunName: this.props.data.shixun.name,
|
|
|
|
|
trainee: this.props.data.shixun.trainee,
|
|
|
|
|
choice_main_type: this.props.data.shixun.choice_main_type,
|
|
|
|
|
choice_small_type: this.props.data.shixun.choice_small_type,
|
|
|
|
|
choice_standard_scripts: this.props.data.shixun.choice_standard_scripts,
|
|
|
|
|
shixunmemoMDvalue: this.props.data.shixun.evaluate_script,
|
|
|
|
|
simichecked: this.props.data.shixun.is_secret_repository,
|
|
|
|
|
shixun_service_configs: this.props.data.shixun.shixun_service_configs,
|
|
|
|
|
standard_scripts:this.props.data.shixun.standard_scripts,
|
|
|
|
|
shixun_service_configlist:this.props.data.shixun.shixun_service_configs,
|
|
|
|
|
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.choice_standard_scripts===null){
|
|
|
|
|
if(this.props.data.shixun&&this.props.data.shixun.choice_standard_scripts===null){
|
|
|
|
|
this.setState({
|
|
|
|
|
choice_standard_scripts:{id: this.props.data.shixun.standard_scripts[0].id, value: ""},
|
|
|
|
|
choice_standard_scriptssum:this.props.data.shixun.standard_scripts[0].id
|
|
|
|
|
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
|
|
|
|
|
})
|
|
|
|
|
this.props.form.setFieldsValue({
|
|
|
|
|
selectscripts:this.props.data.shixun.standard_scripts[0].id
|
|
|
|
|
selectscripts:this.props.data.shixun&&this.props.data.shixun.standard_scripts[0].id
|
|
|
|
|
})
|
|
|
|
|
this.get_mirror_script(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.props.form.setFieldsValue({
|
|
|
|
|
selectscripts:this.props.data.shixun.choice_standard_scripts
|
|
|
|
|
selectscripts:this.props.data.shixun&&this.props.data.shixun.choice_standard_scripts
|
|
|
|
|
})
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
let newlist = ""
|
|
|
|
|
this.props.data.shixun.choice_small_type.map((item, key) => {
|
|
|
|
|
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) {
|
|
|
|
|
newlist = newlist + `${i.description}`
|
|
|
|
@ -96,8 +96,8 @@ class Shixuninformation extends Component {
|
|
|
|
|
subvalues: newlist
|
|
|
|
|
})
|
|
|
|
|
|
|
|
|
|
this.props.data.shixun.main_type.map((item,key)=>{
|
|
|
|
|
if(item.id===this.props.data.shixun.choice_main_type){
|
|
|
|
|
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.setState({
|
|
|
|
|
mainvalues:item.description,
|
|
|
|
|
})
|
|
|
|
@ -105,12 +105,12 @@ class Shixuninformation extends Component {
|
|
|
|
|
})
|
|
|
|
|
|
|
|
|
|
this.props.form.setFieldsValue({
|
|
|
|
|
name: this.props.data.shixun.name,
|
|
|
|
|
trainee: this.props.data.shixun.trainee,
|
|
|
|
|
selectleft: this.props.data.shixun.choice_main_type,
|
|
|
|
|
selectright:this.props.data.shixun.choice_small_type,
|
|
|
|
|
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,
|
|
|
|
|
})
|
|
|
|
|
this.contentMdRef.current.setValue(this.props.data.shixun.description);
|
|
|
|
|
this.contentMdRef.current.setValue(this.props.data.shixun&&this.props.data.shixun.description);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
@ -681,7 +681,7 @@ class Shixuninformation extends Component {
|
|
|
|
|
axios.put(url, data).then((result) => {
|
|
|
|
|
if (result) {
|
|
|
|
|
if (result.data) {
|
|
|
|
|
this.props.getdatas()
|
|
|
|
|
this.props.getdatas("2")
|
|
|
|
|
if(result.data.shixun_identifier){
|
|
|
|
|
this.props.showNotification("基本信息更新成功!")
|
|
|
|
|
this.setState({
|
|
|
|
@ -838,7 +838,7 @@ class Shixuninformation extends Component {
|
|
|
|
|
>
|
|
|
|
|
|
|
|
|
|
{
|
|
|
|
|
this.props.data === undefined ? "" : this.props.data.shixun.main_type.map((item, key) => {
|
|
|
|
|
this.props.data === undefined ? "" : this.props.data.shixun&&this.props.data.shixun.main_type.map((item, key) => {
|
|
|
|
|
return (
|
|
|
|
|
<Option value={item.id} key={key} name={item.description}>
|
|
|
|
|
<Tooltip placement="right" title={item.description === "" ? "无描述" : item.description}>
|
|
|
|
@ -867,7 +867,7 @@ class Shixuninformation extends Component {
|
|
|
|
|
<div className=" fl pr mr20">
|
|
|
|
|
<Select placeholder="请选择小类别"
|
|
|
|
|
mode="multiple"
|
|
|
|
|
value={this.state.choice_small_type.length === 0 || this.state.choice_small_type[0] === "" || this.state.choice_small_type === [] ? undefined : this.state.choice_small_type}
|
|
|
|
|
value={!this.state.choice_small_type?undefined:this.state.choice_small_type.length === 0 || this.state.choice_small_type[0] === "" || this.state.choice_small_type === [] ? undefined : this.state.choice_small_type}
|
|
|
|
|
style={{width: 200}}
|
|
|
|
|
disabled={operateauthority ? false : true}
|
|
|
|
|
onDeselect={operateauthority ? this.Deselectlittle : ""}
|
|
|
|
@ -876,7 +876,7 @@ class Shixuninformation extends Component {
|
|
|
|
|
defaultOpen={false}
|
|
|
|
|
>
|
|
|
|
|
{
|
|
|
|
|
this.props.data === undefined ? "" : this.props.data.shixun.small_type.map((item, key) => {
|
|
|
|
|
this.props.data === undefined ? "" : this.props.data.shixun&&this.props.data.shixun.small_type.map((item, key) => {
|
|
|
|
|
return (
|
|
|
|
|
<Option value={item.id} key={key} name={item.description}>
|
|
|
|
|
<Tooltip placement="right" title={item.description === "" ? "无描述" : item.description}>
|
|
|
|
@ -1251,7 +1251,7 @@ class Shixuninformation extends Component {
|
|
|
|
|
</div>
|
|
|
|
|
{this.props.identity < 5 ?
|
|
|
|
|
<Bottomsubmit {...this.props} {...this.state} url={`/shixuns/${this.props.match.params.shixunId}/challenges`}
|
|
|
|
|
onSubmits={this.onSubmits} loadings={this.state.loading} /> : ""}
|
|
|
|
|
onSubmits={this.onSubmits} loadings={this.state.loading} bottomvalue={"下一步"} /> : ""}
|
|
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
);
|
|
|
|
|