Selaa lähdekoodia

fix: change student

DESKTOP-USV654P\pc 1 viikko sitten
vanhempi
commit
e83757e576

+ 4 - 6
src/views/educational/labourManager/index.vue

@@ -109,11 +109,11 @@
     <BasicTable @register="registerTable">
       <template #toolbar>
         <a-button type="primary" @click="visible = true">导入</a-button>
-        <a-button type="primary" @click="handleExport()">导出</a-button>
+        <!-- <a-button type="primary" @click="handleExport()">导出</a-button> -->
         <a-button type="primary" @click="handleDownload">下载模板</a-button>
       </template>
       <template #action="{ record }">
-        <div style="display: flex; justify-content: center;">
+        <div style="display: flex; justify-content: center">
           <TableAction
             :actions="[
               {
@@ -131,11 +131,9 @@
     </BasicTable>
     <viewModal @register="viewModalreg" />
     <Modal @cancel="handleCancel" @ok="handleSubmit" v-model:visible="visible" title="导入">
-      <div style="padding: 12px;">
+      <div style="padding: 12px">
         <Upload :max-count="1" :before-upload="beforeUpload">
-          <a-button type="primary">
-            模板文件
-          </a-button>
+          <a-button type="primary"> 模板文件 </a-button>
         </Upload>
         <BasicForm @register="formReg" />
       </div>

+ 15 - 8
src/views/educational/timetable/index.vue

@@ -61,6 +61,16 @@
         rowSpan = classTimeList.filter((row) => row.timePeriod === timePeriod).length;
       }
 
+      const diffName = (data, field: string) => {
+        const value: string[] = [];
+        data.forEach((item: any) => {
+          if (!value.includes(item[field])) {
+            value.push(item[field]);
+          }
+        });
+        return value.length > 1 ? value.join('/') : value[0];
+      };
+
       const getWeekObj = (weeks) => {
         const weekFilter = courseList.filter(
           (row) =>
@@ -70,16 +80,13 @@
         );
         if (weekFilter && weekFilter.length > 0) {
           return {
-            siteName: weekFilter.map((item) => item.classroomName).join('/'), //weekFilter[0].classroomName || '-',
-            courseName: weekFilter.map((item) => item.courseName).join('/'), //weekFilter[0].courseName || '-',
+            siteName: diffName(weekFilter, 'classroomName'), //weekFilter[0].classroomName || '-',
+            courseName: diffName(weekFilter, 'courseName'), //weekFilter[0].courseName || '-',
             name:
               formData.courseType === 'teacher'
-                ? weekFilter.map((item) => item.className).join('/')
-                : weekFilter
-                    .map((item) => item.teacherName)
-                    .filter((item) => item != '')
-                    .join('/'), //weekFilter[0].teacherName || '-',
-            adjustType: weekFilter.map((item) => item.adjustType).join('/'),
+                ? diffName(weekFilter, 'className')
+                : diffName(weekFilter, 'teacherName'), //weekFilter[0].teacherName || '-',
+            adjustType: diffName(weekFilter, 'adjustType'),
           };
         } else {
           return {};

+ 14 - 4
src/views/sys/door/components/timetable/calendar.vue

@@ -117,6 +117,16 @@
         rowSpan = classTimeList.filter((row) => row.timePeriod === timePeriod).length;
       }
 
+      const diffName = (data, field: string) => {
+        const value: string[] = [];
+        data.forEach((item: any) => {
+          if (!value.includes(item[field])) {
+            value.push(item[field]);
+          }
+        });
+        return value.length > 1 ? value.join('/') : value[0];
+      };
+
       const getWeekObj = (weeks) => {
         const weekFilter = courseList.filter(
           (row) =>
@@ -129,10 +139,10 @@
             console.log('weekFilter', weekFilter);
           }
           return {
-            siteName: weekFilter.map((item) => item.classroomName || '').join('/'), // [0].classroomName || '-',
-            courseName: weekFilter.map((item) => item.courseName || '').join('/'), //weekFilter[0].courseName || '-',
-            name: weekFilter.map((item) => item.className || '').join('/'), // weekFilter[0].className || '1',
-            adjustType: weekFilter.map((item) => item.adjustType).join('/'), //weekFilter[0].adjustType || '-',
+            siteName: diffName(weekFilter, 'classroomName'), // [0].classroomName || '-',
+            courseName: diffName(weekFilter, 'courseName'), //weekFilter[0].courseName || '-',
+            name: diffName(weekFilter, 'className'), // weekFilter[0].className || '1',
+            adjustType: diffName(weekFilter, 'adjustType'), //weekFilter[0].adjustType || '-',
           };
         } else {
           return {};