瀏覽代碼

feat: 添加告警计划的检测区域校验,删除冗余注释代码;

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

+ 5 - 63
src/views/device/detail/components/alarmPlanModal/index.vue

@@ -286,51 +286,6 @@
                 </div>
               </div>
             </baseAreaViewer>
-
-            <!-- {{ blocks[0] }} -->
-
-            <!-- {{ getOriginPosition(props.area!.ranges, [0, 0]) }} -->
-
-            <!-- <div class="viewer">
-              <div class="viewer-content">
-                <div
-                  class="mapBox blockArea"
-                  :style="{
-                    width: `${areaWidth}px`,
-                    height: `${areaHeight}px`,
-                    cursor: 'default',
-                  }"
-                >
-                  <div
-                    v-for="(block, blockIndex) in blocks"
-                    :key="blockIndex"
-                    class="block-item"
-                    :style="{
-                      left: `${block.x}px`,
-                      top: `${block.y}px`,
-                      width: `${block.width}px`,
-                      height: `${block.height}px`,
-                      border: `2px solid #1890ff`,
-                      position: 'absolute',
-                      cursor: 'move',
-                      backgroundColor: 'rgba(24, 144, 255, 0.1)',
-                    }"
-                    @mousedown="startDrag(block, $event)"
-                    @mousemove="drag(block)"
-                    @mouseup="endDrag(block)"
-                  >
-                    <div
-                      class="resize-handle"
-                      :style="{
-                        backgroundColor: '#1890ff',
-                      }"
-                      @mousedown.stop="startResize(block, $event)"
-                    >
-                    </div>
-                  </div>
-                </div>
-              </div>
-            </div> -->
           </a-form-item-rest>
         </a-form-item>
 
@@ -1045,27 +1000,14 @@ const submit = () => {
         return
       }
       if (formState.effectTimeRanges.length === 0) {
-        message.warn('请选择生效方式的范围')
+        message.warn('请选择生效方式')
+        return
+      }
+      if ([1, 2, 3, 9].includes(formState.eventType as number) && formState.region.length !== 4) {
+        message.warn('请选择检测区域')
         return
       }
-      // if ([1, 2, 3, 9].includes(formState.eventType as number) && formState.region.length !== 4) {
-      //   message.warn('请选择检测区域')
-      //   return
-      // }
-
       submitLoading.value = true
-      // alarmApi
-      //   .saveAlarmPlan(params)
-      //   .then((res) => {
-      //     console.log('添加成功', res)
-      //     submitLoading.value = false
-      //     message.success('添加成功')
-      //     emit('success')
-      //     cancel()
-      //   })
-      //   .catch(() => {
-      //     submitLoading.value = false
-      //   })
       if (props.type === 'plan') savePlan(params)
       if (props.type === 'template') saveTemplate(params)
     })