From a49c3d3c9e3a81769a4c0c1c8126e3ac541ad7b3 Mon Sep 17 00:00:00 2001 From: weike Date: Wed, 26 Jun 2024 14:05:31 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E5=A4=9A=E6=AC=A1=E7=82=B9?= =?UTF-8?q?=E5=87=BB=E4=B8=8B=E4=B8=80=E6=AD=A5=E6=8C=89=E9=92=AE,?= =?UTF-8?q?=E9=A1=B5=E9=9D=A2=E8=87=AA=E5=8A=A8=E5=90=91=E5=90=8E=E8=B7=B3?= =?UTF-8?q?=E9=97=AE=E9=A2=98:=20=E7=82=B9=E5=87=BB=E4=B9=8B=E5=90=8E?= =?UTF-8?q?=E7=A6=81=E7=94=A8=E6=8C=89=E9=92=AE,=E8=B7=B3=E8=BD=AC?= =?UTF-8?q?=E4=B9=8B=E5=90=8E=E5=86=8D=E5=90=AF=E7=94=A8=E6=8C=89=E9=92=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../deploy/deployWindowMain.ts | 65 ++++++++++--------- 1 file changed, 35 insertions(+), 30 deletions(-) diff --git a/src/vs/code/electron-sandbox/deploy/deployWindowMain.ts b/src/vs/code/electron-sandbox/deploy/deployWindowMain.ts index 0e4c8549..fb895c88 100644 --- a/src/vs/code/electron-sandbox/deploy/deployWindowMain.ts +++ b/src/vs/code/electron-sandbox/deploy/deployWindowMain.ts @@ -351,14 +351,14 @@ class deployWindow { x[n].style.display = 'flex'; //... and fix the Previous/Next buttons: if (n === 0) { - document.getElementById('prevStep')!.style.display = 'none'; + this.prevBtn!.style.display = 'none'; } else { - document.getElementById('prevStep')!.style.display = 'inline'; + this.prevBtn!.style.display = 'inline'; } if (n === (x.length - 1)) { - document.getElementById('nextStep')!.innerHTML = '确定'; + this.nextBtn!.innerHTML = '确定'; } else { - document.getElementById('nextStep')!.innerHTML = "下一步"; + this.nextBtn!.innerHTML = "下一步"; } } @@ -432,6 +432,10 @@ class deployWindow { } async nextPrev(n: number) { + + this.nextBtn!.disabled = true; + this.prevBtn!.disabled = true; + // This function will figure out which tab to display // let x = document.getElementsByClassName('tab'); // Exit the function if any field in the current tab is invalid: @@ -466,6 +470,7 @@ class deployWindow { console.log("renderer send kylinide.installWizard.init.configSelect"); let result = await ipcRenderer.invoke('kylinide.installWizard.init.configSelect', data); if (result === void 0) { + this.prevBtn!.disabled = false; return; } const parentdiv = document.getElementById('osInfo') as HTMLDivElement; @@ -498,6 +503,7 @@ class deployWindow { let result = await ipcRenderer.invoke('kylinide.installWizard.init.configGetValue', data); if (result === void 0) { console.log("kylinide.installWizard.init.configGetValue result is void"); + this.prevBtn!.disabled = false; return; } console.log("kylinide.installWizard.init configGetValue depInfoData:" + result.depInfoData) @@ -512,16 +518,6 @@ class deployWindow { this.setFisrtClass(depInfoData, result.selectKey); this.extAddressPath = result.extAddressPath; - let checkboxForm = document.getElementById("checkboxForm"); - //设置下一步按钮显示状态 - let selectedCheckboxes = checkboxForm?.querySelectorAll('input[type="checkbox"]:checked'); - // console.log("aaa+" + selectedCheckboxes.length); - if (selectedCheckboxes && selectedCheckboxes.length > 1) { - this.nextBtn!.disabled = false; - } else { - this.nextBtn!.disabled = true; - } - } else if (this.onlineInstallTabArray[this.onlineInstallTabArrayIndex] === "onlineInstallTab3") { const checkboxForm = document.getElementById("checkboxForm"); console.log("nextPrev onlineInstallTab3"); @@ -588,6 +584,7 @@ class deployWindow { console.log("renderer send kylinide.installWizard.init httpVerify"); let result = await ipcRenderer.invoke('kylinide.installWizard.init.httpVerify'); if (result === void 0) { + this.prevBtn!.disabled = false; console.log("kylinide.installWizard.init.httpVerify result is void"); return; } @@ -598,13 +595,10 @@ class deployWindow { } this.onlineInstallTabArrayIndex = this.onlineInstallTabArrayIndex + 1; this.showTabFromIndex(this.onlineInstallTabArray, this.onlineInstallTabArrayIndex); - if (this.nextBtn) - this.nextBtn.disabled = true; - if (this.prevBtn) - this.prevBtn.disabled = true; let configData = await ipcRenderer.invoke('kylinide.installWizard.init.configVersify', { type: "configVersify" }); console.log("kylinide.installWizard.init configVersify "); if (configData === void 0) { + this.prevBtn!.disabled = false; console.log("kylinide.installWizard.init.configVersify result is void"); return; } @@ -631,23 +625,35 @@ class deployWindow { parentdiv.innerHTML = configData.message; } } - if (this.nextBtn && this.prevBtn) { - this.nextBtn.disabled = false; - this.prevBtn.disabled = false; - } this.nextPrev(1); } else { this.custom_print("nextPrev this.onlineInstallTabArrayIndex != 0") + + if (this.onlineInstallTabArray[this.onlineInstallTabArrayIndex] === "onlineInstallTab2") { + let checkboxForm = document.getElementById("checkboxForm"); + //设置下一步按钮显示状态 + let selectedCheckboxes = checkboxForm?.querySelectorAll('input[type="checkbox"]:checked'); + // console.log("aaa+" + selectedCheckboxes.length); + if (selectedCheckboxes && selectedCheckboxes.length > 1) { + this.nextBtn!.disabled = false; + } else { + this.nextBtn!.disabled = true; + } + } else { + this.nextBtn!.disabled = false; + } + let preTab = document.getElementById(this.onlineInstallTabArray[this.onlineInstallTabArrayIndex]) as HTMLDivElement; preTab.style.display = 'none'; this.onlineInstallTabArrayIndex = this.onlineInstallTabArrayIndex + n; this.showTabFromIndex(this.onlineInstallTabArray, this.onlineInstallTabArrayIndex); + this.prevBtn!.disabled = false; } } // if (onlineInstallTabArray[onlineInstallTabArrayIndex] === "onlineInstallTab3") { - // document.getElementById('nextStep').disabled = true; - // document.getElementById('nextStep').innerHTML = setLanguage('okStep'); + // this.nextBtn!.disabled = true; + // this.nextBtn!.innerHTML = setLanguage('okStep'); // } if (this.onlineInstallTabArray[this.onlineInstallTabArrayIndex] === "onlineInstallTab4") { @@ -762,12 +768,12 @@ class deployWindow { ipcRenderer.send('kylinide.installWizard.skipWizard'); }); - document.getElementById('prevStep')?.addEventListener('click', () => { + this.prevBtn!.addEventListener('click', () => { console.log('click prevStep'); this.Prev(-1); }); - document.getElementById('nextStep')?.addEventListener('click', () => { + this.nextBtn!.addEventListener('click', () => { console.log('click nextStep'); if (this.nextBtnInvokeCheck!.canInvoke()) { this.nextPrev(1); @@ -779,7 +785,7 @@ class deployWindow { ipcRenderer.send('kylinide.installWizard.msg.process', { type: "cancel" }); console.log("render send kylinide.installWizard.msg.process:cancel"); }); - document.getElementById('cancel')?.addEventListener('click', () => { + this.cancelBtn!.addEventListener('click', () => { console.log('click cancel'); // ipcRenderer.removeAllListeners('kylinide.installWizard.msg'); ipcRenderer.send('kylinide.installWizard.msg.process', { type: "cancel" }); @@ -843,8 +849,7 @@ class deployWindow { this.onlineInstallTabArrayIndex = this.onlineInstallTabArrayIndex + n; } if (this.onlineInstallTabArray[this.onlineInstallTabArrayIndex] === 'onlineInstallTab2') { - let bt = document.getElementById('nextStep') as HTMLButtonElement; - bt.disabled = false; + this.nextBtn!.disabled = false; } this.showTabFromIndex(this.onlineInstallTabArray, this.onlineInstallTabArrayIndex); } @@ -892,8 +897,8 @@ class deployWindow { let constent = ""; let flag = 0; for (let i = 0; i < jsonSelectKey.length; i++) { - console.log("json:" + firstClass[jsonSelectKey[i]]['zh_cn']); if (firstClass.hasOwnProperty(jsonSelectKey[i])) { + console.log("json:" + firstClass[jsonSelectKey[i]]['zh_cn']); flag++; constent += firstClass[jsonSelectKey[i]]['zh_cn'] + " "; installedPkg.push(firstClass[jsonSelectKey[i]]['zh_cn']);