浏览代码

fix: 协议配置修改bug

lvkun 3 年之前
父节点
当前提交
cf962e7474
共有 2 个文件被更改,包括 13 次插入5 次删除
  1. 1 1
      src/api/rts/stream.ts
  2. 12 4
      src/pages/rts/record/index.vue

+ 1 - 1
src/api/rts/stream.ts

@@ -116,7 +116,7 @@ export const postRecord = (params: {type: 'mp4' | 'ts' | 'flv', streamPath: stri
 /** 停止录制 */
 export const stopRecord = (id: string) => {
   return request<RTS.STREAM.Detail[]>({
-    url: '/record/api/stop?id=xxx',
+    url: `/record/api/stop?id=${id}`,
     method: 'GET'
   })
 }

+ 12 - 4
src/pages/rts/record/index.vue

@@ -22,14 +22,14 @@
       style="margin-top: 20px;"
       :columns="recordColumns"
       :data-source="state.recordDataSource"
-      :loading="state.loading"
+      :loading="state.recordLoading"
       :pagination="false"
     >
     <template #bodyCell="{column, record}" >
         <template v-if="column.key === 'action'"  >
           <a-space>
             <!-- <a @click="openModal(record)" >详情</a> -->
-            <a @click="recordPlay(record)" >录制播放</a>
+            <a @click="recordPlay(record)" >flv播放</a>
           </a-space>
         </template>
       </template>
@@ -100,7 +100,7 @@
 </template>
 <script lang="ts" setup >
 import { RtsController } from '@/controller/rts'
-import { onMounted, reactive } from 'vue'
+import { onMounted, reactive, watch } from 'vue'
 import { Form, message } from 'ant-design-vue'
 import { VideoPlayerTsx } from '@/components/VideoPlayer/index'
 import { getRecording } from '@/api/rts/stream'
@@ -160,6 +160,7 @@ const recordState = reactive({
 
 const state = reactive({
   loading: false,
+  recordLoading: false,
   visible: false,
   recordVisible: false,
   recordingDataSource: [],
@@ -171,8 +172,13 @@ const state = reactive({
   videoUrl: ''
 })
 
+watch(
+  () => recordState.type,
+  () => getRecordList()
+)
+
 const stopRcord = async (record) => {
-  await RtsController.stopRecord(record.id)
+  await RtsController.stopRecord(record.ID)
   getRecording()
 }
 
@@ -206,7 +212,9 @@ const getStreamList = async () => {
 }
 
 const getRecordList = async () => {
+  state.recordLoading = true
   const { data } = await RtsController.listRecord(state.type)
+  state.recordLoading = false
   state.recordDataSource = data
 }