DESKTOP-USV654P\pc 2 тижнів тому
батько
коміт
34d5d20754

+ 2 - 2
.env.development

@@ -15,8 +15,8 @@ VITE_DROP_CONSOLE = false
 
 # 接口地址
 # 如果没有跨域问题,直接在这里配置即可
-# VITE_GLOB_API_URL=http://localhost:8080
-  VITE_GLOB_API_URL=http://10.150.10.139:8888/api
+# VITE_GLOB_API_URL=http://42.247.8.136:8007/tlapipre
+VITE_GLOB_API_URL=http://10.150.10.139:8888/api
 
 #VITE_GLOB_API_URL=http://172.21.92.28:8080
 # 文件上传接口  可选

+ 1 - 1
Makefile

@@ -12,7 +12,7 @@ build:
 
 commit:
 	git add . && \
-	git commit --no-verify -m "fix: change studentbaseInfo"
+	git commit --no-verify -m "fix: change timetable"
 
 checkPre:
 	git checkout pre

+ 25 - 1
src/views/educational/timetable/data.config.ts

@@ -1,11 +1,35 @@
 import { BasicColumn } from '/@/components/Table';
 import { h } from 'vue';
 
+const formatDdjustType = (adjustType) => {
+  if (adjustType === 'course_substitute') return '顶课';
+  if (adjustType === 'course_exchange') return '调课';
+  if (adjustType === 'course_replace') return '补班';
+  if (adjustType === 'course_delete') return '删除';
+  return adjustType === '/' ? '' : adjustType;
+};
+
+const formatStyle = (text: any) => {
+  let style = 'position:relative;padding:4px;';
+  if (text.adjustType === 'course_substitute') {
+    style += 'background-color:#ec808d;color:#fff;';
+  }
+  if (text.adjustType === 'course_exchange') {
+    style += 'background-color:#facd91;color:#fff;';
+  }
+  return style;
+};
+
 const formatWeek = ({ text }: { text: any }) => {
-  return h('div', null, [
+  return h('div', { style: formatStyle(text) }, [
     h('div', null, text.courseName || ''),
     h('div', null, text.siteName || ''),
     h('div', null, text.name || ''),
+    h(
+      'div',
+      { style: 'position:absolute;top:4px;right:4px;font-size:12px;' },
+      formatDdjustType(text.adjustType),
+    ),
   ]);
 };
 

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

@@ -28,7 +28,6 @@
     postScheduleScheduleWeekExportQuery,
   } from '/@/services/apis/ScheduleController';
   import { requestMagicApi } from '/@/api/magicApi';
-  import { BasicOptionModel } from '/@/api/model/baseModel';
   import { orderBy } from 'lodash-es';
   import { downloadByData } from '/@/utils/file/download';
   import { formatToDate, formatToDateTime } from '/@/utils/dateUtil';
@@ -71,12 +70,16 @@
         );
         if (weekFilter && weekFilter.length > 0) {
           return {
-            siteName: weekFilter[0].classroomName || '-',
-            courseName: weekFilter[0].courseName || '-',
+            siteName: weekFilter.map((item) => item.classroomName).join('/'), //weekFilter[0].classroomName || '-',
+            courseName: weekFilter.map((item) => item.courseName).join('/'), //weekFilter[0].courseName || '-',
             name:
               formData.courseType === 'teacher'
-                ? weekFilter[0].className || '-'
-                : weekFilter[0].teacherName || '-',
+                ? 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('/'),
           };
         } else {
           return {};

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

@@ -62,6 +62,7 @@
                   {{ item.courseName }}
                 </div>
               </div>
+              <div>{{ item.adjustType }}</div>
             </div>
           </template>
         </Calendar>
@@ -80,7 +81,6 @@
     getScheduleCurrentWeek,
     getScheduleWeekList,
   } from '/@/services/apis/ScheduleController';
-  import { BasicOptionModel } from '/@/api/model/baseModel';
   import { BasicTable, useTable } from '/@/components/Table';
   import { tableColumns } from '/@/views/educational/timetable/data.config';
   import { orderBy } from 'lodash-es';
@@ -125,10 +125,14 @@
             row.weeks === weeks,
         );
         if (weekFilter && weekFilter.length > 0) {
+          if (weekFilter[0].adjustType) {
+            console.log('weekFilter', weekFilter);
+          }
           return {
-            siteName: weekFilter[0].classroomName || '-',
-            courseName: weekFilter[0].courseName || '-',
-            name: weekFilter[0].className || '1',
+            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 || '-',
           };
         } else {
           return {};