Bläddra i källkod

fix: 设备录像

lvkun996 2 år sedan
förälder
incheckning
ab700b9686
4 ändrade filer med 66 tillägg och 2 borttagningar
  1. 17 0
      src/api/cvs/aibox.ts
  2. 25 1
      src/pages/cvs/video/device.vue
  3. 0 1
      src/pages/cvs/video/space.vue
  4. 24 0
      src/type/cvs.d.ts

+ 17 - 0
src/api/cvs/aibox.ts

@@ -0,0 +1,17 @@
+import request from '@/service/request'
+
+export const getAiBoxPage = (params: COMMON.API.QueryParams & {name?: string, state: 'OFFLINE' | 'ONLINE'}) => {
+  return request<CVS.Feature.Face[]>({
+    url: '/aiBox/page',
+    method: 'GET',
+    params
+  })
+}
+
+export const dimensionAiBox = (data: Partial<CVS.AiBox.AiBox>) => {
+  return request<string>({
+    url: '/aiBox/page',
+    method: 'PUT',
+    data
+  })
+}

+ 25 - 1
src/pages/cvs/video/device.vue

@@ -23,12 +23,26 @@
   <table-pro
     ref="tableProDom"
     :service="SpaceController.devicePage"
+    :serviceParams="{deviceName}"
     :columns="columns"
     @add="openModal"
   >
     <template #search >
-      <a-space><InputTsx placeholder="请输入设备名称进行搜索" /> <a-button type="primary">搜索</a-button> </a-space>
+      <a-space><InputTsx placeholder="请输入设备名称进行搜索" v-model:value="deviceName" /> <a-button type="primary" @click="search">搜索</a-button> </a-space>
     </template>
+
+    <template #render="{column, record}" >
+
+      <template v-if="column.key === 'action'" >
+        <a-space>
+          <a>实时观看</a>
+          <a @click="recordParty(record)" >录像回放</a>
+          <a @click="thumbParty(record)">截图查看</a>
+          <a>AI分析</a>
+        </a-space>
+      </template>
+    </template>
+
   </table-pro>
 
   <modal-pro
@@ -108,6 +122,8 @@ const useForm = Form.useForm
 
 const spaceId = ref(useRoute().query.spaceId as string)
 
+const deviceName = ref(null)
+
 const tableProDom = ref()
 
 const state = reactive<{
@@ -146,6 +162,10 @@ const ok = () => {
   }).catch(() => {})
 }
 
+const recordParty = (record: CVS.device) => {}
+
+const thumbParty = (record: CVS.device) => {}
+
 const onChangeSpace = (spaceId: string) => {
   deviceState.spaceId = spaceId
   tableProDom.value.reload({ page: 1 })
@@ -163,6 +183,10 @@ const getSpaceList = async () => {
   })
 }
 
+const search = () => {
+  tableProDom.value.reload()
+}
+
 onMounted(() => {
   getSpaceList()
 })

+ 0 - 1
src/pages/cvs/video/space.vue

@@ -207,7 +207,6 @@ import { Form } from 'ant-design-vue'
 import { OperatorController, SpaceController } from '@/controller'
 import { useRouter } from 'vue-router'
 import dayjs, { Dayjs } from 'dayjs'
-import { vueLanguage } from '@codemirror/lang-vue'
 
 const useForm = Form.useForm
 

+ 24 - 0
src/type/cvs.d.ts

@@ -117,4 +117,28 @@ declare namespace CVS {
 
   }
 
+  namespace AiBox {
+    interface AiBox {
+      'clientId': string, // aibox id 也是mqtt id 唯一标识
+      'name': string, // 名称
+      'description': string // 描述
+      'state': 'ONLINE' | 'OFFLINE' // 状态 OFFLINE 离线 ONLINE 在线
+      'updateAt': number // 更新时间 需要展示 可能为null
+      'createAt': number // 创建时间 需要展示 可能为null
+    }
+
+    interface Task {
+      id: string
+    }
+
+    interface Stream {
+      id: string
+    }
+
+    interface Sys {
+      id: string
+    }
+
+  }
+
 }