<script setup lang="ts">
import { ref } from "vue"
import NoProcess from "@/views/_component/_WarnNoProcess.vue"
import Processing from "@/views/_component/_WarnProcessing.vue"
import Processed from "@/views/_component/_WarnProcessed.vue"

const active = ref(0)
const cols = ref([
  {
    name: "公司名称",
    field: "company_name",
  },

  {
    name: "设备名称",
    field: "device_name",
  },
  {
    name: "告警类型",
    field: "warn_type_name",
  },
  {
    name: "告警数据",
    field: "warn_value",
  },
  {
    name: "发生时间",
    field: "warn_time",
  },
  {
    name: "恢复时间",
    field: "warn_recovery",
  },
  {
    name: "持续时间",
    field: "continue_time",
  },
])
const col2s = ref([
  {
    name: "公司名称",
    field: "company_name",
  },
  {
    name: "告警类型",
    field: "warn_type_name",
  },
  {
    name: "告警数据",
    field: "warn_value",
  },
  {
    name: "发生时间",
    field: "warn_start_time",
  },
  {
    name: "恢复时间",
    field: "warn_recovery_time",
  },
  {
    name: "持续时间",
    field: "warn_continue_time",
  },
  {
    name: "状态",
    field: "work_order_stats_name",
  },
  {
    name: "操作",
    width: 150,
    field: "action",
  },
])
const col3s = ref([
  {
    name: "公司名称",
    field: "company_name",
  },

  {
    name: "设备名称",
    field: "device_name",
  },
  {
    name: "告警类型",
    field: "warn_type_name",
  },
  {
    name: "告警数据",
    field: "warn_value",
  },
  {
    name: "创建时间",
    field: "work_order_start_time",
  },
  {
    name: "完结时间",
    field: "work_order_end_time",
  },
  {
    name: "持续时间",
    field: "work_order_continue_time",
  },
  {
    name: "操作",
    width: 150,
    field: "action",
  },
])
</script>

<template>
  <el-tabs v-model="active" class="demo-tabs">
    <el-tab-pane label="未处理" :name="0">
      <NoProcess v-if="active == 0" :type="2" :columns="cols"></NoProcess>
    </el-tab-pane>
    <el-tab-pane label="处理中" :name="1">
      <Processing v-if="active == 1" :type="2" :columns="col2s"></Processing>
    </el-tab-pane>
    <el-tab-pane label="已完结" :name="2">
      <Processed v-if="active == 2" :type="2" :columns="col3s"></Processed>
    </el-tab-pane>
  </el-tabs>
</template>
