|
|
@@ -464,65 +464,26 @@ import { downloadExcel, GetExcelFileName } from "@/utils/exportExcel";
|
|
|
import { onMounted, reactive, watch, ref, computed, nextTick } from "vue";
|
|
|
import { loadingSvgIcon } from "@/utils/common";
|
|
|
import { cloneDeep } from "lodash-es";
|
|
|
+
|
|
|
const analysisStore = useAnalysisStore();
|
|
|
const reportModuleRef = ref<any>(null);
|
|
|
const getExamName = computed(() => {
|
|
|
return analysisStore.analysisExamInfo.examName || "";
|
|
|
});
|
|
|
-const state = reactive({
|
|
|
- questionGroupDefault: [
|
|
|
- {
|
|
|
- name: "小题分析",
|
|
|
- code: "problem",
|
|
|
- },
|
|
|
- {
|
|
|
- name: "题型分析",
|
|
|
- code: 11,
|
|
|
- },
|
|
|
- {
|
|
|
- name: "错题分析",
|
|
|
- code: "errors",
|
|
|
- },
|
|
|
- {
|
|
|
- name: "客观题分析",
|
|
|
- code: "selectQuestion",
|
|
|
- },
|
|
|
- {
|
|
|
- name: "命题分析",
|
|
|
- code: "proposition",
|
|
|
- },
|
|
|
- ],
|
|
|
- questionGroupList: [], //试题分组标签 动态接口获取
|
|
|
+
|
|
|
+// 1. 为 reactive 添加 <any> 泛型,解决空数组推断为 never[] 及深层对象属性访问报错
|
|
|
+const state = reactive<any>({
|
|
|
groupTitle: "小题分析",
|
|
|
- groupPreviousTitle: "",
|
|
|
- knowledgeLayeredTitle: "", //知识点分层标题
|
|
|
groupName: "", // 分组名称
|
|
|
questionTitle: "", //题目名称
|
|
|
classTitle: "", //班级名称
|
|
|
optionTitle: "", //选项名称
|
|
|
- studentUserName: "", //学生名称
|
|
|
- studentRegistrationCode: "", //学生code
|
|
|
- questionTypesData: {
|
|
|
- chartKey: 0,
|
|
|
- refresh: false,
|
|
|
- data: [],
|
|
|
- tableData: [],
|
|
|
- },
|
|
|
problemAnalysisData: {
|
|
|
chartType: "line_bar_chart", //默认显示折线图柱状图line_bar_chart
|
|
|
chartTypeList: [
|
|
|
- {
|
|
|
- label: "组合图",
|
|
|
- value: "line_bar_chart",
|
|
|
- },
|
|
|
- {
|
|
|
- label: "柱状图",
|
|
|
- value: "vertical_bar",
|
|
|
- },
|
|
|
- {
|
|
|
- label: "雷达图",
|
|
|
- value: "radar_chart",
|
|
|
- },
|
|
|
+ { label: "组合图", value: "line_bar_chart" },
|
|
|
+ { label: "柱状图", value: "vertical_bar" },
|
|
|
+ { label: "雷达图", value: "radar_chart" },
|
|
|
],
|
|
|
legendList: [],
|
|
|
defaultLegendList: [],
|
|
|
@@ -537,27 +498,13 @@ const state = reactive({
|
|
|
questionListIndex: 0, //题目 索引
|
|
|
data: [], //柱状图
|
|
|
}, //小题分析数据
|
|
|
- majorQuestionData: {
|
|
|
- chartType: "line_bar_chart", //默认显示折线图柱状图line_bar_chart
|
|
|
- legendList: [],
|
|
|
- defaultLegendList: [],
|
|
|
- showBarLegendIndex: 1,
|
|
|
- questionListIndex: 0, //题目 索引
|
|
|
- data: [], //柱状图
|
|
|
- }, //分组题目 对应的题目列表
|
|
|
questionScoreStatsData: {
|
|
|
checked: false,
|
|
|
isIndeterminate: true,
|
|
|
markLineData: [], //平均分
|
|
|
chartTypeList: [
|
|
|
- {
|
|
|
- label: "柱状图",
|
|
|
- value: "vertical_bar",
|
|
|
- },
|
|
|
- {
|
|
|
- label: "率差图",
|
|
|
- value: "difference_chart",
|
|
|
- },
|
|
|
+ { label: "柱状图", value: "vertical_bar" },
|
|
|
+ { label: "率差图", value: "difference_chart" },
|
|
|
],
|
|
|
chartType: "vertical_bar", //默认显示率差图vertical_bar
|
|
|
datax: [], //x轴数据
|
|
|
@@ -576,7 +523,6 @@ const state = reactive({
|
|
|
answerScore: [], //答案所能得的分数
|
|
|
questionType: "", //类型
|
|
|
fullMark: "", //满分
|
|
|
- // average:0,//平均分辅助线
|
|
|
tableData: [],
|
|
|
classListIndex: 0, // 索引
|
|
|
}, //小题分析 /第N题 / N班
|
|
|
@@ -603,89 +549,9 @@ const state = reactive({
|
|
|
total: 0, //总数
|
|
|
currentPage: 1, //当前页
|
|
|
}, //小题分析表 + 题目分组分析
|
|
|
- errorQuestionData: {
|
|
|
- tableKey: 0,
|
|
|
- allData: [], //
|
|
|
- gradeValue: "", //选中的年级
|
|
|
- className: "", //选中的年级名称
|
|
|
- type: "",
|
|
|
- gradeData: [], //年级下拉选项
|
|
|
- tableData: [], //错题分析表数据
|
|
|
- }, //错题分析表
|
|
|
- studentPreviousExamData: {
|
|
|
- data: null,
|
|
|
- chartType: "line_chart",
|
|
|
- selectList: [
|
|
|
- {
|
|
|
- value: "standardScore",
|
|
|
- name: "标准分",
|
|
|
- },
|
|
|
- {
|
|
|
- value: "scoreRate",
|
|
|
- name: "得分率",
|
|
|
- },
|
|
|
- {
|
|
|
- value: "classRank",
|
|
|
- name: "班排",
|
|
|
- },
|
|
|
- {
|
|
|
- value: "schoolRank",
|
|
|
- name: "校排",
|
|
|
- },
|
|
|
- {
|
|
|
- value: "examRank",
|
|
|
- name: "联排",
|
|
|
- },
|
|
|
- ],
|
|
|
- selectVal: "standardScore",
|
|
|
- selectName: "标准分",
|
|
|
- lineChartData: {
|
|
|
- datax: [],
|
|
|
- datay: [],
|
|
|
- title: [],
|
|
|
- tooltipData: [],
|
|
|
- },
|
|
|
- barChartData: {
|
|
|
- //柱状图
|
|
|
- legendList: [],
|
|
|
- data: [],
|
|
|
- },
|
|
|
- }, //学生成绩历次考试分析数据
|
|
|
- groupPrevious: {
|
|
|
- loading: false,
|
|
|
- examNameList: [],
|
|
|
- examChartList: [],
|
|
|
- selectedLegendList: [],
|
|
|
- examChartIndex: [],
|
|
|
- headerList: [],
|
|
|
- dataList: [],
|
|
|
- }, //题目分组历次分析(图表数据)
|
|
|
- stuGroupPreviousChart: {
|
|
|
- examNameList: [],
|
|
|
- examChartList: [],
|
|
|
- examChartIndex: [],
|
|
|
- }, //学生组块历次图
|
|
|
- stuGroupPreviousChartStuInfo: {
|
|
|
- studentName: "", //学生姓名搜索条件
|
|
|
- studentCodeList: [],
|
|
|
- }, //学生历次分析图 搜索学生信息
|
|
|
- stuGroupPrevious: {
|
|
|
- total: 0,
|
|
|
- pageNum: 1,
|
|
|
- pageSize: 10,
|
|
|
- headerList: [],
|
|
|
- tableList: [],
|
|
|
- }, //题目分组历次分析学生数据表(分页)
|
|
|
- classNameList: [],
|
|
|
- showBenchTaskSelect: false, //历次考试弹框
|
|
|
- exportLoading: false, // 题型导出loading
|
|
|
- exportErrorLoading: false, // 错题导出loading
|
|
|
chartKey: 0,
|
|
|
-
|
|
|
dataLoading: false,
|
|
|
loadingText: "加载中,请稍后...",
|
|
|
-
|
|
|
- errorPdfLoading: false, //错题导出PDF loading
|
|
|
paperInfo: {
|
|
|
examPaperId: "", //考试科目id
|
|
|
platformNumber: "", //学籍号平台号
|
|
|
@@ -698,7 +564,6 @@ const state = reactive({
|
|
|
platformNumber: "", //学籍号平台号
|
|
|
questionId: "", //题目id
|
|
|
},
|
|
|
- knowledgeInputDialog: false,
|
|
|
dialogData: {
|
|
|
apiName: "questionStudentInfo",
|
|
|
showDialog: false,
|
|
|
@@ -721,22 +586,26 @@ const state = reactive({
|
|
|
cardQuestionId: "", // 批量查看答题卡试题id
|
|
|
cardRegistrationCodeList: [], // 批量查看答题卡学生账号数组
|
|
|
});
|
|
|
-const majorTable = ref(null);
|
|
|
+
|
|
|
+// 2. 为 ref 添加 <any> 泛型
|
|
|
+const majorTable = ref<any>(null);
|
|
|
+
|
|
|
+// 3. 为所有函数参数补充 :any 类型声明,解决隐式 any 报错
|
|
|
//排序
|
|
|
-const ChangeChartOrder = (sortType, legendData, barIndex, number) => {
|
|
|
+const ChangeChartOrder = (sortType: any, legendData: any, barIndex: any, number: any) => {
|
|
|
const isHasEstimatedScore = state.problemAnalysisData.headerList.find(
|
|
|
- (item) => item.prop == "estimatedScore",
|
|
|
+ (item: any) => item.prop == "estimatedScore",
|
|
|
); //是否存在预估满分
|
|
|
const fullVolume = state.problemAnalysisData.questionList.filter(
|
|
|
- (item) => item.showCode == 999,
|
|
|
+ (item: any) => item.showCode == 999,
|
|
|
); //全卷
|
|
|
const questionList = state.problemAnalysisData.questionList.filter(
|
|
|
- (item) => item.showCode != 999,
|
|
|
+ (item: any) => item.showCode != 999,
|
|
|
);
|
|
|
const newBarIndex = isHasEstimatedScore ? barIndex - 1 : barIndex;
|
|
|
if (sortType == "2") {
|
|
|
//从低到高
|
|
|
- questionList.sort(function (a, b) {
|
|
|
+ questionList.sort(function (a: any, b: any) {
|
|
|
return (
|
|
|
(a?.classList?.[newBarIndex]?.questionStats?.scoreRate || 0) -
|
|
|
(b?.classList?.[newBarIndex]?.questionStats?.scoreRate || 0)
|
|
|
@@ -744,7 +613,7 @@ const ChangeChartOrder = (sortType, legendData, barIndex, number) => {
|
|
|
});
|
|
|
} else if (sortType == "3") {
|
|
|
//从高到低
|
|
|
- questionList.sort(function (a, b) {
|
|
|
+ questionList.sort(function (a: any, b: any) {
|
|
|
return (
|
|
|
(b?.classList?.[newBarIndex]?.questionStats?.scoreRate || 0) -
|
|
|
(a?.classList?.[newBarIndex]?.questionStats?.scoreRate || 0)
|
|
|
@@ -752,16 +621,16 @@ const ChangeChartOrder = (sortType, legendData, barIndex, number) => {
|
|
|
});
|
|
|
} else {
|
|
|
//默认排序 按题号排序
|
|
|
- questionList.sort(function (a, b) {
|
|
|
+ questionList.sort(function (a: any, b: any) {
|
|
|
return (a?.showCode || 0) - (b.showCode || 0);
|
|
|
});
|
|
|
}
|
|
|
state.problemAnalysisData.questionList = [...questionList, ...fullVolume];
|
|
|
- let chartData = [],
|
|
|
- chartTitle = [];
|
|
|
- state.problemAnalysisData.questionList.forEach((ques) => {
|
|
|
+ let chartData: any[] = [],
|
|
|
+ chartTitle: any[] = [];
|
|
|
+ state.problemAnalysisData.questionList.forEach((ques: any) => {
|
|
|
const scoreRateArr = ques.classList.map(
|
|
|
- (item) => item?.questionStats?.scoreRate || 0,
|
|
|
+ (item: any) => item?.questionStats?.scoreRate || 0,
|
|
|
);
|
|
|
if (isHasEstimatedScore) {
|
|
|
chartData.push([
|
|
|
@@ -779,7 +648,7 @@ const ChangeChartOrder = (sortType, legendData, barIndex, number) => {
|
|
|
...state.problemAnalysisData.changeHeaderList,
|
|
|
]
|
|
|
: [...state.problemAnalysisData.changeHeaderList];
|
|
|
- newChangeHeaderList.forEach((item) => {
|
|
|
+ newChangeHeaderList.forEach((item: any) => {
|
|
|
chartTitle.push(item.label);
|
|
|
});
|
|
|
chartTitle.unshift("group");
|
|
|
@@ -790,13 +659,15 @@ const ChangeChartOrder = (sortType, legendData, barIndex, number) => {
|
|
|
//小题分析 /第N题
|
|
|
GetQuestionStatsData(0);
|
|
|
};
|
|
|
+
|
|
|
//试题图表切换公共方法
|
|
|
-const ChangeEchartType = (value, prop) => {
|
|
|
+const ChangeEchartType = (value: any, prop: any) => {
|
|
|
if (prop == "problemAnalysisData") {
|
|
|
ChangeChartOrder("1", state.problemAnalysisData.defaultLegendList, "", 1);
|
|
|
}
|
|
|
state[prop].chartType = value;
|
|
|
};
|
|
|
+
|
|
|
//获取小题分析数据
|
|
|
const GetQuestionAnalysisData = () => {
|
|
|
state.problemAnalysisData.data = []; //柱状图折线图 X轴
|
|
|
@@ -805,7 +676,7 @@ const GetQuestionAnalysisData = () => {
|
|
|
...analysisStore.filterObject,
|
|
|
analysisType: 0, //0-小题分析 1大题分析 2-知识点 3-能力点 question_group_code(4,5,6,7,8) 11-题型分析
|
|
|
})
|
|
|
- .then((res) => {
|
|
|
+ .then((res: any) => {
|
|
|
if (
|
|
|
res.code == 200 &&
|
|
|
res.data &&
|
|
|
@@ -825,32 +696,32 @@ const GetQuestionAnalysisData = () => {
|
|
|
|
|
|
state.chartKey++;
|
|
|
//Y轴数据
|
|
|
- let chartData = [];
|
|
|
- let legendList = [];
|
|
|
+ let chartData: any[] = [];
|
|
|
+ let legendList: any[] = [];
|
|
|
const isHasEstimatedScore = state.problemAnalysisData.headerList.find(
|
|
|
- (item) => item.prop == "estimatedScore",
|
|
|
+ (item: any) => item.prop == "estimatedScore",
|
|
|
); //是否存在预估满分
|
|
|
- chartData = questionList.map((item) => {
|
|
|
+ chartData = questionList.map((item: any) => {
|
|
|
return isHasEstimatedScore
|
|
|
? [item.questionName, item.estimatedScoreRate]
|
|
|
: [item.questionName];
|
|
|
});
|
|
|
- questionList.forEach((ques, key) => {
|
|
|
+ questionList.forEach((ques: any, key: number) => {
|
|
|
const scoreRateArr = ques.classList.map(
|
|
|
- (item) => item?.questionStats?.scoreRate || 0,
|
|
|
+ (item: any) => item?.questionStats?.scoreRate || 0,
|
|
|
);
|
|
|
chartData[key].push(...scoreRateArr);
|
|
|
});
|
|
|
- let chartTitle = [],
|
|
|
- titleType = [],
|
|
|
- classSelectLegend = [];
|
|
|
+ let chartTitle: any[] = [],
|
|
|
+ titleType: any[] = [],
|
|
|
+ classSelectLegend: any[] = [];
|
|
|
const newChangeHeaderList = isHasEstimatedScore
|
|
|
? [
|
|
|
{ ...isHasEstimatedScore, isG: false, type: 1 },
|
|
|
...changeHeaderList,
|
|
|
]
|
|
|
: [...changeHeaderList];
|
|
|
- newChangeHeaderList.forEach((item) => {
|
|
|
+ newChangeHeaderList.forEach((item: any) => {
|
|
|
chartTitle.push(item.label);
|
|
|
titleType.push(item.type ? item.type : ""); //1柱状图 2折线
|
|
|
if (
|
|
|
@@ -906,9 +777,6 @@ const GetQuestionAnalysisData = () => {
|
|
|
state.problemAnalysisData.changeHeaderList = [];
|
|
|
state.problemAnalysisData.childHeaderList = [];
|
|
|
|
|
|
- state.majorQuestionData.data = [];
|
|
|
- state.majorQuestionData.legendList = [];
|
|
|
-
|
|
|
state.questionScoreStatsData.datax = [];
|
|
|
state.questionScoreStatsData.datay = [];
|
|
|
state.questionScoreStatsData.dataStackY = [];
|
|
|
@@ -949,12 +817,14 @@ const GetQuestionAnalysisData = () => {
|
|
|
state.dataLoading = false;
|
|
|
});
|
|
|
};
|
|
|
+
|
|
|
// 点击柱状图折线图
|
|
|
-const HandleChartClick = (index, name) => {
|
|
|
+const HandleChartClick = (index: any, name: any) => {
|
|
|
GetQuestionStatsData(index); //小题分析
|
|
|
};
|
|
|
+
|
|
|
// 获取小题分析 /第N题
|
|
|
-const GetQuestionStatsData = (index) => {
|
|
|
+const GetQuestionStatsData = (index: any) => {
|
|
|
const questionData = cloneDeep(state.problemAnalysisData.questionList[index]);
|
|
|
state.problemAnalysisData.questionListIndex = index;
|
|
|
state.questionTitle = questionData?.questionName || "";
|
|
|
@@ -963,9 +833,9 @@ const GetQuestionStatsData = (index) => {
|
|
|
state.questionScoreStatsData.datay = []; // Y轴数据
|
|
|
state.questionScoreStatsData.dataStackY = []; // Y轴数据
|
|
|
state.questionScoreStatsData.tooltipData = []; // 提示框内容
|
|
|
- let dataStackY = [];
|
|
|
+ let dataStackY: any[] = [];
|
|
|
const isHasEstimatedScore = state.problemAnalysisData.headerList.find(
|
|
|
- (item) => item.prop == "estimatedScore",
|
|
|
+ (item: any) => item.prop == "estimatedScore",
|
|
|
); //是否存在预估满分
|
|
|
if (questionData.classList.length > 1) {
|
|
|
const key = state.problemAnalysisData.showBarLegendIndex;
|
|
|
@@ -985,7 +855,7 @@ const GetQuestionStatsData = (index) => {
|
|
|
);
|
|
|
}
|
|
|
//辅助线
|
|
|
- classList.forEach((item, index) => {
|
|
|
+ classList.forEach((item: any, index: number) => {
|
|
|
const keyIndex =
|
|
|
analysisStore.filterObject.classLevel == 0 ||
|
|
|
analysisStore.filterObject.classLevel == 1
|
|
|
@@ -1007,7 +877,7 @@ const GetQuestionStatsData = (index) => {
|
|
|
state.questionScoreStatsData.rate = 60;
|
|
|
}
|
|
|
|
|
|
- questionData.classList.forEach((item) => {
|
|
|
+ questionData.classList.forEach((item: any) => {
|
|
|
state.questionScoreStatsData.datax.push(item.groupName);
|
|
|
state.questionScoreStatsData.datay.push(item.questionStats.scoreRate);
|
|
|
dataStackY.push(item.questionStats.lossRate);
|
|
|
@@ -1027,9 +897,9 @@ const GetQuestionStatsData = (index) => {
|
|
|
const maxValue = max.toFixed(2);
|
|
|
const minValue = min.toFixed(2);
|
|
|
|
|
|
- let maxClass = [],
|
|
|
- minClass = [];
|
|
|
- state.questionScoreStatsData.datay.forEach((item, index) => {
|
|
|
+ let maxClass: any[] = [],
|
|
|
+ minClass: any[] = [];
|
|
|
+ state.questionScoreStatsData.datay.forEach((item: any, index: number) => {
|
|
|
if (Number(item) == Number(maxValue)) {
|
|
|
maxClass.push(state.questionScoreStatsData.datax[index]);
|
|
|
}
|
|
|
@@ -1049,21 +919,23 @@ const GetQuestionStatsData = (index) => {
|
|
|
// 获取小题分析 /第N题 / 第N班
|
|
|
GetQuestionAnswerData(state.problemAnalysisData.showBarLegendIndex);
|
|
|
};
|
|
|
+
|
|
|
//切换 获取小题分析 /第N题 获取第N班答题列表
|
|
|
-const HandleQuestionScoreChartClick = (index) => {
|
|
|
+const HandleQuestionScoreChartClick = (index: any) => {
|
|
|
GetQuestionAnswerData(index + state.problemAnalysisData.showBarLegendIndex);
|
|
|
};
|
|
|
+
|
|
|
// 获取小题分析 /第N题 / 第N班 选项
|
|
|
-const GetQuestionAnswerData = (index) => {
|
|
|
+const GetQuestionAnswerData = (index: any) => {
|
|
|
const isHasEstimatedScore = state.problemAnalysisData.headerList.find(
|
|
|
- (item) => item.prop == "estimatedScore",
|
|
|
+ (item: any) => item.prop == "estimatedScore",
|
|
|
); //是否存在预估满分
|
|
|
const newINdex = isHasEstimatedScore ? index - 1 : index;
|
|
|
const classList =
|
|
|
state.problemAnalysisData.questionList?.[
|
|
|
state.problemAnalysisData.questionListIndex
|
|
|
]?.classList?.[newINdex];
|
|
|
- // console.log("打印获取小题分析班级列表",classList)
|
|
|
+
|
|
|
state.questionAnswerData.answerValue =
|
|
|
state.problemAnalysisData.questionList[
|
|
|
state.problemAnalysisData.questionListIndex
|
|
|
@@ -1085,7 +957,7 @@ const GetQuestionAnswerData = (index) => {
|
|
|
state.questionAnswerData.datax = []; // x轴数据
|
|
|
state.questionAnswerData.datay = []; // Y轴数据
|
|
|
let sum = 0;
|
|
|
- answerList.forEach((item) => {
|
|
|
+ answerList.forEach((item: any) => {
|
|
|
sum += item.studentNum;
|
|
|
state.questionAnswerData.datax.push(item.name);
|
|
|
state.questionAnswerData.datay.push(item.studentNum);
|
|
|
@@ -1123,15 +995,17 @@ const GetQuestionAnswerData = (index) => {
|
|
|
}
|
|
|
}
|
|
|
};
|
|
|
+
|
|
|
// 点击柱状图小题分析 /第N题 / 第N班 选项 获取答题情况
|
|
|
-const HandleQuestionAnswerChartClick = (index, name) => {
|
|
|
+const HandleQuestionAnswerChartClick = (index: any, name: any) => {
|
|
|
if (analysisStore.filterObject.schoolLevel == 2) {
|
|
|
//单校时展示
|
|
|
GetAnswerListByAnswerAndScore(index, name);
|
|
|
}
|
|
|
};
|
|
|
+
|
|
|
//通过答案或者分数查询某题作答情况
|
|
|
-const GetAnswerListByAnswerAndScore = (index, name) => {
|
|
|
+const GetAnswerListByAnswerAndScore = (index: any, name: any) => {
|
|
|
state.optionTitle = name; //选项名称
|
|
|
const question =
|
|
|
state.problemAnalysisData.questionList[
|
|
|
@@ -1139,7 +1013,7 @@ const GetAnswerListByAnswerAndScore = (index, name) => {
|
|
|
];
|
|
|
const classItem = question.classList[state.questionAnswerData.classListIndex];
|
|
|
const classItemKeys = Object.keys(classItem);
|
|
|
- const reportParam = {
|
|
|
+ const reportParam: any = {
|
|
|
...analysisStore.filterObject,
|
|
|
};
|
|
|
Object.keys(analysisStore.filterObject).forEach((item) => {
|
|
|
@@ -1157,7 +1031,7 @@ const GetAnswerListByAnswerAndScore = (index, name) => {
|
|
|
};
|
|
|
state.cardQuestionId = params.questionId; // 批量查看答题卡试题id
|
|
|
state.cardRegistrationCodeList = params.registrationCodeList; // 批量查看答题卡学生账号数组
|
|
|
- queryAnswerListByAnswerAndScore(params).then((res) => {
|
|
|
+ queryAnswerListByAnswerAndScore(params).then((res: any) => {
|
|
|
if (res.code == 200) {
|
|
|
state.majorAnswerData.tableData = res.data || [];
|
|
|
HandleRowClick(
|
|
|
@@ -1170,8 +1044,9 @@ const GetAnswerListByAnswerAndScore = (index, name) => {
|
|
|
}
|
|
|
});
|
|
|
};
|
|
|
+
|
|
|
// 点击某行学生某题作答情况
|
|
|
-const HandleRowClick = (row) => {
|
|
|
+const HandleRowClick = (row: any) => {
|
|
|
console.log("row", row);
|
|
|
if (row?.studentRegistrationCode) {
|
|
|
//答题卡
|
|
|
@@ -1185,12 +1060,13 @@ const HandleRowClick = (row) => {
|
|
|
questionId: question.questionId, //题目id
|
|
|
};
|
|
|
state.majorAnswerData.rowIndex = state.majorAnswerData.tableData.findIndex(
|
|
|
- (item) => item.studentRegistrationCode == row?.studentRegistrationCode,
|
|
|
+ (item: any) => item.studentRegistrationCode == row?.studentRegistrationCode,
|
|
|
);
|
|
|
} else {
|
|
|
state.paperInfos = {};
|
|
|
}
|
|
|
};
|
|
|
+
|
|
|
// 获取项目分析表
|
|
|
const GetMajorTableData = () => {
|
|
|
state.majorTableData.tableKey += 1;
|
|
|
@@ -1200,38 +1076,38 @@ const GetMajorTableData = () => {
|
|
|
state.majorTableData.childHeaderData =
|
|
|
state.problemAnalysisData.childHeaderList;
|
|
|
const headerPropData = state.problemAnalysisData.headerList.map(
|
|
|
- (item) => item.prop,
|
|
|
+ (item: any) => item.prop,
|
|
|
); //表头字段名
|
|
|
const childHeaderPropData = state.problemAnalysisData.childHeaderList.map(
|
|
|
- (item) => item.prop,
|
|
|
+ (item: any) => item.prop,
|
|
|
); //动态表头字段名
|
|
|
- let allTableData = [];
|
|
|
+ let allTableData: any[] = [];
|
|
|
const allList = state.problemAnalysisData.questionTableList;
|
|
|
- allList.forEach((item) => {
|
|
|
- let itemObj = {
|
|
|
+ allList.forEach((item: any) => {
|
|
|
+ let itemObj: any = {
|
|
|
questionId: item?.questionId || "",
|
|
|
knowledgeId: item?.knowledgeId || "",
|
|
|
};
|
|
|
const classList = item.classList;
|
|
|
- headerPropData.forEach((title) => {
|
|
|
+ headerPropData.forEach((title: any) => {
|
|
|
itemObj[title] = Array.isArray(item[title])
|
|
|
? item[title].join("、")
|
|
|
: item[title];
|
|
|
});
|
|
|
|
|
|
- classList.forEach((el) => {
|
|
|
+ classList.forEach((el: any) => {
|
|
|
if (
|
|
|
el.questionStats?.headDataBOList &&
|
|
|
el.questionStats.headDataBOList.length > 0
|
|
|
) {
|
|
|
- el.questionStats.headDataBOList.forEach((bo) => {
|
|
|
+ el.questionStats.headDataBOList.forEach((bo: any) => {
|
|
|
el.questionStats[`${bo.name}Rate`] = bo.rate;
|
|
|
el.questionStats[`${bo.name}StudentNumber`] = bo.studentNumber;
|
|
|
});
|
|
|
} else {
|
|
|
el.questionStats = [];
|
|
|
}
|
|
|
- childHeaderPropData.forEach((field) => {
|
|
|
+ childHeaderPropData.forEach((field: any) => {
|
|
|
itemObj[`${el.groupId}_${field}`] = el.questionStats[field];
|
|
|
});
|
|
|
});
|
|
|
@@ -1243,6 +1119,7 @@ const GetMajorTableData = () => {
|
|
|
//重置表格滚动条位置
|
|
|
ResetTableScroll(); //重置表格滚动条位置
|
|
|
};
|
|
|
+
|
|
|
//重置表格滚动条位置
|
|
|
const ResetTableScroll = () => {
|
|
|
nextTick(() => {
|
|
|
@@ -1257,6 +1134,7 @@ const ResetTableScroll = () => {
|
|
|
}
|
|
|
});
|
|
|
};
|
|
|
+
|
|
|
// 分页获取分析表
|
|
|
const GetPageMajorTableData = () => {
|
|
|
const start =
|
|
|
@@ -1267,8 +1145,9 @@ const GetPageMajorTableData = () => {
|
|
|
end,
|
|
|
);
|
|
|
};
|
|
|
+
|
|
|
//设置表头字段显示隐藏
|
|
|
-const SetEnterHeaderData = (data) => {
|
|
|
+const SetEnterHeaderData = (data: any) => {
|
|
|
if (data.static && data.static.length > 0) {
|
|
|
state.problemAnalysisData.headerList = [...data.static];
|
|
|
}
|
|
|
@@ -1280,8 +1159,9 @@ const SetEnterHeaderData = (data) => {
|
|
|
}
|
|
|
GetMajorTableData();
|
|
|
};
|
|
|
+
|
|
|
// 人员弹框
|
|
|
-const OpenStudentDialog = (childHeader, parent, row) => {
|
|
|
+const OpenStudentDialog = (childHeader: any, parent: any, row: any) => {
|
|
|
if (
|
|
|
(childHeader.prop.indexOf("Count") > -1 ||
|
|
|
childHeader.prop.indexOf("Number") > -1) &&
|
|
|
@@ -1344,51 +1224,55 @@ const OpenStudentDialog = (childHeader, parent, row) => {
|
|
|
state.dialogData.groupTitle = state.groupTitle.replace(/分析/g, "");
|
|
|
}
|
|
|
};
|
|
|
+
|
|
|
// 关闭人员弹框
|
|
|
-const CloseDialog = (val) => {
|
|
|
+const CloseDialog = (val: any) => {
|
|
|
state.dialogData.showDialog = val;
|
|
|
};
|
|
|
+
|
|
|
// 分页获取分析表
|
|
|
-const ChangeCurrentPage = (val) => {
|
|
|
+const ChangeCurrentPage = (val: any) => {
|
|
|
state.majorTableData.currentPage = val;
|
|
|
GetMajorTableData(); //加载分析表格数据
|
|
|
};
|
|
|
+
|
|
|
const ChangePageSize = (val: number) => {
|
|
|
state.majorTableData.pageSize = val;
|
|
|
state.majorTableData.currentPage = 1;
|
|
|
GetMajorTableData(); //加载分析表格数据
|
|
|
};
|
|
|
+
|
|
|
// 导出Excel
|
|
|
const ExportExcel = () => {
|
|
|
// 1. 设置加载状态
|
|
|
reportModuleRef.value?.SetExportLoading?.(true);
|
|
|
// 2. 参数
|
|
|
const examName = getExamName.value;
|
|
|
- let params = {
|
|
|
+ let params: any = {
|
|
|
fileName: `${GetExcelFileName(examName, analysisStore.filterObject, state.groupTitle)}`,
|
|
|
examName: examName, //考试名称
|
|
|
sheetName: state.groupTitle, //sheet页名称
|
|
|
};
|
|
|
const staticHeaderData = state.problemAnalysisData.headerList.filter(
|
|
|
- (item) => item.display,
|
|
|
+ (item: any) => item.display,
|
|
|
);
|
|
|
const childHeaderData = state.problemAnalysisData.childHeaderList.filter(
|
|
|
- (item) => item.display,
|
|
|
+ (item: any) => item.display,
|
|
|
);
|
|
|
const dynamicsHeaderData = state.problemAnalysisData.changeHeaderList.filter(
|
|
|
- (item) => item.display,
|
|
|
+ (item: any) => item.display,
|
|
|
);
|
|
|
params.staticHeaderData = staticHeaderData;
|
|
|
params.childHeaderData = childHeaderData;
|
|
|
params.dynamicsHeaderData = dynamicsHeaderData;
|
|
|
- let dataList = [];
|
|
|
- state.majorTableData.allTableData.forEach((item) => {
|
|
|
- const rowData = [];
|
|
|
- staticHeaderData.forEach((header) => {
|
|
|
+ let dataList: any[] = [];
|
|
|
+ state.majorTableData.allTableData.forEach((item: any) => {
|
|
|
+ const rowData: any[] = [];
|
|
|
+ staticHeaderData.forEach((header: any) => {
|
|
|
rowData.push(item?.[header.prop] || "-");
|
|
|
});
|
|
|
- dynamicsHeaderData.forEach((parent) => {
|
|
|
- childHeaderData.forEach((child) => {
|
|
|
+ dynamicsHeaderData.forEach((parent: any) => {
|
|
|
+ childHeaderData.forEach((child: any) => {
|
|
|
const itemValue = item[`${parent.prop}_${child.prop}`];
|
|
|
if (child.prop.indexOf("Rate") > -1) {
|
|
|
const rate = itemValue ? `${itemValue}%` : "-";
|
|
|
@@ -1406,22 +1290,25 @@ const ExportExcel = () => {
|
|
|
reportModuleRef.value?.SetExportLoading?.(false);
|
|
|
});
|
|
|
};
|
|
|
+
|
|
|
//设置表头样式
|
|
|
-const HeaderRowStyle = ({ row, rowIndex }) => {
|
|
|
+const HeaderRowStyle = ({ row, rowIndex }: any) => {
|
|
|
if (rowIndex === 1) {
|
|
|
return {
|
|
|
display: "none",
|
|
|
};
|
|
|
}
|
|
|
};
|
|
|
-const TableRowClassName = ({ row, rowIndex }) => {
|
|
|
+
|
|
|
+const TableRowClassName = ({ row, rowIndex }: any) => {
|
|
|
if (rowIndex === state.majorAnswerData.rowIndex) {
|
|
|
return "current-row";
|
|
|
}
|
|
|
return "";
|
|
|
};
|
|
|
+
|
|
|
//查看答题卡
|
|
|
-const handleClick = (row) => {
|
|
|
+const handleClick = (row: any) => {
|
|
|
state.paperInfo = {
|
|
|
examPaperId: analysisStore.filterObject.subjectId, //考试科目id
|
|
|
platformNumber: row.studentRegistrationCode, //学籍号平台号
|
|
|
@@ -1430,44 +1317,33 @@ const handleClick = (row) => {
|
|
|
state.paperTitle = `${getExamName.value}-${analysisStore.filterObject.subjectName}-${row.className}-${row.studentUserName}`; //学生姓名
|
|
|
state.showStudentPaperDialog = true;
|
|
|
};
|
|
|
+
|
|
|
//更新弹窗状态
|
|
|
const UpdateModelValue = (val: boolean) => {
|
|
|
state.showStudentPaperDialog = val;
|
|
|
};
|
|
|
+
|
|
|
//批量查看小题答题卡
|
|
|
const VisibleQuestionCard = () => {
|
|
|
state.showQuestionCardDialog = true;
|
|
|
};
|
|
|
+
|
|
|
//关闭弹框
|
|
|
const CloseQuestionCardDialog = () => {
|
|
|
state.showQuestionCardDialog = false;
|
|
|
};
|
|
|
+
|
|
|
const pageInit = () => {
|
|
|
state.problemAnalysisData.chartTypeList =
|
|
|
analysisStore.filterObject.classLevel != 2
|
|
|
? [
|
|
|
- {
|
|
|
- label: "组合图",
|
|
|
- value: "line_bar_chart",
|
|
|
- },
|
|
|
- {
|
|
|
- label: "柱状图",
|
|
|
- value: "vertical_bar",
|
|
|
- },
|
|
|
- {
|
|
|
- label: "雷达图",
|
|
|
- value: "radar_chart",
|
|
|
- },
|
|
|
+ { label: "组合图", value: "line_bar_chart" },
|
|
|
+ { label: "柱状图", value: "vertical_bar" },
|
|
|
+ { label: "雷达图", value: "radar_chart" },
|
|
|
]
|
|
|
: [
|
|
|
- {
|
|
|
- label: "柱状图",
|
|
|
- value: "vertical_bar",
|
|
|
- },
|
|
|
- {
|
|
|
- label: "雷达图",
|
|
|
- value: "radar_chart",
|
|
|
- },
|
|
|
+ { label: "柱状图", value: "vertical_bar" },
|
|
|
+ { label: "雷达图", value: "radar_chart" },
|
|
|
];
|
|
|
state.problemAnalysisData.chartType =
|
|
|
analysisStore.filterObject.classLevel != 2
|
|
|
@@ -1478,6 +1354,7 @@ const pageInit = () => {
|
|
|
state.majorAnswerData.rowIndex = 0;
|
|
|
GetQuestionAnalysisData(); //获取小题分析数据
|
|
|
};
|
|
|
+
|
|
|
// 监听筛选条件
|
|
|
watch(
|
|
|
() => analysisStore.filterObject,
|