Просмотр исходного кода

Merge branch 'algoConfg-fix' into 'dev'

fix: min-width -> min_width & min-height -> min_height

See merge request skyeye/skyeye_frontend/skyeye-admin!34
宏耀 孙 1 год назад
Родитель
Сommit
87f635f0e2

+ 10 - 10
src/views/cameras/preview/components/AlgorithmsSetting/AlgoParamsCard.vue

@@ -69,9 +69,9 @@
           :label="labelNameMap[item.label] + '最小检测面积:'"
           :label="labelNameMap[item.label] + '最小检测面积:'"
           required
           required
         >
         >
-          <el-form-item :prop="item.label ? item.label + '.' + 'min-width' : 'min-width'">
+          <el-form-item :prop="item.label ? item.label + '.' + 'min_width' : 'min_width'">
             <ElInputNumber
             <ElInputNumber
-              v-model="algoParams[item.label ? item.label + '.' + 'min-width' : 'min-width']"
+              v-model="algoParams[item.label ? item.label + '.' + 'min_width' : 'min_width']"
               controls-position="right"
               controls-position="right"
               :min="32"
               :min="32"
               :step="1"
               :step="1"
@@ -81,11 +81,11 @@
             <span>px</span>
             <span>px</span>
           </el-form-item>
           </el-form-item>
           <el-form-item
           <el-form-item
-            :prop="item.label ? item.label + '.' + 'min-height' : 'min-height'"
+            :prop="item.label ? item.label + '.' + 'min_height' : 'min_height'"
             style="margin-left: 17px"
             style="margin-left: 17px"
           >
           >
             <ElInputNumber
             <ElInputNumber
-              v-model="algoParams[item.label ? item.label + '.' + 'min-height' : 'min-height']"
+              v-model="algoParams[item.label ? item.label + '.' + 'min_height' : 'min_height']"
               controls-position="right"
               controls-position="right"
               :min="32"
               :min="32"
               :step="1"
               :step="1"
@@ -173,8 +173,8 @@
       if (!val) return;
       if (!val) return;
       const meta = metaObjList.value.find((item) => item.label === val);
       const meta = metaObjList.value.find((item) => item.label === val);
       algoParams.value.confidence = meta.confidence * 100;
       algoParams.value.confidence = meta.confidence * 100;
-      algoParams.value['min-width'] = meta['min-width'];
-      algoParams.value['min-height'] = meta['min-height'];
+      algoParams.value['min_width'] = meta['min_width'];
+      algoParams.value['min_height'] = meta['min_height'];
 
 
       const nexts = meta.nextObjs;
       const nexts = meta.nextObjs;
       if (nexts) {
       if (nexts) {
@@ -191,8 +191,8 @@
             type: 'minArea',
             type: 'minArea',
             prop: '',
             prop: '',
           });
           });
-          algoParams.value[item.label + '.' + 'min-width'] = item['min-width'];
-          algoParams.value[item.label + '.' + 'min-height'] = item['min-height'];
+          algoParams.value[item.label + '.' + 'min_width'] = item['min_width'];
+          algoParams.value[item.label + '.' + 'min_height'] = item['min_height'];
         }
         }
       }
       }
     },
     },
@@ -234,7 +234,7 @@
         ];
         ];
       }
       }
       if (param.type === 'minArea') {
       if (param.type === 'minArea') {
-        rule[param.label ? param.label + '.' + 'min-width' : 'min-width'] = [
+        rule[param.label ? param.label + '.' + 'min_width' : 'min_width'] = [
           {
           {
             required: true,
             required: true,
             message: '请输入最小宽度',
             message: '请输入最小宽度',
@@ -242,7 +242,7 @@
           },
           },
           { validator: integerJudge, trigger: 'blur' },
           { validator: integerJudge, trigger: 'blur' },
         ];
         ];
-        rule[param.label ? param.label + '.' + 'min-height' : 'min-height'] = [
+        rule[param.label ? param.label + '.' + 'min_height' : 'min_height'] = [
           {
           {
             required: true,
             required: true,
             message: '请输入最小高度',
             message: '请输入最小高度',

+ 4 - 4
src/views/cameras/preview/components/AlgorithmsSetting/AlgoSettingCard.vue

@@ -299,8 +299,8 @@
       const val = {
       const val = {
         label: meta.label,
         label: meta.label,
         confidence: meta.confidence / 100,
         confidence: meta.confidence / 100,
-        'min-width': meta['min-width'],
-        'min-height': meta['min-height'],
+        'min_width': meta['min_width'],
+        'min_height': meta['min_height'],
       } as any;
       } as any;
       const nextValues = [] as any[];
       const nextValues = [] as any[];
       obj.nextObjs.forEach((next) => {
       obj.nextObjs.forEach((next) => {
@@ -308,8 +308,8 @@
           nextValues.push({
           nextValues.push({
             label: next.label,
             label: next.label,
             confidence: meta[`${next.label}.confidence`] / 100,
             confidence: meta[`${next.label}.confidence`] / 100,
-            'min-width': meta[next.label + '.' + 'min-width'],
-            'min-height': meta[next.label + '.' + 'min-height'],
+            'min_width': meta[next.label + '.' + 'min_width'],
+            'min_height': meta[next.label + '.' + 'min_height'],
             nextObjs: [],
             nextObjs: [],
           });
           });
         }
         }

+ 4 - 4
src/views/cameras/preview/components/AlgorithmsSetting/utils.ts

@@ -75,13 +75,13 @@ export const getMetaValues = (extra: string | undefined | null) => {
       id: uid(),
       id: uid(),
       label: item.label,
       label: item.label,
       confidence: item.confidence * 100,
       confidence: item.confidence * 100,
-      'min-width': item['min-width'],
-      'min-height': item['min-height'],
+      min_width: item['min_width'],
+      min_height: item['min_height'],
     } as any;
     } as any;
     item.nextObjs.forEach((next) => {
     item.nextObjs.forEach((next) => {
       val[`${next.label}.confidence`] = next.confidence * 100;
       val[`${next.label}.confidence`] = next.confidence * 100;
-      val[next.label + '.' + 'min-width'] = next['min-width'];
-      val[next.label + '.' + 'min-height'] = next['min-height'];
+      val[next.label + '.' + 'min_width'] = next['min_width'];
+      val[next.label + '.' + 'min_height'] = next['min_height'];
     });
     });
     return val;
     return val;
   });
   });

+ 2 - 2
src/views/cameras/preview/store/useCameraAlgoStore.ts

@@ -23,8 +23,8 @@ export interface AlgoParamMetaItem {
   label: string;
   label: string;
   criticalCount: number;
   criticalCount: number;
   confidence: number;
   confidence: number;
-  'min-width': number;
-  'max-width': number;
+  min_width: number;
+  max_width: number;
   nextObjs: AlgoParamMetaItem[];
   nextObjs: AlgoParamMetaItem[];
 }
 }