lex-xin 2 mesiacov pred
rodič
commit
1adaf1abca

+ 1 - 46
src/student/teacher-dependent/components/vip.module.less

@@ -1,4 +1,4 @@
-.tipSection {
+.tipSection2 {
   padding: 4px 14px 0;
 }
 :global {
@@ -131,49 +131,4 @@
   background: #fff;
   padding-top: 10px;
   padding-bottom: 30px;
-}
-
-
-.tipSection {
-  position: relative;
-  background: #FFFFFF;
-  border-radius: 6px;
-  margin-bottom: 12px;
-  .iconCross {
-    position: absolute;
-    top: 15px;
-    right: 13px;
-    font-size: 16px;
-    color: #CCCCCC;
-    cursor: pointer;
-  }
-  .tipTitle {
-    padding: 12px 12px 10px;
-    font-weight: 500;
-    font-size: 15px;
-    color: #333333;
-    line-height: 18px;
-
-    img {
-      width: 18px;
-      height: 18px;
-      margin-right: 6px;
-      vertical-align: text-bottom;
-    }
-  }
-  .tipContent {
-    padding: 0 12px 10px;
-    font-size: 13px;
-    color: #777777;
-    line-height: 22px;
-  }
-  .tipFooter {
-    margin: 0 12px;
-    padding: 10px 0;
-    text-align: center;
-    border-top: 1px solid #F2F2F2;
-    font-size: 13px;
-    color: #2DC7AA;
-    line-height: 18px;
-  }
 }

+ 2 - 1
src/student/teacher-dependent/components/vip.tsx

@@ -395,7 +395,8 @@ export default defineComponent({
   render() {
     return (
       <>
-        <div class={styles.tipSection}><Tips type="LIVE_COURSE" title='什么是VIP定制课?' content='VIP定制课程采用一对一专属授课模式,每节课时长为45分钟。课程内容根据学生的具体需求量身打造,旨在全面提升学生的个人技能与表现。不论是希望在乐器演奏技巧上取得突破,如提高指法精准度、气息控制能力或节奏掌握等;还是为即将到来的重要活动、比赛或考级做充分准备,我们都能提供高度匹配的教学方案。此外,教学进度将根据每位学员的学习吸收情况灵活调整,确保每个人都能在最适合自己的节奏中稳步前进,扎实提升个人能力。' /></div>
+      <div class={styles.tipSection2}>
+        <Tips type="LIVE_COURSE" title='什么是VIP定制课?' content='VIP定制课程采用一对一专属授课模式,每节课时长为45分钟。课程内容根据学生的具体需求量身打造,旨在全面提升学生的个人技能与表现。不论是希望在乐器演奏技巧上取得突破,如提高指法精准度、气息控制能力或节奏掌握等;还是为即将到来的重要活动、比赛或考级做充分准备,我们都能提供高度匹配的教学方案。此外,教学进度将根据每位学员的学习吸收情况灵活调整,确保每个人都能在最适合自己的节奏中稳步前进,扎实提升个人能力。' /></div>
         {!this.loadDataStatus &&
           (this.settingStatus ? (
             <>

+ 6 - 3
src/teacher/statistics/home-statistics-detail/echats/index.tsx

@@ -59,7 +59,7 @@ echarts.use([
   LineChart
 ])
 
-const lineChartOption = (xAxisData: any, seriesData: any) => {
+const lineChartOption = (xAxisData: any, seriesData: any, countMaxCount = 5) => {
   return {
     title: {
       text: '单位:次',
@@ -203,7 +203,8 @@ const lineChartOption = (xAxisData: any, seriesData: any) => {
       splitLine: {
         axisLine: { lineStyle: { color: '#8C8C8C' } },
         lineStyle: { color: ['#f2f2f2'], type: 'dashed' }
-      }
+      },
+      splitNumber: countMaxCount
     },
     dataZoom: [{ type: 'inside', throttle: 100 }],
     toolbox: { feature: { saveAsImage: { show: false } } }
@@ -229,6 +230,7 @@ export default defineComponent({
       buyCount: 0,
       time: ''
     })
+    const countMaxCount = ref(5)
     const currentType = ref<TIME_TYPE>(props.currentType)
     const timeRange = getTimeRange(currentType.value)
     const searchStatus = ref(false)
@@ -261,10 +263,11 @@ export default defineComponent({
         statisticCounts.value.browseCount = props.obj.browseCount || 0
         statisticCounts.value.buyCount = props.obj.buyCount || 0
         statisticCounts.value.time = props.obj.time
+        countMaxCount.value = props.obj.countMaxCount
         myChart.clear()
         lineChartOption &&
           myChart.setOption(
-            lineChartOption(props.obj.xAxisData, props.obj.yAxisData)
+            lineChartOption(props.obj.xAxisData, props.obj.yAxisData, countMaxCount.value)
           )
         myChart.on('highlight', function (params: any) {
           const batch = params.batch || []

+ 7 - 0
src/teacher/statistics/home-statistics-detail/list/index.tsx

@@ -35,6 +35,7 @@ export default defineComponent({
     const obj = ref({
       xAxisData: [] as any,
       yAxisData: [] as any,
+      countMaxCount: 5,
       browseCount: 0,
       buyCount: 0,
       time: ''
@@ -66,10 +67,14 @@ export default defineComponent({
         const exposure = data.exposure || []
         const xAxisData: string[] = []
         const exposureList: number[] = []
+        let maxCount = 0 // 最大人数 - 用记设置练习人数分割线
         exposure.forEach((item: any, index: number) => {
           xAxisData.push(item.date)
           exposureList.push(item.exposureNum)
 
+          if (maxCount < (item.exposureNum || 0)) {
+            maxCount = item.exposureNum
+          }
           if (exposure.length - 1 === index) {
             obj.value.browseCount = item.exposureNum
             obj.value.time = item.date
@@ -84,9 +89,11 @@ export default defineComponent({
           }
         })
         const yAxisData = [exposureList, buyList]
+        const countMaxCount = maxCount >= 5 ? 5 : Math.max(maxCount, 1)
 
         obj.value.xAxisData = xAxisData
         obj.value.yAxisData = yAxisData
+        obj.value.countMaxCount = countMaxCount
       } catch {
         //
       }

+ 13 - 4
src/teacher/statistics/home-statistics/index.tsx

@@ -79,7 +79,7 @@ const lineChartOption = (
         show: false
       },
       axisLabel: {
-        margin: 16,
+        margin: 16
         // formatter: function (value, index) {
         //   // 第一个和最后一个标签分别居左和居右显示
         //   if (index === 0) {
@@ -243,6 +243,7 @@ export default defineComponent({
     const popoverStatus = ref(false)
     const currentType = ref<TIME_TYPE>('MONTH')
     const timeRange = ref(getTimeRange(currentType.value))
+    // const isNotifyHeight = ref(false)
     const statisticCounts = ref({
       browseCount: 0,
       buyCount: 0,
@@ -253,8 +254,11 @@ export default defineComponent({
       myChart = echarts.init(
         document.getElementById('eChart') as HTMLDivElement
       )
+      getHeight()
       getDetail()
+    })
 
+    const getHeight = () => {
       const round = homeStatisticsRef.value?.getBoundingClientRect()
       postMessage({
         api: 'homeStatisticsHeight',
@@ -262,7 +266,8 @@ export default defineComponent({
           height: round.height || 300
         }
       })
-    })
+      // isNotifyHeight.value = true
+    }
 
     const searchText = computed(() => {
       const template = {
@@ -279,6 +284,7 @@ export default defineComponent({
         const { data } = await request.post(
           '/api-teacher/home/courseExposure',
           {
+            hideLoading: true,
             data: timeRange.value
           }
         )
@@ -378,6 +384,9 @@ export default defineComponent({
 
     // 监听页面返回
     listenerMessage('webViewOnResume', () => {
+      // if (!isNotifyHeight.value) {
+      //   getHeight()
+      // }
       getDetail()
     })
     return () => (
@@ -397,9 +406,9 @@ export default defineComponent({
         <div class={styles.eChartSection}>
           <div class={styles.eChartTitle}>
             <div class={styles.left}>
-              {statisticCounts.value.time && (
+              {/* {statisticCounts.value.time && ( */}
                 <div class={styles.time}>{statisticCounts.value.time}</div>
-              )}
+              {/* )} */}
 
               <div class={styles.twoItem}>
                 <div class={styles.item} style="--color: #2DC7AA">

+ 2 - 5
src/teacher/statistics/practice-statistics-detail/echats/index.tsx

@@ -1,10 +1,8 @@
 import {
   defineComponent,
   nextTick,
-  onMounted,
   PropType,
   ref,
-  shallowRef,
   watch
 } from 'vue'
 import styles from './index.module.less'
@@ -33,7 +31,6 @@ import {
 import { LabelLayout } from 'echarts/features'
 import { CanvasRenderer } from 'echarts/renderers'
 import { formatSecToHMS } from '..'
-import { boxShadow } from 'html2canvas/dist/types/css/property-descriptors/box-shadow'
 
 // 注册必须的组件
 echarts.use([
@@ -218,7 +215,7 @@ export default defineComponent({
         statisticCounts.value.count =
           props.type === 'NUM'
             ? props.obj.count
-            : formatSecToHMS(props.obj.count).all
+            : formatSecToHMS(props.obj.count || 0).all
 
         myChart.clear()
         lineChartOption &&
@@ -251,7 +248,7 @@ export default defineComponent({
             const count =
               props.type === 'NUM'
                 ? props.obj.yAxisData[batchIndex]
-                : formatSecToHMS(props.obj.yAxisData[batchIndex] || 0).all
+                : formatSecToHMS(props.obj.yAxisData[batchIndex]?.[2] || 0).all
             const time = props.obj.xAxisData[batchIndex]
             statisticCounts.value = {
               count,

+ 12 - 2
src/teacher/statistics/practice-statistics-detail/index.module.less

@@ -9,6 +9,9 @@
   height: calc(100vh - var(--header-height, 0));
   overflow-x: hidden;
   overflow-y: auto;
+  &::-webkit-scrollbar {
+    display: none;
+  }
 }
 
 .section {
@@ -262,16 +265,23 @@
     flex-direction: column;
     justify-content: center;
     margin-left: 4px;
+    width: 12px;
+    position: relative;
     :global {
       .iconfont {
         line-height: 1;
       }
     }
+    .upArrow, .downArrow {
+      font-size: 12px;
+      position: absolute;
+    }
     .upArrow {
-      transform: rotate(180deg) translateY(-1px);
+      bottom: -2px;
+      transform: rotate(180deg);
     }
     .downArrow {
-      transform: translateY(-3px);
+      top: -2px;
     }
   }
 }

+ 45 - 34
src/teacher/statistics/practice-statistics-detail/index.tsx

@@ -16,6 +16,7 @@ import { getTimeRange, TIME_TYPE } from '../home-statistics'
 import ColResult from '@/components/col-result'
 import { promisefiyPostMessage } from '@/helpers/native-message'
 import { useRouter } from 'vue-router'
+import { state } from '@/state'
 
 /** 秒转分 */
 export const formatSecToMin = (second: number) => {
@@ -45,22 +46,31 @@ export const formatSecToHMS = second => {
   }
 }
 
+const catchKey = 'practice-statistics-detail-search'
 export default defineComponent({
   name: 'PracticeDetail',
   setup() {
     const router = useRouter()
+
+    let catchSearch: any = sessionStorage.getItem(catchKey)
+    catchSearch = catchSearch ? JSON.parse(catchSearch) : {}
+    sessionStorage.removeItem(catchKey)
+
     const searchStatus = ref(false)
-    const currentType = ref<TIME_TYPE>('MONTH')
+    const currentType = ref<TIME_TYPE>(catchSearch.currentType !== undefined ?  catchSearch.currentType : 'MONTH')
 
     const searchObj = reactive({
-      tempSubjectId: '' as any,
-      type: 'MONTH' as TIME_TYPE
+      tempSubjectId: catchSearch.subjectId || '' as any,
+      type: catchSearch.currentType !== undefined ?  catchSearch.currentType : 'MONTH' as TIME_TYPE
     })
-    const timeRange = getTimeRange(currentType.value)
+    const timeRange = catchSearch.startTime && catchSearch.endTime ? {
+      startTime: catchSearch.startTime,
+      endTime: catchSearch.endTime
+    } : getTimeRange(currentType.value)
     const forms = reactive({
       loading: false,
       dataShow: true,
-      subjectId: '' as any, // 选择的声部
+      subjectId: catchSearch.subjectId || '' as any, // 选择的声部
       subjectList: [] as any,
       startTimeStatus: false,
       startTimeClosedStatus: false,
@@ -131,15 +141,13 @@ export default defineComponent({
 
         const pathname = data || ''
         if (pathname) {
-          const filenameWithExtension = pathname.split('/').pop()
-          const filename = filenameWithExtension.split('.')[0]
-          console.log(filename) // 输出: page
+          const fileName = `练习详情${forms.startTimeStr}~${forms.endTimeStr}_${state.user.data?.userId}`
           // 发送消息通知移动端下载文件
           promisefiyPostMessage({
             api: 'downloadFile',
             content: {
               downloadUrl: pathname,
-              fileName: filename
+              fileName
             }
           })
         }
@@ -171,10 +179,14 @@ export default defineComponent({
         // 练习时长
         const practiceTimes = data.practiceTimes || []
         const xAxisDataTimes: string[] = []
-        const practiceTimeList: string[] = []
+        const practiceTimeList: any[] = []
         practiceTimes.forEach((item: any, index: number) => {
           xAxisDataTimes.push(item.date)
-          practiceTimeList.push(formatSecToMin(item.practiceTime))
+          practiceTimeList.push([
+            index,
+            formatSecToMin(item.practiceTime),
+            item.practiceTime
+          ])
 
           if (practiceTimes.length - 1 === index) {
             obj.value.timeCount = item.practiceTime
@@ -292,6 +304,7 @@ export default defineComponent({
       // timeRange.value = getTimeRange(currentType.value)
       searchStatus.value = false
       forms.subjectId = searchObj.tempSubjectId
+      currentType.value = searchObj.type
       getDetail()
       getStudentDetail()
     }
@@ -320,10 +333,16 @@ export default defineComponent({
 
     /** 跳转详情 */
     const toDetail = (item: any) => {
+      sessionStorage.setItem(catchKey, JSON.stringify({
+        startTime: forms.startTimeStr,
+        endTime: forms.endTimeStr,
+        currentType: currentType.value,
+        subjectId: forms.subjectId
+      }))
       router.push({
         path: '/exercise-detail',
         query: {
-          studentId: item.userId || ''
+          studentId: item.userId || '',
         }
       })
     }
@@ -458,7 +477,15 @@ export default defineComponent({
                         >
                           练习时长
                           <div class={styles.filters}>
-                            <Icon
+                            <i class={['iconfont iconfont-down', styles.upArrow]} style={{ color: forms.sortField === 'totalPracticeTime' &&
+                                forms.sortType === 'ASC'
+                                  ? 'rgba(223, 128, 16, 1)'
+                                  : 'rgba(0, 0, 0, 0.20)' }}></i>
+                            <i class={['iconfont iconfont-down', styles.downArrow]} style={{ color: forms.sortField === 'totalPracticeTime' &&
+                                forms.sortType === 'DESC'
+                                  ? 'rgba(223, 128, 16, 1)'
+                                  : 'rgba(0, 0, 0, 0.20)' }}></i>
+                            {/* <Icon
                               classPrefix="iconfont"
                               name="down"
                               class={styles.upArrow}
@@ -481,7 +508,7 @@ export default defineComponent({
                                   ? 'rgba(223, 128, 16, 1)'
                                   : 'rgba(0, 0, 0, 0.20)'
                               }
-                            />
+                            /> */}
                           </div>
                         </div>
                       </th>
@@ -493,30 +520,14 @@ export default defineComponent({
                         >
                           平均练习时长
                           <div class={styles.filters}>
-                            <Icon
-                              classPrefix="iconfont"
-                              name="down"
-                              class={styles.upArrow}
-                              size={12}
-                              color={
-                                forms.sortField === 'averagePracticeTime' &&
+                            <i class={['iconfont iconfont-down', styles.upArrow]} style={{ color: forms.sortField === 'averagePracticeTime' &&
                                 forms.sortType === 'ASC'
                                   ? 'rgba(223, 128, 16, 1)'
-                                  : 'rgba(0, 0, 0, 0.20)'
-                              }
-                            />
-                            <Icon
-                              classPrefix="iconfont"
-                              name="down"
-                              class={styles.downArrow}
-                              size={12}
-                              color={
-                                forms.sortField === 'averagePracticeTime' &&
+                                  : 'rgba(0, 0, 0, 0.20)' }}></i>
+                            <i class={['iconfont iconfont-down', styles.downArrow]} style={{ color: forms.sortField === 'averagePracticeTime' &&
                                 forms.sortType === 'DESC'
                                   ? 'rgba(223, 128, 16, 1)'
-                                  : 'rgba(0, 0, 0, 0.20)'
-                              }
-                            />
+                                  : 'rgba(0, 0, 0, 0.20)' }}></i>
                           </div>
                         </div>
                       </th>