Преглед изворни кода

fix: change course statistics

DESKTOP-USV654P\pc пре 2 недеља
родитељ
комит
0f7c03d573

+ 5 - 4
src/views/course/statistics/components/detail.vue

@@ -157,13 +157,14 @@
 
             const colName = `day${index}`;
 
-            totalRow[colName] = { courseName: item.content };
+            totalRow[colName] = {
+              courseName: item.content === 0 || item.content === '0.0' ? '' : item.content,
+            };
 
             row[colName] = {};
-            row['total'] = col.content === 0 ? '' : col.content;
+            row['total'] = col.content === 0 || col.content === '0.0' ? '' : col.content;
 
             if (filter.length > 0) {
-              // console.log('filter', filter);
               const filterItem = filter[0];
               if (filterItem.content) {
                 const contents = filterItem.content.split(',');
@@ -173,7 +174,7 @@
                   className = contents[1];
                 }
 
-                row[colName]['courseName'] = courseName;
+                row[colName]['courseName'] = courseName === '0.0' ? '' : courseName;
                 row[colName]['className'] = className;
 
                 if (filterItem.adjustType === 'course_exchange') {

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

@@ -200,13 +200,14 @@
             try {
               if (record.courseTimeTypeData) {
                 const courseTimeTypeData = JSON.parse(record.courseTimeTypeData);
-                if (courseTimeTypeData[item.name]) return courseTimeTypeData[item.name];
-                else return 0;
+                if (courseTimeTypeData[item.name])
+                  return courseTimeTypeData[item.name] === 0 ? '' : courseTimeTypeData[item.name];
+                else return '';
               } else {
-                return 0;
+                return '';
               }
             } catch {
-              return 0;
+              return '';
             }
           },
         });

+ 27 - 0
src/views/course/statistics/data.config.ts

@@ -135,53 +135,80 @@ export const formDetailSchema: BasicColumn[] = [
     dataIndex: 'classTime7',
     align: 'left',
     width: 80,
+    customRender: ({ text }) => {
+      return text === 0 ? '' : text;
+    },
   },
   {
     title: '正课(含调顶课时)',
     dataIndex: 'classTime8',
     align: 'left',
     width: 80,
+    customRender: ({ text }) => {
+      return text === 0 ? '' : text;
+    },
   },
   {
     title: '晚辅(含调顶课时)',
     dataIndex: 'classTime9',
     align: 'left',
     width: 80,
+    customRender: ({ text }) => {
+      return text === 0 ? '' : text;
+    },
   },
   {
     title: '顶课',
     dataIndex: 'classTime10',
     align: 'left',
     width: 80,
+    customRender: ({ text }) => {
+      return text === 0 ? '' : text;
+    },
   },
   {
     title: '调课',
     dataIndex: 'classTime11',
     align: 'left',
     width: 80,
+    customRender: ({ text }) => {
+      return text === 0 ? '' : text;
+    },
   },
   {
     title: '总课时',
     dataIndex: 'allClassTime',
     align: 'left',
     width: 80,
+    customRender: ({ text }) => {
+      return text === 0 ? '' : text;
+    },
   },
   {
     title: '课时费(元)',
     dataIndex: 'classTimeAmount',
     align: 'left',
     width: 100,
+    customRender: ({ text }) => {
+      return text === 0 ? '' : text;
+    },
   },
   {
     title: '外聘教师超课时费(元)',
     dataIndex: 'beyondClassTimeAmount',
     align: 'left',
     width: 100,
+    customRender: ({ text }) => {
+      return text === 0 ? '' : text;
+    },
   },
   {
     title: '总金额(元)',
     dataIndex: 'totalAmount',
     align: 'left',
     width: 110,
+    customRender: ({ text }) => {
+      return text === 0 ? '' : text;
+    },
   },
 ];