Quellcode durchsuchen

fix: 湖全景空态与明细 tab 统一为 empty-hint 组件

主体明细表空时不再用裸表格行,改用与明细数据 tab 同款
图标+标题+引导文案的 .empty-hint;同时修正明细 tab 过时提示
(报表块已搬到数据中台,该页右上角是「从云端拉取」不是「同步数据」)。
KenZ1117 vor 2 Wochen
Ursprung
Commit
db673246d4
2 geänderte Dateien mit 10 neuen und 6 gelöschten Zeilen
  1. 6 2
      public/index.html
  2. 4 4
      public/lake.js

+ 6 - 2
public/index.html

@@ -377,7 +377,7 @@
             </span>
           </div>
           <div class="table-wrap">
-            <table class="data-table">
+            <table class="data-table" id="lakeEntityTable">
               <thead>
                 <tr>
                   <th>账号名</th><th>门店/连锁</th><th>总行数</th><th>公司</th><th>连锁</th><th>门店</th><th>汇总</th><th>覆盖区间</th><th>最近同步</th><th>上次推送云端</th>
@@ -387,6 +387,10 @@
                 <tr><td colspan="10" class="empty-cell">加载中…</td></tr>
               </tbody>
             </table>
+            <div id="lakeEmpty" class="empty-hint" hidden>
+              <div class="empty-icon"><svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.7" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><path d="M4 20V11M10 20V4M16 20v-6M2.5 20h19"/></svg></div>
+              <p>本地湖为空<br><small>取数机先「同步数据」推上云端,本机点右上角「从云端拉取」</small></p>
+            </div>
           </div>
         </div>
 
@@ -462,7 +466,7 @@
             </table>
             <div id="reportEmpty" class="empty-hint" hidden>
               <div class="empty-icon"><svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.7" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><path d="M4 20V11M10 20V4M16 20v-6M2.5 20h19"/></svg></div>
-              <p id="reportEmptyText">暂无数据<br><small>请确认商家客户端已登录,然后点击右上角「同步数据」</small></p>
+              <p id="reportEmptyText">暂无数据<br><small>取数机先「同步数据」推上云端,本机点右上角「从云端拉取」</small></p>
             </div>
           </div>
           <div class="report-pager" id="reportPager"></div>

+ 4 - 4
public/lake.js

@@ -42,10 +42,10 @@
 
   function renderEntities(entities) {
     const tbody = $('lakeEntityRows');
-    if (!entities.length) {
-      tbody.innerHTML = '<tr><td colspan="10" class="empty-cell">本地湖为空 —— 取数机先「同步数据」,其他电脑点右上「从云端拉取」</td></tr>';
-      return;
-    }
+    // 空湖:与明细 tab 同款 .empty-hint 空态(图标+标题+引导文案),表格整体隐藏
+    $('lakeEntityTable').hidden = !entities.length;
+    $('lakeEmpty').hidden = !!entities.length;
+    if (!entities.length) return;
     tbody.innerHTML = entities.map((e) => {
       const cov = e.coverage ? `${fmtDate(e.coverage.from)} ~ ${fmtDate(e.coverage.to)}` : '–';
       const sync = e.lastSync ? `${fmtTime(e.lastSync.at)}(${fmtDate(e.lastSync.from)}~${fmtDate(e.lastSync.to)})${e.lastSync.ok ? '' : ' ⚠'}` : '–';