sss
This commit is contained in:
42
server/api/power-station/properties.get.ts
Normal file
42
server/api/power-station/properties.get.ts
Normal file
@@ -0,0 +1,42 @@
|
||||
export default defineEventHandler(async event => {
|
||||
const query = getQuery(event)
|
||||
const nodeId = query.nodeId as string
|
||||
|
||||
if (!nodeId) {
|
||||
throw createError({
|
||||
statusCode: 400,
|
||||
statusMessage: 'Node ID is required',
|
||||
})
|
||||
}
|
||||
|
||||
try {
|
||||
// 模拟属性数据
|
||||
const mockProperties = {
|
||||
basic: [
|
||||
{ label: '节点ID', value: nodeId },
|
||||
{ label: '节点名称', value: nodeId.split('~').pop() },
|
||||
{ label: '节点类型', value: '设备' },
|
||||
{ label: '所属系统', value: '主系统' },
|
||||
],
|
||||
technical: [
|
||||
{ label: '设计压力', value: '16.5 MPa', unit: 'MPa' },
|
||||
{ label: '设计温度', value: '545', unit: '°C' },
|
||||
{ label: '材料', value: 'SA-516 Gr.70' },
|
||||
{ label: '厚度', value: '25', unit: 'mm' },
|
||||
],
|
||||
status: [
|
||||
{ label: '运行状态', value: '正常运行', status: 'success' },
|
||||
{ label: '健康度', value: '95%', status: 'success' },
|
||||
{ label: '维护状态', value: '正常', status: 'success' },
|
||||
{ label: '报警状态', value: '无报警', status: 'success' },
|
||||
],
|
||||
}
|
||||
|
||||
return mockProperties
|
||||
} catch (error) {
|
||||
throw createError({
|
||||
statusCode: 500,
|
||||
statusMessage: 'Failed to fetch properties data',
|
||||
})
|
||||
}
|
||||
})
|
||||
Reference in New Issue
Block a user