feat: align frontend runtime and Edge TTS
This commit is contained in:
@@ -152,7 +152,7 @@ export function MapDevPanel({ commands, controllerState, detailFeature, onClose
|
||||
<button type="button" onClick={commands.clearHighlight} className={secondaryButtonClassName}>清除高亮</button>
|
||||
</PanelSection>
|
||||
|
||||
<PanelSection title="全网水流" description="按管渠拓扑方向显示静态或动画流纹。">
|
||||
<PanelSection title="全网水流" description="按管线拓扑方向显示静态或动画流纹。">
|
||||
<div className="grid grid-cols-2 gap-2">
|
||||
<button type="button" disabled={controllerState.pending || controllerState.flowVisible} onClick={() => void commands.setFlowVisible(true)} className={primaryButtonClassName}>开启水流</button>
|
||||
<button type="button" disabled={!controllerState.flowVisible} onClick={() => void commands.setFlowVisible(false)} className={secondaryButtonClassName}>关闭水流</button>
|
||||
|
||||
@@ -124,7 +124,7 @@ export const runningWorkflowDefinitions: Record<ScheduledConditionTaskId, Runnin
|
||||
{
|
||||
id: "calculate-energy",
|
||||
title: "计算单位电耗",
|
||||
detail: "按当前窗口排水量折算单位排水电耗和效率偏差。"
|
||||
detail: "按当前窗口供水量折算单位供水电耗和效率偏差。"
|
||||
},
|
||||
{
|
||||
id: "compare-efficiency",
|
||||
|
||||
@@ -92,7 +92,7 @@ const CONDITION_TASKS: ConditionTaskDefinition[] = [
|
||||
{
|
||||
id: "pump-energy",
|
||||
title: "泵站能耗检查",
|
||||
summary: "检查泵组负载、单位排水电耗、启停频率和供压稳定性。",
|
||||
summary: "检查泵组负载、单位供水电耗、启停频率和供压稳定性。",
|
||||
intervalMinutes: 60,
|
||||
durationMinutes: 10
|
||||
}
|
||||
@@ -709,16 +709,16 @@ function createTaskKpis(task: ConditionTaskDefinition, signal: TaskSignal): Sche
|
||||
return [
|
||||
{
|
||||
id: "energy-deviation",
|
||||
label: "单位排水电耗偏差",
|
||||
label: "单位供水电耗偏差",
|
||||
value: energyDeviation.toString(),
|
||||
unit: "%",
|
||||
threshold: "关注 > 10%,异常 > 15%",
|
||||
status: getMetricRisk(energyDeviation, 10, 15),
|
||||
description: "本轮单位排水电耗相对同窗基线的偏差。"
|
||||
description: "本轮单位供水电耗相对同窗基线的偏差。"
|
||||
},
|
||||
{
|
||||
id: "unit-energy",
|
||||
label: "单位排水电耗",
|
||||
label: "单位供水电耗",
|
||||
value: unitEnergy.toString(),
|
||||
unit: "kWh/m3",
|
||||
baseline: "同窗经济运行区间 0.28-0.34",
|
||||
@@ -780,10 +780,10 @@ function createDispatchInstructions(signal: TaskSignal): DispatchInstruction[] {
|
||||
action: "泵组组合优化",
|
||||
target: "1# 泵站 3# / 4# 泵组",
|
||||
command: "保持 3# 泵运行,延后 4# 泵启动 10 分钟,避免低效并联区间",
|
||||
verification: "复核单位排水电耗是否低于 0.34kWh/m3"
|
||||
verification: "复核单位供水电耗是否低于 0.34kWh/m3"
|
||||
},
|
||||
{
|
||||
action: "高区排水边界收敛",
|
||||
action: "高区供水边界收敛",
|
||||
target: "高区联络阀 HV-204",
|
||||
command: "开度下调 3%,减少高区向中区回流",
|
||||
verification: "确认高区末端压力不低于 0.22MPa"
|
||||
@@ -819,7 +819,7 @@ function createDispatchInstructions(signal: TaskSignal): DispatchInstruction[] {
|
||||
{
|
||||
action: "阀门开度回退",
|
||||
target: "华山路沿线阀门组 VG-11",
|
||||
command: "将昨日临时开度回退 2%,恢复常规排水边界",
|
||||
command: "将昨日临时开度回退 2%,恢复常规供水边界",
|
||||
verification: "观察华山路和人民路支线压差不超过 2.5m"
|
||||
},
|
||||
{
|
||||
@@ -911,7 +911,7 @@ function createGuidanceItems(
|
||||
|
||||
if (task.id === "pump-energy") {
|
||||
return [
|
||||
"关注单位排水电耗和启停频率,判断是否存在泵组组合不经济。",
|
||||
"关注单位供水电耗和启停频率,判断是否存在泵组组合不经济。",
|
||||
"若电耗偏差持续升高,建议比较相邻泵组效率曲线并优化启停策略。",
|
||||
"调整前需确认供压稳定性,避免节能动作引发末端低压。"
|
||||
];
|
||||
|
||||
@@ -23,5 +23,5 @@ export const WORKBENCH_SCENARIOS: WorkbenchScenario[] = [
|
||||
|
||||
export const WORKBENCH_USER: WorkbenchUser = {
|
||||
name: "调度员",
|
||||
role: "排水运行调度中心"
|
||||
role: "供水运行调度中心"
|
||||
};
|
||||
|
||||
@@ -6,6 +6,7 @@ import { DefaultChatTransport } from "ai";
|
||||
import useSWR from "swr";
|
||||
import useSWRImmutable from "swr/immutable";
|
||||
import type { PersonaState } from "@/shared/ai-elements/persona";
|
||||
import { env } from "@/shared/config/env";
|
||||
import { showMapNotice } from "@/features/map/core/components/notice-actions";
|
||||
import type {
|
||||
AgentApprovalMode,
|
||||
@@ -209,7 +210,7 @@ export function useWorkbenchAgent({ onUiEnvelope, onFrontendAction }: UseWorkben
|
||||
const transport = useMemo(
|
||||
() =>
|
||||
new DefaultChatTransport<AgentUiMessage>({
|
||||
api: "/api/v1/agent/chat/stream",
|
||||
api: `${env.TJWATER_AGENT_API_BASE_URL.replace(/\/$/, "")}/api/v1/agent/chat/stream`,
|
||||
prepareSendMessagesRequest({ id, messages, body, trigger, messageId }) {
|
||||
return {
|
||||
body: {
|
||||
|
||||
@@ -902,7 +902,7 @@ export function MapWorkbenchPage() {
|
||||
ref={mapContainerRef}
|
||||
className="map-grid"
|
||||
style={{ position: "absolute", inset: 0 }}
|
||||
aria-label="排水管网地图"
|
||||
aria-label="供水管网地图"
|
||||
/>
|
||||
|
||||
<WorkbenchTopBar
|
||||
@@ -969,7 +969,11 @@ export function MapWorkbenchPage() {
|
||||
</div>
|
||||
</>
|
||||
) : (
|
||||
<AgentCollapsedRail personaState={agent.personaState} onExpand={agent.expandPanel} />
|
||||
<AgentCollapsedRail
|
||||
personaState={agent.personaState}
|
||||
statusLabel={agent.statusLabel}
|
||||
onExpand={agent.expandPanel}
|
||||
/>
|
||||
)}
|
||||
</div>
|
||||
|
||||
|
||||
@@ -33,7 +33,7 @@ const PROPERTY_LABELS: Record<string, string> = {
|
||||
sensor_name: "传感器名称",
|
||||
swmm_node: "SWMM 节点",
|
||||
topology_order: "拓扑序",
|
||||
distance_to_wwtp_m: "距污水厂距离",
|
||||
distance_to_wwtp_m: "距处理厂距离",
|
||||
upstream_node_count: "上游节点数",
|
||||
upstream_sensors: "上游传感器",
|
||||
downstream_path: "下游路径",
|
||||
@@ -103,7 +103,7 @@ const PROPERTY_LABELS: Record<string, string> = {
|
||||
device_icon_code: "设备图标编码",
|
||||
active: "运行状态",
|
||||
external_id: "设备编号",
|
||||
junction_id: "关联检查井",
|
||||
junction_id: "关联节点",
|
||||
kind: "设备类型",
|
||||
location_source: "位置来源",
|
||||
site_external_id: "站点编号",
|
||||
|
||||
@@ -98,7 +98,7 @@ export function createAlertQueueConversationPrompt({
|
||||
});
|
||||
|
||||
return [
|
||||
"请作为排水管网调度 Agent,汇总当前待复核工况队列。",
|
||||
"请作为供水管网调度 Agent,汇总当前待复核工况队列。",
|
||||
"",
|
||||
"目标:",
|
||||
"1. 汇总这一组待复核工况之间的关联关系和处理顺序。",
|
||||
|
||||
Reference in New Issue
Block a user