Pārlūkot izejas kodu

fix(employeeProfile): 修复员工标签展示和查询逻辑

1.  将原roleNames替换为userTags并支持逗号分隔展示多个标签
2.  修正标签分数查询的匹配条件为选中员工ID
3.  为标签添加左侧间距优化排版
4.  新增调试语句方便排查问题
huoyi 2 nedēļas atpakaļ
vecāks
revīzija
d233049ff8
1 mainītis faili ar 7 papildinājumiem un 3 dzēšanām
  1. 7 3
      src/pages/employeeProfile/index.vue

+ 7 - 3
src/pages/employeeProfile/index.vue

@@ -97,8 +97,8 @@
97 97
                             </view>
98 98
                             <view class="info-item">
99 99
                                 <view class="info-label">标签:</view>
100
-                                <view class="info-value">
101
-                                    <text class="tag" v-if="portrait.roleNames">{{ portrait.roleNames }}</text>
100
+                                <view class="info-value" v-if="portrait.userTags">
101
+                                    <text class="tag" v-for="tag in portrait.userTags.split(',')" :key="tag">{{ tag }}</text>
102 102
                                 </view>
103 103
                             </view>
104 104
                         </view>
@@ -548,9 +548,10 @@ export default {
548 548
             }).catch(() => { })
549 549
 
550 550
             const tagPromise = countTagScore(params).then(res => {
551
+                debugger
551 552
                 const data = res.data
552 553
                 if (Array.isArray(data)) {
553
-                    const found = data.find(item => item.userId === this.searchKeyword || item.personName === this.searchKeyword)
554
+                    const found = data.find(item => item.userId === this.selectedEmployeeId)
554 555
                     this.tagScoreData = found ? (found.totalScore ?? found.score) : null
555 556
                 } else {
556 557
                     this.tagScoreData = data
@@ -565,12 +566,14 @@ export default {
565 566
             })
566 567
         },
567 568
         initScoreChart() {
569
+            debugger
568 570
             if (!this.$refs.scoreCircle) return
569 571
             if (this.scoreChartInstance) {
570 572
                 this.scoreChartInstance.dispose()
571 573
             }
572 574
             this.scoreChartInstance = echarts.init(this.$refs.scoreCircle)
573 575
             const score = this.portrait.totalScore || 0
576
+            debugger
574 577
             const option = {
575 578
                 series: [
576 579
                     {
@@ -984,6 +987,7 @@ export default {
984 987
             .tag {
985 988
                 display: inline-block;
986 989
                 padding: 4rpx 16rpx;
990
+                margin-left: 2rpx;
987 991
                 background: rgba(167, 139, 250, 0.3);
988 992
                 border-radius: 8rpx;
989 993
                 color: #A78BFA;