修復打包問題
This commit is contained in:
@@ -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>
|
||||
|
||||
|
||||
Reference in New Issue
Block a user