fix: 老师数据看板
This commit is contained in:
parent
da364bc97d
commit
6fda3ac190
4
.env
4
.env
@ -1,5 +1,5 @@
|
|||||||
#VITE_HOST = http://192.168.0.114:9053
|
#VITE_HOST = http://192.168.0.114:9053
|
||||||
VITE_HOST = http://43.136.52.196:9053
|
#VITE_HOST = http://43.136.52.196:9053
|
||||||
#VITE_HOST= https://ai.xuexiaole.com
|
VITE_HOST= https://ai.xuexiaole.com
|
||||||
VITE_OSS_HOST = https://xxl-1313840333.cos.ap-guangzhou.myqcloud.com
|
VITE_OSS_HOST = https://xxl-1313840333.cos.ap-guangzhou.myqcloud.com
|
||||||
VITE_WS_URL = wss://test.qiaoying.vip/wss/websocket
|
VITE_WS_URL = wss://test.qiaoying.vip/wss/websocket
|
||||||
@ -108,6 +108,67 @@ export interface ClassHomeworkReportData {
|
|||||||
studentList: ClassHomeworkStudentItem[];
|
studentList: ClassHomeworkStudentItem[];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// ---------- AI 批改效率总览 school/report/aiCorrectionEfficiency/overview ----------
|
||||||
|
export interface TopErrorTitle {
|
||||||
|
titleId?: number | string;
|
||||||
|
titleContent?: string;
|
||||||
|
subjectId?: number;
|
||||||
|
subjectName?: string;
|
||||||
|
errorCount?: number;
|
||||||
|
errorRate?: number;
|
||||||
|
[key: string]: any;
|
||||||
|
}
|
||||||
|
|
||||||
|
export interface AiCorrectionOverview {
|
||||||
|
classId: number | string;
|
||||||
|
className: string;
|
||||||
|
aiPaperCount: number;
|
||||||
|
aiTitleCount: number;
|
||||||
|
teacherSaveTimeMinutes: number;
|
||||||
|
excellentCount: number;
|
||||||
|
excellentRate: number;
|
||||||
|
goodCount: number;
|
||||||
|
goodRate: number;
|
||||||
|
passCount: number;
|
||||||
|
passRate: number;
|
||||||
|
unsubmittedCount: number;
|
||||||
|
unsubmittedRate: number;
|
||||||
|
topErrorTitles: TopErrorTitle[];
|
||||||
|
}
|
||||||
|
|
||||||
|
/** AI 批改效率总览:GET 请求,form 风格 query */
|
||||||
|
export const getAiCorrectionOverview = (params: {
|
||||||
|
classId: string | number;
|
||||||
|
subjectIds?: number[];
|
||||||
|
startTime?: string;
|
||||||
|
endTime?: string;
|
||||||
|
schoolId?: string;
|
||||||
|
}) => {
|
||||||
|
const formEncode = (v: string) => encodeURIComponent(v).replace(/%20/g, '+');
|
||||||
|
const query: string[] = [];
|
||||||
|
query.push('classId=' + formEncode(String(params.classId)));
|
||||||
|
if (params.schoolId) {
|
||||||
|
query.push('schoolId=' + formEncode(String(params.schoolId)));
|
||||||
|
}
|
||||||
|
if (params.subjectIds && params.subjectIds.length > 0) {
|
||||||
|
params.subjectIds.forEach((id) => {
|
||||||
|
query.push('subjectIds=' + formEncode(String(id)));
|
||||||
|
});
|
||||||
|
}
|
||||||
|
if (params.startTime != null && params.startTime !== '' && String(params.startTime).trim() !== '') {
|
||||||
|
const st = String(params.startTime).trim();
|
||||||
|
query.push('startTime=' + formEncode(st.includes(' ') ? st : st + ' 00:00:00'));
|
||||||
|
}
|
||||||
|
if (params.endTime != null && params.endTime !== '' && String(params.endTime).trim() !== '') {
|
||||||
|
const et = String(params.endTime).trim();
|
||||||
|
query.push('endTime=' + formEncode(et.includes(' ') ? et : et + ' 23:59:59'));
|
||||||
|
}
|
||||||
|
return request({
|
||||||
|
url: '/school/report/aiCorrectionEfficiency/overview?' + query.join('&'),
|
||||||
|
method: 'GET',
|
||||||
|
});
|
||||||
|
};
|
||||||
|
|
||||||
/** 班级作业报表:GET 请求,参数以 form 表单风格放在 query(subjectIds 为多个同名参数) */
|
/** 班级作业报表:GET 请求,参数以 form 表单风格放在 query(subjectIds 为多个同名参数) */
|
||||||
export const getClassHomeworkReport = (params: {
|
export const getClassHomeworkReport = (params: {
|
||||||
classId: string | number;
|
classId: string | number;
|
||||||
|
|||||||
@ -103,7 +103,7 @@ import { getClassListByTeacher, getSubjectListByClassId } from '@/api/teacher';
|
|||||||
import { teacher } from '@/store/teacher';
|
import { teacher } from '@/store/teacher';
|
||||||
import { storeToRefs } from 'pinia';
|
import { storeToRefs } from 'pinia';
|
||||||
const teacherStore = teacher();
|
const teacherStore = teacher();
|
||||||
const { schoolId } = storeToRefs(teacherStore);
|
const { schoolId, teacherInfo } = storeToRefs(teacherStore);
|
||||||
|
|
||||||
// 胶囊预留 + 安全区域
|
// 胶囊预留 + 安全区域
|
||||||
const topPaddingRightRpx = ref(0);
|
const topPaddingRightRpx = ref(0);
|
||||||
@ -167,12 +167,20 @@ watch(() => selectedClassId.value, async (newClassId) => {
|
|||||||
// 适配接口返回格式
|
// 适配接口返回格式
|
||||||
if (Array.isArray(data)) {
|
if (Array.isArray(data)) {
|
||||||
subjectList.value = data.map((item: any) => ({
|
subjectList.value = data.map((item: any) => ({
|
||||||
value: item.subjectId ?? item.id ?? item.value,
|
value: Number(item.subjectId ?? item.id ?? item.value),
|
||||||
label: item.subjectName ?? item.name ?? item.label ?? '',
|
label: item.subjectName ?? item.name ?? item.label ?? '',
|
||||||
}));
|
}));
|
||||||
} else {
|
} else {
|
||||||
subjectList.value = [];
|
subjectList.value = [];
|
||||||
}
|
}
|
||||||
|
// 根据 getLoginUser 返回的 subjectId 默认选中对应学科
|
||||||
|
const teacherSubjectId = teacherInfo.value?.subjectId;
|
||||||
|
if (teacherSubjectId != null && teacherSubjectId !== '') {
|
||||||
|
const tid = Number(teacherSubjectId);
|
||||||
|
if (!isNaN(tid) && subjectList.value.some((s) => s.value === tid)) {
|
||||||
|
selectedSubjectIds.value = [tid];
|
||||||
|
}
|
||||||
|
}
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
console.error('获取学科列表失败', e);
|
console.error('获取学科列表失败', e);
|
||||||
subjectList.value = [];
|
subjectList.value = [];
|
||||||
|
|||||||
File diff suppressed because it is too large
Load Diff
Loading…
x
Reference in New Issue
Block a user