解决 海康页面 ts 爆红

解决 海康页面 ts 爆红
This commit is contained in:
TimSpan 2024-08-16 10:15:40 +08:00
parent 866d498406
commit d115fc7af7
2 changed files with 11 additions and 8 deletions

4
src/global.d.ts vendored
View File

@ -1,5 +1,7 @@
declare const __APP_ENV: ImportMetaEnv; declare const __APP_ENV: ImportMetaEnv;
interface Window {
JSPlugin: any; // 根据实际情况定义类型,比如 `JSPlugin: MyPluginType`
}
declare interface AppInfo { declare interface AppInfo {
name: string; name: string;
appName: string, appName: string,

View File

@ -5,6 +5,7 @@
import api from '@/axios' import api from '@/axios'
import {Ref, ref, watch, onMounted, onBeforeMount, onBeforeUnmount, reactive, getCurrentInstance} from 'vue' import {Ref, ref, watch, onMounted, onBeforeMount, onBeforeUnmount, reactive, getCurrentInstance} from 'vue'
import {useRouter} from 'vue-router' import {useRouter} from 'vue-router'
import {JsonResult} from '@/axios'
const router = useRouter() const router = useRouter()
const infoData = ref() const infoData = ref()
var curIndex = 0 // var curIndex = 0 //
@ -16,13 +17,13 @@ onMounted(() => {
} }
let date = { let date = {
pointId: router.currentRoute.value.query.pointId, pointId: router.currentRoute.value.query.pointId,
useTLS: 0, useTLS: 0
} }
if (process.env.NODE_ENV === 'production') { if (process.env.NODE_ENV === 'production') {
date.useTLS = 1 date.useTLS = 1
} }
api.post('/multialarm/video/preview', { ...date }).then((res) => { api.post('/multialarm/video/preview', {...date}).then((res: JsonResult<any>) => {
// console.log('router222', res) // console.log('router222', res)
console.log('播放地址', res.data.videoUrl) console.log('播放地址', res.data.videoUrl)
var code = res['code'] var code = res['code']
@ -41,9 +42,9 @@ onMounted(() => {
iCurrentSplit: IS_MOVE_DEVICE ? 1 : 2, iCurrentSplit: IS_MOVE_DEVICE ? 1 : 2,
openDebug: true, openDebug: true,
oStyle: { oStyle: {
borderSelect: IS_MOVE_DEVICE ? '#000' : '#FFCC00', borderSelect: IS_MOVE_DEVICE ? '#000' : '#FFCC00'
}, },
bSupporDoubleClickFull: true, //true bSupporDoubleClickFull: true //true
}) })
var controlIndex = 2 var controlIndex = 2
@ -53,7 +54,7 @@ onMounted(() => {
playURL, playURL,
{ {
playURL: playURL, // playURL: playURL, //
mode: 1, // 0=; 1= 0 mode: 1 // 0=; 1= 0
}, },
curIndex // curIndex //
) )