|
@@ -115,7 +115,7 @@ import {
|
|
|
watch,
|
|
|
onBeforeMount,
|
|
|
onUnmounted,
|
|
|
- onBeforeUnmount,
|
|
|
+ onBeforeUnmount
|
|
|
} from "vue";
|
|
|
import { Switch, Toast } from "vant";
|
|
|
import {
|
|
@@ -123,9 +123,9 @@ import {
|
|
|
getStatusHttp,
|
|
|
querySapceFloorHeating,
|
|
|
setallLampHttp,
|
|
|
- setSpaceCondtioners,
|
|
|
+ setSpaceCondtioners
|
|
|
} from "@/apis/envmonitor";
|
|
|
-import { getRelNowTime, parseImgUrl, setQueryConfig } from "@/utils";
|
|
|
+import { fix, getRelNowTime, parseImgUrl, setQueryConfig } from "@/utils";
|
|
|
import { type } from "os";
|
|
|
import { onDeactivated } from "vue";
|
|
|
import { AnyMxRecord } from "dns";
|
|
@@ -136,29 +136,29 @@ export default defineComponent({
|
|
|
props: {
|
|
|
projectId: {
|
|
|
type: String,
|
|
|
- default: () => "",
|
|
|
+ default: () => ""
|
|
|
},
|
|
|
spaceId: {
|
|
|
type: String,
|
|
|
- default: () => "",
|
|
|
+ default: () => ""
|
|
|
},
|
|
|
showFloorBox: {
|
|
|
type: Boolean,
|
|
|
- default: () => false,
|
|
|
+ default: () => false
|
|
|
},
|
|
|
userIsControl: {
|
|
|
type: Boolean,
|
|
|
- default: () => false,
|
|
|
+ default: () => false
|
|
|
},
|
|
|
forceOverTimeFlag: {
|
|
|
type: Boolean,
|
|
|
- default: () => false,
|
|
|
+ default: () => false
|
|
|
},
|
|
|
seviceEquipmentList: {
|
|
|
// 是否走服务定制的设备
|
|
|
type: Array,
|
|
|
- default: () => [],
|
|
|
- },
|
|
|
+ default: () => []
|
|
|
+ }
|
|
|
},
|
|
|
components: { Switch },
|
|
|
setup(props, contx) {
|
|
@@ -166,6 +166,7 @@ export default defineComponent({
|
|
|
let heatingData: any = {};
|
|
|
let floorHeathingStatus: any = null;
|
|
|
const timeOut: any = null;
|
|
|
+ let realTemp: any = 0;
|
|
|
const proxyData = reactive({
|
|
|
distroyFlag: false,
|
|
|
seviceEquipmentList: props.seviceEquipmentList,
|
|
@@ -181,7 +182,7 @@ export default defineComponent({
|
|
|
floorHeathingStatus: floorHeathingStatus,
|
|
|
swiperIinit: false,
|
|
|
part: 1,
|
|
|
- realTemp: 0,
|
|
|
+ realTemp: realTemp,
|
|
|
navType: "all",
|
|
|
runStatus: 0,
|
|
|
lightColorImg: parseImgUrl("page-officehome", "lightColorControl.svg"),
|
|
@@ -208,7 +209,7 @@ export default defineComponent({
|
|
|
let obj: any = {
|
|
|
id: item.id, //类型:String 必有字段 备注:设备id
|
|
|
code: code, //类型:String 必有字段 备注:编码 EquipSwtichSet
|
|
|
- value: value, //类型:String 必有字段 备注:值 0
|
|
|
+ value: value //类型:String 必有字段 备注:值 0
|
|
|
};
|
|
|
data.push(obj);
|
|
|
});
|
|
@@ -228,7 +229,7 @@ export default defineComponent({
|
|
|
let obj: any = {
|
|
|
id: item.id, //类型:String 必有字段 备注:设备id
|
|
|
code: code, //类型:String 必有字段 备注:编码 EquipSwtichSet
|
|
|
- value: value, //类型:String 必有字段 备注:值 0
|
|
|
+ value: value //类型:String 必有字段 备注:值 0
|
|
|
};
|
|
|
data.push(obj);
|
|
|
});
|
|
@@ -243,7 +244,7 @@ export default defineComponent({
|
|
|
setSpaceCondtioners(data: any, item: any = null) {
|
|
|
console.log("调节数据", data);
|
|
|
setSpaceCondtioners(data)
|
|
|
- .then((res) => {
|
|
|
+ .then(res => {
|
|
|
proxyData.loadingFlag = false;
|
|
|
if (item) {
|
|
|
item.loading = false;
|
|
@@ -321,18 +322,18 @@ export default defineComponent({
|
|
|
if (!handBox) {
|
|
|
return;
|
|
|
}
|
|
|
- handBox.addEventListener("touchstart", function (e: any) {
|
|
|
+ handBox.addEventListener("touchstart", function(e: any) {
|
|
|
barLeft = isNaN(parseInt(barBox.style.left))
|
|
|
? 0
|
|
|
: parseInt(barBox.style.left);
|
|
|
isMove = true;
|
|
|
});
|
|
|
- handBox.addEventListener("touchend", function (e: any) {
|
|
|
+ handBox.addEventListener("touchend", function(e: any) {
|
|
|
isMove = false;
|
|
|
proxyData.eqChangeTemp();
|
|
|
});
|
|
|
swiper(handBox, {
|
|
|
- swipeLeft: function (e: any) {
|
|
|
+ swipeLeft: function(e: any) {
|
|
|
if (isMove) {
|
|
|
barLeft = Math.abs(barLeft);
|
|
|
let moveRealX: any = Math.abs(e.mation.moveX - e.mation.startX);
|
|
@@ -341,10 +342,14 @@ export default defineComponent({
|
|
|
barBox.style.left = left + "px";
|
|
|
proxyData.realTemp =
|
|
|
left * part + proxyData.heatingData.minTempSet;
|
|
|
- proxyData.realTemp = Math.round(proxyData.realTemp);
|
|
|
+ // proxyData.realTemp = Math.round(proxyData.realTemp);
|
|
|
+ if (proxyData.realTemp) {
|
|
|
+ proxyData.realTemp = proxyData.realTemp.toFixed(1);
|
|
|
+ proxyData.realTemp = fix(proxyData.realTemp);
|
|
|
+ }
|
|
|
}
|
|
|
},
|
|
|
- swipeRight: function (e: any) {
|
|
|
+ swipeRight: function(e: any) {
|
|
|
if (isMove) {
|
|
|
barLeft = Math.abs(barLeft);
|
|
|
let moveRealX: any = Math.abs(e.mation.moveX - e.mation.startX);
|
|
@@ -353,17 +358,27 @@ export default defineComponent({
|
|
|
barBox.style.left = left + "px";
|
|
|
proxyData.realTemp =
|
|
|
left * part + proxyData.heatingData.minTempSet;
|
|
|
- proxyData.realTemp = Math.round(proxyData.realTemp);
|
|
|
+ // proxyData.realTemp = Math.round(proxyData.realTemp);
|
|
|
+ if (proxyData.realTemp) {
|
|
|
+ proxyData.realTemp = proxyData.realTemp.toFixed(1);
|
|
|
+ proxyData.realTemp = fix(proxyData.realTemp);
|
|
|
+ }
|
|
|
}
|
|
|
- },
|
|
|
+ }
|
|
|
});
|
|
|
},
|
|
|
- // 设置温度条的位置
|
|
|
- setBarNowPerstion() {
|
|
|
+ setRelTemp() {
|
|
|
proxyData.realTemp = proxyData.heatingData.tempSet
|
|
|
? proxyData.heatingData.tempSet
|
|
|
: 0;
|
|
|
|
|
|
+ if (proxyData.realTemp) {
|
|
|
+ proxyData.realTemp = proxyData.realTemp.toFixed(1);
|
|
|
+ proxyData.realTemp = fix(proxyData.realTemp);
|
|
|
+ }
|
|
|
+ },
|
|
|
+ // 设置温度条的位置
|
|
|
+ setBarNowPerstion() {
|
|
|
let barBox: any = document.querySelector("#barFloorId");
|
|
|
if (!barBox) {
|
|
|
return;
|
|
@@ -406,21 +421,26 @@ export default defineComponent({
|
|
|
}
|
|
|
proxyData.floorHeatingList.map((item: any) => {
|
|
|
item.switch = item.runStatus ? true : false;
|
|
|
+ if (item.tempSet) {
|
|
|
+ item.tempSet = item.tempSet.toFixed(1);
|
|
|
+ item.tempSet = fix(item.tempSet);
|
|
|
+ }
|
|
|
});
|
|
|
},
|
|
|
// 获取地暖的状态
|
|
|
getFloorHeatingList() {
|
|
|
let str: any = setQueryConfig({ spaceId: proxyData.spaceId });
|
|
|
querySapceFloorHeating(str)
|
|
|
- .then((res) => {
|
|
|
+ .then(res => {
|
|
|
const resData: any = res;
|
|
|
const data: any = resData ? resData.data : {};
|
|
|
proxyData.heatingData = data;
|
|
|
- // if (data.equipList && data.equipList.length) {
|
|
|
- // proxyData.floorHeatingList = data.equipList || [];
|
|
|
- // }
|
|
|
- proxyData.floorHeatingList = [data.equipList[0]];
|
|
|
+ if (data.equipList && data.equipList.length) {
|
|
|
+ proxyData.floorHeatingList = data.equipList || [];
|
|
|
+ }
|
|
|
+ // proxyData.floorHeatingList = [data.equipList[0]];
|
|
|
proxyData.formateDataStatus();
|
|
|
+ proxyData.setRelTemp();
|
|
|
proxyData.sliderInit();
|
|
|
proxyData.startfloorHeathingStatus();
|
|
|
})
|
|
@@ -458,7 +478,7 @@ export default defineComponent({
|
|
|
proxyData.getFloorHeatingList();
|
|
|
}
|
|
|
}, timerLen);
|
|
|
- },
|
|
|
+ }
|
|
|
});
|
|
|
watch(
|
|
|
[() => props, () => props.spaceId],
|
|
@@ -485,7 +505,7 @@ export default defineComponent({
|
|
|
},
|
|
|
{
|
|
|
deep: true,
|
|
|
- immediate: true,
|
|
|
+ immediate: true
|
|
|
}
|
|
|
);
|
|
|
onBeforeUnmount(() => {
|
|
@@ -500,9 +520,9 @@ export default defineComponent({
|
|
|
proxyData.getFloorHeatingList();
|
|
|
});
|
|
|
return {
|
|
|
- ...toRefs(proxyData),
|
|
|
+ ...toRefs(proxyData)
|
|
|
};
|
|
|
- },
|
|
|
+ }
|
|
|
});
|
|
|
</script>
|
|
|
<style lang="scss" scoped>
|