Compare commits

..

No commits in common. "823a2d5fa9d0bfd351a2938c8c7d8649dc557de1" and "077450e4045c05fc4e83129658fe661dbd03a389" have entirely different histories.

13 changed files with 91 additions and 478 deletions

3
.gitignore vendored
View File

@ -19,5 +19,4 @@ tests/**/coverage/
*.ntvs*
*.njsproj
*.sln
tsconfig.tsbuildinfo
.vscode
tsconfig.tsbuildinfo

View File

@ -1,6 +1,6 @@
{
"editor.formatOnType": true,
"editor.formatOnSave": false,
"editor.formatOnSave": true,
"[vue]": {
"editor.defaultFormatter": "esbenp.prettier-vscode"
},
@ -40,5 +40,4 @@
"v-ripple"
],
"vscodeCustomCodeColor.highlightValueColor": "#b392f0",
"vue3snippets.enable-compile-vue-file-on-did-save-code": true,
}

View File

@ -18,18 +18,7 @@ export function ImportExamInfo(id: number, file: File) {
{
headers: {
"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
});
}

View File

@ -62,21 +62,6 @@ 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
* @return {object}

View File

@ -62,7 +62,7 @@ export interface OperationButton {
* @param row
* @param handleReloadPaged
*/
click?: (obj, row, handleReloadPaged: (reload?: boolean) => void) => void;
click?: (obj, row, handleReloadPaged: (reload: boolean) => void) => void;
/** 按钮类型 */
btnType?: "add" | "edit" | "del" | "custom";
/** 按钮样式 */
@ -182,11 +182,6 @@ export interface SearchConditions {
PageSize: number;
/** 排序字段 */
OrderBy: string;
/**
* @tips 0:升序 1:降序
* @默认 = 1
*/
OrderByType?: 0 | 1;
/** 默认查询条件 */
defaultConditions: ConditionalModel[];
/** 查询条件 */

View File

@ -94,8 +94,7 @@ function appStyle() {
tableHeight.value =
appB.value.parentElement.parentElement.offsetHeight -
145 -
appB_S.value.offsetHeight +
0;
appB_S.value.offsetHeight;
return tableHeight;
}

View File

@ -74,7 +74,7 @@ const convertKeysToCamelCase = <T>(data: any): T => {
const defaultConfig: AxiosRequestConfig = {
baseURL: import.meta.env.VITE_API_BASEURL,
// 请求超时时间
timeout: 20 * 1000,
timeout: 10000,
headers: {
Accept: "application/json, text/plain, */*",
"Content-Type": "application/json",
@ -183,8 +183,7 @@ class PureHttp {
const $config = response.config;
// 关闭进度条动画
NProgress.done();
if (!(response.data instanceof Blob))
response.data = convertKeysToCamelCase(response.data);
response.data = convertKeysToCamelCase(response.data);
// 优先判断post/get等方法是否传入回调否则执行初始化设置等回调
if (typeof $config.beforeResponseCallback === "function") {
$config.beforeResponseCallback(response);

View File

@ -6,13 +6,10 @@ 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 { DeleteExamInfo, ImportExamInfo } from "@/api/exam";
import { entryExamInfo } from "./examFun";
import { ElMessage, ElMessageBox } from "element-plus";
const ControllerName = "ExamClassInfo";
defineOptions({
name: ControllerName,
name: ControllerName
});
const props = defineProps<{
@ -36,10 +33,10 @@ const tableData: TableConfig = {
{
FieldName: "ExamId",
FieldValue: props.data[0].id + "",
ConditionalType: ConditionalType.Equal,
},
ConditionalType: ConditionalType.Equal
}
], //
Conditions: [],
Conditions: []
},
operationColumn: true, //
operationColumnData: [
@ -48,21 +45,21 @@ const tableData: TableConfig = {
topBtn: true, //
label: "添加",
btnStyle: "success",
btnType: "custom",
btnType: "custom"
},
{
topBtn: false, //
show: true,
label: "删除",
click: deleteInfo,
btnStyle: "danger", // topBtn: true success danger
btnType: "del", // add edit del
btnStyle: "danger" // topBtn: true success danger
},
{
topBtn: false, //
show: true,
label: "重新录入",
click: reloadImportInfo,
btnStyle: "primary", // topBtn: true success danger
btnType: "custom", // add edit del
btnStyle: "primary" // topBtn: true success danger
},
{
topBtn: false, //
@ -71,12 +68,12 @@ const tableData: TableConfig = {
btnType: "custom",
btnStyle: "primary",
custom: {
title: "考试学生班级详情", // title
title: "考试班级详情", // title
src: "exam/userDetails", //
width: "1600px", //
height: "880px", //
},
},
height: "800px" //
}
}
],
column: {
//
@ -86,15 +83,15 @@ const tableData: TableConfig = {
searchType: ConditionalType.Like, //
add: false, //
edit: false, //
width: "180px",
width: "180px"
},
grade: {
label: "年级",
width: "100px",
custom: (s) => `${s.gradeYear}${s.gradeLevel}`,
custom: s => `${s.gradeYear}${s.gradeLevel}`,
search: true,
add: false, //
edit: false, //
edit: false //
},
className: {
label: "班级",
@ -102,62 +99,37 @@ const tableData: TableConfig = {
search: true,
searchType: ConditionalType.Like, //
add: false, //
edit: false, //
edit: false //
},
peopleCount: {
label: "参考人数",
width: "100px",
search: false,
add: false, //
edit: false, //
edit: false //
},
entryPerson: {
label: "录入人",
width: "200px",
search: true,
add: false, //
edit: false, //
edit: false //
},
createTime: {
label: "录入时间",
width: "200px",
search: true,
add: false, //
edit: false, //
},
edit: false //
}
},
data: [],
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);
onMounted(async () => {
//

View File

@ -1,121 +0,0 @@
<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";
const ControllerName = "ExamClassInfo";
defineOptions({
name: "ClassExam",
});
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: 20,
OrderBy: "Id", //
OrderByType: 1, //
defaultConditions: [], //
Conditions: [],
},
operationColumn: true, //
operationColumnData: [
{
topBtn: false, //
show: true,
label: "详情",
btnType: "custom",
btnStyle: "primary",
custom: {
title: "考试学生班级详情", // title
src: "exam/userDetails", //
width: "1600px", //
height: "800px", //
},
},
],
column: {
//
schoolName: {
label: "学校",
search: true,
searchType: ConditionalType.Like, //
add: false, //
edit: false, //
width: "180px",
},
grade: {
label: "年级",
width: "120px",
custom: (s) => `${s.gradeYear}${s.gradeLevel}`,
search: true,
add: false, //
edit: false, //
},
className: {
label: "班级",
width: "80px",
search: true,
searchType: ConditionalType.Like, //
add: false, //
edit: false, //
},
examName: {
label: "最近考试",
width: "200px",
search: false,
},
peopleCount: {
label: "参考人数",
width: "100px",
search: false,
},
onLineCount: {
label: "重本人数",
width: "100px",
search: false,
},
onLineRate: {
label: "重本率",
width: "100px",
custom: (row) => `${row.onLineRate * 100}%`,
search: false,
},
onLineRanking: {
label: "重本率排名",
search: false,
},
},
data: [],
pageData: {
total: 0,
},
selectRows: [],
};
const showTable = ref(false);
onMounted(async () => {
//
showTable.value = true;
});
</script>
<template>
<div><ahTable v-if="showTable" ref="table" :tableConfig="tableData" /></div>
</template>

View File

@ -1,36 +0,0 @@
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) { }
}

View File

@ -8,11 +8,10 @@ import { getenum } from "@/api/enum";
import { ruleRequired, ruleRequiredNumber } from "@/utils/rules";
import { ImportExamInfo } from "@/api/exam";
import { ElMessage } from "element-plus";
import { entryExamInfo } from "./examFun";
const ControllerName = "Exam";
defineOptions({
name: ControllerName,
name: ControllerName
});
function searchCallback(data) {}
@ -30,7 +29,7 @@ const tableData: TableConfig = {
PageSize: 20,
OrderBy: "Id", //
defaultConditions: [], //
Conditions: [],
Conditions: []
},
operationColumn: true, //
operationColumnData: [
@ -38,21 +37,21 @@ const tableData: TableConfig = {
//
topBtn: false, //
label: "修改",
btnType: "edit", // add edit del custom
btnType: "edit" // add edit del custom
},
{
//
topBtn: true, //
label: "添加",
btnStyle: "success",
btnType: "add", // add edit del custom
btnType: "add" // add edit del custom
},
{
topBtn: false, //
show: true,
label: "删除",
btnType: "del", // add edit del
btnStyle: "danger", // topBtn: true success danger
btnStyle: "danger" // topBtn: true success danger
},
{
topBtn: false, //
@ -64,16 +63,16 @@ const tableData: TableConfig = {
title: "考试班级详情", // title
src: "exam/classDetails", //
width: "1300px", //
height: "800px", //
},
height: "800px" //
}
},
{
topBtn: false, //
show: true,
label: "录入成绩",
click: entryExam,
btnStyle: "primary", // topBtn: true success danger
},
btnStyle: "primary" // topBtn: true success danger
}
],
column: {
//
@ -82,7 +81,7 @@ const tableData: TableConfig = {
search: true,
add: false, //
edit: false, //
width: "150px",
width: "150px"
},
name: {
label: "考试名称",
@ -92,7 +91,7 @@ const tableData: TableConfig = {
searchType: ConditionalType.Like, //
add: true, //
edit: true, //
setting: {},
setting: {}
},
level: {
label: "年级",
@ -102,7 +101,7 @@ const tableData: TableConfig = {
setting: {},
search: true,
add: true, //
edit: true, //
edit: true //
},
testPaperType: {
label: "试卷类型",
@ -112,7 +111,7 @@ const tableData: TableConfig = {
setting: {},
search: true,
add: true, //
edit: true, //
edit: true //
},
type: {
label: "考试类型",
@ -122,7 +121,7 @@ const tableData: TableConfig = {
setting: {},
search: true,
add: true, //
edit: true, //
edit: true //
},
scoreLine: {
label: "划线分数",
@ -131,7 +130,7 @@ const tableData: TableConfig = {
width: "100px",
setting: {},
add: true, //
edit: true, //
edit: true //
},
startTime: {
label: "考试时间",
@ -141,24 +140,54 @@ const tableData: TableConfig = {
type: "datetime",
setting: {},
add: true, //
edit: true, //
edit: true //
},
createTime: {
label: "创建时间",
type: "datetime",
search: true,
add: false, //
edit: false, //
},
edit: false //
}
},
data: [],
pageData: {
total: 0,
total: 0
},
selectRows: [],
selectRows: []
};
function entryExam(obj, row, callBack) {
entryExamInfo(row[0].id);
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(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);
onMounted(async () => {
@ -169,7 +198,9 @@ onMounted(async () => {
tableData.column.testPaperType.setting.datasource = (
await getenum("TestPaperTypeEnum")
).data;
tableData.column.type.setting.datasource = (await getenum("ExamTypeEnum")).data;
tableData.column.type.setting.datasource = (
await getenum("ExamTypeEnum")
).data;
showTable.value = true;
});

View File

@ -17,6 +17,7 @@ const props = defineProps<{
}>();
function searchCallback(data) {}
const table = ref<{ initTable: (config: TableConfig) => void }>();
const tableData: TableConfig = {
apiUrl: ControllerName,
@ -27,9 +28,8 @@ const tableData: TableConfig = {
//
show: true,
PageIndex: 0,
PageSize: 60,
OrderBy: "AssignRanking", //
OrderByType: 0,
PageSize: 20,
OrderBy: "Id", //
defaultConditions: [], //
Conditions: []
},
@ -39,33 +39,19 @@ const tableData: TableConfig = {
//
topBtn: true, //
label: "成绩升序",
btnStyle: "primary",
click: (o, r, c) => {
tableData.search.OrderByType = 1;
c();
}
btnStyle: "primary"
},
{
//
topBtn: true, //
label: "成绩降序",
btnStyle: "primary",
click: (o, r, c) => {
tableData.search.OrderByType = 0;
c();
}
btnStyle: "primary"
},
{
topBtn: false, //
label: "个人详情",
btnType: "custom",
btnStyle: "primary",
custom: {
title: "考试学生班级详情", // title
src: "exam/userExam", //
width: "1600px", //
height: "800px" //
}
btnStyle: "primary" // topBtn: true success danger
}
],
column: {
@ -154,19 +140,8 @@ onMounted(async () => {
showTable.value = true;
});
const exam = props.data[0];
</script>
<template>
<div>
<div class="p-[10px] text-[1.5rem]">
<strong>学校</strong>{{ exam.schoolName }}&nbsp;&nbsp;
<strong>年级</strong>{{ exam.gradeLevel + exam.gradeYear }}&nbsp;&nbsp;
<strong>班级</strong>{{ exam.className }}&nbsp;&nbsp;
<strong>考试名称</strong>{{ exam.examName }}&nbsp;&nbsp;
<!-- <strong>考试类型</strong>{{exam.className}}&nbsp;&nbsp;
<strong>试卷类型</strong>{{exam.className}}&nbsp;&nbsp; -->
</div>
<ahTable v-if="showTable" ref="table" :tableConfig="tableData" />
</div>
<div><ahTable v-if="showTable" ref="table" :tableConfig="tableData" /></div>
</template>

View File

@ -1,173 +0,0 @@
<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
>&nbsp; &nbsp; {{ exam.schoolName }} {{ exam.grade }}
{{ exam.className }}
</div>
<ahTable v-if="showTable" ref="table" :tableConfig="tableData" />
</div>
</template>