From c6836cad06f56d3a42118ff0a18c1b8a8e4030aa Mon Sep 17 00:00:00 2001 From: caozehui <2427765068@qq.com> Date: Fri, 27 Dec 2024 13:36:20 +0800 Subject: [PATCH] =?UTF-8?q?=E5=BE=AE=E8=B0=83?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- frontend/src/api/check/interface/index.ts | 2 +- frontend/src/views/home/components/test.vue | 20 +++++++++++--------- 2 files changed, 12 insertions(+), 10 deletions(-) diff --git a/frontend/src/api/check/interface/index.ts b/frontend/src/api/check/interface/index.ts index a4b2a1c..d75db35 100644 --- a/frontend/src/api/check/interface/index.ts +++ b/frontend/src/api/check/interface/index.ts @@ -54,7 +54,7 @@ export namespace CheckData { LOADING = 0, SUCCESS = 1, FAIL = 2, - UNCONNECTED=3, + UNCONNECTED = 3, ERRORDATA = 4 } diff --git a/frontend/src/views/home/components/test.vue b/frontend/src/views/home/components/test.vue index 99ccac6..80e9b05 100644 --- a/frontend/src/views/home/components/test.vue +++ b/frontend/src/views/home/components/test.vue @@ -110,7 +110,7 @@ -
+

@@ -195,7 +195,7 @@ const testStatus = toRef(props, 'testStatus') const webMsgSend = toRef(props, 'webMsgSend') const resultDialogVisible = ref(false) -const scrollContainer = ref(null); +const scrollContainerRef = ref(); const dataCheckSingleChannelSingleTestPopupRef = ref>() @@ -228,7 +228,7 @@ const checkResultView = computed(() => { tempChnBtnResult.push({color: CheckData.ButtonColorEnum.INFO, icon: 'Minus'}) break; case CheckData.ChnCheckResultEnum.LOADING: - tempChnBtnResult.push({color: CheckData.ButtonColorEnum.INFO, icon: 'Loading'}) + tempChnBtnResult.push({color: CheckData.ButtonColorEnum.LOADING, icon: 'Loading'}) break; case CheckData.ChnCheckResultEnum.SUCCESS: tempChnBtnResult.push({color: CheckData.ButtonColorEnum.SUCCESS, icon: 'CircleCheckFilled'}) @@ -256,7 +256,7 @@ const checkResultView = computed(() => { tempChnBtnResult.push({color: CheckData.ButtonColorEnum.INFO, icon: 'Minus'}) break; case CheckData.ChnCheckResultEnum.LOADING: - tempChnBtnResult.push({color: CheckData.ButtonColorEnum.INFO, icon: 'Loading'}) + tempChnBtnResult.push({color: CheckData.ButtonColorEnum.LOADING, icon: 'Loading'}) break; case CheckData.ChnCheckResultEnum.SUCCESS: tempChnBtnResult.push({color: CheckData.ButtonColorEnum.SUCCESS, icon: 'CircleCheckFilled'}) @@ -470,7 +470,6 @@ watch(webMsgSend, function (newValue, oldValue) { // 更新进度条 const updatePercentage = () => { - console.log('updatePercentage',activeIndex, checkTotal) if (activeIndex < checkTotal) { percentage.value = Math.trunc(activeIndex / checkTotal * 100); } else { @@ -498,7 +497,8 @@ onBeforeMount(() => { initCheckResult() // todo 可移除start - randomUnConnectedRaw = getRandomInt(scriptData.length) + 1 + let a = getRandomInt(scriptData.length) + 4 + randomUnConnectedRaw = a < scriptData.length ? a : scriptData.length randomUnConnectedDeviceId = deviceList[getRandomInt(deviceList.length)].deviceId randomErrorDataRaw = getRandomInt(scriptData.length) + 1 while (randomErrorDataRaw === randomUnConnectedRaw) { @@ -507,6 +507,7 @@ onBeforeMount(() => { // todo 可移除end }) + const showTestLog = () => { drawer.value = true } @@ -600,8 +601,9 @@ const updateCheckResult = (data: CheckData.ScriptChnItem) => { } const scrollToBottom = () => { - if (scrollContainer.value) { - scrollContainer.value.scrollTop = scrollContainer.value.scrollHeight; + if (scrollContainerRef.value) { + scrollContainerRef.value.scrollTop = scrollContainerRef.value.scrollHeight; + console.log(scrollContainerRef.value.scrollTop) } }; @@ -773,7 +775,7 @@ const getCheckResult = (scriptId: string) => { tempChnResult.push(CheckData.ChnCheckResultEnum.SUCCESS) } let randomNum = getRandomInt(item.chnNum * 2) - if (randomNum < item.chnNum) { + if (randomNum < item.chnNum && activeIndex >= 4 && activeIndex <= 8) { tempChnResult[randomNum] = CheckData.ChnCheckResultEnum.FAIL errorCheckItem.push({scriptId, type: 'error'}) }