吉安感知网项目-前端
shuishen
2026-01-19 cf2ab1935f8b6cd113db09142ed8b8dd6f3070ab
applications/drone-command/src/views/dataCockpit/components/RealWarning.vue
@@ -2,7 +2,7 @@
 * @Author       : yuan
 * @Date         : 2026-01-08 09:29:07
 * @LastEditors  : yuan
 * @LastEditTime : 2026-01-08 14:49:09
 * @LastEditTime : 2026-01-19 11:31:09
 * @FilePath     : \applications\drone-command\src\views\dataCockpit\components\RealWarning.vue
 * @Description  : 
 * Copyright 2026 OBKoro1, All Rights Reserved. 
@@ -15,16 +15,18 @@
      element-loading-background="rgba(5, 5, 15, 0.6)"
      element-loading-text="加载中..."
   >
      <EmptyState v-if="!realWarningData.length" />
      <RealTemplate
         v-else
         v-for="(item, ind) in realWarningData"
         :key="ind"
         :data="item"
         @signal="() => handleAction('signal', item)"
         @counter="() => handleAction('counter', item)"
         @favorite="() => console.log('收藏', item.id)"
      />
      <div class="list-content">
         <EmptyState v-if="!realWarningData.length" />
         <RealTemplate
            v-else
            v-for="(item, ind) in realWarningData"
            :key="ind"
            :data="item"
            @signal="() => handleAction('signal', item)"
            @counter="() => handleAction('counter', item)"
            @favorite="() => console.log('收藏', item.id)"
         />
      </div>
   </div>
</template>
@@ -46,8 +48,7 @@
const buildPayload = (type, item) => ({
   counterWay: type === 'signal' ? 1 : type === 'counter' ? 2 : '',
   deviceId: item.deviceId,
   droneDeviceCode: item.droneDeviceCode ?? item.droneSerialNo
   alarmRecordId: item?.alarmRecordId ?? item?.id
})
const handleAction = async (type, item) => {
@@ -56,6 +57,7 @@
      const res = await interferenceAndExpulsionApi(buildPayload(type, item))
      if (res?.data?.success) {
         ElMessage({ type: 'success', message: `${actionText}成功` })
         await fetchRealWarning()
      } else {
         ElMessage({ type: 'error', message: res?.data?.msg || `${actionText}失败` })
      }
@@ -88,8 +90,16 @@
<style lang="scss" scoped>
.real-warning {
   display: flex;
   flex-direction: column;
   width: 100%;
   height: 100%;
   overflow: hidden;
}
.list-content {
   height: 0;
   flex: 1;
   overflow-y: auto;
}
</style>