mo 1 year ago
parent
commit
db4e6249cb

+ 2 - 1
src/views/attend-class/model/train-type/index.tsx

@@ -162,8 +162,9 @@ export default defineComponent({
                     </h4>
                   ) : (
                     <h4>
+
                       {props.item.trainingTimes
-                        ? (props.item.trainingTimes / 60).toFixed(0)
+                        ? parseInt((props.item.trainingTimes / 60)+'')
                         : 0}
                       <span>分钟</span>
                     </h4>

+ 10 - 0
src/views/classList/api.ts

@@ -159,3 +159,13 @@ export const getTrainingClassDetail = (params: any) => {
     requestType: 'form'
   });
 };
+
+
+/**
+ * 学生练习记录
+ */
+export const getTrainingStatList = (params: any) => {
+  return request.post(`/edu-app/musicPracticeRecordStat/trainingList`, {
+    data: params
+  });
+};

+ 2 - 1
src/views/classList/components/testRecode.tsx

@@ -100,6 +100,7 @@ export default defineComponent({
         });
         state.testInfo.practiceDurationAvg = res.data.practiceDurationAvg;
         state.testInfo.practiceUserCount = res.data.practiceUserCount;
+        state.testInfo.vipUserCount = res.data.vipUserCount
       } catch (e) {
         console.log(e);
       }
@@ -147,7 +148,7 @@ export default defineComponent({
           title: '学生类型',
           key: 'studentType',
           render(row: any) {
-            return <>{row.studentType == 'member' ? '会员' : '普通'}</>;
+            return <>{row.vipFlag ? '会员' : '普通'}</>;
           }
         },
         {

+ 2 - 1
src/views/classList/index.tsx

@@ -170,6 +170,7 @@ export default defineComponent({
                     学生调整
                   </NButton>
                   <NButton
+                  disabled={!(row.preStudentNum > 0)}
                     type="primary"
                     text
                     onClick={() => classesBegin(row)}>
@@ -261,7 +262,7 @@ export default defineComponent({
           v-slots={{
             icon: () => (
               <>
-                <NImage class={styles.addBtnIcon} src={add}></NImage>
+                <NImage class={styles.addBtnIcon} previewDisabled src={add}></NImage>
               </>
             )
           }}>

+ 1 - 1
src/views/classList/modals/Gotoclass.tsx

@@ -68,7 +68,7 @@ export default defineComponent({
           emit('close');
           window.open(href, +new Date() + '');
         } else {
-          message.error('当前章节没有课件,请重新学则');
+          message.error('当前章节暂无课件,请重新选择');
         }
       });
 

+ 1 - 0
src/views/studentList/components/evaluationRecords.tsx

@@ -144,6 +144,7 @@ export default defineComponent({
       const res = await getPracticeRecordList({
         userId: props.studentId,
         ...state.pagination,
+        feature: "EVALUATION",
         ...getTimes(timer.value, ['startTime', 'endTime'], 'YYYY-MM-DD')
       });
       state.tableList = res.data.rows;

+ 17 - 3
src/views/studentList/components/practiceData.tsx

@@ -12,6 +12,7 @@ import numeral from 'numeral';
 import { useECharts } from '@/hooks/web/useECharts';
 import Pagination from '/src/components/pagination';
 import { getTrainingStat } from '../api';
+import { getTrainingStatList } from '@/views/classList/api'
 import {
   getNowDateAndMonday,
   getNowDateAndSunday,
@@ -85,8 +86,18 @@ export default defineComponent({
         }
       ];
     };
-    const getList = () => {
-      console.log('1');
+    const getList =  async () => {
+        try{
+          const res = await getTrainingStatList({
+            page:1,
+            rows:999,
+            studentId: props.studentId,
+            ...getTimes(timer.value, ['startTime', 'endTime'], 'YYYY-MM-DD')
+          })
+          state.tableList = res.data.rows;
+        }catch(e){
+          console.log(e)
+        }
     };
     const setChart = () => {
       setOptions({
@@ -222,7 +233,7 @@ export default defineComponent({
         payForm.timeList = res.data.trainingStatDetailList.map((item: any) => {
           return item.practiceDuration;
         });
-        state.tableList = res.data.trainingStatDetailList;
+
         setChart();
         console.log(payForm);
       } catch (e) {
@@ -232,6 +243,7 @@ export default defineComponent({
     const search = () => {
       state.pagination.page = 1;
       getChartDetail();
+      getList()
       console.log('search');
     };
     const onReset = () => {
@@ -240,11 +252,13 @@ export default defineComponent({
         getNowDateAndSunday(new Date().getTime())
       ];
       search();
+      getList()
       console.log('onReset');
     };
     onMounted(() => {
       console.log(props.studentId);
       getChartDetail();
+      getList()
     });
     return () => (
       <>