Procházet zdrojové kódy

fix:空调、投屏、音响

anxiaoxia před 4 týdny
rodič
revize
7bca67dd38

+ 12 - 12
src/hooks/useDeviceControl.js

@@ -57,7 +57,7 @@ const initDeviceCommand = data => {
   let { lamps = [], curtains = [] } = data || {}
   let commands = []
   // 灯具指令
-  lamps.forEach(item => {
+//   lamps.forEach(item => {
     // 开关指令---取到开关点位
     // commands.push({
     //   id: item.id,
@@ -66,19 +66,19 @@ const initDeviceCommand = data => {
     // })
 
     // 亮度指令 默认80
-    commands.push({
-      id: item.id,
-      code: item.codeBright,
-      value: item.valueBright
-    })
+    // commands.push({
+    //   id: item.id,
+    //   code: item.codeBright,
+    //   value: item.valueBright
+    // })
 
     // 色温指令
-    commands.push({
-      id: item.id,
-      code: item.codeColorTemp,
-      value: item.valueColorTemp
-    })
-  })
+    // commands.push({
+    //   id: item.id,
+    //   code: item.codeColorTemp,
+    //   value: item.valueColorTemp
+    // })
+//   })
   // 窗帘指令
   curtains.forEach(item => {
     commands.push({

+ 2 - 2
src/views/envmonitor/taiguv1/components/Air/AirMore.vue

@@ -51,7 +51,7 @@
 
         <div class="fan-speed">
           <div class="volume-top">
-            <span :class="airData.gear == 0 ? 'span-active' : ''">0</span>
+            <!-- <span :class="airData.gear == 0 ? 'span-active' : ''">0</span> -->
             <span :class="airData.gear == 1 ? 'span-active' : ''">1</span>
             <span :class="airData.gear == 2 ? 'span-active' : ''">2</span>
             <span :class="airData.gear == 3 ? 'span-active' : ''">3</span>
@@ -99,7 +99,7 @@
             </div>
             <div class="fans-view">
               <div class="volume-top">
-                <span :class="item.gear == 0 ? 'span-active' : ''">0</span>
+                <!-- <span :class="item.gear == 0 ? 'span-active' : ''">0</span> -->
                 <span :class="item.gear == 1 ? 'span-active' : ''">1</span>
                 <span :class="item.gear == 2 ? 'span-active' : ''">2</span>
                 <span :class="item.gear == 3 ? 'span-active' : ''">3</span>

+ 1 - 1
src/views/envmonitor/taiguv1/components/Air/index.vue

@@ -37,7 +37,7 @@
       <div class="air-volume" v-show="airData.isOpen">
         <div class="volume-left">
           <div class="volume-top">
-            <span :class="airData.gear == 0 ? 'span-active' : ''">0</span>
+            <!-- <span :class="airData.gear == 0 ? 'span-active' : ''">0</span> -->
             <span :class="airData.gear == 1 ? 'span-active' : ''">1</span>
             <span :class="airData.gear == 2 ? 'span-active' : ''">2</span>
             <span :class="airData.gear == 3 ? 'span-active' : ''">3</span>

+ 1 - 1
src/views/envmonitor/taiguv1/components/Screen/index.vue

@@ -26,7 +26,7 @@
                 {{$t(`screen.无线投屏`)}}
             </div>
             <div
-                 v-if="roomInfo.name !=='ROOM NAIAD' && roomInfo.name !=='ROOM METIS'"
+                 v-if="roomInfo.name !=='ROOM NAIAD' && roomInfo.name !=='ROOM METIS' && roomInfo.name!=='FORUM 1' && roomInfo.name!=='FORUM 2' && roomInfo.name!=='FORUM 3' && roomInfo.name!=='FORUM'"
                 class="btn"
                 :class="screenData.runStatus == 3 ? 'btn-active' : ''"
                 @click="setScreenStatus('runStatus',3)"

+ 98 - 7
src/views/envmonitor/taiguv1/const.js

@@ -895,7 +895,7 @@ export const roomSourceData = [
           {
             chineseName: "瑜伽模式",
             englishName: "Yoga",
-            id: "2",
+            id: "4",
             activeSvg: YogaModeIcon,
             unActiveSvg: UnYogaModeIcon,
             lamps: [
@@ -1082,7 +1082,7 @@ export const roomSourceData = [
           {
             chineseName: "私人餐厅",
             englishName: "Private Dining",
-            id: "2",
+            id: "5",
             activeSvg: PrivateDiningIcon,
             unActiveSvg: UnPrivateDiningIcon,
             lamps: [
@@ -1269,7 +1269,7 @@ export const roomSourceData = [
           {
             chineseName: "开放日",
             englishName: "Open House",
-            id: "2",
+            id: "6",
             activeSvg: OpenHouseIcon,
             unActiveSvg: UnOpenHouseIcon,
             lamps: [
@@ -1456,7 +1456,7 @@ export const roomSourceData = [
           {
             chineseName: "路演",
             englishName: "Roadshows",
-            id: "2",
+            id: "7",
             activeSvg: RoadshowsIcon,
             unActiveSvg: UnRoadshowsIcon,
             lamps: [
@@ -1980,7 +1980,7 @@ export const roomSourceData = [
           {
             chineseName: "私人拍卖",
             englishName: "Private Auction",
-            id: "2",
+            id: "4",
             activeSvg: PrivateAuctionIcon,
             unActiveSvg: UnPrivateAuctionIcon,
             lamps: [
@@ -2146,7 +2146,7 @@ export const roomSourceData = [
           {
             chineseName: "影院模式",
             englishName: "Cinema",
-            id: "2",
+            id: "5",
             activeSvg: CinemaIcon,
             unActiveSvg: UnCinemaIcon,
             lamps: [
@@ -2604,7 +2604,7 @@ export const roomSourceData = [
           {
             chineseName: "美食评鉴",
             englishName: "Food Tasting",
-            id: "2",
+            id: "3",
             activeSvg: FoodTastingIcon,
             unActiveSvg: UnFoodTastingIcon,
             lamps: [
@@ -3578,6 +3578,97 @@ export const roomSourceData = [
     bg: require("@/assets/taiguv1/svg/room_training_background.png"),
     video: "",
   },
+  {
+    id: "room10",
+    name: "FORUM",
+    spaceId: "Sp3301050005e5150e4985c04699aaca5ddd2aee4fe2",
+    chineseName: "培训室东、西、中",
+    scene: {
+      SceneDefaul: {
+        chineseName: "会议",
+        mode: [
+          {
+            chineseName: "普通模式",
+            englishName: "Generol Mode",
+            id: "1",
+            activeSvg: GenerolModeIcon,
+            unActiveSvg: UnGenerolModeIcon,
+            lamps: [
+              {
+                id: "Eq33010500050d26b9830d9340ba977eaebc34dec653",
+                name: "筒灯辅助照明",
+                valueBright: 100,
+                codeBright: "brightSet",
+                codeColorTemp: "colorTempSet",
+                valueColorTemp: 3500,
+                valueSwitch: 1,
+                codeSwitch: "switchSet",
+              },
+              {
+                id: "Eq330105000506eb564bac6948e5a7072c783bfcf82c",
+                name: "筒灯主照明",
+                valueBright: 100,
+                codeBright: "brightSet",
+                codeColorTemp: "colorTempSet",
+                valueColorTemp: 3500,
+                valueSwitch: 1,
+                codeSwitch: "switchSet",
+              },
+              {
+                id: "Eq3301050005058197d7d5af4ac18e1c5294cb1c0a5b",
+                name: "灯带辅助照明",
+                valueBright: 100,
+                codeBright: "brightSet",
+                codeColorTemp: "colorTempSet",
+                valueColorTemp: 3500,
+                valueSwitch: 1,
+                codeSwitch: "switchSet",
+              },
+            ],
+            curtains: [
+              {
+                id: "Eq33010500054570d1f28e984342b9b47381a0b0782e",
+                name: "窗帘",
+                value: 2,
+                code: "EquipOnSet",
+              },
+              {
+                id: "Eq330105000520b4b76a7a824a8a90797663f00d7d11",
+                name: "窗帘",
+                value: 2,
+                code: "EquipOnSet",
+              },
+              {
+                id: "Eq33010500050fd8fd7e8973407f919daffc34c47b2c",
+                name: "窗帘",
+                value: 2,
+                code: "EquipOnSet",
+              },
+            ],
+            MIDS: [
+              {
+                id: "Eq33010500052051e7dae1a34d5c9b55fae2213e5664",
+                code: "WEMIDS",
+                value: 1,
+              },
+            ],
+            OFDS: [
+              {
+                id: "Eq33010500055c5a6ce1fd6342e3a5057de07056ad3a",
+                code: "OTOFDS",
+                value: 1,
+              },
+            ],
+          },
+        ],
+      },
+    },
+    icon: require("@/assets/taiguv1/svg/room_training_icon.svg"),
+    modeBg:
+      "linear-gradient(113.73deg, rgba(4, 18, 32, 0.5) 17.26%, rgba(6, 18, 32, 0.8) 55.71%)",
+    bg: require("@/assets/taiguv1/svg/room_training_background.png"),
+    video: "",
+  },
 ];
 
 export const lanageArr = [

+ 37 - 16
src/views/envmonitor/taiguv1/index.vue

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