Browse Source

fix(employeeProfile): 修复职业资格证书展示逻辑

1. 移除冗余的 qualificationLevelMap 计算逻辑
2. 改为直接从 qualificationData 获取证书时间数据
3. 注释掉重复的职业资格证书展示区块
4. 调整模板标签缩进格式
huoyi 1 month ago
parent
commit
9766ec526b
1 changed files with 16 additions and 21 deletions
  1. 16 21
      src/pages/employeeProfile/index.vue

+ 16 - 21
src/pages/employeeProfile/index.vue

@@ -101,7 +101,7 @@
101 101
                                 <view class="info-label">标签:</view>
102 102
                                 <view class="info-value" v-if="portrait.userTags">
103 103
                                     <text class="tag" v-for="tag in portrait.userTags.split(',')" :key="tag">{{ tag
104
-                                    }}</text>
104
+                                        }}</text>
105 105
                                 </view>
106 106
                             </view>
107 107
                         </view>
@@ -151,19 +151,20 @@
151 151
                 <SectionTitle v-if="activeTab === 'profile'" title="职业资格证书获取时间">
152 152
                     <view class="cert-info">
153 153
                         <view class="cert-item" v-for="level in displayQualificationLevels" :key="level.field">
154
-                            <text class="cert-name">{{ level.label }}:{{ (qualificationData && qualificationData[level.field]) || '-' }}</text>
154
+                            <text class="cert-name">{{ level.label }}:{{ level.time || '-' }}</text>
155 155
                         </view>
156 156
                         <view v-if="!displayQualificationLevels.length" class="no-data">暂无数据</view>
157 157
                     </view>
158 158
                 </SectionTitle>
159 159
 
160
-                <SectionTitle v-if="activeTab === 'profile' && displayQualificationLevels.length > 0" title="职业资格证书获取时间">
160
+                <!-- <SectionTitle v-if="activeTab === 'profile' && displayQualificationLevels.length > 0"
161
+                    title="职业资格证书获取时间">
161 162
                     <view class="cert-info">
162 163
                         <view class="cert-item" v-for="level in displayQualificationLevels" :key="level.field">
163
-                            <text class="cert-name">{{ level.label }}:{{ (qualificationData && qualificationData[level.field]) || '-' }}</text>
164
+                            <text class="cert-name">{{ level.label }}:{{ level.time || '-' }}</text>
164 165
                         </view>
165 166
                     </view>
166
-                </SectionTitle>
167
+                </SectionTitle> -->
167 168
 
168 169
                 <SectionTitle v-if="activeTab === 'profile'" title="个人能力">
169 170
                     <div class="chart-legend">
@@ -237,7 +238,7 @@
237 238
                         <view class="warning-score-item">
238 239
                             <text class="warning-score-label">综合得分</text>
239 240
                             <text class="warning-score-value" :class="scoreLevelClass">{{ portrait.totalScore || 0
240
-                                }}</text>
241
+                            }}</text>
241 242
                         </view>
242 243
                     </view>
243 244
                     <view class="warning-detail" v-if="scoreDetails.length">
@@ -342,7 +343,7 @@
342 343
 
343 344
 <script>
344 345
 import * as echarts from 'echarts'
345
-import { getEmployeePortrait, countTagScore,getQualificationLevelTime } from '@/api/portraitManagement/portraitManagement'
346
+import { getEmployeePortrait, countTagScore, getQualificationLevelTime } from '@/api/portraitManagement/portraitManagement'
346 347
 import { listAllUser, getDeptUserTree } from '@/api/system/user'
347 348
 import SectionTitle from '@/components/SectionTitle.vue'
348 349
 import EmployeeTreeNode from '@/pages/components/EmployeeTreeNode.vue'
@@ -419,21 +420,15 @@ export default {
419 420
         }
420 421
     },
421 422
     computed: {
422
-        qualificationLevelMap() {
423
-            return [
424
-                { label: '五级', field: 'levelFiveTime' },
425
-                { label: '四级', field: 'levelFourTime' },
426
-                { label: '三级', field: 'levelThreeTime' },
427
-                { label: '二级', field: 'levelTwoTime' },
428
-                { label: '一级', field: 'levelOneTime' }
429
-            ]
430
-        },
423
+        
431 424
         displayQualificationLevels() {
432
-            const currentLevel = this.portrait?.qualificationLevelText
433
-            if (!currentLevel) return []
434
-            const currentIndex = this.qualificationLevelMap.findIndex(l => l.label === currentLevel)
435
-            if (currentIndex === -1) return []
436
-            return this.qualificationLevelMap.slice(currentIndex)
425
+            if (!this.qualificationData) return []
426
+            console.log(this.qualificationData)
427
+            debugger
428
+            return this.qualificationLevelMap.map(item => ({
429
+                label: item.label,
430
+                time: this.qualificationData[item.field] || 0
431
+            })).filter(item => item.time)
437 432
         },
438 433
         schoolingText() {
439 434
             if (!this.portrait.schooling) return '-'