From 05bb62752be33afe2d32f59db837a53591f3aab3 Mon Sep 17 00:00:00 2001 From: chenpingsen Date: Wed, 21 Aug 2024 17:54:27 +0800 Subject: [PATCH] =?UTF-8?q?add:=E5=A2=9E=E5=8A=A0=E4=B8=80=E4=B8=AA?= =?UTF-8?q?=E5=85=A8=E5=B1=80=E7=9A=84loading?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- hx-ai-intelligent/src/store/item.ts | 27 ++++++++++++++++++++-- .../ventilationSystem/components/boxModel.vue | 6 ++--- .../equipmentControl/ventilationSystem/index.vue | 8 +++---- 3 files changed, 31 insertions(+), 10 deletions(-) diff --git a/hx-ai-intelligent/src/store/item.ts b/hx-ai-intelligent/src/store/item.ts index f3c2b57..c4e87f8 100644 --- a/hx-ai-intelligent/src/store/item.ts +++ b/hx-ai-intelligent/src/store/item.ts @@ -1,4 +1,5 @@ import { defineStore } from 'pinia'; +import { ref } from 'vue'; export const items = defineStore({ id: 'items', @@ -10,10 +11,32 @@ export const items = defineStore({ projectId: 'HLlmTZp8', // 站点ID siteId: undefined, + // 全局loading状态 + isLoading: ref(false), }; }, getters: { - double: (state: any) => state.count * 2, + // double: (state: any) => state.count * 2, + }, + actions: { + // 设置全局loading + setLoading(bool: boolean) { + if (bool == this.isLoading) { + return; + } + // loading在此框架的设定内,无法高于drawer(抽屉) + // 但操作逻辑又集中在drawer中,此处只能操作DOM + const dom: any = document.querySelector('.ant-spin-nested-loading'); + if (bool) { + // 抽屉的高度为 999 + dom.style.zIndex = '1111'; + } else { + dom.style.zIndex = ''; + } + this.isLoading = bool; + setTimeout(() => { + this.setLoading(false); + }, 5000); + }, }, - actions: {}, }); diff --git a/hx-ai-intelligent/src/view/equipmentControl/ventilationSystem/components/boxModel.vue b/hx-ai-intelligent/src/view/equipmentControl/ventilationSystem/components/boxModel.vue index 451ba2e..3c2d4c6 100644 --- a/hx-ai-intelligent/src/view/equipmentControl/ventilationSystem/components/boxModel.vue +++ b/hx-ai-intelligent/src/view/equipmentControl/ventilationSystem/components/boxModel.vue @@ -60,7 +60,7 @@ v-if="runMode.value == 2 || runMode.value == 4" src="../../image/liftState/wind-hot.svg" alt="" /> - + @@ -93,9 +93,7 @@ const switchStatus = computed(() => { return props.dataSource.record.switchStatus; }); - onMounted(() => { - console.log(props.dataSource, 'pppppppppppp'); - }); + onMounted(() => {});