From cb555a91f74a97d439e92ff3fae01e5650566f25 Mon Sep 17 00:00:00 2001 From: hz Date: Thu, 11 Dec 2025 12:11:02 +0800 Subject: [PATCH] =?UTF-8?q?fix(lan):=20=E4=BF=AE=E5=A4=8D=E5=B1=80?= =?UTF-8?q?=E5=9F=9F=E7=BD=91=E6=9C=8D=E5=8A=A1=E6=A3=80=E6=B5=8B=E9=80=BB?= =?UTF-8?q?=E8=BE=91=E4=B8=8E=E6=98=BE=E7=A4=BA=E6=8E=A7=E5=88=B6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - 将 `v-if` 替换为 `v-show` 以避免组件重复创建 - 使用 `.sync` 修饰符替代 `value` 事件进行双向绑定 - 调整检测超时逻辑,超时后设置为检测成功 - 网络响应失败时正确同步状态值 - 移除模板中冗余的条件渲染包装元素 --- src/components/LanServiceChecker.vue | 8 +++----- src/views/portal/case/AICall.vue | 6 +++--- 2 files changed, 6 insertions(+), 8 deletions(-) diff --git a/src/components/LanServiceChecker.vue b/src/components/LanServiceChecker.vue index b8950574..16431e53 100644 --- a/src/components/LanServiceChecker.vue +++ b/src/components/LanServiceChecker.vue @@ -20,7 +20,7 @@ export default { methods: { syncValue(val) { this.loading = false - this.$emit('value', val) + this.$emit('update:value', val) }, /**局域网检测*/ lanServiceCheck() { @@ -30,7 +30,7 @@ export default { const controller = new AbortController(); const timeoutId = setTimeout(() => { controller.abort(); - this.syncValue(false); + this.syncValue(true); }, 1000); // 拼接随机参数(时间戳+随机数,确保URL唯一,防止缓存) @@ -43,7 +43,7 @@ export default { }) .then(response => { clearTimeout(timeoutId); - response.ok ? this.syncValue(true) : this.syncValue(false); + this.syncValue(!response.ok) }) .catch(error => { clearTimeout(timeoutId); @@ -58,14 +58,12 @@ export default { diff --git a/src/views/portal/case/AICall.vue b/src/views/portal/case/AICall.vue index 31ba0428..57a208c4 100644 --- a/src/views/portal/case/AICall.vue +++ b/src/views/portal/case/AICall.vue @@ -37,11 +37,11 @@ -
- +
+
-
+