| 12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160 |
- <!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="schools"><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="10" r="3"/><path d="M12 21s7-6.2 7-11a7 7 0 1 0-14 0c0 4.8 7 11 7 11Z"/></svg></span><span>校区地图</span></button>
- <button class="nav-item" data-view="ops"><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 20h16"/><path d="M7 20V9M12 20V4M17 20v-7"/></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><span class="nav-beta">Beta</span></button>
- <button class="nav-item" data-view="ask"><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="4" y="8" width="16" height="11" rx="3"/><path d="M12 8V5"/><circle cx="12" cy="3.6" r="1.4"/><path d="M9.5 13.5h.01M14.5 13.5h.01"/><path d="M9.5 16.2h5"/></svg></span><span>智能问数</span><span class="nav-beta">Beta</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 id="sidebarVersion">淘宝闪购 · 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 id="crawlChannel">
- <option value="auto">自动 · 优先客户端,不可用回落 Cookie</option>
- <option value="client">仅客户端(淘宝闪购)</option>
- <option value="cookie">仅 Cookie</option>
- </select>
- <div class="panel-hint" id="crawlChannelHint">正在检测通道状态…</div>
- </div>
- <label style="display:flex;align-items:center;gap:6px;font-size:13px;cursor:pointer;">
- <input type="checkbox" id="forceFullCrawl">
- <span>强制全量抓取(覆盖已有图片)</span>
- </label>
- </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="btnNaposDiagnose" hidden>取数诊断</button>
- <button class="btn btn-ghost btn-small" id="btnHarvest" hidden>定向采集</button>
- <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="M3 12a9 9 0 0 1 9-9 9.75 9.75 0 0 1 6.74 2.74L21 8"/><path d="M21 3v5h-5"/><path d="M21 12a9 9 0 0 1-9 9 9.75 9.75 0 0 1-6.74-2.74L3 16"/><path d="M8 16H3v5"/></svg>
- 同步数据
- </button>
- </div>
- </div>
- <div id="entityTabs"></div>
- <div class="panel panel-fixed" id="syncHistoryPanel">
- <div class="panel-title">
- <span>同步历史</span>
- <span class="actions">
- <span class="badge" id="reportPushBadge">云端未启用</span>
- <button class="btn btn-primary btn-small" id="btnReportPush">
- <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>
- </div>
- <div class="table-wrap">
- <table class="data-table" id="syncHistoryTable">
- <thead><tr><th>时间</th><th>区间</th><th>范围</th><th>新增</th><th>更新</th><th>失败</th><th>备注</th><th>云端</th></tr></thead>
- <tbody id="syncHistoryRows"><tr><td colspan="8" class="empty-cell">加载中…</td></tr></tbody>
- </table>
- <div id="syncHistoryEmpty" 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="syncHistoryEmptyText"></p>
- </div>
- </div>
- </div>
- </main>
- </div>
- <!-- ==================== 校区地图 ==================== -->
- <div id="viewSchools" 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="btnSchoolsReset">回到全国</button>
- </div>
- </div>
- <div class="schools-layout">
- <div class="schools-map-card"><div id="schoolsMap" class="schools-map"></div></div>
- <aside class="schools-side">
- <div class="schools-side-head"><b>学校</b><span id="schoolsCount"></span></div>
- <div id="schoolsList" class="schools-list"></div>
- </aside>
- </div>
- </main>
- </div>
- <!-- ==================== 店铺运营 ==================== -->
- <div id="viewOps" class="view">
- <main class="content">
- <div class="page-header">
- <div>
- <h1>店铺运营</h1>
- <div class="sub">上传商家后台导出的人工统计表,按学校 / 店铺 / 日期查看运营指标</div>
- </div>
- <div class="toolbar">
- <div id="opsHeaderTools"></div>
- <button class="btn btn-ghost btn-small" id="btnOpsRecords">导入记录</button>
- <button class="btn btn-primary btn-small" id="btnOpsUpload">
- <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 16V4"/><path d="M7 9l5-5 5 5"/><path d="M4 20h16"/></svg>
- 上传文件
- </button>
- </div>
- </div>
- <div id="opsBar"></div>
- <div id="opsBody"></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-primary 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">
- <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="actions">
- <span class="badge badge-info" id="lakeRowsBadge">0 主体</span>
- <span class="conn-help-wrap">
- <button type="button" class="help-btn" id="btnLakeHelp" title="多机数据与云端同步规则" aria-expanded="false">?</button>
- <div class="help-popover" id="lakeHelpPopover" hidden>
- <div class="help-popover-title">多机与云端同步规则</div>
- <ol class="help-popover-steps">
- <li><b>不产生重复:</b>每一行的身份是「日期×账号×维度×门店」,多台电脑写同一行只会覆盖,不会重复。</li>
- <li><b>数据新者胜:</b>推送时对比本地取数时间与云端修改时间,旧数据不会覆盖云端新数据(跳过并计数)。</li>
- <li><b>层间矛盾拦截:</b>门店明细全部全零而连锁/公司汇总有数(取数异常形态)时拒绝推送;新店多导致的大面积全零是正常形态,不受影响。</li>
- <li><b>拉取不算待推:</b>云端拉取回来的数据本来就已在云端,不计入本机「待推送」;从未本地同步过的只读机器恒显示与云端一致。</li>
- <li><b>拉取以云端为准:</b>其他电脑执行「云端拉取」后,本地同键行被云端版本覆盖。</li>
- <li><b>推送前备份:</b>每次推送会把将被覆盖的云端记录自动备份到本机(.genpic/aitable-backup/,保留 20 份),坏推送可回滚;不放心误推的机器可在 系统设置 里开「云端写保护」,只拉不推。</li>
- </ol>
- </div>
- </span>
- </span>
- </div>
- <div class="table-wrap">
- <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>
- </tr>
- </thead>
- <tbody id="lakeEntityRows">
- <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>
- </div>
- <div id="lakeTabDetail" hidden>
- <div id="lakeEntityTabs"></div>
- <div class="report-toolbar panel">
- <div class="field report-field-sm">
- <label>日期范围</label>
- <select id="reportRangePreset">
- <option value="1">昨日</option>
- <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="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 class="report-pager" id="reportPager"></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 id="analysisEntityTabs"></div>
- <div class="ana-tpl-bar" id="anaTplBar"></div>
- <div class="ana-note" id="anaTplDesc"></div>
- <div class="report-toolbar panel">
- <div class="field report-field-sm">
- <label>日期范围</label>
- <select id="analysisRangePreset">
- <option value="1">昨日</option>
- <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" id="anaMetricField">
- <label>主指标</label>
- <select id="chartMetric" class="chart-metric-select"></select>
- </div>
- <label class="ana-compare-toggle" id="anaCompareField" title="主趋势图中叠加上一周期的虚线对照">
- <input type="checkbox" id="anaComparePrev" checked>
- <span>对比上期</span>
- </label>
- </div>
- <div class="delta-strip" id="analysisDeltas"></div>
- <div id="analysisEmpty" 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="analysisEmptyText"></p>
- </div>
- <div class="ana-grid" id="anaGrid"></div>
- </main>
- </div>
- <!-- ==================== 智能问数 ==================== -->
- <div id="viewAsk" class="view">
- <main class="content content-ask">
- <div class="ask-shell">
- <aside class="ask-side">
- <div class="ask-side-head">
- <span class="ask-brand">
- <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"/><path d="M9.5 13.5h.01M14.5 13.5h.01"/><path d="M9.5 16.2h5"/></svg>
- 智能问数
- </span>
- <button type="button" class="ask-new-btn" id="btnAskNewSession" title="新建会话">+</button>
- </div>
- <div class="ask-search">
- <input type="text" id="askSearch" placeholder="搜索会话" autocomplete="off">
- </div>
- <div class="ask-side-list" id="askSessions"></div>
- </aside>
- <section class="ask-stage">
- <div class="ask-stage-head">
- <span class="ask-stage-title" id="askStageTitle">新对话</span>
- <span class="ask-stage-badge" id="askStageBadge"></span>
- </div>
- <div class="ask-stage-sub">智能体自动取数、做同环比对比与数据体检;结论均来自本地数据湖,过程与数据质量判定全程可见</div>
- <div id="askDigest" class="ask-digest" hidden></div>
- <div class="ask-stream" id="askStream">
- <div class="ask-hero" id="askEmpty">
- <div class="ask-hero-title">给问数一个目标</div>
- <div class="ask-hero-sub">智能体会自动规划、调用取数与校验工具(湖概览 / 报表查询 / 同环比对比 / 数据体检),逐步给出带真实数字的结论;切换页面后运行仍会继续,可随时回来查看。</div>
- <div class="ask-chips" id="askChips">
- <button type="button" data-q="最近7天营业额和单量趋势">最近7天营业额和单量趋势</button>
- <button type="button" data-q="最近30天比上一个30天营业额变化多少,主要受哪些门店影响">环比变化与影响门店</button>
- <button type="button" data-q="做一次数据体检,看看数据质量有没有问题">数据体检</button>
- <button type="button" data-q="上月营业额Top5门店">上月营业额Top5门店</button>
- </div>
- </div>
- </div>
- <div class="ask-composer">
- <textarea id="askInput" rows="1" placeholder="描述你的数据问题,或从「技能」里点名打法;回车发送,Shift + Enter 换行" autocomplete="off"></textarea>
- <div class="ask-composer-bar">
- <select id="askEntity" class="ask-ent-select" title="数据主体"></select>
- <div class="seg-control" id="askMode">
- <button type="button" data-mode="auto" class="active">自动</button>
- <button type="button" data-mode="agent">深度分析</button>
- <button type="button" data-mode="quick">快问</button>
- </div>
- <select id="askSkill" class="ask-ent-select" title="内置技能(打法模板,可选)">
- <option value="">技能:自动</option>
- </select>
- <span class="ask-composer-spacer"></span>
- <button type="button" class="btn btn-ghost btn-small" id="btnAskStop" hidden>停止</button>
- <button type="button" class="ask-send-btn" id="btnAskSend" 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>
- </section>
- </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 class="help">用于快问与问数结论;深度分析缺省也用它</div>
- </div>
- <div class="field">
- <label>深度分析模型(可选)</label>
- <select id="settingsChatModelAgent">
- <option value="">跟随对话模型</option>
- <option value="deepseek-v4.1-flash">deepseek-v4.1-flash</option>
- <option value="glm-5.3-flash">glm-5.3-flash</option>
- </select>
- <div class="help">问数「深度分析」多步规划用的模型,缺省跟随上方对话模型</div>
- </div>
- <div class="field">
- <label>动作 JSON mode</label>
- <label style="display:flex;align-items:center;gap:6px;margin:0;">
- <input type="checkbox" id="settingsChatJsonMode" />
- <span>启用 response_format=json_object(网关支持时更稳,报错请关闭)</span>
- </label>
- </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>
- </div>
- <div class="field">
- <label>Cookie(淘宝闪购,兜底通道)</label>
- <textarea id="settingsCookie" rows="3" placeholder="采集走客户端通道时无需此项;仅 Cookie 通道 / 客户端不可用时使用。登录 melody.shop.ele.me 后从 DevTools 复制粘贴"></textarea>
- </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>
- <span class="conn-help-wrap">
- <button type="button" class="help-btn" id="btnSecurityHelp" title="局域网访问口令说明" aria-expanded="false">?</button>
- <div class="help-popover pop-left" id="securityHelpPopover" hidden>
- <div class="help-popover-title">局域网访问口令</div>
- <ol class="help-popover-steps">
- <li><b>作用:</b>设置后,同一局域网的其他电脑访问本服务需要输入此口令;本机 127.0.0.1 不受影响。</li>
- <li><b>清除:</b>输入 <code>-</code> 保存即清除;留空保存保持不变。</li>
- <li><b>临时开关:</b>也可用环境变量 <code>ACCESS_TOKEN</code>。</li>
- </ol>
- </div>
- </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>
- <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>
- <span class="conn-help-wrap">
- <button type="button" class="help-btn" id="btnAitableHelp" title="钉钉 AI 表格配置说明" aria-expanded="false">?</button>
- <div class="help-popover pop-left" id="aitableHelpPopover" hidden>
- <div class="help-popover-title">钉钉 AI 表格 · 配置说明</div>
- <ol class="help-popover-steps">
- <li><b>前置条件:</b>钉钉企业内部应用需开通「AI 表格」API 权限。</li>
- <li><b>Base ID:</b>可直接粘贴分享链接(形如 alidocs.dingtalk.com/i/nodes/xxx),保存时自动提取 ID;三张表名留空用默认值。</li>
- <li><b>为什么拆三张表:</b>云端按维度拆表(门店明细/连锁汇总/公司汇总),每张表内粒度唯一,钉钉 AI 问数/人工聚合不会跨维度算重。</li>
- <li><b>推送与拉取:</b>取数机「同步 → 自动推送」(数据采集页有手动推送按钮),其他电脑在「数据中台」页执行「云端拉取」。本面板只管配置。</li>
- </ol>
- </div>
- </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>
- <label style="display:flex;align-items:center;gap:6px;">
- <input type="checkbox" id="settingsAitableReadOnly">
- <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>
- <div class="field">
- <label>Base ID / 三张数据表名称</label>
- <input type="text" id="settingsAitableBaseId" placeholder="粘贴 AI 表格分享链接或直接填 Base ID" autocomplete="off">
- <div class="sheet-names-grid">
- <input type="text" id="settingsAitableSheetDetail" placeholder="门店明细" autocomplete="off">
- <input type="text" id="settingsAitableSheetChain" placeholder="连锁汇总" autocomplete="off">
- <input type="text" id="settingsAitableSheetCompany" placeholder="公司汇总" autocomplete="off">
- </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="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="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>
- <!-- 取数诊断弹窗(隐藏入口:连点侧边栏版本号 5 次显现) -->
- <div class="modal-overlay" id="modalNaposDiagnose" 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="M14.7 6.3a4.5 4.5 0 0 0-6 6L3 18l3 3 5.7-5.7a4.5 4.5 0 0 0 6-6L14 13l-3-3 3.7-3.7z"/></svg>
- </span>
- <span>取数诊断</span>
- </div>
- <button class="modal-close" id="btnCloseDiagnose">×</button>
- </div>
- <div class="modal-body">
- <div class="diagnose-summary" id="diagnoseSummary">正在诊断,约需半分钟,请勿关闭…</div>
- <details class="diagnose-raw">
- <summary>原始报告 JSON(复制或下载发给开发即可)</summary>
- <pre id="diagnoseJson"></pre>
- </details>
- </div>
- <div class="modal-footer">
- <button class="btn btn-ghost btn-small" id="btnCopyDiagnose">复制报告</button>
- <button class="btn btn-ghost btn-small" id="btnDownloadDiagnose">下载报告</button>
- <button class="btn btn-primary btn-small" id="btnDismissDiagnose">关闭</button>
- </div>
- </div>
- </div>
- <!-- 定向采集弹窗(隐藏入口:与取数诊断一起,连点侧边栏版本号 5 次显现) -->
- <div class="modal-overlay" id="modalHarvest" 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"><circle cx="12" cy="12" r="3"/><path d="M5 12a7 7 0 0 1 1.5-4.3M19 12a7 7 0 0 0-1.5-4.3M2.5 12a9.5 9.5 0 0 1 2-5.8M21.5 12a9.5 9.5 0 0 0-2-5.8"/></svg>
- </span>
- <span>定向采集接口</span>
- </div>
- <button class="modal-close" id="btnCloseHarvest">×</button>
- </div>
- <div class="modal-body">
- <ol class="help-popover-steps" style="position:static;opacity:1;visibility:visible;margin:0 0 10px;">
- <li><b>用途:</b>补录接口目录没有覆盖的页面(如「历史订单」「营业时间设置」),供开发侧定位数据源。</li>
- <li><b>用法:</b>点「开始采集」后,切到淘宝闪购客户端,<b>正常翻看目标页面约 2 分钟</b>(比如订单页点「历史订单」翻几页),时间到自动结束。</li>
- <li><b>安全:</b>只录下你浏览时页面自己发出的请求地址,不重放、不点击、不改任何数据。</li>
- <li><b>完成后:</b>点「复制清单」把结果发回开发侧即可。</li>
- </ol>
- <div class="field-row">
- <div class="field">
- <label>采集时长</label>
- <select id="harvestSeconds">
- <option value="60">1 分钟</option>
- <option value="120" selected>2 分钟</option>
- <option value="300">5 分钟</option>
- </select>
- </div>
- <div class="field" style="flex:0;">
- <label> </label>
- <button class="btn btn-primary btn-small" id="btnHarvestStart">开始采集</button>
- </div>
- </div>
- <div class="badge" id="harvestStatusBadge" style="margin-bottom:8px;">待开始</div>
- <div id="harvestSummary" class="diagnose-summary" hidden></div>
- <details class="diagnose-raw" id="harvestRawWrap" hidden>
- <summary>接口清单 JSON(复制发给开发即可)</summary>
- <pre id="harvestJson"></pre>
- </details>
- </div>
- <div class="modal-footer">
- <button class="btn btn-ghost btn-small" id="btnCopyHarvest" hidden>复制清单</button>
- <button class="btn btn-ghost btn-small" id="btnHarvestStop" hidden>提前结束</button>
- <button class="btn btn-primary btn-small" id="btnDismissHarvest">关闭</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="1">昨日</option>
- <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>
- <!-- 店铺运营 · 上传弹窗 -->
- <div class="modal-overlay" id="opsUploadModal" hidden>
- <div class="modal ops-upload-modal">
- <div class="modal-header">
- <div class="modal-title"><span>上传店铺运营数据</span></div>
- <button class="modal-close" id="opsUploadClose" type="button" aria-label="关闭">×</button>
- </div>
- <div class="modal-body">
- <div class="ops-drop" id="opsDrop">
- <b>拖拽 .xlsx 文件到这里(可多选)</b>
- <small>或点击选择文件;支持商家后台导出的人工统计表,一次最多 30 个</small>
- </div>
- <input type="file" id="opsFile" accept=".xlsx" multiple hidden>
- <div class="ops-file-list" id="opsFileList"></div>
- <div class="ops-field">
- <label for="opsYear">数据年份</label>
- <input type="number" class="ops-input" id="opsYear" min="2000" max="2100" value="2026">
- <small>表里的日期只有「9.9」这种格式,没有年份,需要你确认</small>
- </div>
- <div class="ops-field">
- <label for="opsSchool">学校</label>
- <select class="ops-input ops-select" id="opsSchool">
- <option value="">自动(读取表格里的「学校名称」列)</option>
- <option value="__custom">手动输入…</option>
- </select>
- <input type="text" class="ops-input" id="opsSchoolCustom" placeholder="输入学校名称" hidden>
- <small>表格里没有「学校名称」列,或想把这批数据归到指定学校时,在这里选或手动填</small>
- </div>
- <label class="ops-check"><input type="checkbox" id="opsForce"> 覆盖已导入的文件(同一文件重新导入时替换旧数据)</label>
- <div class="ops-upload-result" id="opsUploadResult"></div>
- </div>
- <div class="modal-footer">
- <button class="btn btn-ghost btn-small" id="opsUploadCancel" type="button">关闭</button>
- <button class="btn btn-primary btn-small" id="opsUploadStart" type="button">开始导入</button>
- </div>
- </div>
- </div>
- <!-- 店铺运营 · 导入记录 -->
- <div class="modal-overlay" id="opsRecordsModal" hidden>
- <div class="modal ops-records-modal">
- <div class="modal-header">
- <div class="modal-title"><span>导入记录</span></div>
- <button class="modal-close" id="opsRecordsClose" type="button" aria-label="关闭">×</button>
- </div>
- <div class="modal-body" id="opsRecordsList"></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="/analysis-templates.js"></script>
- <script src="/reports.js"></script>
- <script src="/lake.js"></script>
- <script src="/ops.js"></script>
- <script src="/schools.js"></script>
- <script src="/ask.js"></script>
- <script src="/app.js"></script>
- </body>
- </html>
|