Ver Fonte

feat(risk): 岗位证书 tag 按证书类型区分颜色

- 加 getCertTypeTag 函数,4 种证书对应 4 种颜色
  防损资格证=蓝 电工操作证=橙 焊工操作证=红 高处作业证=绿
- el-tag type 从写死 'success' 改为动态
yangjingjing há 1 dia atrás
pai
commit
fff65aa305
1 ficheiros alterados com 12 adições e 1 exclusões
  1. 12 1
      src/views/risk/personnel/index.vue

+ 12 - 1
src/views/risk/personnel/index.vue

@@ -81,7 +81,7 @@
             <el-tag
               v-for="(cert, idx) in getPersonnelCerts(scope.row.id)"
               :key="idx"
-              type="success"
+              :type="getCertTypeTag(cert.certType)"
               size="small"
               style="margin-right: 4px; margin-bottom: 4px"
             >
@@ -562,6 +562,17 @@ const getInsuranceTag = (row: any) => {
   return map[label] || 'info';
 };
 
+// 岗位证书 tag 颜色(按字典 value 映射)
+const getCertTypeTag = (type: string) => {
+  const map: Record<string, string> = {
+    防损资格证: 'primary',    // 蓝
+    电工操作证: 'warning',    // 橙
+    焊工操作证: 'danger',     // 红
+    高处作业证: 'success'     // 绿
+  };
+  return map[type] || 'info';
+};
+
 // 人员类型 tag 颜色(按字典 value 映射,与设计稿一致)
 const getJobTypeTag = (type: string) => {
   const map: Record<string, string> = {