Explorar o código

refactor(employeeProfile): 优化职业资格证书展示逻辑

- 由单一证书时间展示改为显示多个等级对应证书信息
- 使用computed计算当前及之前所有等级证书数据
- 模板中动态渲染多个证书名称及时间,提升展示准确性
- 删除无用的getQualificationTime计算属性
- 改进用户界面,更清晰体现职业资格证书层级关系
huoyi hai 6 días
pai
achega
a89433e8a2
Modificáronse 1 ficheiros con 9 adicións e 10 borrados
  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