Browse Source

add:增加一个全局的loading

temp
chenpingsen 3 months ago
parent
commit
05bb62752b
  1. 27
      hx-ai-intelligent/src/store/item.ts
  2. 6
      hx-ai-intelligent/src/view/equipmentControl/ventilationSystem/components/boxModel.vue
  3. 8
      hx-ai-intelligent/src/view/equipmentControl/ventilationSystem/index.vue

27
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: {},
});

6
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="" />
<img v-if="runMode.value == 0" src="../../image/liftState/switch-on.svg" alt="" />
<img v-if="runMode.value == 0" src="../../image/liftState/switch-off.svg" alt="" />
</div>
</div>
<!-- 冷风 热风 -->
@ -93,9 +93,7 @@
const switchStatus = computed(() => {
return props.dataSource.record.switchStatus;
});
onMounted(() => {
console.log(props.dataSource, 'pppppppppppp');
});
onMounted(() => {});
</script>
<style lang="less" scoped>
.box-model {

8
hx-ai-intelligent/src/view/equipmentControl/ventilationSystem/index.vue

@ -443,13 +443,13 @@
});
};
//
const sensorData = ref([]);
const sensorData = ref<any>([]);
// 湿
const humidityData = ref([]);
const humidityData = ref<any>([]);
// PM2.5
const pmData = ref([]);
const pmData = ref<any>([]);
//
const CO2Data = ref([]);
const CO2Data = ref<any>([]);
//
const fanData = ref([]);
//

Loading…
Cancel
Save