优化界面
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 name="viewport" content="width=device-width, initial-scale=1.0">
|
||||
<title>猪场管理系统</title>
|
||||
<script type="module" crossorigin src="/assets/index.390b7904.js"></script>
|
||||
<link rel="stylesheet" href="/assets/index.c407adbd.css">
|
||||
<script type="module" crossorigin src="/assets/index.7bd57931.js"></script>
|
||||
<link rel="stylesheet" href="/assets/index.077c8bec.css">
|
||||
</head>
|
||||
<body>
|
||||
<div id="app"></div>
|
||||
|
||||
@@ -119,7 +119,7 @@
|
||||
:key="parent.id"
|
||||
:value="parent.id"
|
||||
>
|
||||
{{ parent.name }}
|
||||
{{ parent.display_name }}
|
||||
</option>
|
||||
</select>
|
||||
</div>
|
||||
@@ -204,12 +204,26 @@ export default {
|
||||
if (currentType === 'pig_pen_controller' || currentType === 'feed_mill_controller') {
|
||||
// 控制器的上级是中继设备
|
||||
return this.devices.filter(device => device.type === 'relay')
|
||||
.map(relay => ({
|
||||
...relay,
|
||||
display_name: relay.name
|
||||
}));
|
||||
} 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