dev #8

Merged
hy merged 45 commits from dev into master 2025-08-26 19:03:29 +08:00
4 changed files with 148 additions and 8 deletions
Showing only changes of commit 733b406eb7 - Show all commits

View File

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

View File

@ -68,7 +68,7 @@ const tableData: TableConfig = {
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" //

View File

@ -0,0 +1,116 @@
<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", //
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: "100px",
custom: s => `${s.gradeYear}${s.gradeLevel}`,
search: true,
add: false, //
edit: false //
},
className: {
label: "班级",
width: "150px",
search: true,
searchType: ConditionalType.Like, //
add: false, //
edit: false //
},
peopleCount: {
label: "参考人数",
width: "100px",
search: false,
add: false, //
edit: false //
},
entryPerson: {
label: "录入人",
width: "200px",
search: true,
add: false, //
edit: false //
},
createTime: {
label: "录入时间",
width: "200px",
search: true,
add: false, //
edit: 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

@ -17,7 +17,6 @@ const props = defineProps<{
}>(); }>();
function searchCallback(data) {} function searchCallback(data) {}
const table = ref<{ initTable: (config: TableConfig) => void }>(); const table = ref<{ initTable: (config: TableConfig) => void }>();
const tableData: TableConfig = { const tableData: TableConfig = {
apiUrl: ControllerName, apiUrl: ControllerName,
@ -28,8 +27,9 @@ const tableData: TableConfig = {
// //
show: true, show: true,
PageIndex: 0, PageIndex: 0,
PageSize: 20, PageSize: 60,
OrderBy: "Id", // OrderBy: "AssignRanking", //
OrderByType: 0,
defaultConditions: [], // defaultConditions: [], //
Conditions: [] Conditions: []
}, },
@ -39,13 +39,21 @@ const tableData: TableConfig = {
// //
topBtn: true, // topBtn: true, //
label: "成绩升序", label: "成绩升序",
btnStyle: "primary" btnStyle: "primary",
click: (o, r, c) => {
tableData.search.OrderByType = 1;
c();
}
}, },
{ {
// //
topBtn: true, // topBtn: true, //
label: "成绩降序", label: "成绩降序",
btnStyle: "primary" btnStyle: "primary",
click: (o, r, c) => {
tableData.search.OrderByType = 0;
c();
}
}, },
{ {
topBtn: false, // topBtn: false, //
@ -140,8 +148,19 @@ onMounted(async () => {
showTable.value = true; showTable.value = true;
}); });
const exam = props.data[0];
</script> </script>
<template> <template>
<div><ahTable v-if="showTable" ref="table" :tableConfig="tableData" /></div> <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>
</template> </template>