<template>
  <ConfigPageBase
    section="fleet"
    title="车队全生命周期"
    description="分区域/跨楼层/多车协作；OTA、批量操作、网络诊断（FleetLifecycleConfig）"
    :defaults="DEFAULT_FLEET">
    <template #default="{ payload }">
      <el-alert
        type="info"
        :closable="false"
        show-icon
        title="车队分配已移至「车辆运维 → 运维总览」"
        description="在运维总览中可新建车队、设定名称/区域/楼层，并将车辆分配到各车队。"
        style="margin-bottom: 12px" />
      <el-tabs model-value="ota">
        <el-tab-pane name="ota" label="OTA 升级">
          <el-descriptions :column="2" border>
            <el-descriptions-item label="启用">{{ payload.ota.enabled ? '是' : '否' }}</el-descriptions-item>
            <el-descriptions-item label="批次大小">{{ payload.ota.batchSize }}</el-descriptions-item>
            <el-descriptions-item label="失败回滚">{{ payload.ota.rollbackOnFail ? '是' : '否' }}</el-descriptions-item>
          </el-descriptions>
        </el-tab-pane>
        <el-tab-pane name="batch" label="批量操作">
          <el-descriptions :column="2" border>
            <el-descriptions-item label="需确认">{{ payload.batchOps.confirmationRequired ? '是' : '否' }}</el-descriptions-item>
            <el-descriptions-item label="最大批量">{{ payload.batchOps.maxBatch }}</el-descriptions-item>
          </el-descriptions>
        </el-tab-pane>
        <el-tab-pane name="diag" label="网络诊断">
          <el-descriptions :column="2" border>
            <el-descriptions-item label="RTT 阈值 (ms)">{{ payload.networkDiag.rttThresholdMs }}</el-descriptions-item>
            <el-descriptions-item label="丢包阈值">{{ payload.networkDiag.packetLossThreshold }}</el-descriptions-item>
          </el-descriptions>
        </el-tab-pane>
      </el-tabs>
    </template>
  </ConfigPageBase>
</template>

<script setup lang="ts">
import ConfigPageBase from '@/components/ConfigPageBase.vue'
import { DEFAULT_FLEET } from '@/mock/data/configs'
</script>
