| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900 |
- <!DOCTYPE html>
- <html lang="zh-CN">
- <head>
- <meta charset="UTF-8">
- <meta name="viewport" content="width=device-width, initial-scale=1.0">
- <title>智慧运营中台</title>
- <link rel="icon" href="/assets/logo.png">
- <link rel="stylesheet" href="/style.css">
- </head>
- <body>
- <!-- Splash Screen -->
- <div class="splash" id="splash">
- <img src="/assets/logo.png" alt="智慧运营中台" class="splash-logo">
- <div class="splash-name">智慧运营中台</div>
- <div class="splash-sub">淘宝闪购专业版</div>
- <div class="splash-bar"><span></span></div>
- <div class="splash-powered">
- <span>powered by</span>
- <img src="/assets/powered-by.png" alt="Hyreal IDE">
- </div>
- </div>
- <div class="app-frame">
- <aside class="sidebar">
- <div class="sidebar-brand">
- <div class="sidebar-logo"><img src="/assets/logo.png" alt="门"></div>
- <div class="sidebar-titles">
- <div class="t1">智慧运营中台</div>
- <div class="t2">淘宝闪购专业版</div>
- </div>
- </div>
- <div class="nav-section-label">门店装修</div>
- <button class="nav-item active" data-view="crawl"><span class="ico"><svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.8" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><path d="M4 6h16M4 12h10M4 18h16"/></svg></span><span>门店采集</span></button>
- <button class="nav-item" data-view="gen"><span class="ico"><svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.8" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><path d="M12 3l1.8 4.9L19 9.7l-4.3 3 1.2 5.3-3.9-3-3.9 3 1.2-5.3-4.3-3 5.2-1.8z"/></svg></span><span>视觉生成</span></button>
- <button class="nav-item" data-view="tasks"><span class="ico"><svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.8" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><path d="M4 7h10M4 12h16M4 17h7"/><circle cx="18" cy="7" r="2"/><circle cx="15" cy="17" r="2"/></svg></span><span>任务中心</span></button>
- <button class="nav-item" data-view="history"><span class="ico"><svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.8" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><rect x="3" y="4" width="18" height="16" rx="3"/><circle cx="9" cy="10" r="1.8"/><path d="M21 16l-5-5-6 6"/></svg></span><span>历史创作</span></button>
- <div class="nav-section-label">经营分析</div>
- <button class="nav-item" data-view="reports"><span class="ico"><svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.8" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><path d="M12 3v12"/><path d="M7 10l5 5 5-5"/><path d="M4 21h16"/></svg></span><span>数据采集</span></button>
- <button class="nav-item" data-view="lake"><span class="ico"><svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.8" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><ellipse cx="12" cy="5" rx="7" ry="2.5"/><path d="M5 5v6c0 1.4 3.1 2.5 7 2.5s7-1.1 7-2.5V5"/><path d="M5 11v6c0 1.4 3.1 2.5 7 2.5s7-1.1 7-2.5v-6"/></svg></span><span>数据中台</span></button>
- <button class="nav-item" data-view="analysis"><span class="ico"><svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.8" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><path d="M3 17l5-6 4 3 5-8 4 5"/><path d="M3 21h18"/></svg></span><span>趋势图表</span></button>
- <div class="nav-section-label">设置</div>
- <button class="nav-item" data-view="settings"><span class="ico"><svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.8" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><circle cx="12" cy="12" r="3"/><path d="M19.4 15a1.7 1.7 0 0 0 .34 1.87l.06.06a2 2 0 1 1-2.83 2.83l-.06-.06A1.7 1.7 0 0 0 15 19.4a1.7 1.7 0 0 0-1 1.55V21a2 2 0 1 1-4 0v-.05A1.7 1.7 0 0 0 9 19.4a1.7 1.7 0 0 0-1.87.34l-.06.06a2 2 0 1 1-2.83-2.83l.06-.06A1.7 1.7 0 0 0 4.6 15a1.7 1.7 0 0 0-1.55-1H3a2 2 0 1 1 0-4h.05A1.7 1.7 0 0 0 4.6 9a1.7 1.7 0 0 0-.34-1.87l-.06-.06a2 2 0 1 1 2.83-2.83l.06.06A1.7 1.7 0 0 0 9 4.6h.09A1.7 1.7 0 0 0 10 3.05V3a2 2 0 1 1 4 0v.05A1.7 1.7 0 0 0 15 4.6a1.7 1.7 0 0 0 1.87-.34l.06-.06a2 2 0 1 1 2.83 2.83l-.06.06A1.7 1.7 0 0 0 19.4 9v.09a1.7 1.7 0 0 0 1.55.91H21a2 2 0 1 1 0 4h-.05a1.7 1.7 0 0 0-1.55 1z"/></svg></span><span>系统设置</span></button>
- <button class="nav-item" data-view="logs"><span class="ico"><svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.8" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><path d="M4 5h16v11H8l-4 4Z"/><path d="M8 9h8M8 12h5"/></svg></span><span>系统日志</span></button>
- <div class="sidebar-bottom">
- <span>v1.0.0</span>
- <img src="/assets/powered-by.png" alt="Hyreal IDE" class="sidebar-powered">
- </div>
- </aside>
- <div class="main-wrap">
- <!-- ==================== 门店采集 ==================== -->
- <div id="viewCrawl" class="view active">
- <main class="content">
- <div class="page-header">
- <div>
- <h1>门店采集</h1>
- <div class="sub">从淘宝闪购后台按店铺批量采集菜品图,用于后续视觉美化</div>
- </div>
- </div>
- <div class="crawl-grid">
- <div class="left-col">
-
- <div class="panel panel-narrow panel-designed">
- <div class="stage-marker"><span class="stage-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 7h16M4 17h16"/><circle cx="9" cy="7" r="2.2"/><circle cx="15" cy="17" r="2.2"/></svg></span><span>抓取设置</span></div>
- <span class="panel-watermark"><svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.4" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><path d="M12 3a9 9 0 1 0 0 18 9 9 0 0 0 0-18Z"/><path d="M12 8v4l3 2"/></svg></span>
- <div class="panel-body">
-
- <div class="field">
- <label>抓取内容</label>
- <select disabled><option>菜品图片 + 名称</option></select>
- </div>
- <button class="collapse-trigger" id="advToggle" aria-expanded="false">
- <span>高级设置</span><span class="chev"><svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2.2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><path d="M9 6l6 6-6 6"/></svg></span>
- </button>
- <div id="advBody" class="collapse">
- <div style="padding-top:12px;display:flex;flex-direction:column;gap:12px;">
- <label style="display:flex;align-items:center;gap:6px;font-size:13px;cursor:pointer;">
- <input type="checkbox" id="forceFullCrawl">
- <span>强制全量抓取(覆盖已有图片)</span>
- </label>
- </div>
- </div>
- </div>
- </div>
- <button class="btn btn-primary btn-block" id="startBtn">
- <span id="startBtnIcon"><svg viewBox="0 0 24 24" fill="currentColor" aria-hidden="true"><path d="M8 5v14l11-7z"/></svg></span>
- <span id="startBtnText">开始抓取</span>
- </button>
- <button class="btn btn-danger btn-block" id="stopBtn" disabled style="display:none;"><svg viewBox="0 0 24 24" fill="currentColor" aria-hidden="true"><rect x="6" y="6" width="12" height="12" rx="2"/></svg><span>停止</span></button>
- <div class="panel panel-fixed panel-progress">
- <div class="panel-title">
- <span>进度列表</span>
- <span class="actions"><span class="badge" id="crawlStatusBadge"></span></span>
- </div>
- <div id="progressList"></div>
- </div>
- </div>
- <div class="right-col">
- <div class="panel panel-fixed panel-shops">
- <div class="panel-title">
- <span>店铺清单</span>
- <span class="actions">
- <span class="badge badge-info" id="shopCount">0 家</span>
- <button class="btn btn-ghost btn-small" id="btnToggleAdd">+ 添加店铺</button>
- </span>
- </div>
- <div style="overflow-x:auto;">
- <table class="data-table">
- <thead>
- <tr>
- <th style="width:36px;"><input type="checkbox" id="selectAllCb"></th>
- <th style="min-width:220px;">店铺</th>
- <th style="width:100px;">shopId</th>
- <th style="width:100px;">状态</th>
- <th style="width:220px;">文件夹</th>
- </tr>
- </thead>
- <tbody id="shopTableBody"></tbody>
- </table>
- <div id="shopTableEmpty" class="empty-hint">
- <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"><rect x="5" y="4" width="14" height="17" rx="2"/><path d="M9 4a3 3 0 0 1 6 0"/><path d="M9 10h6M9 14h6M9 18h4"/></svg></div>
- <p>尚无店铺<br><small>点击右上角「+ 添加店铺」手动录入</small></p>
- </div>
- </div>
- </div>
- </div>
- </div>
- </main>
- </div>
- <!-- ==================== 视觉生成 ==================== -->
- <div id="viewGen" class="view">
- <main class="content">
- <div class="page-header">
- <div>
- <h1>视觉生成</h1>
- <div class="sub">基于已采集的菜品图片,批量生成 LOGO / 海报 / 招牌 / 贴纸 + 菜品图</div>
- </div>
- <div class="toolbar">
- <button class="btn btn-ghost btn-small" id="btnRefreshGen">
- <svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.8" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><path d="M20 12a8 8 0 1 1-2.3-5.6"/><path d="M20 4v5h-5"/></svg>
- 刷新
- </button>
- </div>
- </div>
- <div class="gen-overview">
- <div class="stats-grid" id="statsBar">
- <div class="metric accent"><span class="metric-icon"><svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.8" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><path d="M4 20V9l8-5 8 5v11"/><path d="M9 20v-6h6v6"/></svg></span><span class="metric-body"><span class="metric-label">店铺</span><span class="metric-value" id="statShops">—</span><span class="stat-delta" id="statShopsDelta"></span></span></div>
- <div class="metric ok"><span class="metric-icon"><svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><path d="M5 12.5l4.5 4.5L19 7.5"/></svg></span><span class="metric-body"><span class="metric-label">已生成</span><span class="metric-value" id="statDone">—</span><span class="stat-delta" id="statDoneDelta"></span></span></div>
- <div class="metric warn"><span class="metric-icon"><svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.8" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><path d="M7 3h10M7 21h10"/><path d="M8 3c0 8 8 8 8 18M16 3c0 8-8 8-8 18"/></svg></span><span class="metric-body"><span class="metric-label">待处理</span><span class="metric-value" id="statPending">—</span><span class="stat-delta" id="statPendingDelta"></span></span></div>
- <div class="metric fail"><span class="metric-icon"><svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.8" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><circle cx="12" cy="12" r="9"/><path d="M12 7v6M12 16.5v.5"/></svg></span><span class="metric-body"><span class="metric-label">失败</span><span class="metric-value" id="statFail">—</span><span class="stat-delta" id="statFailDelta"></span></span></div>
- </div>
- <div class="gen-controls">
- <div class="field">
- <label>扫描范围</label>
- <div class="scan-dropdown" id="scanDropdown">
- <button type="button" class="scan-dropdown-trigger" id="scanDropdownTrigger" aria-expanded="false" aria-haspopup="listbox">
- <span id="scanDropdownText">全量扫描</span>
- <svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><path d="M6 9l6 6 6-6"/></svg>
- </button>
- <div class="scan-dropdown-menu" id="scanDropdownMenu" role="listbox" aria-multiselectable="true" hidden></div>
- </div>
- </div>
- <button class="btn btn-primary" id="scanBtn">
- <span id="scanIcon"><svg viewBox="0 0 24 24" fill="currentColor" aria-hidden="true"><path d="M8 5v14l11-7z"/></svg></span>
- <span id="scanText">扫描店铺</span>
- </button>
- </div>
- </div>
- <div class="shop-cards" id="shopList"></div>
- </main>
- </div>
- <!-- ==================== 历史创作 ==================== -->
- <div id="viewTasks" class="view">
- <main class="content">
- <div class="page-header">
- <div>
- <h1>任务中心</h1>
- <div class="sub">跟踪生成任务状态,服务重启后可恢复进行中的生成任务</div>
- </div>
- <div class="toolbar">
- <button class="btn btn-ghost btn-small" id="btnRefreshTasks">
- <svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.8" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><path d="M20 12a8 8 0 1 1-2.3-5.6"/><path d="M20 4v5h-5"/></svg>
- 刷新
- </button>
- </div>
- </div>
- <div class="tasks-overview panel panel-designed">
- <span class="panel-watermark"><svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.4" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><path d="M4 7h10M4 12h16M4 17h7"/><circle cx="18" cy="7" r="2"/><circle cx="15" cy="17" r="2"/></svg></span>
- <div class="tasks-stats">
- <div class="task-stat"><span>全部</span><strong id="taskCountAll">0</strong></div>
- <div class="task-stat running"><span>进行中</span><strong id="taskCountRunning">0</strong></div>
- <div class="task-stat queued"><span>排队</span><strong id="taskCountQueued">0</strong></div>
- <div class="task-stat success"><span>成功</span><strong id="taskCountSuccess">0</strong></div>
- <div class="task-stat failed"><span>失败</span><strong id="taskCountFailed">0</strong></div>
- </div>
- <div class="tasks-filters" id="taskFilters">
- <button class="history-filter active" data-filter="all">全部</button>
- <button class="history-filter" data-filter="running">进行中</button>
- <button class="history-filter" data-filter="queued">排队中</button>
- <button class="history-filter" data-filter="success">已完成</button>
- <button class="history-filter" data-filter="failed">失败</button>
- </div>
- </div>
- <div class="history-summary" id="taskSummary">正在加载任务…</div>
- <div class="task-list" id="taskList"></div>
- </main>
- </div>
- <!-- ==================== 历史创作 ==================== -->
- <div id="viewHistory" class="view">
- <main class="content">
- <div class="page-header">
- <div>
- <h1>历史创作</h1>
- <div class="sub">以图片墙回顾已生成的品牌物料与菜品作品</div>
- </div>
- <div class="toolbar">
- <button class="btn btn-ghost btn-small" id="btnRefreshHistory">
- <svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.8" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><path d="M20 12a8 8 0 1 1-2.3-5.6"/><path d="M20 4v5h-5"/></svg>
- 刷新
- </button>
- </div>
- </div>
- <div class="history-toolbar panel">
- <div class="history-search">
- <svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.8" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><circle cx="11" cy="11" r="6.5"/><path d="M20 20l-4.2-4.2"/></svg>
- <input type="text" id="historySearch" placeholder="搜索门店或作品名称">
- </div>
- <div class="history-filters" id="historyFilters">
- <button class="history-filter active" data-filter="all">全部</button>
- <button class="history-filter" data-filter="logo">LOGO</button>
- <button class="history-filter" data-filter="banner">海报</button>
- <button class="history-filter" data-filter="signage">招牌</button>
- <button class="history-filter" data-filter="sticker">贴纸</button>
- <button class="history-filter" data-filter="dish">菜品</button>
- </div>
- </div>
- <div class="history-summary" id="historySummary">加载中…</div>
- <div class="history-gallery" id="historyGallery"></div>
- </main>
- </div>
- <!-- ==================== 数据采集 ==================== -->
- <div id="viewReports" class="view">
- <main class="content">
- <div class="page-header">
- <div>
- <h1>数据采集</h1>
- <div class="sub">同步控制台:连接商家客户端、按区间取数入库、推送云端主档案</div>
- </div>
- <div class="toolbar">
- <span class="conn-help-wrap">
- <span class="badge badge-info" id="reportConnBadge">检测连接…</span>
- <button type="button" class="help-btn" id="btnClientHelp" title="客户端连接排查" aria-expanded="false">?</button>
- <div class="help-popover" id="clientHelpPopover" hidden>
- <div class="help-popover-title">客户端连接排查</div>
- <ol class="help-popover-steps">
- <li><b>验证调试端口:</b>客户端带参启动后,浏览器打开 <code>http://127.0.0.1:9669/json/version</code> —— 看到一段 JSON(含 "Browser")就是通的;打不开就是客户端没带参。</li>
- <li><b>macOS 带参启动:</b>⌘Q 完全退出客户端(活动监视器确认进程没了)→ 终端执行:<code>open -a "淘宝闪购商家版" --args --remote-debugging-port=9669</code></li>
- <li><b>Windows 带参启动:</b>任务栏右键完全退出(任务管理器确认)→ 右键快捷方式 → 属性 → 「目标」末尾加 <code>--remote-debugging-port=9669</code> → 以后都用这个快捷方式启动。</li>
- <li>回到本页点「刷新」,徽章变「客户端已连接」后同步即可。若同步弹窗报 <code>Failed to fetch</code>,先确认服务在跑(启动窗口未关闭)。</li>
- </ol>
- <div class="help-popover-note">注意:客户端每次重启都必须带参启动,否则端口不会开启。</div>
- </div>
- </span>
- <button class="btn btn-ghost btn-small" id="btnReportRefresh">
- <svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.8" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><path d="M20 12a8 8 0 1 1-2.3-5.6"/><path d="M20 4v5h-5"/></svg>
- 刷新
- </button>
- <button class="btn btn-primary btn-small" id="btnOpenSync">
- <svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.8" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><path d="M12 3v12"/><path d="M7 10l5 5 5-5"/><path d="M4 21h16"/></svg>
- 同步数据
- </button>
- <button class="btn btn-ghost btn-small" id="btnReportPush" title="把本地湖增量推送到钉钉 AI 表格(云端主档案)">
- <svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.8" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><path d="M12 21V9"/><path d="M7 14l5-5 5 5"/><path d="M4 3h16"/></svg>
- 推送云端
- </button>
- <span class="badge" id="reportPushBadge">云端未启用</span>
- </div>
- </div>
- <div class="entity-tabs" id="entityTabs"></div>
- <div class="panel panel-fixed" id="syncHistoryPanel">
- <div class="panel-title">
- <span>同步历史</span>
- <span class="badge badge-info" id="syncHistoryBadge">本主体最近 8 次</span>
- </div>
- <div class="table-wrap">
- <table class="data-table">
- <thead><tr><th>时间</th><th>区间</th><th>范围</th><th>新增</th><th>更新</th><th>失败</th><th>备注</th></tr></thead>
- <tbody id="syncHistoryRows"><tr><td colspan="7" class="empty-cell">暂无同步记录</td></tr></tbody>
- </table>
- </div>
- </div>
- </main>
- </div>
- <!-- ==================== 数据中台 ==================== -->
- <div id="viewLake" class="view">
- <main class="content">
- <div class="page-header">
- <div>
- <h1>数据中台</h1>
- <div class="sub">本地数据湖全景与明细数据(含全部原始字段),可从云端拉取补全</div>
- </div>
- <div class="toolbar">
- <button class="btn btn-ghost btn-small" id="btnLakeRefresh">
- <svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.8" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><path d="M20 12a8 8 0 1 1-2.3-5.6"/><path d="M20 4v5h-5"/></svg>
- 刷新
- </button>
- <button class="btn btn-ghost btn-small" id="btnLakePull" title="以钉钉 AI 表格(云端主档案)为准,拉回本地湖;未注册的账号自动创建主体">
- <svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.8" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><path d="M12 3v12"/><path d="M7 10l5 5 5-5"/><path d="M4 21h16"/></svg>
- 从云端拉取
- </button>
- <span class="badge" id="lakeSyncBadge"></span>
- </div>
- </div>
- <div class="seg-control lake-tabs" id="lakeTabs" role="tablist" style="margin-bottom:14px; max-width:fit-content;">
- <button type="button" class="active" data-tab="overview">湖全景</button>
- <button type="button" data-tab="detail">明细数据</button>
- </div>
- <div id="lakeTabOverview">
- <div class="stats-grid" id="lakeKpis">
- <div class="metric"><span class="metric-body"><span class="metric-label">数据主体</span><span class="metric-value" id="lakeEntityCount">–</span><span class="metric-sub">已注册的商家账号</span></span></div>
- <div class="metric"><span class="metric-body"><span class="metric-label">湖内总行数</span><span class="metric-value" id="lakeRowCount">–</span><span class="metric-sub">按 日期×维度×门店 幂等去重</span></span></div>
- <div class="metric"><span class="metric-body"><span class="metric-label">日期覆盖</span><span class="metric-value" id="lakeCoverage">–</span><span class="metric-sub">最早 ~ 最晚(后台约 180 天)</span></span></div>
- <div class="metric"><span class="metric-body"><span class="metric-label">最近同步</span><span class="metric-value" id="lakeLastSync">–</span><span class="metric-sub">取数写入本地湖的时间</span></span></div>
- </div>
- <div class="panel panel-fixed report-table-panel">
- <div class="panel-title">
- <span>主体明细</span>
- <span class="badge badge-info" id="lakeRowsBadge">0 主体</span>
- </div>
- <div class="table-wrap">
- <table class="data-table">
- <thead>
- <tr>
- <th>账号名</th><th>门店/连锁</th><th>总行数</th><th>公司</th><th>连锁</th><th>门店</th><th>汇总</th><th>覆盖区间</th><th>最近同步</th><th>上次推送云端</th>
- </tr>
- </thead>
- <tbody id="lakeEntityRows">
- <tr><td colspan="10" class="empty-cell">加载中…</td></tr>
- </tbody>
- </table>
- </div>
- <div class="help">冲突策略:同一行(日期×账号×维度×门店)多机写入时以取数时间新者为准;云端更新的行不会被本机旧数据覆盖。大批量全零数据会被拦截,防止取数异常污染云端主档案。</div>
- </div>
- </div>
- <div id="lakeTabDetail" hidden>
- <div class="entity-tabs" id="lakeEntityTabs"></div>
- <div class="report-toolbar panel">
- <div class="field report-field-sm">
- <label>日期范围</label>
- <select id="reportRangePreset">
- <option value="7">近 7 天</option>
- <option value="30" selected>近 30 天</option>
- <option value="90">近 90 天</option>
- <option value="custom">自定义</option>
- </select>
- </div>
- <div class="field report-field-md" id="reportCustomRange" hidden>
- <label>起止日期</label>
- <div class="report-date-range">
- <input type="date" id="reportFromDate">
- <span>–</span>
- <input type="date" id="reportToDate">
- </div>
- </div>
- <div class="field report-field-lg">
- <label>门店</label>
- <div class="scan-dropdown" id="reportShopDropdown">
- <button type="button" class="scan-dropdown-trigger" id="reportShopTrigger" aria-expanded="false" aria-haspopup="listbox">
- <span id="reportShopText">全部门店</span>
- <svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><path d="M6 9l6 6 6-6"/></svg>
- </button>
- <div class="scan-dropdown-menu" id="reportShopMenu" role="listbox" aria-multiselectable="true" hidden></div>
- </div>
- </div>
- <div class="field">
- <label>视图</label>
- <div class="seg-control" id="reportViewModes" role="tablist">
- <button type="button" class="active" data-mode="detail">明细</button>
- <button type="button" data-mode="shop">按门店</button>
- <button type="button" data-mode="date">按日期</button>
- </div>
- </div>
- <div class="field report-field-grow">
- <label>搜索门店</label>
- <input type="text" id="reportSearch" placeholder="输入门店名称过滤">
- </div>
- <div class="field">
- <label>字段</label>
- <div class="seg-control" id="reportFieldModes" role="tablist">
- <button type="button" class="active" data-fields="report">报表列</button>
- <button type="button" data-fields="all">全部字段</button>
- </div>
- </div>
- <div class="report-toolbar-actions">
- <button class="btn btn-ghost btn-small" id="btnColumnCfg">列设置</button>
- <button class="btn btn-ghost btn-small" id="btnExportCsv">导出 CSV</button>
- </div>
- </div>
- <div class="stats-grid" id="reportKpis"></div>
- <div class="panel panel-fixed report-table-panel">
- <div class="panel-title">
- <span>报表数据</span>
- <span class="actions"><span class="badge badge-info" id="reportRowCount">0 行</span></span>
- </div>
- <div class="report-table-wrap" id="reportTableWrap">
- <table class="data-table report-table" id="reportTable">
- <thead id="reportTableHead"></thead>
- <tbody id="reportTableBody"></tbody>
- </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>
- </div>
- </div>
- </div>
- </div>
- </main>
- </div>
- <!-- ==================== 趋势图表 ==================== -->
- <div id="viewAnalysis" class="view">
- <main class="content">
- <div class="page-header">
- <div>
- <h1>趋势图表</h1>
- <div class="sub">主指标趋势 · 门店对比 · 转化漏斗,支持环比;有疑问点右下角问数助手</div>
- </div>
- <div class="toolbar">
- <button class="btn btn-ghost btn-small" id="btnExportHtml">
- <svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.8" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><path d="M12 3v12"/><path d="M7 10l5 5 5-5"/><path d="M4 21h16"/></svg>
- 导出周报
- </button>
- </div>
- </div>
- <div class="entity-tabs" id="analysisEntityTabs"></div>
- <div class="report-toolbar panel">
- <div class="field report-field-sm">
- <label>日期范围</label>
- <select id="analysisRangePreset">
- <option value="7">近 7 天</option>
- <option value="30" selected>近 30 天</option>
- <option value="90">近 90 天</option>
- </select>
- </div>
- <div class="field report-field-lg">
- <label>门店</label>
- <div class="scan-dropdown" id="anaShopDropdown">
- <button type="button" class="scan-dropdown-trigger" id="anaShopTrigger" aria-expanded="false" aria-haspopup="listbox">
- <span id="anaShopText">全部门店</span>
- <svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><path d="M6 9l6 6 6-6"/></svg>
- </button>
- <div class="scan-dropdown-menu" id="anaShopMenu" role="listbox" aria-multiselectable="true" hidden></div>
- </div>
- </div>
- <div class="field report-field-sm">
- <label>主指标</label>
- <select id="chartMetric" class="chart-metric-select"></select>
- </div>
- <label class="ana-compare-toggle" title="主趋势图中叠加上一周期的虚线对照">
- <input type="checkbox" id="anaComparePrev" checked>
- <span>对比上期</span>
- </label>
- </div>
- <div class="delta-strip" id="analysisDeltas"></div>
- <div class="ana-grid">
- <div class="panel ana-cell ana-span2">
- <div class="panel-title"><span id="anaTrendTitle">主指标趋势</span></div>
- <div id="chartTrend" class="chart chart-lg"></div>
- </div>
- <div class="panel ana-cell">
- <div class="panel-title"><span>门店排行 Top 10</span></div>
- <div id="chartRank" class="chart chart-lg"></div>
- </div>
- <div class="panel ana-cell">
- <div class="panel-title"><span>转化漏斗(曝光 → 进店 → 下单)</span></div>
- <div id="chartFunnel" class="chart chart-lg"></div>
- </div>
- <div class="panel ana-cell ana-span2">
- <div class="panel-title"><span id="anaCompareTitle">门店对比 · Top 5</span></div>
- <div id="chartCompare" class="chart chart-lg"></div>
- </div>
- </div>
- </main>
- </div>
- <!-- ==================== 系统设置 ==================== -->
- <div id="viewSettings" class="view">
- <main class="content">
- <div class="page-header">
- <div>
- <h1>系统设置</h1>
- <div class="sub">API 密钥与采集配置,保存后立即生效</div>
- </div>
- </div>
- <div class="settings-workspace">
- <div class="settings-col">
- <div class="panel panel-narrow">
- <div class="stage-marker">
- <span class="num">1</span><span>API 设置</span>
- <div class="seg-control settings-api-tabs" id="settingsApiTabs" role="tablist">
- <button type="button" class="active" data-tab="image">图像模型</button>
- <button type="button" data-tab="chat">对话模型</button>
- </div>
- </div>
- <span class="panel-watermark"><svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.4" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><circle cx="7.5" cy="15.5" r="4.5"/><path d="M11 12L21 2"/><path d="M16 7l3 3"/></svg></span>
- <div class="panel-body">
- <div id="settingsTabImage" class="settings-tab-body" role="tabpanel">
- <div class="field">
- <div class="field-label-row">
- <label>API Key<span class="req">*</span></label>
- <span class="label-links">
- <a class="settings-link settings-link-compact" href="https://o-hubs.com/api/console/keys" target="_blank" rel="noopener noreferrer">
- <svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.8" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><circle cx="7.5" cy="15.5" r="4.5"/><path d="M11 12L21 2"/><path d="M16 7l3 3"/></svg>
- <span>获取 API Key</span>
- </a>
- <a class="settings-link settings-link-compact" href="https://o-hubs.com/home" target="_blank" rel="noopener noreferrer">
- <svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.8" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><rect x="3" y="6" width="18" height="13" rx="3"/><path d="M3 10h18"/><path d="M7 15h3"/></svg>
- <span>充值</span>
- </a>
- </span>
- </div>
- <input type="text" id="settingsApiKey" placeholder="sk-...">
- </div>
- <div class="field">
- <label>API 地址</label>
- <input type="text" id="settingsApiBase" value="https://api.lk888.ai" disabled>
- </div>
- <div class="field">
- <label>默认模型</label>
- <select id="settingsModel"></select>
- </div>
- <div class="settings-links">
- <button type="button" class="settings-link settings-link-btn" id="btnTestImage">
- <svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.8" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><path d="M20 12a8 8 0 1 1-2.3-5.6"/><path d="M20 4v5h-5"/></svg>
- <span>测试 API 与模型</span>
- </button>
- <span id="imageTestStatus" class="badge"></span>
- </div>
- </div>
- <div id="settingsTabChat" class="settings-tab-body" role="tabpanel" hidden>
- <div class="field">
- <label>API Key</label>
- <input type="text" id="settingsChatApiKey" placeholder="留空复用上方 API Key">
- </div>
- <div class="field">
- <label>API 地址</label>
- <input type="text" id="settingsChatApiBase" disabled placeholder="默认与生图 API 地址一致">
- </div>
- <div class="field">
- <label>对话模型</label>
- <select id="settingsChatModel">
- <option value="deepseek-v4.1-flash">deepseek-v4.1-flash</option>
- <option value="glm-5.3-flash">glm-5.3-flash</option>
- </select>
- </div>
- <div class="settings-links">
- <button type="button" class="settings-link settings-link-btn" id="btnTestChat">
- <svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.8" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><path d="M20 12a8 8 0 1 1-2.3-5.6"/><path d="M20 4v5h-5"/></svg>
- <span>测试对话模型</span>
- </button>
- <span id="chatTestStatus" class="badge"></span>
- </div>
- </div>
- <div class="panel-save-row">
- <button class="btn btn-primary btn-small" id="btnSaveApi">保存设置</button>
- <span id="apiSaveStatus" class="badge"></span>
- </div>
- </div>
- </div>
- <div class="panel panel-narrow">
- <div class="stage-marker"><span class="num">2</span><span>采集配置</span></div>
- <span class="panel-watermark"><svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.4" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><path d="M3 7a2 2 0 0 1 2-2h4l2 2h8a2 2 0 0 1 2 2v8a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2Z"/><path d="M3 11h18"/></svg></span>
- <div class="panel-body">
- <div class="field">
- <label>输出根目录</label>
- <input type="text" id="settingsRootDir" placeholder="/path/to/workspace">
- </div>
- <div class="field-row">
- <div class="field">
- <label>每页条数</label>
- <input type="number" id="pageSizeInput" min="1" value="50">
- </div>
- <div class="field">
- <label>间隔 (ms)</label>
- <input type="number" id="delayInput" min="0" value="300">
- <div class="help">建议 ≥ 200</div>
- </div>
- </div>
- <div class="field">
- <label>Cookie(淘宝闪购)</label>
- <textarea id="settingsCookie" rows="3" placeholder="登录 melody.shop.ele.me 后从 DevTools 复制"></textarea>
- <div class="help">Cookie 保存后不再回显;会话过期时粘贴新值即可更新</div>
- </div>
- <div class="panel-save-row">
- <button class="btn btn-primary btn-small" id="btnSaveCrawl">保存设置</button>
- <span id="crawlSaveStatus" class="badge"></span>
- </div>
- </div>
- </div>
- </div>
- <div class="settings-col">
- <div class="panel panel-narrow">
- <div class="stage-marker"><span class="num">3</span><span>安全设置</span></div>
- <span class="panel-watermark"><svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.4" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><path d="M12 3l7 3v5c0 4.4-3 8.4-7 10-4-1.6-7-5.6-7-10V6Z"/><path d="M9.5 12l1.8 1.8L15 10"/></svg></span>
- <div class="panel-body">
- <div class="field">
- <label>局域网访问口令(accessToken)</label>
- <input type="text" id="settingsAccessToken" placeholder="未设置" autocomplete="off">
- <div class="help">设置后,同一局域网的其他电脑访问本服务需要输入此口令(本机 127.0.0.1 不受影响)。留空保持不变;输入 - 清除口令。临时开关也可用环境变量 ACCESS_TOKEN。</div>
- </div>
- <div class="panel-save-row">
- <button class="btn btn-primary btn-small" id="btnSaveSecurity">保存设置</button>
- <span id="securitySaveStatus" class="badge"></span>
- </div>
- </div>
- </div>
- <div class="panel panel-narrow">
- <div class="stage-marker"><span class="num">4</span><span>钉钉 AI 表格</span></div>
- <span class="panel-watermark"><svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.4" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><rect x="3" y="4" width="18" height="16" rx="3"/><path d="M3 10h18M9 10v10"/></svg></span>
- <div class="panel-body">
- <div class="field">
- <label style="display:flex;align-items:center;gap:6px;">
- <input type="checkbox" id="settingsAitableEnabled">
- <span>启用(同步完成后自动推送增量到云端)</span>
- </label>
- </div>
- <div class="field">
- <label>AppKey / AppSecret(钉钉企业内部应用)</label>
- <input type="text" id="settingsAitableAppKey" placeholder="钉钉开放平台应用的 AppKey" autocomplete="off">
- <input type="text" id="settingsAitableAppSecret" placeholder="AppSecret 未设置" autocomplete="off" style="margin-top:6px;">
- <div class="help">Secret 保存后不回显;输入 - 清除。应用需开通「AI 表格」API 权限。</div>
- </div>
- <div class="field">
- <label>Base ID / 数据表名称</label>
- <input type="text" id="settingsAitableBaseId" placeholder="粘贴 AI 表格分享链接或直接填 Base ID" autocomplete="off">
- <input type="text" id="settingsAitableSheetName" placeholder="数据表" autocomplete="off" style="margin-top:6px;">
- <div class="help">Base ID 可直接粘贴分享链接(形如 alidocs.dingtalk.com/i/nodes/xxx),保存时自动提取 ID;网页版打开表格时地址栏里也能看到。</div>
- </div>
- <div class="settings-links">
- <button type="button" class="settings-link settings-link-btn" id="btnTestAitable"><span>测试连通</span></button>
- <span id="aitableStatus" class="badge"></span>
- </div>
- <div class="help">架构:取数机「同步 → 自动推送」(数据采集页有手动推送按钮),其他电脑在「数据中台」页从云端拉取。推送/拉取入口分别在数据采集与数据中台页,本面板只管配置。</div>
- <div class="panel-save-row">
- <button class="btn btn-primary btn-small" id="btnSaveAitable">保存设置</button>
- <span id="aitableSaveStatus" class="badge"></span>
- </div>
- </div>
- </div>
- </div>
- </div>
- </main>
- </div>
- <!-- ==================== 系统日志 ==================== --> <!-- ==================== 系统日志 ==================== -->
- <div id="viewLogs" class="view">
- <main class="content">
- <div class="page-header">
- <div>
- <h1>系统日志</h1>
- <div class="sub">任务与系统的实时运行日志(最近 500 条,自动刷新)</div>
- </div>
- </div>
- <div class="panel panel-fixed panel-log settings-log">
- <div class="panel-title">
- <span>实时日志</span>
- <span class="actions">
- <button class="btn btn-ghost btn-small" id="btnClearLog">清空日志</button>
- </span>
- </div>
- <span class="panel-watermark log-watermark"><svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.4" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><path d="M4 5h16v11H8l-4 4Z"/><path d="M8 9h8M8 12h5"/></svg></span>
- <div class="log-box" id="logPanel"></div>
- </div>
- </main>
- </div>
- </div>
- </div>
- <div class="toast-wrap" id="toast-wrap"></div>
- <!-- 智能问数 · 机器人(仅经营分析相关页面显示) -->
- <div class="chatbot-fab" id="chatbotFab" title="智能问数" hidden>
- <svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.8" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><rect x="4" y="8" width="16" height="11" rx="3"/><path d="M12 8V5"/><circle cx="12" cy="3.6" r="1.4"/><circle cx="9" cy="13" r="1.1" fill="currentColor" stroke="none"/><circle cx="15" cy="13" r="1.1" fill="currentColor" stroke="none"/><path d="M9.5 16.2h5"/></svg>
- </div>
- <div class="chatbot-panel" id="chatbotPanel" hidden>
- <div class="chatbot-head">
- <span class="chatbot-title">
- <svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.8" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><rect x="4" y="8" width="16" height="11" rx="3"/><path d="M12 8V5"/><circle cx="12" cy="3.6" r="1.4"/><circle cx="9" cy="13" r="1.1" fill="currentColor" stroke="none"/><circle cx="15" cy="13" r="1.1" fill="currentColor" stroke="none"/><path d="M9.5 16.2h5"/></svg>
- 智能问数
- </span>
- <span class="chatbot-sub">支持上下文追问</span>
- <button type="button" class="chatbot-icon-btn" id="btnChatClear" title="清空对话">
- <svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.8" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><path d="M3 6h18"/><path d="M8 6V4h8v2"/><path d="M6 6l1 14h10l1-14"/></svg>
- </button>
- <button type="button" class="chatbot-icon-btn" id="btnChatClose" title="收起">
- <svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><path d="M6 6l12 12M18 6L6 18"/></svg>
- </button>
- </div>
- <div class="chatbot-body" id="chatbotBody">
- <div class="chatbot-msg bot">
- <div class="chatbot-bubble">你好,我是经营数据助手。可以直接问,也支持追问 —— 比如先问「上月营业额Top5门店」,再问「那二店的单量呢」。</div>
- </div>
- <div class="chatbot-chips" id="chatbotChips">
- <button type="button" data-q="上月营业额Top5门店">上月营业额Top5门店</button>
- <button type="button" data-q="最近7天进店转化率趋势">最近7天进店转化率趋势</button>
- <button type="button" data-q="昨天营业额和订单总量">昨天营业额和订单总量</button>
- <button type="button" data-q="哪几家门店曝光高但下单少">哪几家门店曝光高但下单少</button>
- </div>
- </div>
- <div class="chatbot-input-row">
- <input type="text" id="chatbotInput" placeholder="输入问题,回车发送…" autocomplete="off">
- <button type="button" class="btn btn-primary btn-small" id="btnChatSend" title="发送">
- <svg viewBox="0 0 24 24" fill="currentColor" aria-hidden="true"><path d="M3 11l18-8-8 18-2.5-7.5z"/></svg>
- </button>
- </div>
- </div>
- <!-- 添加店铺弹窗 -->
- <div class="modal-overlay" id="modalAddShop" hidden>
- <div class="modal">
- <div class="modal-header">
- <div class="modal-title">
- <span class="modal-status-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 20V9l8-5 8 5v11"/><path d="M9 20v-6h6v6"/></svg>
- </span>
- <span>添加店铺</span>
- </div>
- <button class="modal-close" id="btnCloseModal">×</button>
- </div>
- <div class="modal-body">
- <div class="field">
- <label>店铺清单</label>
- <textarea id="manualInput" rows="5" placeholder="每行一个:shopId 店铺名 507068342 鑫龙福麻辣烫(康诺美食城店)"></textarea>
- <div class="help">每行一条,shopId 和店铺名用空格或逗号分隔</div>
- </div>
- </div>
- <div class="modal-footer">
- <button class="btn btn-ghost btn-small" id="btnCancelAdd">取消</button>
- <button class="btn btn-primary btn-small" id="useManualBtn">确认添加</button>
- </div>
- </div>
- </div>
- <!-- 列设置弹窗 -->
- <div class="modal-overlay" id="modalReportColumns" hidden>
- <div class="modal">
- <div class="modal-header">
- <div class="modal-title">
- <span class="modal-status-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 6h16M4 12h16M4 18h16"/></svg>
- </span>
- <span>列设置</span>
- </div>
- <button class="modal-close" id="btnCloseColumnCfg">×</button>
- </div>
- <div class="modal-body">
- <div class="help" style="margin-bottom:8px;">勾选需要在报表中展示的字段(日期与门店名称固定展示)</div>
- <div class="colcfg-list" id="columnCfgList"></div>
- </div>
- <div class="modal-footer">
- <button class="btn btn-ghost btn-small" id="btnResetColumns">恢复默认</button>
- <button class="btn btn-primary btn-small" id="btnApplyColumns">应用</button>
- </div>
- </div>
- </div>
- <!-- 数据同步弹窗 -->
- <div class="modal-overlay" id="modalReportSync" hidden>
- <div class="modal modal-wide">
- <div class="modal-header">
- <div class="modal-title">
- <span class="modal-status-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="M12 3v12"/><path d="M7 10l5 5 5-5"/><path d="M4 21h16"/></svg>
- </span>
- <span>同步数据到本地</span>
- </div>
- <button class="modal-close" id="btnCloseSync">×</button>
- </div>
- <div class="modal-body">
- <div class="badge" id="syncEntityBadge">未识别主体</div>
- <div class="field">
- <label>同步范围</label>
- <select id="syncScope">
- <option value="all" selected>全部(公司 + 连锁 + 门店明细)</option>
- <option value="shop">仅门店明细</option>
- <option value="company">仅公司 / 连锁汇总</option>
- <option value="custom">指定门店</option>
- </select>
- </div>
- <div class="field" id="syncShopPickWrap" hidden>
- <label>选择门店</label>
- <div class="scan-dropdown" id="syncShopDropdown">
- <button type="button" class="scan-dropdown-trigger" id="syncShopTrigger" aria-expanded="false" aria-haspopup="listbox">
- <span id="syncShopText">选择门店</span>
- <svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><path d="M6 9l6 6 6-6"/></svg>
- </button>
- <div class="scan-dropdown-menu" id="syncShopMenu" role="listbox" aria-multiselectable="true" hidden></div>
- </div>
- </div>
- <div class="field">
- <label>日期范围</label>
- <select id="syncRange">
- <option value="7">近 7 天</option>
- <option value="30" selected>近 30 天</option>
- <option value="90">近 90 天</option>
- </select>
- <div class="help">经营数据后台保留约 180 天;当天数据未结算,同步区间右端取昨日</div>
- </div>
- <div class="field">
- <label>每日自动同步</label>
- <div style="display:flex;gap:10px;align-items:center;">
- <label style="display:flex;align-items:center;gap:6px;margin:0;white-space:nowrap;">
- <input type="checkbox" id="autoSyncEnabled" />
- <span>每天自动同步昨日数据</span>
- </label>
- <input type="time" id="autoSyncTime" value="06:00" style="width:110px;" />
- </div>
- <div class="help">需商家客户端以调试端口运行;到点时客户端在线即自动补同步昨日数据,离线则当天在线后补跑。同步记录照常进入同步记录列表。</div>
- </div>
- <div id="syncProgressWrap" hidden>
- <div class="sync-progress-row">
- <div class="sync-progress-bar"><span id="syncProgressBar"></span></div>
- <span class="badge badge-info" id="syncProgressText">0 / 0</span>
- </div>
- <div class="sync-stat-row">
- <span class="badge badge-ok" id="syncStatAdded">新增 0</span>
- <span class="badge badge-info" id="syncStatUpdated">更新 0</span>
- <span class="badge badge-fail" id="syncStatFailed">失败 0</span>
- <button class="btn btn-ghost btn-small" id="btnSyncCancel" hidden>取消</button>
- </div>
- <div class="sync-steps" id="syncSteps"></div>
- </div>
- <div class="help" id="syncHint">同步会把所选区间逐日、逐店的经营数据写入本地数据湖(data/reports/),可反复同步自动去重合并。</div>
- </div>
- <div class="modal-footer">
- <button class="btn btn-ghost btn-small" id="btnCancelSync">关闭</button>
- <button class="btn btn-primary btn-small" id="btnStartSync">开始同步</button>
- </div>
- </div>
- </div>
- <script src="/crawl.js"></script>
- <script src="/gen.js"></script>
- <script src="/tasks.js"></script>
- <script src="/history.js"></script>
- <script src="/vendor/echarts.min.js"></script>
- <script src="/reports.js"></script>
- <script src="/lake.js"></script>
- <script src="/app.js"></script>
- </body>
- </html>
|