From 51faf3e9c3c613e7fb12db6c88356946f2429e0c Mon Sep 17 00:00:00 2001
From: czt <czt18638530771@163.com>
Date: 星期五, 12 十二月 2025 17:35:30 +0800
Subject: [PATCH] 调整安防视频页面及逻辑
---
fzzy-igdss-web/src/main/resources/static/security/video-control.js | 77 ++++++++++++++++++++++++++++++++++++++
1 files changed, 77 insertions(+), 0 deletions(-)
diff --git a/fzzy-igdss-web/src/main/resources/static/security/video-control.js b/fzzy-igdss-web/src/main/resources/static/security/video-control.js
new file mode 100644
index 0000000..849b9ba
--- /dev/null
+++ b/fzzy-igdss-web/src/main/resources/static/security/video-control.js
@@ -0,0 +1,77 @@
+/**
+ * PTZ 鍏叡鏂规硶锛屽紩鐢ㄤ箣鍓嶉渶瑕佸厛瀹氫箟curCamera瀵硅薄
+ * 鎵ц鍛戒护缂栫爜
+ * 浜戝彴鎺у埗鍛戒护 1=涓婏紝2=涓嬶紝3=宸︼紝4=鍙筹紝5=宸︿笂锛�6=宸︿笅锛�7=鍙充笂锛�8=鍙充笅锛�0=鍋滄锛�9=鍙樺�嶅皬锛�10 = 鍙樺�嶅姞锛�11 = 鍙樼劍鍋�
+ * 棰勭疆浣嶅懡浠� 1=璁剧疆锛�2=鎵ц锛�3=鍒犻櫎
+ * 鏁版嵁灏哻urCamera瀵硅薄灏佽涓篈Pi 瀵硅薄鍙戦�佺粰浜戝钩鍙�
+ */
+
+function getParam(command, preset) {
+ return {
+ playType: curCamera.playType,
+ ptzType: curCamera.ptzType,
+ snapType: curCamera.snapType,
+ cameraId: curCamera.id,
+ cameraName: curCamera.name,
+ ip: curCamera.ip,
+ sn: curCamera.sn,
+ webPort: curCamera.webPort,
+ ctrlPort: curCamera.controlPort,
+ channel: curCamera.chanNum,
+ loginId: curCamera.loginId,
+ pwd: curCamera.pwd,
+ mediaAddr: curCamera.mediaAddr,
+ urlIn: curCamera.urlIn,
+ urlOut: curCamera.urlOut,
+ command: command,
+ preset: preset
+ }
+}
+
+//浜戝彴鎺у埗
+function ptzControl(command) {
+ // layer.msg('寮�濮嬭皟鐢ㄤ簯鍙扳�︹��', {icon: 1, time: 1200,offset:'rb'});
+ const param = getParam(command, null);
+ const url = "../../basic/security/ptz-media";
+ sendControlCommand(url, param);
+}
+
+//棰勭疆浣嶆帶鍒�
+function presetControl(command) {
+ //layer.msg('寮�濮嬫墽琛屸�︹��', {icon: 1, time: 1200,offset:'rb'});
+ const preset = $("#preset").val();
+ const param = getParam(command, preset);
+ const url = "../../basic/security/ptz-media";
+ sendControlCommand(url, param);
+}
+
+//鍋滄绉诲姩
+function moveStop() {
+ //layer.msg('寮�濮嬭皟鐢ㄤ簯鍙扳�︹��', {icon: 1, time: 1200,offset:'rb'});
+ const param = getParam(0, null);
+ const url = "../../basic/security/ptz-media";
+ sendControlCommand(url, param);
+}
+
+//鍙樼劍鍋�
+function zoomStop() {
+ //doNothing
+}
+
+//鍙戦�佹帶鍒跺懡浠�
+function sendControlCommand(url, param) {
+ $.ajax({
+ type: "POST",
+ url: url,
+ dataType: 'JSON',
+ contentType: "application/json;charset=UTF-8",
+ data: JSON.stringify(param),
+ success: function (data) {
+ if (data.code === "ERROR") {
+ layer.msg('鎵ц澶辫触', {icon: 2, time: 1500,offset:'rb'});
+ } else {
+ layer.msg('鎵ц鎴愬姛', {icon: 1, time: 1200,offset:'rb'});
+ }
+ }
+ })
+}
\ No newline at end of file
--
Gitblit v1.9.3