From 8018774a29da5bac884fab0154feff2b249a7a6e Mon Sep 17 00:00:00 2001 From: donghao Date: Wed, 12 Mar 2025 21:00:27 +0800 Subject: [PATCH] =?UTF-8?q?feat:=20=E5=AE=9E=E6=97=B6=E8=A7=86=E9=A2=91?= =?UTF-8?q?=E6=92=AD=E6=94=BE=E5=AE=9E=E7=8E=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/components/CustomTable/src/baseTable.scss | 6 +- src/components/videoPlayer/RealPlayer.vue | 12 +- src/components/videoPlayer/index.ts | 0 src/views/dashboard/DeviceStatus.vue | 17 +-- src/views/dashboard/PoleMonitor.vue | 17 ++- .../components/HistoryVideoModal.vue | 41 +----- .../dashboard/components/RealVideoModal.vue | 127 ++++++++++++++++++ 7 files changed, 158 insertions(+), 62 deletions(-) delete mode 100644 src/components/videoPlayer/index.ts diff --git a/src/components/CustomTable/src/baseTable.scss b/src/components/CustomTable/src/baseTable.scss index 8eac7f7..3068280 100644 --- a/src/components/CustomTable/src/baseTable.scss +++ b/src/components/CustomTable/src/baseTable.scss @@ -49,7 +49,11 @@ } &:hover { color: #37DBFF; - background: linear-gradient( 90deg, rgba(30,54,88,0) 0%, #0C4FAD 53%, rgba(65,117,190,0) 100%);; + background: linear-gradient( 90deg, rgba(30,54,88,0) 0%, #0C4FAD 53%, rgba(65,117,190,0) 100%); + } + &.selected-row{ + color: #37DBFF; + background: linear-gradient( 90deg, rgba(30,54,88,0) 0%, #0C4FAD 53%, rgba(65,117,190,0) 100%); } } } diff --git a/src/components/videoPlayer/RealPlayer.vue b/src/components/videoPlayer/RealPlayer.vue index 9f094e1..dd5eabd 100644 --- a/src/components/videoPlayer/RealPlayer.vue +++ b/src/components/videoPlayer/RealPlayer.vue @@ -1,5 +1,5 @@ @@ -54,6 +54,7 @@ import { BaseTable } from "@/components/CustomTable"; import ContentHeader from '@/components/ContentHeader.vue'; import HistoryVideoModal from './components/HistoryVideoModal.vue'; +import RealVideoModal from './components/RealVideoModal.vue'; import onLineIcon from '@/assets/common/online_icon.png'; import outLineIcon from '@/assets/common/outline_icon.png'; import errorIcon from '@/assets/common/error_icon.png'; @@ -96,6 +97,7 @@ const deleteModel = reactive<{ }); const currentRow = ref>({}); +const isRealOpen = ref(false); @@ -174,13 +176,6 @@ const pagination = ref({ currentPage: 1, pageSize: 10, total: 0 }); const listData = ref([]); -// const searchValue = ref(""); - -// const formData = reactive({ -// name: "", -// status: "" -// }); - const dataLoading = ref(true); const getList = async () => { @@ -212,6 +207,8 @@ function handleTableChange(record) { function openCurrent(row) { console.log(row, "openCurrent"); currentRow.value = row; + isRealOpen.value = true; + } function openHistory(row) { diff --git a/src/views/dashboard/PoleMonitor.vue b/src/views/dashboard/PoleMonitor.vue index b44a54d..5bfa23c 100644 --- a/src/views/dashboard/PoleMonitor.vue +++ b/src/views/dashboard/PoleMonitor.vue @@ -2,7 +2,7 @@ * @Author: donghao donghao@supervision.ltd * @Date: 2025-03-06 15:15:01 * @LastEditors: donghao donghao@supervision.ltd - * @LastEditTime: 2025-03-12 15:01:18 + * @LastEditTime: 2025-03-12 20:57:12 * @FilePath: \vite-ai\data-dashboard\src\views\dashboard\PoleMonitor.vue * @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE --> @@ -75,7 +75,8 @@ @@ -120,7 +121,8 @@ const onSwiper = (swiper) => { const onSlideChange = () => { console.log("slide change"); }; - +// 存储当前选中行的索引 +const currentRowIndex = ref(-1); // const currentRow = ref>({}); const columns = [ { @@ -215,7 +217,16 @@ function handleTableChange(record) { }; getList(); } +// TODO 点击选中效果 +// 定义行类名方法 +const handleRowClassName = ({ rowIndex }) => { + return rowIndex === currentRowIndex.value ? 'selected-row' : ''; +}; +// 行点击事件处理 +const handleRowClick = (row, event, rowIndex) => { + currentRowIndex.value = rowIndex; +}; onMounted(() => { getList(); }); diff --git a/src/views/dashboard/components/HistoryVideoModal.vue b/src/views/dashboard/components/HistoryVideoModal.vue index a6125e7..4936ee6 100644 --- a/src/views/dashboard/components/HistoryVideoModal.vue +++ b/src/views/dashboard/components/HistoryVideoModal.vue @@ -1,47 +1,12 @@ - - - \ No newline at end of file diff --git a/src/views/dashboard/components/RealVideoModal.vue b/src/views/dashboard/components/RealVideoModal.vue index e69de29..765b062 100644 --- a/src/views/dashboard/components/RealVideoModal.vue +++ b/src/views/dashboard/components/RealVideoModal.vue @@ -0,0 +1,127 @@ + + + + + \ No newline at end of file