From f6abc8c724eed706487b7616bc6c816e5db5c939 Mon Sep 17 00:00:00 2001
From: czt <czt18638530771@163.com>
Date: 星期二, 09 十二月 2025 20:13:48 +0800
Subject: [PATCH] 数量检测页面提交

---
 fzzy-igdss-web/src/main/resources/static/security/video-aerial.js |  165 +++++++++++++++++++++++++++++++++++++++++++++++++++++++
 1 files changed, 165 insertions(+), 0 deletions(-)

diff --git a/fzzy-igdss-web/src/main/resources/static/security/video-aerial.js b/fzzy-igdss-web/src/main/resources/static/security/video-aerial.js
new file mode 100644
index 0000000..c0a8064
--- /dev/null
+++ b/fzzy-igdss-web/src/main/resources/static/security/video-aerial.js
@@ -0,0 +1,165 @@
+var layer;
+
+var windowWidth = 1700;
+var windowHeight = 810;
+
+$(function () {
+    layui.use(['layer'], function () {
+        layer = layui.layer;
+        addDevice(listCamera);
+    });
+});
+
+window.onload = function () {
+    $("#m-container").css("background-image", "url(" + backgroundImg + ")");
+
+    windowWidth = document.body.offsetWidth;
+    windowHeight = document.body.offsetHeight;
+};
+
+function showVideo(id) {
+    layer.msg("璋冪敤瑙嗛鏌ョ湅鈥︹��");
+    //鑾峰彇瑙嗛淇℃伅
+    var curVideo = null;
+    $.each(listCamera, function (index, item) {
+        if (item.id == id) {
+            curVideo = item;
+            return true;
+        }
+    });
+    if (!curVideo) {
+        layer.alert("娌℃湁鑾峰彇鍒板綋鍓嶈棰戜俊鎭�︹��");
+        return;
+    }
+    var url = "/security/video-play?cameraId=" + curVideo.id + "&playType=" + curVideo.playType;
+    if(curVideo.playType == "MEDIA_HIK"){
+        //娴峰悍鎻掍欢鐩存帴window.open鏂伴〉闈㈡挱鏀�
+        var iHeight = 550;
+        var iWidth = 1100;
+        var iTop = (window.screen.height-30-iHeight)/2; //鑾峰緱绐楀彛鐨勫瀭鐩翠綅缃�;
+        var iLeft = (window.screen.width-10-iWidth)/2; //鑾峰緱绐楀彛鐨勬按骞充綅缃�;
+        console.log(iWidth + "-" + iHeight);
+        console.log(iTop + "-" + iLeft);
+        var name = "瑙嗛棰勮";
+        window.open(url,name,'height='+iHeight+',innerHeight='+iHeight+',width='+iWidth+',innerWidth='+iWidth+',top='+iTop+',left='+iLeft+',toolbar=0,menubar=0,scrollbars=auto,resizeable=0,location=0,status=no');
+    }else {
+        if (windowWidth > 1350) {
+            layer.open({
+                type: 2,
+                title: false,//"褰撳墠棰勮锛�" + curVideo.name,
+                area: ['1315px', '570px'],
+                shade: 0,
+                content: url,
+                btn: 0,
+                closeBtn: 2
+            });
+        } else {
+            layer.open({
+                type: 2,
+                title: false,//"褰撳墠棰勮锛�" + curVideo.name,
+                area: ['1315px', (windowHeight - 30) + 'px'],
+                shade: 0,
+                content: url,
+                btn: 0,
+                closeBtn: 2
+            });
+        }
+    }
+};
+
+function showTips(name) {
+    $("#camera_info").text("鎻愮ず锛氬綋鍓嶈澶囧悕绉�- " + name);
+};
+
+// 寮�濮嬫嫋鎷�
+function drag() {
+    var tips = $(".device");
+    if (tips.length == 0) {
+        return;
+    }
+
+    var maxX = windowWidth;
+    var maxY = windowHeight;
+
+    $.each(tips, function (index, item) {
+        var dd = new Dragdrop({
+            target: item,
+            area: [0, maxX, 0, maxY],
+            callback: function (obj) {
+                console.log('x:' + (obj.moveX) + ' y:' + (obj.moveY));
+            }
+        });
+        dd.dragAll();
+    });
+};
+
+//娣诲姞璁惧淇℃伅
+function addDevice(list) {
+   //  console.log(list);
+
+    if (!list || list.length == 0) return;
+    var container = $("#m-container");
+    var parentWidth = container.width();
+    var parentHeight = container.height();
+
+    var temp;
+    var left = 50, top = 50;
+    $.each(list, function (index, item) {
+        left = (parentWidth * item.posX).toFixed(4);
+        top = (parentHeight * item.posY).toFixed(4);
+        if (left < 1) left = 50;
+        if (top < 1) top = 50;
+
+        temp = "";
+        temp += "<div id='" + item.id + "' class='device' "
+            + "' onclick=showTips('" + item.name + "') "
+            + "' ondblclick=showVideo('" + item.id + "') style='left:"
+            + left + "px;top:" + top + "px;'>";
+        temp += "<img src='/img/web/security/ca-4.png' /></div>";
+        container.append(temp);
+    });
+};
+
+// 淇濆瓨璁惧浣嶇疆淇℃伅
+function updatePos() {
+    var tips = $(".device");
+    if (tips.length == 0) {
+        return;
+    }
+    var container = $("#m-container");
+    var parentWidth = container.width();
+    var parentHeight = container.height();
+    var parentTop = container.offset().top;
+    var parentLeft = container.offset().left;
+
+    // 灏佽鏁版嵁杩涜淇濆瓨
+    var data = new Array();
+    var id = null, posX = 0.0, posY = 0.0;
+    var offset;
+    $.each(tips, function (index, item) {
+        id = item.id;
+        offset = $('#' + id).offset();
+
+        posX = (offset.left - parentLeft) / parentWidth;
+        posY = (offset.top - parentTop) / parentHeight;
+
+        data[index] = {
+            id: id,
+            posX: posX.toFixed(4),
+            posY: posY.toFixed(4)
+        };
+    });
+    $.ajax({
+        type: 'POST',
+        url: "/security/update-pos",
+        dataType: 'JSON',
+        contentType: "application/json;charset=UTF-8",
+        data: JSON.stringify(data),
+        success: function (result) {
+            layer.msg("淇℃伅鏇存柊瀹屾垚锛侊紒");
+        },
+        error: function (result) {
+            layer.msg(result.msg);
+        }
+    });
+}

--
Gitblit v1.9.3