ll
liukangdong
2024-12-12 c5370d2a8c89caa6c8da533c2cf691cb3d16dc3c
ll
已修改1个文件
33 ■■■■ 文件已修改
screen/src/views/SecurityControl.vue 33 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
screen/src/views/SecurityControl.vue
@@ -476,7 +476,7 @@
</template>
<script setup>
import { ref, onMounted } from 'vue'
import { ref, onMounted, nextTick } from 'vue'
import VScaleScreen from 'v-scale-screen'
import Percent from '@/components/percent.vue'
import dayjs from 'dayjs'
@@ -520,20 +520,23 @@
    szClassId: "23BF3B0A-2C56-4D97-9C03-0CB103AA8F11",   // 用于IE10使用ActiveX的clsid
    cbConnectSuccess: function () {
      // 创建WebControl实例成功
      console.log('创建WebControl实例成功');
      oWebControl.value.JS_StartService("window", {         // WebControl实例创建成功后需要启动服务
        dllPath: "./VideoPluginConnect.dll"         // 值"./VideoPluginConnect.dll"写死
      }).then(function () {
        oWebControl.value.JS_SetWindowControlCallback({   // 设置消息回调
          cbIntegrationCallBack: cbIntegrationCallBack
        })// 启动插件服务成功
        // oWebControl.value.JS_CreateWnd("playWnd", that.boxWidth, that.boxHeight).then(function () { //JS_CreateWnd创建视频播放窗口,宽高可设定,boxWidth, boxHeight容器
        oWebControl.value.JS_CreateWnd("playWnd").then(function () { //JS_CreateWnd创建视频播放窗口,宽高可设定,boxWidth, boxHeight容器
        oWebControl.value.JS_CreateWnd("playWnd", '300', '200').then(function () { //JS_CreateWnd创建视频播放窗口,宽高可设定,boxWidth, boxHeight容器
        // oWebControl.value.JS_CreateWnd("playWnd").then(function () { //JS_CreateWnd创建视频播放窗口,宽高可设定,boxWidth, boxHeight容器
          init()  // 创建播放实例成功后初始化
        })
      }, function () { // 启动插件服务失败
      })
    },
    cbConnectError: function () { // 创建WebControl实例失败
      console.log('创建WebControl实例失败');
      oWebControl.value = null
      $("#playWnd").html("插件未启动,正在尝试启动,请稍候...")
      WebControl.JS_WakeUp("VideoWebPlugin://") // 程序未启动时执行error函数,采用wakeup来启动程序
@@ -549,6 +552,7 @@
    cbConnectClose: function (bNormalClose) {
      // 异常断开:bNormalClose = false
      // JS_Disconnect正常断开:bNormalClose = true
      console.log('异常断开:bNormalClose');
      oWebControl.value = null
      $("#playWnd").html("插件未启动,正在尝试启动,请稍候...")
      WebControl.JS_WakeUp("VideoWebPlugin://")
@@ -580,14 +584,15 @@
const init = () => {
  getPubKey(function () {
    ////////////////////////////////// 请自行修改以下变量值   ////////////////////////////////////
    let appkey = "28631222"                           //综合安防管理平台提供的appkey,必填
    let secret = setEncrypt("vRfUmiilCd4EpLmtZKoT")   //综合安防管理平台提供的secret,必填
    let ip = "112.48.8.98"                           //综合安防管理平台IP地址,必填
    let appkey = "23154099"                           //综合安防管理平台提供的appkey,必填
    let secret = '88wFsg3xfn7o8QMsWEO2'   //综合安防管理平台提供的secret,必填
    // let secret = setEncrypt("88wFsg3xfn7o8QMsWEO2")   //综合安防管理平台提供的secret,必填
    let ip = "10.50.250.253"                           //综合安防管理平台IP地址,必填
    let playMode = 0                                  //初始播放模式:0-预览(实时流),1-回放(视频)
    let port = 10443                                    //综合安防管理平台端口,若启用HTTPS协议,默认443
    let port = 443                                    //综合安防管理平台端口,若启用HTTPS协议,默认443
    let snapDir = "D:\\SnapDir"                       //抓图存储路径
    let videoDir = "D:\\VideoDir"                     //紧急录像或录像剪辑存储路径
    let layout = "4x1"                                //playMode指定模式的布局
    let layout = "1x1"                                //playMode指定模式的布局
    let enableHTTPS = 1                               //是否启用HTTPS协议与综合安防管理平台交互,这里总是填1
    let encryptedFields = 'secret'                    //加密字段,默认加密领域为secret
    let showToolbar = 1                               //是否显示工具栏,0-不显示,非0-显示
@@ -611,6 +616,8 @@
        buttonIDs: buttonIDs                       //自定义工具条按钮
      })
    }).then(function (oData) {
      console.log('初始化成功');
      // oWebControl.value.JS_Resize(that.boxWidth, that.boxHeight)  // 初始化后resize一次,规避firefox下首次显示窗口后插件窗口未与DIV窗口重合问题
    })
  })
@@ -1048,6 +1055,9 @@
const menuItemClick = (val) => {
  initPlugin()
  activeMenu.value = val
  nextTick(() => {
    console.log('indexCode', val.indexCode);
  oWebControl.value.JS_RequestInterface({
    funcName: "startPreview",
    argument: JSON.stringify({
@@ -1059,9 +1069,14 @@
    })
  }).then((oData) => {
    if (oData.responseMsg.code === 1) {
      console.log('success')
        console.log('success', oData)
    }
    }, err => {
      console.log('err', err)
  })
  })
  // afgetCarmeraPreviemUrl({ indexCode: val.indexCode }).then(res => {
  //   activeVideo.value = res.data
  // })