diff --git a/src/router/index.js b/src/router/index.js index c8729400..5c31df21 100644 --- a/src/router/index.js +++ b/src/router/index.js @@ -604,6 +604,15 @@ const routes2 = [{ "@/views/projectFront/laborManage/attendanceManage/attendanceManageOld.vue" ), }, + //劳务管理--中水北方人员考勤 + { + path: "/project/labor/attendanceManageNorth", + name: "劳务管理_中水北方人员考勤", + component: () => + import ( + "@/views/projectFront/laborManage/attendanceManage/attendanceManageNorth.vue" + ), + }, { path: "/project/labor/newAttendanceManage", name: "劳务管理_人员考勤1", diff --git a/src/views/companyAdmin/companyBigScreen/terminalOperation/components/isc_plugin.vue b/src/views/companyAdmin/companyBigScreen/terminalOperation/components/isc_plugin.vue new file mode 100644 index 00000000..9cf900b9 --- /dev/null +++ b/src/views/companyAdmin/companyBigScreen/terminalOperation/components/isc_plugin.vue @@ -0,0 +1,144 @@ + + + \ No newline at end of file diff --git a/src/views/companyAdmin/companyBigScreen/terminalOperation/components/video_isc_plugin.js b/src/views/companyAdmin/companyBigScreen/terminalOperation/components/video_isc_plugin.js new file mode 100644 index 00000000..4717811b --- /dev/null +++ b/src/views/companyAdmin/companyBigScreen/terminalOperation/components/video_isc_plugin.js @@ -0,0 +1,290 @@ +import './jsencrypt.min.js'; + +class VideoPlugin { + constructor() { + this.isChrome = navigator.userAgent.indexOf('Chrome') > -1; + this.WebControl = null; + this.oWebControl = null; + this.pubKey = ''; + this.initCount = 0; + this.loadWebControl(); + } + + async loadWebControl() { + if (this.isChrome) { + try { + const { WebControl } = await + import ('./jsWebControl-1.0.0.min.js'); + this.WebControl = WebControl; + } catch (error) { + console.error('加载WebControl失败:', error); + } + } + } + + async initPlugin(itemId, appkey, secret, ip, port, videoData, layout) { + if (!this.WebControl) { + console.error('WebControl未加载完成'); + return false; + } + // 确保所有必要参数都已初始化 + this.appkey = appkey; + this.secret = secret; + this.ip = ip; + this.port = port; + this.layout = layout; + this.width = 0; + this.height = 0; + return new Promise((resolve, reject) => { + this.oWebControl = new this.WebControl({ + szPluginContainer: `playWnd${itemId}`, + iServicePortStart: 15900, + iServicePortEnd: 15909, + szClassId: "23BF3B0A-2C56-4D97-9C03-0CB103AA8F11", + cbConnectSuccess: () => this.onConnectSuccess(itemId, videoData, resolve), + cbConnectError: () => this.onConnectError(itemId, appkey, secret, ip, port, reject), + cbConnectClose: () => console.log("连接关闭") + }); + }); + } + + onConnectSuccess(itemId, videoData, resolve) { + this.setCallbacks(); + this.oWebControl.JS_StartService("window", { + dllPath: "./VideoPluginConnect.dll" + }).then(() => { + this.setupWindow(itemId, videoData); + resolve(true); + }).catch(error => { + console.error('启动服务失败:', error); + }); + } + + onConnectError(itemId, appkey, secret, ip, port, reject) { + console.log("插件未启动,正在尝试启动..."); + this.initCount++; + + if (this.initCount < 3) { + setTimeout(() => this.initPlugin(itemId, appkey, secret, ip, port), 3000); + } else { + reject(new Error("插件启动失败")); + this.showDownloadDialog(); + } + } + + setupWindow(itemId, videoData) { + const bottomHeight = 0; + let width = document.getElementById(`videoOverview${itemId}`).offsetWidth; + let height = document.getElementById(`videoOverview${itemId}`).offsetHeight - bottomHeight; + + // 缩放比例计算 + let ratio = 1; + if (enabledProjectV2 != 1) { + if (localStorage.getItem('systemInfo') && JSON.parse(localStorage.getItem('systemInfo')).zoomType != 1) { + ratio = this.getRatio(); + } + } + + width = width * ratio; + height = height * ratio; + + // 窗口大小调整处理 + window.onresize = () => { + clearTimeout(window.$timeId); + window.$timeId = setTimeout(() => { + const container = document.getElementById('videoBoxContainer') || document.querySelector('.videocBox'); + if (container) { + width = container.offsetWidth; + height = container.offsetHeight - 80; + } + if (this.oWebControl != null) { + this.oWebControl.JS_Resize(width, height); + } + }, 10); + }; + + this.oWebControl.JS_CreateWnd(`playWnd${itemId}`, width, height, { + bEmbed: false, + cbSetDocTitle: (uuid) => { + this.oWebControl._pendBg = false; + window.parent.postMessage({ + action: 'updateTitle', + msg: '子页面通知父页面修改title', + info: uuid + }, '*'); + } + }).then(() => { + console.log("JS_CreateWnd success"); + this.initVideo(videoData, itemId); + }); + } + + initVideo(videoData, itemId) { + this.getPubKey().then(() => { + const config = { + appkey: this.appkey, + secret: this.setEncrypt(this.secret), + ip: this.ip, + playMode: 0, + port: parseInt(this.port), + snapDir: "D:\\SnapDir", + videoDir: "D:\\VideoDir", + layout: this.layout, + enableHTTPS: 1, + encryptedFields: 'secret', + showToolbar: 0, + showSmart: 1, + buttonIDs: "0,16,256,257,258,259,260,512,513,514,515,516,517,768,769" + }; + // 添加调试日志 + console.log('初始化配置:', config); + console.log('视频数据:', videoData); + this.oWebControl.JS_RequestInterface({ + funcName: "init", + argument: JSON.stringify(config) + }).then((response) => { + console.log('初始化响应:', response); + if (COMPANY === 'xingxuan') { + this.oWebControl.oDocOffset.top = 94; + this.oWebControl.oDocOffset.left = 280; + } + console.log("init success", videoData, document.getElementById(`videoOverview${itemId}`), document.getElementById(`videoOverview${itemId}`).width, document.getElementById(`videoOverview${itemId}`).offsetHeight); + // 确保使用最新的width和height + const width = document.getElementById(`videoOverview${itemId}`).offsetWidth; + const height = document.getElementById(`videoOverview${itemId}`).offsetHeight; + this.ratio = window.localStorage.getItem("zoom"); + this.oWebControl.JS_Resize(width * this.ratio, height * this.ratio); + + this.startVideoPreview(videoData); + }); + }); + } + + startVideoPreview(videoData) { + for (let i = 0; i < videoData.length; i++) { + if (i < 24 && videoData.length >= i) { + this.openVideo(videoData[i].serialNumber, videoData[i].defaultStreamType, i + 1); + } + } + } + + openVideo(cameraIndexCode, streamMode, winIndex) { + const transMode = 1; // TCP + const gpuMode = 0; // 不启用GPU硬解 + // 添加调试信息 + console.log('开始预览:', { + cameraIndexCode, + streamMode, + winIndex, + transMode, + gpuMode + }); + this.oWebControl.JS_RequestInterface({ + funcName: "startPreview", + argument: JSON.stringify({ + cameraIndexCode: cameraIndexCode, + streamMode: streamMode == 2 ? 0 : streamMode, + transMode: transMode, + gpuMode: gpuMode, + wndId: winIndex || -1, + }) + }).then((oData) => { + console.log('预览响应:', oData); + }); + } + + unInitPlugin() { + if (!this.oWebControl) return false; + + const isIE = !!window.ActiveXObject || 'ActiveXObject' in window; + if (isIE) { + this.oWebControl.JS_Disconnect().then(() => { + console.log("JS_Disconnect"); + }); + } else { + this.oWebControl.JS_DestroyWnd().then(() => { + console.log("JS_DestroyWnd"); + this.oWebControl.JS_StopService("window").then(() => { + this.oWebControl.JS_Disconnect().then(() => { + console.log("JS_Disconnect"); + }); + }); + }); + } + } + + setCallbacks() { + this.oWebControl.JS_SetWindowControlCallback({ + cbIntegrationCallBack: this.cbIntegrationCallBack + }); + } + + getRatio() { + const bodyWidth = document.body.clientWidth; + const bodyHeight = document.body.clientHeight; + const scaleWidthNum = bodyWidth / 1920; + const scaleHeightNum = bodyHeight / 1080; + + return scaleWidthNum > scaleHeightNum ? scaleHeightNum : scaleWidthNum; + } + + setEncrypt(value) { + const encrypt = new JSEncrypt(); + encrypt.setPublicKey(this.pubKey); + return encrypt.encrypt(value); + } + + getPubKey() { + return new Promise((resolve) => { + this.oWebControl.JS_RequestInterface({ + funcName: "getRSAPubKey", + argument: JSON.stringify({ keyLength: 1024 }) + }).then((oData) => { + if (oData.responseMsg.data) { + this.pubKey = oData.responseMsg.data; + resolve(); + } + }); + }); + } + + cbIntegrationCallBack(oData) { + console.log(JSON.stringify(oData.responseMsg)); + } + + showDownloadDialog() { + if (confirm("检测到视频插件未安装,是否下载视频插件?")) { + window.location.href = "http://101.43.164.214:11111/image/VideoWebPlugin.rar"; + } + } + + resizePlugin(val, itemId) { + if (this.oWebControl) { + const width = document.getElementById(`videoOverview${itemId}`).offsetWidth; + const height = document.getElementById(`videoOverview${itemId}`).offsetHeight; + + if (val && val == 1) { + this.oWebControl.JS_Resize(width / 2 + 20, height - 215); + } else { + this.oWebControl.JS_Resize(width, height); + } + } + } + hidePluginWindow() { + if (this.oWebControl) { + this.oWebControl.JS_HideWnd(); + } + } + showPluginWindow() { + if (this.oWebControl) { + this.oWebControl.JS_ShowWnd(); + } + } + setPluginOffset(left, top) { + if (this.WebControl) { + this.WebControl.JS_SetDocOffset({ left, top }); + } + } +} + +export default VideoPlugin; \ No newline at end of file diff --git a/src/views/companyAdmin/companyBigScreen/terminalOperation/homeworkControlProcess.vue b/src/views/companyAdmin/companyBigScreen/terminalOperation/homeworkControlProcess.vue index f824b64d..32f39dc3 100644 --- a/src/views/companyAdmin/companyBigScreen/terminalOperation/homeworkControlProcess.vue +++ b/src/views/companyAdmin/companyBigScreen/terminalOperation/homeworkControlProcess.vue @@ -286,10 +286,19 @@ :controls="true" /> --> +
+ +
{ console.log("进来了", Number(res.result.total)); workTicketInfo.total = Number(res.result.total); if (workTicketList.value.length > 0) { - onViewDetail(workTicketList.value[0]); + onViewDetail(workTicketList.value[0], true); + } else { + workTicketDetail.value = {}; + policeCameraItemList.value = []; } } } @@ -706,11 +720,28 @@ const getSelectAllProjectInfoList = () => { const onSelectProject = () => { workTicketInfo.pageNo = 1; workTicketList.value = []; - + getProjectVideoConfigList(); getWorkTicketPage(); getWorkTicketCountWorkTicket(); getWorkTicketTypeTreePage(); } +const videoConfig = ref({ + enableNotPlugin: 1, +}); +//查询项目各类型的视频配置信息 +const getProjectVideoConfigList = () => { + projectVideoConfigListApi({ + projectSn: workTicketInfo.projectSn, + }).then((res) => { + if (res.code == 200) { + if (res.result) { + videoConfig.value = res.result; + } else { + videoConfig.enableNotPlugin = 1; + } + } + }); +}; const onRefresh = () => { if(!viewAllShow.value){ onWorkTicketQuery(); @@ -782,8 +813,8 @@ const isJSON = (str) => { }; const timeInterval = ref(null); // 查看详情 -const onViewDetail = (row) => { - if (row.id == workTicketDetail.value.id) return; +const onViewDetail = (row, flag) => { + if (row.id == workTicketDetail.value.id && flag != true) return; workTicketDetail.value = row; getWorkTicketQueryById(); getWorkTicketHistoryList(); diff --git a/src/views/companyAdmin/companyBigScreen/videoSurveillance/areaTree.vue b/src/views/companyAdmin/companyBigScreen/videoSurveillance/areaTree.vue index fcd212ff..82cadada 100644 --- a/src/views/companyAdmin/companyBigScreen/videoSurveillance/areaTree.vue +++ b/src/views/companyAdmin/companyBigScreen/videoSurveillance/areaTree.vue @@ -278,8 +278,9 @@ export default { resultList.map((item) => { return { ...item.videoItem, - videoType: item.projectVideoConfig.videoType, - projectSn: item.projectVideoConfig.projectSn, + ...item.projectVideoConfig, + // videoType: item.projectVideoConfig.videoType, + // projectSn: item.projectVideoConfig.projectSn, }; }) ); @@ -323,8 +324,9 @@ export default { resultList.map((item) => { return { ...item.videoItem, - videoType: item.projectVideoConfig.videoType, - projectSn: item.projectVideoConfig.projectSn, + ...item.projectVideoConfig, + // videoType: item.projectVideoConfig.videoType, + // projectSn: item.projectVideoConfig.projectSn, }; }) ); @@ -404,8 +406,9 @@ export default { this.$emit("playParams", [ { ...data.videoItem, - videoType: data.projectVideoConfig.videoType, - projectSn: data.projectVideoConfig.projectSn, + ...data.projectVideoConfig, + // videoType: data.projectVideoConfig.videoType, + // projectSn: data.projectVideoConfig.projectSn, }, ]); } else { diff --git a/src/views/projectFront/aiAnalysis/warningList.vue b/src/views/projectFront/aiAnalysis/warningList.vue index ffc62e12..aec93446 100644 --- a/src/views/projectFront/aiAnalysis/warningList.vue +++ b/src/views/projectFront/aiAnalysis/warningList.vue @@ -118,10 +118,10 @@ - {{ $t('message.sixComplete.carDense.from') + ':' }}{{ item.alarmDesc }} + {{ $t('message.sixComplete.carDense.from') + ':' }}{{ item.location }}
diff --git a/src/views/projectFront/highModulus/pointManage.vue b/src/views/projectFront/highModulus/pointManage.vue index 1864d6b0..de715a79 100644 --- a/src/views/projectFront/highModulus/pointManage.vue +++ b/src/views/projectFront/highModulus/pointManage.vue @@ -275,7 +275,11 @@ - +