调整成绩分析
This commit is contained in:
parent
720bd62f84
commit
22d1f59efe
@ -39,7 +39,7 @@
|
||||
<!-- 6. 本班与年级平均分对比分析图表 -->
|
||||
<CjBjNjPjf
|
||||
v-model:selected-km-id="xzkmId"
|
||||
:bj-pj-list="bjPjList"
|
||||
:bj-pj-list="bjFxList"
|
||||
:current-bj-id="xzbjId"
|
||||
/>
|
||||
|
||||
@ -134,7 +134,7 @@ const tjglData = ref<TjglData>({
|
||||
jgl: 0,
|
||||
jgrs: 0,
|
||||
});
|
||||
const bjPjList = ref<BjPjInfo[]>([]);
|
||||
const bjFxList = ref<BjPjInfo[]>([]);
|
||||
const djRsList = ref<DjRsInfo[]>([]);
|
||||
|
||||
// --- 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 || [];
|
||||
|
||||
@ -34,12 +34,12 @@ interface BjPjInfo {
|
||||
|
||||
// --- Props ---
|
||||
interface Props {
|
||||
bjPjList?: BjPjInfo[];
|
||||
bjFxList?: BjPjInfo[];
|
||||
currentBjId?: string | number;
|
||||
}
|
||||
|
||||
const props = withDefaults(defineProps<Props>(), {
|
||||
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();
|
||||
}
|
||||
},
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user