Explorar el Código

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

1. 移除冗余的 qualificationLevelMap 计算逻辑
2. 改为直接从 qualificationData 获取证书时间数据
3. 注释掉重复的职业资格证书展示区块
4. 调整模板标签缩进格式
huoyi hace 1 mes
padre
commit
9766ec526b
Se han modificado 1 ficheros con 16 adiciones y 21 borrados
  1. 16 21
      src/pages/employeeProfile/index.vue

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

@@ -101,7 +101,7 @@
101
                                 <view class="info-label">标签:</view>
101
                                 <view class="info-label">标签:</view>
102
                                 <view class="info-value" v-if="portrait.userTags">
102
                                 <view class="info-value" v-if="portrait.userTags">
103
                                     <text class="tag" v-for="tag in portrait.userTags.split(',')" :key="tag">{{ tag
103
                                     <text class="tag" v-for="tag in portrait.userTags.split(',')" :key="tag">{{ tag
104
-                                    }}</text>
104
+                                        }}</text>
105
                                 </view>
105
                                 </view>
106
                             </view>
106
                             </view>
107
                         </view>
107
                         </view>
@@ -151,19 +151,20 @@
151
                 <SectionTitle v-if="activeTab === 'profile'" title="职业资格证书获取时间">
151
                 <SectionTitle v-if="activeTab === 'profile'" title="职业资格证书获取时间">
152
                     <view class="cert-info">
152
                     <view class="cert-info">
153
                         <view class="cert-item" v-for="level in displayQualificationLevels" :key="level.field">
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
                         </view>
155
                         </view>
156
                         <view v-if="!displayQualificationLevels.length" class="no-data">暂无数据</view>
156
                         <view v-if="!displayQualificationLevels.length" class="no-data">暂无数据</view>
157
                     </view>
157
                     </view>
158
                 </SectionTitle>
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
                     <view class="cert-info">
162
                     <view class="cert-info">
162
                         <view class="cert-item" v-for="level in displayQualificationLevels" :key="level.field">
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
                         </view>
165
                         </view>
165
                     </view>
166
                     </view>
166
-                </SectionTitle>
167
+                </SectionTitle> -->
167
 
168
 
168
                 <SectionTitle v-if="activeTab === 'profile'" title="个人能力">
169
                 <SectionTitle v-if="activeTab === 'profile'" title="个人能力">
169
                     <div class="chart-legend">
170
                     <div class="chart-legend">
@@ -237,7 +238,7 @@
237
                         <view class="warning-score-item">
238
                         <view class="warning-score-item">
238
                             <text class="warning-score-label">综合得分</text>
239
                             <text class="warning-score-label">综合得分</text>
239
                             <text class="warning-score-value" :class="scoreLevelClass">{{ portrait.totalScore || 0
240
                             <text class="warning-score-value" :class="scoreLevelClass">{{ portrait.totalScore || 0
240
-                                }}</text>
241
+                            }}</text>
241
                         </view>
242
                         </view>
242
                     </view>
243
                     </view>
243
                     <view class="warning-detail" v-if="scoreDetails.length">
244
                     <view class="warning-detail" v-if="scoreDetails.length">
@@ -342,7 +343,7 @@
342
 
343
 
343
 <script>
344
 <script>
344
 import * as echarts from 'echarts'
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
 import { listAllUser, getDeptUserTree } from '@/api/system/user'
347
 import { listAllUser, getDeptUserTree } from '@/api/system/user'
347
 import SectionTitle from '@/components/SectionTitle.vue'
348
 import SectionTitle from '@/components/SectionTitle.vue'
348
 import EmployeeTreeNode from '@/pages/components/EmployeeTreeNode.vue'
349
 import EmployeeTreeNode from '@/pages/components/EmployeeTreeNode.vue'
@@ -419,21 +420,15 @@ export default {
419
         }
420
         }
420
     },
421
     },
421
     computed: {
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
         displayQualificationLevels() {
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
         schoolingText() {
433
         schoolingText() {
439
             if (!this.portrait.schooling) return '-'
434
             if (!this.portrait.schooling) return '-'