Răsfoiți Sursa

fix: 修复前端刷新问题

GTong 8 luni în urmă
părinte
comite
a3b8d116b8
1 a modificat fișierele cu 25 adăugiri și 8 ștergeri
  1. 25 8
      static/license_info/license_info.js

+ 25 - 8
static/license_info/license_info.js

@@ -222,7 +222,11 @@ userManagementLink.addEventListener('click', function(event) {
 // 监听 License 信息按钮的点击事件
 licenseInfoLink.addEventListener('click', function(event) {
     event.preventDefault(); // 阻止默认的跳转行为
- 
+
+ // 创建一个新的 div 元素
+const container = document.createElement('div');
+
+
     // 将瀑布流的 License 信息内容恢复到主内容区域
     const licenseInfoHtml = `
         <!-- 包裹搜索框、下拉框、时间选择框和确定按钮的 div -->
@@ -242,14 +246,27 @@ licenseInfoLink.addEventListener('click', function(event) {
             <input type="date" id="end-date" placeholder="结束时间" />
         
             <!-- 搜索框 -->
-            <input type="text" id="search-bar" style="display: none; placeholder="搜索..." />
-        
+            <input type="text" id="search-bar" style="display: none;" placeholder="搜索..." />
+   
             <!-- 确定按钮 -->
             <button id="submit-button">确定</button>
+            <button id="reset-button">返回</button>
         </div>
-            <div class="license-info-container" " id="license-info-restaurant-list">   </div>
+            <div class="license-info-container" id="license-info-restaurant-list">   </div>
     `; // 这是原来的 License 信息区域 HTML
 
+// 将 licenseInfoHtml 插入到 div 元素中
+    // container.innerHTML = licenseInfoHtml;
+    // searchBar = container.querySelector('search-bar');
+    //  statusFilter = container.querySelector('license-status-filter');
+    //  startDate = container.querySelector('start-date');
+    //  endDate = container.querySelector('end-date');
+    //  submitButton = container.querySelector('submit-button');
+    //  licenseInfoContainer = container.querySelector('license-info-restaurant-list');
+
+ 
+
+    license_info_mainElement.innerHTML  = licenseInfoHtml;
     searchBar = document.getElementById('search-bar');
      statusFilter = document.getElementById('license-status-filter');
      startDate = document.getElementById('start-date');
@@ -259,8 +276,6 @@ licenseInfoLink.addEventListener('click', function(event) {
 
 
 
-    //mainContainer.innerHTML = licenseInfoHtml;
-    license_info_mainElement.innerHTML  = licenseInfoHtml;
           //清楚lic信息组的数据
           LicApplicationData = [];
           initializeScrollListeners(); // 重新初始化滚动监听器
@@ -277,7 +292,7 @@ licenseInfoLink.addEventListener('click', function(event) {
     })();
     
     // 刷新页面
-    //location.reload();
+    location.reload();
 });
 
 roleManagementLink.addEventListener('click', function(event) {
@@ -605,8 +620,10 @@ async function fetchPermissionsByRole(role) {
             }else if (hasReadUserPermission){
                 document.getElementById('user-management-link').click();
             }
-           
         }
+
+  
+
         //  if (hasReadLicensePermission || hasReadLicenseAllPermission) {
         //     document.getElementById('license-info-link').click();