agentworkshop 0.7.21 → 0.7.22
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.output/nitro.json +1 -1
- package/.output/public/_nuxt/{BA3XzwiD.js → 0exC4jVL.js} +1 -1
- package/.output/public/_nuxt/BAbAEW0D.js +1 -0
- package/.output/public/_nuxt/{DBXhDLgl.js → BuiGDfMB.js} +1 -1
- package/.output/public/_nuxt/Ci0uX4c4.js +1 -0
- package/.output/public/_nuxt/D6B0xnjk.js +1 -0
- package/.output/public/_nuxt/{TownView.BHLKAjEu.css → TownView.zu2rU5nS.css} +1 -1
- package/.output/public/_nuxt/_id_.C2VHq_vT.css +1 -0
- package/.output/public/_nuxt/_id_.Dswy2p0I.css +1 -0
- package/.output/public/_nuxt/builds/latest.json +1 -1
- package/.output/public/_nuxt/builds/meta/e2341fc0-6f3f-4680-abf8-935a7c9fb912.json +1 -0
- package/.output/public/_nuxt/{BOJaHO5V.js → c3mwkHWP.js} +2 -2
- package/.output/public/_nuxt/daq.BTdEun-8.css +1 -0
- package/.output/public/_nuxt/dbi5bHkY.js +2 -0
- package/.output/public/_nuxt/{DsOkkMX3.js → jyQyulh-.js} +1 -1
- package/.output/public/_nuxt/{B-E8fXAO.js → n3vMFfrv.js} +1 -1
- package/.output/server/chunks/_/nitro.mjs +873 -748
- package/.output/server/chunks/_/nitro.mjs.map +1 -1
- package/.output/server/chunks/build/{TownView-ql2eHZOg.mjs → TownView-DxeQe1Bl.mjs} +144 -143
- package/.output/server/chunks/build/{TownView-ql2eHZOg.mjs.map → TownView-DxeQe1Bl.mjs.map} +1 -1
- package/.output/server/chunks/build/{_id_-CwR5oLu9.mjs → _id_-B9RvEQFC.mjs} +33 -35
- package/.output/server/chunks/build/_id_-B9RvEQFC.mjs.map +1 -0
- package/.output/server/chunks/build/{_id_-Bs-euJPu.mjs → _id_-CqF0R5W5.mjs} +138 -137
- package/.output/server/chunks/build/_id_-CqF0R5W5.mjs.map +1 -0
- package/.output/server/chunks/build/{_wsId_-B3aB9bIp.mjs → _wsId_-YC2t_fRt.mjs} +3 -3
- package/.output/server/chunks/build/{_wsId_-B3aB9bIp.mjs.map → _wsId_-YC2t_fRt.mjs.map} +1 -1
- package/.output/server/chunks/build/{daq-epWL_sC7.mjs → daq-Bhwwz9vp.mjs} +146 -118
- package/.output/server/chunks/build/daq-Bhwwz9vp.mjs.map +1 -0
- package/.output/server/chunks/build/{pages-Dq7_H4FK.mjs → pages-D9tOoJsf.mjs} +2 -2
- package/.output/server/chunks/build/{pages-Dq7_H4FK.mjs.map → pages-D9tOoJsf.mjs.map} +1 -1
- package/.output/server/chunks/build/{town-CstiKxf_.mjs → town-Dsh0jlwZ.mjs} +3 -3
- package/.output/server/chunks/build/{town-CstiKxf_.mjs.map → town-Dsh0jlwZ.mjs.map} +1 -1
- package/.output/server/chunks/build/{useDaqStream-BOOZ-p-l.mjs → useDaqStream-DkRL3tEW.mjs} +9 -1
- package/.output/server/chunks/build/{useDaqStream-BOOZ-p-l.mjs.map → useDaqStream-DkRL3tEW.mjs.map} +1 -1
- package/.output/server/chunks/routes/api/workshop/daq/_id/bind.post.mjs +1 -1
- package/.output/server/chunks/routes/api/workshop/daq/_id/bind.post.mjs.map +1 -1
- package/.output/server/chunks/routes/api/workshop/daq/_id/bindings.put.mjs +34 -0
- package/.output/server/chunks/routes/api/workshop/daq/_id/bindings.put.mjs.map +1 -0
- package/.output/server/chunks/routes/api/workshop/dcw/_id/bind.post.mjs +1 -1
- package/.output/server/chunks/routes/api/workshop/dcw/_id/bind.post.mjs.map +1 -1
- package/.output/server/chunks/routes/api/workshop/dcw/_id/bindings.put.mjs +33 -0
- package/.output/server/chunks/routes/api/workshop/dcw/_id/bindings.put.mjs.map +1 -0
- package/.output/server/chunks/routes/renderer.mjs +1 -1
- package/.output/server/chunks/virtual/entry.mjs +6 -6
- package/.output/server/chunks/virtual/precomputed.mjs +1 -1
- package/.output/server/package.json +1 -1
- package/app/components/workshop/town/TownView.vue +7082 -7076
- package/app/composables/workshop/useDaqStream.ts +10 -0
- package/app/pages/daq/[id].vue +4 -3
- package/app/pages/daq/index.vue +66 -21
- package/app/pages/dcw/[id].vue +5 -1
- package/package.json +148 -148
- package/scripts/_dbg-device-bind-e2e.mjs +129 -0
- package/server/api/workshop/daq/[id]/bind.post.ts +5 -2
- package/server/api/workshop/daq/[id]/bindings.put.ts +22 -0
- package/server/api/workshop/dcw/[id]/bind.post.ts +4 -2
- package/server/api/workshop/dcw/[id]/bindings.put.ts +21 -0
- package/server/data/daqs.json +408 -103
- package/server/data/dcw-lines.json +7 -0
- package/server/data/dcw-rollback.json +10 -10
- package/server/data/dcw-runs.json +25 -27
- package/server/data/dcw-writes.json +12 -0
- package/server/data/dcws.json +216 -216
- package/server/data/line-runs.json +18 -18
- package/server/services/workshop/agents/industrial-context.ts +231 -222
- package/server/services/workshop/daq/daq-controller.ts +76 -23
- package/server/services/workshop/daq/daq-node.ts +11 -1
- package/server/services/workshop/dcw/dcw-controller.ts +50 -2
- package/server/services/workshop/dcw/dcw-node.ts +10 -1
- package/shared/daq-protocol.ts +2 -0
- package/shared/dcw-protocol.ts +2 -0
- package/.output/public/_nuxt/B_C3GLsD.js +0 -1
- package/.output/public/_nuxt/Ba7YofCb.js +0 -2
- package/.output/public/_nuxt/CgT5wMfz.js +0 -1
- package/.output/public/_nuxt/D4CLp1hc.js +0 -1
- package/.output/public/_nuxt/_id_.DIxEKj88.css +0 -1
- package/.output/public/_nuxt/_id_.IbmpkhH4.css +0 -1
- package/.output/public/_nuxt/builds/meta/5d344836-03a5-4f47-a0a7-fd30192f5a8f.json +0 -1
- package/.output/public/_nuxt/daq.6IrhVVfy.css +0 -1
- package/.output/server/chunks/build/_id_-Bs-euJPu.mjs.map +0 -1
- package/.output/server/chunks/build/_id_-CwR5oLu9.mjs.map +0 -1
- package/.output/server/chunks/build/daq-epWL_sC7.mjs.map +0 -1
|
@@ -637,35 +637,40 @@ class DaqController {
|
|
|
637
637
|
private siblingsOf(bindingId: string): DaqNode[] {
|
|
638
638
|
const hit = this.siblingsCache.get(bindingId)
|
|
639
639
|
if (hit && Date.now() - hit.at < 1000) return hit.list
|
|
640
|
-
const list = this.repo.all().filter(n => n.
|
|
640
|
+
const list = this.repo.all().filter(n => n.deviceIds.includes(bindingId))
|
|
641
641
|
if (this.siblingsCache.size > 500) this.siblingsCache.clear()
|
|
642
642
|
this.siblingsCache.set(bindingId, { at: Date.now(), list })
|
|
643
643
|
return list
|
|
644
644
|
}
|
|
645
645
|
|
|
646
646
|
private writeBackTelemetry(node: DaqNode): void {
|
|
647
|
-
if (
|
|
647
|
+
if (node.deviceIds.length === 0 || node.value == null) return
|
|
648
648
|
const host = getDaqHostPorts()
|
|
649
649
|
if (!host) return // 端口未装配(边缘独立/装配前):不攒积压,直接跳过回写
|
|
650
650
|
const key = findDaqTemplate(node.templateKey)?.telemetryKey ?? node.templateKey
|
|
651
|
-
//
|
|
652
|
-
|
|
653
|
-
const
|
|
654
|
-
|
|
655
|
-
|
|
656
|
-
|
|
657
|
-
|
|
658
|
-
|
|
659
|
-
|
|
660
|
-
|
|
661
|
-
|
|
662
|
-
|
|
663
|
-
|
|
664
|
-
|
|
665
|
-
|
|
651
|
+
// 多对多绑定:向每台绑定设备回写通道值;同设备多节点取最严重节点态
|
|
652
|
+
// (alarm > warn > ok/offline),避免"最近写者定态"抖动
|
|
653
|
+
for (const deviceId of node.deviceIds) {
|
|
654
|
+
const siblings = this.siblingsOf(deviceId)
|
|
655
|
+
const worst = siblings.some(n => n.state === 'alarm')
|
|
656
|
+
? 'alarm'
|
|
657
|
+
: siblings.some(n => n.state === 'warn') ? 'warn' : 'ok'
|
|
658
|
+
const acc = this.pendingBackfill.get(deviceId) ?? {}
|
|
659
|
+
acc[key] = node.value
|
|
660
|
+
this.pendingBackfill.set(deviceId, acc)
|
|
661
|
+
const res = host.telemetry.applyTelemetry(deviceId, acc, worst)
|
|
662
|
+
if (!res.ok) {
|
|
663
|
+
// 目标设备已被删除:从本节点解绑该设备(其余绑定保留),链路自愈
|
|
664
|
+
this.pendingBackfill.delete(deviceId)
|
|
665
|
+
node.deviceIds = node.deviceIds.filter(d => d !== deviceId)
|
|
666
|
+
node.deviceBindingId = node.deviceIds[0] ?? null
|
|
667
|
+
this.repo.flushNow()
|
|
668
|
+
this.emitNodeChanged('updated', node)
|
|
669
|
+
continue
|
|
670
|
+
}
|
|
671
|
+
this.pendingBackfill.delete(deviceId)
|
|
672
|
+
if (res.twinId) this.pushTwinTelemetry(res.twinId)
|
|
666
673
|
}
|
|
667
|
-
this.pendingBackfill.delete(node.deviceBindingId)
|
|
668
|
-
if (res.twinId) this.pushTwinTelemetry(res.twinId)
|
|
669
674
|
}
|
|
670
675
|
|
|
671
676
|
/** 遥测 WS 推送(1s/设备节流):孪生状态/遥测事件化直推,前端全量轮询降级为断线兜底 */
|
|
@@ -935,22 +940,70 @@ class DaqController {
|
|
|
935
940
|
|
|
936
941
|
bind(id: string, deviceId: string | null): DaqNode {
|
|
937
942
|
const node = this.repo.byId(id)
|
|
938
|
-
if (!node) throw
|
|
943
|
+
if (!node) throw new AppError(404, ErrorCodes.NOT_FOUND, `数采节点不存在: ${id}`)
|
|
939
944
|
if (deviceId && !getDaqHostPorts()?.telemetry.deviceExists(deviceId)) {
|
|
940
|
-
throw
|
|
945
|
+
throw new AppError(404, ErrorCodes.NOT_FOUND, `目标设备不存在: ${deviceId}`)
|
|
941
946
|
}
|
|
947
|
+
// 排他语义保留(deviceId=null 清空全部);多对多增删用 bindDevice/unbindDeviceNode/setDeviceBindings
|
|
948
|
+
node.deviceIds = deviceId ? [deviceId] : []
|
|
942
949
|
node.deviceBindingId = deviceId
|
|
943
950
|
this.repo.flushNow()
|
|
944
951
|
this.emitNodeChanged('updated', node)
|
|
945
952
|
return node
|
|
946
953
|
}
|
|
947
954
|
|
|
955
|
+
/** 追加一台绑定设备((节点,设备)对唯一;已绑定则幂等返回) */
|
|
956
|
+
bindDevice(id: string, deviceId: string): DaqNode {
|
|
957
|
+
const node = this.repo.byId(id)
|
|
958
|
+
if (!node) throw new AppError(404, ErrorCodes.NOT_FOUND, `数采节点不存在: ${id}`)
|
|
959
|
+
if (!getDaqHostPorts()?.telemetry.deviceExists(deviceId)) {
|
|
960
|
+
throw new AppError(404, ErrorCodes.NOT_FOUND, `目标设备不存在: ${deviceId}`)
|
|
961
|
+
}
|
|
962
|
+
if (node.deviceIds.includes(deviceId)) return node
|
|
963
|
+
node.deviceIds = [...node.deviceIds, deviceId]
|
|
964
|
+
node.deviceBindingId = node.deviceIds[0] ?? null
|
|
965
|
+
this.repo.flushNow()
|
|
966
|
+
this.emitNodeChanged('updated', node)
|
|
967
|
+
return node
|
|
968
|
+
}
|
|
969
|
+
|
|
970
|
+
/** 解绑一台设备(其余绑定保留) */
|
|
971
|
+
unbindDeviceNode(id: string, deviceId: string): DaqNode {
|
|
972
|
+
const node = this.repo.byId(id)
|
|
973
|
+
if (!node) throw Object.assign(new Error(`数采节点不存在: ${id}`), { status: 404 })
|
|
974
|
+
if (!node.deviceIds.includes(deviceId)) return node
|
|
975
|
+
node.deviceIds = node.deviceIds.filter(d => d !== deviceId)
|
|
976
|
+
node.deviceBindingId = node.deviceIds[0] ?? null
|
|
977
|
+
this.repo.flushNow()
|
|
978
|
+
this.emitNodeChanged('updated', node)
|
|
979
|
+
return node
|
|
980
|
+
}
|
|
981
|
+
|
|
982
|
+
/** 整体设定绑定设备列表(去重、校验存在性;全量替换) */
|
|
983
|
+
setDeviceBindings(id: string, deviceIds: string[]): DaqNode {
|
|
984
|
+
const node = this.repo.byId(id)
|
|
985
|
+
if (!node) throw Object.assign(new Error(`数采节点不存在: ${id}`), { status: 404 })
|
|
986
|
+
const unique = [...new Set(deviceIds.map(String).filter(Boolean))]
|
|
987
|
+
for (const d of unique) {
|
|
988
|
+
if (!getDaqHostPorts()?.telemetry.deviceExists(d)) {
|
|
989
|
+
throw new AppError(404, ErrorCodes.NOT_FOUND, `目标设备不存在: ${d}`)
|
|
990
|
+
}
|
|
991
|
+
}
|
|
992
|
+
node.deviceIds = unique
|
|
993
|
+
node.deviceBindingId = unique[0] ?? null
|
|
994
|
+
this.repo.flushNow()
|
|
995
|
+
this.emitNodeChanged('updated', node)
|
|
996
|
+
return node
|
|
997
|
+
}
|
|
998
|
+
|
|
948
999
|
/** 设备删除级联:解绑其全部 DAQ 节点 + 清回写积压 + 广播(链路不再依赖下次回写失败自愈) */
|
|
949
1000
|
unbindDevice(deviceId: string): void {
|
|
950
1001
|
this.pendingBackfill.delete(deviceId)
|
|
1002
|
+
this.siblingsCache.delete(deviceId)
|
|
951
1003
|
for (const node of this.repo.all()) {
|
|
952
|
-
if (node.
|
|
953
|
-
node.
|
|
1004
|
+
if (!node.deviceIds.includes(deviceId)) continue
|
|
1005
|
+
node.deviceIds = node.deviceIds.filter(d => d !== deviceId)
|
|
1006
|
+
node.deviceBindingId = node.deviceIds[0] ?? null
|
|
954
1007
|
this.repo.flushNow()
|
|
955
1008
|
this.emitNodeChanged('updated', node)
|
|
956
1009
|
}
|
|
@@ -29,6 +29,8 @@ interface DaqNodeOptions {
|
|
|
29
29
|
warnLow?: number | null
|
|
30
30
|
warnHigh?: number | null
|
|
31
31
|
deviceBindingId?: string | null
|
|
32
|
+
/** 多对多绑定(权威):deviceIds 去重列表;deviceBindingId 为兼容别名(首个) */
|
|
33
|
+
deviceIds?: string[]
|
|
32
34
|
/** 数据语义标定钩子(decoder:采集值 → 物理值) */
|
|
33
35
|
transform?: DataTransform
|
|
34
36
|
posX?: number
|
|
@@ -60,6 +62,8 @@ export class DaqNode {
|
|
|
60
62
|
warnLow: number | null
|
|
61
63
|
warnHigh: number | null
|
|
62
64
|
deviceBindingId: string | null
|
|
65
|
+
/** 多对多设备绑定(权威字段;去重有序) */
|
|
66
|
+
deviceIds: string[]
|
|
63
67
|
driverConfig: Record<string, string | number | boolean>
|
|
64
68
|
transform?: DataTransform
|
|
65
69
|
posX?: number
|
|
@@ -94,7 +98,10 @@ export class DaqNode {
|
|
|
94
98
|
// 预警带缺省 = 量程两端各收 8%(越带即 warn,越硬限即 alarm)
|
|
95
99
|
this.warnLow = o.warnLow !== undefined ? o.warnLow : this.min !== undefined && tpl ? +(this.min + (this.max - this.min) * 0.08).toFixed(this.decimals) : null
|
|
96
100
|
this.warnHigh = o.warnHigh !== undefined ? o.warnHigh : tpl ? +(this.max - (this.max - this.min) * 0.08).toFixed(this.decimals) : null
|
|
97
|
-
|
|
101
|
+
// 多对多迁移:legacy deviceBindingId(单绑)→ deviceIds 首位;去重保序
|
|
102
|
+
const legacy = o.deviceBindingId ?? null
|
|
103
|
+
this.deviceIds = [...new Set([...(o.deviceIds ?? []), ...(legacy ? [legacy] : [])])].filter(Boolean)
|
|
104
|
+
this.deviceBindingId = this.deviceIds[0] ?? legacy ?? null
|
|
98
105
|
this.driverConfig = o.driverConfig ?? {}
|
|
99
106
|
if (o.transform) this.transform = o.transform
|
|
100
107
|
if (o.posX !== undefined) this.posX = o.posX
|
|
@@ -183,6 +190,7 @@ export class DaqNode {
|
|
|
183
190
|
warnLow: this.warnLow,
|
|
184
191
|
warnHigh: this.warnHigh,
|
|
185
192
|
deviceBindingId: this.deviceBindingId,
|
|
193
|
+
deviceIds: this.deviceIds,
|
|
186
194
|
driverConfig: this.driverConfig,
|
|
187
195
|
transform: this.transform,
|
|
188
196
|
posX: this.posX,
|
|
@@ -212,6 +220,7 @@ export class DaqNode {
|
|
|
212
220
|
warnLow: row.warnLow === undefined ? undefined : (row.warnLow == null ? null : Number(row.warnLow)),
|
|
213
221
|
warnHigh: row.warnHigh === undefined ? undefined : (row.warnHigh == null ? null : Number(row.warnHigh)),
|
|
214
222
|
deviceBindingId: row.deviceBindingId === undefined ? undefined : (row.deviceBindingId == null ? null : String(row.deviceBindingId)),
|
|
223
|
+
deviceIds: Array.isArray(row.deviceIds) ? row.deviceIds.map(String).filter(Boolean) : undefined,
|
|
215
224
|
driverConfig: (row.driverConfig as Record<string, string | number | boolean>) ?? {},
|
|
216
225
|
transform: (row.transform as DataTransform | undefined) ?? undefined,
|
|
217
226
|
posX: row.posX == null ? undefined : Number(row.posX),
|
|
@@ -246,6 +255,7 @@ export class DaqNode {
|
|
|
246
255
|
warnLow: this.warnLow,
|
|
247
256
|
warnHigh: this.warnHigh,
|
|
248
257
|
deviceBindingId: this.deviceBindingId,
|
|
258
|
+
deviceIds: this.deviceIds,
|
|
249
259
|
driverConfig: this.driverConfig,
|
|
250
260
|
transform: this.transform,
|
|
251
261
|
posX: this.posX,
|
|
@@ -61,6 +61,7 @@ export interface DcwCreateInput {
|
|
|
61
61
|
posX?: number
|
|
62
62
|
posZ?: number
|
|
63
63
|
deviceBindingId?: string | null
|
|
64
|
+
deviceIds?: string[]
|
|
64
65
|
/** 所属产线('' = 未分配) */
|
|
65
66
|
lineId?: string
|
|
66
67
|
/** 节点级工艺语义备注(覆盖模板) */
|
|
@@ -345,6 +346,7 @@ class DcwController {
|
|
|
345
346
|
min: input.min,
|
|
346
347
|
max: input.max,
|
|
347
348
|
deviceBindingId: input.deviceBindingId ?? null,
|
|
349
|
+
deviceIds: input.deviceIds ?? (input.deviceBindingId ? [input.deviceBindingId] : []),
|
|
348
350
|
posX: input.posX,
|
|
349
351
|
posZ: input.posZ,
|
|
350
352
|
lineId: input.lineId,
|
|
@@ -427,17 +429,63 @@ class DcwController {
|
|
|
427
429
|
const twin = getDeviceTwinRepo().findById(deviceId)
|
|
428
430
|
if (!twin) throw new AppError(404, ErrorCodes.NOT_FOUND, `目标设备不存在: ${deviceId}`)
|
|
429
431
|
}
|
|
432
|
+
// 排他语义保留;多对多增删用 bindDevice/unbindDeviceNode/setDeviceBindings
|
|
433
|
+
node.deviceIds = deviceId ? [deviceId] : []
|
|
430
434
|
node.deviceBindingId = deviceId
|
|
431
435
|
this.repo.flushNow()
|
|
432
436
|
this.emitNodeChanged('updated', node)
|
|
433
437
|
return node
|
|
434
438
|
}
|
|
435
439
|
|
|
440
|
+
/** 追加一台绑定设备((节点,设备)对唯一;幂等) */
|
|
441
|
+
bindDevice(id: string, deviceId: string): DcwNode {
|
|
442
|
+
const node = this.repo.byId(id)
|
|
443
|
+
if (!node) throw new AppError(404, ErrorCodes.NOT_FOUND, `控制节点不存在: ${id}`)
|
|
444
|
+
const twin = getDeviceTwinRepo().findById(deviceId)
|
|
445
|
+
if (!twin) throw new AppError(404, ErrorCodes.NOT_FOUND, `目标设备不存在: ${deviceId}`)
|
|
446
|
+
if (node.deviceIds.includes(deviceId)) return node
|
|
447
|
+
node.deviceIds = [...node.deviceIds, deviceId]
|
|
448
|
+
node.deviceBindingId = node.deviceIds[0] ?? null
|
|
449
|
+
this.repo.flushNow()
|
|
450
|
+
this.emitNodeChanged('updated', node)
|
|
451
|
+
return node
|
|
452
|
+
}
|
|
453
|
+
|
|
454
|
+
/** 解绑一台设备(其余绑定保留) */
|
|
455
|
+
unbindDeviceNode(id: string, deviceId: string): DcwNode {
|
|
456
|
+
const node = this.repo.byId(id)
|
|
457
|
+
if (!node) throw new AppError(404, ErrorCodes.NOT_FOUND, `控制节点不存在: ${id}`)
|
|
458
|
+
if (!node.deviceIds.includes(deviceId)) return node
|
|
459
|
+
node.deviceIds = node.deviceIds.filter(d => d !== deviceId)
|
|
460
|
+
node.deviceBindingId = node.deviceIds[0] ?? null
|
|
461
|
+
this.repo.flushNow()
|
|
462
|
+
this.emitNodeChanged('updated', node)
|
|
463
|
+
return node
|
|
464
|
+
}
|
|
465
|
+
|
|
466
|
+
/** 整体设定绑定设备列表(去重、校验存在性;全量替换) */
|
|
467
|
+
setDeviceBindings(id: string, deviceIds: string[]): DcwNode {
|
|
468
|
+
const node = this.repo.byId(id)
|
|
469
|
+
if (!node) throw new AppError(404, ErrorCodes.NOT_FOUND, `控制节点不存在: ${id}`)
|
|
470
|
+
const unique = [...new Set(deviceIds.map(String).filter(Boolean))]
|
|
471
|
+
for (const d of unique) {
|
|
472
|
+
if (!getDeviceTwinRepo().findById(d)) {
|
|
473
|
+
throw new AppError(404, ErrorCodes.NOT_FOUND, `目标设备不存在: ${d}`)
|
|
474
|
+
}
|
|
475
|
+
}
|
|
476
|
+
node.deviceIds = unique
|
|
477
|
+
node.deviceBindingId = unique[0] ?? null
|
|
478
|
+
this.repo.flushNow()
|
|
479
|
+
this.emitNodeChanged('updated', node)
|
|
480
|
+
return node
|
|
481
|
+
}
|
|
482
|
+
|
|
436
483
|
/** 设备删除级联解绑(device-twins 删除路由调用) */
|
|
437
484
|
unbindDevice(deviceId: string): void {
|
|
438
485
|
for (const node of this.repo.all()) {
|
|
439
|
-
if (node.
|
|
440
|
-
node.
|
|
486
|
+
if (!node.deviceIds.includes(deviceId)) continue
|
|
487
|
+
node.deviceIds = node.deviceIds.filter(d => d !== deviceId)
|
|
488
|
+
node.deviceBindingId = node.deviceIds[0] ?? null
|
|
441
489
|
this.repo.flushNow()
|
|
442
490
|
this.emitNodeChanged('updated', node)
|
|
443
491
|
}
|
|
@@ -23,6 +23,8 @@ interface DcwNodeOptions {
|
|
|
23
23
|
min?: number
|
|
24
24
|
max?: number
|
|
25
25
|
deviceBindingId?: string | null
|
|
26
|
+
/** 多对多绑定(权威):deviceIds 去重列表 */
|
|
27
|
+
deviceIds?: string[]
|
|
26
28
|
driverConfig?: Record<string, string | number | boolean>
|
|
27
29
|
/** 数据语义标定钩子(encode:物理值 → PLC 设定值;回读经 decoder 校验) */
|
|
28
30
|
transform?: DataTransform
|
|
@@ -49,6 +51,8 @@ export class DcwNode {
|
|
|
49
51
|
min: number
|
|
50
52
|
max: number
|
|
51
53
|
deviceBindingId: string | null
|
|
54
|
+
/** 多对多设备绑定(权威字段;去重有序) */
|
|
55
|
+
deviceIds: string[]
|
|
52
56
|
driverConfig: Record<string, string | number | boolean>
|
|
53
57
|
transform?: DataTransform
|
|
54
58
|
posX?: number
|
|
@@ -83,7 +87,9 @@ export class DcwNode {
|
|
|
83
87
|
this.decimals = o.decimals ?? tpl?.decimals ?? 2
|
|
84
88
|
this.min = o.min ?? tpl?.min ?? 0
|
|
85
89
|
this.max = o.max ?? tpl?.max ?? 100
|
|
86
|
-
|
|
90
|
+
const legacyD = o.deviceBindingId ?? null
|
|
91
|
+
this.deviceIds = [...new Set([...(o.deviceIds ?? []), ...(legacyD ? [legacyD] : [])])].filter(Boolean)
|
|
92
|
+
this.deviceBindingId = this.deviceIds[0] ?? legacyD ?? null
|
|
87
93
|
this.driverConfig = o.driverConfig ?? {}
|
|
88
94
|
if (o.transform) this.transform = o.transform
|
|
89
95
|
if (o.posX !== undefined) this.posX = o.posX
|
|
@@ -148,6 +154,7 @@ export class DcwNode {
|
|
|
148
154
|
min: this.min,
|
|
149
155
|
max: this.max,
|
|
150
156
|
deviceBindingId: this.deviceBindingId,
|
|
157
|
+
deviceIds: this.deviceIds,
|
|
151
158
|
driverConfig: this.driverConfig,
|
|
152
159
|
transform: this.transform,
|
|
153
160
|
posX: this.posX,
|
|
@@ -179,6 +186,7 @@ export class DcwNode {
|
|
|
179
186
|
min: row.min != null ? Number(row.min) : undefined,
|
|
180
187
|
max: row.max != null ? Number(row.max) : undefined,
|
|
181
188
|
deviceBindingId: row.deviceBindingId === undefined ? undefined : (row.deviceBindingId == null ? null : String(row.deviceBindingId)),
|
|
189
|
+
deviceIds: Array.isArray(row.deviceIds) ? row.deviceIds.map(String).filter(Boolean) : undefined,
|
|
182
190
|
driverConfig: (row.driverConfig as Record<string, string | number | boolean>) ?? {},
|
|
183
191
|
transform: (row.transform as DataTransform | undefined) ?? undefined,
|
|
184
192
|
posX: row.posX == null ? undefined : Number(row.posX),
|
|
@@ -224,6 +232,7 @@ export class DcwNode {
|
|
|
224
232
|
min: this.min,
|
|
225
233
|
max: this.max,
|
|
226
234
|
deviceBindingId: this.deviceBindingId,
|
|
235
|
+
deviceIds: this.deviceIds,
|
|
227
236
|
driverConfig: this.driverConfig,
|
|
228
237
|
transform: this.transform,
|
|
229
238
|
posX: this.posX,
|
package/shared/daq-protocol.ts
CHANGED
|
@@ -384,6 +384,8 @@ export interface DaqNodeView {
|
|
|
384
384
|
warnHigh: number | null
|
|
385
385
|
/** 绑定的设备孪生 id(null = 未绑定) */
|
|
386
386
|
deviceBindingId: string | null
|
|
387
|
+
/** 多对多设备绑定(权威;去重有序;deviceBindingId=首个,兼容别名) */
|
|
388
|
+
deviceIds: string[]
|
|
387
389
|
/** 数据语义标定钩子(decoder:PLC 采集值 → 物理值) */
|
|
388
390
|
transform?: DataTransform
|
|
389
391
|
/** 节点级采集语义备注(覆盖模板 semantics) */
|
package/shared/dcw-protocol.ts
CHANGED
|
@@ -250,6 +250,8 @@ export interface DcwNodeView {
|
|
|
250
250
|
min: number
|
|
251
251
|
max: number
|
|
252
252
|
deviceBindingId: string | null
|
|
253
|
+
/** 多对多设备绑定(权威;去重有序;deviceBindingId=首个,兼容别名) */
|
|
254
|
+
deviceIds: string[]
|
|
253
255
|
driverConfig: Record<string, string | number | boolean>
|
|
254
256
|
posX?: number
|
|
255
257
|
posZ?: number
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{H as e,U as t,W as n,q as r}from"./rqZ-1SoP.js";import{B as i,C as a,G as o,H as s,Ht as c,St as l,Ut as ee,Wt as u,a as d,b as f,f as p,ft as m,g as h,h as g,mt as _,nt as te,p as v,rt as y,t as b,x as ne}from"./BSCpFtzG.js";import{a as re}from"./vJ4FPb-_.js";import{t as ie}from"./D8CqF0yy.js";import{n as ae}from"./BeIfu4N3.js";import{t as oe}from"./C9f8QMp12.js";import{t as x}from"./G0qIw7Gq2.js";import{n as se,t as ce}from"./DAR70Lf5.js";import{t as le}from"./DBXhDLgl.js";import{t as ue}from"./BWC4HQHQ.js";var de={key:0,class:`page`},fe={class:`banner bad`},pe={key:1,class:`page`},me={class:`aw-page-head`},he={class:`aw-kicker`},ge={class:`sub`},_e={class:`badges mono`},ve={class:`badge`},ye={class:`badge`},be={class:`badge`},xe={class:`aw-tile ctrl-card`},Se={class:`ctrl-left`},Ce=[`title`],we={class:`ctrl-right`},Te={class:`ctrl-metrics mono`},Ee=[`title`],De=[`title`],Oe=[`title`],ke={key:1,class:`aw-tile adopt-card`},Ae={class:`adopt-title`},je={class:`adopt-list`},Me=[`onClick`],Ne=[`onClick`],Pe={class:`aw-tile line-card`},Fe={class:`line-status`},Ie={class:`line-info`},Le={key:0,class:`mono dim`},Re={key:1,class:`dim`},ze={class:`line-ctl`},Be={class:`ctl-sel`},Ve={value:``},He=[`value`],Ue={class:`ctl-sel`},We=[`disabled`],Ge={value:``},Ke=[`value`,`disabled`],qe=[`disabled`,`title`],Je=[`disabled`],Ye={key:0,class:`banner bad`,style:{"margin-top":`10px`}},Xe={key:1,class:`banner good`,style:{"margin-top":`10px`}},Ze={class:`modal`},Qe={class:`m-title`},$e={class:`dim mono`},et={class:`dim tpl-hint`},tt={class:`tpl-chips`},nt=[`title`],rt={class:`mono`},it={class:`sec-label`},at={class:`f-grid tpl-form`},ot={class:`f`},st=[`placeholder`],ct={class:`f`},lt=[`placeholder`],ut={class:`f`},dt={class:`f`},ft={class:`f`},pt=[`placeholder`],mt={class:`f`},ht=[`placeholder`],gt={class:`f`},_t={class:`f`},vt=[`value`],yt={class:`f`},bt=[`placeholder`],xt={key:0,class:`banner good`,style:{"margin-top":`10px`}},St={key:1,class:`m-err`},Ct={class:`m-actions`},wt=[`disabled`],Tt={class:`modal`},Et={class:`m-title`},Dt={class:`seg-row`},Ot={class:`f-grid`},kt={class:`f`},At=[`value`],jt={class:`f`},Mt=[`placeholder`],Nt={class:`f`},Pt=[`placeholder`],Ft={class:`f`},It=[`placeholder`],Lt={class:`f-grid cal-form`},Rt={class:`f`},zt={value:`none`},Bt={class:`f`},Vt={style:{display:`flex`,gap:`6px`}},Ht=[`disabled`],Ut=[`disabled`],Wt={class:`f-grid`},Gt={class:`f`},Kt=[`value`],qt={key:0,class:`f-grid driver-form`},Jt={key:0,style:{color:`var(--tone-danger-dot)`,"font-style":`normal`}},Yt=[`onUpdate:modelValue`],Xt=[`value`],Zt=[`onUpdate:modelValue`,`type`,`placeholder`],Qt={key:2,class:`hint`},$t={class:`test-row`},en=[`disabled`],tn={class:`f`},nn=[`placeholder`],rn={key:1,class:`m-err`},an={class:`m-actions`},on=[`disabled`],sn={class:`aw-tile table-card`},cn={class:`nodes-table`},ln={class:`right`},un={class:`mono dim`},dn={class:`mono ch`},fn=[`disabled`,`title`,`onClick`],pn={key:0,class:`st-pill paused`},mn={class:`mono val`},hn={key:0,class:`dim`},gn={class:`mono val`},_n=[`title`],vn={key:0,class:`dim`},yn=[`disabled`,`title`,`onClick`],bn={class:`write-row`},xn=[`onUpdate:modelValue`,`placeholder`,`min`,`max`,`step`,`disabled`,`title`],Sn=[`disabled`,`title`,`onClick`],Cn={class:`mono dim`},wn={class:`mono`},Tn=[`title`],En={class:`right`},Dn=[`onClick`],On={key:0},kn={colspan:`9`},An={class:`pane-empty`,style:{"min-height":`120px`}},jn={class:`pe-sub`},Mn={class:`aw-tile recipe-card`},Nn={class:`recipe-hd`},Pn={class:`panel-tag mono`},Fn={class:`recipe-sub`},In={key:0,class:`product-row`},Ln=[`title`,`onClick`],Rn=[`title`,`onClick`],zn={key:1,class:`dim`,style:{margin:`6px 0 12px`,"font-size":`12px`}},Bn={class:`recipe-grid`},Vn={class:`recipe-name`},Hn=[`title`],Un={class:`dim`},Wn={class:`mono dim`},Gn={key:0,class:`dim desc`},Kn={class:`recipe-params mono`},qn=[`title`],Jn={key:0,class:`chip-stale-tag`},Yn=[`title`],Xn={key:0,class:`chip-stale-tag`},Zn={class:`recipe-actions`},Qn=[`onClick`],$n=[`onClick`],er=[`onClick`],tr={key:0,class:`mono`},nr=[`onClick`],rr={key:0,class:`pane-empty`,style:{"grid-column":`1 / -1`}},ir={key:2,class:`banner good`},ar=[`disabled`],or={key:3,class:`runs`},sr={class:`sec-label`},cr={class:`nodes-table`},lr={class:`right`},ur={class:`mono`},dr={class:`mono dim`},fr={class:`right`},pr=[`disabled`,`onClick`],mr=[`onClick`],hr={class:`modal`},gr={class:`m-title`},_r={class:`sec-label`},vr={class:`nodes-table`},yr={class:`mono dim`},br={class:`mono`},xr={class:`mono`},Sr={class:`mono dim`},Cr={class:`mono dim`},wr={key:0},Tr={colspan:`6`,class:`dim`,style:{"text-align":`center`,padding:`12px`}},Er={class:`sec-label`},Dr={class:`nodes-table`},Or={class:`mono`},kr={class:`mono dim`},Ar={class:`mono dim`},jr={key:0},Mr={colspan:`6`,class:`dim`,style:{"text-align":`center`,padding:`12px`}},Nr={class:`m-actions`},Pr={class:`modal`},Fr={class:`m-title`},Ir={class:`f-grid`},Lr={class:`f`},Rr=[`value`],zr={class:`f`},Br=[`placeholder`],Vr={class:`f`},Hr=[`placeholder`],Ur={class:`sec-label`},Wr={class:`f`},Gr=[`onUpdate:modelValue`],Kr=[`value`],qr={key:0,class:`row-stale`},Jr={class:`f`},Yr=[`onUpdate:modelValue`],Xr={class:`f`},Zr=[`onUpdate:modelValue`,`placeholder`],Qr={class:`f`},$r=[`onUpdate:modelValue`,`placeholder`],ei=[`onClick`],ti={class:`sec-label`},ni={class:`f`},ri=[`onUpdate:modelValue`],ii=[`value`],ai={class:`f`},oi=[`onUpdate:modelValue`],si={class:`f`},ci=[`onUpdate:modelValue`],li=[`onClick`],ui=[`disabled`,`title`],di={key:0,class:`m-note`},fi={key:1,class:`m-err`},pi={class:`m-actions`},mi=[`disabled`],hi={class:`modal`,style:{"max-width":`760px`}},gi={class:`modal-head`},_i={key:0,class:`dim`,style:{"margin-left":`8px`,"font-size":`12px`}},vi={key:0,class:`banner good`,style:{margin:`6px 0`}},yi={key:1,class:`dim`},bi={key:2,class:`pane-empty`},xi={class:`ver-head`},Si={class:`mono ver-v`},Ci={class:`mono dim`},wi={class:`ver-actor`},Ti=[`onClick`],Ei={key:0,class:`ver-desc`},Di={class:`ver-diff mono`},Oi={class:`aw-tile query-card`},ki={class:`sec-label`},Ai={class:`q-grid`},ji={class:`f`},Mi={value:``},Ni=[`value`],Pi={class:`f`},Fi=[`disabled`],Ii={value:``},Li=[`value`],Ri={class:`f`},zi={value:``},Bi=[`value`],Vi={class:`f`},Hi={value:``},Ui=[`value`],Wi={class:`f`},Gi={class:`f`},Ki={class:`f q-actions`},qi=[`disabled`],Ji={key:0,class:`banner bad`,style:{"margin-top":`8px`}},Yi={key:1,class:`q-result`},Xi={class:`nodes-table`},Zi={class:`mono dim`},Qi={class:`mono`},$i={class:`mono`},ea={class:`mono`},ta={class:`mono dim`},na={key:6,class:`aw-tile table-card`},ra={class:`sec-label`},ia={class:`nodes-table`},aa={class:`mono dim`},oa={class:`mono`},sa={class:`mono dim`},ca={class:`dim`},la={class:`modal`},ua={class:`m-title`},da={class:`f-grid`},fa={class:`f`},pa=[`placeholder`],ma={class:`f`},ha=[`placeholder`],ga={key:0,class:`m-err`},_a={class:`m-actions`},va=[`disabled`],ya={key:8,class:`err`},ba={class:`aw-tile ledger-card`},xa={class:`ledger-head`},Sa={value:``},Ca=[`value`],wa={class:`ledger-tri`},Ta={class:`tri-cell`},Ea={class:`mono`},Da={class:`tri-cell`},Oa={class:`mono`},ka={class:`tri-cell`},Aa={class:`mono`},ja={class:`ledger-cols`},Ma={class:`ledger-col`},Na={class:`sec-t`},Pa={class:`ledger-list mono`},Fa={class:`ledger-col`},Ia={class:`sec-t`},La={class:`ledger-list`},Ra={class:`mono`},za=b(a({__name:`[id]`,setup(a){let{t:b}=ae(),za=re(),S=ce(),Ba=le(),Va=ue();Ba.load();let C=p(()=>String(za.params.id??``)),w=p(()=>S.lines.find(e=>e.id===C.value)),T=p(()=>S.lineStateOf(C.value));S.load();let Ha=S.ensureWsFeed();i(()=>Ha());let Ua=e=>e?Va.twins.find(t=>t.id===e)?.name??e:b(`dcwDetail.k3own4q121`),Wa={idle:b(`dcwDetail.k3zgkk122`),writing:b(`dcwDetail.k3l3h80123`),ok:`已 ACK`,error:b(`dcwDetail.k40reu124`),offline:b(`dcwDetail.k44c2n125`)};function Ga(e){let t=e??``;return S.templates.find(e=>e.key===(t.startsWith(`dcw-`)?t.slice(4):t))?.ch??t}function Ka(e){return S.nodeById(e)?.min}function qa(e){return S.nodeById(e)?.max}let Ja=p(()=>Ba.nodes.filter(e=>e.lineId===C.value)),E=_(``),D=_(null),Ya=_(!1);async function Xa(){if(E.value){Ya.value=!0;try{D.value=await S.fetchLedger(E.value)}finally{Ya.value=!1}}}async function Za(){E.value&&(await S.rollbackNode(E.value),await Xa())}function Qa(e){return Ba.nodeById(e)?.name??e}let O=p(()=>S.nodes.filter(e=>e.lineId===C.value)),k=p(()=>S.products.filter(e=>e.lineId===C.value)),$a=p(()=>S.recipes.filter(e=>e.lineId===C.value)),eo=p(()=>S.runs.filter(e=>e.lineId===C.value)),to=p(()=>{let e=new Set(O.value.map(e=>e.id));return S.history.filter(t=>e.has(t.nodeId))}),no=p(()=>S.nodes.filter(e=>!e.lineId)),ro=p(()=>S.products.filter(e=>!e.lineId));async function io(e){await S.patchNode(e,{lineId:C.value});let t=S.nodeById(e);t&&(t.lineId=C.value)}async function ao(e){await S.updateProduct(e,{lineId:C.value}),await S.load()}let A=m({}),oo=_(``),j=_(``),so=_(``);async function co(e,t){oo.value=e,j.value=``,so.value=``;try{let n=await S.write(e,t);n.ok?(so.value=b(`dcwDetail.k1alcbyu182`,{p0:S.nodeById(e)?.name??e,p1:n.message}),A[e]=``):j.value=b(`dcwDetail.kl1e9x9183`,{p0:S.nodeById(e)?.name??e,p1:n.message})}catch(e){j.value=x(e)}finally{oo.value=``}}let lo=_(``);async function uo(e){lo.value=e,j.value=``;try{await S.readNode(e)}catch(e){j.value=x(e)}finally{lo.value=``}}let fo=_(``);async function po(e,t){fo.value=e,j.value=``;try{await S.patchNode(e,{enabled:t});let n=S.nodeById(e);n&&(n.enabled=t,t?n.state===`offline`&&(n.state=`idle`):n.state=`offline`)}catch(e){j.value=x(e)}finally{fo.value=``}}let mo=_(!1),ho=_(`mock`),go=_(S.templates[0]?.key??``),M=_(`mock`),_o=_(``),vo=_(null),yo=_(null),N=_({}),P=m({kind:`none`,scale:1,offset:0}),bo=_(``),xo=_(!1),F=_(null),So=_(!1),Co=_(``),wo=p(()=>se.find(e=>e.kind===M.value)),To=p(()=>wo.value?.configFields??[]);function Eo(){let e={};for(let t of To.value)t.default!==void 0&&(e[t.key]=t.default);N.value=e,F.value=null}Eo();async function Do(){xo.value=!0,F.value=null;try{F.value=await S.testDriver(M.value,N.value)}catch(e){F.value={ok:!1,message:x(e)}}finally{xo.value=!1}}async function Oo(){So.value=!0,Co.value=``;try{for(let e of To.value)if(e.required&&(N.value[e.key]===void 0||N.value[e.key]===``))throw Error(b(`dcwDetail.k8x1un1184`,{p0:e.label}));let e=P.kind===`linear`?{kind:`linear`,scale:Number(P.scale),offset:Number(P.offset)}:void 0;await S.createFromTemplate(`dcw-${go.value}`,{name:_o.value.trim()||void 0,driver:M.value,driverConfig:{...N.value},transform:e,holdIntervalMs:vo.value,readIntervalMs:yo.value,lineId:C.value,semantics:bo.value.trim()||void 0}),mo.value=!1,_o.value=``,bo.value=``}catch(e){Co.value=x(e)}finally{So.value=!1}}let ko=_(!1),Ao=_(!1),jo=_(``),Mo=_(``);function No(){ko.value=!0,jo.value=``,Mo.value=``}let I=m({name:``,ch:``,code:``,unit:``,min:``,max:``,decimals:1,icon:`gateway`,semantics:``}),Po=[{key:`thermo`,label:b(`dcwDetail.k422b8126`)},{key:`pressure`,label:b(`dcwDetail.k3x6ff127`)},{key:`tension`,label:b(`dcwDetail.k3z9xc128`)},{key:`encoder`,label:b(`dcwDetail.kjb3vhs129`)},{key:`camera`,label:b(`dcwDetail.k47atw130`)},{key:`gateway`,label:b(`dcwDetail.k48c07131`)}];async function Fo(){Ao.value=!0,jo.value=``,Mo.value=``;try{if(!I.name.trim())throw Error(b(`dcwDetail.k6ugbw2132`));if(I.unit.trim()===``)throw Error(b(`dcwDetail.kx3pg59133`));if(I.min===``||I.max===``)throw Error(b(`dcwDetail.k13awowo134`));let e=await S.createTemplate({name:I.name.trim(),ch:I.ch.trim()||I.name.trim(),code:I.code.trim()||`CUSTOM`,unit:I.unit.trim(),min:Number(I.min),max:Number(I.max),decimals:Number(I.decimals)||0,icon:I.icon,semantics:I.semantics.trim()||void 0});go.value=e.key,Mo.value=b(`dcwDetail.ky4e1tr185`,{p0:e.name}),I.name=``,I.ch=``,I.code=``,I.unit=``,I.min=``,I.max=``,I.semantics=``}catch(e){jo.value=x(e)}finally{Ao.value=!1}}let L=_(``),R=_(``),z=_(!1),B=_(``),V=_(``),Io=p(()=>$a.value.filter(e=>e.productId===L.value));async function Lo(){z.value=!0,B.value=``,V.value=``;try{if(!R.value)throw Error(b(`dcwDetail.k1b6qe0r135`));await S.startLine(C.value,R.value),B.value=b(`dcwDetail.k17jteb9186`,{p0:T.value.productName,p1:T.value.recipeName,p2:T.value.runId})}catch(e){V.value=x(e)}finally{z.value=!1}}async function Ro(){z.value=!0,B.value=``,V.value=``;try{let e=`${T.value.productName??``} · ${T.value.recipeName??``}`;await S.stopLine(C.value),B.value=b(`dcwDetail.kzl49pd187`,{p0:e})}catch(e){V.value=x(e)}finally{z.value=!1}}let zo=_(!1),Bo=_(!1),Vo=_(``),H=m({name:``,description:``}),U=_(``);async function Ho(){Bo.value=!0,Vo.value=``;try{let e=await S.createProduct({name:H.name.trim(),description:H.description.trim(),lineId:C.value});L.value=e.id,U.value=e.id,zo.value=!1,H.name=``,H.description=``}catch(e){Vo.value=x(e)}finally{Bo.value=!1}}let Uo=p(()=>U.value?$a.value.filter(e=>e.productId===U.value):$a.value),Wo=e=>S.products.find(t=>t.id===e)?.name??e;function W(e,t){let n=S.nodes.find(t=>t.id===e);return n?n.enabled?t&&n.lineId!==t?{code:`unbound`,label:b(`dcwDetail.staleUnbound`)}:null:{code:`disabled`,label:b(`dcwDetail.staleDisabled`)}:{code:`deleted`,label:b(`dcwDetail.staleDeleted`)}}function Go(e){return S.nodes.find(t=>t.id===e)?.name??e}function Ko(e,t){let n=Ba.nodes.find(t=>t.id===e);return n?n.enabled?t&&n.lineId!==t?{code:`unbound`,label:b(`dcwDetail.staleUnbound`)}:null:{code:`disabled`,label:b(`dcwDetail.staleDisabled`)}:{code:`deleted`,label:b(`dcwDetail.staleDeleted`)}}let qo=_(!1),G=_(null),Jo=_([]),Yo=_(!1),K=_(``);async function Xo(e){G.value=S.recipes.find(t=>t.id===e)??null,qo.value=!0,K.value=``,Yo.value=!0;try{Jo.value=await S.recipeVersions(e)}catch(e){K.value=x(e)}finally{Yo.value=!1}}let Zo=e=>e===`agent`?`Agent`:b(e===`system`?`dcwDetail.srcSystem`:`dcwDetail.srcUser`);function Qo(e,t){if(t===0)return b(`dcwDetail.histInit`);let n=Jo.value[t-1],r=e.params.map(e=>({p:e,old:n.params.find(t=>t.nodeId===e.nodeId)})).filter(({p:e,old:t})=>!t||t.value!==e.value).map(({p:e,old:t})=>`${S.nodes.find(t=>t.id===e.nodeId)?.name??e.nodeId}: ${t?.value??b(`dcwDetail.histAdded`)} → ${e.value}`);return r.length>0?r.join(`;`):b(`dcwDetail.histNoChange`)}async function $o(e){if(G.value){K.value=``;try{let t=await S.revertRecipe(G.value.id,{version:e,reason:b(`dcwDetail.revertReasonUi`)});K.value=b(`dcwDetail.revertOk`,{p0:t.version??0}),Jo.value=await S.recipeVersions(G.value.id)}catch(e){K.value=x(e)}}}let q=m({productId:``,recipeId:``,paramKey:``,nodeId:``,lastMin:30,bucketMs:15e3}),es=_(null),ts=_(!1),ns=_(``);async function rs(){ts.value=!0,ns.value=``,es.value=null;try{es.value=await S.queryLine({lineId:C.value,productId:q.productId||void 0,recipeId:q.recipeId||void 0,paramKey:q.paramKey||void 0,nodeId:q.nodeId||void 0,fromMs:Date.now()-q.lastMin*6e4,toMs:Date.now(),bucketMs:q.bucketMs>0?q.bucketMs:void 0,limit:2e3}),es.value.channels.length===0&&(ns.value=b(`dcwDetail.kszv5sq136`))}catch(e){ns.value=x(e)}finally{ts.value=!1}}let is=p(()=>S.templates.map(e=>e.key)),J=_(!1),Y=_(null),as=_(!1),X=_(``),os=_(``),Z=m({productId:``,name:``,description:``,params:[],daqWindows:[]}),Q=_(null),$=_(null),ss=_(!1);function cs(){Y.value=null,X.value=``,Z.productId=U.value||L.value||k.value[0]?.id||``,Z.name=``,Z.description=``,Z.params=[{nodeId:O.value[0]?.id??``,value:``,min:``,max:``}],Z.daqWindows=[],J.value=!0}function ls(e){let t=S.recipes.find(t=>t.id===e);if(!t)return;Y.value=e,X.value=``;let n=t.params.filter(e=>S.nodes.some(t=>t.id===e.nodeId)),r=t.params.length-n.length;os.value=r>0?b(`dcwDetail.staleDropped`,{p0:r}):``,Z.productId=t.productId,Z.name=t.name,Z.description=t.description,Z.params=n.map(e=>({nodeId:e.nodeId,value:e.value,min:e.min??``,max:e.max??``})),Z.daqWindows=(t.daqWindows??[]).map(e=>({nodeId:e.nodeId,min:e.min??``,max:e.max??``})),J.value=!0}async function us(){as.value=!0,X.value=``;try{let e={productId:Z.productId,name:Z.name.trim(),description:Z.description.trim(),params:Z.params.filter(e=>e.nodeId&&e.value!==``&&Number.isFinite(Number(e.value))).map(e=>({nodeId:e.nodeId,value:Number(e.value),...e.min!==``&&Number.isFinite(Number(e.min))?{min:Number(e.min)}:{},...e.max!==``&&Number.isFinite(Number(e.max))?{max:Number(e.max)}:{}})),daqWindows:Z.daqWindows.filter(e=>e.nodeId&&(e.min!==``||e.max!==``)).map(e=>({nodeId:e.nodeId,...e.min!==``&&Number.isFinite(Number(e.min))?{min:Number(e.min)}:{},...e.max!==``&&Number.isFinite(Number(e.max))?{max:Number(e.max)}:{}}))};Y.value?await S.updateRecipe(Y.value,e):await S.createRecipe(e),J.value=!1}catch(e){X.value=x(e)}finally{as.value=!1}}async function ds(e){Q.value=null,j.value=``;try{let t=await S.applyRecipe(e),n=t.results.filter(e=>e.ok).length;Q.value={runId:t.id,ok:n,total:t.results.length},n<t.results.length&&(j.value=b(`dcwDetail.ks7szkt188`,{p0:t.results.filter(e=>!e.ok).map(e=>e.message).join(`;`)}))}catch(e){j.value=x(e)}}async function fs(e){ss.value=!0;try{let t=await S.runData(e);$.value={runId:e,data:t}}catch(e){j.value=x(e)}finally{ss.value=!1}}function ps(e){let t=e?.value??e?.avg;return t==null?`--`:String(Math.round(t*1e3)/1e3)}return(i,a)=>{let p=ie,m=oe;return l(S).loaded&&!w.value?(s(),h(`div`,de,[v(`p`,fe,u(i.$t(`dcwDetail.k19337yp018`)),1),ne(p,{class:`pill-btn`,to:`/dcw`},{default:te(()=>[f(u(i.$t(`dcwDetail.kllwu1c019`)),1)]),_:1})])):(s(),h(`div`,pe,[v(`div`,me,[v(`div`,null,[v(`p`,he,[v(`span`,{class:`line-chip`,style:ee({background:w.value?.color??`#3aa0ff`})},null,4),f(`AGENTWORKSHOP / LINE / `+u(w.value?.name??C.value),1)]),v(`h1`,null,u(w.value?.name??i.$t(`dcwDetail.k1b2snna151`))+` · `+u(i.$t(`dcwDetail.k1l0iow1137`)),1),v(`p`,ge,u(w.value?.description||i.$t(`dcwDetail.kzcbfki152`)),1)]),v(`div`,_e,[v(`span`,ve,u(i.$t(`dcwDetail.k45uio082`))+` `+u(O.value.length),1),v(`span`,ye,u(i.$t(`dcwDetail.k3waz1025`))+` `+u(k.value.length),1),v(`span`,be,u(i.$t(`dcwDetail.k48grv027`))+` `+u($a.value.length),1)])]),v(`section`,xe,[v(`div`,Se,[v(`button`,{class:c([`aw-pill`,{running:l(S).controller.running}]),title:i.$t(`dcwDetail.k1snap154`),onClick:a[0]||=e=>l(S).startStop(l(S).controller.running?`pause`:`resume`)},[v(`span`,{class:c(l(S).controller.running?`i-tabler-player-pause`:`i-tabler-player-play`)},null,2),f(` `+u(l(S).controller.running?i.$t(`dcwDetail.kplrsg153`):i.$t(`dcwDetail.knxgni9169`)),1)],10,Ce)]),v(`div`,we,[v(`span`,Te,[v(`span`,null,u(i.$t(`dcwDetail.k45uio082`))+` `+u(l(S).controller.nodesOnline)+`/`+u(l(S).controller.nodesTotal),1),a[55]||=v(`span`,{class:`sep`},`·`,-1),v(`span`,{title:i.$t(`dcwDetail.kd3ygmn001`)},u(i.$t(`dcwDetail.k3wtib138`))+` `+u(l(S).controller.writesTotal),9,Ee),a[56]||=v(`span`,{class:`sep`},`·`,-1),v(`span`,{class:c({warn:l(S).controller.writesFailed>0}),title:i.$t(`dcwDetail.kd3znl0002`)},u(i.$t(`dcwDetail.k3yit7139`))+` `+u(l(S).controller.writesFailed),11,De)]),v(`button`,{class:`aw-pill outline`,title:i.$t(`dcwDetail.kc4ixly003`),onClick:No},[a[57]||=v(`span`,{class:`i-tabler-template`},null,-1),f(` `+u(i.$t(`dcwDetail.k1972dx9020`)),1)],8,Oe),v(`button`,{class:`aw-pill add-btn`,onClick:a[1]||=e=>mo.value=!0},[a[58]||=v(`span`,{class:`i-tabler-plus`},null,-1),f(` `+u(i.$t(`dcwDetail.k1976uns021`)),1)])])]),j.value||so.value?(s(),h(`p`,{key:0,class:c([`banner`,j.value?`bad`:`good`])},u(j.value||so.value),3)):g(``,!0),no.value.length||ro.value.length?(s(),h(`section`,ke,[v(`b`,Ae,u(i.$t(`dcwDetail.kaebkky022`)),1),v(`div`,je,[(s(!0),h(d,null,o(no.value,e=>(s(),h(`span`,{key:e.id,class:`adopt-chip`},[f(u(e.name)+` `,1),v(`button`,{class:`mini-btn`,onClick:t=>io(e.id)},u(i.$t(`dcwDetail.kyjp9fg023`)),9,Me)]))),128)),(s(!0),h(d,null,o(ro.value,e=>(s(),h(`span`,{key:e.id,class:`adopt-chip`},[f(u(e.name)+`(`+u(i.$t(`dcwDetail.k3km252140`)),1),v(`button`,{class:`mini-btn`,onClick:t=>ao(e.id)},u(i.$t(`dcwDetail.kyjp9fg023`)),9,Ne)]))),128))])])):g(``,!0),v(`section`,Pe,[v(`div`,Fe,[v(`span`,{class:c([`line-dot`,{on:T.value.active}])},null,2),v(`div`,Ie,[v(`b`,null,u(T.value.active?i.$t(`dcwDetail.k1pxrhx0154`):i.$t(`dcwDetail.k1b2hxmx170`)),1),T.value.active?(s(),h(`small`,Le,u(T.value.productName)+` · `+u(T.value.recipeName)+` · `+u(i.$t(`dcwDetail.k400lb075`))+` `+u(T.value.runId)+` · `+u(i.$t(`dcwDetail.k3zkt2166`))+` `+u(T.value.startedAt?.slice(11,19))+` `+u(i.$t(`dcwDetail.k69vag8168`))+` `+u(T.value.taggedSamples)+` `+u(i.$t(`dcwDetail.k4118o085`)),1)):(s(),h(`small`,Re,u(i.$t(`dcwDetail.k19pof14024`)),1))])]),v(`div`,ze,[v(`label`,Be,[v(`span`,null,u(i.$t(`dcwDetail.k3waz1025`)),1),y(v(`select`,{"onUpdate:modelValue":a[2]||=e=>L.value=e,class:`inp`,onChange:a[3]||=e=>R.value=``},[v(`option`,Ve,u(i.$t(`dcwDetail.kuisodh026`)),1),(s(!0),h(d,null,o(k.value,e=>(s(),h(`option`,{key:e.id,value:e.id},u(e.name),9,He))),128))],544),[[t,L.value]])]),v(`label`,Ue,[v(`span`,null,u(i.$t(`dcwDetail.k48grv027`)),1),y(v(`select`,{"onUpdate:modelValue":a[4]||=e=>R.value=e,class:`inp`,disabled:!L.value},[v(`option`,Ge,u(i.$t(`dcwDetail.kutxzsz028`)),1),(s(!0),h(d,null,o(Io.value,e=>(s(),h(`option`,{key:e.id,value:e.id,disabled:e.params.length===0},u(e.name)+u(e.params.length===0?i.$t(`dcwDetail.k1hicmch155`):i.$t(`dcwDetail.k1lzfi4g180`,{p0:e.params.length})),9,Ke))),128))],8,We),[[t,R.value]])]),T.value.active?(s(),h(`button`,{key:1,class:`pill-btn stop`,disabled:z.value,onClick:Ro},u(i.$t(`dcwDetail.k1xyhd2y030`)),9,Je)):(s(),h(`button`,{key:0,class:`pill-btn`,disabled:z.value||!R.value,title:R.value?`下发配方参数并开始打标数据采集`:`开跑前必须先设定配方`,onClick:Lo},u(i.$t(`dcwDetail.kfb8vml029`)),9,qe))]),V.value?(s(),h(`p`,Ye,u(V.value),1)):g(``,!0),B.value?(s(),h(`p`,Xe,u(B.value),1)):g(``,!0)]),ko.value?(s(),h(`div`,{key:2,class:`modal-mask`,onClick:a[15]||=r(e=>ko.value=!1,[`self`])},[v(`div`,Ze,[v(`h3`,Qe,[f(u(i.$t(`dcwDetail.k1x4vam0031`))+` `,1),v(`small`,$e,u(i.$t(`dcwDetail.k3x23c141`))+` `+u(l(S).templates.filter(e=>e.builtin).length)+` · `+u(i.$t(`dcwDetail.k3t616a142`))+` `+u(l(S).templates.filter(e=>!e.builtin).length),1)]),v(`p`,et,u(i.$t(`dcwDetail.ke1iyud032`)),1),v(`div`,tt,[(s(!0),h(d,null,o(l(S).templates,e=>(s(),h(`span`,{key:e.key,class:`tpl-chip`,title:`${e.code} · ${e.min}~${e.max} ${e.unit}${e.semantics?` · ${e.semantics}`:``}`},[f(u(e.name)+` `,1),v(`small`,rt,u(e.min)+`~`+u(e.max)+u(e.unit),1),v(`em`,{class:c([`tpl-tag`,{builtin:e.builtin}])},u(e.builtin?i.$t(`dcwDetail.k3x23c141`):i.$t(`dcwDetail.k3t616a142`)),3)],8,nt))),128))]),v(`p`,it,u(i.$t(`dcwDetail.k169eb4s033`)),1),v(`div`,at,[v(`label`,ot,[v(`span`,null,[f(u(i.$t(`dcwDetail.k1f55q76034`)),1),a[59]||=v(`em`,null,`*`,-1)]),y(v(`input`,{"onUpdate:modelValue":a[5]||=e=>I.name=e,class:`inp`,placeholder:i.$t(`dcwDetail.k1tooi3o004`)},null,8,st),[[n,I.name]])]),v(`label`,ct,[v(`span`,null,u(i.$t(`dcwDetail.k1bqk219035`)),1),y(v(`input`,{"onUpdate:modelValue":a[6]||=e=>I.ch=e,class:`inp`,placeholder:i.$t(`dcwDetail.k698qz0005`)},null,8,lt),[[n,I.ch]])]),v(`label`,ut,[v(`span`,null,u(i.$t(`dcwDetail.k1ayxrqb036`)),1),y(v(`input`,{"onUpdate:modelValue":a[7]||=e=>I.code=e,class:`inp`,placeholder:`如 MOTOR · I`},null,512),[[n,I.code]])]),v(`label`,dt,[v(`span`,null,[f(u(i.$t(`dcwDetail.k3x4ef037`)),1),a[60]||=v(`em`,null,`*`,-1)]),y(v(`input`,{"onUpdate:modelValue":a[8]||=e=>I.unit=e,class:`inp`,placeholder:`如 A`},null,512),[[n,I.unit]])]),v(`label`,ft,[v(`span`,null,[f(u(i.$t(`dcwDetail.k1l9jv5m038`)),1),a[61]||=v(`em`,null,`*`,-1)]),y(v(`input`,{"onUpdate:modelValue":a[9]||=e=>I.min=e,type:`number`,class:`inp`,placeholder:i.$t(`dcwDetail.kxz9174006`)},null,8,pt),[[n,I.min,void 0,{number:!0}]])]),v(`label`,mt,[v(`span`,null,[f(u(i.$t(`dcwDetail.k1l9jv4p039`)),1),a[62]||=v(`em`,null,`*`,-1)]),y(v(`input`,{"onUpdate:modelValue":a[10]||=e=>I.max=e,type:`number`,class:`inp`,placeholder:i.$t(`dcwDetail.kxz9167007`)},null,8,ht),[[n,I.max,void 0,{number:!0}]])]),v(`label`,gt,[v(`span`,null,u(i.$t(`dcwDetail.k3mxmcx040`)),1),y(v(`input`,{"onUpdate:modelValue":a[11]||=e=>I.decimals=e,type:`number`,min:`0`,max:`4`,class:`inp`},null,512),[[n,I.decimals,void 0,{number:!0}]])]),v(`label`,_t,[v(`span`,null,u(i.$t(`dcwDetail.k3xx56041`)),1),y(v(`select`,{"onUpdate:modelValue":a[12]||=e=>I.icon=e,class:`inp`},[(s(),h(d,null,o(Po,e=>v(`option`,{key:e.key,value:e.key},u(e.label),9,vt)),64))],512),[[t,I.icon]])])]),v(`label`,yt,[v(`span`,null,u(i.$t(`dcwDetail.knjmyfr042`)),1),y(v(`textarea`,{"onUpdate:modelValue":a[13]||=e=>I.semantics=e,class:`inp`,rows:`2`,placeholder:i.$t(`dcwDetail.k1qdnfzc008`)},null,8,bt),[[n,I.semantics]])]),Mo.value?(s(),h(`p`,xt,u(Mo.value),1)):g(``,!0),jo.value?(s(),h(`p`,St,u(jo.value),1)):g(``,!0),v(`div`,Ct,[v(`button`,{class:`aw-pill outline`,onClick:a[14]||=e=>ko.value=!1},u(i.$t(`dcwDetail.k3x62t043`)),1),v(`button`,{class:`pill-btn`,disabled:Ao.value||!I.name.trim()||I.unit.trim()===``||I.min===``||I.max===``,onClick:Fo},u(Ao.value?i.$t(`dcwDetail.k1bg4759156`):i.$t(`dcwDetail.k1bg9nga171`)),9,wt)])])])):g(``,!0),mo.value?(s(),h(`div`,{key:3,class:`modal-mask`,onClick:a[28]||=r(e=>mo.value=!1,[`self`])},[v(`div`,Tt,[v(`h3`,Et,u(i.$t(`dcwDetail.k1976uns021`)),1),v(`div`,Dt,[v(`button`,{class:c([`seg`,{on:ho.value===`mock`}]),onClick:a[16]||=e=>ho.value=`mock`},` Mock 模拟 PLC `,2),v(`button`,{class:c([`seg`,{on:ho.value===`real`}]),onClick:a[17]||=e=>ho.value=`real`},u(i.$t(`dcwDetail.kyj8fen044`)),3)]),v(`div`,Ot,[v(`label`,kt,[v(`span`,null,u(i.$t(`dcwDetail.k1ejzwqp045`)),1),y(v(`select`,{"onUpdate:modelValue":a[18]||=e=>go.value=e,class:`inp`},[(s(!0),h(d,null,o(l(S).templates,e=>(s(),h(`option`,{key:e.key,value:e.key},u(e.name)+` · `+u(e.ch)+`(`+u(e.min)+`~`+u(e.max)+` `+u(e.unit)+`)`+u(e.builtin?``:i.$t(`dcwDetail.kr45rk9157`)),9,At))),128))],512),[[t,go.value]])]),v(`label`,jt,[v(`span`,null,u(i.$t(`dcwDetail.k1ce2k1y046`)),1),y(v(`input`,{"onUpdate:modelValue":a[19]||=e=>_o.value=e,class:`inp`,placeholder:i.$t(`dcwDetail.kgpxzy3009`)},null,8,Mt),[[n,_o.value]])]),v(`label`,Nt,[v(`span`,null,u(i.$t(`dcwDetail.k1vyb8im047`)),1),y(v(`input`,{"onUpdate:modelValue":a[20]||=e=>vo.value=e,type:`number`,min:`0`,max:`3600000`,step:`500`,class:`inp`,placeholder:i.$t(`dcwDetail.kb1srz0010`)},null,8,Pt),[[n,vo.value,void 0,{number:!0}]])]),v(`label`,Ft,[v(`span`,null,u(i.$t(`dcwDetail.k9r7d4e016`)),1),y(v(`input`,{"onUpdate:modelValue":a[21]||=e=>yo.value=e,type:`number`,min:`0`,max:`3600000`,step:`500`,class:`inp`,placeholder:i.$t(`dcwDetail.k9r7d4e017`)},null,8,It),[[n,yo.value,void 0,{number:!0}]])])]),v(`div`,Lt,[v(`label`,Rt,[v(`span`,null,u(i.$t(`dcwDetail.kiune1f048`)),1),y(v(`select`,{"onUpdate:modelValue":a[22]||=e=>P.kind=e,class:`inp`},[v(`option`,zt,u(i.$t(`dcwDetail.kkzy0k049`)),1),a[63]||=v(`option`,{value:`linear`},` 线性标定:PLC值 = (物理值 - offset) / scale `,-1)],512),[[t,P.kind]])]),v(`label`,Bt,[a[64]||=v(`span`,null,`scale / offset`,-1),v(`div`,Vt,[y(v(`input`,{"onUpdate:modelValue":a[23]||=e=>P.scale=e,type:`number`,step:`0.1`,class:`inp`,disabled:P.kind!==`linear`,title:`decoder 斜率(≠0):物理值 = scale × PLC值 + offset;下发时自动取逆`},null,8,Ht),[[n,P.scale,void 0,{number:!0}]]),y(v(`input`,{"onUpdate:modelValue":a[24]||=e=>P.offset=e,type:`number`,step:`0.1`,class:`inp`,disabled:P.kind!==`linear`,title:`decoder 截距`},null,8,Ut),[[n,P.offset,void 0,{number:!0}]])])])]),ho.value===`real`?(s(),h(d,{key:0},[v(`div`,Wt,[v(`label`,Gt,[v(`span`,null,u(i.$t(`dcwDetail.k1kt87rx050`)),1),y(v(`select`,{"onUpdate:modelValue":a[25]||=e=>M.value=e,class:`inp`},[(s(!0),h(d,null,o(l(se).filter(e=>e.status!==`builtin`),e=>(s(),h(`option`,{key:e.kind,value:e.kind},u(e.label),9,Kt))),128))],512),[[t,M.value]])])]),To.value.length?(s(),h(`div`,qt,[(s(!0),h(d,null,o(To.value,n=>(s(),h(`label`,{key:n.key,class:`f`},[v(`span`,null,[f(u(n.label),1),n.required?(s(),h(`em`,Jt,`*`)):g(``,!0)]),n.type===`select`?y((s(),h(`select`,{key:0,"onUpdate:modelValue":e=>N.value[n.key]=e,class:`inp`},[(s(!0),h(d,null,o(n.options,e=>(s(),h(`option`,{key:e.value,value:e.value},u(e.label),9,Xt))),128))],8,Yt)),[[t,N.value[n.key]]]):y((s(),h(`input`,{key:1,"onUpdate:modelValue":e=>N.value[n.key]=e,type:n.type===`number`?`number`:`text`,placeholder:n.placeholder,class:`inp`},null,8,Zt)),[[e,N.value[n.key]]]),n.hint?(s(),h(`small`,Qt,u(n.hint),1)):g(``,!0)]))),128))])):g(``,!0),v(`div`,$t,[v(`button`,{class:`pill-btn outline`,disabled:xo.value,onClick:Do},u(xo.value?i.$t(`dcwDetail.k1fsh720158`):i.$t(`dcwDetail.k1fstglk172`)),9,en),F.value?(s(),h(`span`,{key:0,class:c([`test-result`,F.value.ok?`good`:`bad`])},u(F.value.ok?`✓`:`✗`)+` `+u(F.value.message),3)):g(``,!0)])],64)):g(``,!0),v(`label`,tn,[v(`span`,null,u(i.$t(`dcwDetail.k1hgizn7051`)),1),y(v(`textarea`,{"onUpdate:modelValue":a[26]||=e=>bo.value=e,class:`inp`,rows:`2`,placeholder:i.$t(`dcwDetail.k12bnyt9011`)},null,8,nn),[[n,bo.value]])]),Co.value?(s(),h(`p`,rn,u(Co.value),1)):g(``,!0),v(`div`,an,[v(`button`,{class:`aw-pill outline`,onClick:a[27]||=e=>mo.value=!1},u(i.$t(`dcwDetail.k3xdnn052`)),1),v(`button`,{class:`aw-pill`,disabled:So.value,onClick:Oo},u(So.value?i.$t(`dcwDetail.k1bg4759156`):i.$t(`dcwDetail.k1bge46t173`)),9,on)])])])):g(``,!0),ne(m,{spinning:!l(S).loaded&&!l(S).error},{default:te(()=>[v(`section`,sn,[v(`table`,cn,[v(`thead`,null,[v(`tr`,null,[v(`th`,null,u(i.$t(`dcwDetail.k1e2dtkt053`)),1),v(`th`,null,u(i.$t(`dcwDetail.k403cy054`)),1),v(`th`,null,u(i.$t(`dcwDetail.k42w8s055`)),1),v(`th`,null,u(i.$t(`dcwDetail.k1deqh0d056`)),1),v(`th`,null,u(i.$t(`dcwDetail.k9r7d4e018`)),1),v(`th`,null,u(i.$t(`dcwDetail.k1k79ec9057`)),1),v(`th`,null,u(i.$t(`dcwDetail.k1dexou6058`)),1),v(`th`,null,u(i.$t(`dcwDetail.k1b1nnaa059`)),1),v(`th`,null,u(i.$t(`dcwDetail.k1i8rtqt060`)),1),v(`th`,ln,u(i.$t(`dcwDetail.k40aa6061`)),1)])]),v(`tbody`,null,[(s(!0),h(d,null,o(O.value,e=>(s(),h(`tr`,{key:e.id,class:c({"node-paused":!e.enabled})},[v(`td`,null,[v(`span`,un,u(e.id.slice(0,8)),1),v(`b`,null,u(e.name),1),v(`small`,dn,u(Ga(e.templateRef)),1)]),v(`td`,null,[v(`button`,{class:c([`ctrl-toggle`,{on:e.enabled}]),disabled:fo.value===e.id,title:e.enabled?`暂停该节点控制:下发将被拒绝`:`开启该节点控制:恢复可下发`,onClick:t=>po(e.id,!e.enabled)},[a[65]||=v(`span`,{class:`ct-dot`},null,-1),f(` `+u(e.enabled?i.$t(`dcwDetail.k3o3ib3159`):i.$t(`dcwDetail.k3n93ed062`)),1)],10,fn)]),v(`td`,null,[e.enabled?(s(),h(`span`,{key:1,class:c([`st-pill`,e.state])},u(Wa[e.state]??e.state),3)):(s(),h(`span`,pn,u(i.$t(`dcwDetail.k3n93ed062`)),1))]),v(`td`,mn,[f(u(e.value==null?`--`:e.value.toFixed(e.decimals))+` `,1),v(`small`,null,u(e.unit),1),e.lastAckAt?(s(),h(`small`,hn,` · `+u(e.lastAckAt.slice(11,19)),1)):g(``,!0)]),v(`td`,gn,[v(`span`,{title:e.lastReadError??i.$t(`dcwDetail.k9r7d4e019`),class:c({"read-stale":e.lastReadError})},u(e.readValue==null?`--`:e.readValue.toFixed(e.decimals)),11,_n),v(`small`,null,u(e.unit),1),e.lastReadAt?(s(),h(`small`,vn,` · `+u(e.lastReadAt.slice(11,19)),1)):g(``,!0),v(`button`,{class:`mini-btn read-btn`,disabled:lo.value===e.id,title:i.$t(`dcwDetail.k9r7d4e020`),onClick:t=>uo(e.id)},u(lo.value===e.id?`···`:i.$t(`dcwDetail.k9r7d4e021`)),9,yn)]),v(`td`,null,[v(`div`,bn,[y(v(`input`,{"onUpdate:modelValue":t=>A[e.id]=t,type:`number`,class:`inp write-inp mono`,placeholder:`${e.min}~${e.max}`,min:e.min,max:e.max,step:10**-e.decimals,disabled:!e.enabled,title:e.enabled?``:`当前节点暂停:开启控制后方可设定`},null,8,xn),[[n,A[e.id],void 0,{number:!0}]]),v(`button`,{class:`mini-btn write-btn`,disabled:!e.enabled||oo.value===e.id||A[e.id]==null||A[e.id]===``,title:e.enabled?`下发设定值`:`当前节点暂停:开启控制后方可设定`,onClick:t=>co(e.id,Number(A[e.id]))},u(oo.value===e.id?i.$t(`dcwDetail.k3l3h80123`):i.$t(`dcwDetail.k3w6td174`)),9,Sn)])]),v(`td`,Cn,u(e.min)+` ~ `+u(e.max)+` `+u(e.unit),1),v(`td`,wn,[f(u(e.holdIntervalMs==null?i.$t(`dcwDetail.k3zul4160`):`${e.holdIntervalMs}ms`)+` `,1),v(`small`,{class:`dim`,title:i.$t(`dcwDetail.k9r7d4e016`)},`· `+u(e.readIntervalMs===0?i.$t(`dcwDetail.k9r7d4e022`):e.readIntervalMs==null?i.$t(`dcwDetail.k9r7d4e023`):`${e.readIntervalMs}ms`),9,Tn)]),v(`td`,null,u(Ua(e.deviceBindingId)),1),v(`td`,En,[v(`button`,{class:`mini-btn danger`,onClick:t=>l(S).removeNode(e.id)},u(i.$t(`dcwDetail.k3xakp063`)),9,Dn)])],2))),128)),l(S).loaded&&O.value.length===0?(s(),h(`tr`,On,[v(`td`,kn,[v(`div`,An,[v(`p`,jn,u(i.$t(`dcwDetail.k1wtecyw064`)),1)])])])):g(``,!0)])])])]),_:1},8,[`spinning`]),v(`section`,Mn,[v(`div`,Nn,[v(`h3`,null,u(i.$t(`dcwDetail.k1j8w3hd065`)),1),v(`span`,Pn,u(k.value.length)+` `+u(i.$t(`dcwDetail.k1av3wgs143`))+` `+u(Uo.value.length)+` `+u(i.$t(`dcwDetail.k48grv027`)),1),v(`button`,{class:`pill-btn`,style:{"margin-left":`auto`},onClick:cs},u(i.$t(`dcwDetail.k1akm6dc066`)),1),v(`button`,{class:`mini-btn`,onClick:a[29]||=e=>zo.value=!0},u(i.$t(`dcwDetail.k1aka0ki067`)),1)]),v(`p`,Fn,u(i.$t(`dcwDetail.k6bl2q8068`)),1),k.value.length?(s(),h(`div`,In,[v(`button`,{class:c([`prod-chip`,{on:U.value===``}]),onClick:a[30]||=e=>U.value=``},u(i.$t(`dcwDetail.k3x4t1069`)),3),(s(!0),h(d,null,o(k.value,e=>(s(),h(`button`,{key:e.id,class:c([`prod-chip`,{on:U.value===e.id}]),title:e.description,onClick:t=>U.value=e.id},[f(u(e.name)+` `,1),v(`span`,{class:`prod-del`,title:i.$t(`dcwDetail.k1bpfjgx012`),onClick:r(t=>l(S).removeProduct(e.id),[`stop`])},`×`,8,Rn)],10,Ln))),128))])):(s(),h(`p`,zn,u(i.$t(`dcwDetail.knov3zg070`)),1)),v(`div`,Bn,[(s(!0),h(d,null,o(Uo.value,e=>(s(),h(`div`,{key:e.id,class:`recipe-item`},[v(`div`,Vn,[v(`b`,null,u(e.name),1),e.version?(s(),h(`span`,{key:0,class:`param-chip mono`,title:l(b)(`dcwDetail.histTitle`)},`v`+u(e.version),9,Hn)):g(``,!0),v(`small`,Un,u(Wo(e.productId)),1),v(`small`,Wn,u(e.id),1)]),e.description?(s(),h(`p`,Gn,u(e.description),1)):g(``,!0),v(`div`,Kn,[(s(!0),h(d,null,o(e.params,(t,n)=>(s(),h(`span`,{key:n,class:c([`param-chip`,{stale:W(t.nodeId,e.lineId)}]),title:W(t.nodeId,e.lineId)?.label??``},[f(u(Go(t.nodeId))+` = `+u(t.value),1),W(t.nodeId,e.lineId)?(s(),h(`span`,Jn,u(W(t.nodeId,e.lineId).label),1)):g(``,!0)],10,qn))),128)),(s(!0),h(d,null,o(e.daqWindows,(t,n)=>(s(),h(`span`,{key:`w-${n}`,class:c([`param-chip daqwin`,{stale:Ko(t.nodeId,e.lineId)}]),title:Ko(t.nodeId,e.lineId)?.label??i.$t(`dcwDetail.k1l11api013`)},[f(` ◎ `+u(Qa(t.nodeId))+` ∈ [`+u(t.min??`-∞`)+`, `+u(t.max??`+∞`)+`]`,1),Ko(t.nodeId,e.lineId)?(s(),h(`span`,Xn,u(Ko(t.nodeId,e.lineId).label),1)):g(``,!0)],10,Yn))),128))]),v(`div`,Zn,[v(`button`,{class:`pill-btn`,onClick:t=>ds(e.id)},u(i.$t(`dcwDetail.k1497qvr071`)),9,Qn),v(`button`,{class:`mini-btn`,onClick:t=>ls(e.id)},u(i.$t(`dcwDetail.k45eb0072`)),9,$n),v(`button`,{class:`mini-btn`,onClick:t=>Xo(e.id)},[f(u(l(b)(`dcwDetail.histBtn`)),1),e.version?(s(),h(`span`,tr,`·v`+u(e.version),1)):g(``,!0)],8,er),v(`button`,{class:`mini-btn danger`,onClick:t=>l(S).removeRecipe(e.id)},u(i.$t(`dcwDetail.k3xakp063`)),9,nr)])]))),128)),Uo.value.length===0?(s(),h(`div`,rr,u(i.$t(`dcwDetail.keko1xy073`)),1)):g(``,!0)]),Q.value?(s(),h(`div`,ir,[f(u(i.$t(`dcwDetail.k1l3hrvp144`))+` `+u(Q.value.runId)+` `+u(i.$t(`dcwDetail.k1g3lh2v167`))+u(Q.value.ok)+`/`+u(Q.value.total)+` `+u(i.$t(`dcwDetail.k1bqci06149`))+` `,1),v(`button`,{class:`mini-btn`,style:{"margin-left":`10px`},disabled:ss.value,onClick:a[31]||=e=>fs(Q.value.runId)},u(ss.value?i.$t(`dcwDetail.k1br0ij9161`):i.$t(`dcwDetail.kxwei5175`)),9,ar)])):g(``,!0),eo.value.length?(s(),h(`div`,or,[v(`p`,sr,u(i.$t(`dcwDetail.k1rjer8d074`)),1),v(`table`,cr,[v(`thead`,null,[v(`tr`,null,[v(`th`,null,u(i.$t(`dcwDetail.k400lb075`)),1),v(`th`,null,u(i.$t(`dcwDetail.k48grv027`)),1),v(`th`,null,u(i.$t(`dcwDetail.k4497j076`)),1),v(`th`,null,u(i.$t(`dcwDetail.k1bqhtmu077`)),1),v(`th`,lr,u(i.$t(`dcwDetail.k40aa6061`)),1)])]),v(`tbody`,null,[(s(!0),h(d,null,o([...eo.value].reverse().slice(0,8),e=>(s(),h(`tr`,{key:e.id},[v(`td`,ur,u(e.id),1),v(`td`,null,u(e.recipeName),1),v(`td`,dr,u(e.startedAt.slice(5,19))+` ~ `+u(e.endedAt?e.endedAt.slice(5,19):i.$t(`dcwDetail.k3vpfg9162`)),1),v(`td`,null,[v(`span`,{class:c([`st-pill`,e.results.every(e=>e.ok)?`ok`:`warn`])},u(e.results.filter(e=>e.ok).length)+`/`+u(e.results.length),3)]),v(`td`,fr,[v(`button`,{class:`mini-btn`,disabled:ss.value,onClick:t=>fs(e.id)},u(i.$t(`dcwDetail.k1dzwrdp078`)),9,pr),e.endedAt?g(``,!0):(s(),h(`button`,{key:0,class:`mini-btn`,onClick:t=>l(S).closeRun(e.id)},u(i.$t(`dcwDetail.k1blr7y7079`)),9,mr))])]))),128))])])])):g(``,!0),$.value?(s(),h(`div`,{key:4,class:`modal-mask`,onClick:a[33]||=r(e=>$.value=null,[`self`])},[v(`div`,hr,[v(`h3`,gr,u(i.$t(`dcwDetail.k11lq94k145`))+` `+u($.value.data.run.recipeName)+`(`+u($.value.runId)+`) `,1),v(`p`,_r,u(i.$t(`dcwDetail.k1me41w8080`)),1),v(`table`,vr,[v(`thead`,null,[v(`tr`,null,[v(`th`,null,u(i.$t(`dcwDetail.k48hde081`)),1),v(`th`,null,u(i.$t(`dcwDetail.k45uio082`)),1),v(`th`,null,u(i.$t(`dcwDetail.k40t11083`)),1),v(`th`,null,u(i.$t(`dcwDetail.k3xuaw084`)),1),a[66]||=v(`th`,null,`min ~ max`,-1),v(`th`,null,u(i.$t(`dcwDetail.k4118o085`)),1)])]),v(`tbody`,null,[(s(!0),h(d,null,o($.value.data.daq,e=>(s(),h(`tr`,{key:e.nodeId},[v(`td`,null,[f(u(e.ch),1),v(`small`,yr,u(e.unit),1)]),v(`td`,null,u(e.nodeName),1),v(`td`,br,u(e.latest),1),v(`td`,xr,u(e.avg),1),v(`td`,Sr,u(e.min)+` ~ `+u(e.max),1),v(`td`,Cr,u(e.cnt),1)]))),128)),$.value.data.daq.length===0?(s(),h(`tr`,wr,[v(`td`,Tr,u(i.$t(`dcwDetail.kd457ry086`)),1)])):g(``,!0)])]),v(`p`,Er,u(i.$t(`dcwDetail.k12b7cxs087`)),1),v(`table`,Dr,[v(`thead`,null,[v(`tr`,null,[v(`th`,null,u(i.$t(`dcwDetail.k3xbjr088`)),1),v(`th`,null,u(i.$t(`dcwDetail.k45uio082`)),1),v(`th`,null,u(i.$t(`dcwDetail.k3ncbsh089`)),1),v(`th`,null,u(i.$t(`dcwDetail.k3lh3mz090`)),1),v(`th`,null,u(i.$t(`dcwDetail.k454pg091`)),1),v(`th`,null,u(i.$t(`dcwDetail.k40ieu092`)),1)])]),v(`tbody`,null,[(s(!0),h(d,null,o($.value.data.writes,(e,t)=>(s(),h(`tr`,{key:t},[v(`td`,null,u(e.param),1),v(`td`,null,u(e.nodeName),1),v(`td`,Or,u(e.eng),1),v(`td`,kr,u(e.raw),1),v(`td`,null,[v(`span`,{class:c([`st-pill`,e.ok?`ok`:`alarm`])},u(e.ok?`ACK`:i.$t(`dcwDetail.k3yit7139`)),3)]),v(`td`,Ar,u(e.at.slice(5,19)),1)]))),128)),$.value.data.writes.length===0?(s(),h(`tr`,jr,[v(`td`,Mr,u(i.$t(`dcwDetail.knzcp8i093`)),1)])):g(``,!0)])]),v(`div`,Nr,[v(`button`,{class:`aw-pill outline`,onClick:a[32]||=e=>$.value=null},u(i.$t(`dcwDetail.k3x62t043`)),1)])])])):g(``,!0)]),J.value?(s(),h(`div`,{key:4,class:`modal-mask`,onClick:a[40]||=r(e=>J.value=!1,[`self`])},[v(`div`,Pr,[v(`h3`,Fr,u(Y.value?i.$t(`dcwDetail.k1iiwk0i163`):i.$t(`dcwDetail.k1efq0r9176`)),1),v(`div`,Ir,[v(`label`,Lr,[v(`span`,null,[f(u(i.$t(`dcwDetail.k1dw4fzf094`)),1),a[67]||=v(`em`,null,`*`,-1)]),y(v(`select`,{"onUpdate:modelValue":a[34]||=e=>Z.productId=e,class:`inp`},[(s(!0),h(d,null,o(k.value,e=>(s(),h(`option`,{key:e.id,value:e.id},u(e.name),9,Rr))),128))],512),[[t,Z.productId]])]),v(`label`,zr,[v(`span`,null,[f(u(i.$t(`dcwDetail.k1l3f8so095`)),1),a[68]||=v(`em`,null,`*`,-1)]),y(v(`input`,{"onUpdate:modelValue":a[35]||=e=>Z.name=e,class:`inp`,placeholder:i.$t(`dcwDetail.k12c11vm014`)},null,8,Br),[[n,Z.name]])]),v(`label`,Vr,[v(`span`,null,u(i.$t(`dcwDetail.k40gkk096`)),1),y(v(`input`,{"onUpdate:modelValue":a[36]||=e=>Z.description=e,class:`inp`,placeholder:i.$t(`dcwDetail.k1hxx8hy015`)},null,8,Hr),[[n,Z.description]])])]),v(`p`,Ur,u(i.$t(`dcwDetail.ka1kfgh097`)),1),(s(!0),h(d,null,o(Z.params,(e,r)=>(s(),h(`div`,{key:r,class:`param-row`},[v(`label`,Wr,[v(`span`,null,u(i.$t(`dcwDetail.k1e2dtkt053`)),1),y(v(`select`,{"onUpdate:modelValue":t=>e.nodeId=t,class:`inp`},[(s(!0),h(d,null,o(O.value,e=>(s(),h(`option`,{key:e.id,value:e.id},u(e.name)+`(`+u(Ga(e.templateRef))+` · `+u(e.min)+`~`+u(e.max)+` `+u(e.unit)+`) `,9,Kr))),128))],8,Gr),[[t,e.nodeId]]),W(e.nodeId,C.value)?(s(),h(`span`,qr,u(W(e.nodeId,C.value).label),1)):g(``,!0)]),v(`label`,Jr,[v(`span`,null,[f(u(i.$t(`dcwDetail.k3renp2098`)),1),a[69]||=v(`em`,null,`*`,-1)]),y(v(`input`,{"onUpdate:modelValue":t=>e.value=t,type:`number`,class:`inp`,step:.1},null,8,Yr),[[n,e.value,void 0,{number:!0}]])]),v(`label`,Xr,[v(`span`,null,u(i.$t(`dcwDetail.k134rw3b146`))+u(Ka(e.nodeId)??`-`)+`)`,1),y(v(`input`,{"onUpdate:modelValue":t=>e.min=t,type:`number`,class:`inp`,step:.1,placeholder:i.$t(`dcwDetail.k5vew9z016`)},null,8,Zr),[[n,e.min,void 0,{number:!0}]])]),v(`label`,Qr,[v(`span`,null,u(i.$t(`dcwDetail.khrv911147`))+u(qa(e.nodeId)??`-`)+`)`,1),y(v(`input`,{"onUpdate:modelValue":t=>e.max=t,type:`number`,class:`inp`,step:.1,placeholder:i.$t(`dcwDetail.kzoh5pr017`)},null,8,$r),[[n,e.max,void 0,{number:!0}]])]),v(`button`,{class:`mini-btn danger param-del`,onClick:e=>Z.params.splice(r,1)},u(i.$t(`dcwDetail.k44idg099`)),9,ei)]))),128)),v(`button`,{class:`mini-btn`,onClick:a[37]||=e=>Z.params.push({nodeId:O.value[0]?.id??``,value:``,min:``,max:``})},u(i.$t(`dcwDetail.k1broh7h100`)),1),v(`p`,ti,u(i.$t(`dcwDetail.k1h5gues101`)),1),(s(!0),h(d,null,o(Z.daqWindows,(e,r)=>(s(),h(`div`,{key:`dw-${r}`,class:`param-row`},[v(`label`,ni,[v(`span`,null,u(i.$t(`dcwDetail.k1empnnb102`)),1),y(v(`select`,{"onUpdate:modelValue":t=>e.nodeId=t,class:`inp`},[(s(!0),h(d,null,o(Ja.value,e=>(s(),h(`option`,{key:e.id,value:e.id},u(e.name)+`(`+u(e.min)+`~`+u(e.max)+` `+u(e.unit)+`) `,9,ii))),128))],8,ri),[[t,e.nodeId]])]),v(`label`,ai,[v(`span`,null,u(i.$t(`dcwDetail.kqm08ap103`)),1),y(v(`input`,{"onUpdate:modelValue":t=>e.min=t,type:`number`,class:`inp`,step:.1},null,8,oi),[[n,e.min,void 0,{number:!0}]])]),v(`label`,si,[v(`span`,null,u(i.$t(`dcwDetail.kpypf8g104`)),1),y(v(`input`,{"onUpdate:modelValue":t=>e.max=t,type:`number`,class:`inp`,step:.1},null,8,ci),[[n,e.max,void 0,{number:!0}]])]),v(`button`,{class:`mini-btn danger param-del`,onClick:e=>Z.daqWindows.splice(r,1)},u(i.$t(`dcwDetail.k44idg099`)),9,li)]))),128)),v(`button`,{class:`mini-btn`,disabled:Ja.value.length===0,title:Ja.value.length===0?`本产线暂无数采节点`:``,onClick:a[38]||=e=>Z.daqWindows.push({nodeId:Ja.value[0]?.id??``,min:``,max:``})},u(i.$t(`dcwDetail.kv1de1p105`)),9,ui),os.value?(s(),h(`p`,di,u(os.value),1)):g(``,!0),X.value?(s(),h(`p`,fi,u(X.value),1)):g(``,!0),v(`div`,pi,[v(`button`,{class:`aw-pill outline`,onClick:a[39]||=e=>J.value=!1},u(i.$t(`dcwDetail.k3xdnn052`)),1),v(`button`,{class:`pill-btn`,disabled:as.value,onClick:us},u(as.value?i.$t(`dcwDetail.k1b38d59164`):i.$t(`dcwDetail.k1b3kwg0177`)),9,mi)])])])):g(``,!0),qo.value?(s(),h(`div`,{key:5,class:`modal-mask`,onClick:a[42]||=r(e=>qo.value=!1,[`self`])},[v(`div`,hi,[v(`div`,gi,[v(`h3`,null,[f(u(l(b)(`dcwDetail.histTitle`)),1),G.value?(s(),h(`span`,_i,u(G.value.name)+` · v`+u(G.value.version),1)):g(``,!0)]),v(`button`,{class:`mini-btn`,onClick:a[41]||=e=>qo.value=!1},` ✕ `)]),K.value?(s(),h(`p`,vi,u(K.value),1)):g(``,!0),Yo.value?(s(),h(`p`,yi,u(l(b)(`dcwDetail.histLoading`)),1)):Jo.value.length===0?(s(),h(`div`,bi,u(l(b)(`dcwDetail.histEmpty`)),1)):(s(!0),h(d,{key:3},o(Jo.value,(e,t)=>(s(),h(`div`,{key:e.version,class:c([`ver-row`,{cur:e.current}])},[v(`div`,xi,[v(`span`,Si,`v`+u(e.version),1),v(`span`,{class:c([`ver-src`,e.by??(e.current?`cur`:``)])},u(e.current?l(b)(`dcwDetail.histCurrent`):Zo(e.by)),3),v(`span`,Ci,u(e.at.slice(0,19).replace(`T`,` `)),1),v(`span`,wi,u(e.actorName||`—`),1),e.current?g(``,!0):(s(),h(`button`,{key:0,class:`mini-btn`,onClick:t=>$o(e.version)},u(l(b)(`dcwDetail.revertTo`)),9,Ti))]),e.description?(s(),h(`p`,Ei,u(e.description),1)):g(``,!0),v(`p`,Di,u(Qo(e,t)),1)],2))),128))])])):g(``,!0),v(`section`,Oi,[v(`p`,ki,u(i.$t(`dcwDetail.k1us3jse106`)),1),v(`div`,Ai,[v(`label`,ji,[v(`span`,null,u(i.$t(`dcwDetail.k3waz1025`)),1),y(v(`select`,{"onUpdate:modelValue":a[43]||=e=>q.productId=e,class:`inp`,onChange:a[44]||=e=>q.recipeId=``},[v(`option`,Mi,u(i.$t(`dcwDetail.k1bkl1jx107`)),1),(s(!0),h(d,null,o(k.value,e=>(s(),h(`option`,{key:e.id,value:e.id},u(e.name),9,Ni))),128))],544),[[t,q.productId]])]),v(`label`,Pi,[v(`span`,null,u(i.$t(`dcwDetail.k48grv027`)),1),y(v(`select`,{"onUpdate:modelValue":a[45]||=e=>q.recipeId=e,class:`inp`,disabled:!q.productId},[v(`option`,Ii,u(i.$t(`dcwDetail.k1bkx7cr108`)),1),(s(!0),h(d,null,o(Uo.value,e=>(s(),h(`option`,{key:e.id,value:e.id},u(e.name),9,Li))),128))],8,Fi),[[t,q.recipeId]])]),v(`label`,Ri,[v(`span`,null,u(i.$t(`dcwDetail.k1demcae109`)),1),y(v(`select`,{"onUpdate:modelValue":a[46]||=e=>q.paramKey=e,class:`inp`},[v(`option`,zi,u(i.$t(`dcwDetail.k1bkx7ya110`)),1),(s(!0),h(d,null,o(is.value,e=>(s(),h(`option`,{key:e,value:e},u(e),9,Bi))),128))],512),[[t,q.paramKey]])]),v(`label`,Vi,[v(`span`,null,u(i.$t(`dcwDetail.k45uio082`)),1),y(v(`select`,{"onUpdate:modelValue":a[47]||=e=>q.nodeId=e,class:`inp`},[v(`option`,Hi,u(i.$t(`dcwDetail.k1bkul3k111`)),1),(s(!0),h(d,null,o(Ja.value,e=>(s(),h(`option`,{key:e.id,value:e.id},u(e.name),9,Ui))),128))],512),[[t,q.nodeId]])]),v(`label`,Wi,[v(`span`,null,u(i.$t(`dcwDetail.kx2ojn0112`)),1),y(v(`input`,{"onUpdate:modelValue":a[48]||=e=>q.lastMin=e,type:`number`,min:`1`,max:`10080`,class:`inp`},null,512),[[n,q.lastMin,void 0,{number:!0}]])]),v(`label`,Gi,[v(`span`,null,u(i.$t(`dcwDetail.kjvnvn4113`)),1),y(v(`input`,{"onUpdate:modelValue":a[49]||=e=>q.bucketMs=e,type:`number`,min:`1000`,step:`500`,class:`inp`},null,512),[[n,q.bucketMs,void 0,{number:!0}]])]),v(`div`,Ki,[v(`button`,{class:`pill-btn`,disabled:ts.value,onClick:rs},u(ts.value?i.$t(`dcwDetail.k1eyx09r165`):i.$t(`dcwDetail.k416ek178`)),9,qi)])]),ns.value?(s(),h(`p`,Ji,u(ns.value),1)):g(``,!0),es.value?(s(),h(`div`,Yi,[v(`table`,Xi,[v(`thead`,null,[v(`tr`,null,[v(`th`,null,u(i.$t(`dcwDetail.k48hde081`)),1),v(`th`,null,u(i.$t(`dcwDetail.k45uio082`)),1),v(`th`,null,u(i.$t(`dcwDetail.k42kcu114`)),1),v(`th`,null,u(i.$t(`dcwDetail.k49ujb115`)),1),v(`th`,null,u(i.$t(`dcwDetail.k40pvw116`)),1),v(`th`,null,u(i.$t(`dcwDetail.k3xho3117`)),1)])]),v(`tbody`,null,[(s(!0),h(d,null,o(es.value.channels,e=>(s(),h(`tr`,{key:e.nodeId},[v(`td`,null,[f(u(e.ch),1),v(`small`,Zi,u(e.unit),1)]),v(`td`,null,u(e.nodeName),1),v(`td`,Qi,u(e.points.length),1),v(`td`,$i,u(ps(e.points[0])),1),v(`td`,ea,u(ps(e.points[e.points.length-1])),1),v(`td`,ta,u(new Date(e.points[0]?.at??0).toLocaleTimeString())+` ~ `+u(new Date(e.points[e.points.length-1]?.at??0).toLocaleTimeString()),1)]))),128))])])])):g(``,!0)]),to.value.length?(s(),h(`section`,na,[v(`p`,ra,u(i.$t(`dcwDetail.kw7ym9b148`))+` `+u(to.value.length)+` `+u(i.$t(`dcwDetail.k40bfz150`)),1),v(`table`,ia,[v(`tbody`,null,[(s(!0),h(d,null,o(to.value.slice(0,12),e=>(s(),h(`tr`,{key:e.id},[v(`td`,aa,u(e.at.slice(5,19)),1),v(`td`,null,u(e.param),1),v(`td`,null,u(e.nodeName),1),v(`td`,oa,u(e.eng),1),v(`td`,sa,` raw `+u(e.raw??`-`),1),v(`td`,null,[v(`span`,{class:c([`st-pill`,e.ok?`ok`:`alarm`])},u(e.ok?`ACK`:i.$t(`dcwDetail.k3yit7139`)),3)]),v(`td`,ca,u(e.recipeRunId?i.$t(`dcwDetail.k6vgks7181`,{p0:e.recipeRunId}):`手动`),1)]))),128))])])])):g(``,!0),zo.value?(s(),h(`div`,{key:7,class:`modal-mask`,onClick:a[53]||=r(e=>zo.value=!1,[`self`])},[v(`div`,la,[v(`h3`,ua,u(i.$t(`dcwDetail.k1efduyf118`)),1),v(`div`,da,[v(`label`,fa,[v(`span`,null,[f(u(i.$t(`dcwDetail.k1avjrl6119`)),1),a[70]||=v(`em`,null,`*`,-1)]),y(v(`input`,{"onUpdate:modelValue":a[50]||=e=>H.name=e,class:`inp`,placeholder:i.$t(`dcwDetail.k12c11vm014`)},null,8,pa),[[n,H.name]])]),v(`label`,ma,[v(`span`,null,u(i.$t(`dcwDetail.k40gkk096`)),1),y(v(`input`,{"onUpdate:modelValue":a[51]||=e=>H.description=e,class:`inp`,placeholder:i.$t(`dcwDetail.k1hxx8hy015`)},null,8,ha),[[n,H.description]])])]),Vo.value?(s(),h(`p`,ga,u(Vo.value),1)):g(``,!0),v(`div`,_a,[v(`button`,{class:`aw-pill outline`,onClick:a[52]||=e=>zo.value=!1},u(i.$t(`dcwDetail.k3xdnn052`)),1),v(`button`,{class:`pill-btn`,disabled:Bo.value,onClick:Ho},u(Bo.value?i.$t(`dcwDetail.k1bg4759156`):i.$t(`dcwDetail.k1bg4kn6179`)),9,va)])])])):g(``,!0),l(S).error?(s(),h(`p`,ya,[f(u(l(S).error)+`(`,1),ne(p,{to:`/workshop`},{default:te(()=>[f(u(i.$t(`dcwDetail.k1bhhheq120`)),1)]),_:1}),a[71]||=f(`) `,-1)])):g(``,!0),v(`section`,ba,[v(`div`,xa,[v(`b`,null,u(i.$t(`dcwDetail.k1ledgt001`)),1),y(v(`select`,{"onUpdate:modelValue":a[54]||=e=>E.value=e,class:`inp`,onChange:Xa},[v(`option`,Sa,u(i.$t(`dcwDetail.k1ledgs001`)),1),(s(!0),h(d,null,o(O.value,e=>(s(),h(`option`,{key:e.id,value:e.id},u(e.name),9,Ca))),128))],544),[[t,E.value]])]),D.value?(s(),h(d,{key:0},[v(`div`,wa,[v(`div`,Ta,[v(`small`,null,u(i.$t(`dcwDetail.k1ledgv001`)),1),v(`b`,Ea,u(D.value.current??`--`),1)]),v(`div`,Da,[v(`small`,null,u(i.$t(`dcwDetail.k1ledgv002`)),1),v(`b`,Oa,u(D.value.recipeTarget??`--`),1)]),v(`div`,ka,[v(`small`,null,u(i.$t(`dcwDetail.k1ledgv003`)),1),v(`b`,Aa,u(D.value.lastGood??`--`),1)]),v(`button`,{class:`mini-btn`,onClick:Xa},u(i.$t(`dcwDetail.k1ledga001`)),1),v(`button`,{class:`mini-btn danger`,onClick:Za},u(i.$t(`dcwDetail.k1ledga002`)),1)]),v(`div`,ja,[v(`div`,Ma,[v(`small`,Na,u(i.$t(`dcwDetail.k1ledgh001`)),1),v(`ul`,Pa,[(s(!0),h(d,null,o(D.value.journal,e=>(s(),h(`li`,{key:e.id},u(e.at.slice(5,16).replace(`T`,` `))+` [`+u(e.source)+`] `+u(e.prevValue??`?`)+` → `+u(e.newValue),1))),128))])]),v(`div`,Fa,[v(`small`,Ia,u(i.$t(`dcwDetail.k1ledgr001`)),1),v(`ul`,La,[(s(!0),h(d,null,o(D.value.records,e=>(s(),h(`li`,{key:e.id,class:`ledger-rec`},[v(`span`,{class:c([`rec-st`,e.status])},u(e.status),3),v(`span`,Ra,u(e.params[0]?.from??`?`)+` → `+u(e.params[0]?.to),1),v(`small`,null,u(e.judge?`${e.judge.verdict}(${e.judge.by})`:e.status===`open`?`open`:e.closedBy??``),1)]))),128))])])])],64)):g(``,!0)])]))}}}),[[`__scopeId`,`data-v-7b43b781`]]);export{za as default};
|