|
@@ -128,15 +128,15 @@
|
|
class="fotter"
|
|
class="fotter"
|
|
:class="airIsOpen ? 'small' : 'fotter'"
|
|
:class="airIsOpen ? 'small' : 'fotter'"
|
|
>
|
|
>
|
|
- <div class="box">
|
|
|
|
|
|
+ <div class="box" v-if="screenEquipList?.length">
|
|
<Screen
|
|
<Screen
|
|
:roomInfo="roomInfo"
|
|
:roomInfo="roomInfo"
|
|
:screenStatus="screenStatus"
|
|
:screenStatus="screenStatus"
|
|
:equipList="screenEquipList"
|
|
:equipList="screenEquipList"
|
|
></Screen>
|
|
></Screen>
|
|
</div>
|
|
</div>
|
|
- <!--空调-->
|
|
|
|
- <div class="box">
|
|
|
|
|
|
+ <!--设备-->
|
|
|
|
+ <div class="box" v-if="audioEquipList?.length">
|
|
<Volumn
|
|
<Volumn
|
|
:audioStatus="audioStatus"
|
|
:audioStatus="audioStatus"
|
|
:equipList="audioEquipList"
|
|
:equipList="audioEquipList"
|
|
@@ -159,7 +159,7 @@
|
|
</div>
|
|
</div>
|
|
<div
|
|
<div
|
|
class="box"
|
|
class="box"
|
|
- v-if="spaceDevice.curtains?.length"
|
|
|
|
|
|
+ v-if="curtainsList?.length"
|
|
>
|
|
>
|
|
<Curtain
|
|
<Curtain
|
|
@showMore="showMore"
|
|
@showMore="showMore"
|
|
@@ -245,6 +245,7 @@ const spaceDevice = ref({})
|
|
|
|
|
|
const lampStatus = ref({})
|
|
const lampStatus = ref({})
|
|
const lampEquipList = ref([])
|
|
const lampEquipList = ref([])
|
|
|
|
+const lampScenceControlGroup = ref({ "code": "InCloudSet", })
|
|
const curtainsList = ref([])
|
|
const curtainsList = ref([])
|
|
|
|
|
|
const airStatus = ref({
|
|
const airStatus = ref({
|
|
@@ -289,15 +290,23 @@ const hasExecutedDefault = ref(false)
|
|
const hasExecutedModeScene = ref(false)
|
|
const hasExecutedModeScene = ref(false)
|
|
const store = useStore()
|
|
const store = useStore()
|
|
|
|
|
|
-onMounted(() => {
|
|
|
|
|
|
+onMounted(async () => {
|
|
// TODO: 切换语言
|
|
// TODO: 切换语言
|
|
type.value = localStorage.getItem('lang') || 'zh-CN'
|
|
type.value = localStorage.getItem('lang') || 'zh-CN'
|
|
locale.value = type.value
|
|
locale.value = type.value
|
|
|
|
|
|
try {
|
|
try {
|
|
let roomId = route.query.id || 'room4'
|
|
let roomId = route.query.id || 'room4'
|
|
-
|
|
|
|
roomInfo.value = roomSourceData.find(item => item.id == roomId) || {}
|
|
roomInfo.value = roomSourceData.find(item => item.id == roomId) || {}
|
|
|
|
+ // 获取窗帘列表
|
|
|
|
+ getCurtainList()
|
|
|
|
+ // 获取设备的状态===>需要轮询
|
|
|
|
+ getDeviceStatus()
|
|
|
|
+ // 获取空间环境参数 轮询 5 分钟
|
|
|
|
+ getSpaceInfo()
|
|
|
|
+
|
|
|
|
+ // 等待 getLampScenceControlGroupId 执行完成
|
|
|
|
+ await getLampScenceControlGroupId();
|
|
|
|
|
|
if (roomId == 'room7' || roomId == 'room8' || roomId == 'room9') {
|
|
if (roomId == 'room7' || roomId == 'room8' || roomId == 'room9') {
|
|
showDefaultScene()
|
|
showDefaultScene()
|
|
@@ -305,17 +314,13 @@ onMounted(() => {
|
|
// 获取场景===>轮询 30s
|
|
// 获取场景===>轮询 30s
|
|
getSpaceScene({ meetingId: roomInfo.value.meetingId })
|
|
getSpaceScene({ meetingId: roomInfo.value.meetingId })
|
|
}
|
|
}
|
|
- // 获取窗帘列表
|
|
|
|
- getCurtainList()
|
|
|
|
- // 获取设备的状态===>需要轮询
|
|
|
|
- getDeviceStatus()
|
|
|
|
- // 获取空间环境参数 轮询 5 分钟
|
|
|
|
- getSpaceInfo()
|
|
|
|
} catch (error) {
|
|
} catch (error) {
|
|
handleError(error)
|
|
handleError(error)
|
|
}
|
|
}
|
|
})
|
|
})
|
|
|
|
|
|
|
|
+
|
|
|
|
+
|
|
// 获取空间信息
|
|
// 获取空间信息
|
|
const getSpaceInfo = () => {
|
|
const getSpaceInfo = () => {
|
|
const polling = createPollingTask(() => {
|
|
const polling = createPollingTask(() => {
|
|
@@ -327,7 +332,7 @@ const getSpaceInfo = () => {
|
|
}).then(res => {
|
|
}).then(res => {
|
|
if (res.result === 'success') {
|
|
if (res.result === 'success') {
|
|
let [spaceInfo] = res.content
|
|
let [spaceInfo] = res.content
|
|
- let { temperature, co2, pm25, tvoc, humidity } = spaceInfo || {temperature:23, co2:400, pm25:0, tvoc:0, humidity:35}
|
|
|
|
|
|
+ let { temperature, co2, pm25, tvoc, humidity } = spaceInfo || { temperature: 23, co2: 400, pm25: 0, tvoc: 0, humidity: 35 }
|
|
envParams.value = {
|
|
envParams.value = {
|
|
temperature: temperature < 16 || temperature > 32 ? 23 : temperature,
|
|
temperature: temperature < 16 || temperature > 32 ? 23 : temperature,
|
|
co2: co2 < 400 || co2 > 1200 ? 400 : co2,
|
|
co2: co2 < 400 || co2 > 1200 ? 400 : co2,
|
|
@@ -368,6 +373,7 @@ const handleEnvData = (type, num) => {
|
|
unit: config.unit
|
|
unit: config.unit
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
+
|
|
// 展示默认场景
|
|
// 展示默认场景
|
|
const showDefaultScene = () => {
|
|
const showDefaultScene = () => {
|
|
// 默认场景
|
|
// 默认场景
|
|
@@ -427,9 +433,11 @@ const getSpaceScene = params => {
|
|
//初始化空间
|
|
//初始化空间
|
|
const initSpace = () => {
|
|
const initSpace = () => {
|
|
sceneData.value = roomInfo.value.scene ?.[spaceScene.value] || {}
|
|
sceneData.value = roomInfo.value.scene ?.[spaceScene.value] || {}
|
|
- modeData.value = sceneData.value.mode || {}
|
|
|
|
|
|
+ modeData.value = sceneData.value.mode || {}
|
|
modeType.value = modeData.value[0].id
|
|
modeType.value = modeData.value[0].id
|
|
spaceDevice.value = modeData.value[0]
|
|
spaceDevice.value = modeData.value[0]
|
|
|
|
+
|
|
|
|
+ lampScenceControlGroup.value.value = modeType.value
|
|
}
|
|
}
|
|
|
|
|
|
// 切换场景模式
|
|
// 切换场景模式
|
|
@@ -438,6 +446,7 @@ const changeMode = type => {
|
|
if (modeType.value == 3) {
|
|
if (modeType.value == 3) {
|
|
spaceDevice.value.custom = true
|
|
spaceDevice.value.custom = true
|
|
}
|
|
}
|
|
|
|
+ lampScenceControlGroup.value.value = modeType.value
|
|
// 切换模式重新下发指令
|
|
// 切换模式重新下发指令
|
|
sendCommand()
|
|
sendCommand()
|
|
}
|
|
}
|
|
@@ -447,10 +456,22 @@ const sendCommand = () => {
|
|
// 组装指令
|
|
// 组装指令
|
|
let devices = modeData.value.find(item => item.id == modeType.value)
|
|
let devices = modeData.value.find(item => item.id == modeType.value)
|
|
let commands = deviceControl.initDeviceCommand(devices)
|
|
let commands = deviceControl.initDeviceCommand(devices)
|
|
-
|
|
|
|
|
|
+ commands.push(lampScenceControlGroup.value);
|
|
deviceControl.sendCommands(commands)
|
|
deviceControl.sendCommands(commands)
|
|
}
|
|
}
|
|
|
|
|
|
|
|
+// 获取场景控制灯设备组ID
|
|
|
|
+const getLampScenceControlGroupId = () => {
|
|
|
|
+ const params = {
|
|
|
|
+ projectId,
|
|
|
|
+ spaceId: roomInfo.value.spaceId,
|
|
|
|
+ category: 'SELTLG'
|
|
|
|
+ }
|
|
|
|
+ findForServe(params).then(res => {
|
|
|
|
+ lampScenceControlGroup.value.id = res.data[0]?.id
|
|
|
|
+ })
|
|
|
|
+}
|
|
|
|
+
|
|
const getCurtainList = () => {
|
|
const getCurtainList = () => {
|
|
findForServe({
|
|
findForServe({
|
|
projectId,
|
|
projectId,
|
|
@@ -724,7 +745,7 @@ onUnmounted(() => {
|
|
color: #fff;
|
|
color: #fff;
|
|
text-align: left;
|
|
text-align: left;
|
|
margin-right: 8px;
|
|
margin-right: 8px;
|
|
- //
|
|
|
|
|
|
+ //
|
|
user-select: none; // 防止长按时出现选择文本
|
|
user-select: none; // 防止长按时出现选择文本
|
|
-webkit-user-select: none;
|
|
-webkit-user-select: none;
|
|
-webkit-touch-callout: none;
|
|
-webkit-touch-callout: none;
|