From 733b406eb73b6d9700b9e2850c5480a108964af8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=B0=8F=E8=82=A5=E7=BE=8A?= <1048382248@qq.com> Date: Mon, 18 Aug 2025 18:38:35 +0800 Subject: [PATCH] =?UTF-8?q?=E5=AE=8C=E5=96=84=20=E5=AD=A6=E7=94=9F?= =?UTF-8?q?=E8=80=83=E8=AF=95=E6=B5=81=E7=A8=8B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/components/hTable/hTable.ts | 7 +- src/views/exam/classDetails.vue | 2 +- src/views/exam/classExam.vue | 116 ++++++++++++++++++++++++++++++++ src/views/exam/userDetails.vue | 31 +++++++-- 4 files changed, 148 insertions(+), 8 deletions(-) create mode 100644 src/views/exam/classExam.vue diff --git a/src/components/hTable/hTable.ts b/src/components/hTable/hTable.ts index f000c78..c650c2b 100644 --- a/src/components/hTable/hTable.ts +++ b/src/components/hTable/hTable.ts @@ -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,6 +182,11 @@ export interface SearchConditions { PageSize: number; /** 排序字段 */ OrderBy: string; + /**排序顺序 + * @tips 0:升序 1:降序 + * @默认 = 1 + */ + OrderByType?: 0 | 1; /** 默认查询条件 */ defaultConditions: ConditionalModel[]; /** 查询条件 */ diff --git a/src/views/exam/classDetails.vue b/src/views/exam/classDetails.vue index 1304807..c00839e 100644 --- a/src/views/exam/classDetails.vue +++ b/src/views/exam/classDetails.vue @@ -68,7 +68,7 @@ const tableData: TableConfig = { btnType: "custom", btnStyle: "primary", custom: { - title: "考试班级详情", // 弹出框title + title: "考试学生班级详情", // 弹出框title src: "exam/userDetails", // 组件路径 width: "1600px", // 弹框宽度 height: "800px" // 弹框高度 diff --git a/src/views/exam/classExam.vue b/src/views/exam/classExam.vue new file mode 100644 index 0000000..433f53e --- /dev/null +++ b/src/views/exam/classExam.vue @@ -0,0 +1,116 @@ + + + diff --git a/src/views/exam/userDetails.vue b/src/views/exam/userDetails.vue index 2e0fd78..52bdcb3 100644 --- a/src/views/exam/userDetails.vue +++ b/src/views/exam/userDetails.vue @@ -17,7 +17,6 @@ const props = defineProps<{ }>(); function searchCallback(data) {} - const table = ref<{ initTable: (config: TableConfig) => void }>(); const tableData: TableConfig = { apiUrl: ControllerName, @@ -28,8 +27,9 @@ const tableData: TableConfig = { // 查询条件 show: true, PageIndex: 0, - PageSize: 20, - OrderBy: "Id", // 排序 + PageSize: 60, + OrderBy: "AssignRanking", // 排序 + OrderByType: 0, defaultConditions: [], // 默认查询条件 Conditions: [] }, @@ -39,13 +39,21 @@ const tableData: TableConfig = { // 操作按钮 topBtn: true, // 是头部按钮 label: "成绩升序", - btnStyle: "primary" + btnStyle: "primary", + click: (o, r, c) => { + tableData.search.OrderByType = 1; + c(); + } }, { // 操作按钮 topBtn: true, // 是头部按钮 label: "成绩降序", - btnStyle: "primary" + btnStyle: "primary", + click: (o, r, c) => { + tableData.search.OrderByType = 0; + c(); + } }, { topBtn: false, // 头部按钮 @@ -140,8 +148,19 @@ onMounted(async () => { showTable.value = true; }); +const exam = props.data[0];