修復打包問題
This commit is contained in:
258
scripts/fix-encoding-corruption.py
Normal file
258
scripts/fix-encoding-corruption.py
Normal 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())
|
||||
96
scripts/fix-stuunionleague.py
Normal file
96
scripts/fix-stuunionleague.py
Normal 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')
|
||||
60
src/api/recruit/recruitschoolcode.ts
Normal file
60
src/api/recruit/recruitschoolcode.ts
Normal 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,
|
||||
});
|
||||
};
|
||||
@@ -31,7 +31,7 @@ const togglePlayPause = () => {
|
||||
if (isPlaying.value) {
|
||||
pauseAudio(); // 如果正在播放,则暂停
|
||||
} else {
|
||||
playAudio(props.text); // 如果未播放,则生成或播放<EFBFBD><EFBFBD><EFBFBD>频
|
||||
playAudio(props.text); // 如果未播放,则生成或播放音频
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
@@ -35,7 +35,7 @@
|
||||
<script setup lang="ts">
|
||||
import { ref, reactive, nextTick } from 'vue'
|
||||
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'
|
||||
|
||||
// Emits
|
||||
|
||||
@@ -225,7 +225,7 @@ import TableColumnControl from '/@/components/TableColumnControl/index.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 { useTableColumnControl } from '/@/hooks/tableColumnControl'
|
||||
import { useTableColumnControl } from '/@/hooks/tableColumn'
|
||||
|
||||
import { defineAsyncComponent as defineStatusTag } from 'vue'
|
||||
const StatusTag = defineStatusTag(() => import('/@/components/StatusTag/index.vue'))
|
||||
|
||||
@@ -166,7 +166,7 @@ import TableColumnControl from '/@/components/TableColumnControl/index.vue'
|
||||
// 引入组件
|
||||
const FormDialog = defineAsyncComponent(() => import('./form.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'
|
||||
const StatusTag = defineStatusTag(() => import('/@/components/StatusTag/index.vue'))
|
||||
|
||||
@@ -169,7 +169,7 @@ import { useMessage } from "/@/hooks/message";
|
||||
import { parseTime } from "/@/utils/formatTime";
|
||||
import TableColumnControl from '/@/components/TableColumnControl/index.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'
|
||||
|
||||
|
||||
// 定义变量内容
|
||||
|
||||
@@ -1,21 +1,21 @@
|
||||
<template>
|
||||
<div class="modern-page-container">
|
||||
<div class="page-wrapper">
|
||||
<!-- 搜索表单卡片 -->
|
||||
<!-- ?????? -->
|
||||
<el-card v-show="showSearch" class="search-card" shadow="never">
|
||||
<template #header>
|
||||
<div class="card-header">
|
||||
<span class="card-title">
|
||||
<el-icon class="title-icon"><Search /></el-icon>
|
||||
筛选条<EFBFBD><EFBFBD>?
|
||||
????
|
||||
</span>
|
||||
</div>
|
||||
</template>
|
||||
<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
|
||||
v-model="state.queryForm.schoolYear"
|
||||
placeholder="请选择学年"
|
||||
placeholder="?????"
|
||||
clearable
|
||||
filterable
|
||||
style="width: 200px">
|
||||
@@ -27,10 +27,10 @@
|
||||
</el-option>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="学期" prop="schoolTerm">
|
||||
<el-form-item label="??" prop="schoolTerm">
|
||||
<el-select
|
||||
v-model="state.queryForm.schoolTerm"
|
||||
placeholder="请选择学期"
|
||||
placeholder="?????"
|
||||
clearable
|
||||
style="width: 200px">
|
||||
<el-option
|
||||
@@ -41,48 +41,48 @@
|
||||
</el-option>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="宿舍<EFBFBD><EFBFBD>? prop="roomNo">
|
||||
<el-form-item label="???" prop="roomNo">
|
||||
<el-input
|
||||
v-model="state.queryForm.roomNo"
|
||||
placeholder="请输入宿舍号"
|
||||
placeholder="??????"
|
||||
clearable
|
||||
style="width: 200px" />
|
||||
</el-form-item>
|
||||
<el-form-item label="奖项名称" prop="ruleName">
|
||||
<el-form-item label="????" prop="ruleName">
|
||||
<el-input
|
||||
v-model="state.queryForm.ruleName"
|
||||
placeholder="请输入奖项名<EFBFBD><EFBFBD>?
|
||||
placeholder="???????"
|
||||
clearable
|
||||
style="width: 200px" />
|
||||
</el-form-item>
|
||||
<el-form-item>
|
||||
<el-button type="primary" plain icon="Search" @click="getDataList">查询</el-button>
|
||||
<el-button icon="Refresh" @click="handleReset">重置</el-button>
|
||||
<el-button type="primary" plain icon="Search" @click="getDataList">??</el-button>
|
||||
<el-button icon="Refresh" @click="handleReset">??</el-button>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
</el-card>
|
||||
|
||||
<!-- 内容卡片 -->
|
||||
<!-- ???? -->
|
||||
<el-card class="content-card" shadow="never">
|
||||
<template #header>
|
||||
<div class="card-header">
|
||||
<span class="card-title">
|
||||
<el-icon class="title-icon"><Document /></el-icon>
|
||||
文明宿舍列表
|
||||
????????
|
||||
</span>
|
||||
<div class="header-actions">
|
||||
<el-button
|
||||
icon="Plus"
|
||||
type="primary"
|
||||
@click="formDialogRef.openDialog()">
|
||||
新增
|
||||
??
|
||||
</el-button>
|
||||
<el-button
|
||||
icon="Upload"
|
||||
type="success"
|
||||
class="ml10"
|
||||
@click="handleImport">
|
||||
导入
|
||||
??
|
||||
</el-button>
|
||||
<right-toolbar
|
||||
v-model:showSearch="showSearch"
|
||||
@@ -98,7 +98,7 @@
|
||||
@order-change="handleColumnOrderChange"
|
||||
>
|
||||
<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-icon><Menu /></el-icon>
|
||||
</el-button>
|
||||
@@ -110,7 +110,7 @@
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<!-- 表格 -->
|
||||
<!-- ?? -->
|
||||
<el-table
|
||||
:data="state.dataList"
|
||||
v-loading="state.loading"
|
||||
@@ -118,7 +118,7 @@
|
||||
:cell-style="tableStyle.cellStyle"
|
||||
:header-cell-style="tableStyle.headerCellStyle"
|
||||
class="modern-table">
|
||||
<el-table-column type="index" label="序号" width="70" align="center">
|
||||
<el-table-column type="index" label="??" width="70" align="center">
|
||||
<template #header>
|
||||
<el-icon><List /></el-icon>
|
||||
</template>
|
||||
@@ -128,7 +128,7 @@
|
||||
</el-table-column>
|
||||
<template v-for="col in visibleColumnsSorted" :key="col.prop || col.label">
|
||||
<el-table-column
|
||||
v-if="checkColumnVisible(col.prop || '') && col.prop !== '操作'"
|
||||
v-if="checkColumnVisible(col.prop || '') && col.prop !== '??'"
|
||||
:prop="col.prop"
|
||||
:label="col.label"
|
||||
:width="col.width"
|
||||
@@ -152,10 +152,10 @@
|
||||
</template>
|
||||
</el-table-column>
|
||||
</template>
|
||||
<el-table-column label="操作" width="150" align="center" fixed="right">
|
||||
<el-table-column label="??" width="150" align="center" fixed="right">
|
||||
<template #header>
|
||||
<el-icon><Setting /></el-icon>
|
||||
<span style="margin-left: 4px">操作</span>
|
||||
<span style="margin-left: 4px">??</span>
|
||||
</template>
|
||||
<template #default="scope">
|
||||
<el-button
|
||||
@@ -163,20 +163,20 @@
|
||||
link
|
||||
type="primary"
|
||||
@click="handleEdit(scope.row)">
|
||||
编辑
|
||||
??
|
||||
</el-button>
|
||||
<el-button
|
||||
icon="Delete"
|
||||
link
|
||||
type="danger"
|
||||
@click="handleDelete(scope.row)">
|
||||
删除
|
||||
??
|
||||
</el-button>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
|
||||
<!-- 分页 -->
|
||||
<!-- ?? -->
|
||||
<div class="pagination-wrapper">
|
||||
<pagination
|
||||
@size-change="sizeChangeHandle"
|
||||
@@ -186,12 +186,12 @@
|
||||
</el-card>
|
||||
</div>
|
||||
|
||||
<!-- 新增/编辑表单弹窗 -->
|
||||
<!-- ??/?????? -->
|
||||
<form-dialog ref="formDialogRef" @refresh="getDataList" />
|
||||
|
||||
<!-- 导入弹窗 -->
|
||||
<!-- ???? -->
|
||||
<el-dialog
|
||||
title="导入文明宿舍"
|
||||
title="??????"
|
||||
v-model="importDialogVisible"
|
||||
:width="500"
|
||||
:close-on-click-modal="false"
|
||||
@@ -201,7 +201,7 @@
|
||||
icon="Download"
|
||||
type="success"
|
||||
@click="handleDownloadTemplate">
|
||||
下载模板
|
||||
????
|
||||
</el-button>
|
||||
</div>
|
||||
<el-upload
|
||||
@@ -213,18 +213,18 @@
|
||||
drag>
|
||||
<el-icon class="el-icon--upload"><upload-filled /></el-icon>
|
||||
<div class="el-upload__text">
|
||||
将文件拖到此处,<EFBFBD><EFBFBD>?em>点击上传</em>
|
||||
????????<em>????</em>
|
||||
</div>
|
||||
<template #tip>
|
||||
<div class="el-upload__tip">
|
||||
只能上传 xlsx/xls 文件
|
||||
???? xlsx/xls ??
|
||||
</div>
|
||||
</template>
|
||||
</el-upload>
|
||||
<template #footer>
|
||||
<span class="dialog-footer">
|
||||
<el-button @click="importDialogVisible = false"><EFBFBD><EFBFBD>?<EFBFBD><EFBFBD>?/el-button>
|
||||
<el-button type="primary" @click="handleImportSubmit" :disabled="!importFile || importLoading"><EFBFBD><EFBFBD>?<EFBFBD><EFBFBD>?/el-button>
|
||||
<el-button @click="importDialogVisible = false">??</el-button>
|
||||
<el-button type="primary" @click="handleImportSubmit" :disabled="!importFile || importLoading">??</el-button>
|
||||
</span>
|
||||
</template>
|
||||
</el-dialog>
|
||||
@@ -241,11 +241,11 @@ import { getDicts } from "/@/api/admin/dict";
|
||||
import { useMessage, useMessageBox } from "/@/hooks/message";
|
||||
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 { useTableColumnControl } from '/@/hooks/tableColumnControl'
|
||||
import { useTableColumnControl } from '/@/hooks/tableColumn'
|
||||
import FormDialog from './form.vue'
|
||||
|
||||
|
||||
// 定义变量内容
|
||||
// ????
|
||||
const route = useRoute()
|
||||
const formDialogRef = ref()
|
||||
const uploadRef = ref()
|
||||
@@ -258,16 +258,16 @@ const importDialogVisible = ref(false)
|
||||
const importFile = ref<File | null>(null)
|
||||
const importLoading = ref(false)
|
||||
|
||||
// 表格列配<EFBFBD><EFBFBD>?
|
||||
// ?????
|
||||
const tableColumns = [
|
||||
{ prop: 'schoolYear', label: '学年', icon: Calendar },
|
||||
{ prop: 'schoolTerm', label: '学期', icon: Clock },
|
||||
{ prop: 'roomNo', label: '宿舍<EFBFBD><EFBFBD>?, icon: House },
|
||||
{ prop: 'ruleName', label: '奖项名称', icon: Trophy, minWidth: 150 },
|
||||
{ prop: 'remarks', label: '备注', icon: EditPen, minWidth: 200 }
|
||||
{ prop: 'schoolYear', label: '??', icon: Calendar },
|
||||
{ prop: 'schoolTerm', label: '??', icon: Clock },
|
||||
{ prop: 'roomNo', label: '???', icon: House },
|
||||
{ prop: 'ruleName', label: '????', icon: Trophy, minWidth: 150 },
|
||||
{ prop: 'remarks', label: '??', icon: EditPen, minWidth: 200 }
|
||||
]
|
||||
|
||||
// 使用表格列控制hook
|
||||
// ??????? hook
|
||||
const {
|
||||
visibleColumns,
|
||||
visibleColumnsSorted,
|
||||
@@ -276,13 +276,13 @@ const {
|
||||
handleColumnOrderChange
|
||||
} = useTableColumnControl(tableColumns, route.path)
|
||||
|
||||
// 表格样式
|
||||
// ????
|
||||
const tableStyle = {
|
||||
cellStyle: { padding: '8px 0' },
|
||||
headerCellStyle: { background: '#f5f7fa', color: '#606266', fontWeight: 'bold' }
|
||||
}
|
||||
|
||||
// 配置 useTable
|
||||
// ?? useTable
|
||||
const state: BasicTableProps = reactive<BasicTableProps>({
|
||||
queryForm: {
|
||||
schoolYear: '',
|
||||
@@ -295,7 +295,7 @@ const state: BasicTableProps = reactive<BasicTableProps>({
|
||||
item: 'records',
|
||||
totalCount: 'total'
|
||||
},
|
||||
createdIsNeed: true // 页面加载时自动获取数<E58F96><E695B0>?
|
||||
createdIsNeed: true // ?????????
|
||||
})
|
||||
|
||||
// table hook
|
||||
@@ -306,7 +306,7 @@ const {
|
||||
tableStyle: _tableStyle
|
||||
} = useTable(state)
|
||||
|
||||
// 格式化学<EFBFBD><EFBFBD>?
|
||||
// ?????
|
||||
const formatSchoolTerm = (value: string | number) => {
|
||||
if (value === null || value === undefined || value === '') {
|
||||
return '-'
|
||||
@@ -315,7 +315,7 @@ const formatSchoolTerm = (value: string | number) => {
|
||||
return dictItem ? dictItem.label : value
|
||||
}
|
||||
|
||||
// 重置
|
||||
// ??
|
||||
const handleReset = () => {
|
||||
searchFormRef.value?.resetFields()
|
||||
state.queryForm.schoolYear = ''
|
||||
@@ -325,22 +325,22 @@ const handleReset = () => {
|
||||
getDataList()
|
||||
}
|
||||
|
||||
// 导入
|
||||
// ????
|
||||
const handleImport = () => {
|
||||
importDialogVisible.value = true
|
||||
importFile.value = null
|
||||
uploadRef.value?.clearFiles()
|
||||
}
|
||||
|
||||
// 下载模板
|
||||
// ????
|
||||
const handleDownloadTemplate = async () => {
|
||||
try {
|
||||
const fileName = '文明宿舍导入模板.xlsx'
|
||||
// 使用动态导入获取文件URL,从 views/stuwork/rewarddorm <EFBFBD><EFBFBD>?assets/file 的相对路<EFBFBD><EFBFBD>?
|
||||
const fileName = '????????.xlsx'
|
||||
// ?????? views/stuwork/rewarddorm ? assets/file ?
|
||||
const fileUrl = new URL(`../../../assets/file/${fileName}`, import.meta.url).href
|
||||
const response = await fetch(fileUrl)
|
||||
if (!response.ok) {
|
||||
throw new Error('文件下载失败')
|
||||
throw new Error('??????')
|
||||
}
|
||||
const blob = await response.blob()
|
||||
const url = window.URL.createObjectURL(blob)
|
||||
@@ -351,60 +351,60 @@ const handleDownloadTemplate = async () => {
|
||||
link.click()
|
||||
window.URL.revokeObjectURL(url)
|
||||
document.body.removeChild(link)
|
||||
useMessage().success('模板下载成功')
|
||||
useMessage().success('??????')
|
||||
} catch (error) {
|
||||
useMessage().error('模板下载失败,请检查模板文件是否存<EFBFBD><EFBFBD>?)
|
||||
useMessage().error('??????')
|
||||
}
|
||||
}
|
||||
|
||||
// 文件变化
|
||||
// ????
|
||||
const handleFileChange = (file: any) => {
|
||||
importFile.value = file.raw
|
||||
}
|
||||
|
||||
// 提交导入
|
||||
// ????
|
||||
const handleImportSubmit = async () => {
|
||||
if (!importFile.value) {
|
||||
useMessage().warning('请选择要导入的文件')
|
||||
useMessage().warning('?????????')
|
||||
return
|
||||
}
|
||||
|
||||
importLoading.value = true
|
||||
try {
|
||||
await importExcel(importFile.value)
|
||||
useMessage().success('导入成功')
|
||||
useMessage().success('????')
|
||||
importDialogVisible.value = false
|
||||
importFile.value = null
|
||||
uploadRef.value?.clearFiles()
|
||||
getDataList()
|
||||
} catch (err: any) {
|
||||
useMessage().error(err.msg || '导入失败')
|
||||
useMessage().error(err.msg || '????')
|
||||
} finally {
|
||||
importLoading.value = false
|
||||
}
|
||||
}
|
||||
|
||||
// 编辑
|
||||
// ??
|
||||
const handleEdit = (row: any) => {
|
||||
formDialogRef.value?.openDialog('edit', row)
|
||||
}
|
||||
|
||||
// 删除
|
||||
// ??
|
||||
const handleDelete = async (row: any) => {
|
||||
const { confirm } = useMessageBox()
|
||||
try {
|
||||
await confirm('确定要删除该文明宿舍记录吗?')
|
||||
await confirm('???????????')
|
||||
await delObj([row.id])
|
||||
useMessage().success('删除成功')
|
||||
useMessage().success('????')
|
||||
getDataList()
|
||||
} catch (err: any) {
|
||||
if (err !== 'cancel') {
|
||||
useMessage().error(err.msg || '删除失败')
|
||||
useMessage().error(err.msg || '????')
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// 获取学年列表
|
||||
// ??????
|
||||
const getSchoolYearList = async () => {
|
||||
try {
|
||||
const res = await queryAllSchoolYear()
|
||||
@@ -418,7 +418,7 @@ const getSchoolYearList = async () => {
|
||||
}
|
||||
}
|
||||
|
||||
// 获取学期字典
|
||||
// ??????
|
||||
const getSchoolTermDict = async () => {
|
||||
try {
|
||||
const res = await getDicts('school_term')
|
||||
@@ -435,7 +435,7 @@ const getSchoolTermDict = async () => {
|
||||
}
|
||||
}
|
||||
|
||||
// 初始<EFBFBD><EFBFBD>?
|
||||
// ???
|
||||
onMounted(() => {
|
||||
getSchoolYearList()
|
||||
getSchoolTermDict()
|
||||
|
||||
@@ -1,21 +1,21 @@
|
||||
<template>
|
||||
<div class="modern-page-container">
|
||||
<div class="page-wrapper">
|
||||
<!-- 搜索表单卡片 -->
|
||||
<!-- ???? -->
|
||||
<el-card v-show="showSearch" class="search-card" shadow="never">
|
||||
<template #header>
|
||||
<div class="card-header">
|
||||
<span class="card-title">
|
||||
<el-icon class="title-icon"><Search /></el-icon>
|
||||
筛选条<EFBFBD><EFBFBD>?
|
||||
????
|
||||
</span>
|
||||
</div>
|
||||
</template>
|
||||
<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
|
||||
v-model="state.queryForm.ruleType"
|
||||
placeholder="请选择奖项类型"
|
||||
placeholder="请输入奖项名称"
|
||||
clearable
|
||||
style="width: 200px">
|
||||
<el-option
|
||||
@@ -27,26 +27,26 @@
|
||||
</el-select>
|
||||
</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-form-item>
|
||||
</el-form>
|
||||
</el-card>
|
||||
|
||||
<!-- 内容卡片 -->
|
||||
<!-- ???? -->
|
||||
<el-card class="content-card" shadow="never">
|
||||
<template #header>
|
||||
<div class="card-header">
|
||||
<span class="card-title">
|
||||
<el-icon class="title-icon"><Document /></el-icon>
|
||||
评优评先奖项列表
|
||||
????????
|
||||
</span>
|
||||
<div class="header-actions">
|
||||
<el-button
|
||||
icon="Plus"
|
||||
type="primary"
|
||||
@click="formDialogRef.openDialog()">
|
||||
新增
|
||||
??
|
||||
</el-button>
|
||||
<right-toolbar
|
||||
v-model:showSearch="showSearch"
|
||||
@@ -62,7 +62,7 @@
|
||||
@order-change="handleColumnOrderChange"
|
||||
>
|
||||
<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-icon><Menu /></el-icon>
|
||||
</el-button>
|
||||
@@ -150,7 +150,7 @@
|
||||
</el-card>
|
||||
</div>
|
||||
|
||||
<!-- 新增/编辑表单弹窗 -->
|
||||
<!-- ??/?????? -->
|
||||
<form-dialog ref="formDialogRef" @refresh="getDataList" />
|
||||
</div>
|
||||
</template>
|
||||
@@ -165,10 +165,10 @@ import { useMessage, useMessageBox } from "/@/hooks/message";
|
||||
import TableColumnControl from '/@/components/TableColumnControl/index.vue'
|
||||
import FormDialog from './form.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 formDialogRef = ref()
|
||||
const searchFormRef = ref()
|
||||
@@ -176,14 +176,14 @@ const columnControlRef = ref()
|
||||
const showSearch = ref(true)
|
||||
const ruleTypeList = ref<any[]>([])
|
||||
|
||||
// 表格列配<EFBFBD><EFBFBD>?
|
||||
// ?????
|
||||
const tableColumns = [
|
||||
{ prop: 'ruleName', label: '奖项名称', icon: Trophy, minWidth: 200 },
|
||||
{ prop: 'ruleType', label: '奖项类型', icon: Collection },
|
||||
{ prop: 'remarks', label: '备注', icon: EditPen, minWidth: 200 }
|
||||
{ prop: 'ruleName', label: '????', icon: Trophy, minWidth: 200 },
|
||||
{ prop: 'ruleType', label: '????', icon: Collection },
|
||||
{ prop: 'remarks', label: '??', icon: EditPen, minWidth: 200 }
|
||||
]
|
||||
|
||||
// 使用表格列控制hook
|
||||
// ??????? hook
|
||||
const {
|
||||
visibleColumns,
|
||||
visibleColumnsSorted,
|
||||
@@ -192,13 +192,13 @@ const {
|
||||
handleColumnOrderChange
|
||||
} = useTableColumnControl(tableColumns, route.path)
|
||||
|
||||
// 表格样式
|
||||
// ????
|
||||
const tableStyle = {
|
||||
cellStyle: { padding: '8px 0' },
|
||||
headerCellStyle: { background: '#f5f7fa', color: '#606266', fontWeight: 'bold' }
|
||||
}
|
||||
|
||||
// 配置 useTable
|
||||
// ?? useTable
|
||||
const state: BasicTableProps = reactive<BasicTableProps>({
|
||||
queryForm: {
|
||||
ruleType: ''
|
||||
@@ -208,7 +208,7 @@ const state: BasicTableProps = reactive<BasicTableProps>({
|
||||
item: 'records',
|
||||
totalCount: 'total'
|
||||
},
|
||||
createdIsNeed: true // 页面加载时自动获取数<EFBFBD><EFBFBD>?
|
||||
createdIsNeed: true // ???????????
|
||||
})
|
||||
|
||||
// table hook
|
||||
@@ -219,7 +219,7 @@ const {
|
||||
tableStyle: _tableStyle
|
||||
} = useTable(state)
|
||||
|
||||
// 格式化奖项类<EFBFBD><EFBFBD>?
|
||||
// ???????
|
||||
const formatRuleType = (value: string | number) => {
|
||||
if (value === null || value === undefined || value === '') {
|
||||
return '-'
|
||||
@@ -228,34 +228,34 @@ const formatRuleType = (value: string | number) => {
|
||||
return dictItem ? dictItem.label : value
|
||||
}
|
||||
|
||||
// 重置
|
||||
// ??
|
||||
const handleReset = () => {
|
||||
searchFormRef.value?.resetFields()
|
||||
state.queryForm.ruleType = ''
|
||||
getDataList()
|
||||
}
|
||||
|
||||
// 编辑
|
||||
// ??
|
||||
const handleEdit = (row: any) => {
|
||||
formDialogRef.value?.openDialog('edit', row)
|
||||
}
|
||||
|
||||
// 删除
|
||||
// ??
|
||||
const handleDelete = async (row: any) => {
|
||||
const { confirm } = useMessageBox()
|
||||
try {
|
||||
await confirm('确定要删除该评优评先奖项吗?')
|
||||
await confirm('??????????????')
|
||||
await delObj([row.id])
|
||||
useMessage().success('删除成功')
|
||||
useMessage().success('????')
|
||||
getDataList()
|
||||
} catch (err: any) {
|
||||
if (err !== 'cancel') {
|
||||
useMessage().error(err.msg || '删除失败')
|
||||
useMessage().error(err.msg || '????')
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// 获取奖项类型字典
|
||||
// ????????
|
||||
const getRuleTypeDict = async () => {
|
||||
try {
|
||||
const res = await getDicts('rule_type')
|
||||
@@ -272,7 +272,7 @@ const getRuleTypeDict = async () => {
|
||||
}
|
||||
}
|
||||
|
||||
// 初始<EFBFBD><EFBFBD>?
|
||||
// ???
|
||||
onMounted(() => {
|
||||
getRuleTypeDict()
|
||||
})
|
||||
|
||||
@@ -1,21 +1,21 @@
|
||||
<template>
|
||||
<div class="modern-page-container">
|
||||
<div class="page-wrapper">
|
||||
<!-- 搜索表单卡片 -->
|
||||
<!-- ?????? -->
|
||||
<el-card v-show="showSearch" class="search-card" shadow="never">
|
||||
<template #header>
|
||||
<div class="card-header">
|
||||
<span class="card-title">
|
||||
<el-icon class="title-icon"><Search /></el-icon>
|
||||
筛选条<EFBFBD><EFBFBD>?
|
||||
????
|
||||
</span>
|
||||
</div>
|
||||
</template>
|
||||
<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
|
||||
v-model="queryForm.deptCode"
|
||||
placeholder="请选择学院"
|
||||
placeholder="?????"
|
||||
clearable
|
||||
filterable
|
||||
style="width: 200px">
|
||||
@@ -27,10 +27,10 @@
|
||||
</el-option>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="班级" prop="classCode">
|
||||
<el-form-item label="??" prop="classCode">
|
||||
<el-select
|
||||
v-model="queryForm.classCode"
|
||||
placeholder="请选择班级"
|
||||
placeholder="?????"
|
||||
clearable
|
||||
filterable
|
||||
style="width: 200px">
|
||||
@@ -42,10 +42,10 @@
|
||||
</el-option>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="学年" prop="schoolYear">
|
||||
<el-form-item label="??" prop="schoolYear">
|
||||
<el-select
|
||||
v-model="queryForm.schoolYear"
|
||||
placeholder="请选择学年"
|
||||
placeholder="?????"
|
||||
clearable
|
||||
filterable
|
||||
style="width: 200px">
|
||||
@@ -57,10 +57,10 @@
|
||||
</el-option>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="学期" prop="schoolTerm">
|
||||
<el-form-item label="??" prop="schoolTerm">
|
||||
<el-select
|
||||
v-model="queryForm.schoolTerm"
|
||||
placeholder="请选择学期"
|
||||
placeholder="?????"
|
||||
clearable
|
||||
style="width: 200px">
|
||||
<el-option
|
||||
@@ -72,19 +72,19 @@
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item>
|
||||
<el-button type="primary" plain icon="Search" @click="getDataList">查询</el-button>
|
||||
<el-button icon="Refresh" @click="handleReset">重置</el-button>
|
||||
<el-button type="primary" plain icon="Search" @click="getDataList">??</el-button>
|
||||
<el-button icon="Refresh" @click="handleReset">??</el-button>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
</el-card>
|
||||
|
||||
<!-- 内容卡片 -->
|
||||
<!-- ???? -->
|
||||
<el-card class="content-card" shadow="never">
|
||||
<template #header>
|
||||
<div class="card-header">
|
||||
<span class="card-title">
|
||||
<el-icon class="title-icon"><Document /></el-icon>
|
||||
学生评优评先列表
|
||||
????
|
||||
</span>
|
||||
<div class="header-actions">
|
||||
<el-button
|
||||
@@ -92,7 +92,7 @@
|
||||
type="success"
|
||||
class="ml10"
|
||||
@click="handleExport">
|
||||
导出
|
||||
??
|
||||
</el-button>
|
||||
<right-toolbar
|
||||
v-model:showSearch="showSearch"
|
||||
@@ -108,7 +108,7 @@
|
||||
@order-change="handleColumnOrderChange"
|
||||
>
|
||||
<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-icon><Menu /></el-icon>
|
||||
</el-button>
|
||||
@@ -120,7 +120,7 @@
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<!-- 表格 -->
|
||||
<!-- ?? -->
|
||||
<el-table
|
||||
:data="dataList"
|
||||
v-loading="loading"
|
||||
@@ -128,7 +128,7 @@
|
||||
:cell-style="tableStyle.cellStyle"
|
||||
:header-cell-style="tableStyle.headerCellStyle"
|
||||
class="modern-table">
|
||||
<el-table-column type="index" label="序号" width="70" align="center">
|
||||
<el-table-column type="index" label="??" width="70" align="center">
|
||||
<template #header>
|
||||
<el-icon><List /></el-icon>
|
||||
</template>
|
||||
@@ -138,7 +138,7 @@
|
||||
</el-table-column>
|
||||
<template v-for="col in visibleColumnsSorted" :key="col.prop || col.label">
|
||||
<el-table-column
|
||||
v-if="checkColumnVisible(col.prop || '') && col.prop !== '操作'"
|
||||
v-if="checkColumnVisible(col.prop || '') && col.prop !== '??'"
|
||||
:prop="col.prop"
|
||||
:label="col.label"
|
||||
show-overflow-tooltip
|
||||
@@ -149,30 +149,30 @@
|
||||
<el-icon><component :is="columnConfigMap[col.prop]?.icon || OfficeBuilding" /></el-icon>
|
||||
<span style="margin-left: 4px">{{ col.label }}</span>
|
||||
</template>
|
||||
<!-- 操行平均分列特殊模板 -->
|
||||
<!-- ?????????? -->
|
||||
<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">
|
||||
{{ scope.row.averageConduct.toFixed(2) }}
|
||||
</el-tag>
|
||||
<span v-else>-</span>
|
||||
</template>
|
||||
<!-- 总评成绩平均分列特殊模板 -->
|
||||
<!-- ???????????? -->
|
||||
<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">
|
||||
{{ scope.row.averageScore.toFixed(2) }}
|
||||
</el-tag>
|
||||
<span v-else>-</span>
|
||||
</template>
|
||||
<!-- 个人奖项列特殊模<EFBFBD><EFBFBD>?-->
|
||||
<!-- ????????? -->
|
||||
<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">
|
||||
{{ scope.row.ruleName.join('<EFBFBD><EFBFBD>?) }}
|
||||
{{ scope.row.ruleName.join('?') }}
|
||||
</el-tag>
|
||||
<span v-else>-</span>
|
||||
</template>
|
||||
<!-- 保存时间列特殊模<EFBFBD><EFBFBD>?-->
|
||||
<!-- ????????? -->
|
||||
<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>
|
||||
</el-table-column>
|
||||
</template>
|
||||
@@ -194,10 +194,11 @@ import { useMessage } from "/@/hooks/message";
|
||||
import { parseTime } from "/@/utils/formatTime";
|
||||
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 { useTableColumnControl } from '/@/hooks/tableColumnControl'
|
||||
import { useTableColumnControl } from '/@/hooks/tableColumn'
|
||||
|
||||
const dateTimeFormat = '{y}-{m}-{d} {h}:{i}:{s}'
|
||||
|
||||
// 定义变量内容
|
||||
// ????
|
||||
const route = useRoute()
|
||||
const searchFormRef = ref()
|
||||
const columnControlRef = ref<any>()
|
||||
@@ -209,20 +210,20 @@ const schoolTermList = ref<any[]>([])
|
||||
const deptList = ref<any[]>([])
|
||||
const classList = ref<any[]>([])
|
||||
|
||||
// 表格列配<EFBFBD><EFBFBD>?
|
||||
// ?????
|
||||
const tableColumns = [
|
||||
{ prop: 'departName', label: '学院' },
|
||||
{ prop: 'classNo', label: '班级' },
|
||||
{ prop: 'stuNo', label: '学号' },
|
||||
{ prop: 'realName', label: '姓名' },
|
||||
{ prop: 'averageConduct', label: '操行平均<EFBFBD><EFBFBD>? },
|
||||
{ prop: 'averageScore', label: '总评成绩平均<EFBFBD><EFBFBD>? },
|
||||
{ prop: 'violation', label: '违规情况', minWidth: 150 },
|
||||
{ prop: 'ruleName', label: '个人奖项', minWidth: 200 },
|
||||
{ prop: 'upDateTime', label: '保存时间', width: 180 }
|
||||
{ prop: 'departName', label: '????' },
|
||||
{ prop: 'classNo', label: '??' },
|
||||
{ prop: 'stuNo', label: '??' },
|
||||
{ prop: 'realName', label: '??' },
|
||||
{ prop: 'averageConduct', label: '?????' },
|
||||
{ prop: 'averageScore', label: '???????' },
|
||||
{ prop: 'violation', label: '????', minWidth: 150 },
|
||||
{ prop: 'ruleName', label: '????', minWidth: 200 },
|
||||
{ prop: 'upDateTime', label: '????', width: 180 }
|
||||
]
|
||||
|
||||
// 列配置映射(用于图标<EFBFBD><EFBFBD>?
|
||||
// ?????????????
|
||||
const columnConfigMap: Record<string, { icon: any }> = {
|
||||
departName: { icon: OfficeBuilding },
|
||||
classNo: { icon: Grid },
|
||||
@@ -235,7 +236,7 @@ const columnConfigMap: Record<string, { icon: any }> = {
|
||||
upDateTime: { icon: Clock }
|
||||
}
|
||||
|
||||
// 使用表格列控制hook
|
||||
// ???????hook
|
||||
const {
|
||||
visibleColumns,
|
||||
visibleColumnsSorted,
|
||||
@@ -244,7 +245,7 @@ const {
|
||||
handleColumnOrderChange
|
||||
} = useTableColumnControl(tableColumns, route.path)
|
||||
|
||||
// 查询表单
|
||||
// ????
|
||||
const queryForm = reactive({
|
||||
deptCode: '',
|
||||
classCode: '',
|
||||
@@ -252,13 +253,13 @@ const queryForm = reactive({
|
||||
schoolTerm: ''
|
||||
})
|
||||
|
||||
// 表格样式
|
||||
// ????
|
||||
const tableStyle = {
|
||||
cellStyle: { padding: '8px 0' },
|
||||
headerCellStyle: { background: '#f5f7fa', color: '#606266', fontWeight: 'bold' }
|
||||
}
|
||||
|
||||
// 格式化学<EFBFBD><EFBFBD>?
|
||||
// ?????
|
||||
const formatSchoolTerm = (value: string | number) => {
|
||||
if (value === null || value === undefined || value === '') {
|
||||
return '-'
|
||||
@@ -267,7 +268,7 @@ const formatSchoolTerm = (value: string | number) => {
|
||||
return dictItem ? dictItem.label : value
|
||||
}
|
||||
|
||||
// 获取数据列表
|
||||
// ????
|
||||
const getDataList = async () => {
|
||||
loading.value = true
|
||||
try {
|
||||
@@ -278,14 +279,14 @@ const getDataList = async () => {
|
||||
dataList.value = []
|
||||
}
|
||||
} catch (err: any) {
|
||||
useMessage().error(err.msg || '获取数据列表失败')
|
||||
useMessage().error(err.msg || '??????')
|
||||
dataList.value = []
|
||||
} finally {
|
||||
loading.value = false
|
||||
}
|
||||
}
|
||||
|
||||
// 重置
|
||||
// ??
|
||||
const handleReset = () => {
|
||||
searchFormRef.value?.resetFields()
|
||||
queryForm.deptCode = ''
|
||||
@@ -295,43 +296,43 @@ const handleReset = () => {
|
||||
getDataList()
|
||||
}
|
||||
|
||||
// 导出
|
||||
// ??
|
||||
const handleExport = async () => {
|
||||
try {
|
||||
loading.value = true
|
||||
const res = await exportExcel(queryForm)
|
||||
|
||||
// 创建blob对象
|
||||
// ?? blob
|
||||
const blob = new Blob([res], {
|
||||
type: 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet'
|
||||
})
|
||||
|
||||
// 创建下载链接
|
||||
// ??????
|
||||
const url = window.URL.createObjectURL(blob)
|
||||
const link = document.createElement('a')
|
||||
link.href = url
|
||||
|
||||
// 设置文件<EFBFBD><EFBFBD>?
|
||||
const fileName = `学生评优评先_${new Date().getTime()}.xlsx`
|
||||
// ???
|
||||
const fileName = `??????_${new Date().getTime()}.xlsx`
|
||||
link.setAttribute('download', fileName)
|
||||
|
||||
// 触发下载
|
||||
// ????
|
||||
document.body.appendChild(link)
|
||||
link.click()
|
||||
|
||||
// 清理
|
||||
// ??
|
||||
document.body.removeChild(link)
|
||||
window.URL.revokeObjectURL(url)
|
||||
|
||||
useMessage().success('导出成功')
|
||||
useMessage().success('????')
|
||||
} catch (err: any) {
|
||||
useMessage().error(err.msg || '导出失败')
|
||||
useMessage().error(err.msg || '????')
|
||||
} finally {
|
||||
loading.value = false
|
||||
}
|
||||
}
|
||||
|
||||
// 获取学年列表
|
||||
// ??????
|
||||
const getSchoolYearList = async () => {
|
||||
try {
|
||||
const res = await queryAllSchoolYear()
|
||||
@@ -345,7 +346,7 @@ const getSchoolYearList = async () => {
|
||||
}
|
||||
}
|
||||
|
||||
// 获取学期字典
|
||||
// ??????
|
||||
const getSchoolTermDict = async () => {
|
||||
try {
|
||||
const res = await getDicts('school_term')
|
||||
@@ -362,7 +363,7 @@ const getSchoolTermDict = async () => {
|
||||
}
|
||||
}
|
||||
|
||||
// 获取学院列表
|
||||
// ??????
|
||||
const getDeptListData = async () => {
|
||||
try {
|
||||
const res = await getDeptList()
|
||||
@@ -376,7 +377,7 @@ const getDeptListData = async () => {
|
||||
}
|
||||
}
|
||||
|
||||
// 获取班级列表
|
||||
// ??????
|
||||
const getClassListData = async () => {
|
||||
try {
|
||||
const res = await getClassListByRole()
|
||||
@@ -390,7 +391,7 @@ const getClassListData = async () => {
|
||||
}
|
||||
}
|
||||
|
||||
// 初始<EFBFBD><EFBFBD>?
|
||||
// ????
|
||||
onMounted(() => {
|
||||
getSchoolYearList()
|
||||
getSchoolTermDict()
|
||||
|
||||
@@ -7,7 +7,7 @@
|
||||
<div class="card-header">
|
||||
<span class="card-title">
|
||||
<el-icon class="title-icon"><Search /></el-icon>
|
||||
筛选条<EFBFBD><EFBFBD>?
|
||||
筛选条件
|
||||
</span>
|
||||
</div>
|
||||
</template>
|
||||
@@ -54,7 +54,7 @@
|
||||
<div class="card-header">
|
||||
<span class="card-title">
|
||||
<el-icon class="title-icon"><Document /></el-icon>
|
||||
助学金批次列<EFBFBD><EFBFBD>?
|
||||
助学金批次列表
|
||||
</span>
|
||||
<div class="header-actions">
|
||||
<el-button
|
||||
@@ -77,7 +77,7 @@
|
||||
@order-change="handleColumnOrderChange"
|
||||
>
|
||||
<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-icon><Menu /></el-icon>
|
||||
</el-button>
|
||||
@@ -214,7 +214,7 @@ const schoolTermList = ref<any[]>([])
|
||||
const quarterList = ref<any[]>([])
|
||||
const classifyList = ref<any[]>([])
|
||||
|
||||
// 表格列配<EFBFBD><EFBFBD>?
|
||||
// 表格列配置
|
||||
const tableColumns = [
|
||||
{ prop: 'title', label: '批次名称', icon: Document, minWidth: 200 },
|
||||
{ prop: 'schoolYear', label: '学年', icon: Calendar, width: 120 },
|
||||
@@ -222,7 +222,7 @@ const tableColumns = [
|
||||
{ prop: 'type', label: '季度', icon: Timer, width: 100 },
|
||||
{ prop: 'classify', label: '类别', icon: Collection, width: 100 },
|
||||
{ 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: 'remarks', label: '备注', icon: EditPen, minWidth: 150 }
|
||||
]
|
||||
@@ -264,7 +264,7 @@ const {
|
||||
tableStyle: _tableStyle
|
||||
} = useTable(state)
|
||||
|
||||
// 格式化学<EFBFBD><EFBFBD>?
|
||||
// 格式化学期
|
||||
const formatSchoolTerm = (value: string | number) => {
|
||||
if (value === null || value === undefined || value === '') {
|
||||
return '-'
|
||||
@@ -273,7 +273,7 @@ const formatSchoolTerm = (value: string | number) => {
|
||||
return dictItem ? dictItem.label : value
|
||||
}
|
||||
|
||||
// 格式化季<EFBFBD><EFBFBD>?
|
||||
// 格式化季度
|
||||
const formatQuarter = (value: string | number) => {
|
||||
if (value === null || value === undefined || value === '') {
|
||||
return '-'
|
||||
@@ -282,7 +282,7 @@ const formatQuarter = (value: string | number) => {
|
||||
return dictItem ? dictItem.label : value
|
||||
}
|
||||
|
||||
// 格式化类<EFBFBD><EFBFBD>?
|
||||
// 格式化类别
|
||||
const formatClassify = (value: string | number) => {
|
||||
if (value === null || value === undefined || value === '') {
|
||||
return '-'
|
||||
@@ -313,7 +313,7 @@ const handleEdit = (row: any) => {
|
||||
const handleDelete = async (row: any) => {
|
||||
try {
|
||||
const { confirm } = useMessageBox()
|
||||
await confirm(`确定要删除批<E999A4><E689B9>?"${row.title}" 吗?`)
|
||||
await confirm(`确定要删除批次"${row.title}" 吗?`)
|
||||
await delObj([row.id])
|
||||
useMessage().success('删除成功')
|
||||
getDataList()
|
||||
@@ -389,7 +389,7 @@ const getClassifyDict = async () => {
|
||||
}
|
||||
}
|
||||
|
||||
// 初始<EFBFBD><EFBFBD>?
|
||||
// 初始化
|
||||
onMounted(() => {
|
||||
getSchoolYearList()
|
||||
getSchoolTermDict()
|
||||
|
||||
@@ -7,7 +7,7 @@
|
||||
<div class="card-header">
|
||||
<span class="card-title">
|
||||
<el-icon class="title-icon"><Search /></el-icon>
|
||||
筛选条<EFBFBD><EFBFBD>?
|
||||
筛选条件
|
||||
</span>
|
||||
</div>
|
||||
</template>
|
||||
@@ -34,10 +34,10 @@
|
||||
clearable
|
||||
style="width: 200px" />
|
||||
</el-form-item>
|
||||
<el-form-item label="所属类<EFBFBD><EFBFBD>? prop="type">
|
||||
<el-form-item label="所属类别" prop="type">
|
||||
<el-select
|
||||
v-model="state.queryForm.type"
|
||||
placeholder="请选择所属类<EFBFBD><EFBFBD>?
|
||||
placeholder="请选择所属类别"
|
||||
clearable
|
||||
style="width: 200px">
|
||||
<el-option
|
||||
@@ -84,7 +84,7 @@
|
||||
@order-change="handleColumnOrderChange"
|
||||
>
|
||||
<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-icon><Menu /></el-icon>
|
||||
</el-button>
|
||||
@@ -125,14 +125,14 @@
|
||||
<el-icon><component :is="columnConfigMap[col.prop]?.icon || Calendar" /></el-icon>
|
||||
<span style="margin-left: 4px">{{ col.label }}</span>
|
||||
</template>
|
||||
<!-- 人数列特殊模<EFBFBD><EFBFBD>?-->
|
||||
<!-- 人数列特殊模板 -->
|
||||
<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">
|
||||
{{ scope.row.num }}
|
||||
</el-tag>
|
||||
<span v-else>-</span>
|
||||
</template>
|
||||
<!-- 成立时间列特殊模<EFBFBD><EFBFBD>?-->
|
||||
<!-- 成立时间列特殊模板 -->
|
||||
<template v-else-if="col.prop === 'openTime'" #default="scope">
|
||||
<span>{{ parseTime(scope.row.openTime, '{y}-{m}-{d}') }}</span>
|
||||
</template>
|
||||
@@ -222,21 +222,21 @@ const showSearch = ref(true)
|
||||
const deptList = ref<any[]>([])
|
||||
const typeList = ref<any[]>([])
|
||||
|
||||
// 表格列配<EFBFBD><EFBFBD>?
|
||||
// 表格列配置
|
||||
const tableColumns = [
|
||||
{ prop: 'associationName', label: '社团名称', minWidth: 200 },
|
||||
{ prop: 'deptName', label: '学院', minWidth: 150 },
|
||||
{ prop: 'teacherRealName', label: '指导老师姓名', width: 120 },
|
||||
{ prop: 'maintainer', label: '负责<EFBFBD><EFBFBD>?, width: 100 },
|
||||
{ prop: 'maintainer', label: '负责人', width: 100 },
|
||||
{ prop: 'num', label: '人数', width: 80 },
|
||||
{ prop: 'openTime', 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: 'ruleNote', label: '社团章程', minWidth: 200 }
|
||||
]
|
||||
|
||||
// 列配置映射(用于图标<EFBFBD><EFBFBD>?
|
||||
// 列配置映射(用于图标显示)
|
||||
const columnConfigMap: Record<string, { icon: any }> = {
|
||||
associationName: { icon: Trophy },
|
||||
deptName: { icon: OfficeBuilding },
|
||||
@@ -277,7 +277,7 @@ const state: BasicTableProps = reactive<BasicTableProps>({
|
||||
item: 'records',
|
||||
totalCount: 'total'
|
||||
},
|
||||
createdIsNeed: true // 页面加载时自动获取数<EFBFBD><EFBFBD>?
|
||||
createdIsNeed: true // 页面加载时自动获取数据
|
||||
})
|
||||
|
||||
// table hook
|
||||
@@ -288,7 +288,7 @@ const {
|
||||
tableStyle: _tableStyle
|
||||
} = useTable(state)
|
||||
|
||||
// 格式化类<EFBFBD><EFBFBD>?
|
||||
// 格式化类别
|
||||
const formatType = (value: string | number) => {
|
||||
if (value === null || value === undefined || value === '') {
|
||||
return '-'
|
||||
@@ -362,7 +362,7 @@ const getTypeDict = async () => {
|
||||
}
|
||||
}
|
||||
|
||||
// 初始<EFBFBD><EFBFBD>?
|
||||
// 初始化
|
||||
onMounted(() => {
|
||||
getDeptListData()
|
||||
getTypeDict()
|
||||
|
||||
@@ -1,21 +1,21 @@
|
||||
<template>
|
||||
<div class="modern-page-container">
|
||||
<div class="page-wrapper">
|
||||
<!-- 搜索表单卡片 -->
|
||||
<!-- ?????? -->
|
||||
<el-card v-show="showSearch" class="search-card" shadow="never">
|
||||
<template #header>
|
||||
<div class="card-header">
|
||||
<span class="card-title">
|
||||
<el-icon class="title-icon"><Search /></el-icon>
|
||||
筛选条<EFBFBD><EFBFBD>?
|
||||
????
|
||||
</span>
|
||||
</div>
|
||||
</template>
|
||||
<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
|
||||
v-model="state.queryForm.schoolYear"
|
||||
placeholder="请选择学年"
|
||||
placeholder="?????"
|
||||
clearable
|
||||
filterable
|
||||
style="width: 200px">
|
||||
@@ -27,10 +27,10 @@
|
||||
</el-option>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="学期" prop="schoolTerm">
|
||||
<el-form-item label="??" prop="schoolTerm">
|
||||
<el-select
|
||||
v-model="state.queryForm.schoolTerm"
|
||||
placeholder="请选择学期"
|
||||
placeholder="?????"
|
||||
clearable
|
||||
style="width: 200px">
|
||||
<el-option
|
||||
@@ -41,10 +41,10 @@
|
||||
</el-option>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="学院" prop="deptCode">
|
||||
<el-form-item label="??" prop="deptCode">
|
||||
<el-select
|
||||
v-model="state.queryForm.deptCode"
|
||||
placeholder="请选择学院"
|
||||
placeholder="?????"
|
||||
clearable
|
||||
filterable
|
||||
style="width: 200px">
|
||||
@@ -56,10 +56,10 @@
|
||||
</el-option>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="班级" prop="classCode">
|
||||
<el-form-item label="??" prop="classCode">
|
||||
<el-select
|
||||
v-model="state.queryForm.classCode"
|
||||
placeholder="请选择班级"
|
||||
placeholder="?????"
|
||||
clearable
|
||||
filterable
|
||||
style="width: 200px">
|
||||
@@ -71,41 +71,41 @@
|
||||
</el-option>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="姓名" prop="realName">
|
||||
<el-form-item label="??" prop="realName">
|
||||
<el-input
|
||||
v-model="state.queryForm.realName"
|
||||
placeholder="请输入姓<EFBFBD><EFBFBD>?
|
||||
placeholder="?????"
|
||||
clearable
|
||||
style="width: 200px" />
|
||||
</el-form-item>
|
||||
<el-form-item label="学号" prop="stuNo">
|
||||
<el-form-item label="??" prop="stuNo">
|
||||
<el-input
|
||||
v-model="state.queryForm.stuNo"
|
||||
placeholder="请输入学<EFBFBD><EFBFBD>?
|
||||
placeholder="?????"
|
||||
clearable
|
||||
style="width: 200px" />
|
||||
</el-form-item>
|
||||
<el-form-item>
|
||||
<el-button type="primary" plain icon="Search" @click="getDataList">查询</el-button>
|
||||
<el-button icon="Refresh" @click="handleReset">重置</el-button>
|
||||
<el-button type="primary" plain icon="Search" @click="getDataList">??</el-button>
|
||||
<el-button icon="Refresh" @click="handleReset">??</el-button>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
</el-card>
|
||||
|
||||
<!-- 内容卡片 -->
|
||||
<!-- ???? -->
|
||||
<el-card class="content-card" shadow="never">
|
||||
<template #header>
|
||||
<div class="card-header">
|
||||
<span class="card-title">
|
||||
<el-icon class="title-icon"><Document /></el-icon>
|
||||
学生关爱记录列表
|
||||
????????
|
||||
</span>
|
||||
<div class="header-actions">
|
||||
<el-button
|
||||
icon="Plus"
|
||||
type="primary"
|
||||
@click="formDialogRef.openDialog()">
|
||||
新增
|
||||
??
|
||||
</el-button>
|
||||
<right-toolbar
|
||||
v-model:showSearch="showSearch"
|
||||
@@ -121,7 +121,7 @@
|
||||
@order-change="handleColumnOrderChange"
|
||||
>
|
||||
<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-icon><Menu /></el-icon>
|
||||
</el-button>
|
||||
@@ -133,7 +133,7 @@
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<!-- 表格 -->
|
||||
<!-- ?? -->
|
||||
<el-table
|
||||
:data="state.dataList"
|
||||
v-loading="state.loading"
|
||||
@@ -141,7 +141,7 @@
|
||||
:cell-style="tableStyle.cellStyle"
|
||||
:header-cell-style="tableStyle.headerCellStyle"
|
||||
class="modern-table">
|
||||
<el-table-column type="index" label="序号" width="70" align="center">
|
||||
<el-table-column type="index" label="??" width="70" align="center">
|
||||
<template #header>
|
||||
<el-icon><List /></el-icon>
|
||||
</template>
|
||||
@@ -151,7 +151,7 @@
|
||||
</el-table-column>
|
||||
<template v-for="col in visibleColumnsSorted" :key="col.prop || col.label">
|
||||
<el-table-column
|
||||
v-if="checkColumnVisible(col.prop || '') && col.prop !== '操作'"
|
||||
v-if="checkColumnVisible(col.prop || '') && col.prop !== '??'"
|
||||
:prop="col.prop"
|
||||
:label="col.label"
|
||||
show-overflow-tooltip
|
||||
@@ -162,32 +162,32 @@
|
||||
<el-icon><component :is="columnConfigMap[col.prop]?.icon || Calendar" /></el-icon>
|
||||
<span style="margin-left: 4px">{{ col.label }}</span>
|
||||
</template>
|
||||
<!-- 学期列特殊模<EFBFBD><EFBFBD>?-->
|
||||
<!-- ??????? -->
|
||||
<template v-if="col.prop === 'schoolTerm'" #default="scope">
|
||||
<el-tag size="small" type="primary" effect="plain">
|
||||
{{ formatSchoolTerm(scope.row.schoolTerm) }}
|
||||
</el-tag>
|
||||
</template>
|
||||
<!-- 需关爱类型列特殊模<EFBFBD><EFBFBD>?-->
|
||||
<!-- ?????????? -->
|
||||
<template v-else-if="col.prop === 'careType'" #default="scope">
|
||||
<el-tag size="small" type="danger" effect="plain">
|
||||
{{ formatCareType(scope.row.careType) }}
|
||||
</el-tag>
|
||||
</template>
|
||||
<!-- 记录时间列特殊模<EFBFBD><EFBFBD>?-->
|
||||
<!-- ????????? -->
|
||||
<template v-else-if="col.prop === 'recordDate'" #default="scope">
|
||||
<span>{{ scope.row.recordDate || '-' }}</span>
|
||||
</template>
|
||||
<!-- 干预结果列特殊模<EFBFBD><EFBFBD>?-->
|
||||
<!-- ????????? -->
|
||||
<template v-else-if="col.prop === 'result'" #default="scope">
|
||||
<span>{{ scope.row.result || '-' }}</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</template>
|
||||
<el-table-column label="操作" width="250" align="center" fixed="right">
|
||||
<el-table-column label="??" width="250" align="center" fixed="right">
|
||||
<template #header>
|
||||
<el-icon><Setting /></el-icon>
|
||||
<span style="margin-left: 4px">操作</span>
|
||||
<span style="margin-left: 4px">??</span>
|
||||
</template>
|
||||
<template #default="scope">
|
||||
<el-button
|
||||
@@ -195,27 +195,27 @@
|
||||
link
|
||||
type="primary"
|
||||
@click="handleEdit(scope.row)">
|
||||
编辑
|
||||
??
|
||||
</el-button>
|
||||
<el-button
|
||||
icon="Document"
|
||||
link
|
||||
type="success"
|
||||
@click="handleResult(scope.row)">
|
||||
干预结果
|
||||
????
|
||||
</el-button>
|
||||
<el-button
|
||||
icon="Delete"
|
||||
link
|
||||
type="danger"
|
||||
@click="handleDelete(scope.row)">
|
||||
删除
|
||||
??
|
||||
</el-button>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
|
||||
<!-- 分页 -->
|
||||
<!-- ?? -->
|
||||
<div class="pagination-wrapper">
|
||||
<pagination
|
||||
@size-change="sizeChangeHandle"
|
||||
@@ -225,10 +225,10 @@
|
||||
</el-card>
|
||||
</div>
|
||||
|
||||
<!-- 新增/编辑表单弹窗 -->
|
||||
<!-- ??/?????? -->
|
||||
<form-dialog ref="formDialogRef" @refresh="getDataList" />
|
||||
|
||||
<!-- 干预结果弹窗 -->
|
||||
<!-- ?????? -->
|
||||
<result-dialog ref="resultDialogRef" @refresh="getDataList" />
|
||||
</div>
|
||||
</template>
|
||||
@@ -246,11 +246,11 @@ import { useMessage, useMessageBox } from "/@/hooks/message";
|
||||
import TableColumnControl from '/@/components/TableColumnControl/index.vue'
|
||||
import FormDialog from './form.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 { useTableColumnControl } from '/@/hooks/tableColumnControl'
|
||||
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/tableColumn'
|
||||
|
||||
|
||||
// 定义变量内容
|
||||
// ??????
|
||||
const route = useRoute()
|
||||
const formDialogRef = ref()
|
||||
const resultDialogRef = ref()
|
||||
@@ -263,22 +263,22 @@ const deptList = ref<any[]>([])
|
||||
const classList = ref<any[]>([])
|
||||
const careTypeList = ref<any[]>([])
|
||||
|
||||
// 表格列配<EFBFBD><EFBFBD>?
|
||||
// ?????
|
||||
const tableColumns = [
|
||||
{ prop: 'schoolYear', label: '学年' },
|
||||
{ prop: 'schoolTerm', label: '学期' },
|
||||
{ prop: 'deptName', label: '学院' },
|
||||
{ prop: 'classNo', label: '班级' },
|
||||
{ prop: 'realName', label: '姓名' },
|
||||
{ prop: 'teacherRealName', label: '班主任姓<EFBFBD><EFBFBD>? },
|
||||
{ prop: 'teacherTel', label: '班主任电<EFBFBD><EFBFBD>? },
|
||||
{ prop: 'careType', label: '需关爱类型' },
|
||||
{ prop: 'present', label: '危机表现', minWidth: 150 },
|
||||
{ prop: 'recordDate', label: '记录时间', width: 120 },
|
||||
{ prop: 'result', label: '干预结果', minWidth: 150 }
|
||||
{ prop: 'schoolYear', label: '??' },
|
||||
{ prop: 'schoolTerm', label: '??' },
|
||||
{ prop: 'deptName', label: '??' },
|
||||
{ prop: 'classNo', label: '??' },
|
||||
{ prop: 'realName', label: '??' },
|
||||
{ prop: 'teacherRealName', label: '?????' },
|
||||
{ prop: 'teacherTel', label: '?????' },
|
||||
{ prop: 'careType', label: '?????' },
|
||||
{ prop: 'present', label: '????', minWidth: 150 },
|
||||
{ prop: 'recordDate', label: '????', width: 120 },
|
||||
{ prop: 'result', label: '????', minWidth: 150 }
|
||||
]
|
||||
|
||||
// 列配置映射(用于图标<EFBFBD><EFBFBD>?
|
||||
// ?????????????
|
||||
const columnConfigMap: Record<string, { icon: any }> = {
|
||||
schoolYear: { icon: Calendar },
|
||||
schoolTerm: { icon: Clock },
|
||||
@@ -287,13 +287,13 @@ const columnConfigMap: Record<string, { icon: any }> = {
|
||||
realName: { icon: Avatar },
|
||||
teacherRealName: { icon: UserFilled },
|
||||
teacherTel: { icon: Phone },
|
||||
careType: { icon: Heart },
|
||||
careType: { icon: Star },
|
||||
present: { icon: Warning },
|
||||
recordDate: { icon: Calendar },
|
||||
result: { icon: CircleCheck }
|
||||
}
|
||||
|
||||
// 使用表格列控制hook
|
||||
// ???????hook
|
||||
const {
|
||||
visibleColumns,
|
||||
visibleColumnsSorted,
|
||||
@@ -302,7 +302,7 @@ const {
|
||||
handleColumnOrderChange
|
||||
} = useTableColumnControl(tableColumns, route.path)
|
||||
|
||||
// 配置 useTable
|
||||
// ?? useTable
|
||||
const state: BasicTableProps = reactive<BasicTableProps>({
|
||||
queryForm: {
|
||||
schoolYear: '',
|
||||
@@ -328,7 +328,7 @@ const {
|
||||
tableStyle
|
||||
} = useTable(state)
|
||||
|
||||
// 格式化学<EFBFBD><EFBFBD>?
|
||||
// ?????
|
||||
const formatSchoolTerm = (value: string | number) => {
|
||||
if (value === null || value === undefined || value === '') {
|
||||
return '-'
|
||||
@@ -337,14 +337,14 @@ const formatSchoolTerm = (value: string | number) => {
|
||||
return dictItem ? dictItem.label : value
|
||||
}
|
||||
|
||||
// 格式化需关爱类型
|
||||
// ????????
|
||||
const formatCareType = (value: string) => {
|
||||
if (!value) return '-'
|
||||
const item = careTypeList.value.find((item: any) => item.value === value)
|
||||
return item ? item.label : value
|
||||
}
|
||||
|
||||
// 重置
|
||||
// ??
|
||||
const handleReset = () => {
|
||||
searchFormRef.value?.resetFields()
|
||||
state.queryForm.schoolYear = ''
|
||||
@@ -356,32 +356,32 @@ const handleReset = () => {
|
||||
getDataList()
|
||||
}
|
||||
|
||||
// 编辑
|
||||
// ??
|
||||
const handleEdit = (row: any) => {
|
||||
formDialogRef.value?.openDialog('edit', row)
|
||||
}
|
||||
|
||||
// 干预结果
|
||||
// ????
|
||||
const handleResult = (row: any) => {
|
||||
resultDialogRef.value?.openDialog(row)
|
||||
}
|
||||
|
||||
// 删除
|
||||
// ??
|
||||
const handleDelete = async (row: any) => {
|
||||
const { confirm } = useMessageBox()
|
||||
try {
|
||||
await confirm('确定要删除该心理健康记录吗?')
|
||||
await confirm('??????????????')
|
||||
await delObj([row.id])
|
||||
useMessage().success('删除成功')
|
||||
useMessage().success('????')
|
||||
getDataList()
|
||||
} catch (err: any) {
|
||||
if (err !== 'cancel') {
|
||||
useMessage().error(err.msg || '删除失败')
|
||||
useMessage().error(err.msg || '????')
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// 获取学年列表
|
||||
// ??????
|
||||
const getSchoolYearList = async () => {
|
||||
try {
|
||||
const res = await queryAllSchoolYear()
|
||||
@@ -395,7 +395,7 @@ const getSchoolYearList = async () => {
|
||||
}
|
||||
}
|
||||
|
||||
// 获取学期字典
|
||||
// ??????
|
||||
const getSchoolTermDict = async () => {
|
||||
try {
|
||||
const res = await getDicts('school_term')
|
||||
@@ -412,7 +412,7 @@ const getSchoolTermDict = async () => {
|
||||
}
|
||||
}
|
||||
|
||||
// 获取学院列表
|
||||
// ??????
|
||||
const getDeptListData = async () => {
|
||||
try {
|
||||
const res = await getDeptList()
|
||||
@@ -426,7 +426,7 @@ const getDeptListData = async () => {
|
||||
}
|
||||
}
|
||||
|
||||
// 获取班级列表
|
||||
// ??????
|
||||
const getClassListData = async () => {
|
||||
try {
|
||||
const res = await getClassListByRole()
|
||||
@@ -440,7 +440,7 @@ const getClassListData = async () => {
|
||||
}
|
||||
}
|
||||
|
||||
// 获取需关爱类型字典
|
||||
// ?????????
|
||||
const getCareTypeDict = async () => {
|
||||
try {
|
||||
const res = await getDicts('stu_care_type')
|
||||
@@ -457,7 +457,7 @@ const getCareTypeDict = async () => {
|
||||
}
|
||||
}
|
||||
|
||||
// 初始<EFBFBD><EFBFBD>?
|
||||
// ???
|
||||
onMounted(() => {
|
||||
getSchoolYearList()
|
||||
getSchoolTermDict()
|
||||
|
||||
@@ -1,21 +1,21 @@
|
||||
<template>
|
||||
<div class="modern-page-container">
|
||||
<div class="page-wrapper">
|
||||
<!-- 搜索表单卡片 -->
|
||||
<!-- ?????? -->
|
||||
<el-card v-show="showSearch" class="search-card" shadow="never">
|
||||
<template #header>
|
||||
<div class="card-header">
|
||||
<span class="card-title">
|
||||
<el-icon class="title-icon"><Search /></el-icon>
|
||||
筛选条<EFBFBD><EFBFBD>?
|
||||
????
|
||||
</span>
|
||||
</div>
|
||||
</template>
|
||||
<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
|
||||
v-model="state.queryForm.schoolYear"
|
||||
placeholder="请选择学年"
|
||||
placeholder="?????"
|
||||
clearable
|
||||
filterable
|
||||
style="width: 200px">
|
||||
@@ -27,10 +27,10 @@
|
||||
</el-option>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="学期" prop="schoolTerm">
|
||||
<el-form-item label="??" prop="schoolTerm">
|
||||
<el-select
|
||||
v-model="state.queryForm.schoolTerm"
|
||||
placeholder="请选择学期"
|
||||
placeholder="?????"
|
||||
clearable
|
||||
style="width: 200px">
|
||||
<el-option
|
||||
@@ -41,10 +41,10 @@
|
||||
</el-option>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="学院" prop="deptCode">
|
||||
<el-form-item label="??" prop="deptCode">
|
||||
<el-select
|
||||
v-model="state.queryForm.deptCode"
|
||||
placeholder="请选择学院"
|
||||
placeholder="?????"
|
||||
clearable
|
||||
filterable
|
||||
style="width: 200px"
|
||||
@@ -57,10 +57,10 @@
|
||||
</el-option>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="班级" prop="classCode">
|
||||
<el-form-item label="??" prop="classCode">
|
||||
<el-select
|
||||
v-model="state.queryForm.classCode"
|
||||
placeholder="请选择班级"
|
||||
placeholder="?????"
|
||||
clearable
|
||||
filterable
|
||||
style="width: 200px">
|
||||
@@ -72,17 +72,17 @@
|
||||
</el-option>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="姓名" prop="realName">
|
||||
<el-form-item label="??" prop="realName">
|
||||
<el-input
|
||||
v-model="state.queryForm.realName"
|
||||
placeholder="请输入姓<EFBFBD><EFBFBD>?
|
||||
placeholder="?????"
|
||||
clearable
|
||||
style="width: 200px" />
|
||||
</el-form-item>
|
||||
<el-form-item label="类型" prop="conductType">
|
||||
<el-form-item label="??" prop="conductType">
|
||||
<el-select
|
||||
v-model="state.queryForm.conductType"
|
||||
placeholder="请选择类型"
|
||||
placeholder="?????"
|
||||
clearable
|
||||
style="width: 200px">
|
||||
<el-option
|
||||
@@ -94,33 +94,33 @@
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item>
|
||||
<el-button type="primary" plain icon="Search" @click="getDataList">查询</el-button>
|
||||
<el-button icon="Refresh" @click="handleReset">重置</el-button>
|
||||
<el-button type="primary" plain icon="Search" @click="getDataList">??</el-button>
|
||||
<el-button icon="Refresh" @click="handleReset">??</el-button>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
</el-card>
|
||||
|
||||
<!-- 内容卡片 -->
|
||||
<!-- ???? -->
|
||||
<el-card class="content-card" shadow="never">
|
||||
<template #header>
|
||||
<div class="card-header">
|
||||
<span class="card-title">
|
||||
<el-icon class="title-icon"><Document /></el-icon>
|
||||
学生操行记录列表
|
||||
????????
|
||||
</span>
|
||||
<div class="header-actions">
|
||||
<el-button
|
||||
icon="Plus"
|
||||
type="primary"
|
||||
@click="formDialogRef.openDialog()">
|
||||
新增
|
||||
??
|
||||
</el-button>
|
||||
<el-button
|
||||
icon="Upload"
|
||||
type="success"
|
||||
class="ml10"
|
||||
@click="handleImport">
|
||||
导入
|
||||
??
|
||||
</el-button>
|
||||
<right-toolbar
|
||||
v-model:showSearch="showSearch"
|
||||
@@ -136,7 +136,7 @@
|
||||
@order-change="handleColumnOrderChange"
|
||||
>
|
||||
<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-icon><Menu /></el-icon>
|
||||
</el-button>
|
||||
@@ -148,7 +148,7 @@
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<!-- 表格 -->
|
||||
<!-- ?? -->
|
||||
<el-table
|
||||
:data="state.dataList"
|
||||
v-loading="state.loading"
|
||||
@@ -156,7 +156,7 @@
|
||||
:cell-style="tableStyle.cellStyle"
|
||||
:header-cell-style="tableStyle.headerCellStyle"
|
||||
class="modern-table">
|
||||
<el-table-column type="index" label="序号" width="70" align="center">
|
||||
<el-table-column type="index" label="??" width="70" align="center">
|
||||
<template #header>
|
||||
<el-icon><List /></el-icon>
|
||||
</template>
|
||||
@@ -166,7 +166,7 @@
|
||||
</el-table-column>
|
||||
<template v-for="col in visibleColumnsSorted" :key="col.prop || col.label">
|
||||
<el-table-column
|
||||
v-if="checkColumnVisible(col.prop || '') && col.prop !== '操作'"
|
||||
v-if="checkColumnVisible(col.prop || '') && col.prop !== '??'"
|
||||
:prop="col.prop"
|
||||
:label="col.label"
|
||||
show-overflow-tooltip
|
||||
@@ -177,23 +177,23 @@
|
||||
<el-icon><component :is="columnConfigMap[col.prop]?.icon || Calendar" /></el-icon>
|
||||
<span style="margin-left: 4px">{{ col.label }}</span>
|
||||
</template>
|
||||
<!-- 学期列特殊模<EFBFBD><EFBFBD>?-->
|
||||
<!-- ??????? -->
|
||||
<template v-if="col.prop === 'schoolTerm'" #default="scope">
|
||||
<el-tag size="small" type="primary" effect="plain">
|
||||
{{ formatSchoolTerm(scope.row.schoolTerm) }}
|
||||
</el-tag>
|
||||
</template>
|
||||
<!-- 类型列特殊模<EFBFBD><EFBFBD>?-->
|
||||
<!-- ??????? -->
|
||||
<template v-else-if="col.prop === 'conductType'" #default="scope">
|
||||
<el-tag size="small" type="warning" effect="plain">
|
||||
{{ formatType(scope.row.conductType) }}
|
||||
</el-tag>
|
||||
</template>
|
||||
<!-- 考核时间列特殊模<EFBFBD><EFBFBD>?-->
|
||||
<!-- ????????? -->
|
||||
<template v-else-if="col.prop === 'recordDate'" #default="scope">
|
||||
<span>{{ scope.row.recordDate || '-' }}</span>
|
||||
</template>
|
||||
<!-- 附件列特殊模<EFBFBD><EFBFBD>?-->
|
||||
<!-- ??????? -->
|
||||
<template v-else-if="col.prop === 'attachment'" #default="scope">
|
||||
<el-button
|
||||
v-if="scope.row.attachment"
|
||||
@@ -202,16 +202,16 @@
|
||||
type="primary"
|
||||
size="small"
|
||||
@click="handleViewAttachment(scope.row)">
|
||||
查看
|
||||
??
|
||||
</el-button>
|
||||
<span v-else>-</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</template>
|
||||
<el-table-column label="操作" width="150" align="center" fixed="right">
|
||||
<el-table-column label="??" width="150" align="center" fixed="right">
|
||||
<template #header>
|
||||
<el-icon><Setting /></el-icon>
|
||||
<span style="margin-left: 4px">操作</span>
|
||||
<span style="margin-left: 4px">??</span>
|
||||
</template>
|
||||
<template #default="scope">
|
||||
<el-button
|
||||
@@ -219,20 +219,20 @@
|
||||
link
|
||||
type="primary"
|
||||
@click="handleEdit(scope.row)">
|
||||
编辑
|
||||
??
|
||||
</el-button>
|
||||
<el-button
|
||||
icon="Delete"
|
||||
link
|
||||
type="danger"
|
||||
@click="handleDelete(scope.row)">
|
||||
删除
|
||||
??
|
||||
</el-button>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
|
||||
<!-- 分页 -->
|
||||
<!-- ?? -->
|
||||
<div class="pagination-wrapper">
|
||||
<pagination
|
||||
@size-change="sizeChangeHandle"
|
||||
@@ -242,12 +242,12 @@
|
||||
</el-card>
|
||||
</div>
|
||||
|
||||
<!-- 新增/编辑表单弹窗 -->
|
||||
<!-- ??/?????? -->
|
||||
<form-dialog ref="formDialogRef" @refresh="getDataList" />
|
||||
|
||||
<!-- 导入弹窗 -->
|
||||
<!-- ???? -->
|
||||
<el-dialog
|
||||
title="导入操行考核"
|
||||
title="??????"
|
||||
v-model="importDialogVisible"
|
||||
:width="500"
|
||||
:close-on-click-modal="false"
|
||||
@@ -261,18 +261,18 @@
|
||||
drag>
|
||||
<el-icon class="el-icon--upload"><upload-filled /></el-icon>
|
||||
<div class="el-upload__text">
|
||||
将文件拖到此处,<EFBFBD><EFBFBD>?em>点击上传</em>
|
||||
????????<em>????</em>
|
||||
</div>
|
||||
<template #tip>
|
||||
<div class="el-upload__tip">
|
||||
只能上传 xlsx/xls 文件
|
||||
???? xlsx/xls ??
|
||||
</div>
|
||||
</template>
|
||||
</el-upload>
|
||||
<template #footer>
|
||||
<span class="dialog-footer">
|
||||
<el-button @click="importDialogVisible = false"><EFBFBD><EFBFBD>?<EFBFBD><EFBFBD>?/el-button>
|
||||
<el-button type="primary" @click="handleImportSubmit" :disabled="!importFile || importLoading"><EFBFBD><EFBFBD>?<EFBFBD><EFBFBD>?/el-button>
|
||||
<el-button @click="importDialogVisible = false">??</el-button>
|
||||
<el-button type="primary" @click="handleImportSubmit" :disabled="!importFile || importLoading">??</el-button>
|
||||
</span>
|
||||
</template>
|
||||
</el-dialog>
|
||||
@@ -291,11 +291,11 @@ import { getDicts } from "/@/api/admin/dict";
|
||||
import { useMessage, useMessageBox } from "/@/hooks/message";
|
||||
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 { useTableColumnControl } from '/@/hooks/tableColumnControl'
|
||||
import { useTableColumnControl } from '/@/hooks/tableColumn'
|
||||
|
||||
import FormDialog from './form.vue'
|
||||
|
||||
// 定义变量内容
|
||||
// ??????
|
||||
const route = useRoute()
|
||||
const formDialogRef = ref()
|
||||
const columnControlRef = ref<any>()
|
||||
@@ -311,21 +311,21 @@ const importDialogVisible = ref(false)
|
||||
const importFile = ref<File | null>(null)
|
||||
const importLoading = ref(false)
|
||||
|
||||
// 表格列配<EFBFBD><EFBFBD>?
|
||||
// ?????
|
||||
const tableColumns = [
|
||||
{ prop: 'stuNo', label: '学号' },
|
||||
{ prop: 'schoolYear', label: '学年' },
|
||||
{ prop: 'schoolTerm', label: '学期' },
|
||||
{ prop: 'deptName', label: '学院' },
|
||||
{ prop: 'classNo', label: '班级' },
|
||||
{ prop: 'realName', label: '姓名' },
|
||||
{ prop: 'conductType', label: '类型' },
|
||||
{ prop: 'recordDate', label: '考核时间', width: 120 },
|
||||
{ prop: 'description', label: '情况记录', minWidth: 150 },
|
||||
{ prop: 'attachment', label: '附件', width: 100 }
|
||||
{ prop: 'stuNo', label: '??' },
|
||||
{ prop: 'schoolYear', label: '??' },
|
||||
{ prop: 'schoolTerm', label: '??' },
|
||||
{ prop: 'deptName', label: '??' },
|
||||
{ prop: 'classNo', label: '??' },
|
||||
{ prop: 'realName', label: '??' },
|
||||
{ prop: 'conductType', label: '??' },
|
||||
{ prop: 'recordDate', label: '????', width: 120 },
|
||||
{ prop: 'description', label: '????', minWidth: 150 },
|
||||
{ prop: 'attachment', label: '??', width: 100 }
|
||||
]
|
||||
|
||||
// 列配置映射(用于图标<EFBFBD><EFBFBD>?
|
||||
// ????????????
|
||||
const columnConfigMap: Record<string, { icon: any }> = {
|
||||
stuNo: { icon: CreditCard },
|
||||
schoolYear: { icon: Calendar },
|
||||
@@ -339,7 +339,7 @@ const columnConfigMap: Record<string, { icon: any }> = {
|
||||
attachment: { icon: Document }
|
||||
}
|
||||
|
||||
// 使用表格列控制hook
|
||||
// ???????hook
|
||||
const {
|
||||
visibleColumns,
|
||||
visibleColumnsSorted,
|
||||
@@ -348,7 +348,7 @@ const {
|
||||
handleColumnOrderChange
|
||||
} = useTableColumnControl(tableColumns, route.path)
|
||||
|
||||
// 配置 useTable
|
||||
// ?? useTable
|
||||
const state: BasicTableProps = reactive<BasicTableProps>({
|
||||
queryForm: {
|
||||
schoolYear: '',
|
||||
@@ -374,7 +374,7 @@ const {
|
||||
tableStyle
|
||||
} = useTable(state)
|
||||
|
||||
// 格式化学<EFBFBD><EFBFBD>?
|
||||
// ?????
|
||||
const formatSchoolTerm = (value: string | number) => {
|
||||
if (value === null || value === undefined || value === '') {
|
||||
return '-'
|
||||
@@ -383,19 +383,19 @@ const formatSchoolTerm = (value: string | number) => {
|
||||
return dictItem ? dictItem.label : value
|
||||
}
|
||||
|
||||
// 格式化类<EFBFBD><EFBFBD>?
|
||||
// ?????
|
||||
const formatType = (value: string) => {
|
||||
if (!value) return '-'
|
||||
const item = typeList.value.find((item: any) => item.value === value)
|
||||
return item ? item.label : value
|
||||
}
|
||||
|
||||
// 学院变化
|
||||
// ????
|
||||
const handleDeptChange = () => {
|
||||
// 可以根据学院筛选班级,这里暂时不实<EFBFBD><EFBFBD>?
|
||||
// ??????????????????
|
||||
}
|
||||
|
||||
// 重置
|
||||
// ??
|
||||
const handleReset = () => {
|
||||
searchFormRef.value?.resetFields()
|
||||
state.queryForm.schoolYear = ''
|
||||
@@ -407,7 +407,7 @@ const handleReset = () => {
|
||||
getDataList()
|
||||
}
|
||||
|
||||
// 查看附件
|
||||
// ????
|
||||
const handleViewAttachment = (row: any) => {
|
||||
if (row.attachment) {
|
||||
const urls = typeof row.attachment === 'string' ? row.attachment.split(',') : [row.attachment]
|
||||
@@ -419,61 +419,61 @@ const handleViewAttachment = (row: any) => {
|
||||
}
|
||||
}
|
||||
|
||||
// 导入
|
||||
// ??
|
||||
const handleImport = () => {
|
||||
importDialogVisible.value = true
|
||||
importFile.value = null
|
||||
uploadRef.value?.clearFiles()
|
||||
}
|
||||
|
||||
// 文件变化
|
||||
// ????
|
||||
const handleFileChange = (file: any) => {
|
||||
importFile.value = file.raw
|
||||
}
|
||||
|
||||
// 提交导入
|
||||
// ????
|
||||
const handleImportSubmit = async () => {
|
||||
if (!importFile.value) {
|
||||
useMessage().warning('请选择要导入的文件')
|
||||
useMessage().warning('?????????')
|
||||
return
|
||||
}
|
||||
|
||||
importLoading.value = true
|
||||
try {
|
||||
await importExcel(importFile.value)
|
||||
useMessage().success('导入成功')
|
||||
useMessage().success('????')
|
||||
importDialogVisible.value = false
|
||||
importFile.value = null
|
||||
uploadRef.value?.clearFiles()
|
||||
getDataList()
|
||||
} catch (err: any) {
|
||||
useMessage().error(err.msg || '导入失败')
|
||||
useMessage().error(err.msg || '????')
|
||||
} finally {
|
||||
importLoading.value = false
|
||||
}
|
||||
}
|
||||
|
||||
// 编辑
|
||||
// ??
|
||||
const handleEdit = (row: any) => {
|
||||
formDialogRef.value?.openDialog('edit', row)
|
||||
}
|
||||
|
||||
// 删除
|
||||
// ??
|
||||
const handleDelete = async (row: any) => {
|
||||
const { confirm } = useMessageBox()
|
||||
try {
|
||||
await confirm('确定要删除该操行考核记录吗?')
|
||||
await confirm('??????????????')
|
||||
await delObj([row.id])
|
||||
useMessage().success('删除成功')
|
||||
useMessage().success('????')
|
||||
getDataList()
|
||||
} catch (err: any) {
|
||||
if (err !== 'cancel') {
|
||||
useMessage().error(err.msg || '删除失败')
|
||||
useMessage().error(err.msg || '????')
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// 获取学年列表
|
||||
// ??????
|
||||
const getSchoolYearList = async () => {
|
||||
try {
|
||||
const res = await queryAllSchoolYear()
|
||||
@@ -487,7 +487,7 @@ const getSchoolYearList = async () => {
|
||||
}
|
||||
}
|
||||
|
||||
// 获取学期字典
|
||||
// ??????
|
||||
const getSchoolTermDict = async () => {
|
||||
try {
|
||||
const res = await getDicts('school_term')
|
||||
@@ -504,7 +504,7 @@ const getSchoolTermDict = async () => {
|
||||
}
|
||||
}
|
||||
|
||||
// 获取学院列表
|
||||
// ??????
|
||||
const getDeptListData = async () => {
|
||||
try {
|
||||
const res = await getDeptList()
|
||||
@@ -518,7 +518,7 @@ const getDeptListData = async () => {
|
||||
}
|
||||
}
|
||||
|
||||
// 获取班级列表
|
||||
// ??????
|
||||
const getClassListData = async () => {
|
||||
try {
|
||||
const res = await getClassListByRole()
|
||||
@@ -532,7 +532,7 @@ const getClassListData = async () => {
|
||||
}
|
||||
}
|
||||
|
||||
// 获取类型字典
|
||||
// ??????
|
||||
const getTypeDict = async () => {
|
||||
try {
|
||||
const res = await getDicts('conduct_type')
|
||||
@@ -549,7 +549,7 @@ const getTypeDict = async () => {
|
||||
}
|
||||
}
|
||||
|
||||
// 初始<EFBFBD><EFBFBD>?
|
||||
// ???
|
||||
onMounted(() => {
|
||||
getSchoolYearList()
|
||||
getSchoolTermDict()
|
||||
|
||||
@@ -7,7 +7,7 @@
|
||||
<div class="card-header">
|
||||
<span class="card-title">
|
||||
<el-icon class="title-icon"><Search /></el-icon>
|
||||
筛选条<EFBFBD><EFBFBD>?
|
||||
筛选条件
|
||||
</span>
|
||||
</div>
|
||||
</template>
|
||||
@@ -47,7 +47,7 @@
|
||||
icon="FolderAdd"
|
||||
type="primary"
|
||||
@click="formDialogRef.openDialog()">
|
||||
<EFBFBD><EFBFBD>?<EFBFBD><EFBFBD>?
|
||||
新增
|
||||
</el-button>
|
||||
<right-toolbar
|
||||
v-model:showSearch="showSearch"
|
||||
@@ -63,7 +63,7 @@
|
||||
@order-change="handleColumnOrderChange"
|
||||
>
|
||||
<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-icon><Menu /></el-icon>
|
||||
</el-button>
|
||||
@@ -161,7 +161,7 @@ import { useMessage, useMessageBox } from "/@/hooks/message";
|
||||
import TableColumnControl from '/@/components/TableColumnControl/index.vue'
|
||||
import FormDialog from './form.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 formDialogRef = ref()
|
||||
|
||||
// 表格列配<EFBFBD><EFBFBD>?
|
||||
// 表格列配置
|
||||
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: 'reason', label: '请假事由', icon: Document },
|
||||
{ prop: 'deptName', label: '发起部门', icon: OfficeBuilding }
|
||||
@@ -213,7 +213,7 @@ const {
|
||||
tableStyle
|
||||
} = useTable(state)
|
||||
|
||||
// 格式化日期时<EFBFBD><EFBFBD>?
|
||||
// 格式化日期时间
|
||||
const formatDateTime = (dateTime: string) => {
|
||||
if (!dateTime) return '-'
|
||||
// 如果包含时间部分,只显示日期部分
|
||||
@@ -243,7 +243,7 @@ const handleEdit = (row: any) => {
|
||||
// 删除
|
||||
const handleDelete = async (row: any) => {
|
||||
try {
|
||||
await useMessageBox().confirm('确定要删除这条记录吗<EFBFBD><EFBFBD>?)
|
||||
await useMessageBox().confirm('确定要删除这条记录吗?')
|
||||
await delObj([row.id])
|
||||
useMessage().success('删除成功')
|
||||
getDataList()
|
||||
@@ -266,7 +266,7 @@ const getDeptListData = async () => {
|
||||
}
|
||||
}
|
||||
|
||||
// 初始<EFBFBD><EFBFBD>?
|
||||
// 初始化
|
||||
onMounted(() => {
|
||||
getDeptListData()
|
||||
})
|
||||
|
||||
@@ -1,21 +1,21 @@
|
||||
<template>
|
||||
<div class="modern-page-container">
|
||||
<div class="page-wrapper">
|
||||
<!-- 搜索表单卡片 -->
|
||||
<!-- ???? -->
|
||||
<el-card v-show="showSearch" class="search-card" shadow="never">
|
||||
<template #header>
|
||||
<div class="card-header">
|
||||
<span class="card-title">
|
||||
<el-icon class="title-icon"><Search /></el-icon>
|
||||
筛选条<EFBFBD><EFBFBD>?
|
||||
????
|
||||
</span>
|
||||
</div>
|
||||
</template>
|
||||
<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
|
||||
v-model="searchForm.schoolYear"
|
||||
placeholder="请选择学年"
|
||||
placeholder="?????"
|
||||
clearable
|
||||
filterable
|
||||
style="width: 200px">
|
||||
@@ -27,10 +27,10 @@
|
||||
</el-option>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="学期" prop="schoolTerm">
|
||||
<el-form-item label="??" prop="schoolTerm">
|
||||
<el-select
|
||||
v-model="searchForm.schoolTerm"
|
||||
placeholder="请选择学期"
|
||||
placeholder="?????"
|
||||
clearable
|
||||
style="width: 200px">
|
||||
<el-option
|
||||
@@ -41,10 +41,10 @@
|
||||
</el-option>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="学院" prop="deptCode">
|
||||
<el-form-item label="??" prop="deptCode">
|
||||
<el-select
|
||||
v-model="searchForm.deptCode"
|
||||
placeholder="请选择学院"
|
||||
placeholder="?????"
|
||||
clearable
|
||||
filterable
|
||||
style="width: 200px">
|
||||
@@ -56,10 +56,10 @@
|
||||
</el-option>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="班级" prop="classCode">
|
||||
<el-form-item label="??" prop="classCode">
|
||||
<el-select
|
||||
v-model="searchForm.classCode"
|
||||
placeholder="请选择班级"
|
||||
placeholder="?????"
|
||||
clearable
|
||||
filterable
|
||||
style="width: 200px">
|
||||
@@ -71,34 +71,34 @@
|
||||
</el-option>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="姓名" prop="realName">
|
||||
<el-form-item label="??" prop="realName">
|
||||
<el-input
|
||||
v-model="searchForm.realName"
|
||||
placeholder="请输入姓<EFBFBD><EFBFBD>?
|
||||
placeholder="?????"
|
||||
clearable
|
||||
style="width: 200px" />
|
||||
</el-form-item>
|
||||
<el-form-item label="学号" prop="stuNo">
|
||||
<el-form-item label="??" prop="stuNo">
|
||||
<el-input
|
||||
v-model="searchForm.stuNo"
|
||||
placeholder="请输入学<EFBFBD><EFBFBD>?
|
||||
placeholder="?????"
|
||||
clearable
|
||||
style="width: 200px" />
|
||||
</el-form-item>
|
||||
<el-form-item label="处分月份" prop="punlishMonth">
|
||||
<el-form-item label="????" prop="punlishMonth">
|
||||
<el-date-picker
|
||||
v-model="searchForm.punlishMonth"
|
||||
type="month"
|
||||
placeholder="选择处分月份"
|
||||
placeholder="??????"
|
||||
format="YYYY-MM"
|
||||
value-format="YYYY-MM"
|
||||
clearable
|
||||
style="width: 200px" />
|
||||
</el-form-item>
|
||||
<el-form-item label="处分级别" prop="punlishLevel">
|
||||
<el-form-item label="????" prop="punlishLevel">
|
||||
<el-select
|
||||
v-model="searchForm.punlishLevel"
|
||||
placeholder="请选择处分级别"
|
||||
placeholder="???????"
|
||||
clearable
|
||||
style="width: 200px">
|
||||
<el-option
|
||||
@@ -110,33 +110,33 @@
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item>
|
||||
<el-button type="primary" plain icon="Search" @click="handleSearch">查询</el-button>
|
||||
<el-button icon="Refresh" @click="handleReset">重置</el-button>
|
||||
<el-button type="primary" plain icon="Search" @click="handleSearch">??</el-button>
|
||||
<el-button icon="Refresh" @click="handleReset">??</el-button>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
</el-card>
|
||||
|
||||
<!-- 内容卡片 -->
|
||||
<!-- ???? -->
|
||||
<el-card class="content-card" shadow="never">
|
||||
<template #header>
|
||||
<div class="card-header">
|
||||
<span class="card-title">
|
||||
<el-icon class="title-icon"><Document /></el-icon>
|
||||
学生处分记录列表
|
||||
??????
|
||||
</span>
|
||||
<div class="header-actions">
|
||||
<el-button
|
||||
icon="FolderAdd"
|
||||
type="primary"
|
||||
@click="formDialogRef.openDialog()">
|
||||
<EFBFBD><EFBFBD>?<EFBFBD><EFBFBD>?
|
||||
??
|
||||
</el-button>
|
||||
<el-button
|
||||
icon="Download"
|
||||
type="success"
|
||||
class="ml10"
|
||||
@click="handleExport">
|
||||
<EFBFBD><EFBFBD>?<EFBFBD><EFBFBD>?
|
||||
??
|
||||
</el-button>
|
||||
<right-toolbar
|
||||
v-model:showSearch="showSearch"
|
||||
@@ -152,7 +152,7 @@
|
||||
@order-change="handleColumnOrderChange"
|
||||
>
|
||||
<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-icon><Menu /></el-icon>
|
||||
</el-button>
|
||||
@@ -164,7 +164,7 @@
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<!-- 表格 -->
|
||||
<!-- ?? -->
|
||||
<el-table
|
||||
:data="state.dataList"
|
||||
v-loading="state.loading"
|
||||
@@ -172,7 +172,7 @@
|
||||
:cell-style="tableStyle.cellStyle"
|
||||
:header-cell-style="tableStyle.headerCellStyle"
|
||||
class="modern-table">
|
||||
<el-table-column type="index" label="序号" width="70" align="center">
|
||||
<el-table-column type="index" label="??" width="70" align="center">
|
||||
<template #header>
|
||||
<el-icon><List /></el-icon>
|
||||
</template>
|
||||
@@ -182,7 +182,7 @@
|
||||
</el-table-column>
|
||||
<template v-for="col in visibleColumnsSorted" :key="col.prop || col.label">
|
||||
<el-table-column
|
||||
v-if="checkColumnVisible(col.prop || '') && col.prop !== '操作'"
|
||||
v-if="checkColumnVisible(col.prop || '') && col.prop !== '??'"
|
||||
:prop="col.prop"
|
||||
:label="col.label"
|
||||
show-overflow-tooltip
|
||||
@@ -193,40 +193,40 @@
|
||||
<el-icon><component :is="columnConfigMap[col.prop]?.icon || Calendar" /></el-icon>
|
||||
<span style="margin-left: 4px">{{ col.label }}</span>
|
||||
</template>
|
||||
<!-- 学期列特殊模<EFBFBD><EFBFBD>?-->
|
||||
<!-- ???? -->
|
||||
<template v-if="col.prop === 'schoolTerm'" #default="scope">
|
||||
<el-tag size="small" type="primary" effect="plain">
|
||||
{{ formatSchoolTerm(scope.row.schoolTerm) }}
|
||||
</el-tag>
|
||||
</template>
|
||||
<!-- 处分时间列特殊模<EFBFBD><EFBFBD>?-->
|
||||
<!-- ?????? -->
|
||||
<template v-else-if="col.prop === 'punlishStartDate'" #default="scope">
|
||||
<span>{{ scope.row.punlishStartDate ? formatDate(scope.row.punlishStartDate) : '-' }}</span>
|
||||
</template>
|
||||
<!-- 到期日列特殊模板 -->
|
||||
<!-- ?????? -->
|
||||
<template v-else-if="col.prop === 'punlishEndDate'" #default="scope">
|
||||
<span>{{ scope.row.punlishEndDate ? formatDate(scope.row.punlishEndDate) : '-' }}</span>
|
||||
</template>
|
||||
<!-- 处分级别列特殊模<EFBFBD><EFBFBD>?-->
|
||||
<!-- ?????? -->
|
||||
<template v-else-if="col.prop === 'punlishLevel'" #default="scope">
|
||||
<el-tag size="small" type="danger" effect="plain">
|
||||
{{ formatPunlishLevel(scope.row.punlishLevel) }}
|
||||
</el-tag>
|
||||
</template>
|
||||
<!-- 处分状态列特殊模板 -->
|
||||
<!-- ???? -->
|
||||
<template v-else-if="col.prop === 'publishStatus'" #default="scope">
|
||||
<StatusTag
|
||||
: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' } }"
|
||||
/>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</template>
|
||||
<el-table-column label="操作" width="250" align="center" fixed="right">
|
||||
<el-table-column label="??" width="250" align="center" fixed="right">
|
||||
<template #header>
|
||||
<el-icon><Setting /></el-icon>
|
||||
<span style="margin-left: 4px">操作</span>
|
||||
<span style="margin-left: 4px">??</span>
|
||||
</template>
|
||||
<template #default="scope">
|
||||
<el-button
|
||||
@@ -234,34 +234,34 @@
|
||||
link
|
||||
type="primary"
|
||||
@click="handleReport(scope.row)">
|
||||
思想汇报
|
||||
????
|
||||
</el-button>
|
||||
<el-button
|
||||
icon="CircleClose"
|
||||
link
|
||||
type="warning"
|
||||
@click="handleCancel(scope.row)">
|
||||
撤销处分
|
||||
????
|
||||
</el-button>
|
||||
<el-button
|
||||
icon="Edit"
|
||||
link
|
||||
type="primary"
|
||||
@click="handleEdit(scope.row)">
|
||||
编辑
|
||||
??
|
||||
</el-button>
|
||||
<el-button
|
||||
icon="Delete"
|
||||
link
|
||||
type="danger"
|
||||
@click="handleDelete(scope.row)">
|
||||
删除
|
||||
??
|
||||
</el-button>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
|
||||
<!-- 分页 -->
|
||||
<!-- ?? -->
|
||||
<div class="pagination-wrapper">
|
||||
<pagination
|
||||
@size-change="sizeChangeHandle"
|
||||
@@ -271,7 +271,7 @@
|
||||
</el-card>
|
||||
</div>
|
||||
|
||||
<!-- 新增/编辑表单弹窗 -->
|
||||
<!-- ??/???? -->
|
||||
<form-dialog ref="formDialogRef" @refresh="getDataList" />
|
||||
</div>
|
||||
</template>
|
||||
@@ -289,12 +289,12 @@ import { useMessage, useMessageBox } from "/@/hooks/message";
|
||||
import TableColumnControl from '/@/components/TableColumnControl/index.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 { useTableColumnControl } from '/@/hooks/tableColumnControl'
|
||||
import { useTableColumnControl } from '/@/hooks/tableColumn'
|
||||
|
||||
import { defineAsyncComponent } from 'vue'
|
||||
const StatusTag = defineAsyncComponent(() => import('/@/components/StatusTag/index.vue'))
|
||||
|
||||
// 定义变量内容
|
||||
// ???
|
||||
const route = useRoute()
|
||||
const searchFormRef = ref()
|
||||
const columnControlRef = ref<any>()
|
||||
@@ -307,22 +307,22 @@ const punlishLevelList = ref<any[]>([])
|
||||
const publishStatusList = ref<any[]>([])
|
||||
const formDialogRef = ref()
|
||||
|
||||
// 表格列配<EFBFBD><EFBFBD>?
|
||||
// ???
|
||||
const tableColumns = [
|
||||
{ prop: 'schoolYear', label: '学年' },
|
||||
{ prop: 'schoolTerm', label: '学期' },
|
||||
{ prop: 'deptName', label: '学院' },
|
||||
{ prop: 'classNo', label: '班级' },
|
||||
{ prop: 'stuRealName', label: '姓名' },
|
||||
{ prop: 'stuNo', label: '学号' },
|
||||
{ prop: 'punlishStartDate', label: '处分时间', width: 180 },
|
||||
{ prop: 'punlishEndDate', label: '到期<EFBFBD><EFBFBD>?, width: 180 },
|
||||
{ prop: 'punlishLevel', label: '处分级别' },
|
||||
{ prop: 'punlishContent', label: '处分内容', minWidth: 150 },
|
||||
{ prop: 'publishStatus', label: '处分状<EFBFBD><EFBFBD>? }
|
||||
{ prop: 'schoolYear', label: '??' },
|
||||
{ prop: 'schoolTerm', label: '??' },
|
||||
{ prop: 'deptName', label: '??' },
|
||||
{ prop: 'classNo', label: '??' },
|
||||
{ prop: 'stuRealName', label: '??' },
|
||||
{ prop: 'stuNo', label: '??' },
|
||||
{ prop: 'punlishStartDate', label: '??????', width: 180 },
|
||||
{ prop: 'punlishEndDate', label: '???', width: 180 },
|
||||
{ prop: 'punlishLevel', label: '????' },
|
||||
{ prop: 'punlishContent', label: '????', minWidth: 150 },
|
||||
{ prop: 'publishStatus', label: '????' }
|
||||
]
|
||||
|
||||
// 列配置映射(用于图标<EFBFBD><EFBFBD>?
|
||||
// ?????
|
||||
const columnConfigMap: Record<string, { icon: any }> = {
|
||||
schoolYear: { icon: Calendar },
|
||||
schoolTerm: { icon: Clock },
|
||||
@@ -337,7 +337,7 @@ const columnConfigMap: Record<string, { icon: any }> = {
|
||||
publishStatus: { icon: CircleCheck }
|
||||
}
|
||||
|
||||
// 使用表格列控制hook
|
||||
// ????? hook
|
||||
const {
|
||||
visibleColumns,
|
||||
visibleColumnsSorted,
|
||||
@@ -346,7 +346,7 @@ const {
|
||||
handleColumnOrderChange
|
||||
} = useTableColumnControl(tableColumns, route.path)
|
||||
|
||||
// 搜索表单
|
||||
// ????
|
||||
const searchForm = reactive({
|
||||
schoolYear: '',
|
||||
schoolTerm: '',
|
||||
@@ -359,11 +359,11 @@ const searchForm = reactive({
|
||||
punlishMonthArray: [] as string[]
|
||||
})
|
||||
|
||||
// 配置 useTable
|
||||
// ?? useTable
|
||||
const state: BasicTableProps = reactive<BasicTableProps>({
|
||||
queryForm: searchForm,
|
||||
pageList: async (params: any) => {
|
||||
// 处理处分月份参数,API需要数组格<EFBFBD><EFBFBD>?
|
||||
// ???????? API
|
||||
const queryParams = { ...params }
|
||||
if (queryParams.punlishMonth) {
|
||||
queryParams.punlishMonth = [queryParams.punlishMonth]
|
||||
@@ -388,7 +388,7 @@ const {
|
||||
tableStyle
|
||||
} = useTable(state)
|
||||
|
||||
// 格式化学<EFBFBD><EFBFBD>?
|
||||
// ?????
|
||||
const formatSchoolTerm = (value: string | number) => {
|
||||
if (value === null || value === undefined || value === '') {
|
||||
return '-'
|
||||
@@ -397,36 +397,36 @@ const formatSchoolTerm = (value: string | number) => {
|
||||
return dictItem ? dictItem.label : value
|
||||
}
|
||||
|
||||
// 格式化日<EFBFBD><EFBFBD>?
|
||||
// ?????
|
||||
const formatDate = (dateStr: string) => {
|
||||
if (!dateStr) return '-'
|
||||
// 如果包含时间部分,只显示日期部分
|
||||
// ??????????
|
||||
if (dateStr.includes(' ')) {
|
||||
return dateStr.split(' ')[0]
|
||||
}
|
||||
return dateStr
|
||||
}
|
||||
|
||||
// 格式化处分级<EFBFBD><EFBFBD>?
|
||||
// ???????
|
||||
const formatPunlishLevel = (value: string) => {
|
||||
if (!value) return '-'
|
||||
const item = punlishLevelList.value.find((item: any) => item.value === value)
|
||||
return item ? item.label : value
|
||||
}
|
||||
|
||||
// 格式化处分状<EFBFBD><EFBFBD>?
|
||||
// ???????
|
||||
const formatPublishStatus = (value: string) => {
|
||||
if (!value) return '-'
|
||||
const item = publishStatusList.value.find((item: any) => item.value === value)
|
||||
return item ? item.label : value
|
||||
}
|
||||
|
||||
// 查询
|
||||
// ??
|
||||
const handleSearch = () => {
|
||||
getDataList()
|
||||
}
|
||||
|
||||
// 重置
|
||||
// ??
|
||||
const handleReset = () => {
|
||||
searchFormRef.value?.resetFields()
|
||||
searchForm.schoolYear = ''
|
||||
@@ -440,65 +440,65 @@ const handleReset = () => {
|
||||
getDataList()
|
||||
}
|
||||
|
||||
// 编辑
|
||||
// ??
|
||||
const handleEdit = (row: any) => {
|
||||
formDialogRef.value?.openDialog('edit', row)
|
||||
}
|
||||
|
||||
// 删除
|
||||
// ??
|
||||
const handleDelete = async (row: any) => {
|
||||
try {
|
||||
await useMessageBox().confirm('确定要删除这条记录吗<EFBFBD><EFBFBD>?)
|
||||
await useMessageBox().confirm('???????????')
|
||||
await delObj([row.id])
|
||||
useMessage().success('删除成功')
|
||||
useMessage().success('????')
|
||||
getDataList()
|
||||
} catch (err: any) {
|
||||
if (err !== 'cancel') {
|
||||
useMessage().error(err.msg || '删除失败')
|
||||
useMessage().error(err.msg || '????')
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// 思想汇报
|
||||
// ????
|
||||
const handleReport = (row: any) => {
|
||||
useMessage().info('思想汇报功能待实<EFBFBD><EFBFBD>?)
|
||||
// TODO: 实现思想汇报功能
|
||||
useMessage().info('?????????')
|
||||
// TODO: ??????
|
||||
}
|
||||
|
||||
// 撤销处分
|
||||
// ????
|
||||
const handleCancel = async (row: any) => {
|
||||
const { confirm } = useMessageBox()
|
||||
try {
|
||||
await confirm('确定要撤销该处分吗<EFBFBD><EFBFBD>?)
|
||||
await confirm('??????????')
|
||||
|
||||
// 获取完整的处分信<EFBFBD><EFBFBD>?
|
||||
// ??????
|
||||
const res = await getDetail(row.id)
|
||||
if (!res.data) {
|
||||
useMessage().error('获取处分信息失败')
|
||||
useMessage().error('????????')
|
||||
return
|
||||
}
|
||||
|
||||
// 更新publishStatus<EFBFBD><EFBFBD>?0"来撤销处分
|
||||
// ? publishStatus ?? "0" ????
|
||||
const updateData = {
|
||||
...res.data,
|
||||
publishStatus: '0'
|
||||
}
|
||||
|
||||
await revokePunishment(updateData)
|
||||
useMessage().success('撤销处分成功')
|
||||
useMessage().success('??????')
|
||||
getDataList()
|
||||
} catch (err: any) {
|
||||
if (err !== 'cancel') {
|
||||
useMessage().error(err.msg || '撤销处分失败')
|
||||
useMessage().error(err.msg || '??????')
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// 导出
|
||||
// ??
|
||||
const handleExport = async () => {
|
||||
try {
|
||||
const params: any = { ...searchForm }
|
||||
// 处理处分月份参数,API需要数组格<EFBFBD><EFBFBD>?
|
||||
// ???????? API
|
||||
if (params.punlishMonth) {
|
||||
params.punlishMonth = [params.punlishMonth]
|
||||
} else {
|
||||
@@ -506,23 +506,23 @@ const handleExport = async () => {
|
||||
}
|
||||
delete params.punlishMonthArray
|
||||
const res = await exportData(params)
|
||||
// 处理返回的文件流
|
||||
// ????
|
||||
const blob = new Blob([res.data])
|
||||
const elink = document.createElement('a')
|
||||
elink.download = '学生违纪.xlsx'
|
||||
elink.download = '????.xlsx'
|
||||
elink.style.display = 'none'
|
||||
elink.href = URL.createObjectURL(blob)
|
||||
document.body.appendChild(elink)
|
||||
elink.click()
|
||||
URL.revokeObjectURL(elink.href)
|
||||
document.body.removeChild(elink)
|
||||
useMessage().success('导出成功')
|
||||
useMessage().success('????')
|
||||
} catch (err: any) {
|
||||
useMessage().error(err.msg || '导出失败')
|
||||
useMessage().error(err.msg || '????')
|
||||
}
|
||||
}
|
||||
|
||||
// 获取学年列表
|
||||
// ??????
|
||||
const getSchoolYearList = async () => {
|
||||
try {
|
||||
const res = await queryAllSchoolYear()
|
||||
@@ -534,7 +534,7 @@ const getSchoolYearList = async () => {
|
||||
}
|
||||
}
|
||||
|
||||
// 获取学期字典
|
||||
// ??????
|
||||
const getSchoolTermDict = async () => {
|
||||
try {
|
||||
const res = await getDicts('school_term')
|
||||
@@ -549,7 +549,7 @@ const getSchoolTermDict = async () => {
|
||||
}
|
||||
}
|
||||
|
||||
// 获取学院列表
|
||||
// ??????
|
||||
const getDeptListData = async () => {
|
||||
try {
|
||||
const res = await getDeptListByLevelTwo()
|
||||
@@ -561,7 +561,7 @@ const getDeptListData = async () => {
|
||||
}
|
||||
}
|
||||
|
||||
// 获取班级列表
|
||||
// ??????
|
||||
const getClassListData = async () => {
|
||||
try {
|
||||
const res = await getClassListByRole()
|
||||
@@ -573,7 +573,7 @@ const getClassListData = async () => {
|
||||
}
|
||||
}
|
||||
|
||||
// 获取处分级别字典
|
||||
// ????????
|
||||
const getPunlishLevelDict = async () => {
|
||||
try {
|
||||
const res = await getDicts('punlish_level')
|
||||
@@ -588,7 +588,7 @@ const getPunlishLevelDict = async () => {
|
||||
}
|
||||
}
|
||||
|
||||
// 获取处分状态字<EFBFBD><EFBFBD>?
|
||||
// ????????
|
||||
const getPublishStatusDict = async () => {
|
||||
try {
|
||||
const res = await getDicts('publish_status')
|
||||
@@ -603,7 +603,7 @@ const getPublishStatusDict = async () => {
|
||||
}
|
||||
}
|
||||
|
||||
// 初始<EFBFBD><EFBFBD>?
|
||||
// ???
|
||||
onMounted(() => {
|
||||
getSchoolYearList()
|
||||
getSchoolTermDict()
|
||||
@@ -621,4 +621,3 @@ onMounted(() => {
|
||||
<style scoped lang="scss">
|
||||
@import '/@/assets/styles/modern-page.scss';
|
||||
</style>
|
||||
|
||||
|
||||
@@ -7,7 +7,7 @@
|
||||
<div class="card-header">
|
||||
<span class="card-title">
|
||||
<el-icon class="title-icon"><Search /></el-icon>
|
||||
筛选条<EFBFBD><EFBFBD>?
|
||||
筛选条件
|
||||
</span>
|
||||
</div>
|
||||
</template>
|
||||
@@ -45,7 +45,7 @@
|
||||
<el-form-item label="学号" prop="stuNo">
|
||||
<el-input
|
||||
v-model="searchForm.stuNo"
|
||||
placeholder="请输入学<EFBFBD><EFBFBD>?
|
||||
placeholder="请输入学号"
|
||||
clearable
|
||||
style="width: 200px" />
|
||||
</el-form-item>
|
||||
@@ -85,7 +85,7 @@
|
||||
@order-change="handleColumnOrderChange"
|
||||
>
|
||||
<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-icon><Menu /></el-icon>
|
||||
</el-button>
|
||||
@@ -183,7 +183,7 @@ import { useMessage, useMessageBox } from "/@/hooks/message";
|
||||
import TableColumnControl from '/@/components/TableColumnControl/index.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 { useTableColumnControl } from '/@/hooks/tableColumnControl'
|
||||
import { useTableColumnControl } from '/@/hooks/tableColumn'
|
||||
|
||||
|
||||
// 定义变量内容
|
||||
@@ -196,7 +196,7 @@ const classList = ref<any[]>([])
|
||||
const schoolTermList = ref<any[]>([])
|
||||
const formDialogRef = ref()
|
||||
|
||||
// 表格列配<EFBFBD><EFBFBD>?
|
||||
// 表格列配置
|
||||
const tableColumns = [
|
||||
{ prop: 'schoolYear', label: '学年', icon: Calendar },
|
||||
{ prop: 'schoolTerm', label: '学期', icon: Clock },
|
||||
@@ -204,10 +204,10 @@ const tableColumns = [
|
||||
{ prop: 'classCode', label: '班级代码', icon: Grid },
|
||||
{ prop: 'stuNo', label: '学号', icon: CreditCard },
|
||||
{ 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: 'reason', label: '请假事由', icon: Document, minWidth: 150 },
|
||||
{ prop: 'classTeach', label: '班主<EFBFBD><EFBFBD>?, icon: UserFilled },
|
||||
{ prop: 'classTeach', label: '班主任', icon: UserFilled },
|
||||
{ prop: 'stuPhote', label: '联系方式', icon: Phone },
|
||||
{ prop: 'remarks', label: '备注', icon: EditPen, minWidth: 150 }
|
||||
]
|
||||
@@ -247,7 +247,7 @@ const {
|
||||
tableStyle
|
||||
} = useTable(state)
|
||||
|
||||
// 格式化学<EFBFBD><EFBFBD>?
|
||||
// 格式化学期
|
||||
const formatSchoolTerm = (value: string | number) => {
|
||||
if (value === null || value === undefined || value === '') {
|
||||
return '-'
|
||||
@@ -256,10 +256,10 @@ const formatSchoolTerm = (value: string | number) => {
|
||||
return dictItem ? dictItem.label : value
|
||||
}
|
||||
|
||||
// 格式化日期时<EFBFBD><EFBFBD>?
|
||||
// 格式化日期时间
|
||||
const formatDateTime = (dateTime: string) => {
|
||||
if (!dateTime) return '-'
|
||||
// 如果包含时间部分,只显示日期和时<EFBFBD><EFBFBD>?
|
||||
// 如果包含时间部分,只显示日期和时间
|
||||
if (dateTime.includes(' ')) {
|
||||
return dateTime.split('.')[0] // 移除毫秒部分
|
||||
}
|
||||
@@ -331,7 +331,7 @@ const getSchoolTermDict = async () => {
|
||||
}
|
||||
}
|
||||
|
||||
// 初始<EFBFBD><EFBFBD>?
|
||||
// 初始化
|
||||
onMounted(() => {
|
||||
getDeptListData()
|
||||
getClassListData()
|
||||
|
||||
@@ -7,7 +7,7 @@
|
||||
<div class="card-header">
|
||||
<span class="card-title">
|
||||
<el-icon class="title-icon"><Search /></el-icon>
|
||||
筛选条<EFBFBD><EFBFBD>?
|
||||
筛选条件
|
||||
</span>
|
||||
</div>
|
||||
</template>
|
||||
@@ -56,10 +56,10 @@
|
||||
</el-option>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="原班<EFBFBD><EFBFBD>? prop="oldClassCode">
|
||||
<el-form-item label="原班级" prop="oldClassCode">
|
||||
<el-select
|
||||
v-model="searchForm.oldClassCode"
|
||||
placeholder="请选择原班<EFBFBD><EFBFBD>?
|
||||
placeholder="请选择原班级"
|
||||
clearable
|
||||
filterable
|
||||
style="width: 200px">
|
||||
@@ -74,14 +74,14 @@
|
||||
<el-form-item label="学号" prop="stuNo">
|
||||
<el-input
|
||||
v-model="searchForm.stuNo"
|
||||
placeholder="请输入学<EFBFBD><EFBFBD>?
|
||||
placeholder="请输入学号"
|
||||
clearable
|
||||
style="width: 200px" />
|
||||
</el-form-item>
|
||||
<el-form-item label="姓名" prop="realName">
|
||||
<el-input
|
||||
v-model="searchForm.realName"
|
||||
placeholder="请输入姓<EFBFBD><EFBFBD>?
|
||||
placeholder="请输入姓名"
|
||||
clearable
|
||||
style="width: 200px" />
|
||||
</el-form-item>
|
||||
@@ -126,7 +126,7 @@
|
||||
type="success"
|
||||
class="ml10"
|
||||
@click="handleExport">
|
||||
<EFBFBD><EFBFBD>?<EFBFBD><EFBFBD>?
|
||||
导出
|
||||
</el-button>
|
||||
<right-toolbar
|
||||
v-model:showSearch="showSearch"
|
||||
@@ -142,7 +142,7 @@
|
||||
@order-change="handleColumnOrderChange"
|
||||
>
|
||||
<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-icon><Menu /></el-icon>
|
||||
</el-button>
|
||||
@@ -183,23 +183,23 @@
|
||||
<el-icon><component :is="columnConfigMap[col.prop]?.icon || Calendar" /></el-icon>
|
||||
<span style="margin-left: 4px">{{ col.label }}</span>
|
||||
</template>
|
||||
<!-- 学期列特殊模<EFBFBD><EFBFBD>?-->
|
||||
<!-- 学期列特殊模板 -->
|
||||
<template v-if="col.prop === 'schoolTerm'" #default="scope">
|
||||
<el-tag size="small" type="primary" effect="plain">
|
||||
{{ formatSchoolTerm(scope.row.schoolTerm) }}
|
||||
</el-tag>
|
||||
</template>
|
||||
<!-- 异动时间列特殊模<EFBFBD><EFBFBD>?-->
|
||||
<!-- 异动时间列特殊模板 -->
|
||||
<template v-else-if="col.prop === 'turnoverDate'" #default="scope">
|
||||
<span>{{ scope.row.turnoverDate ? formatDate(scope.row.turnoverDate) : '-' }}</span>
|
||||
</template>
|
||||
<!-- 异动类型列特殊模<EFBFBD><EFBFBD>?-->
|
||||
<!-- 异动类型列特殊模板 -->
|
||||
<template v-else-if="col.prop === 'turnoverType'" #default="scope">
|
||||
<el-tag size="small" type="warning" effect="plain">
|
||||
{{ formatTurnoverType(scope.row.turnoverType) }}
|
||||
</el-tag>
|
||||
</template>
|
||||
<!-- 转制类型列特殊模<EFBFBD><EFBFBD>?-->
|
||||
<!-- 转制类型列特殊模板 -->
|
||||
<template v-else-if="col.prop === 'turnYear'" #default="scope">
|
||||
<el-tag size="small" type="info" effect="plain">
|
||||
{{ formatTurnYear(scope.row.turnYear) }}
|
||||
@@ -259,7 +259,7 @@ import { useMessage, useMessageBox } from "/@/hooks/message";
|
||||
import TableColumnControl from '/@/components/TableColumnControl/index.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 { useTableColumnControl } from '/@/hooks/tableColumnControl'
|
||||
import { useTableColumnControl } from '/@/hooks/tableColumn'
|
||||
|
||||
|
||||
// 定义变量内容
|
||||
@@ -275,13 +275,13 @@ const turnoverTypeList = ref<any[]>([])
|
||||
const turnYearList = ref<any[]>([])
|
||||
const formDialogRef = ref()
|
||||
|
||||
// 表格列配<EFBFBD><EFBFBD>?
|
||||
// 表格列配置
|
||||
const tableColumns = [
|
||||
{ prop: 'schoolYear', label: '学年' },
|
||||
{ prop: 'schoolTerm', label: '学期' },
|
||||
{ prop: 'deptName', label: '学院' },
|
||||
{ prop: 'oldClassNo', label: '原班<EFBFBD><EFBFBD>? },
|
||||
{ prop: 'newClassNo', label: '现班<EFBFBD><EFBFBD>? },
|
||||
{ prop: 'oldClassNo', label: '原班级' },
|
||||
{ prop: 'newClassNo', label: '现班号' },
|
||||
{ prop: 'stuNo', label: '学号' },
|
||||
{ prop: 'realName', label: '姓名' },
|
||||
{ prop: 'turnoverDate', label: '异动时间', width: 180 },
|
||||
@@ -290,7 +290,7 @@ const tableColumns = [
|
||||
{ prop: 'remarks', label: '异动原因', minWidth: 150 }
|
||||
]
|
||||
|
||||
// 列配置映射(用于图标<EFBFBD><EFBFBD>?
|
||||
// 列配置映射(用于图标显示)
|
||||
const columnConfigMap: Record<string, { icon: any }> = {
|
||||
schoolYear: { icon: Calendar },
|
||||
schoolTerm: { icon: Clock },
|
||||
@@ -344,7 +344,7 @@ const {
|
||||
tableStyle
|
||||
} = useTable(state)
|
||||
|
||||
// 格式化学<EFBFBD><EFBFBD>?
|
||||
// 格式化学期
|
||||
const formatSchoolTerm = (value: string | number) => {
|
||||
if (value === null || value === undefined || value === '') {
|
||||
return '-'
|
||||
@@ -353,7 +353,7 @@ const formatSchoolTerm = (value: string | number) => {
|
||||
return dictItem ? dictItem.label : value
|
||||
}
|
||||
|
||||
// 格式化日<EFBFBD><EFBFBD>?
|
||||
// 格式化日期
|
||||
const formatDate = (dateStr: string) => {
|
||||
if (!dateStr) return '-'
|
||||
// 如果包含时间部分,只显示日期部分
|
||||
@@ -363,14 +363,14 @@ const formatDate = (dateStr: string) => {
|
||||
return dateStr
|
||||
}
|
||||
|
||||
// 格式化异动类<EFBFBD><EFBFBD>?
|
||||
// 格式化异动类型
|
||||
const formatTurnoverType = (value: string) => {
|
||||
if (!value) return '-'
|
||||
const item = turnoverTypeList.value.find((item: any) => item.value === value)
|
||||
return item ? item.label : value
|
||||
}
|
||||
|
||||
// 格式化转制类<EFBFBD><EFBFBD>?
|
||||
// 格式化转制类型
|
||||
const formatTurnYear = (value: string) => {
|
||||
if (!value) return '-'
|
||||
const item = turnYearList.value.find((item: any) => item.value === value)
|
||||
@@ -403,7 +403,7 @@ const handleEdit = (row: any) => {
|
||||
// 删除
|
||||
const handleDelete = async (row: any) => {
|
||||
try {
|
||||
await useMessageBox().confirm('确定要删除这条记录吗<EFBFBD><EFBFBD>?)
|
||||
await useMessageBox().confirm('确定要删除这条记录吗?')
|
||||
await delObj([row.id])
|
||||
useMessage().success('删除成功')
|
||||
getDataList()
|
||||
@@ -515,7 +515,7 @@ const getTurnYearDict = async () => {
|
||||
}
|
||||
}
|
||||
|
||||
// 初始<EFBFBD><EFBFBD>?
|
||||
// 初始化
|
||||
onMounted(() => {
|
||||
getSchoolYearList()
|
||||
getSchoolTermDict()
|
||||
|
||||
@@ -1,13 +1,13 @@
|
||||
<template>
|
||||
<div class="modern-page-container">
|
||||
<div class="page-wrapper">
|
||||
<!-- 搜索表单卡片 -->
|
||||
<!-- ?????? -->
|
||||
<el-card v-show="showSearch" class="search-card" shadow="never">
|
||||
<template #header>
|
||||
<div class="card-header">
|
||||
<span class="card-title">
|
||||
<el-icon class="title-icon"><Search /></el-icon>
|
||||
筛选条<EFBFBD><EFBFBD>?
|
||||
????
|
||||
</span>
|
||||
</div>
|
||||
</template>
|
||||
@@ -15,7 +15,7 @@
|
||||
<el-form-item label="班级" prop="classCode">
|
||||
<el-select
|
||||
v-model="state.queryForm.classCode"
|
||||
placeholder="请选择班级"
|
||||
placeholder="请选择学年"
|
||||
clearable
|
||||
filterable
|
||||
style="width: 200px">
|
||||
@@ -27,31 +27,31 @@
|
||||
</el-option>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="班号" prop="classNo">
|
||||
<el-form-item label="??" prop="classNo">
|
||||
<el-input
|
||||
v-model="state.queryForm.classNo"
|
||||
placeholder="请输入班<EFBFBD><EFBFBD>?
|
||||
placeholder="请输入姓名"
|
||||
clearable
|
||||
style="width: 200px" />
|
||||
</el-form-item>
|
||||
<el-form-item label="姓名" prop="realName">
|
||||
<el-input
|
||||
v-model="state.queryForm.realName"
|
||||
placeholder="请输入姓<EFBFBD><EFBFBD>?
|
||||
placeholder="请输入姓名"
|
||||
clearable
|
||||
style="width: 200px" />
|
||||
</el-form-item>
|
||||
<el-form-item label="团员编号" prop="serNo">
|
||||
<el-form-item label="????" prop="serNo">
|
||||
<el-input
|
||||
v-model="state.queryForm.serNo"
|
||||
placeholder="请输入团员编<EFBFBD><EFBFBD>?
|
||||
placeholder="请输入奖项名称"
|
||||
clearable
|
||||
style="width: 200px" />
|
||||
</el-form-item>
|
||||
<el-form-item label="入学年份" prop="grade">
|
||||
<el-select
|
||||
v-model="state.queryForm.grade"
|
||||
placeholder="请选择入学年份"
|
||||
placeholder="请输入奖项名称"
|
||||
clearable
|
||||
style="width: 200px">
|
||||
<el-option
|
||||
@@ -63,40 +63,40 @@
|
||||
</el-select>
|
||||
</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-form-item>
|
||||
</el-form>
|
||||
</el-card>
|
||||
|
||||
<!-- 内容卡片 -->
|
||||
<!-- ???? -->
|
||||
<el-card class="content-card" shadow="never">
|
||||
<template #header>
|
||||
<div class="card-header">
|
||||
<span class="card-title">
|
||||
<el-icon class="title-icon"><Document /></el-icon>
|
||||
学生团员列表
|
||||
??????
|
||||
</span>
|
||||
<div class="header-actions">
|
||||
<el-button
|
||||
icon="Plus"
|
||||
type="primary"
|
||||
@click="formDialogRef.openDialog()">
|
||||
新增
|
||||
??
|
||||
</el-button>
|
||||
<el-button
|
||||
icon="Upload"
|
||||
type="success"
|
||||
class="ml10"
|
||||
@click="handleImport">
|
||||
导入
|
||||
??
|
||||
</el-button>
|
||||
<el-button
|
||||
icon="Download"
|
||||
type="warning"
|
||||
class="ml10"
|
||||
@click="handleExport">
|
||||
导出
|
||||
??
|
||||
</el-button>
|
||||
<right-toolbar
|
||||
v-model:showSearch="showSearch"
|
||||
@@ -112,7 +112,7 @@
|
||||
@order-change="handleColumnOrderChange"
|
||||
>
|
||||
<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-icon><Menu /></el-icon>
|
||||
</el-button>
|
||||
@@ -153,11 +153,11 @@
|
||||
<el-icon><component :is="columnConfigMap[col.prop]?.icon || Calendar" /></el-icon>
|
||||
<span style="margin-left: 4px">{{ col.label }}</span>
|
||||
</template>
|
||||
<!-- 入团时间列特殊模<EFBFBD><EFBFBD>?-->
|
||||
<!-- ????????? -->
|
||||
<template v-if="col.prop === 'enterTime'" #default="scope">
|
||||
<span>{{ parseTime(scope.row.enterTime, '{y}-{m}-{d}') }}</span>
|
||||
</template>
|
||||
<!-- 团内职务列特殊模<EFBFBD><EFBFBD>?-->
|
||||
<!-- ????????? -->
|
||||
<template v-else-if="col.prop === 'position'" #default="scope">
|
||||
<el-tag v-if="scope.row.position" size="small" type="primary" effect="plain">
|
||||
{{ scope.row.position }}
|
||||
@@ -200,12 +200,12 @@
|
||||
</el-card>
|
||||
</div>
|
||||
|
||||
<!-- 新增/编辑表单弹窗 -->
|
||||
<!-- ??/?????? -->
|
||||
<form-dialog ref="formDialogRef" @refresh="getDataList" />
|
||||
|
||||
<!-- 导入弹窗 -->
|
||||
<!-- ???? -->
|
||||
<el-dialog
|
||||
title="导入团员"
|
||||
title="????"
|
||||
v-model="importDialogVisible"
|
||||
:close-on-click-modal="false"
|
||||
width="500px">
|
||||
@@ -220,18 +220,18 @@
|
||||
drag>
|
||||
<el-icon class="el-icon--upload"><upload-filled /></el-icon>
|
||||
<div class="el-upload__text">
|
||||
将文件拖到此处,<EFBFBD><EFBFBD>?em>点击上传</em>
|
||||
????????<em>????</em>
|
||||
</div>
|
||||
<template #tip>
|
||||
<div class="el-upload__tip">
|
||||
只能上传 xlsx/xls 文件
|
||||
???? xlsx/xls ??
|
||||
</div>
|
||||
</template>
|
||||
</el-upload>
|
||||
<template #footer>
|
||||
<span class="dialog-footer">
|
||||
<el-button @click="importDialogVisible = false"><EFBFBD><EFBFBD>?<EFBFBD><EFBFBD>?/el-button>
|
||||
<el-button type="primary" @click="handleImportSubmit" :loading="importLoading"><EFBFBD><EFBFBD>?<EFBFBD><EFBFBD>?/el-button>
|
||||
<el-button @click="importDialogVisible = false">取消</el-button>
|
||||
<el-button type="primary" @click="handleImportSubmit" :loading="importLoading">??</el-button>
|
||||
</span>
|
||||
</template>
|
||||
</el-dialog>
|
||||
@@ -249,12 +249,12 @@ import { useMessage, useMessageBox } from "/@/hooks/message";
|
||||
import { parseTime } from "/@/utils/formatTime";
|
||||
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 { useTableColumnControl } from '/@/hooks/tableColumnControl'
|
||||
import { useTableColumnControl } from '/@/hooks/tableColumn'
|
||||
|
||||
import type { UploadFile, UploadFiles } from 'element-plus';
|
||||
import FormDialog from './form.vue'
|
||||
|
||||
// 定义变量内容
|
||||
// ??????
|
||||
const route = useRoute()
|
||||
const formDialogRef = ref()
|
||||
const columnControlRef = ref<any>()
|
||||
@@ -267,19 +267,19 @@ const importDialogVisible = ref(false)
|
||||
const importLoading = ref(false)
|
||||
const fileList = ref<UploadFile[]>([])
|
||||
|
||||
// 表格列配<EFBFBD><EFBFBD>?
|
||||
// ?????
|
||||
const tableColumns = [
|
||||
{ prop: 'deptName', label: '学院', minWidth: 150 },
|
||||
{ prop: 'classNo', label: '班级', width: 120 },
|
||||
{ prop: 'stuNo', label: '学号', width: 120 },
|
||||
{ prop: 'realName', label: '姓名', width: 100 },
|
||||
{ prop: 'phone', label: '联系电话', width: 120 },
|
||||
{ prop: 'enterTime', label: '入团时间', width: 120 },
|
||||
{ prop: 'serNo', label: '团员编号', width: 120 },
|
||||
{ prop: 'position', label: '团内职务', width: 120 }
|
||||
{ prop: 'deptName', label: '????', minWidth: 150 },
|
||||
{ prop: 'classNo', label: '??', width: 120 },
|
||||
{ prop: 'stuNo', label: '??', width: 120 },
|
||||
{ prop: 'realName', label: '??', width: 100 },
|
||||
{ prop: 'phone', label: '???', width: 120 },
|
||||
{ prop: 'enterTime', label: '????', width: 120 },
|
||||
{ prop: 'serNo', label: '????', width: 120 },
|
||||
{ prop: 'position', label: '????', width: 120 }
|
||||
]
|
||||
|
||||
// 列配置映射(用于图标<EFBFBD><EFBFBD>?
|
||||
// ?????????????
|
||||
const columnConfigMap: Record<string, { icon: any }> = {
|
||||
deptName: { icon: OfficeBuilding },
|
||||
classNo: { icon: Grid },
|
||||
@@ -291,7 +291,7 @@ const columnConfigMap: Record<string, { icon: any }> = {
|
||||
position: { icon: Briefcase }
|
||||
}
|
||||
|
||||
// 使用表格列控制hook
|
||||
// ???????hook
|
||||
const {
|
||||
visibleColumns,
|
||||
visibleColumnsSorted,
|
||||
@@ -300,13 +300,13 @@ const {
|
||||
handleColumnOrderChange
|
||||
} = useTableColumnControl(tableColumns, route.path)
|
||||
|
||||
// 表格样式
|
||||
// ????
|
||||
const tableStyle = {
|
||||
cellStyle: { padding: '8px 0' },
|
||||
headerCellStyle: { background: '#f5f7fa', color: '#606266', fontWeight: 'bold' }
|
||||
}
|
||||
|
||||
// 配置 useTable
|
||||
// ?? useTable
|
||||
const state: BasicTableProps = reactive<BasicTableProps>({
|
||||
queryForm: {
|
||||
classCode: '',
|
||||
@@ -331,7 +331,7 @@ const {
|
||||
tableStyle: _tableStyle
|
||||
} = useTable(state)
|
||||
|
||||
// 重置
|
||||
// ??
|
||||
const handleReset = () => {
|
||||
searchFormRef.value?.resetFields()
|
||||
state.queryForm.classCode = ''
|
||||
@@ -342,70 +342,70 @@ const handleReset = () => {
|
||||
getDataList()
|
||||
}
|
||||
|
||||
// 编辑
|
||||
// ??
|
||||
const handleEdit = (row: any) => {
|
||||
formDialogRef.value?.openDialog('edit', row)
|
||||
}
|
||||
|
||||
// 删除
|
||||
// ??
|
||||
const handleDelete = async (row: any) => {
|
||||
const { confirm } = useMessageBox()
|
||||
try {
|
||||
await confirm('确定要删除该团员吗?')
|
||||
await confirm('???????????')
|
||||
await delObj([row.id])
|
||||
useMessage().success('删除成功')
|
||||
useMessage().success('????')
|
||||
getDataList()
|
||||
} catch (err: any) {
|
||||
if (err !== 'cancel') {
|
||||
useMessage().error(err.msg || '删除失败')
|
||||
useMessage().error(err.msg || '????')
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// 导入
|
||||
// ??
|
||||
const handleImport = () => {
|
||||
importDialogVisible.value = true
|
||||
fileList.value = []
|
||||
}
|
||||
|
||||
// 文件变化
|
||||
// ????
|
||||
const handleFileChange = (file: UploadFile, files: UploadFiles) => {
|
||||
fileList.value = [file]
|
||||
}
|
||||
|
||||
// 文件超出限制
|
||||
// ??????
|
||||
const handleExceed = () => {
|
||||
useMessage().warning('只能上传一个文<EFBFBD><EFBFBD>?)
|
||||
useMessage().warning('????????')
|
||||
}
|
||||
|
||||
// 提交导入
|
||||
// ????
|
||||
const handleImportSubmit = async () => {
|
||||
if (fileList.value.length === 0) {
|
||||
useMessage().warning('请选择要上传的文件')
|
||||
useMessage().warning('?????????')
|
||||
return
|
||||
}
|
||||
|
||||
const file = fileList.value[0].raw
|
||||
if (!file) {
|
||||
useMessage().warning('文件不存<EFBFBD><EFBFBD>?)
|
||||
useMessage().warning('?????')
|
||||
return
|
||||
}
|
||||
|
||||
importLoading.value = true
|
||||
try {
|
||||
await importExcel(file as File)
|
||||
useMessage().success('导入成功')
|
||||
useMessage().success('????')
|
||||
importDialogVisible.value = false
|
||||
fileList.value = []
|
||||
getDataList()
|
||||
} catch (err: any) {
|
||||
useMessage().error(err.msg || '导入失败')
|
||||
useMessage().error(err.msg || '????')
|
||||
} finally {
|
||||
importLoading.value = false
|
||||
}
|
||||
}
|
||||
|
||||
// 导出
|
||||
// ??
|
||||
const handleExport = async () => {
|
||||
try {
|
||||
const res = await exportExcel(state.queryForm)
|
||||
@@ -413,18 +413,18 @@ const handleExport = async () => {
|
||||
const url = window.URL.createObjectURL(blob)
|
||||
const link = document.createElement('a')
|
||||
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)
|
||||
link.click()
|
||||
document.body.removeChild(link)
|
||||
window.URL.revokeObjectURL(url)
|
||||
useMessage().success('导出成功')
|
||||
useMessage().success('????')
|
||||
} catch (err: any) {
|
||||
useMessage().error(err.msg || '导出失败')
|
||||
useMessage().error(err.msg || '????')
|
||||
}
|
||||
}
|
||||
|
||||
// 获取班级列表
|
||||
// ??????
|
||||
const getClassListData = async () => {
|
||||
try {
|
||||
const res = await getClassListByRole()
|
||||
@@ -438,7 +438,7 @@ const getClassListData = async () => {
|
||||
}
|
||||
}
|
||||
|
||||
// 获取入学年份列表
|
||||
// ????????
|
||||
const getGradeListData = async () => {
|
||||
try {
|
||||
const res = await getGradeList()
|
||||
@@ -452,7 +452,7 @@ const getGradeListData = async () => {
|
||||
}
|
||||
}
|
||||
|
||||
// 初始<EFBFBD><EFBFBD>?
|
||||
// ???
|
||||
onMounted(() => {
|
||||
getClassListData()
|
||||
getGradeListData()
|
||||
@@ -466,4 +466,3 @@ onMounted(() => {
|
||||
<style scoped lang="scss">
|
||||
@import '/@/assets/styles/modern-page.scss';
|
||||
</style>
|
||||
|
||||
|
||||
@@ -7,7 +7,7 @@
|
||||
<div class="card-header">
|
||||
<span class="card-title">
|
||||
<el-icon class="title-icon"><Search /></el-icon>
|
||||
筛选条<EFBFBD><EFBFBD>?
|
||||
筛选条件
|
||||
</span>
|
||||
</div>
|
||||
</template>
|
||||
@@ -59,21 +59,21 @@
|
||||
<el-form-item label="班号" prop="classNo">
|
||||
<el-input
|
||||
v-model="searchForm.classNo"
|
||||
placeholder="请输入班<EFBFBD><EFBFBD>?
|
||||
placeholder="请输入班号"
|
||||
clearable
|
||||
style="width: 200px" />
|
||||
</el-form-item>
|
||||
<el-form-item label="学号" prop="stuNo">
|
||||
<el-input
|
||||
v-model="searchForm.stuNo"
|
||||
placeholder="请输入学<EFBFBD><EFBFBD>?
|
||||
placeholder="请输入学号"
|
||||
clearable
|
||||
style="width: 200px" />
|
||||
</el-form-item>
|
||||
<el-form-item label="姓名" prop="realName">
|
||||
<el-input
|
||||
v-model="searchForm.realName"
|
||||
placeholder="请输入姓<EFBFBD><EFBFBD>?
|
||||
placeholder="请输入姓名"
|
||||
clearable
|
||||
style="width: 200px" />
|
||||
</el-form-item>
|
||||
@@ -81,8 +81,8 @@
|
||||
<el-date-picker
|
||||
v-model="searchForm.dateRange"
|
||||
type="daterange"
|
||||
range-separator="<EFBFBD><EFBFBD>?
|
||||
start-placeholder="开始日<EFBFBD><EFBFBD>?
|
||||
range-separator="至"
|
||||
start-placeholder="开始日期"
|
||||
end-placeholder="结束日期"
|
||||
format="YYYY-MM-DD"
|
||||
value-format="YYYY-MM-DD"
|
||||
@@ -109,7 +109,7 @@
|
||||
icon="FolderAdd"
|
||||
type="primary"
|
||||
@click="formDialogRef.openDialog()">
|
||||
<EFBFBD><EFBFBD>?<EFBFBD><EFBFBD>?
|
||||
新增
|
||||
</el-button>
|
||||
<el-button
|
||||
icon="User"
|
||||
@@ -132,7 +132,7 @@
|
||||
@order-change="handleColumnOrderChange"
|
||||
>
|
||||
<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-icon><Menu /></el-icon>
|
||||
</el-button>
|
||||
@@ -173,7 +173,7 @@
|
||||
<el-icon><component :is="columnConfigMap[col.prop]?.icon || Calendar" /></el-icon>
|
||||
<span style="margin-left: 4px">{{ col.label }}</span>
|
||||
</template>
|
||||
<!-- 学期列特殊模<EFBFBD><EFBFBD>?-->
|
||||
<!-- 学期列特殊模板 -->
|
||||
<template v-if="col.prop === 'schoolTerm'" #default="scope">
|
||||
<el-tag size="small" type="primary" effect="plain">
|
||||
{{ formatSchoolTerm(scope.row.schoolTerm) }}
|
||||
@@ -183,11 +183,11 @@
|
||||
<template v-else-if="col.prop === 'startTime'" #default="scope">
|
||||
<span>{{ scope.row.startTime ? scope.row.startTime.split(' ')[0] : '-' }}</span>
|
||||
</template>
|
||||
<!-- 工学交替结束时间列特殊模<EFBFBD><EFBFBD>?-->
|
||||
<!-- 工学交替结束时间列特殊模板 -->
|
||||
<template v-else-if="col.prop === 'endTime'" #default="scope">
|
||||
<span>{{ scope.row.endTime ? scope.row.endTime.split(' ')[0] : '-' }}</span>
|
||||
</template>
|
||||
<!-- 带班教师列特殊模<EFBFBD><EFBFBD>?-->
|
||||
<!-- 带班教师列特殊模板 -->
|
||||
<template v-else-if="col.prop === 'attendanceTeacherName'" #default="scope">
|
||||
<span>{{ scope.row.attendanceTeacherName || '-' }}</span>
|
||||
</template>
|
||||
@@ -241,7 +241,7 @@ import TableColumnControl from '/@/components/TableColumnControl/index.vue'
|
||||
import FormDialog from './form.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 { useTableColumnControl } from '/@/hooks/tableColumnControl'
|
||||
import { useTableColumnControl } from '/@/hooks/tableColumn'
|
||||
|
||||
|
||||
// 定义变量内容
|
||||
@@ -255,7 +255,7 @@ const schoolTermList = ref<any[]>([])
|
||||
const formDialogRef = ref()
|
||||
const teacherDialogRef = ref()
|
||||
|
||||
// 表格列配<EFBFBD><EFBFBD>?
|
||||
// 表格列配置
|
||||
const tableColumns = [
|
||||
{ prop: 'schoolYear', label: '学年' },
|
||||
{ prop: 'schoolTerm', label: '学期' },
|
||||
@@ -263,13 +263,13 @@ const tableColumns = [
|
||||
{ prop: 'stuNo', label: '学号' },
|
||||
{ prop: 'realName', label: '姓名' },
|
||||
{ prop: 'classNo', label: '班号' },
|
||||
{ prop: 'className', label: '班级简<EFBFBD><EFBFBD>? },
|
||||
{ prop: 'startTime', label: '工学交替开始时<EFBFBD><EFBFBD>?, width: 180 },
|
||||
{ prop: 'className', label: '班级简称' },
|
||||
{ prop: 'startTime', label: '工学交替开始时间', width: 180 },
|
||||
{ prop: 'endTime', label: '工学交替结束时间', width: 180 },
|
||||
{ prop: 'attendanceTeacherName', label: '带班教师' }
|
||||
]
|
||||
|
||||
// 列配置映射(用于图标<EFBFBD><EFBFBD>?
|
||||
// 列配置映射(用于图标显示)
|
||||
const columnConfigMap: Record<string, { icon: any }> = {
|
||||
schoolYear: { icon: Calendar },
|
||||
schoolTerm: { icon: Clock },
|
||||
@@ -357,7 +357,7 @@ const handleReset = () => {
|
||||
// 删除
|
||||
const handleDelete = async (row: any) => {
|
||||
try {
|
||||
await useMessageBox().confirm('确定要删除这条记录吗<EFBFBD><EFBFBD>?)
|
||||
await useMessageBox().confirm('确定要删除这条记录吗?')
|
||||
await delObj([row.id])
|
||||
useMessage().success('删除成功')
|
||||
getDataList()
|
||||
@@ -404,7 +404,7 @@ const getSchoolTermList = async () => {
|
||||
}
|
||||
}
|
||||
|
||||
// 初始<EFBFBD><EFBFBD>?
|
||||
// 初始化
|
||||
onMounted(() => {
|
||||
getDeptListData()
|
||||
getSchoolYearList()
|
||||
|
||||
@@ -7,7 +7,7 @@
|
||||
<div class="card-header">
|
||||
<span class="card-title">
|
||||
<el-icon class="title-icon"><Document /></el-icon>
|
||||
教学楼管理列<EFBFBD><EFBFBD>?
|
||||
教学楼管理列表
|
||||
</span>
|
||||
<div class="header-actions">
|
||||
<el-button
|
||||
@@ -29,7 +29,7 @@
|
||||
@order-change="handleColumnOrderChange"
|
||||
>
|
||||
<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-icon><Menu /></el-icon>
|
||||
</el-button>
|
||||
@@ -120,7 +120,7 @@ import { useMessage, useMessageBox } from "/@/hooks/message";
|
||||
import TableColumnControl from '/@/components/TableColumnControl/index.vue'
|
||||
import FormDialog from './form.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 columnControlRef = ref<any>()
|
||||
|
||||
// 表格列配<EFBFBD><EFBFBD>?
|
||||
// 表格列配置
|
||||
const tableColumns = [
|
||||
{ prop: 'buildingNo', label: '楼号' },
|
||||
{ prop: 'remarks', label: '备注', minWidth: 200 }
|
||||
]
|
||||
|
||||
// 列配置映射(用于图标<EFBFBD><EFBFBD>?
|
||||
// 列配置映射(用于图标显示
|
||||
const columnConfigMap: Record<string, { icon: any }> = {
|
||||
buildingNo: { icon: OfficeBuilding },
|
||||
remarks: { icon: EditPen }
|
||||
@@ -177,7 +177,7 @@ const handleEdit = (row: any) => {
|
||||
const handleDelete = async (row: any) => {
|
||||
const { confirm } = useMessageBox()
|
||||
try {
|
||||
await confirm('确定要删除该教学楼吗<EFBFBD><EFBFBD>?)
|
||||
await confirm('确定要删除该教学楼吗?')
|
||||
await delObj([row.id])
|
||||
useMessage().success('删除成功')
|
||||
getDataList()
|
||||
@@ -188,7 +188,7 @@ const handleDelete = async (row: any) => {
|
||||
}
|
||||
}
|
||||
|
||||
// 初始<EFBFBD><EFBFBD>?
|
||||
// 初始化
|
||||
onMounted(() => {
|
||||
nextTick(() => {
|
||||
if (visibleColumns.value.length === 0) {
|
||||
|
||||
@@ -7,7 +7,7 @@
|
||||
<div class="card-header">
|
||||
<span class="card-title">
|
||||
<el-icon class="title-icon"><Search /></el-icon>
|
||||
筛选条<EFBFBD><EFBFBD>?
|
||||
筛选条件
|
||||
</span>
|
||||
</div>
|
||||
</template>
|
||||
@@ -86,7 +86,7 @@
|
||||
@order-change="handleColumnOrderChange"
|
||||
>
|
||||
<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-icon><Menu /></el-icon>
|
||||
</el-button>
|
||||
@@ -186,7 +186,7 @@ import TableColumnControl from '/@/components/TableColumnControl/index.vue'
|
||||
import FormDialog from './form.vue'
|
||||
import BatchDialog from './batch.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 selectedRows = ref<any[]>([])
|
||||
|
||||
// 表格列配<EFBFBD><EFBFBD>?
|
||||
// 表格列配置
|
||||
const tableColumns = [
|
||||
{ prop: 'deptName', label: '学院' },
|
||||
{ prop: 'buildingNo', label: '楼号' },
|
||||
{ prop: 'position', label: '教室位置' }
|
||||
]
|
||||
|
||||
// 列配置映射(用于图标<EFBFBD><EFBFBD>?
|
||||
// 列配置映射(用于图标显示
|
||||
const columnConfigMap: Record<string, { icon: any }> = {
|
||||
deptName: { icon: OfficeBuilding },
|
||||
buildingNo: { icon: OfficeBuilding },
|
||||
@@ -317,7 +317,7 @@ const getBuildingListData = async () => {
|
||||
}
|
||||
}
|
||||
|
||||
// 初始<EFBFBD><EFBFBD>?
|
||||
// 初始化
|
||||
onMounted(() => {
|
||||
getDeptListData()
|
||||
getBuildingListData()
|
||||
|
||||
@@ -1,21 +1,21 @@
|
||||
<template>
|
||||
<div class="modern-page-container">
|
||||
<div class="page-wrapper">
|
||||
<!-- 搜索表单卡片 -->
|
||||
<!-- ?????? -->
|
||||
<el-card v-show="showSearch" class="search-card" shadow="never">
|
||||
<template #header>
|
||||
<div class="card-header">
|
||||
<span class="card-title">
|
||||
<el-icon class="title-icon"><Search /></el-icon>
|
||||
筛选条<EFBFBD><EFBFBD>?
|
||||
?????
|
||||
</span>
|
||||
</div>
|
||||
</template>
|
||||
<el-form :model="state.queryForm" ref="searchFormRef" :inline="true" @keyup.enter="getDataList" class="search-form">
|
||||
<el-form-item label="批次" prop="termId">
|
||||
<el-form-item label="??" prop="termId">
|
||||
<el-select
|
||||
v-model="state.queryForm.termId"
|
||||
placeholder="请选择批次"
|
||||
placeholder="?????"
|
||||
clearable
|
||||
filterable
|
||||
style="width: 200px">
|
||||
@@ -27,10 +27,10 @@
|
||||
</el-option>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="学院" prop="deptCode">
|
||||
<el-form-item label="??" prop="deptCode">
|
||||
<el-select
|
||||
v-model="state.queryForm.deptCode"
|
||||
placeholder="请选择学院"
|
||||
placeholder="?????"
|
||||
clearable
|
||||
filterable
|
||||
style="width: 200px">
|
||||
@@ -42,10 +42,10 @@
|
||||
</el-option>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="入学年份" prop="grade">
|
||||
<el-form-item label="????" prop="grade">
|
||||
<el-select
|
||||
v-model="state.queryForm.grade"
|
||||
placeholder="请选择入学年份"
|
||||
placeholder="???????"
|
||||
clearable
|
||||
filterable
|
||||
style="width: 200px">
|
||||
@@ -57,19 +57,19 @@
|
||||
</el-option>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="年纪" prop="gradeCurr">
|
||||
<el-form-item label="??" prop="gradeCurr">
|
||||
<el-input-number
|
||||
v-model="state.queryForm.gradeCurr"
|
||||
placeholder="请输入年<EFBFBD><EFBFBD>?
|
||||
placeholder="?????"
|
||||
:min="1"
|
||||
:max="10"
|
||||
clearable
|
||||
style="width: 200px" />
|
||||
</el-form-item>
|
||||
<el-form-item label="班级" prop="classCode">
|
||||
<el-form-item label="??" prop="classCode">
|
||||
<el-select
|
||||
v-model="state.queryForm.classCode"
|
||||
placeholder="请选择班级"
|
||||
placeholder="?????"
|
||||
clearable
|
||||
filterable
|
||||
style="width: 200px">
|
||||
@@ -81,10 +81,10 @@
|
||||
</el-option>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="审核状<EFBFBD><EFBFBD>? prop="checkStatus">
|
||||
<el-form-item label="????" prop="checkStatus">
|
||||
<el-select
|
||||
v-model="state.queryForm.checkStatus"
|
||||
placeholder="请选择审核状<EFBFBD><EFBFBD>?
|
||||
placeholder="???????"
|
||||
clearable
|
||||
style="width: 200px">
|
||||
<el-option
|
||||
@@ -96,26 +96,26 @@
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item>
|
||||
<el-button type="primary" plain icon="Search" @click="getDataList">查询</el-button>
|
||||
<el-button icon="Refresh" @click="handleReset">重置</el-button>
|
||||
<el-button type="primary" plain icon="Search" @click="getDataList">??</el-button>
|
||||
<el-button icon="Refresh" @click="handleReset">??</el-button>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
</el-card>
|
||||
|
||||
<!-- 内容卡片 -->
|
||||
<!-- ???? -->
|
||||
<el-card class="content-card" shadow="never">
|
||||
<template #header>
|
||||
<div class="card-header">
|
||||
<span class="card-title">
|
||||
<el-icon class="title-icon"><Document /></el-icon>
|
||||
免学费学生列<EFBFBD><EFBFBD>?
|
||||
????????
|
||||
</span>
|
||||
<div class="header-actions">
|
||||
<el-button
|
||||
icon="Plus"
|
||||
type="primary"
|
||||
@click="handleAdd">
|
||||
新增
|
||||
??
|
||||
</el-button>
|
||||
<el-button
|
||||
icon="Download"
|
||||
@@ -123,7 +123,7 @@
|
||||
class="ml10"
|
||||
:loading="exportLoading"
|
||||
@click="handleExport">
|
||||
导出
|
||||
??
|
||||
</el-button>
|
||||
<right-toolbar
|
||||
v-model:showSearch="showSearch"
|
||||
@@ -139,7 +139,7 @@
|
||||
@order-change="handleColumnOrderChange"
|
||||
>
|
||||
<template #trigger>
|
||||
<el-tooltip class="item" effect="dark" content="列设<EFBFBD><EFBFBD>? placement="top">
|
||||
<el-tooltip class="item" effect="dark" content="???" placement="top">
|
||||
<el-button circle style="margin-left: 0;">
|
||||
<el-icon><Menu /></el-icon>
|
||||
</el-button>
|
||||
@@ -151,7 +151,7 @@
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<!-- 表格 -->
|
||||
<!-- ?? -->
|
||||
<el-table
|
||||
:data="state.dataList"
|
||||
v-loading="state.loading"
|
||||
@@ -159,7 +159,7 @@
|
||||
:cell-style="tableStyle.cellStyle"
|
||||
:header-cell-style="tableStyle.headerCellStyle"
|
||||
class="modern-table">
|
||||
<el-table-column type="index" label="序号" width="70" align="center">
|
||||
<el-table-column type="index" label="??" width="70" align="center">
|
||||
<template #header>
|
||||
<el-icon><List /></el-icon>
|
||||
</template>
|
||||
@@ -169,7 +169,7 @@
|
||||
</el-table-column>
|
||||
<template v-for="col in visibleColumnsSorted" :key="col.prop || col.label">
|
||||
<el-table-column
|
||||
v-if="checkColumnVisible(col.prop || '') && col.prop !== '操作'"
|
||||
v-if="checkColumnVisible(col.prop || '') && col.prop !== '??'"
|
||||
:prop="col.prop"
|
||||
:label="col.label"
|
||||
show-overflow-tooltip
|
||||
@@ -180,39 +180,39 @@
|
||||
<el-icon><component :is="columnConfigMap[col.prop]?.icon || Calendar" /></el-icon>
|
||||
<span style="margin-left: 4px">{{ col.label }}</span>
|
||||
</template>
|
||||
<!-- 年级列特殊模<EFBFBD><EFBFBD>?-->
|
||||
<!-- ????????-->
|
||||
<template v-if="col.prop === 'gradeCurr'" #default="scope">
|
||||
<el-tag v-if="scope.row.gradeCurr !== undefined && scope.row.gradeCurr !== null" size="small" type="primary" effect="plain">
|
||||
{{ scope.row.gradeCurr }}
|
||||
</el-tag>
|
||||
<span v-else>-</span>
|
||||
</template>
|
||||
<!-- 性别列特殊模<EFBFBD><EFBFBD>?-->
|
||||
<!-- ????????-->
|
||||
<template v-else-if="col.prop === 'gender'" #default="scope">
|
||||
<GenderTag :sex="scope.row.gender" />
|
||||
</template>
|
||||
<!-- 生源列特殊模<EFBFBD><EFBFBD>?-->
|
||||
<!-- ????????-->
|
||||
<template v-else-if="col.prop === 'education'" #default="scope">
|
||||
<el-tag v-if="scope.row.education" size="small" type="info" effect="plain">
|
||||
{{ formatEducation(scope.row.education) }}
|
||||
</el-tag>
|
||||
<span v-else>-</span>
|
||||
</template>
|
||||
<!-- 层次列特殊模<EFBFBD><EFBFBD>?-->
|
||||
<!-- ????????-->
|
||||
<template v-else-if="col.prop === 'majorLevel'" #default="scope">
|
||||
<el-tag v-if="scope.row.majorLevel" size="small" type="warning" effect="plain">
|
||||
{{ formatMajorLevel(scope.row.majorLevel) }}
|
||||
</el-tag>
|
||||
<span v-else>-</span>
|
||||
</template>
|
||||
<!-- 金额列特殊模<EFBFBD><EFBFBD>?-->
|
||||
<!-- ????????-->
|
||||
<template v-else-if="col.prop === 'money'" #default="scope">
|
||||
<el-tag v-if="scope.row.money !== undefined && scope.row.money !== null" size="small" type="success" effect="plain">
|
||||
¥{{ scope.row.money }}
|
||||
?{{ scope.row.money }}
|
||||
</el-tag>
|
||||
<span v-else>-</span>
|
||||
</template>
|
||||
<!-- 审核状态列特殊模板 -->
|
||||
<!-- ????????? -->
|
||||
<template v-else-if="col.prop === 'checkStatus'" #default="scope">
|
||||
<StatusTag
|
||||
:value="scope.row.checkStatus"
|
||||
@@ -222,10 +222,10 @@
|
||||
</template>
|
||||
</el-table-column>
|
||||
</template>
|
||||
<el-table-column label="操作" width="150" align="center" fixed="right">
|
||||
<el-table-column label="??" width="150" align="center" fixed="right">
|
||||
<template #header>
|
||||
<el-icon><Setting /></el-icon>
|
||||
<span style="margin-left: 4px">操作</span>
|
||||
<span style="margin-left: 4px">??</span>
|
||||
</template>
|
||||
<template #default="scope">
|
||||
<el-button
|
||||
@@ -233,20 +233,20 @@
|
||||
link
|
||||
type="primary"
|
||||
@click="handleEdit(scope.row)">
|
||||
编辑
|
||||
??
|
||||
</el-button>
|
||||
<el-button
|
||||
icon="Delete"
|
||||
link
|
||||
type="danger"
|
||||
@click="handleDelete(scope.row)">
|
||||
删除
|
||||
??
|
||||
</el-button>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
|
||||
<!-- 分页 -->
|
||||
<!-- ?? -->
|
||||
<div class="pagination-wrapper">
|
||||
<pagination
|
||||
@size-change="sizeChangeHandle"
|
||||
@@ -256,7 +256,7 @@
|
||||
</el-card>
|
||||
</div>
|
||||
|
||||
<!-- 新增/编辑表单弹窗 -->
|
||||
<!-- ??/?????? -->
|
||||
<!-- <form-dialog ref="formDialogRef" @refresh="getDataList" /> -->
|
||||
</div>
|
||||
</template>
|
||||
@@ -279,14 +279,14 @@ import {
|
||||
OfficeBuilding, Reading, UserFilled, Calendar, Sort, Grid,
|
||||
CreditCard, Avatar, Setting, Menu, Search, Document
|
||||
} from '@element-plus/icons-vue'
|
||||
import { useTableColumnControl } from '/@/hooks/tableColumnControl'
|
||||
import { useTableColumnControl } from '/@/hooks/tableColumn'
|
||||
|
||||
|
||||
// 引入组件
|
||||
// ????
|
||||
const GenderTag = defineAsyncComponent(() => import('/@/components/GenderTag/index.vue'))
|
||||
const StatusTag = defineAsyncComponent(() => import('/@/components/StatusTag/index.vue'))
|
||||
|
||||
// 定义变量内容
|
||||
// ??????
|
||||
const route = useRoute()
|
||||
const searchFormRef = ref()
|
||||
const columnControlRef = ref<any>()
|
||||
@@ -301,29 +301,29 @@ const genderList = ref<any[]>([])
|
||||
const educationList = ref<any[]>([])
|
||||
const majorLevelList = ref<any[]>([])
|
||||
const checkStatusList = ref<any[]>([
|
||||
{ label: '待审<EFBFBD><EFBFBD>?, value: '0' },
|
||||
{ label: '审核通过', value: '1' }
|
||||
{ label: '???', value: '0' },
|
||||
{ label: '????', value: '1' }
|
||||
])
|
||||
|
||||
// 表格列配<EFBFBD><EFBFBD>?
|
||||
// ??????
|
||||
const tableColumns = [
|
||||
{ prop: 'deptName', label: '学院', minWidth: 150 },
|
||||
{ prop: 'majorName', label: '专业', minWidth: 150 },
|
||||
{ prop: 'teacherName', label: '班主<EFBFBD><EFBFBD>?, width: 100 },
|
||||
{ prop: 'grade', label: '入学年份', width: 100 },
|
||||
{ prop: 'gradeCurr', label: '年级', width: 80 },
|
||||
{ prop: 'classNo', label: '班级', width: 120 },
|
||||
{ prop: 'stuNo', label: '学号', width: 120 },
|
||||
{ prop: 'realName', label: '姓名', width: 100 },
|
||||
{ prop: 'gender', label: '性别', width: 80 },
|
||||
{ prop: 'education', label: '生源', width: 100 },
|
||||
{ prop: 'majorLevel', label: '层次', width: 100 },
|
||||
{ prop: 'phone', label: '联系电话', width: 120 },
|
||||
{ prop: 'money', label: '金额', width: 100 },
|
||||
{ prop: 'checkStatus', label: '审核状<EFBFBD><EFBFBD>?, width: 100 }
|
||||
{ prop: 'deptName', label: '??', minWidth: 150 },
|
||||
{ prop: 'majorName', label: '??', minWidth: 150 },
|
||||
{ prop: 'teacherName', label: '???', width: 100 },
|
||||
{ prop: 'grade', label: '????', width: 100 },
|
||||
{ prop: 'gradeCurr', label: '??', width: 80 },
|
||||
{ prop: 'classNo', label: '??', width: 120 },
|
||||
{ prop: 'stuNo', label: '??', width: 120 },
|
||||
{ prop: 'realName', label: '??', width: 100 },
|
||||
{ prop: 'gender', label: '??', width: 80 },
|
||||
{ prop: 'education', label: '??', width: 100 },
|
||||
{ prop: 'majorLevel', label: '??', width: 100 },
|
||||
{ prop: 'phone', label: '????', width: 120 },
|
||||
{ prop: 'money', label: '??', width: 100 },
|
||||
{ prop: 'checkStatus', label: '????', width: 100 }
|
||||
]
|
||||
|
||||
// 列配置映射(用于图标<EFBFBD><EFBFBD>?
|
||||
// ????????????
|
||||
const columnConfigMap: Record<string, { icon: any }> = {
|
||||
deptName: { icon: OfficeBuilding },
|
||||
majorName: { icon: Reading },
|
||||
@@ -341,7 +341,7 @@ const columnConfigMap: Record<string, { icon: any }> = {
|
||||
checkStatus: { icon: CircleCheck }
|
||||
}
|
||||
|
||||
// 使用表格列控制hook
|
||||
// ???????hook
|
||||
const {
|
||||
visibleColumns,
|
||||
visibleColumnsSorted,
|
||||
@@ -350,13 +350,13 @@ const {
|
||||
handleColumnOrderChange
|
||||
} = useTableColumnControl(tableColumns, route.path)
|
||||
|
||||
// 表格样式
|
||||
// ????
|
||||
const tableStyle = {
|
||||
cellStyle: { padding: '8px 0' },
|
||||
headerCellStyle: { background: '#f5f7fa', color: '#606266', fontWeight: 'bold' }
|
||||
}
|
||||
|
||||
// 配置 useTable
|
||||
// ?? useTable
|
||||
const state: BasicTableProps = reactive<BasicTableProps>({
|
||||
queryForm: {
|
||||
termId: '',
|
||||
@@ -382,7 +382,7 @@ const {
|
||||
tableStyle: _tableStyle
|
||||
} = useTable(state)
|
||||
|
||||
// 格式化性别
|
||||
// ?????
|
||||
const formatGender = (value: string | number) => {
|
||||
if (value === null || value === undefined || value === '') {
|
||||
return '-'
|
||||
@@ -391,7 +391,7 @@ const formatGender = (value: string | number) => {
|
||||
return dictItem ? dictItem.label : value
|
||||
}
|
||||
|
||||
// 格式化生<EFBFBD><EFBFBD>?
|
||||
// ??????
|
||||
const formatEducation = (value: string | number) => {
|
||||
if (value === null || value === undefined || value === '') {
|
||||
return '-'
|
||||
@@ -400,7 +400,7 @@ const formatEducation = (value: string | number) => {
|
||||
return dictItem ? dictItem.label : value
|
||||
}
|
||||
|
||||
// 格式化层<EFBFBD><EFBFBD>?
|
||||
// ??????
|
||||
const formatMajorLevel = (value: string | number) => {
|
||||
if (value === null || value === undefined || value === '') {
|
||||
return '-'
|
||||
@@ -409,7 +409,7 @@ const formatMajorLevel = (value: string | number) => {
|
||||
return dictItem ? dictItem.label : value
|
||||
}
|
||||
|
||||
// 格式化审核状<EFBFBD><EFBFBD>?
|
||||
// ????????
|
||||
const formatCheckStatus = (value: string | number) => {
|
||||
if (value === null || value === undefined || value === '') {
|
||||
return '-'
|
||||
@@ -418,7 +418,7 @@ const formatCheckStatus = (value: string | number) => {
|
||||
return dictItem ? dictItem.label : value
|
||||
}
|
||||
|
||||
// 重置
|
||||
// ??
|
||||
const handleReset = () => {
|
||||
searchFormRef.value?.resetFields()
|
||||
state.queryForm.termId = ''
|
||||
@@ -430,40 +430,40 @@ const handleReset = () => {
|
||||
getDataList()
|
||||
}
|
||||
|
||||
// 新增
|
||||
// ??
|
||||
const handleAdd = () => {
|
||||
useMessage().info('新增功能待开<EFBFBD><EFBFBD>?)
|
||||
useMessage().info('?????')
|
||||
// formDialogRef.value?.openDialog('add')
|
||||
}
|
||||
|
||||
// 编辑
|
||||
// ??
|
||||
const handleEdit = (row: any) => {
|
||||
useMessage().info('编辑功能待开<EFBFBD><EFBFBD>?)
|
||||
useMessage().info('?????')
|
||||
// formDialogRef.value?.openDialog('edit', row.id)
|
||||
}
|
||||
|
||||
// 删除
|
||||
// ??
|
||||
const handleDelete = async (row: any) => {
|
||||
try {
|
||||
const { confirm } = useMessageBox()
|
||||
await confirm(`确定要删除学号为 ${row.stuNo} 的免学费记录吗?`)
|
||||
await confirm(`???????? ${row.stuNo} ????????`)
|
||||
await delObj(row.id)
|
||||
useMessage().success('删除成功')
|
||||
useMessage().success('????')
|
||||
getDataList()
|
||||
} catch (err: any) {
|
||||
if (err !== 'cancel') {
|
||||
useMessage().error(err.msg || '删除失败')
|
||||
useMessage().error(err.msg || '????')
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// 导出
|
||||
// ??
|
||||
const handleExport = async () => {
|
||||
try {
|
||||
exportLoading.value = true
|
||||
const res = await exportExcel(state.queryForm)
|
||||
const blob = new Blob([res.data as BlobPart])
|
||||
const fileName = `免学费查询_${new Date().getTime()}.xls`
|
||||
const fileName = `?????_${new Date().getTime()}.xls`
|
||||
const elink = document.createElement('a')
|
||||
elink.download = fileName
|
||||
elink.style.display = 'none'
|
||||
@@ -472,15 +472,15 @@ const handleExport = async () => {
|
||||
elink.click()
|
||||
URL.revokeObjectURL(elink.href)
|
||||
document.body.removeChild(elink)
|
||||
useMessage().success('导出成功')
|
||||
useMessage().success('????')
|
||||
} catch (err: any) {
|
||||
useMessage().error(err.msg || '导出失败')
|
||||
useMessage().error(err.msg || '????')
|
||||
} finally {
|
||||
exportLoading.value = false
|
||||
}
|
||||
}
|
||||
|
||||
// 获取批次列表
|
||||
// ??????
|
||||
const getTermList = async () => {
|
||||
try {
|
||||
const res = await request({
|
||||
@@ -497,7 +497,7 @@ const getTermList = async () => {
|
||||
}
|
||||
}
|
||||
|
||||
// 获取学院列表
|
||||
// ??????
|
||||
const getDeptListData = async () => {
|
||||
try {
|
||||
const res = await getDeptList()
|
||||
@@ -511,7 +511,7 @@ const getDeptListData = async () => {
|
||||
}
|
||||
}
|
||||
|
||||
// 获取班级列表
|
||||
// ??????
|
||||
const getClassListData = async () => {
|
||||
try {
|
||||
const res = await getClassListByRole()
|
||||
@@ -525,7 +525,7 @@ const getClassListData = async () => {
|
||||
}
|
||||
}
|
||||
|
||||
// 获取入学年份列表
|
||||
// ????????
|
||||
const getGradeList = async () => {
|
||||
try {
|
||||
const res = await queryAllSchoolYear()
|
||||
@@ -539,7 +539,7 @@ const getGradeList = async () => {
|
||||
}
|
||||
}
|
||||
|
||||
// 获取性别字典
|
||||
// ??????
|
||||
const getGenderDict = async () => {
|
||||
try {
|
||||
const res = await getDicts('sexy')
|
||||
@@ -556,7 +556,7 @@ const getGenderDict = async () => {
|
||||
}
|
||||
}
|
||||
|
||||
// 获取生源字典
|
||||
// ??????
|
||||
const getEducationDict = async () => {
|
||||
try {
|
||||
const res = await getDicts('pre_school_education')
|
||||
@@ -573,7 +573,7 @@ const getEducationDict = async () => {
|
||||
}
|
||||
}
|
||||
|
||||
// 获取层次字典
|
||||
// ??????
|
||||
const getMajorLevelDict = async () => {
|
||||
try {
|
||||
const res = await getDicts('basic_major_level')
|
||||
@@ -590,7 +590,7 @@ const getMajorLevelDict = async () => {
|
||||
}
|
||||
}
|
||||
|
||||
// 初始<EFBFBD><EFBFBD>?
|
||||
// ????
|
||||
onMounted(() => {
|
||||
getTermList()
|
||||
getDeptListData()
|
||||
|
||||
@@ -1,40 +1,40 @@
|
||||
<template>
|
||||
<div class="modern-page-container">
|
||||
<div class="page-wrapper">
|
||||
<!-- 搜索表单卡片 -->
|
||||
<!-- ?????? -->
|
||||
<el-card v-show="showSearch" class="search-card" shadow="never">
|
||||
<template #header>
|
||||
<div class="card-header">
|
||||
<span class="card-title">
|
||||
<el-icon class="title-icon"><Search /></el-icon>
|
||||
筛选条<EFBFBD><EFBFBD>?
|
||||
?????
|
||||
</span>
|
||||
</div>
|
||||
</template>
|
||||
<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
|
||||
v-model="searchForm.effectiveMoney"
|
||||
placeholder="可用余额大于"
|
||||
placeholder="???????"
|
||||
:precision="2"
|
||||
:min="0"
|
||||
clearable
|
||||
style="width: 200px" />
|
||||
</el-form-item>
|
||||
<el-form-item label="已住人数" prop="isLiveNum">
|
||||
<el-form-item label="????" prop="isLiveNum">
|
||||
<el-select
|
||||
v-model="searchForm.isLiveNum"
|
||||
placeholder="请选择"
|
||||
placeholder="?????"
|
||||
clearable
|
||||
style="width: 200px">
|
||||
<el-option label="大于0" :value="true" />
|
||||
<el-option label="等于0" :value="false" />
|
||||
<el-option label="??0" :value="true" />
|
||||
<el-option label="??0" :value="false" />
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="楼号" prop="buildNo">
|
||||
<el-form-item label="??" prop="buildNo">
|
||||
<el-select
|
||||
v-model="searchForm.buildNo"
|
||||
placeholder="请选择楼号"
|
||||
placeholder="?????"
|
||||
clearable
|
||||
filterable
|
||||
style="width: 200px">
|
||||
@@ -46,48 +46,48 @@
|
||||
</el-option>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="宿舍<EFBFBD><EFBFBD>? prop="roomNo">
|
||||
<el-form-item label="???" prop="roomNo">
|
||||
<el-input
|
||||
v-model="searchForm.roomNo"
|
||||
placeholder="请输入宿舍号"
|
||||
placeholder="??????"
|
||||
clearable
|
||||
style="width: 200px" />
|
||||
</el-form-item>
|
||||
<el-form-item>
|
||||
<el-button type="primary" plain icon="Search" @click="handleSearch">查询</el-button>
|
||||
<el-button icon="Refresh" @click="handleReset">重置</el-button>
|
||||
<el-button type="primary" plain icon="Search" @click="handleSearch">??</el-button>
|
||||
<el-button icon="Refresh" @click="handleReset">??</el-button>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
</el-card>
|
||||
|
||||
<!-- 内容卡片 -->
|
||||
<!-- ???? -->
|
||||
<el-card class="content-card" shadow="never">
|
||||
<template #header>
|
||||
<div class="card-header">
|
||||
<span class="card-title">
|
||||
<el-icon class="title-icon"><Document /></el-icon>
|
||||
水电明细列表
|
||||
??????
|
||||
</span>
|
||||
<div class="header-actions">
|
||||
<el-button
|
||||
icon="FolderAdd"
|
||||
type="primary"
|
||||
@click="formDialogRef.openDialog()">
|
||||
<EFBFBD><EFBFBD>?<EFBFBD><EFBFBD>?
|
||||
????
|
||||
</el-button>
|
||||
<el-button
|
||||
icon="Download"
|
||||
type="success"
|
||||
class="ml10"
|
||||
@click="handleExport">
|
||||
<EFBFBD><EFBFBD>?<EFBFBD><EFBFBD>?
|
||||
????
|
||||
</el-button>
|
||||
<el-button
|
||||
icon="Setting"
|
||||
type="warning"
|
||||
class="ml10"
|
||||
@click="handleInitWaterOrder">
|
||||
初始化本期水电补<EFBFBD><EFBFBD>?
|
||||
??????????
|
||||
</el-button>
|
||||
<right-toolbar
|
||||
v-model:showSearch="showSearch"
|
||||
@@ -103,7 +103,7 @@
|
||||
@order-change="handleColumnOrderChange"
|
||||
>
|
||||
<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-icon><Menu /></el-icon>
|
||||
</el-button>
|
||||
@@ -115,7 +115,7 @@
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<!-- 表格 -->
|
||||
<!-- ?? -->
|
||||
<el-table
|
||||
:data="state.dataList"
|
||||
v-loading="state.loading"
|
||||
@@ -124,7 +124,7 @@
|
||||
:header-cell-style="tableStyle.headerCellStyle"
|
||||
class="modern-table"
|
||||
@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>
|
||||
<el-icon><List /></el-icon>
|
||||
</template>
|
||||
@@ -134,7 +134,7 @@
|
||||
</el-table-column>
|
||||
<template v-for="col in visibleColumnsSorted" :key="col.prop || col.label">
|
||||
<el-table-column
|
||||
v-if="checkColumnVisible(col.prop || '') && col.prop !== '操作'"
|
||||
v-if="checkColumnVisible(col.prop || '') && col.prop !== '??'"
|
||||
:prop="col.prop"
|
||||
:label="col.label"
|
||||
show-overflow-tooltip
|
||||
@@ -145,53 +145,53 @@
|
||||
<el-icon><component :is="columnConfigMap[col.prop]?.icon || Money" /></el-icon>
|
||||
<span style="margin-left: 4px">{{ col.label }}</span>
|
||||
</template>
|
||||
<!-- 几人间列特殊模板 -->
|
||||
<!-- ???????? -->
|
||||
<template v-if="col.prop === 'bedNum'" #default="scope">
|
||||
<el-tag v-if="scope.row.bedNum" size="small" type="info" effect="plain">
|
||||
{{ scope.row.bedNum }}人间
|
||||
{{ scope.row.bedNum }}??
|
||||
</el-tag>
|
||||
<span v-else>-</span>
|
||||
</template>
|
||||
<!-- 已住人数列特殊模<EFBFBD><EFBFBD>?-->
|
||||
<!-- ??????????-->
|
||||
<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">
|
||||
{{ scope.row.liveNum }}
|
||||
</el-tag>
|
||||
<span v-else>-</span>
|
||||
</template>
|
||||
<!-- 校园补贴列特殊模<EFBFBD><EFBFBD>?-->
|
||||
<!-- ??????????-->
|
||||
<template v-else-if="col.prop === 'oddbMoney'" #default="scope">
|
||||
<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>
|
||||
<span v-else>¥0.00</span>
|
||||
<span v-else>?0.00</span>
|
||||
</template>
|
||||
<!-- 充值金额列特殊模板 -->
|
||||
<!-- ????????? -->
|
||||
<template v-else-if="col.prop === 'rechargeMoney'" #default="scope">
|
||||
<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>
|
||||
<span v-else>¥0.00</span>
|
||||
<span v-else>?0.00</span>
|
||||
</template>
|
||||
<!-- 消费金额列特殊模<EFBFBD><EFBFBD>?-->
|
||||
<!-- ??????????-->
|
||||
<template v-else-if="col.prop === 'costMoney'" #default="scope">
|
||||
<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>
|
||||
<span v-else>¥0.00</span>
|
||||
<span v-else>?0.00</span>
|
||||
</template>
|
||||
<!-- 可用余额列特殊模<EFBFBD><EFBFBD>?-->
|
||||
<!-- ??????????-->
|
||||
<template v-else-if="col.prop === 'effectiveMoney'" #default="scope">
|
||||
<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>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</template>
|
||||
<el-table-column label="操作" width="200" align="center" fixed="right">
|
||||
<el-table-column label="??" width="200" align="center" fixed="right">
|
||||
<template #header>
|
||||
<el-icon><Setting /></el-icon>
|
||||
<span style="margin-left: 4px">操作</span>
|
||||
<span style="margin-left: 4px">??</span>
|
||||
</template>
|
||||
<template #default="scope">
|
||||
<el-button
|
||||
@@ -199,27 +199,27 @@
|
||||
link
|
||||
type="primary"
|
||||
@click="handleEdit(scope.row)">
|
||||
编辑
|
||||
??
|
||||
</el-button>
|
||||
<el-button
|
||||
icon="View"
|
||||
link
|
||||
type="info"
|
||||
@click="handleViewDetail(scope.row)">
|
||||
明细
|
||||
??
|
||||
</el-button>
|
||||
<el-button
|
||||
icon="Delete"
|
||||
link
|
||||
type="danger"
|
||||
@click="handleDelete(scope.row)">
|
||||
删除
|
||||
??
|
||||
</el-button>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
|
||||
<!-- 分页 -->
|
||||
<!-- ?? -->
|
||||
<div class="pagination-wrapper">
|
||||
<pagination
|
||||
@size-change="sizeChangeHandle"
|
||||
@@ -229,28 +229,28 @@
|
||||
</el-card>
|
||||
</div>
|
||||
|
||||
<!-- 表单弹窗 -->
|
||||
<!-- ???? -->
|
||||
<FormDialog ref="formDialogRef" @refresh="getDataList()" />
|
||||
|
||||
<!-- 明细弹窗 -->
|
||||
<!-- ???? -->
|
||||
<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-item label="补贴金额" prop="costMoney">
|
||||
<el-form-item label="????" prop="costMoney">
|
||||
<el-input-number
|
||||
v-model="initForm.costMoney"
|
||||
:precision="2"
|
||||
:min="0"
|
||||
placeholder="请输入补贴金<EFBFBD><EFBFBD>?
|
||||
placeholder="???????"
|
||||
style="width: 100%" />
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
<template #footer>
|
||||
<span class="dialog-footer">
|
||||
<el-button @click="initDialogVisible = false"><EFBFBD><EFBFBD>?<EFBFBD><EFBFBD>?/el-button>
|
||||
<el-button type="primary" @click="confirmInit" :loading="initLoading"><EFBFBD><EFBFBD>?<EFBFBD><EFBFBD>?/el-button>
|
||||
<el-button @click="initDialogVisible = false">??</el-button>
|
||||
<el-button type="primary" @click="confirmInit" :loading="initLoading">??</el-button>
|
||||
</span>
|
||||
</template>
|
||||
</el-dialog>
|
||||
@@ -268,10 +268,10 @@ import TableColumnControl from '/@/components/TableColumnControl/index.vue'
|
||||
import FormDialog from './form.vue';
|
||||
import DetailDialog from './detail.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 searchFormRef = ref()
|
||||
const columnControlRef = ref<any>()
|
||||
@@ -283,19 +283,19 @@ const buildingList = ref<any[]>([])
|
||||
const initDialogVisible = ref(false)
|
||||
const initLoading = ref(false)
|
||||
|
||||
// 表格列配<EFBFBD><EFBFBD>?
|
||||
// ??????
|
||||
const tableColumns = [
|
||||
{ prop: 'buildNo', label: '楼号' },
|
||||
{ prop: 'roomNo', label: '宿舍<EFBFBD><EFBFBD>? },
|
||||
{ prop: 'bedNum', label: '几人<EFBFBD><EFBFBD>? },
|
||||
{ prop: 'liveNum', label: '已住人数' },
|
||||
{ prop: 'oddbMoney', label: '校园补贴' },
|
||||
{ prop: 'rechargeMoney', label: '充值金<EFBFBD><EFBFBD>? },
|
||||
{ prop: 'costMoney', label: '消费金额' },
|
||||
{ prop: 'effectiveMoney', label: '可用余额' }
|
||||
{ prop: 'buildNo', label: '??' },
|
||||
{ prop: 'roomNo', label: '???' },
|
||||
{ prop: 'bedNum', label: '???' },
|
||||
{ prop: 'liveNum', label: '????' },
|
||||
{ prop: 'oddbMoney', label: '????' },
|
||||
{ prop: 'rechargeMoney', label: '????' },
|
||||
{ prop: 'costMoney', label: '????' },
|
||||
{ prop: 'effectiveMoney', label: '????' }
|
||||
]
|
||||
|
||||
// 列配置映射(用于图标<EFBFBD><EFBFBD>?
|
||||
// ????????????
|
||||
const columnConfigMap: Record<string, { icon: any }> = {
|
||||
buildNo: { icon: OfficeBuilding },
|
||||
roomNo: { icon: House },
|
||||
@@ -307,7 +307,7 @@ const columnConfigMap: Record<string, { icon: any }> = {
|
||||
effectiveMoney: { icon: Money }
|
||||
}
|
||||
|
||||
// 使用表格列控制hook
|
||||
// ???????hook
|
||||
const {
|
||||
visibleColumns,
|
||||
visibleColumnsSorted,
|
||||
@@ -316,7 +316,7 @@ const {
|
||||
handleColumnOrderChange
|
||||
} = useTableColumnControl(tableColumns, route.path)
|
||||
|
||||
// 搜索表单
|
||||
// ????
|
||||
const searchForm = reactive({
|
||||
effectiveMoney: undefined as number | undefined,
|
||||
isLiveNum: undefined as boolean | undefined,
|
||||
@@ -324,20 +324,20 @@ const searchForm = reactive({
|
||||
roomNo: ''
|
||||
})
|
||||
|
||||
// 初始化表<EFBFBD><EFBFBD>?
|
||||
// ??????
|
||||
const initForm = reactive({
|
||||
costMoney: 0
|
||||
})
|
||||
|
||||
// 初始化表单验证规<EFBFBD><EFBFBD>?
|
||||
// ??????????
|
||||
const initRules = {
|
||||
costMoney: [
|
||||
{ required: true, message: '请输入补贴金<EFBFBD><EFBFBD>?, trigger: 'blur' },
|
||||
{ type: 'number', min: 0, message: '补贴金额必须大于等于0', trigger: 'blur' }
|
||||
{ required: true, message: '???????', trigger: 'blur' },
|
||||
{ type: 'number', min: 0, message: '??????????0', trigger: 'blur' }
|
||||
]
|
||||
}
|
||||
|
||||
// 配置 useTable
|
||||
// ?? useTable
|
||||
const state: BasicTableProps = reactive<BasicTableProps>({
|
||||
queryForm: searchForm,
|
||||
pageList: fetchList,
|
||||
@@ -357,12 +357,12 @@ const {
|
||||
tableStyle
|
||||
} = useTable(state)
|
||||
|
||||
// 查询
|
||||
// ??
|
||||
const handleSearch = () => {
|
||||
getDataList()
|
||||
}
|
||||
|
||||
// 重置
|
||||
// ??
|
||||
const handleReset = () => {
|
||||
searchFormRef.value?.formRef?.resetFields()
|
||||
searchForm.effectiveMoney = undefined
|
||||
@@ -372,43 +372,43 @@ const handleReset = () => {
|
||||
getDataList()
|
||||
}
|
||||
|
||||
// 编辑
|
||||
// ??
|
||||
const handleEdit = (row: any) => {
|
||||
formDialogRef.value.openDialog('edit', row)
|
||||
}
|
||||
|
||||
// 查看明细
|
||||
// ????
|
||||
const handleViewDetail = (row: any) => {
|
||||
detailDialogRef.value.openDialog(row.roomNo)
|
||||
}
|
||||
|
||||
// 删除
|
||||
// ??
|
||||
const handleDelete = async (row: any) => {
|
||||
try {
|
||||
await useMessageBox().confirm('确定要删除该记录吗?')
|
||||
await useMessageBox().confirm('???????????')
|
||||
await delObjs([row.id])
|
||||
useMessage().success('删除成功')
|
||||
useMessage().success('????')
|
||||
getDataList()
|
||||
} catch (err: any) {
|
||||
if (err !== 'cancel') {
|
||||
useMessage().error(err.msg || '删除失败')
|
||||
useMessage().error(err.msg || '????')
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// 导出
|
||||
// ??
|
||||
const handleExport = () => {
|
||||
// TODO: 实现导出功能
|
||||
useMessage().warning('导出功能开发中')
|
||||
// TODO: ????
|
||||
useMessage().warning('???????')
|
||||
}
|
||||
|
||||
// 初始化本期水电补<EFBFBD><EFBFBD>?
|
||||
// ??????????
|
||||
const handleInitWaterOrder = () => {
|
||||
initDialogVisible.value = true
|
||||
initForm.costMoney = 0
|
||||
}
|
||||
|
||||
// 确认初始<EFBFBD><EFBFBD>?
|
||||
// ??????
|
||||
const confirmInit = async () => {
|
||||
if (!initFormRef.value) return
|
||||
|
||||
@@ -418,18 +418,18 @@ const confirmInit = async () => {
|
||||
initLoading.value = true
|
||||
try {
|
||||
await initWaterOrder({ costMoney: initForm.costMoney })
|
||||
useMessage().success('初始化成<EFBFBD><EFBFBD>?)
|
||||
useMessage().success('?????')
|
||||
initDialogVisible.value = false
|
||||
getDataList()
|
||||
} catch (err: any) {
|
||||
useMessage().error(err.msg || '初始化失<EFBFBD><EFBFBD>?)
|
||||
useMessage().error(err.msg || '?????')
|
||||
} finally {
|
||||
initLoading.value = false
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
// 获取楼号列表
|
||||
// ??????
|
||||
const getBuildingListData = async () => {
|
||||
try {
|
||||
const res = await getBuildingList()
|
||||
@@ -441,7 +441,7 @@ const getBuildingListData = async () => {
|
||||
}
|
||||
}
|
||||
|
||||
// 初始<EFBFBD><EFBFBD>?
|
||||
// ????
|
||||
onMounted(() => {
|
||||
getBuildingListData()
|
||||
nextTick(() => {
|
||||
|
||||
@@ -1,28 +1,28 @@
|
||||
<template>
|
||||
<div class="modern-page-container">
|
||||
<div class="page-wrapper">
|
||||
<!-- 搜索表单卡片 -->
|
||||
<!-- ?????? -->
|
||||
<el-card v-show="showSearch" class="search-card" shadow="never">
|
||||
<template #header>
|
||||
<div class="card-header">
|
||||
<span class="card-title">
|
||||
<el-icon class="title-icon"><Search /></el-icon>
|
||||
筛选条<EFBFBD><EFBFBD>?
|
||||
?????
|
||||
</span>
|
||||
</div>
|
||||
</template>
|
||||
<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
|
||||
v-model="searchForm.roomNo"
|
||||
placeholder="请输入宿舍号"
|
||||
placeholder="??????"
|
||||
clearable
|
||||
style="width: 200px" />
|
||||
</el-form-item>
|
||||
<el-form-item label="学年" prop="year">
|
||||
<el-form-item label="??" prop="year">
|
||||
<el-select
|
||||
v-model="searchForm.year"
|
||||
placeholder="请选择学年"
|
||||
placeholder="?????"
|
||||
clearable
|
||||
filterable
|
||||
style="width: 200px">
|
||||
@@ -34,10 +34,10 @@
|
||||
</el-option>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="学期" prop="period">
|
||||
<el-form-item label="??" prop="period">
|
||||
<el-select
|
||||
v-model="searchForm.period"
|
||||
placeholder="请选择学期"
|
||||
placeholder="?????"
|
||||
clearable
|
||||
style="width: 200px">
|
||||
<el-option
|
||||
@@ -49,26 +49,26 @@
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item>
|
||||
<el-button type="primary" plain icon="Search" @click="handleSearch">查询</el-button>
|
||||
<el-button icon="Refresh" @click="handleReset">重置</el-button>
|
||||
<el-button type="primary" plain icon="Search" @click="handleSearch">??</el-button>
|
||||
<el-button icon="Refresh" @click="handleReset">??</el-button>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
</el-card>
|
||||
|
||||
<!-- 内容卡片 -->
|
||||
<!-- ???? -->
|
||||
<el-card class="content-card" shadow="never">
|
||||
<template #header>
|
||||
<div class="card-header">
|
||||
<span class="card-title">
|
||||
<el-icon class="title-icon"><Document /></el-icon>
|
||||
水电订单列表
|
||||
??????
|
||||
</span>
|
||||
<div class="header-actions">
|
||||
<el-button
|
||||
icon="FolderAdd"
|
||||
type="primary"
|
||||
@click="formDialogRef.openDialog()">
|
||||
<EFBFBD><EFBFBD>?<EFBFBD><EFBFBD>?
|
||||
????
|
||||
</el-button>
|
||||
<right-toolbar
|
||||
v-model:showSearch="showSearch"
|
||||
@@ -84,7 +84,7 @@
|
||||
@order-change="handleColumnOrderChange"
|
||||
>
|
||||
<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-icon><Menu /></el-icon>
|
||||
</el-button>
|
||||
@@ -96,7 +96,7 @@
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<!-- 表格 -->
|
||||
<!-- ?? -->
|
||||
<el-table
|
||||
:data="state.dataList"
|
||||
v-loading="state.loading"
|
||||
@@ -105,7 +105,7 @@
|
||||
:header-cell-style="tableStyle.headerCellStyle"
|
||||
class="modern-table"
|
||||
@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>
|
||||
<el-icon><List /></el-icon>
|
||||
</template>
|
||||
@@ -115,7 +115,7 @@
|
||||
</el-table-column>
|
||||
<template v-for="col in visibleColumnsSorted" :key="col.prop || col.label">
|
||||
<el-table-column
|
||||
v-if="checkColumnVisible(col.prop || '') && col.prop !== '操作'"
|
||||
v-if="checkColumnVisible(col.prop || '') && col.prop !== '??'"
|
||||
:prop="col.prop"
|
||||
:label="col.label"
|
||||
show-overflow-tooltip
|
||||
@@ -124,40 +124,40 @@
|
||||
<el-icon><component :is="columnConfigMap[col.prop]?.icon || Calendar" /></el-icon>
|
||||
<span style="margin-left: 4px">{{ col.label }}</span>
|
||||
</template>
|
||||
<!-- 学期列特殊模<EFBFBD><EFBFBD>?-->
|
||||
<!-- ????????-->
|
||||
<template v-if="col.prop === 'period'" #default="scope">
|
||||
<el-tag size="small" type="primary" effect="plain">
|
||||
{{ formatSchoolTerm(scope.row.period) }}
|
||||
</el-tag>
|
||||
</template>
|
||||
<!-- 类型列特殊模<EFBFBD><EFBFBD>?-->
|
||||
<!-- ????????-->
|
||||
<template v-else-if="col.prop === 'type'" #default="scope">
|
||||
<el-tag size="small" type="info" effect="plain">
|
||||
{{ formatType(scope.row.type) }}
|
||||
</el-tag>
|
||||
</template>
|
||||
<!-- 充值类型列特殊模板 -->
|
||||
<!-- ????????? -->
|
||||
<template v-else-if="col.prop === 'paymentCode'" #default="scope">
|
||||
<el-tag size="small" type="warning" effect="plain">
|
||||
{{ formatPaymentType(scope.row.paymentCode) }}
|
||||
</el-tag>
|
||||
</template>
|
||||
<!-- 金额列特殊模<EFBFBD><EFBFBD>?-->
|
||||
<!-- ????????-->
|
||||
<template v-else-if="col.prop === 'money'" #default="scope">
|
||||
<el-tag v-if="scope.row.money" size="small" type="success" effect="plain">
|
||||
¥{{ scope.row.money }}
|
||||
?{{ scope.row.money }}
|
||||
</el-tag>
|
||||
<span v-else>-</span>
|
||||
</template>
|
||||
<!-- 充值结果列特殊模板 -->
|
||||
<!-- ????????? -->
|
||||
<template v-else-if="col.prop === 'chargeState'" #default="scope">
|
||||
<StatusTag
|
||||
: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' } }"
|
||||
/>
|
||||
</template>
|
||||
<!-- 状态列特殊模板 -->
|
||||
<!-- ??????? -->
|
||||
<template v-else-if="col.prop === 'state'" #default="scope">
|
||||
<el-tag size="small" type="info" effect="plain">
|
||||
{{ formatState(scope.row.state) }}
|
||||
@@ -165,10 +165,10 @@
|
||||
</template>
|
||||
</el-table-column>
|
||||
</template>
|
||||
<el-table-column label="操作" width="150" align="center" fixed="right">
|
||||
<el-table-column label="??" width="150" align="center" fixed="right">
|
||||
<template #header>
|
||||
<el-icon><Setting /></el-icon>
|
||||
<span style="margin-left: 4px">操作</span>
|
||||
<span style="margin-left: 4px">??</span>
|
||||
</template>
|
||||
<template #default="scope">
|
||||
<el-button
|
||||
@@ -176,20 +176,20 @@
|
||||
link
|
||||
type="primary"
|
||||
@click="handleEdit(scope.row)">
|
||||
编辑
|
||||
??
|
||||
</el-button>
|
||||
<el-button
|
||||
icon="Delete"
|
||||
link
|
||||
type="danger"
|
||||
@click="handleDelete(scope.row)">
|
||||
删除
|
||||
??
|
||||
</el-button>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
|
||||
<!-- 分页 -->
|
||||
<!-- ?? -->
|
||||
<div class="pagination-wrapper">
|
||||
<pagination
|
||||
@size-change="sizeChangeHandle"
|
||||
@@ -199,7 +199,7 @@
|
||||
</el-card>
|
||||
</div>
|
||||
|
||||
<!-- 表单弹窗 -->
|
||||
<!-- ???? -->
|
||||
<FormDialog ref="formDialogRef" @refresh="getDataList()" />
|
||||
</div>
|
||||
</template>
|
||||
@@ -215,12 +215,12 @@ import { useMessage, useMessageBox } from "/@/hooks/message";
|
||||
import TableColumnControl from '/@/components/TableColumnControl/index.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 { useTableColumnControl } from '/@/hooks/tableColumnControl'
|
||||
import { useTableColumnControl } from '/@/hooks/tableColumn'
|
||||
|
||||
import { defineAsyncComponent } from 'vue'
|
||||
const StatusTag = defineAsyncComponent(() => import('/@/components/StatusTag/index.vue'))
|
||||
|
||||
// 定义变量内容
|
||||
// ??????
|
||||
const route = useRoute()
|
||||
const searchFormRef = ref()
|
||||
const columnControlRef = ref<any>()
|
||||
@@ -233,22 +233,22 @@ const paymentTypeList = ref<any[]>([])
|
||||
const chargeStateList = ref<any[]>([])
|
||||
const stateList = ref<any[]>([])
|
||||
|
||||
// 表格列配<EFBFBD><EFBFBD>?
|
||||
// ??????
|
||||
const tableColumns = [
|
||||
{ prop: 'roomNo', label: '宿舍<EFBFBD><EFBFBD>? },
|
||||
{ prop: 'year', label: '学年' },
|
||||
{ prop: 'period', label: '学期' },
|
||||
{ prop: 'orderNum', label: '订单<EFBFBD><EFBFBD>? },
|
||||
{ prop: 'type', label: '类型' },
|
||||
{ prop: 'paymentCode', label: '充值类<EFBFBD><EFBFBD>? },
|
||||
{ prop: 'money', label: '金额' },
|
||||
{ prop: 'chargeAccount', label: '充值人的账<EFBFBD><EFBFBD>? },
|
||||
{ prop: 'chargeRealname', label: '充值人的真实姓<EFBFBD><EFBFBD>? },
|
||||
{ prop: 'chargeState', label: '充值结<EFBFBD><EFBFBD>? },
|
||||
{ prop: 'state', label: '状<EFBFBD><EFBFBD>? }
|
||||
{ prop: 'roomNo', label: '???' },
|
||||
{ prop: 'year', label: '??' },
|
||||
{ prop: 'period', label: '??' },
|
||||
{ prop: 'orderNum', label: '???' },
|
||||
{ prop: 'type', label: '??' },
|
||||
{ prop: 'paymentCode', label: '????' },
|
||||
{ prop: 'money', label: '??' },
|
||||
{ prop: 'chargeAccount', label: '??????' },
|
||||
{ prop: 'chargeRealname', label: '????????' },
|
||||
{ prop: 'chargeState', label: '????' },
|
||||
{ prop: 'state', label: '??' }
|
||||
]
|
||||
|
||||
// 列配置映射(用于图标<EFBFBD><EFBFBD>?
|
||||
// ????????????
|
||||
const columnConfigMap: Record<string, { icon: any }> = {
|
||||
roomNo: { icon: House },
|
||||
year: { icon: Calendar },
|
||||
@@ -263,7 +263,7 @@ const columnConfigMap: Record<string, { icon: any }> = {
|
||||
state: { icon: CircleCheck }
|
||||
}
|
||||
|
||||
// 使用表格列控制hook
|
||||
// ???????hook
|
||||
const {
|
||||
visibleColumns,
|
||||
visibleColumnsSorted,
|
||||
@@ -272,14 +272,14 @@ const {
|
||||
handleColumnOrderChange
|
||||
} = useTableColumnControl(tableColumns, route.path)
|
||||
|
||||
// 搜索表单
|
||||
// ????
|
||||
const searchForm = reactive({
|
||||
roomNo: '',
|
||||
year: '',
|
||||
period: ''
|
||||
})
|
||||
|
||||
// 配置 useTable
|
||||
// ?? useTable
|
||||
const state: BasicTableProps = reactive<BasicTableProps>({
|
||||
queryForm: searchForm,
|
||||
pageList: fetchList,
|
||||
@@ -299,12 +299,12 @@ const {
|
||||
tableStyle
|
||||
} = useTable(state)
|
||||
|
||||
// 查询
|
||||
// ??
|
||||
const handleSearch = () => {
|
||||
getDataList()
|
||||
}
|
||||
|
||||
// 重置
|
||||
// ??
|
||||
const handleReset = () => {
|
||||
searchFormRef.value?.formRef?.resetFields()
|
||||
searchForm.roomNo = ''
|
||||
@@ -313,27 +313,27 @@ const handleReset = () => {
|
||||
getDataList()
|
||||
}
|
||||
|
||||
// 编辑
|
||||
// ??
|
||||
const handleEdit = (row: any) => {
|
||||
formDialogRef.value.openDialog('edit', row)
|
||||
}
|
||||
|
||||
// 删除
|
||||
// ??
|
||||
const handleDelete = async (row: any) => {
|
||||
try {
|
||||
await useMessageBox().confirm('确定要删除该记录吗?')
|
||||
await useMessageBox().confirm('??????????')
|
||||
const { delObjs } = await import("/@/api/stuwork/waterorder")
|
||||
await delObjs([row.id])
|
||||
useMessage().success('删除成功')
|
||||
useMessage().success('????')
|
||||
getDataList()
|
||||
} catch (err: any) {
|
||||
if (err !== 'cancel') {
|
||||
useMessage().error(err.msg || '删除失败')
|
||||
useMessage().error(err.msg || '????')
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// 格式化学<EFBFBD><EFBFBD>?
|
||||
// ??????
|
||||
const formatSchoolTerm = (value: string | number) => {
|
||||
if (value === null || value === undefined || value === '') {
|
||||
return '-'
|
||||
@@ -342,7 +342,7 @@ const formatSchoolTerm = (value: string | number) => {
|
||||
return dictItem ? dictItem.label : value
|
||||
}
|
||||
|
||||
// 格式化类<EFBFBD><EFBFBD>?
|
||||
// ??????
|
||||
const formatType = (value: string | number) => {
|
||||
if (value === null || value === undefined || value === '') {
|
||||
return '-'
|
||||
@@ -351,7 +351,7 @@ const formatType = (value: string | number) => {
|
||||
return dictItem ? dictItem.label : value
|
||||
}
|
||||
|
||||
// 格式化充值类<EFBFBD><EFBFBD>?
|
||||
// ????????
|
||||
const formatPaymentType = (value: string | number) => {
|
||||
if (value === null || value === undefined || value === '') {
|
||||
return '-'
|
||||
@@ -360,7 +360,7 @@ const formatPaymentType = (value: string | number) => {
|
||||
return dictItem ? dictItem.label : value
|
||||
}
|
||||
|
||||
// 格式化充值结<EFBFBD><EFBFBD>?
|
||||
// ????????
|
||||
const formatChargeState = (value: string | number) => {
|
||||
if (value === null || value === undefined || value === '') {
|
||||
return '-'
|
||||
@@ -369,7 +369,7 @@ const formatChargeState = (value: string | number) => {
|
||||
return dictItem ? dictItem.label : value
|
||||
}
|
||||
|
||||
// 格式化状<EFBFBD><EFBFBD>?
|
||||
// ??????
|
||||
const formatState = (value: string | number) => {
|
||||
if (value === null || value === undefined || value === '') {
|
||||
return '-'
|
||||
@@ -378,7 +378,7 @@ const formatState = (value: string | number) => {
|
||||
return dictItem ? dictItem.label : value
|
||||
}
|
||||
|
||||
// 获取学年列表
|
||||
// ??????
|
||||
const getSchoolYearList = async () => {
|
||||
try {
|
||||
const res = await queryAllSchoolYear()
|
||||
@@ -390,7 +390,7 @@ const getSchoolYearList = async () => {
|
||||
}
|
||||
}
|
||||
|
||||
// 获取学期字典
|
||||
// ??????
|
||||
const getSchoolTermDict = async () => {
|
||||
try {
|
||||
const res = await getDicts('school_term')
|
||||
@@ -405,7 +405,7 @@ const getSchoolTermDict = async () => {
|
||||
}
|
||||
}
|
||||
|
||||
// 获取类型字典
|
||||
// ??????
|
||||
const getTypeDict = async () => {
|
||||
try {
|
||||
const res = await getDicts('dorm_water_source_type')
|
||||
@@ -420,7 +420,7 @@ const getTypeDict = async () => {
|
||||
}
|
||||
}
|
||||
|
||||
// 获取充值类型字<EFBFBD><EFBFBD>?
|
||||
// ?????????
|
||||
const getPaymentTypeDict = async () => {
|
||||
try {
|
||||
const res = await getDicts('dorm_water_payment_type')
|
||||
@@ -435,7 +435,7 @@ const getPaymentTypeDict = async () => {
|
||||
}
|
||||
}
|
||||
|
||||
// 获取充值结果字<EFBFBD><EFBFBD>?
|
||||
// ?????????
|
||||
const getChargeStateDict = async () => {
|
||||
try {
|
||||
const res = await getDicts('dorm_water_charge_state')
|
||||
@@ -450,7 +450,7 @@ const getChargeStateDict = async () => {
|
||||
}
|
||||
}
|
||||
|
||||
// 获取状态字<EFBFBD><EFBFBD>?
|
||||
// ???????
|
||||
const getStateDict = async () => {
|
||||
try {
|
||||
const res = await getDicts('dorm_water_state')
|
||||
@@ -465,7 +465,7 @@ const getStateDict = async () => {
|
||||
}
|
||||
}
|
||||
|
||||
// 初始<EFBFBD><EFBFBD>?
|
||||
// ????
|
||||
onMounted(() => {
|
||||
getSchoolYearList()
|
||||
getSchoolTermDict()
|
||||
|
||||
@@ -1,21 +1,21 @@
|
||||
<template>
|
||||
<div class="modern-page-container">
|
||||
<div class="page-wrapper">
|
||||
<!-- 搜索表单卡片 -->
|
||||
<!-- ?????? -->
|
||||
<el-card v-show="showSearch" class="search-card" shadow="never">
|
||||
<template #header>
|
||||
<div class="card-header">
|
||||
<span class="card-title">
|
||||
<el-icon class="title-icon"><Search /></el-icon>
|
||||
筛选条<EFBFBD><EFBFBD>?
|
||||
????
|
||||
</span>
|
||||
</div>
|
||||
</template>
|
||||
<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
|
||||
v-model="searchForm.deptCode"
|
||||
placeholder="请选择学院"
|
||||
placeholder="?????"
|
||||
clearable
|
||||
filterable
|
||||
style="width: 200px"
|
||||
@@ -28,10 +28,10 @@
|
||||
</el-option>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="班级" prop="classCode">
|
||||
<el-form-item label="??" prop="classCode">
|
||||
<el-select
|
||||
v-model="searchForm.classCode"
|
||||
placeholder="请选择班级"
|
||||
placeholder="?????"
|
||||
clearable
|
||||
filterable
|
||||
style="width: 200px">
|
||||
@@ -43,31 +43,31 @@
|
||||
</el-option>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="来源" prop="source">
|
||||
<el-form-item label="??" prop="source">
|
||||
<el-select
|
||||
v-model="searchForm.source"
|
||||
placeholder="请选择来源"
|
||||
placeholder="?????"
|
||||
clearable
|
||||
style="width: 200px"
|
||||
@change="handleSourceChange">
|
||||
<el-option label="考勤记录" value="history" />
|
||||
<el-option label="考勤" value="attendance" />
|
||||
<el-option label="????" value="history" />
|
||||
<el-option label="??" value="attendance" />
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item>
|
||||
<el-button type="primary" plain icon="Search" @click="handleSearch">查询</el-button>
|
||||
<el-button icon="Refresh" @click="handleReset">重置</el-button>
|
||||
<el-button type="primary" plain icon="Search" @click="handleSearch">??</el-button>
|
||||
<el-button icon="Refresh" @click="handleReset">??</el-button>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
</el-card>
|
||||
|
||||
<!-- 内容卡片 -->
|
||||
<!-- ???? -->
|
||||
<el-card class="content-card" shadow="never">
|
||||
<template #header>
|
||||
<div class="card-header">
|
||||
<span class="card-title">
|
||||
<el-icon class="title-icon"><Document /></el-icon>
|
||||
勤工助学考勤列表
|
||||
????????
|
||||
</span>
|
||||
<div class="header-actions">
|
||||
<right-toolbar
|
||||
@@ -84,7 +84,7 @@
|
||||
@order-change="handleColumnOrderChange"
|
||||
>
|
||||
<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-icon><Menu /></el-icon>
|
||||
</el-button>
|
||||
@@ -96,7 +96,7 @@
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<!-- 表格 -->
|
||||
<!-- ?? -->
|
||||
<el-table
|
||||
:data="state.dataList"
|
||||
v-loading="state.loading"
|
||||
@@ -104,7 +104,7 @@
|
||||
:cell-style="tableStyle.cellStyle"
|
||||
:header-cell-style="tableStyle.headerCellStyle"
|
||||
class="modern-table">
|
||||
<el-table-column type="index" label="序号" width="70" align="center">
|
||||
<el-table-column type="index" label="??" width="70" align="center">
|
||||
<template #header>
|
||||
<el-icon><List /></el-icon>
|
||||
</template>
|
||||
@@ -114,7 +114,7 @@
|
||||
</el-table-column>
|
||||
<template v-for="col in visibleColumnsSorted" :key="col.prop || col.label">
|
||||
<el-table-column
|
||||
v-if="checkColumnVisible(col.prop || '') && col.prop !== '操作'"
|
||||
v-if="checkColumnVisible(col.prop || '') && col.prop !== '??'"
|
||||
:prop="col.prop"
|
||||
:label="col.label"
|
||||
show-overflow-tooltip
|
||||
@@ -125,28 +125,28 @@
|
||||
<el-icon><component :is="columnConfigMap[col.prop]?.icon || Calendar" /></el-icon>
|
||||
<span style="margin-left: 4px">{{ col.label }}</span>
|
||||
</template>
|
||||
<!-- 学期列特殊模<EFBFBD><EFBFBD>?-->
|
||||
<!-- ??????? -->
|
||||
<template v-if="col.prop === 'schoolTerm'" #default="scope">
|
||||
<el-tag size="small" type="primary" effect="plain">
|
||||
{{ formatSchoolTerm(scope.row.schoolTerm) }}
|
||||
</el-tag>
|
||||
</template>
|
||||
<!-- 考勤类型列特殊模<EFBFBD><EFBFBD>?-->
|
||||
<!-- ????????? -->
|
||||
<template v-else-if="col.prop === 'attendanceType'" #default="scope">
|
||||
<el-tag size="small" type="warning" effect="plain">
|
||||
{{ formatAttendanceType(scope.row.attendanceType) }}
|
||||
</el-tag>
|
||||
</template>
|
||||
<!-- 落实情况列特殊模<EFBFBD><EFBFBD>?-->
|
||||
<!-- ????????? -->
|
||||
<template v-else-if="col.prop === 'remarks'" #default="scope">
|
||||
<span>{{ scope.row.remarks || '-' }}</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</template>
|
||||
<el-table-column label="操作" width="150" align="center" fixed="right">
|
||||
<el-table-column label="??" width="150" align="center" fixed="right">
|
||||
<template #header>
|
||||
<el-icon><Setting /></el-icon>
|
||||
<span style="margin-left: 4px">操作</span>
|
||||
<span style="margin-left: 4px">??</span>
|
||||
</template>
|
||||
<template #default="scope">
|
||||
<el-button
|
||||
@@ -154,13 +154,13 @@
|
||||
link
|
||||
type="primary"
|
||||
@click="handleView(scope.row)">
|
||||
查看详情
|
||||
????
|
||||
</el-button>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
|
||||
<!-- 分页 -->
|
||||
<!-- ?? -->
|
||||
<div class="pagination-wrapper">
|
||||
<pagination
|
||||
@size-change="sizeChangeHandle"
|
||||
@@ -182,33 +182,33 @@ import { getClassListByRole } from "/@/api/basic/basicclass";
|
||||
import { useMessage } from "/@/hooks/message";
|
||||
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 { useTableColumnControl } from '/@/hooks/tableColumnControl'
|
||||
import { useTableColumnControl } from '/@/hooks/tableColumn'
|
||||
|
||||
|
||||
// 定义变量内容
|
||||
// ??????
|
||||
const route = useRoute()
|
||||
const searchFormRef = ref()
|
||||
const columnControlRef = ref<any>()
|
||||
const showSearch = ref(true)
|
||||
const deptList = ref<any[]>([])
|
||||
const classList = ref<any[]>([])
|
||||
const showRemarks = ref(false) // 控制落实情况列的显示
|
||||
const showRemarks = ref(false) // ??????????
|
||||
|
||||
// 表格列配<EFBFBD><EFBFBD>?
|
||||
// ?????
|
||||
const tableColumns = [
|
||||
{ prop: 'schoolYear', label: '学年' },
|
||||
{ prop: 'schoolTerm', label: '学期' },
|
||||
{ prop: 'deptName', label: '系部名称' },
|
||||
{ prop: 'classCode', label: '班级代码' },
|
||||
{ prop: 'classNo', label: '班级简<EFBFBD><EFBFBD>? },
|
||||
{ prop: 'classProName', label: '班级规范名称', minWidth: 200 },
|
||||
{ prop: 'stuNo', label: '学号' },
|
||||
{ prop: 'realName', label: '姓名' },
|
||||
{ prop: 'attendanceType', label: '考勤类型' },
|
||||
{ prop: 'remarks', label: '落实情况', minWidth: 150 }
|
||||
{ prop: 'schoolYear', label: '??' },
|
||||
{ prop: 'schoolTerm', label: '??' },
|
||||
{ prop: 'deptName', label: '????' },
|
||||
{ prop: 'classCode', label: '????' },
|
||||
{ prop: 'classNo', label: '????' },
|
||||
{ prop: 'classProName', label: '??????', minWidth: 200 },
|
||||
{ prop: 'stuNo', label: '??' },
|
||||
{ prop: 'realName', label: '??' },
|
||||
{ prop: 'attendanceType', label: '????' },
|
||||
{ prop: 'remarks', label: '????', minWidth: 150 }
|
||||
]
|
||||
|
||||
// 列配置映射(用于图标<EFBFBD><EFBFBD>?
|
||||
// ?????????????
|
||||
const columnConfigMap: Record<string, { icon: any }> = {
|
||||
schoolYear: { icon: Calendar },
|
||||
schoolTerm: { icon: Clock },
|
||||
@@ -222,7 +222,7 @@ const columnConfigMap: Record<string, { icon: any }> = {
|
||||
remarks: { icon: Document }
|
||||
}
|
||||
|
||||
// 使用表格列控制hook
|
||||
// ??????? hook
|
||||
const {
|
||||
visibleColumns,
|
||||
visibleColumnsSorted,
|
||||
@@ -231,14 +231,14 @@ const {
|
||||
handleColumnOrderChange
|
||||
} = useTableColumnControl(tableColumns, route.path)
|
||||
|
||||
// 搜索表单
|
||||
// ????
|
||||
const searchForm = reactive({
|
||||
deptCode: '',
|
||||
classCode: '',
|
||||
source: '' // 来源选择:考勤记录、考勤
|
||||
source: '' // ????????????
|
||||
})
|
||||
|
||||
// 配置 useTable
|
||||
// ?? useTable
|
||||
const state: BasicTableProps = reactive<BasicTableProps>({
|
||||
queryForm: searchForm,
|
||||
pageList: fetchList,
|
||||
@@ -257,26 +257,26 @@ const {
|
||||
tableStyle
|
||||
} = useTable(state)
|
||||
|
||||
// 格式化考勤类型
|
||||
// ???????
|
||||
const formatAttendanceType = (value: string | number) => {
|
||||
if (value === '1' || value === 1) return '到岗'
|
||||
if (value === '2' || value === 2) return '未到<EFBFBD><EFBFBD>?
|
||||
if (value === '3' || value === 3) return '请假'
|
||||
if (value === '1' || value === 1) return '??'
|
||||
if (value === '2' || value === 2) return '???'
|
||||
if (value === '3' || value === 3) return '??'
|
||||
return '-'
|
||||
}
|
||||
|
||||
// 学院变化时更新班级列<EFBFBD><EFBFBD>?
|
||||
// ???????????
|
||||
const handleDeptChange = () => {
|
||||
searchForm.classCode = ''
|
||||
getClassListData()
|
||||
}
|
||||
|
||||
// 来源选择变化
|
||||
// ??????
|
||||
const handleSourceChange = async (value: string) => {
|
||||
if (value === 'history') {
|
||||
// 选择考勤记录时,显示落实情况<EFBFBD><EFBFBD>?
|
||||
// ???????????????
|
||||
showRemarks.value = true
|
||||
// 查询考勤记录(不强制要求学院和班级)
|
||||
// ??????????????????
|
||||
try {
|
||||
state.loading = true
|
||||
const params: any = {}
|
||||
@@ -299,7 +299,7 @@ const handleSourceChange = async (value: string) => {
|
||||
}
|
||||
}
|
||||
} catch (err: any) {
|
||||
useMessage().error(err.msg || '查询考勤记录失败')
|
||||
useMessage().error(err.msg || '????????')
|
||||
state.dataList = []
|
||||
if (state.pagination) {
|
||||
state.pagination.total = 0
|
||||
@@ -308,17 +308,17 @@ const handleSourceChange = async (value: string) => {
|
||||
state.loading = false
|
||||
}
|
||||
} else if (value === 'attendance') {
|
||||
// 选择考勤时,不显示落实情况列,使用普通列表接<EFBFBD><EFBFBD>?
|
||||
// ???????????????????????
|
||||
showRemarks.value = false
|
||||
getDataList()
|
||||
} else {
|
||||
// 清空选择时,不显示落实情况列
|
||||
// ??????????????
|
||||
showRemarks.value = false
|
||||
getDataList()
|
||||
}
|
||||
}
|
||||
|
||||
// 查询
|
||||
// ??
|
||||
const handleSearch = () => {
|
||||
if (searchForm.source === 'history') {
|
||||
handleSourceChange('history')
|
||||
@@ -328,7 +328,7 @@ const handleSearch = () => {
|
||||
}
|
||||
}
|
||||
|
||||
// 重置
|
||||
// ??
|
||||
const handleReset = () => {
|
||||
searchFormRef.value?.resetFields()
|
||||
searchForm.deptCode = ''
|
||||
@@ -338,12 +338,12 @@ const handleReset = () => {
|
||||
getDataList()
|
||||
}
|
||||
|
||||
// 查看详情
|
||||
// ????
|
||||
const handleView = (row: any) => {
|
||||
useMessage().warning('查看详情功能待实<EFBFBD><EFBFBD>?)
|
||||
useMessage().warning('?????????')
|
||||
}
|
||||
|
||||
// 获取学院列表
|
||||
// ??????
|
||||
const getDeptListData = async () => {
|
||||
try {
|
||||
const res = await getDeptList()
|
||||
@@ -355,13 +355,13 @@ const getDeptListData = async () => {
|
||||
}
|
||||
}
|
||||
|
||||
// 获取班级列表
|
||||
// ??????
|
||||
const getClassListData = async () => {
|
||||
try {
|
||||
const res = await getClassListByRole()
|
||||
if (res.data) {
|
||||
let list = Array.isArray(res.data) ? res.data : []
|
||||
// 如果选择了学院,过滤班级列表
|
||||
// ??????????????
|
||||
if (searchForm.deptCode) {
|
||||
list = list.filter((item: any) => item.deptCode === searchForm.deptCode)
|
||||
}
|
||||
@@ -372,7 +372,7 @@ const getClassListData = async () => {
|
||||
}
|
||||
}
|
||||
|
||||
// 初始<EFBFBD><EFBFBD>?
|
||||
// ???
|
||||
onMounted(() => {
|
||||
getDeptListData()
|
||||
getClassListData()
|
||||
@@ -386,4 +386,3 @@ onMounted(() => {
|
||||
<style scoped lang="scss">
|
||||
@import '/@/assets/styles/modern-page.scss';
|
||||
</style>
|
||||
|
||||
|
||||
Reference in New Issue
Block a user