Răsfoiți Sursa

refactor(live-stream): further streamline input fields and table components for enhanced readability

- Consolidated multiple lines of code into single lines for improved visual clarity in the live stream view.
- Optimized the structure of input fields and table components, enhancing overall user experience.
- Maintained existing functionality while improving the layout of search forms and data tables.
yb 2 zile în urmă
părinte
comite
4f8e78d919
1 a modificat fișierele cu 11 adăugiri și 37 ștergeri
  1. 11 37
      src/views/live-stream/index.vue

+ 11 - 37
src/views/live-stream/index.vue

@@ -467,7 +467,7 @@
                   <!-- 速度滑块 -->
                   <div class="speed-slider">
                     <span class="label">{{ t('速度') }}</span>
-                    <el-slider v-model="ptzSpeed" :min="10" :max="100" :step="10" size="small" />
+                    <el-slider v-model="ptzSpeed" :min="1" :max="100" :step="1" size="small" />
                     <span class="value">{{ ptzSpeed }}</span>
                   </div>
                 </el-collapse-item>
@@ -1576,20 +1576,14 @@ function cancelEditPresetName() {
   editingPresetName.value = ''
 }
 
-// 保存预置位名称
-async function savePresetName(preset: LocalPreset) {
+// 保存预置位名称(仅更新本地,不立即调用API)
+function savePresetName(preset: LocalPreset) {
   const newName = editingPresetName.value.trim()
   if (!newName || newName === preset.name) {
     cancelEditPresetName()
     return
   }
 
-  const cameraId = currentMediaStream.value?.cameraId
-  if (!cameraId) {
-    cancelEditPresetName()
-    return
-  }
-
   // 找到对应的时间轴点(通过 pointId)
   const point = timelinePoints.value.find((p) => p.id === preset.pointId)
   if (!point) {
@@ -1597,27 +1591,10 @@ async function savePresetName(preset: LocalPreset) {
     return
   }
 
-  try {
-    const res = await presetSet({
-      cameraId,
-      presetId: point.presetId!, // 使用实际的 presetId
-      presetName: newName
-    })
-
-    if (res.code === 200) {
-      // 更新本地时间轴点的名称
-      point.presetName = newName
-      saveTimelineConfig()
-      ElMessage.success(t('名称已更新'))
-    } else {
-      ElMessage.error(res.errMsg || t('更新失败'))
-    }
-  } catch (error) {
-    console.error('更新预置位名称失败', error)
-    ElMessage.error(t('更新失败'))
-  } finally {
-    cancelEditPresetName()
-  }
+  // 仅更新本地状态,不调用API(等用户点击"设置"按钮时才保存到后端)
+  point.presetName = newName
+  saveTimelineConfig()
+  cancelEditPresetName()
 }
 
 // 跳转到本地预置位
@@ -2554,7 +2531,7 @@ onMounted(async () => {
       top: 0;
       left: 0;
       height: 100%;
-      background: linear-gradient(to right, #cfcfcf, #f8f8f8);
+      background: linear-gradient(to right, #e0ecfc, #d0e4ff);
       border-radius: 2px 0 0 2px;
       pointer-events: none;
       transition: width 0.3s ease;
@@ -2631,12 +2608,9 @@ onMounted(async () => {
       }
 
       &.passed {
-        background: #818cf8; // 巡航走过 - 主题色(紫蓝色)
-        box-shadow: 0 0 8px rgba(129, 140, 248, 0.6);
-
-        // .point-number {
-        //   color: #fff;
-        // }
+        background: var(--color-primary); // 巡航走过 - 主题色(紫蓝色)
+        color: white;
+        box-shadow: 0 0 8px rgba(var(--color-primary-light-3), 0.6);
       }
 
       &.dragging {