diff --git a/docs/elena_live.html b/docs/elena_live.html index f16e648..9ad95ae 100644 --- a/docs/elena_live.html +++ b/docs/elena_live.html @@ -55,6 +55,26 @@ body{font-family:'Inter',sans-serif;background:var(--bg);color:var(--text);displ .blk-pain::before{content:'•';position:absolute;left:3px;color:#f59e0b} .blk-tobe{font-size:13px;color:var(--primary);line-height:1.5;background:var(--light);padding:8px 10px;border-radius:8px} .empty{text-align:center;color:#cbd5e1;padding:60px 20px;font-size:14px} +/* IDEF0 box */ +.idef-lbl{font-size:11px;font-weight:700;text-transform:uppercase;letter-spacing:.05em;color:#9ca3af;margin:18px 0 10px} +.idef{margin-bottom:14px} +.idef-c{display:flex;flex-wrap:wrap;gap:4px;justify-content:center;margin-bottom:5px;padding-bottom:5px;border-bottom:2px dashed #cbd5e1} +.idef-mid{display:grid;grid-template-columns:auto 1fr auto;gap:8px;align-items:stretch} +.idef-i,.idef-o{display:flex;flex-direction:column;gap:4px;justify-content:center;max-width:130px} +.idef-fn{background:var(--white);border:2px solid var(--primary);border-radius:11px;padding:12px 10px;text-align:center;font-size:13px;font-weight:700;color:var(--dark);display:flex;flex-direction:column;gap:4px;justify-content:center;min-height:60px} +.idef-fn b{font-size:11px;color:var(--primary);font-family:'Montserrat'} +.idef-fn i{font-style:normal;font-size:11px;font-weight:700} +.idef-m{display:flex;flex-wrap:wrap;gap:4px;justify-content:center;margin-top:5px;padding-top:5px;border-top:2px dashed #cbd5e1} +.ar{font-size:10.5px;line-height:1.3;padding:3px 7px;border-radius:6px;background:#F1F5F9;color:#475569;display:inline-block} +.ar em{font-style:normal;color:#94a3b8;font-size:9px;margin-left:2px} +.idef-c .ar{background:#FEF3C7;color:#92400E} +.idef-c .ar.miss,.idef-c .ar.nomiss{background:#FEF2F2;color:#DC2626;border:1px dashed #FECACA} +.idef-i .ar{background:#EFF6FF;color:#1E40AF} +.idef-o .ar{background:#ECFDF5;color:#047857} +.idef-o .ar.dead{background:#FEF2F2;color:#DC2626} +.idef-m .ar.mech{background:#F5F3FF;color:#6D28D9} +.ar.dim{background:transparent;color:#cbd5e1} +.idef-iss{margin:-8px 0 14px;padding-left:4px} @media(max-width:860px){.model-col{position:fixed;inset:56px 0 0 0;width:100%;max-width:none;z-index:50}.chat-col{border:none}} @@ -140,46 +160,57 @@ async function sendMsg(){ } function pctColor(p){return p>=70?"#047857":p>=45?"#F59E0B":"#EF4444"} -function pctBg(p){return p>=70?"#ECFDF5":p>=45?"#FEF3C7":"#FEF2F2"} -const SEV={critical:["#DC2626","#FEF2F2","КРИТИЧНО"],high:["#92400E","#FEF3C7","ВЫСОКИЙ"],medium:["#1E40AF","#EFF6FF","СРЕДНИЙ"]}; +const SEV={critical:["#DC2626","#FEF2F2","КРИТ"],high:["#92400E","#FEF3C7","ВЫС"],medium:["#1E40AF","#EFF6FF","СРЕД"]}; +const MTYPE={human:"чел",equipment:"обор",software:"ПО",none:"—"}; + +function idefBox(fn, ctrls, ins, outs, mechs, opts={}){ + // Классический IDEF0 блок: Control сверху, Input слева, Output справа, Mechanism снизу + const C = (ctrls&&ctrls.length) ? ctrls.map(c=>`${esc(c.name)}`).join("") : `нет управления`; + const I = (ins&&ins.length) ? ins.map(a=>`${esc(a.name)}${a.source&&!/клиент|внеш|анна|подпис/i.test(a.source)?'←'+esc(a.source)+'':''}`).join("") : ``; + const O = (outs&&outs.length) ? outs.map(a=>`${esc(a.name)}${a.target&&a.target!=='НИКУДА'&&!/клиент|внеш|анна/i.test(a.target)?'→'+esc(a.target)+'':a.target==='НИКУДА'?' ⊘':''}`).join("") : ``; + const M = (mechs&&mechs.length) ? mechs.map(m=>`${esc(m.name)}${MTYPE[m.type]||''}`).join("") : ``; + return `
+
${C}
+
+
${I}
+
${opts.id?`${opts.id}`:''}${esc(fn)}${opts.pct!=null?`${opts.pct}%`:''}
+
${O}
+
+
${M}
+
`; +} function renderModel(m){ const col = document.getElementById("modelCol"); col.classList.add("show"); - let html = `
Операционная карта
${esc(m.client_summary)}
`; + let html = `
Модель бизнеса · IDEF0
${esc(m.client_summary)}
`; if(m.business_pattern){ - html += `
Паттерн бизнеса
${esc(m.business_pattern)}
`; + html += `
Паттерн бизнеса
${esc(m.business_pattern)}
`; } - - // Узлы - html += `
Узлы бизнеса · ${m.nodes.length}
`; - m.nodes.forEach(n=>{ - html += `
-
${esc(n.name)}
-
${n.completeness}%
-
${esc(n.actor)}
-
-
→ Вход
${esc(n.input)}
-
Выход →
${esc(n.output)}
-
-
Нормы
${esc(n.norms)}
-
Ресурсы
${esc(n.resources)}
`; - if(n.connections&&n.connections.length) html+=`
Связи
${n.connections.map(esc).join(' · ')}
`; - if(n.issues&&n.issues.length){html+=`
Проблемы
`;n.issues.forEach(p=>html+=`
${esc(p)}
`);html+=`
`} - html += `
`; - }); - - // Паттерны проблем - if(m.gaps&&m.gaps.length){ - html += `
Найденные разрывы · ${m.gaps.length}
`; - m.gaps.forEach(g=>{ + // A-0 контекст + if(m.context){ + html += `
A-0 · Контекстная диаграмма
`; + const c=m.context; + html += idefBox(c.function, c.controls, c.inputs, c.outputs, c.mechanisms, {id:"A0 "}); + } + // A0 декомпозиция + if(m.activities&&m.activities.length){ + html += `
A0 · Декомпозиция · ${m.activities.length} функций
`; + m.activities.forEach(a=>{ + html += idefBox(a.function, a.controls, a.inputs, a.outputs, a.mechanisms, {id:a.node_id+" ", pct:a.completeness}); + if(a.issues&&a.issues.length){html+=`
`;a.issues.forEach(p=>html+=`
${esc(p)}
`);html+=`
`} + }); + } + // Анализ стрелок + if(m.arrow_issues&&m.arrow_issues.length){ + html += `
Анализ стрелок · ${m.arrow_issues.length} разрывов
`; + m.arrow_issues.forEach(g=>{ const s=SEV[g.severity]||SEV.medium; - html+=`
-
${s[2]}${esc(g.title)}
+ html+=`
+
${s[2]}${esc(g.node_id)}${esc(g.title)}
${esc(g.description)}
`; }); } - if(m.missing_info&&m.missing_info.length){ html+=`
Елена уточнит ещё
`; m.missing_info.forEach(q=>html+=`
${esc(q)}
`);html+=`
`;