xsh_1997 1 ay önce
ebeveyn
işleme
ee20aee9ed

+ 1 - 1
ruoyi-screen/src/components/GisMap.vue

@@ -10,7 +10,7 @@ import {
10 10
   loadGisSdk,
11 11
   resolveGisMapStyle,
12 12
   createGisTransformRequest,
13
-  syncWmtsLayerVisibility
13
+  syncWmtsLayerVisibility 
14 14
 } from '@/utils/gisLoader'
15 15
 import {
16 16
   parsePoiLngLat,

+ 2 - 0
ruoyi-ui/package.json

@@ -24,9 +24,11 @@
24 24
     "url": "https://gitee.com/y_project/RuoYi-Vue.git"
25 25
   },
26 26
   "dependencies": {
27
+    "@liveqing/liveplayer": "^2.7.40",
27 28
     "@riophae/vue-treeselect": "0.4.0",
28 29
     "axios": "0.30.3",
29 30
     "clipboard": "2.0.8",
31
+    "copy-webpack-plugin": "^4.6.0",
30 32
     "core-js": "3.37.1",
31 33
     "echarts": "5.4.0",
32 34
     "element-china-area-data": "^5.0.2",

+ 1 - 0
ruoyi-ui/public/index.html

@@ -6,6 +6,7 @@
6 6
     <meta name="renderer" content="webkit">
7 7
     <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no">
8 8
     <link rel="icon" href="<%= BASE_URL %>favicon.ico">
9
+    <script type="text/javascript" src="<%= BASE_URL %>js/liveplayer-lib.min.js"></script>
9 10
     <title><%= webpackConfig.name %></title>
10 11
     <!--[if lt IE 11]><script>window.location.href='/html/ie.html';</script><![endif]-->
11 12
 	  <style>

Dosya farkı çok büyük olduğundan ihmal edildi
+ 1 - 0
ruoyi-ui/public/js/liveplayer-component.min.js


Dosya farkı çok büyük olduğundan ihmal edildi
+ 1 - 0
ruoyi-ui/public/js/liveplayer-lib.min.js


+ 2 - 0
ruoyi-ui/src/lang/bo/videoSurveillance.js

@@ -33,6 +33,7 @@ export default {
33 33
     colOwner: "གཙོ་བོ།",
34 34
     colInstallLocation: "སྒྲིག་གནས།",
35 35
     actionLiveView: "ད་ལྟ་བརྙན་ལྟ",
36
+    dialogLiveView: "ད་ལྟ་བརྙན",
36 37
     formMonitorName: "བརྙན་ཟློས་མིང་།",
37 38
     formOwner: "གཙོ་བོ།",
38 39
     formInstallLocation: "སྒྲིག་གནས།",
@@ -45,6 +46,7 @@ export default {
45 46
     dialogEdit: "[རྩོམ]བརྙན་ཟློས",
46 47
     confirmDelete: "ཐོ་གཞུང་འདི་སུབ་རྒྱུ་གཏན་ཁེལ་ལམ?",
47 48
     msgLiveNotOpen: "ད་ལྟ་བརྙན་མ་ཁ་ཕྱེ། སྒྲིག་གནས་སྔོན་དུ་གྲུབ",
49
+    msgLiveNoStream: "བརྙན་ཟློས་མེད(接口对接待)",
48 50
     viewMonitorName: "བརྙན་ཟློས་མིང་།",
49 51
     viewOwner: "གཙོ་བོ།",
50 52
     viewInstallLocation: "སྒྲིག་གནས།",

+ 2 - 0
ruoyi-ui/src/lang/zh/videoSurveillance.js

@@ -33,6 +33,7 @@ export default {
33 33
     colOwner: "所属主体",
34 34
     colInstallLocation: "安装位置",
35 35
     actionLiveView: "查看实时监控",
36
+    dialogLiveView: "实时监控",
36 37
     formMonitorName: "监控名称",
37 38
     formOwner: "所属主体",
38 39
     formInstallLocation: "安装位置",
@@ -45,6 +46,7 @@ export default {
45 46
     dialogEdit: "[编辑]监控点位",
46 47
     confirmDelete: "是否确认删除这条数据?",
47 48
     msgLiveNotOpen: "实时监控功能暂未开放,请先完成监控点位登记",
49
+    msgLiveNoStream: "暂无直播流(监控流地址待接口对接)",
48 50
     viewMonitorName: "监控名称",
49 51
     viewOwner: "所属主体",
50 52
     viewInstallLocation: "安装位置",

+ 71 - 3
ruoyi-ui/src/views/videoSurveillance/livestockMonitor/index.vue

@@ -65,7 +65,7 @@
65 65
         <el-table-column :label="vsT('colInstallLocation')" prop="installLocation" align="center" min-width="120" :show-overflow-tooltip="true" />
66 66
         <el-table-column :label="vsCommon('colOp')" align="center" class-name="small-padding fixed-width" width="300" fixed="right">
67 67
           <template slot-scope="scope">
68
-            <el-button type="text" size="mini" @click="handleLiveView">{{ vsT("actionLiveView") }}</el-button>
68
+            <el-button type="text" size="mini" @click="handleLiveView(scope.row)">{{ vsT("actionLiveView") }}</el-button>
69 69
             <el-button
70 70
               v-hasPermi="['videoSurveillance:livestockMonitor:query']"
71 71
               type="text"
@@ -177,10 +177,38 @@
177 177
         <el-button @click="viewOpen = false">{{ vsCommon("close") }}</el-button>
178 178
       </div>
179 179
     </el-dialog>
180
+
181
+    <el-dialog
182
+      :title="liveDialogTitle"
183
+      :visible.sync="liveOpen"
184
+      width="960px"
185
+      append-to-body
186
+      destroy-on-close
187
+      @close="closeLiveView"
188
+    >
189
+      <div class="live-player-wrap">
190
+        <LivePlayer
191
+          :video-url="liveVideoUrl"
192
+          :video-title="liveVideoTitle"
193
+          :alt="vsT('msgLiveNoStream')"
194
+          live
195
+          fluent
196
+          :autoplay="!!liveVideoUrl"
197
+          stretch
198
+          aspect="16:9"
199
+          :controls="true"
200
+          :muted="true"
201
+        />
202
+      </div>
203
+      <div slot="footer" class="dialog-footer">
204
+        <el-button @click="closeLiveView">{{ vsCommon("close") }}</el-button>
205
+      </div>
206
+    </el-dialog>
180 207
   </div>
181 208
 </template>
182 209
 
183 210
 <script>
211
+import LivePlayer from "@liveqing/liveplayer"
184 212
 import videoSurveillanceLocaleMixin from "@/mixins/videoSurveillanceLocaleMixin"
185 213
 import {
186 214
   listLivestockMonitor,
@@ -205,6 +233,9 @@ function createEmptyForm() {
205 233
 
206 234
 export default {
207 235
   name: "VideoSurveillanceLivestockMonitor",
236
+  components: {
237
+    LivePlayer
238
+  },
208 239
   mixins: [videoSurveillanceLocaleMixin],
209 240
   data() {
210 241
     return {
@@ -212,6 +243,10 @@ export default {
212 243
       loading: false,
213 244
       open: false,
214 245
       viewOpen: false,
246
+      liveOpen: false,
247
+      liveRow: {},
248
+      liveVideoUrl: "",
249
+      liveVideoTitle: "",
215 250
       viewRow: {},
216 251
       dialogEdit: false,
217 252
       formKey: 0,
@@ -238,6 +273,10 @@ export default {
238 273
     dialogTitle() {
239 274
       return this.dialogEdit ? this.vsT("dialogEdit") : this.vsT("dialogAdd")
240 275
     },
276
+    liveDialogTitle() {
277
+      const name = this.liveRow.monitorName || this.liveVideoTitle
278
+      return name ? `${this.vsT("dialogLiveView")} - ${name}` : this.vsT("dialogLiveView")
279
+    },
241 280
     formRules() {
242 281
       return {
243 282
         monitorName: [
@@ -471,8 +510,30 @@ export default {
471 510
         this.viewOpen = true
472 511
       })
473 512
     },
474
-    handleLiveView() {
475
-      this.$modal.msgWarning(this.vsT("msgLiveNotOpen"))
513
+    handleLiveView(row) {
514
+      if (!row || row.id == null) {
515
+        return
516
+      }
517
+      getLivestockMonitor(row.id).then((res) => {
518
+        const data = res.data || row
519
+        this.liveRow = data
520
+        this.liveVideoTitle = data.monitorName || ""
521
+        this.liveVideoUrl = this.resolveLiveVideoUrl(data)
522
+        this.liveOpen = true
523
+      })
524
+    },
525
+    closeLiveView() {
526
+      this.liveVideoUrl = ""
527
+      this.liveVideoTitle = ""
528
+      this.liveRow = {}
529
+      this.liveOpen = false
530
+    },
531
+    resolveLiveVideoUrl(row) {
532
+      if (!row) {
533
+        return ""
534
+      }
535
+      const url = row.liveStreamUrl || row.streamUrl || row.videoUrl
536
+      return url ? String(url).trim() : ""
476 537
     },
477 538
     handleDelete(row) {
478 539
       this.$modal
@@ -520,4 +581,11 @@ export default {
520 581
   margin-right: 6px;
521 582
   vertical-align: middle;
522 583
 }
584
+
585
+.live-player-wrap {
586
+  position: relative;
587
+  width: 100%;
588
+  height: 540px;
589
+  background: #000;
590
+}
523 591
 </style>

+ 8 - 1
ruoyi-ui/vue.config.js

@@ -7,6 +7,8 @@ function resolve(dir) {
7 7
 
8 8
 const CompressionPlugin = require('compression-webpack-plugin')
9 9
 
10
+const CopyPlugin = require('copy-webpack-plugin')
11
+
10 12
 const name = process.env.VUE_APP_TITLE || '行业数字服务链' // 网页标题
11 13
 
12 14
 const baseUrl = 'http://192.168.1.6:8010' // 后端接口
@@ -76,7 +78,12 @@ module.exports = {
76 78
         algorithm: 'gzip',                             // 使用gzip压缩
77 79
         minRatio: 0.8,                                 // 压缩比例,小于 80% 的文件不会被压缩
78 80
         deleteOriginalAssets: false                    // 压缩后删除原文件
79
-      })
81
+      }),
82
+      new CopyPlugin([
83
+        { from: 'node_modules/@liveqing/liveplayer/dist/component/crossdomain.xml'},
84
+        { from: 'node_modules/@liveqing/liveplayer/dist/component/liveplayer.swf'},
85
+        { from: 'node_modules/@liveqing/liveplayer/dist/component/liveplayer-lib.min.js', to: 'js/'},
86
+      ])
80 87
     ],
81 88
   },
82 89
   chainWebpack(config) {