diff --git a/src/components/hazard_inspect/ItemList.vue b/src/components/hazard_inspect/ItemList.vue
index ac2be16..9bee426 100644
--- a/src/components/hazard_inspect/ItemList.vue
+++ b/src/components/hazard_inspect/ItemList.vue
@@ -36,7 +36,24 @@ function handleItemClick(item: string, index: number) {
+
+
+
+ {{ index + 1 }}
+
+
+ {{ index + 1 }}
+
+
+
+ {{ (item as number[])[1] }}
+
+
+
+
+
+
diff --git a/src/composables/api.ts b/src/composables/api.ts
index 7771674..3464878 100644
--- a/src/composables/api.ts
+++ b/src/composables/api.ts
@@ -17,6 +17,6 @@ export async function runApi(funcName: string, params: Record) {
catch (error) {
// 捕获异常,打印错误信息
console.error('接口调用失败:', error)
- throw error
+ return 'error'
}
}
diff --git a/src/pages/nav/hazardCheck/HazardCheckResult.vue b/src/pages/nav/hazardCheck/HazardCheckResult.vue
index 8484793..9e9f3f0 100644
--- a/src/pages/nav/hazardCheck/HazardCheckResult.vue
+++ b/src/pages/nav/hazardCheck/HazardCheckResult.vue
@@ -2,7 +2,7 @@
import { computed, onMounted, ref } from 'vue'
import { useRouter } from 'vue-router'
-// import { runApi } from '~/composables/api'
+import { runApi } from '~/composables/api'
interface HazardItem {
隐患编号: string
@@ -19,7 +19,8 @@ interface HazardItem {
}
interface DataFormat {
- 隐患列表: [number, string, string][]
+ 隐患列表: [number, string][]
+ // 隐患列表: [number, string, string][]
隐患范围字典: Record
隐患数据: HazardItem[]
}
@@ -134,7 +135,7 @@ function getData() {
data.value.隐患列表 = (objects || []).map((obj: any) => {
return [
obj.level,
- resultData.value?.class_list?.[obj.class_id] || '',
+ // resultData.value?.class_list?.[obj.class_id] || '',
tag?.[obj.tag_id] || '',
]
})
@@ -241,17 +242,21 @@ onMounted(() => {
// 从路由参数中获取数据
const vidFile = router.currentRoute.value.query.vid_file as string
if (vidFile) {
- // runApi('/get_vidUrl', {
- // vid_file: vidFile,
- // }).then((res) => {
- // // console.log('接口调用成功,返回数据:', res)
- // // vidUrl.value = res[0]
- // vidUrl.value = 'http://localhost:8086/santai5_h264.mp4'
- // console.log('完整视频路径:', vidUrl.value)
- // })
- // 测试用视频路径
- vidUrl.value = 'http://localhost:8086/santai5_h264.mp4'
- // console.log('完整视频路径:', vidUrl.value)
+ runApi('/get_full_vid_path', {
+ vid_file: vidFile,
+ }).then((res) => {
+ // console.log('接口调用成功,返回数据:', res)
+ vidUrl.value = (res as string[])[0]
+
+ // 截取文件名
+ const fileName = vidUrl.value.split('\\').pop() || ''
+ // 去掉文件扩展名
+ const fileNameNoExt = fileName.split('.')[0]
+ // 文件扩展名
+ const fileExt = fileName.split('.')[1]
+ // 临时拼接视频路径
+ vidUrl.value = `http://localhost:8086/${fileNameNoExt}_h264.${fileExt}`
+ })
// runApi('/run', {
// vid_file: vidFile,
diff --git a/src/pages/nav/hazardCheck/index.vue b/src/pages/nav/hazardCheck/index.vue
index d0921c7..17f073c 100644
--- a/src/pages/nav/hazardCheck/index.vue
+++ b/src/pages/nav/hazardCheck/index.vue
@@ -1,6 +1,6 @@
@@ -111,12 +132,11 @@ async function goToResult(formEl: FormInstance | undefined) {
>
-
-
+
-
+
物体识别
@@ -158,4 +178,11 @@ async function goToResult(formEl: FormInstance | undefined) {
justify-content: center;
align-items: start;
}
+
+.checkbox-group {
+ display: flex;
+ flex-wrap: wrap;
+ gap: 16px;
+ justify-content: flex-start;
+}