zhangwencui
4 天以前 472c1c1e6fb0258e03b87c748a605dd274dcd4b0
src/views/safeProduction/accidentReportingRecord/index.vue
@@ -229,10 +229,10 @@
            {{ currentKnowledge.happenLocation }}
          </el-descriptions-item>
          <el-descriptions-item label="事故等级">
            {{ currentKnowledge.accidentGrade }}
            <el-tag :type="accidentGradeType(currentKnowledge.accidentGrade)">{{ currentKnowledge.accidentGrade }}</el-tag>
          </el-descriptions-item>
          <el-descriptions-item label="事故类型">
            {{ currentKnowledge.accidentType }}
            <el-tag type="info">{{ accidentTypeLabel(currentKnowledge.accidentType) }}</el-tag>
          </el-descriptions-item>
          <el-descriptions-item label="人员伤亡情况">
            {{ currentKnowledge.personLoss }}
@@ -409,6 +409,9 @@
      label: "事故类型",
      prop: "accidentType",
      showOverflowTooltip: true,
      formatData: params => {
        return accidentTypeLabel(params);
      },
    },
    {
      dataType: "action",
@@ -462,6 +465,20 @@
    page.value.current = 1;
    getList();
  };
  const accidentGradeType = val => {
    switch (val) {
      case "轻微事故":
        return "info";
      case "一般事故":
        return "info";
      case "较大事故":
        return "warning";
      case "重大事故":
        return "danger";
      default:
        return "info";
    }
  };
  const accidentGradeOptions = [
    {
      label: "轻微事故",
@@ -480,25 +497,15 @@
      value: "重大事故",
    },
  ];
  const accidentTypeOptions = [
    {
      label: "责任事故",
      value: "责任事故",
    },
    {
      label: "非责任事故",
      value: "非责任事故",
    },
    {
      label: "破坏性事故",
      value: "破坏性事故",
    },
    {
      label: "重大事故",
      value: "重大事故",
    },
  ];
  const { proxy } = getCurrentInstance();
  const { accident_type } = proxy.useDict("accident_type");
  const accidentTypeOptions = computed(() => accident_type?.value || []);
  const accidentTypeLabel = val => {
    const item = accidentTypeOptions.value.find(
      i => String(i.value) === String(val)
    );
    return item ? item.label : val;
  };
  const getList = () => {
    tableLoading.value = true;
    safeAccidentListPage({ ...page.value, ...searchForm.value })
@@ -711,10 +718,6 @@
        // 用户取消
      });
  };
  // 导出
  const { proxy } = getCurrentInstance();
  const { knowledge_type } = proxy.useDict("knowledge_type");
  // 字典工具
  const knowledgeTypeOptions = computed(() => knowledge_type?.value || []);