Explorar o código

feat: aiconfig的types

lvkun %!s(int64=2) %!d(string=hai) anos
pai
achega
2741d0ec11

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

@@ -33,7 +33,7 @@ export const updateSpace = (data: CVS.space) => {
 }
 
 export const getSpaceConfigById = (spaceId: string) => {
-  return request<string>({
+  return request<CVS.space>({
     url: `/spaceConfig/${spaceId}`,
     method: 'GET'
   })

+ 12 - 6
src/components/StepModal/index.tsx

@@ -57,22 +57,28 @@ export const StepModal = defineComponent({
         footer={null}
       >
         <Row class='steps' >
-          <Steps
-            size="small"
-            current={props.step}
-            items={props.steps}
-          ></Steps>
+          {
+            props.steps ? <Steps size="small" current={props.step} items={props.steps} /> : null
+          }
+
         </Row>
         <Row class='step-modal-content' >
           {ctx.slots.default!()}
         </Row>
         <Row class='footer' align='middle' justify='space-between' >
           <Col>
-            <Space>
+          {
+             props.steps.length
+               ? <Space>
               <Button disabled={props.step === 0} onClick={preStep} >上一步</Button>
               <Button onClick={nextStep} >{isLastStep.value ? '提交' : '下一步'}</Button>
               <Button onClick={close} >取消</Button>
             </Space>
+               : <Space>
+                <Button onClick={close} >取消</Button>
+                <Button type='primary' onClick={() => ctx.emit('submit')} >提交</Button>
+              </Space>
+          }
           </Col>
         </Row>
       </Modal>

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

@@ -1,4 +1,4 @@
-import { addDevice, addSpace, delSpace, getDeviceAiRetById, getDeviceById, getDevicePage, getDeviceRecordById, getDeviceThumbById, getSpace, getSpaceById, getSpaceList, updateSpace, updateStatus } from '@/api/cvs/video'
+import { addDevice, addSpace, delSpace, getDeviceAiRetById, getDeviceById, getDevicePage, getDeviceRecordById, getDeviceThumbById, getSpace, getSpaceById, getSpaceConfigById, getSpaceList, updateSpace, updateStatus } from '@/api/cvs/video'
 import { message } from 'ant-design-vue'
 
 export class SpaceController {
@@ -64,7 +64,8 @@ export class SpaceController {
   }
 
   static async spaceConfigById (spaceId: string) {
-
+    const { code, data } = await getSpaceConfigById(spaceId)
+    return data
   }
 
   static async devicePage (params: COMMON.API.QueryParams & {deviceName: string}) {

+ 4 - 3
src/pages/cvs/video/space.vue

@@ -28,8 +28,8 @@
  </table-pro>
 
  <StepModal
-    :step="step"
-    :steps="steps"
+    :step=" step"
+    :steps="spaceState.spaceId ? [] : steps"
     :visible="visible"
     @close="visible = false"
     @next="stepNext"
@@ -277,7 +277,8 @@ const { resetFields, validate, validateInfos } = useForm(spaceState, {
 const openModal = async (record = { spaceId: '' }) => {
   if (record.spaceId) {
     spaceState.spaceId = record.spaceId
-    resetFields(await SpaceController.byId(record.spaceId))
+    resetFields(await SpaceController.spaceConfigById(record.spaceId))
+    step.value = 1
   } else {
     resetFields({})
   }

+ 8 - 1
src/type/cvs.d.ts

@@ -32,7 +32,14 @@ declare namespace CVS {
       // ai 配置
       'aiConfig': {
         'enabled': boolean,
-        'configuration': [],
+        'configuration': {
+          confidence: number // 置信度 0 - 100
+          interval: number // 抽帧间隔 毫秒单位
+          effectiveTimeStart: string //  生效开始时间 时间格式是 HH:mm:ss
+          effectiveTimeEnd: string //  生效结束时间 时间格式是 HH:mm:ss
+          aiId: string // 算子id 选择某个算子的id
+          groupId: string // 分组id 如果是人脸对比等信息 可能需要人脸库分组 id
+        }[],
         'bucket': string,
       }