调整成绩分析
This commit is contained in:
parent
720bd62f84
commit
22d1f59efe
@ -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 || [];
|
||||||
|
|
||||||
// 处理等级段数据列表,传递给CjZfFs和CjZfDj组件
|
// 处理等级段数据列表,传递给CjZfFs和CjZfDj组件
|
||||||
djRsList.value = res.result.djRsList || [];
|
djRsList.value = res.result.djRsList || [];
|
||||||
|
|||||||
@ -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();
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user