|
|
@@ -867,8 +867,8 @@ const TABS = [
|
|
|
"system"
|
|
|
];
|
|
|
const DONE = ["overview", "energy", "component", "fault"];
|
|
|
-const ST = { 危险: "bad", 报警: "warn", 不可判: "unk", 良好: "ok", 优秀: "ex" };
|
|
|
-const ST_ALIAS = {
|
|
|
+const ST$1 = { 危险: "bad", 报警: "warn", 不可判: "unk", 良好: "ok", 优秀: "ex" };
|
|
|
+const ST_ALIAS$1 = {
|
|
|
critical: "bad",
|
|
|
alarm: "warn",
|
|
|
undeterminable: "unk",
|
|
|
@@ -882,7 +882,7 @@ const ST_ALIAS = {
|
|
|
unk: "unk",
|
|
|
ex: "ex"
|
|
|
};
|
|
|
-const stateKey = (value) => ST[String(value)] || ST_ALIAS[String(value)];
|
|
|
+const stateKey$1 = (value) => ST$1[String(value)] || ST_ALIAS$1[String(value)];
|
|
|
const STEP = {
|
|
|
证据: "evidence",
|
|
|
机制: "mechanism",
|
|
|
@@ -891,7 +891,7 @@ const STEP = {
|
|
|
动作: "action",
|
|
|
验收: "acceptance"
|
|
|
};
|
|
|
-const stKey = (k) => "st." + (k === "ex" ? "excellent" : k);
|
|
|
+const stKey$1 = (k) => "st." + (k === "ex" ? "excellent" : k);
|
|
|
const unitNo = (wtg) => String(wtg).replace("WTG", "").replace(/^0/, "") + "#";
|
|
|
const fmt = (n, d = 0) => {
|
|
|
if (n == null || typeof n === "number" && isNaN(n)) return "—";
|
|
|
@@ -899,13 +899,13 @@ const fmt = (n, d = 0) => {
|
|
|
if (isNaN(num)) return "—";
|
|
|
return num.toLocaleString("zh-CN", { maximumFractionDigits: d, minimumFractionDigits: d });
|
|
|
};
|
|
|
-const stWord = (zh) => {
|
|
|
- const k = stateKey(zh);
|
|
|
- return k ? t(stKey(k)) : String(zh ?? "");
|
|
|
+const stWord$1 = (zh) => {
|
|
|
+ const k = stateKey$1(zh);
|
|
|
+ return k ? t(stKey$1(k)) : String(zh ?? "");
|
|
|
};
|
|
|
const COLS = ["振动", "温度", "润滑", "油液", "报警", "工单"];
|
|
|
function unitState(row) {
|
|
|
- const ks = COLS.map((c) => stateKey((row?.[c] || {}).ostate)).filter(Boolean);
|
|
|
+ const ks = COLS.map((c) => stateKey$1((row?.[c] || {}).ostate)).filter(Boolean);
|
|
|
if (!ks.length) return "unk";
|
|
|
if (ks.includes("bad")) return "bad";
|
|
|
if (ks.includes("warn")) return "warn";
|
|
|
@@ -948,7 +948,7 @@ const sysName = (value) => {
|
|
|
return SYS_ZH[key] ? t("sys." + key) : String(value ?? "");
|
|
|
};
|
|
|
const partName = (p) => sysName(p);
|
|
|
-const _sfc_main$5 = /* @__PURE__ */ defineComponent({
|
|
|
+const _sfc_main$6 = /* @__PURE__ */ defineComponent({
|
|
|
__name: "Component",
|
|
|
__ssrInlineRender: true,
|
|
|
props: {
|
|
|
@@ -1083,13 +1083,13 @@ const _sfc_main$5 = /* @__PURE__ */ defineComponent({
|
|
|
};
|
|
|
}
|
|
|
});
|
|
|
-const _sfc_setup$5 = _sfc_main$5.setup;
|
|
|
-_sfc_main$5.setup = (props, ctx) => {
|
|
|
+const _sfc_setup$6 = _sfc_main$6.setup;
|
|
|
+_sfc_main$6.setup = (props, ctx) => {
|
|
|
const ssrContext = useSSRContext();
|
|
|
(ssrContext.modules || (ssrContext.modules = /* @__PURE__ */ new Set())).add("src/views/Component.vue");
|
|
|
- return _sfc_setup$5 ? _sfc_setup$5(props, ctx) : void 0;
|
|
|
+ return _sfc_setup$6 ? _sfc_setup$6(props, ctx) : void 0;
|
|
|
};
|
|
|
-const _sfc_main$4 = /* @__PURE__ */ defineComponent({
|
|
|
+const _sfc_main$5 = /* @__PURE__ */ defineComponent({
|
|
|
__name: "EChart",
|
|
|
__ssrInlineRender: true,
|
|
|
props: {
|
|
|
@@ -1132,14 +1132,14 @@ const _export_sfc = (sfc, props) => {
|
|
|
}
|
|
|
return target;
|
|
|
};
|
|
|
-const _sfc_setup$4 = _sfc_main$4.setup;
|
|
|
-_sfc_main$4.setup = (props, ctx) => {
|
|
|
+const _sfc_setup$5 = _sfc_main$5.setup;
|
|
|
+_sfc_main$5.setup = (props, ctx) => {
|
|
|
const ssrContext = useSSRContext();
|
|
|
(ssrContext.modules || (ssrContext.modules = /* @__PURE__ */ new Set())).add("src/components/EChart.vue");
|
|
|
- return _sfc_setup$4 ? _sfc_setup$4(props, ctx) : void 0;
|
|
|
+ return _sfc_setup$5 ? _sfc_setup$5(props, ctx) : void 0;
|
|
|
};
|
|
|
-const EChart = /* @__PURE__ */ _export_sfc(_sfc_main$4, [["__scopeId", "data-v-999bee15"]]);
|
|
|
-const _sfc_main$3 = /* @__PURE__ */ defineComponent({
|
|
|
+const EChart = /* @__PURE__ */ _export_sfc(_sfc_main$5, [["__scopeId", "data-v-999bee15"]]);
|
|
|
+const _sfc_main$4 = /* @__PURE__ */ defineComponent({
|
|
|
__name: "Energy",
|
|
|
__ssrInlineRender: true,
|
|
|
props: {
|
|
|
@@ -1249,13 +1249,13 @@ const _sfc_main$3 = /* @__PURE__ */ defineComponent({
|
|
|
};
|
|
|
}
|
|
|
});
|
|
|
-const _sfc_setup$3 = _sfc_main$3.setup;
|
|
|
-_sfc_main$3.setup = (props, ctx) => {
|
|
|
+const _sfc_setup$4 = _sfc_main$4.setup;
|
|
|
+_sfc_main$4.setup = (props, ctx) => {
|
|
|
const ssrContext = useSSRContext();
|
|
|
(ssrContext.modules || (ssrContext.modules = /* @__PURE__ */ new Set())).add("src/views/Energy.vue");
|
|
|
- return _sfc_setup$3 ? _sfc_setup$3(props, ctx) : void 0;
|
|
|
+ return _sfc_setup$4 ? _sfc_setup$4(props, ctx) : void 0;
|
|
|
};
|
|
|
-const _sfc_main$2 = /* @__PURE__ */ defineComponent({
|
|
|
+const _sfc_main$3 = /* @__PURE__ */ defineComponent({
|
|
|
__name: "Fault",
|
|
|
__ssrInlineRender: true,
|
|
|
props: {
|
|
|
@@ -1304,10 +1304,10 @@ const _sfc_main$2 = /* @__PURE__ */ defineComponent({
|
|
|
const m = String(k).match(/^([0-9]+)/);
|
|
|
return m ? m[1] : String(k).slice(0, 4);
|
|
|
};
|
|
|
- const esc = (s) => String(s ?? "").replace(/&/g, "&").replace(/</g, "<").replace(/>/g, ">").replace(/"/g, """);
|
|
|
+ const esc2 = (s) => String(s ?? "").replace(/&/g, "&").replace(/</g, "<").replace(/>/g, ">").replace(/"/g, """);
|
|
|
function paretoSummaryHtml(items, unit, note) {
|
|
|
const it = (items || []).filter((x) => x && x.v > 0);
|
|
|
- if (!it.length) return esc(t("ch.pareto.none"));
|
|
|
+ if (!it.length) return esc2(t("ch.pareto.none"));
|
|
|
const tot = it.reduce((a, x) => a + x.v, 0);
|
|
|
let cum = 0;
|
|
|
let k80 = null;
|
|
|
@@ -1315,10 +1315,10 @@ const _sfc_main$2 = /* @__PURE__ */ defineComponent({
|
|
|
cum += it[i].v;
|
|
|
if (k80 === null && tot && cum / tot >= 0.8) k80 = i + 1;
|
|
|
}
|
|
|
- const top3 = it.slice(0, 3).map((x) => `<b>${esc(shortK(x.k))}</b> ${esc(String(x.k).replace(/^[0-9]+ */, "").slice(0, 18))}`).join(" · ");
|
|
|
+ const top3 = it.slice(0, 3).map((x) => `<b>${esc2(shortK(x.k))}</b> ${esc2(String(x.k).replace(/^[0-9]+ */, "").slice(0, 18))}`).join(" · ");
|
|
|
const total = t("ch.pareto.total", { n: it.length, tot: fmt(Math.round(tot)), unit });
|
|
|
- const head = k80 ? `<b>${esc(t("ch.pareto.key", { k: k80 }))}</b> (${esc(total)})` : esc(total);
|
|
|
- return head + "<br>" + esc(t("ch.pareto.top3")) + top3 + (note ? "<br>" + esc(note) : "");
|
|
|
+ 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")));
|
|
|
@@ -1503,10 +1503,209 @@ const _sfc_main$2 = /* @__PURE__ */ defineComponent({
|
|
|
};
|
|
|
}
|
|
|
});
|
|
|
+const _sfc_setup$3 = _sfc_main$3.setup;
|
|
|
+_sfc_main$3.setup = (props, ctx) => {
|
|
|
+ const ssrContext = useSSRContext();
|
|
|
+ (ssrContext.modules || (ssrContext.modules = /* @__PURE__ */ new Set())).add("src/views/Fault.vue");
|
|
|
+ return _sfc_setup$3 ? _sfc_setup$3(props, ctx) : void 0;
|
|
|
+};
|
|
|
+const VIBJARGON = [
|
|
|
+ [/DE[/]NDE/g, "驱动端与非驱动端"],
|
|
|
+ [/GenDE/g, "发电机驱动端"],
|
|
|
+ [/GenNDE/g, "发电机非驱动端"],
|
|
|
+ [/HS_gen2?/g, "高速轴发电机侧"],
|
|
|
+ [/HS_rot/g, "高速轴转子侧"],
|
|
|
+ [/IMS/g, "中间轴"],
|
|
|
+ [/(?<![A-Za-z])NDE(?![A-Za-z])/g, "非驱动端"],
|
|
|
+ [/(?<![A-Za-z])DE(?![A-Za-z])/g, "驱动端"],
|
|
|
+ [/内圈BPFI/g, "内圈特征频率"],
|
|
|
+ [/外圈BPFO/g, "外圈特征频率"],
|
|
|
+ [/BPFI/g, "内圈特征频率"],
|
|
|
+ [/BPFO/g, "外圈特征频率"],
|
|
|
+ [/FTF/g, "保持架特征频率"],
|
|
|
+ [/BSF/g, "滚动体特征频率"],
|
|
|
+ [/TD_1R/g, "时域单转指标"],
|
|
|
+ [/Peak/g, "冲击峰值"],
|
|
|
+ [/Rms/gi, "有效值"],
|
|
|
+ [/([0-9]+(?:[.][0-9]+)?)[ ]*阶/g, "$1 倍轴频"],
|
|
|
+ [/[(]o([0-9]+(?:[.][0-9]+)?)[)]/g, "(轴频 $1 倍)"],
|
|
|
+ [/×p90/g, "×全场90分位"],
|
|
|
+ [/×fleet/g, "×全场中位"],
|
|
|
+ [/六窗/g, "六个观测窗"],
|
|
|
+ [/([0-9])窗/g, "$1 个观测窗"],
|
|
|
+ [/宽带/g, "宽频带总量"],
|
|
|
+ [/台阶/g, "阶跃上升"],
|
|
|
+ [/缓升/g, "缓慢上升"],
|
|
|
+ [/回落/g, "回落至"],
|
|
|
+ [/全净|六窗全净/g, "各窗均干净"],
|
|
|
+ [/清洁/g, "干净"],
|
|
|
+ [/回归/g, "回到常态"],
|
|
|
+ [/同族/g, "同批次共性 (见该批主台)"],
|
|
|
+ [/族第([^ ]+)台/g, "同批次第$1台"],
|
|
|
+ [/族/g, "批次共性组"],
|
|
|
+ [/gain异常/g, "测点增益异常"],
|
|
|
+ [/gain/g, "测点增益"],
|
|
|
+ [/[(]销[)]/g, "(已销案)"],
|
|
|
+ [/梯度/g, "沿链梯度最高点"],
|
|
|
+ [/周期主导/g, "周期成分主导"],
|
|
|
+ [/急性事件/g, "突发事件"],
|
|
|
+ [/慢性/g, "长期"],
|
|
|
+ [/主异常在/g, "主要异常位于"]
|
|
|
+];
|
|
|
+const esc = (s) => String(s == null ? "" : s).replace(/&/g, "&").replace(/</g, "<").replace(/>/g, ">").replace(/"/g, """);
|
|
|
+const dv = (s) => esc(s);
|
|
|
+const ST = { 危险: "bad", 报警: "warn", 不可判: "unk", 良好: "ok", 优秀: "ex" };
|
|
|
+const ST_ALIAS = {
|
|
|
+ critical: "bad",
|
|
|
+ alarm: "warn",
|
|
|
+ undeterminable: "unk",
|
|
|
+ indeterminate: "unk",
|
|
|
+ "not evaluable": "unk",
|
|
|
+ good: "ok",
|
|
|
+ excellent: "ex",
|
|
|
+ warn: "warn",
|
|
|
+ bad: "bad",
|
|
|
+ ok: "ok",
|
|
|
+ unk: "unk",
|
|
|
+ ex: "ex"
|
|
|
+};
|
|
|
+const stateKey = (v) => ST[String(v)] || ST_ALIAS[String(v)];
|
|
|
+const STC = { bad: "var(--critical)", warn: "var(--warning)", unk: "var(--unknown)", ok: "var(--good)", ex: "var(--excellent)" };
|
|
|
+const CST = { 优秀: "var(--excellent)", 良好: "var(--good)", 报警: "var(--warning)", 危险: "var(--critical)", 不可判: "var(--unknown)", 监测不可用: "var(--unknown)", 无监测: "var(--unknown)" };
|
|
|
+const CLV = { bad: "var(--critical)", warn: "var(--warning)", note: "var(--muted)", ok: "var(--good)", unlisted: "var(--muted)", stale: "var(--muted)", meta: "var(--muted)" };
|
|
|
+const TIER = {
|
|
|
+ 定论: "confirmed",
|
|
|
+ "准定论·预警": "near",
|
|
|
+ "候选·新发": "candidate_new",
|
|
|
+ 候选: "candidate",
|
|
|
+ "候选·记基线": "candidate_baseline",
|
|
|
+ 参考: "reference",
|
|
|
+ INSUFFICIENT: "insufficient",
|
|
|
+ 正常: "normal",
|
|
|
+ 撤回: "withdrawn"
|
|
|
+};
|
|
|
+const stKey = (k) => "st." + (k === "ex" ? "excellent" : k);
|
|
|
+const stWord = (zh) => {
|
|
|
+ const k = stateKey(zh);
|
|
|
+ return k ? t(stKey(k)) : dv(zh);
|
|
|
+};
|
|
|
+const tierWord = (zh) => {
|
|
|
+ const k = TIER[String(zh)];
|
|
|
+ const key = "tier." + k;
|
|
|
+ return k ? t(key) : String(zh) === "—" ? "—" : dv(zh);
|
|
|
+};
|
|
|
+const duo = (st, ev, col) => `<span class="duo" style="--c:${col}"><span class="st">${st}</span><span class="ev">${ev}</span></span>`;
|
|
|
+const vibPlain = (x) => {
|
|
|
+ let s = String(x == null ? "" : x);
|
|
|
+ for (const [a, b] of VIBJARGON) s = s.replace(a, b);
|
|
|
+ return s;
|
|
|
+};
|
|
|
+const attrPlain = (x) => vibPlain(x);
|
|
|
+const spark = (hist, color) => {
|
|
|
+ if (!hist || hist.filter((x) => x != null).length < 3) return "";
|
|
|
+ const vs = hist.filter((x) => x != null);
|
|
|
+ const mn = Math.min(...vs), mx = Math.max(...vs), sp = mx - mn || 1;
|
|
|
+ const W = 84, H = 22, n = hist.length;
|
|
|
+ let d = "", last = null;
|
|
|
+ hist.forEach((v, i) => {
|
|
|
+ if (v == null) return;
|
|
|
+ const x = i / (n - 1) * W, y = H - 2 - (v - mn) / sp * (H - 4);
|
|
|
+ d += (d ? "L" : "M") + x.toFixed(1) + " " + y.toFixed(1);
|
|
|
+ last = [x, y];
|
|
|
+ });
|
|
|
+ return `<svg width="${W}" height="${H}" style="vertical-align:middle;margin-left:6px"><path d="${d}" fill="none" stroke="${color}" stroke-width="1.2" opacity=".75"/><circle cx="${last[0]}" cy="${last[1]}" r="2.4" fill="${color}"/></svg>`;
|
|
|
+};
|
|
|
+const FAMCO = { 齿轮箱: "#8A6D3B", 发电机: "#4A6FA5", 主轴承: "#2E7D6B", 变桨叶片: "#4A6FA5", 偏航: "#2E7D6B", 测风: "#7C5295", 其他: "#5A6470" };
|
|
|
+const famBar = (fam, n, maxN) => {
|
|
|
+ if (!n) return `<span class="small muted">${t("fus.no_alarm")}</span>`;
|
|
|
+ const W = 118, w = Math.max(6, Math.round(n / Math.max(maxN || n, 1) * W));
|
|
|
+ return `<div title="${esc(t("fus.fam_tip", { n, m: maxN || n }))}" style="display:flex;height:9px;border-radius:3px;overflow:hidden;width:${w}px">${(fam || []).map((f) => `<i title="${esc(sysName(f.k))} ${f.n}" style="width:${(f.n / n * 100).toFixed(1)}%;background:${FAMCO[f.k] || "#5A6470"}"></i>`).join("")}</div><div class="small muted" style="margin-top:3px">${(fam || []).slice(0, 2).map((f) => sysName(f.k) + " " + f.n).join(" · ")}</div>`;
|
|
|
+};
|
|
|
+function matrixHtml(F) {
|
|
|
+ const months = (F.列窗 || {}).months || [];
|
|
|
+ let h = `<div class="panel mb" style="border-left:3px solid var(--warning)"><b>${t("fus.rules_head")}</b><p class="small" style="margin-top:4px">${t("fus.rule1")}<br>${t("fus.rule2")}</p></div>`;
|
|
|
+ h += `<div class="panel mb"><h3>${t("fus.matrix_head")}</h3><p class="small muted">${t("fus.matrix_note1")}</p><p class="small">${t("fus.matrix_note2", { n: months.length, m0: months[0] || "?" })}</p>
|
|
|
+ <div class="small muted" style="margin:6px 0 12px;line-height:2"><div><b>${t("fus.legend_state")}</b> ${["bad", "warn", "ok", "ex", "unk"].map((k) => `<span style="display:inline-flex;align-items:center;gap:4px;margin-right:12px"><i style="width:10px;height:10px;border-radius:2px;background:${STC[k]}"></i>${t(stKey(k))}</span>`).join("")}</div>
|
|
|
+ <div><b>${t("fus.legend_tier")}</b> ${["定论", "准定论·预警", "候选·新发", "候选", "候选·记基线", "参考", "INSUFFICIENT"].map((k) => `<span style="display:inline-flex;align-items:center;gap:4px;margin-right:12px"><i style="width:10px;height:10px;border-radius:2px;background:${(F.色标 || {})[k] || "#ccc"}"></i>${tierWord(k)}</span>`).join("")}</div><div>${t("fus.legend_note")}</div></div>`;
|
|
|
+ const shortWin = (w) => {
|
|
|
+ const s = String(w || "");
|
|
|
+ const m = s.match(/20[0-9][0-9]-[0-9][0-9](?:~20[0-9][0-9]-[0-9][0-9])?|至[ ]*20[0-9][0-9]-[0-9][0-9]|20[0-9][0-9]~20[0-9][0-9]/);
|
|
|
+ return m ? m[0].startsWith("至") ? t("win.through", { date: m[0].replace(/^至\s*/, "") }) : m[0] : s.slice(0, 14);
|
|
|
+ };
|
|
|
+ const th = (name, win, extra) => `<th title="${esc(win || "")}${extra || ""}"><div>${name}</div><div class="small muted" style="font-weight:400">${dv(shortWin(win))}${extra || ""}</div></th>`;
|
|
|
+ const LW = F.列窗 || {};
|
|
|
+ h += `<div class="tblwrap"><table class="fmx" style="table-layout:fixed;width:100%;min-width:900px"><colgroup><col style="width:7%">${'<col style="width:15.5%">'.repeat(6)}</colgroup><tr><th>${t("ui.unit")}</th>${th(t("fus.col.vib"), LW.振动, t("fus.col.fixed"))}${th(t("fus.col.temp"), LW.温度)}${th(t("fus.col.lub"), LW.润滑, t("fus.col.display_only"))}${th(t("fus.col.oil"), LW.油液)}${th(t("fus.col.alarm"), LW.报警)}${th(t("fus.col.wo"), LW.工单)}</tr>`;
|
|
|
+ const mat = F.矩阵 || [];
|
|
|
+ const MAXAL = Math.max(1, ...mat.map((r) => (r.报警 || {}).n || 0));
|
|
|
+ const MAXWO = Math.max(1, ...mat.map((r) => (r.工单 || {}).n || 0));
|
|
|
+ const WC = F.色标 || {};
|
|
|
+ const shortOf = (c) => {
|
|
|
+ if (c.ostate && c.ostate !== "不可判") return stWord(c.ostate);
|
|
|
+ const n = String(c.note || "");
|
|
|
+ if (/数据不足|不可判|nsufficient/.test(n)) return t("fus.short.nodata");
|
|
|
+ if (/未评估|ot assessed/.test(n)) return t("fus.short.uneval");
|
|
|
+ if (/无样|未取样|o sample/.test(n)) return t("fus.short.nosample");
|
|
|
+ if (/样龄|stale/.test(n)) return t("fus.short.stale");
|
|
|
+ const m = { ok: t("fus.short.normal"), unlisted: t("fus.short.unlisted"), stale: t("fus.short.stale") };
|
|
|
+ return m[c.level] || "—";
|
|
|
+ };
|
|
|
+ const cell = (c0) => {
|
|
|
+ const c = c0 || {};
|
|
|
+ const col = CST[c.ostate] || WC[c.wlevel] || CLV[c.level] || "var(--muted)";
|
|
|
+ const full = vibPlain(c.note);
|
|
|
+ const isProb = ["bad", "warn", "note"].includes(c.level);
|
|
|
+ const tip = esc(full) + t("fus.tip_state", { s: stWord(c.ostate || "?") });
|
|
|
+ if (!isProb) return `<td class="small" title="${tip}" style="border-left:3px solid ${col};color:var(--muted)">${shortOf(c)}</td>`;
|
|
|
+ const parts = full.split(/[::]/);
|
|
|
+ const brief = (parts.length > 1 ? parts.slice(1).join(":") : full).trim();
|
|
|
+ const cleanBrief = /^[ ]*(评估报告|两口径差异|⚠|ssessment)/.test(brief) || brief.length > 16 ? "" : brief;
|
|
|
+ const shortCut = cleanBrief ? dv(cleanBrief) : c.ostate && c.ostate !== "不可判" ? "" : shortOf(c);
|
|
|
+ const ev = c.wlevel && c.wlevel !== "—" && c.wlevel !== "正常" && c.ostate ? duo(stWord(c.ostate), tierWord(c.wlevel), col) : "";
|
|
|
+ return `<td class="small" title="${tip}${t("fus.tip_tier", { e: tierWord(c.wlevel || "?") })}" style="border-left:3px solid ${col};overflow:hidden"><div><div style="color:${col};font-weight:${["bad", "warn"].includes(c.level) ? 600 : 400}">${shortCut}</div>${ev}</div>${spark(c.hist, c.level === "bad" ? "var(--critical)" : c.level === "warn" ? "var(--warning)" : "var(--muted)")}</td>`;
|
|
|
+ };
|
|
|
+ mat.forEach((r) => {
|
|
|
+ const al = r.报警 || { n: 0, fam: [] }, wo = r.工单 || { n: 0, acts: [] };
|
|
|
+ const alc = al.rank && al.rank <= 5 ? "var(--warning)" : "var(--line)";
|
|
|
+ const bu = al.burst;
|
|
|
+ const altip = esc((al.items || []).map((x) => `${x.code} ${vibPlain(x.text)} — ${x.n} (${x.first}~${x.last})`).join("\n")) + (bu ? "\n" + esc(t("fus.burst_tip", { c: bu.code, p: (bu.share * 100).toFixed(0), m: bu.med_s })) : "");
|
|
|
+ h += `<tr><td><a href="/turbine/${r.turbine}"><b>${unitNo(r.turbine)}</b></a></td>${cell(r.振动)}${cell(r.温度)}${cell(r.润滑)}${cell(r.油液)}
|
|
|
+ <td title="${altip}" style="border-left:3px solid ${bu ? "var(--unknown)" : alc}"><b class="small num" style="color:${al.rank && al.rank <= 10 ? "var(--ink)" : "var(--muted)"}">${t("fus.alarm_n", { n: al.n })}</b>${al.rank ? `<span class="small muted">${t("fus.alarm_rank", { r: al.rank, t: al.tot })}</span>` : ""}${bu ? `<div class="small" style="color:var(--unknown)">${t("fus.burst", { p: (bu.share * 100).toFixed(0), c: bu.code })}</div>` : ""}${al.rank && al.rank <= 10 || bu ? famBar(al.fam, al.n, MAXAL) : ""}</td>
|
|
|
+ <td title="${esc((wo.items || []).map((x) => `${x.date} ${attrPlain(x.name)} → ${attrPlain(x.act)}${x.part ? " " + attrPlain(x.part) : ""}`).join("\n") || t("fus.wo_none"))}" style="min-width:110px">${wo.n ? `<b class="small">${t("fus.wo_n", { n: wo.n })}</b>${wo.last ? `<span class="small muted"> · ${esc(wo.last)}</span>` : ""}<div style="height:7px;border-radius:3px;background:var(--muted);opacity:.5;margin-top:4px;width:${Math.max(6, Math.round(wo.n / MAXWO * 90))}px"></div><div class="small muted" style="margin-top:3px">${(wo.acts || []).slice(0, 2).map((a) => dv(a.k) + "×" + a.n).join(" · ")}</div>` : `<span class="small muted">—</span>`}</td></tr>`;
|
|
|
+ });
|
|
|
+ return h + `</table></div><p class="small muted" style="margin-top:8px">${t("fus.matrix_foot")}</p></div>`;
|
|
|
+}
|
|
|
+const FUS_SUBS = ["matrix", "loop", "units", "events", "cms"];
|
|
|
+const _sfc_main$2 = /* @__PURE__ */ defineComponent({
|
|
|
+ __name: "Vibration",
|
|
|
+ __ssrInlineRender: true,
|
|
|
+ props: {
|
|
|
+ d: {},
|
|
|
+ sub: {}
|
|
|
+ },
|
|
|
+ emits: ["sub"],
|
|
|
+ setup(__props, { emit: __emit }) {
|
|
|
+ const props = __props;
|
|
|
+ const sub = computed(() => props.sub || "matrix");
|
|
|
+ const F = computed(() => props.d?.fus);
|
|
|
+ const bodyHtml = computed(() => {
|
|
|
+ const f = F.value;
|
|
|
+ if (!f || f.err) return `<section><div class="panel"><p>${t("fus.unavailable", { e: String(f && f.err || "") })}</p></div></section>`;
|
|
|
+ if (sub.value === "matrix") return matrixHtml(f);
|
|
|
+ return `<div class="panel mb"><p class="small muted">子视图「${t("fus.sub." + sub.value)}」尚未迁移到 Vue(迁移中)。</p></div>`;
|
|
|
+ });
|
|
|
+ return (_ctx, _push, _parent, _attrs) => {
|
|
|
+ _push(`<section${ssrRenderAttrs(_attrs)}><div class="eyebrow">${ssrInterpolate(unref(t)("fus.eyebrow"))}</div><div style="${ssrRenderStyle({ "display": "flex", "gap": "8px", "margin-bottom": "14px", "flex-wrap": "wrap" })}"><!--[-->`);
|
|
|
+ ssrRenderList(unref(FUS_SUBS), (s) => {
|
|
|
+ _push(`<button class="${ssrRenderClass([{ on: s === sub.value }, "pill"])}"${ssrRenderAttr("data-fsub", s)}>${ssrInterpolate(unref(t)("fus.sub." + s))}</button>`);
|
|
|
+ });
|
|
|
+ _push(`<!--]--></div><div>${bodyHtml.value ?? ""}</div></section>`);
|
|
|
+ };
|
|
|
+ }
|
|
|
+});
|
|
|
const _sfc_setup$2 = _sfc_main$2.setup;
|
|
|
_sfc_main$2.setup = (props, ctx) => {
|
|
|
const ssrContext = useSSRContext();
|
|
|
- (ssrContext.modules || (ssrContext.modules = /* @__PURE__ */ new Set())).add("src/views/Fault.vue");
|
|
|
+ (ssrContext.modules || (ssrContext.modules = /* @__PURE__ */ new Set())).add("src/views/Vibration.vue");
|
|
|
return _sfc_setup$2 ? _sfc_setup$2(props, ctx) : void 0;
|
|
|
};
|
|
|
const _sfc_main$1 = /* @__PURE__ */ defineComponent({
|
|
|
@@ -1606,9 +1805,9 @@ const _sfc_main$1 = /* @__PURE__ */ defineComponent({
|
|
|
}
|
|
|
_push(`<div class="cards"><!--[-->`);
|
|
|
ssrRenderList(rows.value, (r) => {
|
|
|
- _push(`<div class="card"${ssrRenderAttr("id", `u-${r.t}`)} style="${ssrRenderStyle(`--sev:var(--${unref(SEV)[unref(stateKey)(r.ostate) || (r.lvl === "bad" ? "bad" : "warn")]})`)}"><div class="head"><a class="unit"${ssrRenderAttr("href", `/turbine/${r.t}`)}>${ssrInterpolate(unref(unitNo)(r.t))}</a><span class="sys">${ssrInterpolate(r.part || "")}</span><span class="${ssrRenderClass([unref(stateKey)(r.ostate) || (r.lvl === "bad" ? "bad" : "warn"), "chip"])}">${ssrInterpolate(unref(stWord)(r.ostate || (r.lvl === "bad" ? "危险" : "报警")))}</span></div><details class="evidence-detail"><summary>${ssrInterpolate(unref(t)("ov.evidence"))}</summary><div class="why">${ssrInterpolate(basis(r))}</div></details><div class="evid">`);
|
|
|
+ _push(`<div class="card"${ssrRenderAttr("id", `u-${r.t}`)} style="${ssrRenderStyle(`--sev:var(--${unref(SEV)[unref(stateKey$1)(r.ostate) || (r.lvl === "bad" ? "bad" : "warn")]})`)}"><div class="head"><a class="unit"${ssrRenderAttr("href", `/turbine/${r.t}`)}>${ssrInterpolate(unref(unitNo)(r.t))}</a><span class="sys">${ssrInterpolate(r.part || "")}</span><span class="${ssrRenderClass([unref(stateKey$1)(r.ostate) || (r.lvl === "bad" ? "bad" : "warn"), "chip"])}">${ssrInterpolate(unref(stWord$1)(r.ostate || (r.lvl === "bad" ? "危险" : "报警")))}</span></div><details class="evidence-detail"><summary>${ssrInterpolate(unref(t)("ov.evidence"))}</summary><div class="why">${ssrInterpolate(basis(r))}</div></details><div class="evid">`);
|
|
|
if (r.estate) {
|
|
|
- _push(`<span class="${ssrRenderClass([r.estate, "tier"])}">${ssrInterpolate(unref(stWord)(r.estate))}</span>`);
|
|
|
+ _push(`<span class="${ssrRenderClass([r.estate, "tier"])}">${ssrInterpolate(unref(stWord$1)(r.estate))}</span>`);
|
|
|
} else {
|
|
|
_push(`<!---->`);
|
|
|
}
|
|
|
@@ -1627,13 +1826,13 @@ const _sfc_main$1 = /* @__PURE__ */ defineComponent({
|
|
|
});
|
|
|
_push(`<!--]--></div></section><section><div class="sechead"><h2>${ssrInterpolate(unref(t)("ov.strip"))}</h2><span class="meta">${ssrInterpolate(unref(t)("ov.strip_hint"))}</span><div class="legend"><!--[-->`);
|
|
|
ssrRenderList(["bad", "warn", "unk", "ok", "ex"], (k) => {
|
|
|
- _push(`<span><i style="${ssrRenderStyle(`background:var(--${unref(SEV)[k]})`)}"></i>${ssrInterpolate(unref(t)(unref(stKey)(k)))}</span>`);
|
|
|
+ _push(`<span><i style="${ssrRenderStyle(`background:var(--${unref(SEV)[k]})`)}"></i>${ssrInterpolate(unref(t)(unref(stKey$1)(k)))}</span>`);
|
|
|
});
|
|
|
_push(`<!--]--></div></div><div class="strip" style="${ssrRenderStyle(`--n:${mat.value.length || 38}`)}"><div class="cells">`);
|
|
|
if (mat.value.length) {
|
|
|
_push(`<!--[-->`);
|
|
|
ssrRenderList(mat.value, (r) => {
|
|
|
- _push(`<div class="${ssrRenderClass([[unref(unitState)(r), hot.value.has(r.turbine) ? "hot" : ""], "cell"])}"${ssrRenderAttr("data-u", r.turbine)}${ssrRenderAttr("title", `${unref(unitNo)(r.turbine)} ${unref(t)(unref(stKey)(unref(unitState)(r)))}`)}></div>`);
|
|
|
+ _push(`<div class="${ssrRenderClass([[unref(unitState)(r), hot.value.has(r.turbine) ? "hot" : ""], "cell"])}"${ssrRenderAttr("data-u", r.turbine)}${ssrRenderAttr("title", `${unref(unitNo)(r.turbine)} ${unref(t)(unref(stKey$1)(unref(unitState)(r)))}`)}></div>`);
|
|
|
});
|
|
|
_push(`<!--]-->`);
|
|
|
} else {
|
|
|
@@ -1674,35 +1873,42 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
sys: {},
|
|
|
sub: {}
|
|
|
},
|
|
|
- emits: ["tab"],
|
|
|
+ emits: ["tab", "sub"],
|
|
|
setup(__props, { emit: __emit }) {
|
|
|
const props = __props;
|
|
|
+ const emit = __emit;
|
|
|
const pending = computed(() => !DONE.includes(props.tab));
|
|
|
return (_ctx, _push, _parent, _attrs) => {
|
|
|
- _push(`<!--[--><nav class="wb-tabs" data-v-9b63d247><!--[-->`);
|
|
|
+ _push(`<!--[--><nav class="wb-tabs" data-v-3d118848><!--[-->`);
|
|
|
ssrRenderList(unref(TABS), (id) => {
|
|
|
- _push(`<button class="${ssrRenderClass({ on: id === __props.tab })}" data-v-9b63d247>${ssrInterpolate(unref(t)("tab." + id))}`);
|
|
|
+ _push(`<button class="${ssrRenderClass({ on: id === __props.tab })}" data-v-3d118848>${ssrInterpolate(unref(t)("tab." + id))}`);
|
|
|
if (!unref(DONE).includes(id)) {
|
|
|
- _push(`<sup class="todo" data-v-9b63d247>迁移中</sup>`);
|
|
|
+ _push(`<sup class="todo" data-v-3d118848>迁移中</sup>`);
|
|
|
} else {
|
|
|
_push(`<!---->`);
|
|
|
}
|
|
|
_push(`</button>`);
|
|
|
});
|
|
|
- _push(`<!--]--></nav><div class="page-head" data-v-9b63d247><h1 data-v-9b63d247>${ssrInterpolate(unref(t)("tab." + __props.tab))}</h1><span class="window-badge" data-v-9b63d247>${ssrInterpolate(unref(t)("win.label"))} · ${ssrInterpolate(unref(winName)(__props.d?.win))}</span></div>`);
|
|
|
+ _push(`<!--]--></nav><div class="page-head" data-v-3d118848><h1 data-v-3d118848>${ssrInterpolate(unref(t)("tab." + __props.tab))}</h1><span class="window-badge" data-v-3d118848>${ssrInterpolate(unref(t)("win.label"))} · ${ssrInterpolate(unref(winName)(__props.d?.win))}</span></div>`);
|
|
|
if (__props.tab === "overview") {
|
|
|
_push(ssrRenderComponent(_sfc_main$1, { d: __props.d }, null, _parent));
|
|
|
} else if (__props.tab === "energy") {
|
|
|
- _push(ssrRenderComponent(_sfc_main$3, { d: __props.d }, null, _parent));
|
|
|
+ _push(ssrRenderComponent(_sfc_main$4, { d: __props.d }, null, _parent));
|
|
|
} else if (__props.tab === "component") {
|
|
|
- _push(ssrRenderComponent(_sfc_main$5, {
|
|
|
+ _push(ssrRenderComponent(_sfc_main$6, {
|
|
|
d: __props.d,
|
|
|
sys: __props.sys
|
|
|
}, null, _parent));
|
|
|
} else if (__props.tab === "fault") {
|
|
|
- _push(ssrRenderComponent(_sfc_main$2, { d: __props.d }, null, _parent));
|
|
|
+ _push(ssrRenderComponent(_sfc_main$3, { d: __props.d }, null, _parent));
|
|
|
+ } else if (__props.tab === "vibration") {
|
|
|
+ _push(ssrRenderComponent(_sfc_main$2, {
|
|
|
+ d: __props.d,
|
|
|
+ sub: __props.sub,
|
|
|
+ onSub: ($event) => emit("sub", $event)
|
|
|
+ }, null, _parent));
|
|
|
} else if (pending.value) {
|
|
|
- _push(`<section class="card" data-v-9b63d247><h2 data-v-9b63d247>${ssrInterpolate(unref(t)("tab." + __props.tab))} <small data-v-9b63d247>(本页签尚未迁移到 Vue)</small></h2><p class="hint" data-v-9b63d247> 迁移纪律:页签逐个搬,每搬一个就用 <code data-v-9b63d247>tools/render_parity.mjs</code> 与重构前页面 (现网 <code data-v-9b63d247>/detail/v2</code>)对拍文案/数值/类名序列,**通过后**才删对应的 Python 前端源码。 当前已迁移:${ssrInterpolate(unref(DONE).join("、"))}。 </p></section>`);
|
|
|
+ _push(`<section class="card" data-v-3d118848><h2 data-v-3d118848>${ssrInterpolate(unref(t)("tab." + __props.tab))} <small data-v-3d118848>(本页签尚未迁移到 Vue)</small></h2><p class="hint" data-v-3d118848> 迁移纪律:页签逐个搬,每搬一个就用 <code data-v-3d118848>tools/render_parity.mjs</code> 与重构前页面 (现网 <code data-v-3d118848>/detail/v2</code>)对拍文案/数值/类名序列,**通过后**才删对应的 Python 前端源码。 当前已迁移:${ssrInterpolate(unref(DONE).join("、"))}。 </p></section>`);
|
|
|
} else {
|
|
|
_push(`<!---->`);
|
|
|
}
|
|
|
@@ -1716,7 +1922,7 @@ _sfc_main.setup = (props, ctx) => {
|
|
|
(ssrContext.modules || (ssrContext.modules = /* @__PURE__ */ new Set())).add("src/views/Workbench.vue");
|
|
|
return _sfc_setup ? _sfc_setup(props, ctx) : void 0;
|
|
|
};
|
|
|
-const Workbench = /* @__PURE__ */ _export_sfc(_sfc_main, [["__scopeId", "data-v-9b63d247"]]);
|
|
|
+const Workbench = /* @__PURE__ */ _export_sfc(_sfc_main, [["__scopeId", "data-v-3d118848"]]);
|
|
|
async function renderTab(d, tab = "overview", sub) {
|
|
|
const app = createSSRApp(Workbench, { d, tab, sub: sub ?? null });
|
|
|
return await renderToString(app);
|