From d4f409b54ea2efcb7964830b8240482aac651ac5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9D=A8=E6=A0=91=E6=98=8E?= <775174143@qq.com> Date: Wed, 28 Aug 2019 17:32:05 +0800 Subject: [PATCH] =?UTF-8?q?=E6=9C=8D=E5=8A=A1=E5=99=A8=E9=85=8D=E7=BD=AE?= =?UTF-8?q?=E8=B0=83=E6=95=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../modules/tpm/TPMsettings/TPMsettings.js | 65 +++++++++++++++---- .../src/modules/tpm/newshixuns/Newshixuns.js | 8 ++- 2 files changed, 59 insertions(+), 14 deletions(-) diff --git a/public/react/src/modules/tpm/TPMsettings/TPMsettings.js b/public/react/src/modules/tpm/TPMsettings/TPMsettings.js index 50358aba6..839638344 100644 --- a/public/react/src/modules/tpm/TPMsettings/TPMsettings.js +++ b/public/react/src/modules/tpm/TPMsettings/TPMsettings.js @@ -560,13 +560,32 @@ export default class TPMsettings extends Component { } bigClass = (value) => { + // choice_main_type + // choice_small_type + let {settingsData,shixun_service_configs,choice_main_type,choice_small_type}=this.state; + + let list=[] + list.push(choice_main_type) + choice_small_type.map((item,key)=>{ + list.push(item) + }) + + let newshixun_service_configs=shixun_service_configs; + + let newshixun_service_configsagin=[] + + newshixun_service_configs.map((item,key)=>{ + list.map((its,index)=>{ + if(item.mirror_repository_id===its){ + newshixun_service_configsagin.push(item) + } + }) + }) - let {settingsData,shixun_service_configs}=this.state; - let newshixun_service_configs=shixun_service_configs; settingsData.shixun.main_type.some((item,key)=> { if (item.id === value) { - newshixun_service_configs[0]={ + newshixun_service_configsagin[0]={ mirror_repository_id:value, name:item.type_name, cpu_limit:1, @@ -586,8 +605,8 @@ export default class TPMsettings extends Component { choice_main_type: value, standard_scripts:response.data, choice_standard_scripts:null, - shixun_service_configs:newshixun_service_configs, - shixun_service_configlist:newshixun_service_configs, + shixun_service_configs:newshixun_service_configsagin, + shixun_service_configlist:newshixun_service_configsagin, }) } }).catch((error) => { @@ -628,7 +647,7 @@ export default class TPMsettings extends Component { } littleClass = (value) => { - let {settingsData,shixun_service_configs,choice_small_type}=this.state; + let {settingsData,shixun_service_configs,choice_small_type,choice_main_type}=this.state; let newshixun_service_configs=shixun_service_configs; let newchoice_small_type=choice_small_type; // if(Array.isArray(value)===true){ @@ -649,9 +668,26 @@ export default class TPMsettings extends Component { // ) // }) // } + + let list=[] + list.push(choice_main_type) + choice_small_type.map((item,key)=>{ + list.push(item) + }) + + let newshixun_service_configsagin=[] + + newshixun_service_configs.map((item,key)=>{ + list.map((its,index)=>{ + if(item.mirror_repository_id===its){ + newshixun_service_configsagin.push(item) + } + }) + }) + settingsData.shixun.small_type.some((items,keys)=> { if (items.id === value) { - newshixun_service_configs.push({ + newshixun_service_configsagin.push({ mirror_repository_id:value, name:items.type_name, cpu_limit:1, @@ -666,10 +702,11 @@ export default class TPMsettings extends Component { newchoice_small_type.push(value) + consoe.log(newshixun_service_configsagin) this.setState({ choice_small_type: newchoice_small_type, - shixun_service_configs:newshixun_service_configs, - shixun_service_configlist:newshixun_service_configs, + shixun_service_configs:newshixun_service_configsagin, + shixun_service_configlist:newshixun_service_configsagin, }) } onPodExistTimeChange = (e) => { @@ -1609,7 +1646,7 @@ export default class TPMsettings extends Component { settingsData === undefined ? "" : settingsData.shixun.main_type.map((item, key) => { return ( @@ -1738,7 +1775,11 @@ export default class TPMsettings extends Component { { settingsData === undefined ? "" : settingsData.shixun.small_type.map((item, key) => { return( - + ) }) } @@ -2189,7 +2230,7 @@ export default class TPMsettings extends Component {
{item.name} - this.Deselectlittle(item.mirror_repository_id)}> + {/*this.Deselectlittle(item.mirror_repository_id)}>*/}