dedsudiyu hace 2 años
padre
commit
0f08b51736

+ 7 - 1
api/index.js

@@ -1798,4 +1798,10 @@ export const riskPlanId = (data) => {
         data: data,
     })
 };
-
+//标记预案已读
+export const controlSwitch = (data) => {
+    return apiResquest({
+        url: `/laboratory/subject/manger/controlSwitch/`+data.id,
+        method: 'post',
+    })
+};

+ 2 - 2
api/request/config.js

@@ -1,7 +1,7 @@
 const config = {
 	// base_url: 'http://192.168.1.9:8080',//柴
 	// base_url: 'http://192.168.1.7:8080',//刘波
-	// base_url: 'http://192.168.1.17:8080',//小飞
+	base_url: 'http://192.168.1.17:8080',//小飞
 	// base_url: 'http://192.168.1.20:8080',//志伟
     // base_url: 'http://192.168.1.8:8080',//高升
 	// base_url: 'http://192.168.1.29:8080',//何成
@@ -15,6 +15,6 @@ const config = {
 	// base_url: 'https://lab.sxitdlc.com/jdlabSystem/', //交大地址
     // base_url: 'https://lab.sxitdlc.com/jndxlabSystem/', //暨大地址
     //  base_url: 'https://lab.sxitdlc.com/kdwclabSystem/', //矿大文昌地址
-    base_url: 'https://lab.sxitdlc.com/sudalabSystem/', //苏大临时地址
+    // base_url: 'https://lab.sxitdlc.com/sudalabSystem/', //苏大临时地址
 }
 export { config }

+ 35 - 2
pages/emergencyEvacuationBig.vue

@@ -142,7 +142,7 @@
         </view>
         <!-- 视频部分 -->
         <view class="video-max-box" v-if="urlList[0]">
-          <video v-for="(item,index) in urlList" :key="index" :id="urlList.id" :src="item.url"
+          <video v-for="(item,index) in urlList" :key="index" ref="videoRef" :src="item.url"
                  :poster="videoCover" :custom-cache='false' :autoplay="true" :controls="true"
                  :enable-danmu="false" :muted="true" :show-fullscreen-btn="true" :show-center-play-btn="false"
                  :show-play-btn="false" @error="videoErrorCallback">
@@ -377,6 +377,7 @@ export default {
   methods: {
     //返回按钮
     backButton(){
+		let self = this;
       this.offMQTT();
       this.$set(this,'buildingName',null);
       this.$set(this,'buildingId',null);
@@ -385,7 +386,35 @@ export default {
       this.$set(this,'floorId',null);
       this.$set(this,'subId',null);
       this.$set(this,'subName',null);
+	  // console.log('this.$refs.videoRef',this.$refs.videoRef)
+	  // console.log('this.$refs.videoRef',this.$refs.videoRef.getTotalList())
+	  // for(let i=0;i<self.urlList.length;i++){
+		 //  let id = self.urlList[i].id;
+		 //  console.log(self.$refs.id);
+		 //  console.log('urlList',this.urlList[i]);
+		 //  let query = wx.createSelectorQuery();//创建节点查询器 query
+		 //  query.select('#440102004920000000010014')
+		 //  let a = query.select('#440102004920000000010014');
+		 //  console.log('query',query.select('#440102004920000000010014'));
+		  
+		  
+		 //  console.log('wx.createSelectorQuery',wx.createSelectorQuery('440102004920000000010014'));
+		  
+		 //  let videoElement1 = document.getElementById('440102004920000000010014');
+		 //  console.log('videoElement1',videoElement1);
+		  
+		  
+		 //  let videoElement = document.getElementById(self.urlList[i].id);
+		 //  console.log('videoElement',videoElement);
+		 //  videoElement.pause();
+		 //  videoElement.removeAttribute('src'); // empty source
+		 //  videoElement.load();
+		 //  // console.log('关闭',self.urlList[i].videoContext)
+		 //  // self.urlList[i].videoContext.stop();
+	  // }
+	  // return
       this.$set(this,'pageType',1);
+      this.$set(this,'urlList',[]);
       this.treeselectByUser();
     },
     //全屏疏散页面
@@ -619,6 +648,7 @@ export default {
           for(let o=0;o<self.buildingList.length;o++){
             for(let i=0;i<data.data.length;i++){
               if(data.data[i].buildId == self.buildingList[o].id){
+				self.buildingList[o].name.replace('(预案发生)')
                 self.buildingList[o].name = '(预案发生) '+self.buildingList[o].name
               }
             }
@@ -629,6 +659,7 @@ export default {
           for(let o=0;o<self.floorList.length;o++){
             for(let i=0;i<data.data.length;i++){
               if(data.data[i].floorId == self.floorList[o].id){
+				self.floorList[o].name.replace('(预案发生)')
                 self.floorList[o].name = '(预案发生) '+self.floorList[o].name
               }
             }
@@ -639,6 +670,7 @@ export default {
           for(let o=0;o<self.fjListArray.length;o++){
             for(let i=0;i<data.data.length;i++){
               if(data.data[i].subId == self.fjListArray[o].subId){
+				self.fjListArray[o].subName.replace('(预案发生)')
                 self.fjListArray[o].subName = '(预案发生) '+self.fjListArray[o].subName
               }
             }
@@ -737,8 +769,9 @@ export default {
           let newUrl = text + 'rtp/' + url[1];
           let obj = {
             name: "楼道监控" + (i + 1),
-             id:data.data.data[i].deviceID,
+            id:data.data.data[i].deviceID,
             url: newUrl,
+			videoContext:wx.createVideoContext(data.data.data[i].deviceID)
           }
           list.push(obj)
         }

+ 48 - 11
pages_manage/workbench/laboratory/laboratoryInfo.vue

@@ -77,13 +77,14 @@
           <view>语音播报</view>
           <view @click="goWord()">播放文字</view>
         </view> -->
-        <view class="for-button-box" v-for="(minItem,minIndex) in itemData.labHardwareVOList" :key="minIndex" v-if="minItem.hardwareTypeEnum.enumName!='VIDEO_MONITOR' && minItem.hardwareTypeEnum.enumName!='RFID_RECOGNIZER'&& minItem.hardwareTypeEnum.enumName!='AI_TERMINAL'&& minItem.hardwareTypeEnum.enumName!='AI_DOORLOCK'&& minItem.hardwareTypeEnum.enumName!='AI_CABINETLOCK' && minItem.hardwareName!='一键灭火'">
-          <view>{{minItem.hardwareName}}</view>
-          <img v-if="minItem.state.code=='3'" src="@/images/icon_10.png" @click="hardwareButton(minItem,'close')">
-          <img v-if="minItem.state.code=='4'" src="@/images/icon_11.png" @click="hardwareButton(minItem,'open')">
-          <view v-if="minItem.state.code=='0'">离线</view>
-          <view v-if="minItem.state.code=='2'" style="color:#0183FA;">在线</view>
-        </view>
+        <view class="for-button-box" v-for="(minItem,minIndex) in itemData.labHardwareVOList" :key="minIndex" v-if="minItem.hardwareTypeEnum.enumName!='VIDEO_MONITOR' && minItem.hardwareTypeEnum.enumName!='RFID_RECOGNIZER'&& minItem.hardwareTypeEnum.enumName!='AI_TERMINAL'&& minItem.hardwareTypeEnum.enumName!='AI_DOORLOCK'&& minItem.hardwareTypeEnum.enumName!='AI_CABINETLOCK' && minItem.hardwareName!='一键灭火' && minItem.isPcfire != '1'">
+          <view class="for-button-p">{{minItem.hardwareName}}</view>
+          <img v-if="minItem.state.code=='3' && minItem.pcType != 1" src="@/images/icon_10.png" @click="hardwareButton(minItem,'close')">
+          <img v-if="minItem.state.code=='4' && minItem.pcType != 1" src="@/images/icon_11.png" @click="hardwareButton(minItem,'open')">
+          <view class="for-button-p" v-if="minItem.state.code=='0' && minItem.pcType != 1">离线</view>
+          <view class="for-button-p" v-if="minItem.state.code=='2' && minItem.pcType != 1" style="color:#0183FA;">在线</view>
+		  <view v-if="minItem.pcType == 1" class="pcType-button" @click="pcTypeButtonClick(minItem.id)">操作</view>
+		</view>
       </view>
     </view>
     <view class="info-max-box">
@@ -162,7 +163,8 @@
 <script>
 import $mqtt from '@/utils/mqtt.min.js';
 import { config } from '@/api/request/config.js'
-import { mySubjectList,subject_class,listDepartments,mangerControl,getDicts,laboratoryInfo,firedeviceStatus,firedeviceStart,firedeviceCancel} from '@/api/index.js'
+import { mySubjectList,subject_class,listDepartments,mangerControl,getDicts,laboratoryInfo,
+		 firedeviceStatus,firedeviceStart,firedeviceCancel,controlSwitch} from '@/api/index.js'
 export default {
   data() {
     return {
@@ -204,8 +206,6 @@ export default {
 	  fireTopic:"lab/fireDevice/Warn/",//传感器状态异常
 	  fireOnlineTopic:"lab/fireDevice/isOnline/",//设备是否在线
 	  firePerformTopic:"lab/fireDevice/executing/",//是否正在执行灭火操作
-	  
-	  
 	  fireType:false,//有无火焰设备状态
 	  fireListType:false,//灭火设备在线离线
 	  fireCode:null,// //灭火设备code
@@ -711,6 +711,33 @@ export default {
       this.client.end();
       this.client = {};
     },
+	pcTypeButtonClick(id){
+		let self = this;
+		uni.showModal({
+		  content: '确认要操作该设备吗?',
+		  cancelColor:"#999",
+		  confirmColor:"#0183FA",
+		  success: function (res) {
+			if (res.confirm) {
+			  self.controlSwitch(id);
+			  console.log('用户点击确定');
+			} else if (res.cancel) {
+			  console.log('用户点击取消');
+			}
+		  }
+		});
+	},
+	async controlSwitch(id){
+		const {data} = await controlSwitch({id:id});
+		if(data.code == 200){
+			uni.showToast({
+			  title: '操作成功',
+			  icon:"none",
+			  mask:true,
+			  duration: 2000
+			});
+		}
+	},
     //设备开关按钮
     hardwareButton(minItem,command){
       let self = this;
@@ -1101,7 +1128,7 @@ export default {
         display flex
         border-bottom:1rpx solid #e0e0e0;
         margin:0 20rpx;
-        view{
+        .for-button-p{
           flex:1;
           line-height:90rpx;
           color:#333333;
@@ -1116,6 +1143,16 @@ export default {
           text-align right
           color:#999;
         }
+		.pcType-button{
+		  width:120rpx;
+		  line-height:42rpx;
+		  border:4rpx solid #0183FA;
+		  border-radius:30rpx;
+		  color: #0183FA !important;
+		  font-size: 24rpx;
+		  text-align center !important;
+		  margin:20rpx 0 20rpx 0;
+		}
       }
     }
   }