fix(workbench): 账号详情支持 hash 第三段直达 tab,趋势图失败显式提示
This commit is contained in:
1 parent
5c37e489ea
commit
0c7bf6f831
1 file changed
+5
-1
@@ -376,6 +376,9 @@ async function renderAccounts(view) {
|
||||
async function renderAccountDetail(view, id) {
|
||||
const accountId = Number(id);
|
||||
let page = 1, tab = 'info';
|
||||
// hash 第三段支持直达指定 tab:#/account/1629/persona → 视频列表(含趋势图)
|
||||
const seg = (location.hash || '').replace(/^#\/?/, '').split('/');
|
||||
if (seg.length >= 3 && ['info', 'persona', 'analysis'].includes(seg[2])) tab = seg[2];
|
||||
const bstate = { batch: false };
|
||||
const d = await api('/api/dsh/account-videos?accountId=' + accountId + '&page=1&pageSize=20').catch((e) => ({ ok: false, error: e.message }));
|
||||
if (!d.ok) { view.innerHTML = `<div class="page"><div class="page-toolbar">${toolbarBack()}</div><div class="empty">${esc(d.error || '账号不存在')}</div></div>`; bindBack(view); return; }
|
||||
@@ -548,7 +551,8 @@ async function renderAccountDetail(view, id) {
|
||||
mono token:纸 #F0EFEB / 墨 #1C1C1A / 灰 #8F8E88 / 网格 #DEDDD6;tipLight 黑底纸字;quarticOut 入场 */
|
||||
function renderTrendChart(view) {
|
||||
const el = view.querySelector('#trendChart');
|
||||
if (!el || typeof echarts === 'undefined') return;
|
||||
if (!el) return;
|
||||
if (typeof echarts === 'undefined') { el.innerHTML = `<div class="trend-empty">图表组件未加载(vendor/echarts.min.js 缺失),请重开页面</div>`; return; }
|
||||
const items = (trendData || []).filter((v) => v.publish_time);
|
||||
if (items.length < 2) { el.innerHTML = `<div class="trend-empty">暂无足够视频数据展示趋势</div>`; return; }
|
||||
const pts = items
|
||||
|
||||
Reference in new issue
Block a user