add:增加全局loading
This commit is contained in:
BIN
hx-ai-intelligent/public/asset/image/bulbLogo/fault.png
Normal file
BIN
hx-ai-intelligent/public/asset/image/bulbLogo/fault.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 5.8 KiB |
BIN
hx-ai-intelligent/public/asset/image/bulbLogo/fault1.png
Normal file
BIN
hx-ai-intelligent/public/asset/image/bulbLogo/fault1.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 5.1 KiB |
Binary file not shown.
Before Width: | Height: | Size: 5.8 KiB After Width: | Height: | Size: 5.8 KiB |
@@ -1,6 +1,8 @@
|
||||
<template>
|
||||
<a-config-provider :locale="locale">
|
||||
<a-spin :spinning="state.isLoading" size="large">
|
||||
<router-view />
|
||||
</a-spin>
|
||||
</a-config-provider>
|
||||
</template>
|
||||
|
||||
@@ -10,6 +12,7 @@
|
||||
import { useRouter } from 'vue-router';
|
||||
import Cookies from 'js-cookie';
|
||||
import { message } from 'ant-design-vue';
|
||||
import { items } from '/@/store/item';
|
||||
export default defineComponent({
|
||||
name: 'App',
|
||||
|
||||
@@ -37,6 +40,8 @@
|
||||
return {
|
||||
cachedViews,
|
||||
locale: zhCN,
|
||||
// 获得全局变量
|
||||
state: items(),
|
||||
};
|
||||
},
|
||||
});
|
||||
|
@@ -9,29 +9,29 @@
|
||||
device.regionName + ' > ' + device.deviceGroupName
|
||||
}}</span></div
|
||||
>
|
||||
<button class="right-button">{{
|
||||
record?.runStatus?.label ? record.runStatus.label : '--'
|
||||
<button class="right-button" :class="getClass(record)">{{
|
||||
record.runStatus.value != 0 ? record.runStatus.label : record.switchStatus.label
|
||||
}}</button>
|
||||
</div>
|
||||
<div class="light-tag-box">
|
||||
<div class="tag-box-item">
|
||||
<img src="/asset/image//bulbLogo/22496.png" alt="" />
|
||||
<span class="title">控制模式</span>
|
||||
<span class="title-text">控制模式</span>
|
||||
<span class="result">{{ record.autoStatus.label }}</span>
|
||||
</div>
|
||||
<div class="tag-box-item">
|
||||
<img src="/asset/image//bulbLogo/22496.png" alt="" />
|
||||
<span class="title">温度</span>
|
||||
<span class="title-text">温度</span>
|
||||
<span class="result">{{ record.temp + record.tempUnit }}</span>
|
||||
</div>
|
||||
<div class="tag-box-item">
|
||||
<img src="/asset/image//bulbLogo/22496.png" alt="" />
|
||||
<span class="title">控制场景</span>
|
||||
<span class="title-text">控制场景</span>
|
||||
<span class="result">{{ device.scene.label }}</span>
|
||||
</div>
|
||||
<div class="tag-box-item">
|
||||
<img src="/asset/image//bulbLogo/22496.png" alt="" />
|
||||
<span class="title">风速</span>
|
||||
<span class="title-text">风速</span>
|
||||
<span class="result">{{ record.windSpeed + record.windSpeedUnit }}</span>
|
||||
</div>
|
||||
</div>
|
||||
@@ -75,6 +75,23 @@
|
||||
const device = computed(() => props.device);
|
||||
// 设备信息
|
||||
const record = computed(() => props.device.record);
|
||||
|
||||
const getClass = (data: any) => {
|
||||
let state = data.runStatus.value;
|
||||
let isOpen = data.switchStatus.value;
|
||||
// 故障
|
||||
if (state == 1) {
|
||||
return 'button-fault';
|
||||
} else if (state == 2) {
|
||||
return 'button-repair';
|
||||
} else if (state == 3) {
|
||||
return 'button-alarm';
|
||||
} else if (state == 0 && isOpen == 1) {
|
||||
return 'button-on';
|
||||
} else if (state == 0 && isOpen == 0) {
|
||||
return 'button-off';
|
||||
}
|
||||
};
|
||||
</script>
|
||||
<style lang="less" scoped>
|
||||
.icon-box {
|
||||
@@ -116,9 +133,29 @@
|
||||
width: 5em;
|
||||
height: 26px;
|
||||
background: rgba(57, 215, 187, 0.1);
|
||||
border: 1px solid rgba(57, 215, 187, 1);
|
||||
border-width: 1px;
|
||||
border-style: solid;
|
||||
font-size: 12px;
|
||||
color: rgba(57, 215, 187, 1);
|
||||
}
|
||||
.button-on {
|
||||
color: #0dffa4;
|
||||
border-color: #0dffa4;
|
||||
}
|
||||
.button-off {
|
||||
color: #bfcde2;
|
||||
border-color: #bfcde2;
|
||||
}
|
||||
.button-repair {
|
||||
color: #ffbc46;
|
||||
border-color: #ffbc46;
|
||||
}
|
||||
.button-alarm {
|
||||
color: #f36163;
|
||||
border-color: #f36163;
|
||||
}
|
||||
.button-fault {
|
||||
color: #ff7636;
|
||||
border-color: #ff7636;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -140,9 +177,9 @@
|
||||
vertical-align: middle;
|
||||
}
|
||||
|
||||
.title {
|
||||
.title-text {
|
||||
position: absolute;
|
||||
left: 60px;
|
||||
left: 53px;
|
||||
top: 13px;
|
||||
color: rgba(64, 255, 252, 1);
|
||||
}
|
||||
|
@@ -269,7 +269,7 @@
|
||||
<script setup lang="ts">
|
||||
import { ref, computed, onMounted } from 'vue';
|
||||
import { DownOutlined, UpOutlined, StopOutlined } from '@ant-design/icons-vue';
|
||||
import { message } from 'ant-design-vue';
|
||||
import { message, Modal } from 'ant-design-vue';
|
||||
// 请求
|
||||
import { http } from '/nerv-lib/util/http';
|
||||
import { airConditionControl } from '/@/api/airConditionControlSystem';
|
||||
@@ -736,28 +736,23 @@
|
||||
if (!changeList.value.length && !lockList.value.length) {
|
||||
return message.info('未产生任何修改');
|
||||
}
|
||||
state.setLoading(true);
|
||||
http
|
||||
.get(planManage.getRunningPlan, {
|
||||
deviceType: 2,
|
||||
ctrlType: 2,
|
||||
projectId: state.projectId,
|
||||
siteId: state.siteId,
|
||||
})
|
||||
.then((res) => {
|
||||
// 如果有计划正在执行
|
||||
if (res.data && res.data.length) {
|
||||
state.setLoading(false);
|
||||
// 此处框架本身存在问题,弹出层在本地环境无法关闭,暂时使用浏览器自带的confirm方法
|
||||
// Modal.confirm({
|
||||
// title: '提示信息',
|
||||
// content: '有计划正在执行,点击"确定"将暂停当前计划',
|
||||
// onOk() {
|
||||
// return new Promise((resolve, reject) => {
|
||||
// });
|
||||
// },
|
||||
// onCancel() { },
|
||||
// });
|
||||
|
||||
let flag = window.confirm('有计划正在执行,点击"确定"将暂停当前计划');
|
||||
if (flag) {
|
||||
Modal.confirm({
|
||||
title: '提示信息',
|
||||
content: '有计划正在执行,点击"确定"将暂停当前计划',
|
||||
onOk() {
|
||||
state.setLoading(true);
|
||||
// 如果点击了确定,将先终止所有进行中的计划
|
||||
http
|
||||
.post(airConditionControl.submitChangeList, {
|
||||
@@ -767,16 +762,21 @@
|
||||
sceneList: [],
|
||||
})
|
||||
.then((res) => {
|
||||
console.log(res, '成功');
|
||||
// 如果重置成功,则获取修改前后对比数据
|
||||
if (res.retcode == 0) {
|
||||
sendChangeList();
|
||||
// 未成功提示
|
||||
} else {
|
||||
state.setLoading(false);
|
||||
message.error('关闭进行中的任务操作失败,请重新尝试');
|
||||
}
|
||||
})
|
||||
.catch(() => {
|
||||
state.setLoading(false);
|
||||
});
|
||||
},
|
||||
onCancel() {},
|
||||
});
|
||||
}
|
||||
// 没有计划正在执行,则直接请求
|
||||
} else {
|
||||
sendChangeList();
|
||||
@@ -793,6 +793,7 @@
|
||||
siteId: state.siteId,
|
||||
})
|
||||
.then((res) => {
|
||||
state.setLoading(false);
|
||||
if (res.retcode == 0) {
|
||||
diffList.value = res.data;
|
||||
executeVisible.value = true;
|
||||
@@ -800,7 +801,9 @@
|
||||
message.warning('获取修改内容失败');
|
||||
}
|
||||
})
|
||||
.catch(() => {});
|
||||
.catch(() => {
|
||||
state.setLoading(false);
|
||||
});
|
||||
};
|
||||
// 通用取消
|
||||
const changeCancel = () => {};
|
||||
|
@@ -30,7 +30,7 @@
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<tr v-for="(row, index) in dataSource" :key="index">
|
||||
<tr v-for="(row, index) in dataSource" v-show="row.executeStatus.value != 0" :key="index">
|
||||
<td>{{ index + 1 }}</td>
|
||||
<td>{{ row.startTime }}</td>
|
||||
<td>{{ row.planName }}</td>
|
||||
@@ -162,7 +162,7 @@
|
||||
projectId: state.projectId,
|
||||
siteId: state.siteId,
|
||||
// 设备类型(1照明,2空调,3排风扇,4风幕机,5电动窗,6进水阀,7排水泵)
|
||||
deviceType: 2,
|
||||
ctrlType: 2,
|
||||
})
|
||||
.then((res) => {
|
||||
dataSource.value = res.data;
|
||||
@@ -184,6 +184,10 @@
|
||||
};
|
||||
// 将对表格的修改统一发送
|
||||
const sendTable = () => {
|
||||
if (!dataSource.value.length) {
|
||||
return message.info('没有任何数据可以提交');
|
||||
}
|
||||
state.setLoading(true);
|
||||
http
|
||||
.post(
|
||||
airConditionControl.submitTableData +
|
||||
@@ -191,6 +195,7 @@
|
||||
dataSource.value,
|
||||
)
|
||||
.then((res) => {
|
||||
state.setLoading(false);
|
||||
if (res.retcode == 0) {
|
||||
message.success('操作成功');
|
||||
// 刷新数据
|
||||
@@ -198,6 +203,9 @@
|
||||
} else {
|
||||
message.info(res.msg);
|
||||
}
|
||||
})
|
||||
.catch(() => {
|
||||
state.setLoading(false);
|
||||
});
|
||||
};
|
||||
|
||||
@@ -228,7 +236,7 @@
|
||||
projectId: state.projectId,
|
||||
siteId: state.siteId,
|
||||
// 设备类型(1照明,2空调,3排风扇,4风幕机,5电动窗,6进水阀,7排水泵)
|
||||
deviceType: 2,
|
||||
ctrlType: 2,
|
||||
})
|
||||
.then((res) => {
|
||||
let arr: Array<Object> = [];
|
||||
|
@@ -55,16 +55,10 @@
|
||||
<div class="btn-item">
|
||||
<div class="left">控制模式</div>
|
||||
<div class="right">
|
||||
<span>{{
|
||||
item.autoStatusBefore.label.indexOf('模式') != -1
|
||||
? item.autoStatusBefore.label.replace('模式', '')
|
||||
: item.autoStatusBefore.label
|
||||
}}</span>
|
||||
<span>{{ item.autoStatusBefore.label ? item.autoStatusBefore.label : '--' }}</span>
|
||||
<img src="/asset/image/bulbLogo/22406.png" alt="" />
|
||||
<span>{{
|
||||
item.autoStatusAfter.label.indexOf('模式') != -1
|
||||
? item.autoStatusAfter.label.replace('模式', '')
|
||||
: item.autoStatusAfter.label
|
||||
item.autoStatusAfter.label ? item.autoStatusAfter.label : '--'
|
||||
}}</span></div
|
||||
>
|
||||
</div>
|
||||
@@ -110,7 +104,7 @@
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div style="width: 100%; height: 80px"></div>
|
||||
<div style="width: 100%; height: 160px"></div>
|
||||
<div class="button-box">
|
||||
<button class="cancel" @click="logModalVisible = false">关闭</button>
|
||||
</div>
|
||||
@@ -126,7 +120,8 @@
|
||||
import { Pagination } from 'ant-design-vue';
|
||||
import { http } from '/nerv-lib/util/http';
|
||||
import { airConditionControl } from '/@/api/airConditionControlSystem';
|
||||
|
||||
// 全局变量
|
||||
import { items } from '/@/store/item';
|
||||
// 初始化 =======================================================
|
||||
|
||||
// 组件
|
||||
@@ -140,6 +135,9 @@
|
||||
getTable();
|
||||
});
|
||||
|
||||
// 全局变量
|
||||
const state = items();
|
||||
|
||||
// 日志业务 ======================================================
|
||||
|
||||
// 分页设置
|
||||
@@ -154,6 +152,7 @@
|
||||
let trIndex = ref(-1);
|
||||
// 获得表格数据
|
||||
const getTable = (changePage = false) => {
|
||||
state.setLoading(true);
|
||||
// 如果是切换页面,则清除当前序列、关闭弹窗
|
||||
if (changePage) {
|
||||
trIndex.value = -1;
|
||||
@@ -166,9 +165,13 @@
|
||||
pageNum: pagination.value.pageNum,
|
||||
})
|
||||
.then((res) => {
|
||||
state.setLoading(false);
|
||||
let data = res.data;
|
||||
dataSource.value = data.records;
|
||||
pagination.value.total = data.total;
|
||||
})
|
||||
.catch(() => {
|
||||
state.setLoading(false);
|
||||
});
|
||||
};
|
||||
// 刷新功能(右下角)
|
||||
@@ -193,8 +196,12 @@
|
||||
// 日志详情显隐
|
||||
const logModalVisible = ref(false);
|
||||
const getLogDetail = (id: any) => {
|
||||
http.get(airConditionControl.getLogDetail, { logId: id }).then((res) => {
|
||||
state.setLoading(true);
|
||||
http
|
||||
.get(airConditionControl.getLogDetail, { logId: id })
|
||||
.then((res) => {
|
||||
const data = res.data;
|
||||
state.setLoading(false);
|
||||
if (data && data.length) {
|
||||
// 显示模态框
|
||||
logModalVisible.value = true;
|
||||
@@ -202,6 +209,9 @@
|
||||
} else {
|
||||
return message.info('返回值无效');
|
||||
}
|
||||
})
|
||||
.catch(() => {
|
||||
state.setLoading(false);
|
||||
});
|
||||
};
|
||||
// 日志详情
|
||||
|
@@ -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,8 +107,12 @@
|
||||
// 左上角分层切换
|
||||
const changeFloor = (area: any, floor: string) => {
|
||||
if (floor == thisFloor.value) {
|
||||
return;
|
||||
return message.info('已选择此楼层');
|
||||
}
|
||||
Modal.confirm({
|
||||
title: '提示信息',
|
||||
content: '切换楼层会放弃已保存的修改内容',
|
||||
onOk() {
|
||||
// 切换前还原修改内容
|
||||
tabs1Ref.value.refresh(false);
|
||||
// 清空设备点阵
|
||||
@@ -127,6 +128,9 @@
|
||||
// 默认选择第一项
|
||||
treeData.value[0].selected = true;
|
||||
tabs1Ref.value.changeArea(treeData.value[0]);
|
||||
},
|
||||
onCancel() {},
|
||||
});
|
||||
};
|
||||
|
||||
// 分区业务 =====================================================
|
||||
|
@@ -7,59 +7,65 @@
|
||||
<img src="/asset/image//bulbLogo/21962.png" alt="" />
|
||||
<span class="tag-text">{{ blub.regionName + ' > ' + blub.deviceGroupName }}</span></div
|
||||
>
|
||||
<button class="right-button">{{
|
||||
record?.runStatus?.label ? record.runStatus.label : '--'
|
||||
<button class="right-button" :class="getClass(record)">{{
|
||||
record.runStatus.value != 0 ? record.runStatus.label : record.switchStatus.label
|
||||
}}</button>
|
||||
</div>
|
||||
<div class="light-tag-box">
|
||||
<div class="tag-box-item">
|
||||
<img src="/asset/image//bulbLogo/22496.png" alt="" />
|
||||
<span class="title">控制模式</span>
|
||||
<span class="title-text">控制模式</span>
|
||||
<span class="result">{{ record.autoStatus.label }}</span>
|
||||
</div>
|
||||
<div class="tag-box-item">
|
||||
<img src="/asset/image//bulbLogo/22496.png" alt="" />
|
||||
<span class="title">亮度</span>
|
||||
<span class="title-text">亮度</span>
|
||||
<span class="result">{{ record.brightness + record.brightnessUnit }}</span>
|
||||
</div>
|
||||
<div class="tag-box-item">
|
||||
<img src="/asset/image//bulbLogo/22496.png" alt="" />
|
||||
<span class="title">控制场景</span>
|
||||
<span class="title-text">控制场景</span>
|
||||
<span class="result">{{ blub.scene.label }}</span>
|
||||
</div>
|
||||
<div class="tag-box-item">
|
||||
<img src="/asset/image//bulbLogo/22496.png" alt="" />
|
||||
<span class="title">色温</span>
|
||||
<span class="title-text">色温</span>
|
||||
<span class="result">{{ record.LwctemC + record.LwctemCUnit }}</span>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
<div class="icon-box" :style="props.blub.styleText">
|
||||
<!-- 正常=0 -->
|
||||
<img
|
||||
v-if="record?.runStatus?.value == 0"
|
||||
class="icon-item"
|
||||
src="/asset/image/bulbLogo/on.png"
|
||||
alt="" />
|
||||
<!-- 故障=1 -->
|
||||
<img
|
||||
v-if="record?.runStatus?.value == 1"
|
||||
v-if="record.runStatus.value == 1"
|
||||
class="icon-item"
|
||||
src="/asset/image/bulbLogo/off.png"
|
||||
src="/asset/image/bulbLogo/fault.png"
|
||||
alt="" />
|
||||
<!-- 维修=2 -->
|
||||
<img
|
||||
v-if="record?.runStatus?.value == 2"
|
||||
v-if="record.runStatus.value == 2"
|
||||
class="icon-item"
|
||||
src="/asset/image/bulbLogo/repair.png"
|
||||
alt="" />
|
||||
<!-- 警告=3 -->
|
||||
<img
|
||||
v-if="record?.runStatus?.value == 3"
|
||||
v-if="record.runStatus.value == 3"
|
||||
class="icon-item"
|
||||
src="/asset/image/bulbLogo/alarm.png"
|
||||
alt="" />
|
||||
<!-- 开启 -->
|
||||
<img
|
||||
v-if="record.runStatus.value == 0 && record.switchStatus.value == 1"
|
||||
class="icon-item"
|
||||
src="/asset/image/bulbLogo/on.png"
|
||||
alt="" />
|
||||
<!-- 关闭 -->
|
||||
<img
|
||||
v-if="record.runStatus.value == 0 && record.switchStatus.value == 0"
|
||||
class="icon-item"
|
||||
src="/asset/image/bulbLogo/off.png"
|
||||
alt="" />
|
||||
</div>
|
||||
</a-popover>
|
||||
</template>
|
||||
@@ -73,13 +79,29 @@
|
||||
const blub = computed(() => props.blub);
|
||||
// 设备信息
|
||||
const record = computed(() => props.blub.record);
|
||||
|
||||
const getClass = (data: any) => {
|
||||
let state = data.runStatus.value;
|
||||
let isOpen = data.switchStatus.value;
|
||||
// 故障
|
||||
if (state == 1) {
|
||||
return 'button-fault';
|
||||
} else if (state == 2) {
|
||||
return 'button-repair';
|
||||
} else if (state == 3) {
|
||||
return 'button-alarm';
|
||||
} else if (state == 0 && isOpen == 1) {
|
||||
return 'button-on';
|
||||
} else if (state == 0 && isOpen == 0) {
|
||||
return 'button-off';
|
||||
}
|
||||
};
|
||||
</script>
|
||||
<style lang="less" scoped>
|
||||
.icon-box {
|
||||
width: 28px;
|
||||
height: 40px;
|
||||
position: absolute;
|
||||
|
||||
.icon-item {
|
||||
width: 25px;
|
||||
cursor: pointer;
|
||||
@@ -115,9 +137,29 @@
|
||||
width: 5em;
|
||||
height: 26px;
|
||||
background: rgba(57, 215, 187, 0.1);
|
||||
border: 1px solid rgba(57, 215, 187, 1);
|
||||
border-width: 1px;
|
||||
border-style: solid;
|
||||
font-size: 12px;
|
||||
color: rgba(57, 215, 187, 1);
|
||||
}
|
||||
.button-on {
|
||||
color: #0dffa4;
|
||||
border-color: #0dffa4;
|
||||
}
|
||||
.button-off {
|
||||
color: #bfcde2;
|
||||
border-color: #bfcde2;
|
||||
}
|
||||
.button-repair {
|
||||
color: #ffbc46;
|
||||
border-color: #ffbc46;
|
||||
}
|
||||
.button-alarm {
|
||||
color: #f36163;
|
||||
border-color: #f36163;
|
||||
}
|
||||
.button-fault {
|
||||
color: #ff7636;
|
||||
border-color: #ff7636;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -139,9 +181,9 @@
|
||||
vertical-align: middle;
|
||||
}
|
||||
|
||||
.title {
|
||||
.title-text {
|
||||
position: absolute;
|
||||
left: 60px;
|
||||
left: 53px;
|
||||
top: 13px;
|
||||
color: rgba(64, 255, 252, 1);
|
||||
}
|
||||
|
@@ -1,51 +1,52 @@
|
||||
// 此文件只定义light(即俯视图小灯泡)的位置信息
|
||||
// 与显示状态和分组信息无关
|
||||
export const lightPosition = [
|
||||
// 安检区A
|
||||
// 走廊西
|
||||
{ left: '160px', bottom: '270px' },
|
||||
{ left: '185px', bottom: '230px' },
|
||||
{ left: '220px', bottom: '180px' },
|
||||
{ left: '250px', bottom: '130px' },
|
||||
// 站厅区B 1组
|
||||
// 办公西区 1组
|
||||
{ left: '240px', bottom: '290px' },
|
||||
{ left: '260px', bottom: '260px' },
|
||||
{ left: '280px', bottom: '230px' },
|
||||
{ left: '310px', bottom: '190px' },
|
||||
{ left: '330px', bottom: '160px' },
|
||||
// 站厅区B 2组
|
||||
// 办公西区 2组
|
||||
{ left: '300px', bottom: '305px' },
|
||||
{ left: '325px', bottom: '275px' },
|
||||
{ left: '350px', bottom: '245px' },
|
||||
{ left: '375px', bottom: '215px' },
|
||||
{ left: '400px', bottom: '180px' },
|
||||
// 站台区A 1组
|
||||
// 站厅西区 1组
|
||||
{ left: '370px', bottom: '320px' },
|
||||
{ left: '470px', bottom: '210px' },
|
||||
// 站台区A 2组
|
||||
// 站厅西区 2组
|
||||
{ left: '425px', bottom: '335px' },
|
||||
{ left: '530px', bottom: '230px' },
|
||||
// 站台区A 3组
|
||||
// 站厅西区 3组
|
||||
{ left: '475px', bottom: '350px' },
|
||||
{ left: '590px', bottom: '250px' },
|
||||
// 站台区A 4组
|
||||
// 站厅西区 4组
|
||||
{ left: '530px', bottom: '365px' },
|
||||
{ left: '640px', bottom: '270px' },
|
||||
// 一楼办公区
|
||||
// 临检区
|
||||
{ left: '570px', bottom: '390px' },
|
||||
{ left: '605px', bottom: '365px' },
|
||||
{ left: '640px', bottom: '340px' },
|
||||
{ left: '675px', bottom: '315px' },
|
||||
{ left: '710px', bottom: '290px' },
|
||||
// 安保区 4 分组
|
||||
{ left: '670px', bottom: '370px' },
|
||||
{ left: '720px', bottom: '385px' },
|
||||
{ left: '770px', bottom: '400px' },
|
||||
{ left: '820px', bottom: '415px' },
|
||||
// 一楼男厕A
|
||||
{ left: '810px', bottom: '455px' },
|
||||
{ left: '970px', bottom: '370px' },
|
||||
{ left: '850px', bottom: '465px' },
|
||||
{ left: '1010px', bottom: '385px' },
|
||||
// 安检区
|
||||
{ left: '635px', bottom: '405px' },
|
||||
{ left: '675px', bottom: '375px' },
|
||||
{ left: '725px', bottom: '340px' },
|
||||
{ left: '780px', bottom: '305px' },
|
||||
// 站厅东区 共4组
|
||||
{ left: '690px', bottom: '420px' },
|
||||
{ left: '835px', bottom: '330px' },
|
||||
{ left: '800px', bottom: '390px' },
|
||||
{ left: '850px', bottom: '400px' },
|
||||
{ left: '900px', bottom: '410px' },
|
||||
];
|
||||
|
||||
export const lightPosition1 = [
|
||||
|
@@ -249,7 +249,7 @@
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div style="width: 100%; height: 60px"></div>
|
||||
<div style="width: 100%; height: 100px"></div>
|
||||
<div class="button-box">
|
||||
<button class="cancel" @click="executeVisible = false">取消</button>
|
||||
<a-popconfirm
|
||||
@@ -736,28 +736,22 @@
|
||||
if (!changeList.value.length && !lockList.value.length) {
|
||||
return message.info('未产生任何修改');
|
||||
}
|
||||
state.setLoading(true);
|
||||
http
|
||||
.get(planManage.getRunningPlan, {
|
||||
deviceType: 1,
|
||||
ctrlType: 1,
|
||||
projectId: state.projectId,
|
||||
siteId: state.siteId,
|
||||
})
|
||||
.then((res) => {
|
||||
// 如果有计划正在执行
|
||||
if (res.data && res.data.length) {
|
||||
// 此处框架本身存在问题,弹出层在本地环境无法关闭,暂时使用浏览器自带的confirm方法
|
||||
// Modal.confirm({
|
||||
// title: '提示信息',
|
||||
// content: '有计划正在执行,点击"确定"将暂停当前计划',
|
||||
// onOk() {
|
||||
// return new Promise((resolve, reject) => {
|
||||
// });
|
||||
// },
|
||||
// onCancel() { },
|
||||
// });
|
||||
|
||||
let flag = window.confirm('有计划正在执行,点击"确定"将暂停当前计划');
|
||||
if (flag) {
|
||||
state.setLoading(false);
|
||||
Modal.confirm({
|
||||
title: '提示信息',
|
||||
content: '有计划正在执行,点击"确定"将暂停当前计划',
|
||||
onOk() {
|
||||
state.setLoading(true);
|
||||
// 如果点击了确定,将先终止所有进行中的计划
|
||||
http
|
||||
.post(lightingManage.submitChangeList, {
|
||||
@@ -767,16 +761,21 @@
|
||||
sceneList: [],
|
||||
})
|
||||
.then((res) => {
|
||||
console.log(res, '成功');
|
||||
// 如果重置成功,则获取修改前后对比数据
|
||||
if (res.retcode == 0) {
|
||||
sendChangeList();
|
||||
// 未成功提示
|
||||
} else {
|
||||
state.setLoading(false);
|
||||
message.error('关闭进行中的任务操作失败,请重新尝试');
|
||||
}
|
||||
})
|
||||
.catch(() => {
|
||||
state.setLoading(false);
|
||||
});
|
||||
},
|
||||
onCancel() {},
|
||||
});
|
||||
}
|
||||
// 没有计划正在执行,则直接请求
|
||||
} else {
|
||||
sendChangeList();
|
||||
@@ -793,6 +792,7 @@
|
||||
siteId: state.siteId,
|
||||
})
|
||||
.then((res) => {
|
||||
state.setLoading(false);
|
||||
if (res.retcode == 0) {
|
||||
diffList.value = res.data;
|
||||
executeVisible.value = true;
|
||||
@@ -800,7 +800,9 @@
|
||||
message.error('获取修改内容失败');
|
||||
}
|
||||
})
|
||||
.catch(() => {});
|
||||
.catch(() => {
|
||||
state.setLoading(false);
|
||||
});
|
||||
};
|
||||
// 通用取消
|
||||
const changeCancel = () => {};
|
||||
@@ -838,6 +840,7 @@
|
||||
};
|
||||
// 提交本次修改
|
||||
const submitChangeList = () => {
|
||||
state.setLoading(true);
|
||||
http
|
||||
.post(lightingManage.submitChangeList, {
|
||||
sceneList: changeList.value,
|
||||
@@ -846,6 +849,7 @@
|
||||
siteId: state.siteId,
|
||||
})
|
||||
.then((res) => {
|
||||
state.setLoading(false);
|
||||
let data = res.data;
|
||||
// 修改请求发送了,但操作时产生了失败结果
|
||||
if (res.retcode != 0) {
|
||||
@@ -862,7 +866,9 @@
|
||||
refresh(true);
|
||||
emit('resetAll');
|
||||
})
|
||||
.catch(() => {});
|
||||
.catch(() => {
|
||||
state.setLoading(false);
|
||||
});
|
||||
};
|
||||
|
||||
// 其他业务 ========================================================================
|
||||
|
@@ -30,7 +30,7 @@
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<tr v-for="(row, index) in dataSource" :key="index">
|
||||
<tr v-for="(row, index) in dataSource" v-show="row.executeStatus.value != 0" :key="index">
|
||||
<td>{{ index + 1 }}</td>
|
||||
<td>{{ row.startTime }}</td>
|
||||
<td>{{ row.planName }}</td>
|
||||
@@ -163,7 +163,7 @@
|
||||
projectId: state.projectId,
|
||||
siteId: state.siteId,
|
||||
// 设备类型(1照明,2空调,3排风扇,4风幕机,5电动窗,6进水阀,7排水泵)
|
||||
deviceType: 1,
|
||||
ctrlType: 1,
|
||||
})
|
||||
.then((res) => {
|
||||
dataSource.value = res.data;
|
||||
@@ -185,6 +185,10 @@
|
||||
};
|
||||
// 将对表格的修改统一发送
|
||||
const sendTable = () => {
|
||||
if (!dataSource.value.length) {
|
||||
return message.info('没有任何数据可以提交');
|
||||
}
|
||||
state.setLoading(true);
|
||||
http
|
||||
.post(
|
||||
lightingManage.submitTableData +
|
||||
@@ -192,6 +196,7 @@
|
||||
dataSource.value,
|
||||
)
|
||||
.then((res) => {
|
||||
state.setLoading(false);
|
||||
if (res.retcode == 0) {
|
||||
message.success('操作成功');
|
||||
// 刷新数据
|
||||
@@ -199,6 +204,9 @@
|
||||
} else {
|
||||
message.info(res.msg);
|
||||
}
|
||||
})
|
||||
.catch(() => {
|
||||
state.setLoading(false);
|
||||
});
|
||||
};
|
||||
|
||||
@@ -229,7 +237,7 @@
|
||||
projectId: state.projectId,
|
||||
siteId: state.siteId,
|
||||
// 设备类型(1照明,2空调,3排风扇,4风幕机,5电动窗,6进水阀,7排水泵)
|
||||
deviceType: 1,
|
||||
ctrlType: 1,
|
||||
})
|
||||
.then((res) => {
|
||||
let arr: Array<Object> = [];
|
||||
|
@@ -55,16 +55,10 @@
|
||||
<div class="btn-item">
|
||||
<div class="left">控制模式</div>
|
||||
<div class="right">
|
||||
<span>{{
|
||||
item.autoStatusBefore.label.indexOf('模式') != -1
|
||||
? item.autoStatusBefore.label.replace('模式', '')
|
||||
: item.autoStatusBefore.label
|
||||
}}</span>
|
||||
<span>{{ item.autoStatusBefore.label ? item.autoStatusBefore.label : '--' }}</span>
|
||||
<img src="/asset/image/bulbLogo/22406.png" alt="" />
|
||||
<span>{{
|
||||
item.autoStatusAfter.label.indexOf('模式') != -1
|
||||
? item.autoStatusAfter.label.replace('模式', '')
|
||||
: item.autoStatusAfter.label
|
||||
item.autoStatusAfter.label ? item.autoStatusAfter.label : '--'
|
||||
}}</span></div
|
||||
>
|
||||
</div>
|
||||
@@ -109,7 +103,7 @@
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div style="width: 100%; height: 80px"></div>
|
||||
<div style="width: 100%; height: 160px"></div>
|
||||
<div class="button-box">
|
||||
<button class="cancel" @click="logModalVisible = false">关闭</button>
|
||||
</div>
|
||||
@@ -125,6 +119,8 @@
|
||||
import { Pagination } from 'ant-design-vue';
|
||||
import { http } from '/nerv-lib/util/http';
|
||||
import { lightingManage } from '/@/api/IlluminationInfo';
|
||||
// 全局变量
|
||||
import { items } from '/@/store/item';
|
||||
|
||||
// 初始化 =======================================================
|
||||
|
||||
@@ -139,6 +135,9 @@
|
||||
getTable();
|
||||
});
|
||||
|
||||
// 全局变量
|
||||
const state = items();
|
||||
|
||||
// 日志业务 ======================================================
|
||||
|
||||
// 分页设置
|
||||
@@ -153,6 +152,7 @@
|
||||
let trIndex = ref(-1);
|
||||
// 获得表格数据
|
||||
const getTable = (changePage = false) => {
|
||||
state.setLoading(true);
|
||||
// 如果是切换页面,则清除当前序列、关闭弹窗
|
||||
if (changePage) {
|
||||
trIndex.value = -1;
|
||||
@@ -165,9 +165,13 @@
|
||||
pageNum: pagination.value.pageNum,
|
||||
})
|
||||
.then((res) => {
|
||||
state.setLoading(false);
|
||||
let data = res.data;
|
||||
dataSource.value = data.records;
|
||||
pagination.value.total = data.total;
|
||||
})
|
||||
.catch(() => {
|
||||
state.setLoading(false);
|
||||
});
|
||||
};
|
||||
// 刷新功能(右下角)
|
||||
@@ -192,7 +196,11 @@
|
||||
// 日志详情显隐
|
||||
const logModalVisible = ref(false);
|
||||
const getLogDetail = (id: any) => {
|
||||
http.get(lightingManage.getLogDetail, { logId: id }).then((res) => {
|
||||
state.setLoading(true);
|
||||
http
|
||||
.get(lightingManage.getLogDetail, { logId: id })
|
||||
.then((res) => {
|
||||
state.setLoading(false);
|
||||
const data = res.data;
|
||||
if (data && data.length) {
|
||||
// 显示模态框
|
||||
@@ -201,6 +209,9 @@
|
||||
} else {
|
||||
return message.info('返回值无效');
|
||||
}
|
||||
})
|
||||
.catch(() => {
|
||||
state.setLoading(false);
|
||||
});
|
||||
};
|
||||
// 日志详情
|
||||
|
@@ -108,7 +108,7 @@
|
||||
line-height: 35px;
|
||||
text-align: left;
|
||||
padding-left: 10px;
|
||||
font-size: 14px;
|
||||
font-size: 13px;
|
||||
:first-child {
|
||||
color: white;
|
||||
}
|
||||
@@ -116,7 +116,7 @@
|
||||
vertical-align: middle;
|
||||
}
|
||||
img {
|
||||
padding: 0 5px;
|
||||
padding: 0 2px;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@@ -215,7 +215,7 @@
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div style="width: 100%; height: 60px"></div>
|
||||
<div style="width: 100%; height: 100px"></div>
|
||||
<div class="button-box">
|
||||
<button class="cancel" @click="executeVisible = false">取消</button>
|
||||
<a-popconfirm
|
||||
@@ -686,28 +686,22 @@
|
||||
if (!changeList.value.length && !lockList.value.length) {
|
||||
return message.info('未产生任何修改');
|
||||
}
|
||||
state.setLoading(true);
|
||||
http
|
||||
.get(planManage.getRunningPlan, {
|
||||
deviceType: url.deviceType,
|
||||
ctrlType: url.deviceType,
|
||||
projectId: state.projectId,
|
||||
siteId: state.siteId,
|
||||
})
|
||||
.then((res) => {
|
||||
// 如果有计划正在执行
|
||||
if (res.data && res.data.length) {
|
||||
// 此处框架本身存在问题,弹出层在本地环境无法关闭,暂时使用浏览器自带的confirm方法
|
||||
// Modal.confirm({
|
||||
// title: '提示信息',
|
||||
// content: '有计划正在执行,点击"确定"将暂停当前计划',
|
||||
// onOk() {
|
||||
// return new Promise((resolve, reject) => {
|
||||
// });
|
||||
// },
|
||||
// onCancel() { },
|
||||
// });
|
||||
|
||||
let flag = window.confirm('有计划正在执行,点击"确定"将暂停当前计划');
|
||||
if (flag) {
|
||||
state.setLoading(false);
|
||||
Modal.confirm({
|
||||
title: '提示信息',
|
||||
content: '有计划正在执行,点击"确定"将暂停当前计划',
|
||||
onOk() {
|
||||
state.setLoading(false);
|
||||
// 如果点击了确定,将先终止所有进行中的计划
|
||||
http
|
||||
.post(url.getList, {
|
||||
@@ -717,16 +711,22 @@
|
||||
sceneList: [],
|
||||
})
|
||||
.then((res) => {
|
||||
console.log(res, '成功');
|
||||
// 如果重置成功,则获取修改前后对比数据
|
||||
if (res.retcode == 0) {
|
||||
sendChangeList();
|
||||
// 未成功提示
|
||||
} else {
|
||||
state.setLoading(false);
|
||||
message.error('关闭进行中的任务操作失败,请重新尝试');
|
||||
}
|
||||
})
|
||||
.catch(() => {
|
||||
state.setLoading(false);
|
||||
});
|
||||
}
|
||||
},
|
||||
onCancel() {},
|
||||
});
|
||||
|
||||
// 没有计划正在执行,则直接请求
|
||||
} else {
|
||||
sendChangeList();
|
||||
@@ -743,6 +743,7 @@
|
||||
siteId: state.siteId,
|
||||
})
|
||||
.then((res) => {
|
||||
state.setLoading(false);
|
||||
if (res.retcode == 0) {
|
||||
diffList.value = res.data;
|
||||
executeVisible.value = true;
|
||||
@@ -750,7 +751,9 @@
|
||||
message.error('获取修改内容失败');
|
||||
}
|
||||
})
|
||||
.catch(() => {});
|
||||
.catch(() => {
|
||||
state.setLoading(false);
|
||||
});
|
||||
};
|
||||
// 通用取消
|
||||
const changeCancel = () => {};
|
||||
|
@@ -55,16 +55,10 @@
|
||||
<div class="btn-item">
|
||||
<div class="left">控制模式</div>
|
||||
<div class="right">
|
||||
<span>{{
|
||||
item.autoStatusBefore.label.indexOf('模式') != -1
|
||||
? item.autoStatusBefore.label.replace('模式', '')
|
||||
: item.autoStatusBefore.label
|
||||
}}</span>
|
||||
<span>{{ item.autoStatusBefore.label ? item.autoStatusBefore.label : '--' }}</span>
|
||||
<img src="/asset/image/bulbLogo/22406.png" alt="" />
|
||||
<span>{{
|
||||
item.autoStatusAfter.label.indexOf('模式') != -1
|
||||
? item.autoStatusAfter.label.replace('模式', '')
|
||||
: item.autoStatusAfter.label
|
||||
item.autoStatusAfter.label ? item.autoStatusAfter.label : '--'
|
||||
}}</span></div
|
||||
>
|
||||
</div>
|
||||
@@ -109,7 +103,7 @@
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div style="width: 100%; height: 80px"></div>
|
||||
<div style="width: 100%; height: 160px"></div>
|
||||
<div class="button-box">
|
||||
<button class="cancel" @click="logModalVisible = false">关闭</button>
|
||||
</div>
|
||||
@@ -125,7 +119,6 @@
|
||||
import { Pagination } from 'ant-design-vue';
|
||||
import { http } from '/nerv-lib/util/http';
|
||||
import { ventilating } from '/@/api/ventilatingSystem';
|
||||
|
||||
// 全局变量
|
||||
import { items } from '/@/store/item';
|
||||
|
||||
@@ -183,6 +176,7 @@
|
||||
let trIndex = ref(-1);
|
||||
// 获得表格数据
|
||||
const getTable = (changePage = false) => {
|
||||
state.setLoading(true);
|
||||
// 如果是切换页面,则清除当前序列、关闭弹窗
|
||||
if (changePage) {
|
||||
trIndex.value = -1;
|
||||
@@ -195,16 +189,19 @@
|
||||
pageNum: pagination.value.pageNum,
|
||||
})
|
||||
.then((res) => {
|
||||
state.setLoading(false);
|
||||
let data = res.data;
|
||||
dataSource.value = data.records;
|
||||
pagination.value.total = data.total;
|
||||
})
|
||||
.catch(() => {
|
||||
state.setLoading(false);
|
||||
});
|
||||
};
|
||||
// 刷新功能(右下角)
|
||||
const reset = () => {
|
||||
trIndex.value = -1;
|
||||
logModalVisible.value = false;
|
||||
// state.setLoading(true);
|
||||
pagination.value = {
|
||||
pageSize: 10,
|
||||
pageNum: 1,
|
||||
@@ -223,7 +220,11 @@
|
||||
// 日志详情显隐
|
||||
const logModalVisible = ref(false);
|
||||
const getLogDetail = (id: any) => {
|
||||
http.get(logDetail, { logId: id }).then((res) => {
|
||||
state.setLoading(true);
|
||||
http
|
||||
.get(logDetail, { logId: id })
|
||||
.then((res) => {
|
||||
state.setLoading(false);
|
||||
const data = res.data;
|
||||
if (data && data.length) {
|
||||
// 显示模态框
|
||||
@@ -232,6 +233,9 @@
|
||||
} else {
|
||||
return message.info('返回值无效');
|
||||
}
|
||||
})
|
||||
.catch(() => {
|
||||
state.setLoading(false);
|
||||
});
|
||||
};
|
||||
const cxList = ref([]);
|
||||
|
@@ -30,7 +30,7 @@
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<tr v-for="(row, index) in dataSource" :key="index">
|
||||
<tr v-for="(row, index) in dataSource" v-show="row.executeStatus.value != 0" :key="index">
|
||||
<td>{{ index + 1 }}</td>
|
||||
<td>{{ row.startTime }}</td>
|
||||
<td>{{ row.planName }}</td>
|
||||
@@ -177,7 +177,7 @@
|
||||
projectId: state.projectId,
|
||||
siteId: state.siteId,
|
||||
// 设备类型(1照明,2空调,3排风扇,4风幕机,5电动窗,6进水阀,7排水泵)
|
||||
deviceType: props.type,
|
||||
ctrlType: props.type,
|
||||
})
|
||||
.then((res) => {
|
||||
dataSource.value = res.data;
|
||||
@@ -199,12 +199,17 @@
|
||||
};
|
||||
// 将对表格的修改统一发送
|
||||
const sendTable = () => {
|
||||
if (!dataSource.value.length) {
|
||||
return message.info('没有任何数据可以提交');
|
||||
}
|
||||
state.setLoading(true);
|
||||
http
|
||||
.post(
|
||||
url + `?projectId=${state.projectId}${state.siteId ? `&siteId=${state.siteId}` : ''}`,
|
||||
dataSource.value,
|
||||
)
|
||||
.then((res) => {
|
||||
state.setLoading(false);
|
||||
if (res.retcode == 0) {
|
||||
message.success('操作成功');
|
||||
// 刷新数据
|
||||
@@ -212,6 +217,9 @@
|
||||
} else {
|
||||
message.info(res.msg);
|
||||
}
|
||||
})
|
||||
.catch(() => {
|
||||
state.setLoading(false);
|
||||
});
|
||||
};
|
||||
|
||||
@@ -242,7 +250,7 @@
|
||||
projectId: state.projectId,
|
||||
siteId: state.siteId,
|
||||
// 设备类型(1照明,2空调,3排风扇,4风幕机,5电动窗,6进水阀,7排水泵)
|
||||
deviceType: props.type,
|
||||
ctrlType: props.type,
|
||||
})
|
||||
.then((res) => {
|
||||
let arr: Array<Object> = [];
|
||||
|
Reference in New Issue
Block a user