|
@@ -26,6 +26,7 @@
|
|
<div class="name">{{ roomInfo.name }}</div>
|
|
<div class="name">{{ roomInfo.name }}</div>
|
|
<div class="location">38/F</div>
|
|
<div class="location">38/F</div>
|
|
</div>
|
|
</div>
|
|
|
|
+
|
|
<div class="language-box">
|
|
<div class="language-box">
|
|
<div
|
|
<div
|
|
class="language-item"
|
|
class="language-item"
|
|
@@ -35,6 +36,7 @@
|
|
>
|
|
>
|
|
{{ item.text }}
|
|
{{ item.text }}
|
|
</div>
|
|
</div>
|
|
|
|
+ {{$t('login.title')}}
|
|
</div>
|
|
</div>
|
|
<!-- 场景类型 -->
|
|
<!-- 场景类型 -->
|
|
<div class="mode-box">
|
|
<div class="mode-box">
|
|
@@ -157,6 +159,7 @@
|
|
</div>
|
|
</div>
|
|
<div
|
|
<div
|
|
class="box"
|
|
class="box"
|
|
|
|
+ v-if="spaceDevice.curtains?.length"
|
|
>
|
|
>
|
|
<Curtain
|
|
<Curtain
|
|
@showMore="showMore"
|
|
@showMore="showMore"
|
|
@@ -197,6 +200,7 @@
|
|
|
|
|
|
<script setup>
|
|
<script setup>
|
|
import { onMounted, onUnmounted, ref } from 'vue'
|
|
import { onMounted, onUnmounted, ref } from 'vue'
|
|
|
|
+import { useI18n } from 'vue-i18n'
|
|
import { useRoute, useRouter } from 'vue-router'
|
|
import { useRoute, useRouter } from 'vue-router'
|
|
import AirMore from './components/Air/AirMore.vue'
|
|
import AirMore from './components/Air/AirMore.vue'
|
|
import Air from './components/Air/index.vue'
|
|
import Air from './components/Air/index.vue'
|
|
@@ -207,17 +211,16 @@ import LightMore from './components/Lamp/LightMore.vue'
|
|
import Screen from './components/Screen/index.vue'
|
|
import Screen from './components/Screen/index.vue'
|
|
import Volumn from './components/Volumn/index.vue'
|
|
import Volumn from './components/Volumn/index.vue'
|
|
import { ENV_CONFIG, lanageArr, roomSourceData } from './const'
|
|
import { ENV_CONFIG, lanageArr, roomSourceData } from './const'
|
|
|
|
+
|
|
const boxLine = require('@/assets/taiguv1/svg/box_line.png')
|
|
const boxLine = require('@/assets/taiguv1/svg/box_line.png')
|
|
// import "vue3-video-play/dist/style.css";
|
|
// import "vue3-video-play/dist/style.css";
|
|
import { httpGetByMeetingId, HttpGetSpaceInfo, queryAirStatus, queryAudioStatus, queryLampStatus, queryScreenCastingStatus } from '@/apis/taiguv1'
|
|
import { httpGetByMeetingId, HttpGetSpaceInfo, queryAirStatus, queryAudioStatus, queryLampStatus, queryScreenCastingStatus } from '@/apis/taiguv1'
|
|
import useDeviceControl from '@/hooks/useDeviceControl'
|
|
import useDeviceControl from '@/hooks/useDeviceControl'
|
|
-const type = ref('zh')
|
|
|
|
|
|
+const type = ref(localStorage.getItem('lang') || 'zh-CN')
|
|
const route = useRoute()
|
|
const route = useRoute()
|
|
const router = useRouter()
|
|
const router = useRouter()
|
|
const deviceControl = useDeviceControl()
|
|
const deviceControl = useDeviceControl()
|
|
-const checkLanage = item => {
|
|
|
|
- type.value = item.type
|
|
|
|
-}
|
|
|
|
|
|
+
|
|
// 空间信息
|
|
// 空间信息
|
|
const roomInfo = ref({})
|
|
const roomInfo = ref({})
|
|
// 场景
|
|
// 场景
|
|
@@ -256,6 +259,14 @@ const popupType = ref(null)
|
|
|
|
|
|
const envParams = ref({})
|
|
const envParams = ref({})
|
|
|
|
|
|
|
|
+
|
|
|
|
+const { locale } = useI18n()
|
|
|
|
+const checkLanage = item => {
|
|
|
|
+ type.value = item.type
|
|
|
|
+ locale.value = item.type
|
|
|
|
+ localStorage.setItem('lang', item.type) // 持久化存储
|
|
|
|
+}
|
|
|
|
+
|
|
const handleChildLampSwitch = (status, text) => {
|
|
const handleChildLampSwitch = (status, text) => {
|
|
// lampSwitchStatus.value = status
|
|
// lampSwitchStatus.value = status
|
|
// lampStatusText.value = text
|
|
// lampStatusText.value = text
|
|
@@ -269,7 +280,9 @@ const hasExecutedModeScene = ref(false)
|
|
// const store = useStore()
|
|
// const store = useStore()
|
|
|
|
|
|
onMounted(() => {
|
|
onMounted(() => {
|
|
- // try {
|
|
|
|
|
|
+ type.value = localStorage.getItem('lang') || 'zh-CN'
|
|
|
|
+ locale.value = type.value
|
|
|
|
+ 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) || {}
|
|
@@ -285,9 +298,9 @@ onMounted(() => {
|
|
getDeviceStatus()
|
|
getDeviceStatus()
|
|
// 获取空间环境参数 轮询 5 分钟
|
|
// 获取空间环境参数 轮询 5 分钟
|
|
getSpaceInfo()
|
|
getSpaceInfo()
|
|
- // } catch (error) {
|
|
|
|
- // handleError(error)
|
|
|
|
- // }
|
|
|
|
|
|
+ } catch (error) {
|
|
|
|
+ handleError(error)
|
|
|
|
+ }
|
|
})
|
|
})
|
|
|
|
|
|
// 获取空间信息
|
|
// 获取空间信息
|
|
@@ -359,7 +372,8 @@ const showDefaultScene = () => {
|
|
// 获取空间场景
|
|
// 获取空间场景
|
|
const getSpaceScene = params => {
|
|
const getSpaceScene = params => {
|
|
const polling = createPollingTask(() => {
|
|
const polling = createPollingTask(() => {
|
|
- httpGetByMeetingId(params).then(res => {
|
|
|
|
|
|
+ httpGetByMeetingId(params)
|
|
|
|
+ .then(res => {
|
|
if (res.code == 1) {
|
|
if (res.code == 1) {
|
|
let { modeScene, startTime, endTime } = res.data || {}
|
|
let { modeScene, startTime, endTime } = res.data || {}
|
|
|
|
|
|
@@ -385,8 +399,14 @@ const getSpaceScene = params => {
|
|
// 默认场景
|
|
// 默认场景
|
|
showDefaultScene()
|
|
showDefaultScene()
|
|
}
|
|
}
|
|
|
|
+ }else{
|
|
|
|
+ showDefaultScene()
|
|
}
|
|
}
|
|
})
|
|
})
|
|
|
|
+ .catch(error=>{
|
|
|
|
+ console.log('请求失败',error);
|
|
|
|
+ showDefaultScene();
|
|
|
|
+ })
|
|
}, 1000 * 30)
|
|
}, 1000 * 30)
|
|
polling.start()
|
|
polling.start()
|
|
onUnmounted(() => {
|
|
onUnmounted(() => {
|
|
@@ -397,7 +417,7 @@ 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]
|
|
}
|
|
}
|
|
@@ -487,12 +507,12 @@ const updateAirStatus = data => {
|
|
}
|
|
}
|
|
|
|
|
|
const updateLampStatus = data => {
|
|
const updateLampStatus = data => {
|
|
- let brightLamp = data.find(item => item.runStatus == 1)
|
|
|
|
- let arr = data.filter(item => item.runStatus == 1)
|
|
|
|
|
|
+ let brightLamp = data?.find(item => item.brightValue !=0)
|
|
|
|
+ let arr = data?.filter(item => item.brightValue == 0)
|
|
lampStatus.value = {
|
|
lampStatus.value = {
|
|
brightValue: brightLamp ?.brightValue,
|
|
brightValue: brightLamp ?.brightValue,
|
|
colorTempValue: brightLamp ?.colorTempValue,
|
|
colorTempValue: brightLamp ?.colorTempValue,
|
|
- lampStatusText: arr.length == 0 ? '已关闭' : arr.length < data.length ? '已部分开启' : '已开启'
|
|
|
|
|
|
+ lampStatusText: arr?.length == 0 ? '已关闭' : arr?.length < data?.length ? '已部分开启' : '已开启'
|
|
}
|
|
}
|
|
// TODO:灯暂时都打开
|
|
// TODO:灯暂时都打开
|
|
// lampStatus.value.isOpen = false
|
|
// lampStatus.value.isOpen = false
|