|
@@ -158,6 +158,7 @@
|
|
|
key="manualckey"
|
|
|
:workkArr="workkArr"
|
|
|
@closeWork="closeWork"
|
|
|
+ @leaveWork="leaveWork"
|
|
|
@triggerWork="triggerWork"
|
|
|
@setForceOverTimeFlag="setForceOverTimeFlag"
|
|
|
></ManualConfig>
|
|
@@ -228,6 +229,7 @@
|
|
|
<!--出于性能的灯的显示和隐藏最好放在子组件里面判断,减少组件频繁重新加载的问题-->
|
|
|
<Light
|
|
|
v-if="spaceInfo.spaceId"
|
|
|
+ ref="lightRef"
|
|
|
:showLight="spaceExistenceDevice.light"
|
|
|
:forceOverTimeFlag="forceOverTimeFlag"
|
|
|
:controlMode="controlMode"
|
|
@@ -572,6 +574,7 @@ export default defineComponent({
|
|
|
};
|
|
|
let curtainRef: any = {};
|
|
|
let manualAirRef: any = {};
|
|
|
+ let lightRef:any={};
|
|
|
// let mapRef: any = {}
|
|
|
let intervalTimer: any = null;
|
|
|
const workInfo: any = {};
|
|
@@ -747,6 +750,7 @@ export default defineComponent({
|
|
|
opacityV: 1,
|
|
|
curtainRef: curtainRef,
|
|
|
manualAirRef: manualAirRef,
|
|
|
+ lightRef:lightRef,
|
|
|
hideTopImg: false,
|
|
|
isBottom: false,
|
|
|
isScrool: false,
|
|
@@ -1036,18 +1040,23 @@ export default defineComponent({
|
|
|
});
|
|
|
proxyData.seviceEquipmentList = proxyData.spaceEquipList;
|
|
|
},
|
|
|
+ leaveWork(){
|
|
|
+ proxyData.manualAirRef && proxyData.manualAirRef.updateCloseSwitchFromWork()
|
|
|
+ proxyData.lightRef && proxyData.lightRef.updateSwitchFromWork();
|
|
|
+ },
|
|
|
/**
|
|
|
* 关闭加班
|
|
|
*/
|
|
|
closeWork(type: any = "confirm") {
|
|
|
proxyData.isShowWork = false;
|
|
|
proxyData.queryCustomAndScence(2); // 关闭弹窗立即调用刷新加班数据
|
|
|
- if (proxyData.enterType == 2 && type == "confirm") {
|
|
|
- // 空调
|
|
|
- if (proxyData.controlMode == 1) {
|
|
|
- // 手动控制
|
|
|
- proxyData.manualAirRef.updateSwitchFromWork(proxyData.deviceItem);
|
|
|
- }
|
|
|
+ if(type == "confirm"){
|
|
|
+ let lightRefTimer:any=setTimeout(()=>{
|
|
|
+ proxyData.manualAirRef && proxyData.manualAirRef.updateCloseSwitchFromWork()
|
|
|
+ proxyData.lightRef && proxyData.lightRef.updateSwitchFromWork();
|
|
|
+ clearTimeout(lightRefTimer);
|
|
|
+ lightRefTimer=null;
|
|
|
+ },2000)
|
|
|
}
|
|
|
},
|
|
|
forceOverTimeFlag: false,
|
|
@@ -1580,16 +1589,17 @@ export default defineComponent({
|
|
|
proxyData.headerInfo.tipText = "选择工作结束时间";
|
|
|
proxyData.headerInfo.tipTextSwatch = true;
|
|
|
},
|
|
|
- clearInterValEquiment() {
|
|
|
- clearInterval(proxyData.equimentsTimer);
|
|
|
+ clearTimeoutValEquiment() {
|
|
|
+ clearTimeout(proxyData.equimentsTimer);
|
|
|
proxyData.equimentsTimer = null;
|
|
|
},
|
|
|
equimentsTimer: equimentsTimer,
|
|
|
// 定时查空间下面的展示设备
|
|
|
- setEquimentsTimer() {
|
|
|
- proxyData.equimentsTimer = setInterval(() => {
|
|
|
+ setEquimentsTimer(len:any=3600000) {
|
|
|
+ proxyData.equimentsTimer = setTimeout(()=>{
|
|
|
proxyData.getEquipments();
|
|
|
- }, 3600000);
|
|
|
+ proxyData.clearTimeoutValEquiment();
|
|
|
+ },len)
|
|
|
},
|
|
|
// 获取空间下的设备信息
|
|
|
getEquipments() {
|
|
@@ -1624,15 +1634,13 @@ export default defineComponent({
|
|
|
proxyData.navList[2].noShow = false;
|
|
|
}
|
|
|
}
|
|
|
- if (!proxyData.equimentsTimer) {
|
|
|
- proxyData.setEquimentsTimer();
|
|
|
- }
|
|
|
+ proxyData.setEquimentsTimer();
|
|
|
})
|
|
|
.catch(() => {
|
|
|
// if (!proxyData.equimentsTimer) {
|
|
|
// proxyData.setEquimentsTimer();
|
|
|
// }
|
|
|
- proxyData.getEquipments()
|
|
|
+ proxyData.setEquimentsTimer(1000);
|
|
|
});
|
|
|
},
|
|
|
// 时间格式转换
|
|
@@ -1711,8 +1719,8 @@ export default defineComponent({
|
|
|
// 定时调空间
|
|
|
timerSpaceInfo(timer: any = 15000) {
|
|
|
proxyData.spaceTimer = setTimeout(() => {
|
|
|
- proxyData.getSpaceInfo();
|
|
|
proxyData.clearTimerSpaceInfo();
|
|
|
+ proxyData.getSpaceInfo();
|
|
|
}, timer);
|
|
|
},
|
|
|
isWork: false,
|
|
@@ -1790,7 +1798,7 @@ export default defineComponent({
|
|
|
proxyData.equipTimer = null;
|
|
|
},
|
|
|
// 定时器
|
|
|
- getSpaceEquipListTimer(timerLen: any = 5000) {
|
|
|
+ getSpaceEquipListTimer(timerLen: any = 15000) {
|
|
|
proxyData.clearEquipTimer();
|
|
|
proxyData.equipTimer = setTimeout(() => {
|
|
|
proxyData.getSpaceEquipList();
|
|
@@ -1811,7 +1819,7 @@ export default defineComponent({
|
|
|
proxyData.getSpaceEquipListTimer();
|
|
|
})
|
|
|
.catch((error: any) => {
|
|
|
- proxyData.getSpaceEquipListTimer();
|
|
|
+ proxyData.getSpaceEquipListTimer(1000);
|
|
|
});
|
|
|
},
|
|
|
// 定时查空间的加班记录
|
|
@@ -1931,13 +1939,13 @@ export default defineComponent({
|
|
|
proxyData.padNumber = 0;
|
|
|
// proxyData.roomType = "";
|
|
|
// 获取场景配置
|
|
|
- proxyData.getSpaceInfo();
|
|
|
- // 动态获取场景配置
|
|
|
- proxyData.querySpaceSceneConfig();
|
|
|
// 获取空间下展示的那些设备类(窗帘,灯,空调))
|
|
|
proxyData.getEquipments();
|
|
|
+ // 动态获取场景配置
|
|
|
+ proxyData.querySpaceSceneConfig();
|
|
|
// 获取空间下受控设备
|
|
|
proxyData.getSpaceEquipList();
|
|
|
+ proxyData.getSpaceInfo();
|
|
|
// 查询加班记录
|
|
|
proxyData.queryCustomAndScenceTimer(0);
|
|
|
},
|
|
@@ -1973,8 +1981,9 @@ export default defineComponent({
|
|
|
],
|
|
|
};
|
|
|
queryWorkSpace(params).then((res) => {
|
|
|
+ // debugger
|
|
|
let resData: any = res;
|
|
|
- if (resData.result === "success") {
|
|
|
+ if (resData.result == "success") {
|
|
|
proxyData.spaceData = resData?.content ?? [];
|
|
|
// proxyData.copySpaceData = resData?.content ?? [];
|
|
|
} else {
|
|
@@ -1990,8 +1999,6 @@ export default defineComponent({
|
|
|
// if (item.isMajorSpace) {
|
|
|
// item.active = true;
|
|
|
// proxyData.spaceInfo = item;
|
|
|
- // } else {
|
|
|
- // item.active = false;
|
|
|
// }
|
|
|
});
|
|
|
proxyData.copySpaceData = JSON.parse(
|
|
@@ -2127,6 +2134,7 @@ export default defineComponent({
|
|
|
proxyData.clearSceneConfigTimer();
|
|
|
proxyData.clearSecenTimer();
|
|
|
proxyData.clearEquipTimer();
|
|
|
+ proxyData.clearTimeoutValEquiment();
|
|
|
},
|
|
|
contantDetail: contantDetail,
|
|
|
cusServiceTimer: cusServiceTimer,
|
|
@@ -2162,7 +2170,6 @@ export default defineComponent({
|
|
|
});
|
|
|
onBeforeUnmount(() => {
|
|
|
proxyData.clearAll();
|
|
|
- proxyData.clearInterValEquiment();
|
|
|
clearInterval(proxyData.dateInter);
|
|
|
clearTimeout(proxyData.cusServiceTimer);
|
|
|
clearTimeout(proxyData.weatherTimer);
|
|
@@ -2212,6 +2219,7 @@ export default defineComponent({
|
|
|
|
|
|
.left-top {
|
|
|
width: 90%;
|
|
|
+ // margin-top: 10px;
|
|
|
overflow: hidden;
|
|
|
white-space: nowrap;
|
|
|
text-overflow: ellipsis;
|