Commit 5ef2e07e2c4349d57bed5d76a43fb4a96224728a
1 parent
560b2cd5
perf: 优化边缘实例,由点击路由跳转边缘设备修改为Tab页签方式展示
Showing
4 changed files
with
19 additions
and
9 deletions
... | ... | @@ -8,7 +8,7 @@ |
8 | 8 | import { Image } from 'ant-design-vue'; |
9 | 9 | import { useMessage } from '/@/hooks/web/useMessage'; |
10 | 10 | import { syncEdge } from '/@/api/edgeManage/edgeInstance'; |
11 | - import { useGo } from '/@/hooks/web/usePage'; | |
11 | + // import { useGo } from '/@/hooks/web/usePage'; | |
12 | 12 | |
13 | 13 | const props = defineProps({ |
14 | 14 | recordData: { |
... | ... | @@ -30,7 +30,7 @@ |
30 | 30 | |
31 | 31 | const { createMessage } = useMessage(); |
32 | 32 | |
33 | - const go = useGo(); | |
33 | + // const go = useGo(); | |
34 | 34 | |
35 | 35 | const loadStatus = ref(false); |
36 | 36 | |
... | ... | @@ -51,9 +51,9 @@ |
51 | 51 | } |
52 | 52 | }; |
53 | 53 | |
54 | - const handleEventIsOpenEdgeDevice = () => { | |
55 | - go('/edge/edge_device/' + props.recordData?.id?.id); | |
56 | - }; | |
54 | + // const handleEventIsOpenEdgeDevice = () => { | |
55 | + // go('/edge/edge_device/' + props.recordData?.id?.id); | |
56 | + // }; | |
57 | 57 | </script> |
58 | 58 | |
59 | 59 | <template> |
... | ... | @@ -74,9 +74,9 @@ |
74 | 74 | <a-button :loading="loadStatus" type="primary" @click="handleEventIsSyncEdge" |
75 | 75 | >同步边缘</a-button |
76 | 76 | > |
77 | - <a-button class="ml-4" type="primary" @click="handleEventIsOpenEdgeDevice" | |
77 | + <!-- <a-button class="ml-4" type="primary" @click="handleEventIsOpenEdgeDevice" | |
78 | 78 | >边缘设备</a-button |
79 | - > | |
79 | + > --> | |
80 | 80 | </div> |
81 | 81 | </div> |
82 | 82 | </a-col> | ... | ... |
... | ... | @@ -3,6 +3,7 @@ |
3 | 3 | import { ref } from 'vue'; |
4 | 4 | import { EdgeMonitoring } from '../EdgeMonitoring'; |
5 | 5 | import { EdgeEvents } from '../EdgeEvents'; |
6 | + import { EdgeDevice } from '../EdgeDevice'; | |
6 | 7 | import { EdgeInstanceItemType } from '/@/api/edgeManage/model/edgeInstance'; |
7 | 8 | import type { PropType } from 'vue'; |
8 | 9 | |
... | ... | @@ -14,11 +15,12 @@ |
14 | 15 | }); |
15 | 16 | |
16 | 17 | enum ActiveKey { |
18 | + EDGE_DEVICE = 'EdgeDevice', | |
17 | 19 | EDGEMONITORING = 'EdgeMonitoring', |
18 | 20 | EDGEEVENTS = 'EdgeEvents', |
19 | 21 | } |
20 | 22 | |
21 | - const activeKey = ref(ActiveKey.EDGEMONITORING); | |
23 | + const activeKey = ref(ActiveKey.EDGE_DEVICE); | |
22 | 24 | </script> |
23 | 25 | |
24 | 26 | <template> |
... | ... | @@ -29,6 +31,13 @@ |
29 | 31 | type="card" |
30 | 32 | class="w-full h-full bg-light-50 !p-4 dark:bg-dark-900" |
31 | 33 | > |
34 | + <Tabs.TabPane tab="边缘设备" :key="ActiveKey.EDGE_DEVICE"> | |
35 | + <EdgeDevice | |
36 | + v-if="recordData" | |
37 | + :recordData="recordData" | |
38 | + class="p-4 bg-neutral-100 dark:bg-dark-700" | |
39 | + /> | |
40 | + </Tabs.TabPane> | |
32 | 41 | <Tabs.TabPane tab="边缘监控" :key="ActiveKey.EDGEMONITORING"> |
33 | 42 | <EdgeMonitoring |
34 | 43 | v-if="recordData" | ... | ... |