优化界面
This commit is contained in:
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
4
frontend/dist/index.html
vendored
4
frontend/dist/index.html
vendored
@@ -4,8 +4,8 @@
|
|||||||
<meta charset="UTF-8">
|
<meta charset="UTF-8">
|
||||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||||
<title>猪场管理系统</title>
|
<title>猪场管理系统</title>
|
||||||
<script type="module" crossorigin src="/assets/index.390b7904.js"></script>
|
<script type="module" crossorigin src="/assets/index.7bd57931.js"></script>
|
||||||
<link rel="stylesheet" href="/assets/index.c407adbd.css">
|
<link rel="stylesheet" href="/assets/index.077c8bec.css">
|
||||||
</head>
|
</head>
|
||||||
<body>
|
<body>
|
||||||
<div id="app"></div>
|
<div id="app"></div>
|
||||||
|
|||||||
@@ -119,7 +119,7 @@
|
|||||||
:key="parent.id"
|
:key="parent.id"
|
||||||
:value="parent.id"
|
:value="parent.id"
|
||||||
>
|
>
|
||||||
{{ parent.name }}
|
{{ parent.display_name }}
|
||||||
</option>
|
</option>
|
||||||
</select>
|
</select>
|
||||||
</div>
|
</div>
|
||||||
@@ -204,12 +204,26 @@ export default {
|
|||||||
if (currentType === 'pig_pen_controller' || currentType === 'feed_mill_controller') {
|
if (currentType === 'pig_pen_controller' || currentType === 'feed_mill_controller') {
|
||||||
// 控制器的上级是中继设备
|
// 控制器的上级是中继设备
|
||||||
return this.devices.filter(device => device.type === 'relay')
|
return this.devices.filter(device => device.type === 'relay')
|
||||||
|
.map(relay => ({
|
||||||
|
...relay,
|
||||||
|
display_name: relay.name
|
||||||
|
}));
|
||||||
} else if (currentType === 'fan' || currentType === 'water_curtain') {
|
} else if (currentType === 'fan' || currentType === 'water_curtain') {
|
||||||
// 设备的上级是控制器
|
// 设备的上级是控制器
|
||||||
return this.devices.filter(device =>
|
// 找到所有控制器设备,并添加其上级中继设备的名称作为前缀
|
||||||
device.type === 'pig_pen_controller' || device.type === 'feed_mill_controller')
|
const controllers = this.devices.filter(device =>
|
||||||
|
device.type === 'pig_pen_controller' || device.type === 'feed_mill_controller');
|
||||||
|
|
||||||
|
return controllers.map(controller => {
|
||||||
|
// 查找控制器的上级中继设备
|
||||||
|
const relay = this.devices.find(device => device.id === controller.parent_id);
|
||||||
|
return {
|
||||||
|
...controller,
|
||||||
|
display_name: relay ? `${relay.name} - ${controller.name}` : controller.name
|
||||||
|
};
|
||||||
|
});
|
||||||
}
|
}
|
||||||
return []
|
return [];
|
||||||
},
|
},
|
||||||
|
|
||||||
// 加载设备列表
|
// 加载设备列表
|
||||||
|
|||||||
Reference in New Issue
Block a user