From 241d327e57cbfe504aa806c61aa22e6205706098 Mon Sep 17 00:00:00 2001
From: sgj <1442489573@qq.com>
Date: 星期六, 11 四月 2026 16:59:46 +0800
Subject: [PATCH] 引用纠正

---
 fzzy-igdss-web/src/main/resources/static/security/eventInfo/eventInfo.js |  126 ++++++++++++++++++++++++++++++++++++++---
 1 files changed, 116 insertions(+), 10 deletions(-)

diff --git a/fzzy-igdss-web/src/main/resources/static/security/eventInfo/eventInfo.js b/fzzy-igdss-web/src/main/resources/static/security/eventInfo/eventInfo.js
index 1a05e30..db9e275 100644
--- a/fzzy-igdss-web/src/main/resources/static/security/eventInfo/eventInfo.js
+++ b/fzzy-igdss-web/src/main/resources/static/security/eventInfo/eventInfo.js
@@ -1,6 +1,41 @@
 var layer;
 var laypage;
 
+// 鐩戝惉鏀跺偍鍏徃 Select2 鍙樺寲
+$(document).ready(function() {
+    // 鐩戝惉鏀跺偍鍏徃涓嬫媺妗嗗彉鍖�
+    $('select[name="key"]').on('change', function() {
+        var selectedParentId = $(this).val();
+        if(selectedParentId) {
+            getSelectData(selectedParentId);
+        } else {
+            // 濡傛灉娓呯┖浜嗘敹鍌ㄥ叕鍙搁�夋嫨锛屼篃娓呯┖搴撳尯閫夐」
+            var $deptSelect = $('select[name="deptId"]');
+            $deptSelect.empty()
+                .append('<option value="">鎵�鏈�</option>')
+                .select2({
+                    placeholder: "璇烽�夋嫨搴撳尯",
+                    allowClear: true,
+                    width: 'resolve'
+                });
+        }
+    });
+
+    // 鍦ㄧ偣鍑诲簱鍖轰笅鎷夋鏃讹紝浠呴獙璇佽�屼笉鍙戣捣鏂拌姹�
+    $('select[name="deptId"]').on('select2:opening', function(e) {
+        var selectedParentId = $('select[name="key"]').val();
+        if(!selectedParentId) {
+            e.preventDefault();
+            layer.msg('璇峰厛閫夋嫨鏀跺偍鍏徃');
+            return false;
+        }
+
+        // 涓嶅湪姝ゅ鍙戣捣璇锋眰锛屼緷璧� change 浜嬩欢鏃剁殑棰勫姞杞�
+        return true;
+    });
+});
+
+
 $(function () {
     // 鍒濆鍖栧垎椤�
     layui.use(['laypage', 'layer'], function () {
@@ -15,6 +50,72 @@
     initImagePreview();
 });
 
+
+
+
+// 淇敼 getSelectData 鍑芥暟锛屾敮鎸� Select2 鐨勬暟鎹牸寮�
+function getSelectData(parentId) {
+    if(!parentId) {
+        return layer.msg('璇烽�夋嫨鏀跺偍鍏徃');
+    }
+
+    $.ajax({
+        url: "../../system/dept-new/getDeptByUserType",
+        type: 'POST',
+        dataType: "json",
+        contentType: "application/json;charset=UTF-8",
+        data: parentId,
+        success: function (response) {
+            if (response) {
+                deptList = response;
+                // 閲嶆柊鍒濆鍖� Select2 鎴栨洿鏂伴�夐」
+                updateDeptSelect2Options(deptList);
+            } else {
+                layer.msg(response.msg || '鏁版嵁鍔犺浇澶辫触');
+            }
+        },
+        error: function (xhr, status, error) {
+            layer.msg('鏁版嵁鍔犺浇澶辫触');
+        }
+    });
+}
+
+// 鏇存柊 Select2 涓嬫媺妗嗛�夐」
+function updateDeptSelect2Options(deptList) {
+    var $deptSelect = $('select[name="deptId"]');
+
+    // 淇濆瓨褰撳墠閫変腑鐨勫��
+    var currentVal = $deptSelect.val();
+
+    // 娓呯┖鐜版湁閫夐」
+    $deptSelect.empty();
+
+    // 娣诲姞"鎵�鏈�"閫夐」
+    $deptSelect.append('<option value="">鎵�鏈�</option>');
+
+    // 娣诲姞鍔ㄦ�佹暟鎹�夐」
+    if(deptList && deptList.length > 0) {
+        deptList.forEach(function(dept) {
+            $deptSelect.append('<option value="' + dept.id + '">' + dept.kqmc + '</option>');
+        });
+    }
+
+    // 閲嶆柊鍒濆鍖� Select2
+    $deptSelect.select2({
+        placeholder: "璇烽�夋嫨搴撳尯",
+        allowClear: true,
+        width: 'resolve'
+    });
+
+    // 鎭㈠涔嬪墠鐨勯�夋嫨
+    if(currentVal) {
+        $deptSelect.val(currentVal).trigger('change');
+    }
+}
+
+
+
+
 /**
  * 鍒濆鍖栧垎椤电粍浠�
  */
@@ -24,15 +125,20 @@
         count: typeof totalItems !== 'undefined' ? totalItems : 0,
         limit: typeof pageSize !== 'undefined' ? pageSize : 6,
         curr: typeof currentPage !== 'undefined' ? currentPage : 1,
-        layout: ['prev', 'next'],
-        prev: '<i class="layui-icon layui-icon-left"></i>',
-        next: '<i class="layui-icon layui-icon-right"></i>',
+        layout: ['prev','page', 'next'],
+        // prev: '<i class="layui-icon layui-icon-left"></i>',
+        // next: '<i class="layui-icon layui-icon-right"></i>',
         jump: function (obj, first) {
             if (!first) {
                 searchRecord(obj.curr, obj.limit)
             }
         }
     });
