huoyi@samsundot.com дней назад: 6
Родитель
Сommit
5632649189
1 измененных файлов с 9 добавлено и 10 удалено
  1. 9 10
      src/views/portraitManagement/employeeProfile/index.vue

+ 9 - 10
src/views/portraitManagement/employeeProfile/index.vue

@@ -132,8 +132,9 @@
132 132
             </Card>
133 133
             <Card title="职业资格证书情况">
134 134
               <div class="cert-info">
135
-                <span class="cert-name">证书名称:{{ portrait?.qualificationLevelText || '-' }} 时间:{{ getQualificationTime|| '-' }}</span>
136
-              
135
+                <div class="cert-item" v-for="level in displayQualificationLevels" :key="level.field">
136
+                  <span class="cert-name">{{ level.label }}:{{ qualificationData?.[level.field] || '-' }}</span>
137
+                </div>
137 138
               </div>
138 139
             </Card>
139 140
           </div>
@@ -306,14 +307,12 @@ const qualificationLevelMap = [
306 307
   { label: '五级', field: 'levelFiveTime' }
307 308
 ]
308 309
 
309
-const getQualificationTime = computed(() => {
310
-  const certName = portrait.value?.qualificationLevelText || '-';
311
-  
312
-  const item = qualificationLevelMap.find(l => l.label === certName)
313
-  if (item) {
314
-    return qualificationData.value?.[item.field] || '-'
315
-  }
316
-  return '-'
310
+const displayQualificationLevels = computed(() => {
311
+  const currentLevel = portrait.value?.qualificationLevelText
312
+  if (!currentLevel) return []
313
+  const currentIndex = qualificationLevelMap.findIndex(l => l.label === currentLevel)
314
+  if (currentIndex === -1) return []
315
+  return qualificationLevelMap.slice(0, currentIndex + 1)
317 316
 })
318 317
 
319 318