Ver Fonte

refactor(live-stream, lss): streamline component formatting for improved readability

- Consolidated attributes in various components, including el-table, el-drawer, and el-input, to enhance code clarity and maintainability.
- Reduced unnecessary line breaks and improved overall formatting in both live-stream and LSS views for a cleaner layout.
- Updated pagination and drawer components for consistency across the application.
yb há 6 dias atrás
pai
commit
81647b8e06
2 ficheiros alterados com 3 adições e 38 exclusões
  1. 0 37
      src/views/live-stream/index.vue
  2. 3 1
      src/views/lss/index.vue

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

@@ -172,13 +172,6 @@
                 />
               </div>
             </el-form-item>
-            <!-- <el-form-item label="备注:" prop="remark">
-              <el-input v-model="form.remark" type="textarea" :rows="2" placeholder="备注信息" maxlength="500"
-                style="width: 300px" />
-            </el-form-item> -->
-            <!-- <el-form-item v-if="isEdit" label="启用状态:" prop="enabled">
-              <el-switch v-model="form.enabled" />
-            </el-form-item> -->
           </el-form>
         </div>
         <div class="drawer-footer">
@@ -418,8 +411,6 @@ import {
   Refresh,
   ZoomIn,
   ZoomOut,
-  Edit,
-  Delete,
   Close
 } from '@element-plus/icons-vue'
 import { listLiveStreams, addLiveStream, updateLiveStream, deleteLiveStream } from '@/api/live-stream'
@@ -443,34 +434,6 @@ function formatDateTime(dateStr: string | undefined): string {
   return dayjs(dateStr).format('YYYY-MM-DD HH:mm:ss')
 }
 
-// 获取状态标签颜色
-function getStatusTagType(status?: LiveStreamStatus): 'success' | 'warning' | 'danger' | 'info' {
-  switch (status) {
-    case 'streaming':
-      return 'success'
-    case 'idle':
-      return 'info'
-    default:
-      return 'info'
-  }
-}
-
-// 获取状态标签文本
-function getStatusLabel(status?: LiveStreamStatus): string {
-  switch (status) {
-    case 'STREAMING':
-      return t('推流中')
-    case 'IDLE':
-      return t('空闲')
-    case 'STOPPED':
-      return t('已停止')
-    case 'ERROR':
-      return t('错误')
-    default:
-      return '-'
-  }
-}
-
 const loading = ref(false)
 const submitLoading = ref(false)
 const streamList = ref<LiveStreamDTO[]>([])

+ 3 - 1
src/views/lss/index.vue

@@ -844,7 +844,9 @@ const cameraForm = reactive({
 })
 
 // 摄像头表单验证规则(动态)
-const cameraRules = computed<FormRules>(() => ({}))
+const cameraRules = computed<FormRules>(() => ({
+  cameraId: [{ required: true, message: t('请输入设备ID'), trigger: 'blur' }]
+}))
 
 // 排序状态
 const sortState = reactive<{