完善 考试流程
This commit is contained in:
parent
733b406eb7
commit
823a2d5fa9
|
|
@ -19,4 +19,5 @@ tests/**/coverage/
|
||||||
*.ntvs*
|
*.ntvs*
|
||||||
*.njsproj
|
*.njsproj
|
||||||
*.sln
|
*.sln
|
||||||
tsconfig.tsbuildinfo
|
tsconfig.tsbuildinfo
|
||||||
|
.vscode
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,6 @@
|
||||||
{
|
{
|
||||||
"editor.formatOnType": true,
|
"editor.formatOnType": true,
|
||||||
"editor.formatOnSave": true,
|
"editor.formatOnSave": false,
|
||||||
"[vue]": {
|
"[vue]": {
|
||||||
"editor.defaultFormatter": "esbenp.prettier-vscode"
|
"editor.defaultFormatter": "esbenp.prettier-vscode"
|
||||||
},
|
},
|
||||||
|
|
@ -40,4 +40,5 @@
|
||||||
"v-ripple"
|
"v-ripple"
|
||||||
],
|
],
|
||||||
"vscodeCustomCodeColor.highlightValueColor": "#b392f0",
|
"vscodeCustomCodeColor.highlightValueColor": "#b392f0",
|
||||||
|
"vue3snippets.enable-compile-vue-file-on-did-save-code": true,
|
||||||
}
|
}
|
||||||
|
|
@ -18,7 +18,18 @@ export function ImportExamInfo(id: number, file: File) {
|
||||||
{
|
{
|
||||||
headers: {
|
headers: {
|
||||||
"Content-Type": "application/x-www-form-urlencoded"
|
"Content-Type": "application/x-www-form-urlencoded"
|
||||||
}
|
},
|
||||||
|
responseType: "blob"
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @description 删除班级考试信息
|
||||||
|
* @return {object}
|
||||||
|
*/
|
||||||
|
export function DeleteExamInfo(data: { classId: number; examId: number }) {
|
||||||
|
return http.request<any>("post", `ExamClassInfo/DeleteExamInfo`, {
|
||||||
|
data
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
|
||||||
|
|
@ -62,6 +62,21 @@ export function cloudSchoolCombo() {
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
/**
|
||||||
|
* @description 获取班级信息
|
||||||
|
* @return {object}
|
||||||
|
*/
|
||||||
|
export function getClassInfo(id) {
|
||||||
|
return http.request<Res<any>>("get", `userCenter/back/classes/${id}`);
|
||||||
|
}
|
||||||
|
/**
|
||||||
|
* @description 获取学校信息
|
||||||
|
* @return {object}
|
||||||
|
*/
|
||||||
|
export function getSchoolInfo(id) {
|
||||||
|
return http.request<Res<any>>("get", `userCenter/back/schools/${id}`);
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @description 获取用户信息
|
* @description 获取用户信息
|
||||||
* @return {object}
|
* @return {object}
|
||||||
|
|
|
||||||
|
|
@ -94,7 +94,8 @@ function appStyle() {
|
||||||
tableHeight.value =
|
tableHeight.value =
|
||||||
appB.value.parentElement.parentElement.offsetHeight -
|
appB.value.parentElement.parentElement.offsetHeight -
|
||||||
145 -
|
145 -
|
||||||
appB_S.value.offsetHeight;
|
appB_S.value.offsetHeight +
|
||||||
|
0;
|
||||||
return tableHeight;
|
return tableHeight;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -74,7 +74,7 @@ const convertKeysToCamelCase = <T>(data: any): T => {
|
||||||
const defaultConfig: AxiosRequestConfig = {
|
const defaultConfig: AxiosRequestConfig = {
|
||||||
baseURL: import.meta.env.VITE_API_BASEURL,
|
baseURL: import.meta.env.VITE_API_BASEURL,
|
||||||
// 请求超时时间
|
// 请求超时时间
|
||||||
timeout: 10000,
|
timeout: 20 * 1000,
|
||||||
headers: {
|
headers: {
|
||||||
Accept: "application/json, text/plain, */*",
|
Accept: "application/json, text/plain, */*",
|
||||||
"Content-Type": "application/json",
|
"Content-Type": "application/json",
|
||||||
|
|
@ -183,7 +183,8 @@ class PureHttp {
|
||||||
const $config = response.config;
|
const $config = response.config;
|
||||||
// 关闭进度条动画
|
// 关闭进度条动画
|
||||||
NProgress.done();
|
NProgress.done();
|
||||||
response.data = convertKeysToCamelCase(response.data);
|
if (!(response.data instanceof Blob))
|
||||||
|
response.data = convertKeysToCamelCase(response.data);
|
||||||
// 优先判断post/get等方法是否传入回调,否则执行初始化设置等回调
|
// 优先判断post/get等方法是否传入回调,否则执行初始化设置等回调
|
||||||
if (typeof $config.beforeResponseCallback === "function") {
|
if (typeof $config.beforeResponseCallback === "function") {
|
||||||
$config.beforeResponseCallback(response);
|
$config.beforeResponseCallback(response);
|
||||||
|
|
|
||||||
|
|
@ -6,10 +6,13 @@ import { fa } from "element-plus/es/locales.mjs";
|
||||||
import { hTableAPI } from "@/api/hTable";
|
import { hTableAPI } from "@/api/hTable";
|
||||||
import { getenum } from "@/api/enum";
|
import { getenum } from "@/api/enum";
|
||||||
import { ruleRequired, ruleRequiredNumber } from "@/utils/rules";
|
import { ruleRequired, ruleRequiredNumber } from "@/utils/rules";
|
||||||
|
import { DeleteExamInfo, ImportExamInfo } from "@/api/exam";
|
||||||
|
import { entryExamInfo } from "./examFun";
|
||||||
|
import { ElMessage, ElMessageBox } from "element-plus";
|
||||||
const ControllerName = "ExamClassInfo";
|
const ControllerName = "ExamClassInfo";
|
||||||
|
|
||||||
defineOptions({
|
defineOptions({
|
||||||
name: ControllerName
|
name: ControllerName,
|
||||||
});
|
});
|
||||||
|
|
||||||
const props = defineProps<{
|
const props = defineProps<{
|
||||||
|
|
@ -33,10 +36,10 @@ const tableData: TableConfig = {
|
||||||
{
|
{
|
||||||
FieldName: "ExamId",
|
FieldName: "ExamId",
|
||||||
FieldValue: props.data[0].id + "",
|
FieldValue: props.data[0].id + "",
|
||||||
ConditionalType: ConditionalType.Equal
|
ConditionalType: ConditionalType.Equal,
|
||||||
}
|
},
|
||||||
], // 默认查询条件
|
], // 默认查询条件
|
||||||
Conditions: []
|
Conditions: [],
|
||||||
},
|
},
|
||||||
operationColumn: true, // 显示操作按钮
|
operationColumn: true, // 显示操作按钮
|
||||||
operationColumnData: [
|
operationColumnData: [
|
||||||
|
|
@ -45,21 +48,21 @@ const tableData: TableConfig = {
|
||||||
topBtn: true, // 是头部按钮
|
topBtn: true, // 是头部按钮
|
||||||
label: "添加",
|
label: "添加",
|
||||||
btnStyle: "success",
|
btnStyle: "success",
|
||||||
btnType: "custom"
|
btnType: "custom",
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
topBtn: false, // 头部按钮
|
topBtn: false, // 头部按钮
|
||||||
show: true,
|
show: true,
|
||||||
label: "删除",
|
label: "删除",
|
||||||
btnType: "del", // 按钮类型 add edit del 不设置则 自定义按钮
|
click: deleteInfo,
|
||||||
btnStyle: "danger" // topBtn: true才生效 success danger
|
btnStyle: "danger", // topBtn: true才生效 success danger
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
topBtn: false, // 头部按钮
|
topBtn: false, // 头部按钮
|
||||||
show: true,
|
show: true,
|
||||||
label: "重新录入",
|
label: "重新录入",
|
||||||
btnType: "custom", // 按钮类型 add edit del 不设置则 自定义按钮
|
click: reloadImportInfo,
|
||||||
btnStyle: "primary" // topBtn: true才生效 success danger
|
btnStyle: "primary", // topBtn: true才生效 success danger
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
topBtn: false, // 头部按钮
|
topBtn: false, // 头部按钮
|
||||||
|
|
@ -71,9 +74,9 @@ const tableData: TableConfig = {
|
||||||
title: "考试学生班级详情", // 弹出框title
|
title: "考试学生班级详情", // 弹出框title
|
||||||
src: "exam/userDetails", // 组件路径
|
src: "exam/userDetails", // 组件路径
|
||||||
width: "1600px", // 弹框宽度
|
width: "1600px", // 弹框宽度
|
||||||
height: "800px" // 弹框高度
|
height: "880px", // 弹框高度
|
||||||
}
|
},
|
||||||
}
|
},
|
||||||
],
|
],
|
||||||
column: {
|
column: {
|
||||||
// 行数据
|
// 行数据
|
||||||
|
|
@ -83,15 +86,15 @@ const tableData: TableConfig = {
|
||||||
searchType: ConditionalType.Like, // 搜索类型
|
searchType: ConditionalType.Like, // 搜索类型
|
||||||
add: false, // 字段允许添加
|
add: false, // 字段允许添加
|
||||||
edit: false, // 字段允许修改
|
edit: false, // 字段允许修改
|
||||||
width: "180px"
|
width: "180px",
|
||||||
},
|
},
|
||||||
grade: {
|
grade: {
|
||||||
label: "年级",
|
label: "年级",
|
||||||
width: "100px",
|
width: "100px",
|
||||||
custom: s => `${s.gradeYear}${s.gradeLevel}`,
|
custom: (s) => `${s.gradeYear}${s.gradeLevel}`,
|
||||||
search: true,
|
search: true,
|
||||||
add: false, // 字段允许添加
|
add: false, // 字段允许添加
|
||||||
edit: false // 字段允许修改
|
edit: false, // 字段允许修改
|
||||||
},
|
},
|
||||||
className: {
|
className: {
|
||||||
label: "班级",
|
label: "班级",
|
||||||
|
|
@ -99,37 +102,62 @@ const tableData: TableConfig = {
|
||||||
search: true,
|
search: true,
|
||||||
searchType: ConditionalType.Like, // 搜索类型
|
searchType: ConditionalType.Like, // 搜索类型
|
||||||
add: false, // 字段允许添加
|
add: false, // 字段允许添加
|
||||||
edit: false // 字段允许修改
|
edit: false, // 字段允许修改
|
||||||
},
|
},
|
||||||
peopleCount: {
|
peopleCount: {
|
||||||
label: "参考人数",
|
label: "参考人数",
|
||||||
width: "100px",
|
width: "100px",
|
||||||
search: false,
|
search: false,
|
||||||
add: false, // 字段允许添加
|
add: false, // 字段允许添加
|
||||||
edit: false // 字段允许修改
|
edit: false, // 字段允许修改
|
||||||
},
|
},
|
||||||
entryPerson: {
|
entryPerson: {
|
||||||
label: "录入人",
|
label: "录入人",
|
||||||
width: "200px",
|
width: "200px",
|
||||||
search: true,
|
search: true,
|
||||||
add: false, // 字段允许添加
|
add: false, // 字段允许添加
|
||||||
edit: false // 字段允许修改
|
edit: false, // 字段允许修改
|
||||||
},
|
},
|
||||||
createTime: {
|
createTime: {
|
||||||
label: "录入时间",
|
label: "录入时间",
|
||||||
width: "200px",
|
width: "200px",
|
||||||
search: true,
|
search: true,
|
||||||
add: false, // 字段允许添加
|
add: false, // 字段允许添加
|
||||||
edit: false // 字段允许修改
|
edit: false, // 字段允许修改
|
||||||
}
|
},
|
||||||
},
|
},
|
||||||
data: [],
|
data: [],
|
||||||
pageData: {
|
pageData: {
|
||||||
total: 0
|
total: 0,
|
||||||
},
|
},
|
||||||
selectRows: []
|
selectRows: [],
|
||||||
};
|
};
|
||||||
|
|
||||||
|
async function deleteInfo(o, row, c) {
|
||||||
|
try {
|
||||||
|
await ElMessageBox.confirm("是否删除考试信息?", "提示", {
|
||||||
|
confirmButtonText: "确定",
|
||||||
|
cancelButtonText: "取消",
|
||||||
|
type: "warning",
|
||||||
|
});
|
||||||
|
await DeleteExamInfo({ examId: row[0].examId, classId: row[0].classId });
|
||||||
|
} catch (error) {
|
||||||
|
ElMessage.info("取消删除");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
async function reloadImportInfo(o, row, c) {
|
||||||
|
try {
|
||||||
|
await ElMessageBox.confirm("是否重新录入考试信息?", "提示", {
|
||||||
|
confirmButtonText: "确定",
|
||||||
|
cancelButtonText: "取消",
|
||||||
|
type: "warning",
|
||||||
|
});
|
||||||
|
await DeleteExamInfo({ examId: row[0].examId, classId: row[0].classId });
|
||||||
|
entryExamInfo(row[0].examId);
|
||||||
|
} catch (error) {
|
||||||
|
ElMessage.info("取消重新录入");
|
||||||
|
}
|
||||||
|
}
|
||||||
const showTable = ref(false);
|
const showTable = ref(false);
|
||||||
onMounted(async () => {
|
onMounted(async () => {
|
||||||
//初始化数据原
|
//初始化数据原
|
||||||
|
|
|
||||||
|
|
@ -9,7 +9,7 @@ import { ruleRequired, ruleRequiredNumber } from "@/utils/rules";
|
||||||
const ControllerName = "ExamClassInfo";
|
const ControllerName = "ExamClassInfo";
|
||||||
|
|
||||||
defineOptions({
|
defineOptions({
|
||||||
name: "ClassExam"
|
name: "ClassExam",
|
||||||
});
|
});
|
||||||
|
|
||||||
const props = defineProps<{
|
const props = defineProps<{
|
||||||
|
|
@ -29,24 +29,25 @@ const tableData: TableConfig = {
|
||||||
PageIndex: 0,
|
PageIndex: 0,
|
||||||
PageSize: 20,
|
PageSize: 20,
|
||||||
OrderBy: "Id", // 排序
|
OrderBy: "Id", // 排序
|
||||||
|
OrderByType: 1, // 排序方式
|
||||||
defaultConditions: [], // 默认查询条件
|
defaultConditions: [], // 默认查询条件
|
||||||
Conditions: []
|
Conditions: [],
|
||||||
},
|
},
|
||||||
operationColumn: true, // 显示操作按钮
|
operationColumn: true, // 显示操作按钮
|
||||||
operationColumnData: [
|
operationColumnData: [
|
||||||
{
|
{
|
||||||
topBtn: false, // 头部按钮
|
topBtn: false, // 头部按钮
|
||||||
show: true,
|
show: true,
|
||||||
label: "学生成绩详情",
|
label: "详情",
|
||||||
btnType: "custom",
|
btnType: "custom",
|
||||||
btnStyle: "primary",
|
btnStyle: "primary",
|
||||||
custom: {
|
custom: {
|
||||||
title: "考试学生班级详情", // 弹出框title
|
title: "考试学生班级详情", // 弹出框title
|
||||||
src: "exam/userDetails", // 组件路径
|
src: "exam/userDetails", // 组件路径
|
||||||
width: "1600px", // 弹框宽度
|
width: "1600px", // 弹框宽度
|
||||||
height: "800px" // 弹框高度
|
height: "800px", // 弹框高度
|
||||||
}
|
},
|
||||||
}
|
},
|
||||||
],
|
],
|
||||||
column: {
|
column: {
|
||||||
// 行数据
|
// 行数据
|
||||||
|
|
@ -56,51 +57,55 @@ const tableData: TableConfig = {
|
||||||
searchType: ConditionalType.Like, // 搜索类型
|
searchType: ConditionalType.Like, // 搜索类型
|
||||||
add: false, // 字段允许添加
|
add: false, // 字段允许添加
|
||||||
edit: false, // 字段允许修改
|
edit: false, // 字段允许修改
|
||||||
width: "180px"
|
width: "180px",
|
||||||
},
|
},
|
||||||
grade: {
|
grade: {
|
||||||
label: "年级",
|
label: "年级",
|
||||||
width: "100px",
|
width: "120px",
|
||||||
custom: s => `${s.gradeYear}${s.gradeLevel}`,
|
custom: (s) => `${s.gradeYear}${s.gradeLevel}`,
|
||||||
search: true,
|
search: true,
|
||||||
add: false, // 字段允许添加
|
add: false, // 字段允许添加
|
||||||
edit: false // 字段允许修改
|
edit: false, // 字段允许修改
|
||||||
},
|
},
|
||||||
className: {
|
className: {
|
||||||
label: "班级",
|
label: "班级",
|
||||||
width: "150px",
|
width: "80px",
|
||||||
search: true,
|
search: true,
|
||||||
searchType: ConditionalType.Like, // 搜索类型
|
searchType: ConditionalType.Like, // 搜索类型
|
||||||
add: false, // 字段允许添加
|
add: false, // 字段允许添加
|
||||||
edit: false // 字段允许修改
|
edit: false, // 字段允许修改
|
||||||
|
},
|
||||||
|
examName: {
|
||||||
|
label: "最近考试",
|
||||||
|
width: "200px",
|
||||||
|
search: false,
|
||||||
},
|
},
|
||||||
peopleCount: {
|
peopleCount: {
|
||||||
label: "参考人数",
|
label: "参考人数",
|
||||||
width: "100px",
|
width: "100px",
|
||||||
search: false,
|
search: false,
|
||||||
add: false, // 字段允许添加
|
|
||||||
edit: false // 字段允许修改
|
|
||||||
},
|
},
|
||||||
entryPerson: {
|
onLineCount: {
|
||||||
label: "录入人",
|
label: "重本人数",
|
||||||
width: "200px",
|
width: "100px",
|
||||||
search: true,
|
search: false,
|
||||||
add: false, // 字段允许添加
|
},
|
||||||
edit: false // 字段允许修改
|
onLineRate: {
|
||||||
|
label: "重本率",
|
||||||
|
width: "100px",
|
||||||
|
custom: (row) => `${row.onLineRate * 100}%`,
|
||||||
|
search: false,
|
||||||
|
},
|
||||||
|
onLineRanking: {
|
||||||
|
label: "重本率排名",
|
||||||
|
search: false,
|
||||||
},
|
},
|
||||||
createTime: {
|
|
||||||
label: "录入时间",
|
|
||||||
width: "200px",
|
|
||||||
search: true,
|
|
||||||
add: false, // 字段允许添加
|
|
||||||
edit: false // 字段允许修改
|
|
||||||
}
|
|
||||||
},
|
},
|
||||||
data: [],
|
data: [],
|
||||||
pageData: {
|
pageData: {
|
||||||
total: 0
|
total: 0,
|
||||||
},
|
},
|
||||||
selectRows: []
|
selectRows: [],
|
||||||
};
|
};
|
||||||
|
|
||||||
const showTable = ref(false);
|
const showTable = ref(false);
|
||||||
|
|
|
||||||
|
|
@ -0,0 +1,36 @@
|
||||||
|
import { ImportExamInfo } from "@/api/exam";
|
||||||
|
import { ElMessage } from "element-plus";
|
||||||
|
|
||||||
|
export function entryExamInfo(eid: number) {
|
||||||
|
let fileE = document.createElement("input");
|
||||||
|
fileE.type = "file";
|
||||||
|
var formData = new window.FormData();
|
||||||
|
fileE.onchange = async function () {
|
||||||
|
formData.append("File", fileE.files[0]);
|
||||||
|
let res = await ImportExamInfo(eid, fileE.files[0]);
|
||||||
|
if (res.code != undefined) {
|
||||||
|
if (res.code !== 200) return ElMessage.error(res.message);
|
||||||
|
else return ElMessage.success("所有数据录入成功");
|
||||||
|
} else if (res.type === "application/json") {
|
||||||
|
let json = await res.text();
|
||||||
|
if (json !== undefined && json.Code !== 200) {
|
||||||
|
return ElMessage.error(json.Message);
|
||||||
|
} else {
|
||||||
|
return ElMessage.success("操所有数据录入成功作成功");
|
||||||
|
}
|
||||||
|
} else if (res === undefined || res.size === 0)
|
||||||
|
return ElMessage.success("所有数据录入成功");
|
||||||
|
const url = res && window.URL.createObjectURL(res);
|
||||||
|
const link = document.createElement("a");
|
||||||
|
link.href = url;
|
||||||
|
link.setAttribute("download", "未成功导入的考试信息数据" + ".xlsx");
|
||||||
|
document.body.appendChild(link);
|
||||||
|
link.click();
|
||||||
|
document.body.removeChild(link);
|
||||||
|
ElMessage.success("操作成功,已导出重复数据");
|
||||||
|
};
|
||||||
|
|
||||||
|
try {
|
||||||
|
fileE.click();
|
||||||
|
} catch (error) { }
|
||||||
|
}
|
||||||
|
|
@ -8,10 +8,11 @@ import { getenum } from "@/api/enum";
|
||||||
import { ruleRequired, ruleRequiredNumber } from "@/utils/rules";
|
import { ruleRequired, ruleRequiredNumber } from "@/utils/rules";
|
||||||
import { ImportExamInfo } from "@/api/exam";
|
import { ImportExamInfo } from "@/api/exam";
|
||||||
import { ElMessage } from "element-plus";
|
import { ElMessage } from "element-plus";
|
||||||
|
import { entryExamInfo } from "./examFun";
|
||||||
const ControllerName = "Exam";
|
const ControllerName = "Exam";
|
||||||
|
|
||||||
defineOptions({
|
defineOptions({
|
||||||
name: ControllerName
|
name: ControllerName,
|
||||||
});
|
});
|
||||||
|
|
||||||
function searchCallback(data) {}
|
function searchCallback(data) {}
|
||||||
|
|
@ -29,7 +30,7 @@ const tableData: TableConfig = {
|
||||||
PageSize: 20,
|
PageSize: 20,
|
||||||
OrderBy: "Id", // 排序
|
OrderBy: "Id", // 排序
|
||||||
defaultConditions: [], // 默认查询条件
|
defaultConditions: [], // 默认查询条件
|
||||||
Conditions: []
|
Conditions: [],
|
||||||
},
|
},
|
||||||
operationColumn: true, // 显示操作按钮
|
operationColumn: true, // 显示操作按钮
|
||||||
operationColumnData: [
|
operationColumnData: [
|
||||||
|
|
@ -37,21 +38,21 @@ const tableData: TableConfig = {
|
||||||
// 操作按钮
|
// 操作按钮
|
||||||
topBtn: false, // 是头部按钮
|
topBtn: false, // 是头部按钮
|
||||||
label: "修改",
|
label: "修改",
|
||||||
btnType: "edit" // 按钮类型 add edit del custom
|
btnType: "edit", // 按钮类型 add edit del custom
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
// 操作按钮
|
// 操作按钮
|
||||||
topBtn: true, // 是头部按钮
|
topBtn: true, // 是头部按钮
|
||||||
label: "添加",
|
label: "添加",
|
||||||
btnStyle: "success",
|
btnStyle: "success",
|
||||||
btnType: "add" // 按钮类型 add edit del custom
|
btnType: "add", // 按钮类型 add edit del custom
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
topBtn: false, // 头部按钮
|
topBtn: false, // 头部按钮
|
||||||
show: true,
|
show: true,
|
||||||
label: "删除",
|
label: "删除",
|
||||||
btnType: "del", // 按钮类型 add edit del 不设置则 自定义按钮
|
btnType: "del", // 按钮类型 add edit del 不设置则 自定义按钮
|
||||||
btnStyle: "danger" // topBtn: true才生效 success danger
|
btnStyle: "danger", // topBtn: true才生效 success danger
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
topBtn: false, // 头部按钮
|
topBtn: false, // 头部按钮
|
||||||
|
|
@ -63,16 +64,16 @@ const tableData: TableConfig = {
|
||||||
title: "考试班级详情", // 弹出框title
|
title: "考试班级详情", // 弹出框title
|
||||||
src: "exam/classDetails", // 组件路径
|
src: "exam/classDetails", // 组件路径
|
||||||
width: "1300px", // 弹框宽度
|
width: "1300px", // 弹框宽度
|
||||||
height: "800px" // 弹框高度
|
height: "800px", // 弹框高度
|
||||||
}
|
},
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
topBtn: false, // 头部按钮
|
topBtn: false, // 头部按钮
|
||||||
show: true,
|
show: true,
|
||||||
label: "录入成绩",
|
label: "录入成绩",
|
||||||
click: entryExam,
|
click: entryExam,
|
||||||
btnStyle: "primary" // topBtn: true才生效 success danger
|
btnStyle: "primary", // topBtn: true才生效 success danger
|
||||||
}
|
},
|
||||||
],
|
],
|
||||||
column: {
|
column: {
|
||||||
// 行数据
|
// 行数据
|
||||||
|
|
@ -81,7 +82,7 @@ const tableData: TableConfig = {
|
||||||
search: true,
|
search: true,
|
||||||
add: false, // 字段允许添加
|
add: false, // 字段允许添加
|
||||||
edit: false, // 字段允许修改
|
edit: false, // 字段允许修改
|
||||||
width: "150px"
|
width: "150px",
|
||||||
},
|
},
|
||||||
name: {
|
name: {
|
||||||
label: "考试名称",
|
label: "考试名称",
|
||||||
|
|
@ -91,7 +92,7 @@ const tableData: TableConfig = {
|
||||||
searchType: ConditionalType.Like, // 搜索类型
|
searchType: ConditionalType.Like, // 搜索类型
|
||||||
add: true, // 字段允许添加
|
add: true, // 字段允许添加
|
||||||
edit: true, // 字段允许修改
|
edit: true, // 字段允许修改
|
||||||
setting: {}
|
setting: {},
|
||||||
},
|
},
|
||||||
level: {
|
level: {
|
||||||
label: "年级",
|
label: "年级",
|
||||||
|
|
@ -101,7 +102,7 @@ const tableData: TableConfig = {
|
||||||
setting: {},
|
setting: {},
|
||||||
search: true,
|
search: true,
|
||||||
add: true, // 字段允许添加
|
add: true, // 字段允许添加
|
||||||
edit: true // 字段允许修改
|
edit: true, // 字段允许修改
|
||||||
},
|
},
|
||||||
testPaperType: {
|
testPaperType: {
|
||||||
label: "试卷类型",
|
label: "试卷类型",
|
||||||
|
|
@ -111,7 +112,7 @@ const tableData: TableConfig = {
|
||||||
setting: {},
|
setting: {},
|
||||||
search: true,
|
search: true,
|
||||||
add: true, // 字段允许添加
|
add: true, // 字段允许添加
|
||||||
edit: true // 字段允许修改
|
edit: true, // 字段允许修改
|
||||||
},
|
},
|
||||||
type: {
|
type: {
|
||||||
label: "考试类型",
|
label: "考试类型",
|
||||||
|
|
@ -121,7 +122,7 @@ const tableData: TableConfig = {
|
||||||
setting: {},
|
setting: {},
|
||||||
search: true,
|
search: true,
|
||||||
add: true, // 字段允许添加
|
add: true, // 字段允许添加
|
||||||
edit: true // 字段允许修改
|
edit: true, // 字段允许修改
|
||||||
},
|
},
|
||||||
scoreLine: {
|
scoreLine: {
|
||||||
label: "划线分数",
|
label: "划线分数",
|
||||||
|
|
@ -130,7 +131,7 @@ const tableData: TableConfig = {
|
||||||
width: "100px",
|
width: "100px",
|
||||||
setting: {},
|
setting: {},
|
||||||
add: true, // 字段允许添加
|
add: true, // 字段允许添加
|
||||||
edit: true // 字段允许修改
|
edit: true, // 字段允许修改
|
||||||
},
|
},
|
||||||
startTime: {
|
startTime: {
|
||||||
label: "考试时间",
|
label: "考试时间",
|
||||||
|
|
@ -140,54 +141,24 @@ const tableData: TableConfig = {
|
||||||
type: "datetime",
|
type: "datetime",
|
||||||
setting: {},
|
setting: {},
|
||||||
add: true, // 字段允许添加
|
add: true, // 字段允许添加
|
||||||
edit: true // 字段允许修改
|
edit: true, // 字段允许修改
|
||||||
},
|
},
|
||||||
createTime: {
|
createTime: {
|
||||||
label: "创建时间",
|
label: "创建时间",
|
||||||
type: "datetime",
|
type: "datetime",
|
||||||
search: true,
|
search: true,
|
||||||
add: false, // 字段允许添加
|
add: false, // 字段允许添加
|
||||||
edit: false // 字段允许修改
|
edit: false, // 字段允许修改
|
||||||
}
|
},
|
||||||
},
|
},
|
||||||
data: [],
|
data: [],
|
||||||
pageData: {
|
pageData: {
|
||||||
total: 0
|
total: 0,
|
||||||
},
|
},
|
||||||
selectRows: []
|
selectRows: [],
|
||||||
};
|
};
|
||||||
function entryExam(obj, row, callBack) {
|
function entryExam(obj, row, callBack) {
|
||||||
let fileE = document.createElement("input");
|
entryExamInfo(row[0].id);
|
||||||
fileE.type = "file";
|
|
||||||
var formData = new window.FormData();
|
|
||||||
fileE.onchange = async function () {
|
|
||||||
formData.append("File", fileE.files[0]);
|
|
||||||
let res = await ImportExamInfo(row[0].id, fileE.files[0]);
|
|
||||||
if (res.code != undefined) {
|
|
||||||
if (res.code !== 200) return ElMessage.error(res.message);
|
|
||||||
else return ElMessage.success("所有数据录入成功");
|
|
||||||
} else if (res.type === "application/json") {
|
|
||||||
let json = await res.text();
|
|
||||||
if (json !== undefined && json.Code !== 200) {
|
|
||||||
return ElMessage.error(json.Message);
|
|
||||||
} else {
|
|
||||||
return ElMessage.success("操所有数据录入成功作成功");
|
|
||||||
}
|
|
||||||
} else if (res === undefined || res.size === 0)
|
|
||||||
return ElMessage.success("所有数据录入成功");
|
|
||||||
const url = res && window.URL.createObjectURL(res);
|
|
||||||
const link = document.createElement("a");
|
|
||||||
link.href = url;
|
|
||||||
link.setAttribute("download", "未成功导入的考试信息数据" + ".xlsx");
|
|
||||||
document.body.appendChild(link);
|
|
||||||
link.click();
|
|
||||||
document.body.removeChild(link);
|
|
||||||
ElMessage.success("操作成功,已导出重复数据");
|
|
||||||
};
|
|
||||||
|
|
||||||
try {
|
|
||||||
fileE.click();
|
|
||||||
} catch (error) {}
|
|
||||||
}
|
}
|
||||||
const showTable = ref(false);
|
const showTable = ref(false);
|
||||||
onMounted(async () => {
|
onMounted(async () => {
|
||||||
|
|
@ -198,9 +169,7 @@ onMounted(async () => {
|
||||||
tableData.column.testPaperType.setting.datasource = (
|
tableData.column.testPaperType.setting.datasource = (
|
||||||
await getenum("TestPaperTypeEnum")
|
await getenum("TestPaperTypeEnum")
|
||||||
).data;
|
).data;
|
||||||
tableData.column.type.setting.datasource = (
|
tableData.column.type.setting.datasource = (await getenum("ExamTypeEnum")).data;
|
||||||
await getenum("ExamTypeEnum")
|
|
||||||
).data;
|
|
||||||
|
|
||||||
showTable.value = true;
|
showTable.value = true;
|
||||||
});
|
});
|
||||||
|
|
|
||||||
|
|
@ -59,7 +59,13 @@ const tableData: TableConfig = {
|
||||||
topBtn: false, // 头部按钮
|
topBtn: false, // 头部按钮
|
||||||
label: "个人详情",
|
label: "个人详情",
|
||||||
btnType: "custom",
|
btnType: "custom",
|
||||||
btnStyle: "primary" // topBtn: true才生效 success danger
|
btnStyle: "primary",
|
||||||
|
custom: {
|
||||||
|
title: "考试学生班级详情", // 弹出框title
|
||||||
|
src: "exam/userExam", // 组件路径
|
||||||
|
width: "1600px", // 弹框宽度
|
||||||
|
height: "800px" // 弹框高度
|
||||||
|
}
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
column: {
|
column: {
|
||||||
|
|
|
||||||
|
|
@ -0,0 +1,173 @@
|
||||||
|
<script setup lang="ts">
|
||||||
|
import ahTable from "@/components/hTable/index.vue";
|
||||||
|
import { ConditionalType, TableConfig } from "@/components/hTable/hTable";
|
||||||
|
import { onMounted, ref } from "vue";
|
||||||
|
import { fa } from "element-plus/es/locales.mjs";
|
||||||
|
import { hTableAPI } from "@/api/hTable";
|
||||||
|
import { getenum } from "@/api/enum";
|
||||||
|
import { ruleRequired, ruleRequiredNumber } from "@/utils/rules";
|
||||||
|
import { getClassInfo, getSchoolInfo } from "@/api/userCenter";
|
||||||
|
const ControllerName = "ExamUserInfo";
|
||||||
|
|
||||||
|
defineOptions({
|
||||||
|
name: ControllerName,
|
||||||
|
});
|
||||||
|
|
||||||
|
const props = defineProps<{
|
||||||
|
data: any;
|
||||||
|
}>();
|
||||||
|
|
||||||
|
function searchCallback(data) {}
|
||||||
|
const table = ref<{ initTable: (config: TableConfig) => void }>();
|
||||||
|
const tableData: TableConfig = {
|
||||||
|
apiUrl: ControllerName,
|
||||||
|
selectColumn: false, // 列表选择
|
||||||
|
border: false, // 是否显示表格边框
|
||||||
|
searchCallback: searchCallback,
|
||||||
|
search: {
|
||||||
|
// 查询条件
|
||||||
|
show: true,
|
||||||
|
PageIndex: 0,
|
||||||
|
PageSize: 60,
|
||||||
|
OrderBy: "Id", // 排序
|
||||||
|
OrderByType: 1,
|
||||||
|
defaultConditions: [
|
||||||
|
{
|
||||||
|
FieldName: "UserId",
|
||||||
|
FieldValue: props.data[0].userId + "",
|
||||||
|
},
|
||||||
|
], // 默认查询条件
|
||||||
|
Conditions: [],
|
||||||
|
},
|
||||||
|
operationColumn: true, // 显示操作按钮
|
||||||
|
operationColumnData: [],
|
||||||
|
column: {
|
||||||
|
// 行数据
|
||||||
|
examName: {
|
||||||
|
label: "考试名称",
|
||||||
|
search: true,
|
||||||
|
searchType: ConditionalType.Like, // 搜索类型
|
||||||
|
width: "180px",
|
||||||
|
},
|
||||||
|
// 行数据
|
||||||
|
type: {
|
||||||
|
label: "考试类型",
|
||||||
|
search: true,
|
||||||
|
type: "dropdown",
|
||||||
|
setting: {},
|
||||||
|
width: "150px",
|
||||||
|
},
|
||||||
|
// 行数据
|
||||||
|
grade: {
|
||||||
|
label: "考试阶段",
|
||||||
|
search: true,
|
||||||
|
searchType: ConditionalType.Like, // 搜索类型
|
||||||
|
width: "120px",
|
||||||
|
}, // 行数据
|
||||||
|
testPaperType: {
|
||||||
|
label: "试卷类型",
|
||||||
|
search: true,
|
||||||
|
type: "dropdown",
|
||||||
|
setting: {},
|
||||||
|
width: "150px",
|
||||||
|
},
|
||||||
|
语文: {
|
||||||
|
label: "语文",
|
||||||
|
search: false,
|
||||||
|
width: "80px",
|
||||||
|
custom: (row) => row.subjectDic.语文 ?? "--",
|
||||||
|
},
|
||||||
|
数学: {
|
||||||
|
label: "数学",
|
||||||
|
search: false,
|
||||||
|
width: "80px",
|
||||||
|
custom: (row) => row.subjectDic.数学 ?? "--",
|
||||||
|
},
|
||||||
|
英语: {
|
||||||
|
label: "英语",
|
||||||
|
search: false,
|
||||||
|
width: "80px",
|
||||||
|
custom: (row) => row.subjectDic.英语 ?? "--",
|
||||||
|
},
|
||||||
|
物理: {
|
||||||
|
label: "物理",
|
||||||
|
search: false,
|
||||||
|
width: "80px",
|
||||||
|
custom: (row) => row.subjectDic.物理 ?? "--",
|
||||||
|
},
|
||||||
|
化学: {
|
||||||
|
label: "化学",
|
||||||
|
search: false,
|
||||||
|
width: "80px",
|
||||||
|
custom: (row) => row.subjectDic.化学 ?? "--",
|
||||||
|
},
|
||||||
|
生物: {
|
||||||
|
label: "生物",
|
||||||
|
search: false,
|
||||||
|
width: "80px",
|
||||||
|
custom: (row) => row.subjectDic.生物 ?? "--",
|
||||||
|
},
|
||||||
|
政治: {
|
||||||
|
label: "政治",
|
||||||
|
search: false,
|
||||||
|
width: "80px",
|
||||||
|
custom: (row) => row.subjectDic.政治 ?? "--",
|
||||||
|
},
|
||||||
|
历史: {
|
||||||
|
label: "历史",
|
||||||
|
search: false,
|
||||||
|
width: "80px",
|
||||||
|
custom: (row) => row.subjectDic.历史 ?? "--",
|
||||||
|
},
|
||||||
|
地理: {
|
||||||
|
label: "地理",
|
||||||
|
search: false,
|
||||||
|
width: "80px",
|
||||||
|
custom: (row) => row.subjectDic.地理 ?? "--",
|
||||||
|
},
|
||||||
|
assignScore: {
|
||||||
|
label: "赋分总分",
|
||||||
|
search: false,
|
||||||
|
width: "80px",
|
||||||
|
},
|
||||||
|
assignRanking: {
|
||||||
|
label: "赋分后的排名",
|
||||||
|
search: false,
|
||||||
|
width: "120px",
|
||||||
|
},
|
||||||
|
},
|
||||||
|
data: [],
|
||||||
|
pageData: {
|
||||||
|
total: 0,
|
||||||
|
},
|
||||||
|
selectRows: [],
|
||||||
|
};
|
||||||
|
|
||||||
|
const showTable = ref(false);
|
||||||
|
const exam = props.data[0];
|
||||||
|
onMounted(async () => {
|
||||||
|
//初始化数据原
|
||||||
|
getClassInfo(exam.classId).then((res) => {
|
||||||
|
exam.className = res.data.name;
|
||||||
|
});
|
||||||
|
getSchoolInfo(exam.schoolId).then((res) => {
|
||||||
|
exam.schoolName = res.data.name;
|
||||||
|
});
|
||||||
|
tableData.column.testPaperType.setting.datasource = (
|
||||||
|
await getenum("TestPaperTypeEnum")
|
||||||
|
).data;
|
||||||
|
tableData.column.type.setting.datasource = (await getenum("ExamTypeEnum")).data;
|
||||||
|
showTable.value = true;
|
||||||
|
});
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<template>
|
||||||
|
<div>
|
||||||
|
<div class="p-[10px] text-[1.3rem]">
|
||||||
|
<strong>学生{{ exam.userName }}</strong
|
||||||
|
> {{ exam.schoolName }} {{ exam.grade }}
|
||||||
|
{{ exam.className }}
|
||||||
|
</div>
|
||||||
|
<ahTable v-if="showTable" ref="table" :tableConfig="tableData" />
|
||||||
|
</div>
|
||||||
|
</template>
|
||||||
Loading…
Reference in New Issue