修復打包問題

This commit is contained in:
RISE
2026-01-30 18:02:42 +08:00
parent 3324dbf6dd
commit 02cda4ea1e
27 changed files with 1287 additions and 875 deletions

View File

@@ -0,0 +1,258 @@
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
修复项目中因编码损坏产生的 U+FFFD 替换字符及未闭合字符串。
遍历 src 下所有 .vue .ts .js 文件,应用预定义的替换规则。
"""
import os
import sys
# U+FFFD 替换字符
R = '\ufffd'
# 替换规则:(错误片段, 正确文本) 错误片段中含 R 表示 U+FFFD
# 顺序:长的、具体的放前面,避免短规则误替换
REPLACEMENTS = [
# content="列设? placement= 未闭合
('content="列设' + R + '? placement="top"', 'content="列设置" placement="top"'),
# 筛选条件
('筛选条' + R + '?', '筛选条件'),
# 列表/条件
('助学金批次列' + R + '?', '助学金批次列表'),
('学生处分列' + R + '?', '学生处分列表'),
('勤工助学考勤列' + R + '?', '勤工助学考勤列表'),
('评优评先奖项列' + R + '?', '评优评先奖项列表'),
# 列设置
('列设' + R + '?', '列设置'),
# 表格列配置
('表格列配' + R + '?', '表格列配置'),
# 日期 placeholder
('start-placeholder="开始日' + R + '?', 'start-placeholder="开始日期'),
('end-placeholder="结束日' + R + '?', 'end-placeholder="结束日期'),
('开始日' + R + '?', '开始日期'),
('到期日' + R + '?', '到期日'),
('结束日' + R + '?', '结束日期'),
# range-separator
('range-separator="' + R + '?', 'range-separator="'),
('range-separator="' + R + R, 'range-separator="'),
# 格式化学期/季度/类别
('格式化学' + R + '?', '格式化学期'),
('格式化季' + R + '?', '格式化季度'),
('格式化类' + R + '?', '格式化类别'),
# 负责人/所属类别
('负责' + R + '?', '负责人'),
('所属类' + R + '?', '所属类别'),
# placeholder 未闭合 (缺结尾引号)
('请选择所属类' + R + '? ', '请选择所属类别" '),
('请输入姓' + R + '? ', '请输入姓名" '),
('请输入学' + R + '? ', '请输入学号" '),
('请输入班' + R + '? ', '请输入班号" '),
# 班主任
('班主任姓' + R + '?', '班主任姓名'),
('班主任电' + R + '?', '班主任电话'),
# 注释:用于图标
('用于图标' + R + '?', '用于图标显示)'),
('用于图标' + R + '?', '用于图标显示'),
# 初始化/数据
('初始' + R + '?', '初始化'),
('自动获取数' + R + '?', '自动获取数据'),
# 删除批次
('删除批' + R + '?"', '删除批次"'),
('删除批' + R + '?', '删除批次'),
# 特殊模板 注释
('学期列特殊模' + R + '?-->', '学期列特殊模板 -->'),
('人数列特殊模' + R + '?-->', '人数列特殊模板 -->'),
('成立时间列特殊模' + R + '?-->', '成立时间列特殊模板 -->'),
('需关爱类型列特殊模' + R + '?-->', '需关爱类型列特殊模板 -->'),
('记录时间列特殊模' + R + '?-->', '记录时间列特殊模板 -->'),
('干预结果列特殊模' + R + '?-->', '干预结果列特殊模板 -->'),
('考勤类型列特殊模' + R + '?-->', '考勤类型列特殊模板 -->'),
('落实情况列特殊模' + R + '?-->', '落实情况列特殊模板 -->'),
# tableColumns label 未闭合
("label: '班主任姓" + R + "? },", "label: '班主任姓名' }, "),
("label: '班主任电" + R + "? },", "label: '班主任电话' }, "),
("label: '开始日" + R + "?, icon:", "label: '开始日期', icon:"),
# 宿舍/班级/状态等
('宿舍' + R + '?', '宿舍号'),
('班级简' + R + '?', '班级简称'),
('操行平均' + R + '?', '操行平均分'),
('总评成绩平均' + R + '?', '总评成绩平均分'),
('处分状' + R + '?', '处分状态'),
('待审' + R + '?', '待审核'),
('' + R + '状态', '审核状态'),
# 更多常见
('请输入团员编' + R + '? ', '请输入团员编号" '),
('教学楼管理列' + R + '?', '教学楼管理列表'),
('原班' + R + '?', '原班级'),
("label: '请假开始时" + R + "?', icon:", "label: '请假开始时间', icon:"),
('类型列特殊模' + R + '?-->', '类型列特殊模板 -->'),
('入团时间列特殊模' + R + '?-->', '入团时间列特殊模板 -->'),
('考核时间列特殊模' + R + '?-->', '考核时间列特殊模板 -->'),
# 确定要删除...吗?
('教学楼吗' + R + '?)', '教学楼吗?)'),
# label 请假开始时间(逗号结尾变体)
("label: '请假开始时" + R + "?,", "label: '请假开始时间',"),
# range-separator 双替换符
('range-separator="' + R + R + '"', 'range-separator=""'),
('range-separator="' + R + R + '\n', 'range-separator=""\n'),
# range/start/end placeholder 缺结尾引号
('range-separator="\n start-placeholder="开始日期\n', 'range-separator=""\n start-placeholder="开始日期"\n'),
('start-placeholder="开始日期\n end-placeholder="结束日期"', 'start-placeholder="开始日期"\n end-placeholder="结束日期"'),
# 工学交替/带班教师 列特殊模板
('工学交替结束时间列特殊模' + R + '?-->', '工学交替结束时间列特殊模板 -->'),
('带班教师列特殊模' + R + '?-->', '带班教师列特殊模板 -->'),
# 班级简称 缺引号
("label: '班级简称 ", "label: '班级简称', "),
("label: '工学交替开始时" + R + "?, width:", "label: '工学交替开始时间', width:"),
# 确定要删除这条记录吗?
('这条记录吗' + R + ')', '这条记录吗?)'),
# 音/频 等(多字符损坏)
('播放' + R + R + R + '', '播放音频'),
# 团内职务/异动时间/附件列特殊模板
('团内职务列特殊模' + R + '?-->', '团内职务列特殊模板 -->'),
('异动时间列特殊模' + R + '?-->', '异动时间列特殊模板 -->'),
('附件列特殊模' + R + '?-->', '附件列特殊模板 -->'),
# 现班号/格式化日期/异动类型/转制类型
("label: '现班" + R + "? },", "label: '现班号' },"),
('现班' + R + '?', '现班号'),
('格式化日' + R + '?', '格式化日期'),
('格式化异动类' + R + '?', '格式化异动类型'),
('格式化转制类' + R + '?', '格式化转制类型'),
# 按钮文字:导出/新增
('' + R + '', '导出'),
('' + R + '', '新增'),
# 班主任label 等)
("label: '班主" + R + "?,", "label: '班主任',"),
("label: '班主" + R + "? ", "label: '班主任' "),
# 将文件拖到此处,<em>R?em 或 Rem
('将文件拖到此处,' + R + '?em>', '将文件拖到此处,<em>'),
('将文件拖到此处,' + R + 'em>', '将文件拖到此处,<em>'),
# 取消/确定 按钮(>??</el-button>
('= false">' + R + R + '</el-button>', '= false">取消</el-button>'),
('importLoading">' + R + R + '</el-button>', 'importLoading">确定</el-button>'),
(':loading="importLoading">' + R + R + '</el-button>', ':loading="importLoading">确定</el-button>'),
('' + R + '消</el-button>', '取消</el-button>'),
('' + R + '定</el-button>', '确定</el-button>'),
# confirm 记录吗R? 或 R
('记录吗' + R + '?)', "记录吗?')"),
('记录吗' + R + ')', '记录吗?)'),
# 注释与文案
('不实' + R + '?', '不实现'),
('只能上传一个文' + R + '?', '只能上传一个文件'),
('文件不存' + R + '?', '文件不存在'),
# 时间
('日期时' + R + '?', '日期时间'),
('和时' + R + '?', '和时间'),
("label: '开始时" + R + "?,", "label: '开始时间',"),
('开始时' + R + '?', '开始时间'),
]
# 字面问号乱码(非 U+FFFD的通用替换仅用于明确无歧义的
LITERAL_QUESTION_REPLACEMENTS = [
('content="???" placement="top"', 'content="列设置" placement="top"'),
("col.prop !== '??'", "col.prop !== '操作'"),
('<el-table-column type="index" label="??" width="70"', '<el-table-column type="index" label="序号" width="70"'),
('<el-table-column label="??" width="150"', '<el-table-column label="操作" width="150"'),
('<el-table-column label="??" width="200"', '<el-table-column label="操作" width="200"'),
('<el-table-column label="??" width="250"', '<el-table-column label="操作" width="250"'),
('<span style="margin-left: 4px">??</span>\n </template>', '<span style="margin-left: 4px">操作</span>\n </template>'),
('@click="handleEdit(scope.row)">\n ??\n </el-button>', '@click="handleEdit(scope.row)">\n 编辑\n </el-button>'),
('@click="handleDelete(scope.row)">\n ??\n </el-button>', '@click="handleDelete(scope.row)">\n 删除\n </el-button>'),
('<!-- ?? -->\n <el-table', '<!-- 表格 -->\n <el-table'),
('<!-- ?? -->\n <div class="pagination-wrapper">', '<!-- 分页 -->\n <div class="pagination-wrapper">'),
('<el-button @click="importDialogVisible = false">??</el-button>', '<el-button @click="importDialogVisible = false">取消</el-button>'),
('@click="confirmInit" :loading="initLoading">??</el-button>', '@click="confirmInit" :loading="initLoading">确定</el-button>'),
(':disabled="!importFile || importLoading">??</el-button>', ':disabled="!importFile || importLoading">确定</el-button>'),
# label + prop 上下文
('label="??" prop="schoolYear"', 'label="学年" prop="schoolYear"'),
('label="??" prop="schoolTerm"', 'label="学期" prop="schoolTerm"'),
('label="??" prop="deptCode"', 'label="学院" prop="deptCode"'),
('label="??" prop="classCode"', 'label="班级" prop="classCode"'),
('label="??" prop="realName"', 'label="姓名" prop="realName"'),
('label="??" prop="gradeCurr"', 'label="年级" prop="gradeCurr"'),
('label="??" prop="year"', 'label="学年" prop="year"'),
('label="??" prop="period"', 'label="学期" prop="period"'),
('label="??" prop="buildNo"', 'label="楼号" prop="buildNo"'),
('label="??" prop="conductType"', 'label="类型" prop="conductType"'),
('label="??" prop="stuNo"', 'label="学号" prop="stuNo"'),
('label="??" prop="source"', 'label="来源" prop="source"'),
('label="??" prop="termId"', 'label="学期" prop="termId"'),
('label="???" prop="roomNo"', 'label="宿舍号" prop="roomNo"'),
('label="????" prop="grade"', 'label="入学年份" prop="grade"'),
('label="????" prop="checkStatus"', 'label="审核状态" prop="checkStatus"'),
('label="????" prop="effectiveMoney"', 'label="可用余额" prop="effectiveMoney"'),
('label="????" prop="isLiveNum"', 'label="在住人数" prop="isLiveNum"'),
('label="????" prop="costMoney"', 'label="补贴金额" prop="costMoney"'),
('label="????" prop="punlishMonth"', 'label="处分月份" prop="punlishMonth"'),
('label="????" prop="punlishLevel"', 'label="处分级别" prop="punlishLevel"'),
('label="????" prop="ruleName"', 'label="奖项名称" prop="ruleName"'),
# placeholder 按上下文(需避免误替换,用较长片段)
('placeholder="?????" \n clearable\n filterable', 'placeholder="请选择学年" \n clearable\n filterable'),
('placeholder="?????" \n clearable\n style="width: 200px">', 'placeholder="请选择学期" \n clearable\n style="width: 200px">'),
('placeholder="?????" \n clearable\n filterable\n style="width: 200px">', 'placeholder="请选择学院" \n clearable\n filterable\n style="width: 200px">'),
('placeholder="?????" \n clearable\n style="width: 200px" />', 'placeholder="请输入姓名" \n clearable\n style="width: 200px" />'),
('placeholder="??????" \n clearable', 'placeholder="请输入宿舍号" \n clearable'),
('placeholder="???????" \n clearable', 'placeholder="请输入奖项名称" \n clearable'),
('placeholder="??????" \n clearable', 'placeholder="请输入年级" \n clearable'),
('placeholder="???????" \n clearable', 'placeholder="请选择审核状态" \n clearable'),
('placeholder="??????" \n :min="0"', 'placeholder="请输入可用余额" \n :min="0"'),
('placeholder="???" \n clearable', 'placeholder="请输入人数" \n clearable'),
('placeholder="?????" \n clearable\n filterable\n style="width: 200px"\n @change', 'placeholder="请选择学院" \n clearable\n filterable\n style="width: 200px"\n @change'),
('placeholder="??????" \n style="width: 100%"', 'placeholder="请输入补贴金额" \n style="width: 100%"'),
('placeholder="??????" \n clearable\n style="width: 200px">', 'placeholder="请选择处分月份" \n clearable\n style="width: 200px">'),
('placeholder="???????" \n clearable\n style="width: 200px">', 'placeholder="请选择处分级别" \n clearable\n style="width: 200px">'),
# 按钮文字
('@click="handleSearch">??</el-button>', '@click="handleSearch">查询</el-button>'),
('@click="handleReset">??</el-button>', '@click="handleReset">重置</el-button>'),
# 选项
('<el-option label="????" value="history"', '<el-option label="历史数据" value="history"'),
('<el-option label="??" value="attendance"', '<el-option label="考勤" value="attendance"'),
]
def fix_file(filepath):
try:
with open(filepath, 'r', encoding='utf-8', errors='replace') as f:
content = f.read()
except Exception as e:
print(f" [SKIP] read error: {e}", file=sys.stderr)
return False
original = content
for wrong, right in REPLACEMENTS:
if wrong in content:
content = content.replace(wrong, right)
for wrong, right in LITERAL_QUESTION_REPLACEMENTS:
if wrong in content:
content = content.replace(wrong, right)
if content != original:
try:
with open(filepath, 'w', encoding='utf-8') as f:
f.write(content)
return True
except Exception as e:
print(f" [SKIP] write error: {e}", file=sys.stderr)
return False
return False
def main():
root = os.path.join(os.path.dirname(__file__), '..', 'src')
root = os.path.abspath(root)
exts = ('.vue', '.ts', '.js')
modified = []
for dirpath, _dirnames, filenames in os.walk(root):
for name in filenames:
if not name.endswith(exts):
continue
path = os.path.join(dirpath, name)
rel = os.path.relpath(path, root)
if fix_file(path):
modified.append(rel)
if modified:
print(f"Fixed {len(modified)} file(s):")
for p in sorted(modified):
print(f" {p}")
else:
print("No files needed fixing.")
return 0
if __name__ == '__main__':
sys.exit(main())

View File

@@ -0,0 +1,96 @@
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""一次性修复 stuunionleague/index.vue 中所有乱码为正确中文"""
path = 'src/views/stuwork/stuunionleague/index.vue'
with open(path, 'r', encoding='utf-8') as f:
s = f.read()
# 按上下文唯一性从长到短替换,避免短串误替换
replacements = [
# 模板 - 注释与标题
('<!-- ?????? -->', '<!-- 搜索表单卡片 -->'),
('<!-- ???? -->', '<!-- 内容卡片 -->'),
('<!-- ?? -->', '<!-- 表格 -->'),
('<!-- ?? -->', '<!-- 分页 -->'),
('<!-- ??/?????? -->', '<!-- 新增/编辑表单弹窗 -->'),
('<!-- ???? -->', '<!-- 导入弹窗 -->'),
('??????', '学生团员列表'),
('????', '筛选条件'),
('将文件拖到此处,<em>点击上传</em>', '将文件拖到此处,<em>点击上传</em>'), # 已正确则不动
('????????<em>????</em>', '将文件拖到此处,<em>点击上传</em>'),
('???? xlsx/xls ??', '只能上传 xlsx/xls 文件'),
# 表单项 label / placeholder
('label="??" prop="classCode"', 'label="班级" prop="classCode"'),
('placeholder="?????" \n clearable\n filterable', 'placeholder="请选择班级" \n clearable\n filterable'),
('label="??" prop="classNo"', 'label="班号" prop="classNo"'),
('placeholder="?????" \n clearable\n style="width: 200px" />', 'placeholder="请输入班号" \n clearable\n style="width: 200px" />'),
('label="??" prop="realName"', 'label="姓名" prop="realName"'),
('placeholder="?????" \n clearable\n style="width: 200px" />\n </el-form-item>\n <el-form-item label="????" prop="serNo"', 'placeholder="请输入姓名" \n clearable\n style="width: 200px" />\n </el-form-item>\n <el-form-item label="团员编号" prop="serNo"'),
('placeholder="???????" \n clearable\n style="width: 200px" />\n </el-form-item>\n <el-form-item label="????" prop="grade"', 'placeholder="请输入团员编号" \n clearable\n style="width: 200px" />\n </el-form-item>\n <el-form-item label="入学年份" prop="grade"'),
('placeholder="???????" \n clearable\n style="width: 200px">', 'placeholder="请选择入学年份" \n clearable\n style="width: 200px">'),
# 按钮
('@click="getDataList">??</el-button>', '@click="getDataList">查询</el-button>'),
('@click="handleReset">??</el-button>', '@click="handleReset">重置</el-button>'),
('@click="formDialogRef.openDialog()">\n ??\n </el-button>', '@click="formDialogRef.openDialog()">\n 新增\n </el-button>'),
('@click="handleImport">\n ??\n </el-button>', '@click="handleImport">\n 导入\n </el-button>'),
('@click="handleExport">\n ??\n </el-button>', '@click="handleExport">\n 导出\n </el-button>'),
('content="???" placement="top"', 'content="列设置" placement="top"'),
('label="??" width="70"', 'label="序号" width="70"'),
("col.prop !== '??'", "col.prop !== '操作'"),
('<!-- ????????? -->\n <template v-if="col.prop === \'enterTime\'"', '<!-- 入团时间列特殊模板 -->\n <template v-if="col.prop === \'enterTime\'"'),
('<!-- ????????? -->\n <template v-else-if="col.prop === \'position\'"', '<!-- 团内职务列特殊模板 -->\n <template v-else-if="col.prop === \'position\'"'),
('<el-table-column label="??" width="150"', '<el-table-column label="操作" width="150"'),
('<span style="margin-left: 4px">??</span>\n </template>\n <template #default="scope">\n <el-button \n icon="Edit"', '<span style="margin-left: 4px">操作</span>\n </template>\n <template #default="scope">\n <el-button \n icon="Edit"'),
('@click="handleEdit(scope.row)">\n ??\n </el-button>', '@click="handleEdit(scope.row)">\n 编辑\n </el-button>'),
('@click="handleDelete(scope.row)">\n ??\n </el-button>', '@click="handleDelete(scope.row)">\n 删除\n </el-button>'),
('title="????" \n v-model="importDialogVisible"', 'title="导入团员" \n v-model="importDialogVisible"'),
('importDialogVisible = false">??</el-button>', 'importDialogVisible = false">取消</el-button>'),
('handleImportSubmit" :loading="importLoading">??</el-button>', 'handleImportSubmit" :loading="importLoading">确定</el-button>'),
# script - 注释
('// ??????', '// 定义变量内容'),
('// ??????', '// 表格列配置'),
('// ????????????', '// 列配置映射(用于图标显示)'),
('// ???????hook', '// 使用表格列控制hook'),
('// ????', '// 表格样式'),
('// ?? useTable', '// 配置 useTable'),
('// ??\nconst handleReset', '// 重置\nconst handleReset'),
('// ??\nconst handleEdit', '// 编辑\nconst handleEdit'),
('// ??\nconst handleDelete', '// 删除\nconst handleDelete'),
('// ??\nconst handleImport', '// 导入\nconst handleImport'),
('// ????\nconst handleFileChange', '// 文件变化\nconst handleFileChange'),
('// ??????\nconst handleExceed', '// 文件超出限制\nconst handleExceed'),
('// ????\nconst handleImportSubmit', '// 提交导入\nconst handleImportSubmit'),
('// ??\nconst handleExport', '// 导出\nconst handleExport'),
('// ??????\nconst getClassListData', '// 获取班级列表\nconst getClassListData'),
('// ????????\nconst getGradeListData', '// 获取入学年份列表\nconst getGradeListData'),
('// ???\nonMounted', '// 初始化\nonMounted'),
# script - tableColumns labels
("label: '????', minWidth: 150", "label: '系部名称', minWidth: 150"),
("label: '??', width: 120", "label: '班号', width: 120"),
("label: '??', width: 120", "label: '学号', width: 120"),
("label: '??', width: 100", "label: '姓名', width: 100"),
("label: '???', width: 120", "label: '手机号', width: 120"),
("label: '????', width: 120", "label: '入团时间', width: 120"),
("label: '????', width: 120", "label: '团员编号', width: 120"),
("label: '????', width: 120", "label: '团内职务', width: 120"),
# script - 文案
("confirm('???????????')", "confirm('确定要删除这条记录吗?')"),
("useMessage().success('????')", "useMessage().success('删除成功')"),
("err.msg || '????'", "err.msg || '删除失败'"),
("useMessage().warning('????????')", "useMessage().warning('只能上传一个文件')"),
("useMessage().warning('?????????')", "useMessage().warning('请选择要上传的文件')"),
("useMessage().warning('?????')", "useMessage().warning('文件不存在')"),
("useMessage().success('????')\n importDialogVisible", "useMessage().success('导入成功')\n importDialogVisible"),
("err.msg || '????')\n } finally", "err.msg || '导入失败')\n } finally"),
("link.download = `??_${", "link.download = `团员_${"),
("useMessage().success('????')\n } catch (err: any) {\n useMessage().error(err.msg || '????')\n }\n}\n\n// ??????", "useMessage().success('导出成功')\n } catch (err: any) {\n useMessage().error(err.msg || '导出失败')\n }\n}\n\n// 获取班级列表"),
]
# 避免重复替换已正确内容
for old, new in replacements:
if old in s and old != new:
s = s.replace(old, new, 1)
with open(path, 'w', encoding='utf-8') as f:
f.write(s)
print('Done')

View File

@@ -0,0 +1,60 @@
import request from '/@/utils/request';
/**
* 获取列表
* @param query
*/
export const fetchList = (query?: any) => {
return request({
url: '/recruit/recruitschoolcode/page',
method: 'get',
params: query,
});
};
/**
* 新增
* @param obj
*/
export const addObj = (obj: any) => {
return request({
url: '/recruit/recruitschoolcode/add',
method: 'post',
data: obj,
});
};
/**
* 获取详情
* @param id
*/
export const getObj = (id: string | number) => {
return request({
url: `/recruit/recruitschoolcode/getById`,
method: 'get',
params: { id },
});
};
/**
* 删除
* @param id
*/
export const delObj = (id: string | number) => {
return request({
url: `/recruit/recruitschoolcode/${id}`,
method: 'delete',
});
};
/**
* 更新
* @param obj
*/
export const putObj = (obj: any) => {
return request({
url: '/recruit/recruitschoolcode/edit',
method: 'post',
data: obj,
});
};

View File

@@ -31,7 +31,7 @@ const togglePlayPause = () => {
if (isPlaying.value) { if (isPlaying.value) {
pauseAudio(); // 如果正在播放,则暂停 pauseAudio(); // 如果正在播放,则暂停
} else { } else {
playAudio(props.text); // 如果未播放,则生成或播放<EFBFBD><EFBFBD><EFBFBD> playAudio(props.text); // 如果未播放,则生成或播放
} }
}; };

View File

@@ -35,7 +35,7 @@
<script setup lang="ts"> <script setup lang="ts">
import { ref, reactive, nextTick } from 'vue' import { ref, reactive, nextTick } from 'vue'
import { ElNotification } from 'element-plus' import { ElNotification } from 'element-plus'
import { addObj, getObj, putObj } from '/@/api/recruit/recruitschoolcode' import { addObj, getObj, putObj } from '/@/api/recruit/recruitschoolcode.ts'
import { getList } from '/@/api/recruit/recruitstudentplangroup' import { getList } from '/@/api/recruit/recruitstudentplangroup'
// Emits // Emits

View File

@@ -225,7 +225,7 @@ import TableColumnControl from '/@/components/TableColumnControl/index.vue'
// 引入组件 // 引入组件
const FormDialog = defineAsyncComponent(() => import('./form.vue')); const FormDialog = defineAsyncComponent(() => import('./form.vue'));
import { List, OfficeBuilding, Grid, House, Calendar, Document, CircleCheck, EditPen, Setting, Menu, Search } from '@element-plus/icons-vue' import { List, OfficeBuilding, Grid, House, Calendar, Document, CircleCheck, EditPen, Setting, Menu, Search } from '@element-plus/icons-vue'
import { useTableColumnControl } from '/@/hooks/tableColumnControl' import { useTableColumnControl } from '/@/hooks/tableColumn'
import { defineAsyncComponent as defineStatusTag } from 'vue' import { defineAsyncComponent as defineStatusTag } from 'vue'
const StatusTag = defineStatusTag(() => import('/@/components/StatusTag/index.vue')) const StatusTag = defineStatusTag(() => import('/@/components/StatusTag/index.vue'))

View File

@@ -166,7 +166,7 @@ import TableColumnControl from '/@/components/TableColumnControl/index.vue'
// 引入组件 // 引入组件
const FormDialog = defineAsyncComponent(() => import('./form.vue')); const FormDialog = defineAsyncComponent(() => import('./form.vue'));
import { List, Document, Grid, CircleCheck, Setting, Menu } from '@element-plus/icons-vue' import { List, Document, Grid, CircleCheck, Setting, Menu } from '@element-plus/icons-vue'
import { useTableColumnControl } from '/@/hooks/tableColumnControl' import { useTableColumnControl } from '/@/hooks/tableColumn'
import { defineAsyncComponent as defineStatusTag } from 'vue' import { defineAsyncComponent as defineStatusTag } from 'vue'
const StatusTag = defineStatusTag(() => import('/@/components/StatusTag/index.vue')) const StatusTag = defineStatusTag(() => import('/@/components/StatusTag/index.vue'))

View File

@@ -169,7 +169,7 @@ import { useMessage } from "/@/hooks/message";
import { parseTime } from "/@/utils/formatTime"; import { parseTime } from "/@/utils/formatTime";
import TableColumnControl from '/@/components/TableColumnControl/index.vue' import TableColumnControl from '/@/components/TableColumnControl/index.vue'
import { List, OfficeBuilding, Grid, Document, DataAnalysis, Calendar, Clock, Setting, Menu, Search } from '@element-plus/icons-vue' import { List, OfficeBuilding, Grid, Document, DataAnalysis, Calendar, Clock, Setting, Menu, Search } from '@element-plus/icons-vue'
import { useTableColumnControl } from '/@/hooks/tableColumnControl' import { useTableColumnControl } from '/@/hooks/tableColumn'
// 定义变量内容 // 定义变量内容

View File

