|
@@ -25,9 +25,11 @@
|
|
|
<th>本科目难度</th>
|
|
|
<th>占总分权重(%)</th>
|
|
|
</tr>
|
|
|
- <tr v-for="(item2, index) in item.totalScoreRange" :key="index">
|
|
|
+ <tr v-for="(item2, index2) in item.totalScoreRange" :key="index2">
|
|
|
<td>
|
|
|
- {{ scoreTitle(item.totalScoreRangeTitle[index]) || "全体考生" }}
|
|
|
+ {{
|
|
|
+ scoreTitle(item.totalScoreRangeTitle[index2]) || "全体考生"
|
|
|
+ }}
|
|
|
</td>
|
|
|
<td v-number-to-percent>
|
|
|
{{ item2.countRate }}
|
|
@@ -62,7 +64,7 @@
|
|
|
</template>
|
|
|
|
|
|
<script setup lang="ts">
|
|
|
-import { useMainStore } from "@/store";
|
|
|
+// import { useMainStore } from "@/store";
|
|
|
import { onMounted } from "vue";
|
|
|
import { useRoute } from "vue-router";
|
|
|
import {
|
|
@@ -72,32 +74,37 @@ import {
|
|
|
import EventBus from "@/plugins/eventBus";
|
|
|
import { message } from "ant-design-vue";
|
|
|
import { RANGE_POINT_TYPE } from "@/constants/constants";
|
|
|
+import { RangeConfig, SasCourse } from "@/types";
|
|
|
|
|
|
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);
|
|
|
const route = useRoute();
|
|
|
const projectId = +route.params.projectId;
|
|
|
|
|
|
-let data = $ref([]);
|
|
|
+let data = $ref<SasCourse[]>([]);
|
|
|
async function fetchData() {
|
|
|
const res = await getSasCourseList({
|
|
|
projectId,
|
|
|
courseId,
|
|
|
});
|
|
|
// console.log(Object.keys(JSON.parse(res.data[0].scoreRange)));
|
|
|
- res.data = res.data.map((v: any) => {
|
|
|
- v.totalScoreRange = JSON.parse(v.totalScoreRange || "{}");
|
|
|
- v.totalScoreRangeTitle = JSON.parse(v.totalScoreRangeTitle || "{}");
|
|
|
+ res.data = res.data.map((v) => {
|
|
|
+ v.totalScoreRange = JSON.parse(
|
|
|
+ <string>(<unknown>v.totalScoreRange) || "{}"
|
|
|
+ );
|
|
|
+ v.totalScoreRangeTitle = JSON.parse(
|
|
|
+ <string>(<unknown>v.totalScoreRangeTitle) || "{}"
|
|
|
+ );
|
|
|
return v;
|
|
|
});
|
|
|
data = res.data;
|
|
|
}
|
|
|
|
|
|
onMounted(async () => {
|
|
|
- rootOrgId = store.userInfo.rootOrgId;
|
|
|
+ // rootOrgId = store.userInfo.rootOrgId;
|
|
|
await fetchData();
|
|
|
});
|
|
|
|
|
@@ -106,7 +113,7 @@ let selectedCourseId = $ref(0);
|
|
|
|
|
|
let rangeConfigRef = $ref(null);
|
|
|
|
|
|
-const openRangeConfigModal = (item: any) => {
|
|
|
+const openRangeConfigModal = (item: SasCourse) => {
|
|
|
selectedCourseId = item.courseId;
|
|
|
selectedRangeConfig = JSON.parse(item.totalRangeConfig || "0") || [
|
|
|
{
|
|
@@ -115,7 +122,8 @@ const openRangeConfigModal = (item: any) => {
|
|
|
adjustScore: 0,
|
|
|
},
|
|
|
];
|
|
|
- // @ts-ignore
|
|
|
+ // @ts-ignore https://github.com/vuejs/vue-next/issues/4397
|
|
|
+ // eslint-disable-next-line @typescript-eslint/no-unsafe-call
|
|
|
rangeConfigRef.showModal();
|
|
|
};
|
|
|
|
|
@@ -128,7 +136,7 @@ async function handleRangeConfigUpdate(rangeConfig: any) {
|
|
|
void message.success({ content: "操作成功" });
|
|
|
}
|
|
|
|
|
|
-function scoreTitle(rangeConfig: any) {
|
|
|
+function scoreTitle(rangeConfig: RangeConfig) {
|
|
|
if (!rangeConfig) return false;
|
|
|
if (rangeConfig.type === "ZERO") return "0-";
|
|
|
|