lex 2 年之前
父節點
當前提交
5b9acff72c

+ 4 - 0
src/student/leaderboard/index.module.less

@@ -92,6 +92,10 @@
       font-size: 15px;
       color: #333;
       margin-right: 6px;
+      max-width: 120px;
+      overflow: hidden;
+      white-space: nowrap;
+      text-overflow: ellipsis;
     }
     .tag {
       font-size: 12px;

+ 6 - 3
src/student/leaderboard/index.tsx

@@ -155,6 +155,7 @@ export default defineComponent({
               titleInactiveColor="rgba(153,152,155,1)"
               titleActiveColor="#fff"
               onChange={index => getData()}
+              shrink
             >
               {state.musicList.map((item: IMusicItem) => {
                 return (
@@ -216,9 +217,11 @@ export default defineComponent({
                               </div>
                               <div class={styles.right}>
                                 <div class={styles.fraction}>{n.score}分</div>
-                                <div class={styles.time}>
-                                  第 {n.times} 次评测
-                                </div>
+                                {state.rankingMethod !== 'TOTAL_SCORE' && (
+                                  <div class={styles.time}>
+                                    第 {n.times} 次评测
+                                  </div>
+                                )}
                               </div>
                             </div>
                           )

+ 3 - 0
src/student/share-active/track-review-activity/index.module.less

@@ -171,6 +171,9 @@
     max-width: 200px;
     display: flex;
   }
+  .musicTitleScore {
+    flex: 1;
+  }
 
   .cellLevel {
     padding-bottom: 18px;

+ 5 - 1
src/student/share-active/track-review-activity/index.tsx

@@ -477,7 +477,11 @@ export default defineComponent({
               <CellGroup class={styles.musicItem} border={false}>
                 <Cell
                   center
-                  titleClass={styles.musicTitle}
+                  titleClass={[
+                    styles.musicTitle,
+                    this.rankingMethod == 'TOTAL_SCORE' &&
+                      styles.musicTitleScore
+                  ]}
                   isLink
                   v-slots={{
                     icon: () => (

+ 6 - 2
src/teacher/leaderboard/index.module.less

@@ -77,7 +77,7 @@
   }
   .user {
     margin-left: 6px;
-    .userContent{
+    .userContent {
       display: flex;
       align-items: center;
       margin-bottom: 4px;
@@ -86,6 +86,10 @@
       font-size: 15px;
       color: #333;
       margin-right: 6px;
+      max-width: 120px;
+      overflow: hidden;
+      white-space: nowrap;
+      text-overflow: ellipsis;
     }
     .tag {
       font-size: 12px;
@@ -95,7 +99,7 @@
       margin-right: 4px;
       padding: 1px 2px;
     }
-    .times{
+    .times {
       font-size: 12px;
       color: #999;
     }

+ 30 - 9
src/teacher/leaderboard/index.tsx

@@ -35,17 +35,27 @@ export default defineComponent({
     const router = useRouter()
     const state = reactive({
       tabIndex: 0,
-      musicList: [] as IMusicItem[]
+      musicList: [] as IMusicItem[],
+      rankingMethod: ''
     })
     const getMusicList = async () => {
       try {
         const {
-          data: { activityMusicVoList, shareUrl, subjectUrl }
+          data: {
+            rankingMethod,
+            subjectInfos,
+            activityMusicVoList,
+            shareUrl,
+            subjectUrl
+          }
         } = await request.post(
           `/api-student/open/activity/info/${route.query.id}`
         )
-        if (Array.isArray(activityMusicVoList)) {
-          state.musicList = activityMusicVoList.map(n => {
+        state.rankingMethod = rankingMethod
+        const activityList =
+          rankingMethod === 'TOTAL_SCORE' ? subjectInfos : activityMusicVoList
+        if (Array.isArray(activityList)) {
+          state.musicList = activityList.map(n => {
             n.rankingList = []
             return n
           })
@@ -61,7 +71,9 @@ export default defineComponent({
             params: {
               activityPlanId: route.query.id,
               activityEvaluationId:
-                state.musicList[state.tabIndex].evaluationId,
+                state.rankingMethod === 'TOTAL_SCORE'
+                  ? state.musicList[state.tabIndex].subjectId
+                  : state.musicList[state.tabIndex].evaluationId,
               limit: 10
             }
           }
@@ -118,10 +130,17 @@ export default defineComponent({
               titleInactiveColor="rgba(153,152,155,1)"
               titleActiveColor="#fff"
               onChange={index => getData()}
+              shrink
             >
               {state.musicList.map((item: IMusicItem) => {
                 return (
-                  <Tab title={item.musicSheetName}>
+                  <Tab
+                    title={
+                      state.rankingMethod === 'TOTAL_SCORE'
+                        ? item.subjectName
+                        : item.musicSheetName
+                    }
+                  >
                     <div
                       class={[styles.tabContent, 'van-safe-area-bottom']}
                       style={{ height: `calc(100vh - ${imgHeight.value}px)` }}
@@ -166,9 +185,11 @@ export default defineComponent({
                               </div>
                               <div class={styles.right}>
                                 <div class={styles.fraction}>{n.score}分</div>
-                                <div class={styles.time}>
-                                  第 {n.times} 次评测
-                                </div>
+                                {state.rankingMethod !== 'TOTAL_SCORE' && (
+                                  <div class={styles.time}>
+                                    第 {n.times} 次评测
+                                  </div>
+                                )}
                               </div>
                             </div>
                           )

+ 3 - 0
src/teacher/share-page/track-review-activity/index.module.less

@@ -169,6 +169,9 @@
     max-width: 200px;
     display: flex;
   }
+  .musicTitleScore {
+    flex: 1;
+  }
 
   .cellLevel {
     padding-bottom: 18px;

+ 5 - 1
src/teacher/share-page/track-review-activity/index.tsx

@@ -281,7 +281,11 @@ export default defineComponent({
               <CellGroup class={styles.musicItem} border={false}>
                 <Cell
                   center
-                  titleClass={styles.musicTitle}
+                  titleClass={[
+                    styles.musicTitle,
+                    this.rankingMethod == 'TOTAL_SCORE' &&
+                      styles.musicTitleScore
+                  ]}
                   v-slots={{
                     icon: () => (
                       <Image