Add factory dashboard SignalR integration
This commit is contained in:
parent
1331d10e31
commit
2b5081061e
@ -14,6 +14,7 @@
|
||||
"@dev-screen-starter/debug": "workspace:*",
|
||||
"@dev-screen-starter/screen-core": "workspace:*",
|
||||
"@dev-screen-starter/visual-kit": "workspace:*",
|
||||
"@microsoft/signalr": "^10.0.0",
|
||||
"@vitejs/plugin-react": "^5.0.4",
|
||||
"echarts": "^6.0.0",
|
||||
"react": "^19.1.1",
|
||||
|
||||
344
apps/factory-dashboard/src/api/dashboardSignalR.ts
Normal file
344
apps/factory-dashboard/src/api/dashboardSignalR.ts
Normal file
@ -0,0 +1,344 @@
|
||||
import * as signalR from '@microsoft/signalr'
|
||||
import type { AlarmRow, CncDevice, DeviceTrendData, FactoryDevice, PowerDevice, WeeklyStats } from '../domain/deviceTypes'
|
||||
|
||||
type DashboardDailyProductionDto = {
|
||||
dates?: string[]
|
||||
Dates?: string[]
|
||||
produce?: number[]
|
||||
Produce?: number[]
|
||||
runtime?: number[]
|
||||
Runtime?: number[]
|
||||
}
|
||||
|
||||
type DashboardDeviceDto = {
|
||||
deviceId?: string
|
||||
DeviceId?: string
|
||||
deviceName?: string
|
||||
DeviceName?: string
|
||||
deviceType?: string
|
||||
DeviceType?: string
|
||||
status?: string
|
||||
Status?: string
|
||||
alarmSummary?: string
|
||||
AlarmSummary?: string
|
||||
realtime?: Record<string, unknown>
|
||||
Realtime?: Record<string, unknown>
|
||||
dailyProduction?: DashboardDailyProductionDto
|
||||
DailyProduction?: DashboardDailyProductionDto
|
||||
trendPoints?: DashboardTrendPointDto[]
|
||||
TrendPoints?: DashboardTrendPointDto[]
|
||||
}
|
||||
|
||||
type DashboardAlarmDto = {
|
||||
deviceId?: string
|
||||
DeviceId?: string
|
||||
alarmMessage?: string
|
||||
AlarmMessage?: string
|
||||
lastSeenTime?: string
|
||||
LastSeenTime?: string
|
||||
startTime?: string
|
||||
StartTime?: string
|
||||
}
|
||||
|
||||
type DashboardSnapshotDto = {
|
||||
devices?: DashboardDeviceDto[]
|
||||
Devices?: DashboardDeviceDto[]
|
||||
alarms?: DashboardAlarmDto[]
|
||||
Alarms?: DashboardAlarmDto[]
|
||||
}
|
||||
|
||||
type DashboardTrendPointDto = {
|
||||
metricName?: string
|
||||
MetricName?: string
|
||||
bucketTime?: string
|
||||
BucketTime?: string
|
||||
avgValue?: number
|
||||
AvgValue?: number
|
||||
}
|
||||
|
||||
type DashboardSignalRHandlers = {
|
||||
onConnectionState: (state: string) => void
|
||||
onSnapshot: (devices: DashboardDeviceDto[], alarms: AlarmRow[]) => void
|
||||
onDeviceUpdated: (device: DashboardDeviceDto) => void
|
||||
onAlarmUpdated: (deviceId: string, alarms: AlarmRow[]) => void
|
||||
onTrendUpdated: (deviceId: string, points: DashboardTrendPointDto[]) => void
|
||||
}
|
||||
|
||||
export function connectDashboardSignalR(url: string, handlers: DashboardSignalRHandlers) {
|
||||
const connection = new signalR.HubConnectionBuilder()
|
||||
.withUrl(url)
|
||||
.withAutomaticReconnect()
|
||||
.build()
|
||||
|
||||
connection.onreconnecting(() => handlers.onConnectionState('重连中'))
|
||||
connection.onreconnected(() => handlers.onConnectionState('已连接'))
|
||||
connection.onclose(() => handlers.onConnectionState('已断开'))
|
||||
|
||||
connection.on('device.updated', (device: DashboardDeviceDto) => {
|
||||
handlers.onDeviceUpdated(device)
|
||||
})
|
||||
|
||||
connection.on('alarm.updated', (payload: { deviceId?: string; DeviceId?: string; alarms?: DashboardAlarmDto[]; Alarms?: DashboardAlarmDto[] }) => {
|
||||
const deviceId = payload.deviceId ?? payload.DeviceId ?? ''
|
||||
handlers.onAlarmUpdated(deviceId, mapAlarms(payload.alarms ?? payload.Alarms ?? []))
|
||||
})
|
||||
|
||||
connection.on('trend.updated', (payload: { deviceId?: string; DeviceId?: string; points?: DashboardTrendPointDto[]; Points?: DashboardTrendPointDto[] }) => {
|
||||
const deviceId = payload.deviceId ?? payload.DeviceId ?? ''
|
||||
handlers.onTrendUpdated(deviceId, payload.points ?? payload.Points ?? [])
|
||||
})
|
||||
|
||||
connection.start()
|
||||
.then(async () => {
|
||||
handlers.onConnectionState('已连接')
|
||||
const snapshot = await connection.invoke<DashboardSnapshotDto>('GetSnapshot')
|
||||
handlers.onSnapshot(snapshot.devices ?? snapshot.Devices ?? [], mapAlarms(snapshot.alarms ?? snapshot.Alarms ?? []))
|
||||
})
|
||||
.catch((error) => {
|
||||
handlers.onConnectionState(`连接失败: ${error instanceof Error ? error.message : String(error)}`)
|
||||
})
|
||||
|
||||
return () => {
|
||||
void connection.stop()
|
||||
}
|
||||
}
|
||||
|
||||
export function applyDashboardDeviceUpdate(devices: FactoryDevice[], dto: DashboardDeviceDto): FactoryDevice[] {
|
||||
const deviceId = dto.deviceId ?? dto.DeviceId ?? ''
|
||||
const deviceType = String(dto.deviceType ?? dto.DeviceType ?? '').toLowerCase()
|
||||
const status = String(dto.status ?? dto.Status ?? '')
|
||||
const realtime = (dto.realtime ?? dto.Realtime ?? {}) as Record<string, unknown>
|
||||
const dailyProduction = dto.dailyProduction ?? dto.DailyProduction
|
||||
const trendPoints = dto.trendPoints ?? dto.TrendPoints ?? []
|
||||
const index = devices.findIndex((device) => isSameDevice(device, deviceId, deviceType))
|
||||
const current = index >= 0 ? devices[index] : createDeviceFromDto(deviceId, deviceType)
|
||||
if (!current) return devices
|
||||
|
||||
const next = updateDevice(current, deviceId, deviceType, status, realtime, dailyProduction)
|
||||
const nextWithTrend = trendPoints.length ? applyTrendToDevice(next, trendPoints) : next
|
||||
if (index < 0) return [...devices, nextWithTrend]
|
||||
return devices.map((device, i) => (i === index ? nextWithTrend : device))
|
||||
}
|
||||
|
||||
export function applyDashboardTrendUpdate(devices: FactoryDevice[], deviceId: string, points: DashboardTrendPointDto[]): FactoryDevice[] {
|
||||
if (!deviceId || points.length === 0) return devices
|
||||
|
||||
return devices.map((device) => {
|
||||
if (!isSameDevice(device, deviceId, device.type)) return device
|
||||
|
||||
return applyTrendToDevice(device, points)
|
||||
})
|
||||
}
|
||||
|
||||
function applyTrendToDevice(device: FactoryDevice, points: DashboardTrendPointDto[]): FactoryDevice {
|
||||
const trend = buildTrendData(device.type, points)
|
||||
return trend ? { ...device, trend } : device
|
||||
}
|
||||
|
||||
function updateDevice(device: FactoryDevice, deviceId: string, deviceType: string, status: string, realtime: Record<string, unknown>, dailyProduction?: DashboardDailyProductionDto): FactoryDevice {
|
||||
if (device.type === 'cnc' || deviceType === 'cnc') {
|
||||
const cncDevice = (device.type === 'cnc' ? device : createDeviceFromDto(deviceId, 'cnc')) as CncDevice
|
||||
return {
|
||||
...cncDevice,
|
||||
online: true,
|
||||
weeklyStats: mapDailyProduction(dailyProduction) ?? cncDevice.weeklyStats,
|
||||
machineData: {
|
||||
...(cncDevice.machineData ?? {}),
|
||||
alarm: readStringArray(realtime.alarmMessages),
|
||||
alarmStatus: status === 'alarm' ? 1 : 0,
|
||||
runtime: minutesToFanucTime(readNumber(realtime.runtimeMinutes)),
|
||||
cuttime: minutesToFanucTime(readNumber(realtime.cuttimeMinutes)),
|
||||
cycletime: minutesToFanucTime(readNumber(realtime.cycletimeMinutes)),
|
||||
currentProduceCount: readNumber(realtime.currentProduceCount),
|
||||
todayProduce: readNumber(realtime.todayProduce),
|
||||
programCurrent: {
|
||||
name: readString(realtime.programName) ?? '无程序',
|
||||
number: readNumber(realtime.programNumber)
|
||||
},
|
||||
setFeedRate: readNumber(realtime.setFeedRate),
|
||||
setSpindleSpeed: readNumber(realtime.setSpindleSpeed),
|
||||
spindleSpeedAndFeedRate: {
|
||||
speed: readNumber(realtime.spindleSpeed),
|
||||
feedRate: readNumber(realtime.feedRate)
|
||||
},
|
||||
statusInfo: {
|
||||
Alarm: status === 'alarm' ? 1 : 0,
|
||||
Emergency: 0,
|
||||
Motion: status === 'running' ? 1 : 0,
|
||||
MSTB: status === 'running' ? 1 : 0,
|
||||
RunStatus: readString(realtime.runStatus) ?? (status === 'running' ? '3' : '0'),
|
||||
WorkMode: readString(realtime.workMode) ?? '1'
|
||||
},
|
||||
sysInfo: {
|
||||
axes: readNumber(realtime.axes),
|
||||
cncType: readString(realtime.cncType),
|
||||
mtType: 'Machining center'
|
||||
},
|
||||
timestamp: readString(realtime.payloadTime) ?? new Date().toISOString()
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (device.type === 'power' || deviceType === 'power') {
|
||||
const powerDevice = (device.type === 'power' ? device : createDeviceFromDto(deviceId, 'power')) as PowerDevice
|
||||
return {
|
||||
...powerDevice,
|
||||
online: true,
|
||||
machineData: {
|
||||
timestamp: readString(realtime.payloadTime) ?? new Date().toISOString(),
|
||||
slave1: {
|
||||
current1: formatAmp(realtime.currentA),
|
||||
current2: formatAmp(realtime.currentB),
|
||||
current3: formatAmp(realtime.currentC)
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return device
|
||||
}
|
||||
|
||||
function mapDailyProduction(dailyProduction?: DashboardDailyProductionDto): WeeklyStats | null {
|
||||
if (!dailyProduction) return null
|
||||
|
||||
const dates = dailyProduction.dates ?? dailyProduction.Dates ?? []
|
||||
const produce = toNumberArray(dailyProduction.produce ?? dailyProduction.Produce)
|
||||
const runtime = toNumberArray(dailyProduction.runtime ?? dailyProduction.Runtime)
|
||||
if (dates.length === 0 || produce.length === 0) return null
|
||||
|
||||
return {
|
||||
dates: dates.map((date) => String(date)),
|
||||
produce,
|
||||
cuttime: runtime
|
||||
}
|
||||
}
|
||||
|
||||
function buildTrendData(deviceType: FactoryDevice['type'], points: DashboardTrendPointDto[]): DeviceTrendData | null {
|
||||
const rows = points
|
||||
.map((point) => ({
|
||||
metricName: String(point.metricName ?? point.MetricName ?? ''),
|
||||
bucketTime: String(point.bucketTime ?? point.BucketTime ?? ''),
|
||||
value: readNumber(point.avgValue ?? point.AvgValue)
|
||||
}))
|
||||
.filter((point) => point.bucketTime && point.metricName && point.value != null)
|
||||
|
||||
if (rows.length === 0) return null
|
||||
|
||||
const labels = Array.from(new Set(rows.map((point) => point.bucketTime))).sort()
|
||||
const valueOf = (metricName: string) => labels.map((time) => rows.find((point) => point.bucketTime === time && point.metricName === metricName)?.value ?? 0)
|
||||
|
||||
if (deviceType === 'power') {
|
||||
return {
|
||||
labels: labels.map(formatTrendLabel),
|
||||
power: valueOf('estimatedPower'),
|
||||
currentA: valueOf('currentA'),
|
||||
currentB: valueOf('currentB'),
|
||||
currentC: valueOf('currentC')
|
||||
}
|
||||
}
|
||||
|
||||
if (deviceType === 'cnc') {
|
||||
return {
|
||||
labels: labels.map(formatTrendLabel),
|
||||
produce: valueOf('cncProduceCount'),
|
||||
runtime: valueOf('runtimeMinutes')
|
||||
}
|
||||
}
|
||||
|
||||
return null
|
||||
}
|
||||
|
||||
function createDeviceFromDto(deviceId: string, deviceType: string): FactoryDevice | null {
|
||||
if (deviceType === 'cnc') {
|
||||
return {
|
||||
id: deviceId,
|
||||
name: deviceId || 'CNC-UNKNOWN',
|
||||
type: 'cnc',
|
||||
online: true,
|
||||
machineData: null,
|
||||
weeklyStats: null
|
||||
}
|
||||
}
|
||||
if (deviceType === 'power') {
|
||||
return {
|
||||
id: deviceId,
|
||||
name: powerName(deviceId),
|
||||
type: 'power',
|
||||
online: true,
|
||||
machineData: null,
|
||||
powerHistory: []
|
||||
}
|
||||
}
|
||||
return null
|
||||
}
|
||||
|
||||
function isSameDevice(device: FactoryDevice, deviceId: string, deviceType: string) {
|
||||
if (device.id === deviceId || device.name === deviceId) return true
|
||||
if (deviceType === 'cnc' && device.name === deviceId) return true
|
||||
if (deviceType === 'power') {
|
||||
if (deviceId.endsWith('001') && device.name.includes('#1')) return true
|
||||
if (deviceId.endsWith('002') && device.name.includes('#2')) return true
|
||||
}
|
||||
return false
|
||||
}
|
||||
|
||||
function mapAlarms(alarms: DashboardAlarmDto[]): AlarmRow[] {
|
||||
return alarms.map((alarm) => {
|
||||
const time = alarm.lastSeenTime ?? alarm.LastSeenTime ?? alarm.startTime ?? alarm.StartTime ?? ''
|
||||
return {
|
||||
time: formatTime(time),
|
||||
device: alarm.deviceId ?? alarm.DeviceId ?? '--',
|
||||
message: alarm.alarmMessage ?? alarm.AlarmMessage ?? '设备告警'
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
function readString(value: unknown) {
|
||||
return value == null ? undefined : String(value)
|
||||
}
|
||||
|
||||
function readNumber(value: unknown) {
|
||||
const number = Number(value)
|
||||
return Number.isFinite(number) ? number : undefined
|
||||
}
|
||||
|
||||
function toNumberArray(value: unknown) {
|
||||
return Array.isArray(value) ? value.map((item) => Number(item)).map((item) => (Number.isFinite(item) ? item : 0)) : []
|
||||
}
|
||||
|
||||
function readStringArray(value: unknown) {
|
||||
return Array.isArray(value) ? value.map((item) => String(item)) : []
|
||||
}
|
||||
|
||||
function minutesToFanucTime(minutes?: number) {
|
||||
if (!Number.isFinite(minutes)) return undefined
|
||||
const totalSeconds = Math.max(0, Math.round((minutes ?? 0) * 60))
|
||||
const hours = Math.floor(totalSeconds / 3600)
|
||||
const mins = Math.floor((totalSeconds % 3600) / 60)
|
||||
const secs = totalSeconds % 60
|
||||
return `${hours} H ${mins} M ${secs} S`
|
||||
}
|
||||
|
||||
function formatAmp(value: unknown) {
|
||||
const number = readNumber(value)
|
||||
return number == null ? 'invalid' : `${number.toFixed(1)}A`
|
||||
}
|
||||
|
||||
function formatTime(value: string) {
|
||||
if (!value) return '--'
|
||||
const date = new Date(value)
|
||||
if (Number.isNaN(date.getTime())) return value.slice(11, 16) || value
|
||||
return date.toTimeString().slice(0, 5)
|
||||
}
|
||||
|
||||
function formatTrendLabel(value: string) {
|
||||
const date = new Date(value)
|
||||
if (Number.isNaN(date.getTime())) return value.slice(11, 16) || value
|
||||
return date.toTimeString().slice(0, 5)
|
||||
}
|
||||
|
||||
function powerName(deviceId: string) {
|
||||
if (deviceId.endsWith('001')) return '配电柜 #1'
|
||||
if (deviceId.endsWith('002')) return '配电柜 #2'
|
||||
return deviceId || '配电柜'
|
||||
}
|
||||
@ -4,7 +4,7 @@ import type { CncDevice } from '../domain/deviceTypes'
|
||||
export function CncCard({ device, onOpen }: { device: CncDevice; onOpen?: () => void }) {
|
||||
const status = getDeviceStatus(device)
|
||||
const machineData = device.machineData
|
||||
const todayProduce = Number(device.weeklyStats?.produce?.[6] || 0)
|
||||
const todayProduce = Number(machineData?.todayProduce ?? device.weeklyStats?.produce?.[6] ?? 0)
|
||||
|
||||
return (
|
||||
<button className={`device-card cnc-card status-${status.key}`} onClick={onOpen} type="button">
|
||||
|
||||
@ -1,6 +1,6 @@
|
||||
import { ChartPanel, createDualAxisOption, createLineOption } from '@dev-screen-starter/charts'
|
||||
import { FlipNumber, TrendBadge, WaterLevel } from '@dev-screen-starter/visual-kit'
|
||||
import { formatFanucTimeShort, getDeviceStatus, getLaserSysStateText, STATUS_COLORS } from '../domain/deviceStatus'
|
||||
import { formatFanucTimeShort, getCncWorkModeText, getDeviceStatus, getLaserSysStateText, STATUS_COLORS } from '../domain/deviceStatus'
|
||||
import type { FactoryDevice } from '../domain/deviceTypes'
|
||||
import { getLast7DaysChartInfo } from '../utils/weekLabels'
|
||||
|
||||
@ -41,7 +41,7 @@ function FocusRealtime({ device }: { device: FactoryDevice }) {
|
||||
<div className="focus-task">
|
||||
<span>当前图纸</span>
|
||||
<strong>{nc?.TaskName ?? '无当前图纸'}</strong>
|
||||
<small>{getLaserSysStateText(nc?.SysState)}</small>
|
||||
<small>{getLaserSysStateText(nc?.SysState)} · {device.machineData?.timestamp ?? '等待数据'}</small>
|
||||
</div>
|
||||
</div>
|
||||
<div className="focus-metric-grid">
|
||||
@ -49,6 +49,8 @@ function FocusRealtime({ device }: { device: FactoryDevice }) {
|
||||
<FocusMetric label="切割长度" value={((device.machineData?.cutLength ?? 0) / 1000).toFixed(1)} unit="m" />
|
||||
<FocusMetric label="激光功率" value={String(nc?.LaserPower ?? 0)} unit="W" />
|
||||
<FocusMetric label="气压" value={String(ds?.GasPressure ?? 0)} unit="Bar" />
|
||||
<FocusMetric label="工作速度" value={String(nc?.WorkSpeed ?? 0)} unit="mm/min" />
|
||||
<FocusMetric label="开光/开气" value={`${ds?.IsLaserOn ? '开光' : '未开光'} · ${ds?.IsGasOn ? '开气' : '未开气'}`} />
|
||||
</div>
|
||||
</div>
|
||||
)
|
||||
@ -56,22 +58,25 @@ function FocusRealtime({ device }: { device: FactoryDevice }) {
|
||||
|
||||
if (device.type === 'cnc') {
|
||||
const md = device.machineData
|
||||
const todayProduce = Number(md?.todayProduce ?? device.weeklyStats?.produce?.[6] ?? 0)
|
||||
|
||||
return (
|
||||
<div className="focus-realtime">
|
||||
<div className="focus-hero">
|
||||
<FlipNumber label="今日产量" value={Number(device.weeklyStats?.produce?.[6] || 0).toLocaleString()} unit="件" tone="green" />
|
||||
<FlipNumber label="今日产量" value={todayProduce.toLocaleString()} unit="件" tone="green" />
|
||||
<div className="focus-task">
|
||||
<span>当前程序</span>
|
||||
<strong>{md?.programCurrent?.name ?? '无程序'}</strong>
|
||||
<small>运行 {formatFanucTimeShort(md?.runtime)}</small>
|
||||
<small>运行 {formatFanucTimeShort(md?.runtime)} · {md?.timestamp ?? '等待数据'}</small>
|
||||
</div>
|
||||
</div>
|
||||
<div className="focus-metric-grid">
|
||||
<FocusMetric label="累计产量" value={Number(md?.currentProduceCount || 0).toLocaleString()} unit="件" />
|
||||
<FocusMetric label="主轴倍率" value={String(md?.setSpindleSpeed ?? 0)} unit="%" />
|
||||
<FocusMetric label="进给倍率" value={String(md?.setFeedRate ?? 0)} unit="%" />
|
||||
<FocusMetric label="循环时间" value={formatFanucTimeShort(md?.cycletime)} />
|
||||
<FocusMetric label="切削时间" value={formatFanucTimeShort(md?.cuttime)} />
|
||||
<FocusMetric label="实际转速" value={String(md?.spindleSpeedAndFeedRate?.speed ?? 0)} unit="RPM" />
|
||||
<FocusMetric label="进给速度" value={String(md?.spindleSpeedAndFeedRate?.feedRate ?? 0)} unit="mm/min" />
|
||||
<FocusMetric label="工作模式" value={getCncWorkModeText(md?.statusInfo?.WorkMode)} />
|
||||
</div>
|
||||
</div>
|
||||
)
|
||||
@ -103,14 +108,19 @@ function FocusRealtime({ device }: { device: FactoryDevice }) {
|
||||
}
|
||||
|
||||
function FocusTrend({ device }: { device: FactoryDevice }) {
|
||||
const labels = device.weeklyStats?.dates ?? getLast7DaysChartInfo().labels
|
||||
const title = device.type === 'power' ? '最近7天电流趋势' : '最近7天产量与运行趋势'
|
||||
const powerTrend = device.type === 'power' ? buildPowerTrendDisplay(device) : null
|
||||
const hasRealtimeTrend = device.type === 'power' && Boolean(powerTrend?.labels.length)
|
||||
const labels = hasRealtimeTrend ? powerTrend?.labels ?? [] : device.weeklyStats?.dates ?? getLast7DaysChartInfo().labels
|
||||
const title = hasRealtimeTrend
|
||||
? device.type === 'power' ? '最近1小时三相电流趋势' : '实时产量与运行趋势'
|
||||
: device.type === 'power' ? '最近7天电流趋势' : '最近7天产量与运行趋势'
|
||||
const dailyProduce = getDailyProduce(device)
|
||||
const option = device.type === 'power'
|
||||
? createLineOption({
|
||||
categories: labels,
|
||||
values: device.powerHistory ?? [],
|
||||
name: '视在功率',
|
||||
color: '#d8a13e'
|
||||
series: hasRealtimeTrend
|
||||
? powerTrend?.series ?? []
|
||||
: [{ name: '视在功率', values: device.powerHistory ?? [], color: '#d8a13e' }]
|
||||
})
|
||||
: createDualAxisOption({
|
||||
categories: labels,
|
||||
@ -118,7 +128,7 @@ function FocusTrend({ device }: { device: FactoryDevice }) {
|
||||
rightName: '运行时长',
|
||||
bar: {
|
||||
name: device.type === 'laser' ? '穿孔' : '产量',
|
||||
values: device.weeklyStats?.produce ?? [],
|
||||
values: dailyProduce,
|
||||
color: '#63a4ff'
|
||||
},
|
||||
line: {
|
||||
@ -139,6 +149,67 @@ function FocusTrend({ device }: { device: FactoryDevice }) {
|
||||
)
|
||||
}
|
||||
|
||||
function buildPowerTrendDisplay(device: Extract<FactoryDevice, { type: 'power' }>) {
|
||||
const latestLabel = formatTrendTime(device.machineData?.timestamp) ?? '当前'
|
||||
const labels = appendLatestLabel(device.trend?.labels ?? [], latestLabel)
|
||||
const currentA = appendLatestTrendValue(device.trend?.currentA ?? [], parseAmp(device.machineData?.slave1?.current1), labels.length)
|
||||
const currentB = appendLatestTrendValue(device.trend?.currentB ?? [], parseAmp(device.machineData?.slave1?.current2), labels.length)
|
||||
const currentC = appendLatestTrendValue(device.trend?.currentC ?? [], parseAmp(device.machineData?.slave1?.current3), labels.length)
|
||||
|
||||
return {
|
||||
labels,
|
||||
series: [
|
||||
{ name: 'A相', values: currentA, color: '#63a4ff', step: 'end' as const },
|
||||
{ name: 'B相', values: currentB, color: '#56d08a', step: 'end' as const },
|
||||
{ name: 'C相', values: currentC, color: '#d8a13e', step: 'end' as const }
|
||||
]
|
||||
}
|
||||
}
|
||||
|
||||
function appendLatestLabel(labels: string[], latestLabel: string) {
|
||||
if (labels.length === 0) return [latestLabel]
|
||||
if (labels[labels.length - 1] === latestLabel) return labels
|
||||
|
||||
return [...labels, latestLabel]
|
||||
}
|
||||
|
||||
function appendLatestTrendValue(values: number[], latest: number | undefined, targetLength: number) {
|
||||
const fallback = Number.isFinite(latest) ? latest ?? 0 : values[values.length - 1] ?? 0
|
||||
const next = [...values]
|
||||
|
||||
while (next.length < Math.max(targetLength - 1, 0)) {
|
||||
next.push(next[next.length - 1] ?? fallback)
|
||||
}
|
||||
|
||||
if (next.length === targetLength) {
|
||||
next[next.length - 1] = fallback
|
||||
return next
|
||||
}
|
||||
|
||||
return [...next, fallback]
|
||||
}
|
||||
|
||||
function getDailyProduce(device: FactoryDevice) {
|
||||
const values = [...(device.weeklyStats?.produce ?? [])]
|
||||
if (device.type === 'cnc' && device.machineData?.todayProduce != null) {
|
||||
const lastIndex = Math.max(values.length - 1, 0)
|
||||
values[lastIndex] = device.machineData.todayProduce
|
||||
}
|
||||
return values
|
||||
}
|
||||
|
||||
function parseAmp(value?: string) {
|
||||
const number = Number.parseFloat(String(value ?? '').replace(/A$/i, ''))
|
||||
return Number.isFinite(number) ? number : undefined
|
||||
}
|
||||
|
||||
function formatTrendTime(value?: string) {
|
||||
if (!value) return undefined
|
||||
const date = new Date(value)
|
||||
if (Number.isNaN(date.getTime())) return value.slice(11, 16) || value
|
||||
return date.toTimeString().slice(0, 5)
|
||||
}
|
||||
|
||||
function FocusMetric({ label, value, unit, warn = false }: { label: string; value: string; unit?: string; warn?: boolean }) {
|
||||
return (
|
||||
<div className={`focus-metric ${warn ? 'warn' : ''}`}>
|
||||
|
||||
@ -1,6 +1,6 @@
|
||||
import { FlipNumber, WaterLevel } from '@dev-screen-starter/visual-kit'
|
||||
import { getDeviceStatus } from '../domain/deviceStatus'
|
||||
import type { CncDevice, FactoryDevice } from '../domain/deviceTypes'
|
||||
import type { FactoryDevice } from '../domain/deviceTypes'
|
||||
|
||||
type StatusSummaryProps = {
|
||||
devices: FactoryDevice[]
|
||||
@ -24,11 +24,17 @@ export function StatusSummary({ devices, weeklyLabels, weeklyProduce, todayIdx }
|
||||
const availability = devices.length ? Math.round(((devices.length - counts.offline) / devices.length) * 100) : 0
|
||||
const running = devices.length ? Math.round((counts.running / devices.length) * 100) : 0
|
||||
const maxProduce = Math.max(...weeklyProduce, 1)
|
||||
const cncDevices = devices.filter((device): device is CncDevice => device.type === 'cnc' && device.online)
|
||||
const cncTotal = cncDevices
|
||||
.reduce((sum, device) => sum + Number(device.machineData?.currentProduceCount || 0), 0)
|
||||
const todayProduce = cncDevices
|
||||
.reduce((sum, device) => sum + Number(device.weeklyStats?.produce?.[todayIdx] || 0), 0)
|
||||
const productionDevices = devices.filter((device) => (device.type === 'cnc' || device.type === 'laser') && device.online)
|
||||
const cncTotal = productionDevices.reduce((sum, device) => {
|
||||
if (device.type === 'cnc') return sum + Number(device.machineData?.currentProduceCount || 0)
|
||||
if (device.type === 'laser') return sum + Number(device.machineData?.pierceCount || 0)
|
||||
return sum
|
||||
}, 0)
|
||||
const todayProduce = productionDevices
|
||||
.reduce((sum, device) => {
|
||||
if (device.type === 'cnc') return sum + Number(device.machineData?.todayProduce ?? device.weeklyStats?.produce?.[todayIdx] ?? 0)
|
||||
return sum + Number(device.weeklyStats?.produce?.[todayIdx] ?? 0)
|
||||
}, 0)
|
||||
|
||||
return (
|
||||
<div className="status-summary">
|
||||
@ -47,7 +53,7 @@ export function StatusSummary({ devices, weeklyLabels, weeklyProduce, todayIdx }
|
||||
</div>
|
||||
|
||||
<div className="summary-total">
|
||||
<FlipNumber label="CNC 总产量" value={cncTotal.toLocaleString()} tone="blue" size="sm" />
|
||||
<FlipNumber label="总产能" value={cncTotal.toLocaleString()} tone="blue" size="sm" />
|
||||
<div className="today-produce">今日产量 <strong>{todayProduce.toLocaleString()}</strong> 件</div>
|
||||
</div>
|
||||
|
||||
|
||||
@ -12,6 +12,16 @@ export type DeviceStatus = {
|
||||
label: string
|
||||
}
|
||||
|
||||
export type DeviceTrendData = {
|
||||
labels: string[]
|
||||
produce?: number[]
|
||||
runtime?: number[]
|
||||
power?: number[]
|
||||
currentA?: number[]
|
||||
currentB?: number[]
|
||||
currentC?: number[]
|
||||
}
|
||||
|
||||
export type BaseFactoryDevice = {
|
||||
id: string
|
||||
name: string
|
||||
@ -19,6 +29,7 @@ export type BaseFactoryDevice = {
|
||||
online: boolean
|
||||
offlineReason?: string
|
||||
weeklyStats?: WeeklyStats | null
|
||||
trend?: DeviceTrendData
|
||||
}
|
||||
|
||||
export type LaserMachineData = {
|
||||
@ -57,7 +68,10 @@ export type CncMachineData = {
|
||||
runtime?: string
|
||||
cuttime?: string
|
||||
cycletime?: string
|
||||
currentForegroundDir?: string
|
||||
currentProduceCount?: number
|
||||
todayProduce?: number
|
||||
cutterNumber?: number
|
||||
programCurrent?: {
|
||||
name?: string
|
||||
number?: number
|
||||
|
||||
@ -17,6 +17,8 @@ export const factoryDevices: FactoryDevice[] = [
|
||||
pierceCount: 3728,
|
||||
cutLength: 537221.81,
|
||||
moveLength: 7271764.2,
|
||||
workTime: 6.8,
|
||||
laserTime: 4.6,
|
||||
timestamp: '2026-04-06 22:15:00',
|
||||
CutSystemState: {
|
||||
NcState: {
|
||||
@ -55,6 +57,9 @@ export const factoryDevices: FactoryDevice[] = [
|
||||
cutRate: '35.8%',
|
||||
pierceCount: 4120,
|
||||
cutLength: 680000.2,
|
||||
moveLength: 720820.6,
|
||||
workTime: 4.2,
|
||||
laserTime: 2.9,
|
||||
timestamp: '2026-04-06 22:15:00',
|
||||
CutSystemState: {
|
||||
NcState: {
|
||||
@ -98,7 +103,9 @@ export const factoryDevices: FactoryDevice[] = [
|
||||
runtime: `${320 + index * 18} H 13 M 25 S`,
|
||||
cuttime: `${2029 + index * 96} H 22 M 15 S`,
|
||||
cycletime: `0 H ${String(12 + index).padStart(2, '0')} M 30 S`,
|
||||
currentForegroundDir: '//CNC_MEM/USER/PATH1/',
|
||||
currentProduceCount: 400 + index * 870,
|
||||
cutterNumber: 4 + (index % 20),
|
||||
programCurrent: { name: `O${2168 + index}`, number: 2168 + index },
|
||||
setFeedRate: 100,
|
||||
setSpindleSpeed: 100,
|
||||
|
||||
@ -1,10 +1,12 @@
|
||||
import { ScreenStage, type ScaleMode } from '@dev-screen-starter/screen-core'
|
||||
import { useMemo, useState } from 'react'
|
||||
import { useEffect, useMemo, useState } from 'react'
|
||||
import { applyDashboardDeviceUpdate, applyDashboardTrendUpdate, connectDashboardSignalR } from '../api/dashboardSignalR'
|
||||
import { AlarmPanel } from '../components/AlarmPanel'
|
||||
import { DeviceListPanel } from '../components/DeviceListPanel'
|
||||
import { FocusDevicePanel } from '../components/FocusDevicePanel'
|
||||
import { HeaderBar } from '../components/HeaderBar'
|
||||
import { StatusSummary } from '../components/StatusSummary'
|
||||
import type { AlarmRow, FactoryDevice } from '../domain/deviceTypes'
|
||||
import { factoryAlarms, factoryDevices } from '../mock/factoryDevices'
|
||||
import { getLast7DaysChartInfo } from '../utils/weekLabels'
|
||||
|
||||
@ -19,19 +21,66 @@ function readScaleMode(): ScaleMode {
|
||||
return scaleModes.includes(value as ScaleMode) ? (value as ScaleMode) : 'fit'
|
||||
}
|
||||
|
||||
function readDataMode() {
|
||||
if (typeof window === 'undefined') return 'mock'
|
||||
return new URLSearchParams(window.location.search).get('dataMode') ?? import.meta.env.VITE_DATA_MODE ?? 'mock'
|
||||
}
|
||||
|
||||
function readSignalRUrl() {
|
||||
if (typeof window === 'undefined') return 'http://127.0.0.1:5000/dashboardHub'
|
||||
return new URLSearchParams(window.location.search).get('signalRUrl') ?? import.meta.env.VITE_DASHBOARD_SIGNALR_URL ?? 'http://127.0.0.1:5000/dashboardHub'
|
||||
}
|
||||
|
||||
export function DashboardPage() {
|
||||
const scaleMode = readScaleMode()
|
||||
const defaultFocus = factoryDevices.find((device) => device.online && device.type === 'cnc') ?? factoryDevices[0]
|
||||
const [selectedDeviceId, setSelectedDeviceId] = useState(defaultFocus.id)
|
||||
const dataMode = readDataMode()
|
||||
const signalRUrl = readSignalRUrl()
|
||||
const isSignalRMode = dataMode === 'signalr'
|
||||
const [devices, setDevices] = useState(() => (isSignalRMode ? [] : factoryDevices))
|
||||
const [alarms, setAlarms] = useState(() => (isSignalRMode ? [] : factoryAlarms))
|
||||
const [connectionState, setConnectionState] = useState(dataMode === 'signalr' ? '连接中' : 'mock 数据')
|
||||
const defaultFocus = devices.find((device) => device.online && device.type === 'cnc') ?? devices[0]
|
||||
const [selectedDeviceId, setSelectedDeviceId] = useState(defaultFocus?.id ?? '')
|
||||
const selectedDevice = useMemo(
|
||||
() => factoryDevices.find((device) => device.id === selectedDeviceId) ?? defaultFocus,
|
||||
[defaultFocus, selectedDeviceId]
|
||||
() => devices.find((device) => device.id === selectedDeviceId) ?? devices.find((device) => device.name === selectedDeviceId) ?? defaultFocus,
|
||||
[defaultFocus, devices, selectedDeviceId]
|
||||
)
|
||||
const { labels, todayIdx } = getLast7DaysChartInfo()
|
||||
const weeklyProduce = labels.map((_, index) =>
|
||||
factoryDevices.reduce((sum, device) => sum + Number(device.weeklyStats?.produce?.[index] || 0), 0)
|
||||
devices.reduce((sum, device) => sum + Number(device.weeklyStats?.produce?.[index] || 0), 0)
|
||||
)
|
||||
|
||||
useEffect(() => {
|
||||
if (!isSignalRMode) {
|
||||
setDevices(factoryDevices)
|
||||
setAlarms(factoryAlarms)
|
||||
setConnectionState('mock 数据')
|
||||
return
|
||||
}
|
||||
|
||||
return connectDashboardSignalR(signalRUrl, {
|
||||
onConnectionState: setConnectionState,
|
||||
onSnapshot: (snapshotDevices, snapshotAlarms) => {
|
||||
setDevices(snapshotDevices.reduce((next, device) => applyDashboardDeviceUpdate(next, device), [] as FactoryDevice[]))
|
||||
setAlarms(snapshotAlarms)
|
||||
},
|
||||
onDeviceUpdated: (device) => {
|
||||
setDevices((current) => applyDashboardDeviceUpdate(current, device))
|
||||
},
|
||||
onAlarmUpdated: (deviceId, nextAlarms) => {
|
||||
setAlarms((current) => mergeDeviceAlarms(current, deviceId, nextAlarms))
|
||||
},
|
||||
onTrendUpdated: (deviceId, points) => {
|
||||
setDevices((current) => applyDashboardTrendUpdate(current, deviceId, points))
|
||||
}
|
||||
})
|
||||
}, [isSignalRMode, signalRUrl])
|
||||
|
||||
useEffect(() => {
|
||||
if (selectedDevice || !defaultFocus) return
|
||||
setSelectedDeviceId(defaultFocus.id)
|
||||
}, [defaultFocus, selectedDevice])
|
||||
|
||||
return (
|
||||
<ScreenStage background="#020c20" scaleMode={scaleMode} debug>
|
||||
<div className="factory-dashboard">
|
||||
@ -39,27 +88,54 @@ export function DashboardPage() {
|
||||
|
||||
<main className="factory-main">
|
||||
<aside className="side-panel left-panel">
|
||||
<DeviceListPanel devices={factoryDevices} selectedId={selectedDevice.id} onSelect={setSelectedDeviceId} />
|
||||
<DeviceListPanel devices={devices} selectedId={selectedDevice?.id ?? ''} onSelect={setSelectedDeviceId} />
|
||||
</aside>
|
||||
|
||||
<section className="center-panel">
|
||||
<FocusDevicePanel device={selectedDevice} />
|
||||
{selectedDevice ? <FocusDevicePanel device={selectedDevice} /> : <EmptyFocusPanel connectionState={connectionState} />}
|
||||
</section>
|
||||
|
||||
<aside className="side-panel right-panel">
|
||||
<StatusSummary devices={factoryDevices} weeklyLabels={labels} weeklyProduce={weeklyProduce} todayIdx={todayIdx} />
|
||||
<AlarmPanel alarms={factoryAlarms} />
|
||||
<StatusSummary devices={devices} weeklyLabels={labels} weeklyProduce={weeklyProduce} todayIdx={todayIdx} />
|
||||
<AlarmPanel alarms={alarms} />
|
||||
</aside>
|
||||
</main>
|
||||
|
||||
<footer className="factory-footer">
|
||||
<span className="conn-dot pulse" />
|
||||
实时链路:mock 数据
|
||||
实时链路:{dataMode === 'signalr' ? `SignalR ${connectionState}` : connectionState}
|
||||
<span>超时阈值:60s</span>
|
||||
<span>历史数据:mock 同步</span>
|
||||
<span>历史数据:{dataMode === 'signalr' ? '后端推送' : 'mock 同步'}</span>
|
||||
<span>scaleMode={scaleMode}</span>
|
||||
</footer>
|
||||
</div>
|
||||
</ScreenStage>
|
||||
)
|
||||
}
|
||||
|
||||
function mergeDeviceAlarms(current: AlarmRow[], deviceId: string, nextAlarms: AlarmRow[]) {
|
||||
if (!deviceId) return nextAlarms
|
||||
return [...current.filter((alarm) => alarm.device !== deviceId), ...nextAlarms]
|
||||
}
|
||||
|
||||
function EmptyFocusPanel({ connectionState }: { connectionState: string }) {
|
||||
return (
|
||||
<section className="focus-panel status-offline">
|
||||
<header className="focus-header">
|
||||
<div>
|
||||
<span>焦点设备</span>
|
||||
<strong>等待设备数据</strong>
|
||||
</div>
|
||||
</header>
|
||||
<div className="focus-main">
|
||||
<div className="focus-realtime">
|
||||
<div className="focus-task empty">
|
||||
<span>实时链路</span>
|
||||
<strong>{connectionState}</strong>
|
||||
<small>未收到后端设备快照或实时推送</small>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</section>
|
||||
)
|
||||
}
|
||||
|
||||
@ -622,14 +622,14 @@ button {
|
||||
display: grid;
|
||||
flex: 1;
|
||||
gap: 14px;
|
||||
grid-template-rows: minmax(0, 320px) minmax(0, 1fr);
|
||||
grid-template-rows: minmax(0, 300px) minmax(0, 1fr);
|
||||
min-height: 0;
|
||||
}
|
||||
|
||||
.focus-realtime {
|
||||
display: grid;
|
||||
gap: 14px;
|
||||
grid-template-columns: 430px 1fr;
|
||||
grid-template-columns: 410px 1fr;
|
||||
min-height: 0;
|
||||
}
|
||||
|
||||
@ -639,7 +639,7 @@ button {
|
||||
border-radius: 8px;
|
||||
display: grid;
|
||||
gap: 12px;
|
||||
grid-template-columns: 190px 1fr;
|
||||
grid-template-columns: 168px 1fr;
|
||||
min-height: 0;
|
||||
padding: 14px;
|
||||
}
|
||||
@ -656,8 +656,8 @@ button {
|
||||
}
|
||||
|
||||
.focus-hero .vk-water-level-tank {
|
||||
height: 112px;
|
||||
width: 112px;
|
||||
height: 104px;
|
||||
width: 104px;
|
||||
}
|
||||
|
||||
.focus-task {
|
||||
@ -674,7 +674,7 @@ button {
|
||||
|
||||
.focus-task strong {
|
||||
color: #f0f7ff;
|
||||
font-size: 26px;
|
||||
font-size: 24px;
|
||||
margin: 10px 0;
|
||||
overflow: hidden;
|
||||
text-overflow: ellipsis;
|
||||
@ -683,14 +683,14 @@ button {
|
||||
|
||||
.focus-task small {
|
||||
color: #04b9ff;
|
||||
font-size: 16px;
|
||||
font-size: 14px;
|
||||
font-weight: 800;
|
||||
}
|
||||
|
||||
.focus-metric-grid {
|
||||
display: grid;
|
||||
gap: 10px;
|
||||
grid-template-columns: repeat(2, minmax(0, 1fr));
|
||||
gap: 8px;
|
||||
grid-template-columns: repeat(3, minmax(0, 1fr));
|
||||
}
|
||||
|
||||
.focus-metric {
|
||||
@ -701,7 +701,7 @@ button {
|
||||
flex-direction: column;
|
||||
justify-content: center;
|
||||
min-width: 0;
|
||||
padding: 12px 16px;
|
||||
padding: 10px 12px;
|
||||
}
|
||||
|
||||
.focus-metric.warn {
|
||||
@ -710,13 +710,13 @@ button {
|
||||
|
||||
.focus-metric span {
|
||||
color: #8eb8d8;
|
||||
font-size: 14px;
|
||||
margin-bottom: 10px;
|
||||
font-size: 13px;
|
||||
margin-bottom: 8px;
|
||||
}
|
||||
|
||||
.focus-metric strong {
|
||||
color: #f0f7ff;
|
||||
font-size: 28px;
|
||||
font-size: 24px;
|
||||
line-height: 1;
|
||||
overflow: hidden;
|
||||
text-overflow: ellipsis;
|
||||
@ -729,8 +729,8 @@ button {
|
||||
|
||||
.focus-metric small {
|
||||
color: #8eb8d8;
|
||||
font-size: 16px;
|
||||
margin-left: 6px;
|
||||
font-size: 13px;
|
||||
margin-left: 4px;
|
||||
}
|
||||
|
||||
.focus-trend {
|
||||
|
||||
261
doc/factory-dashboard-wms-progress.md
Normal file
261
doc/factory-dashboard-wms-progress.md
Normal file
@ -0,0 +1,261 @@
|
||||
# 工厂看板与 WMS 对接进度
|
||||
|
||||
更新时间:2026-06-01
|
||||
|
||||
本文档记录当前工厂看板项目和 WMS 后端改造的已完成工作、验证结果和后续建议。当前目标不是通用拖拽式大屏设计器,而是沉淀一个可直接承接项目需求的 React 看板基础工程,并逐步接入 WMS 后端清洗后的实时数据。
|
||||
|
||||
## 1. 当前项目定位
|
||||
|
||||
- `dev-screen-starter`:项目型大屏开发基础框架,负责屏幕适配、图表工厂、视觉组件、示例看板和客户项目模板。
|
||||
- `apps/factory-dashboard`:工厂设备看板示例项目,当前以 CNC、激光设备、配电柜为业务场景。
|
||||
- `WMS`:现有业务后端,负责 MQTT 数据接收、死区过滤、数据清洗、汇总落库,并通过 SignalR 向看板推送清洗后的数据。
|
||||
|
||||
## 2. 看板侧已完成
|
||||
|
||||
### 2.1 基础框架
|
||||
|
||||
- 已采用 React、TypeScript、Vite、pnpm workspace。
|
||||
- 已保留项目型开发模式,不做拖拽编辑器。
|
||||
- 已完成 `ScreenStage` 屏幕适配能力,支持 `fit`、`fill`、`stretch`、`none` 等缩放模式。
|
||||
- 已沉淀 `packages/charts` 图表工厂,基于 ECharts 生成常用图表 option。
|
||||
- 已沉淀 `packages/visual-kit`,用于大屏视觉装饰和展示组件。
|
||||
- 已提供 `ChartPanel`、`Panel`、`MetricCard` 等基础组合能力。
|
||||
|
||||
### 2.2 factory-dashboard 页面
|
||||
|
||||
- 已将主界面从“每台设备一个大方框”的模式,调整为更适合老板和参观人员观看的焦点设备模式。
|
||||
- 当前布局包括:
|
||||
- 左侧设备列表和设备状态入口。
|
||||
- 中间焦点设备实时信息。
|
||||
- 中间设备近 7 日产量或趋势图。
|
||||
- 右侧设备总览、今日产量、近 7 日趋势、告警列表。
|
||||
- 已支持设备点击切换焦点设备。
|
||||
- 已补齐 CNC、激光、配电柜的 mock 展示数据。
|
||||
- CNC 设备编号已统一为 `CNC-001` 到 `CNC-013`。
|
||||
- 自动滚动列表已调整到面板内显示,避免越界。
|
||||
|
||||
### 2.3 SignalR 数据接入
|
||||
|
||||
- 已新增 `@microsoft/signalr` 依赖。
|
||||
- 已新增 `apps/factory-dashboard/src/api/dashboardSignalR.ts`。
|
||||
- 看板支持通过 URL 参数或环境变量切换数据模式:
|
||||
- 默认:mock 数据。
|
||||
- `?dataMode=signalr`:连接 WMS SignalR。
|
||||
- 已支持连接 WMS `/dashboardHub`。
|
||||
- 已支持启动后调用 `GetSnapshot` 获取设备快照和当前告警。
|
||||
- 已支持监听:
|
||||
- `device.updated`
|
||||
- `alarm.updated`
|
||||
- `trend.updated`
|
||||
- 已将后端 CNC、配电柜 DTO 映射到现有前端 `FactoryDevice` 类型。
|
||||
- 页面底部已展示实时链路状态,例如 `SignalR 已连接`。
|
||||
- `dataMode=signalr` 时不再使用 mock 设备和 mock 告警兜底,避免连接失败时误展示假数据。
|
||||
- SignalR 连接失败时会展示空状态和连接错误,方便现场判断后端链路问题。
|
||||
- 告警推送已改为按设备合并和清空,避免单设备告警覆盖全局告警列表。
|
||||
|
||||
### 2.4 产量口径调整
|
||||
|
||||
- CNC 类型已新增 `todayProduce` 字段。
|
||||
- CNC 卡片的“今日产量”优先使用后端推送的 `todayProduce`。
|
||||
- 焦点设备的“今日产量”优先使用后端推送的 `todayProduce`。
|
||||
- 右侧汇总区的“今日产量”对 CNC 优先使用后端推送的 `todayProduce`。
|
||||
- mock/周统计数据仅作为无后端数据时的 fallback。
|
||||
- CNC 焦点下方图表使用后端 `DeviceProductionDaily` 的最近 7 天日期、日产量和运行时长,避免前端日期与 mock 数据错位。
|
||||
- CNC 当天产量使用实时 `todayProduce` 覆盖 7 天图表最后一天,保证当天数据及时。
|
||||
|
||||
### 2.5 配电柜趋势展示
|
||||
|
||||
- 配电柜焦点下方图表已调整为最近 1 小时三相电流趋势。
|
||||
- 趋势数据来自后端 `DeviceMetricTrendPoint`。
|
||||
- 前端用阶梯线展示死区后的稀疏趋势点,表达“数值保持到下一次变化”。
|
||||
- 图表末尾会补入最新 `device.updated` 中的实时 A/B/C 电流。
|
||||
- 如果最近 1 小时内无趋势点,但设备有当前实时值,图表仍会显示当前点,不会空白。
|
||||
|
||||
## 3. WMS 后端已完成
|
||||
|
||||
### 3.1 MQTT 接收运行控制
|
||||
|
||||
- 已新增 MQTT 全局运行状态。
|
||||
- 启动时读取 `MqttSubscription.IsEnabled`:
|
||||
- 只要存在一条启用订阅,就认为 MQTT 接收开启。
|
||||
- 全部禁用则认为 MQTT 接收关闭。
|
||||
- 前端修改订阅启用状态时,同步更新全局运行变量。
|
||||
- MQTT job 消费消息时读取全局变量,用于判断是否继续处理。
|
||||
|
||||
### 3.2 设备数据表
|
||||
|
||||
已新增并通过 EF Core 同步到 MySQL 的表:
|
||||
|
||||
- `DeviceCurrentState`
|
||||
- 保存设备当前状态。
|
||||
- 用于看板快照、设备在线状态、最后一次实时数据展示。
|
||||
- `DeviceMetricTrendPoint`
|
||||
- 保存清洗后的趋势点。
|
||||
- 用于电流趋势、转速趋势、进给趋势、运行时长等图表。
|
||||
- `DeviceAlarmRecord`
|
||||
- 保存设备告警生命周期。
|
||||
- 用于当前告警列表和后续告警统计。
|
||||
- `DeviceProductionDaily`
|
||||
- 保存设备日产能汇总。
|
||||
- 用于今日产量、日报、近 7 日产量趋势。
|
||||
|
||||
### 3.3 配电柜清洗流程
|
||||
|
||||
- 已新增 `PowerCabinetMessageProcessor`。
|
||||
- 已支持识别配电柜 MQTT payload。
|
||||
- 已提取 A/B/C 三相电流。
|
||||
- 已做电流死区过滤,减少无意义写库和推送。
|
||||
- 已更新 `DeviceCurrentState`。
|
||||
- 死区命中时不会新增 `DeviceMetricTrendPoint`,但会更新 `DeviceCurrentState.LastPayloadTime`、`LastUpdateTime` 和 `RealtimeJson`,表示设备仍在持续上报且当前值有效。
|
||||
- 已写入分钟级趋势点:
|
||||
- `currentA`
|
||||
- `currentB`
|
||||
- `currentC`
|
||||
- `currentAvg`
|
||||
- `estimatedPower`
|
||||
- `imbalanceRate`
|
||||
- 已同步配电柜异常告警。
|
||||
- 已返回统一 `ProcessingResult`,供 job 和 SignalR 推送使用。
|
||||
|
||||
### 3.4 CNC 清洗流程
|
||||
|
||||
- 已新增 `CncMessageProcessor`。
|
||||
- 已支持识别 CNC MQTT payload。
|
||||
- 已提取:
|
||||
- 设备状态。
|
||||
- 当前程序名和程序号。
|
||||
- 累计产量 `currentProduceCount`。
|
||||
- 主轴转速。
|
||||
- 进给速度。
|
||||
- 设定主轴倍率。
|
||||
- 设定进给倍率。
|
||||
- 运行时间。
|
||||
- 切削时间。
|
||||
- 循环时间。
|
||||
- 工作模式。
|
||||
- 告警信息。
|
||||
- CNC 类型和轴数。
|
||||
- 已支持设备号解析,例如从 topic 或 payload 映射到 `CNC-001`。
|
||||
- 已做死区过滤:
|
||||
- 状态、程序、产量、告警变化会触发更新。
|
||||
- 主轴转速小幅变化、进给速度小幅变化可被过滤。
|
||||
- 超过最大静默时间后仍会更新,避免长期无推送。
|
||||
- 已更新 `DeviceCurrentState`。
|
||||
- 已写入趋势点:
|
||||
- `cncProduceCount`
|
||||
- `spindleSpeed`
|
||||
- `feedRate`
|
||||
- `runtimeMinutes`
|
||||
- `cuttimeMinutes`
|
||||
- 已更新 `DeviceProductionDaily`:
|
||||
- `StartCounter`
|
||||
- `EndCounter`
|
||||
- `ProduceCount`
|
||||
- `RuntimeMinutes`
|
||||
- `CuttimeMinutes`
|
||||
- 已同步 CNC 告警。
|
||||
- 已在清洗后的实时数据中加入 `todayProduce`。
|
||||
|
||||
### 3.5 SignalR 推送服务
|
||||
|
||||
- 已新增 `DashboardHub`。
|
||||
- 已将 hub 映射到 `/dashboardHub`。
|
||||
- 已新增 CORS 策略,允许本地看板连接:
|
||||
- `http://localhost:5173`
|
||||
- `http://127.0.0.1:5173`
|
||||
- 已新增 `DashboardPushService`。
|
||||
- MQTT job 在清洗成功后会推送:
|
||||
- `device.updated`
|
||||
- `trend.updated`
|
||||
- `alarm.updated`
|
||||
- MQTT job 已调整为先保存清洗结果,再推送 SignalR,避免趋势和告警查询滞后一拍。
|
||||
- `device.updated` 使用 `ProcessingResult.ParsedData`,也就是清洗后的数据,而不是重新从原始报文解析。
|
||||
- `GetSnapshot` 会返回当前设备状态和当前活跃告警。
|
||||
- `GetSnapshot` 会从 `DeviceProductionDaily` 合并当天 CNC `todayProduce`,保证页面刚打开时也能拿到今日产量。
|
||||
- `GetSnapshot` 和 `device.updated` 会返回 CNC 最近 7 天 `DailyProduction`,作为前端 7 天产量/运行趋势的唯一数据源。
|
||||
- 配电柜 `trend.updated` 会返回最近 1 小时 `DeviceMetricTrendPoint`,并补窗口开始前最后一个有效点,保证死区稳定时趋势图不断档。
|
||||
|
||||
## 4. 当前验证结果
|
||||
|
||||
已执行并通过:
|
||||
|
||||
```bash
|
||||
dotnet build WMS.sln
|
||||
pnpm --filter @dev-screen-starter/factory-dashboard typecheck
|
||||
pnpm --filter @dev-screen-starter/factory-dashboard build
|
||||
```
|
||||
|
||||
验证情况:
|
||||
|
||||
- WMS 编译通过。
|
||||
- WMS 编译仅存在 `.NET 6` 停止支持的 SDK warning。
|
||||
- factory-dashboard 类型检查通过。
|
||||
- factory-dashboard 生产构建通过。
|
||||
- 前端构建存在 SignalR/ECharts chunk 较大的提示,不影响当前运行。
|
||||
- WMS 已可监听 `http://127.0.0.1:5000`。
|
||||
- `/dashboardHub/negotiate` 已验证返回 `200`。
|
||||
- 浏览器中 `http://localhost:5173/?scaleMode=fit&dataMode=signalr` 已可显示 SignalR 连接状态。
|
||||
|
||||
## 5. 本次提交范围
|
||||
|
||||
本次提交包含 WMS 后端和 `factory-dashboard` 看板的联动改造。
|
||||
|
||||
WMS 侧主要改动:
|
||||
|
||||
- `HHWMS.Web/Program.cs`
|
||||
- `HHWMS.Web/Areas/System/Controllers/jobs/MqttMessageJob.cs`
|
||||
- `HHWMS.Web/Areas/Hub/DashboardHub.cs`
|
||||
- `HHWMS.Web/Services/DeviceData/PowerCabinetMessageProcessor.cs`
|
||||
- `HHWMS.Web/Services/DeviceData/CncMessageProcessor.cs`
|
||||
- `HHWMS.Web/Services/DeviceData/DashboardPushService.cs`
|
||||
- `HHWMS.Web/Services/DeviceData/ProcessingResult.cs`
|
||||
|
||||
看板侧主要改动:
|
||||
|
||||
- `apps/factory-dashboard/package.json`
|
||||
- `apps/factory-dashboard/src/api/dashboardSignalR.ts`
|
||||
- `apps/factory-dashboard/src/pages/DashboardPage.tsx`
|
||||
- `apps/factory-dashboard/src/components/CncCard.tsx`
|
||||
- `apps/factory-dashboard/src/components/FocusDevicePanel.tsx`
|
||||
- `apps/factory-dashboard/src/components/StatusSummary.tsx`
|
||||
- `apps/factory-dashboard/src/domain/deviceTypes.ts`
|
||||
- `apps/factory-dashboard/src/mock/factoryDevices.ts`
|
||||
- `apps/factory-dashboard/src/styles/factory-dashboard.css`
|
||||
- `packages/charts/src/optionFactories.ts`
|
||||
- `pnpm-lock.yaml`
|
||||
- `doc/factory-dashboard-wms-progress.md`
|
||||
|
||||
## 6. 后续建议
|
||||
|
||||
### 6.1 后端优先事项
|
||||
|
||||
- 激光设备暂时继续使用外部 HTTP 信息,不纳入当前 MQTT/SignalR 清洗链路。
|
||||
- 增加看板专用查询接口:
|
||||
- 设备列表。
|
||||
- 最近 1 小时或自定义时间窗电流趋势。
|
||||
- 近 7 日产量趋势。
|
||||
- 当前告警列表。
|
||||
- 设备详情页数据。
|
||||
- 增加聚合推送事件,例如 `summary.updated`,用于推送整屏汇总指标。
|
||||
- 为 `DeviceMetricTrendPoint` 增加按设备、指标、时间范围查询能力。
|
||||
- 明确设备编码映射规则,避免 topic、payload、数据库设备号不一致。
|
||||
- 后续将 .NET 6 升级到受支持版本,减少运行环境风险。
|
||||
|
||||
### 6.2 看板优先事项
|
||||
|
||||
- 将右侧近 7 日趋势从 mock 切到后端接口。
|
||||
- 将焦点设备趋势图从 mock 切到后端接口或 SignalR 聚合数据。
|
||||
- 增加设备详情页:
|
||||
- CNC 详情。
|
||||
- 激光详情。
|
||||
- 配电柜详情。
|
||||
- 增加真实数据和 mock 数据并行调试开关。
|
||||
- 对 SignalR 断线、重连、空数据、后端异常增加更明确的页面状态。
|
||||
- 对生产环境构建做代码拆分,降低首屏 JS 体积。
|
||||
|
||||
### 6.3 数据口径建议
|
||||
|
||||
- 今日产量、总产能、近 7 日产量这类业务指标应以后端汇总表为准。
|
||||
- 前端只负责展示,不再计算核心业务口径。
|
||||
- 原始 MQTT 数据只用于采集和审计,不直接推给看板。
|
||||
- 看板实时链路统一消费后端清洗后的 WebSocket/SignalR 数据。
|
||||
@ -11,6 +11,7 @@ type AxisChartInput = {
|
||||
values: number[]
|
||||
name?: string
|
||||
color?: string
|
||||
step?: 'start' | 'middle' | 'end'
|
||||
}
|
||||
|
||||
type MultiSeriesInput = {
|
||||
@ -19,6 +20,7 @@ type MultiSeriesInput = {
|
||||
name: string
|
||||
values: number[]
|
||||
color?: string
|
||||
step?: 'start' | 'middle' | 'end'
|
||||
}>
|
||||
}
|
||||
|
||||
@ -107,6 +109,7 @@ export function createLineOption(input: AxisChartInput | MultiSeriesInput): ECha
|
||||
name: item.name,
|
||||
type: 'line' as const,
|
||||
smooth: true,
|
||||
step: item.step,
|
||||
data: item.values,
|
||||
areaStyle: { color: `${item.color ?? '#63a4ff'}22` },
|
||||
lineStyle: { color: item.color ?? '#63a4ff', width: 3 },
|
||||
@ -117,6 +120,7 @@ export function createLineOption(input: AxisChartInput | MultiSeriesInput): ECha
|
||||
name: input.name,
|
||||
type: 'line' as const,
|
||||
smooth: true,
|
||||
step: input.step,
|
||||
data: input.values,
|
||||
areaStyle: { color: `${input.color ?? '#63a4ff'}22` },
|
||||
lineStyle: { color: input.color ?? '#63a4ff', width: 3 },
|
||||
|
||||
187
pnpm-lock.yaml
generated
187
pnpm-lock.yaml
generated
@ -98,6 +98,52 @@ importers:
|
||||
specifier: ^5.9.2
|
||||
version: 5.9.3
|
||||
|
||||
apps/factory-dashboard:
|
||||
dependencies:
|
||||
'@dev-screen-starter/charts':
|
||||
specifier: workspace:*
|
||||
version: link:../../packages/charts
|
||||
'@dev-screen-starter/data':
|
||||
specifier: workspace:*
|
||||
version: link:../../packages/data
|
||||
'@dev-screen-starter/debug':
|
||||
specifier: workspace:*
|
||||
version: link:../../packages/debug
|
||||
'@dev-screen-starter/screen-core':
|
||||
specifier: workspace:*
|
||||
version: link:../../packages/screen-core
|
||||
'@dev-screen-starter/visual-kit':
|
||||
specifier: workspace:*
|
||||
version: link:../../packages/visual-kit
|
||||
'@microsoft/signalr':
|
||||
specifier: ^10.0.0
|
||||
version: 10.0.0
|
||||
'@vitejs/plugin-react':
|
||||
specifier: ^5.0.4
|
||||
version: 5.2.0(vite@7.3.3)
|
||||
echarts:
|
||||
specifier: ^6.0.0
|
||||
version: 6.1.0
|
||||
react:
|
||||
specifier: ^19.1.1
|
||||
version: 19.2.6
|
||||
react-dom:
|
||||
specifier: ^19.1.1
|
||||
version: 19.2.6(react@19.2.6)
|
||||
vite:
|
||||
specifier: ^7.1.7
|
||||
version: 7.3.3
|
||||
devDependencies:
|
||||
'@types/react':
|
||||
specifier: ^19.1.16
|
||||
version: 19.2.15
|
||||
'@types/react-dom':
|
||||
specifier: ^19.1.9
|
||||
version: 19.2.3(@types/react@19.2.15)
|
||||
typescript:
|
||||
specifier: ^5.9.2
|
||||
version: 5.9.3
|
||||
|
||||
packages/charts:
|
||||
dependencies:
|
||||
echarts:
|
||||
@ -466,6 +512,9 @@ packages:
|
||||
'@jridgewell/trace-mapping@0.3.31':
|
||||
resolution: {integrity: sha512-zzNR+SdQSDJzc8joaeP8QQoCQr8NuYx2dIIytl1QeBEZHJ9uW6hebsrYgbz8hJwUQao3TWCMtmfV8Nu1twOLAw==}
|
||||
|
||||
'@microsoft/signalr@10.0.0':
|
||||
resolution: {integrity: sha512-0BRqz/uCx3JdrOqiqgFhih/+hfTERaUfCZXFB52uMaZJrKaPRzHzMuqVsJC/V3pt7NozcNXGspjKiQEK+X7P2w==}
|
||||
|
||||
'@rolldown/pluginutils@1.0.0-rc.3':
|
||||
resolution: {integrity: sha512-eybk3TjzzzV97Dlj5c+XrBFW57eTNhzod66y9HrBlzJ6NsCrWCp/2kaPS3K9wJmurBC0Tdw4yPjXKZqlznim3Q==}
|
||||
|
||||
@ -636,6 +685,10 @@ packages:
|
||||
peerDependencies:
|
||||
vite: ^4.2.0 || ^5.0.0 || ^6.0.0 || ^7.0.0 || ^8.0.0
|
||||
|
||||
abort-controller@3.0.0:
|
||||
resolution: {integrity: sha512-h8lQ8tacZYnR3vNQTgibj+tODHI5/+l06Au2Pcriv/Gmet0eaj4TwWH41sO9wnHDiQsEj19q0drzdWdeAHtweg==}
|
||||
engines: {node: '>=6.5'}
|
||||
|
||||
baseline-browser-mapping@2.10.32:
|
||||
resolution: {integrity: sha512-wbPvpyjJPC0zdfdKXxqEL3Ea+bOMD/87X4lftiJkkaBiuG6ALQy1SLmEd7BSmVCuwCQsBrCamgBoLyfFDD1EPg==}
|
||||
engines: {node: '>=6.0.0'}
|
||||
@ -679,6 +732,14 @@ packages:
|
||||
resolution: {integrity: sha512-WUj2qlxaQtO4g6Pq5c29GTcWGDyd8itL8zTlipgECz3JesAiiOKotd8JU6otB3PACgG6xkJUyVhboMS+bje/jA==}
|
||||
engines: {node: '>=6'}
|
||||
|
||||
event-target-shim@5.0.1:
|
||||
resolution: {integrity: sha512-i/2XbnSz/uxRCU6+NdVJgKWDTM427+MqYbkQzD321DuCQJUqOuJKIA0IM2+W2xtYHdKOmZ4dR6fExsd4SXL+WQ==}
|
||||
engines: {node: '>=6'}
|
||||
|
||||
eventsource@2.0.2:
|
||||
resolution: {integrity: sha512-IzUmBGPR3+oUG9dUeXynyNmf91/3zUSJg1lCktzKw47OXuhco54U3r9B7O4XX+Rb1Itm9OZ2b0RkTs10bICOxA==}
|
||||
engines: {node: '>=12.0.0'}
|
||||
|
||||
fdir@6.5.0:
|
||||
resolution: {integrity: sha512-tIbYtZbucOs0BRGqPJkshJUYdL+SDH7dVM8gjy+ERp3WAUjLEFJE+02kanyHtwjWOnwrKYBiwAmM0p4kLJAnXg==}
|
||||
engines: {node: '>=12.0.0'}
|
||||
@ -688,6 +749,9 @@ packages:
|
||||
picomatch:
|
||||
optional: true
|
||||
|
||||
fetch-cookie@2.2.0:
|
||||
resolution: {integrity: sha512-h9AgfjURuCgA2+2ISl8GbavpUdR+WGAM2McW/ovn4tVccegp8ZqCKWSBR8uRdM8dDNlx5WdKRWxBYUwteLDCNQ==}
|
||||
|
||||
fsevents@2.3.3:
|
||||
resolution: {integrity: sha512-5xoDfX+fL7faATnagmWPpbFtwh/R77WmMMqqHGS65C3vvB0YHrgF+B1YmZ3441tMj5n63k0212XNoJwzlhffQw==}
|
||||
engines: {node: ^8.16.0 || ^10.6.0 || >=11.0.0}
|
||||
@ -721,6 +785,15 @@ packages:
|
||||
engines: {node: ^10 || ^12 || ^13.7 || ^14 || >=15.0.1}
|
||||
hasBin: true
|
||||
|
||||
node-fetch@2.7.0:
|
||||
resolution: {integrity: sha512-c4FRfUm/dbcWZ7U+1Wq0AwCyFL+3nt2bEw05wfxSz+DWpWsitgmSgYmy2dQdWyKC1694ELPqMs/YzUSNozLt8A==}
|
||||
engines: {node: 4.x || >=6.0.0}
|
||||
peerDependencies:
|
||||
encoding: ^0.1.0
|
||||
peerDependenciesMeta:
|
||||
encoding:
|
||||
optional: true
|
||||
|
||||
node-releases@2.0.46:
|
||||
resolution: {integrity: sha512-GYVXHE2KnrzAfsAjl4uP++evGFCrAU1jta4ubEjIG7YWt/64Gqv66a30yKwWczVjA6j3bM4nBwH7Pk1JmDHaxQ==}
|
||||
engines: {node: '>=18'}
|
||||
@ -736,6 +809,16 @@ packages:
|
||||
resolution: {integrity: sha512-FfR8sjd4em2T6fb3I2MwAJU7HWVMr9zba+enmQeeWFfCbm+UOC/0X4DS8XtpUTMwWMGbjKYP7xjfNekzyGmB3A==}
|
||||
engines: {node: ^10 || ^12 || >=14}
|
||||
|
||||
psl@1.15.0:
|
||||
resolution: {integrity: sha512-JZd3gMVBAVQkSs6HdNZo9Sdo0LNcQeMNP3CozBJb3JYC/QUYZTnKxP+f8oWRX4rHP5EurWxqAHTSwUCjlNKa1w==}
|
||||
|
||||
punycode@2.3.1:
|
||||
resolution: {integrity: sha512-vYt7UD1U9Wg6138shLtLOvdAu+8DsC/ilFtEVHcH+wydcSpNE20AfSOduf6MkRFahL5FY7X1oU7nKVZFtfq8Fg==}
|
||||
engines: {node: '>=6'}
|
||||
|
||||
querystringify@2.2.0:
|
||||
resolution: {integrity: sha512-FIqgj2EUvTa7R50u0rGsyTftzjYmv/a3hO345bZNrqabNqjtgiDMgmo4mkUjd+nzU5oF3dClKqFIPUKybUyqoQ==}
|
||||
|
||||
react-dom@19.2.6:
|
||||
resolution: {integrity: sha512-0prMI+hvBbPjsWnxDLxlCGyM8PN6UuWjEUCYmZhO67xIV9Xasa/r/vDnq+Xyq4Lo27g8QSbO5YzARu0D1Sps3g==}
|
||||
peerDependencies:
|
||||
@ -749,6 +832,9 @@ packages:
|
||||
resolution: {integrity: sha512-sfWGGfavi0xr8Pg0sVsyHMAOziVYKgPLNrS7ig+ivMNb3wbCBw3KxtflsGBAwD3gYQlE/AEZsTLgToRrSCjb0Q==}
|
||||
engines: {node: '>=0.10.0'}
|
||||
|
||||
requires-port@1.0.0:
|
||||
resolution: {integrity: sha512-KigOCHcocU3XODJxsu8i/j8T9tzT4adHiecwORRQ0ZZFcp7ahwXuRU1m+yuO90C5ZUyGeGfocHDI14M3L3yDAQ==}
|
||||
|
||||
rollup@4.60.4:
|
||||
resolution: {integrity: sha512-WHeFSbZYsPu3+bLoNRUuAO+wavNlocOPf3wSHTP7hcFKVnJeWsYlCDbr3mTS14FCizf9ccIxXA8sGL8zKeQN3g==}
|
||||
engines: {node: '>=18.0.0', npm: '>=8.0.0'}
|
||||
@ -761,6 +847,9 @@ packages:
|
||||
resolution: {integrity: sha512-BR7VvDCVHO+q2xBEWskxS6DJE1qRnb7DxzUrogb71CWoSficBxYsiAGd+Kl0mmq/MprG9yArRkyrQxTO6XjMzA==}
|
||||
hasBin: true
|
||||
|
||||
set-cookie-parser@2.7.2:
|
||||
resolution: {integrity: sha512-oeM1lpU/UvhTxw+g3cIfxXHyJRc/uidd3yK1P242gzHds0udQBYzs3y8j4gCCW+ZJ7ad0yctld8RYO+bdurlvw==}
|
||||
|
||||
source-map-js@1.2.1:
|
||||
resolution: {integrity: sha512-UXWMKhLOwVKb728IUtQPXxfYU+usdybtUrK/8uGE8CQMvrhOpwvzDBwj0QhSL7MQc7vIsISBG8VQ8+IDQxpfQA==}
|
||||
engines: {node: '>=0.10.0'}
|
||||
@ -769,6 +858,13 @@ packages:
|
||||
resolution: {integrity: sha512-pn99VhoACYR8nFHhxqix+uvsbXineAasWm5ojXoN8xEwK5Kd3/TrhNn1wByuD52UxWRLy8pu+kRMniEi6Eq9Zg==}
|
||||
engines: {node: '>=12.0.0'}
|
||||
|
||||
tough-cookie@4.1.4:
|
||||
resolution: {integrity: sha512-Loo5UUvLD9ScZ6jh8beX1T6sO1w2/MpCRpEP7V280GKMVUQ0Jzar2U3UJPsrdbziLEMMhu3Ujnq//rhiFuIeag==}
|
||||
engines: {node: '>=6'}
|
||||
|
||||
tr46@0.0.3:
|
||||
resolution: {integrity: sha512-N3WMsuqV66lT30CrXNbEjx4GEwlow3v6rr4mCcv6prnfwhS01rkgyFdjPNBYd9br7LpXV1+Emh01fHnq2Gdgrw==}
|
||||
|
||||
tslib@2.3.0:
|
||||
resolution: {integrity: sha512-N82ooyxVNm6h1riLCoyS9e3fuJ3AMG2zIZs2Gd1ATcSFjSA23Q0fzjjZeh0jbJvWVDZ0cJT8yaNNaaXHzueNjg==}
|
||||
|
||||
@ -777,12 +873,19 @@ packages:
|
||||
engines: {node: '>=14.17'}
|
||||
hasBin: true
|
||||
|
||||
universalify@0.2.0:
|
||||
resolution: {integrity: sha512-CJ1QgKmNg3CwvAv/kOFmtnEN05f0D/cn9QntgNOQlQF9dgvVTHj3t+8JPdjqawCHk7V/KA+fbUqzZ9XWhcqPUg==}
|
||||
engines: {node: '>= 4.0.0'}
|
||||
|
||||
update-browserslist-db@1.2.3:
|
||||
resolution: {integrity: sha512-Js0m9cx+qOgDxo0eMiFGEueWztz+d4+M3rGlmKPT+T4IS/jP4ylw3Nwpu6cpTTP8R1MAC1kF4VbdLt3ARf209w==}
|
||||
hasBin: true
|
||||
peerDependencies:
|
||||
browserslist: '>= 4.21.0'
|
||||
|
||||
url-parse@1.5.10:
|
||||
resolution: {integrity: sha512-WypcfiRhfeUP9vvF0j6rw0J3hrWrw6iZv3+22h6iRMJ/8z1Tj6XfLP4DsUix5MhMPnXpiHDoKyoZ/bdCkwBCiQ==}
|
||||
|
||||
vite@7.3.3:
|
||||
resolution: {integrity: sha512-/4XH147Ui7OGTjg3HbdWe5arnZQSbfuRzdr9Ec7TQi5I7R+ir0Rlc9GIvD4v0XZurELqA035KVXJXpR61xhiTA==}
|
||||
engines: {node: ^20.19.0 || >=22.12.0}
|
||||
@ -823,6 +926,24 @@ packages:
|
||||
yaml:
|
||||
optional: true
|
||||
|
||||
webidl-conversions@3.0.1:
|
||||
resolution: {integrity: sha512-2JAn3z8AR6rjK8Sm8orRC0h/bcl/DqL7tRPdGZ4I1CjdF+EaMLmYxBHyXuKL849eucPFhvBoxMsflfOb8kxaeQ==}
|
||||
|
||||
whatwg-url@5.0.0:
|
||||
resolution: {integrity: sha512-saE57nupxk6v3HY35+jzBwYa0rKSy0XR8JSxZPwgLr7ys0IBzhGviA1/TUGJLmSVqs8pb9AnvICXEuOHLprYTw==}
|
||||
|
||||
ws@7.5.11:
|
||||
resolution: {integrity: sha512-zS54Oen9bITtp7kp2XM3AydrCIq1D+HwJOuH+c+e4LfpL/lotP5osijd+UoMnxwAam1GN8R4KtLAyIrIcBNpiA==}
|
||||
engines: {node: '>=8.3.0'}
|
||||
peerDependencies:
|
||||
bufferutil: ^4.0.1
|
||||
utf-8-validate: ^5.0.2
|
||||
peerDependenciesMeta:
|
||||
bufferutil:
|
||||
optional: true
|
||||
utf-8-validate:
|
||||
optional: true
|
||||
|
||||
yallist@3.1.1:
|
||||
resolution: {integrity: sha512-a4UGQaWPH59mOXUYnAG2ewncQS4i4F43Tv3JoAM+s2VDAmS9NsK8GpDMLrCHPksFT7h3K6TOoUNn2pb7RoXx4g==}
|
||||
|
||||
@ -1040,6 +1161,18 @@ snapshots:
|
||||
'@jridgewell/resolve-uri': 3.1.2
|
||||
'@jridgewell/sourcemap-codec': 1.5.5
|
||||
|
||||
'@microsoft/signalr@10.0.0':
|
||||
dependencies:
|
||||
abort-controller: 3.0.0
|
||||
eventsource: 2.0.2
|
||||
fetch-cookie: 2.2.0
|
||||
node-fetch: 2.7.0
|
||||
ws: 7.5.11
|
||||
transitivePeerDependencies:
|
||||
- bufferutil
|
||||
- encoding
|
||||
- utf-8-validate
|
||||
|
||||
'@rolldown/pluginutils@1.0.0-rc.3': {}
|
||||
|
||||
'@rollup/rollup-android-arm-eabi@4.60.4':
|
||||
@ -1160,6 +1293,10 @@ snapshots:
|
||||
transitivePeerDependencies:
|
||||
- supports-color
|
||||
|
||||
abort-controller@3.0.0:
|
||||
dependencies:
|
||||
event-target-shim: 5.0.1
|
||||
|
||||
baseline-browser-mapping@2.10.32: {}
|
||||
|
||||
browserslist@4.28.2:
|
||||
@ -1218,10 +1355,19 @@ snapshots:
|
||||
|
||||
escalade@3.2.0: {}
|
||||
|
||||
event-target-shim@5.0.1: {}
|
||||
|
||||
eventsource@2.0.2: {}
|
||||
|
||||
fdir@6.5.0(picomatch@4.0.4):
|
||||
optionalDependencies:
|
||||
picomatch: 4.0.4
|
||||
|
||||
fetch-cookie@2.2.0:
|
||||
dependencies:
|
||||
set-cookie-parser: 2.7.2
|
||||
tough-cookie: 4.1.4
|
||||
|
||||
fsevents@2.3.3:
|
||||
optional: true
|
||||
|
||||
@ -1241,6 +1387,10 @@ snapshots:
|
||||
|
||||
nanoid@3.3.12: {}
|
||||
|
||||
node-fetch@2.7.0:
|
||||
dependencies:
|
||||
whatwg-url: 5.0.0
|
||||
|
||||
node-releases@2.0.46: {}
|
||||
|
||||
picocolors@1.1.1: {}
|
||||
@ -1253,6 +1403,14 @@ snapshots:
|
||||
picocolors: 1.1.1
|
||||
source-map-js: 1.2.1
|
||||
|
||||
psl@1.15.0:
|
||||
dependencies:
|
||||
punycode: 2.3.1
|
||||
|
||||
punycode@2.3.1: {}
|
||||
|
||||
querystringify@2.2.0: {}
|
||||
|
||||
react-dom@19.2.6(react@19.2.6):
|
||||
dependencies:
|
||||
react: 19.2.6
|
||||
@ -1262,6 +1420,8 @@ snapshots:
|
||||
|
||||
react@19.2.6: {}
|
||||
|
||||
requires-port@1.0.0: {}
|
||||
|
||||
rollup@4.60.4:
|
||||
dependencies:
|
||||
'@types/estree': 1.0.8
|
||||
@ -1297,6 +1457,8 @@ snapshots:
|
||||
|
||||
semver@6.3.1: {}
|
||||
|
||||
set-cookie-parser@2.7.2: {}
|
||||
|
||||
source-map-js@1.2.1: {}
|
||||
|
||||
tinyglobby@0.2.16:
|
||||
@ -1304,16 +1466,32 @@ snapshots:
|
||||
fdir: 6.5.0(picomatch@4.0.4)
|
||||
picomatch: 4.0.4
|
||||
|
||||
tough-cookie@4.1.4:
|
||||
dependencies:
|
||||
psl: 1.15.0
|
||||
punycode: 2.3.1
|
||||
universalify: 0.2.0
|
||||
url-parse: 1.5.10
|
||||
|
||||
tr46@0.0.3: {}
|
||||
|
||||
tslib@2.3.0: {}
|
||||
|
||||
typescript@5.9.3: {}
|
||||
|
||||
universalify@0.2.0: {}
|
||||
|
||||
update-browserslist-db@1.2.3(browserslist@4.28.2):
|
||||
dependencies:
|
||||
browserslist: 4.28.2
|
||||
escalade: 3.2.0
|
||||
picocolors: 1.1.1
|
||||
|
||||
url-parse@1.5.10:
|
||||
dependencies:
|
||||
querystringify: 2.2.0
|
||||
requires-port: 1.0.0
|
||||
|
||||
vite@7.3.3:
|
||||
dependencies:
|
||||
esbuild: 0.27.7
|
||||
@ -1325,6 +1503,15 @@ snapshots:
|
||||
optionalDependencies:
|
||||
fsevents: 2.3.3
|
||||
|
||||
webidl-conversions@3.0.1: {}
|
||||
|
||||
whatwg-url@5.0.0:
|
||||
dependencies:
|
||||
tr46: 0.0.3
|
||||
webidl-conversions: 3.0.1
|
||||
|
||||
ws@7.5.11: {}
|
||||
|
||||
yallist@3.1.1: {}
|
||||
|
||||
zrender@6.1.0:
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user