|
|
@@ -1224,7 +1224,16 @@ const _sfc_main$b = /* @__PURE__ */ defineComponent({
|
|
|
const u = dist["不可判"] || 0;
|
|
|
const N = Object.values(dist).reduce((x, y) => x + y, 0) || 1;
|
|
|
const col = a >= 8 ? "var(--critical)" : a >= 3 ? "var(--warning)" : a ? "var(--accent)" : "var(--good)";
|
|
|
- return { s, dist, a, u, N, col };
|
|
|
+ return {
|
|
|
+ segs: [["报警", "critical"], ["不可判", "unknown"], ["良好", "good"], ["优秀", "excellent"]].filter(([k]) => dist[k]).map(([k, cl]) => ({ col: cl, w: (dist[k] / N * 100).toFixed(1) })),
|
|
|
+ line: t("cmp.alarm_n", { a: `<b style="color:${col}">${a}</b>` }) + (u ? t("cmp.unk_n", { u }) : "") + t("cmp.fleet_n", { n: N }),
|
|
|
+ s,
|
|
|
+ dist,
|
|
|
+ a,
|
|
|
+ u,
|
|
|
+ N,
|
|
|
+ col
|
|
|
+ };
|
|
|
}));
|
|
|
function hitHtml(w) {
|
|
|
return (w.syss || []).map((x) => `<a href="/problem/${w.t}/${encodeURIComponent(sysFromSlug(x) || x)}">${sysName(x)}</a>`).join(" · ");
|
|
|
@@ -1301,13 +1310,10 @@ const _sfc_main$b = /* @__PURE__ */ defineComponent({
|
|
|
_push(`<section><div class="eyebrow">${ssrInterpolate(unref(t)("cmp.by_system"))}</div><div class="panel mb"><div style="${ssrRenderStyle({ "display": "grid", "grid-template-columns": "repeat(auto-fit,minmax(170px,1fr))", "gap": "10px" })}"><!--[-->`);
|
|
|
ssrRenderList(cards.value, (c) => {
|
|
|
_push(`<div class="sysc" role="button" tabindex="0"${ssrRenderAttr("data-sys", unref(sysSlug)(c.s))} style="${ssrRenderStyle(`cursor:pointer;border-left:3px solid ${c.col}`)}"><div class="t"><b>${ssrInterpolate(unref(sysName)(c.s))}</b></div><div class="bar"><!--[-->`);
|
|
|
- ssrRenderList([["报警", "critical"], ["不可判", "unknown"], ["良好", "good"], ["优秀", "excellent"]], ([k, col]) => {
|
|
|
- _push(`<i style="${ssrRenderStyle([
|
|
|
- `width:${(c.dist[k] / c.N * 100).toFixed(1)}%;background:var(--${col})`,
|
|
|
- c.dist[k] ? null : { display: "none" }
|
|
|
- ])}"></i>`);
|
|
|
+ ssrRenderList(c.segs, (sg) => {
|
|
|
+ _push(`<i style="${ssrRenderStyle(`width:${sg.w}%;background:var(--${sg.col})`)}"></i>`);
|
|
|
});
|
|
|
- _push(`<!--]--></div><div class="small muted"><span>${unref(t)("cmp.alarm_n", { a: `<b style="color:${c.col}">${c.a}</b>` }) ?? ""}</span>${ssrInterpolate((c.u ? unref(t)("cmp.unk_n", { u: c.u }) : "") + unref(t)("cmp.fleet_n", { n: c.N }))}</div></div>`);
|
|
|
+ _push(`<!--]--></div><div class="small muted">${c.line ?? ""}</div></div>`);
|
|
|
});
|
|
|
_push(`<!--]--></div><p class="small muted" style="${ssrRenderStyle({ "margin-top": "8px" })}">${ssrInterpolate(unref(t)("cmp.cards_note"))}</p></div></section>`);
|
|
|
if (__props.d.rel && __props.d.rel.err) {
|
|
|
@@ -2124,11 +2130,7 @@ const _sfc_main$9 = /* @__PURE__ */ defineComponent({
|
|
|
_push(ssrRenderComponent(_sfc_main$a, {
|
|
|
html: unref(chart)("blameBar", E.value)
|
|
|
}, null, _parent));
|
|
|
- _push(`<!--[-->`);
|
|
|
- ssrRenderList(blameGroups.value, (v, i) => {
|
|
|
- _push(`<div style="${ssrRenderStyle({ "display": "flex", "align-items": "baseline", "gap": "7px", "margin-top": "5px" })}"><i style="${ssrRenderStyle(`flex:none;width:9px;height:9px;border-radius:2px;background:${["var(--accent)", "var(--critical)", "var(--muted)"][i]};opacity:.55`)}"></i><span style="${ssrRenderStyle({ "font-weight": "600" })}">${ssrInterpolate(unref(t)(["ch.blame.n1", "ch.blame.n2", "ch.blame.n3"][i]))}</span><span class="num">${ssrInterpolate(unref(fmt)(Math.round(v)))} MWh</span><span class="small muted">${ssrInterpolate(unref(t)(["ch.blame.d1", "ch.blame.d2", "ch.blame.d3"][i]))}</span></div>`);
|
|
|
- });
|
|
|
- _push(`<!--]--><p class="small muted" style="${ssrRenderStyle({ "margin-top": "6px" })}">${ssrInterpolate(unref(t)("en.blame_note", { n: unref(fmt)(Math.round(((E.value.items || []).find((x) => x.k === "停机") || {}).loss || 0)) }))}</p></div><div class="panel"><h3>${ssrInterpolate(unref(t)("en.states"))} <span class="small muted" style="${ssrRenderStyle({ "font-weight": "400" })}">${ssrInterpolate(unref(t)("en.win", { win: unref(winName)(__props.d.win) }))}</span></h3><div class="tblwrap"><table><tr><th>${ssrInterpolate(unref(t)("en.state"))}</th><th>${ssrInterpolate(unref(t)("en.share"))}</th><th class="r" style="${ssrRenderStyle({ "width": "90px" })}">${ssrInterpolate(unref(t)("en.loss_mwh"))}</th></tr><!--[-->`);
|
|
|
+ _push(`<p class="small muted" style="${ssrRenderStyle({ "margin-top": "6px" })}">${ssrInterpolate(unref(t)("en.blame_note", { n: unref(fmt)(Math.round(((E.value.items || []).find((x) => x.k === "停机") || {}).loss || 0)) }))}</p></div><div class="panel"><h3>${ssrInterpolate(unref(t)("en.states"))} <span class="small muted" style="${ssrRenderStyle({ "font-weight": "400" })}">${ssrInterpolate(unref(t)("en.win", { win: unref(winName)(__props.d.win) }))}</span></h3><div class="tblwrap"><table><tr><th>${ssrInterpolate(unref(t)("en.state"))}</th><th>${ssrInterpolate(unref(t)("en.share"))}</th><th class="r" style="${ssrRenderStyle({ "width": "90px" })}">${ssrInterpolate(unref(t)("en.loss_mwh"))}</th></tr><!--[-->`);
|
|
|
ssrRenderList(S.value, (x) => {
|
|
|
_push(`<tr><td class="small">${ssrInterpolate(lossName(x.k))}</td><td><i class="bar" style="${ssrRenderStyle(`width:${Math.round(x.pct / mxp.value * 84)}px;background:${x.k.indexOf("停机") >= 0 && x.k.indexOf("调度") < 0 ? "var(--critical)" : "var(--accent)"}`)}"></i><span class="num small">${ssrInterpolate(x.pct)}% · ${ssrInterpolate(unref(fmt)(Math.round(x.h)))}h</span></td><td class="r small">${ssrInterpolate(unref(fmt)(Math.round(x.loss)))}</td></tr>`);
|
|
|
});
|
|
|
@@ -2208,9 +2210,9 @@ const _sfc_main$8 = /* @__PURE__ */ defineComponent({
|
|
|
const head = k80 ? `<b>${esc2(t("ch.pareto.key", { k: k80 }))}</b> (${esc2(total)})` : esc2(total);
|
|
|
return head + "<br>" + esc2(t("ch.pareto.top3")) + top3 + (note ? "<br>" + esc2(note) : "");
|
|
|
}
|
|
|
- const paretoNSummary = computed(() => paretoSummaryHtml(F.value.pareto_n || [], t("unit.n"), t("flt.pareto_n_note")));
|
|
|
- const paretoDSummary = computed(() => paretoSummaryHtml(F.value.pareto_d || [], " h", t("flt.pareto_d_note")));
|
|
|
- const stopParetoSummary = computed(() => paretoSummaryHtml(stopPareto.value, " h", t("flt.stop_pareto_note")));
|
|
|
+ computed(() => paretoSummaryHtml(F.value.pareto_n || [], t("unit.n"), t("flt.pareto_n_note")));
|
|
|
+ computed(() => paretoSummaryHtml(F.value.pareto_d || [], " h", t("flt.pareto_d_note")));
|
|
|
+ computed(() => paretoSummaryHtml(stopPareto.value, " h", t("flt.stop_pareto_note")));
|
|
|
computed(() => pareto(F.value.pareto_n || []));
|
|
|
computed(() => pareto(F.value.pareto_d || []));
|
|
|
function k80Of(items) {
|
|
|
@@ -2245,8 +2247,7 @@ const _sfc_main$8 = /* @__PURE__ */ defineComponent({
|
|
|
const pt = computed(() => F.value.per_t || []);
|
|
|
const maxT = computed(() => Math.max(1, ...pt.value.map((x) => x.v)));
|
|
|
const seasonal = computed(() => M.value && props.d?.m8?.seasonal ? props.d.m8.seasonal : []);
|
|
|
- const ML_COLS = ["var(--accent)", "#D48A1E", "#2E8B6A", "#7C5295"];
|
|
|
- const seasonalNames = computed(() => seasonal.value.slice(0, 4).map((x) => String(x.name).slice(0, 16)));
|
|
|
+ computed(() => seasonal.value.slice(0, 4).map((x) => String(x.name).slice(0, 16)));
|
|
|
computed(() => {
|
|
|
const s = seasonal.value.slice(0, 4);
|
|
|
const months = s.length ? s[0].months : [];
|
|
|
@@ -2301,7 +2302,8 @@ const _sfc_main$8 = /* @__PURE__ */ defineComponent({
|
|
|
const partPlain = (k) => partName(k);
|
|
|
const seasonalRaw = computed(() => ({
|
|
|
months: seasonal.value[0] && seasonal.value[0].months || [],
|
|
|
- series: seasonal.value.slice(0, 4).map((x) => ({ name: String(x.name), vals: x.vals }))
|
|
|
+ series: seasonal.value.slice(0, 4).map((x) => ({ name: String(x.name).slice(0, 16), vals: x.vals })),
|
|
|
+ xlab: t("flt.seasonal_x")
|
|
|
}));
|
|
|
const top = computed(() => M.value?.台级top || []);
|
|
|
const mxTop = computed(() => Math.max(1, ...top.value.map((x) => x.时长h)));
|
|
|
@@ -2320,11 +2322,11 @@ const _sfc_main$8 = /* @__PURE__ */ defineComponent({
|
|
|
_push(ssrRenderComponent(_sfc_main$a, {
|
|
|
html: unref(chart)("paretoChart", F.value.pareto_n || [], unref(t)("unit.n"), unref(t)("flt.pareto_n_note"))
|
|
|
}, null, _parent));
|
|
|
- _push(`<p class="small muted" style="${ssrRenderStyle({ "margin-top": "5px", "line-height": "1.6" })}">${paretoNSummary.value ?? ""}</p></div><div class="panel"><h3>${ssrInterpolate(unref(t)("flt.pareto_d"))}</h3>`);
|
|
|
+ _push(`</div><div class="panel"><h3>${ssrInterpolate(unref(t)("flt.pareto_d"))}</h3>`);
|
|
|
_push(ssrRenderComponent(_sfc_main$a, {
|
|
|
html: unref(chart)("paretoChart", F.value.pareto_d || [], " h", unref(t)("flt.pareto_d_note"))
|
|
|
}, null, _parent));
|
|
|
- _push(`<p class="small muted" style="${ssrRenderStyle({ "margin-top": "5px", "line-height": "1.6" })}">${paretoDSummary.value ?? ""}</p></div><div class="panel span2"><h3>${ssrInterpolate(unref(t)("flt.quad"))}</h3>`);
|
|
|
+ _push(`</div><div class="panel span2"><h3>${ssrInterpolate(unref(t)("flt.quad"))}</h3>`);
|
|
|
_push(ssrRenderComponent(_sfc_main$a, {
|
|
|
html: unref(chart)("quadChart", F.value.quad || [])
|
|
|
}, null, _parent));
|
|
|
@@ -2349,11 +2351,7 @@ const _sfc_main$8 = /* @__PURE__ */ defineComponent({
|
|
|
_push(ssrRenderComponent(_sfc_main$a, {
|
|
|
html: unref(chart)("multiline", seasonalRaw.value)
|
|
|
}, null, _parent));
|
|
|
- _push(`<div class="legend" style="${ssrRenderStyle({ "margin-top": "6px", "flex-wrap": "wrap" })}"><!--[-->`);
|
|
|
- ssrRenderList(seasonalNames.value, (nm, i) => {
|
|
|
- _push(`<span><i style="${ssrRenderStyle(`background:${ML_COLS[i % 4]}`)}"></i>${ssrInterpolate(nm)}</span>`);
|
|
|
- });
|
|
|
- _push(`<!--]--></div><p class="small muted" style="${ssrRenderStyle({ "margin-top": "6px" })}">${ssrInterpolate(unref(t)("flt.seasonal_note"))}</p></div>`);
|
|
|
+ _push(`<p class="small muted" style="${ssrRenderStyle({ "margin-top": "6px" })}">${ssrInterpolate(unref(t)("flt.seasonal_note"))}</p></div>`);
|
|
|
} else {
|
|
|
_push(`<!---->`);
|
|
|
}
|
|
|
@@ -2376,7 +2374,7 @@ const _sfc_main$8 = /* @__PURE__ */ defineComponent({
|
|
|
_push(ssrRenderComponent(_sfc_main$a, {
|
|
|
html: unref(chart)("paretoChart", stopPareto.value, " h", unref(t)("flt.stop_pareto_note"))
|
|
|
}, null, _parent));
|
|
|
- _push(`<p class="small muted" style="${ssrRenderStyle({ "margin-top": "5px", "line-height": "1.6" })}">${stopParetoSummary.value ?? ""}</p><p class="small muted" style="${ssrRenderStyle({ "margin-top": "4px" })}">${ssrInterpolate(M.value.口径)}</p></div><div class="panel"><h3>${ssrInterpolate(unref(t)("flt.stop_units", { n: top.value.length }))}</h3><div class="tblwrap"><table><tr><th style="${ssrRenderStyle({ "width": "64px" })}">${ssrInterpolate(unref(t)("ui.unit"))}</th><th>${ssrInterpolate(unref(t)("flt.stop_h"))}</th><th class="r" style="${ssrRenderStyle({ "width": "56px" })}">${ssrInterpolate(unref(t)("flt.stop_n"))}</th></tr><!--[-->`);
|
|
|
+ _push(`<p class="small muted" style="${ssrRenderStyle({ "margin-top": "4px" })}">${ssrInterpolate(M.value.口径)}</p></div><div class="panel"><h3>${ssrInterpolate(unref(t)("flt.stop_units", { n: top.value.length }))}</h3><div class="tblwrap"><table><tr><th style="${ssrRenderStyle({ "width": "64px" })}">${ssrInterpolate(unref(t)("ui.unit"))}</th><th>${ssrInterpolate(unref(t)("flt.stop_h"))}</th><th class="r" style="${ssrRenderStyle({ "width": "56px" })}">${ssrInterpolate(unref(t)("flt.stop_n"))}</th></tr><!--[-->`);
|
|
|
ssrRenderList(top.value, (x) => {
|
|
|
_push(`<tr><td><b>${ssrInterpolate(unref(unitNo)(x.t))}</b></td><td><i class="bar" style="${ssrRenderStyle(`width:${Math.round(x.时长h / mxTop.value * 90)}px;background:${x.时长h / mxTop.value > 0.6 ? "var(--critical)" : "var(--accent)"}`)}"></i><span class="num small">${ssrInterpolate(unref(fmt)(x.时长h))}</span>h</td><td class="r small">${ssrInterpolate(x.次)}</td></tr>`);
|
|
|
});
|
|
|
@@ -2553,7 +2551,7 @@ const _sfc_main$6 = /* @__PURE__ */ defineComponent({
|
|
|
ssrRenderList(figs.value, (f, i) => {
|
|
|
_push(`<div class="panel"><h3>${ssrInterpolate(unref(dv)(f.title || ""))}`);
|
|
|
if (f.unit) {
|
|
|
- _push(`<span><span class="small muted" style="${ssrRenderStyle({ "font-weight": "400" })}">(${ssrInterpolate(unref(dv)(f.unit))})</span></span>`);
|
|
|
+ _push(`<span class="small muted" style="${ssrRenderStyle({ "font-weight": "400" })}">(${ssrInterpolate(unref(dv)(f.unit))})</span>`);
|
|
|
} else {
|
|
|
_push(`<!---->`);
|
|
|
}
|
|
|
@@ -2561,11 +2559,6 @@ const _sfc_main$6 = /* @__PURE__ */ defineComponent({
|
|
|
_push(ssrRenderComponent(_sfc_main$a, {
|
|
|
html: unref(chart)("multiline", Object.assign({ zero: false }, f))
|
|
|
}, null, _parent));
|
|
|
- _push(`<div class="legend" style="${ssrRenderStyle({ "margin-top": "6px", "flex-wrap": "wrap" })}"><!--[-->`);
|
|
|
- ssrRenderList(f.series || [], (s, k) => {
|
|
|
- _push(`<span><i style="${ssrRenderStyle(`background:${["var(--accent)", "#D48A1E", "#2E8B6A", "#7C5295"][k % 4]}`)}"></i>${ssrInterpolate(String(s.name))}</span>`);
|
|
|
- });
|
|
|
- _push(`<!--]--></div>`);
|
|
|
if (f.note) {
|
|
|
_push(`<p class="small muted" style="${ssrRenderStyle({ "margin-top": "6px" })}">${ssrInterpolate(unref(dv)(f.note))}</p>`);
|
|
|
} else {
|