+    var total = typeof totalItems !== 'undefined' ? totalItems : 0;
+    if(total == 0){
+        // 闅愯棌鍒嗛〉
+        $('#paginationContainer').hide();
+    }
 }
 
 /**
@@ -47,9 +153,9 @@
         count: totalCount,
         limit: pageSize,
         curr: currentPage,
-        layout: ['prev', 'next'],
-        prev: '<i class="layui-icon layui-icon-left"></i>',
-        next: '<i class="layui-icon layui-icon-right"></i>',
+        layout: ['prev', 'page','next'],
+        // prev: '<i class="layui-icon layui-icon-left"></i>',
+        // next: '<i class="layui-icon layui-icon-right"></i>',
         jump: function (obj, first) {
             if (!first) {
                 searchRecord(obj.curr, obj.limit)
@@ -131,12 +237,12 @@
             </div>
         `;
         // 闅愯棌鍒嗛〉
-        $('.pagination-container').hide();
+        $('#paginationContainer').hide();
         return;
     }
 
     // 鏄剧ず鍒嗛〉
-    $('.pagination-container').show();
+    $('#paginationContainer').show();
 
     // 鐢熸垚浜嬩欢鍗$墖
     var html = '';
@@ -169,11 +275,11 @@
                     </div>
                     <div class="gallery-meta">
                         <div style="display: flex; align-items: center; gap: 15px;width: 100%">
-                            <div class="meta-item" style="width: 50%">
+                            <div class="meta-item" style="min-width: 60%">
                                 <i class="layui-icon layui-icon-video"></i>
                                 <span>${getCameraName(record.serId) || record.serId || ''}</span>
                             </div>
-                            <div class="meta-item" style="width: 50%">
+                            <div class="meta-item" style="min-width: 40%">
                                 <i class="layui-icon layui-icon-date"></i>
                                 <span>${formatDate(record.time)}</span>
                             </div>

--
Gitblit v1.9.3