|
@@ -8,7 +8,9 @@
|
|
<a-table :data-source="dataList" :columns="columns" size="middle" bordered>
|
|
<a-table :data-source="dataList" :columns="columns" size="middle" bordered>
|
|
<template #bodyCell="{ column, record }">
|
|
<template #bodyCell="{ column, record }">
|
|
<template v-if="column.key === 'operation'">
|
|
<template v-if="column.key === 'operation'">
|
|
- <qm-button type="link" @click="">导入</qm-button>
|
|
|
|
|
|
+ <qm-button type="link" @click="openImportDialog(record)"
|
|
|
|
+ >导入</qm-button
|
|
|
|
+ >
|
|
<qm-button type="link" @click="clear(record)">清空</qm-button>
|
|
<qm-button type="link" @click="clear(record)">清空</qm-button>
|
|
</template>
|
|
</template>
|
|
</template>
|
|
</template>
|
|
@@ -17,6 +19,11 @@
|
|
v-model="showSetParamsDialog"
|
|
v-model="showSetParamsDialog"
|
|
v-if="showSetParamsDialog"
|
|
v-if="showSetParamsDialog"
|
|
></SetImportParamsDialog>
|
|
></SetImportParamsDialog>
|
|
|
|
+ <StuImportFileDialog
|
|
|
|
+ v-model="showStuImportFileDialog"
|
|
|
|
+ v-if="showStuImportFileDialog"
|
|
|
|
+ >
|
|
|
|
+ </StuImportFileDialog>
|
|
</div>
|
|
</div>
|
|
</template>
|
|
</template>
|
|
<script name="StuImport" lang="ts" setup>
|
|
<script name="StuImport" lang="ts" setup>
|
|
@@ -25,10 +32,26 @@ import SetImportParamsDialog from "./SetImportParamsDialog.vue";
|
|
import useTable from "@/hooks/useTable";
|
|
import useTable from "@/hooks/useTable";
|
|
import { getStuList } from "@/ap/baseDataConfig";
|
|
import { getStuList } from "@/ap/baseDataConfig";
|
|
import { useUserStore } from "@/store";
|
|
import { useUserStore } from "@/store";
|
|
|
|
+import { getStuImportSet, clearStuData } from "@/ap/baseDataConfig";
|
|
|
|
+import StuImportFileDialog from "./StuImportFileDialog.vue";
|
|
import type { TableColumnsType } from "@qmth/ui";
|
|
import type { TableColumnsType } from "@qmth/ui";
|
|
|
|
|
|
const userStore = useUserStore();
|
|
const userStore = useUserStore();
|
|
const showSetParamsDialog = ref(false);
|
|
const showSetParamsDialog = ref(false);
|
|
|
|
+const showStuImportFileDialog = ref(false);
|
|
|
|
+const year = ref();
|
|
|
|
+const yearHalf = ref();
|
|
|
|
+
|
|
|
|
+const _getStuImportSet = () => {
|
|
|
|
+ getStuImportSet({ examId: userStore.curExam?.id as number }).then(
|
|
|
|
+ (res: any) => {
|
|
|
|
+ console.log("mock 考生导入参数设置获取", res);
|
|
|
|
+ year.value = res?.year;
|
|
|
|
+ yearHalf.value = res?.yearHalf;
|
|
|
|
+ }
|
|
|
|
+ );
|
|
|
|
+};
|
|
|
|
+_getStuImportSet();
|
|
const fields = ref([
|
|
const fields = ref([
|
|
{
|
|
{
|
|
type: "button",
|
|
type: "button",
|
|
@@ -53,15 +76,15 @@ const columns: TableColumnsType = [
|
|
},
|
|
},
|
|
{
|
|
{
|
|
title: "科目代码",
|
|
title: "科目代码",
|
|
- dataIndex: "a",
|
|
|
|
|
|
+ dataIndex: "subjectCode",
|
|
},
|
|
},
|
|
{
|
|
{
|
|
title: "科目名称",
|
|
title: "科目名称",
|
|
- dataIndex: "b",
|
|
|
|
|
|
+ dataIndex: "subjectName",
|
|
},
|
|
},
|
|
{
|
|
{
|
|
title: "已导入考生数",
|
|
title: "已导入考生数",
|
|
- dataIndex: "c",
|
|
|
|
|
|
+ dataIndex: "studentCount",
|
|
},
|
|
},
|
|
{
|
|
{
|
|
title: "操作",
|
|
title: "操作",
|
|
@@ -69,20 +92,35 @@ const columns: TableColumnsType = [
|
|
width: 300,
|
|
width: 300,
|
|
},
|
|
},
|
|
];
|
|
];
|
|
-const { dataList, pagination, loading, getList, toPage } = useTable(
|
|
|
|
- getStuList,
|
|
|
|
- { examId: userStore.curExam?.id },
|
|
|
|
- true
|
|
|
|
-);
|
|
|
|
|
|
+const dataList = ref([]);
|
|
|
|
+const search = () => {
|
|
|
|
+ getStuList({ examId: userStore.curExam?.id as number }).then((res: any) => {
|
|
|
|
+ console.log("mock 考生列表", res);
|
|
|
|
+ dataList.value = res || [];
|
|
|
|
+ });
|
|
|
|
+};
|
|
|
|
+search();
|
|
const clear = (row: any) => {
|
|
const clear = (row: any) => {
|
|
window.$confirm({
|
|
window.$confirm({
|
|
title: () => "系统通知",
|
|
title: () => "系统通知",
|
|
content: () => "请确认是否立即删除?",
|
|
content: () => "请确认是否立即删除?",
|
|
onOk() {
|
|
onOk() {
|
|
- //todo 执行删除接口
|
|
|
|
|
|
+ clearStuData({
|
|
|
|
+ examId: userStore.curExam?.id as number,
|
|
|
|
+ subjectCode: row.subjectCode,
|
|
|
|
+ }).then(() => {
|
|
|
|
+ console.log("mock 删除考生单条数据");
|
|
|
|
+ window.$message.success("操作成功");
|
|
|
|
+ search();
|
|
|
|
+ });
|
|
},
|
|
},
|
|
});
|
|
});
|
|
};
|
|
};
|
|
|
|
+const curRow = ref(null);
|
|
|
|
+const openImportDialog = (row: any) => {
|
|
|
|
+ curRow.value = row;
|
|
|
|
+ showStuImportFileDialog.value = true;
|
|
|
|
+};
|
|
</script>
|
|
</script>
|
|
<style lang="less" scoped>
|
|
<style lang="less" scoped>
|
|
.stu-import {
|
|
.stu-import {
|