Parcourir la source

fix: change course statistics

DESKTOP-USV654P\pc il y a 3 semaines
Parent
commit
fe8a0d0dea
1 fichiers modifiés avec 10 ajouts et 5 suppressions
  1. 10 5
      src/views/course/statistics/components/edit.vue

+ 10 - 5
src/views/course/statistics/components/edit.vue

@@ -164,10 +164,15 @@
     });
   };
   const handelRefrresh = async () => {
-    await postClassTimeStatisticsRefreshStatistics({ id: unref(modelRef).id });
-    closeModal();
+    try {
+      setModalProps({ loading: true, confirmLoading: true });
+      await postClassTimeStatisticsRefreshStatistics({ id: unref(modelRef).id });
+      closeModal();
 
-    emit('success');
+      emit('success');
+    } finally {
+      setModalProps({ loading: false, confirmLoading: false });
+    }
   };
 
   const handleExport = async () => {
@@ -193,8 +198,8 @@
           width: 80,
           customRender: ({ text, record }) => {
             try {
-              if (record.courseTimeTypeJson) {
-                const courseTimeTypeData = JSON.parse(record.courseTimeTypeJson);
+              if (record.courseTimeTypeData) {
+                const courseTimeTypeData = JSON.parse(record.courseTimeTypeData);
                 if (courseTimeTypeData[text]) return courseTimeTypeData[text];
                 else return 0;
               } else {