Explorar o código

fix: change course statistics

DESKTOP-USV654P\pc hai 3 semanas
pai
achega
fe8a0d0dea
Modificáronse 1 ficheiros con 10 adicións e 5 borrados
  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 {