Explorar el Código

feat: 设备分析

lvkun hace 2 años
padre
commit
d518f49b93
Se han modificado 3 ficheros con 39 adiciones y 5 borrados
  1. 1 1
      src/api/cvs/video.ts
  2. 3 1
      src/controller/cvs/spaceController.ts
  3. 35 3
      src/pages/cvs/video/device.vue

+ 1 - 1
src/api/cvs/video.ts

@@ -92,7 +92,7 @@ export const addDevice = (data: Partial<CVS.device>) => {
 }
 
 export const getDeviceRecordById = (params: {
-  deviceId: string
+  deviceId: number
   startTs?: number,
   endTs?: number,
   recordFormat: 'FLV' | 'TS' | 'MP4' | 'RAW'

+ 3 - 1
src/controller/cvs/spaceController.ts

@@ -86,9 +86,11 @@ export class SpaceController {
 
   static async deviceRecordById (
     params: {
-      deviceId: string
+      deviceId: number
       startTs?: number,
       endTs?: number,
+      page: number,
+      pageSize: number
       recordFormat: 'FLV' | 'TS' | 'MP4' | 'RAW'
     }
   ) {

+ 35 - 3
src/pages/cvs/video/device.vue

@@ -35,10 +35,9 @@
 
       <template v-if="column.key === 'action'" >
         <a-space>
-          <a>实时观看</a>
           <a @click="recordParty(record)" >录像回放</a>
           <a @click="thumbParty(record)">截图查看</a>
-          <a>AI分析</a>
+          <a @click="aiAnalysis(record)">AI分析</a>
         </a-space>
       </template>
     </template>
@@ -77,6 +76,20 @@
     </a-form>
   </modal-pro>
 </a-card>
+
+<modal-pro
+  :label="deviceState.deviceName"
+  :open="state.activeVisible"
+  @cancel="state.activeVisible = false"
+  @ok="state.activeVisible = false"
+>
+  <a-card
+    :tab-list="deviceTabs"
+    :active-tab-key="activeTabKey"
+  >
+
+  </a-card>
+</modal-pro>
 </template>
 <script lang='ts' setup >
 import { InputTsx } from '@/components/MicroComponents/index'
@@ -126,11 +139,21 @@ const deviceName = ref(null)
 
 const tableProDom = ref()
 
+const activeTabKey = ref<'record' | 'thumb' | 'ai'>('record')
+
+const deviceTabs = [
+  { key: 'record', tab: '录像回放' },
+  { key: 'thumb', tab: '截图查看' },
+  { key: 'ai', tab: 'AI分析' }
+]
+
 const state = reactive<{
   visible: boolean,
+  activeVisible: boolean,
   spaceList: CVS.space[]
 }>({
   visible: false,
+  activeVisible: false,
   spaceList: []
 })
 
@@ -162,10 +185,19 @@ const ok = () => {
   }).catch(() => {})
 }
 
-const recordParty = (record: CVS.device) => {}
+const recordParty = async (record: CVS.device) => {
+  state.activeVisible = true
+  resetFields({ ...record })
+  activeTabKey.value = 'record'
+  // const data = await SpaceController.deviceRecordById({ deviceId: record.deviceId, page: 1, pageSize: 10, recordFormat: 'FLV' })
+}
 
 const thumbParty = (record: CVS.device) => {}
 
+const aiAnalysis = (record: CVS.device) => {
+
+}
+
 const onChangeSpace = (spaceId: string) => {
   deviceState.spaceId = spaceId
   tableProDom.value.reload({ page: 1 })