From b2bccb622aaa968c02a78795f7d8e1ab2fb8c99d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=B2=A1=E5=A4=8D=E4=B9=A0?= <2353956224@qq.com> Date: Mon, 8 Sep 2025 23:12:00 +0800 Subject: [PATCH] =?UTF-8?q?=E7=82=B9=E5=87=BB=E6=94=BE=E5=A4=A7=E6=A0=B7?= =?UTF-8?q?=E5=BC=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .env.development | 5 +- src/components/MultiLineInputDialog.vue | 6 +- src/static/css/video.less | 231 ++++++++++++++++++++++++ src/stores/storage.js | 2 +- src/views/VideoStream.vue | 80 ++++++-- 5 files changed, 300 insertions(+), 24 deletions(-) diff --git a/.env.development b/.env.development index ecaf696..5e7b6ac 100644 --- a/.env.development +++ b/.env.development @@ -1,9 +1,10 @@ # iOS 控制服务 VUE_APP_BASE_LOCAL=http://127.0.0.1:34567/ +# VUE_APP_BASE_LOCAL=http://192.168.1.209:34567/ # 业务后端(开发用内网地址) -VUE_APP_BASE_REMOTE=https://crawlclient.api.yolozs.com -# VUE_APP_BASE_REMOTE=http://192.168.1.144:8101/ +# VUE_APP_BASE_REMOTE=https://crawlclient.api.yolozs.com +VUE_APP_BASE_REMOTE=http://192.168.1.144:8101/ # AI 服务 VUE_APP_BASE_SPECIAL=http://ai.zhukeping.com \ No newline at end of file diff --git a/src/components/MultiLineInputDialog.vue b/src/components/MultiLineInputDialog.vue index 17466ae..a8e862d 100644 --- a/src/components/MultiLineInputDialog.vue +++ b/src/components/MultiLineInputDialog.vue @@ -54,9 +54,9 @@ function parseLines() { } function handleConfirm() { - if (!rawText.value) { - return; // 空内容直接忽略 - }; + // if (!rawText.value) { + // return; // 空内容直接忽略 + // }; const items = parseLines(); emit('confirm', items, props.title, props.index, value1.value); closingByConfirm.value = true; // 标记:这次关闭来自“确定” diff --git a/src/static/css/video.less b/src/static/css/video.less index e1c6668..b4f07bc 100644 --- a/src/static/css/video.less +++ b/src/static/css/video.less @@ -41,6 +41,12 @@ body { /* 关键:grid items 在 block 轴不拉伸 */ justify-items: center; /* 可选:让每个卡片水平居中 */ + row-gap: 24px; + /* 上下行之间 24px 间距 */ + column-gap: 16px; + /* 左右列之间 16px 间距(可按需调整或删掉) */ + overflow: visible; + /* 放大时允许覆盖 */ } .right { @@ -250,4 +256,229 @@ video { flex-direction: column; align-items: center; // justify-content: center; +} + + +/* === STEP 1: 放大覆盖,但不改变网格布局尺寸 === */ + +/* 1) 网格行高稳定(可选) */ +.content { + /* 确保每个自动行的基准高度,等于缩略高度 432px */ + grid-auto-rows: 432px; + overflow: visible; + /* 放大时允许溢出覆盖 */ +} + +/* 2) 每个卡片的占位固定为缩略尺寸(320×720 的 0.6 倍 = 192×432) */ +.video-container { + position: relative; + width: 192px; + /* 固定缩略占位宽度 */ + height: 432px; + /* 固定缩略占位高度 */ + overflow: visible; + /* 放大时从容器溢出,不挤压布局 */ + align-self: start; + margin: 0; +} + +/* 3) 真正的手机画面用绝对定位 + 视觉缩放(默认缩略 0.6) */ +.video-container .video-canvas { + position: absolute; + top: 0; + left: 0; + /* 原始尺寸:320×720。用 !important 覆盖模板里的 :style 宽高,避免改变布局 */ + width: 320px !important; + height: 720px !important; + + transform: scale(0.6); + transform-origin: top center; + /* 默认以上方为原点(下一步会针对上下行细调方向) */ + transition: transform .18s ease, box-shadow .18s ease, z-index .18s ease; + + z-index: 1; + /* 未选中时层级较低 */ + line-height: 0; + cursor: pointer; +} + +/* 4) 选中时:仅视觉放大,不改变外层占位尺寸 */ +.video-container .video-canvas.active { + transform: scale(1); + z-index: 20; + /* 盖住其它缩略卡片 */ + box-shadow: 0 8px 22px rgba(0, 0, 0, .25); +} + +/* 5) 图像与画布尺寸固定为原始尺寸,覆盖在 video-canvas 内 */ +.video-container .stream, +.video-container .overlay { + position: absolute; + top: 0; + left: 0; + width: 320px !important; + height: 720px !important; + display: block; +} + +.video-container .stream { + user-select: none; + pointer-events: none; + /* 事件交给上层 overlay/canvas */ + z-index: 1; +} + +.video-container .overlay { + z-index: 2; + cursor: crosshair; +} + + + + +/* —— 修正容器与画布的对齐与偏移 —— */ + +/* 网格:行距回到紧凑,且不再让子项有奇怪的基线对齐 */ +.content { + row-gap: 12px; + /* 行间距按需改 */ + column-gap: 16px; + align-items: start; + /* 已有,强调一下 */ + justify-items: center; + /* 已有 */ + overflow: visible; + /* 放大可溢出覆盖 */ +} + +/* 让每个格子“像块级元素”占位,避免 flex 造成的基线/对齐偏差 */ +.video-container { + display: block !important; + /* 避免作为 flex 容器引入的对齐偏差 */ + position: relative; + width: 192px; + /* 固定缩略占位:320×720 的 0.6 倍 */ + height: 432px; + margin: 0 !important; + /* gap 负责间距 */ + padding: 0 !important; + border: 0; + overflow: visible; + align-self: start; + /* 和网格对齐一致 */ +} + +/* 核心:子元素绝对定位在容器(0,0);缩放从左上角开始,杜绝“左/上漂移” */ +.video-container .video-canvas { + position: absolute; + top: 0; + left: 0; + width: 320px !important; + height: 720px !important; + + transform: scale(0.6); + transform-origin: top left !important; + /* 关键:从左上角缩放,边界贴紧容器左上 */ + + margin: 0 !important; + box-sizing: border-box; + /* 如果你需要边框,避免边框把可视尺寸再挤偏 */ + z-index: 1; + line-height: 0; + cursor: pointer; + + /* 如之前有边框导致“看起来外扩”,建议先关掉调试 */ + border: none !important; + /* 需要边框再开,但建议用 outline,不参与尺寸 */ +} + +/* 选中放大:遮挡覆盖但不挤压 */ +.video-container .video-canvas.active { + transform: scale(1); + z-index: 20; + box-shadow: 0 8px 22px rgba(0, 0, 0, .25); +} + +/* 图片与操作层铺满 video-canvas 的原始尺寸 */ +.video-container .stream, +.video-container .overlay { + position: absolute; + top: 0; + left: 0; + width: 320px !important; + height: 720px !important; + display: block; +} + +.video-container .stream { + user-select: none; + pointer-events: none; + z-index: 1; +} + +.video-container .overlay { + z-index: 2; +} + +// /* 第二行“选中时”向上放大(默认仍从左上缩放,只有选中才改为 bottom-left) */ +// .content .video-container:nth-child(n + 4) .video-canvas.active { +// transform-origin: bottom left !important; +// /* 只在选中时往上长 */ +// } + + +/* 网格允许覆盖,不挤压布局 */ +.content { + overflow: visible; +} + +/* 每个卡片只占缩略尺寸:320x720 的 0.6 倍 = 192x432 */ +.video-container { + position: relative; + width: 192px !important; + height: 432px !important; + overflow: visible; + margin: 0 !important; + /* 行/列间距用 gap 控即可 */ + padding: 0 !important; +} + +/* 画面容器固定原始尺寸,绝对定位到卡片左上角 */ +.video-canvas { + position: absolute; + top: 0; + left: 0; + width: 320px !important; + height: 720px !important; + transition: transform .18s ease, box-shadow .18s ease; + will-change: transform; + z-index: 1; +} + +/* 选中时仅提升层级、阴影(缩放由 getCanvasStyle 控制) */ +.video-canvas.active { + z-index: 20; + box-shadow: 0 8px 22px rgba(0, 0, 0, .25); +} + +/* 图像与遮罩铺满 320x720 */ +.video-canvas .stream, +.video-canvas .overlay { + position: absolute; + top: 0; + left: 0; + width: 320px !important; + height: 720px !important; + display: block; +} + +.video-canvas .stream { + user-select: none; + pointer-events: none; + /* 让鼠标事件落在 overlay 上 */ + z-index: 1; +} + +.video-canvas .overlay { + z-index: 2; } \ No newline at end of file diff --git a/src/stores/storage.js b/src/stores/storage.js index 24f47a8..09c9ae4 100644 --- a/src/stores/storage.js +++ b/src/stores/storage.js @@ -74,7 +74,7 @@ export function addToHostList(newItem) { // 用于获取私信信息 export function getContentpriList() { const arr = JSON.parse(localStorage.getItem('Contentpri')) - return [arr, arr, arr, arr, arr, arr, arr, arr]; + return arr; } // 用于设置私信信息 export function setContentpriList(data) { diff --git a/src/views/VideoStream.vue b/src/views/VideoStream.vue index bcd5fe1..c591a74 100644 --- a/src/views/VideoStream.vue +++ b/src/views/VideoStream.vue @@ -18,16 +18,13 @@
-
- - - - + - + @mousemove.stop="(e) => onCanvasMove(device.deviceId, e, index)" />
@@ -109,7 +106,7 @@