|
@@ -119,7 +119,10 @@ let activeKey = $ref(["0"]);
|
|
// const store = useMainStore();
|
|
// const store = useMainStore();
|
|
|
|
|
|
// let rootOrgId = $ref(undefined as unknown as number);
|
|
// let rootOrgId = $ref(undefined as unknown as number);
|
|
-let courseId = $ref(undefined as undefined | number);
|
|
|
|
|
|
+// let courseId = $ref(undefined as undefined | number);
|
|
|
|
+const props = defineProps<{
|
|
|
|
+ courseId?: number;
|
|
|
|
+}>();
|
|
const route = useRoute();
|
|
const route = useRoute();
|
|
const projectId = +route.params.projectId;
|
|
const projectId = +route.params.projectId;
|
|
|
|
|
|
@@ -127,7 +130,7 @@ let courses = $ref<SasCourse[]>([]);
|
|
async function fetchData() {
|
|
async function fetchData() {
|
|
const res = await getSasCourseList({
|
|
const res = await getSasCourseList({
|
|
projectId,
|
|
projectId,
|
|
- courseId,
|
|
|
|
|
|
+ courseId: props.courseId,
|
|
});
|
|
});
|
|
// console.log(Object.keys(JSON.parse(res.data[0].scoreRange)));
|
|
// console.log(Object.keys(JSON.parse(res.data[0].scoreRange)));
|
|
res.data = res.data.map((v) => {
|
|
res.data = res.data.map((v) => {
|
|
@@ -157,7 +160,7 @@ async function fetchData() {
|
|
v.scoreRangeTotal = acc;
|
|
v.scoreRangeTotal = acc;
|
|
return v;
|
|
return v;
|
|
});
|
|
});
|
|
- console.log(res.data);
|
|
|
|
|
|
+ // console.log(res.data);
|
|
courses = res.data;
|
|
courses = res.data;
|
|
}
|
|
}
|
|
|
|
|
|
@@ -165,6 +168,7 @@ onMounted(async () => {
|
|
// rootOrgId = store.userInfo.rootOrgId;
|
|
// rootOrgId = store.userInfo.rootOrgId;
|
|
await fetchData();
|
|
await fetchData();
|
|
});
|
|
});
|
|
|
|
+watch(() => [props.courseId], fetchData);
|
|
|
|
|
|
let scoreGap = $ref(10);
|
|
let scoreGap = $ref(10);
|
|
|
|
|
|
@@ -288,7 +292,7 @@ function openModal2() {
|
|
}
|
|
}
|
|
|
|
|
|
function segementsLine(course: SasCourse) {
|
|
function segementsLine(course: SasCourse) {
|
|
- console.log(course);
|
|
|
|
|
|
+ // console.log(course);
|
|
return {
|
|
return {
|
|
title: {
|
|
title: {
|
|
text: "频率",
|
|
text: "频率",
|
|
@@ -312,7 +316,7 @@ function segementsLine(course: SasCourse) {
|
|
}
|
|
}
|
|
|
|
|
|
function rangeSegementsLine(course: SasCourse) {
|
|
function rangeSegementsLine(course: SasCourse) {
|
|
- console.log(course);
|
|
|
|
|
|
+ // console.log(course);
|
|
return {
|
|
return {
|
|
title: {
|
|
title: {
|
|
text: "频率",
|
|
text: "频率",
|