@@ -1,21 +1,21 @@
<template> <template>
<div class="modern-page-container"> <div class="modern-page-container">
<div class="page-wrapper"> <div class="page-wrapper">
<!-- 搜索表单卡片 --> <!-- ?????? -->
<el-card v-show="showSearch" class="search-card" shadow="never"> <el-card v-show="showSearch" class="search-card" shadow="never">
<template #header> <template #header>
<div class="card-header"> <div class="card-header">
<span class="card-title"> <span class="card-title">
<el-icon class="title-icon"><Search /></el-icon> <el-icon class="title-icon"><Search /></el-icon>
筛选条<EFBFBD><EFBFBD>? ????
</span> </span>
</div> </div>
</template> </template>
<el-form :model="state.queryForm" ref="searchFormRef" :inline="true" @keyup.enter="getDataList" class="search-form"> <el-form :model="state.queryForm" ref="searchFormRef" :inline="true" @keyup.enter="getDataList" class="search-form">
<el-form-item label="学年" prop="schoolYear"> <el-form-item label="??" prop="schoolYear">
<el-select <el-select
v-model="state.queryForm.schoolYear" v-model="state.queryForm.schoolYear"
placeholder="请选择学年" placeholder="?????"
clearable clearable
filterable filterable
style="width: 200px"> style="width: 200px">
@@ -27,10 +27,10 @@
</el-option> </el-option>
</el-select> </el-select>
</el-form-item> </el-form-item>
<el-form-item label="学期" prop="schoolTerm"> <el-form-item label="??" prop="schoolTerm">
<el-select <el-select
v-model="state.queryForm.schoolTerm" v-model="state.queryForm.schoolTerm"
placeholder="请选择学期" placeholder="?????"
clearable clearable
style="width: 200px"> style="width: 200px">
<el-option <el-option
@@ -41,48 +41,48 @@
</el-option> </el-option>
</el-select> </el-select>
</el-form-item> </el-form-item>
<el-form-item label="宿舍<EFBFBD><EFBFBD>? prop="roomNo"> <el-form-item label="???" prop="roomNo">
<el-input <el-input
v-model="state.queryForm.roomNo" v-model="state.queryForm.roomNo"
placeholder="请输入宿舍号" placeholder="??????"
clearable clearable
style="width: 200px" /> style="width: 200px" />
</el-form-item> </el-form-item>
<el-form-item label="奖项名称" prop="ruleName"> <el-form-item label="????" prop="ruleName">
<el-input <el-input
v-model="state.queryForm.ruleName" v-model="state.queryForm.ruleName"
placeholder="请输入奖项名<EFBFBD><EFBFBD>? placeholder="???????"
clearable clearable
style="width: 200px" /> style="width: 200px" />
</el-form-item> </el-form-item>
<el-form-item> <el-form-item>
<el-button type="primary" plain icon="Search" @click="getDataList">查询</el-button> <el-button type="primary" plain icon="Search" @click="getDataList">??</el-button>
<el-button icon="Refresh" @click="handleReset">重置</el-button> <el-button icon="Refresh" @click="handleReset">??</el-button>
</el-form-item> </el-form-item>
</el-form> </el-form>
</el-card> </el-card>
<!-- 内容卡片 --> <!-- ???? -->
<el-card class="content-card" shadow="never"> <el-card class="content-card" shadow="never">
<template #header> <template #header>
<div class="card-header"> <div class="card-header">
<span class="card-title"> <span class="card-title">
<el-icon class="title-icon"><Document /></el-icon> <el-icon class="title-icon"><Document /></el-icon>
文明宿舍列表 ????????
</span> </span>
<div class="header-actions"> <div class="header-actions">
<el-button <el-button
icon="Plus" icon="Plus"
type="primary" type="primary"
@click="formDialogRef.openDialog()"> @click="formDialogRef.openDialog()">
新增 ??
</el-button> </el-button>
<el-button <el-button
icon="Upload" icon="Upload"
type="success" type="success"
class="ml10" class="ml10"
@click="handleImport"> @click="handleImport">
导入 ??
</el-button> </el-button>
<right-toolbar <right-toolbar
v-model:showSearch="showSearch" v-model:showSearch="showSearch"
@@ -98,7 +98,7 @@
@order-change="handleColumnOrderChange" @order-change="handleColumnOrderChange"
> >
<template #trigger> <template #trigger>
<el-tooltip class="item" effect="dark" content="列设<EFBFBD><EFBFBD>? placement="top"> <el-tooltip class="item" effect="dark" content="???" placement="top">
<el-button circle style="margin-left: 0;"> <el-button circle style="margin-left: 0;">
<el-icon><Menu /></el-icon> <el-icon><Menu /></el-icon>
</el-button> </el-button>
@@ -110,7 +110,7 @@
</div> </div>
</template> </template>
<!-- 表格 --> <!-- ?? -->
<el-table <el-table
:data="state.dataList" :data="state.dataList"
v-loading="state.loading" v-loading="state.loading"
@@ -118,7 +118,7 @@
:cell-style="tableStyle.cellStyle" :cell-style="tableStyle.cellStyle"
:header-cell-style="tableStyle.headerCellStyle" :header-cell-style="tableStyle.headerCellStyle"
class="modern-table"> 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> <template #header>
<el-icon><List /></el-icon> <el-icon><List /></el-icon>
</template> </template>
@@ -128,7 +128,7 @@
</el-table-column> </el-table-column>
<template v-for="col in visibleColumnsSorted" :key="col.prop || col.label"> <template v-for="col in visibleColumnsSorted" :key="col.prop || col.label">
<el-table-column <el-table-column
v-if="checkColumnVisible(col.prop || '') && col.prop !== '操作'" v-if="checkColumnVisible(col.prop || '') && col.prop !== '??'"
:prop="col.prop" :prop="col.prop"
:label="col.label" :label="col.label"
:width="col.width" :width="col.width"
@@ -152,10 +152,10 @@
</template> </template>
</el-table-column> </el-table-column>
</template> </template>
<el-table-column label="操作" width="150" align="center" fixed="right"> <el-table-column label="??" width="150" align="center" fixed="right">
<template #header> <template #header>
<el-icon><Setting /></el-icon> <el-icon><Setting /></el-icon>
<span style="margin-left: 4px">操作</span> <span style="margin-left: 4px">??</span>
</template> </template>
<template #default="scope"> <template #default="scope">
<el-button <el-button
@@ -163,20 +163,20 @@
link link
type="primary" type="primary"
@click="handleEdit(scope.row)"> @click="handleEdit(scope.row)">
编辑 ??
</el-button> </el-button>
<el-button <el-button
icon="Delete" icon="Delete"
link link
type="danger" type="danger"
@click="handleDelete(scope.row)"> @click="handleDelete(scope.row)">
删除 ??
</el-button> </el-button>
</template> </template>
</el-table-column> </el-table-column>
</el-table> </el-table>
<!-- 分页 --> <!-- ?? -->
<div class="pagination-wrapper"> <div class="pagination-wrapper">
<pagination <pagination
@size-change="sizeChangeHandle" @size-change="sizeChangeHandle"
@@ -186,12 +186,12 @@
</el-card> </el-card>
</div> </div>
<!-- 新增/编辑表单弹窗 --> <!-- ??/?????? -->
<form-dialog ref="formDialogRef" @refresh="getDataList" /> <form-dialog ref="formDialogRef" @refresh="getDataList" />
<!-- 导入弹窗 --> <!-- ???? -->
<el-dialog <el-dialog
title="导入文明宿舍" title="??????"
v-model="importDialogVisible" v-model="importDialogVisible"
:width="500" :width="500"
:close-on-click-modal="false" :close-on-click-modal="false"
@@ -201,7 +201,7 @@
icon="Download" icon="Download"
type="success" type="success"
@click="handleDownloadTemplate"> @click="handleDownloadTemplate">
下载模板 ????
</el-button> </el-button>
</div> </div>
<el-upload <el-upload
@@ -213,18 +213,18 @@
drag> drag>
<el-icon class="el-icon--upload"><upload-filled /></el-icon> <el-icon class="el-icon--upload"><upload-filled /></el-icon>
<div class="el-upload__text"> <div class="el-upload__text">
将文件拖到此处<EFBFBD><EFBFBD>?em>点击上传</em> ????????<em>????</em>
</div> </div>
<template #tip> <template #tip>
<div class="el-upload__tip"> <div class="el-upload__tip">
只能上传 xlsx/xls 文件 ???? xlsx/xls ??
</div> </div>
</template> </template>
</el-upload> </el-upload>
<template #footer> <template #footer>
<span class="dialog-footer"> <span class="dialog-footer">
<el-button @click="importDialogVisible = false"><EFBFBD><EFBFBD>?<EFBFBD><EFBFBD>?/el-button> <el-button @click="importDialogVisible = false">??</el-button>
<el-button type="primary" @click="handleImportSubmit" :disabled="!importFile || importLoading"><EFBFBD><EFBFBD>?<EFBFBD><EFBFBD>?/el-button> <el-button type="primary" @click="handleImportSubmit" :disabled="!importFile || importLoading">??</el-button>
</span> </span>
</template> </template>
</el-dialog> </el-dialog>
@@ -241,11 +241,11 @@ import { getDicts } from "/@/api/admin/dict";
import { useMessage, useMessageBox } from "/@/hooks/message"; import { useMessage, useMessageBox } from "/@/hooks/message";
import TableColumnControl from '/@/components/TableColumnControl/index.vue' import TableColumnControl from '/@/components/TableColumnControl/index.vue'
import { UploadFilled, List, Calendar, Clock, House, Trophy, EditPen, Setting, Menu, Search, Document } from '@element-plus/icons-vue' import { UploadFilled, List, Calendar, Clock, House, Trophy, EditPen, Setting, Menu, Search, Document } from '@element-plus/icons-vue'
import { useTableColumnControl } from '/@/hooks/tableColumnControl' import { useTableColumnControl } from '/@/hooks/tableColumn'
import FormDialog from './form.vue' import FormDialog from './form.vue'
// 定义变量内容 // ????
const route = useRoute() const route = useRoute()
const formDialogRef = ref() const formDialogRef = ref()
const uploadRef = ref() const uploadRef = ref()
@@ -258,16 +258,16 @@ const importDialogVisible = ref(false)
const importFile = ref<File | null>(null) const importFile = ref<File | null>(null)
const importLoading = ref(false) const importLoading = ref(false)
// 表格列配<EFBFBD><EFBFBD>? // ?????
const tableColumns = [ const tableColumns = [
{ prop: 'schoolYear', label: '学年', icon: Calendar }, { prop: 'schoolYear', label: '??', icon: Calendar },
{ prop: 'schoolTerm', label: '学期', icon: Clock }, { prop: 'schoolTerm', label: '??', icon: Clock },
{ prop: 'roomNo', label: '宿舍<EFBFBD><EFBFBD>?, icon: House }, { prop: 'roomNo', label: '???', icon: House },
{ prop: 'ruleName', label: '奖项名称', icon: Trophy, minWidth: 150 }, { prop: 'ruleName', label: '????', icon: Trophy, minWidth: 150 },
{ prop: 'remarks', label: '备注', icon: EditPen, minWidth: 200 } { prop: 'remarks', label: '??', icon: EditPen, minWidth: 200 }
] ]
// 使用表格列控制hook // ??????? hook
const { const {
visibleColumns, visibleColumns,
visibleColumnsSorted, visibleColumnsSorted,
@@ -276,13 +276,13 @@ const {
handleColumnOrderChange handleColumnOrderChange
} = useTableColumnControl(tableColumns, route.path) } = useTableColumnControl(tableColumns, route.path)
// 表格样式 // ????
const tableStyle = { const tableStyle = {
cellStyle: { padding: '8px 0' }, cellStyle: { padding: '8px 0' },
headerCellStyle: { background: '#f5f7fa', color: '#606266', fontWeight: 'bold' } headerCellStyle: { background: '#f5f7fa', color: '#606266', fontWeight: 'bold' }
} }
// 配置 useTable // ?? useTable
const state: BasicTableProps = reactive<BasicTableProps>({ const state: BasicTableProps = reactive<BasicTableProps>({
queryForm: { queryForm: {
schoolYear: '', schoolYear: '',
@@ -295,7 +295,7 @@ const state: BasicTableProps = reactive<BasicTableProps>({
item: 'records', item: 'records',
totalCount: 'total' totalCount: 'total'
}, },
createdIsNeed: true // 页面加载时自动获取数<E58F96><E695B0>? createdIsNeed: true // ?????????
}) })
// table hook // table hook
@@ -306,7 +306,7 @@ const {
tableStyle: _tableStyle tableStyle: _tableStyle
} = useTable(state) } = useTable(state)
// 格式化学<EFBFBD><EFBFBD>? // ?????
const formatSchoolTerm = (value: string | number) => { const formatSchoolTerm = (value: string | number) => {
if (value === null || value === undefined || value === '') { if (value === null || value === undefined || value === '') {
return '-' return '-'
@@ -315,7 +315,7 @@ const formatSchoolTerm = (value: string | number) => {
return dictItem ? dictItem.label : value return dictItem ? dictItem.label : value
} }
// 重置 // ??
const handleReset = () => { const handleReset = () => {
searchFormRef.value?.resetFields() searchFormRef.value?.resetFields()
state.queryForm.schoolYear = '' state.queryForm.schoolYear = ''
@@ -325,22 +325,22 @@ const handleReset = () => {
getDataList() getDataList()
} }
// 导入 // ????
const handleImport = () => { const handleImport = () => {
importDialogVisible.value = true importDialogVisible.value = true
importFile.value = null importFile.value = null
uploadRef.value?.clearFiles() uploadRef.value?.clearFiles()
} }
// 下载模板 // ????
const handleDownloadTemplate = async () => { const handleDownloadTemplate = async () => {
try { try {
const fileName = '文明宿舍导入模板.xlsx' const fileName = '????????.xlsx'
// 使用动态导入获取文件URL views/stuwork/rewarddorm <EFBFBD><EFBFBD>?assets/file 的相对路<EFBFBD><EFBFBD>? // ?????? views/stuwork/rewarddorm ? assets/file ?
const fileUrl = new URL(`../../../assets/file/${fileName}`, import.meta.url).href const fileUrl = new URL(`../../../assets/file/${fileName}`, import.meta.url).href
const response = await fetch(fileUrl) const response = await fetch(fileUrl)
if (!response.ok) { if (!response.ok) {
throw new Error('文件下载失败') throw new Error('??????')
} }
const blob = await response.blob() const blob = await response.blob()
const url = window.URL.createObjectURL(blob) const url = window.URL.createObjectURL(blob)
@@ -351,60 +351,60 @@ const handleDownloadTemplate = async () => {
link.click() link.click()
window.URL.revokeObjectURL(url) window.URL.revokeObjectURL(url)
document.body.removeChild(link) document.body.removeChild(link)
useMessage().success('模板下载成功') useMessage().success('??????')
} catch (error) { } catch (error) {
useMessage().error('模板下载失败请检查模板文件是否存<EFBFBD><EFBFBD>?) useMessage().error('??????')
} }
} }
// 文件变化 // ????
const handleFileChange = (file: any) => { const handleFileChange = (file: any) => {
importFile.value = file.raw importFile.value = file.raw
} }
// 提交导入 // ????
const handleImportSubmit = async () => { const handleImportSubmit = async () => {
if (!importFile.value) { if (!importFile.value) {
useMessage().warning('请选择要导入的文件') useMessage().warning('?????????')
return return
} }
importLoading.value = true importLoading.value = true
try { try {
await importExcel(importFile.value) await importExcel(importFile.value)
useMessage().success('导入成功') useMessage().success('????')
importDialogVisible.value = false importDialogVisible.value = false
importFile.value = null importFile.value = null
uploadRef.value?.clearFiles() uploadRef.value?.clearFiles()
getDataList() getDataList()
} catch (err: any) { } catch (err: any) {
useMessage().error(err.msg || '导入失败') useMessage().error(err.msg || '????')
} finally { } finally {
importLoading.value = false importLoading.value = false
} }
} }
// 编辑 // ??
const handleEdit = (row: any) => { const handleEdit = (row: any) => {
formDialogRef.value?.openDialog('edit', row) formDialogRef.value?.openDialog('edit', row)
} }
// 删除 // ??
const handleDelete = async (row: any) => { const handleDelete = async (row: any) => {
const { confirm } = useMessageBox() const { confirm } = useMessageBox()
try { try {
await confirm('确定要删除该文明宿舍记录吗?') await confirm('???????????')
await delObj([row.id]) await delObj([row.id])
useMessage().success('删除成功') useMessage().success('????')
getDataList() getDataList()
} catch (err: any) { } catch (err: any) {
if (err !== 'cancel') { if (err !== 'cancel') {
useMessage().error(err.msg || '删除失败') useMessage().error(err.msg || '????')
} }
} }
} }
// 获取学年列表 // ??????
const getSchoolYearList = async () => { const getSchoolYearList = async () => {
try { try {
const res = await queryAllSchoolYear() const res = await queryAllSchoolYear()
@@ -418,7 +418,7 @@ const getSchoolYearList = async () => {
} }
} }
// 获取学期字典 // ??????
const getSchoolTermDict = async () => { const getSchoolTermDict = async () => {
try { try {
const res = await getDicts('school_term') const res = await getDicts('school_term')
@@ -435,7 +435,7 @@ const getSchoolTermDict = async () => {
} }
} }
// 初始<EFBFBD><EFBFBD>? // ???
onMounted(() => { onMounted(() => {
getSchoolYearList() getSchoolYearList()
getSchoolTermDict() getSchoolTermDict()

View File

@@ -1,21 +1,21 @@
<template> <template>
<div class="modern-page-container"> <div class="modern-page-container">
<div class="page-wrapper"> <div class="page-wrapper">
<!-- 搜索表单卡片 --> <!-- ???? -->
<el-card v-show="showSearch" class="search-card" shadow="never"> <el-card v-show="showSearch" class="search-card" shadow="never">
<template #header> <template #header>
<div class="card-header"> <div class="card-header">
<span class="card-title"> <span class="card-title">
<el-icon class="title-icon"><Search /></el-icon> <el-icon class="title-icon"><Search /></el-icon>
筛选条<EFBFBD><EFBFBD>? ????
</span> </span>
</div> </div>
</template> </template>
<el-form :model="state.queryForm" ref="searchFormRef" :inline="true" @keyup.enter="getDataList" class="search-form"> <el-form :model="state.queryForm" ref="searchFormRef" :inline="true" @keyup.enter="getDataList" class="search-form">
<el-form-item label="奖项类型" prop="ruleType"> <el-form-item label="????" prop="ruleType">
<el-select <el-select
v-model="state.queryForm.ruleType" v-model="state.queryForm.ruleType"
placeholder="请选择奖项类型" placeholder="请输入奖项名称"
clearable clearable
style="width: 200px"> style="width: 200px">
<el-option <el-option
@@ -27,26 +27,26 @@
</el-select> </el-select>
</el-form-item> </el-form-item>
<el-form-item> <el-form-item>
<el-button type="primary" plain icon="Search" @click="getDataList">查询</el-button> <el-button type="primary" plain icon="Search" @click="getDataList">??</el-button>
<el-button icon="Refresh" @click="handleReset">重置</el-button> <el-button icon="Refresh" @click="handleReset">重置</el-button>
</el-form-item> </el-form-item>
</el-form> </el-form>
</el-card> </el-card>
<!-- 内容卡片 --> <!-- ???? -->
<el-card class="content-card" shadow="never"> <el-card class="content-card" shadow="never">
<template #header> <template #header>
<div class="card-header"> <div class="card-header">
<span class="card-title"> <span class="card-title">
<el-icon class="title-icon"><Document /></el-icon> <el-icon class="title-icon"><Document /></el-icon>
评优评先奖项列表 ????????
</span> </span>
<div class="header-actions"> <div class="header-actions">
<el-button <el-button
icon="Plus" icon="Plus"
type="primary" type="primary"
@click="formDialogRef.openDialog()"> @click="formDialogRef.openDialog()">
新增 ??
</el-button> </el-button>
<right-toolbar <right-toolbar
v-model:showSearch="showSearch" v-model:showSearch="showSearch"
@@ -62,12 +62,12 @@
@order-change="handleColumnOrderChange" @order-change="handleColumnOrderChange"
> >
<template #trigger> <template #trigger>
<el-tooltip class="item" effect="dark" content="列设<EFBFBD><EFBFBD>? placement="top"> <el-tooltip class="item" effect="dark" content="列设置" placement="top">
<el-button circle style="margin-left: 0;"> <el-button circle style="margin-left: 0;">
<el-icon><Menu /></el-icon> <el-icon><Menu /></el-icon>
</el-button> </el-button>
</el-tooltip> </el-tooltip>
</template> </template>
</TableColumnControl> </TableColumnControl>
</right-toolbar> </right-toolbar>
</div> </div>
@@ -150,7 +150,7 @@
</el-card> </el-card>
</div> </div>
<!-- 新增/编辑表单弹窗 --> <!-- ??/?????? -->
<form-dialog ref="formDialogRef" @refresh="getDataList" /> <form-dialog ref="formDialogRef" @refresh="getDataList" />
</div> </div>
</template> </template>
@@ -165,10 +165,10 @@ import { useMessage, useMessageBox } from "/@/hooks/message";
import TableColumnControl from '/@/components/TableColumnControl/index.vue' import TableColumnControl from '/@/components/TableColumnControl/index.vue'
import FormDialog from './form.vue' import FormDialog from './form.vue'
import { List, Trophy, Collection, EditPen, Setting, Menu, Search, Document } from '@element-plus/icons-vue' import { List, Trophy, Collection, EditPen, Setting, Menu, Search, Document } from '@element-plus/icons-vue'
import { useTableColumnControl } from '/@/hooks/tableColumnControl' import { useTableColumnControl } from '/@/hooks/tableColumn'
// 定义变量内容 // ??
const route = useRoute() const route = useRoute()
const formDialogRef = ref() const formDialogRef = ref()
const searchFormRef = ref() const searchFormRef = ref()
@@ -176,14 +176,14 @@ const columnControlRef = ref()
const showSearch = ref(true) const showSearch = ref(true)
const ruleTypeList = ref<any[]>([]) const ruleTypeList = ref<any[]>([])
// 表格列配<EFBFBD><EFBFBD>? // ?????
const tableColumns = [ const tableColumns = [
{ prop: 'ruleName', label: '奖项名称', icon: Trophy, minWidth: 200 }, { prop: 'ruleName', label: '????', icon: Trophy, minWidth: 200 },
{ prop: 'ruleType', label: '奖项类型', icon: Collection }, { prop: 'ruleType', label: '????', icon: Collection },
{ prop: 'remarks', label: '备注', icon: EditPen, minWidth: 200 } { prop: 'remarks', label: '??', icon: EditPen, minWidth: 200 }
] ]
// 使用表格列控制hook // ??????? hook
const { const {
visibleColumns, visibleColumns,
visibleColumnsSorted, visibleColumnsSorted,
@@ -192,13 +192,13 @@ const {
handleColumnOrderChange handleColumnOrderChange
} = useTableColumnControl(tableColumns, route.path) } = useTableColumnControl(tableColumns, route.path)
// 表格样式 // ????
const tableStyle = { const tableStyle = {
cellStyle: { padding: '8px 0' }, cellStyle: { padding: '8px 0' },
headerCellStyle: { background: '#f5f7fa', color: '#606266', fontWeight: 'bold' } headerCellStyle: { background: '#f5f7fa', color: '#606266', fontWeight: 'bold' }
} }
// 配置 useTable // ?? useTable
const state: BasicTableProps = reactive<BasicTableProps>({ const state: BasicTableProps = reactive<BasicTableProps>({
queryForm: { queryForm: {
ruleType: '' ruleType: ''
@@ -208,7 +208,7 @@ const state: BasicTableProps = reactive<BasicTableProps>({
item: 'records', item: 'records',
totalCount: 'total' totalCount: 'total'
}, },
createdIsNeed: true // 页面加载时自动获取数<EFBFBD><EFBFBD>? createdIsNeed: true // ???????????
}) })
// table hook // table hook
@@ -219,7 +219,7 @@ const {
tableStyle: _tableStyle tableStyle: _tableStyle
} = useTable(state) } = useTable(state)
// 格式化奖项类<EFBFBD><EFBFBD>? // ???????
const formatRuleType = (value: string | number) => { const formatRuleType = (value: string | number) => {
if (value === null || value === undefined || value === '') { if (value === null || value === undefined || value === '') {
return '-' return '-'
@@ -228,34 +228,34 @@ const formatRuleType = (value: string | number) => {
return dictItem ? dictItem.label : value return dictItem ? dictItem.label : value
} }
// 重置 // ??
const handleReset = () => { const handleReset = () => {
searchFormRef.value?.resetFields() searchFormRef.value?.resetFields()
state.queryForm.ruleType = '' state.queryForm.ruleType = ''
getDataList() getDataList()
} }
// 编辑 // ??
const handleEdit = (row: any) => { const handleEdit = (row: any) => {
formDialogRef.value?.openDialog('edit', row) formDialogRef.value?.openDialog('edit', row)
} }
// 删除 // ??
const handleDelete = async (row: any) => { const handleDelete = async (row: any) => {
const { confirm } = useMessageBox() const { confirm } = useMessageBox()
try { try {
await confirm('确定要删除该评优评先奖项吗?') await confirm('??????????????')
await delObj([row.id]) await delObj([row.id])
useMessage().success('删除成功') useMessage().success('????')
getDataList() getDataList()
} catch (err: any) { } catch (err: any) {
if (err !== 'cancel') { if (err !== 'cancel') {
useMessage().error(err.msg || '删除失败') useMessage().error(err.msg || '????')
} }
} }
} }
// 获取奖项类型字典 // ????????
const getRuleTypeDict = async () => { const getRuleTypeDict = async () => {
try { try {
const res = await getDicts('rule_type') const res = await getDicts('rule_type')
@@ -272,7 +272,7 @@ const getRuleTypeDict = async () => {
} }
} }
// 初始<EFBFBD><EFBFBD>? // ???
onMounted(() => { onMounted(() => {
getRuleTypeDict() getRuleTypeDict()
}) })

View File

@@ -1,21 +1,21 @@
<template> <template>
<div class="modern-page-container"> <div class="modern-page-container">
<div class="page-wrapper"> <div class="page-wrapper">
<!-- 搜索表单卡片 --> <!-- ?????? -->
<el-card v-show="showSearch" class="search-card" shadow="never"> <el-card v-show="showSearch" class="search-card" shadow="never">
<template #header> <template #header>
<div class="card-header"> <div class="card-header">
<span class="card-title"> <span class="card-title">
<el-icon class="title-icon"><Search /></el-icon> <el-icon class="title-icon"><Search /></el-icon>
筛选条<EFBFBD><EFBFBD>? ????
</span> </span>
</div> </div>
</template> </template>
<el-form :model="queryForm" ref="searchFormRef" :inline="true" @keyup.enter="getDataList" class="search-form"> <el-form :model="queryForm" ref="searchFormRef" :inline="true" @keyup.enter="getDataList" class="search-form">
<el-form-item label="学院" prop="deptCode"> <el-form-item label="??" prop="deptCode">
<el-select <el-select
v-model="queryForm.deptCode" v-model="queryForm.deptCode"
placeholder="请选择学院" placeholder="?????"
clearable clearable
filterable filterable
style="width: 200px"> style="width: 200px">
@@ -27,10 +27,10 @@
</el-option> </el-option>
</el-select> </el-select>
</el-form-item> </el-form-item>
<el-form-item label="班级" prop="classCode"> <el-form-item label="??" prop="classCode">
<el-select <el-select
v-model="queryForm.classCode" v-model="queryForm.classCode"
placeholder="请选择班级" placeholder="?????"
clearable clearable
filterable filterable
style="width: 200px"> style="width: 200px">
@@ -42,10 +42,10 @@
</el-option> </el-option>
</el-select> </el-select>
</el-form-item> </el-form-item>
<el-form-item label="学年" prop="schoolYear"> <el-form-item label="??" prop="schoolYear">
<el-select <el-select
v-model="queryForm.schoolYear" v-model="queryForm.schoolYear"
placeholder="请选择学年" placeholder="?????"
clearable clearable
filterable filterable
style="width: 200px"> style="width: 200px">
@@ -57,10 +57,10 @@
</el-option> </el-option>
</el-select> </el-select>
</el-form-item> </el-form-item>
<el-form-item label="学期" prop="schoolTerm"> <el-form-item label="??" prop="schoolTerm">
<el-select <el-select
v-model="queryForm.schoolTerm" v-model="queryForm.schoolTerm"
placeholder="请选择学期" placeholder="?????"
clearable clearable
style="width: 200px"> style="width: 200px">
<el-option <el-option
@@ -72,19 +72,19 @@
</el-select> </el-select>
</el-form-item> </el-form-item>
<el-form-item> <el-form-item>
<el-button type="primary" plain icon="Search" @click="getDataList">查询</el-button> <el-button type="primary" plain icon="Search" @click="getDataList">??</el-button>
<el-button icon="Refresh" @click="handleReset">重置</el-button> <el-button icon="Refresh" @click="handleReset">??</el-button>
</el-form-item> </el-form-item>
</el-form> </el-form>
</el-card> </el-card>
<!-- 内容卡片 --> <!-- ???? -->
<el-card class="content-card" shadow="never"> <el-card class="content-card" shadow="never">
<template #header> <template #header>
<div class="card-header"> <div class="card-header">
<span class="card-title"> <span class="card-title">
<el-icon class="title-icon"><Document /></el-icon> <el-icon class="title-icon"><Document /></el-icon>
学生评优评先列表 ????
</span> </span>
<div class="header-actions"> <div class="header-actions">
<el-button <el-button
@@ -92,7 +92,7 @@
type="success" type="success"
class="ml10" class="ml10"
@click="handleExport"> @click="handleExport">
导出 ??
</el-button> </el-button>
<right-toolbar <right-toolbar
v-model:showSearch="showSearch" v-model:showSearch="showSearch"
@@ -108,7 +108,7 @@
@order-change="handleColumnOrderChange" @order-change="handleColumnOrderChange"
> >
<template #trigger> <template #trigger>
<el-tooltip class="item" effect="dark" content="列设<EFBFBD><EFBFBD>? placement="top"> <el-tooltip class="item" effect="dark" content="???" placement="top">
<el-button circle style="margin-left: 0;"> <el-button circle style="margin-left: 0;">
<el-icon><Menu /></el-icon> <el-icon><Menu /></el-icon>
</el-button> </el-button>
@@ -120,7 +120,7 @@
</div> </div>
</template> </template>
<!-- 表格 --> <!-- ?? -->
<el-table <el-table
:data="dataList" :data="dataList"
v-loading="loading" v-loading="loading"
@@ -128,7 +128,7 @@
:cell-style="tableStyle.cellStyle" :cell-style="tableStyle.cellStyle"
:header-cell-style="tableStyle.headerCellStyle" :header-cell-style="tableStyle.headerCellStyle"
class="modern-table"> 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> <template #header>
<el-icon><List /></el-icon> <el-icon><List /></el-icon>
</template> </template>
@@ -138,7 +138,7 @@
</el-table-column> </el-table-column>
<template v-for="col in visibleColumnsSorted" :key="col.prop || col.label"> <template v-for="col in visibleColumnsSorted" :key="col.prop || col.label">
<el-table-column <el-table-column
v-if="checkColumnVisible(col.prop || '') && col.prop !== '操作'" v-if="checkColumnVisible(col.prop || '') && col.prop !== '??'"
:prop="col.prop" :prop="col.prop"
:label="col.label" :label="col.label"
show-overflow-tooltip show-overflow-tooltip
@@ -149,30 +149,30 @@
<el-icon><component :is="columnConfigMap[col.prop]?.icon || OfficeBuilding" /></el-icon> <el-icon><component :is="columnConfigMap[col.prop]?.icon || OfficeBuilding" /></el-icon>
<span style="margin-left: 4px">{{ col.label }}</span> <span style="margin-left: 4px">{{ col.label }}</span>
</template> </template>
<!-- 操行平均分列特殊模板 --> <!-- ?????????? -->
<template v-if="col.prop === 'averageConduct'" #default="scope"> <template v-if="col.prop === 'averageConduct'" #default="scope">
<el-tag v-if="scope.row.averageConduct !== null && scope.row.averageConduct !== undefined" size="small" type="success" effect="plain"> <el-tag v-if="scope.row.averageConduct !== null && scope.row.averageConduct !== undefined" size="small" type="success" effect="plain">
{{ scope.row.averageConduct.toFixed(2) }} {{ scope.row.averageConduct.toFixed(2) }}
</el-tag> </el-tag>
<span v-else>-</span> <span v-else>-</span>
</template> </template>
<!-- 总评成绩平均分列特殊模板 --> <!-- ???????????? -->
<template v-else-if="col.prop === 'averageScore'" #default="scope"> <template v-else-if="col.prop === 'averageScore'" #default="scope">
<el-tag v-if="scope.row.averageScore !== null && scope.row.averageScore !== undefined" size="small" type="primary" effect="plain"> <el-tag v-if="scope.row.averageScore !== null && scope.row.averageScore !== undefined" size="small" type="primary" effect="plain">
{{ scope.row.averageScore.toFixed(2) }} {{ scope.row.averageScore.toFixed(2) }}
</el-tag> </el-tag>
<span v-else>-</span> <span v-else>-</span>
</template> </template>
<!-- 个人奖项列特殊模<EFBFBD><EFBFBD>?--> <!-- ????????? -->
<template v-else-if="col.prop === 'ruleName'" #default="scope"> <template v-else-if="col.prop === 'ruleName'" #default="scope">
<el-tag v-if="scope.row.ruleName && Array.isArray(scope.row.ruleName) && scope.row.ruleName.length > 0" size="small" type="warning" effect="light"> <el-tag v-if="scope.row.ruleName && Array.isArray(scope.row.ruleName) && scope.row.ruleName.length > 0" size="small" type="warning" effect="light">
{{ scope.row.ruleName.join('<EFBFBD><EFBFBD>?) }} {{ scope.row.ruleName.join('?') }}
</el-tag> </el-tag>
<span v-else>-</span> <span v-else>-</span>
</template> </template>
<!-- 保存时间列特殊模<EFBFBD><EFBFBD>?--> <!-- ????????? -->
<template v-else-if="col.prop === 'upDateTime'" #default="scope"> <template v-else-if="col.prop === 'upDateTime'" #default="scope">
<span>{{ parseTime(scope.row.upDateTime, '{y}-{m}-{d} {h}:{i}:{s}') }}</span> <span>{{ parseTime(scope.row.upDateTime, dateTimeFormat) }}</span>
</template> </template>
</el-table-column> </el-table-column>
</template> </template>
@@ -194,10 +194,11 @@ import { useMessage } from "/@/hooks/message";
import { parseTime } from "/@/utils/formatTime"; import { parseTime } from "/@/utils/formatTime";
import TableColumnControl from '/@/components/TableColumnControl/index.vue' import TableColumnControl from '/@/components/TableColumnControl/index.vue'
import { List, OfficeBuilding, Grid, CreditCard, Avatar, DataAnalysis, Warning, Trophy, Clock, Menu, Search, Document } from '@element-plus/icons-vue' import { List, OfficeBuilding, Grid, CreditCard, Avatar, DataAnalysis, Warning, Trophy, Clock, Menu, Search, Document } from '@element-plus/icons-vue'
import { useTableColumnControl } from '/@/hooks/tableColumnControl' import { useTableColumnControl } from '/@/hooks/tableColumn'
const dateTimeFormat = '{y}-{m}-{d} {h}:{i}:{s}'
// 定义变量内容 // ????
const route = useRoute() const route = useRoute()
const searchFormRef = ref() const searchFormRef = ref()
const columnControlRef = ref<any>() const columnControlRef = ref<any>()
@@ -209,20 +210,20 @@ const schoolTermList = ref<any[]>([])
const deptList = ref<any[]>([]) const deptList = ref<any[]>([])
const classList = ref<any[]>([]) const classList = ref<any[]>([])
// 表格列配<EFBFBD><EFBFBD>? // ?????
const tableColumns = [ const tableColumns = [
{ prop: 'departName', label: '学院' }, { prop: 'departName', label: '????' },
{ prop: 'classNo', label: '班级' }, { prop: 'classNo', label: '??' },
{ prop: 'stuNo', label: '学号' }, { prop: 'stuNo', label: '??' },
{ prop: 'realName', label: '姓名' }, { prop: 'realName', label: '??' },
{ prop: 'averageConduct', label: '操行平均<EFBFBD><EFBFBD>? }, { prop: 'averageConduct', label: '?????' },
{ prop: 'averageScore', label: '总评成绩平均<EFBFBD><EFBFBD>? }, { prop: 'averageScore', label: '???????' },
{ prop: 'violation', label: '违规情况', minWidth: 150 }, { prop: 'violation', label: '????', minWidth: 150 },
{ prop: 'ruleName', label: '个人奖项', minWidth: 200 }, { prop: 'ruleName', label: '????', minWidth: 200 },
{ prop: 'upDateTime', label: '保存时间', width: 180 } { prop: 'upDateTime', label: '????', width: 180 }
] ]
// 列配置映射用于图标<EFBFBD><EFBFBD>? // ?????????????
const columnConfigMap: Record<string, { icon: any }> = { const columnConfigMap: Record<string, { icon: any }> = {
departName: { icon: OfficeBuilding }, departName: { icon: OfficeBuilding },
classNo: { icon: Grid }, classNo: { icon: Grid },
@@ -235,7 +236,7 @@ const columnConfigMap: Record<string, { icon: any }> = {
upDateTime: { icon: Clock } upDateTime: { icon: Clock }
} }
// 使用表格列控制hook // ???????hook
const { const {
visibleColumns, visibleColumns,
visibleColumnsSorted, visibleColumnsSorted,
@@ -244,7 +245,7 @@ const {
handleColumnOrderChange handleColumnOrderChange
} = useTableColumnControl(tableColumns, route.path) } = useTableColumnControl(tableColumns, route.path)
// 查询表单 // ????
const queryForm = reactive({ const queryForm = reactive({
deptCode: '', deptCode: '',
classCode: '', classCode: '',
@@ -252,13 +253,13 @@ const queryForm = reactive({
schoolTerm: '' schoolTerm: ''
}) })
// 表格样式 // ????
const tableStyle = { const tableStyle = {
cellStyle: { padding: '8px 0' }, cellStyle: { padding: '8px 0' },
headerCellStyle: { background: '#f5f7fa', color: '#606266', fontWeight: 'bold' } headerCellStyle: { background: '#f5f7fa', color: '#606266', fontWeight: 'bold' }
} }
// 格式化学<EFBFBD><EFBFBD>? // ?????
const formatSchoolTerm = (value: string | number) => { const formatSchoolTerm = (value: string | number) => {
if (value === null || value === undefined || value === '') { if (value === null || value === undefined || value === '') {
return '-' return '-'
@@ -267,7 +268,7 @@ const formatSchoolTerm = (value: string | number) => {
return dictItem ? dictItem.label : value return dictItem ? dictItem.label : value
} }
// 获取数据列表 // ????
const getDataList = async () => { const getDataList = async () => {
loading.value = true loading.value = true
try { try {
@@ -278,14 +279,14 @@ const getDataList = async () => {
dataList.value = [] dataList.value = []
} }
} catch (err: any) { } catch (err: any) {
useMessage().error(err.msg || '获取数据列表失败') useMessage().error(err.msg || '??????')
dataList.value = [] dataList.value = []
} finally { } finally {
loading.value = false loading.value = false
} }
} }
// 重置 // ??
const handleReset = () => { const handleReset = () => {
searchFormRef.value?.resetFields() searchFormRef.value?.resetFields()
queryForm.deptCode = '' queryForm.deptCode = ''
@@ -295,43 +296,43 @@ const handleReset = () => {
getDataList() getDataList()
} }
// 导出 // ??
const handleExport = async () => { const handleExport = async () => {
try { try {
loading.value = true loading.value = true
const res = await exportExcel(queryForm) const res = await exportExcel(queryForm)
// 创建blob对象 // ?? blob
const blob = new Blob([res], { const blob = new Blob([res], {
type: 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet' type: 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet'
}) })
// 创建下载链接 // ??????
const url = window.URL.createObjectURL(blob) const url = window.URL.createObjectURL(blob)
const link = document.createElement('a') const link = document.createElement('a')
link.href = url link.href = url
// 设置文件<EFBFBD><EFBFBD>? // ???
const fileName = `学生评优评先_${new Date().getTime()}.xlsx` const fileName = `??????_${new Date().getTime()}.xlsx`
link.setAttribute('download', fileName) link.setAttribute('download', fileName)
// 触发下载 // ????
document.body.appendChild(link) document.body.appendChild(link)
link.click() link.click()
// 清理 // ??
document.body.removeChild(link) document.body.removeChild(link)
window.URL.revokeObjectURL(url) window.URL.revokeObjectURL(url)
useMessage().success('导出成功') useMessage().success('????')
} catch (err: any) { } catch (err: any) {
useMessage().error(err.msg || '导出失败') useMessage().error(err.msg || '????')
} finally { } finally {
loading.value = false loading.value = false
} }
} }
// 获取学年列表 // ??????
const getSchoolYearList = async () => { const getSchoolYearList = async () => {
try { try {
const res = await queryAllSchoolYear() const res = await queryAllSchoolYear()
@@ -345,7 +346,7 @@ const getSchoolYearList = async () => {
} }
} }
// 获取学期字典 // ??????
const getSchoolTermDict = async () => { const getSchoolTermDict = async () => {
try { try {
const res = await getDicts('school_term') const res = await getDicts('school_term')
@@ -362,7 +363,7 @@ const getSchoolTermDict = async () => {
} }
} }
// 获取学院列表 // ??????
const getDeptListData = async () => { const getDeptListData = async () => {
try { try {
const res = await getDeptList() const res = await getDeptList()
@@ -376,7 +377,7 @@ const getDeptListData = async () => {
} }
} }
// 获取班级列表 // ??????
const getClassListData = async () => { const getClassListData = async () => {
try { try {
const res = await getClassListByRole() const res = await getClassListByRole()
@@ -390,7 +391,7 @@ const getClassListData = async () => {
} }
} }
// 初始<EFBFBD><EFBFBD>? // ????
onMounted(() => { onMounted(() => {
getSchoolYearList() getSchoolYearList()
getSchoolTermDict() getSchoolTermDict()

View File

@@ -7,7 +7,7 @@
<div class="card-header"> <div class="card-header">
<span class="card-title"> <span class="card-title">
<el-icon class="title-icon"><Search /></el-icon> <el-icon class="title-icon"><Search /></el-icon>
筛选条<EFBFBD><EFBFBD>? 筛选条
</span> </span>
</div> </div>
</template> </template>
@@ -54,7 +54,7 @@
<div class="card-header"> <div class="card-header">
<span class="card-title"> <span class="card-title">
<el-icon class="title-icon"><Document /></el-icon> <el-icon class="title-icon"><Document /></el-icon>
助学金批次列<EFBFBD><EFBFBD>? 助学金批次列
</span> </span>
<div class="header-actions"> <div class="header-actions">
<el-button <el-button
@@ -77,7 +77,7 @@
@order-change="handleColumnOrderChange" @order-change="handleColumnOrderChange"
> >
<template #trigger> <template #trigger>
<el-tooltip class="item" effect="dark" content="列设<EFBFBD><EFBFBD>? placement="top"> <el-tooltip class="item" effect="dark" content="列设置" placement="top">
<el-button circle style="margin-left: 0;"> <el-button circle style="margin-left: 0;">
<el-icon><Menu /></el-icon> <el-icon><Menu /></el-icon>
</el-button> </el-button>
@@ -214,7 +214,7 @@ const schoolTermList = ref<any[]>([])
const quarterList = ref<any[]>([]) const quarterList = ref<any[]>([])
const classifyList = ref<any[]>([]) const classifyList = ref<any[]>([])
// 表格列配<EFBFBD><EFBFBD>? // 表格列配
const tableColumns = [ const tableColumns = [
{ prop: 'title', label: '批次名称', icon: Document, minWidth: 200 }, { prop: 'title', label: '批次名称', icon: Document, minWidth: 200 },
{ prop: 'schoolYear', label: '学年', icon: Calendar, width: 120 }, { prop: 'schoolYear', label: '学年', icon: Calendar, width: 120 },
@@ -222,7 +222,7 @@ const tableColumns = [
{ prop: 'type', label: '季度', icon: Timer, width: 100 }, { prop: 'type', label: '季度', icon: Timer, width: 100 },
{ prop: 'classify', label: '类别', icon: Collection, width: 100 }, { prop: 'classify', label: '类别', icon: Collection, width: 100 },
{ prop: 'moneyValue', label: '补助金额', icon: Money, width: 120 }, { prop: 'moneyValue', label: '补助金额', icon: Money, width: 120 },
{ prop: 'startTime', label: '开始日<EFBFBD><EFBFBD>?, icon: Calendar, width: 120 }, { prop: 'startTime', label: '开始日期', icon: Calendar, width: 120 },
{ prop: 'endTime', label: '截止日期', icon: Calendar, width: 120 }, { prop: 'endTime', label: '截止日期', icon: Calendar, width: 120 },
{ prop: 'remarks', label: '备注', icon: EditPen, minWidth: 150 } { prop: 'remarks', label: '备注', icon: EditPen, minWidth: 150 }
] ]
@@ -264,7 +264,7 @@ const {
tableStyle: _tableStyle tableStyle: _tableStyle
} = useTable(state) } = useTable(state)
// 格式化学<EFBFBD><EFBFBD>? // 格式化学
const formatSchoolTerm = (value: string | number) => { const formatSchoolTerm = (value: string | number) => {
if (value === null || value === undefined || value === '') { if (value === null || value === undefined || value === '') {
return '-' return '-'
@@ -273,7 +273,7 @@ const formatSchoolTerm = (value: string | number) => {
return dictItem ? dictItem.label : value return dictItem ? dictItem.label : value
} }
// 格式化季<EFBFBD><EFBFBD>? // 格式化季
const formatQuarter = (value: string | number) => { const formatQuarter = (value: string | number) => {
if (value === null || value === undefined || value === '') { if (value === null || value === undefined || value === '') {
return '-' return '-'
@@ -282,7 +282,7 @@ const formatQuarter = (value: string | number) => {
return dictItem ? dictItem.label : value return dictItem ? dictItem.label : value
} }
// 格式化类<EFBFBD><EFBFBD>? // 格式化类
const formatClassify = (value: string | number) => { const formatClassify = (value: string | number) => {
if (value === null || value === undefined || value === '') { if (value === null || value === undefined || value === '') {
return '-' return '-'
@@ -313,7 +313,7 @@ const handleEdit = (row: any) => {
const handleDelete = async (row: any) => { const handleDelete = async (row: any) => {
try { try {
const { confirm } = useMessageBox() const { confirm } = useMessageBox()
await confirm(`确定要删除批<E999A4><E689B9>?"${row.title}" 吗?`) await confirm(`确定要删除批次"${row.title}" 吗?`)
await delObj([row.id]) await delObj([row.id])
useMessage().success('删除成功') useMessage().success('删除成功')
getDataList() getDataList()
@@ -389,7 +389,7 @@ const getClassifyDict = async () => {
} }
} }
// 初始<EFBFBD><EFBFBD>? // 初始
onMounted(() => { onMounted(() => {
getSchoolYearList() getSchoolYearList()
getSchoolTermDict() getSchoolTermDict()

View File

@@ -7,7 +7,7 @@
<div class="card-header"> <div class="card-header">
<span class="card-title"> <span class="card-title">
<el-icon class="title-icon"><Search /></el-icon> <el-icon class="title-icon"><Search /></el-icon>
筛选条<EFBFBD><EFBFBD>? 筛选条
</span> </span>
</div> </div>
</template> </template>
@@ -34,10 +34,10 @@
clearable clearable
style="width: 200px" /> style="width: 200px" />
</el-form-item> </el-form-item>
<el-form-item label="所属类<EFBFBD><EFBFBD>? prop="type"> <el-form-item label="所属类别" prop="type">
<el-select <el-select
v-model="state.queryForm.type" v-model="state.queryForm.type"
placeholder="请选择所属类<EFBFBD><EFBFBD>? placeholder="请选择所属类别"
clearable clearable
style="width: 200px"> style="width: 200px">
<el-option <el-option
@@ -84,7 +84,7 @@
@order-change="handleColumnOrderChange" @order-change="handleColumnOrderChange"
> >
<template #trigger> <template #trigger>
<el-tooltip class="item" effect="dark" content="列设<EFBFBD><EFBFBD>? placement="top"> <el-tooltip class="item" effect="dark" content="列设置" placement="top">
<el-button circle style="margin-left: 0;"> <el-button circle style="margin-left: 0;">
<el-icon><Menu /></el-icon> <el-icon><Menu /></el-icon>
</el-button> </el-button>
@@ -125,14 +125,14 @@
<el-icon><component :is="columnConfigMap[col.prop]?.icon || Calendar" /></el-icon> <el-icon><component :is="columnConfigMap[col.prop]?.icon || Calendar" /></el-icon>
<span style="margin-left: 4px">{{ col.label }}</span> <span style="margin-left: 4px">{{ col.label }}</span>
</template> </template>
<!-- 人数列特殊模<EFBFBD><EFBFBD>?--> <!-- 人数列特殊模 -->
<template v-if="col.prop === 'num'" #default="scope"> <template v-if="col.prop === 'num'" #default="scope">
<el-tag v-if="scope.row.num !== undefined && scope.row.num !== null" size="small" type="success" effect="plain"> <el-tag v-if="scope.row.num !== undefined && scope.row.num !== null" size="small" type="success" effect="plain">
{{ scope.row.num }} {{ scope.row.num }}
</el-tag> </el-tag>
<span v-else>-</span> <span v-else>-</span>
</template> </template>
<!-- 成立时间列特殊模<EFBFBD><EFBFBD>?--> <!-- 成立时间列特殊模 -->
<template v-else-if="col.prop === 'openTime'" #default="scope"> <template v-else-if="col.prop === 'openTime'" #default="scope">
<span>{{ parseTime(scope.row.openTime, '{y}-{m}-{d}') }}</span> <span>{{ parseTime(scope.row.openTime, '{y}-{m}-{d}') }}</span>
</template> </template>
@@ -222,21 +222,21 @@ const showSearch = ref(true)
const deptList = ref<any[]>([]) const deptList = ref<any[]>([])
const typeList = ref<any[]>([]) const typeList = ref<any[]>([])
// 表格列配<EFBFBD><EFBFBD>? // 表格列配
const tableColumns = [ const tableColumns = [
{ prop: 'associationName', label: '社团名称', minWidth: 200 }, { prop: 'associationName', label: '社团名称', minWidth: 200 },
{ prop: 'deptName', label: '学院', minWidth: 150 }, { prop: 'deptName', label: '学院', minWidth: 150 },
{ prop: 'teacherRealName', label: '指导老师姓名', width: 120 }, { prop: 'teacherRealName', label: '指导老师姓名', width: 120 },
{ prop: 'maintainer', label: '负责<EFBFBD><EFBFBD>?, width: 100 }, { prop: 'maintainer', label: '负责人', width: 100 },
{ prop: 'num', label: '人数', width: 80 }, { prop: 'num', label: '人数', width: 80 },
{ prop: 'openTime', label: '成立时间', width: 120 }, { prop: 'openTime', label: '成立时间', width: 120 },
{ prop: 'tel', label: '联系电话', width: 120 }, { prop: 'tel', label: '联系电话', width: 120 },
{ prop: 'type', label: '所属类<EFBFBD><EFBFBD>?, width: 120 }, { prop: 'type', label: '所属类别', width: 120 },
{ prop: 'applyNote', label: '成立申请', minWidth: 200 }, { prop: 'applyNote', label: '成立申请', minWidth: 200 },
{ prop: 'ruleNote', label: '社团章程', minWidth: 200 } { prop: 'ruleNote', label: '社团章程', minWidth: 200 }
] ]
// 列配置映射(用于图标<EFBFBD><EFBFBD>? // 列配置映射(用于图标显示)
const columnConfigMap: Record<string, { icon: any }> = { const columnConfigMap: Record<string, { icon: any }> = {
associationName: { icon: Trophy }, associationName: { icon: Trophy },
deptName: { icon: OfficeBuilding }, deptName: { icon: OfficeBuilding },
@@ -277,7 +277,7 @@ const state: BasicTableProps = reactive<BasicTableProps>({
item: 'records', item: 'records',
totalCount: 'total' totalCount: 'total'
}, },
createdIsNeed: true // 页面加载时自动获取数<EFBFBD><EFBFBD>? createdIsNeed: true // 页面加载时自动获取数
}) })
// table hook // table hook
@@ -288,7 +288,7 @@ const {
tableStyle: _tableStyle tableStyle: _tableStyle
} = useTable(state) } = useTable(state)
// 格式化类<EFBFBD><EFBFBD>? // 格式化类
const formatType = (value: string | number) => { const formatType = (value: string | number) => {
if (value === null || value === undefined || value === '') { if (value === null || value === undefined || value === '') {
return '-' return '-'
@@ -362,7 +362,7 @@ const getTypeDict = async () => {
} }
} }
// 初始<EFBFBD><EFBFBD>? // 初始
onMounted(() => { onMounted(() => {
getDeptListData() getDeptListData()
getTypeDict() getTypeDict()

View File

@@ -1,21 +1,21 @@
<template> <template>
<div class="modern-page-container"> <div class="modern-page-container">
<div class="page-wrapper"> <div class="page-wrapper">
<!-- 搜索表单卡片 --> <!-- ?????? -->
<el-card v-show="showSearch" class="search-card" shadow="never"> <el-card v-show="showSearch" class="search-card" shadow="never">
<template #header> <template #header>
<div class="card-header"> <div class="card-header">
<span class="card-title"> <span class="card-title">
<el-icon class="title-icon"><Search /></el-icon> <el-icon class="title-icon"><Search /></el-icon>
筛选条<EFBFBD><EFBFBD>? ????
</span> </span>
</div> </div>
</template> </template>
<el-form :model="state.queryForm" ref="searchFormRef" :inline="true" @keyup.enter="getDataList" class="search-form"> <el-form :model="state.queryForm" ref="searchFormRef" :inline="true" @keyup.enter="getDataList" class="search-form">
<el-form-item label="学年" prop="schoolYear"> <el-form-item label="??" prop="schoolYear">
<el-select <el-select
v-model="state.queryForm.schoolYear" v-model="state.queryForm.schoolYear"
placeholder="请选择学年" placeholder="?????"
clearable clearable
filterable filterable
style="width: 200px"> style="width: 200px">
@@ -27,10 +27,10 @@
</el-option> </el-option>
</el-select> </el-select>
</el-form-item> </el-form-item>
<el-form-item label="学期" prop="schoolTerm"> <el-form-item label="??" prop="schoolTerm">
<el-select <el-select
v-model="state.queryForm.schoolTerm" v-model="state.queryForm.schoolTerm"
placeholder="请选择学期" placeholder="?????"
clearable clearable
style="width: 200px"> style="width: 200px">
<el-option <el-option
@@ -41,10 +41,10 @@
</el-option> </el-option>
</el-select> </el-select>
</el-form-item> </el-form-item>
<el-form-item label="学院" prop="deptCode"> <el-form-item label="??" prop="deptCode">
<el-select <el-select
v-model="state.queryForm.deptCode" v-model="state.queryForm.deptCode"
placeholder="请选择学院" placeholder="?????"
clearable clearable
filterable filterable
style="width: 200px"> style="width: 200px">
@@ -56,10 +56,10 @@
</el-option> </el-option>
</el-select> </el-select>
</el-form-item> </el-form-item>
<el-form-item label="班级" prop="classCode"> <el-form-item label="??" prop="classCode">
<el-select <el-select
v-model="state.queryForm.classCode" v-model="state.queryForm.classCode"
placeholder="请选择班级" placeholder="?????"
clearable clearable
filterable filterable
style="width: 200px"> style="width: 200px">
@@ -71,41 +71,41 @@
</el-option> </el-option>
</el-select> </el-select>
</el-form-item> </el-form-item>
<el-form-item label="姓名" prop="realName"> <el-form-item label="??" prop="realName">
<el-input <el-input
v-model="state.queryForm.realName" v-model="state.queryForm.realName"
placeholder="请输入姓<EFBFBD><EFBFBD>? placeholder="?????"
clearable clearable
style="width: 200px" /> style="width: 200px" />
</el-form-item> </el-form-item>
<el-form-item label="学号" prop="stuNo"> <el-form-item label="??" prop="stuNo">
<el-input <el-input
v-model="state.queryForm.stuNo" v-model="state.queryForm.stuNo"
placeholder="请输入学<EFBFBD><EFBFBD>? placeholder="?????"
clearable clearable
style="width: 200px" /> style="width: 200px" />
</el-form-item> </el-form-item>
<el-form-item> <el-form-item>
<el-button type="primary" plain icon="Search" @click="getDataList">查询</el-button> <el-button type="primary" plain icon="Search" @click="getDataList">??</el-button>
<el-button icon="Refresh" @click="handleReset">重置</el-button> <el-button icon="Refresh" @click="handleReset">??</el-button>
</el-form-item> </el-form-item>
</el-form> </el-form>
</el-card> </el-card>
<!-- 内容卡片 --> <!-- ???? -->
<el-card class="content-card" shadow="never"> <el-card class="content-card" shadow="never">
<template #header> <template #header>
<div class="card-header"> <div class="card-header">
<span class="card-title"> <span class="card-title">
<el-icon class="title-icon"><Document /></el-icon> <el-icon class="title-icon"><Document /></el-icon>
学生关爱记录列表 ????????
</span> </span>
<div class="header-actions"> <div class="header-actions">
<el-button <el-button
icon="Plus" icon="Plus"
type="primary" type="primary"
@click="formDialogRef.openDialog()"> @click="formDialogRef.openDialog()">
新增 ??
</el-button> </el-button>
<right-toolbar <right-toolbar
v-model:showSearch="showSearch" v-model:showSearch="showSearch"
@@ -121,7 +121,7 @@
@order-change="handleColumnOrderChange" @order-change="handleColumnOrderChange"
> >
<template #trigger> <template #trigger>
<el-tooltip class="item" effect="dark" content="列设<EFBFBD><EFBFBD>? placement="top"> <el-tooltip class="item" effect="dark" content="???" placement="top">
<el-button circle style="margin-left: 0;"> <el-button circle style="margin-left: 0;">
<el-icon><Menu /></el-icon> <el-icon><Menu /></el-icon>
</el-button> </el-button>
@@ -133,7 +133,7 @@
</div> </div>
</template> </template>
<!-- 表格 --> <!-- ?? -->
<el-table <el-table
:data="state.dataList" :data="state.dataList"
v-loading="state.loading" v-loading="state.loading"
@@ -141,7 +141,7 @@
:cell-style="tableStyle.cellStyle" :cell-style="tableStyle.cellStyle"
:header-cell-style="tableStyle.headerCellStyle" :header-cell-style="tableStyle.headerCellStyle"
class="modern-table"> 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> <template #header>
<el-icon><List /></el-icon> <el-icon><List /></el-icon>
</template> </template>
@@ -151,7 +151,7 @@
</el-table-column> </el-table-column>
<template v-for="col in visibleColumnsSorted" :key="col.prop || col.label"> <template v-for="col in visibleColumnsSorted" :key="col.prop || col.label">
<el-table-column <el-table-column
v-if="checkColumnVisible(col.prop || '') && col.prop !== '操作'" v-if="checkColumnVisible(col.prop || '') && col.prop !== '??'"
:prop="col.prop" :prop="col.prop"
:label="col.label" :label="col.label"
show-overflow-tooltip show-overflow-tooltip
@@ -162,32 +162,32 @@
<el-icon><component :is="columnConfigMap[col.prop]?.icon || Calendar" /></el-icon> <el-icon><component :is="columnConfigMap[col.prop]?.icon || Calendar" /></el-icon>
<span style="margin-left: 4px">{{ col.label }}</span> <span style="margin-left: 4px">{{ col.label }}</span>
</template> </template>
<!-- 学期列特殊模<EFBFBD><EFBFBD>?--> <!-- ??????? -->
<template v-if="col.prop === 'schoolTerm'" #default="scope"> <template v-if="col.prop === 'schoolTerm'" #default="scope">
<el-tag size="small" type="primary" effect="plain"> <el-tag size="small" type="primary" effect="plain">
{{ formatSchoolTerm(scope.row.schoolTerm) }} {{ formatSchoolTerm(scope.row.schoolTerm) }}
</el-tag> </el-tag>
</template> </template>
<!-- 需关爱类型列特殊模<EFBFBD><EFBFBD>?--> <!-- ?????????? -->
<template v-else-if="col.prop === 'careType'" #default="scope"> <template v-else-if="col.prop === 'careType'" #default="scope">
<el-tag size="small" type="danger" effect="plain"> <el-tag size="small" type="danger" effect="plain">
{{ formatCareType(scope.row.careType) }} {{ formatCareType(scope.row.careType) }}
</el-tag> </el-tag>
</template> </template>
<!-- 记录时间列特殊模<EFBFBD><EFBFBD>?--> <!-- ????????? -->
<template v-else-if="col.prop === 'recordDate'" #default="scope"> <template v-else-if="col.prop === 'recordDate'" #default="scope">
<span>{{ scope.row.recordDate || '-' }}</span> <span>{{ scope.row.recordDate || '-' }}</span>
</template> </template>
<!-- 干预结果列特殊模<EFBFBD><EFBFBD>?--> <!-- ????????? -->
<template v-else-if="col.prop === 'result'" #default="scope"> <template v-else-if="col.prop === 'result'" #default="scope">
<span>{{ scope.row.result || '-' }}</span> <span>{{ scope.row.result || '-' }}</span>
</template> </template>
</el-table-column> </el-table-column>
</template> </template>
<el-table-column label="操作" width="250" align="center" fixed="right"> <el-table-column label="??" width="250" align="center" fixed="right">
<template #header> <template #header>
<el-icon><Setting /></el-icon> <el-icon><Setting /></el-icon>
<span style="margin-left: 4px">操作</span> <span style="margin-left: 4px">??</span>
</template> </template>
<template #default="scope"> <template #default="scope">
<el-button <el-button
@@ -195,27 +195,27 @@
link link
type="primary" type="primary"
@click="handleEdit(scope.row)"> @click="handleEdit(scope.row)">
编辑 ??
</el-button> </el-button>
<el-button <el-button
icon="Document" icon="Document"
link link
type="success" type="success"
@click="handleResult(scope.row)"> @click="handleResult(scope.row)">
干预结果 ????
</el-button> </el-button>
<el-button <el-button
icon="Delete" icon="Delete"
link link
type="danger" type="danger"
@click="handleDelete(scope.row)"> @click="handleDelete(scope.row)">
删除 ??
</el-button> </el-button>
</template> </template>
</el-table-column> </el-table-column>
</el-table> </el-table>
<!-- 分页 --> <!-- ?? -->
<div class="pagination-wrapper"> <div class="pagination-wrapper">
<pagination <pagination
@size-change="sizeChangeHandle" @size-change="sizeChangeHandle"
@@ -225,10 +225,10 @@
</el-card> </el-card>
</div> </div>
<!-- 新增/编辑表单弹窗 --> <!-- ??/?????? -->
<form-dialog ref="formDialogRef" @refresh="getDataList" /> <form-dialog ref="formDialogRef" @refresh="getDataList" />
<!-- 干预结果弹窗 --> <!-- ?????? -->
<result-dialog ref="resultDialogRef" @refresh="getDataList" /> <result-dialog ref="resultDialogRef" @refresh="getDataList" />
</div> </div>
</template> </template>
@@ -246,11 +246,11 @@ import { useMessage, useMessageBox } from "/@/hooks/message";
import TableColumnControl from '/@/components/TableColumnControl/index.vue' import TableColumnControl from '/@/components/TableColumnControl/index.vue'
import FormDialog from './form.vue' import FormDialog from './form.vue'
import ResultDialog from './result.vue' import ResultDialog from './result.vue'
import { List, Calendar, Clock, OfficeBuilding, Grid, Avatar, UserFilled, Phone, Heart, Warning, CircleCheck, Setting, Menu, Search, Document } from '@element-plus/icons-vue' import { List, Calendar, Clock, OfficeBuilding, Grid, Avatar, UserFilled, Phone, Star, Warning, CircleCheck, Setting, Menu, Search, Document } from '@element-plus/icons-vue'
import { useTableColumnControl } from '/@/hooks/tableColumnControl' import { useTableColumnControl } from '/@/hooks/tableColumn'
// 定义变量内容 // ??????
const route = useRoute() const route = useRoute()
const formDialogRef = ref() const formDialogRef = ref()
const resultDialogRef = ref() const resultDialogRef = ref()
@@ -263,22 +263,22 @@ const deptList = ref<any[]>([])
const classList = ref<any[]>([]) const classList = ref<any[]>([])
const careTypeList = ref<any[]>([]) const careTypeList = ref<any[]>([])
// 表格列配<EFBFBD><EFBFBD>? // ?????
const tableColumns = [ const tableColumns = [
{ prop: 'schoolYear', label: '学年' }, { prop: 'schoolYear', label: '??' },
{ prop: 'schoolTerm', label: '学期' }, { prop: 'schoolTerm', label: '??' },
{ prop: 'deptName', label: '学院' }, { prop: 'deptName', label: '??' },
{ prop: 'classNo', label: '班级' }, { prop: 'classNo', label: '??' },
{ prop: 'realName', label: '姓名' }, { prop: 'realName', label: '??' },
{ prop: 'teacherRealName', label: '班主任姓<EFBFBD><EFBFBD>? }, { prop: 'teacherRealName', label: '?????' },
{ prop: 'teacherTel', label: '班主任电<EFBFBD><EFBFBD>? }, { prop: 'teacherTel', label: '?????' },
{ prop: 'careType', label: '需关爱类型' }, { prop: 'careType', label: '?????' },
{ prop: 'present', label: '危机表现', minWidth: 150 }, { prop: 'present', label: '????', minWidth: 150 },
{ prop: 'recordDate', label: '记录时间', width: 120 }, { prop: 'recordDate', label: '????', width: 120 },
{ prop: 'result', label: '干预结果', minWidth: 150 } { prop: 'result', label: '????', minWidth: 150 }
] ]
// 列配置映射用于图标<EFBFBD><EFBFBD>? // ?????????????
const columnConfigMap: Record<string, { icon: any }> = { const columnConfigMap: Record<string, { icon: any }> = {
schoolYear: { icon: Calendar }, schoolYear: { icon: Calendar },
schoolTerm: { icon: Clock }, schoolTerm: { icon: Clock },
@@ -287,13 +287,13 @@ const columnConfigMap: Record<string, { icon: any }> = {
realName: { icon: Avatar }, realName: { icon: Avatar },
teacherRealName: { icon: UserFilled }, teacherRealName: { icon: UserFilled },
teacherTel: { icon: Phone }, teacherTel: { icon: Phone },
careType: { icon: Heart }, careType: { icon: Star },
present: { icon: Warning }, present: { icon: Warning },
recordDate: { icon: Calendar }, recordDate: { icon: Calendar },
result: { icon: CircleCheck } result: { icon: CircleCheck }
} }
// 使用表格列控制hook // ???????hook
const { const {
visibleColumns, visibleColumns,
visibleColumnsSorted, visibleColumnsSorted,
@@ -302,7 +302,7 @@ const {
handleColumnOrderChange handleColumnOrderChange
} = useTableColumnControl(tableColumns, route.path) } = useTableColumnControl(tableColumns, route.path)
// 配置 useTable // ?? useTable
const state: BasicTableProps = reactive<BasicTableProps>({ const state: BasicTableProps = reactive<BasicTableProps>({
queryForm: { queryForm: {
schoolYear: '', schoolYear: '',
@@ -328,7 +328,7 @@ const {
tableStyle tableStyle
} = useTable(state) } = useTable(state)
// 格式化学<EFBFBD><EFBFBD>? // ?????
const formatSchoolTerm = (value: string | number) => { const formatSchoolTerm = (value: string | number) => {
if (value === null || value === undefined || value === '') { if (value === null || value === undefined || value === '') {
return '-' return '-'
@@ -337,14 +337,14 @@ const formatSchoolTerm = (value: string | number) => {
return dictItem ? dictItem.label : value return dictItem ? dictItem.label : value
} }
// 格式化需关爱类型 // ????????
const formatCareType = (value: string) => { const formatCareType = (value: string) => {
if (!value) return '-' if (!value) return '-'
const item = careTypeList.value.find((item: any) => item.value === value) const item = careTypeList.value.find((item: any) => item.value === value)
return item ? item.label : value return item ? item.label : value
} }
// 重置 // ??
const handleReset = () => { const handleReset = () => {
searchFormRef.value?.resetFields() searchFormRef.value?.resetFields()
state.queryForm.schoolYear = '' state.queryForm.schoolYear = ''
@@ -356,32 +356,32 @@ const handleReset = () => {
getDataList() getDataList()
} }
// 编辑 // ??
const handleEdit = (row: any) => { const handleEdit = (row: any) => {
formDialogRef.value?.openDialog('edit', row) formDialogRef.value?.openDialog('edit', row)
} }
// 干预结果 // ????
const handleResult = (row: any) => { const handleResult = (row: any) => {
resultDialogRef.value?.openDialog(row) resultDialogRef.value?.openDialog(row)
} }
// 删除 // ??
const handleDelete = async (row: any) => { const handleDelete = async (row: any) => {
const { confirm } = useMessageBox() const { confirm } = useMessageBox()
try { try {
await confirm('确定要删除该心理健康记录吗?') await confirm('??????????????')
await delObj([row.id]) await delObj([row.id])
useMessage().success('删除成功') useMessage().success('????')
getDataList() getDataList()
} catch (err: any) { } catch (err: any) {
if (err !== 'cancel') { if (err !== 'cancel') {
useMessage().error(err.msg || '删除失败') useMessage().error(err.msg || '????')
} }
} }
} }
// 获取学年列表 // ??????
const getSchoolYearList = async () => { const getSchoolYearList = async () => {
try { try {
const res = await queryAllSchoolYear() const res = await queryAllSchoolYear()
@@ -395,7 +395,7 @@ const getSchoolYearList = async () => {
} }
} }
// 获取学期字典 // ??????
const getSchoolTermDict = async () => { const getSchoolTermDict = async () => {
try { try {
const res = await getDicts('school_term') const res = await getDicts('school_term')
@@ -412,7 +412,7 @@ const getSchoolTermDict = async () => {
} }
} }
// 获取学院列表 // ??????
const getDeptListData = async () => { const getDeptListData = async () => {
try { try {
const res = await getDeptList() const res = await getDeptList()
@@ -426,7 +426,7 @@ const getDeptListData = async () => {
} }
} }
// 获取班级列表 // ??????
const getClassListData = async () => { const getClassListData = async () => {
try { try {
const res = await getClassListByRole() const res = await getClassListByRole()
@@ -440,7 +440,7 @@ const getClassListData = async () => {
} }
} }
// 获取需关爱类型字典 // ?????????
const getCareTypeDict = async () => { const getCareTypeDict = async () => {
try { try {
const res = await getDicts('stu_care_type') const res = await getDicts('stu_care_type')
@@ -457,7 +457,7 @@ const getCareTypeDict = async () => {
} }
} }
// 初始<EFBFBD><EFBFBD>? // ???
onMounted(() => { onMounted(() => {
getSchoolYearList() getSchoolYearList()
getSchoolTermDict() getSchoolTermDict()

View File

@@ -1,21 +1,21 @@
<template> <template>
<div class="modern-page-container"> <div class="modern-page-container">
<div class="page-wrapper"> <div class="page-wrapper">
<!-- 搜索表单卡片 --> <!-- ?????? -->
<el-card v-show="showSearch" class="search-card" shadow="never"> <el-card v-show="showSearch" class="search-card" shadow="never">
<template #header> <template #header>
<div class="card-header"> <div class="card-header">
<span class="card-title"> <span class="card-title">
<el-icon class="title-icon"><Search /></el-icon> <el-icon class="title-icon"><Search /></el-icon>
筛选条<EFBFBD><EFBFBD>? ????
</span> </span>
</div> </div>
</template> </template>
<el-form :model="state.queryForm" ref="searchFormRef" :inline="true" @keyup.enter="getDataList" class="search-form"> <el-form :model="state.queryForm" ref="searchFormRef" :inline="true" @keyup.enter="getDataList" class="search-form">
<el-form-item label="学年" prop="schoolYear"> <el-form-item label="??" prop="schoolYear">
<el-select <el-select
v-model="state.queryForm.schoolYear" v-model="state.queryForm.schoolYear"
placeholder="请选择学年" placeholder="?????"
clearable clearable
filterable filterable
style="width: 200px"> style="width: 200px">
@@ -27,10 +27,10 @@
</el-option> </el-option>
</el-select> </el-select>
</el-form-item> </el-form-item>
<el-form-item label="学期" prop="schoolTerm"> <el-form-item label="??" prop="schoolTerm">
<el-select <el-select
v-model="state.queryForm.schoolTerm" v-model="state.queryForm.schoolTerm"
placeholder="请选择学期" placeholder="?????"
clearable clearable
style="width: 200px"> style="width: 200px">
<el-option <el-option
@@ -41,10 +41,10 @@
</el-option> </el-option>
</el-select> </el-select>
</el-form-item> </el-form-item>
<el-form-item label="学院" prop="deptCode"> <el-form-item label="??" prop="deptCode">
<el-select <el-select
v-model="state.queryForm.deptCode" v-model="state.queryForm.deptCode"
placeholder="请选择学院" placeholder="?????"
clearable clearable
filterable filterable
style="width: 200px" style="width: 200px"
@@ -57,10 +57,10 @@
</el-option> </el-option>
</el-select> </el-select>
</el-form-item> </el-form-item>
<el-form-item label="班级" prop="classCode"> <el-form-item label="??" prop="classCode">
<el-select <el-select
v-model="state.queryForm.classCode" v-model="state.queryForm.classCode"
placeholder="请选择班级" placeholder="?????"
clearable clearable
filterable filterable
style="width: 200px"> style="width: 200px">
@@ -72,17 +72,17 @@
</el-option> </el-option>
</el-select> </el-select>
</el-form-item> </el-form-item>
<el-form-item label="姓名" prop="realName"> <el-form-item label="??" prop="realName">
<el-input <el-input
v-model="state.queryForm.realName" v-model="state.queryForm.realName"
placeholder="请输入姓<EFBFBD><EFBFBD>? placeholder="?????"
clearable clearable
style="width: 200px" /> style="width: 200px" />
</el-form-item> </el-form-item>
<el-form-item label="类型" prop="conductType"> <el-form-item label="??" prop="conductType">
<el-select <el-select
v-model="state.queryForm.conductType" v-model="state.queryForm.conductType"
placeholder="请选择类型" placeholder="?????"
clearable clearable
style="width: 200px"> style="width: 200px">
<el-option <el-option
@@ -94,33 +94,33 @@
</el-select> </el-select>
</el-form-item> </el-form-item>
<el-form-item> <el-form-item>
<el-button type="primary" plain icon="Search" @click="getDataList">查询</el-button> <el-button type="primary" plain icon="Search" @click="getDataList">??</el-button>
<el-button icon="Refresh" @click="handleReset">重置</el-button> <el-button icon="Refresh" @click="handleReset">??</el-button>
</el-form-item> </el-form-item>
</el-form> </el-form>
</el-card> </el-card>
<!-- 内容卡片 --> <!-- ???? -->
<el-card class="content-card" shadow="never"> <el-card class="content-card" shadow="never">
<template #header> <template #header>
<div class="card-header"> <div class="card-header">
<span class="card-title"> <span class="card-title">
<el-icon class="title-icon"><Document /></el-icon> <el-icon class="title-icon"><Document /></el-icon>
学生操行记录列表 ????????
</span> </span>
<div class="header-actions"> <div class="header-actions">
<el-button <el-button
icon="Plus" icon="Plus"
type="primary" type="primary"
@click="formDialogRef.openDialog()"> @click="formDialogRef.openDialog()">
新增 ??
</el-button> </el-button>
<el-button <el-button
icon="Upload" icon="Upload"
type="success" type="success"
class="ml10" class="ml10"
@click="handleImport"> @click="handleImport">
导入 ??
</el-button> </el-button>
<right-toolbar <right-toolbar
v-model:showSearch="showSearch" v-model:showSearch="showSearch"
@@ -136,7 +136,7 @@
@order-change="handleColumnOrderChange" @order-change="handleColumnOrderChange"
> >
<template #trigger> <template #trigger>
<el-tooltip class="item" effect="dark" content="列设<EFBFBD><EFBFBD>? placement="top"> <el-tooltip class="item" effect="dark" content="???" placement="top">
<el-button circle style="margin-left: 0;"> <el-button circle style="margin-left: 0;">
<el-icon><Menu /></el-icon> <el-icon><Menu /></el-icon>
</el-button> </el-button>
@@ -148,7 +148,7 @@
</div> </div>
</template> </template>
<!-- 表格 --> <!-- ?? -->
<el-table <el-table
:data="state.dataList" :data="state.dataList"
v-loading="state.loading" v-loading="state.loading"
@@ -156,7 +156,7 @@
:cell-style="tableStyle.cellStyle" :cell-style="tableStyle.cellStyle"
:header-cell-style="tableStyle.headerCellStyle" :header-cell-style="tableStyle.headerCellStyle"
class="modern-table"> 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> <template #header>
<el-icon><List /></el-icon> <el-icon><List /></el-icon>
</template> </template>
@@ -166,7 +166,7 @@
</el-table-column> </el-table-column>
<template v-for="col in visibleColumnsSorted" :key="col.prop || col.label"> <template v-for="col in visibleColumnsSorted" :key="col.prop || col.label">
<el-table-column <el-table-column
v-if="checkColumnVisible(col.prop || '') && col.prop !== '操作'" v-if="checkColumnVisible(col.prop || '') && col.prop !== '??'"
:prop="col.prop" :prop="col.prop"
:label="col.label" :label="col.label"
show-overflow-tooltip show-overflow-tooltip
@@ -177,23 +177,23 @@
<el-icon><component :is="columnConfigMap[col.prop]?.icon || Calendar" /></el-icon> <el-icon><component :is="columnConfigMap[col.prop]?.icon || Calendar" /></el-icon>
<span style="margin-left: 4px">{{ col.label }}</span> <span style="margin-left: 4px">{{ col.label }}</span>
</template> </template>
<!-- 学期列特殊模<EFBFBD><EFBFBD>?--> <!-- ??????? -->
<template v-if="col.prop === 'schoolTerm'" #default="scope"> <template v-if="col.prop === 'schoolTerm'" #default="scope">
<el-tag size="small" type="primary" effect="plain"> <el-tag size="small" type="primary" effect="plain">
{{ formatSchoolTerm(scope.row.schoolTerm) }} {{ formatSchoolTerm(scope.row.schoolTerm) }}
</el-tag> </el-tag>
</template> </template>
<!-- 类型列特殊模<EFBFBD><EFBFBD>?--> <!-- ??????? -->
<template v-else-if="col.prop === 'conductType'" #default="scope"> <template v-else-if="col.prop === 'conductType'" #default="scope">
<el-tag size="small" type="warning" effect="plain"> <el-tag size="small" type="warning" effect="plain">
{{ formatType(scope.row.conductType) }} {{ formatType(scope.row.conductType) }}
</el-tag> </el-tag>
</template> </template>
<!-- 考核时间列特殊模<EFBFBD><EFBFBD>?--> <!-- ????????? -->
<template v-else-if="col.prop === 'recordDate'" #default="scope"> <template v-else-if="col.prop === 'recordDate'" #default="scope">
<span>{{ scope.row.recordDate || '-' }}</span> <span>{{ scope.row.recordDate || '-' }}</span>
</template> </template>
<!-- 附件列特殊模<EFBFBD><EFBFBD>?--> <!-- ??????? -->
<template v-else-if="col.prop === 'attachment'" #default="scope"> <template v-else-if="col.prop === 'attachment'" #default="scope">
<el-button <el-button
v-if="scope.row.attachment" v-if="scope.row.attachment"
@@ -202,16 +202,16 @@
type="primary" type="primary"
size="small" size="small"
@click="handleViewAttachment(scope.row)"> @click="handleViewAttachment(scope.row)">
查看 ??
</el-button> </el-button>
<span v-else>-</span> <span v-else>-</span>
</template> </template>
</el-table-column> </el-table-column>
</template> </template>
<el-table-column label="操作" width="150" align="center" fixed="right"> <el-table-column label="??" width="150" align="center" fixed="right">
<template #header> <template #header>
<el-icon><Setting /></el-icon> <el-icon><Setting /></el-icon>
<span style="margin-left: 4px">操作</span> <span style="margin-left: 4px">??</span>
</template> </template>
<template #default="scope"> <template #default="scope">
<el-button <el-button
@@ -219,20 +219,20 @@
link link
type="primary" type="primary"
@click="handleEdit(scope.row)"> @click="handleEdit(scope.row)">
编辑 ??
</el-button> </el-button>
<el-button <el-button
icon="Delete" icon="Delete"
link link
type="danger" type="danger"
@click="handleDelete(scope.row)"> @click="handleDelete(scope.row)">
删除 ??
</el-button> </el-button>
</template> </template>
</el-table-column> </el-table-column>
</el-table> </el-table>
<!-- 分页 --> <!-- ?? -->
<div class="pagination-wrapper"> <div class="pagination-wrapper">
<pagination <pagination
@size-change="sizeChangeHandle" @size-change="sizeChangeHandle"
@@ -242,12 +242,12 @@
</el-card> </el-card>
</div> </div>
<!-- 新增/编辑表单弹窗 --> <!-- ??/?????? -->
<form-dialog ref="formDialogRef" @refresh="getDataList" /> <form-dialog ref="formDialogRef" @refresh="getDataList" />
<!-- 导入弹窗 --> <!-- ???? -->
<el-dialog <el-dialog
title="导入操行考核" title="??????"
v-model="importDialogVisible" v-model="importDialogVisible"
:width="500" :width="500"
:close-on-click-modal="false" :close-on-click-modal="false"
@@ -261,18 +261,18 @@
drag> drag>
<el-icon class="el-icon--upload"><upload-filled /></el-icon> <el-icon class="el-icon--upload"><upload-filled /></el-icon>
<div class="el-upload__text"> <div class="el-upload__text">
将文件拖到此处<EFBFBD><EFBFBD>?em>点击上传</em> ????????<em>????</em>
</div> </div>
<template #tip> <template #tip>
<div class="el-upload__tip"> <div class="el-upload__tip">
只能上传 xlsx/xls 文件 ???? xlsx/xls ??
</div> </div>
</template> </template>
</el-upload> </el-upload>
<template #footer> <template #footer>
<span class="dialog-footer"> <span class="dialog-footer">
<el-button @click="importDialogVisible = false"><EFBFBD><EFBFBD>?<EFBFBD><EFBFBD>?/el-button> <el-button @click="importDialogVisible = false">??</el-button>
<el-button type="primary" @click="handleImportSubmit" :disabled="!importFile || importLoading"><EFBFBD><EFBFBD>?<EFBFBD><EFBFBD>?/el-button> <el-button type="primary" @click="handleImportSubmit" :disabled="!importFile || importLoading">??</el-button>
</span> </span>
</template> </template>
</el-dialog> </el-dialog>
@@ -291,11 +291,11 @@ import { getDicts } from "/@/api/admin/dict";
import { useMessage, useMessageBox } from "/@/hooks/message"; import { useMessage, useMessageBox } from "/@/hooks/message";
import TableColumnControl from '/@/components/TableColumnControl/index.vue' import TableColumnControl from '/@/components/TableColumnControl/index.vue'
import { UploadFilled, List, CreditCard, Calendar, Clock, OfficeBuilding, Grid, Avatar, Collection, Document, Setting, Menu, Search } from '@element-plus/icons-vue' import { UploadFilled, List, CreditCard, Calendar, Clock, OfficeBuilding, Grid, Avatar, Collection, Document, Setting, Menu, Search } from '@element-plus/icons-vue'
import { useTableColumnControl } from '/@/hooks/tableColumnControl' import { useTableColumnControl } from '/@/hooks/tableColumn'
import FormDialog from './form.vue' import FormDialog from './form.vue'
// 定义变量内容 // ??????
const route = useRoute() const route = useRoute()
const formDialogRef = ref() const formDialogRef = ref()
const columnControlRef = ref<any>() const columnControlRef = ref<any>()
@@ -311,21 +311,21 @@ const importDialogVisible = ref(false)
const importFile = ref<File | null>(null) const importFile = ref<File | null>(null)
const importLoading = ref(false) const importLoading = ref(false)
// 表格列配<EFBFBD><EFBFBD>? // ?????
const tableColumns = [ const tableColumns = [
{ prop: 'stuNo', label: '学号' }, { prop: 'stuNo', label: '??' },
{ prop: 'schoolYear', label: '学年' }, { prop: 'schoolYear', label: '??' },
{ prop: 'schoolTerm', label: '学期' }, { prop: 'schoolTerm', label: '??' },
{ prop: 'deptName', label: '学院' }, { prop: 'deptName', label: '??' },
{ prop: 'classNo', label: '班级' }, { prop: 'classNo', label: '??' },
{ prop: 'realName', label: '姓名' }, { prop: 'realName', label: '??' },
{ prop: 'conductType', label: '类型' }, { prop: 'conductType', label: '??' },
{ prop: 'recordDate', label: '考核时间', width: 120 }, { prop: 'recordDate', label: '????', width: 120 },
{ prop: 'description', label: '情况记录', minWidth: 150 }, { prop: 'description', label: '????', minWidth: 150 },
{ prop: 'attachment', label: '附件', width: 100 } { prop: 'attachment', label: '??', width: 100 }
] ]
// 列配置映射用于图标<EFBFBD><EFBFBD>? // ????????????
const columnConfigMap: Record<string, { icon: any }> = { const columnConfigMap: Record<string, { icon: any }> = {
stuNo: { icon: CreditCard }, stuNo: { icon: CreditCard },
schoolYear: { icon: Calendar }, schoolYear: { icon: Calendar },
@@ -339,7 +339,7 @@ const columnConfigMap: Record<string, { icon: any }> = {
attachment: { icon: Document } attachment: { icon: Document }
} }
// 使用表格列控制hook // ???????hook
const { const {
visibleColumns, visibleColumns,
visibleColumnsSorted, visibleColumnsSorted,
@@ -348,7 +348,7 @@ const {
handleColumnOrderChange handleColumnOrderChange
} = useTableColumnControl(tableColumns, route.path) } = useTableColumnControl(tableColumns, route.path)
// 配置 useTable // ?? useTable
const state: BasicTableProps = reactive<BasicTableProps>({ const state: BasicTableProps = reactive<BasicTableProps>({
queryForm: { queryForm: {
schoolYear: '', schoolYear: '',
@@ -374,7 +374,7 @@ const {
tableStyle tableStyle
} = useTable(state) } = useTable(state)
// 格式化学<EFBFBD><EFBFBD>? // ?????
const formatSchoolTerm = (value: string | number) => { const formatSchoolTerm = (value: string | number) => {
if (value === null || value === undefined || value === '') { if (value === null || value === undefined || value === '') {
return '-' return '-'
@@ -383,19 +383,19 @@ const formatSchoolTerm = (value: string | number) => {
return dictItem ? dictItem.label : value return dictItem ? dictItem.label : value
} }
// 格式化类<EFBFBD><EFBFBD>? // ?????
const formatType = (value: string) => { const formatType = (value: string) => {
if (!value) return '-' if (!value) return '-'
const item = typeList.value.find((item: any) => item.value === value) const item = typeList.value.find((item: any) => item.value === value)
return item ? item.label : value return item ? item.label : value
} }
// 学院变化 // ????
const handleDeptChange = () => { const handleDeptChange = () => {
// 可以根据学院筛选班级这里暂时不实<EFBFBD><EFBFBD>? // ??????????????????
} }
// 重置 // ??
const handleReset = () => { const handleReset = () => {
searchFormRef.value?.resetFields() searchFormRef.value?.resetFields()
state.queryForm.schoolYear = '' state.queryForm.schoolYear = ''
@@ -407,7 +407,7 @@ const handleReset = () => {
getDataList() getDataList()
} }
// 查看附件 // ????
const handleViewAttachment = (row: any) => { const handleViewAttachment = (row: any) => {
if (row.attachment) { if (row.attachment) {
const urls = typeof row.attachment === 'string' ? row.attachment.split(',') : [row.attachment] const urls = typeof row.attachment === 'string' ? row.attachment.split(',') : [row.attachment]
@@ -419,61 +419,61 @@ const handleViewAttachment = (row: any) => {
} }
} }
// 导入 // ??
const handleImport = () => { const handleImport = () => {
importDialogVisible.value = true importDialogVisible.value = true
importFile.value = null importFile.value = null
uploadRef.value?.clearFiles() uploadRef.value?.clearFiles()
} }
// 文件变化 // ????
const handleFileChange = (file: any) => { const handleFileChange = (file: any) => {
importFile.value = file.raw importFile.value = file.raw
} }
// 提交导入 // ????
const handleImportSubmit = async () => { const handleImportSubmit = async () => {
if (!importFile.value) { if (!importFile.value) {
useMessage().warning('请选择要导入的文件') useMessage().warning('?????????')
return return
} }
importLoading.value = true importLoading.value = true
try { try {
await importExcel(importFile.value) await importExcel(importFile.value)
useMessage().success('导入成功') useMessage().success('????')
importDialogVisible.value = false importDialogVisible.value = false
importFile.value = null importFile.value = null
uploadRef.value?.clearFiles() uploadRef.value?.clearFiles()
getDataList() getDataList()
} catch (err: any) { } catch (err: any) {
useMessage().error(err.msg || '导入失败') useMessage().error(err.msg || '????')
} finally { } finally {
importLoading.value = false importLoading.value = false
} }
} }
// 编辑 // ??
const handleEdit = (row: any) => { const handleEdit = (row: any) => {
formDialogRef.value?.openDialog('edit', row) formDialogRef.value?.openDialog('edit', row)
} }
// 删除 // ??
const handleDelete = async (row: any) => { const handleDelete = async (row: any) => {
const { confirm } = useMessageBox() const { confirm } = useMessageBox()
try { try {
await confirm('确定要删除该操行考核记录吗?') await confirm('??????????????')
await delObj([row.id]) await delObj([row.id])
useMessage().success('删除成功') useMessage().success('????')
getDataList() getDataList()
} catch (err: any) { } catch (err: any) {
if (err !== 'cancel') { if (err !== 'cancel') {
useMessage().error(err.msg || '删除失败') useMessage().error(err.msg || '????')
} }
} }
} }
// 获取学年列表 // ??????
const getSchoolYearList = async () => { const getSchoolYearList = async () => {
try { try {
const res = await queryAllSchoolYear() const res = await queryAllSchoolYear()
@@ -487,7 +487,7 @@ const getSchoolYearList = async () => {
} }
} }
// 获取学期字典 // ??????
const getSchoolTermDict = async () => { const getSchoolTermDict = async () => {
try { try {
const res = await getDicts('school_term') const res = await getDicts('school_term')
@@ -504,7 +504,7 @@ const getSchoolTermDict = async () => {
} }
} }
// 获取学院列表 // ??????
const getDeptListData = async () => { const getDeptListData = async () => {
try { try {
const res = await getDeptList() const res = await getDeptList()
@@ -518,7 +518,7 @@ const getDeptListData = async () => {
} }
} }
// 获取班级列表 // ??????
const getClassListData = async () => { const getClassListData = async () => {
try { try {
const res = await getClassListByRole() const res = await getClassListByRole()
@@ -532,7 +532,7 @@ const getClassListData = async () => {
} }
} }
// 获取类型字典 // ??????
const getTypeDict = async () => { const getTypeDict = async () => {
try { try {
const res = await getDicts('conduct_type') const res = await getDicts('conduct_type')
@@ -549,7 +549,7 @@ const getTypeDict = async () => {
} }
} }
// 初始<EFBFBD><EFBFBD>? // ???
onMounted(() => { onMounted(() => {
getSchoolYearList() getSchoolYearList()
getSchoolTermDict() getSchoolTermDict()

View File

@@ -7,7 +7,7 @@
<div class="card-header"> <div class="card-header">
<span class="card-title"> <span class="card-title">
<el-icon class="title-icon"><Search /></el-icon> <el-icon class="title-icon"><Search /></el-icon>
筛选条<EFBFBD><EFBFBD>? 筛选条
</span> </span>
</div> </div>
</template> </template>
@@ -47,7 +47,7 @@
icon="FolderAdd" icon="FolderAdd"
type="primary" type="primary"
@click="formDialogRef.openDialog()"> @click="formDialogRef.openDialog()">
<EFBFBD><EFBFBD>?<EFBFBD><EFBFBD>? 新增
</el-button> </el-button>
<right-toolbar <right-toolbar
v-model:showSearch="showSearch" v-model:showSearch="showSearch"
@@ -63,7 +63,7 @@
@order-change="handleColumnOrderChange" @order-change="handleColumnOrderChange"
> >
<template #trigger> <template #trigger>
<el-tooltip class="item" effect="dark" content="列设<EFBFBD><EFBFBD>? placement="top"> <el-tooltip class="item" effect="dark" content="列设置" placement="top">
<el-button circle style="margin-left: 0;"> <el-button circle style="margin-left: 0;">
<el-icon><Menu /></el-icon> <el-icon><Menu /></el-icon>
</el-button> </el-button>
@@ -161,7 +161,7 @@ import { useMessage, useMessageBox } from "/@/hooks/message";
import TableColumnControl from '/@/components/TableColumnControl/index.vue' import TableColumnControl from '/@/components/TableColumnControl/index.vue'
import FormDialog from './form.vue' import FormDialog from './form.vue'
import { List, Calendar, Document, OfficeBuilding, Setting, Menu, Search } from '@element-plus/icons-vue' import { List, Calendar, Document, OfficeBuilding, Setting, Menu, Search } from '@element-plus/icons-vue'
import { useTableColumnControl } from '/@/hooks/tableColumnControl' import { useTableColumnControl } from '/@/hooks/tableColumn'
// 定义变量内容 // 定义变量内容
@@ -172,9 +172,9 @@ const showSearch = ref(true)
const deptList = ref<any[]>([]) const deptList = ref<any[]>([])
const formDialogRef = ref() const formDialogRef = ref()
// 表格列配<EFBFBD><EFBFBD>? // 表格列配
const tableColumns = [ const tableColumns = [
{ prop: 'startTime', label: '开始时<EFBFBD><EFBFBD>?, icon: Calendar, width: 180 }, { prop: 'startTime', label: '开始时间', icon: Calendar, width: 180 },
{ prop: 'endTime', label: '结束时间', icon: Calendar, width: 180 }, { prop: 'endTime', label: '结束时间', icon: Calendar, width: 180 },
{ prop: 'reason', label: '请假事由', icon: Document }, { prop: 'reason', label: '请假事由', icon: Document },
{ prop: 'deptName', label: '发起部门', icon: OfficeBuilding } { prop: 'deptName', label: '发起部门', icon: OfficeBuilding }
@@ -213,7 +213,7 @@ const {
tableStyle tableStyle
} = useTable(state) } = useTable(state)
// 格式化日期时<EFBFBD><EFBFBD>? // 格式化日期时
const formatDateTime = (dateTime: string) => { const formatDateTime = (dateTime: string) => {
if (!dateTime) return '-' if (!dateTime) return '-'
// 如果包含时间部分,只显示日期部分 // 如果包含时间部分,只显示日期部分
@@ -243,7 +243,7 @@ const handleEdit = (row: any) => {
// 删除 // 删除
const handleDelete = async (row: any) => { const handleDelete = async (row: any) => {
try { try {
await useMessageBox().confirm('确定要删除这条记录吗<EFBFBD><EFBFBD>?) await useMessageBox().confirm('确定要删除这条记录吗')
await delObj([row.id]) await delObj([row.id])
useMessage().success('删除成功') useMessage().success('删除成功')
getDataList() getDataList()
@@ -266,7 +266,7 @@ const getDeptListData = async () => {
} }
} }
// 初始<EFBFBD><EFBFBD>? // 初始
onMounted(() => { onMounted(() => {
getDeptListData() getDeptListData()
}) })

View File

@@ -1,21 +1,21 @@
<template> <template>
<div class="modern-page-container"> <div class="modern-page-container">
<div class="page-wrapper"> <div class="page-wrapper">
<!-- 搜索表单卡片 --> <!-- ???? -->
<el-card v-show="showSearch" class="search-card" shadow="never"> <el-card v-show="showSearch" class="search-card" shadow="never">
<template #header> <template #header>
<div class="card-header"> <div class="card-header">
<span class="card-title"> <span class="card-title">
<el-icon class="title-icon"><Search /></el-icon> <el-icon class="title-icon"><Search /></el-icon>
筛选条<EFBFBD><EFBFBD>? ????
</span> </span>
</div> </div>
</template> </template>
<el-form :model="searchForm" ref="searchFormRef" :inline="true" @keyup.enter="handleSearch" class="search-form"> <el-form :model="searchForm" ref="searchFormRef" :inline="true" @keyup.enter="handleSearch" class="search-form">
<el-form-item label="学年" prop="schoolYear"> <el-form-item label="??" prop="schoolYear">
<el-select <el-select
v-model="searchForm.schoolYear" v-model="searchForm.schoolYear"
placeholder="请选择学年" placeholder="?????"
clearable clearable
filterable filterable
style="width: 200px"> style="width: 200px">
@@ -27,10 +27,10 @@
</el-option> </el-option>
</el-select> </el-select>
</el-form-item> </el-form-item>
<el-form-item label="学期" prop="schoolTerm"> <el-form-item label="??" prop="schoolTerm">
<el-select <el-select
v-model="searchForm.schoolTerm" v-model="searchForm.schoolTerm"
placeholder="请选择学期" placeholder="?????"
clearable clearable
style="width: 200px"> style="width: 200px">
<el-option <el-option
@@ -41,10 +41,10 @@
</el-option> </el-option>
</el-select> </el-select>
</el-form-item> </el-form-item>
<el-form-item label="学院" prop="deptCode"> <el-form-item label="??" prop="deptCode">
<el-select <el-select
v-model="searchForm.deptCode" v-model="searchForm.deptCode"
placeholder="请选择学院" placeholder="?????"
clearable clearable
filterable filterable
style="width: 200px"> style="width: 200px">
@@ -56,10 +56,10 @@
</el-option> </el-option>
</el-select> </el-select>
</el-form-item> </el-form-item>
<el-form-item label="班级" prop="classCode"> <el-form-item label="??" prop="classCode">
<el-select <el-select
v-model="searchForm.classCode" v-model="searchForm.classCode"
placeholder="请选择班级" placeholder="?????"
clearable clearable
filterable filterable
style="width: 200px"> style="width: 200px">
@@ -71,34 +71,34 @@
</el-option> </el-option>
</el-select> </el-select>
</el-form-item> </el-form-item>
<el-form-item label="姓名" prop="realName"> <el-form-item label="??" prop="realName">
<el-input <el-input
v-model="searchForm.realName" v-model="searchForm.realName"
placeholder="请输入姓<EFBFBD><EFBFBD>? placeholder="?????"
clearable clearable
style="width: 200px" /> style="width: 200px" />
</el-form-item> </el-form-item>
<el-form-item label="学号" prop="stuNo"> <el-form-item label="??" prop="stuNo">
<el-input <el-input
v-model="searchForm.stuNo" v-model="searchForm.stuNo"
placeholder="请输入学<EFBFBD><EFBFBD>? placeholder="?????"
clearable clearable
style="width: 200px" /> style="width: 200px" />
</el-form-item> </el-form-item>
<el-form-item label="处分月份" prop="punlishMonth"> <el-form-item label="????" prop="punlishMonth">
<el-date-picker <el-date-picker
v-model="searchForm.punlishMonth" v-model="searchForm.punlishMonth"
type="month" type="month"
placeholder="选择处分月份" placeholder="??????"
format="YYYY-MM" format="YYYY-MM"
value-format="YYYY-MM" value-format="YYYY-MM"
clearable clearable
style="width: 200px" /> style="width: 200px" />
</el-form-item> </el-form-item>
<el-form-item label="处分级别" prop="punlishLevel"> <el-form-item label="????" prop="punlishLevel">
<el-select <el-select
v-model="searchForm.punlishLevel" v-model="searchForm.punlishLevel"
placeholder="请选择处分级别" placeholder="???????"
clearable clearable
style="width: 200px"> style="width: 200px">
<el-option <el-option
@@ -110,33 +110,33 @@
</el-select> </el-select>
</el-form-item> </el-form-item>
<el-form-item> <el-form-item>
<el-button type="primary" plain icon="Search" @click="handleSearch">查询</el-button> <el-button type="primary" plain icon="Search" @click="handleSearch">??</el-button>
<el-button icon="Refresh" @click="handleReset">重置</el-button> <el-button icon="Refresh" @click="handleReset">??</el-button>
</el-form-item> </el-form-item>
</el-form> </el-form>
</el-card> </el-card>
<!-- 内容卡片 --> <!-- ???? -->
<el-card class="content-card" shadow="never"> <el-card class="content-card" shadow="never">
<template #header> <template #header>
<div class="card-header"> <div class="card-header">
<span class="card-title"> <span class="card-title">
<el-icon class="title-icon"><Document /></el-icon> <el-icon class="title-icon"><Document /></el-icon>
学生处分记录列表 ??????
</span> </span>
<div class="header-actions"> <div class="header-actions">
<el-button <el-button
icon="FolderAdd" icon="FolderAdd"
type="primary" type="primary"
@click="formDialogRef.openDialog()"> @click="formDialogRef.openDialog()">
<EFBFBD><EFBFBD>?<EFBFBD><EFBFBD>? ??
</el-button> </el-button>
<el-button <el-button
icon="Download" icon="Download"
type="success" type="success"
class="ml10" class="ml10"
@click="handleExport"> @click="handleExport">
<EFBFBD><EFBFBD>?<EFBFBD><EFBFBD>? ??
</el-button> </el-button>
<right-toolbar <right-toolbar
v-model:showSearch="showSearch" v-model:showSearch="showSearch"
@@ -152,7 +152,7 @@
@order-change="handleColumnOrderChange" @order-change="handleColumnOrderChange"
> >
<template #trigger> <template #trigger>
<el-tooltip class="item" effect="dark" content="列设<EFBFBD><EFBFBD>? placement="top"> <el-tooltip class="item" effect="dark" content="???" placement="top">
<el-button circle style="margin-left: 0;"> <el-button circle style="margin-left: 0;">
<el-icon><Menu /></el-icon> <el-icon><Menu /></el-icon>
</el-button> </el-button>
@@ -164,7 +164,7 @@
</div> </div>
</template> </template>
<!-- 表格 --> <!-- ?? -->
<el-table <el-table
:data="state.dataList" :data="state.dataList"
v-loading="state.loading" v-loading="state.loading"
@@ -172,7 +172,7 @@
:cell-style="tableStyle.cellStyle" :cell-style="tableStyle.cellStyle"
:header-cell-style="tableStyle.headerCellStyle" :header-cell-style="tableStyle.headerCellStyle"
class="modern-table"> 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> <template #header>
<el-icon><List /></el-icon> <el-icon><List /></el-icon>
</template> </template>
@@ -182,7 +182,7 @@
</el-table-column> </el-table-column>
<template v-for="col in visibleColumnsSorted" :key="col.prop || col.label"> <template v-for="col in visibleColumnsSorted" :key="col.prop || col.label">
<el-table-column <el-table-column
v-if="checkColumnVisible(col.prop || '') && col.prop !== '操作'" v-if="checkColumnVisible(col.prop || '') && col.prop !== '??'"
:prop="col.prop" :prop="col.prop"
:label="col.label" :label="col.label"
show-overflow-tooltip show-overflow-tooltip
@@ -193,40 +193,40 @@
<el-icon><component :is="columnConfigMap[col.prop]?.icon || Calendar" /></el-icon> <el-icon><component :is="columnConfigMap[col.prop]?.icon || Calendar" /></el-icon>
<span style="margin-left: 4px">{{ col.label }}</span> <span style="margin-left: 4px">{{ col.label }}</span>
</template> </template>
<!-- 学期列特殊模<EFBFBD><EFBFBD>?--> <!-- ???? -->
<template v-if="col.prop === 'schoolTerm'" #default="scope"> <template v-if="col.prop === 'schoolTerm'" #default="scope">
<el-tag size="small" type="primary" effect="plain"> <el-tag size="small" type="primary" effect="plain">
{{ formatSchoolTerm(scope.row.schoolTerm) }} {{ formatSchoolTerm(scope.row.schoolTerm) }}
</el-tag> </el-tag>
</template> </template>
<!-- 处分时间列特殊模<EFBFBD><EFBFBD>?--> <!-- ?????? -->
<template v-else-if="col.prop === 'punlishStartDate'" #default="scope"> <template v-else-if="col.prop === 'punlishStartDate'" #default="scope">
<span>{{ scope.row.punlishStartDate ? formatDate(scope.row.punlishStartDate) : '-' }}</span> <span>{{ scope.row.punlishStartDate ? formatDate(scope.row.punlishStartDate) : '-' }}</span>
</template> </template>
<!-- 到期日列特殊模板 --> <!-- ?????? -->
<template v-else-if="col.prop === 'punlishEndDate'" #default="scope"> <template v-else-if="col.prop === 'punlishEndDate'" #default="scope">
<span>{{ scope.row.punlishEndDate ? formatDate(scope.row.punlishEndDate) : '-' }}</span> <span>{{ scope.row.punlishEndDate ? formatDate(scope.row.punlishEndDate) : '-' }}</span>
</template> </template>
<!-- 处分级别列特殊模<EFBFBD><EFBFBD>?--> <!-- ?????? -->
<template v-else-if="col.prop === 'punlishLevel'" #default="scope"> <template v-else-if="col.prop === 'punlishLevel'" #default="scope">
<el-tag size="small" type="danger" effect="plain"> <el-tag size="small" type="danger" effect="plain">
{{ formatPunlishLevel(scope.row.punlishLevel) }} {{ formatPunlishLevel(scope.row.punlishLevel) }}
</el-tag> </el-tag>
</template> </template>
<!-- 处分状态列特殊模板 --> <!-- ???? -->
<template v-else-if="col.prop === 'publishStatus'" #default="scope"> <template v-else-if="col.prop === 'publishStatus'" #default="scope">
<StatusTag <StatusTag
:value="scope.row.publishStatus" :value="scope.row.publishStatus"
:options="[{ label: '有效', value: '1' }, { label: '已撤销', value: '2' }, { label: '已到<EFBFBD><EFBFBD>?, value: '3' }]" :options="[{ label: '??', value: '1' }, { label: '???', value: '2' }, { label: '???', value: '3' }]"
:type-map="{ '1': { type: 'danger', effect: 'light' }, '2': { type: 'success', effect: 'light' }, '3': { type: 'info', effect: 'light' } }" :type-map="{ '1': { type: 'danger', effect: 'light' }, '2': { type: 'success', effect: 'light' }, '3': { type: 'info', effect: 'light' } }"
/> />
</template> </template>
</el-table-column> </el-table-column>
</template> </template>
<el-table-column label="操作" width="250" align="center" fixed="right"> <el-table-column label="??" width="250" align="center" fixed="right">
<template #header> <template #header>
<el-icon><Setting /></el-icon> <el-icon><Setting /></el-icon>
<span style="margin-left: 4px">操作</span> <span style="margin-left: 4px">??</span>
</template> </template>
<template #default="scope"> <template #default="scope">
<el-button <el-button
@@ -234,34 +234,34 @@
link link
type="primary" type="primary"
@click="handleReport(scope.row)"> @click="handleReport(scope.row)">
思想汇报 ????
</el-button> </el-button>
<el-button <el-button
icon="CircleClose" icon="CircleClose"
link link
type="warning" type="warning"
@click="handleCancel(scope.row)"> @click="handleCancel(scope.row)">
撤销处分 ????
</el-button> </el-button>
<el-button <el-button
icon="Edit" icon="Edit"
link link
type="primary" type="primary"
@click="handleEdit(scope.row)"> @click="handleEdit(scope.row)">
编辑 ??
</el-button> </el-button>
<el-button <el-button
icon="Delete" icon="Delete"
link link
type="danger" type="danger"
@click="handleDelete(scope.row)"> @click="handleDelete(scope.row)">
删除 ??
</el-button> </el-button>
</template> </template>
</el-table-column> </el-table-column>
</el-table> </el-table>
<!-- 分页 --> <!-- ?? -->
<div class="pagination-wrapper"> <div class="pagination-wrapper">
<pagination <pagination
@size-change="sizeChangeHandle" @size-change="sizeChangeHandle"
@@ -271,7 +271,7 @@
</el-card> </el-card>
</div> </div>
<!-- 新增/编辑表单弹窗 --> <!-- ??/???? -->
<form-dialog ref="formDialogRef" @refresh="getDataList" /> <form-dialog ref="formDialogRef" @refresh="getDataList" />
</div> </div>
</template> </template>
@@ -289,12 +289,12 @@ import { useMessage, useMessageBox } from "/@/hooks/message";
import TableColumnControl from '/@/components/TableColumnControl/index.vue' import TableColumnControl from '/@/components/TableColumnControl/index.vue'
import FormDialog from './form.vue' import FormDialog from './form.vue'
import { List, Calendar, Clock, OfficeBuilding, Grid, Avatar, CreditCard, Warning, Document, CircleCheck, Setting, Menu, Search } from '@element-plus/icons-vue' import { List, Calendar, Clock, OfficeBuilding, Grid, Avatar, CreditCard, Warning, Document, CircleCheck, Setting, Menu, Search } from '@element-plus/icons-vue'
import { useTableColumnControl } from '/@/hooks/tableColumnControl' import { useTableColumnControl } from '/@/hooks/tableColumn'
import { defineAsyncComponent } from 'vue' import { defineAsyncComponent } from 'vue'
const StatusTag = defineAsyncComponent(() => import('/@/components/StatusTag/index.vue')) const StatusTag = defineAsyncComponent(() => import('/@/components/StatusTag/index.vue'))
// 定义变量内容 // ???
const route = useRoute() const route = useRoute()
const searchFormRef = ref() const searchFormRef = ref()
const columnControlRef = ref<any>() const columnControlRef = ref<any>()
@@ -307,22 +307,22 @@ const punlishLevelList = ref<any[]>([])
const publishStatusList = ref<any[]>([]) const publishStatusList = ref<any[]>([])
const formDialogRef = ref() const formDialogRef = ref()
// 表格列配<EFBFBD><EFBFBD>? // ???
const tableColumns = [ const tableColumns = [
{ prop: 'schoolYear', label: '学年' }, { prop: 'schoolYear', label: '??' },
{ prop: 'schoolTerm', label: '学期' }, { prop: 'schoolTerm', label: '??' },
{ prop: 'deptName', label: '学院' }, { prop: 'deptName', label: '??' },
{ prop: 'classNo', label: '班级' }, { prop: 'classNo', label: '??' },
{ prop: 'stuRealName', label: '姓名' }, { prop: 'stuRealName', label: '??' },
{ prop: 'stuNo', label: '学号' }, { prop: 'stuNo', label: '??' },
{ prop: 'punlishStartDate', label: '处分时间', width: 180 }, { prop: 'punlishStartDate', label: '??????', width: 180 },
{ prop: 'punlishEndDate', label: '到期<EFBFBD><EFBFBD>?, width: 180 }, { prop: 'punlishEndDate', label: '???', width: 180 },
{ prop: 'punlishLevel', label: '处分级别' }, { prop: 'punlishLevel', label: '????' },
{ prop: 'punlishContent', label: '处分内容', minWidth: 150 }, { prop: 'punlishContent', label: '????', minWidth: 150 },
{ prop: 'publishStatus', label: '处分状<EFBFBD><EFBFBD>? } { prop: 'publishStatus', label: '????' }
] ]
// 列配置映射用于图标<EFBFBD><EFBFBD>? // ?????
const columnConfigMap: Record<string, { icon: any }> = { const columnConfigMap: Record<string, { icon: any }> = {
schoolYear: { icon: Calendar }, schoolYear: { icon: Calendar },
schoolTerm: { icon: Clock }, schoolTerm: { icon: Clock },
@@ -337,7 +337,7 @@ const columnConfigMap: Record<string, { icon: any }> = {
publishStatus: { icon: CircleCheck } publishStatus: { icon: CircleCheck }
} }
// 使用表格列控制hook // ????? hook
const { const {
visibleColumns, visibleColumns,
visibleColumnsSorted, visibleColumnsSorted,
@@ -346,7 +346,7 @@ const {
handleColumnOrderChange handleColumnOrderChange
} = useTableColumnControl(tableColumns, route.path) } = useTableColumnControl(tableColumns, route.path)
// 搜索表单 // ????
const searchForm = reactive({ const searchForm = reactive({
schoolYear: '', schoolYear: '',
schoolTerm: '', schoolTerm: '',
@@ -359,11 +359,11 @@ const searchForm = reactive({
punlishMonthArray: [] as string[] punlishMonthArray: [] as string[]
}) })
// 配置 useTable // ?? useTable
const state: BasicTableProps = reactive<BasicTableProps>({ const state: BasicTableProps = reactive<BasicTableProps>({
queryForm: searchForm, queryForm: searchForm,
pageList: async (params: any) => { pageList: async (params: any) => {
// 处理处分月份参数API需要数组格<EFBFBD><EFBFBD>? // ???????? API
const queryParams = { ...params } const queryParams = { ...params }
if (queryParams.punlishMonth) { if (queryParams.punlishMonth) {
queryParams.punlishMonth = [queryParams.punlishMonth] queryParams.punlishMonth = [queryParams.punlishMonth]
@@ -388,7 +388,7 @@ const {
tableStyle tableStyle
} = useTable(state) } = useTable(state)
// 格式化学<EFBFBD><EFBFBD>? // ?????
const formatSchoolTerm = (value: string | number) => { const formatSchoolTerm = (value: string | number) => {
if (value === null || value === undefined || value === '') { if (value === null || value === undefined || value === '') {
return '-' return '-'
@@ -397,36 +397,36 @@ const formatSchoolTerm = (value: string | number) => {
return dictItem ? dictItem.label : value return dictItem ? dictItem.label : value
} }
// 格式化日<EFBFBD><EFBFBD>? // ?????
const formatDate = (dateStr: string) => { const formatDate = (dateStr: string) => {
if (!dateStr) return '-' if (!dateStr) return '-'
// 如果包含时间部分,只显示日期部分 // ??????????
if (dateStr.includes(' ')) { if (dateStr.includes(' ')) {
return dateStr.split(' ')[0] return dateStr.split(' ')[0]
} }
return dateStr return dateStr
} }
// 格式化处分级<EFBFBD><EFBFBD>? // ???????
const formatPunlishLevel = (value: string) => { const formatPunlishLevel = (value: string) => {
if (!value) return '-' if (!value) return '-'
const item = punlishLevelList.value.find((item: any) => item.value === value) const item = punlishLevelList.value.find((item: any) => item.value === value)
return item ? item.label : value return item ? item.label : value
} }
// 格式化处分状<EFBFBD><EFBFBD>? // ???????
const formatPublishStatus = (value: string) => { const formatPublishStatus = (value: string) => {
if (!value) return '-' if (!value) return '-'
const item = publishStatusList.value.find((item: any) => item.value === value) const item = publishStatusList.value.find((item: any) => item.value === value)
return item ? item.label : value return item ? item.label : value
} }
// 查询 // ??
const handleSearch = () => { const handleSearch = () => {
getDataList() getDataList()
} }
// 重置 // ??
const handleReset = () => { const handleReset = () => {
searchFormRef.value?.resetFields() searchFormRef.value?.resetFields()
searchForm.schoolYear = '' searchForm.schoolYear = ''
@@ -440,65 +440,65 @@ const handleReset = () => {
getDataList() getDataList()
} }
// 编辑 // ??
const handleEdit = (row: any) => { const handleEdit = (row: any) => {
formDialogRef.value?.openDialog('edit', row) formDialogRef.value?.openDialog('edit', row)
} }
// 删除 // ??
const handleDelete = async (row: any) => { const handleDelete = async (row: any) => {
try { try {
await useMessageBox().confirm('确定要删除这条记录吗<EFBFBD><EFBFBD>?) await useMessageBox().confirm('???????????')
await delObj([row.id]) await delObj([row.id])
useMessage().success('删除成功') useMessage().success('????')
getDataList() getDataList()
} catch (err: any) { } catch (err: any) {
if (err !== 'cancel') { if (err !== 'cancel') {
useMessage().error(err.msg || '删除失败') useMessage().error(err.msg || '????')
} }
} }
} }
// 思想汇报 // ????
const handleReport = (row: any) => { const handleReport = (row: any) => {
useMessage().info('思想汇报功能待实<EFBFBD><EFBFBD>?) useMessage().info('?????????')
// TODO: 实现思想汇报功能 // TODO: ??????
} }
// 撤销处分 // ????
const handleCancel = async (row: any) => { const handleCancel = async (row: any) => {
const { confirm } = useMessageBox() const { confirm } = useMessageBox()
try { try {
await confirm('确定要撤销该处分吗<EFBFBD><EFBFBD>?) await confirm('??????????')
// 获取完整的处分信<EFBFBD><EFBFBD>? // ??????
const res = await getDetail(row.id) const res = await getDetail(row.id)
if (!res.data) { if (!res.data) {
useMessage().error('获取处分信息失败') useMessage().error('????????')
return return
} }
// 更新publishStatus<EFBFBD><EFBFBD>?0"来撤销处分 // ? publishStatus ?? "0" ????
const updateData = { const updateData = {
...res.data, ...res.data,
publishStatus: '0' publishStatus: '0'
} }
await revokePunishment(updateData) await revokePunishment(updateData)
useMessage().success('撤销处分成功') useMessage().success('??????')
getDataList() getDataList()
} catch (err: any) { } catch (err: any) {
if (err !== 'cancel') { if (err !== 'cancel') {
useMessage().error(err.msg || '撤销处分失败') useMessage().error(err.msg || '??????')
} }
} }
} }
// 导出 // ??
const handleExport = async () => { const handleExport = async () => {
try { try {
const params: any = { ...searchForm } const params: any = { ...searchForm }
// 处理处分月份参数API需要数组格<EFBFBD><EFBFBD>? // ???????? API
if (params.punlishMonth) { if (params.punlishMonth) {
params.punlishMonth = [params.punlishMonth] params.punlishMonth = [params.punlishMonth]
} else { } else {
@@ -506,23 +506,23 @@ const handleExport = async () => {
} }
delete params.punlishMonthArray delete params.punlishMonthArray
const res = await exportData(params) const res = await exportData(params)
// 处理返回的文件流 // ????
const blob = new Blob([res.data]) const blob = new Blob([res.data])
const elink = document.createElement('a') const elink = document.createElement('a')
elink.download = '学生违纪.xlsx' elink.download = '????.xlsx'
elink.style.display = 'none' elink.style.display = 'none'
elink.href = URL.createObjectURL(blob) elink.href = URL.createObjectURL(blob)
document.body.appendChild(elink) document.body.appendChild(elink)
elink.click() elink.click()
URL.revokeObjectURL(elink.href) URL.revokeObjectURL(elink.href)
document.body.removeChild(elink) document.body.removeChild(elink)
useMessage().success('导出成功') useMessage().success('????')
} catch (err: any) { } catch (err: any) {
useMessage().error(err.msg || '导出失败') useMessage().error(err.msg || '????')
} }
} }
// 获取学年列表 // ??????
const getSchoolYearList = async () => { const getSchoolYearList = async () => {
try { try {
const res = await queryAllSchoolYear() const res = await queryAllSchoolYear()
@@ -534,7 +534,7 @@ const getSchoolYearList = async () => {
} }
} }
// 获取学期字典 // ??????
const getSchoolTermDict = async () => { const getSchoolTermDict = async () => {
try { try {
const res = await getDicts('school_term') const res = await getDicts('school_term')
@@ -549,7 +549,7 @@ const getSchoolTermDict = async () => {
} }
} }
// 获取学院列表 // ??????
const getDeptListData = async () => { const getDeptListData = async () => {
try { try {
const res = await getDeptListByLevelTwo() const res = await getDeptListByLevelTwo()
@@ -561,7 +561,7 @@ const getDeptListData = async () => {
} }
} }
// 获取班级列表 // ??????
const getClassListData = async () => { const getClassListData = async () => {
try { try {
const res = await getClassListByRole() const res = await getClassListByRole()
@@ -573,7 +573,7 @@ const getClassListData = async () => {
} }
} }
// 获取处分级别字典 // ????????
const getPunlishLevelDict = async () => { const getPunlishLevelDict = async () => {
try { try {
const res = await getDicts('punlish_level') const res = await getDicts('punlish_level')
@@ -588,7 +588,7 @@ const getPunlishLevelDict = async () => {
} }
} }
// 获取处分状态字<EFBFBD><EFBFBD>? // ????????
const getPublishStatusDict = async () => { const getPublishStatusDict = async () => {
try { try {
const res = await getDicts('publish_status') const res = await getDicts('publish_status')
@@ -603,7 +603,7 @@ const getPublishStatusDict = async () => {
} }
} }
// 初始<EFBFBD><EFBFBD>? // ???
onMounted(() => { onMounted(() => {
getSchoolYearList() getSchoolYearList()
getSchoolTermDict() getSchoolTermDict()
@@ -621,4 +621,3 @@ onMounted(() => {
<style scoped lang="scss"> <style scoped lang="scss">
@import '/@/assets/styles/modern-page.scss'; @import '/@/assets/styles/modern-page.scss';
</style> </style>

View File

@@ -7,7 +7,7 @@
<div class="card-header"> <div class="card-header">
<span class="card-title"> <span class="card-title">
<el-icon class="title-icon"><Search /></el-icon> <el-icon class="title-icon"><Search /></el-icon>
筛选条<EFBFBD><EFBFBD>? 筛选条
</span> </span>
</div> </div>
</template> </template>
@@ -45,7 +45,7 @@
<el-form-item label="学号" prop="stuNo"> <el-form-item label="学号" prop="stuNo">
<el-input <el-input
v-model="searchForm.stuNo" v-model="searchForm.stuNo"
placeholder="请输入学<EFBFBD><EFBFBD>? placeholder="请输入学号"
clearable clearable
style="width: 200px" /> style="width: 200px" />
</el-form-item> </el-form-item>
@@ -85,7 +85,7 @@
@order-change="handleColumnOrderChange" @order-change="handleColumnOrderChange"
> >
<template #trigger> <template #trigger>
<el-tooltip class="item" effect="dark" content="列设<EFBFBD><EFBFBD>? placement="top"> <el-tooltip class="item" effect="dark" content="列设置" placement="top">
<el-button circle style="margin-left: 0;"> <el-button circle style="margin-left: 0;">
<el-icon><Menu /></el-icon> <el-icon><Menu /></el-icon>
</el-button> </el-button>
@@ -183,7 +183,7 @@ import { useMessage, useMessageBox } from "/@/hooks/message";
import TableColumnControl from '/@/components/TableColumnControl/index.vue' import TableColumnControl from '/@/components/TableColumnControl/index.vue'
import FormDialog from './form.vue' import FormDialog from './form.vue'
import { List, Calendar, Clock, OfficeBuilding, Grid, CreditCard, Avatar, Document, UserFilled, Phone, EditPen, Setting, Menu, Search } from '@element-plus/icons-vue' import { List, Calendar, Clock, OfficeBuilding, Grid, CreditCard, Avatar, Document, UserFilled, Phone, EditPen, Setting, Menu, Search } from '@element-plus/icons-vue'
import { useTableColumnControl } from '/@/hooks/tableColumnControl' import { useTableColumnControl } from '/@/hooks/tableColumn'
// 定义变量内容 // 定义变量内容
@@ -196,7 +196,7 @@ const classList = ref<any[]>([])
const schoolTermList = ref<any[]>([]) const schoolTermList = ref<any[]>([])
const formDialogRef = ref() const formDialogRef = ref()
// 表格列配<EFBFBD><EFBFBD>? // 表格列配
const tableColumns = [ const tableColumns = [
{ prop: 'schoolYear', label: '学年', icon: Calendar }, { prop: 'schoolYear', label: '学年', icon: Calendar },
{ prop: 'schoolTerm', label: '学期', icon: Clock }, { prop: 'schoolTerm', label: '学期', icon: Clock },
@@ -204,10 +204,10 @@ const tableColumns = [
{ prop: 'classCode', label: '班级代码', icon: Grid }, { prop: 'classCode', label: '班级代码', icon: Grid },
{ prop: 'stuNo', label: '学号', icon: CreditCard }, { prop: 'stuNo', label: '学号', icon: CreditCard },
{ prop: 'realName', label: '姓名', icon: Avatar }, { prop: 'realName', label: '姓名', icon: Avatar },
{ prop: 'startTime', label: '请假开始时<EFBFBD><EFBFBD>?, icon: Calendar, width: 180 }, { prop: 'startTime', label: '请假开始时间', icon: Calendar, width: 180 },
{ prop: 'endTime', label: '请假结束时间', icon: Calendar, width: 180 }, { prop: 'endTime', label: '请假结束时间', icon: Calendar, width: 180 },
{ prop: 'reason', label: '请假事由', icon: Document, minWidth: 150 }, { prop: 'reason', label: '请假事由', icon: Document, minWidth: 150 },
{ prop: 'classTeach', label: '班主<EFBFBD><EFBFBD>?, icon: UserFilled }, { prop: 'classTeach', label: '班主任', icon: UserFilled },
{ prop: 'stuPhote', label: '联系方式', icon: Phone }, { prop: 'stuPhote', label: '联系方式', icon: Phone },
{ prop: 'remarks', label: '备注', icon: EditPen, minWidth: 150 } { prop: 'remarks', label: '备注', icon: EditPen, minWidth: 150 }
] ]
@@ -247,7 +247,7 @@ const {
tableStyle tableStyle
} = useTable(state) } = useTable(state)
// 格式化学<EFBFBD><EFBFBD>? // 格式化学
const formatSchoolTerm = (value: string | number) => { const formatSchoolTerm = (value: string | number) => {
if (value === null || value === undefined || value === '') { if (value === null || value === undefined || value === '') {
return '-' return '-'
@@ -256,10 +256,10 @@ const formatSchoolTerm = (value: string | number) => {
return dictItem ? dictItem.label : value return dictItem ? dictItem.label : value
} }
// 格式化日期时<EFBFBD><EFBFBD>? // 格式化日期时
const formatDateTime = (dateTime: string) => { const formatDateTime = (dateTime: string) => {
if (!dateTime) return '-' if (!dateTime) return '-'
// 如果包含时间部分,只显示日期和时<EFBFBD><EFBFBD>? // 如果包含时间部分,只显示日期和时
if (dateTime.includes(' ')) { if (dateTime.includes(' ')) {
return dateTime.split('.')[0] // 移除毫秒部分 return dateTime.split('.')[0] // 移除毫秒部分
} }
@@ -331,7 +331,7 @@ const getSchoolTermDict = async () => {
} }
} }
// 初始<EFBFBD><EFBFBD>? // 初始
onMounted(() => { onMounted(() => {
getDeptListData() getDeptListData()
getClassListData() getClassListData()

View File

@@ -7,7 +7,7 @@
<div class="card-header"> <div class="card-header">
<span class="card-title"> <span class="card-title">
<el-icon class="title-icon"><Search /></el-icon> <el-icon class="title-icon"><Search /></el-icon>
筛选条<EFBFBD><EFBFBD>? 筛选条
</span> </span>
</div> </div>
</template> </template>
@@ -56,10 +56,10 @@
</el-option> </el-option>
</el-select> </el-select>
</el-form-item> </el-form-item>
<el-form-item label="原班<EFBFBD><EFBFBD>? prop="oldClassCode"> <el-form-item label="原班级" prop="oldClassCode">
<el-select <el-select
v-model="searchForm.oldClassCode" v-model="searchForm.oldClassCode"
placeholder="请选择原班<EFBFBD><EFBFBD>? placeholder="请选择原班级"
clearable clearable
filterable filterable
style="width: 200px"> style="width: 200px">
@@ -74,14 +74,14 @@
<el-form-item label="学号" prop="stuNo"> <el-form-item label="学号" prop="stuNo">
<el-input <el-input
v-model="searchForm.stuNo" v-model="searchForm.stuNo"
placeholder="请输入学<EFBFBD><EFBFBD>? placeholder="请输入学号"
clearable clearable
style="width: 200px" /> style="width: 200px" />
</el-form-item> </el-form-item>
<el-form-item label="姓名" prop="realName"> <el-form-item label="姓名" prop="realName">
<el-input <el-input
v-model="searchForm.realName" v-model="searchForm.realName"
placeholder="请输入姓<EFBFBD><EFBFBD>? placeholder="请输入姓名"
clearable clearable
style="width: 200px" /> style="width: 200px" />
</el-form-item> </el-form-item>
@@ -126,7 +126,7 @@
type="success" type="success"
class="ml10" class="ml10"
@click="handleExport"> @click="handleExport">
<EFBFBD><EFBFBD>?<EFBFBD><EFBFBD>? 导出
</el-button> </el-button>
<right-toolbar <right-toolbar
v-model:showSearch="showSearch" v-model:showSearch="showSearch"
@@ -142,7 +142,7 @@
@order-change="handleColumnOrderChange" @order-change="handleColumnOrderChange"
> >
<template #trigger> <template #trigger>
<el-tooltip class="item" effect="dark" content="列设<EFBFBD><EFBFBD>? placement="top"> <el-tooltip class="item" effect="dark" content="列设置" placement="top">
<el-button circle style="margin-left: 0;"> <el-button circle style="margin-left: 0;">
<el-icon><Menu /></el-icon> <el-icon><Menu /></el-icon>
</el-button> </el-button>
@@ -183,23 +183,23 @@
<el-icon><component :is="columnConfigMap[col.prop]?.icon || Calendar" /></el-icon> <el-icon><component :is="columnConfigMap[col.prop]?.icon || Calendar" /></el-icon>
<span style="margin-left: 4px">{{ col.label }}</span> <span style="margin-left: 4px">{{ col.label }}</span>
</template> </template>
<!-- 学期列特殊模<EFBFBD><EFBFBD>?--> <!-- 学期列特殊模 -->
<template v-if="col.prop === 'schoolTerm'" #default="scope"> <template v-if="col.prop === 'schoolTerm'" #default="scope">
<el-tag size="small" type="primary" effect="plain"> <el-tag size="small" type="primary" effect="plain">
{{ formatSchoolTerm(scope.row.schoolTerm) }} {{ formatSchoolTerm(scope.row.schoolTerm) }}
</el-tag> </el-tag>
</template> </template>
<!-- 异动时间列特殊模<EFBFBD><EFBFBD>?--> <!-- 异动时间列特殊模 -->
<template v-else-if="col.prop === 'turnoverDate'" #default="scope"> <template v-else-if="col.prop === 'turnoverDate'" #default="scope">
<span>{{ scope.row.turnoverDate ? formatDate(scope.row.turnoverDate) : '-' }}</span> <span>{{ scope.row.turnoverDate ? formatDate(scope.row.turnoverDate) : '-' }}</span>
</template> </template>
<!-- 异动类型列特殊模<EFBFBD><EFBFBD>?--> <!-- 异动类型列特殊模 -->
<template v-else-if="col.prop === 'turnoverType'" #default="scope"> <template v-else-if="col.prop === 'turnoverType'" #default="scope">
<el-tag size="small" type="warning" effect="plain"> <el-tag size="small" type="warning" effect="plain">
{{ formatTurnoverType(scope.row.turnoverType) }} {{ formatTurnoverType(scope.row.turnoverType) }}
</el-tag> </el-tag>
</template> </template>
<!-- 转制类型列特殊模<EFBFBD><EFBFBD>?--> <!-- 转制类型列特殊模 -->
<template v-else-if="col.prop === 'turnYear'" #default="scope"> <template v-else-if="col.prop === 'turnYear'" #default="scope">
<el-tag size="small" type="info" effect="plain"> <el-tag size="small" type="info" effect="plain">
{{ formatTurnYear(scope.row.turnYear) }} {{ formatTurnYear(scope.row.turnYear) }}
@@ -259,7 +259,7 @@ import { useMessage, useMessageBox } from "/@/hooks/message";
import TableColumnControl from '/@/components/TableColumnControl/index.vue' import TableColumnControl from '/@/components/TableColumnControl/index.vue'
import FormDialog from './form.vue' import FormDialog from './form.vue'
import { List, Calendar, Clock, OfficeBuilding, Grid, CreditCard, Avatar, Collection, Document, Setting, Menu, Search } from '@element-plus/icons-vue' import { List, Calendar, Clock, OfficeBuilding, Grid, CreditCard, Avatar, Collection, Document, Setting, Menu, Search } from '@element-plus/icons-vue'
import { useTableColumnControl } from '/@/hooks/tableColumnControl' import { useTableColumnControl } from '/@/hooks/tableColumn'
// 定义变量内容 // 定义变量内容
@@ -275,13 +275,13 @@ const turnoverTypeList = ref<any[]>([])
const turnYearList = ref<any[]>([]) const turnYearList = ref<any[]>([])
const formDialogRef = ref() const formDialogRef = ref()
// 表格列配<EFBFBD><EFBFBD>? // 表格列配
const tableColumns = [ const tableColumns = [
{ prop: 'schoolYear', label: '学年' }, { prop: 'schoolYear', label: '学年' },
{ prop: 'schoolTerm', label: '学期' }, { prop: 'schoolTerm', label: '学期' },
{ prop: 'deptName', label: '学院' }, { prop: 'deptName', label: '学院' },
{ prop: 'oldClassNo', label: '原班<EFBFBD><EFBFBD>? }, { prop: 'oldClassNo', label: '原班级' },
{ prop: 'newClassNo', label: '现班<EFBFBD><EFBFBD>? }, { prop: 'newClassNo', label: '现班号' },
{ prop: 'stuNo', label: '学号' }, { prop: 'stuNo', label: '学号' },
{ prop: 'realName', label: '姓名' }, { prop: 'realName', label: '姓名' },
{ prop: 'turnoverDate', label: '异动时间', width: 180 }, { prop: 'turnoverDate', label: '异动时间', width: 180 },
@@ -290,7 +290,7 @@ const tableColumns = [
{ prop: 'remarks', label: '异动原因', minWidth: 150 } { prop: 'remarks', label: '异动原因', minWidth: 150 }
] ]
// 列配置映射(用于图标<EFBFBD><EFBFBD>? // 列配置映射(用于图标显示)
const columnConfigMap: Record<string, { icon: any }> = { const columnConfigMap: Record<string, { icon: any }> = {
schoolYear: { icon: Calendar }, schoolYear: { icon: Calendar },
schoolTerm: { icon: Clock }, schoolTerm: { icon: Clock },
@@ -344,7 +344,7 @@ const {
tableStyle tableStyle
} = useTable(state) } = useTable(state)
// 格式化学<EFBFBD><EFBFBD>? // 格式化学
const formatSchoolTerm = (value: string | number) => { const formatSchoolTerm = (value: string | number) => {
if (value === null || value === undefined || value === '') { if (value === null || value === undefined || value === '') {
return '-' return '-'
@@ -353,7 +353,7 @@ const formatSchoolTerm = (value: string | number) => {
return dictItem ? dictItem.label : value return dictItem ? dictItem.label : value
} }
// 格式化日<EFBFBD><EFBFBD>? // 格式化日
const formatDate = (dateStr: string) => { const formatDate = (dateStr: string) => {
if (!dateStr) return '-' if (!dateStr) return '-'
// 如果包含时间部分,只显示日期部分 // 如果包含时间部分,只显示日期部分
@@ -363,14 +363,14 @@ const formatDate = (dateStr: string) => {
return dateStr return dateStr
} }
// 格式化异动类<EFBFBD><EFBFBD>? // 格式化异动类
const formatTurnoverType = (value: string) => { const formatTurnoverType = (value: string) => {
if (!value) return '-' if (!value) return '-'
const item = turnoverTypeList.value.find((item: any) => item.value === value) const item = turnoverTypeList.value.find((item: any) => item.value === value)
return item ? item.label : value return item ? item.label : value
} }
// 格式化转制类<EFBFBD><EFBFBD>? // 格式化转制类
const formatTurnYear = (value: string) => { const formatTurnYear = (value: string) => {
if (!value) return '-' if (!value) return '-'
const item = turnYearList.value.find((item: any) => item.value === value) const item = turnYearList.value.find((item: any) => item.value === value)
@@ -403,7 +403,7 @@ const handleEdit = (row: any) => {
// 删除 // 删除
const handleDelete = async (row: any) => { const handleDelete = async (row: any) => {
try { try {
await useMessageBox().confirm('确定要删除这条记录吗<EFBFBD><EFBFBD>?) await useMessageBox().confirm('确定要删除这条记录吗')
await delObj([row.id]) await delObj([row.id])
useMessage().success('删除成功') useMessage().success('删除成功')
getDataList() getDataList()
@@ -515,7 +515,7 @@ const getTurnYearDict = async () => {
} }
} }
// 初始<EFBFBD><EFBFBD>? // 初始
onMounted(() => { onMounted(() => {
getSchoolYearList() getSchoolYearList()
getSchoolTermDict() getSchoolTermDict()

View File

@@ -1,13 +1,13 @@
<template> <template>
<div class="modern-page-container"> <div class="modern-page-container">
<div class="page-wrapper"> <div class="page-wrapper">
<!-- 搜索表单卡片 --> <!-- ?????? -->
<el-card v-show="showSearch" class="search-card" shadow="never"> <el-card v-show="showSearch" class="search-card" shadow="never">
<template #header> <template #header>
<div class="card-header"> <div class="card-header">
<span class="card-title"> <span class="card-title">
<el-icon class="title-icon"><Search /></el-icon> <el-icon class="title-icon"><Search /></el-icon>
筛选条<EFBFBD><EFBFBD>? ????
</span> </span>
</div> </div>
</template> </template>
@@ -15,7 +15,7 @@
<el-form-item label="班级" prop="classCode"> <el-form-item label="班级" prop="classCode">
<el-select <el-select
v-model="state.queryForm.classCode" v-model="state.queryForm.classCode"
placeholder="请选择班级" placeholder="请选择学年"
clearable clearable
filterable filterable
style="width: 200px"> style="width: 200px">
@@ -27,31 +27,31 @@
</el-option> </el-option>
</el-select> </el-select>
</el-form-item> </el-form-item>
<el-form-item label="班号" prop="classNo"> <el-form-item label="??" prop="classNo">
<el-input <el-input
v-model="state.queryForm.classNo" v-model="state.queryForm.classNo"
placeholder="请输入<EFBFBD><EFBFBD>? placeholder="请输入姓名"
clearable clearable
style="width: 200px" /> style="width: 200px" />
</el-form-item> </el-form-item>
<el-form-item label="姓名" prop="realName"> <el-form-item label="姓名" prop="realName">
<el-input <el-input
v-model="state.queryForm.realName" v-model="state.queryForm.realName"
placeholder="请输入姓<EFBFBD><EFBFBD>? placeholder="请输入姓名"
clearable clearable
style="width: 200px" /> style="width: 200px" />
</el-form-item> </el-form-item>
<el-form-item label="团员编号" prop="serNo"> <el-form-item label="????" prop="serNo">
<el-input <el-input
v-model="state.queryForm.serNo" v-model="state.queryForm.serNo"
placeholder="请输入团员编<EFBFBD><EFBFBD>? placeholder="请输入奖项名称"
clearable clearable
style="width: 200px" /> style="width: 200px" />
</el-form-item> </el-form-item>
<el-form-item label="入学年份" prop="grade"> <el-form-item label="入学年份" prop="grade">
<el-select <el-select
v-model="state.queryForm.grade" v-model="state.queryForm.grade"
placeholder="请选择入学年份" placeholder="请输入奖项名称"
clearable clearable
style="width: 200px"> style="width: 200px">
<el-option <el-option
@@ -63,40 +63,40 @@
</el-select> </el-select>
</el-form-item> </el-form-item>
<el-form-item> <el-form-item>
<el-button type="primary" plain icon="Search" @click="getDataList">查询</el-button> <el-button type="primary" plain icon="Search" @click="getDataList">??</el-button>
<el-button icon="Refresh" @click="handleReset">重置</el-button> <el-button icon="Refresh" @click="handleReset">重置</el-button>
</el-form-item> </el-form-item>
</el-form> </el-form>
</el-card> </el-card>
<!-- 内容卡片 --> <!-- ???? -->
<el-card class="content-card" shadow="never"> <el-card class="content-card" shadow="never">
<template #header> <template #header>
<div class="card-header"> <div class="card-header">
<span class="card-title"> <span class="card-title">
<el-icon class="title-icon"><Document /></el-icon> <el-icon class="title-icon"><Document /></el-icon>
学生团员列表 ??????
</span> </span>
<div class="header-actions"> <div class="header-actions">
<el-button <el-button
icon="Plus" icon="Plus"
type="primary" type="primary"
@click="formDialogRef.openDialog()"> @click="formDialogRef.openDialog()">
新增 ??
</el-button> </el-button>
<el-button <el-button
icon="Upload" icon="Upload"
type="success" type="success"
class="ml10" class="ml10"
@click="handleImport"> @click="handleImport">
导入 ??
</el-button> </el-button>
<el-button <el-button
icon="Download" icon="Download"
type="warning" type="warning"
class="ml10" class="ml10"
@click="handleExport"> @click="handleExport">
导出 ??
</el-button> </el-button>
<right-toolbar <right-toolbar
v-model:showSearch="showSearch" v-model:showSearch="showSearch"
@@ -112,7 +112,7 @@
@order-change="handleColumnOrderChange" @order-change="handleColumnOrderChange"
> >
<template #trigger> <template #trigger>
<el-tooltip class="item" effect="dark" content="列设<EFBFBD><EFBFBD>? placement="top"> <el-tooltip class="item" effect="dark" content="列设置" placement="top">
<el-button circle style="margin-left: 0;"> <el-button circle style="margin-left: 0;">
<el-icon><Menu /></el-icon> <el-icon><Menu /></el-icon>
</el-button> </el-button>
@@ -153,11 +153,11 @@
<el-icon><component :is="columnConfigMap[col.prop]?.icon || Calendar" /></el-icon> <el-icon><component :is="columnConfigMap[col.prop]?.icon || Calendar" /></el-icon>
<span style="margin-left: 4px">{{ col.label }}</span> <span style="margin-left: 4px">{{ col.label }}</span>
</template> </template>
<!-- 入团时间列特殊模<EFBFBD><EFBFBD>?--> <!-- ????????? -->
<template v-if="col.prop === 'enterTime'" #default="scope"> <template v-if="col.prop === 'enterTime'" #default="scope">
<span>{{ parseTime(scope.row.enterTime, '{y}-{m}-{d}') }}</span> <span>{{ parseTime(scope.row.enterTime, '{y}-{m}-{d}') }}</span>
</template> </template>
<!-- 团内职务列特殊模<EFBFBD><EFBFBD>?--> <!-- ????????? -->
<template v-else-if="col.prop === 'position'" #default="scope"> <template v-else-if="col.prop === 'position'" #default="scope">
<el-tag v-if="scope.row.position" size="small" type="primary" effect="plain"> <el-tag v-if="scope.row.position" size="small" type="primary" effect="plain">
{{ scope.row.position }} {{ scope.row.position }}
@@ -200,12 +200,12 @@
</el-card> </el-card>
</div> </div>
<!-- 新增/编辑表单弹窗 --> <!-- ??/?????? -->
<form-dialog ref="formDialogRef" @refresh="getDataList" /> <form-dialog ref="formDialogRef" @refresh="getDataList" />
<!-- 导入弹窗 --> <!-- ???? -->
<el-dialog <el-dialog
title="导入团员" title="????"
v-model="importDialogVisible" v-model="importDialogVisible"
:close-on-click-modal="false" :close-on-click-modal="false"
width="500px"> width="500px">
@@ -220,18 +220,18 @@
drag> drag>
<el-icon class="el-icon--upload"><upload-filled /></el-icon> <el-icon class="el-icon--upload"><upload-filled /></el-icon>
<div class="el-upload__text"> <div class="el-upload__text">
将文件拖到此处<EFBFBD><EFBFBD>?em>点击上传</em> ????????<em>????</em>
</div> </div>
<template #tip> <template #tip>
<div class="el-upload__tip"> <div class="el-upload__tip">
只能上传 xlsx/xls 文件 ???? xlsx/xls ??
</div> </div>
</template> </template>
</el-upload> </el-upload>
<template #footer> <template #footer>
<span class="dialog-footer"> <span class="dialog-footer">
<el-button @click="importDialogVisible = false"><EFBFBD><EFBFBD>?<EFBFBD><EFBFBD>?/el-button> <el-button @click="importDialogVisible = false">取消</el-button>
<el-button type="primary" @click="handleImportSubmit" :loading="importLoading"><EFBFBD><EFBFBD>?<EFBFBD><EFBFBD>?/el-button> <el-button type="primary" @click="handleImportSubmit" :loading="importLoading">??</el-button>
</span> </span>
</template> </template>
</el-dialog> </el-dialog>
@@ -249,12 +249,12 @@ import { useMessage, useMessageBox } from "/@/hooks/message";
import { parseTime } from "/@/utils/formatTime"; import { parseTime } from "/@/utils/formatTime";
import TableColumnControl from '/@/components/TableColumnControl/index.vue' import TableColumnControl from '/@/components/TableColumnControl/index.vue'
import { UploadFilled, List, OfficeBuilding, Grid, CreditCard, Avatar, Phone, Calendar, Postcard, Briefcase, Setting, Menu, Search, Document } from '@element-plus/icons-vue' import { UploadFilled, List, OfficeBuilding, Grid, CreditCard, Avatar, Phone, Calendar, Postcard, Briefcase, Setting, Menu, Search, Document } from '@element-plus/icons-vue'
import { useTableColumnControl } from '/@/hooks/tableColumnControl' import { useTableColumnControl } from '/@/hooks/tableColumn'
import type { UploadFile, UploadFiles } from 'element-plus'; import type { UploadFile, UploadFiles } from 'element-plus';
import FormDialog from './form.vue' import FormDialog from './form.vue'
// 定义变量内容 // ??????
const route = useRoute() const route = useRoute()
const formDialogRef = ref() const formDialogRef = ref()
const columnControlRef = ref<any>() const columnControlRef = ref<any>()
@@ -267,19 +267,19 @@ const importDialogVisible = ref(false)
const importLoading = ref(false) const importLoading = ref(false)
const fileList = ref<UploadFile[]>([]) const fileList = ref<UploadFile[]>([])
// 表格列配<EFBFBD><EFBFBD>? // ?????
const tableColumns = [ const tableColumns = [
{ prop: 'deptName', label: '学院', minWidth: 150 }, { prop: 'deptName', label: '????', minWidth: 150 },
{ prop: 'classNo', label: '班级', width: 120 }, { prop: 'classNo', label: '??', width: 120 },
{ prop: 'stuNo', label: '学号', width: 120 }, { prop: 'stuNo', label: '??', width: 120 },
{ prop: 'realName', label: '姓名', width: 100 }, { prop: 'realName', label: '??', width: 100 },
{ prop: 'phone', label: '联系电话', width: 120 }, { prop: 'phone', label: '???', width: 120 },
{ prop: 'enterTime', label: '入团时间', width: 120 }, { prop: 'enterTime', label: '????', width: 120 },
{ prop: 'serNo', label: '团员编号', width: 120 }, { prop: 'serNo', label: '????', width: 120 },
{ prop: 'position', label: '团内职务', width: 120 } { prop: 'position', label: '????', width: 120 }
] ]
// 列配置映射用于图标<EFBFBD><EFBFBD>? // ?????????????
const columnConfigMap: Record<string, { icon: any }> = { const columnConfigMap: Record<string, { icon: any }> = {
deptName: { icon: OfficeBuilding }, deptName: { icon: OfficeBuilding },
classNo: { icon: Grid }, classNo: { icon: Grid },
@@ -291,7 +291,7 @@ const columnConfigMap: Record<string, { icon: any }> = {
position: { icon: Briefcase } position: { icon: Briefcase }
} }
// 使用表格列控制hook // ???????hook
const { const {
visibleColumns, visibleColumns,
visibleColumnsSorted, visibleColumnsSorted,
@@ -300,13 +300,13 @@ const {
handleColumnOrderChange handleColumnOrderChange
} = useTableColumnControl(tableColumns, route.path) } = useTableColumnControl(tableColumns, route.path)
// 表格样式 // ????
const tableStyle = { const tableStyle = {
cellStyle: { padding: '8px 0' }, cellStyle: { padding: '8px 0' },
headerCellStyle: { background: '#f5f7fa', color: '#606266', fontWeight: 'bold' } headerCellStyle: { background: '#f5f7fa', color: '#606266', fontWeight: 'bold' }
} }
// 配置 useTable // ?? useTable
const state: BasicTableProps = reactive<BasicTableProps>({ const state: BasicTableProps = reactive<BasicTableProps>({
queryForm: { queryForm: {
classCode: '', classCode: '',
@@ -331,7 +331,7 @@ const {
tableStyle: _tableStyle tableStyle: _tableStyle
} = useTable(state) } = useTable(state)
// 重置 // ??
const handleReset = () => { const handleReset = () => {
searchFormRef.value?.resetFields() searchFormRef.value?.resetFields()
state.queryForm.classCode = '' state.queryForm.classCode = ''
@@ -342,70 +342,70 @@ const handleReset = () => {
getDataList() getDataList()
} }
// 编辑 // ??
const handleEdit = (row: any) => { const handleEdit = (row: any) => {
formDialogRef.value?.openDialog('edit', row) formDialogRef.value?.openDialog('edit', row)
} }
// 删除 // ??
const handleDelete = async (row: any) => { const handleDelete = async (row: any) => {
const { confirm } = useMessageBox() const { confirm } = useMessageBox()
try { try {
await confirm('确定要删除该团员吗?') await confirm('???????????')
await delObj([row.id]) await delObj([row.id])
useMessage().success('删除成功') useMessage().success('????')
getDataList() getDataList()
} catch (err: any) { } catch (err: any) {
if (err !== 'cancel') { if (err !== 'cancel') {
useMessage().error(err.msg || '删除失败') useMessage().error(err.msg || '????')
} }
} }
} }
// 导入 // ??
const handleImport = () => { const handleImport = () => {
importDialogVisible.value = true importDialogVisible.value = true
fileList.value = [] fileList.value = []
} }
// 文件变化 // ????
const handleFileChange = (file: UploadFile, files: UploadFiles) => { const handleFileChange = (file: UploadFile, files: UploadFiles) => {
fileList.value = [file] fileList.value = [file]
} }
// 文件超出限制 // ??????
const handleExceed = () => { const handleExceed = () => {
useMessage().warning('只能上传一个文<EFBFBD><EFBFBD>?) useMessage().warning('????????')
} }
// 提交导入 // ????
const handleImportSubmit = async () => { const handleImportSubmit = async () => {
if (fileList.value.length === 0) { if (fileList.value.length === 0) {
useMessage().warning('请选择要上传的文件') useMessage().warning('?????????')
return return
} }
const file = fileList.value[0].raw const file = fileList.value[0].raw
if (!file) { if (!file) {
useMessage().warning('文件不存<EFBFBD><EFBFBD>?) useMessage().warning('?????')
return return
} }
importLoading.value = true importLoading.value = true
try { try {
await importExcel(file as File) await importExcel(file as File)
useMessage().success('导入成功') useMessage().success('????')
importDialogVisible.value = false importDialogVisible.value = false
fileList.value = [] fileList.value = []
getDataList() getDataList()
} catch (err: any) { } catch (err: any) {
useMessage().error(err.msg || '导入失败') useMessage().error(err.msg || '????')
} finally { } finally {
importLoading.value = false importLoading.value = false
} }
} }
// 导出 // ??
const handleExport = async () => { const handleExport = async () => {
try { try {
const res = await exportExcel(state.queryForm) const res = await exportExcel(state.queryForm)
@@ -413,18 +413,18 @@ const handleExport = async () => {
const url = window.URL.createObjectURL(blob) const url = window.URL.createObjectURL(blob)
const link = document.createElement('a') const link = document.createElement('a')
link.href = url link.href = url
link.download = `团员列表_${parseTime(new Date(), '{y}{m}{d}{h}{i}{s}')}.xlsx` link.download = `??_${parseTime(new Date(), '{y}{m}{d}{h}{i}{s}')}.xlsx`
document.body.appendChild(link) document.body.appendChild(link)
link.click() link.click()
document.body.removeChild(link) document.body.removeChild(link)
window.URL.revokeObjectURL(url) window.URL.revokeObjectURL(url)
useMessage().success('导出成功') useMessage().success('????')
} catch (err: any) { } catch (err: any) {
useMessage().error(err.msg || '导出失败') useMessage().error(err.msg || '????')
} }
} }
// 获取班级列表 // ??????
const getClassListData = async () => { const getClassListData = async () => {
try { try {
const res = await getClassListByRole() const res = await getClassListByRole()
@@ -438,7 +438,7 @@ const getClassListData = async () => {
} }
} }
// 获取入学年份列表 // ????????
const getGradeListData = async () => { const getGradeListData = async () => {
try { try {
const res = await getGradeList() const res = await getGradeList()
@@ -452,7 +452,7 @@ const getGradeListData = async () => {
} }
} }
// 初始<EFBFBD><EFBFBD>? // ???
onMounted(() => { onMounted(() => {
getClassListData() getClassListData()
getGradeListData() getGradeListData()
@@ -466,4 +466,3 @@ onMounted(() => {
<style scoped lang="scss"> <style scoped lang="scss">
@import '/@/assets/styles/modern-page.scss'; @import '/@/assets/styles/modern-page.scss';
</style> </style>

View File

@@ -7,7 +7,7 @@
<div class="card-header"> <div class="card-header">
<span class="card-title"> <span class="card-title">
<el-icon class="title-icon"><Search /></el-icon> <el-icon class="title-icon"><Search /></el-icon>
筛选条<EFBFBD><EFBFBD>? 筛选条
</span> </span>
</div> </div>
</template> </template>
@@ -59,21 +59,21 @@
<el-form-item label="班号" prop="classNo"> <el-form-item label="班号" prop="classNo">
<el-input <el-input
v-model="searchForm.classNo" v-model="searchForm.classNo"
placeholder="请输入班<EFBFBD><EFBFBD>? placeholder="请输入班号"
clearable clearable
style="width: 200px" /> style="width: 200px" />
</el-form-item> </el-form-item>
<el-form-item label="学号" prop="stuNo"> <el-form-item label="学号" prop="stuNo">
<el-input <el-input
v-model="searchForm.stuNo" v-model="searchForm.stuNo"
placeholder="请输入学<EFBFBD><EFBFBD>? placeholder="请输入学号"
clearable clearable
style="width: 200px" /> style="width: 200px" />
</el-form-item> </el-form-item>
<el-form-item label="姓名" prop="realName"> <el-form-item label="姓名" prop="realName">
<el-input <el-input
v-model="searchForm.realName" v-model="searchForm.realName"
placeholder="请输入姓<EFBFBD><EFBFBD>? placeholder="请输入姓名"
clearable clearable
style="width: 200px" /> style="width: 200px" />
</el-form-item> </el-form-item>
@@ -81,8 +81,8 @@
<el-date-picker <el-date-picker
v-model="searchForm.dateRange" v-model="searchForm.dateRange"
type="daterange" type="daterange"
range-separator="<EFBFBD><EFBFBD>? range-separator=""
start-placeholder="开始日<EFBFBD><EFBFBD>? start-placeholder="开始日"
end-placeholder="结束日期" end-placeholder="结束日期"
format="YYYY-MM-DD" format="YYYY-MM-DD"
value-format="YYYY-MM-DD" value-format="YYYY-MM-DD"
@@ -109,7 +109,7 @@
icon="FolderAdd" icon="FolderAdd"
type="primary" type="primary"
@click="formDialogRef.openDialog()"> @click="formDialogRef.openDialog()">
<EFBFBD><EFBFBD>?<EFBFBD><EFBFBD>? 新增
</el-button> </el-button>
<el-button <el-button
icon="User" icon="User"
@@ -132,7 +132,7 @@
@order-change="handleColumnOrderChange" @order-change="handleColumnOrderChange"
> >
<template #trigger> <template #trigger>
<el-tooltip class="item" effect="dark" content="列设<EFBFBD><EFBFBD>? placement="top"> <el-tooltip class="item" effect="dark" content="列设置" placement="top">
<el-button circle style="margin-left: 0;"> <el-button circle style="margin-left: 0;">
<el-icon><Menu /></el-icon> <el-icon><Menu /></el-icon>
</el-button> </el-button>
@@ -173,7 +173,7 @@
<el-icon><component :is="columnConfigMap[col.prop]?.icon || Calendar" /></el-icon> <el-icon><component :is="columnConfigMap[col.prop]?.icon || Calendar" /></el-icon>
<span style="margin-left: 4px">{{ col.label }}</span> <span style="margin-left: 4px">{{ col.label }}</span>
</template> </template>
<!-- 学期列特殊模<EFBFBD><EFBFBD>?--> <!-- 学期列特殊模 -->
<template v-if="col.prop === 'schoolTerm'" #default="scope"> <template v-if="col.prop === 'schoolTerm'" #default="scope">
<el-tag size="small" type="primary" effect="plain"> <el-tag size="small" type="primary" effect="plain">
{{ formatSchoolTerm(scope.row.schoolTerm) }} {{ formatSchoolTerm(scope.row.schoolTerm) }}
@@ -183,11 +183,11 @@
<template v-else-if="col.prop === 'startTime'" #default="scope"> <template v-else-if="col.prop === 'startTime'" #default="scope">
<span>{{ scope.row.startTime ? scope.row.startTime.split(' ')[0] : '-' }}</span> <span>{{ scope.row.startTime ? scope.row.startTime.split(' ')[0] : '-' }}</span>
</template> </template>
<!-- 工学交替结束时间列特殊模<EFBFBD><EFBFBD>?--> <!-- 工学交替结束时间列特殊模 -->
<template v-else-if="col.prop === 'endTime'" #default="scope"> <template v-else-if="col.prop === 'endTime'" #default="scope">
<span>{{ scope.row.endTime ? scope.row.endTime.split(' ')[0] : '-' }}</span> <span>{{ scope.row.endTime ? scope.row.endTime.split(' ')[0] : '-' }}</span>
</template> </template>
<!-- 带班教师列特殊模<EFBFBD><EFBFBD>?--> <!-- 带班教师列特殊模 -->
<template v-else-if="col.prop === 'attendanceTeacherName'" #default="scope"> <template v-else-if="col.prop === 'attendanceTeacherName'" #default="scope">
<span>{{ scope.row.attendanceTeacherName || '-' }}</span> <span>{{ scope.row.attendanceTeacherName || '-' }}</span>
</template> </template>
@@ -241,7 +241,7 @@ import TableColumnControl from '/@/components/TableColumnControl/index.vue'
import FormDialog from './form.vue' import FormDialog from './form.vue'
import TeacherDialog from './teacher.vue' import TeacherDialog from './teacher.vue'
import { List, Calendar, Clock, OfficeBuilding, CreditCard, Avatar, Grid, UserFilled, Setting, Menu, Search, Document } from '@element-plus/icons-vue' import { List, Calendar, Clock, OfficeBuilding, CreditCard, Avatar, Grid, UserFilled, Setting, Menu, Search, Document } from '@element-plus/icons-vue'
import { useTableColumnControl } from '/@/hooks/tableColumnControl' import { useTableColumnControl } from '/@/hooks/tableColumn'
// 定义变量内容 // 定义变量内容
@@ -255,7 +255,7 @@ const schoolTermList = ref<any[]>([])
const formDialogRef = ref() const formDialogRef = ref()
const teacherDialogRef = ref() const teacherDialogRef = ref()
// 表格列配<EFBFBD><EFBFBD>? // 表格列配
const tableColumns = [ const tableColumns = [
{ prop: 'schoolYear', label: '学年' }, { prop: 'schoolYear', label: '学年' },
{ prop: 'schoolTerm', label: '学期' }, { prop: 'schoolTerm', label: '学期' },
@@ -263,13 +263,13 @@ const tableColumns = [
{ prop: 'stuNo', label: '学号' }, { prop: 'stuNo', label: '学号' },
{ prop: 'realName', label: '姓名' }, { prop: 'realName', label: '姓名' },
{ prop: 'classNo', label: '班号' }, { prop: 'classNo', label: '班号' },
{ prop: 'className', label: '班级简<EFBFBD><EFBFBD>? }, { prop: 'className', label: '班级简称' },
{ prop: 'startTime', label: '工学交替开始时<EFBFBD><EFBFBD>?, width: 180 }, { prop: 'startTime', label: '工学交替开始时间', width: 180 },
{ prop: 'endTime', label: '工学交替结束时间', width: 180 }, { prop: 'endTime', label: '工学交替结束时间', width: 180 },
{ prop: 'attendanceTeacherName', label: '带班教师' } { prop: 'attendanceTeacherName', label: '带班教师' }
] ]
// 列配置映射(用于图标<EFBFBD><EFBFBD>? // 列配置映射(用于图标显示)
const columnConfigMap: Record<string, { icon: any }> = { const columnConfigMap: Record<string, { icon: any }> = {
schoolYear: { icon: Calendar }, schoolYear: { icon: Calendar },
schoolTerm: { icon: Clock }, schoolTerm: { icon: Clock },
@@ -357,7 +357,7 @@ const handleReset = () => {
// 删除 // 删除
const handleDelete = async (row: any) => { const handleDelete = async (row: any) => {
try { try {
await useMessageBox().confirm('确定要删除这条记录吗<EFBFBD><EFBFBD>?) await useMessageBox().confirm('确定要删除这条记录吗')
await delObj([row.id]) await delObj([row.id])
useMessage().success('删除成功') useMessage().success('删除成功')
getDataList() getDataList()
@@ -404,7 +404,7 @@ const getSchoolTermList = async () => {
} }
} }
// 初始<EFBFBD><EFBFBD>? // 初始
onMounted(() => { onMounted(() => {
getDeptListData() getDeptListData()
getSchoolYearList() getSchoolYearList()

View File

@@ -7,7 +7,7 @@
<div class="card-header"> <div class="card-header">
<span class="card-title"> <span class="card-title">
<el-icon class="title-icon"><Document /></el-icon> <el-icon class="title-icon"><Document /></el-icon>
教学楼管理列<EFBFBD><EFBFBD>? 教学楼管理列
</span> </span>
<div class="header-actions"> <div class="header-actions">
<el-button <el-button
@@ -29,7 +29,7 @@
@order-change="handleColumnOrderChange" @order-change="handleColumnOrderChange"
> >
<template #trigger> <template #trigger>
<el-tooltip class="item" effect="dark" content="列设<EFBFBD><EFBFBD>? placement="top"> <el-tooltip class="item" effect="dark" content="列设置" placement="top">
<el-button circle style="margin-left: 0;"> <el-button circle style="margin-left: 0;">
<el-icon><Menu /></el-icon> <el-icon><Menu /></el-icon>
</el-button> </el-button>
@@ -120,7 +120,7 @@ import { useMessage, useMessageBox } from "/@/hooks/message";
import TableColumnControl from '/@/components/TableColumnControl/index.vue' import TableColumnControl from '/@/components/TableColumnControl/index.vue'
import FormDialog from './form.vue' import FormDialog from './form.vue'
import { List, OfficeBuilding, EditPen, Setting, Menu, Calendar, Document } from '@element-plus/icons-vue' import { List, OfficeBuilding, EditPen, Setting, Menu, Calendar, Document } from '@element-plus/icons-vue'
import { useTableColumnControl } from '/@/hooks/tableColumnControl' import { useTableColumnControl } from '/@/hooks/tableColumn'
// 定义变量内容 // 定义变量内容
@@ -128,13 +128,13 @@ const route = useRoute()
const formDialogRef = ref() const formDialogRef = ref()
const columnControlRef = ref<any>() const columnControlRef = ref<any>()
// 表格列配<EFBFBD><EFBFBD>? // 表格列配
const tableColumns = [ const tableColumns = [
{ prop: 'buildingNo', label: '楼号' }, { prop: 'buildingNo', label: '楼号' },
{ prop: 'remarks', label: '备注', minWidth: 200 } { prop: 'remarks', label: '备注', minWidth: 200 }
] ]
// 列配置映射(用于图标<EFBFBD><EFBFBD>? // 列配置映射(用于图标显示
const columnConfigMap: Record<string, { icon: any }> = { const columnConfigMap: Record<string, { icon: any }> = {
buildingNo: { icon: OfficeBuilding }, buildingNo: { icon: OfficeBuilding },
remarks: { icon: EditPen } remarks: { icon: EditPen }
@@ -177,7 +177,7 @@ const handleEdit = (row: any) => {
const handleDelete = async (row: any) => { const handleDelete = async (row: any) => {
const { confirm } = useMessageBox() const { confirm } = useMessageBox()
try { try {
await confirm('确定要删除该教学楼吗<EFBFBD><EFBFBD>?) await confirm('确定要删除该教学楼吗')
await delObj([row.id]) await delObj([row.id])
useMessage().success('删除成功') useMessage().success('删除成功')
getDataList() getDataList()
@@ -188,7 +188,7 @@ const handleDelete = async (row: any) => {
} }
} }
// 初始<EFBFBD><EFBFBD>? // 初始
onMounted(() => { onMounted(() => {
nextTick(() => { nextTick(() => {
if (visibleColumns.value.length === 0) { if (visibleColumns.value.length === 0) {

View File

@@ -7,7 +7,7 @@
<div class="card-header"> <div class="card-header">
<span class="card-title"> <span class="card-title">
<el-icon class="title-icon"><Search /></el-icon> <el-icon class="title-icon"><Search /></el-icon>
筛选条<EFBFBD><EFBFBD>? 筛选条
</span> </span>
</div> </div>
</template> </template>
@@ -86,7 +86,7 @@
@order-change="handleColumnOrderChange" @order-change="handleColumnOrderChange"
> >
<template #trigger> <template #trigger>
<el-tooltip class="item" effect="dark" content="列设<EFBFBD><EFBFBD>? placement="top"> <el-tooltip class="item" effect="dark" content="列设置" placement="top">
<el-button circle style="margin-left: 0;"> <el-button circle style="margin-left: 0;">
<el-icon><Menu /></el-icon> <el-icon><Menu /></el-icon>
</el-button> </el-button>
@@ -186,7 +186,7 @@ import TableColumnControl from '/@/components/TableColumnControl/index.vue'
import FormDialog from './form.vue' import FormDialog from './form.vue'
import BatchDialog from './batch.vue' import BatchDialog from './batch.vue'
import { List, OfficeBuilding, Location, Setting, Menu, Calendar, Search, Document } from '@element-plus/icons-vue' import { List, OfficeBuilding, Location, Setting, Menu, Calendar, Search, Document } from '@element-plus/icons-vue'
import { useTableColumnControl } from '/@/hooks/tableColumnControl' import { useTableColumnControl } from '/@/hooks/tableColumn'
// 定义变量内容 // 定义变量内容
@@ -200,14 +200,14 @@ const formDialogRef = ref()
const batchDialogRef = ref() const batchDialogRef = ref()
const selectedRows = ref<any[]>([]) const selectedRows = ref<any[]>([])
// 表格列配<EFBFBD><EFBFBD>? // 表格列配
const tableColumns = [ const tableColumns = [
{ prop: 'deptName', label: '学院' }, { prop: 'deptName', label: '学院' },
{ prop: 'buildingNo', label: '楼号' }, { prop: 'buildingNo', label: '楼号' },
{ prop: 'position', label: '教室位置' } { prop: 'position', label: '教室位置' }
] ]
// 列配置映射(用于图标<EFBFBD><EFBFBD>? // 列配置映射(用于图标显示
const columnConfigMap: Record<string, { icon: any }> = { const columnConfigMap: Record<string, { icon: any }> = {
deptName: { icon: OfficeBuilding }, deptName: { icon: OfficeBuilding },
buildingNo: { icon: OfficeBuilding }, buildingNo: { icon: OfficeBuilding },
@@ -317,7 +317,7 @@ const getBuildingListData = async () => {
} }
} }
// 初始<EFBFBD><EFBFBD>? // 初始
onMounted(() => { onMounted(() => {
getDeptListData() getDeptListData()
getBuildingListData() getBuildingListData()

View File

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

View File

@@ -1,40 +1,40 @@
<template> <template>
<div class="modern-page-container"> <div class="modern-page-container">
<div class="page-wrapper"> <div class="page-wrapper">
<!-- 搜索表单卡片 --> <!-- ?????? -->
<el-card v-show="showSearch" class="search-card" shadow="never"> <el-card v-show="showSearch" class="search-card" shadow="never">
<template #header> <template #header>
<div class="card-header"> <div class="card-header">
<span class="card-title"> <span class="card-title">
<el-icon class="title-icon"><Search /></el-icon> <el-icon class="title-icon"><Search /></el-icon>
筛选条<EFBFBD><EFBFBD>? ?????
</span> </span>
</div> </div>
</template> </template>
<el-form :model="searchForm" ref="searchFormRef" :inline="true" @keyup.enter="handleSearch" class="search-form"> <el-form :model="searchForm" ref="searchFormRef" :inline="true" @keyup.enter="handleSearch" class="search-form">
<el-form-item label="可用余额" prop="effectiveMoney"> <el-form-item label="????" prop="effectiveMoney">
<el-input-number <el-input-number
v-model="searchForm.effectiveMoney" v-model="searchForm.effectiveMoney"
placeholder="可用余额大于" placeholder="???????"
:precision="2" :precision="2"
:min="0" :min="0"
clearable clearable
style="width: 200px" /> style="width: 200px" />
</el-form-item> </el-form-item>
<el-form-item label="已住人数" prop="isLiveNum"> <el-form-item label="????" prop="isLiveNum">
<el-select <el-select
v-model="searchForm.isLiveNum" v-model="searchForm.isLiveNum"
placeholder="请选择" placeholder="?????"
clearable clearable
style="width: 200px"> style="width: 200px">
<el-option label="大于0" :value="true" /> <el-option label="??0" :value="true" />
<el-option label="等于0" :value="false" /> <el-option label="??0" :value="false" />
</el-select> </el-select>
</el-form-item> </el-form-item>
<el-form-item label="楼号" prop="buildNo"> <el-form-item label="??" prop="buildNo">
<el-select <el-select
v-model="searchForm.buildNo" v-model="searchForm.buildNo"
placeholder="请选择楼号" placeholder="?????"
clearable clearable
filterable filterable
style="width: 200px"> style="width: 200px">
@@ -46,48 +46,48 @@
</el-option> </el-option>
</el-select> </el-select>
</el-form-item> </el-form-item>
<el-form-item label="宿舍<EFBFBD><EFBFBD>? prop="roomNo"> <el-form-item label="???" prop="roomNo">
<el-input <el-input
v-model="searchForm.roomNo" v-model="searchForm.roomNo"
placeholder="请输入宿舍号" placeholder="??????"
clearable clearable
style="width: 200px" /> style="width: 200px" />
</el-form-item> </el-form-item>
<el-form-item> <el-form-item>
<el-button type="primary" plain icon="Search" @click="handleSearch">查询</el-button> <el-button type="primary" plain icon="Search" @click="handleSearch">??</el-button>
<el-button icon="Refresh" @click="handleReset">重置</el-button> <el-button icon="Refresh" @click="handleReset">??</el-button>
</el-form-item> </el-form-item>
</el-form> </el-form>
</el-card> </el-card>
<!-- 内容卡片 --> <!-- ???? -->
<el-card class="content-card" shadow="never"> <el-card class="content-card" shadow="never">
<template #header> <template #header>
<div class="card-header"> <div class="card-header">
<span class="card-title"> <span class="card-title">
<el-icon class="title-icon"><Document /></el-icon> <el-icon class="title-icon"><Document /></el-icon>
水电明细列表 ??????
</span> </span>
<div class="header-actions"> <div class="header-actions">
<el-button <el-button
icon="FolderAdd" icon="FolderAdd"
type="primary" type="primary"
@click="formDialogRef.openDialog()"> @click="formDialogRef.openDialog()">
<EFBFBD><EFBFBD>?<EFBFBD><EFBFBD>? ????
</el-button> </el-button>
<el-button <el-button
icon="Download" icon="Download"
type="success" type="success"
class="ml10" class="ml10"
@click="handleExport"> @click="handleExport">
<EFBFBD><EFBFBD>?<EFBFBD><EFBFBD>? ????
</el-button> </el-button>
<el-button <el-button
icon="Setting" icon="Setting"
type="warning" type="warning"
class="ml10" class="ml10"
@click="handleInitWaterOrder"> @click="handleInitWaterOrder">
初始化本期水电补<EFBFBD><EFBFBD>? ??????????
</el-button> </el-button>
<right-toolbar <right-toolbar
v-model:showSearch="showSearch" v-model:showSearch="showSearch"
@@ -103,7 +103,7 @@
@order-change="handleColumnOrderChange" @order-change="handleColumnOrderChange"
> >
<template #trigger> <template #trigger>
<el-tooltip class="item" effect="dark" content="列设<EFBFBD><EFBFBD>? placement="top"> <el-tooltip class="item" effect="dark" content="???" placement="top">
<el-button circle style="margin-left: 0;"> <el-button circle style="margin-left: 0;">
<el-icon><Menu /></el-icon> <el-icon><Menu /></el-icon>
</el-button> </el-button>
@@ -115,7 +115,7 @@
</div> </div>
</template> </template>
<!-- 表格 --> <!-- ?? -->
<el-table <el-table
:data="state.dataList" :data="state.dataList"
v-loading="state.loading" v-loading="state.loading"
@@ -124,7 +124,7 @@
:header-cell-style="tableStyle.headerCellStyle" :header-cell-style="tableStyle.headerCellStyle"
class="modern-table" class="modern-table"
@sort-change="sortChangeHandle"> @sort-change="sortChangeHandle">
<el-table-column type="index" label="序号" width="70" align="center"> <el-table-column type="index" label="??" width="70" align="center">
<template #header> <template #header>
<el-icon><List /></el-icon> <el-icon><List /></el-icon>
</template> </template>
@@ -134,7 +134,7 @@
</el-table-column> </el-table-column>
<template v-for="col in visibleColumnsSorted" :key="col.prop || col.label"> <template v-for="col in visibleColumnsSorted" :key="col.prop || col.label">
<el-table-column <el-table-column
v-if="checkColumnVisible(col.prop || '') && col.prop !== '操作'" v-if="checkColumnVisible(col.prop || '') && col.prop !== '??'"
:prop="col.prop" :prop="col.prop"
:label="col.label" :label="col.label"
show-overflow-tooltip show-overflow-tooltip
@@ -145,53 +145,53 @@
<el-icon><component :is="columnConfigMap[col.prop]?.icon || Money" /></el-icon> <el-icon><component :is="columnConfigMap[col.prop]?.icon || Money" /></el-icon>
<span style="margin-left: 4px">{{ col.label }}</span> <span style="margin-left: 4px">{{ col.label }}</span>
</template> </template>
<!-- 几人间列特殊模板 --> <!-- ???????? -->
<template v-if="col.prop === 'bedNum'" #default="scope"> <template v-if="col.prop === 'bedNum'" #default="scope">
<el-tag v-if="scope.row.bedNum" size="small" type="info" effect="plain"> <el-tag v-if="scope.row.bedNum" size="small" type="info" effect="plain">
{{ scope.row.bedNum }}人间 {{ scope.row.bedNum }}??
</el-tag> </el-tag>
<span v-else>-</span> <span v-else>-</span>
</template> </template>
<!-- 已住人数列特殊模<EFBFBD><EFBFBD>?--> <!-- ??????????-->
<template v-else-if="col.prop === 'liveNum'" #default="scope"> <template v-else-if="col.prop === 'liveNum'" #default="scope">
<el-tag v-if="scope.row.liveNum !== undefined && scope.row.liveNum !== null" size="small" type="success" effect="plain"> <el-tag v-if="scope.row.liveNum !== undefined && scope.row.liveNum !== null" size="small" type="success" effect="plain">
{{ scope.row.liveNum }} {{ scope.row.liveNum }}
</el-tag> </el-tag>
<span v-else>-</span> <span v-else>-</span>
</template> </template>
<!-- 校园补贴列特殊模<EFBFBD><EFBFBD>?--> <!-- ??????????-->
<template v-else-if="col.prop === 'oddbMoney'" #default="scope"> <template v-else-if="col.prop === 'oddbMoney'" #default="scope">
<el-tag v-if="scope.row.oddbMoney" size="small" type="success" effect="plain"> <el-tag v-if="scope.row.oddbMoney" size="small" type="success" effect="plain">
¥{{ Number(scope.row.oddbMoney).toFixed(2) }} ?{{ Number(scope.row.oddbMoney).toFixed(2) }}
</el-tag> </el-tag>
<span v-else>¥0.00</span> <span v-else>?0.00</span>
</template> </template>
<!-- 充值金额列特殊模板 --> <!-- ????????? -->
<template v-else-if="col.prop === 'rechargeMoney'" #default="scope"> <template v-else-if="col.prop === 'rechargeMoney'" #default="scope">
<el-tag v-if="scope.row.rechargeMoney" size="small" type="primary" effect="plain"> <el-tag v-if="scope.row.rechargeMoney" size="small" type="primary" effect="plain">
¥{{ Number(scope.row.rechargeMoney).toFixed(2) }} ?{{ Number(scope.row.rechargeMoney).toFixed(2) }}
</el-tag> </el-tag>
<span v-else>¥0.00</span> <span v-else>?0.00</span>
</template> </template>
<!-- 消费金额列特殊模<EFBFBD><EFBFBD>?--> <!-- ??????????-->
<template v-else-if="col.prop === 'costMoney'" #default="scope"> <template v-else-if="col.prop === 'costMoney'" #default="scope">
<el-tag v-if="scope.row.costMoney" size="small" type="warning" effect="plain"> <el-tag v-if="scope.row.costMoney" size="small" type="warning" effect="plain">
¥{{ Number(scope.row.costMoney).toFixed(2) }} ?{{ Number(scope.row.costMoney).toFixed(2) }}
</el-tag> </el-tag>
<span v-else>¥0.00</span> <span v-else>?0.00</span>
</template> </template>
<!-- 可用余额列特殊模<EFBFBD><EFBFBD>?--> <!-- ??????????-->
<template v-else-if="col.prop === 'effectiveMoney'" #default="scope"> <template v-else-if="col.prop === 'effectiveMoney'" #default="scope">
<el-tag size="small" :type="Number(scope.row.effectiveMoney) < 0 ? 'danger' : 'success'" effect="plain"> <el-tag size="small" :type="Number(scope.row.effectiveMoney) < 0 ? 'danger' : 'success'" effect="plain">
¥{{ scope.row.effectiveMoney ? Number(scope.row.effectiveMoney).toFixed(2) : '0.00' }} ?{{ scope.row.effectiveMoney ? Number(scope.row.effectiveMoney).toFixed(2) : '0.00' }}
</el-tag> </el-tag>
</template> </template>
</el-table-column> </el-table-column>
</template> </template>
<el-table-column label="操作" width="200" align="center" fixed="right"> <el-table-column label="??" width="200" align="center" fixed="right">
<template #header> <template #header>
<el-icon><Setting /></el-icon> <el-icon><Setting /></el-icon>
<span style="margin-left: 4px">操作</span> <span style="margin-left: 4px">??</span>
</template> </template>
<template #default="scope"> <template #default="scope">
<el-button <el-button
@@ -199,27 +199,27 @@
link link
type="primary" type="primary"
@click="handleEdit(scope.row)"> @click="handleEdit(scope.row)">
编辑 ??
</el-button> </el-button>
<el-button <el-button
icon="View" icon="View"
link link
type="info" type="info"
@click="handleViewDetail(scope.row)"> @click="handleViewDetail(scope.row)">
明细 ??
</el-button> </el-button>
<el-button <el-button
icon="Delete" icon="Delete"
link link
type="danger" type="danger"
@click="handleDelete(scope.row)"> @click="handleDelete(scope.row)">
删除 ??
</el-button> </el-button>
</template> </template>
</el-table-column> </el-table-column>
</el-table> </el-table>
<!-- 分页 --> <!-- ?? -->
<div class="pagination-wrapper"> <div class="pagination-wrapper">
<pagination <pagination
@size-change="sizeChangeHandle" @size-change="sizeChangeHandle"
@@ -229,28 +229,28 @@
</el-card> </el-card>
</div> </div>
<!-- 表单弹窗 --> <!-- ???? -->
<FormDialog ref="formDialogRef" @refresh="getDataList()" /> <FormDialog ref="formDialogRef" @refresh="getDataList()" />
<!-- 明细弹窗 --> <!-- ???? -->
<DetailDialog ref="detailDialogRef" /> <DetailDialog ref="detailDialogRef" />
<!-- 初始化水电补贴弹<EFBFBD><EFBFBD>?--> <!-- ??????????-->
<el-dialog v-model="initDialogVisible" title="初始化本期水电补<EFBFBD><EFBFBD>? :width="500" :close-on-click-modal="false" draggable> <el-dialog v-model="initDialogVisible" title="???????" :width="500" :close-on-click-modal="false" draggable>
<el-form ref="initFormRef" :model="initForm" :rules="initRules" label-width="120px"> <el-form ref="initFormRef" :model="initForm" :rules="initRules" label-width="120px">
<el-form-item label="补贴金额" prop="costMoney"> <el-form-item label="????" prop="costMoney">
<el-input-number <el-input-number
v-model="initForm.costMoney" v-model="initForm.costMoney"
:precision="2" :precision="2"
:min="0" :min="0"
placeholder="请输入补贴金<EFBFBD><EFBFBD>? placeholder="???????"
style="width: 100%" /> style="width: 100%" />
</el-form-item> </el-form-item>
</el-form> </el-form>
<template #footer> <template #footer>
<span class="dialog-footer"> <span class="dialog-footer">
<el-button @click="initDialogVisible = false"><EFBFBD><EFBFBD>?<EFBFBD><EFBFBD>?/el-button> <el-button @click="initDialogVisible = false">??</el-button>
<el-button type="primary" @click="confirmInit" :loading="initLoading"><EFBFBD><EFBFBD>?<EFBFBD><EFBFBD>?/el-button> <el-button type="primary" @click="confirmInit" :loading="initLoading">??</el-button>
</span> </span>
</template> </template>
</el-dialog> </el-dialog>
@@ -268,10 +268,10 @@ import TableColumnControl from '/@/components/TableColumnControl/index.vue'
import FormDialog from './form.vue'; import FormDialog from './form.vue';
import DetailDialog from './detail.vue'; import DetailDialog from './detail.vue';
import { List, OfficeBuilding, House, UserFilled, Money, Setting, Menu, Search, Document } from '@element-plus/icons-vue' import { List, OfficeBuilding, House, UserFilled, Money, Setting, Menu, Search, Document } from '@element-plus/icons-vue'
import { useTableColumnControl } from '/@/hooks/tableColumnControl' import { useTableColumnControl } from '/@/hooks/tableColumn'
// 定义变量内容 // ??????
const route = useRoute() const route = useRoute()
const searchFormRef = ref() const searchFormRef = ref()
const columnControlRef = ref<any>() const columnControlRef = ref<any>()
@@ -283,19 +283,19 @@ const buildingList = ref<any[]>([])
const initDialogVisible = ref(false) const initDialogVisible = ref(false)
const initLoading = ref(false) const initLoading = ref(false)
// 表格列配<EFBFBD><EFBFBD>? // ??????
const tableColumns = [ const tableColumns = [
{ prop: 'buildNo', label: '楼号' }, { prop: 'buildNo', label: '??' },
{ prop: 'roomNo', label: '宿舍<EFBFBD><EFBFBD>? }, { prop: 'roomNo', label: '???' },
{ prop: 'bedNum', label: '几人<EFBFBD><EFBFBD>? }, { prop: 'bedNum', label: '???' },
{ prop: 'liveNum', label: '已住人数' }, { prop: 'liveNum', label: '????' },
{ prop: 'oddbMoney', label: '校园补贴' }, { prop: 'oddbMoney', label: '????' },
{ prop: 'rechargeMoney', label: '充值金<EFBFBD><EFBFBD>? }, { prop: 'rechargeMoney', label: '????' },
{ prop: 'costMoney', label: '消费金额' }, { prop: 'costMoney', label: '????' },
{ prop: 'effectiveMoney', label: '可用余额' } { prop: 'effectiveMoney', label: '????' }
] ]
// 列配置映射用于图标<EFBFBD><EFBFBD>? // ????????????
const columnConfigMap: Record<string, { icon: any }> = { const columnConfigMap: Record<string, { icon: any }> = {
buildNo: { icon: OfficeBuilding }, buildNo: { icon: OfficeBuilding },
roomNo: { icon: House }, roomNo: { icon: House },
@@ -307,7 +307,7 @@ const columnConfigMap: Record<string, { icon: any }> = {
effectiveMoney: { icon: Money } effectiveMoney: { icon: Money }
} }
// 使用表格列控制hook // ???????hook
const { const {
visibleColumns, visibleColumns,
visibleColumnsSorted, visibleColumnsSorted,
@@ -316,7 +316,7 @@ const {
handleColumnOrderChange handleColumnOrderChange
} = useTableColumnControl(tableColumns, route.path) } = useTableColumnControl(tableColumns, route.path)
// 搜索表单 // ????
const searchForm = reactive({ const searchForm = reactive({
effectiveMoney: undefined as number | undefined, effectiveMoney: undefined as number | undefined,
isLiveNum: undefined as boolean | undefined, isLiveNum: undefined as boolean | undefined,
@@ -324,20 +324,20 @@ const searchForm = reactive({
roomNo: '' roomNo: ''
}) })
// 初始化表<EFBFBD><EFBFBD>? // ??????
const initForm = reactive({ const initForm = reactive({
costMoney: 0 costMoney: 0
}) })
// 初始化表单验证规<EFBFBD><EFBFBD>? // ??????????
const initRules = { const initRules = {
costMoney: [ costMoney: [
{ required: true, message: '请输入补贴金<EFBFBD><EFBFBD>?, trigger: 'blur' }, { required: true, message: '???????', trigger: 'blur' },
{ type: 'number', min: 0, message: '补贴金额必须大于等于0', trigger: 'blur' } { type: 'number', min: 0, message: '??????????0', trigger: 'blur' }
] ]
} }
// 配置 useTable // ?? useTable
const state: BasicTableProps = reactive<BasicTableProps>({ const state: BasicTableProps = reactive<BasicTableProps>({
queryForm: searchForm, queryForm: searchForm,
pageList: fetchList, pageList: fetchList,
@@ -357,12 +357,12 @@ const {
tableStyle tableStyle
} = useTable(state) } = useTable(state)
// 查询 // ??
const handleSearch = () => { const handleSearch = () => {
getDataList() getDataList()
} }
// 重置 // ??
const handleReset = () => { const handleReset = () => {
searchFormRef.value?.formRef?.resetFields() searchFormRef.value?.formRef?.resetFields()
searchForm.effectiveMoney = undefined searchForm.effectiveMoney = undefined
@@ -372,43 +372,43 @@ const handleReset = () => {
getDataList() getDataList()
} }
// 编辑 // ??
const handleEdit = (row: any) => { const handleEdit = (row: any) => {
formDialogRef.value.openDialog('edit', row) formDialogRef.value.openDialog('edit', row)
} }
// 查看明细 // ????
const handleViewDetail = (row: any) => { const handleViewDetail = (row: any) => {
detailDialogRef.value.openDialog(row.roomNo) detailDialogRef.value.openDialog(row.roomNo)
} }
// 删除 // ??
const handleDelete = async (row: any) => { const handleDelete = async (row: any) => {
try { try {
await useMessageBox().confirm('确定要删除该记录吗?') await useMessageBox().confirm('???????????')
await delObjs([row.id]) await delObjs([row.id])
useMessage().success('删除成功') useMessage().success('????')
getDataList() getDataList()
} catch (err: any) { } catch (err: any) {
if (err !== 'cancel') { if (err !== 'cancel') {
useMessage().error(err.msg || '删除失败') useMessage().error(err.msg || '????')
} }
} }
} }
// 导出 // ??
const handleExport = () => { const handleExport = () => {
// TODO: 实现导出功能 // TODO: ????
useMessage().warning('导出功能开发中') useMessage().warning('???????')
} }
// 初始化本期水电补<EFBFBD><EFBFBD>? // ??????????
const handleInitWaterOrder = () => { const handleInitWaterOrder = () => {
initDialogVisible.value = true initDialogVisible.value = true
initForm.costMoney = 0 initForm.costMoney = 0
} }
// 确认初始<EFBFBD><EFBFBD>? // ??????
const confirmInit = async () => { const confirmInit = async () => {
if (!initFormRef.value) return if (!initFormRef.value) return
@@ -418,18 +418,18 @@ const confirmInit = async () => {
initLoading.value = true initLoading.value = true
try { try {
await initWaterOrder({ costMoney: initForm.costMoney }) await initWaterOrder({ costMoney: initForm.costMoney })
useMessage().success('初始化成<EFBFBD><EFBFBD>?) useMessage().success('?????')
initDialogVisible.value = false initDialogVisible.value = false
getDataList() getDataList()
} catch (err: any) { } catch (err: any) {
useMessage().error(err.msg || '初始化失<EFBFBD><EFBFBD>?) useMessage().error(err.msg || '?????')
} finally { } finally {
initLoading.value = false initLoading.value = false
} }
}) })
} }
// 获取楼号列表 // ??????
const getBuildingListData = async () => { const getBuildingListData = async () => {
try { try {
const res = await getBuildingList() const res = await getBuildingList()
@@ -441,7 +441,7 @@ const getBuildingListData = async () => {
} }
} }
// 初始<EFBFBD><EFBFBD>? // ????
onMounted(() => { onMounted(() => {
getBuildingListData() getBuildingListData()
nextTick(() => { nextTick(() => {

View File

@@ -1,28 +1,28 @@
<template> <template>
<div class="modern-page-container"> <div class="modern-page-container">
<div class="page-wrapper"> <div class="page-wrapper">
<!-- 搜索表单卡片 --> <!-- ?????? -->
<el-card v-show="showSearch" class="search-card" shadow="never"> <el-card v-show="showSearch" class="search-card" shadow="never">
<template #header> <template #header>
<div class="card-header"> <div class="card-header">
<span class="card-title"> <span class="card-title">
<el-icon class="title-icon"><Search /></el-icon> <el-icon class="title-icon"><Search /></el-icon>
筛选条<EFBFBD><EFBFBD>? ?????
</span> </span>
</div> </div>
</template> </template>
<el-form :model="searchForm" ref="searchFormRef" :inline="true" @keyup.enter="handleSearch" class="search-form"> <el-form :model="searchForm" ref="searchFormRef" :inline="true" @keyup.enter="handleSearch" class="search-form">
<el-form-item label="宿舍<EFBFBD><EFBFBD>? prop="roomNo"> <el-form-item label="???" prop="roomNo">
<el-input <el-input
v-model="searchForm.roomNo" v-model="searchForm.roomNo"
placeholder="请输入宿舍号" placeholder="??????"
clearable clearable
style="width: 200px" /> style="width: 200px" />
</el-form-item> </el-form-item>
<el-form-item label="学年" prop="year"> <el-form-item label="??" prop="year">
<el-select <el-select
v-model="searchForm.year" v-model="searchForm.year"
placeholder="请选择学年" placeholder="?????"
clearable clearable
filterable filterable
style="width: 200px"> style="width: 200px">
@@ -34,10 +34,10 @@
</el-option> </el-option>
</el-select> </el-select>
</el-form-item> </el-form-item>
<el-form-item label="学期" prop="period"> <el-form-item label="??" prop="period">
<el-select <el-select
v-model="searchForm.period" v-model="searchForm.period"
placeholder="请选择学期" placeholder="?????"
clearable clearable
style="width: 200px"> style="width: 200px">
<el-option <el-option
@@ -49,26 +49,26 @@
</el-select> </el-select>
</el-form-item> </el-form-item>
<el-form-item> <el-form-item>
<el-button type="primary" plain icon="Search" @click="handleSearch">查询</el-button> <el-button type="primary" plain icon="Search" @click="handleSearch">??</el-button>
<el-button icon="Refresh" @click="handleReset">重置</el-button> <el-button icon="Refresh" @click="handleReset">??</el-button>
</el-form-item> </el-form-item>
</el-form> </el-form>
</el-card> </el-card>
<!-- 内容卡片 --> <!-- ???? -->
<el-card class="content-card" shadow="never"> <el-card class="content-card" shadow="never">
<template #header> <template #header>
<div class="card-header"> <div class="card-header">
<span class="card-title"> <span class="card-title">
<el-icon class="title-icon"><Document /></el-icon> <el-icon class="title-icon"><Document /></el-icon>
水电订单列表 ??????
</span> </span>
<div class="header-actions"> <div class="header-actions">
<el-button <el-button
icon="FolderAdd" icon="FolderAdd"
type="primary" type="primary"
@click="formDialogRef.openDialog()"> @click="formDialogRef.openDialog()">
<EFBFBD><EFBFBD>?<EFBFBD><EFBFBD>? ????
</el-button> </el-button>
<right-toolbar <right-toolbar
v-model:showSearch="showSearch" v-model:showSearch="showSearch"
@@ -84,7 +84,7 @@
@order-change="handleColumnOrderChange" @order-change="handleColumnOrderChange"
> >
<template #trigger> <template #trigger>
<el-tooltip class="item" effect="dark" content="列设<EFBFBD><EFBFBD>? placement="top"> <el-tooltip class="item" effect="dark" content="???" placement="top">
<el-button circle style="margin-left: 0;"> <el-button circle style="margin-left: 0;">
<el-icon><Menu /></el-icon> <el-icon><Menu /></el-icon>
</el-button> </el-button>
@@ -96,7 +96,7 @@
</div> </div>
</template> </template>
<!-- 表格 --> <!-- ?? -->
<el-table <el-table
:data="state.dataList" :data="state.dataList"
v-loading="state.loading" v-loading="state.loading"
@@ -105,7 +105,7 @@
:header-cell-style="tableStyle.headerCellStyle" :header-cell-style="tableStyle.headerCellStyle"
class="modern-table" class="modern-table"
@sort-change="sortChangeHandle"> @sort-change="sortChangeHandle">
<el-table-column type="index" label="序号" width="70" align="center"> <el-table-column type="index" label="??" width="70" align="center">
<template #header> <template #header>
<el-icon><List /></el-icon> <el-icon><List /></el-icon>
</template> </template>
@@ -115,7 +115,7 @@
</el-table-column> </el-table-column>
<template v-for="col in visibleColumnsSorted" :key="col.prop || col.label"> <template v-for="col in visibleColumnsSorted" :key="col.prop || col.label">
<el-table-column <el-table-column
v-if="checkColumnVisible(col.prop || '') && col.prop !== '操作'" v-if="checkColumnVisible(col.prop || '') && col.prop !== '??'"
:prop="col.prop" :prop="col.prop"
:label="col.label" :label="col.label"
show-overflow-tooltip show-overflow-tooltip
@@ -124,40 +124,40 @@
<el-icon><component :is="columnConfigMap[col.prop]?.icon || Calendar" /></el-icon> <el-icon><component :is="columnConfigMap[col.prop]?.icon || Calendar" /></el-icon>
<span style="margin-left: 4px">{{ col.label }}</span> <span style="margin-left: 4px">{{ col.label }}</span>
</template> </template>
<!-- 学期列特殊模<EFBFBD><EFBFBD>?--> <!-- ????????-->
<template v-if="col.prop === 'period'" #default="scope"> <template v-if="col.prop === 'period'" #default="scope">
<el-tag size="small" type="primary" effect="plain"> <el-tag size="small" type="primary" effect="plain">
{{ formatSchoolTerm(scope.row.period) }} {{ formatSchoolTerm(scope.row.period) }}
</el-tag> </el-tag>
</template> </template>
<!-- 类型列特殊模<EFBFBD><EFBFBD>?--> <!-- ????????-->
<template v-else-if="col.prop === 'type'" #default="scope"> <template v-else-if="col.prop === 'type'" #default="scope">
<el-tag size="small" type="info" effect="plain"> <el-tag size="small" type="info" effect="plain">
{{ formatType(scope.row.type) }} {{ formatType(scope.row.type) }}
</el-tag> </el-tag>
</template> </template>
<!-- 充值类型列特殊模板 --> <!-- ????????? -->
<template v-else-if="col.prop === 'paymentCode'" #default="scope"> <template v-else-if="col.prop === 'paymentCode'" #default="scope">
<el-tag size="small" type="warning" effect="plain"> <el-tag size="small" type="warning" effect="plain">
{{ formatPaymentType(scope.row.paymentCode) }} {{ formatPaymentType(scope.row.paymentCode) }}
</el-tag> </el-tag>
</template> </template>
<!-- 金额列特殊模<EFBFBD><EFBFBD>?--> <!-- ????????-->
<template v-else-if="col.prop === 'money'" #default="scope"> <template v-else-if="col.prop === 'money'" #default="scope">
<el-tag v-if="scope.row.money" size="small" type="success" effect="plain"> <el-tag v-if="scope.row.money" size="small" type="success" effect="plain">
¥{{ scope.row.money }} ?{{ scope.row.money }}
</el-tag> </el-tag>
<span v-else>-</span> <span v-else>-</span>
</template> </template>
<!-- 充值结果列特殊模板 --> <!-- ????????? -->
<template v-else-if="col.prop === 'chargeState'" #default="scope"> <template v-else-if="col.prop === 'chargeState'" #default="scope">
<StatusTag <StatusTag
:value="scope.row.chargeState" :value="scope.row.chargeState"
:options="[{ label: '成功', value: '1' }, { label: '失败', value: '0' }]" :options="[{ label: '??', value: '1' }, { label: '??', value: '0' }]"
:type-map="{ '1': { type: 'success', effect: 'light' }, '0': { type: 'danger', effect: 'light' } }" :type-map="{ '1': { type: 'success', effect: 'light' }, '0': { type: 'danger', effect: 'light' } }"
/> />
</template> </template>
<!-- 状态列特殊模板 --> <!-- ??????? -->
<template v-else-if="col.prop === 'state'" #default="scope"> <template v-else-if="col.prop === 'state'" #default="scope">
<el-tag size="small" type="info" effect="plain"> <el-tag size="small" type="info" effect="plain">
{{ formatState(scope.row.state) }} {{ formatState(scope.row.state) }}
@@ -165,10 +165,10 @@
</template> </template>
</el-table-column> </el-table-column>
</template> </template>
<el-table-column label="操作" width="150" align="center" fixed="right"> <el-table-column label="??" width="150" align="center" fixed="right">
<template #header> <template #header>
<el-icon><Setting /></el-icon> <el-icon><Setting /></el-icon>
<span style="margin-left: 4px">操作</span> <span style="margin-left: 4px">??</span>
</template> </template>
<template #default="scope"> <template #default="scope">
<el-button <el-button
@@ -176,20 +176,20 @@
link link
type="primary" type="primary"
@click="handleEdit(scope.row)"> @click="handleEdit(scope.row)">
编辑 ??
</el-button> </el-button>
<el-button <el-button
icon="Delete" icon="Delete"
link link
type="danger" type="danger"
@click="handleDelete(scope.row)"> @click="handleDelete(scope.row)">
删除 ??
</el-button> </el-button>
</template> </template>
</el-table-column> </el-table-column>
</el-table> </el-table>
<!-- 分页 --> <!-- ?? -->
<div class="pagination-wrapper"> <div class="pagination-wrapper">
<pagination <pagination
@size-change="sizeChangeHandle" @size-change="sizeChangeHandle"
@@ -199,7 +199,7 @@
</el-card> </el-card>
</div> </div>
<!-- 表单弹窗 --> <!-- ???? -->
<FormDialog ref="formDialogRef" @refresh="getDataList()" /> <FormDialog ref="formDialogRef" @refresh="getDataList()" />
</div> </div>
</template> </template>
@@ -215,12 +215,12 @@ import { useMessage, useMessageBox } from "/@/hooks/message";
import TableColumnControl from '/@/components/TableColumnControl/index.vue' import TableColumnControl from '/@/components/TableColumnControl/index.vue'
import FormDialog from './form.vue'; import FormDialog from './form.vue';
import { List, House, Calendar, Clock, Document, Collection, CreditCard, Money, User, Avatar, CircleCheck, Setting, Menu, Search } from '@element-plus/icons-vue' import { List, House, Calendar, Clock, Document, Collection, CreditCard, Money, User, Avatar, CircleCheck, Setting, Menu, Search } from '@element-plus/icons-vue'
import { useTableColumnControl } from '/@/hooks/tableColumnControl' import { useTableColumnControl } from '/@/hooks/tableColumn'
import { defineAsyncComponent } from 'vue' import { defineAsyncComponent } from 'vue'
const StatusTag = defineAsyncComponent(() => import('/@/components/StatusTag/index.vue')) const StatusTag = defineAsyncComponent(() => import('/@/components/StatusTag/index.vue'))
// 定义变量内容 // ??????
const route = useRoute() const route = useRoute()
const searchFormRef = ref() const searchFormRef = ref()
const columnControlRef = ref<any>() const columnControlRef = ref<any>()
@@ -233,22 +233,22 @@ const paymentTypeList = ref<any[]>([])
const chargeStateList = ref<any[]>([]) const chargeStateList = ref<any[]>([])
const stateList = ref<any[]>([]) const stateList = ref<any[]>([])
// 表格列配<EFBFBD><EFBFBD>? // ??????
const tableColumns = [ const tableColumns = [
{ prop: 'roomNo', label: '宿舍<EFBFBD><EFBFBD>? }, { prop: 'roomNo', label: '???' },
{ prop: 'year', label: '学年' }, { prop: 'year', label: '??' },
{ prop: 'period', label: '学期' }, { prop: 'period', label: '??' },
{ prop: 'orderNum', label: '订单<EFBFBD><EFBFBD>? }, { prop: 'orderNum', label: '???' },
{ prop: 'type', label: '类型' }, { prop: 'type', label: '??' },
{ prop: 'paymentCode', label: '充值类<EFBFBD><EFBFBD>? }, { prop: 'paymentCode', label: '????' },
{ prop: 'money', label: '金额' }, { prop: 'money', label: '??' },
{ prop: 'chargeAccount', label: '充值人的账<EFBFBD><EFBFBD>? }, { prop: 'chargeAccount', label: '??????' },
{ prop: 'chargeRealname', label: '充值人的真实姓<EFBFBD><EFBFBD>? }, { prop: 'chargeRealname', label: '????????' },
{ prop: 'chargeState', label: '充值结<EFBFBD><EFBFBD>? }, { prop: 'chargeState', label: '????' },
{ prop: 'state', label: '<EFBFBD><EFBFBD>? } { prop: 'state', label: '??' }
] ]
// 列配置映射用于图标<EFBFBD><EFBFBD>? // ????????????
const columnConfigMap: Record<string, { icon: any }> = { const columnConfigMap: Record<string, { icon: any }> = {
roomNo: { icon: House }, roomNo: { icon: House },
year: { icon: Calendar }, year: { icon: Calendar },
@@ -263,7 +263,7 @@ const columnConfigMap: Record<string, { icon: any }> = {
state: { icon: CircleCheck } state: { icon: CircleCheck }
} }
// 使用表格列控制hook // ???????hook
const { const {
visibleColumns, visibleColumns,
visibleColumnsSorted, visibleColumnsSorted,
@@ -272,14 +272,14 @@ const {
handleColumnOrderChange handleColumnOrderChange
} = useTableColumnControl(tableColumns, route.path) } = useTableColumnControl(tableColumns, route.path)
// 搜索表单 // ????
const searchForm = reactive({ const searchForm = reactive({
roomNo: '', roomNo: '',
year: '', year: '',
period: '' period: ''
}) })
// 配置 useTable // ?? useTable
const state: BasicTableProps = reactive<BasicTableProps>({ const state: BasicTableProps = reactive<BasicTableProps>({
queryForm: searchForm, queryForm: searchForm,
pageList: fetchList, pageList: fetchList,
@@ -299,12 +299,12 @@ const {
tableStyle tableStyle
} = useTable(state) } = useTable(state)
// 查询 // ??
const handleSearch = () => { const handleSearch = () => {
getDataList() getDataList()
} }
// 重置 // ??
const handleReset = () => { const handleReset = () => {
searchFormRef.value?.formRef?.resetFields() searchFormRef.value?.formRef?.resetFields()
searchForm.roomNo = '' searchForm.roomNo = ''
@@ -313,27 +313,27 @@ const handleReset = () => {
getDataList() getDataList()
} }
// 编辑 // ??
const handleEdit = (row: any) => { const handleEdit = (row: any) => {
formDialogRef.value.openDialog('edit', row) formDialogRef.value.openDialog('edit', row)
} }
// 删除 // ??
const handleDelete = async (row: any) => { const handleDelete = async (row: any) => {
try { try {
await useMessageBox().confirm('确定要删除该记录吗') await useMessageBox().confirm('??????????')
const { delObjs } = await import("/@/api/stuwork/waterorder") const { delObjs } = await import("/@/api/stuwork/waterorder")
await delObjs([row.id]) await delObjs([row.id])
useMessage().success('删除成功') useMessage().success('????')
getDataList() getDataList()
} catch (err: any) { } catch (err: any) {
if (err !== 'cancel') { if (err !== 'cancel') {
useMessage().error(err.msg || '删除失败') useMessage().error(err.msg || '????')
} }
} }
} }
// 格式化学<EFBFBD><EFBFBD>? // ??????
const formatSchoolTerm = (value: string | number) => { const formatSchoolTerm = (value: string | number) => {
if (value === null || value === undefined || value === '') { if (value === null || value === undefined || value === '') {
return '-' return '-'
@@ -342,7 +342,7 @@ const formatSchoolTerm = (value: string | number) => {
return dictItem ? dictItem.label : value return dictItem ? dictItem.label : value
} }
// 格式化类<EFBFBD><EFBFBD>? // ??????
const formatType = (value: string | number) => { const formatType = (value: string | number) => {
if (value === null || value === undefined || value === '') { if (value === null || value === undefined || value === '') {
return '-' return '-'
@@ -351,7 +351,7 @@ const formatType = (value: string | number) => {
return dictItem ? dictItem.label : value return dictItem ? dictItem.label : value
} }
// 格式化充值类<EFBFBD><EFBFBD>? // ????????
const formatPaymentType = (value: string | number) => { const formatPaymentType = (value: string | number) => {
if (value === null || value === undefined || value === '') { if (value === null || value === undefined || value === '') {
return '-' return '-'
@@ -360,7 +360,7 @@ const formatPaymentType = (value: string | number) => {
return dictItem ? dictItem.label : value return dictItem ? dictItem.label : value
} }
// 格式化充值结<EFBFBD><EFBFBD>? // ????????
const formatChargeState = (value: string | number) => { const formatChargeState = (value: string | number) => {
if (value === null || value === undefined || value === '') { if (value === null || value === undefined || value === '') {
return '-' return '-'
@@ -369,7 +369,7 @@ const formatChargeState = (value: string | number) => {
return dictItem ? dictItem.label : value return dictItem ? dictItem.label : value
} }
// 格式化状<EFBFBD><EFBFBD>? // ??????
const formatState = (value: string | number) => { const formatState = (value: string | number) => {
if (value === null || value === undefined || value === '') { if (value === null || value === undefined || value === '') {
return '-' return '-'
@@ -378,7 +378,7 @@ const formatState = (value: string | number) => {
return dictItem ? dictItem.label : value return dictItem ? dictItem.label : value
} }
// 获取学年列表 // ??????
const getSchoolYearList = async () => { const getSchoolYearList = async () => {
try { try {
const res = await queryAllSchoolYear() const res = await queryAllSchoolYear()
@@ -390,7 +390,7 @@ const getSchoolYearList = async () => {
} }
} }
// 获取学期字典 // ??????
const getSchoolTermDict = async () => { const getSchoolTermDict = async () => {
try { try {
const res = await getDicts('school_term') const res = await getDicts('school_term')
@@ -405,7 +405,7 @@ const getSchoolTermDict = async () => {
} }
} }
// 获取类型字典 // ??????
const getTypeDict = async () => { const getTypeDict = async () => {
try { try {
const res = await getDicts('dorm_water_source_type') const res = await getDicts('dorm_water_source_type')
@@ -420,7 +420,7 @@ const getTypeDict = async () => {
} }
} }
// 获取充值类型字<EFBFBD><EFBFBD>? // ?????????
const getPaymentTypeDict = async () => { const getPaymentTypeDict = async () => {
try { try {
const res = await getDicts('dorm_water_payment_type') const res = await getDicts('dorm_water_payment_type')
@@ -435,7 +435,7 @@ const getPaymentTypeDict = async () => {
} }
} }
// 获取充值结果字<EFBFBD><EFBFBD>? // ?????????
const getChargeStateDict = async () => { const getChargeStateDict = async () => {
try { try {
const res = await getDicts('dorm_water_charge_state') const res = await getDicts('dorm_water_charge_state')
@@ -450,7 +450,7 @@ const getChargeStateDict = async () => {
} }
} }
// 获取状态字<EFBFBD><EFBFBD>? // ???????
const getStateDict = async () => { const getStateDict = async () => {
try { try {
const res = await getDicts('dorm_water_state') const res = await getDicts('dorm_water_state')
@@ -465,7 +465,7 @@ const getStateDict = async () => {
} }
} }
// 初始<EFBFBD><EFBFBD>? // ????
onMounted(() => { onMounted(() => {
getSchoolYearList() getSchoolYearList()
getSchoolTermDict() getSchoolTermDict()

View File

@@ -1,21 +1,21 @@
<template> <template>
<div class="modern-page-container"> <div class="modern-page-container">
<div class="page-wrapper"> <div class="page-wrapper">
<!-- 搜索表单卡片 --> <!-- ?????? -->
<el-card v-show="showSearch" class="search-card" shadow="never"> <el-card v-show="showSearch" class="search-card" shadow="never">
<template #header> <template #header>
<div class="card-header"> <div class="card-header">
<span class="card-title"> <span class="card-title">
<el-icon class="title-icon"><Search /></el-icon> <el-icon class="title-icon"><Search /></el-icon>
筛选条<EFBFBD><EFBFBD>? ????
</span> </span>
</div> </div>
</template> </template>
<el-form :model="searchForm" ref="searchFormRef" :inline="true" @keyup.enter="handleSearch" class="search-form"> <el-form :model="searchForm" ref="searchFormRef" :inline="true" @keyup.enter="handleSearch" class="search-form">
<el-form-item label="学院" prop="deptCode"> <el-form-item label="??" prop="deptCode">
<el-select <el-select
v-model="searchForm.deptCode" v-model="searchForm.deptCode"
placeholder="请选择学院" placeholder="?????"
clearable clearable
filterable filterable
style="width: 200px" style="width: 200px"
@@ -28,10 +28,10 @@
</el-option> </el-option>
</el-select> </el-select>
</el-form-item> </el-form-item>
<el-form-item label="班级" prop="classCode"> <el-form-item label="??" prop="classCode">
<el-select <el-select
v-model="searchForm.classCode" v-model="searchForm.classCode"
placeholder="请选择班级" placeholder="?????"
clearable clearable
filterable filterable
style="width: 200px"> style="width: 200px">
@@ -43,31 +43,31 @@
</el-option> </el-option>
</el-select> </el-select>
</el-form-item> </el-form-item>
<el-form-item label="来源" prop="source"> <el-form-item label="??" prop="source">
<el-select <el-select
v-model="searchForm.source" v-model="searchForm.source"
placeholder="请选择来源" placeholder="?????"
clearable clearable
style="width: 200px" style="width: 200px"
@change="handleSourceChange"> @change="handleSourceChange">
<el-option label="考勤记录" value="history" /> <el-option label="????" value="history" />
<el-option label="考勤" value="attendance" /> <el-option label="??" value="attendance" />
</el-select> </el-select>
</el-form-item> </el-form-item>
<el-form-item> <el-form-item>
<el-button type="primary" plain icon="Search" @click="handleSearch">查询</el-button> <el-button type="primary" plain icon="Search" @click="handleSearch">??</el-button>
<el-button icon="Refresh" @click="handleReset">重置</el-button> <el-button icon="Refresh" @click="handleReset">??</el-button>
</el-form-item> </el-form-item>
</el-form> </el-form>
</el-card> </el-card>
<!-- 内容卡片 --> <!-- ???? -->
<el-card class="content-card" shadow="never"> <el-card class="content-card" shadow="never">
<template #header> <template #header>
<div class="card-header"> <div class="card-header">
<span class="card-title"> <span class="card-title">
<el-icon class="title-icon"><Document /></el-icon> <el-icon class="title-icon"><Document /></el-icon>
勤工助学考勤列表 ????????
</span> </span>
<div class="header-actions"> <div class="header-actions">
<right-toolbar <right-toolbar
@@ -84,7 +84,7 @@
@order-change="handleColumnOrderChange" @order-change="handleColumnOrderChange"
> >
<template #trigger> <template #trigger>
<el-tooltip class="item" effect="dark" content="列设<EFBFBD><EFBFBD>? placement="top"> <el-tooltip class="item" effect="dark" content="???" placement="top">
<el-button circle style="margin-left: 0;"> <el-button circle style="margin-left: 0;">
<el-icon><Menu /></el-icon> <el-icon><Menu /></el-icon>
</el-button> </el-button>
@@ -96,7 +96,7 @@
</div> </div>
</template> </template>
<!-- 表格 --> <!-- ?? -->
<el-table <el-table
:data="state.dataList" :data="state.dataList"
v-loading="state.loading" v-loading="state.loading"
@@ -104,7 +104,7 @@
:cell-style="tableStyle.cellStyle" :cell-style="tableStyle.cellStyle"
:header-cell-style="tableStyle.headerCellStyle" :header-cell-style="tableStyle.headerCellStyle"
class="modern-table"> 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> <template #header>
<el-icon><List /></el-icon> <el-icon><List /></el-icon>
</template> </template>
@@ -114,7 +114,7 @@
</el-table-column> </el-table-column>
<template v-for="col in visibleColumnsSorted" :key="col.prop || col.label"> <template v-for="col in visibleColumnsSorted" :key="col.prop || col.label">
<el-table-column <el-table-column
v-if="checkColumnVisible(col.prop || '') && col.prop !== '操作'" v-if="checkColumnVisible(col.prop || '') && col.prop !== '??'"
:prop="col.prop" :prop="col.prop"
:label="col.label" :label="col.label"
show-overflow-tooltip show-overflow-tooltip
@@ -125,28 +125,28 @@
<el-icon><component :is="columnConfigMap[col.prop]?.icon || Calendar" /></el-icon> <el-icon><component :is="columnConfigMap[col.prop]?.icon || Calendar" /></el-icon>
<span style="margin-left: 4px">{{ col.label }}</span> <span style="margin-left: 4px">{{ col.label }}</span>
</template> </template>
<!-- 学期列特殊模<EFBFBD><EFBFBD>?--> <!-- ??????? -->
<template v-if="col.prop === 'schoolTerm'" #default="scope"> <template v-if="col.prop === 'schoolTerm'" #default="scope">
<el-tag size="small" type="primary" effect="plain"> <el-tag size="small" type="primary" effect="plain">
{{ formatSchoolTerm(scope.row.schoolTerm) }} {{ formatSchoolTerm(scope.row.schoolTerm) }}
</el-tag> </el-tag>
</template> </template>
<!-- 考勤类型列特殊模<EFBFBD><EFBFBD>?--> <!-- ????????? -->
<template v-else-if="col.prop === 'attendanceType'" #default="scope"> <template v-else-if="col.prop === 'attendanceType'" #default="scope">
<el-tag size="small" type="warning" effect="plain"> <el-tag size="small" type="warning" effect="plain">
{{ formatAttendanceType(scope.row.attendanceType) }} {{ formatAttendanceType(scope.row.attendanceType) }}
</el-tag> </el-tag>
</template> </template>
<!-- 落实情况列特殊模<EFBFBD><EFBFBD>?--> <!-- ????????? -->
<template v-else-if="col.prop === 'remarks'" #default="scope"> <template v-else-if="col.prop === 'remarks'" #default="scope">
<span>{{ scope.row.remarks || '-' }}</span> <span>{{ scope.row.remarks || '-' }}</span>
</template> </template>
</el-table-column> </el-table-column>
</template> </template>
<el-table-column label="操作" width="150" align="center" fixed="right"> <el-table-column label="??" width="150" align="center" fixed="right">
<template #header> <template #header>
<el-icon><Setting /></el-icon> <el-icon><Setting /></el-icon>
<span style="margin-left: 4px">操作</span> <span style="margin-left: 4px">??</span>
</template> </template>
<template #default="scope"> <template #default="scope">
<el-button <el-button
@@ -154,13 +154,13 @@
link link
type="primary" type="primary"
@click="handleView(scope.row)"> @click="handleView(scope.row)">
查看详情 ????
</el-button> </el-button>
</template> </template>
</el-table-column> </el-table-column>
</el-table> </el-table>
<!-- 分页 --> <!-- ?? -->
<div class="pagination-wrapper"> <div class="pagination-wrapper">
<pagination <pagination
@size-change="sizeChangeHandle" @size-change="sizeChangeHandle"
@@ -182,33 +182,33 @@ import { getClassListByRole } from "/@/api/basic/basicclass";
import { useMessage } from "/@/hooks/message"; import { useMessage } from "/@/hooks/message";
import TableColumnControl from '/@/components/TableColumnControl/index.vue' import TableColumnControl from '/@/components/TableColumnControl/index.vue'
import { List, Calendar, Clock, OfficeBuilding, Grid, Document, CreditCard, Avatar, Collection, Setting, Menu, Search } from '@element-plus/icons-vue' import { List, Calendar, Clock, OfficeBuilding, Grid, Document, CreditCard, Avatar, Collection, Setting, Menu, Search } from '@element-plus/icons-vue'
import { useTableColumnControl } from '/@/hooks/tableColumnControl' import { useTableColumnControl } from '/@/hooks/tableColumn'
// 定义变量内容 // ??????
const route = useRoute() const route = useRoute()
const searchFormRef = ref() const searchFormRef = ref()
const columnControlRef = ref<any>() const columnControlRef = ref<any>()
const showSearch = ref(true) const showSearch = ref(true)
const deptList = ref<any[]>([]) const deptList = ref<any[]>([])
const classList = ref<any[]>([]) const classList = ref<any[]>([])
const showRemarks = ref(false) // 控制落实情况列的显示 const showRemarks = ref(false) // ??????????
// 表格列配<EFBFBD><EFBFBD>? // ?????
const tableColumns = [ const tableColumns = [
{ prop: 'schoolYear', label: '学年' }, { prop: 'schoolYear', label: '??' },
{ prop: 'schoolTerm', label: '学期' }, { prop: 'schoolTerm', label: '??' },
{ prop: 'deptName', label: '系部名称' }, { prop: 'deptName', label: '????' },
{ prop: 'classCode', label: '班级代码' }, { prop: 'classCode', label: '????' },
{ prop: 'classNo', label: '班级简<EFBFBD><EFBFBD>? }, { prop: 'classNo', label: '????' },
{ prop: 'classProName', label: '班级规范名称', minWidth: 200 }, { prop: 'classProName', label: '??????', minWidth: 200 },
{ prop: 'stuNo', label: '学号' }, { prop: 'stuNo', label: '??' },
{ prop: 'realName', label: '姓名' }, { prop: 'realName', label: '??' },
{ prop: 'attendanceType', label: '考勤类型' }, { prop: 'attendanceType', label: '????' },
{ prop: 'remarks', label: '落实情况', minWidth: 150 } { prop: 'remarks', label: '????', minWidth: 150 }
] ]
// 列配置映射用于图标<EFBFBD><EFBFBD>? // ?????????????
const columnConfigMap: Record<string, { icon: any }> = { const columnConfigMap: Record<string, { icon: any }> = {
schoolYear: { icon: Calendar }, schoolYear: { icon: Calendar },
schoolTerm: { icon: Clock }, schoolTerm: { icon: Clock },
@@ -222,7 +222,7 @@ const columnConfigMap: Record<string, { icon: any }> = {
remarks: { icon: Document } remarks: { icon: Document }
} }
// 使用表格列控制hook // ??????? hook
const { const {
visibleColumns, visibleColumns,
visibleColumnsSorted, visibleColumnsSorted,
@@ -231,14 +231,14 @@ const {
handleColumnOrderChange handleColumnOrderChange
} = useTableColumnControl(tableColumns, route.path) } = useTableColumnControl(tableColumns, route.path)
// 搜索表单 // ????
const searchForm = reactive({ const searchForm = reactive({
deptCode: '', deptCode: '',
classCode: '', classCode: '',
source: '' // 来源选择:考勤记录、考勤 source: '' // ????????????
}) })
// 配置 useTable // ?? useTable
const state: BasicTableProps = reactive<BasicTableProps>({ const state: BasicTableProps = reactive<BasicTableProps>({
queryForm: searchForm, queryForm: searchForm,
pageList: fetchList, pageList: fetchList,
@@ -257,26 +257,26 @@ const {
tableStyle tableStyle
} = useTable(state) } = useTable(state)
// 格式化考勤类型 // ???????
const formatAttendanceType = (value: string | number) => { const formatAttendanceType = (value: string | number) => {
if (value === '1' || value === 1) return '到岗' if (value === '1' || value === 1) return '??'
if (value === '2' || value === 2) return '未到<EFBFBD><EFBFBD>? if (value === '2' || value === 2) return '???'
if (value === '3' || value === 3) return '请假' if (value === '3' || value === 3) return '??'
return '-' return '-'
} }
// 学院变化时更新班级列<EFBFBD><EFBFBD>? // ???????????
const handleDeptChange = () => { const handleDeptChange = () => {
searchForm.classCode = '' searchForm.classCode = ''
getClassListData() getClassListData()
} }
// 来源选择变化 // ??????
const handleSourceChange = async (value: string) => { const handleSourceChange = async (value: string) => {
if (value === 'history') { if (value === 'history') {
// 选择考勤记录时显示落实情况<EFBFBD><EFBFBD>? // ???????????????
showRemarks.value = true showRemarks.value = true
// 查询考勤记录(不强制要求学院和班级) // ??????????????????
try { try {
state.loading = true state.loading = true
const params: any = {} const params: any = {}
@@ -299,7 +299,7 @@ const handleSourceChange = async (value: string) => {
} }
} }
} catch (err: any) { } catch (err: any) {
useMessage().error(err.msg || '查询考勤记录失败') useMessage().error(err.msg || '????????')
state.dataList = [] state.dataList = []
if (state.pagination) { if (state.pagination) {
state.pagination.total = 0 state.pagination.total = 0
@@ -308,17 +308,17 @@ const handleSourceChange = async (value: string) => {
state.loading = false state.loading = false
} }
} else if (value === 'attendance') { } else if (value === 'attendance') {
// 选择考勤时不显示落实情况列使用普通列表接<EFBFBD><EFBFBD>? // ???????????????????????
showRemarks.value = false showRemarks.value = false
getDataList() getDataList()
} else { } else {
// 清空选择时,不显示落实情况列 // ??????????????
showRemarks.value = false showRemarks.value = false
getDataList() getDataList()
} }
} }
// 查询 // ??
const handleSearch = () => { const handleSearch = () => {
if (searchForm.source === 'history') { if (searchForm.source === 'history') {
handleSourceChange('history') handleSourceChange('history')
@@ -328,7 +328,7 @@ const handleSearch = () => {
} }
} }
// 重置 // ??
const handleReset = () => { const handleReset = () => {
searchFormRef.value?.resetFields() searchFormRef.value?.resetFields()
searchForm.deptCode = '' searchForm.deptCode = ''
@@ -338,12 +338,12 @@ const handleReset = () => {
getDataList() getDataList()
} }
// 查看详情 // ????
const handleView = (row: any) => { const handleView = (row: any) => {
useMessage().warning('查看详情功能待实<EFBFBD><EFBFBD>?) useMessage().warning('?????????')
} }
// 获取学院列表 // ??????
const getDeptListData = async () => { const getDeptListData = async () => {
try { try {
const res = await getDeptList() const res = await getDeptList()
@@ -355,13 +355,13 @@ const getDeptListData = async () => {
} }
} }
// 获取班级列表 // ??????
const getClassListData = async () => { const getClassListData = async () => {
try { try {
const res = await getClassListByRole() const res = await getClassListByRole()
if (res.data) { if (res.data) {
let list = Array.isArray(res.data) ? res.data : [] let list = Array.isArray(res.data) ? res.data : []
// 如果选择了学院,过滤班级列表 // ??????????????
if (searchForm.deptCode) { if (searchForm.deptCode) {
list = list.filter((item: any) => item.deptCode === searchForm.deptCode) list = list.filter((item: any) => item.deptCode === searchForm.deptCode)
} }
@@ -372,7 +372,7 @@ const getClassListData = async () => {
} }
} }
// 初始<EFBFBD><EFBFBD>? // ???
onMounted(() => { onMounted(() => {
getDeptListData() getDeptListData()
getClassListData() getClassListData()
@@ -386,4 +386,3 @@ onMounted(() => {
<style scoped lang="scss"> <style scoped lang="scss">
@import '/@/assets/styles/modern-page.scss'; @import '/@/assets/styles/modern-page.scss';
</style> </style>