调整成绩分析

This commit is contained in:
ywyonui 2025-08-23 01:35:23 +08:00
parent 720bd62f84
commit 22d1f59efe
2 changed files with 13 additions and 13 deletions

View File

@ -39,7 +39,7 @@
<!-- 6. 本班与年级平均分对比分析图表 --> <!-- 6. 本班与年级平均分对比分析图表 -->
<CjBjNjPjf <CjBjNjPjf
v-model:selected-km-id="xzkmId" v-model:selected-km-id="xzkmId"
:bj-pj-list="bjPjList" :bj-pj-list="bjFxList"
:current-bj-id="xzbjId" :current-bj-id="xzbjId"
/> />
@ -134,7 +134,7 @@ const tjglData = ref<TjglData>({
jgl: 0, jgl: 0,
jgrs: 0, jgrs: 0,
}); });
const bjPjList = ref<BjPjInfo[]>([]); const bjFxList = ref<BjPjInfo[]>([]);
const djRsList = ref<DjRsInfo[]>([]); const djRsList = ref<DjRsInfo[]>([]);
// --- API Functions --- // --- API Functions ---
@ -194,7 +194,7 @@ const getBjKscjKmData = async (
tjglData.value.jgl = res.result.jgl || 0; tjglData.value.jgl = res.result.jgl || 0;
// CjBjNjPjf // CjBjNjPjf
bjPjList.value = res.result.bjPjList || []; bjFxList.value = res.result.bjFxList || [];
// CjZfFsCjZfDj // CjZfFsCjZfDj
djRsList.value = res.result.djRsList || []; djRsList.value = res.result.djRsList || [];

View File

@ -34,12 +34,12 @@ interface BjPjInfo {
// --- Props --- // --- Props ---
interface Props { interface Props {
bjPjList?: BjPjInfo[]; bjFxList?: BjPjInfo[];
currentBjId?: string | number; currentBjId?: string | number;
} }
const props = withDefaults(defineProps<Props>(), { const props = withDefaults(defineProps<Props>(), {
bjPjList: () => [], bjFxList: () => [],
currentBjId: "", currentBjId: "",
}); });
@ -75,17 +75,17 @@ const drawLineChart = () => {
// 使 // 使
const lineData = { const lineData = {
categories: props.bjPjList.map((bj) => { categories: props.bjFxList.map((bj) => {
const label = bj.bjmc || bj.njmc + bj.bjmc; const label = bj.bjmc || bj.njmc + bj.bjmc;
return label; return label;
}), }),
series: [ series: [
{ {
name: "班级平均分", name: "班级平均分",
data: props.bjPjList.map((bj) => bj.fs), data: props.bjFxList.map((bj) => bj.fs),
color: ["#ea7ccc"], color: ["#ea7ccc"],
textColorFormatter: (item: any, index: number, opts: any) => { textColorFormatter: (item: any, index: number, opts: any) => {
const bj = props.bjPjList[index]; const bj = props.bjFxList[index];
if (bj && bj.bjId === props.currentBjId) { if (bj && bj.bjId === props.currentBjId) {
return "#1890ff"; // 使 return "#1890ff"; // 使
} }
@ -135,7 +135,7 @@ const drawLineChart = () => {
index: number, index: number,
opts: any opts: any
) => { ) => {
const bj = props.bjPjList[index]; const bj = props.bjFxList[index];
if (bj && bj.bjId === props.currentBjId) { if (bj && bj.bjId === props.currentBjId) {
return "#1890ff"; // 使 return "#1890ff"; // 使
} }
@ -148,7 +148,7 @@ const drawLineChart = () => {
index: number, index: number,
opts: any opts: any
) => { ) => {
const bj = props.bjPjList[index]; const bj = props.bjFxList[index];
if (bj && bj.bjId === props.currentBjId) { if (bj && bj.bjId === props.currentBjId) {
return "#1890ff"; // 使 return "#1890ff"; // 使
} }
@ -181,11 +181,11 @@ const drawLineChart = () => {
}; };
// --- Watch --- // --- Watch ---
// bjPjList // bjFxList
watch( watch(
() => props.bjPjList, () => props.bjFxList,
() => { () => {
if (props.bjPjList && props.bjPjList.length > 0) { if (props.bjFxList && props.bjFxList.length > 0) {
drawLineChart(); drawLineChart();
} }
}, },