<template>
  <el-descriptions :column="2" border>
    <el-descriptions-item label="风险单元">
      {{ info.RISKUNITNAME }}
    </el-descriptions-item>
    <el-descriptions-item label="辨识部位">
      {{ info.PARTSNAME }}
    </el-descriptions-item>
    <el-descriptions-item label="存在风险" :span="2">
      {{ info.RISK_DESCR }}
    </el-descriptions-item>
    <el-descriptions-item label="事故发生的可能性">
      <span v-if="info.LIKELIHOOD === 10">完全可以预料</span>
      <span v-else-if="info.LIKELIHOOD === 6">相当可能</span>
      <span v-else-if="info.LIKELIHOOD === 3">可能，但不经常</span>
      <span v-else-if="info.LIKELIHOOD === 1">可能性小，完全意外</span>
      <span v-else-if="info.LIKELIHOOD === 0.5">很不可能，可以设想</span>
      <span v-else-if="info.LIKELIHOOD === 0.2">极不可能</span>
      <span v-else-if="info.LIKELIHOOD === 0.1">实际不可能</span>
    </el-descriptions-item>
    <el-descriptions-item label="分值">
      {{ info.LIKELIHOOD }}
    </el-descriptions-item>
    <el-descriptions-item label="人员暴露于危险环境中的频繁程度">
      <span v-if="info.EXPOSURE === 10">连续暴露</span>
      <span v-else-if="info.EXPOSURE === 6">每天工作时间内暴露</span>
      <span v-else-if="info.EXPOSURE === 3">每周一次或偶然暴露</span>
      <span v-else-if="info.EXPOSURE === 2">每月一次暴露，完全意外</span>
      <span v-else-if="info.EXPOSURE === 1">每年几次暴露</span>
      <span v-else-if="info.EXPOSURE === 0.5">非常罕见暴露</span>
    </el-descriptions-item>
    <el-descriptions-item label="分值">
      {{ info.EXPOSURE }}
    </el-descriptions-item>
    <el-descriptions-item label="一旦发生事故可能造成的后果">
      <span v-if="info.CONSEQUENCE === 100">10人以上死亡</span>
      <span v-else-if="info.CONSEQUENCE === 40">3～9人死亡</span>
      <span v-else-if="info.CONSEQUENCE === 15">1～2人死亡</span>
      <span v-else-if="info.CONSEQUENCE === 7">严重</span>
      <span v-else-if="info.CONSEQUENCE === 3">重大，伤残</span>
      <span v-else-if="info.CONSEQUENCE === 1">引人注意</span>
    </el-descriptions-item>
    <el-descriptions-item label="分值">
      {{ info.CONSEQUENCE }}
    </el-descriptions-item>
    <el-descriptions-item label="风险分级">
      {{ info.DNAME5 }}
    </el-descriptions-item>
    <el-descriptions-item label="总分值">
      {{ info.DANGER }}
    </el-descriptions-item>
    <el-descriptions-item label="管控措施" :span="2">
      {{ info.MEASURES }}
    </el-descriptions-item>
    <el-descriptions-item label="管控部门">
      {{ info.DEPT_NAME_ALL }}
    </el-descriptions-item>
    <el-descriptions-item label="管控责任人">
      {{ info.USER_ID }}
    </el-descriptions-item>
    <el-descriptions-item label="事故类型" :span="2">
      {{ info.ACCIDENTS_NAME }}
    </el-descriptions-item>
    <el-descriptions-item label="应急处置措施" :span="2">
      {{ info.EME_MEASURES }}
    </el-descriptions-item>
    <slot />
  </el-descriptions>
</template>

<script setup>
defineOptions({
  name: "LayoutRiskView",
});
defineProps({
  info: {
    type: Object,
    required: true,
    default: () => ({}),
  },
});
</script>

<style scoped lang="scss"></style>
