Bläddra i källkod

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

1.  将原roleNames替换为userTags并支持逗号分隔展示多个标签
2.  修正标签分数查询的匹配条件为选中员工ID
3.  为标签添加左侧间距优化排版
4.  新增调试语句方便排查问题
huoyi 2 veckor sedan
förälder
incheckning
d233049ff8
1 ändrade filer med 7 tillägg och 3 borttagningar
  1. 7 3
      src/pages/employeeProfile/index.vue

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

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