diff --git a/src/views/business/alarm/list.vue b/src/views/business/alarm/list.vue index 1e54264..0dcd27a 100644 --- a/src/views/business/alarm/list.vue +++ b/src/views/business/alarm/list.vue @@ -2,21 +2,45 @@
-
{{ item.label }}
+
+ {{ item.label }} +
- -
-
+ +
+
{{ item.createAt }} - +
-
{{ (index + 1).toString().padStart(2, '0') }}
+
+ {{ (index + 1).toString().padStart(2, "0") }} +
- {{ item.boatName }} - {{ item.illegalType }} ,请相关人员尽快前往协调 + {{ item.boatName }} - + {{ item.illegalType }} ,请相关人员尽快前往协调
@@ -25,11 +49,11 @@
@@ -43,7 +67,7 @@ import { videoIdentificationPage } from '@/api/identification.js' const mapStore = useMapStore() const tabs = [ - { + { label: '无船号', value: 'monitor' }, @@ -51,7 +75,6 @@ const tabs = [ label: '有船号', value: 'plane' } - ] const current = ref(1) const data = ref([]) @@ -60,31 +83,29 @@ const isFold = ref(false) const isLoading = ref(false) const initData = () => { - -// 为了撑起来框架 - data.value = [ - { + // 为了撑起来框架 + data.value = [ + { id: 1, createAt: '2025-11-23 09:37:25', boatName: '浙渔BHI90', illegalType: '未穿救生衣预警,未封仓预警,未悬挂国旗' } - ] + ] isLoading.value = true const params = { isHasBoatName: current.value == 1 ? 1 : 2, pageNo: 1, pageSize: 20 } - videoIdentificationPage(params).then(res => { - if(res.success) { + videoIdentificationPage(params).then((res) => { + if (res.success) { data.value = res.result.records - }else { + } else { ElMessage.error(res.result) } isLoading.value = false }) - } const toggleFold = () => { isFold.value = !isFold.value @@ -103,22 +124,41 @@ const handle = (type, item) => { break } } + +// 在 script setup 中添加 +const selectedItemId = ref(null) // 记录选中的项目ID + +// 判断是否选中 +const isSelected = (item) => { + return selectedItemId.value === item.id +} + +// 更新选中状态的方法 +const selectItem = (item) => { + selectedItemId.value = item.id === selectedItemId.value ? null : item.id +} + initData()