瀏覽代碼

feat: 告警计划检测区域添加不可用提示;

liujia 1 月之前
父節點
當前提交
b719fb5
共有 1 個文件被更改,包括 13 次插入1 次删除
  1. 13 1
      src/views/device/detail/components/alarmPlanModal/index.vue

+ 13 - 1
src/views/device/detail/components/alarmPlanModal/index.vue

@@ -247,7 +247,13 @@
           name="region"
           style="user-select: none"
         >
-          <div>雷达检测区域:{{ props.area!.ranges }}</div>
+          <a-alert
+            v-if="areaAvailable"
+            message="检测区域范围未配置或数值较小,请在设备配置调整参数!"
+            banner
+            style="margin-bottom: 10px"
+          />
+          <div> 雷达检测区域:{{ props.area!.ranges }} </div>
           <div style="user-select: none">
             <span>告警框选区域: {{ formState.region }}</span>
             <a-button type="link" style="margin-left: 16px" @click="resetBlocks"> 重置 </a-button>
@@ -1108,6 +1114,12 @@ const fetchRoomLayout = async () => {
   }
 }
 fetchRoomLayout()
+
+const areaAvailable = computed(() => {
+  const length = Math.abs(props.area!.ranges[0]) + Math.abs(props.area!.ranges[1])
+  const width = Math.abs(props.area!.ranges[2]) + Math.abs(props.area!.ranges[3])
+  return Number(length) < 50 || Number(width) < 50
+})
 </script>
 
 <style scoped lang="less">