监控中心添加loading

This commit is contained in:
fks-yangshouda
2024-09-03 17:22:50 +08:00
parent 360ec9e6e8
commit 190ec589ce
2 changed files with 62 additions and 18 deletions

View File

@@ -93,6 +93,8 @@
import { deviceMonitor } from '/@/api/monitor';
import { Item } from 'ant-design-vue/lib/menu';
import { dict, getEnum } from '/@/api';
// 全局变量
import { items } from '/@/store/item';
export default defineComponent({
// eslint-disable-next-line vue/multi-word-component-names
@@ -101,6 +103,8 @@
const select = ref<HTMLElement | null>(null);
const divWidth = ref(0); // 用于存储 div 的宽度
// 全局变量
const state = items();
// 获取 div 的宽度
// const getDivWidth = () => {
// if (select.value) {
@@ -282,6 +286,7 @@
// 查询数据后放入pageData
const getSelect = () => {
state.setLoading(true);
pageData.tableList = [];
pageData.tableColumns = [];
@@ -324,6 +329,9 @@
pageData.graphList = res.data.graphData;
pageData.XData = res.data.XData;
})
.finally(() => {
state.setLoading(false);
});
};