add:增加全局loading

This commit is contained in:
chenpingsen
2024-08-22 16:00:04 +08:00
parent ca74de5b37
commit 7b4f22222d
18 changed files with 401 additions and 251 deletions

View File

@@ -3,18 +3,14 @@
<div class="lighting-img-box" :class="{ lightingImgBox1: thisFloor == '2' }">
<!-- 左上角区域切换 -->
<div class="btn-box">
<a-popconfirm
<button
v-for="(item, index) in floorData"
:key="index"
title="切换楼层将取消当前的所有修改项"
ok-text="确定"
cancel-text="取消"
placement="bottomLeft"
@confirm="changeFloor(item.childList, item.dataCode)">
<button class="btn-item" :class="{ btnActive: item.dataCode == thisFloor }">{{
item.name
}}</button>
</a-popconfirm>
class="btn-item"
:class="{ btnActive: item.dataCode == thisFloor }"
@click="changeFloor(item.childList, item.dataCode)"
>{{ item.name }}</button
>
</div>
<!-- 楼层区域 -->
<div class="area">
@@ -84,6 +80,7 @@
import { lightingManage } from '/@/api/IlluminationInfo';
// ICON
import { DoubleLeftOutlined, DoubleRightOutlined } from '@ant-design/icons-vue';
import { message, Modal } from 'ant-design-vue';
// 全局变量
import { items } from '/@/store/item';
@@ -110,23 +107,30 @@
// 左上角分层切换
const changeFloor = (area: any, floor: string) => {
if (floor == thisFloor.value) {
return;
return message.info('已选择此楼层');
}
// 切换前还原修改内容
tabs1Ref.value.refresh(false);
// 清空设备点阵
bulbs.value = [];
thisFloor.value = floor;
getBulbs();
// 重置数据
reset();
// 重置视图
changeArea(['1']);
// 切换楼层数据
treeData.value = area;
// 默认选择第一项
treeData.value[0].selected = true;
tabs1Ref.value.changeArea(treeData.value[0]);
Modal.confirm({
title: '提示信息',
content: '切换楼层会放弃已保存的修改内容',
onOk() {
// 切换前还原修改内容
tabs1Ref.value.refresh(false);
// 清空设备点阵
bulbs.value = [];
thisFloor.value = floor;
getBulbs();
// 重置数据
reset();
// 重置视图
changeArea(['1']);
// 切换楼层数据
treeData.value = area;
// 默认选择第一项
treeData.value[0].selected = true;
tabs1Ref.value.changeArea(treeData.value[0]);
},
onCancel() {},
});
};
// 分区业务 =====================================================