window.DashboardPage = (function() { 'use strict'; async function render() { try { const res = await API.get('/companies?page=1&page_size=5'); const data = res.data || {}; const items = data.items || []; const total = data.total || 0; const tiers = {}, statuses = {}; items.forEach(c => { tiers[c.customer_tier] = (tiers[c.customer_tier] || 0) + 1; statuses[c.customer_status] = (statuses[c.customer_status] || 0) + 1; }); let html = '
| 客户名称 | 行业 | 级别 | 状态 | 地区 | 更新时间 |
|---|---|---|---|---|---|
| ${esc(c.company_name)} | ${esc(c.industry)} | ${UI.tierBadge(c.customer_tier)} | ${UI.statusBadge(c.customer_status)} | ${esc(c.province)} ${esc(c.city)} | ${UI.formatDate(c.update_time)} |