修复课表

This commit is contained in:
ywyonui 2025-07-17 14:01:17 +08:00
parent 47091c1ddc
commit 47bf0977cc
2 changed files with 28 additions and 37 deletions

View File

@ -34,6 +34,13 @@ export const xkqddeleteApi = async (params: any) => {
return await post("/api/xkqd/delete?ids=" + params.ids);
};
/**
*
*/
export const gzlGetDqXqAndZcApi = async () => {
return await get("/api/gzl/getDqXqAndZc");
};
// 获取配置:家长端是否显示分钟数
export const getJzdShowFs = async () => {
return await get("/api/comConfig/getJzdShowFs");

View File

@ -63,22 +63,13 @@
<script lang="ts" setup>
import { ref, reactive, computed, onMounted, nextTick } from "vue";
import dayjs from "dayjs";
import "dayjs/locale/zh-cn";
import weekOfYear from "dayjs/plugin/weekOfYear";
import isoWeek from "dayjs/plugin/isoWeek";
import { dqpkApi, drpkkbApi } from "@/api/base/server";
import { dqpkApi, drpkkbApi, gzlGetDqXqAndZcApi } from "@/api/base/server";
import { useUserStore } from "@/store/modules/user";
const { getCurXs } = useUserStore();
dayjs.locale("zh-cn");
dayjs.extend(weekOfYear);
dayjs.extend(isoWeek);
let dqZc = 0;
let xqId = '';
//
const curZcNum = ref(dayjs().isoWeek());
//
const curZc = ref<any>({});
//
@ -128,7 +119,7 @@ const popupChange = (e: { show: boolean }) => {
//
const selectWeek = (zc: any) => {
if (zc.djz === curZc.value.djz) {
if (curZc.value && zc && zc.djz === curZc.value.djz) {
//
closeWeekPicker();
return;
@ -147,7 +138,9 @@ const selectWeek = (zc: any) => {
//
const selectDay = (index: number) => {
curRqIndex.value = index;
if (!rqList.value.length) {
return;
}
drpkkbApi({
bjId: getCurXs.bjId,
xqId: xqId,
@ -167,8 +160,6 @@ const selectDay = (index: number) => {
//
console.error("调用检查报名状态接口失败:", error);
});
};
//
@ -181,24 +172,17 @@ const getCourseColorClass = (subject: string | undefined): string => {
};
onMounted(async () => {
// Make onMounted async
dqpkApi().then(res => {
// result
if (res && res.resultCode === 1) {
xqId = res.result.pksz.xqId;
zcList.value = res.result.zcList;
sjList.value = res.result.sjList;
//
selectWeek(zcList.value.find((zc: any) => zc.djz === curZcNum.value));
} else {
//
console.warn("检查获取当前学期课表周次相关信息接口返回错误:", res);
const res = await dqpkApi();
const result = res.result;
dqZc = res.result.dqZc;
xqId = res.result.dqXq.id;
zcList.value = result.zcList;
sjList.value = result.sjList;
let zc = zcList.value.find((item:any) => item.djz === dqZc);
if (!zc) {
zc = zcList.value[0];
}
})
.catch((error) => {
//
console.error("调用获取当前学期课表周次相关信息接口失败:", error);
});
selectWeek(zc);
});
</script>