Browse Source

删除项目console.log

liuwei 3 years ago
parent
commit
91c8c08222

+ 1 - 1
src/main/index.js

@@ -48,7 +48,7 @@ function createWindow () {
   mainWindow.setFullScreen(true)
 
   // 打开开发者工具
-  mainWindow.webContents.openDevTools();
+  // mainWindow.webContents.openDevTools();
 
   mainWindow.once('ready-to-show', () => {
     mainWindow.show()

+ 1 - 3
src/renderer/App.vue

@@ -22,7 +22,7 @@
         if (res.status === 200) {
           const result = await reqConfigBigScreen(res.data)
           if(result[0].ID){
-            console.log('上传大屏配置文件成功!')
+
           }
         }
       })
@@ -31,8 +31,6 @@
         if (res.status === 200) {
           const result = await reqConfigDevice(res.data)
           if(result[0].ID){
-            console.log('上传设备配置文件成功!')
-
             const windowJson = await getStaticFile('EnityWindow.Data')
             const arr = windowJson.filter(item => item.IsVisibility === true)
             const homeJson = arr[0]

+ 3 - 4
src/renderer/components/BigShow.vue

@@ -32,7 +32,9 @@
             >
                 <div ref="signal" :id="itemV.ID" style="width:100%;height:100%;overflow: hidden">
                     <ckplayer
-
+                         ref="videoPlayer"
+                         :video="videoPlayObj[itemV.sourceId]"
+                         :style="scaleFun(itemV)"
                     />
                     <div class="signalName">{{itemV.deviceName}}</div>
                     <div class="closeBtn" @click.stop="closeSignal(itemV)">×</div>
@@ -140,7 +142,6 @@
                         bigScreenId: Id,
                         streamWindows
                     })
-                    console.log('结束时间毫秒',new Date().getMilliseconds())
                 }
             },
 
@@ -251,8 +252,6 @@
                 },
 
                 set(arr) {
-                    console.log('开始时间毫秒',new Date().getMilliseconds())
-
                     setTimeout(() => {
                         const bigscreenId = this.$store.state.curOpeBigscreenId
                         const bigScreenObj = this.$store.state.bigScreenObj

+ 10 - 6
src/renderer/components/SignalList.vue

@@ -34,13 +34,17 @@
             <div class="signal_item_bg">
                 <div class="signal_item_bg_body">
                     <div class="signal_item_bg_body_space">
-                        <!--<div style="height:100%" v-show="item.preview" :ref="item.ID">
-                            <VideoPlayer
+                        <div style="height:102px" :ref="item.ID" v-show="item.preview">
+                            <!--<VideoPlayer
                                     :options="videoPlayObj2[item.sourceId]"
                                     :playsinline="true"
                                     :style="scaleFun(item)"
+                            />-->
+
+                            <ckplayer2
+                                 :previewUrl="item.previewUrl"
                             />
-                        </div>-->
+                        </div>
                     </div>
                     <div class="signal_item_bg_body_font">{{item.deviceName}}</div>
                 </div>
@@ -54,6 +58,7 @@
     import draggable from 'vuedraggable'
     import {getStaticFile} from "../../utils/tools"
     import VideoPlayer from "./player"
+    import ckplayer2 from "./ckplayerSignalList"
 
     export default {
         data() {
@@ -65,7 +70,8 @@
 
         components: {
             draggable,
-            VideoPlayer
+            VideoPlayer,
+            ckplayer2
         },
 
         async beforeCreate() {
@@ -113,8 +119,6 @@
                 let len = bigscreenObj[evt.to.id] ? bigscreenObj[evt.to.id].signalArr.length : 0
                 const count = evt.newIndex + 1 - len > 0 ? evt.newIndex + 1 - len : 1
                 
-                console.log(evt,'-----------',count)
-                
                 // 更新当前拖拽的位置
                 this.$store.dispatch('updatePositionNum', count)
             },

+ 6 - 4
src/renderer/components/ckplayer.vue

@@ -8,20 +8,22 @@
         data () {
             return {
                 videoObject: {
-                    /*width: 1015, // 宽度,也可以支持百分比(不过父元素宽度要有)
-                    height: 574, // 高度,也可以支持百分比*/
                     container: "#video", //“#”代表容器的ID,“.”或“”代表容器的class
                     variable: "player", //该属性必需设置,值等于下面的new chplayer()的对象
                     autoplay: true, //自动播放
                     live: true,
-                    video: "rtmp://58.200.131.2:1935/livetv/hunantv", //视频地址(必填),
+                    video: "", //视频地址(必填),
+                    // video: "rtmp://192.168.0.206:1935/live/livestream/sub", //视频地址(必填),
                 }
             }
         },
         mounted: function(){
+            const url = this.video ? this.video.sources[0].src : ''
+            this.videoObject.video = this.previewUrl ? this.previewUrl : url
             // 定义一个对象
             let player = new ckplayer(this.videoObject);
-        }
+        },
+        props:['video','previewUrl'] /*通过props接收父组件传递过来的数据 */
     }
 </script>
 

+ 32 - 0
src/renderer/components/ckplayerSignalList.vue

@@ -0,0 +1,32 @@
+<template>
+    <div id="video" style="height:102px"></div>
+</template>
+
+<script>
+    export default {
+        name: 'ckplayerPlugin',
+        data () {
+            return {
+                videoObject: {
+                    container: "#video", //“#”代表容器的ID,“.”或“”代表容器的class
+                    variable: "player", //该属性必需设置,值等于下面的new chplayer()的对象
+                    autoplay: true, //自动播放
+                    live: true,
+                    video: "", //视频地址(必填),
+                }
+            }
+        },
+        mounted: function(){
+            this.videoObject.video = this.previewUrl
+            // 定义一个对象
+            let player = new ckplayer(this.videoObject);
+        },
+        props:['previewUrl'] /*通过props接收父组件传递过来的数据 */
+    }
+</script>
+
+<style scoped>
+    #video {
+
+    }
+</style>