From 8aa3edd56c279100c9053576f3e90fa55459fe77 Mon Sep 17 00:00:00 2001
From: zengh <123456>
Date: Mon, 16 Jan 2023 16:15:55 +0800
Subject: [PATCH] 修改

---
 src/views/dataL/dataL.vue |  199 ++++++++++++++++++++++++++++---------------------
 1 files changed, 115 insertions(+), 84 deletions(-)

diff --git a/src/views/dataL/dataL.vue b/src/views/dataL/dataL.vue
index 49112ac..7710cb1 100644
--- a/src/views/dataL/dataL.vue
+++ b/src/views/dataL/dataL.vue
@@ -1005,15 +1005,9 @@
         });
       });
     },
-    stetDetails(d, imgdata) {
+    stetDetails(c, imgdata) {
       this.name = "无数据" && this.a.deviceName;
       //设备状态
-      // [grey,green,red][
-      //   onlineStatus = 0,
-      //   onlineStatus = 1,
-      //   state!= "",
-      //   jtype != 2
-      //   ]
       var states,
         d = this.a.dtype;
       if (d == 0) {
@@ -1025,25 +1019,6 @@
       } else if (d == 2) {
         states = "预警";
       }
-
-      // if (s != "") {
-      //   states = "故障";
-      // } else {
-      //   if (j != 1) {
-      //     if (o == 1) {
-      //       states = "正常";
-      //     } else {
-      //       states = "掉线";
-      //     }
-      //   } else {
-      //     states = "预警";
-      //   }
-      // }
-      // console.log(o, 1000);
-      // console.log(s, 1000);
-      // console.log(j, 1000);
-
-      // console.log(states, 1000);
       this.state = states;
 
       this.evaluate = "空气质量";
@@ -1074,7 +1049,7 @@
         installation: this.a.stime, //     安装时间
         heartbeat: this.a.heartbeat, //     心跳时间
       };
-      this.form = d;
+      this.form = c;
     },
     getdataG() {
       var dataG = {
@@ -1211,65 +1186,118 @@
       // console.log(this.$store.state)
     },
     //获取视频
-    openRealVideoBox(serialNumber, channelNumber) {
+    openRealVideoBox(serialNumber, channelNumber,deviceNumber,manufacturer) {
       var that = this;
-      var newAxios = axios.create({
-        baseURL: "https://web.byisf.com:18000",
-        withCredentials: false,
-        headers: {
-          "Content-type": "application/x-www-form-urlencoded",
-        },
-      });
-      newAxios
-        .post(
-          "/api_control",
-          {},
-          {
-            params: {
-              param: JSON.stringify({ PktType: "GetAccessToken" }),
-            },
-          }
-        )
-        .then((res) => {
-          newAxios
-            .get(
-              `https://web.byisf.com:18000/GetPlayUrl?deviceCode=${serialNumber}&chl=${channelNumber}`
-            )
-            .then((result) => {
-              that.videoSource = result.data.data.m3u8;
-              if (Hls.isSupported()) {
-                var dom = document.getElementById(
-                  "real_video_conversationDataL"
-                );
-                that.hls = new Hls();
-                var m3u8Url = decodeURIComponent(that.videoSource);
-                that.hls.loadSource(m3u8Url);
-                that.hls.attachMedia(dom);
-                that.hls.on(Hls.Events.MANIFEST_PARSED, function () {
-                  dom.play();
-                });
-                that.hls.on(Hls.Events.ERROR, function (event, data) {
-                  // console.log(data, 4566824159, "视频播放有问题!!!");
-                  if (data.fatal) {
-                    switch (data.type) {
-                      case Hls.ErrorTypes.NETWORK_ERROR:
-                        console.log(
-                          "fatal network error encountered, try to recover"
-                        );
-                        that.hls.startLoad();
-                        break;
-                      case Hls.ErrorTypes.MEDIA_ERROR:
-                        console.log(
-                          "fatal media error encountered, try to recover"
-                        );
-                        that.hls.recoverMediaError();
-                        break;
-                    }
+
+      if (manufacturer == "HK"){
+        axios
+          .get(
+            `/api/blade-jfpts/equipment/equipment/selectEquimentPlayInfo?number=${deviceNumber}&bmp=m3u8&manufacturer=${manufacturer}`
+          )
+          .then((result) => {
+            that.videoSource = result.data.data.data.url;
+            if (Hls.isSupported()) {
+              var dom = document.getElementById(
+                "real_video_conversationDataL"
+              );
+              that.hls = new Hls();
+              var m3u8Url = decodeURIComponent(that.videoSource);
+              that.hls.loadSource(m3u8Url);
+              that.hls.attachMedia(dom);
+              that.hls.on(Hls.Events.MANIFEST_PARSED, function () {
+                dom.play();
+              });
+              that.hls.on(Hls.Events.ERROR, function (event, data) {
+                // console.log(data, 4566824159, "视频播放有问题!!!");
+                if (data.fatal) {
+                  switch (data.type) {
+                    case Hls.ErrorTypes.NETWORK_ERROR:
+                      console.log(
+                        "fatal network error encountered, try to recover"
+                      );
+                      that.hls.startLoad();
+                      break;
+                    case Hls.ErrorTypes.MEDIA_ERROR:
+                      console.log(
+                        "fatal media error encountered, try to recover"
+                      );
+                      that.hls.recoverMediaError();
+                      break;
                   }
-                });
-              }
-            });
+                }
+              });
+            }
+          });
+      }else{
+        var res = that.a;
+        if (res.deviceName.indexOf("(象湖院区)") != -1 || res.deviceName.indexOf("(东湖院区)") != -1){
+          debugger
+          var dom = document.getElementById(
+            "real_video_conversationDataL"
+          );
+          dom.src = res.netType;
+          dom.play();
+          return;
+        }
+
+        var newAxios = axios.create({
+          baseURL: "https://web.byisf.com:18000",
+          withCredentials: false,
+          headers: {
+            "Content-type": "application/x-www-form-urlencoded",
+          },
         });
+        newAxios
+          .post(
+            "/api_control",
+            {},
+            {
+              params: {
+                param: JSON.stringify({ PktType: "GetAccessToken" }),
+              },
+            }
+          )
+          .then((res) => {
+            newAxios
+              .get(
+                `https://web.byisf.com:18000/GetPlayUrl?deviceCode=${serialNumber}&chl=${channelNumber}`
+              )
+              .then((result) => {
+                that.videoSource = result.data.data.m3u8;
+                if (Hls.isSupported()) {
+                  var dom = document.getElementById(
+                    "real_video_conversationDataL"
+                  );
+                  that.hls = new Hls();
+                  var m3u8Url = decodeURIComponent(that.videoSource);
+                  that.hls.loadSource(m3u8Url);
+                  that.hls.attachMedia(dom);
+                  that.hls.on(Hls.Events.MANIFEST_PARSED, function () {
+                    dom.play();
+                  });
+                  that.hls.on(Hls.Events.ERROR, function (event, data) {
+                    // console.log(data, 4566824159, "视频播放有问题!!!");
+                    if (data.fatal) {
+                      switch (data.type) {
+                        case Hls.ErrorTypes.NETWORK_ERROR:
+                          console.log(
+                            "fatal network error encountered, try to recover"
+                          );
+                          that.hls.startLoad();
+                          break;
+                        case Hls.ErrorTypes.MEDIA_ERROR:
+                          console.log(
+                            "fatal media error encountered, try to recover"
+                          );
+                          that.hls.recoverMediaError();
+                          break;
+                      }
+                    }
+                  });
+                }
+              });
+          });
+      }
     },
   },
   created() {
@@ -1313,7 +1341,7 @@
     activeName() {
       if (this.activeName == "third") {
         this.i++;
-        this.openRealVideoBox(this.a.serialNumber, this.a.channelNumber);
+        this.openRealVideoBox(this.a.serialNumber, this.a.channelNumber,this.a.deviceNumber,this.a.manufacturers);
       } else {
         var dom = document.getElementById("real_video_conversationDataL");
         if (dom.getAttribute("src") != "") {
@@ -1327,6 +1355,9 @@
 };
 </script>
 <style lang="scss" >
+video::-webkit-media-controls-timeline {
+            display: none;
+        }
 #Lour {
   width: 100%;
   font-size: 14px;

--
Gitblit v1.9.3