bobo04052021@163.com 2 днів тому
батько
коміт
74bed3737e

+ 1 - 4
api/api.js

@@ -111,10 +111,7 @@ const apiService = {
   },
   //如果上面这个接口返回code码  则使用这个接口获取url
   getCameraByCode(params) {
-    // const urlParams = new URLSearchParams(params);
-    // const url =
-    //   "/ventanaly-device/camera/queryByCameraCode?" + urlParams.toString();
-    const url = buildURL("/ventanaly-device/camera/queryByCameraCode", params);
+    const url = buildURL("/monitor/camera/queryByCameraCode", params);
     return http.get(url);
   },
 

+ 2 - 2
common/service/config.service.js

@@ -7,12 +7,12 @@ if (process.env.NODE_ENV == "development") {
   // BASE_URL = "http://10.248.135.10:9999"; // 大柳塔进
   // BASE_URL = "http://10.248.135.121:9999"; // 活鸡兔井
   // BASE_URL = "http://10.246.63.125:9999"; // 寸草塔二矿
-  BASE_URL = "http://10.246.183.35:9999"; // 乌兰木伦
+  // BASE_URL = "http://10.246.183.35:9999"; // 乌兰木伦
   // BASE_URL = "http://10.120.120.164:9999"; // 察哈素
   // BASE_URL = "http://182.92.126.35:9999"; // 生产环境
   // BASE_URL = "http://172.16.53.16:9999"; //
   // BASE_URL = "http://10.246.167.205:9999"; //上湾
-  // BASE_URL = "http://172.30.157.9:9999"; //元子沟
+  BASE_URL = "http://172.30.157.9:9999"; //元子沟
   // BASE_URL = "http://10.246.167.205:9999"; //上湾
 }
 let staticDomainURL = BASE_URL + "/sys/common/static";

+ 1 - 1
pages/gasreport/components/gasImgIdentify.vue

@@ -126,7 +126,7 @@
 import api from "@/api/api";
 import moment from 'moment'
 import configService from '@/common/service/config.service.js'
-import { RHFselcet } from '@/uni_modules/fz-media-selcet';
+// import { RHFselcet } from '@/uni_modules/fz-media-selcet';
 export default {
     name: 'gasFill',
     props: {

+ 50 - 23
pages/home/detail/autodoor/autodoor.vue

@@ -75,7 +75,6 @@
             :gatestate1="frontGateStatus"
             :gatestate2="midGateStatus"
             :gatestate3="rearGateStatus"
-            :cameralist="cameralist"
             :height="height"
             :doorcount="ndoorcount"
           >
@@ -114,20 +113,7 @@
             :nowfengji="qidongfengji"
           ></fanmainAnimate>
         </div>
-        <div
-          class="flcard"
-          v-if="this.TabCur == 'window' && this.nwindownum == 1"
-        >
-          <windowAnimate
-            :windowAngle="windowAngle"
-            :height="height"
-            :windowcount="nwindownum"
-          ></windowAnimate>
-        </div>
-        <div
-          class="flcard"
-          v-if="this.TabCur == 'window' && this.nwindownum == 2"
-        >
+        <div class="flcard" style="" v-if="this.TabCur == 'window'">
           <windowAnimate
             :windowAngle="windowAngle"
             :windowAngle1="windowAngle1"
@@ -135,6 +121,21 @@
             :windowcount="nwindownum"
           ></windowAnimate>
         </div>
+        <div v-if="this.cameraList.length > 0">
+          <div class="flcard" v-for="(item, index) in cameraList" :key="index">
+            <video
+              style="margin-left: 20px"
+              id="myVideo"
+              controls
+              show-loading
+              autoplay
+              class="r-video"
+              :vslide-gesture="true"
+              :vslide-gesture-in-fullscreen="true"
+              :src="item.addr"
+            ></video>
+          </div>
+        </div>
         <div class="flcard">
           <div
             class="flex-container"
@@ -671,7 +672,8 @@ export default {
       fan1State: "",
       fan2State: "",
       deviceid: "", //ID
-      cameralist: [], //摄像数据
+      cameras: [], //摄像头数据
+      cameraList: [], //摄像数据
       showColum: {},
       deviceShowList: [],
     };
@@ -693,7 +695,6 @@ export default {
   created() {
     this.getShowColum();
     this.getDeviceInfo(this.itemId);
-    this.getVideoUrlById(this.itemId);
   },
   mounted() {
     this.startTimer();
@@ -789,6 +790,9 @@ export default {
               var result = response.data.result.msgTxt[0].datalist[0];
               let newData = { ...result, ...result.readData };
               this.tableData = newData;
+              this.cameras = result.cameras;
+              this.getVideoUrlById(this.cameras);
+
               if (this.tableData["frontGateClose"] == "1") {
                 this.tableData.frontGateOpen = "关闭";
               } else if (this.tableData["frontGateClose"] == "0") {
@@ -845,16 +849,39 @@ export default {
       });
     },
     //获取监控URL 通过ID获取
-    getVideoUrlById(ID) {
-      let IDString = String(ID); // 将 ID 转换为字符串
+    getVideoUrlById(data) {
+      this.cameraList = []; // 清空摄像头列表
+      data.forEach((item) => {
+        const isHttp =
+          item.addr?.startsWith("http://") || item.addr?.startsWith("https://");
+        if (isHttp) {
+          this.cameraList.push(item);
+        } else {
+          this.getVideoUrlByCode(item.addr);
+        }
+      });
+    },
+    getVideoUrlByCode(ID) {
       new Promise((resolve, reject) => {
         api
-          .getCameraById({ deviceid: IDString })
+          .getCameraByCode({ cameraCode: ID, videoType: "" })
           .then((response) => {
             if (response.data.code == 200) {
-              if (response.data.result.records.length > 0) {
-                this.cameralist = response.data.result.records[0];
-              }
+              const addr = response.data.result.url;
+              this.cameraList.push({
+                addr: addr,
+                cameraCode: ID,
+              });
+              uni.showModal({
+                title: "数据提示",
+                content: this.cameraList.addr
+                  ? `共${
+                      this.cameraList.cameraCode
+                    }条数据:\n${this.cameraList.join("\n\n")}`
+                  : "无数据",
+                showCancel: false,
+                confirmText: "知道了",
+              });
             } else {
               resolve(response);
             }