From bf5194fe2fd5cc37be66823189e897251de234a3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9D=A8=E6=A0=91=E6=98=8E?= <775174143@qq.com> Date: Fri, 13 Dec 2019 11:38:11 +0800 Subject: [PATCH] =?UTF-8?q?=E8=B0=83=E6=95=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- public/react/src/modules/tpm/TPMBanner.js | 2 +- .../tpm/TPMsettings/LearningSettings.js | 2 +- .../tpm/TPMsettings/Shixuninformation.js | 36 +++++++++++---- .../src/modules/tpm/newshixuns/Newshixuns.js | 44 ++++++++++++++----- 4 files changed, 63 insertions(+), 21 deletions(-) diff --git a/public/react/src/modules/tpm/TPMBanner.js b/public/react/src/modules/tpm/TPMBanner.js index af14b25ab..2998ab0a8 100644 --- a/public/react/src/modules/tpm/TPMBanner.js +++ b/public/react/src/modules/tpm/TPMBanner.js @@ -909,7 +909,7 @@ class TPMBanner extends Component { {shixunsDetails.shixun_status === 0 && this.props.identity < 5 ? 申请发布 : "" + id="challenge_begin">发布 : "" }
diff --git a/public/react/src/modules/tpm/TPMsettings/Shixuninformation.js b/public/react/src/modules/tpm/TPMsettings/Shixuninformation.js index ca12058ba..2e2b01708 100644 --- a/public/react/src/modules/tpm/TPMsettings/Shixuninformation.js +++ b/public/react/src/modules/tpm/TPMsettings/Shixuninformation.js @@ -841,15 +841,33 @@ class Shixuninformation extends Component { > { - this.props.data === undefined ? "" : this.props.data.shixun&&this.props.data.shixun.main_type.map((item, key) => { - return ( - - ) - }) + this.props.data === undefined ? "" : 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 ( + + ) + } + }):"" + } + + { + this.props.data === undefined ? "" : 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 ( + + ) + } + }):"" } diff --git a/public/react/src/modules/tpm/newshixuns/Newshixuns.js b/public/react/src/modules/tpm/newshixuns/Newshixuns.js index 3cdbff1c5..c2ec0d5ef 100644 --- a/public/react/src/modules/tpm/newshixuns/Newshixuns.js +++ b/public/react/src/modules/tpm/newshixuns/Newshixuns.js @@ -32,6 +32,7 @@ class Newshixuns extends Component { run_method: undefined, postapplyvisible: undefined, fileList: [], + Radiovalue:"1" } } @@ -85,6 +86,9 @@ class Newshixuns extends Component { this.setState({ Radiovalue: e.target.value, }); + this.props.form.setFieldsValue({ + is_jupyter: e.target.value, + }); }; handleSubmit = (e) => { @@ -535,16 +539,36 @@ class Newshixuns extends Component { defaultOpen={false} > { - newshixunlist === undefined ? "" : newshixunlist.main_type.map((item, key) => { - return ( - - ) - }) + newshixunlist === undefined ? "" : this.state.Radiovalue==="2"?newshixunlist.main_type.map((item, key) => { + let itemtype=item.type_name.toLowerCase().indexOf('jupyter'.toLowerCase()) + if(itemtype>-1){ + return ( + + ) + } + + }):"" + } + { + newshixunlist === undefined ? "" : this.state.Radiovalue==="1"?newshixunlist.main_type.map((item, key) => { + let itemtype=item.type_name.toLowerCase().indexOf('jupyter'.toLowerCase()) + if(itemtype===-1){ + return ( + + ) + } + + }):"" }