flx:修改海康监控插件展示

This commit is contained in:
Rain_ 2025-12-09 09:18:05 +08:00
parent 3a53405feb
commit d8986921d5
12 changed files with 1035 additions and 907 deletions

View File

@ -62,3 +62,7 @@ export const getAllModule = (params?: any) => {
export const getScreenAuthModuleAndMenuApi = (params?: any) => { export const getScreenAuthModuleAndMenuApi = (params?: any) => {
return http.get(BASEURL + "/xmgl/screenAuth/getModuleAndMenu", params); return http.get(BASEURL + "/xmgl/screenAuth/getModuleAndMenu", params);
}; };
export const getUserConfigListApi = (params?: any) => {
return http.get(BASEURL + "/xmgl/userConfig/list", params);
};

View File

@ -59,7 +59,8 @@ export const GlobalStore = defineStore({
tabsIcon: false, tabsIcon: false,
// 页脚 // 页脚
footer: false footer: false
} },
forceH5Play: 0,
}), }),
getters: {}, getters: {},
actions: { actions: {
@ -67,6 +68,9 @@ export const GlobalStore = defineStore({
setSN(sn: string | null) { setSN(sn: string | null) {
this.sn = sn; this.sn = sn;
}, },
setForceH5Play(forceH5Play: number | null) {
this.forceH5Play = forceH5Play;
},
// setToken // setToken
setToken(token: string | null) { setToken(token: string | null) {
this.token = token; this.token = token;

View File

@ -19,6 +19,7 @@ export interface GlobalState {
isManager: string | null; isManager: string | null;
isIframe: boolean | null; isIframe: boolean | null;
userId: string | null; userId: string | null;
forceH5Play: number | null;
} }
/* themeConfigProp */ /* themeConfigProp */

View File

@ -315,3 +315,8 @@ export function filterEnum(
export const getAssetsFile = (url: string) => { export const getAssetsFile = (url: string) => {
return new URL(`../assets/images/${url}`, import.meta.url).href return new URL(`../assets/images/${url}`, import.meta.url).href
} }
// 判断当前系统是不是windows系统
export function isWindows() {
return navigator.userAgent.indexOf('Windows') !== -1;
}

View File

@ -42,7 +42,7 @@ import { ref, reactive, onMounted, onBeforeUnmount } from "vue";
import { useRouter } from "vue-router"; import { useRouter } from "vue-router";
import { Login } from "@/api/interface"; import { Login } from "@/api/interface";
import { ElMessage, ElNotification } from "element-plus"; import { ElMessage, ElNotification } from "element-plus";
import { loginApi, jumpLoginApi } from "@/api/modules/login"; import { loginApi, jumpLoginApi, getUserConfigListApi } from "@/api/modules/login";
import { GlobalStore } from "@/stores"; import { GlobalStore } from "@/stores";
import { TabsStore } from "@/stores/modules/tabs"; import { TabsStore } from "@/stores/modules/tabs";
import { KeepAliveStore } from "@/stores/modules/keepAlive"; import { KeepAliveStore } from "@/stores/modules/keepAlive";
@ -86,7 +86,7 @@ const login = (formEl: FormInstance | undefined) => {
globalStore.setAccountType(result.accountType); globalStore.setAccountType(result.accountType);
globalStore.setProjectDateAuth(result.menuAuthority); globalStore.setProjectDateAuth(result.menuAuthority);
globalStore.setIsManager(result.isManager); // globalStore.setIsManager(result.isManager); //
getUserConfigList(result.userId);
// 2. // 2.
// await initDynamicRouter(); // await initDynamicRouter();
// router.push(arr[result.accountType - 1]); // router.push(arr[result.accountType - 1]);
@ -176,6 +176,17 @@ onMounted(async () => {
} }
}; };
}); });
const getUserConfigList = (userId: string) => {
getUserConfigListApi({
userId: userId,
}).then((res: any) => {
if (res.code === 200) {
if (res.result instanceof Array && res.result.length > 0) {
globalStore.setProjectDateAuth(res.result[0].forceH5Play);
}
}
});
};
// loginenter // loginenter
onBeforeUnmount(() => { onBeforeUnmount(() => {
document.onkeydown = null; document.onkeydown = null;

View File

@ -392,6 +392,7 @@ const getPreviewUrl = row => {
let tempCode = row.monitoringNumber; let tempCode = row.monitoringNumber;
const param = { const param = {
cameraIndexCode: tempCode, cameraIndexCode: tempCode,
streamType: row.defaultStreamType && row.eIndex < 4 ? row.defaultStreamType : "",
// streamType: row.defaultStreamType == 2 ? 0 : row.defaultStreamType, // streamType: row.defaultStreamType == 2 ? 0 : row.defaultStreamType,
type: window.location.protocol.includes("https") ? "wss" : "ws", type: window.location.protocol.includes("https") ? "wss" : "ws",
transmode: 1, transmode: 1,

View File

@ -39,6 +39,7 @@ const getPreviewUrl = (row) => {
const param = { const param = {
cameraIndexCode: tempCode, cameraIndexCode: tempCode,
type: window.location.protocol.includes("https") ? "wss" : "ws", type: window.location.protocol.includes("https") ? "wss" : "ws",
streamType: row.defaultStreamType && row.eIndex < 4 ? row.defaultStreamType : "",
transmode: 1, transmode: 1,
itemId: row.itemId, itemId: row.itemId,
projectSn: row.projectSn, projectSn: row.projectSn,
@ -95,8 +96,11 @@ onMounted(() => {
layout.value = tempLayout layout.value = tempLayout
if (props.devList.length > 0) { if (props.devList.length > 0) {
props.devList.forEach(element => { props.devList.forEach((element, index) => {
play(element) play({
...element,
eIndex: index,
})
}) })
} }
}) })
@ -110,21 +114,30 @@ onBeforeUnmount(() => {
// //
// watch(() => props.devList, (newVal) => { // watch(() => props.devList, (newVal) => {
// if (newVal.length > 0) { // if (newVal.length > 0) {
// newVal.forEach(element => { // newVal.forEach((element, index) => {
// play(element) // play({
// ...element,
// eIndex: index,
// })
// }) // })
// } // }
// }) // })
const isVisible = computed(() => {
watch(() => props.equipmentDialog, (newVal) => { return {
equipmentDialog: props.equipmentDialog,
visibleDialog: props.visibleDialog,
}
})
watch(() => isVisible, (newVal) => {
console.log("我进来了", videoPlugin.value,)
if (videoPlugin.value) { if (videoPlugin.value) {
if (newVal) { if (newVal.value.equipmentDialog || newVal.value.visibleDialog) {
videoPlugin.value.hidePluginWindow() videoPlugin.value.hidePluginWindow()
} else { } else {
videoPlugin.value.showPluginWindow() videoPlugin.value.showPluginWindow()
} }
} }
}) }, { deep: true })
</script> </script>
<style scoped> <style scoped>

View File

@ -162,7 +162,7 @@ class VideoPlugin {
} }
} }
openVideo(cameraIndexCode, streamMode, winIndex) { openVideo(cameraIndexCode, streamMode, winIndex = 0) {
const transMode = 1; // TCP const transMode = 1; // TCP
const gpuMode = 0; // 不启用GPU硬解 const gpuMode = 0; // 不启用GPU硬解
// 添加调试信息 // 添加调试信息
@ -177,7 +177,7 @@ class VideoPlugin {
funcName: "startPreview", funcName: "startPreview",
argument: JSON.stringify({ argument: JSON.stringify({
cameraIndexCode: cameraIndexCode, cameraIndexCode: cameraIndexCode,
streamMode: streamMode == 2 ? 0 : streamMode, streamMode: streamMode == 2 && (winIndex > 4) ? 0 : 1,
transMode: transMode, transMode: transMode,
gpuMode: gpuMode, gpuMode: gpuMode,
wndId: winIndex || -1, wndId: winIndex || -1,

View File

@ -113,6 +113,7 @@
v-model="policeCameraItemInfo.deviceState" v-model="policeCameraItemInfo.deviceState"
clearable clearable
placeholder="请选择" placeholder="请选择"
@visible-change="visibleChange"
> >
<el-option <el-option
v-for="(item, index) in deviceStateList" v-for="(item, index) in deviceStateList"
@ -277,8 +278,17 @@
:autoplay="true" :autoplay="true"
:controls="true" :controls="true"
/> --> /> -->
<div v-if="isWindows() && store.forceH5Play == 0" class="videoOverview" :id="`videoOverview${item.itemId}`">
<IscPlugin
:devList="[item]"
:itemId="item.itemId"
:type="'1x1'"
:equipmentDialog="equipmentDialog"
:visibleDialog="visibleDialog"
></IscPlugin>
</div>
<IscPlayer <IscPlayer
v-if="videoConfig.enableNotPlugin == 1" v-else
:devList="[ :devList="[
{ {
...item, ...item,
@ -288,14 +298,6 @@
:key="'player-' + item.itemId" :key="'player-' + item.itemId"
:playerId="'player-' + item.itemId" :playerId="'player-' + item.itemId"
/> />
<div v-else class="videoOverview" :id="`videoOverview${item.itemId}`">
<IscPlugin
:devList="[item]"
:itemId="item.itemId"
:type="'1x1'"
:equipmentDialog="equipmentDialog"
></IscPlugin>
</div>
</div> </div>
<div class="hls-video_title" @click="onEquipmentClick(item)"> <div class="hls-video_title" @click="onEquipmentClick(item)">
<div>设备详情</div> <div>设备详情</div>
@ -637,6 +639,7 @@ import {
selectAllProjectInfoList, selectAllProjectInfoList,
} from "@/api/modules/workTicket"; } from "@/api/modules/workTicket";
import { getUseProjectVideoConfigApi } from "@/api/modules/tower"; import { getUseProjectVideoConfigApi } from "@/api/modules/tower";
import { isWindows } from "@/utils/util";
import dayjs from "dayjs"; import dayjs from "dayjs";
import duration from "dayjs/plugin/duration"; import duration from "dayjs/plugin/duration";
dayjs.extend(duration); dayjs.extend(duration);
@ -804,6 +807,10 @@ const onViewAllClick = () => {
const equipmentDialog = ref(false); const equipmentDialog = ref(false);
const equipmentDetail = ref({}); const equipmentDetail = ref({});
const visibleDialog = ref(false);
const visibleChange = (val) => {
visibleDialog.value = val;
};
// //
const onEquipmentClick = (row) => { const onEquipmentClick = (row) => {
equipmentDetail.value = row; equipmentDetail.value = row;

View File

@ -1,12 +1,30 @@
<template> <template>
<ScaleBox :width="1920" :height="1080" bgc="transparent" :delay="100" :isFlat="false" @scaleChange="scaleChange"> <ScaleBox
:width="1920"
:height="1080"
bgc="transparent"
:delay="100"
:isFlat="false"
@scaleChange="scaleChange"
>
<!-- <div class="container"> --> <!-- <div class="container"> -->
<div class="largeScreen" :class="{'largeScreen1': store.isIframe}" ref="dataScreenRef" style="width: 100%; height: 100%"> <div
<div v-if="!store.isIframe" class="header" :class="!EntityMap.Mapswitch ? 'storeheader' : ''"> class="largeScreen"
:class="{ largeScreen1: store.isIframe }"
ref="dataScreenRef"
style="width: 100%; height: 100%"
>
<div
v-if="!store.isIframe"
class="header"
:class="!EntityMap.Mapswitch ? 'storeheader' : ''"
>
<!-- <div class="hearderIcon"><img src="@/assets/images/jxjLogo.png" alt="" /></div> --> <!-- <div class="hearderIcon"><img src="@/assets/images/jxjLogo.png" alt="" /></div> -->
<span class="projectTitle" v-if="!isEditTitle"> <span class="projectTitle" v-if="!isEditTitle">
<p>{{ projectTitle }}</p> <p>{{ projectTitle }}</p>
<el-icon class="editIcon" size="20px" color="#b6d0e5" @click="handleEditTitle"><Edit /></el-icon> <el-icon class="editIcon" size="20px" color="#b6d0e5" @click="handleEditTitle"
><Edit
/></el-icon>
<!-- <p>江坑110kv变电站智慧工地</p> --> <!-- <p>江坑110kv变电站智慧工地</p> -->
</span> </span>
<span class="projectTitle" v-if="isEditTitle"> <span class="projectTitle" v-if="isEditTitle">
@ -85,16 +103,23 @@
:index="item.modulePath" :index="item.modulePath"
:class="{ :class="{
subMenu: true, subMenu: true,
active: activeTab === item.modulePath active: activeTab === item.modulePath,
}" }"
> >
<!-- zsbf: COMPANY === 'zsbf' --> <!-- zsbf: COMPANY === 'zsbf' -->
<span @click="navigateTo(item, 1)">{{ item.moduleName }}</span> <span @click="navigateTo(item, 1)">{{ item.moduleName }}</span>
</div> </div>
</div> </div>
<div :class="{ subMenuList: true }" v-if="itemList != null && itemList.length >= 1"> <div
:class="{ subMenuList: true }"
v-if="itemList != null && itemList.length >= 1"
>
<!-- , zsbf: COMPANY === 'zsbf' --> <!-- , zsbf: COMPANY === 'zsbf' -->
<el-scrollbar ref="scrollbarRef" class="scrollItem" @wheel.prevent="handleScroll"> <el-scrollbar
ref="scrollbarRef"
class="scrollItem"
@wheel.prevent="handleScroll"
>
<div class="subMenuItem"> <div class="subMenuItem">
<div <div
class="subItem" class="subItem"
@ -117,7 +142,7 @@
<span class="numColor"> {{ projectPassDay }} </span>个日历天 <span class="numColor"> {{ projectPassDay }} </span>个日历天
</span> </span>
</div> --> </div> -->
<div class="dataBoardContent" :class="{'dataBoardContent1': store.isIframe}"> <div class="dataBoardContent" :class="{ dataBoardContent1: store.isIframe }">
<router-view></router-view> <router-view></router-view>
</div> </div>
</template> </template>
@ -143,8 +168,18 @@ import ScaleBox from "vue3-scale-box";
import { ElMessage } from "element-plus"; import { ElMessage } from "element-plus";
import { ref, reactive, onMounted, onBeforeUnmount, computed, nextTick } from "vue"; import { ref, reactive, onMounted, onBeforeUnmount, computed, nextTick } from "vue";
import { getTaskTimeDetail } from "@/api/modules/schedulePlan"; import { getTaskTimeDetail } from "@/api/modules/schedulePlan";
import { queryByProject, addLargeScreenConfig, updateLargeScreenConfig } from "@/api/modules/config"; import {
import { jumpLargeUserInfoApi, jumpLargeByUserIdApi, getAllModule, getScreenAuthModuleAndMenuApi } from "@/api/modules/login"; queryByProject,
addLargeScreenConfig,
updateLargeScreenConfig,
} from "@/api/modules/config";
import {
jumpLargeUserInfoApi,
getUserConfigListApi,
jumpLargeByUserIdApi,
getAllModule,
getScreenAuthModuleAndMenuApi,
} from "@/api/modules/login";
import { import {
JSYCMenu, JSYCMenu,
XJNBMenu, XJNBMenu,
@ -171,7 +206,7 @@ import {
JXWJJMenu, JXWJJMenu,
ALLXMMenu, ALLXMMenu,
HBLAMenu, HBLAMenu,
QYGMenu QYGMenu,
} from "@/config/staticMenu"; } from "@/config/staticMenu";
import { COMPANY } from "@/config/config"; import { COMPANY } from "@/config/config";
import { useRouter } from "vue-router"; import { useRouter } from "vue-router";
@ -193,7 +228,10 @@ const initProjectTitle = async () => {
await getTitleConfig(); await getTitleConfig();
}; };
const getTitleConfig = async () => { const getTitleConfig = async () => {
const res: any = await queryByProject({ configKey: "largeScreenTitle", projectSn: store.sn }); const res: any = await queryByProject({
configKey: "largeScreenTitle",
projectSn: store.sn,
});
console.log(res, "res"); console.log(res, "res");
if (res.code === 200) { if (res.code === 200) {
const { title: curTitle } = JSON.parse(res.result?.configValue || "{}"); const { title: curTitle } = JSON.parse(res.result?.configValue || "{}");
@ -219,7 +257,7 @@ const handleChangeTitle = async () => {
id: titleConfig.value?.id, id: titleConfig.value?.id,
configKey: "largeScreenTitle", configKey: "largeScreenTitle",
projectSn: store.sn, projectSn: store.sn,
configValue: JSON.stringify({ title: editTitle.value }) configValue: JSON.stringify({ title: editTitle.value }),
}); });
if (res.code === 200) { if (res.code === 200) {
isEditTitle.value = false; isEditTitle.value = false;
@ -270,7 +308,9 @@ const getProjectInfo = async () => {
const res: any = await getTaskTimeDetail({ projectSn: store.sn }); const res: any = await getTaskTimeDetail({ projectSn: store.sn });
console.log("获取项目信息", res); console.log("获取项目信息", res);
projectTimeInfo.value = res.result; projectTimeInfo.value = res.result;
projectPassDay.value = calculateDaysPassed(projectTimeInfo.value.contractPeriodStartTime); projectPassDay.value = calculateDaysPassed(
projectTimeInfo.value.contractPeriodStartTime
);
}; };
function calculateDaysPassed(startDate: any) { function calculateDaysPassed(startDate: any) {
@ -561,7 +601,7 @@ const activeTab2 = ref("");
const router = useRouter(); const router = useRouter();
const getAspectRatioStyle = computed(() => ({ const getAspectRatioStyle = computed(() => ({
width: `${contentWidth.value}px`, width: `${contentWidth.value}px`,
height: `${contentHeight.value}px` height: `${contentHeight.value}px`,
})); }));
//tab //tab
const getAllModelMenu = () => { const getAllModelMenu = () => {
@ -579,7 +619,9 @@ const navigateTo = (path, type) => {
console.log("点击的路由---", path, type); console.log("点击的路由---", path, type);
if (type == 1) { if (type == 1) {
activeTab.value = path.modulePath; activeTab.value = path.modulePath;
activeTab2.value = path.menuList.length ? path.menuList[0].companyPath : path.modulePath; activeTab2.value = path.menuList.length
? path.menuList[0].companyPath
: path.modulePath;
itemList.value = path.menuList; itemList.value = path.menuList;
let index = activeTab2.value.indexOf("?"); let index = activeTab2.value.indexOf("?");
console.log("获取到的参数----", index); console.log("获取到的参数----", index);
@ -592,14 +634,14 @@ const navigateTo = (path, type) => {
router.push({ router.push({
path: activeTab2.value, path: activeTab2.value,
query: { query: {
url url,
} },
}); });
return; return;
} }
} }
router.push({ router.push({
path: activeTab2.value path: activeTab2.value,
}); });
} else { } else {
activeTab2.value = path.companyPath; activeTab2.value = path.companyPath;
@ -614,15 +656,15 @@ const navigateTo = (path, type) => {
router.push({ router.push({
path: path.companyPath, path: path.companyPath,
query: { query: {
url url,
} },
}); });
return; return;
} }
} }
// console.log("---", activeTab2.value); // console.log("---", activeTab2.value);
router.push({ router.push({
path: path.companyPath path: path.companyPath,
}); });
} }
}; };
@ -634,17 +676,17 @@ const getModuleMenu = async () => {
if (res.code == 200) { if (res.code == 200) {
const list = res.result || []; const list = res.result || [];
if (list.length) { if (list.length) {
menuList.value = list.map(item => { menuList.value = list.map((item) => {
let childrenList = item.children?.map(val => { let childrenList = item.children?.map((val) => {
return { return {
menuName: val.name, menuName: val.name,
companyPath: val.routePath companyPath: val.routePath,
}; };
}); });
return { return {
moduleName: item.name, moduleName: item.name,
modulePath: item.routePath, modulePath: item.routePath,
menuList: childrenList menuList: childrenList,
}; };
}); });
} }
@ -671,6 +713,7 @@ onMounted(async () => {
store.setAccount(data.result.account); store.setAccount(data.result.account);
store.setAccountType(data.result.accountType); store.setAccountType(data.result.accountType);
store.setProjectDateAuth(data.menuAuthority); store.setProjectDateAuth(data.menuAuthority);
getUserConfigList(data.userId);
} }
if (window.location.href.indexOf("userId") != -1) { if (window.location.href.indexOf("userId") != -1) {
console.log("免登录跳转进来了吗----", window.location.href.indexOf("userId")); console.log("免登录跳转进来了吗----", window.location.href.indexOf("userId"));
@ -680,19 +723,20 @@ onMounted(async () => {
let isIframe = window.location.href.split("isIframe=")[1]; let isIframe = window.location.href.split("isIframe=")[1];
if (isIframe) { if (isIframe) {
isIframe.includes("&") && (isIframe = isIframe.split("&")[0]); isIframe.includes("&") && (isIframe = isIframe.split("&")[0]);
isIframe === "true" && (store.setIsIframe(true)); isIframe === "true" && store.setIsIframe(true);
} else { } else {
store.setIsIframe(false); store.setIsIframe(false);
} }
console.log("获取到的参数----", newUserId, projectSn, isIframe); console.log("获取到的参数----", newUserId, projectSn, isIframe);
// return // return
const data: any = await jumpLargeByUserIdApi({ userId: newUserId }); const data: any = await jumpLargeByUserIdApi({ userId: newUserId });
console.log("跳转请求的数据----", data.result); console.log("跳转请求的数据----", data.result);
if (data.result.sn) { if (data.result.sn) {
const accountTypeList = [2, 3, 4, 7]; const accountTypeList = [2, 3, 4, 7];
const sn = accountTypeList.includes(data.result.accountType) ? projectSn : data.result.sn; const sn = accountTypeList.includes(data.result.accountType)
? projectSn
: data.result.sn;
console.log("获取到的参数----1111", sn); console.log("获取到的参数----1111", sn);
store.setSN(sn); store.setSN(sn);
} }
@ -701,6 +745,7 @@ onMounted(async () => {
store.setAccount(data.result.account); store.setAccount(data.result.account);
store.setAccountType(data.result.accountType); store.setAccountType(data.result.accountType);
store.setProjectDateAuth(data.menuAuthority); store.setProjectDateAuth(data.menuAuthority);
getUserConfigList(newUserId);
} }
initProjectTitle(); initProjectTitle();
await getModuleMenu(); await getModuleMenu();
@ -789,7 +834,7 @@ onMounted(async () => {
// //
return ElMessage({ return ElMessage({
message: "暂无权限,请联系管理员配置权限", message: "暂无权限,请联系管理员配置权限",
type: "warning" type: "warning",
}); });
} }
// await getAllModelMenu(); // await getAllModelMenu();
@ -841,7 +886,17 @@ onBeforeUnmount(() => {
document.removeEventListener("click", bodyCloseMenus); document.removeEventListener("click", bodyCloseMenus);
window.removeEventListener("resize", calculateAspectRatio); window.removeEventListener("resize", calculateAspectRatio);
}); });
const getUserConfigList = (userId: string) => {
getUserConfigListApi({
userId: userId,
}).then((res: any) => {
if (res.code === 200) {
if (res.result instanceof Array && res.result.length > 0) {
store.setForceH5Play(res.result[0].forceH5Play);
}
}
});
};
function bodyCloseMenus() { function bodyCloseMenus() {
if (showUserBox.value === true) { if (showUserBox.value === true) {
showUserBox.value = false; showUserBox.value = false;
@ -857,8 +912,18 @@ function getNowTime() {
} }
function timeNumber() { function timeNumber() {
let today = new Date(); let today = new Date();
let date = today.getFullYear() + "-" + twoDigits(today.getMonth() + 1) + "-" + twoDigits(today.getDate()); let date =
let time = twoDigits(today.getHours()) + ":" + twoDigits(today.getMinutes()) + ":" + twoDigits(today.getSeconds()); today.getFullYear() +
"-" +
twoDigits(today.getMonth() + 1) +
"-" +
twoDigits(today.getDate());
let time =
twoDigits(today.getHours()) +
":" +
twoDigits(today.getMinutes()) +
":" +
twoDigits(today.getSeconds());
return date + " " + time; return date + " " + time;
} }
function twoDigits(val: any) { function twoDigits(val: any) {
@ -874,7 +939,19 @@ function loginOut() {
} }
// //
function jumpBgd() { function jumpBgd() {
const envList = ["agjt", "zkax", "zkjc", "hfqc", "cpgs", "cqna", "jzjt", "tj", "scwc", "bthg", "zmml"]; // const envList = [
"agjt",
"zkax",
"zkjc",
"hfqc",
"cpgs",
"cqna",
"jzjt",
"tj",
"scwc",
"bthg",
"zmml",
]; //
// //
if (COMPANY == "" || COMPANY == "gsgs") { if (COMPANY == "" || COMPANY == "gsgs") {
console.log(2222, window.location); console.log(2222, window.location);
@ -883,7 +960,9 @@ function jumpBgd() {
// window.location.replace(BASEURL + "/#/login?token=" + store.token); // window.location.replace(BASEURL + "/#/login?token=" + store.token);
// () // ()
// window.location.replace("http://101.43.164.214:11111/#/login?token=" + store.token); // window.location.replace("http://101.43.164.214:11111/#/login?token=" + store.token);
window.location.replace(`${window.location.protocol}//${window.location.host}/#/login?token=` + store.token); window.location.replace(
`${window.location.protocol}//${window.location.host}/#/login?token=` + store.token
);
} else if (COMPANY === "tj") { } else if (COMPANY === "tj") {
window.location.replace("http://192.168.110.220:9809/#/login?token=" + store.token); window.location.replace("http://192.168.110.220:9809/#/login?token=" + store.token);
} else if (COMPANY === "as") { } else if (COMPANY === "as") {

View File

@ -3,8 +3,8 @@
<div class="left" :class="{ hide: !isExpand }"> <div class="left" :class="{ hide: !isExpand }">
<div <div
:class="{ :class="{
control_scroll: videoConfigInfo.enableNotPlugin == 1 && isDragging, control_scroll: (!isWindows() || store.forceH5Play == 1) && isDragging,
control_scrolloff: videoConfigInfo.enableNotPlugin == 1 && !isDragging control_scrolloff: (!isWindows() || store.forceH5Play == 1) && !isDragging
}" }"
class="videoListBig" class="videoListBig"
> >
@ -78,8 +78,8 @@
</div> </div>
<div <div
class="control_main" class="control_main"
:class="{ 'mt-20': videoConfigInfo.enableNotPlugin == 1 && isDragging }" :class="{ 'mt-20': (!isWindows() || store.forceH5Play == 1) && isDragging }"
v-if="videoConfigInfo.enableNotPlugin == 1" v-if="(!isWindows() || store.forceH5Play == 1)"
> >
<div class="control-card"> <div class="control-card">
<div class="control-title"> <div class="control-title">
@ -174,7 +174,7 @@
<DHPlayer :devList="dhVideoList" v-else-if="videoType === 4" ref="dhplayer"></DHPlayer> <DHPlayer :devList="dhVideoList" v-else-if="videoType === 4" ref="dhplayer"></DHPlayer>
<!-- 播放海康 --> <!-- 播放海康 -->
<div v-else ref="playWndBox" style="width: 100%; height: 100%"> <div v-else ref="playWndBox" style="width: 100%; height: 100%">
<div v-if="infor.enableNotPlugin != 1" id="playWnd" class="playWnd" style="width: 100%; height: 100%"></div> <div v-if="isWindows() && store.forceH5Play == 0" id="playWnd" class="playWnd" style="width: 100%; height: 100%"></div>
<!-- :style="{ <!-- :style="{
height: playWndHeight + 'px', height: playWndHeight + 'px',
width: playWndWidth + 'xp' width: playWndWidth + 'xp'
@ -201,6 +201,7 @@ import { GlobalStore } from "@/stores";
import { getUseProjectVideoConfigApi } from "@/api/modules/tower"; import { getUseProjectVideoConfigApi } from "@/api/modules/tower";
import { selectProjectVideoListApi, selectProjectVideoGroupApi, getSafeHatSessionApi } from "@/api/modules/video"; import { selectProjectVideoListApi, selectProjectVideoGroupApi, getSafeHatSessionApi } from "@/api/modules/video";
import { COMPANY } from "@/config/config"; import { COMPANY } from "@/config/config";
import { isWindows } from "@/utils/util";
import emitter from "./mitt"; import emitter from "./mitt";
const defaultProps = { const defaultProps = {
children: "children", children: "children",
@ -387,7 +388,7 @@ const checkVideo = async (item: any) => {
console.log(item, "item11222"); console.log(item, "item11222");
videoInfo.value = item; videoInfo.value = item;
dhVideoList.value = [item]; dhVideoList.value = [item];
if (videoConfigInfo.value.enableNotPlugin == 1) return; if (isWindows() && store.forceH5Play == 1) return;
if (videoType.value !== 1 && videoType.value !== 4) { if (videoType.value !== 1 && videoType.value !== 4) {
previewVideo(cameraIndexCode.value, item.defaultStreamType); previewVideo(cameraIndexCode.value, item.defaultStreamType);
} }
@ -417,18 +418,20 @@ const getVideoList = async () => {
}, []); }, []);
let arr = findVideoByTree(res.result.videoList, []); let arr = findVideoByTree(res.result.videoList, []);
if (arr.length > 0) { if (arr.length > 0) {
console.log(111223344, infor.value.enableNotPlugin == 1); // console.log(111223344, infor.value.enableNotPlugin == 1);
if (infor.value.enableNotPlugin == 1) { if (isWindows() && store.forceH5Play == 0) {
dhVideoList.value = recursiveFilterList(res.result.videoList); console.log(11122334455, arr[0]);
} else {
handleVideoConfig(arr[0]); handleVideoConfig(arr[0]);
} else {
const dataList = recursiveFilterList(res.result.videoList);
dhVideoList.value = dataList;
} }
} }
console.log("objData", objData.value); console.log("objData", objData.value);
}; };
const recursiveFilterList = (dataList: any, resultList: any[] = []) => { const recursiveFilterList = (dataList: any, resultList: any[] = []) => {
return dataList.reduce((prev: any, cur: any) => { return dataList.reduce((prev: any, cur: any) => {
console.log("当前的列表", cur); // console.log("", cur);
if (resultList.length >= 4) return prev; if (resultList.length >= 4) return prev;
if (cur.children && cur.children.length > 0) { if (cur.children && cur.children.length > 0) {
recursiveFilterList(cur.children, resultList); recursiveFilterList(cur.children, resultList);
@ -476,8 +479,7 @@ const handleVideoConfig = (videoData: any) => {
} else if (videoData.videoType === 4) { } else if (videoData.videoType === 4) {
dhVideoList.value = [videoData]; dhVideoList.value = [videoData];
} else { } else {
console.log(88887777, infor.value.enableNotPlugin); if (isWindows() && store.forceH5Play == 0) {
if (infor.value.enableNotPlugin != 1) {
initPlugin(); initPlugin();
} else { } else {
console.log(88887777, videoData); console.log(88887777, videoData);

View File

@ -456,7 +456,8 @@ const getPreviewUrl = row => {
let tempCode = row.serialNumber; let tempCode = row.serialNumber;
const param = { const param = {
cameraIndexCode: tempCode, cameraIndexCode: tempCode,
streamType: row.defaultStreamType == 2 ? 0 : row.defaultStreamType, // streamType: row.defaultStreamType == 2 ? 0 : row.defaultStreamType,
streamType: row.defaultStreamType && row.eIndex < 4 ? row.defaultStreamType : "",
type: window.location.protocol.includes("https") ? "wss" : "ws", type: window.location.protocol.includes("https") ? "wss" : "ws",
transmode: 1, transmode: 1,
itemId: row.itemId itemId: row.itemId