|
@@ -13,14 +13,13 @@
|
|
|
|
|
|
<div class="part-box">
|
|
<div class="part-box">
|
|
<a-space class="part-action" :size="6">
|
|
<a-space class="part-action" :size="6">
|
|
- <!-- TODO:上传下载 -->
|
|
|
|
- <a-button type="text" @click="importModalVisible = true">
|
|
|
|
|
|
+ <a-button type="text" @click="toImportScoreLine">
|
|
<template #icon>
|
|
<template #icon>
|
|
<svg-icon name="course-score"></svg-icon>
|
|
<svg-icon name="course-score"></svg-icon>
|
|
</template>
|
|
</template>
|
|
科目分数线
|
|
科目分数线
|
|
</a-button>
|
|
</a-button>
|
|
- <a-button type="text" @click="handleExport">
|
|
|
|
|
|
+ <a-button type="text" @click="toImportCollege">
|
|
<template #icon>
|
|
<template #icon>
|
|
<svg-icon name="course-college"></svg-icon>
|
|
<svg-icon name="course-college"></svg-icon>
|
|
</template>
|
|
</template>
|
|
@@ -114,40 +113,32 @@
|
|
</a-form>
|
|
</a-form>
|
|
</a-modal>
|
|
</a-modal>
|
|
|
|
|
|
- <a-modal
|
|
|
|
- v-model:open="importModalVisible"
|
|
|
|
- title="单科线批量导入"
|
|
|
|
- okText="确定"
|
|
|
|
- cancelText="取消"
|
|
|
|
- @ok="handleImport"
|
|
|
|
- >
|
|
|
|
- <a-form>
|
|
|
|
- <a-form-item label="文件地址">
|
|
|
|
- <input id="file-input" :multiple="false" type="file" />
|
|
|
|
- </a-form-item>
|
|
|
|
- <a-form-item label="下载模板">
|
|
|
|
- <a-button class="download-tpl-btn" @click="downloadTpl"
|
|
|
|
- >下载模板</a-button
|
|
|
|
- >
|
|
|
|
- </a-form-item>
|
|
|
|
- </a-form>
|
|
|
|
- </a-modal>
|
|
|
|
|
|
+ <ImportScoreLine
|
|
|
|
+ ref="importScoreLineRef"
|
|
|
|
+ :project-id="projectId"
|
|
|
|
+ @modified="search"
|
|
|
|
+ />
|
|
|
|
+ <ImportCollege
|
|
|
|
+ ref="importCollegeRef"
|
|
|
|
+ :project-id="projectId"
|
|
|
|
+ @modified="search"
|
|
|
|
+ />
|
|
</div>
|
|
</div>
|
|
</template>
|
|
</template>
|
|
|
|
|
|
<script setup lang="ts">
|
|
<script setup lang="ts">
|
|
import {
|
|
import {
|
|
- exportProjectParams,
|
|
|
|
getProjectCourseList,
|
|
getProjectCourseList,
|
|
- importProjectParams,
|
|
|
|
updateProjectCourse,
|
|
updateProjectCourse,
|
|
} from "@/api/projectParamsManagementPage";
|
|
} from "@/api/projectParamsManagementPage";
|
|
import { useMainStore } from "@/store";
|
|
import { useMainStore } from "@/store";
|
|
import { ProjectCourse } from "@/types";
|
|
import { ProjectCourse } from "@/types";
|
|
-import { downloadFileURL, goBack } from "@/utils/utils";
|
|
|
|
|
|
+import { goBack } from "@/utils/utils";
|
|
import { message } from "ant-design-vue";
|
|
import { message } from "ant-design-vue";
|
|
-import { watch, onMounted, ref, reactive, toRaw, h } from "vue";
|
|
|
|
|
|
+import { watch, onMounted, ref, reactive, toRaw } from "vue";
|
|
import { useRoute } from "vue-router";
|
|
import { useRoute } from "vue-router";
|
|
|
|
+import ImportScoreLine from "./ImportScoreLine.vue";
|
|
|
|
+import ImportCollege from "./ImportCollege.vue";
|
|
|
|
|
|
const store = useMainStore();
|
|
const store = useMainStore();
|
|
store.currentLocation = "项目列表 / 参数配置";
|
|
store.currentLocation = "项目列表 / 参数配置";
|
|
@@ -192,6 +183,10 @@ const columns = [
|
|
title: "科目",
|
|
title: "科目",
|
|
dataIndex: "course",
|
|
dataIndex: "course",
|
|
},
|
|
},
|
|
|
|
+ {
|
|
|
|
+ title: "学院",
|
|
|
|
+ dataIndex: "college",
|
|
|
|
+ },
|
|
{
|
|
{
|
|
title: "起始计算分",
|
|
title: "起始计算分",
|
|
dataIndex: "startScore",
|
|
dataIndex: "startScore",
|
|
@@ -204,18 +199,6 @@ const columns = [
|
|
title: "复试科目线",
|
|
title: "复试科目线",
|
|
dataIndex: "retestScore",
|
|
dataIndex: "retestScore",
|
|
},
|
|
},
|
|
- // {
|
|
|
|
- // title: "国家总分线",
|
|
|
|
- // dataIndex: "nationalTotalScore",
|
|
|
|
- // },
|
|
|
|
- // {
|
|
|
|
- // title: "复试总分线",
|
|
|
|
- // dataIndex: "retestTotalScore",
|
|
|
|
- // },
|
|
|
|
- // {
|
|
|
|
- // title: "总分满分线",
|
|
|
|
- // dataIndex: "totalScoreLine",
|
|
|
|
- // },
|
|
|
|
{
|
|
{
|
|
title: "操作",
|
|
title: "操作",
|
|
dataIndex: "action",
|
|
dataIndex: "action",
|
|
@@ -224,7 +207,6 @@ const columns = [
|
|
];
|
|
];
|
|
|
|
|
|
onMounted(async () => {
|
|
onMounted(async () => {
|
|
- // rootOrgId = store.userInfo.rootOrgId;
|
|
|
|
await search();
|
|
await search();
|
|
});
|
|
});
|
|
|
|
|
|
@@ -258,39 +240,13 @@ const initProject = <ProjectCourse>(<unknown>{
|
|
const projectObj = reactive({ ...initProject });
|
|
const projectObj = reactive({ ...initProject });
|
|
|
|
|
|
/** <handleImport> */
|
|
/** <handleImport> */
|
|
-let importModalVisible = $ref<boolean>(false);
|
|
|
|
-async function handleImport() {
|
|
|
|
- const files = (document.querySelector("#file-input") as HTMLInputElement)
|
|
|
|
- .files;
|
|
|
|
- const fileToImport = files && files[0];
|
|
|
|
- if (!fileToImport) {
|
|
|
|
- void message.warn({ content: "请选择文件" });
|
|
|
|
- return;
|
|
|
|
- }
|
|
|
|
- (document.querySelector("#file-input") as HTMLInputElement).value = "";
|
|
|
|
- const res = await importProjectParams(projectId, fileToImport);
|
|
|
|
- if (!res.data.hasError) {
|
|
|
|
- importModalVisible = false;
|
|
|
|
- void message.success({ content: "导入成功" });
|
|
|
|
- await clickSearch();
|
|
|
|
- } else {
|
|
|
|
- // eslint-disable-next-line
|
|
|
|
- const msg = res.data.failRecords.map((v) =>
|
|
|
|
- h("div", `行号:${v.lineNum}, 错误:${v.msg}`)
|
|
|
|
- );
|
|
|
|
- void message.error({
|
|
|
|
- content: h("span", ["导入失败", ...msg]),
|
|
|
|
- });
|
|
|
|
- }
|
|
|
|
|
|
+const importScoreLineRef = ref();
|
|
|
|
+function toImportScoreLine() {
|
|
|
|
+ importScoreLineRef.value?.open();
|
|
}
|
|
}
|
|
-/** </handleImport> */
|
|
|
|
-
|
|
|
|
-async function handleExport() {
|
|
|
|
- await exportProjectParams(projectId);
|
|
|
|
- void message.success({ content: "导出成功" });
|
|
|
|
-}
|
|
|
|
-
|
|
|
|
-async function downloadTpl() {
|
|
|
|
- await downloadFileURL("/api/ess/projectCourse/template");
|
|
|
|
|
|
+const importCollegeRef = ref();
|
|
|
|
+function toImportCollege() {
|
|
|
|
+ importCollegeRef.value?.open();
|
|
}
|
|
}
|
|
|
|
+/** </handleImport> */
|
|
</script>
|
|
</script>
|