修复文件问题 修改bug

This commit is contained in:
2026-02-06 00:04:33 +08:00
parent 779b779910
commit de2d64210f
18 changed files with 1712 additions and 894 deletions

View File

@@ -1,21 +1,21 @@
<template>
<div class="modern-page-container">
<div class="page-wrapper">
<!-- ?????? -->
<!-- 查询条件 -->
<el-card v-show="showSearch" class="search-card" shadow="never">
<template #header>
<div class="card-header">
<span class="card-title">
<el-icon class="title-icon"><Search /></el-icon>
?????
查询条件
</span>
</div>
</template>
<el-form :model="state.queryForm" ref="searchFormRef" :inline="true" @keyup.enter="getDataList" class="search-form">
<el-form-item label="??" prop="termId">
<el-form-item label="学期" prop="termId">
<el-select
v-model="state.queryForm.termId"
placeholder="?????"
placeholder="请选择学期"
clearable
filterable
style="width: 200px">
@@ -27,10 +27,10 @@
</el-option>
</el-select>
</el-form-item>
<el-form-item label="??" prop="deptCode">
<el-form-item label="学院" prop="deptCode">
<el-select
v-model="state.queryForm.deptCode"
placeholder="?????"
placeholder="请选择学院"
clearable
filterable
style="width: 200px">
@@ -42,10 +42,10 @@
</el-option>
</el-select>
</el-form-item>
<el-form-item label="????" prop="grade">
<el-form-item label="入学年份" prop="grade">
<el-select
v-model="state.queryForm.grade"
placeholder="???????"
placeholder="请选择入学年份"
clearable
filterable
style="width: 200px">
@@ -57,19 +57,19 @@
</el-option>
</el-select>
</el-form-item>
<el-form-item label="??" prop="gradeCurr">
<el-form-item label="年级" prop="gradeCurr">
<el-input-number
v-model="state.queryForm.gradeCurr"
placeholder="?????"
placeholder="请输入年级"
:min="1"
:max="10"
clearable
style="width: 200px" />
</el-form-item>
<el-form-item label="??" prop="classCode">
<el-form-item label="班级" prop="classCode">
<el-select
v-model="state.queryForm.classCode"
placeholder="?????"
placeholder="请选择班级"
clearable
filterable
style="width: 200px">
@@ -81,10 +81,10 @@
</el-option>
</el-select>
</el-form-item>
<el-form-item label="????" prop="checkStatus">
<el-form-item label="审核状态" prop="checkStatus">
<el-select
v-model="state.queryForm.checkStatus"
placeholder="???????"
placeholder="请选择审核状态"
clearable
style="width: 200px">
<el-option
@@ -96,26 +96,26 @@
</el-select>
</el-form-item>
<el-form-item>
<el-button type="primary" plain icon="Search" @click="getDataList">??</el-button>
<el-button icon="Refresh" @click="handleReset">??</el-button>
<el-button type="primary" plain icon="Search" @click="getDataList">查询</el-button>
<el-button icon="Refresh" @click="handleReset">重置</el-button>
</el-form-item>
</el-form>
</el-card>
<!-- ???? -->
<!-- 数据列表 -->
<el-card class="content-card" shadow="never">
<template #header>
<div class="card-header">
<span class="card-title">
<el-icon class="title-icon"><Document /></el-icon>
????????
免学费学生列表
</span>
<div class="header-actions">
<el-button
icon="Plus"
type="primary"
@click="handleAdd">
??
新增
</el-button>
<el-button
icon="Download"
@@ -123,7 +123,7 @@
class="ml10"
:loading="exportLoading"
@click="handleExport">
??
导出
</el-button>
<right-toolbar
v-model:showSearch="showSearch"
@@ -139,7 +139,7 @@
@order-change="handleColumnOrderChange"
>
<template #trigger>
<el-tooltip class="item" effect="dark" content="???" placement="top">
<el-tooltip class="item" effect="dark" content="列设置" placement="top">
<el-button circle style="margin-left: 0;">
<el-icon><Menu /></el-icon>
</el-button>
@@ -151,7 +151,7 @@
</div>
</template>
<!-- ?? -->
<!-- 表格 -->
<el-table
:data="state.dataList"
v-loading="state.loading"
@@ -159,7 +159,7 @@
:cell-style="tableStyle.cellStyle"
:header-cell-style="tableStyle.headerCellStyle"
class="modern-table">
<el-table-column type="index" label="??" width="70" align="center">
<el-table-column type="index" label="序号" width="70" align="center">
<template #header>
<el-icon><List /></el-icon>
</template>
@@ -169,7 +169,7 @@
</el-table-column>
<template v-for="col in visibleColumnsSorted" :key="col.prop || col.label">
<el-table-column
v-if="checkColumnVisible(col.prop || '') && col.prop !== '??'"
v-if="checkColumnVisible(col.prop || '') && col.prop !== '序号'"
:prop="col.prop"
:label="col.label"
show-overflow-tooltip
@@ -180,39 +180,39 @@
<el-icon><component :is="columnConfigMap[col.prop]?.icon || Calendar" /></el-icon>
<span style="margin-left: 4px">{{ col.label }}</span>
</template>
<!-- ????????-->
<!-- 年级格式化-->
<template v-if="col.prop === 'gradeCurr'" #default="scope">
<el-tag v-if="scope.row.gradeCurr !== undefined && scope.row.gradeCurr !== null" size="small" type="primary" effect="plain">
{{ scope.row.gradeCurr }}
</el-tag>
<span v-else>-</span>
</template>
<!-- ????????-->
<!-- 性别格式化-->
<template v-else-if="col.prop === 'gender'" #default="scope">
<GenderTag :sex="scope.row.gender" />
</template>
<!-- ????????-->
<!-- 学历格式化-->
<template v-else-if="col.prop === 'education'" #default="scope">
<el-tag v-if="scope.row.education" size="small" type="info" effect="plain">
{{ formatEducation(scope.row.education) }}
</el-tag>
<span v-else>-</span>
</template>
<!-- ????????-->
<!-- 专业层次格式化-->
<template v-else-if="col.prop === 'majorLevel'" #default="scope">
<el-tag v-if="scope.row.majorLevel" size="small" type="warning" effect="plain">
{{ formatMajorLevel(scope.row.majorLevel) }}
</el-tag>
<span v-else>-</span>
</template>
<!-- ????????-->
<!-- 金额格式化-->
<template v-else-if="col.prop === 'money'" #default="scope">
<el-tag v-if="scope.row.money !== undefined && scope.row.money !== null" size="small" type="success" effect="plain">
?{{ scope.row.money }}
¥{{ scope.row.money }}
</el-tag>
<span v-else>-</span>
</template>
<!-- ????????? -->
<!-- 审核状态格式化 -->
<template v-else-if="col.prop === 'checkStatus'" #default="scope">
<StatusTag
:value="scope.row.checkStatus"
@@ -222,10 +222,10 @@
</template>
</el-table-column>
</template>
<el-table-column label="??" width="150" align="center" fixed="right">
<el-table-column label="操作" width="150" align="center" fixed="right">
<template #header>
<el-icon><Setting /></el-icon>
<span style="margin-left: 4px">??</span>
<span style="margin-left: 4px">操作</span>
</template>
<template #default="scope">
<el-button
@@ -233,20 +233,20 @@
link
type="primary"
@click="handleEdit(scope.row)">
??
编辑
</el-button>
<el-button
icon="Delete"
link
type="danger"
@click="handleDelete(scope.row)">
??
删除
</el-button>
</template>
</el-table-column>
</el-table>
<!-- ?? -->
<!-- 分页 -->
<div class="pagination-wrapper">
<pagination
@size-change="sizeChangeHandle"
@@ -256,7 +256,7 @@
</el-card>
</div>
<!-- ??/?????? -->
<!-- 新增/编辑对话框 -->
<!-- <form-dialog ref="formDialogRef" @refresh="getDataList" /> -->
</div>
</template>
@@ -282,11 +282,11 @@ import {
import { useTableColumnControl } from '/@/hooks/tableColumn'
// ????
// 异步组件
const GenderTag = defineAsyncComponent(() => import('/@/components/GenderTag/index.vue'))
const StatusTag = defineAsyncComponent(() => import('/@/components/StatusTag/index.vue'))
// ??????
// 定义变量
const route = useRoute()
const searchFormRef = ref()
const columnControlRef = ref<any>()
@@ -301,29 +301,29 @@ const genderList = ref<any[]>([])
const educationList = ref<any[]>([])
const majorLevelList = ref<any[]>([])
const checkStatusList = ref<any[]>([
{ label: '???', value: '0' },
{ label: '????', value: '1' }
{ label: '未审核', value: '0' },
{ label: '已审核', value: '1' }
])
// ??????
// 表格列配置
const tableColumns = [
{ prop: 'deptName', label: '??', minWidth: 150 },
{ prop: 'majorName', label: '??', minWidth: 150 },
{ prop: 'teacherName', label: '???', width: 100 },
{ prop: 'grade', label: '????', width: 100 },
{ prop: 'gradeCurr', label: '??', width: 80 },
{ prop: 'classNo', label: '??', width: 120 },
{ prop: 'stuNo', label: '??', width: 120 },
{ prop: 'realName', label: '??', width: 100 },
{ prop: 'gender', label: '??', width: 80 },
{ prop: 'education', label: '??', width: 100 },
{ prop: 'majorLevel', label: '??', width: 100 },
{ prop: 'phone', label: '????', width: 120 },
{ prop: 'money', label: '??', width: 100 },
{ prop: 'checkStatus', label: '????', width: 100 }
{ prop: 'deptName', label: '学院', minWidth: 150 },
{ prop: 'majorName', label: '专业', minWidth: 150 },
{ prop: 'teacherName', label: '班主任', width: 100 },
{ prop: 'grade', label: '入学年份', width: 100 },
{ prop: 'gradeCurr', label: '年级', width: 80 },
{ prop: 'classNo', label: '班级', width: 120 },
{ prop: 'stuNo', label: '学号', width: 120 },
{ prop: 'realName', label: '姓名', width: 100 },
{ prop: 'gender', label: '性别', width: 80 },
{ prop: 'education', label: '学历', width: 100 },
{ prop: 'majorLevel', label: '层次', width: 100 },
{ prop: 'phone', label: '联系电话', width: 120 },
{ prop: 'money', label: '金额', width: 100 },
{ prop: 'checkStatus', label: '审核状态', width: 100 }
]
// ????????????
// 列配置映射
const columnConfigMap: Record<string, { icon: any }> = {
deptName: { icon: OfficeBuilding },
majorName: { icon: Reading },
@@ -341,22 +341,22 @@ const columnConfigMap: Record<string, { icon: any }> = {
checkStatus: { icon: CircleCheck }
}
// ???????hook
// 表格列控制hook
const {
visibleColumns,
visibleColumnsSorted,
checkColumnVisible,
handleColumnChange,
handleColumnOrderChange
} = useTableColumnControl(tableColumns, route.path)
} = useTableColumnControl(tableColumns)
// ????
// 表格样式
const tableStyle = {
cellStyle: { padding: '8px 0' },
headerCellStyle: { background: '#f5f7fa', color: '#606266', fontWeight: 'bold' }
}
// ?? useTable
// 使用 useTable
const state: BasicTableProps = reactive<BasicTableProps>({
queryForm: {
termId: '',
@@ -382,7 +382,7 @@ const {
tableStyle: _tableStyle
} = useTable(state)
// ?????
// 格式化性别
const formatGender = (value: string | number) => {
if (value === null || value === undefined || value === '') {
return '-'
@@ -391,7 +391,7 @@ const formatGender = (value: string | number) => {
return dictItem ? dictItem.label : value
}
// ??????
// 格式化学历
const formatEducation = (value: string | number) => {
if (value === null || value === undefined || value === '') {
return '-'
@@ -400,7 +400,7 @@ const formatEducation = (value: string | number) => {
return dictItem ? dictItem.label : value
}
// ??????
// 格式化层次
const formatMajorLevel = (value: string | number) => {
if (value === null || value === undefined || value === '') {
return '-'
@@ -409,7 +409,7 @@ const formatMajorLevel = (value: string | number) => {
return dictItem ? dictItem.label : value
}
// ????????
// 格式化审核状态
const formatCheckStatus = (value: string | number) => {
if (value === null || value === undefined || value === '') {
return '-'
@@ -418,7 +418,7 @@ const formatCheckStatus = (value: string | number) => {
return dictItem ? dictItem.label : value
}
// ??
// 重置
const handleReset = () => {
searchFormRef.value?.resetFields()
state.queryForm.termId = ''
@@ -430,40 +430,40 @@ const handleReset = () => {
getDataList()
}
// ??
// 新增
const handleAdd = () => {
useMessage().info('?????')
useMessage().info('功能开发中')
// formDialogRef.value?.openDialog('add')
}
// ??
// 编辑
const handleEdit = (row: any) => {
useMessage().info('?????')
useMessage().info('功能开发中')
// formDialogRef.value?.openDialog('edit', row.id)
}
// ??
// 删除
const handleDelete = async (row: any) => {
try {
const { confirm } = useMessageBox()
await confirm(`???????? ${row.stuNo} ????????`)
await confirm(`确定要删除学号为 ${row.stuNo} 的学生记录吗?`)
await delObj(row.id)
useMessage().success('????')
useMessage().success('删除成功')
getDataList()
} catch (err: any) {
if (err !== 'cancel') {
useMessage().error(err.msg || '????')
useMessage().error(err.msg || '删除失败')
}
}
}
// ??
// 导出
const handleExport = async () => {
try {
exportLoading.value = true
const res = await exportExcel(state.queryForm)
const blob = new Blob([res.data as BlobPart])
const fileName = `?????_${new Date().getTime()}.xls`
const fileName = `免学费学生_${new Date().getTime()}.xls`
const elink = document.createElement('a')
elink.download = fileName
elink.style.display = 'none'
@@ -472,15 +472,15 @@ const handleExport = async () => {
elink.click()
URL.revokeObjectURL(elink.href)
document.body.removeChild(elink)
useMessage().success('????')
useMessage().success('导出成功')
} catch (err: any) {
useMessage().error(err.msg || '????')
useMessage().error(err.msg || '导出失败')
} finally {
exportLoading.value = false
}
}
// ??????
// 获取学期列表
const getTermList = async () => {
try {
const res = await request({
@@ -497,7 +497,7 @@ const getTermList = async () => {
}
}
// ??????
// 获取学院列表
const getDeptListData = async () => {
try {
const res = await getDeptList()
@@ -511,7 +511,7 @@ const getDeptListData = async () => {
}
}
// ??????
// 获取班级列表
const getClassListData = async () => {
try {
const res = await getClassListByRole()
@@ -525,7 +525,7 @@ const getClassListData = async () => {
}
}
// ????????
// 获取入学年份列表
const getGradeList = async () => {
try {
const res = await queryAllSchoolYear()
@@ -539,7 +539,7 @@ const getGradeList = async () => {
}
}
// ??????
// 获取性别字典
const getGenderDict = async () => {
try {
const res = await getDicts('sexy')
@@ -556,7 +556,7 @@ const getGenderDict = async () => {
}
}
// ??????
// 获取学历字典
const getEducationDict = async () => {
try {
const res = await getDicts('pre_school_education')
@@ -573,7 +573,7 @@ const getEducationDict = async () => {
}
}
// ??????
// 获取层次字典
const getMajorLevelDict = async () => {
try {
const res = await getDicts('basic_major_level')
@@ -590,7 +590,7 @@ const getMajorLevelDict = async () => {
}
}
// ????
// 初始化
onMounted(() => {
getTermList()
getDeptListData()