diff --git a/src/pages/view/homeSchool/ChengJiFenXi.vue b/src/pages/view/homeSchool/ChengJiFenXi.vue index 4493f0c..567cb25 100644 --- a/src/pages/view/homeSchool/ChengJiFenXi.vue +++ b/src/pages/view/homeSchool/ChengJiFenXi.vue @@ -39,7 +39,7 @@ @@ -134,7 +134,7 @@ const tjglData = ref({ jgl: 0, jgrs: 0, }); -const bjPjList = ref([]); +const bjFxList = ref([]); const djRsList = ref([]); // --- API Functions --- @@ -194,7 +194,7 @@ const getBjKscjKmData = async ( tjglData.value.jgl = res.result.jgl || 0; // 处理班级平均分列表数据,传递给CjBjNjPjf组件 - bjPjList.value = res.result.bjPjList || []; + bjFxList.value = res.result.bjFxList || []; // 处理等级段数据列表,传递给CjZfFs和CjZfDj组件 djRsList.value = res.result.djRsList || []; diff --git a/src/pages/view/homeSchool/components/CjBjNjPjf.vue b/src/pages/view/homeSchool/components/CjBjNjPjf.vue index fd07f91..b937922 100644 --- a/src/pages/view/homeSchool/components/CjBjNjPjf.vue +++ b/src/pages/view/homeSchool/components/CjBjNjPjf.vue @@ -34,12 +34,12 @@ interface BjPjInfo { // --- Props --- interface Props { - bjPjList?: BjPjInfo[]; + bjFxList?: BjPjInfo[]; currentBjId?: string | number; } const props = withDefaults(defineProps(), { - bjPjList: () => [], + bjFxList: () => [], currentBjId: "", }); @@ -75,17 +75,17 @@ const drawLineChart = () => { // 使用后端返回的班级平均分数据 const lineData = { - categories: props.bjPjList.map((bj) => { + categories: props.bjFxList.map((bj) => { const label = bj.bjmc || bj.njmc + bj.bjmc; return label; }), series: [ { name: "班级平均分", - data: props.bjPjList.map((bj) => bj.fs), + data: props.bjFxList.map((bj) => bj.fs), color: ["#ea7ccc"], textColorFormatter: (item: any, index: number, opts: any) => { - const bj = props.bjPjList[index]; + const bj = props.bjFxList[index]; if (bj && bj.bjId === props.currentBjId) { return "#1890ff"; // 当前班级标签使用蓝色 } @@ -135,7 +135,7 @@ const drawLineChart = () => { index: number, opts: any ) => { - const bj = props.bjPjList[index]; + const bj = props.bjFxList[index]; if (bj && bj.bjId === props.currentBjId) { return "#1890ff"; // 当前班级标签使用蓝色 } @@ -148,7 +148,7 @@ const drawLineChart = () => { index: number, opts: any ) => { - const bj = props.bjPjList[index]; + const bj = props.bjFxList[index]; if (bj && bj.bjId === props.currentBjId) { return "#1890ff"; // 当前班级数据标签使用蓝色 } @@ -181,11 +181,11 @@ const drawLineChart = () => { }; // --- Watch --- -// 监听bjPjList变化,重新绘制图表 +// 监听bjFxList变化,重新绘制图表 watch( - () => props.bjPjList, + () => props.bjFxList, () => { - if (props.bjPjList && props.bjPjList.length > 0) { + if (props.bjFxList && props.bjFxList.length > 0) { drawLineChart(); } },