|
|
@@ -866,7 +866,7 @@ const TABS = [
|
|
|
"report",
|
|
|
"system"
|
|
|
];
|
|
|
-const DONE = ["overview", "energy", "component", "fault", "vibration"];
|
|
|
+const DONE = ["overview", "energy", "component", "fault", "vibration", "generation"];
|
|
|
const ST$1 = { 危险: "bad", 报警: "warn", 不可判: "unk", 良好: "ok", 优秀: "ex" };
|
|
|
const ST_ALIAS$1 = {
|
|
|
critical: "bad",
|
|
|
@@ -948,7 +948,7 @@ const sysName = (value) => {
|
|
|
return SYS_ZH[key] ? t("sys." + key) : String(value ?? "");
|
|
|
};
|
|
|
const partName = (p) => sysName(p);
|
|
|
-const _sfc_main$7 = /* @__PURE__ */ defineComponent({
|
|
|
+const _sfc_main$8 = /* @__PURE__ */ defineComponent({
|
|
|
__name: "Component",
|
|
|
__ssrInlineRender: true,
|
|
|
props: {
|
|
|
@@ -1083,13 +1083,13 @@ const _sfc_main$7 = /* @__PURE__ */ defineComponent({
|
|
|
};
|
|
|
}
|
|
|
});
|
|
|
-const _sfc_setup$7 = _sfc_main$7.setup;
|
|
|
-_sfc_main$7.setup = (props, ctx) => {
|
|
|
+const _sfc_setup$8 = _sfc_main$8.setup;
|
|
|
+_sfc_main$8.setup = (props, ctx) => {
|
|
|
const ssrContext = useSSRContext();
|
|
|
(ssrContext.modules || (ssrContext.modules = /* @__PURE__ */ new Set())).add("src/views/Component.vue");
|
|
|
- return _sfc_setup$7 ? _sfc_setup$7(props, ctx) : void 0;
|
|
|
+ return _sfc_setup$8 ? _sfc_setup$8(props, ctx) : void 0;
|
|
|
};
|
|
|
-const _sfc_main$6 = /* @__PURE__ */ defineComponent({
|
|
|
+const _sfc_main$7 = /* @__PURE__ */ defineComponent({
|
|
|
__name: "EChart",
|
|
|
__ssrInlineRender: true,
|
|
|
props: {
|
|
|
@@ -1132,14 +1132,14 @@ const _export_sfc = (sfc, props) => {
|
|
|
}
|
|
|
return target;
|
|
|
};
|
|
|
-const _sfc_setup$6 = _sfc_main$6.setup;
|
|
|
-_sfc_main$6.setup = (props, ctx) => {
|
|
|
+const _sfc_setup$7 = _sfc_main$7.setup;
|
|
|
+_sfc_main$7.setup = (props, ctx) => {
|
|
|
const ssrContext = useSSRContext();
|
|
|
(ssrContext.modules || (ssrContext.modules = /* @__PURE__ */ new Set())).add("src/components/EChart.vue");
|
|
|
- return _sfc_setup$6 ? _sfc_setup$6(props, ctx) : void 0;
|
|
|
+ return _sfc_setup$7 ? _sfc_setup$7(props, ctx) : void 0;
|
|
|
};
|
|
|
-const EChart = /* @__PURE__ */ _export_sfc(_sfc_main$6, [["__scopeId", "data-v-999bee15"]]);
|
|
|
-const _sfc_main$5 = /* @__PURE__ */ defineComponent({
|
|
|
+const EChart = /* @__PURE__ */ _export_sfc(_sfc_main$7, [["__scopeId", "data-v-999bee15"]]);
|
|
|
+const _sfc_main$6 = /* @__PURE__ */ defineComponent({
|
|
|
__name: "Energy",
|
|
|
__ssrInlineRender: true,
|
|
|
props: {
|
|
|
@@ -1249,13 +1249,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/Energy.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: "Fault",
|
|
|
__ssrInlineRender: true,
|
|
|
props: {
|
|
|
@@ -1503,11 +1503,11 @@ const _sfc_main$4 = /* @__PURE__ */ defineComponent({
|
|
|
};
|
|
|
}
|
|
|
});
|
|
|
-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/views/Fault.vue");
|
|
|
- return _sfc_setup$4 ? _sfc_setup$4(props, ctx) : void 0;
|
|
|
+ return _sfc_setup$5 ? _sfc_setup$5(props, ctx) : void 0;
|
|
|
};
|
|
|
const VIBJARGON = [
|
|
|
[/DE[/]NDE/g, "驱动端与非驱动端"],
|
|
|
@@ -1803,7 +1803,7 @@ function cmsHtml(V, err) {
|
|
|
<p class="small muted" style="margin-top:10px">${t("fus.cms_link")} <a href="http://localhost:8030/index.html" target="_blank" rel="noopener">${t("fus.cms_open")}</a> <a href="/windcms/index.html" target="_blank" rel="noopener">${t("fus.cms_static")}</a></p></div>`;
|
|
|
}
|
|
|
const FUS_SUBS = ["matrix", "loop", "units", "events", "cms"];
|
|
|
-const _sfc_main$3 = /* @__PURE__ */ defineComponent({
|
|
|
+const _sfc_main$4 = /* @__PURE__ */ defineComponent({
|
|
|
__name: "Vibration",
|
|
|
__ssrInlineRender: true,
|
|
|
props: {
|
|
|
@@ -1835,13 +1835,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/Vibration.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: "Generation",
|
|
|
__ssrInlineRender: true,
|
|
|
props: {
|
|
|
@@ -1994,10 +1994,63 @@ 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/Generation.vue");
|
|
|
+ return _sfc_setup$3 ? _sfc_setup$3(props, ctx) : void 0;
|
|
|
+};
|
|
|
+const _sfc_main$2 = /* @__PURE__ */ defineComponent({
|
|
|
+ __name: "Decision",
|
|
|
+ __ssrInlineRender: true,
|
|
|
+ props: {
|
|
|
+ d: {},
|
|
|
+ apis: {}
|
|
|
+ },
|
|
|
+ setup(__props) {
|
|
|
+ const props = __props;
|
|
|
+ const CATS = [
|
|
|
+ ["equip", "设备类"],
|
|
|
+ ["sched", "检修排程决策"],
|
|
|
+ ["loss", "损失分析"],
|
|
|
+ ["risk", "安全风险预测"]
|
|
|
+ ];
|
|
|
+ const MDL_LOC = { "qwen3:8b": "local", "qwen3.8:27b": "local", "qwen3:30b-a3b": "local", "deepseek-r1:14b": "local", "deepseek-r1:32b": "local", "deepseek-chat": "cloud", "kimi-fast": "cloud", "qwen-plus": "cloud", "deepseek-v4-pro": "cloud" };
|
|
|
+ const cat = ref("equip");
|
|
|
+ const q = ref("");
|
|
|
+ const model = ref("");
|
|
|
+ const out = ref("");
|
|
|
+ const askModels = computed(() => props.apis?.["/detail/api/ask_models"] ?? props.apis?.["/api/ask_models"] ?? null);
|
|
|
+ const models = computed(() => askModels.value ? askModels.value.models || {} : null);
|
|
|
+ const localDown = computed(() => !!askModels.value?.offline || !!askModels.value?.LOCAL_AI_DOWN);
|
|
|
+ const catName = computed(() => t("cat." + cat.value));
|
|
|
+ const pills = computed(() => CATS.map(([id]) => `<button class="pill ${id === cat.value ? "on" : ""}" data-cat="${id}">${t("cat." + id)}</button>`).join(""));
|
|
|
+ const qs = computed(() => [1, 2, 3].map((i) => `<div class="qitem" data-q="${esc(t("cat." + cat.value + ".q" + i))}">${t("cat." + cat.value + ".q" + i)}</div>`).join(""));
|
|
|
+ const mdlKey = (id, f) => t("mdl." + id + "." + f);
|
|
|
+ const mdlLabel = (id) => (mdlKey(id, "nm") || id) + (MDL_LOC[id] ? " · " + t("mdl." + MDL_LOC[id]) : "") + (mdlKey(id, "t") ? " · " + mdlKey(id, "t") : "");
|
|
|
+ const mdlNote = (id) => !MDL_LOC[id] ? `<span style="color:var(--warning)">${t("mdl.unknown_warn")}</span>` : MDL_LOC[id] === "local" ? t("mdl.zero_outbound") : `<span style="color:var(--warning)">${t("mdl.outbound_warn")}</span>`;
|
|
|
+ const effectiveModel = computed(() => {
|
|
|
+ const m = models.value;
|
|
|
+ if (m === null) return model.value;
|
|
|
+ const ks = Object.keys(m);
|
|
|
+ return !model.value || !ks.includes(model.value) ? ks[0] || "" : model.value;
|
|
|
+ });
|
|
|
+ const opts = computed(() => {
|
|
|
+ const m = models.value;
|
|
|
+ if (m === null) return '<option value="">…</option>';
|
|
|
+ return Object.keys(m).length ? Object.keys(m).map((k) => `<option value="${esc(k)}" ${k === effectiveModel ? "selected" : ""}>${esc(mdlLabel(k))}</option>`).join("") : `<option value="">${localDown.value ? t("ask.local_down") : t("ask.no_models")}</option>`;
|
|
|
+ });
|
|
|
+ const classicHref = computed(() => `/?lang=zh&win=${encodeURIComponent(String(props.d?.win || ""))}`);
|
|
|
+ const mdlNoteHtml = computed(() => effectiveModel.value ? mdlNote(effectiveModel.value) : "");
|
|
|
+ return (_ctx, _push, _parent, _attrs) => {
|
|
|
+ _push(`<section${ssrRenderAttrs(_attrs)}><div class="eyebrow">${ssrInterpolate(unref(t)("dec.head"))}</div><p class="small muted">${ssrInterpolate(unref(t)("dec.classic"))} <a${ssrRenderAttr("href", classicHref.value)}>${ssrInterpolate(unref(t)("ui.open_classic"))}</a></p><div style="${ssrRenderStyle({ "display": "flex", "gap": "8px", "margin": "10px 0 12px", "flex-wrap": "wrap" })}">${pills.value ?? ""}</div><div class="panel mb"><h3>${ssrInterpolate(unref(t)("ask.common_q", { cat: catName.value }))}</h3><p class="small muted">${ssrInterpolate(unref(t)("cat." + cat.value + ".hint"))}${ssrInterpolate("。")}${ssrInterpolate(unref(t)("ask.grounding"))}</p><div>${qs.value ?? ""}</div><div style="${ssrRenderStyle({ "display": "flex", "gap": "8px", "flex-wrap": "wrap", "margin": "10px 0", "align-items": "center" })}"><input id="askq" type="text"${ssrRenderAttr("placeholder", unref(esc)(unref(t)("ask.placeholder", { cat: catName.value })))}${ssrRenderAttr("value", q.value)} style="${ssrRenderStyle({ "flex": "1", "min-width": "280px" })}"><label class="small muted" for="askm">${ssrInterpolate(unref(t)("ask.model"))}</label><select id="askm">${opts.value ?? ""}</select><span id="mdlnote" class="small">${mdlNoteHtml.value ?? ""}</span><label class="small" style="${ssrRenderStyle({ "cursor": "pointer", "white-space": "nowrap" })}"${ssrRenderAttr("title", unref(esc)(unref(t)("ask.xrev_title")))}><input type="checkbox" id="askxrev"> ${ssrInterpolate(unref(t)("ask.xrev"))} <span class="muted">${ssrInterpolate(unref(t)("ask.xrev_note"))}</span></label><button class="btn" id="askgo">${ssrInterpolate(unref(t)("ask.go"))}</button></div><div id="askout" class="small">${ssrInterpolate(out.value || unref(t)("ask.idle"))}</div></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/Generation.vue");
|
|
|
+ (ssrContext.modules || (ssrContext.modules = /* @__PURE__ */ new Set())).add("src/views/Decision.vue");
|
|
|
return _sfc_setup$2 ? _sfc_setup$2(props, ctx) : void 0;
|
|
|
};
|
|
|
const _sfc_main$1 = /* @__PURE__ */ defineComponent({
|
|
|
@@ -2165,7 +2218,8 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
sys: {},
|
|
|
sub: {},
|
|
|
cms: {},
|
|
|
- curves: {}
|
|
|
+ curves: {},
|
|
|
+ apis: {}
|
|
|
},
|
|
|
emits: ["tab", "sub"],
|
|
|
setup(__props, { emit: __emit }) {
|
|
|
@@ -2173,43 +2227,48 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
const emit = __emit;
|
|
|
const pending = computed(() => !DONE.includes(props.tab));
|
|
|
return (_ctx, _push, _parent, _attrs) => {
|
|
|
- _push(`<!--[--><nav class="wb-tabs" data-v-4088a77e><!--[-->`);
|
|
|
+ _push(`<!--[--><nav class="wb-tabs" data-v-c45596c5><!--[-->`);
|
|
|
ssrRenderList(unref(TABS), (id) => {
|
|
|
- _push(`<button class="${ssrRenderClass({ on: id === __props.tab })}" data-v-4088a77e>${ssrInterpolate(unref(t)("tab." + id))}`);
|
|
|
+ _push(`<button class="${ssrRenderClass({ on: id === __props.tab })}" data-v-c45596c5>${ssrInterpolate(unref(t)("tab." + id))}`);
|
|
|
if (!unref(DONE).includes(id)) {
|
|
|
- _push(`<sup class="todo" data-v-4088a77e>迁移中</sup>`);
|
|
|
+ _push(`<sup class="todo" data-v-c45596c5>迁移中</sup>`);
|
|
|
} else {
|
|
|
_push(`<!---->`);
|
|
|
}
|
|
|
_push(`</button>`);
|
|
|
});
|
|
|
- _push(`<!--]--></nav><div class="page-head" data-v-4088a77e><h1 data-v-4088a77e>${ssrInterpolate(unref(t)("tab." + __props.tab))}</h1><span class="window-badge" data-v-4088a77e>${ssrInterpolate(unref(t)("win.label"))} · ${ssrInterpolate(unref(winName)(__props.d?.win))}</span></div>`);
|
|
|
+ _push(`<!--]--></nav><div class="page-head" data-v-c45596c5><h1 data-v-c45596c5>${ssrInterpolate(unref(t)("tab." + __props.tab))}</h1><span class="window-badge" data-v-c45596c5>${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$5, { d: __props.d }, null, _parent));
|
|
|
+ _push(ssrRenderComponent(_sfc_main$6, { d: __props.d }, null, _parent));
|
|
|
} else if (__props.tab === "component") {
|
|
|
- _push(ssrRenderComponent(_sfc_main$7, {
|
|
|
+ _push(ssrRenderComponent(_sfc_main$8, {
|
|
|
d: __props.d,
|
|
|
sys: __props.sys
|
|
|
}, null, _parent));
|
|
|
} else if (__props.tab === "fault") {
|
|
|
- _push(ssrRenderComponent(_sfc_main$4, { d: __props.d }, null, _parent));
|
|
|
+ _push(ssrRenderComponent(_sfc_main$5, { d: __props.d }, null, _parent));
|
|
|
} else if (__props.tab === "vibration") {
|
|
|
- _push(ssrRenderComponent(_sfc_main$3, {
|
|
|
+ _push(ssrRenderComponent(_sfc_main$4, {
|
|
|
d: __props.d,
|
|
|
sub: __props.sub,
|
|
|
cms: __props.cms,
|
|
|
onSub: ($event) => emit("sub", $event)
|
|
|
}, null, _parent));
|
|
|
} else if (__props.tab === "generation") {
|
|
|
- _push(ssrRenderComponent(_sfc_main$2, {
|
|
|
+ _push(ssrRenderComponent(_sfc_main$3, {
|
|
|
d: __props.d,
|
|
|
curves: __props.curves,
|
|
|
pending: !!__props.d.m9_pending
|
|
|
}, null, _parent));
|
|
|
+ } else if (__props.tab === "decision") {
|
|
|
+ _push(ssrRenderComponent(_sfc_main$2, {
|
|
|
+ d: __props.d,
|
|
|
+ apis: __props.apis
|
|
|
+ }, null, _parent));
|
|
|
} else if (pending.value) {
|
|
|
- _push(`<section class="card" data-v-4088a77e><h2 data-v-4088a77e>${ssrInterpolate(unref(t)("tab." + __props.tab))} <small data-v-4088a77e>(本页签尚未迁移到 Vue)</small></h2><p class="hint" data-v-4088a77e> 迁移纪律:页签逐个搬,每搬一个就用 <code data-v-4088a77e>tools/render_parity.mjs</code> 与重构前页面 (现网 <code data-v-4088a77e>/detail/v2</code>)对拍文案/数值/类名序列,**通过后**才删对应的 Python 前端源码。 当前已迁移:${ssrInterpolate(unref(DONE).join("、"))}。 </p></section>`);
|
|
|
+ _push(`<section class="card" data-v-c45596c5><h2 data-v-c45596c5>${ssrInterpolate(unref(t)("tab." + __props.tab))} <small data-v-c45596c5>(本页签尚未迁移到 Vue)</small></h2><p class="hint" data-v-c45596c5> 迁移纪律:页签逐个搬,每搬一个就用 <code data-v-c45596c5>tools/render_parity.mjs</code> 与重构前页面 (现网 <code data-v-c45596c5>/detail/v2</code>)对拍文案/数值/类名序列,**通过后**才删对应的 Python 前端源码。 当前已迁移:${ssrInterpolate(unref(DONE).join("、"))}。 </p></section>`);
|
|
|
} else {
|
|
|
_push(`<!---->`);
|
|
|
}
|
|
|
@@ -2223,9 +2282,9 @@ _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-4088a77e"]]);
|
|
|
-async function renderTab(d, tab = "overview", sub, cms, curves) {
|
|
|
- const app = createSSRApp(Workbench, { d, tab, sub: sub ?? null, cms: cms ?? null, curves: curves ?? null });
|
|
|
+const Workbench = /* @__PURE__ */ _export_sfc(_sfc_main, [["__scopeId", "data-v-c45596c5"]]);
|
|
|
+async function renderTab(d, tab = "overview", sub, cms, curves, apis) {
|
|
|
+ const app = createSSRApp(Workbench, { d, tab, sub: sub ?? null, cms: cms ?? null, curves: curves ?? null, apis: apis ?? null });
|
|
|
return await renderToString(app);
|
|
|
}
|
|
|
export {
|