|
@@ -10,7 +10,7 @@
|
|
|
import { LitElement, html, css, render } from 'lit';
|
|
import { LitElement, html, css, render } from 'lit';
|
|
|
import { SignalWatcher } from '@lit-labs/signals';
|
|
import { SignalWatcher } from '@lit-labs/signals';
|
|
|
import { useTokens } from '../components/base.js';
|
|
import { useTokens } from '../components/base.js';
|
|
|
-import { spaceCJK } from '../utils/type.js';
|
|
|
|
|
|
|
+import { t } from '../components/cjk.js';
|
|
|
import { boardService } from '../services/board-service.js';
|
|
import { boardService } from '../services/board-service.js';
|
|
|
import { currentPath, currentQuery, subscribe as subscribeRoute, navigate, href, onLinkClick, match } from '../utils/router.js';
|
|
import { currentPath, currentQuery, subscribe as subscribeRoute, navigate, href, onLinkClick, match } from '../utils/router.js';
|
|
|
import { CONFIG } from '../app.config.js';
|
|
import { CONFIG } from '../app.config.js';
|
|
@@ -245,7 +245,7 @@ export class KfApp extends SignalWatcher(LitElement) {
|
|
|
if (!opp) return { heading: '机会卡不存在', body: html`<kf-empty kind="error" title="难道这张卡已被删除?" hint=${`库里找不到 ${d.id}`}></kf-empty>` };
|
|
if (!opp) return { heading: '机会卡不存在', body: html`<kf-empty kind="error" title="难道这张卡已被删除?" hint=${`库里找不到 ${d.id}`}></kf-empty>` };
|
|
|
return {
|
|
return {
|
|
|
heading: opp.title,
|
|
heading: opp.title,
|
|
|
- sub: `${opp.priority ? `${opp.priority} 级 · ` : ''}${opp.category} · ${opp.stage} · ${opp.statusLabel}`,
|
|
|
|
|
|
|
+ sub: t(`${opp.priority ? `${opp.priority} 级 · ` : ''}${opp.category} · ${opp.stage} · ${opp.statusLabel}`),
|
|
|
body: html`
|
|
body: html`
|
|
|
<div class="d-sec">
|
|
<div class="d-sec">
|
|
|
<div class="one">${opp.oneLiner || '(未填写一句话说明)'}</div>
|
|
<div class="one">${opp.oneLiner || '(未填写一句话说明)'}</div>
|
|
@@ -262,8 +262,8 @@ export class KfApp extends SignalWatcher(LitElement) {
|
|
|
${opp.decision ? html`<div class="dec"><b>${opp.decision.label}</b> · ${opp.decision.reason}<div class="kf-muted">${opp.decision.by} · ${fmtDate(opp.decision.at, true)}</div></div>`
|
|
${opp.decision ? html`<div class="dec"><b>${opp.decision.label}</b> · ${opp.decision.reason}<div class="kf-muted">${opp.decision.by} · ${fmtDate(opp.decision.at, true)}</div></div>`
|
|
|
: html`<div class="kf-muted">尚无决策记录。</div>`}
|
|
: html`<div class="kf-muted">尚无决策记录。</div>`}
|
|
|
${opp.decisionLog.length ? html`<details>
|
|
${opp.decisionLog.length ? html`<details>
|
|
|
- <summary>决策记录 ${opp.decisionLog.length} 条(最近 3 条)</summary>
|
|
|
|
|
- <ol class="log">${opp.decisionLog.slice(-3).reverse().map((x) => html`<li><b>${x.label}</b> ${x.reason} <span class="kf-muted">${x.by} · ${fmtDate(x.at, true)}</span></li>`)}</ol></details>` : ''}
|
|
|
|
|
|
|
+ <summary>${t(`决策记录 ${opp.decisionLog.length} 条(最近 3 条)`)}</summary>
|
|
|
|
|
+ <ol class="log">${opp.decisionLog.slice(-3).reverse().map((x) => html`<li><b>${x.label}</b> ${x.reason} <span class="kf-muted">${t(`${x.by} · ${fmtDate(x.at, true)}`)}</span></li>`)}</ol></details>` : ''}
|
|
|
</div>
|
|
</div>
|
|
|
<div class="d-sec">
|
|
<div class="d-sec">
|
|
|
<h4>多人评分</h4>
|
|
<h4>多人评分</h4>
|
|
@@ -295,7 +295,7 @@ export class KfApp extends SignalWatcher(LitElement) {
|
|
|
const ids = conclusionToLedger(db, d.reportId, d.evId);
|
|
const ids = conclusionToLedger(db, d.reportId, d.evId);
|
|
|
return {
|
|
return {
|
|
|
heading: e.claim,
|
|
heading: e.claim,
|
|
|
- sub: `证据链 · 来自报告《${e.report.report?.title || e.report.shortTitle}》`,
|
|
|
|
|
|
|
+ sub: t(`证据链 · 来自报告《${e.report.report?.title || e.report.shortTitle}》`),
|
|
|
body: html`
|
|
body: html`
|
|
|
<div class="d-sec"><div class="kv">
|
|
<div class="d-sec"><div class="kv">
|
|
|
<div><b>${e.ownerCount ?? '—'}</b><span>人独立提到</span></div>
|
|
<div><b>${e.ownerCount ?? '—'}</b><span>人独立提到</span></div>
|
|
@@ -307,7 +307,7 @@ export class KfApp extends SignalWatcher(LitElement) {
|
|
|
<h4>支撑成果(点名到人)</h4>
|
|
<h4>支撑成果(点名到人)</h4>
|
|
|
${e.derived.length ? html`<ul class="links">${e.derived.map((x) => html`<li>
|
|
${e.derived.length ? html`<ul class="links">${e.derived.map((x) => html`<li>
|
|
|
${x.artifact ? html`<button class="lnk" @click=${() => this.#onAction({ type: 'artifact-open', detail: { id: x.id } })}>${x.name}</button>
|
|
${x.artifact ? html`<button class="lnk" @click=${() => this.#onAction({ type: 'artifact-open', detail: { id: x.id } })}>${x.name}</button>
|
|
|
- <span class="kf-muted">${x.owner || '无出身'} · ${x.stage} · ${x.evidence}</span>` : html`<span class="miss">${x.name}</span>`}
|
|
|
|
|
|
|
+ <span class="kf-muted">${t(`${x.owner || '无出身'} · ${x.stage} · ${x.evidence}`)}</span>` : html`<span class="miss">${x.name}</span>`}
|
|
|
</li>`)}</ul>` : html`<div class="kf-muted">这条结论没有登记支撑成果。</div>`}
|
|
</li>`)}</ul>` : html`<div class="kf-muted">这条结论没有登记支撑成果。</div>`}
|
|
|
</div>
|
|
</div>
|
|
|
<div class="d-sec">
|
|
<div class="d-sec">
|
|
@@ -316,10 +316,10 @@ export class KfApp extends SignalWatcher(LitElement) {
|
|
|
<p>${q.text}</p>
|
|
<p>${q.text}</p>
|
|
|
<div class="prov">
|
|
<div class="prov">
|
|
|
<span class="plat">${q.ref || '出处未登记'}</span>
|
|
<span class="plat">${q.ref || '出处未登记'}</span>
|
|
|
- ${q.likes != null ? html`<span>· 点赞 ${q.likes}</span>` : ''}
|
|
|
|
|
|
|
+ ${q.likes != null ? html`<span>${t(`· 点赞 ${q.likes}`)}</span>` : ''}
|
|
|
${q.author ? html`<span>· ${q.author}</span>` : ''}
|
|
${q.author ? html`<span>· ${q.author}</span>` : ''}
|
|
|
${q.art
|
|
${q.art
|
|
|
- ? html`<button class="lnk" @click=${() => this.#onAction({ type: 'artifact-open', detail: { id: q.art.id } })}>· 原文来自「${q.art.shortTitle}」(${q.art.ownerName})→</button>`
|
|
|
|
|
|
|
+ ? html`<button class="lnk" @click=${() => this.#onAction({ type: 'artifact-open', detail: { id: q.art.id } })}>${t(`· 原文来自「${q.art.shortTitle}」(${q.art.ownerName})→`)}</button>`
|
|
|
: html`<span>· 平台原文,未落入知识库</span>`}
|
|
: html`<span>· 平台原文,未落入知识库</span>`}
|
|
|
</div>
|
|
</div>
|
|
|
</li>`)}</ul>` : html`<div class="kf-muted">这条结论没有原文片段。</div>`}
|
|
</li>`)}</ul>` : html`<div class="kf-muted">这条结论没有原文片段。</div>`}
|
|
@@ -330,12 +330,12 @@ export class KfApp extends SignalWatcher(LitElement) {
|
|
|
if (d.type === 'artifact') {
|
|
if (d.type === 'artifact') {
|
|
|
const c = traceArtifact(db, d.id);
|
|
const c = traceArtifact(db, d.id);
|
|
|
if (!c) return { heading: '成果不存在', body: html`<kf-empty kind="error" title="成果已被删除"></kf-empty>` };
|
|
if (!c) return { heading: '成果不存在', body: html`<kf-empty kind="error" title="成果已被删除"></kf-empty>` };
|
|
|
- return { heading: c.artifact.shortTitle, sub: `${c.artifact.ownerName || '无出身'} · ${c.artifact.stageObj?.label || c.artifact.stage} · ${c.artifact.evidenceLabel}`, body: html`<kf-evidence-chain mode="artifact" .chain=${c}></kf-evidence-chain>` };
|
|
|
|
|
|
|
+ return { heading: c.artifact.shortTitle, sub: t(`${c.artifact.ownerName || '无出身'} · ${c.artifact.stageObj?.label || c.artifact.stage} · ${c.artifact.evidenceLabel}`), body: html`<kf-evidence-chain mode="artifact" .chain=${c}></kf-evidence-chain>` };
|
|
|
}
|
|
}
|
|
|
if (d.type === 'insight') {
|
|
if (d.type === 'insight') {
|
|
|
const c = traceInsight(db, d.id);
|
|
const c = traceInsight(db, d.id);
|
|
|
if (!c) return { heading: '归纳不存在', body: html`<kf-empty kind="error" title="归纳已被删除"></kf-empty>` };
|
|
if (!c) return { heading: '归纳不存在', body: html`<kf-empty kind="error" title="归纳已被删除"></kf-empty>` };
|
|
|
- return { heading: c.insight.title, sub: `归纳 · ${c.insight.layer}`, body: html`<kf-evidence-chain mode="insight" .chain=${c}></kf-evidence-chain>` };
|
|
|
|
|
|
|
+ return { heading: c.insight.title, sub: t(`归纳 · ${c.insight.layer}`), body: html`<kf-evidence-chain mode="insight" .chain=${c}></kf-evidence-chain>` };
|
|
|
}
|
|
}
|
|
|
return null;
|
|
return null;
|
|
|
}
|
|
}
|
|
@@ -357,12 +357,6 @@ export class KfApp extends SignalWatcher(LitElement) {
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
render(content.body, body);
|
|
render(content.body, body);
|
|
|
- // 抽屉正文也在浮层里:汉字与拉丁字母之间补 U+2009(v11 1.3),整行正文加 cap 行盒修剪之外的行宽上限
|
|
|
|
|
- requestAnimationFrame(() => {
|
|
|
|
|
- const w = document.createTreeWalker(body, NodeFilter.SHOW_TEXT);
|
|
|
|
|
- let t;
|
|
|
|
|
- while ((t = w.nextNode())) if (/[一-龥][A-Za-z0-9]|[A-Za-z0-9][一-龥]/.test(t.data)) t.data = spaceCJK(t.data);
|
|
|
|
|
- });
|
|
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
renderView() {
|
|
renderView() {
|