From d498cdcf61fd8e2ec341cad3e7c21829ecef1672 Mon Sep 17 00:00:00 2001 From: sd <shidong@jhsoft.cc> Date: 星期二, 26 八月 2025 17:44:18 +0800 Subject: [PATCH] 摄像机配置、数据推送和文搜万物 bug和样式修复; 知识库卡片样式调整参照大模型平台知识库样式。 --- src/pages/searchNew/components/SurveyView.vue | 67 +++++++++++++++++++++------------ 1 files changed, 43 insertions(+), 24 deletions(-) diff --git a/src/pages/searchNew/components/SurveyView.vue b/src/pages/searchNew/components/SurveyView.vue index fbca1e2..001b1cf 100644 --- a/src/pages/searchNew/components/SurveyView.vue +++ b/src/pages/searchNew/components/SurveyView.vue @@ -171,8 +171,9 @@ <el-card class="result-card" :class="{ 'selected-card': selectedItemId === item.id }" @click.native.stop="handleCardClick(item)"> <div class="image-wrapper"> - <el-image slot="error" :src="item.image_path" class="result-image" alt="妫�娴嬬粨鏋�" /> - <!-- <img slot="error" src="@/assets/01.png" class="result-image" alt="妫�娴嬬粨鏋�" /> --> + <div class="image-container"> + <el-image slot="error" :src="item.image_path" class="result-image" alt="妫�娴嬬粨鏋�" /> + </div> <div class="image-overlay" v-if="item.is_warning == 1"> <span class="check-item"> {{ item.task_names }} @@ -204,7 +205,8 @@ <span>{{ item.video_name }}</span> <el-dropdown size="small" trigger="click" @command="handleCommand" class="right-btn"> <img src="@/assets/img/modelTraining.png" - style="width: 16px;height: 16px;margin-left: 10px; vertical-align: middle" @click.stop> + style="width: 16px;height: 16px;margin-left: 10px; vertical-align: middle" + @click.stop> <el-dropdown-menu slot="dropdown"> <el-dropdown-item :command="{ ruleName: item.rule_names ? item.rule_names[0].fileName : '', cameraId: item.video_point_id + '', cameraName: item.video_name, imagePath: item.image_path, status: 1 }">姝g‘</el-dropdown-item> @@ -452,11 +454,12 @@ if (lists) { for (let i = 0; i < lists.length; i++) { console.log("333:" + lists[i].video_point_id) - this.results.push({ + let item = {} + item = { task_names: lists[i].task_name, video_name: lists[i].video_name, - image_path: "/api-img" + lists[i].image_path, - video_path: "/api-img" + lists[i].video_path, + image_path: lists[i].image_path, + video_path: lists[i].video_path, detect_time: lists[i].detect_time, event_levels: lists[i].event_level_name, zh_desc_class: lists[i].zh_desc_class, @@ -464,14 +467,16 @@ is_desc: lists[i].is_desc, video_point_id: lists[i].video_point_id, rule_names: lists[i].rule_names, - knowledge_documents: lists[i].knowledge_documents.map(file => { + }; + if (lists[i].knowledge_documents) { + item.knowledge_documents = lists[i].knowledge_documents.map(file => { return { ...file, - file_url: "/api-img" + file.file_url, fileName: file.title } }) - }); + } + this.results.push(item) } } @@ -695,11 +700,12 @@ this.results = []; if (lists) { for (let i = 0; i < lists.length; i++) { - this.results.push({ + let item = {} + item = { task_names: lists[i].task_name, video_name: lists[i].video_name, - image_path: "/api-img" + lists[i].image_path, - video_path: "/api-img" + lists[i].video_path, + image_path: lists[i].image_path, + video_path: lists[i].video_path, detect_time: lists[i].detect_time, event_levels: lists[i].event_level_name, zh_desc_class: lists[i].zh_desc_class, @@ -707,16 +713,18 @@ is_desc: lists[i].is_desc, video_point_id: lists[i].video_point_id, rule_names: lists[i].rule_names, - knowledge_documents: lists[i].knowledge_documents.map(file => { - return { - ...file, - file_url: "/api-img" + file.file_url, - fileName: file.title - } - }), risk_description: lists[i].risk_description, suggestion: lists[i].suggestion - }); + }; + if (lists[i].knowledge_documents) { + item.knowledge_documents = lists[i].knowledge_documents.map(file => { + return { + ...file, + fileName: file.title + } + }) + } + this.results.push(item) } } this.totalResults = response.data.pagination.total; @@ -732,7 +740,7 @@ }, // 鏂板璇︽儏灞曠ず鏂规硶 showDetail(item) { - // console.info(item) + console.log(item) this.backendData = item.is_warning == 1 ? true : false; // console.info(item.is_warning) this.currentMediaType = "image"; @@ -1119,11 +1127,22 @@ overflow: visible; border-radius: 6px 6px 0 0; - .result-image { + .image-container { + position: relative; width: 100%; - // height: 130px; + padding-top: 56.25%; + /* 16:9瀹介珮姣� */ + background-color: #f5f7fa; + /* 鍔犺浇鏃剁殑鑳屾櫙鑹� */ + } + + .result-image { + position: absolute; + top: 0; + left: 0; + width: 100%; + height: 100%; object-fit: cover; - transition: transform 0.3s; } .image-overlay { -- Gitblit v1.8.0