fix: директор по сервису — KPI карточки 2-строчные с SVG-иконками

This commit is contained in:
wasrusgen 2026-05-28 11:52:51 +03:00
parent f9ea350fa2
commit b5a1c43af2

View File

@ -365,30 +365,30 @@ function screenHome() {
<div style="font-size:13px;color:rgba(255,255,255,.7);margin-top:2px">Директор по сервису · @wasrusgen1 CRM</div> <div style="font-size:13px;color:rgba(255,255,255,.7);margin-top:2px">Директор по сервису · @wasrusgen1 CRM</div>
</div> </div>
<!-- KPI 4 плитки --> <!-- KPI плитки 2×col -->
<div style="display:grid;grid-template-columns:1fr 1fr;gap:10px;padding:14px 16px 0"> <div style="display:grid;grid-template-columns:1fr 1fr;gap:10px;padding:14px 16px 0">
${[ ${[
{val:'1',lbl:'Рекламаций просрочено',icon:'🚨',warn:true}, {val:'1', lbl:'Рекламации', warn:true, icon:'<svg width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2.2" stroke-linecap="round" stroke-linejoin="round"><path d="M10.29 3.86L1.82 18a2 2 0 0 0 1.71 3h16.94a2 2 0 0 0 1.71-3L13.71 3.86a2 2 0 0 0-3.42 0z"/><line x1="12" y1="9" x2="12" y2="13"/><line x1="12" y1="17" x2="12.01" y2="17"/></svg>'},
{val:'48/60',lbl:'Мест на складе',icon:'📦',warn:false}, {val:'48/60', lbl:'Мест на складе', warn:false, icon:'<svg width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2.2" stroke-linecap="round" stroke-linejoin="round"><path d="M21 16V8a2 2 0 0 0-1-1.73l-7-4a2 2 0 0 0-2 0l-7 4A2 2 0 0 0 3 8v8a2 2 0 0 0 1 1.73l7 4a2 2 0 0 0 2 0l7-4A2 2 0 0 0 21 16z"/></svg>'},
{val:'4/7',lbl:'Сборщиков онлайн',icon:'👥',warn:false}, {val:'4/7', lbl:'Сборщиков онлайн',warn:false,icon:'<svg width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2.2" stroke-linecap="round" stroke-linejoin="round"><path d="M17 21v-2a4 4 0 0 0-4-4H5a4 4 0 0 0-4 4v2"/><circle cx="9" cy="7" r="4"/><path d="M23 21v-2a4 4 0 0 0-3-3.87"/><path d="M16 3.13a4 4 0 0 1 0 7.75"/></svg>'},
{val:'42 упак.',lbl:'Экспедиция сегодня',icon:'🚚',warn:false}, {val:'42 уп.',lbl:'Экспедиция', warn:false, icon:'<svg width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2.2" stroke-linecap="round" stroke-linejoin="round"><rect x="1" y="3" width="15" height="13" rx="1"/><path d="M16 8h4l3 3v5h-7V8z"/><circle cx="5.5" cy="18.5" r="2.5"/><circle cx="18.5" cy="18.5" r="2.5"/></svg>'},
{val:'11/12',lbl:'Замеров в срок сегодня',icon:'📏',warn:false}, {val:'11/12', lbl:'Замеров в срок', warn:false, icon:'<svg width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2.2" stroke-linecap="round" stroke-linejoin="round"><path d="M21 6H3"/><path d="M10 12H3"/><path d="M10 18H3"/><polyline points="15 13 18 16 22 10"/></svg>'},
{val:'1',lbl:'Нарушен регламент',icon:'⚠️',warn:true}, {val:'1', lbl:'Нарушений', warn:true, icon:'<svg width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2.2" stroke-linecap="round" stroke-linejoin="round"><path d="M12 22s8-4 8-10V5l-8-3-8 3v7c0 6 8 10 8 10z"/><line x1="12" y1="8" x2="12" y2="12"/><line x1="12" y1="16" x2="12.01" y2="16"/></svg>'},
{val:'3',lbl:'Доп. заказов с объектов',icon:'🏠',warn:false,green:true}, {val:'3', lbl:'Доп. заказов', green:true, icon:'<svg width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2.2" stroke-linecap="round" stroke-linejoin="round"><path d="M3 9l9-7 9 7v11a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2z"/><polyline points="9 22 9 12 15 12 15 22"/></svg>'},
].map((k, i, arr) => ` ].map((k, i, arr) => {
<div class="card" style="margin-bottom:0;padding:14px${i===arr.length-1&&arr.length%2!==0?';grid-column:1/-1;display:flex;align-items:center;gap:16px':''}${k.warn?';border-left:3px solid var(--danger)':k.green?';border-left:3px solid #16A34A':''}"> const isLast = i===arr.length-1 && arr.length%2!==0;
${i===arr.length-1&&arr.length%2!==0 const valColor = k.warn?'var(--danger)':k.green?'#16A34A':'var(--accent)';
? `<div style="font-size:28px">${k.icon}</div> const iconColor = k.warn?'var(--danger)':k.green?'#16A34A':'var(--accent)';
<div> const border = k.warn?';border-left:3px solid var(--danger)':k.green?';border-left:3px solid #16A34A':'';
<div style="font-size:22px;font-weight:800;color:${k.green?'#16A34A':'var(--accent)'};line-height:1">${k.val}</div> const iconHtml = k.icon.replace('stroke="currentColor"', \`stroke="\${iconColor}"\`);
<div style="font-size:12px;color:var(--muted);margin-top:4px">${k.lbl}</div> return \`<div class="card" style="margin-bottom:0;padding:12px 14px\${isLast?';grid-column:1/-1':''}${border}">
</div>` <div style="display:flex;align-items:center;gap:8px;margin-bottom:5px">
: `<div style="font-size:20px;margin-bottom:6px">${k.icon}</div> \${iconHtml}
<div style="font-size:${k.val.length>5?'16':'22'}px;font-weight:800;color:${k.warn?'var(--danger)':k.green?'#16A34A':'var(--accent)'};line-height:1">${k.val}</div> <div style="font-size:\${k.val.length>5?'15':'20'}px;font-weight:900;color:\${valColor};line-height:1">\${k.val}</div>
<div style="font-size:11px;color:var(--muted);margin-top:4px">${k.lbl}</div>` </div>
} <div style="font-size:11px;color:var(--muted);font-weight:500;white-space:nowrap;overflow:hidden;text-overflow:ellipsis">\${k.lbl}</div>
</div> </div>\`;
`).join('')} }).join('')}
</div> </div>
<div style="padding:0 16px"> <div style="padding:0 16px">