修复文件问题 修改bug
This commit is contained in:
@@ -100,3 +100,15 @@ export function delObj(id: number) {
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获取采购申请附件列表
|
||||||
|
* @param purchaseId 采购申请ID
|
||||||
|
*/
|
||||||
|
export function getApplyFiles(purchaseId: string | number) {
|
||||||
|
return request({
|
||||||
|
url: '/purchase/purchasingfiles/applyFiles',
|
||||||
|
method: 'post',
|
||||||
|
params: { purchaseId }
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -262,13 +262,25 @@
|
|||||||
<template #default="scope" v-if="col.prop === 'gender'">
|
<template #default="scope" v-if="col.prop === 'gender'">
|
||||||
<GenderTag :gender="scope.row.gender" />
|
<GenderTag :gender="scope.row.gender" />
|
||||||
</template>
|
</template>
|
||||||
|
<template #default="scope" v-else-if="col.prop === 'education'">
|
||||||
|
<el-tag v-if="getEducationLabel(scope.row.education)" size="small" type="info" effect="plain">
|
||||||
|
{{ getEducationLabel(scope.row.education) }}
|
||||||
|
</el-tag>
|
||||||
|
<span v-else>-</span>
|
||||||
|
</template>
|
||||||
<template #default="scope" v-else-if="col.prop === 'isDorm'">
|
<template #default="scope" v-else-if="col.prop === 'isDorm'">
|
||||||
<el-tag v-if="scope.row.isDorm === 1 || scope.row.isDorm === '1'" size="small" type="success" effect="plain">是</el-tag>
|
<el-tag v-if="scope.row.isDorm === 1 || scope.row.isDorm === '1'" size="small" type="success" effect="plain">是</el-tag>
|
||||||
<el-tag v-else-if="scope.row.isDorm === 0 || scope.row.isDorm === '0'" size="small" type="info" effect="plain">否</el-tag>
|
<el-tag v-else-if="scope.row.isDorm === 0 || scope.row.isDorm === '0'" size="small" type="info" effect="plain">否</el-tag>
|
||||||
<span v-else>-</span>
|
<span v-else>-</span>
|
||||||
</template>
|
</template>
|
||||||
<template #default="scope" v-else-if="col.prop === 'enrollStatus'">
|
<template #default="scope" v-else-if="col.prop === 'enrollStatus'">
|
||||||
<el-tag v-if="scope.row.enrollStatus" size="small" type="info" effect="plain">{{ scope.row.enrollStatus }}</el-tag>
|
<el-tag
|
||||||
|
v-if="getEnrollStatusLabel(scope.row.enrollStatus)"
|
||||||
|
size="small"
|
||||||
|
type="info"
|
||||||
|
effect="plain">
|
||||||
|
{{ getEnrollStatusLabel(scope.row.enrollStatus) }}
|
||||||
|
</el-tag>
|
||||||
<span v-else>-</span>
|
<span v-else>-</span>
|
||||||
</template>
|
</template>
|
||||||
<template #default="scope" v-else-if="col.prop === 'stuStatus'">
|
<template #default="scope" v-else-if="col.prop === 'stuStatus'">
|
||||||
@@ -427,7 +439,6 @@ import {
|
|||||||
editIsleader,
|
editIsleader,
|
||||||
updateInout,
|
updateInout,
|
||||||
updateStuSimpleInfo,
|
updateStuSimpleInfo,
|
||||||
getStuStatus,
|
|
||||||
prePrint
|
prePrint
|
||||||
} from "/@/api/basic/basicstudent";
|
} from "/@/api/basic/basicstudent";
|
||||||
import { getDeptList, getClassListByRole } from "/@/api/basic/basicclass";
|
import { getDeptList, getClassListByRole } from "/@/api/basic/basicclass";
|
||||||
@@ -456,6 +467,7 @@ const deptList = ref<any[]>([])
|
|||||||
const classList = ref<any[]>([])
|
const classList = ref<any[]>([])
|
||||||
const statusList = ref<any[]>([])
|
const statusList = ref<any[]>([])
|
||||||
const stuStatusList = ref<any[]>([])
|
const stuStatusList = ref<any[]>([])
|
||||||
|
const educationList = ref<any[]>([])
|
||||||
const selectedRows = ref<any[]>([])
|
const selectedRows = ref<any[]>([])
|
||||||
const importCertificateDialogVisible = ref(false)
|
const importCertificateDialogVisible = ref(false)
|
||||||
const uploadLoading = ref(false)
|
const uploadLoading = ref(false)
|
||||||
@@ -781,9 +793,17 @@ const getClassListData = async () => {
|
|||||||
// 获取学籍状态列表
|
// 获取学籍状态列表
|
||||||
const getStatusListData = async () => {
|
const getStatusListData = async () => {
|
||||||
try {
|
try {
|
||||||
const res = await getStuStatus()
|
const res = await getDicts('enroll_status')
|
||||||
if (res.data) {
|
if (res.data) {
|
||||||
statusList.value = Array.isArray(res.data) ? res.data : []
|
if (Array.isArray(res.data)) {
|
||||||
|
// 确保数据格式统一为 {label, value}
|
||||||
|
statusList.value = res.data.map((item: any) => ({
|
||||||
|
label: item.label || item.name || item.dictLabel || item.text || '',
|
||||||
|
value: String(item.value || item.code || item.dictValue || item.id || '')
|
||||||
|
})).filter((item: any) => item.label && item.value !== undefined && item.value !== null && item.value !== '')
|
||||||
|
} else {
|
||||||
|
statusList.value = []
|
||||||
|
}
|
||||||
}
|
}
|
||||||
} catch (err) {
|
} catch (err) {
|
||||||
console.error('获取学籍状态列表失败', err)
|
console.error('获取学籍状态列表失败', err)
|
||||||
@@ -791,6 +811,24 @@ const getStatusListData = async () => {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// 获取文化程度字典
|
||||||
|
const getEducationListData = async () => {
|
||||||
|
try {
|
||||||
|
const res = await getDicts('pre_school_education')
|
||||||
|
if (res.data && Array.isArray(res.data)) {
|
||||||
|
educationList.value = res.data.map((item: any) => ({
|
||||||
|
label: item.label || item.dictLabel || item.name,
|
||||||
|
value: item.value || item.dictValue || item.code
|
||||||
|
}))
|
||||||
|
} else {
|
||||||
|
educationList.value = []
|
||||||
|
}
|
||||||
|
} catch (err) {
|
||||||
|
console.error('获取文化程度字典失败', err)
|
||||||
|
educationList.value = []
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
// 获取学生状态列表
|
// 获取学生状态列表
|
||||||
const getStuStatusListData = async () => {
|
const getStuStatusListData = async () => {
|
||||||
try {
|
try {
|
||||||
@@ -813,6 +851,20 @@ const getStuStatusListData = async () => {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// 根据学籍状态值获取标签
|
||||||
|
const getEnrollStatusLabel = (value: any) => {
|
||||||
|
if (value === undefined || value === null || value === '') return ''
|
||||||
|
const status = statusList.value.find(item => String(item.value) === String(value))
|
||||||
|
return status ? status.label : ''
|
||||||
|
}
|
||||||
|
|
||||||
|
// 根据文化程度值获取标签
|
||||||
|
const getEducationLabel = (value: any) => {
|
||||||
|
if (value === undefined || value === null || value === '') return ''
|
||||||
|
const item = educationList.value.find(i => String(i.value) === String(value))
|
||||||
|
return item ? item.label : ''
|
||||||
|
}
|
||||||
|
|
||||||
// 根据学生状态值获取标签
|
// 根据学生状态值获取标签
|
||||||
const getStuStatusLabel = (value: any) => {
|
const getStuStatusLabel = (value: any) => {
|
||||||
if (value === undefined || value === null || value === '') return ''
|
if (value === undefined || value === null || value === '') return ''
|
||||||
@@ -833,6 +885,7 @@ onMounted(() => {
|
|||||||
getDeptListData()
|
getDeptListData()
|
||||||
getClassListData()
|
getClassListData()
|
||||||
getStatusListData()
|
getStatusListData()
|
||||||
|
getEducationListData()
|
||||||
getStuStatusListData()
|
getStuStatusListData()
|
||||||
})
|
})
|
||||||
</script>
|
</script>
|
||||||
|
|||||||
File diff suppressed because it is too large
Load Diff
@@ -102,7 +102,7 @@
|
|||||||
<el-icon><List /></el-icon>
|
<el-icon><List /></el-icon>
|
||||||
</template>
|
</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
<el-table-column prop="code" label="申请单编号" min-width="140" show-overflow-tooltip>
|
<el-table-column prop="purchaseNo" label="申请单编号" min-width="140" show-overflow-tooltip>
|
||||||
<template #header>
|
<template #header>
|
||||||
<el-icon><DocumentCopy /></el-icon>
|
<el-icon><DocumentCopy /></el-icon>
|
||||||
<span style="margin-left: 4px">申请单编号</span>
|
<span style="margin-left: 4px">申请单编号</span>
|
||||||
@@ -197,7 +197,7 @@
|
|||||||
icon="View"
|
icon="View"
|
||||||
link
|
link
|
||||||
type="primary"
|
type="primary"
|
||||||
@click="formDialogRef.openDialog('view', scope.row)">
|
@click="handleView(scope.row)">
|
||||||
查看
|
查看
|
||||||
</el-button>
|
</el-button>
|
||||||
<el-button
|
<el-button
|
||||||
@@ -205,7 +205,7 @@
|
|||||||
icon="Edit"
|
icon="Edit"
|
||||||
link
|
link
|
||||||
type="primary"
|
type="primary"
|
||||||
@click="formDialogRef.openDialog('edit', scope.row)">
|
@click="handleEdit(scope.row)">
|
||||||
编辑
|
编辑
|
||||||
</el-button>
|
</el-button>
|
||||||
<el-button
|
<el-button
|
||||||
@@ -226,7 +226,8 @@
|
|||||||
:total="state.pagination.total"
|
:total="state.pagination.total"
|
||||||
:current="state.pagination.current"
|
:current="state.pagination.current"
|
||||||
:size="state.pagination.size"
|
:size="state.pagination.size"
|
||||||
@pagination="getDataList"
|
@sizeChange="sizeChangeHandle"
|
||||||
|
@currentChange="currentChangeHandle"
|
||||||
/>
|
/>
|
||||||
</el-card>
|
</el-card>
|
||||||
</div>
|
</div>
|
||||||
@@ -312,7 +313,7 @@ const state: BasicTableProps = reactive<BasicTableProps>({
|
|||||||
/**
|
/**
|
||||||
* 使用 useTable 定义表格相关操作
|
* 使用 useTable 定义表格相关操作
|
||||||
*/
|
*/
|
||||||
const { getDataList, tableStyle } = useTable(state);
|
const { getDataList, tableStyle, sizeChangeHandle, currentChangeHandle } = useTable(state);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 重置搜索表单
|
* 重置搜索表单
|
||||||
@@ -361,6 +362,22 @@ const handleIframeMessage = (event: MessageEvent) => {
|
|||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 打开查看对话框
|
||||||
|
* @param row - 当前行数据
|
||||||
|
*/
|
||||||
|
const handleView = (row: any) => {
|
||||||
|
formDialogRef.value?.openDialog('view', row);
|
||||||
|
};
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 打开编辑对话框
|
||||||
|
* @param row - 当前行数据
|
||||||
|
*/
|
||||||
|
const handleEdit = (row: any) => {
|
||||||
|
formDialogRef.value?.openDialog('edit', row);
|
||||||
|
};
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 删除当前行
|
* 删除当前行
|
||||||
* @param row - 当前行数据
|
* @param row - 当前行数据
|
||||||
|
|||||||
@@ -17,7 +17,19 @@
|
|||||||
</el-select>
|
</el-select>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item label="宿舍号" prop="roomNo">
|
<el-form-item label="宿舍号" prop="roomNo">
|
||||||
<el-input v-model="form.roomNo" placeholder="请输入宿舍号" />
|
<el-select
|
||||||
|
v-model="form.roomNo"
|
||||||
|
placeholder="请选择宿舍号"
|
||||||
|
clearable
|
||||||
|
filterable
|
||||||
|
style="width: 100%">
|
||||||
|
<el-option
|
||||||
|
v-for="item in roomList"
|
||||||
|
:key="item.roomNo"
|
||||||
|
:label="item.roomNo"
|
||||||
|
:value="item.roomNo">
|
||||||
|
</el-option>
|
||||||
|
</el-select>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item label="记录日期" prop="recordDate">
|
<el-form-item label="记录日期" prop="recordDate">
|
||||||
<el-date-picker
|
<el-date-picker
|
||||||
@@ -50,6 +62,7 @@ import { ref, reactive, nextTick, onMounted } from 'vue'
|
|||||||
import { useMessage } from '/@/hooks/message'
|
import { useMessage } from '/@/hooks/message'
|
||||||
import { addObj, putObj, getObj } from '/@/api/stuwork/dormhygienedaily'
|
import { addObj, putObj, getObj } from '/@/api/stuwork/dormhygienedaily'
|
||||||
import { getBuildingList } from '/@/api/stuwork/dormbuilding'
|
import { getBuildingList } from '/@/api/stuwork/dormbuilding'
|
||||||
|
import { getRoomList } from '/@/api/stuwork/dormroom'
|
||||||
|
|
||||||
const emit = defineEmits(['refresh'])
|
const emit = defineEmits(['refresh'])
|
||||||
|
|
||||||
@@ -59,6 +72,7 @@ const visible = ref(false)
|
|||||||
const loading = ref(false)
|
const loading = ref(false)
|
||||||
const operType = ref('add') // add 或 edit
|
const operType = ref('add') // add 或 edit
|
||||||
const buildingList = ref<any[]>([])
|
const buildingList = ref<any[]>([])
|
||||||
|
const roomList = ref<any[]>([])
|
||||||
|
|
||||||
// 提交表单数据
|
// 提交表单数据
|
||||||
const form = reactive({
|
const form = reactive({
|
||||||
@@ -75,7 +89,7 @@ const dataRules = {
|
|||||||
{ required: true, message: '请选择楼号', trigger: 'change' }
|
{ required: true, message: '请选择楼号', trigger: 'change' }
|
||||||
],
|
],
|
||||||
roomNo: [
|
roomNo: [
|
||||||
{ required: true, message: '请输入宿舍号', trigger: 'blur' }
|
{ required: true, message: '请选择宿舍号', trigger: 'change' }
|
||||||
],
|
],
|
||||||
recordDate: [
|
recordDate: [
|
||||||
{ required: true, message: '请选择记录日期', trigger: 'change' }
|
{ required: true, message: '请选择记录日期', trigger: 'change' }
|
||||||
@@ -159,9 +173,22 @@ const getBuildingListData = async () => {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// 获取宿舍号列表
|
||||||
|
const getRoomListData = async () => {
|
||||||
|
try {
|
||||||
|
const res = await getRoomList()
|
||||||
|
if (res.data) {
|
||||||
|
roomList.value = Array.isArray(res.data) ? res.data : []
|
||||||
|
}
|
||||||
|
} catch (err) {
|
||||||
|
roomList.value = []
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
// 初始化
|
// 初始化
|
||||||
onMounted(() => {
|
onMounted(() => {
|
||||||
getBuildingListData()
|
getBuildingListData()
|
||||||
|
getRoomListData()
|
||||||
})
|
})
|
||||||
|
|
||||||
// 暴露方法给父组件
|
// 暴露方法给父组件
|
||||||
|
|||||||
@@ -2,7 +2,19 @@
|
|||||||
<el-dialog :title="form.id ? '编辑' : '新增'" v-model="visible" :width="600" :close-on-click-modal="false" draggable>
|
<el-dialog :title="form.id ? '编辑' : '新增'" v-model="visible" :width="600" :close-on-click-modal="false" draggable>
|
||||||
<el-form ref="dataFormRef" :model="form" :rules="dataRules" label-width="100px" v-loading="loading">
|
<el-form ref="dataFormRef" :model="form" :rules="dataRules" label-width="100px" v-loading="loading">
|
||||||
<el-form-item label="房间号" prop="roomNo">
|
<el-form-item label="房间号" prop="roomNo">
|
||||||
<el-input v-model="form.roomNo" placeholder="请输入房间号" />
|
<el-select
|
||||||
|
v-model="form.roomNo"
|
||||||
|
placeholder="请选择房间号"
|
||||||
|
clearable
|
||||||
|
filterable
|
||||||
|
style="width: 100%">
|
||||||
|
<el-option
|
||||||
|
v-for="item in roomList"
|
||||||
|
:key="item.roomNo"
|
||||||
|
:label="item.roomNo"
|
||||||
|
:value="item.roomNo">
|
||||||
|
</el-option>
|
||||||
|
</el-select>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item label="整改时间" prop="reformDate">
|
<el-form-item label="整改时间" prop="reformDate">
|
||||||
<el-date-picker
|
<el-date-picker
|
||||||
@@ -31,9 +43,10 @@
|
|||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script setup lang="ts" name="DormReformFormDialog">
|
<script setup lang="ts" name="DormReformFormDialog">
|
||||||
import { ref, reactive, nextTick } from 'vue'
|
import { ref, reactive, nextTick, onMounted } from 'vue'
|
||||||
import { useMessage } from '/@/hooks/message'
|
import { useMessage } from '/@/hooks/message'
|
||||||
import { addObj, putObj } from '/@/api/stuwork/dormreform'
|
import { addObj, putObj } from '/@/api/stuwork/dormreform'
|
||||||
|
import { getRoomList } from '/@/api/stuwork/dormroom'
|
||||||
|
|
||||||
const emit = defineEmits(['refresh'])
|
const emit = defineEmits(['refresh'])
|
||||||
|
|
||||||
@@ -42,6 +55,7 @@ const dataFormRef = ref()
|
|||||||
const visible = ref(false)
|
const visible = ref(false)
|
||||||
const loading = ref(false)
|
const loading = ref(false)
|
||||||
const operType = ref('add') // add 或 edit
|
const operType = ref('add') // add 或 edit
|
||||||
|
const roomList = ref<any[]>([])
|
||||||
|
|
||||||
// 提交表单数据
|
// 提交表单数据
|
||||||
const form = reactive({
|
const form = reactive({
|
||||||
@@ -54,7 +68,7 @@ const form = reactive({
|
|||||||
// 定义校验规则
|
// 定义校验规则
|
||||||
const dataRules = {
|
const dataRules = {
|
||||||
roomNo: [
|
roomNo: [
|
||||||
{ required: true, message: '请输入房间号', trigger: 'blur' }
|
{ required: true, message: '请选择房间号', trigger: 'change' }
|
||||||
],
|
],
|
||||||
reformDate: [
|
reformDate: [
|
||||||
{ required: true, message: '请选择整改时间', trigger: 'change' }
|
{ required: true, message: '请选择整改时间', trigger: 'change' }
|
||||||
@@ -90,6 +104,23 @@ const openDialog = (type: string = 'add', row?: any) => {
|
|||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// 获取房间号列表
|
||||||
|
const getRoomListData = async () => {
|
||||||
|
try {
|
||||||
|
const res = await getRoomList()
|
||||||
|
if (res.data) {
|
||||||
|
roomList.value = Array.isArray(res.data) ? res.data : []
|
||||||
|
}
|
||||||
|
} catch (err) {
|
||||||
|
roomList.value = []
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// 初始化
|
||||||
|
onMounted(() => {
|
||||||
|
getRoomListData()
|
||||||
|
})
|
||||||
|
|
||||||
// 提交表单
|
// 提交表单
|
||||||
const onSubmit = async () => {
|
const onSubmit = async () => {
|
||||||
if (!dataFormRef.value) return
|
if (!dataFormRef.value) return
|
||||||
|
|||||||
@@ -193,7 +193,8 @@ const onSubmit = async () => {
|
|||||||
visible.value = false
|
visible.value = false
|
||||||
emit('refresh')
|
emit('refresh')
|
||||||
} catch (err: any) {
|
} catch (err: any) {
|
||||||
useMessage().error(err.msg || '转宿失败')
|
// 统一交给全局拦截器处理错误提示,避免在这里重复弹出一次
|
||||||
|
console.error('转宿失败', err)
|
||||||
} finally {
|
} finally {
|
||||||
loading.value = false
|
loading.value = false
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,21 +1,21 @@
|
|||||||
<template>
|
<template>
|
||||||
<div class="modern-page-container">
|
<div class="modern-page-container">
|
||||||
<div class="page-wrapper">
|
<div class="page-wrapper">
|
||||||
<!-- ?????? -->
|
<!-- 查询条件 -->
|
||||||
<el-card v-show="showSearch" class="search-card" shadow="never">
|
<el-card v-show="showSearch" class="search-card" shadow="never">
|
||||||
<template #header>
|
<template #header>
|
||||||
<div class="card-header">
|
<div class="card-header">
|
||||||
<span class="card-title">
|
<span class="card-title">
|
||||||
<el-icon class="title-icon"><Search /></el-icon>
|
<el-icon class="title-icon"><Search /></el-icon>
|
||||||
????
|
查询条件
|
||||||
</span>
|
</span>
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
<el-form :model="state.queryForm" ref="searchFormRef" :inline="true" @keyup.enter="getDataList" class="search-form">
|
<el-form :model="state.queryForm" ref="searchFormRef" :inline="true" @keyup.enter="getDataList" class="search-form">
|
||||||
<el-form-item label="??" prop="schoolYear">
|
<el-form-item label="学年" prop="schoolYear">
|
||||||
<el-select
|
<el-select
|
||||||
v-model="state.queryForm.schoolYear"
|
v-model="state.queryForm.schoolYear"
|
||||||
placeholder="?????"
|
placeholder="请选择学年"
|
||||||
clearable
|
clearable
|
||||||
filterable
|
filterable
|
||||||
style="width: 200px">
|
style="width: 200px">
|
||||||
@@ -27,10 +27,10 @@
|
|||||||
</el-option>
|
</el-option>
|
||||||
</el-select>
|
</el-select>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item label="??" prop="schoolTerm">
|
<el-form-item label="学期" prop="schoolTerm">
|
||||||
<el-select
|
<el-select
|
||||||
v-model="state.queryForm.schoolTerm"
|
v-model="state.queryForm.schoolTerm"
|
||||||
placeholder="?????"
|
placeholder="请选择学期"
|
||||||
clearable
|
clearable
|
||||||
style="width: 200px">
|
style="width: 200px">
|
||||||
<el-option
|
<el-option
|
||||||
@@ -41,48 +41,48 @@
|
|||||||
</el-option>
|
</el-option>
|
||||||
</el-select>
|
</el-select>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item label="???" prop="roomNo">
|
<el-form-item label="宿舍号" prop="roomNo">
|
||||||
<el-input
|
<el-input
|
||||||
v-model="state.queryForm.roomNo"
|
v-model="state.queryForm.roomNo"
|
||||||
placeholder="??????"
|
placeholder="请输入宿舍号"
|
||||||
clearable
|
clearable
|
||||||
style="width: 200px" />
|
style="width: 200px" />
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item label="????" prop="ruleName">
|
<el-form-item label="奖项名称" prop="ruleName">
|
||||||
<el-input
|
<el-input
|
||||||
v-model="state.queryForm.ruleName"
|
v-model="state.queryForm.ruleName"
|
||||||
placeholder="???????"
|
placeholder="请输入奖项名称"
|
||||||
clearable
|
clearable
|
||||||
style="width: 200px" />
|
style="width: 200px" />
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item>
|
<el-form-item>
|
||||||
<el-button type="primary" plain icon="Search" @click="getDataList">??</el-button>
|
<el-button type="primary" plain icon="Search" @click="getDataList">查询</el-button>
|
||||||
<el-button icon="Refresh" @click="handleReset">??</el-button>
|
<el-button icon="Refresh" @click="handleReset">重置</el-button>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
</el-form>
|
</el-form>
|
||||||
</el-card>
|
</el-card>
|
||||||
|
|
||||||
<!-- ???? -->
|
<!-- 数据列表 -->
|
||||||
<el-card class="content-card" shadow="never">
|
<el-card class="content-card" shadow="never">
|
||||||
<template #header>
|
<template #header>
|
||||||
<div class="card-header">
|
<div class="card-header">
|
||||||
<span class="card-title">
|
<span class="card-title">
|
||||||
<el-icon class="title-icon"><Document /></el-icon>
|
<el-icon class="title-icon"><Document /></el-icon>
|
||||||
????????
|
文明宿舍列表
|
||||||
</span>
|
</span>
|
||||||
<div class="header-actions">
|
<div class="header-actions">
|
||||||
<el-button
|
<el-button
|
||||||
icon="Plus"
|
icon="Plus"
|
||||||
type="primary"
|
type="primary"
|
||||||
@click="formDialogRef.openDialog()">
|
@click="formDialogRef.openDialog()">
|
||||||
??
|
新增
|
||||||
</el-button>
|
</el-button>
|
||||||
<el-button
|
<el-button
|
||||||
icon="Upload"
|
icon="Upload"
|
||||||
type="success"
|
type="success"
|
||||||
class="ml10"
|
class="ml10"
|
||||||
@click="handleImport">
|
@click="handleImport">
|
||||||
??
|
导入
|
||||||
</el-button>
|
</el-button>
|
||||||
<right-toolbar
|
<right-toolbar
|
||||||
v-model:showSearch="showSearch"
|
v-model:showSearch="showSearch"
|
||||||
@@ -98,7 +98,7 @@
|
|||||||
@order-change="handleColumnOrderChange"
|
@order-change="handleColumnOrderChange"
|
||||||
>
|
>
|
||||||
<template #trigger>
|
<template #trigger>
|
||||||
<el-tooltip class="item" effect="dark" content="???" placement="top">
|
<el-tooltip class="item" effect="dark" content="列设置" placement="top">
|
||||||
<el-button circle style="margin-left: 0;">
|
<el-button circle style="margin-left: 0;">
|
||||||
<el-icon><Menu /></el-icon>
|
<el-icon><Menu /></el-icon>
|
||||||
</el-button>
|
</el-button>
|
||||||
@@ -110,7 +110,7 @@
|
|||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<!-- ?? -->
|
<!-- 表格 -->
|
||||||
<el-table
|
<el-table
|
||||||
:data="state.dataList"
|
:data="state.dataList"
|
||||||
v-loading="state.loading"
|
v-loading="state.loading"
|
||||||
@@ -118,7 +118,7 @@
|
|||||||
:cell-style="tableStyle.cellStyle"
|
:cell-style="tableStyle.cellStyle"
|
||||||
:header-cell-style="tableStyle.headerCellStyle"
|
:header-cell-style="tableStyle.headerCellStyle"
|
||||||
class="modern-table">
|
class="modern-table">
|
||||||
<el-table-column type="index" label="??" width="70" align="center">
|
<el-table-column type="index" label="序号" width="70" align="center">
|
||||||
<template #header>
|
<template #header>
|
||||||
<el-icon><List /></el-icon>
|
<el-icon><List /></el-icon>
|
||||||
</template>
|
</template>
|
||||||
@@ -128,7 +128,7 @@
|
|||||||
</el-table-column>
|
</el-table-column>
|
||||||
<template v-for="col in visibleColumnsSorted" :key="col.prop || col.label">
|
<template v-for="col in visibleColumnsSorted" :key="col.prop || col.label">
|
||||||
<el-table-column
|
<el-table-column
|
||||||
v-if="checkColumnVisible(col.prop || '') && col.prop !== '??'"
|
v-if="checkColumnVisible(col.prop || '') && col.prop !== '序号'"
|
||||||
:prop="col.prop"
|
:prop="col.prop"
|
||||||
:label="col.label"
|
:label="col.label"
|
||||||
:width="col.width"
|
:width="col.width"
|
||||||
@@ -152,10 +152,10 @@
|
|||||||
</template>
|
</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
</template>
|
</template>
|
||||||
<el-table-column label="??" width="150" align="center" fixed="right">
|
<el-table-column label="操作" width="150" align="center" fixed="right">
|
||||||
<template #header>
|
<template #header>
|
||||||
<el-icon><Setting /></el-icon>
|
<el-icon><Setting /></el-icon>
|
||||||
<span style="margin-left: 4px">??</span>
|
<span style="margin-left: 4px">操作</span>
|
||||||
</template>
|
</template>
|
||||||
<template #default="scope">
|
<template #default="scope">
|
||||||
<el-button
|
<el-button
|
||||||
@@ -163,20 +163,20 @@
|
|||||||
link
|
link
|
||||||
type="primary"
|
type="primary"
|
||||||
@click="handleEdit(scope.row)">
|
@click="handleEdit(scope.row)">
|
||||||
??
|
编辑
|
||||||
</el-button>
|
</el-button>
|
||||||
<el-button
|
<el-button
|
||||||
icon="Delete"
|
icon="Delete"
|
||||||
link
|
link
|
||||||
type="danger"
|
type="danger"
|
||||||
@click="handleDelete(scope.row)">
|
@click="handleDelete(scope.row)">
|
||||||
??
|
删除
|
||||||
</el-button>
|
</el-button>
|
||||||
</template>
|
</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
</el-table>
|
</el-table>
|
||||||
|
|
||||||
<!-- ?? -->
|
<!-- 分页 -->
|
||||||
<div class="pagination-wrapper">
|
<div class="pagination-wrapper">
|
||||||
<pagination
|
<pagination
|
||||||
@size-change="sizeChangeHandle"
|
@size-change="sizeChangeHandle"
|
||||||
@@ -186,12 +186,12 @@
|
|||||||
</el-card>
|
</el-card>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<!-- ??/?????? -->
|
<!-- 新增/编辑对话框 -->
|
||||||
<form-dialog ref="formDialogRef" @refresh="getDataList" />
|
<form-dialog ref="formDialogRef" @refresh="getDataList" />
|
||||||
|
|
||||||
<!-- ???? -->
|
<!-- 导入对话框 -->
|
||||||
<el-dialog
|
<el-dialog
|
||||||
title="??????"
|
title="导入数据"
|
||||||
v-model="importDialogVisible"
|
v-model="importDialogVisible"
|
||||||
:width="500"
|
:width="500"
|
||||||
:close-on-click-modal="false"
|
:close-on-click-modal="false"
|
||||||
@@ -201,7 +201,7 @@
|
|||||||
icon="Download"
|
icon="Download"
|
||||||
type="success"
|
type="success"
|
||||||
@click="handleDownloadTemplate">
|
@click="handleDownloadTemplate">
|
||||||
????
|
下载模板
|
||||||
</el-button>
|
</el-button>
|
||||||
</div>
|
</div>
|
||||||
<el-upload
|
<el-upload
|
||||||
@@ -213,18 +213,18 @@
|
|||||||
drag>
|
drag>
|
||||||
<el-icon class="el-icon--upload"><upload-filled /></el-icon>
|
<el-icon class="el-icon--upload"><upload-filled /></el-icon>
|
||||||
<div class="el-upload__text">
|
<div class="el-upload__text">
|
||||||
????????<em>????</em>
|
将文件拖到此处,或<em>点击上传</em>
|
||||||
</div>
|
</div>
|
||||||
<template #tip>
|
<template #tip>
|
||||||
<div class="el-upload__tip">
|
<div class="el-upload__tip">
|
||||||
???? xlsx/xls ??
|
只能上传 xlsx/xls 文件
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
</el-upload>
|
</el-upload>
|
||||||
<template #footer>
|
<template #footer>
|
||||||
<span class="dialog-footer">
|
<span class="dialog-footer">
|
||||||
<el-button @click="importDialogVisible = false">??</el-button>
|
<el-button @click="importDialogVisible = false">取消</el-button>
|
||||||
<el-button type="primary" @click="handleImportSubmit" :disabled="!importFile || importLoading">??</el-button>
|
<el-button type="primary" @click="handleImportSubmit" :disabled="!importFile || importLoading">确认</el-button>
|
||||||
</span>
|
</span>
|
||||||
</template>
|
</template>
|
||||||
</el-dialog>
|
</el-dialog>
|
||||||
@@ -245,7 +245,7 @@ import { useTableColumnControl } from '/@/hooks/tableColumn'
|
|||||||
import FormDialog from './form.vue'
|
import FormDialog from './form.vue'
|
||||||
|
|
||||||
|
|
||||||
// ????
|
// 定义变量
|
||||||
const route = useRoute()
|
const route = useRoute()
|
||||||
const formDialogRef = ref()
|
const formDialogRef = ref()
|
||||||
const uploadRef = ref()
|
const uploadRef = ref()
|
||||||
@@ -258,31 +258,31 @@ const importDialogVisible = ref(false)
|
|||||||
const importFile = ref<File | null>(null)
|
const importFile = ref<File | null>(null)
|
||||||
const importLoading = ref(false)
|
const importLoading = ref(false)
|
||||||
|
|
||||||
// ?????
|
// 表格列配置
|
||||||
const tableColumns = [
|
const tableColumns = [
|
||||||
{ prop: 'schoolYear', label: '??', icon: Calendar },
|
{ prop: 'schoolYear', label: '学年', icon: Calendar },
|
||||||
{ prop: 'schoolTerm', label: '??', icon: Clock },
|
{ prop: 'schoolTerm', label: '学期', icon: Clock },
|
||||||
{ prop: 'roomNo', label: '???', icon: House },
|
{ prop: 'roomNo', label: '宿舍号', icon: House },
|
||||||
{ prop: 'ruleName', label: '????', icon: Trophy, minWidth: 150 },
|
{ prop: 'ruleName', label: '奖项名称', icon: Trophy, minWidth: 150 },
|
||||||
{ prop: 'remarks', label: '??', icon: EditPen, minWidth: 200 }
|
{ prop: 'remarks', label: '备注', icon: EditPen, minWidth: 200 }
|
||||||
]
|
]
|
||||||
|
|
||||||
// ??????? hook
|
// 表格列控制 hook
|
||||||
const {
|
const {
|
||||||
visibleColumns,
|
visibleColumns,
|
||||||
visibleColumnsSorted,
|
visibleColumnsSorted,
|
||||||
checkColumnVisible,
|
checkColumnVisible,
|
||||||
handleColumnChange,
|
handleColumnChange,
|
||||||
handleColumnOrderChange
|
handleColumnOrderChange
|
||||||
} = useTableColumnControl(tableColumns, route.path)
|
} = useTableColumnControl(tableColumns)
|
||||||
|
|
||||||
// ????
|
// 表格样式
|
||||||
const tableStyle = {
|
const tableStyle = {
|
||||||
cellStyle: { padding: '8px 0' },
|
cellStyle: { padding: '8px 0' },
|
||||||
headerCellStyle: { background: '#f5f7fa', color: '#606266', fontWeight: 'bold' }
|
headerCellStyle: { background: '#f5f7fa', color: '#606266', fontWeight: 'bold' }
|
||||||
}
|
}
|
||||||
|
|
||||||
// ?? useTable
|
// 使用 useTable
|
||||||
const state: BasicTableProps = reactive<BasicTableProps>({
|
const state: BasicTableProps = reactive<BasicTableProps>({
|
||||||
queryForm: {
|
queryForm: {
|
||||||
schoolYear: '',
|
schoolYear: '',
|
||||||
@@ -295,7 +295,7 @@ const state: BasicTableProps = reactive<BasicTableProps>({
|
|||||||
item: 'records',
|
item: 'records',
|
||||||
totalCount: 'total'
|
totalCount: 'total'
|
||||||
},
|
},
|
||||||
createdIsNeed: true // ?????????
|
createdIsNeed: true // 创建时是否需要请求数据
|
||||||
})
|
})
|
||||||
|
|
||||||
// table hook
|
// table hook
|
||||||
@@ -306,7 +306,7 @@ const {
|
|||||||
tableStyle: _tableStyle
|
tableStyle: _tableStyle
|
||||||
} = useTable(state)
|
} = useTable(state)
|
||||||
|
|
||||||
// ?????
|
// 格式化学期
|
||||||
const formatSchoolTerm = (value: string | number) => {
|
const formatSchoolTerm = (value: string | number) => {
|
||||||
if (value === null || value === undefined || value === '') {
|
if (value === null || value === undefined || value === '') {
|
||||||
return '-'
|
return '-'
|
||||||
@@ -315,7 +315,7 @@ const formatSchoolTerm = (value: string | number) => {
|
|||||||
return dictItem ? dictItem.label : value
|
return dictItem ? dictItem.label : value
|
||||||
}
|
}
|
||||||
|
|
||||||
// ??
|
// 重置
|
||||||
const handleReset = () => {
|
const handleReset = () => {
|
||||||
searchFormRef.value?.resetFields()
|
searchFormRef.value?.resetFields()
|
||||||
state.queryForm.schoolYear = ''
|
state.queryForm.schoolYear = ''
|
||||||
@@ -325,22 +325,22 @@ const handleReset = () => {
|
|||||||
getDataList()
|
getDataList()
|
||||||
}
|
}
|
||||||
|
|
||||||
// ????
|
// 导入
|
||||||
const handleImport = () => {
|
const handleImport = () => {
|
||||||
importDialogVisible.value = true
|
importDialogVisible.value = true
|
||||||
importFile.value = null
|
importFile.value = null
|
||||||
uploadRef.value?.clearFiles()
|
uploadRef.value?.clearFiles()
|
||||||
}
|
}
|
||||||
|
|
||||||
// ????
|
// 下载模板
|
||||||
const handleDownloadTemplate = async () => {
|
const handleDownloadTemplate = async () => {
|
||||||
try {
|
try {
|
||||||
const fileName = '????????.xlsx'
|
const fileName = '文明宿舍导入模板.xlsx'
|
||||||
// ?????? views/stuwork/rewarddorm ? assets/file ?
|
// 模板文件位于 views/stuwork/rewarddorm 下的 assets/file 目录
|
||||||
const fileUrl = new URL(`../../../assets/file/${fileName}`, import.meta.url).href
|
const fileUrl = new URL(`../../../assets/file/${fileName}`, import.meta.url).href
|
||||||
const response = await fetch(fileUrl)
|
const response = await fetch(fileUrl)
|
||||||
if (!response.ok) {
|
if (!response.ok) {
|
||||||
throw new Error('??????')
|
throw new Error('下载失败')
|
||||||
}
|
}
|
||||||
const blob = await response.blob()
|
const blob = await response.blob()
|
||||||
const url = window.URL.createObjectURL(blob)
|
const url = window.URL.createObjectURL(blob)
|
||||||
@@ -351,60 +351,60 @@ const handleDownloadTemplate = async () => {
|
|||||||
link.click()
|
link.click()
|
||||||
window.URL.revokeObjectURL(url)
|
window.URL.revokeObjectURL(url)
|
||||||
document.body.removeChild(link)
|
document.body.removeChild(link)
|
||||||
useMessage().success('??????')
|
useMessage().success('下载成功')
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
useMessage().error('??????')
|
useMessage().error('下载失败')
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// ????
|
// 文件变化
|
||||||
const handleFileChange = (file: any) => {
|
const handleFileChange = (file: any) => {
|
||||||
importFile.value = file.raw
|
importFile.value = file.raw
|
||||||
}
|
}
|
||||||
|
|
||||||
// ????
|
// 提交导入
|
||||||
const handleImportSubmit = async () => {
|
const handleImportSubmit = async () => {
|
||||||
if (!importFile.value) {
|
if (!importFile.value) {
|
||||||
useMessage().warning('?????????')
|
useMessage().warning('请先选择要上传的文件')
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
importLoading.value = true
|
importLoading.value = true
|
||||||
try {
|
try {
|
||||||
await importExcel(importFile.value)
|
await importExcel(importFile.value)
|
||||||
useMessage().success('????')
|
useMessage().success('导入成功')
|
||||||
importDialogVisible.value = false
|
importDialogVisible.value = false
|
||||||
importFile.value = null
|
importFile.value = null
|
||||||
uploadRef.value?.clearFiles()
|
uploadRef.value?.clearFiles()
|
||||||
getDataList()
|
getDataList()
|
||||||
} catch (err: any) {
|
} catch (err: any) {
|
||||||
useMessage().error(err.msg || '????')
|
useMessage().error(err.msg || '导入失败')
|
||||||
} finally {
|
} finally {
|
||||||
importLoading.value = false
|
importLoading.value = false
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// ??
|
// 编辑
|
||||||
const handleEdit = (row: any) => {
|
const handleEdit = (row: any) => {
|
||||||
formDialogRef.value?.openDialog('edit', row)
|
formDialogRef.value?.openDialog('edit', row)
|
||||||
}
|
}
|
||||||
|
|
||||||
// ??
|
// 删除
|
||||||
const handleDelete = async (row: any) => {
|
const handleDelete = async (row: any) => {
|
||||||
const { confirm } = useMessageBox()
|
const { confirm } = useMessageBox()
|
||||||
try {
|
try {
|
||||||
await confirm('???????????')
|
await confirm('确定要删除该记录吗?')
|
||||||
await delObj([row.id])
|
await delObj([row.id])
|
||||||
useMessage().success('????')
|
useMessage().success('删除成功')
|
||||||
getDataList()
|
getDataList()
|
||||||
} catch (err: any) {
|
} catch (err: any) {
|
||||||
if (err !== 'cancel') {
|
if (err !== 'cancel') {
|
||||||
useMessage().error(err.msg || '????')
|
useMessage().error(err.msg || '删除失败')
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// ??????
|
// 获取学年列表
|
||||||
const getSchoolYearList = async () => {
|
const getSchoolYearList = async () => {
|
||||||
try {
|
try {
|
||||||
const res = await queryAllSchoolYear()
|
const res = await queryAllSchoolYear()
|
||||||
@@ -418,7 +418,7 @@ const getSchoolYearList = async () => {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// ??????
|
// 获取学期字典
|
||||||
const getSchoolTermDict = async () => {
|
const getSchoolTermDict = async () => {
|
||||||
try {
|
try {
|
||||||
const res = await getDicts('school_term')
|
const res = await getDicts('school_term')
|
||||||
@@ -435,7 +435,7 @@ const getSchoolTermDict = async () => {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// ???
|
// 初始化
|
||||||
onMounted(() => {
|
onMounted(() => {
|
||||||
getSchoolYearList()
|
getSchoolYearList()
|
||||||
getSchoolTermDict()
|
getSchoolTermDict()
|
||||||
|
|||||||
@@ -1,21 +1,21 @@
|
|||||||
<template>
|
<template>
|
||||||
<div class="modern-page-container">
|
<div class="modern-page-container">
|
||||||
<div class="page-wrapper">
|
<div class="page-wrapper">
|
||||||
<!-- ???? -->
|
<!-- 查询条件 -->
|
||||||
<el-card v-show="showSearch" class="search-card" shadow="never">
|
<el-card v-show="showSearch" class="search-card" shadow="never">
|
||||||
<template #header>
|
<template #header>
|
||||||
<div class="card-header">
|
<div class="card-header">
|
||||||
<span class="card-title">
|
<span class="card-title">
|
||||||
<el-icon class="title-icon"><Search /></el-icon>
|
<el-icon class="title-icon"><Search /></el-icon>
|
||||||
????
|
查询条件
|
||||||
</span>
|
</span>
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
<el-form :model="state.queryForm" ref="searchFormRef" :inline="true" @keyup.enter="getDataList" class="search-form">
|
<el-form :model="state.queryForm" ref="searchFormRef" :inline="true" @keyup.enter="getDataList" class="search-form">
|
||||||
<el-form-item label="????" prop="ruleType">
|
<el-form-item label="奖项类型" prop="ruleType">
|
||||||
<el-select
|
<el-select
|
||||||
v-model="state.queryForm.ruleType"
|
v-model="state.queryForm.ruleType"
|
||||||
placeholder="请输入奖项名称"
|
placeholder="请选择奖项类型"
|
||||||
clearable
|
clearable
|
||||||
style="width: 200px">
|
style="width: 200px">
|
||||||
<el-option
|
<el-option
|
||||||
@@ -27,26 +27,26 @@
|
|||||||
</el-select>
|
</el-select>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item>
|
<el-form-item>
|
||||||
<el-button type="primary" plain icon="Search" @click="getDataList">??</el-button>
|
<el-button type="primary" plain icon="Search" @click="getDataList">查询</el-button>
|
||||||
<el-button icon="Refresh" @click="handleReset">重置</el-button>
|
<el-button icon="Refresh" @click="handleReset">重置</el-button>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
</el-form>
|
</el-form>
|
||||||
</el-card>
|
</el-card>
|
||||||
|
|
||||||
<!-- ???? -->
|
<!-- 数据列表 -->
|
||||||
<el-card class="content-card" shadow="never">
|
<el-card class="content-card" shadow="never">
|
||||||
<template #header>
|
<template #header>
|
||||||
<div class="card-header">
|
<div class="card-header">
|
||||||
<span class="card-title">
|
<span class="card-title">
|
||||||
<el-icon class="title-icon"><Document /></el-icon>
|
<el-icon class="title-icon"><Document /></el-icon>
|
||||||
????????
|
评优评先奖项列表
|
||||||
</span>
|
</span>
|
||||||
<div class="header-actions">
|
<div class="header-actions">
|
||||||
<el-button
|
<el-button
|
||||||
icon="Plus"
|
icon="Plus"
|
||||||
type="primary"
|
type="primary"
|
||||||
@click="formDialogRef.openDialog()">
|
@click="formDialogRef.openDialog()">
|
||||||
??
|
新增
|
||||||
</el-button>
|
</el-button>
|
||||||
<right-toolbar
|
<right-toolbar
|
||||||
v-model:showSearch="showSearch"
|
v-model:showSearch="showSearch"
|
||||||
@@ -92,7 +92,7 @@
|
|||||||
</el-table-column>
|
</el-table-column>
|
||||||
<template v-for="col in visibleColumnsSorted" :key="col.prop || col.label">
|
<template v-for="col in visibleColumnsSorted" :key="col.prop || col.label">
|
||||||
<el-table-column
|
<el-table-column
|
||||||
v-if="checkColumnVisible(col.prop || '') && col.prop !== '操作'"
|
v-if="checkColumnVisible(col.prop || '') && col.prop !== '序号'"
|
||||||
:prop="col.prop"
|
:prop="col.prop"
|
||||||
:label="col.label"
|
:label="col.label"
|
||||||
:width="col.width"
|
:width="col.width"
|
||||||
@@ -150,7 +150,7 @@
|
|||||||
</el-card>
|
</el-card>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<!-- ??/?????? -->
|
<!-- 新增/编辑对话框 -->
|
||||||
<form-dialog ref="formDialogRef" @refresh="getDataList" />
|
<form-dialog ref="formDialogRef" @refresh="getDataList" />
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
@@ -168,7 +168,7 @@ import { List, Trophy, Collection, EditPen, Setting, Menu, Search, Document } fr
|
|||||||
import { useTableColumnControl } from '/@/hooks/tableColumn'
|
import { useTableColumnControl } from '/@/hooks/tableColumn'
|
||||||
|
|
||||||
|
|
||||||
// ??
|
// 定义变量
|
||||||
const route = useRoute()
|
const route = useRoute()
|
||||||
const formDialogRef = ref()
|
const formDialogRef = ref()
|
||||||
const searchFormRef = ref()
|
const searchFormRef = ref()
|
||||||
@@ -176,29 +176,29 @@ const columnControlRef = ref()
|
|||||||
const showSearch = ref(true)
|
const showSearch = ref(true)
|
||||||
const ruleTypeList = ref<any[]>([])
|
const ruleTypeList = ref<any[]>([])
|
||||||
|
|
||||||
// ?????
|
// 表格列配置
|
||||||
const tableColumns = [
|
const tableColumns = [
|
||||||
{ prop: 'ruleName', label: '????', icon: Trophy, minWidth: 200 },
|
{ prop: 'ruleName', label: '奖项名称', icon: Trophy, minWidth: 200 },
|
||||||
{ prop: 'ruleType', label: '????', icon: Collection },
|
{ prop: 'ruleType', label: '奖项类型', icon: Collection },
|
||||||
{ prop: 'remarks', label: '??', icon: EditPen, minWidth: 200 }
|
{ prop: 'remarks', label: '备注', icon: EditPen, minWidth: 200 }
|
||||||
]
|
]
|
||||||
|
|
||||||
// ??????? hook
|
// 表格列控制 hook
|
||||||
const {
|
const {
|
||||||
visibleColumns,
|
visibleColumns,
|
||||||
visibleColumnsSorted,
|
visibleColumnsSorted,
|
||||||
checkColumnVisible,
|
checkColumnVisible,
|
||||||
handleColumnChange,
|
handleColumnChange,
|
||||||
handleColumnOrderChange
|
handleColumnOrderChange
|
||||||
} = useTableColumnControl(tableColumns, route.path)
|
} = useTableColumnControl(tableColumns)
|
||||||
|
|
||||||
// ????
|
// 表格样式
|
||||||
const tableStyle = {
|
const tableStyle = {
|
||||||
cellStyle: { padding: '8px 0' },
|
cellStyle: { padding: '8px 0' },
|
||||||
headerCellStyle: { background: '#f5f7fa', color: '#606266', fontWeight: 'bold' }
|
headerCellStyle: { background: '#f5f7fa', color: '#606266', fontWeight: 'bold' }
|
||||||
}
|
}
|
||||||
|
|
||||||
// ?? useTable
|
// 使用 useTable
|
||||||
const state: BasicTableProps = reactive<BasicTableProps>({
|
const state: BasicTableProps = reactive<BasicTableProps>({
|
||||||
queryForm: {
|
queryForm: {
|
||||||
ruleType: ''
|
ruleType: ''
|
||||||
@@ -208,7 +208,7 @@ const state: BasicTableProps = reactive<BasicTableProps>({
|
|||||||
item: 'records',
|
item: 'records',
|
||||||
totalCount: 'total'
|
totalCount: 'total'
|
||||||
},
|
},
|
||||||
createdIsNeed: true // ???????????
|
createdIsNeed: true // 创建时是否需要请求数据
|
||||||
})
|
})
|
||||||
|
|
||||||
// table hook
|
// table hook
|
||||||
@@ -219,7 +219,7 @@ const {
|
|||||||
tableStyle: _tableStyle
|
tableStyle: _tableStyle
|
||||||
} = useTable(state)
|
} = useTable(state)
|
||||||
|
|
||||||
// ???????
|
// 格式化规则类型
|
||||||
const formatRuleType = (value: string | number) => {
|
const formatRuleType = (value: string | number) => {
|
||||||
if (value === null || value === undefined || value === '') {
|
if (value === null || value === undefined || value === '') {
|
||||||
return '-'
|
return '-'
|
||||||
@@ -228,34 +228,34 @@ const formatRuleType = (value: string | number) => {
|
|||||||
return dictItem ? dictItem.label : value
|
return dictItem ? dictItem.label : value
|
||||||
}
|
}
|
||||||
|
|
||||||
// ??
|
// 重置
|
||||||
const handleReset = () => {
|
const handleReset = () => {
|
||||||
searchFormRef.value?.resetFields()
|
searchFormRef.value?.resetFields()
|
||||||
state.queryForm.ruleType = ''
|
state.queryForm.ruleType = ''
|
||||||
getDataList()
|
getDataList()
|
||||||
}
|
}
|
||||||
|
|
||||||
// ??
|
// 编辑
|
||||||
const handleEdit = (row: any) => {
|
const handleEdit = (row: any) => {
|
||||||
formDialogRef.value?.openDialog('edit', row)
|
formDialogRef.value?.openDialog('edit', row)
|
||||||
}
|
}
|
||||||
|
|
||||||
// ??
|
// 删除
|
||||||
const handleDelete = async (row: any) => {
|
const handleDelete = async (row: any) => {
|
||||||
const { confirm } = useMessageBox()
|
const { confirm } = useMessageBox()
|
||||||
try {
|
try {
|
||||||
await confirm('??????????????')
|
await confirm('确定要删除该记录吗?')
|
||||||
await delObj([row.id])
|
await delObj([row.id])
|
||||||
useMessage().success('????')
|
useMessage().success('删除成功')
|
||||||
getDataList()
|
getDataList()
|
||||||
} catch (err: any) {
|
} catch (err: any) {
|
||||||
if (err !== 'cancel') {
|
if (err !== 'cancel') {
|
||||||
useMessage().error(err.msg || '????')
|
useMessage().error(err.msg || '删除失败')
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// ????????
|
// 获取规则类型字典
|
||||||
const getRuleTypeDict = async () => {
|
const getRuleTypeDict = async () => {
|
||||||
try {
|
try {
|
||||||
const res = await getDicts('rule_type')
|
const res = await getDicts('rule_type')
|
||||||
@@ -272,7 +272,7 @@ const getRuleTypeDict = async () => {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// ???
|
// 初始化
|
||||||
onMounted(() => {
|
onMounted(() => {
|
||||||
getRuleTypeDict()
|
getRuleTypeDict()
|
||||||
})
|
})
|
||||||
|
|||||||
@@ -1,21 +1,21 @@
|
|||||||
<template>
|
<template>
|
||||||
<div class="modern-page-container">
|
<div class="modern-page-container">
|
||||||
<div class="page-wrapper">
|
<div class="page-wrapper">
|
||||||
<!-- ?????? -->
|
<!-- 查询条件 -->
|
||||||
<el-card v-show="showSearch" class="search-card" shadow="never">
|
<el-card v-show="showSearch" class="search-card" shadow="never">
|
||||||
<template #header>
|
<template #header>
|
||||||
<div class="card-header">
|
<div class="card-header">
|
||||||
<span class="card-title">
|
<span class="card-title">
|
||||||
<el-icon class="title-icon"><Search /></el-icon>
|
<el-icon class="title-icon"><Search /></el-icon>
|
||||||
????
|
查询条件
|
||||||
</span>
|
</span>
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
<el-form :model="queryForm" ref="searchFormRef" :inline="true" @keyup.enter="getDataList" class="search-form">
|
<el-form :model="queryForm" ref="searchFormRef" :inline="true" @keyup.enter="getDataList" class="search-form">
|
||||||
<el-form-item label="??" prop="deptCode">
|
<el-form-item label="学院" prop="deptCode">
|
||||||
<el-select
|
<el-select
|
||||||
v-model="queryForm.deptCode"
|
v-model="queryForm.deptCode"
|
||||||
placeholder="?????"
|
placeholder="请选择学院"
|
||||||
clearable
|
clearable
|
||||||
filterable
|
filterable
|
||||||
style="width: 200px">
|
style="width: 200px">
|
||||||
@@ -27,10 +27,10 @@
|
|||||||
</el-option>
|
</el-option>
|
||||||
</el-select>
|
</el-select>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item label="??" prop="classCode">
|
<el-form-item label="班级" prop="classCode">
|
||||||
<el-select
|
<el-select
|
||||||
v-model="queryForm.classCode"
|
v-model="queryForm.classCode"
|
||||||
placeholder="?????"
|
placeholder="请选择班级"
|
||||||
clearable
|
clearable
|
||||||
filterable
|
filterable
|
||||||
style="width: 200px">
|
style="width: 200px">
|
||||||
@@ -42,10 +42,10 @@
|
|||||||
</el-option>
|
</el-option>
|
||||||
</el-select>
|
</el-select>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item label="??" prop="schoolYear">
|
<el-form-item label="学年" prop="schoolYear">
|
||||||
<el-select
|
<el-select
|
||||||
v-model="queryForm.schoolYear"
|
v-model="queryForm.schoolYear"
|
||||||
placeholder="?????"
|
placeholder="请选择学年"
|
||||||
clearable
|
clearable
|
||||||
filterable
|
filterable
|
||||||
style="width: 200px">
|
style="width: 200px">
|
||||||
@@ -57,10 +57,10 @@
|
|||||||
</el-option>
|
</el-option>
|
||||||
</el-select>
|
</el-select>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item label="??" prop="schoolTerm">
|
<el-form-item label="学期" prop="schoolTerm">
|
||||||
<el-select
|
<el-select
|
||||||
v-model="queryForm.schoolTerm"
|
v-model="queryForm.schoolTerm"
|
||||||
placeholder="?????"
|
placeholder="请选择学期"
|
||||||
clearable
|
clearable
|
||||||
style="width: 200px">
|
style="width: 200px">
|
||||||
<el-option
|
<el-option
|
||||||
@@ -72,19 +72,19 @@
|
|||||||
</el-select>
|
</el-select>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item>
|
<el-form-item>
|
||||||
<el-button type="primary" plain icon="Search" @click="getDataList">??</el-button>
|
<el-button type="primary" plain icon="Search" @click="getDataList">查询</el-button>
|
||||||
<el-button icon="Refresh" @click="handleReset">??</el-button>
|
<el-button icon="Refresh" @click="handleReset">重置</el-button>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
</el-form>
|
</el-form>
|
||||||
</el-card>
|
</el-card>
|
||||||
|
|
||||||
<!-- ???? -->
|
<!-- 数据列表 -->
|
||||||
<el-card class="content-card" shadow="never">
|
<el-card class="content-card" shadow="never">
|
||||||
<template #header>
|
<template #header>
|
||||||
<div class="card-header">
|
<div class="card-header">
|
||||||
<span class="card-title">
|
<span class="card-title">
|
||||||
<el-icon class="title-icon"><Document /></el-icon>
|
<el-icon class="title-icon"><Document /></el-icon>
|
||||||
????
|
奖励学生列表
|
||||||
</span>
|
</span>
|
||||||
<div class="header-actions">
|
<div class="header-actions">
|
||||||
<el-button
|
<el-button
|
||||||
@@ -92,7 +92,7 @@
|
|||||||
type="success"
|
type="success"
|
||||||
class="ml10"
|
class="ml10"
|
||||||
@click="handleExport">
|
@click="handleExport">
|
||||||
??
|
导出
|
||||||
</el-button>
|
</el-button>
|
||||||
<right-toolbar
|
<right-toolbar
|
||||||
v-model:showSearch="showSearch"
|
v-model:showSearch="showSearch"
|
||||||
@@ -108,7 +108,7 @@
|
|||||||
@order-change="handleColumnOrderChange"
|
@order-change="handleColumnOrderChange"
|
||||||
>
|
>
|
||||||
<template #trigger>
|
<template #trigger>
|
||||||
<el-tooltip class="item" effect="dark" content="???" placement="top">
|
<el-tooltip class="item" effect="dark" content="列设置" placement="top">
|
||||||
<el-button circle style="margin-left: 0;">
|
<el-button circle style="margin-left: 0;">
|
||||||
<el-icon><Menu /></el-icon>
|
<el-icon><Menu /></el-icon>
|
||||||
</el-button>
|
</el-button>
|
||||||
@@ -120,7 +120,7 @@
|
|||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<!-- ?? -->
|
<!-- 表格 -->
|
||||||
<el-table
|
<el-table
|
||||||
:data="dataList"
|
:data="dataList"
|
||||||
v-loading="loading"
|
v-loading="loading"
|
||||||
@@ -128,7 +128,7 @@
|
|||||||
:cell-style="tableStyle.cellStyle"
|
:cell-style="tableStyle.cellStyle"
|
||||||
:header-cell-style="tableStyle.headerCellStyle"
|
:header-cell-style="tableStyle.headerCellStyle"
|
||||||
class="modern-table">
|
class="modern-table">
|
||||||
<el-table-column type="index" label="??" width="70" align="center">
|
<el-table-column type="index" label="序号" width="70" align="center">
|
||||||
<template #header>
|
<template #header>
|
||||||
<el-icon><List /></el-icon>
|
<el-icon><List /></el-icon>
|
||||||
</template>
|
</template>
|
||||||
@@ -138,7 +138,7 @@
|
|||||||
</el-table-column>
|
</el-table-column>
|
||||||
<template v-for="col in visibleColumnsSorted" :key="col.prop || col.label">
|
<template v-for="col in visibleColumnsSorted" :key="col.prop || col.label">
|
||||||
<el-table-column
|
<el-table-column
|
||||||
v-if="checkColumnVisible(col.prop || '') && col.prop !== '??'"
|
v-if="checkColumnVisible(col.prop || '') && col.prop !== '序号'"
|
||||||
:prop="col.prop"
|
:prop="col.prop"
|
||||||
:label="col.label"
|
:label="col.label"
|
||||||
show-overflow-tooltip
|
show-overflow-tooltip
|
||||||
@@ -149,28 +149,28 @@
|
|||||||
<el-icon><component :is="columnConfigMap[col.prop]?.icon || OfficeBuilding" /></el-icon>
|
<el-icon><component :is="columnConfigMap[col.prop]?.icon || OfficeBuilding" /></el-icon>
|
||||||
<span style="margin-left: 4px">{{ col.label }}</span>
|
<span style="margin-left: 4px">{{ col.label }}</span>
|
||||||
</template>
|
</template>
|
||||||
<!-- ?????????? -->
|
<!-- 平均操行分格式化 -->
|
||||||
<template v-if="col.prop === 'averageConduct'" #default="scope">
|
<template v-if="col.prop === 'averageConduct'" #default="scope">
|
||||||
<el-tag v-if="scope.row.averageConduct !== null && scope.row.averageConduct !== undefined" size="small" type="success" effect="plain">
|
<el-tag v-if="scope.row.averageConduct !== null && scope.row.averageConduct !== undefined" size="small" type="success" effect="plain">
|
||||||
{{ scope.row.averageConduct.toFixed(2) }}
|
{{ scope.row.averageConduct.toFixed(2) }}
|
||||||
</el-tag>
|
</el-tag>
|
||||||
<span v-else>-</span>
|
<span v-else>-</span>
|
||||||
</template>
|
</template>
|
||||||
<!-- ???????????? -->
|
<!-- 平均学习成绩格式化 -->
|
||||||
<template v-else-if="col.prop === 'averageScore'" #default="scope">
|
<template v-else-if="col.prop === 'averageScore'" #default="scope">
|
||||||
<el-tag v-if="scope.row.averageScore !== null && scope.row.averageScore !== undefined" size="small" type="primary" effect="plain">
|
<el-tag v-if="scope.row.averageScore !== null && scope.row.averageScore !== undefined" size="small" type="primary" effect="plain">
|
||||||
{{ scope.row.averageScore.toFixed(2) }}
|
{{ scope.row.averageScore.toFixed(2) }}
|
||||||
</el-tag>
|
</el-tag>
|
||||||
<span v-else>-</span>
|
<span v-else>-</span>
|
||||||
</template>
|
</template>
|
||||||
<!-- ????????? -->
|
<!-- 规则名称格式化 -->
|
||||||
<template v-else-if="col.prop === 'ruleName'" #default="scope">
|
<template v-else-if="col.prop === 'ruleName'" #default="scope">
|
||||||
<el-tag v-if="scope.row.ruleName && Array.isArray(scope.row.ruleName) && scope.row.ruleName.length > 0" size="small" type="warning" effect="light">
|
<el-tag v-if="scope.row.ruleName && Array.isArray(scope.row.ruleName) && scope.row.ruleName.length > 0" size="small" type="warning" effect="light">
|
||||||
{{ scope.row.ruleName.join('?') }}
|
{{ scope.row.ruleName.join('、') }}
|
||||||
</el-tag>
|
</el-tag>
|
||||||
<span v-else>-</span>
|
<span v-else>-</span>
|
||||||
</template>
|
</template>
|
||||||
<!-- ????????? -->
|
<!-- 更新时间格式化 -->
|
||||||
<template v-else-if="col.prop === 'upDateTime'" #default="scope">
|
<template v-else-if="col.prop === 'upDateTime'" #default="scope">
|
||||||
<span>{{ parseTime(scope.row.upDateTime, dateTimeFormat) }}</span>
|
<span>{{ parseTime(scope.row.upDateTime, dateTimeFormat) }}</span>
|
||||||
</template>
|
</template>
|
||||||
@@ -198,7 +198,7 @@ import { useTableColumnControl } from '/@/hooks/tableColumn'
|
|||||||
|
|
||||||
const dateTimeFormat = '{y}-{m}-{d} {h}:{i}:{s}'
|
const dateTimeFormat = '{y}-{m}-{d} {h}:{i}:{s}'
|
||||||
|
|
||||||
// ????
|
// 定义变量
|
||||||
const route = useRoute()
|
const route = useRoute()
|
||||||
const searchFormRef = ref()
|
const searchFormRef = ref()
|
||||||
const columnControlRef = ref<any>()
|
const columnControlRef = ref<any>()
|
||||||
@@ -210,20 +210,20 @@ const schoolTermList = ref<any[]>([])
|
|||||||
const deptList = ref<any[]>([])
|
const deptList = ref<any[]>([])
|
||||||
const classList = ref<any[]>([])
|
const classList = ref<any[]>([])
|
||||||
|
|
||||||
// ?????
|
// 表格列配置
|
||||||
const tableColumns = [
|
const tableColumns = [
|
||||||
{ prop: 'departName', label: '????' },
|
{ prop: 'departName', label: '学院名称' },
|
||||||
{ prop: 'classNo', label: '??' },
|
{ prop: 'classNo', label: '班级' },
|
||||||
{ prop: 'stuNo', label: '??' },
|
{ prop: 'stuNo', label: '学号' },
|
||||||
{ prop: 'realName', label: '??' },
|
{ prop: 'realName', label: '姓名' },
|
||||||
{ prop: 'averageConduct', label: '?????' },
|
{ prop: 'averageConduct', label: '平均操行分' },
|
||||||
{ prop: 'averageScore', label: '???????' },
|
{ prop: 'averageScore', label: '平均学习成绩' },
|
||||||
{ prop: 'violation', label: '????', minWidth: 150 },
|
{ prop: 'violation', label: '违规情况', minWidth: 150 },
|
||||||
{ prop: 'ruleName', label: '????', minWidth: 200 },
|
{ prop: 'ruleName', label: '奖励规则', minWidth: 200 },
|
||||||
{ prop: 'upDateTime', label: '????', width: 180 }
|
{ prop: 'upDateTime', label: '更新时间', width: 180 }
|
||||||
]
|
]
|
||||||
|
|
||||||
// ?????????????
|
// 列配置映射
|
||||||
const columnConfigMap: Record<string, { icon: any }> = {
|
const columnConfigMap: Record<string, { icon: any }> = {
|
||||||
departName: { icon: OfficeBuilding },
|
departName: { icon: OfficeBuilding },
|
||||||
classNo: { icon: Grid },
|
classNo: { icon: Grid },
|
||||||
@@ -236,7 +236,7 @@ const columnConfigMap: Record<string, { icon: any }> = {
|
|||||||
upDateTime: { icon: Clock }
|
upDateTime: { icon: Clock }
|
||||||
}
|
}
|
||||||
|
|
||||||
// ???????hook
|
// 表格列控制hook
|
||||||
const {
|
const {
|
||||||
visibleColumns,
|
visibleColumns,
|
||||||
visibleColumnsSorted,
|
visibleColumnsSorted,
|
||||||
@@ -245,7 +245,7 @@ const {
|
|||||||
handleColumnOrderChange
|
handleColumnOrderChange
|
||||||
} = useTableColumnControl(tableColumns, route.path)
|
} = useTableColumnControl(tableColumns, route.path)
|
||||||
|
|
||||||
// ????
|
// 查询表单
|
||||||
const queryForm = reactive({
|
const queryForm = reactive({
|
||||||
deptCode: '',
|
deptCode: '',
|
||||||
classCode: '',
|
classCode: '',
|
||||||
@@ -253,13 +253,13 @@ const queryForm = reactive({
|
|||||||
schoolTerm: ''
|
schoolTerm: ''
|
||||||
})
|
})
|
||||||
|
|
||||||
// ????
|
// 表格样式
|
||||||
const tableStyle = {
|
const tableStyle = {
|
||||||
cellStyle: { padding: '8px 0' },
|
cellStyle: { padding: '8px 0' },
|
||||||
headerCellStyle: { background: '#f5f7fa', color: '#606266', fontWeight: 'bold' }
|
headerCellStyle: { background: '#f5f7fa', color: '#606266', fontWeight: 'bold' }
|
||||||
}
|
}
|
||||||
|
|
||||||
// ?????
|
// 格式化学期
|
||||||
const formatSchoolTerm = (value: string | number) => {
|
const formatSchoolTerm = (value: string | number) => {
|
||||||
if (value === null || value === undefined || value === '') {
|
if (value === null || value === undefined || value === '') {
|
||||||
return '-'
|
return '-'
|
||||||
@@ -268,7 +268,7 @@ const formatSchoolTerm = (value: string | number) => {
|
|||||||
return dictItem ? dictItem.label : value
|
return dictItem ? dictItem.label : value
|
||||||
}
|
}
|
||||||
|
|
||||||
// ????
|
// 获取数据列表
|
||||||
const getDataList = async () => {
|
const getDataList = async () => {
|
||||||
loading.value = true
|
loading.value = true
|
||||||
try {
|
try {
|
||||||
@@ -279,14 +279,14 @@ const getDataList = async () => {
|
|||||||
dataList.value = []
|
dataList.value = []
|
||||||
}
|
}
|
||||||
} catch (err: any) {
|
} catch (err: any) {
|
||||||
useMessage().error(err.msg || '??????')
|
useMessage().error(err.msg || '查询失败')
|
||||||
dataList.value = []
|
dataList.value = []
|
||||||
} finally {
|
} finally {
|
||||||
loading.value = false
|
loading.value = false
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// ??
|
// 重置
|
||||||
const handleReset = () => {
|
const handleReset = () => {
|
||||||
searchFormRef.value?.resetFields()
|
searchFormRef.value?.resetFields()
|
||||||
queryForm.deptCode = ''
|
queryForm.deptCode = ''
|
||||||
@@ -296,43 +296,43 @@ const handleReset = () => {
|
|||||||
getDataList()
|
getDataList()
|
||||||
}
|
}
|
||||||
|
|
||||||
// ??
|
// 导出
|
||||||
const handleExport = async () => {
|
const handleExport = async () => {
|
||||||
try {
|
try {
|
||||||
loading.value = true
|
loading.value = true
|
||||||
const res = await exportExcel(queryForm)
|
const res = await exportExcel(queryForm)
|
||||||
|
|
||||||
// ?? blob
|
// 创建 blob
|
||||||
const blob = new Blob([res], {
|
const blob = new Blob([res], {
|
||||||
type: 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet'
|
type: 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet'
|
||||||
})
|
})
|
||||||
|
|
||||||
// ??????
|
// 创建下载链接
|
||||||
const url = window.URL.createObjectURL(blob)
|
const url = window.URL.createObjectURL(blob)
|
||||||
const link = document.createElement('a')
|
const link = document.createElement('a')
|
||||||
link.href = url
|
link.href = url
|
||||||
|
|
||||||
// ???
|
// 设置文件名
|
||||||
const fileName = `??????_${new Date().getTime()}.xlsx`
|
const fileName = `奖励学生_${new Date().getTime()}.xlsx`
|
||||||
link.setAttribute('download', fileName)
|
link.setAttribute('download', fileName)
|
||||||
|
|
||||||
// ????
|
// 触发下载
|
||||||
document.body.appendChild(link)
|
document.body.appendChild(link)
|
||||||
link.click()
|
link.click()
|
||||||
|
|
||||||
// ??
|
// 清理
|
||||||
document.body.removeChild(link)
|
document.body.removeChild(link)
|
||||||
window.URL.revokeObjectURL(url)
|
window.URL.revokeObjectURL(url)
|
||||||
|
|
||||||
useMessage().success('????')
|
useMessage().success('导出成功')
|
||||||
} catch (err: any) {
|
} catch (err: any) {
|
||||||
useMessage().error(err.msg || '????')
|
useMessage().error(err.msg || '导出失败')
|
||||||
} finally {
|
} finally {
|
||||||
loading.value = false
|
loading.value = false
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// ??????
|
// 获取学年列表
|
||||||
const getSchoolYearList = async () => {
|
const getSchoolYearList = async () => {
|
||||||
try {
|
try {
|
||||||
const res = await queryAllSchoolYear()
|
const res = await queryAllSchoolYear()
|
||||||
@@ -346,7 +346,7 @@ const getSchoolYearList = async () => {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// ??????
|
// 获取学期字典
|
||||||
const getSchoolTermDict = async () => {
|
const getSchoolTermDict = async () => {
|
||||||
try {
|
try {
|
||||||
const res = await getDicts('school_term')
|
const res = await getDicts('school_term')
|
||||||
@@ -363,7 +363,7 @@ const getSchoolTermDict = async () => {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// ??????
|
// 获取学院列表
|
||||||
const getDeptListData = async () => {
|
const getDeptListData = async () => {
|
||||||
try {
|
try {
|
||||||
const res = await getDeptList()
|
const res = await getDeptList()
|
||||||
@@ -377,7 +377,7 @@ const getDeptListData = async () => {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// ??????
|
// 获取班级列表
|
||||||
const getClassListData = async () => {
|
const getClassListData = async () => {
|
||||||
try {
|
try {
|
||||||
const res = await getClassListByRole()
|
const res = await getClassListByRole()
|
||||||
@@ -391,7 +391,7 @@ const getClassListData = async () => {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// ????
|
// 初始化
|
||||||
onMounted(() => {
|
onMounted(() => {
|
||||||
getSchoolYearList()
|
getSchoolYearList()
|
||||||
getSchoolTermDict()
|
getSchoolTermDict()
|
||||||
@@ -400,7 +400,6 @@ onMounted(() => {
|
|||||||
getDataList()
|
getDataList()
|
||||||
nextTick(() => {
|
nextTick(() => {
|
||||||
if (visibleColumns.value.length === 0) {
|
if (visibleColumns.value.length === 0) {
|
||||||
loadSavedConfig()
|
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
})
|
})
|
||||||
|
|||||||
@@ -1,21 +1,21 @@
|
|||||||
<template>
|
<template>
|
||||||
<div class="modern-page-container">
|
<div class="modern-page-container">
|
||||||
<div class="page-wrapper">
|
<div class="page-wrapper">
|
||||||
<!-- ?????? -->
|
<!-- 查询条件 -->
|
||||||
<el-card v-show="showSearch" class="search-card" shadow="never">
|
<el-card v-show="showSearch" class="search-card" shadow="never">
|
||||||
<template #header>
|
<template #header>
|
||||||
<div class="card-header">
|
<div class="card-header">
|
||||||
<span class="card-title">
|
<span class="card-title">
|
||||||
<el-icon class="title-icon"><Search /></el-icon>
|
<el-icon class="title-icon"><Search /></el-icon>
|
||||||
????
|
查询条件
|
||||||
</span>
|
</span>
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
<el-form :model="state.queryForm" ref="searchFormRef" :inline="true" @keyup.enter="getDataList" class="search-form">
|
<el-form :model="state.queryForm" ref="searchFormRef" :inline="true" @keyup.enter="getDataList" class="search-form">
|
||||||
<el-form-item label="??" prop="schoolYear">
|
<el-form-item label="学年" prop="schoolYear">
|
||||||
<el-select
|
<el-select
|
||||||
v-model="state.queryForm.schoolYear"
|
v-model="state.queryForm.schoolYear"
|
||||||
placeholder="?????"
|
placeholder="请选择学年"
|
||||||
clearable
|
clearable
|
||||||
filterable
|
filterable
|
||||||
style="width: 200px">
|
style="width: 200px">
|
||||||
@@ -27,10 +27,10 @@
|
|||||||
</el-option>
|
</el-option>
|
||||||
</el-select>
|
</el-select>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item label="??" prop="schoolTerm">
|
<el-form-item label="学期" prop="schoolTerm">
|
||||||
<el-select
|
<el-select
|
||||||
v-model="state.queryForm.schoolTerm"
|
v-model="state.queryForm.schoolTerm"
|
||||||
placeholder="?????"
|
placeholder="请选择学期"
|
||||||
clearable
|
clearable
|
||||||
style="width: 200px">
|
style="width: 200px">
|
||||||
<el-option
|
<el-option
|
||||||
@@ -41,10 +41,10 @@
|
|||||||
</el-option>
|
</el-option>
|
||||||
</el-select>
|
</el-select>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item label="??" prop="deptCode">
|
<el-form-item label="学院" prop="deptCode">
|
||||||
<el-select
|
<el-select
|
||||||
v-model="state.queryForm.deptCode"
|
v-model="state.queryForm.deptCode"
|
||||||
placeholder="?????"
|
placeholder="请选择学院"
|
||||||
clearable
|
clearable
|
||||||
filterable
|
filterable
|
||||||
style="width: 200px">
|
style="width: 200px">
|
||||||
@@ -56,10 +56,10 @@
|
|||||||
</el-option>
|
</el-option>
|
||||||
</el-select>
|
</el-select>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item label="??" prop="classCode">
|
<el-form-item label="班级" prop="classCode">
|
||||||
<el-select
|
<el-select
|
||||||
v-model="state.queryForm.classCode"
|
v-model="state.queryForm.classCode"
|
||||||
placeholder="?????"
|
placeholder="请选择班级"
|
||||||
clearable
|
clearable
|
||||||
filterable
|
filterable
|
||||||
style="width: 200px">
|
style="width: 200px">
|
||||||
@@ -71,41 +71,41 @@
|
|||||||
</el-option>
|
</el-option>
|
||||||
</el-select>
|
</el-select>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item label="??" prop="realName">
|
<el-form-item label="姓名" prop="realName">
|
||||||
<el-input
|
<el-input
|
||||||
v-model="state.queryForm.realName"
|
v-model="state.queryForm.realName"
|
||||||
placeholder="?????"
|
placeholder="请输入姓名"
|
||||||
clearable
|
clearable
|
||||||
style="width: 200px" />
|
style="width: 200px" />
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item label="??" prop="stuNo">
|
<el-form-item label="学号" prop="stuNo">
|
||||||
<el-input
|
<el-input
|
||||||
v-model="state.queryForm.stuNo"
|
v-model="state.queryForm.stuNo"
|
||||||
placeholder="?????"
|
placeholder="请输入学号"
|
||||||
clearable
|
clearable
|
||||||
style="width: 200px" />
|
style="width: 200px" />
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item>
|
<el-form-item>
|
||||||
<el-button type="primary" plain icon="Search" @click="getDataList">??</el-button>
|
<el-button type="primary" plain icon="Search" @click="getDataList">查询</el-button>
|
||||||
<el-button icon="Refresh" @click="handleReset">??</el-button>
|
<el-button icon="Refresh" @click="handleReset">重置</el-button>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
</el-form>
|
</el-form>
|
||||||
</el-card>
|
</el-card>
|
||||||
|
|
||||||
<!-- ???? -->
|
<!-- 数据列表 -->
|
||||||
<el-card class="content-card" shadow="never">
|
<el-card class="content-card" shadow="never">
|
||||||
<template #header>
|
<template #header>
|
||||||
<div class="card-header">
|
<div class="card-header">
|
||||||
<span class="card-title">
|
<span class="card-title">
|
||||||
<el-icon class="title-icon"><Document /></el-icon>
|
<el-icon class="title-icon"><Document /></el-icon>
|
||||||
????????
|
学生关怀记录列表
|
||||||
</span>
|
</span>
|
||||||
<div class="header-actions">
|
<div class="header-actions">
|
||||||
<el-button
|
<el-button
|
||||||
icon="Plus"
|
icon="Plus"
|
||||||
type="primary"
|
type="primary"
|
||||||
@click="formDialogRef.openDialog()">
|
@click="formDialogRef.openDialog()">
|
||||||
??
|
新增
|
||||||
</el-button>
|
</el-button>
|
||||||
<right-toolbar
|
<right-toolbar
|
||||||
v-model:showSearch="showSearch"
|
v-model:showSearch="showSearch"
|
||||||
@@ -121,7 +121,7 @@
|
|||||||
@order-change="handleColumnOrderChange"
|
@order-change="handleColumnOrderChange"
|
||||||
>
|
>
|
||||||
<template #trigger>
|
<template #trigger>
|
||||||
<el-tooltip class="item" effect="dark" content="???" placement="top">
|
<el-tooltip class="item" effect="dark" content="列设置" placement="top">
|
||||||
<el-button circle style="margin-left: 0;">
|
<el-button circle style="margin-left: 0;">
|
||||||
<el-icon><Menu /></el-icon>
|
<el-icon><Menu /></el-icon>
|
||||||
</el-button>
|
</el-button>
|
||||||
@@ -133,7 +133,7 @@
|
|||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<!-- ?? -->
|
<!-- 表格 -->
|
||||||
<el-table
|
<el-table
|
||||||
:data="state.dataList"
|
:data="state.dataList"
|
||||||
v-loading="state.loading"
|
v-loading="state.loading"
|
||||||
@@ -141,7 +141,7 @@
|
|||||||
:cell-style="tableStyle.cellStyle"
|
:cell-style="tableStyle.cellStyle"
|
||||||
:header-cell-style="tableStyle.headerCellStyle"
|
:header-cell-style="tableStyle.headerCellStyle"
|
||||||
class="modern-table">
|
class="modern-table">
|
||||||
<el-table-column type="index" label="??" width="70" align="center">
|
<el-table-column type="index" label="序号" width="70" align="center">
|
||||||
<template #header>
|
<template #header>
|
||||||
<el-icon><List /></el-icon>
|
<el-icon><List /></el-icon>
|
||||||
</template>
|
</template>
|
||||||
@@ -151,7 +151,7 @@
|
|||||||
</el-table-column>
|
</el-table-column>
|
||||||
<template v-for="col in visibleColumnsSorted" :key="col.prop || col.label">
|
<template v-for="col in visibleColumnsSorted" :key="col.prop || col.label">
|
||||||
<el-table-column
|
<el-table-column
|
||||||
v-if="checkColumnVisible(col.prop || '') && col.prop !== '??'"
|
v-if="checkColumnVisible(col.prop || '') && col.prop !== '序号'"
|
||||||
:prop="col.prop"
|
:prop="col.prop"
|
||||||
:label="col.label"
|
:label="col.label"
|
||||||
show-overflow-tooltip
|
show-overflow-tooltip
|
||||||
@@ -162,32 +162,32 @@
|
|||||||
<el-icon><component :is="columnConfigMap[col.prop]?.icon || Calendar" /></el-icon>
|
<el-icon><component :is="columnConfigMap[col.prop]?.icon || Calendar" /></el-icon>
|
||||||
<span style="margin-left: 4px">{{ col.label }}</span>
|
<span style="margin-left: 4px">{{ col.label }}</span>
|
||||||
</template>
|
</template>
|
||||||
<!-- ??????? -->
|
<!-- 学期格式化 -->
|
||||||
<template v-if="col.prop === 'schoolTerm'" #default="scope">
|
<template v-if="col.prop === 'schoolTerm'" #default="scope">
|
||||||
<el-tag size="small" type="primary" effect="plain">
|
<el-tag size="small" type="primary" effect="plain">
|
||||||
{{ formatSchoolTerm(scope.row.schoolTerm) }}
|
{{ formatSchoolTerm(scope.row.schoolTerm) }}
|
||||||
</el-tag>
|
</el-tag>
|
||||||
</template>
|
</template>
|
||||||
<!-- ?????????? -->
|
<!-- 关怀类型格式化 -->
|
||||||
<template v-else-if="col.prop === 'careType'" #default="scope">
|
<template v-else-if="col.prop === 'careType'" #default="scope">
|
||||||
<el-tag size="small" type="danger" effect="plain">
|
<el-tag size="small" type="danger" effect="plain">
|
||||||
{{ formatCareType(scope.row.careType) }}
|
{{ formatCareType(scope.row.careType) }}
|
||||||
</el-tag>
|
</el-tag>
|
||||||
</template>
|
</template>
|
||||||
<!-- ????????? -->
|
<!-- 记录日期格式化 -->
|
||||||
<template v-else-if="col.prop === 'recordDate'" #default="scope">
|
<template v-else-if="col.prop === 'recordDate'" #default="scope">
|
||||||
<span>{{ scope.row.recordDate || '-' }}</span>
|
<span>{{ scope.row.recordDate || '-' }}</span>
|
||||||
</template>
|
</template>
|
||||||
<!-- ????????? -->
|
<!-- 处理结果格式化 -->
|
||||||
<template v-else-if="col.prop === 'result'" #default="scope">
|
<template v-else-if="col.prop === 'result'" #default="scope">
|
||||||
<span>{{ scope.row.result || '-' }}</span>
|
<span>{{ scope.row.result || '-' }}</span>
|
||||||
</template>
|
</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
</template>
|
</template>
|
||||||
<el-table-column label="??" width="250" align="center" fixed="right">
|
<el-table-column label="操作" width="250" align="center" fixed="right">
|
||||||
<template #header>
|
<template #header>
|
||||||
<el-icon><Setting /></el-icon>
|
<el-icon><Setting /></el-icon>
|
||||||
<span style="margin-left: 4px">??</span>
|
<span style="margin-left: 4px">操作</span>
|
||||||
</template>
|
</template>
|
||||||
<template #default="scope">
|
<template #default="scope">
|
||||||
<el-button
|
<el-button
|
||||||
@@ -195,27 +195,27 @@
|
|||||||
link
|
link
|
||||||
type="primary"
|
type="primary"
|
||||||
@click="handleEdit(scope.row)">
|
@click="handleEdit(scope.row)">
|
||||||
??
|
编辑
|
||||||
</el-button>
|
</el-button>
|
||||||
<el-button
|
<el-button
|
||||||
icon="Document"
|
icon="Document"
|
||||||
link
|
link
|
||||||
type="success"
|
type="success"
|
||||||
@click="handleResult(scope.row)">
|
@click="handleResult(scope.row)">
|
||||||
????
|
处理结果
|
||||||
</el-button>
|
</el-button>
|
||||||
<el-button
|
<el-button
|
||||||
icon="Delete"
|
icon="Delete"
|
||||||
link
|
link
|
||||||
type="danger"
|
type="danger"
|
||||||
@click="handleDelete(scope.row)">
|
@click="handleDelete(scope.row)">
|
||||||
??
|
删除
|
||||||
</el-button>
|
</el-button>
|
||||||
</template>
|
</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
</el-table>
|
</el-table>
|
||||||
|
|
||||||
<!-- ?? -->
|
<!-- 分页 -->
|
||||||
<div class="pagination-wrapper">
|
<div class="pagination-wrapper">
|
||||||
<pagination
|
<pagination
|
||||||
@size-change="sizeChangeHandle"
|
@size-change="sizeChangeHandle"
|
||||||
@@ -225,10 +225,10 @@
|
|||||||
</el-card>
|
</el-card>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<!-- ??/?????? -->
|
<!-- 新增/编辑对话框 -->
|
||||||
<form-dialog ref="formDialogRef" @refresh="getDataList" />
|
<form-dialog ref="formDialogRef" @refresh="getDataList" />
|
||||||
|
|
||||||
<!-- ?????? -->
|
<!-- 处理结果对话框 -->
|
||||||
<result-dialog ref="resultDialogRef" @refresh="getDataList" />
|
<result-dialog ref="resultDialogRef" @refresh="getDataList" />
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
@@ -250,7 +250,7 @@ import { List, Calendar, Clock, OfficeBuilding, Grid, Avatar, UserFilled, Phone,
|
|||||||
import { useTableColumnControl } from '/@/hooks/tableColumn'
|
import { useTableColumnControl } from '/@/hooks/tableColumn'
|
||||||
|
|
||||||
|
|
||||||
// ??????
|
// 定义变量
|
||||||
const route = useRoute()
|
const route = useRoute()
|
||||||
const formDialogRef = ref()
|
const formDialogRef = ref()
|
||||||
const resultDialogRef = ref()
|
const resultDialogRef = ref()
|
||||||
@@ -263,22 +263,22 @@ const deptList = ref<any[]>([])
|
|||||||
const classList = ref<any[]>([])
|
const classList = ref<any[]>([])
|
||||||
const careTypeList = ref<any[]>([])
|
const careTypeList = ref<any[]>([])
|
||||||
|
|
||||||
// ?????
|
// 表格列配置
|
||||||
const tableColumns = [
|
const tableColumns = [
|
||||||
{ prop: 'schoolYear', label: '??' },
|
{ prop: 'schoolYear', label: '学年' },
|
||||||
{ prop: 'schoolTerm', label: '??' },
|
{ prop: 'schoolTerm', label: '学期' },
|
||||||
{ prop: 'deptName', label: '??' },
|
{ prop: 'deptName', label: '学院' },
|
||||||
{ prop: 'classNo', label: '??' },
|
{ prop: 'classNo', label: '班级' },
|
||||||
{ prop: 'realName', label: '??' },
|
{ prop: 'realName', label: '姓名' },
|
||||||
{ prop: 'teacherRealName', label: '?????' },
|
{ prop: 'teacherRealName', label: '班主任姓名' },
|
||||||
{ prop: 'teacherTel', label: '?????' },
|
{ prop: 'teacherTel', label: '班主任电话' },
|
||||||
{ prop: 'careType', label: '?????' },
|
{ prop: 'careType', label: '关怀类型' },
|
||||||
{ prop: 'present', label: '????', minWidth: 150 },
|
{ prop: 'present', label: '现状描述', minWidth: 150 },
|
||||||
{ prop: 'recordDate', label: '????', width: 120 },
|
{ prop: 'recordDate', label: '记录日期', width: 120 },
|
||||||
{ prop: 'result', label: '????', minWidth: 150 }
|
{ prop: 'result', label: '处理结果', minWidth: 150 }
|
||||||
]
|
]
|
||||||
|
|
||||||
// ?????????????
|
// 列配置映射
|
||||||
const columnConfigMap: Record<string, { icon: any }> = {
|
const columnConfigMap: Record<string, { icon: any }> = {
|
||||||
schoolYear: { icon: Calendar },
|
schoolYear: { icon: Calendar },
|
||||||
schoolTerm: { icon: Clock },
|
schoolTerm: { icon: Clock },
|
||||||
@@ -293,7 +293,7 @@ const columnConfigMap: Record<string, { icon: any }> = {
|
|||||||
result: { icon: CircleCheck }
|
result: { icon: CircleCheck }
|
||||||
}
|
}
|
||||||
|
|
||||||
// ???????hook
|
// 表格列控制hook
|
||||||
const {
|
const {
|
||||||
visibleColumns,
|
visibleColumns,
|
||||||
visibleColumnsSorted,
|
visibleColumnsSorted,
|
||||||
@@ -302,7 +302,7 @@ const {
|
|||||||
handleColumnOrderChange
|
handleColumnOrderChange
|
||||||
} = useTableColumnControl(tableColumns, route.path)
|
} = useTableColumnControl(tableColumns, route.path)
|
||||||
|
|
||||||
// ?? useTable
|
// 使用 useTable
|
||||||
const state: BasicTableProps = reactive<BasicTableProps>({
|
const state: BasicTableProps = reactive<BasicTableProps>({
|
||||||
queryForm: {
|
queryForm: {
|
||||||
schoolYear: '',
|
schoolYear: '',
|
||||||
@@ -328,7 +328,7 @@ const {
|
|||||||
tableStyle
|
tableStyle
|
||||||
} = useTable(state)
|
} = useTable(state)
|
||||||
|
|
||||||
// ?????
|
// 格式化学期
|
||||||
const formatSchoolTerm = (value: string | number) => {
|
const formatSchoolTerm = (value: string | number) => {
|
||||||
if (value === null || value === undefined || value === '') {
|
if (value === null || value === undefined || value === '') {
|
||||||
return '-'
|
return '-'
|
||||||
@@ -337,14 +337,14 @@ const formatSchoolTerm = (value: string | number) => {
|
|||||||
return dictItem ? dictItem.label : value
|
return dictItem ? dictItem.label : value
|
||||||
}
|
}
|
||||||
|
|
||||||
// ????????
|
// 格式化关怀类型
|
||||||
const formatCareType = (value: string) => {
|
const formatCareType = (value: string) => {
|
||||||
if (!value) return '-'
|
if (!value) return '-'
|
||||||
const item = careTypeList.value.find((item: any) => item.value === value)
|
const item = careTypeList.value.find((item: any) => item.value === value)
|
||||||
return item ? item.label : value
|
return item ? item.label : value
|
||||||
}
|
}
|
||||||
|
|
||||||
// ??
|
// 重置
|
||||||
const handleReset = () => {
|
const handleReset = () => {
|
||||||
searchFormRef.value?.resetFields()
|
searchFormRef.value?.resetFields()
|
||||||
state.queryForm.schoolYear = ''
|
state.queryForm.schoolYear = ''
|
||||||
@@ -356,32 +356,32 @@ const handleReset = () => {
|
|||||||
getDataList()
|
getDataList()
|
||||||
}
|
}
|
||||||
|
|
||||||
// ??
|
// 编辑
|
||||||
const handleEdit = (row: any) => {
|
const handleEdit = (row: any) => {
|
||||||
formDialogRef.value?.openDialog('edit', row)
|
formDialogRef.value?.openDialog('edit', row)
|
||||||
}
|
}
|
||||||
|
|
||||||
// ????
|
// 处理结果
|
||||||
const handleResult = (row: any) => {
|
const handleResult = (row: any) => {
|
||||||
resultDialogRef.value?.openDialog(row)
|
resultDialogRef.value?.openDialog(row)
|
||||||
}
|
}
|
||||||
|
|
||||||
// ??
|
// 删除
|
||||||
const handleDelete = async (row: any) => {
|
const handleDelete = async (row: any) => {
|
||||||
const { confirm } = useMessageBox()
|
const { confirm } = useMessageBox()
|
||||||
try {
|
try {
|
||||||
await confirm('??????????????')
|
await confirm('确定要删除该记录吗?')
|
||||||
await delObj([row.id])
|
await delObj([row.id])
|
||||||
useMessage().success('????')
|
useMessage().success('删除成功')
|
||||||
getDataList()
|
getDataList()
|
||||||
} catch (err: any) {
|
} catch (err: any) {
|
||||||
if (err !== 'cancel') {
|
if (err !== 'cancel') {
|
||||||
useMessage().error(err.msg || '????')
|
useMessage().error(err.msg || '删除失败')
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// ??????
|
// 获取学年列表
|
||||||
const getSchoolYearList = async () => {
|
const getSchoolYearList = async () => {
|
||||||
try {
|
try {
|
||||||
const res = await queryAllSchoolYear()
|
const res = await queryAllSchoolYear()
|
||||||
@@ -395,7 +395,7 @@ const getSchoolYearList = async () => {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// ??????
|
// 获取学期字典
|
||||||
const getSchoolTermDict = async () => {
|
const getSchoolTermDict = async () => {
|
||||||
try {
|
try {
|
||||||
const res = await getDicts('school_term')
|
const res = await getDicts('school_term')
|
||||||
@@ -412,7 +412,7 @@ const getSchoolTermDict = async () => {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// ??????
|
// 获取学院列表
|
||||||
const getDeptListData = async () => {
|
const getDeptListData = async () => {
|
||||||
try {
|
try {
|
||||||
const res = await getDeptList()
|
const res = await getDeptList()
|
||||||
@@ -426,7 +426,7 @@ const getDeptListData = async () => {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// ??????
|
// 获取班级列表
|
||||||
const getClassListData = async () => {
|
const getClassListData = async () => {
|
||||||
try {
|
try {
|
||||||
const res = await getClassListByRole()
|
const res = await getClassListByRole()
|
||||||
@@ -440,7 +440,7 @@ const getClassListData = async () => {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// ?????????
|
// 获取关怀类型字典
|
||||||
const getCareTypeDict = async () => {
|
const getCareTypeDict = async () => {
|
||||||
try {
|
try {
|
||||||
const res = await getDicts('stu_care_type')
|
const res = await getDicts('stu_care_type')
|
||||||
@@ -457,7 +457,7 @@ const getCareTypeDict = async () => {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// ???
|
// 初始化
|
||||||
onMounted(() => {
|
onMounted(() => {
|
||||||
getSchoolYearList()
|
getSchoolYearList()
|
||||||
getSchoolTermDict()
|
getSchoolTermDict()
|
||||||
|
|||||||
@@ -1,21 +1,21 @@
|
|||||||
<template>
|
<template>
|
||||||
<div class="modern-page-container">
|
<div class="modern-page-container">
|
||||||
<div class="page-wrapper">
|
<div class="page-wrapper">
|
||||||
<!-- ?????? -->
|
<!-- 查询条件 -->
|
||||||
<el-card v-show="showSearch" class="search-card" shadow="never">
|
<el-card v-show="showSearch" class="search-card" shadow="never">
|
||||||
<template #header>
|
<template #header>
|
||||||
<div class="card-header">
|
<div class="card-header">
|
||||||
<span class="card-title">
|
<span class="card-title">
|
||||||
<el-icon class="title-icon"><Search /></el-icon>
|
<el-icon class="title-icon"><Search /></el-icon>
|
||||||
????
|
查询条件
|
||||||
</span>
|
</span>
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
<el-form :model="state.queryForm" ref="searchFormRef" :inline="true" @keyup.enter="getDataList" class="search-form">
|
<el-form :model="state.queryForm" ref="searchFormRef" :inline="true" @keyup.enter="getDataList" class="search-form">
|
||||||
<el-form-item label="??" prop="schoolYear">
|
<el-form-item label="学年" prop="schoolYear">
|
||||||
<el-select
|
<el-select
|
||||||
v-model="state.queryForm.schoolYear"
|
v-model="state.queryForm.schoolYear"
|
||||||
placeholder="?????"
|
placeholder="请选择学年"
|
||||||
clearable
|
clearable
|
||||||
filterable
|
filterable
|
||||||
style="width: 200px">
|
style="width: 200px">
|
||||||
@@ -27,10 +27,10 @@
|
|||||||
</el-option>
|
</el-option>
|
||||||
</el-select>
|
</el-select>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item label="??" prop="schoolTerm">
|
<el-form-item label="学期" prop="schoolTerm">
|
||||||
<el-select
|
<el-select
|
||||||
v-model="state.queryForm.schoolTerm"
|
v-model="state.queryForm.schoolTerm"
|
||||||
placeholder="?????"
|
placeholder="请选择学期"
|
||||||
clearable
|
clearable
|
||||||
style="width: 200px">
|
style="width: 200px">
|
||||||
<el-option
|
<el-option
|
||||||
@@ -41,10 +41,10 @@
|
|||||||
</el-option>
|
</el-option>
|
||||||
</el-select>
|
</el-select>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item label="??" prop="deptCode">
|
<el-form-item label="学院" prop="deptCode">
|
||||||
<el-select
|
<el-select
|
||||||
v-model="state.queryForm.deptCode"
|
v-model="state.queryForm.deptCode"
|
||||||
placeholder="?????"
|
placeholder="请选择学院"
|
||||||
clearable
|
clearable
|
||||||
filterable
|
filterable
|
||||||
style="width: 200px"
|
style="width: 200px"
|
||||||
@@ -57,10 +57,10 @@
|
|||||||
</el-option>
|
</el-option>
|
||||||
</el-select>
|
</el-select>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item label="??" prop="classCode">
|
<el-form-item label="班级" prop="classCode">
|
||||||
<el-select
|
<el-select
|
||||||
v-model="state.queryForm.classCode"
|
v-model="state.queryForm.classCode"
|
||||||
placeholder="?????"
|
placeholder="请选择班级"
|
||||||
clearable
|
clearable
|
||||||
filterable
|
filterable
|
||||||
style="width: 200px">
|
style="width: 200px">
|
||||||
@@ -72,17 +72,17 @@
|
|||||||
</el-option>
|
</el-option>
|
||||||
</el-select>
|
</el-select>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item label="??" prop="realName">
|
<el-form-item label="姓名" prop="realName">
|
||||||
<el-input
|
<el-input
|
||||||
v-model="state.queryForm.realName"
|
v-model="state.queryForm.realName"
|
||||||
placeholder="?????"
|
placeholder="请输入姓名"
|
||||||
clearable
|
clearable
|
||||||
style="width: 200px" />
|
style="width: 200px" />
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item label="??" prop="conductType">
|
<el-form-item label="类型" prop="conductType">
|
||||||
<el-select
|
<el-select
|
||||||
v-model="state.queryForm.conductType"
|
v-model="state.queryForm.conductType"
|
||||||
placeholder="?????"
|
placeholder="请选择类型"
|
||||||
clearable
|
clearable
|
||||||
style="width: 200px">
|
style="width: 200px">
|
||||||
<el-option
|
<el-option
|
||||||
@@ -94,33 +94,33 @@
|
|||||||
</el-select>
|
</el-select>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item>
|
<el-form-item>
|
||||||
<el-button type="primary" plain icon="Search" @click="getDataList">??</el-button>
|
<el-button type="primary" plain icon="Search" @click="getDataList">查询</el-button>
|
||||||
<el-button icon="Refresh" @click="handleReset">??</el-button>
|
<el-button icon="Refresh" @click="handleReset">重置</el-button>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
</el-form>
|
</el-form>
|
||||||
</el-card>
|
</el-card>
|
||||||
|
|
||||||
<!-- ???? -->
|
<!-- 数据列表 -->
|
||||||
<el-card class="content-card" shadow="never">
|
<el-card class="content-card" shadow="never">
|
||||||
<template #header>
|
<template #header>
|
||||||
<div class="card-header">
|
<div class="card-header">
|
||||||
<span class="card-title">
|
<span class="card-title">
|
||||||
<el-icon class="title-icon"><Document /></el-icon>
|
<el-icon class="title-icon"><Document /></el-icon>
|
||||||
????????
|
学生行为记录列表
|
||||||
</span>
|
</span>
|
||||||
<div class="header-actions">
|
<div class="header-actions">
|
||||||
<el-button
|
<el-button
|
||||||
icon="Plus"
|
icon="Plus"
|
||||||
type="primary"
|
type="primary"
|
||||||
@click="formDialogRef.openDialog()">
|
@click="formDialogRef.openDialog()">
|
||||||
??
|
新增
|
||||||
</el-button>
|
</el-button>
|
||||||
<el-button
|
<el-button
|
||||||
icon="Upload"
|
icon="Upload"
|
||||||
type="success"
|
type="success"
|
||||||
class="ml10"
|
class="ml10"
|
||||||
@click="handleImport">
|
@click="handleImport">
|
||||||
??
|
导入
|
||||||
</el-button>
|
</el-button>
|
||||||
<right-toolbar
|
<right-toolbar
|
||||||
v-model:showSearch="showSearch"
|
v-model:showSearch="showSearch"
|
||||||
@@ -136,7 +136,7 @@
|
|||||||
@order-change="handleColumnOrderChange"
|
@order-change="handleColumnOrderChange"
|
||||||
>
|
>
|
||||||
<template #trigger>
|
<template #trigger>
|
||||||
<el-tooltip class="item" effect="dark" content="???" placement="top">
|
<el-tooltip class="item" effect="dark" content="列设置" placement="top">
|
||||||
<el-button circle style="margin-left: 0;">
|
<el-button circle style="margin-left: 0;">
|
||||||
<el-icon><Menu /></el-icon>
|
<el-icon><Menu /></el-icon>
|
||||||
</el-button>
|
</el-button>
|
||||||
@@ -148,7 +148,7 @@
|
|||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<!-- ?? -->
|
<!-- 表格 -->
|
||||||
<el-table
|
<el-table
|
||||||
:data="state.dataList"
|
:data="state.dataList"
|
||||||
v-loading="state.loading"
|
v-loading="state.loading"
|
||||||
@@ -156,7 +156,7 @@
|
|||||||
:cell-style="tableStyle.cellStyle"
|
:cell-style="tableStyle.cellStyle"
|
||||||
:header-cell-style="tableStyle.headerCellStyle"
|
:header-cell-style="tableStyle.headerCellStyle"
|
||||||
class="modern-table">
|
class="modern-table">
|
||||||
<el-table-column type="index" label="??" width="70" align="center">
|
<el-table-column type="index" label="序号" width="70" align="center">
|
||||||
<template #header>
|
<template #header>
|
||||||
<el-icon><List /></el-icon>
|
<el-icon><List /></el-icon>
|
||||||
</template>
|
</template>
|
||||||
@@ -166,7 +166,7 @@
|
|||||||
</el-table-column>
|
</el-table-column>
|
||||||
<template v-for="col in visibleColumnsSorted" :key="col.prop || col.label">
|
<template v-for="col in visibleColumnsSorted" :key="col.prop || col.label">
|
||||||
<el-table-column
|
<el-table-column
|
||||||
v-if="checkColumnVisible(col.prop || '') && col.prop !== '??'"
|
v-if="checkColumnVisible(col.prop || '') && col.prop !== '序号'"
|
||||||
:prop="col.prop"
|
:prop="col.prop"
|
||||||
:label="col.label"
|
:label="col.label"
|
||||||
show-overflow-tooltip
|
show-overflow-tooltip
|
||||||
@@ -177,23 +177,23 @@
|
|||||||
<el-icon><component :is="columnConfigMap[col.prop]?.icon || Calendar" /></el-icon>
|
<el-icon><component :is="columnConfigMap[col.prop]?.icon || Calendar" /></el-icon>
|
||||||
<span style="margin-left: 4px">{{ col.label }}</span>
|
<span style="margin-left: 4px">{{ col.label }}</span>
|
||||||
</template>
|
</template>
|
||||||
<!-- ??????? -->
|
<!-- 学期格式化 -->
|
||||||
<template v-if="col.prop === 'schoolTerm'" #default="scope">
|
<template v-if="col.prop === 'schoolTerm'" #default="scope">
|
||||||
<el-tag size="small" type="primary" effect="plain">
|
<el-tag size="small" type="primary" effect="plain">
|
||||||
{{ formatSchoolTerm(scope.row.schoolTerm) }}
|
{{ formatSchoolTerm(scope.row.schoolTerm) }}
|
||||||
</el-tag>
|
</el-tag>
|
||||||
</template>
|
</template>
|
||||||
<!-- ??????? -->
|
<!-- 类型格式化 -->
|
||||||
<template v-else-if="col.prop === 'conductType'" #default="scope">
|
<template v-else-if="col.prop === 'conductType'" #default="scope">
|
||||||
<el-tag size="small" type="warning" effect="plain">
|
<el-tag size="small" type="warning" effect="plain">
|
||||||
{{ formatType(scope.row.conductType) }}
|
{{ formatType(scope.row.conductType) }}
|
||||||
</el-tag>
|
</el-tag>
|
||||||
</template>
|
</template>
|
||||||
<!-- ????????? -->
|
<!-- 记录日期格式化 -->
|
||||||
<template v-else-if="col.prop === 'recordDate'" #default="scope">
|
<template v-else-if="col.prop === 'recordDate'" #default="scope">
|
||||||
<span>{{ scope.row.recordDate || '-' }}</span>
|
<span>{{ scope.row.recordDate || '-' }}</span>
|
||||||
</template>
|
</template>
|
||||||
<!-- ??????? -->
|
<!-- 附件格式化 -->
|
||||||
<template v-else-if="col.prop === 'attachment'" #default="scope">
|
<template v-else-if="col.prop === 'attachment'" #default="scope">
|
||||||
<el-button
|
<el-button
|
||||||
v-if="scope.row.attachment"
|
v-if="scope.row.attachment"
|
||||||
@@ -202,16 +202,16 @@
|
|||||||
type="primary"
|
type="primary"
|
||||||
size="small"
|
size="small"
|
||||||
@click="handleViewAttachment(scope.row)">
|
@click="handleViewAttachment(scope.row)">
|
||||||
??
|
查看
|
||||||
</el-button>
|
</el-button>
|
||||||
<span v-else>-</span>
|
<span v-else>-</span>
|
||||||
</template>
|
</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
</template>
|
</template>
|
||||||
<el-table-column label="??" width="150" align="center" fixed="right">
|
<el-table-column label="操作" width="150" align="center" fixed="right">
|
||||||
<template #header>
|
<template #header>
|
||||||
<el-icon><Setting /></el-icon>
|
<el-icon><Setting /></el-icon>
|
||||||
<span style="margin-left: 4px">??</span>
|
<span style="margin-left: 4px">操作</span>
|
||||||
</template>
|
</template>
|
||||||
<template #default="scope">
|
<template #default="scope">
|
||||||
<el-button
|
<el-button
|
||||||
@@ -219,20 +219,20 @@
|
|||||||
link
|
link
|
||||||
type="primary"
|
type="primary"
|
||||||
@click="handleEdit(scope.row)">
|
@click="handleEdit(scope.row)">
|
||||||
??
|
编辑
|
||||||
</el-button>
|
</el-button>
|
||||||
<el-button
|
<el-button
|
||||||
icon="Delete"
|
icon="Delete"
|
||||||
link
|
link
|
||||||
type="danger"
|
type="danger"
|
||||||
@click="handleDelete(scope.row)">
|
@click="handleDelete(scope.row)">
|
||||||
??
|
删除
|
||||||
</el-button>
|
</el-button>
|
||||||
</template>
|
</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
</el-table>
|
</el-table>
|
||||||
|
|
||||||
<!-- ?? -->
|
<!-- 分页 -->
|
||||||
<div class="pagination-wrapper">
|
<div class="pagination-wrapper">
|
||||||
<pagination
|
<pagination
|
||||||
@size-change="sizeChangeHandle"
|
@size-change="sizeChangeHandle"
|
||||||
@@ -242,12 +242,12 @@
|
|||||||
</el-card>
|
</el-card>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<!-- ??/?????? -->
|
<!-- 新增/编辑对话框 -->
|
||||||
<form-dialog ref="formDialogRef" @refresh="getDataList" />
|
<form-dialog ref="formDialogRef" @refresh="getDataList" />
|
||||||
|
|
||||||
<!-- ???? -->
|
<!-- 导入对话框 -->
|
||||||
<el-dialog
|
<el-dialog
|
||||||
title="??????"
|
title="导入数据"
|
||||||
v-model="importDialogVisible"
|
v-model="importDialogVisible"
|
||||||
:width="500"
|
:width="500"
|
||||||
:close-on-click-modal="false"
|
:close-on-click-modal="false"
|
||||||
@@ -261,18 +261,18 @@
|
|||||||
drag>
|
drag>
|
||||||
<el-icon class="el-icon--upload"><upload-filled /></el-icon>
|
<el-icon class="el-icon--upload"><upload-filled /></el-icon>
|
||||||
<div class="el-upload__text">
|
<div class="el-upload__text">
|
||||||
????????<em>????</em>
|
将文件拖到此处,或<em>点击上传</em>
|
||||||
</div>
|
</div>
|
||||||
<template #tip>
|
<template #tip>
|
||||||
<div class="el-upload__tip">
|
<div class="el-upload__tip">
|
||||||
???? xlsx/xls ??
|
只能上传 xlsx/xls 文件
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
</el-upload>
|
</el-upload>
|
||||||
<template #footer>
|
<template #footer>
|
||||||
<span class="dialog-footer">
|
<span class="dialog-footer">
|
||||||
<el-button @click="importDialogVisible = false">??</el-button>
|
<el-button @click="importDialogVisible = false">取消</el-button>
|
||||||
<el-button type="primary" @click="handleImportSubmit" :disabled="!importFile || importLoading">??</el-button>
|
<el-button type="primary" @click="handleImportSubmit" :disabled="!importFile || importLoading">确认</el-button>
|
||||||
</span>
|
</span>
|
||||||
</template>
|
</template>
|
||||||
</el-dialog>
|
</el-dialog>
|
||||||
@@ -295,7 +295,7 @@ import { useTableColumnControl } from '/@/hooks/tableColumn'
|
|||||||
|
|
||||||
import FormDialog from './form.vue'
|
import FormDialog from './form.vue'
|
||||||
|
|
||||||
// ??????
|
// 定义变量
|
||||||
const route = useRoute()
|
const route = useRoute()
|
||||||
const formDialogRef = ref()
|
const formDialogRef = ref()
|
||||||
const columnControlRef = ref<any>()
|
const columnControlRef = ref<any>()
|
||||||
@@ -311,21 +311,21 @@ const importDialogVisible = ref(false)
|
|||||||
const importFile = ref<File | null>(null)
|
const importFile = ref<File | null>(null)
|
||||||
const importLoading = ref(false)
|
const importLoading = ref(false)
|
||||||
|
|
||||||
// ?????
|
// 表格列配置
|
||||||
const tableColumns = [
|
const tableColumns = [
|
||||||
{ prop: 'stuNo', label: '??' },
|
{ prop: 'stuNo', label: '学号' },
|
||||||
{ prop: 'schoolYear', label: '??' },
|
{ prop: 'schoolYear', label: '学年' },
|
||||||
{ prop: 'schoolTerm', label: '??' },
|
{ prop: 'schoolTerm', label: '学期' },
|
||||||
{ prop: 'deptName', label: '??' },
|
{ prop: 'deptName', label: '学院' },
|
||||||
{ prop: 'classNo', label: '??' },
|
{ prop: 'classNo', label: '班级' },
|
||||||
{ prop: 'realName', label: '??' },
|
{ prop: 'realName', label: '姓名' },
|
||||||
{ prop: 'conductType', label: '??' },
|
{ prop: 'conductType', label: '类型' },
|
||||||
{ prop: 'recordDate', label: '????', width: 120 },
|
{ prop: 'recordDate', label: '记录日期', width: 120 },
|
||||||
{ prop: 'description', label: '????', minWidth: 150 },
|
{ prop: 'description', label: '描述说明', minWidth: 150 },
|
||||||
{ prop: 'attachment', label: '??', width: 100 }
|
{ prop: 'attachment', label: '附件', width: 100 }
|
||||||
]
|
]
|
||||||
|
|
||||||
// ????????????
|
// 列配置映射
|
||||||
const columnConfigMap: Record<string, { icon: any }> = {
|
const columnConfigMap: Record<string, { icon: any }> = {
|
||||||
stuNo: { icon: CreditCard },
|
stuNo: { icon: CreditCard },
|
||||||
schoolYear: { icon: Calendar },
|
schoolYear: { icon: Calendar },
|
||||||
@@ -339,7 +339,7 @@ const columnConfigMap: Record<string, { icon: any }> = {
|
|||||||
attachment: { icon: Document }
|
attachment: { icon: Document }
|
||||||
}
|
}
|
||||||
|
|
||||||
// ???????hook
|
// 表格列控制hook
|
||||||
const {
|
const {
|
||||||
visibleColumns,
|
visibleColumns,
|
||||||
visibleColumnsSorted,
|
visibleColumnsSorted,
|
||||||
@@ -348,7 +348,7 @@ const {
|
|||||||
handleColumnOrderChange
|
handleColumnOrderChange
|
||||||
} = useTableColumnControl(tableColumns, route.path)
|
} = useTableColumnControl(tableColumns, route.path)
|
||||||
|
|
||||||
// ?? useTable
|
// 使用 useTable
|
||||||
const state: BasicTableProps = reactive<BasicTableProps>({
|
const state: BasicTableProps = reactive<BasicTableProps>({
|
||||||
queryForm: {
|
queryForm: {
|
||||||
schoolYear: '',
|
schoolYear: '',
|
||||||
@@ -374,7 +374,7 @@ const {
|
|||||||
tableStyle
|
tableStyle
|
||||||
} = useTable(state)
|
} = useTable(state)
|
||||||
|
|
||||||
// ?????
|
// 格式化学期
|
||||||
const formatSchoolTerm = (value: string | number) => {
|
const formatSchoolTerm = (value: string | number) => {
|
||||||
if (value === null || value === undefined || value === '') {
|
if (value === null || value === undefined || value === '') {
|
||||||
return '-'
|
return '-'
|
||||||
@@ -383,19 +383,19 @@ const formatSchoolTerm = (value: string | number) => {
|
|||||||
return dictItem ? dictItem.label : value
|
return dictItem ? dictItem.label : value
|
||||||
}
|
}
|
||||||
|
|
||||||
// ?????
|
// 格式化类型
|
||||||
const formatType = (value: string) => {
|
const formatType = (value: string) => {
|
||||||
if (!value) return '-'
|
if (!value) return '-'
|
||||||
const item = typeList.value.find((item: any) => item.value === value)
|
const item = typeList.value.find((item: any) => item.value === value)
|
||||||
return item ? item.label : value
|
return item ? item.label : value
|
||||||
}
|
}
|
||||||
|
|
||||||
// ????
|
// 学院变化
|
||||||
const handleDeptChange = () => {
|
const handleDeptChange = () => {
|
||||||
// ??????????????????
|
// 学院变化时清空班级选择
|
||||||
}
|
}
|
||||||
|
|
||||||
// ??
|
// 重置
|
||||||
const handleReset = () => {
|
const handleReset = () => {
|
||||||
searchFormRef.value?.resetFields()
|
searchFormRef.value?.resetFields()
|
||||||
state.queryForm.schoolYear = ''
|
state.queryForm.schoolYear = ''
|
||||||
@@ -407,7 +407,7 @@ const handleReset = () => {
|
|||||||
getDataList()
|
getDataList()
|
||||||
}
|
}
|
||||||
|
|
||||||
// ????
|
// 查看附件
|
||||||
const handleViewAttachment = (row: any) => {
|
const handleViewAttachment = (row: any) => {
|
||||||
if (row.attachment) {
|
if (row.attachment) {
|
||||||
const urls = typeof row.attachment === 'string' ? row.attachment.split(',') : [row.attachment]
|
const urls = typeof row.attachment === 'string' ? row.attachment.split(',') : [row.attachment]
|
||||||
@@ -419,61 +419,61 @@ const handleViewAttachment = (row: any) => {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// ??
|
// 导入
|
||||||
const handleImport = () => {
|
const handleImport = () => {
|
||||||
importDialogVisible.value = true
|
importDialogVisible.value = true
|
||||||
importFile.value = null
|
importFile.value = null
|
||||||
uploadRef.value?.clearFiles()
|
uploadRef.value?.clearFiles()
|
||||||
}
|
}
|
||||||
|
|
||||||
// ????
|
// 文件变化
|
||||||
const handleFileChange = (file: any) => {
|
const handleFileChange = (file: any) => {
|
||||||
importFile.value = file.raw
|
importFile.value = file.raw
|
||||||
}
|
}
|
||||||
|
|
||||||
// ????
|
// 提交导入
|
||||||
const handleImportSubmit = async () => {
|
const handleImportSubmit = async () => {
|
||||||
if (!importFile.value) {
|
if (!importFile.value) {
|
||||||
useMessage().warning('?????????')
|
useMessage().warning('请先选择要上传的文件')
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
importLoading.value = true
|
importLoading.value = true
|
||||||
try {
|
try {
|
||||||
await importExcel(importFile.value)
|
await importExcel(importFile.value)
|
||||||
useMessage().success('????')
|
useMessage().success('导入成功')
|
||||||
importDialogVisible.value = false
|
importDialogVisible.value = false
|
||||||
importFile.value = null
|
importFile.value = null
|
||||||
uploadRef.value?.clearFiles()
|
uploadRef.value?.clearFiles()
|
||||||
getDataList()
|
getDataList()
|
||||||
} catch (err: any) {
|
} catch (err: any) {
|
||||||
useMessage().error(err.msg || '????')
|
useMessage().error(err.msg || '导入失败')
|
||||||
} finally {
|
} finally {
|
||||||
importLoading.value = false
|
importLoading.value = false
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// ??
|
// 编辑
|
||||||
const handleEdit = (row: any) => {
|
const handleEdit = (row: any) => {
|
||||||
formDialogRef.value?.openDialog('edit', row)
|
formDialogRef.value?.openDialog('edit', row)
|
||||||
}
|
}
|
||||||
|
|
||||||
// ??
|
// 删除
|
||||||
const handleDelete = async (row: any) => {
|
const handleDelete = async (row: any) => {
|
||||||
const { confirm } = useMessageBox()
|
const { confirm } = useMessageBox()
|
||||||
try {
|
try {
|
||||||
await confirm('??????????????')
|
await confirm('确定要删除该记录吗?')
|
||||||
await delObj([row.id])
|
await delObj([row.id])
|
||||||
useMessage().success('????')
|
useMessage().success('删除成功')
|
||||||
getDataList()
|
getDataList()
|
||||||
} catch (err: any) {
|
} catch (err: any) {
|
||||||
if (err !== 'cancel') {
|
if (err !== 'cancel') {
|
||||||
useMessage().error(err.msg || '????')
|
useMessage().error(err.msg || '删除失败')
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// ??????
|
// 获取学年列表
|
||||||
const getSchoolYearList = async () => {
|
const getSchoolYearList = async () => {
|
||||||
try {
|
try {
|
||||||
const res = await queryAllSchoolYear()
|
const res = await queryAllSchoolYear()
|
||||||
@@ -487,7 +487,7 @@ const getSchoolYearList = async () => {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// ??????
|
// 获取学期字典
|
||||||
const getSchoolTermDict = async () => {
|
const getSchoolTermDict = async () => {
|
||||||
try {
|
try {
|
||||||
const res = await getDicts('school_term')
|
const res = await getDicts('school_term')
|
||||||
@@ -504,7 +504,7 @@ const getSchoolTermDict = async () => {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// ??????
|
// 获取学院列表
|
||||||
const getDeptListData = async () => {
|
const getDeptListData = async () => {
|
||||||
try {
|
try {
|
||||||
const res = await getDeptList()
|
const res = await getDeptList()
|
||||||
@@ -518,7 +518,7 @@ const getDeptListData = async () => {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// ??????
|
// 获取班级列表
|
||||||
const getClassListData = async () => {
|
const getClassListData = async () => {
|
||||||
try {
|
try {
|
||||||
const res = await getClassListByRole()
|
const res = await getClassListByRole()
|
||||||
@@ -532,7 +532,7 @@ const getClassListData = async () => {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// ??????
|
// 获取类型字典
|
||||||
const getTypeDict = async () => {
|
const getTypeDict = async () => {
|
||||||
try {
|
try {
|
||||||
const res = await getDicts('conduct_type')
|
const res = await getDicts('conduct_type')
|
||||||
@@ -549,7 +549,7 @@ const getTypeDict = async () => {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// ???
|
// 初始化
|
||||||
onMounted(() => {
|
onMounted(() => {
|
||||||
getSchoolYearList()
|
getSchoolYearList()
|
||||||
getSchoolTermDict()
|
getSchoolTermDict()
|
||||||
|
|||||||
@@ -1,21 +1,21 @@
|
|||||||
<template>
|
<template>
|
||||||
<div class="modern-page-container">
|
<div class="modern-page-container">
|
||||||
<div class="page-wrapper">
|
<div class="page-wrapper">
|
||||||
<!-- ???? -->
|
<!-- 查询条件 -->
|
||||||
<el-card v-show="showSearch" class="search-card" shadow="never">
|
<el-card v-show="showSearch" class="search-card" shadow="never">
|
||||||
<template #header>
|
<template #header>
|
||||||
<div class="card-header">
|
<div class="card-header">
|
||||||
<span class="card-title">
|
<span class="card-title">
|
||||||
<el-icon class="title-icon"><Search /></el-icon>
|
<el-icon class="title-icon"><Search /></el-icon>
|
||||||
????
|
查询条件
|
||||||
</span>
|
</span>
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
<el-form :model="searchForm" ref="searchFormRef" :inline="true" @keyup.enter="handleSearch" class="search-form">
|
<el-form :model="searchForm" ref="searchFormRef" :inline="true" @keyup.enter="handleSearch" class="search-form">
|
||||||
<el-form-item label="??" prop="schoolYear">
|
<el-form-item label="学年" prop="schoolYear">
|
||||||
<el-select
|
<el-select
|
||||||
v-model="searchForm.schoolYear"
|
v-model="searchForm.schoolYear"
|
||||||
placeholder="?????"
|
placeholder="请选择学年"
|
||||||
clearable
|
clearable
|
||||||
filterable
|
filterable
|
||||||
style="width: 200px">
|
style="width: 200px">
|
||||||
@@ -27,10 +27,10 @@
|
|||||||
</el-option>
|
</el-option>
|
||||||
</el-select>
|
</el-select>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item label="??" prop="schoolTerm">
|
<el-form-item label="学期" prop="schoolTerm">
|
||||||
<el-select
|
<el-select
|
||||||
v-model="searchForm.schoolTerm"
|
v-model="searchForm.schoolTerm"
|
||||||
placeholder="?????"
|
placeholder="请选择学期"
|
||||||
clearable
|
clearable
|
||||||
style="width: 200px">
|
style="width: 200px">
|
||||||
<el-option
|
<el-option
|
||||||
@@ -41,10 +41,10 @@
|
|||||||
</el-option>
|
</el-option>
|
||||||
</el-select>
|
</el-select>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item label="??" prop="deptCode">
|
<el-form-item label="学院" prop="deptCode">
|
||||||
<el-select
|
<el-select
|
||||||
v-model="searchForm.deptCode"
|
v-model="searchForm.deptCode"
|
||||||
placeholder="?????"
|
placeholder="请选择学院"
|
||||||
clearable
|
clearable
|
||||||
filterable
|
filterable
|
||||||
style="width: 200px">
|
style="width: 200px">
|
||||||
@@ -56,10 +56,10 @@
|
|||||||
</el-option>
|
</el-option>
|
||||||
</el-select>
|
</el-select>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item label="??" prop="classCode">
|
<el-form-item label="班级" prop="classCode">
|
||||||
<el-select
|
<el-select
|
||||||
v-model="searchForm.classCode"
|
v-model="searchForm.classCode"
|
||||||
placeholder="?????"
|
placeholder="请选择班级"
|
||||||
clearable
|
clearable
|
||||||
filterable
|
filterable
|
||||||
style="width: 200px">
|
style="width: 200px">
|
||||||
@@ -71,34 +71,34 @@
|
|||||||
</el-option>
|
</el-option>
|
||||||
</el-select>
|
</el-select>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item label="??" prop="realName">
|
<el-form-item label="姓名" prop="realName">
|
||||||
<el-input
|
<el-input
|
||||||
v-model="searchForm.realName"
|
v-model="searchForm.realName"
|
||||||
placeholder="?????"
|
placeholder="请输入姓名"
|
||||||
clearable
|
clearable
|
||||||
style="width: 200px" />
|
style="width: 200px" />
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item label="??" prop="stuNo">
|
<el-form-item label="学号" prop="stuNo">
|
||||||
<el-input
|
<el-input
|
||||||
v-model="searchForm.stuNo"
|
v-model="searchForm.stuNo"
|
||||||
placeholder="?????"
|
placeholder="请输入学号"
|
||||||
clearable
|
clearable
|
||||||
style="width: 200px" />
|
style="width: 200px" />
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item label="????" prop="punlishMonth">
|
<el-form-item label="处分月份" prop="punlishMonth">
|
||||||
<el-date-picker
|
<el-date-picker
|
||||||
v-model="searchForm.punlishMonth"
|
v-model="searchForm.punlishMonth"
|
||||||
type="month"
|
type="month"
|
||||||
placeholder="??????"
|
placeholder="请选择处分月份"
|
||||||
format="YYYY-MM"
|
format="YYYY-MM"
|
||||||
value-format="YYYY-MM"
|
value-format="YYYY-MM"
|
||||||
clearable
|
clearable
|
||||||
style="width: 200px" />
|
style="width: 200px" />
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item label="????" prop="punlishLevel">
|
<el-form-item label="处分等级" prop="punlishLevel">
|
||||||
<el-select
|
<el-select
|
||||||
v-model="searchForm.punlishLevel"
|
v-model="searchForm.punlishLevel"
|
||||||
placeholder="???????"
|
placeholder="请选择处分等级"
|
||||||
clearable
|
clearable
|
||||||
style="width: 200px">
|
style="width: 200px">
|
||||||
<el-option
|
<el-option
|
||||||
@@ -110,33 +110,33 @@
|
|||||||
</el-select>
|
</el-select>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item>
|
<el-form-item>
|
||||||
<el-button type="primary" plain icon="Search" @click="handleSearch">??</el-button>
|
<el-button type="primary" plain icon="Search" @click="handleSearch">查询</el-button>
|
||||||
<el-button icon="Refresh" @click="handleReset">??</el-button>
|
<el-button icon="Refresh" @click="handleReset">重置</el-button>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
</el-form>
|
</el-form>
|
||||||
</el-card>
|
</el-card>
|
||||||
|
|
||||||
<!-- ???? -->
|
<!-- 数据列表 -->
|
||||||
<el-card class="content-card" shadow="never">
|
<el-card class="content-card" shadow="never">
|
||||||
<template #header>
|
<template #header>
|
||||||
<div class="card-header">
|
<div class="card-header">
|
||||||
<span class="card-title">
|
<span class="card-title">
|
||||||
<el-icon class="title-icon"><Document /></el-icon>
|
<el-icon class="title-icon"><Document /></el-icon>
|
||||||
??????
|
学生处分列表
|
||||||
</span>
|
</span>
|
||||||
<div class="header-actions">
|
<div class="header-actions">
|
||||||
<el-button
|
<el-button
|
||||||
icon="FolderAdd"
|
icon="FolderAdd"
|
||||||
type="primary"
|
type="primary"
|
||||||
@click="formDialogRef.openDialog()">
|
@click="formDialogRef.openDialog()">
|
||||||
??
|
新增
|
||||||
</el-button>
|
</el-button>
|
||||||
<el-button
|
<el-button
|
||||||
icon="Download"
|
icon="Download"
|
||||||
type="success"
|
type="success"
|
||||||
class="ml10"
|
class="ml10"
|
||||||
@click="handleExport">
|
@click="handleExport">
|
||||||
??
|
导出
|
||||||
</el-button>
|
</el-button>
|
||||||
<right-toolbar
|
<right-toolbar
|
||||||
v-model:showSearch="showSearch"
|
v-model:showSearch="showSearch"
|
||||||
@@ -152,7 +152,7 @@
|
|||||||
@order-change="handleColumnOrderChange"
|
@order-change="handleColumnOrderChange"
|
||||||
>
|
>
|
||||||
<template #trigger>
|
<template #trigger>
|
||||||
<el-tooltip class="item" effect="dark" content="???" placement="top">
|
<el-tooltip class="item" effect="dark" content="列设置" placement="top">
|
||||||
<el-button circle style="margin-left: 0;">
|
<el-button circle style="margin-left: 0;">
|
||||||
<el-icon><Menu /></el-icon>
|
<el-icon><Menu /></el-icon>
|
||||||
</el-button>
|
</el-button>
|
||||||
@@ -164,7 +164,7 @@
|
|||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<!-- ?? -->
|
<!-- 表格 -->
|
||||||
<el-table
|
<el-table
|
||||||
:data="state.dataList"
|
:data="state.dataList"
|
||||||
v-loading="state.loading"
|
v-loading="state.loading"
|
||||||
@@ -172,7 +172,7 @@
|
|||||||
:cell-style="tableStyle.cellStyle"
|
:cell-style="tableStyle.cellStyle"
|
||||||
:header-cell-style="tableStyle.headerCellStyle"
|
:header-cell-style="tableStyle.headerCellStyle"
|
||||||
class="modern-table">
|
class="modern-table">
|
||||||
<el-table-column type="index" label="??" width="70" align="center">
|
<el-table-column type="index" label="序号" width="70" align="center">
|
||||||
<template #header>
|
<template #header>
|
||||||
<el-icon><List /></el-icon>
|
<el-icon><List /></el-icon>
|
||||||
</template>
|
</template>
|
||||||
@@ -182,7 +182,7 @@
|
|||||||
</el-table-column>
|
</el-table-column>
|
||||||
<template v-for="col in visibleColumnsSorted" :key="col.prop || col.label">
|
<template v-for="col in visibleColumnsSorted" :key="col.prop || col.label">
|
||||||
<el-table-column
|
<el-table-column
|
||||||
v-if="checkColumnVisible(col.prop || '') && col.prop !== '??'"
|
v-if="checkColumnVisible(col.prop || '') && col.prop !== '序号'"
|
||||||
:prop="col.prop"
|
:prop="col.prop"
|
||||||
:label="col.label"
|
:label="col.label"
|
||||||
show-overflow-tooltip
|
show-overflow-tooltip
|
||||||
@@ -193,40 +193,40 @@
|
|||||||
<el-icon><component :is="columnConfigMap[col.prop]?.icon || Calendar" /></el-icon>
|
<el-icon><component :is="columnConfigMap[col.prop]?.icon || Calendar" /></el-icon>
|
||||||
<span style="margin-left: 4px">{{ col.label }}</span>
|
<span style="margin-left: 4px">{{ col.label }}</span>
|
||||||
</template>
|
</template>
|
||||||
<!-- ???? -->
|
<!-- 学期 -->
|
||||||
<template v-if="col.prop === 'schoolTerm'" #default="scope">
|
<template v-if="col.prop === 'schoolTerm'" #default="scope">
|
||||||
<el-tag size="small" type="primary" effect="plain">
|
<el-tag size="small" type="primary" effect="plain">
|
||||||
{{ formatSchoolTerm(scope.row.schoolTerm) }}
|
{{ formatSchoolTerm(scope.row.schoolTerm) }}
|
||||||
</el-tag>
|
</el-tag>
|
||||||
</template>
|
</template>
|
||||||
<!-- ?????? -->
|
<!-- 处分开始日期 -->
|
||||||
<template v-else-if="col.prop === 'punlishStartDate'" #default="scope">
|
<template v-else-if="col.prop === 'punlishStartDate'" #default="scope">
|
||||||
<span>{{ scope.row.punlishStartDate ? formatDate(scope.row.punlishStartDate) : '-' }}</span>
|
<span>{{ scope.row.punlishStartDate ? formatDate(scope.row.punlishStartDate) : '-' }}</span>
|
||||||
</template>
|
</template>
|
||||||
<!-- ?????? -->
|
<!-- 处分结束日期 -->
|
||||||
<template v-else-if="col.prop === 'punlishEndDate'" #default="scope">
|
<template v-else-if="col.prop === 'punlishEndDate'" #default="scope">
|
||||||
<span>{{ scope.row.punlishEndDate ? formatDate(scope.row.punlishEndDate) : '-' }}</span>
|
<span>{{ scope.row.punlishEndDate ? formatDate(scope.row.punlishEndDate) : '-' }}</span>
|
||||||
</template>
|
</template>
|
||||||
<!-- ?????? -->
|
<!-- 处分等级 -->
|
||||||
<template v-else-if="col.prop === 'punlishLevel'" #default="scope">
|
<template v-else-if="col.prop === 'punlishLevel'" #default="scope">
|
||||||
<el-tag size="small" type="danger" effect="plain">
|
<el-tag size="small" type="danger" effect="plain">
|
||||||
{{ formatPunlishLevel(scope.row.punlishLevel) }}
|
{{ formatPunlishLevel(scope.row.punlishLevel) }}
|
||||||
</el-tag>
|
</el-tag>
|
||||||
</template>
|
</template>
|
||||||
<!-- ???? -->
|
<!-- 状态 -->
|
||||||
<template v-else-if="col.prop === 'publishStatus'" #default="scope">
|
<template v-else-if="col.prop === 'publishStatus'" #default="scope">
|
||||||
<StatusTag
|
<StatusTag
|
||||||
:value="scope.row.publishStatus"
|
:value="scope.row.publishStatus"
|
||||||
:options="[{ label: '??', value: '1' }, { label: '???', value: '2' }, { label: '???', value: '3' }]"
|
:options="[{ label: '已发布', value: '1' }, { label: '已撤销', value: '2' }, { label: '已取消', value: '3' }]"
|
||||||
:type-map="{ '1': { type: 'danger', effect: 'light' }, '2': { type: 'success', effect: 'light' }, '3': { type: 'info', effect: 'light' } }"
|
:type-map="{ '1': { type: 'danger', effect: 'light' }, '2': { type: 'success', effect: 'light' }, '3': { type: 'info', effect: 'light' } }"
|
||||||
/>
|
/>
|
||||||
</template>
|
</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
</template>
|
</template>
|
||||||
<el-table-column label="??" width="250" align="center" fixed="right">
|
<el-table-column label="操作" width="250" align="center" fixed="right">
|
||||||
<template #header>
|
<template #header>
|
||||||
<el-icon><Setting /></el-icon>
|
<el-icon><Setting /></el-icon>
|
||||||
<span style="margin-left: 4px">??</span>
|
<span style="margin-left: 4px">操作</span>
|
||||||
</template>
|
</template>
|
||||||
<template #default="scope">
|
<template #default="scope">
|
||||||
<el-button
|
<el-button
|
||||||
@@ -234,34 +234,34 @@
|
|||||||
link
|
link
|
||||||
type="primary"
|
type="primary"
|
||||||
@click="handleReport(scope.row)">
|
@click="handleReport(scope.row)">
|
||||||
????
|
处分报告
|
||||||
</el-button>
|
</el-button>
|
||||||
<el-button
|
<el-button
|
||||||
icon="CircleClose"
|
icon="CircleClose"
|
||||||
link
|
link
|
||||||
type="warning"
|
type="warning"
|
||||||
@click="handleCancel(scope.row)">
|
@click="handleCancel(scope.row)">
|
||||||
????
|
撤销处分
|
||||||
</el-button>
|
</el-button>
|
||||||
<el-button
|
<el-button
|
||||||
icon="Edit"
|
icon="Edit"
|
||||||
link
|
link
|
||||||
type="primary"
|
type="primary"
|
||||||
@click="handleEdit(scope.row)">
|
@click="handleEdit(scope.row)">
|
||||||
??
|
编辑
|
||||||
</el-button>
|
</el-button>
|
||||||
<el-button
|
<el-button
|
||||||
icon="Delete"
|
icon="Delete"
|
||||||
link
|
link
|
||||||
type="danger"
|
type="danger"
|
||||||
@click="handleDelete(scope.row)">
|
@click="handleDelete(scope.row)">
|
||||||
??
|
删除
|
||||||
</el-button>
|
</el-button>
|
||||||
</template>
|
</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
</el-table>
|
</el-table>
|
||||||
|
|
||||||
<!-- ?? -->
|
<!-- 分页 -->
|
||||||
<div class="pagination-wrapper">
|
<div class="pagination-wrapper">
|
||||||
<pagination
|
<pagination
|
||||||
@size-change="sizeChangeHandle"
|
@size-change="sizeChangeHandle"
|
||||||
@@ -271,7 +271,7 @@
|
|||||||
</el-card>
|
</el-card>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<!-- ??/???? -->
|
<!-- 新增/编辑 -->
|
||||||
<form-dialog ref="formDialogRef" @refresh="getDataList" />
|
<form-dialog ref="formDialogRef" @refresh="getDataList" />
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
@@ -294,7 +294,7 @@ import { useTableColumnControl } from '/@/hooks/tableColumn'
|
|||||||
import { defineAsyncComponent } from 'vue'
|
import { defineAsyncComponent } from 'vue'
|
||||||
const StatusTag = defineAsyncComponent(() => import('/@/components/StatusTag/index.vue'))
|
const StatusTag = defineAsyncComponent(() => import('/@/components/StatusTag/index.vue'))
|
||||||
|
|
||||||
// ???
|
// 定义变量
|
||||||
const route = useRoute()
|
const route = useRoute()
|
||||||
const searchFormRef = ref()
|
const searchFormRef = ref()
|
||||||
const columnControlRef = ref<any>()
|
const columnControlRef = ref<any>()
|
||||||
@@ -307,22 +307,22 @@ const punlishLevelList = ref<any[]>([])
|
|||||||
const publishStatusList = ref<any[]>([])
|
const publishStatusList = ref<any[]>([])
|
||||||
const formDialogRef = ref()
|
const formDialogRef = ref()
|
||||||
|
|
||||||
// ???
|
// 表格列配置
|
||||||
const tableColumns = [
|
const tableColumns = [
|
||||||
{ prop: 'schoolYear', label: '??' },
|
{ prop: 'schoolYear', label: '学年' },
|
||||||
{ prop: 'schoolTerm', label: '??' },
|
{ prop: 'schoolTerm', label: '学期' },
|
||||||
{ prop: 'deptName', label: '??' },
|
{ prop: 'deptName', label: '学院' },
|
||||||
{ prop: 'classNo', label: '??' },
|
{ prop: 'classNo', label: '班级' },
|
||||||
{ prop: 'stuRealName', label: '??' },
|
{ prop: 'stuRealName', label: '姓名' },
|
||||||
{ prop: 'stuNo', label: '??' },
|
{ prop: 'stuNo', label: '学号' },
|
||||||
{ prop: 'punlishStartDate', label: '??????', width: 180 },
|
{ prop: 'punlishStartDate', label: '处分开始日期', width: 180 },
|
||||||
{ prop: 'punlishEndDate', label: '???', width: 180 },
|
{ prop: 'punlishEndDate', label: '结束日期', width: 180 },
|
||||||
{ prop: 'punlishLevel', label: '????' },
|
{ prop: 'punlishLevel', label: '处分等级' },
|
||||||
{ prop: 'punlishContent', label: '????', minWidth: 150 },
|
{ prop: 'punlishContent', label: '处分内容', minWidth: 150 },
|
||||||
{ prop: 'publishStatus', label: '????' }
|
{ prop: 'publishStatus', label: '发布状态' }
|
||||||
]
|
]
|
||||||
|
|
||||||
// ?????
|
// 列配置映射
|
||||||
const columnConfigMap: Record<string, { icon: any }> = {
|
const columnConfigMap: Record<string, { icon: any }> = {
|
||||||
schoolYear: { icon: Calendar },
|
schoolYear: { icon: Calendar },
|
||||||
schoolTerm: { icon: Clock },
|
schoolTerm: { icon: Clock },
|
||||||
@@ -337,16 +337,16 @@ const columnConfigMap: Record<string, { icon: any }> = {
|
|||||||
publishStatus: { icon: CircleCheck }
|
publishStatus: { icon: CircleCheck }
|
||||||
}
|
}
|
||||||
|
|
||||||
// ????? hook
|
// 表格列控制 hook
|
||||||
const {
|
const {
|
||||||
visibleColumns,
|
visibleColumns,
|
||||||
visibleColumnsSorted,
|
visibleColumnsSorted,
|
||||||
checkColumnVisible,
|
checkColumnVisible,
|
||||||
handleColumnChange,
|
handleColumnChange,
|
||||||
handleColumnOrderChange
|
handleColumnOrderChange
|
||||||
} = useTableColumnControl(tableColumns, route.path)
|
} = useTableColumnControl(tableColumns)
|
||||||
|
|
||||||
// ????
|
// 搜索表单
|
||||||
const searchForm = reactive({
|
const searchForm = reactive({
|
||||||
schoolYear: '',
|
schoolYear: '',
|
||||||
schoolTerm: '',
|
schoolTerm: '',
|
||||||
@@ -359,11 +359,11 @@ const searchForm = reactive({
|
|||||||
punlishMonthArray: [] as string[]
|
punlishMonthArray: [] as string[]
|
||||||
})
|
})
|
||||||
|
|
||||||
// ?? useTable
|
// 使用 useTable
|
||||||
const state: BasicTableProps = reactive<BasicTableProps>({
|
const state: BasicTableProps = reactive<BasicTableProps>({
|
||||||
queryForm: searchForm,
|
queryForm: searchForm,
|
||||||
pageList: async (params: any) => {
|
pageList: async (params: any) => {
|
||||||
// ???????? API
|
// 处理处分月份参数 API
|
||||||
const queryParams = { ...params }
|
const queryParams = { ...params }
|
||||||
if (queryParams.punlishMonth) {
|
if (queryParams.punlishMonth) {
|
||||||
queryParams.punlishMonth = [queryParams.punlishMonth]
|
queryParams.punlishMonth = [queryParams.punlishMonth]
|
||||||
@@ -388,7 +388,7 @@ const {
|
|||||||
tableStyle
|
tableStyle
|
||||||
} = useTable(state)
|
} = useTable(state)
|
||||||
|
|
||||||
// ?????
|
// 格式化学期
|
||||||
const formatSchoolTerm = (value: string | number) => {
|
const formatSchoolTerm = (value: string | number) => {
|
||||||
if (value === null || value === undefined || value === '') {
|
if (value === null || value === undefined || value === '') {
|
||||||
return '-'
|
return '-'
|
||||||
@@ -397,36 +397,36 @@ const formatSchoolTerm = (value: string | number) => {
|
|||||||
return dictItem ? dictItem.label : value
|
return dictItem ? dictItem.label : value
|
||||||
}
|
}
|
||||||
|
|
||||||
// ?????
|
// 格式化日期
|
||||||
const formatDate = (dateStr: string) => {
|
const formatDate = (dateStr: string) => {
|
||||||
if (!dateStr) return '-'
|
if (!dateStr) return '-'
|
||||||
// ??????????
|
// 处理日期时间格式
|
||||||
if (dateStr.includes(' ')) {
|
if (dateStr.includes(' ')) {
|
||||||
return dateStr.split(' ')[0]
|
return dateStr.split(' ')[0]
|
||||||
}
|
}
|
||||||
return dateStr
|
return dateStr
|
||||||
}
|
}
|
||||||
|
|
||||||
// ???????
|
// 格式化处分等级
|
||||||
const formatPunlishLevel = (value: string) => {
|
const formatPunlishLevel = (value: string) => {
|
||||||
if (!value) return '-'
|
if (!value) return '-'
|
||||||
const item = punlishLevelList.value.find((item: any) => item.value === value)
|
const item = punlishLevelList.value.find((item: any) => item.value === value)
|
||||||
return item ? item.label : value
|
return item ? item.label : value
|
||||||
}
|
}
|
||||||
|
|
||||||
// ???????
|
// 格式化发布状态
|
||||||
const formatPublishStatus = (value: string) => {
|
const formatPublishStatus = (value: string) => {
|
||||||
if (!value) return '-'
|
if (!value) return '-'
|
||||||
const item = publishStatusList.value.find((item: any) => item.value === value)
|
const item = publishStatusList.value.find((item: any) => item.value === value)
|
||||||
return item ? item.label : value
|
return item ? item.label : value
|
||||||
}
|
}
|
||||||
|
|
||||||
// ??
|
// 查询
|
||||||
const handleSearch = () => {
|
const handleSearch = () => {
|
||||||
getDataList()
|
getDataList()
|
||||||
}
|
}
|
||||||
|
|
||||||
// ??
|
// 重置
|
||||||
const handleReset = () => {
|
const handleReset = () => {
|
||||||
searchFormRef.value?.resetFields()
|
searchFormRef.value?.resetFields()
|
||||||
searchForm.schoolYear = ''
|
searchForm.schoolYear = ''
|
||||||
@@ -440,65 +440,65 @@ const handleReset = () => {
|
|||||||
getDataList()
|
getDataList()
|
||||||
}
|
}
|
||||||
|
|
||||||
// ??
|
// 编辑
|
||||||
const handleEdit = (row: any) => {
|
const handleEdit = (row: any) => {
|
||||||
formDialogRef.value?.openDialog('edit', row)
|
formDialogRef.value?.openDialog('edit', row)
|
||||||
}
|
}
|
||||||
|
|
||||||
// ??
|
// 删除
|
||||||
const handleDelete = async (row: any) => {
|
const handleDelete = async (row: any) => {
|
||||||
try {
|
try {
|
||||||
await useMessageBox().confirm('???????????')
|
await useMessageBox().confirm('确定要删除该记录吗?')
|
||||||
await delObj([row.id])
|
await delObj([row.id])
|
||||||
useMessage().success('????')
|
useMessage().success('删除成功')
|
||||||
getDataList()
|
getDataList()
|
||||||
} catch (err: any) {
|
} catch (err: any) {
|
||||||
if (err !== 'cancel') {
|
if (err !== 'cancel') {
|
||||||
useMessage().error(err.msg || '????')
|
useMessage().error(err.msg || '删除失败')
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// ????
|
// 处分报告
|
||||||
const handleReport = (row: any) => {
|
const handleReport = (row: any) => {
|
||||||
useMessage().info('?????????')
|
useMessage().info('功能开发中')
|
||||||
// TODO: ??????
|
// TODO: 实现处分报告
|
||||||
}
|
}
|
||||||
|
|
||||||
// ????
|
// 撤销处分
|
||||||
const handleCancel = async (row: any) => {
|
const handleCancel = async (row: any) => {
|
||||||
const { confirm } = useMessageBox()
|
const { confirm } = useMessageBox()
|
||||||
try {
|
try {
|
||||||
await confirm('??????????')
|
await confirm('确定要撤销该处分吗?')
|
||||||
|
|
||||||
// ??????
|
// 获取详情数据
|
||||||
const res = await getDetail(row.id)
|
const res = await getDetail(row.id)
|
||||||
if (!res.data) {
|
if (!res.data) {
|
||||||
useMessage().error('????????')
|
useMessage().error('获取数据失败')
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
// ? publishStatus ?? "0" ????
|
// 将 publishStatus 设置为 "0" 表示撤销
|
||||||
const updateData = {
|
const updateData = {
|
||||||
...res.data,
|
...res.data,
|
||||||
publishStatus: '0'
|
publishStatus: '0'
|
||||||
}
|
}
|
||||||
|
|
||||||
await revokePunishment(updateData)
|
await revokePunishment(updateData)
|
||||||
useMessage().success('??????')
|
useMessage().success('撤销成功')
|
||||||
getDataList()
|
getDataList()
|
||||||
} catch (err: any) {
|
} catch (err: any) {
|
||||||
if (err !== 'cancel') {
|
if (err !== 'cancel') {
|
||||||
useMessage().error(err.msg || '??????')
|
useMessage().error(err.msg || '撤销失败')
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// ??
|
// 导出
|
||||||
const handleExport = async () => {
|
const handleExport = async () => {
|
||||||
try {
|
try {
|
||||||
const params: any = { ...searchForm }
|
const params: any = { ...searchForm }
|
||||||
// ???????? API
|
// 处理处分月份参数 API
|
||||||
if (params.punlishMonth) {
|
if (params.punlishMonth) {
|
||||||
params.punlishMonth = [params.punlishMonth]
|
params.punlishMonth = [params.punlishMonth]
|
||||||
} else {
|
} else {
|
||||||
@@ -506,23 +506,23 @@ const handleExport = async () => {
|
|||||||
}
|
}
|
||||||
delete params.punlishMonthArray
|
delete params.punlishMonthArray
|
||||||
const res = await exportData(params)
|
const res = await exportData(params)
|
||||||
// ????
|
// 下载文件
|
||||||
const blob = new Blob([res.data])
|
const blob = new Blob([res.data])
|
||||||
const elink = document.createElement('a')
|
const elink = document.createElement('a')
|
||||||
elink.download = '????.xlsx'
|
elink.download = '学生处分.xlsx'
|
||||||
elink.style.display = 'none'
|
elink.style.display = 'none'
|
||||||
elink.href = URL.createObjectURL(blob)
|
elink.href = URL.createObjectURL(blob)
|
||||||
document.body.appendChild(elink)
|
document.body.appendChild(elink)
|
||||||
elink.click()
|
elink.click()
|
||||||
URL.revokeObjectURL(elink.href)
|
URL.revokeObjectURL(elink.href)
|
||||||
document.body.removeChild(elink)
|
document.body.removeChild(elink)
|
||||||
useMessage().success('????')
|
useMessage().success('导出成功')
|
||||||
} catch (err: any) {
|
} catch (err: any) {
|
||||||
useMessage().error(err.msg || '????')
|
useMessage().error(err.msg || '导出失败')
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// ??????
|
// 获取学年列表
|
||||||
const getSchoolYearList = async () => {
|
const getSchoolYearList = async () => {
|
||||||
try {
|
try {
|
||||||
const res = await queryAllSchoolYear()
|
const res = await queryAllSchoolYear()
|
||||||
@@ -534,7 +534,7 @@ const getSchoolYearList = async () => {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// ??????
|
// 获取学期字典
|
||||||
const getSchoolTermDict = async () => {
|
const getSchoolTermDict = async () => {
|
||||||
try {
|
try {
|
||||||
const res = await getDicts('school_term')
|
const res = await getDicts('school_term')
|
||||||
@@ -549,7 +549,7 @@ const getSchoolTermDict = async () => {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// ??????
|
// 获取学院列表
|
||||||
const getDeptListData = async () => {
|
const getDeptListData = async () => {
|
||||||
try {
|
try {
|
||||||
const res = await getDeptListByLevelTwo()
|
const res = await getDeptListByLevelTwo()
|
||||||
@@ -561,7 +561,7 @@ const getDeptListData = async () => {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// ??????
|
// 获取班级列表
|
||||||
const getClassListData = async () => {
|
const getClassListData = async () => {
|
||||||
try {
|
try {
|
||||||
const res = await getClassListByRole()
|
const res = await getClassListByRole()
|
||||||
@@ -573,7 +573,7 @@ const getClassListData = async () => {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// ????????
|
// 获取处分等级字典
|
||||||
const getPunlishLevelDict = async () => {
|
const getPunlishLevelDict = async () => {
|
||||||
try {
|
try {
|
||||||
const res = await getDicts('punlish_level')
|
const res = await getDicts('punlish_level')
|
||||||
@@ -588,7 +588,7 @@ const getPunlishLevelDict = async () => {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// ????????
|
// 获取发布状态字典
|
||||||
const getPublishStatusDict = async () => {
|
const getPublishStatusDict = async () => {
|
||||||
try {
|
try {
|
||||||
const res = await getDicts('publish_status')
|
const res = await getDicts('publish_status')
|
||||||
|
|||||||
@@ -1,13 +1,13 @@
|
|||||||
<template>
|
<template>
|
||||||
<div class="modern-page-container">
|
<div class="modern-page-container">
|
||||||
<div class="page-wrapper">
|
<div class="page-wrapper">
|
||||||
<!-- ?????? -->
|
<!-- 查询条件 -->
|
||||||
<el-card v-show="showSearch" class="search-card" shadow="never">
|
<el-card v-show="showSearch" class="search-card" shadow="never">
|
||||||
<template #header>
|
<template #header>
|
||||||
<div class="card-header">
|
<div class="card-header">
|
||||||
<span class="card-title">
|
<span class="card-title">
|
||||||
<el-icon class="title-icon"><Search /></el-icon>
|
<el-icon class="title-icon"><Search /></el-icon>
|
||||||
????
|
查询条件
|
||||||
</span>
|
</span>
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
@@ -15,7 +15,7 @@
|
|||||||
<el-form-item label="班级" prop="classCode">
|
<el-form-item label="班级" prop="classCode">
|
||||||
<el-select
|
<el-select
|
||||||
v-model="state.queryForm.classCode"
|
v-model="state.queryForm.classCode"
|
||||||
placeholder="请选择学年"
|
placeholder="请选择班级"
|
||||||
clearable
|
clearable
|
||||||
filterable
|
filterable
|
||||||
style="width: 200px">
|
style="width: 200px">
|
||||||
@@ -27,10 +27,10 @@
|
|||||||
</el-option>
|
</el-option>
|
||||||
</el-select>
|
</el-select>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item label="??" prop="classNo">
|
<el-form-item label="班级编号" prop="classNo">
|
||||||
<el-input
|
<el-input
|
||||||
v-model="state.queryForm.classNo"
|
v-model="state.queryForm.classNo"
|
||||||
placeholder="请输入姓名"
|
placeholder="请输入班级编号"
|
||||||
clearable
|
clearable
|
||||||
style="width: 200px" />
|
style="width: 200px" />
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
@@ -41,17 +41,17 @@
|
|||||||
clearable
|
clearable
|
||||||
style="width: 200px" />
|
style="width: 200px" />
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item label="????" prop="serNo">
|
<el-form-item label="序列号" prop="serNo">
|
||||||
<el-input
|
<el-input
|
||||||
v-model="state.queryForm.serNo"
|
v-model="state.queryForm.serNo"
|
||||||
placeholder="请输入奖项名称"
|
placeholder="请输入序列号"
|
||||||
clearable
|
clearable
|
||||||
style="width: 200px" />
|
style="width: 200px" />
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item label="入学年份" prop="grade">
|
<el-form-item label="入学年份" prop="grade">
|
||||||
<el-select
|
<el-select
|
||||||
v-model="state.queryForm.grade"
|
v-model="state.queryForm.grade"
|
||||||
placeholder="请输入奖项名称"
|
placeholder="请选择入学年份"
|
||||||
clearable
|
clearable
|
||||||
style="width: 200px">
|
style="width: 200px">
|
||||||
<el-option
|
<el-option
|
||||||
@@ -63,40 +63,40 @@
|
|||||||
</el-select>
|
</el-select>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item>
|
<el-form-item>
|
||||||
<el-button type="primary" plain icon="Search" @click="getDataList">??</el-button>
|
<el-button type="primary" plain icon="Search" @click="getDataList">查询</el-button>
|
||||||
<el-button icon="Refresh" @click="handleReset">重置</el-button>
|
<el-button icon="Refresh" @click="handleReset">重置</el-button>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
</el-form>
|
</el-form>
|
||||||
</el-card>
|
</el-card>
|
||||||
|
|
||||||
<!-- ???? -->
|
<!-- 数据列表 -->
|
||||||
<el-card class="content-card" shadow="never">
|
<el-card class="content-card" shadow="never">
|
||||||
<template #header>
|
<template #header>
|
||||||
<div class="card-header">
|
<div class="card-header">
|
||||||
<span class="card-title">
|
<span class="card-title">
|
||||||
<el-icon class="title-icon"><Document /></el-icon>
|
<el-icon class="title-icon"><Document /></el-icon>
|
||||||
??????
|
学生团组织列表
|
||||||
</span>
|
</span>
|
||||||
<div class="header-actions">
|
<div class="header-actions">
|
||||||
<el-button
|
<el-button
|
||||||
icon="Plus"
|
icon="Plus"
|
||||||
type="primary"
|
type="primary"
|
||||||
@click="formDialogRef.openDialog()">
|
@click="formDialogRef.openDialog()">
|
||||||
??
|
新增
|
||||||
</el-button>
|
</el-button>
|
||||||
<el-button
|
<el-button
|
||||||
icon="Upload"
|
icon="Upload"
|
||||||
type="success"
|
type="success"
|
||||||
class="ml10"
|
class="ml10"
|
||||||
@click="handleImport">
|
@click="handleImport">
|
||||||
??
|
导入
|
||||||
</el-button>
|
</el-button>
|
||||||
<el-button
|
<el-button
|
||||||
icon="Download"
|
icon="Download"
|
||||||
type="warning"
|
type="warning"
|
||||||
class="ml10"
|
class="ml10"
|
||||||
@click="handleExport">
|
@click="handleExport">
|
||||||
??
|
导出
|
||||||
</el-button>
|
</el-button>
|
||||||
<right-toolbar
|
<right-toolbar
|
||||||
v-model:showSearch="showSearch"
|
v-model:showSearch="showSearch"
|
||||||
@@ -153,11 +153,11 @@
|
|||||||
<el-icon><component :is="columnConfigMap[col.prop]?.icon || Calendar" /></el-icon>
|
<el-icon><component :is="columnConfigMap[col.prop]?.icon || Calendar" /></el-icon>
|
||||||
<span style="margin-left: 4px">{{ col.label }}</span>
|
<span style="margin-left: 4px">{{ col.label }}</span>
|
||||||
</template>
|
</template>
|
||||||
<!-- ????????? -->
|
<!-- 入团时间格式化 -->
|
||||||
<template v-if="col.prop === 'enterTime'" #default="scope">
|
<template v-if="col.prop === 'enterTime'" #default="scope">
|
||||||
<span>{{ parseTime(scope.row.enterTime, '{y}-{m}-{d}') }}</span>
|
<span>{{ parseTime(scope.row.enterTime, '{y}-{m}-{d}') }}</span>
|
||||||
</template>
|
</template>
|
||||||
<!-- ????????? -->
|
<!-- 职务格式化 -->
|
||||||
<template v-else-if="col.prop === 'position'" #default="scope">
|
<template v-else-if="col.prop === 'position'" #default="scope">
|
||||||
<el-tag v-if="scope.row.position" size="small" type="primary" effect="plain">
|
<el-tag v-if="scope.row.position" size="small" type="primary" effect="plain">
|
||||||
{{ scope.row.position }}
|
{{ scope.row.position }}
|
||||||
@@ -200,12 +200,12 @@
|
|||||||
</el-card>
|
</el-card>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<!-- ??/?????? -->
|
<!-- 新增/编辑对话框 -->
|
||||||
<form-dialog ref="formDialogRef" @refresh="getDataList" />
|
<form-dialog ref="formDialogRef" @refresh="getDataList" />
|
||||||
|
|
||||||
<!-- ???? -->
|
<!-- 导入对话框 -->
|
||||||
<el-dialog
|
<el-dialog
|
||||||
title="????"
|
title="导入数据"
|
||||||
v-model="importDialogVisible"
|
v-model="importDialogVisible"
|
||||||
:close-on-click-modal="false"
|
:close-on-click-modal="false"
|
||||||
width="500px">
|
width="500px">
|
||||||
@@ -220,18 +220,18 @@
|
|||||||
drag>
|
drag>
|
||||||
<el-icon class="el-icon--upload"><upload-filled /></el-icon>
|
<el-icon class="el-icon--upload"><upload-filled /></el-icon>
|
||||||
<div class="el-upload__text">
|
<div class="el-upload__text">
|
||||||
????????<em>????</em>
|
将文件拖到此处,或<em>点击上传</em>
|
||||||
</div>
|
</div>
|
||||||
<template #tip>
|
<template #tip>
|
||||||
<div class="el-upload__tip">
|
<div class="el-upload__tip">
|
||||||
???? xlsx/xls ??
|
只能上传 xlsx/xls 文件
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
</el-upload>
|
</el-upload>
|
||||||
<template #footer>
|
<template #footer>
|
||||||
<span class="dialog-footer">
|
<span class="dialog-footer">
|
||||||
<el-button @click="importDialogVisible = false">取消</el-button>
|
<el-button @click="importDialogVisible = false">取消</el-button>
|
||||||
<el-button type="primary" @click="handleImportSubmit" :loading="importLoading">??</el-button>
|
<el-button type="primary" @click="handleImportSubmit" :loading="importLoading">确认</el-button>
|
||||||
</span>
|
</span>
|
||||||
</template>
|
</template>
|
||||||
</el-dialog>
|
</el-dialog>
|
||||||
@@ -254,7 +254,7 @@ import { useTableColumnControl } from '/@/hooks/tableColumn'
|
|||||||
import type { UploadFile, UploadFiles } from 'element-plus';
|
import type { UploadFile, UploadFiles } from 'element-plus';
|
||||||
import FormDialog from './form.vue'
|
import FormDialog from './form.vue'
|
||||||
|
|
||||||
// ??????
|
// 定义变量
|
||||||
const route = useRoute()
|
const route = useRoute()
|
||||||
const formDialogRef = ref()
|
const formDialogRef = ref()
|
||||||
const columnControlRef = ref<any>()
|
const columnControlRef = ref<any>()
|
||||||
@@ -267,19 +267,19 @@ const importDialogVisible = ref(false)
|
|||||||
const importLoading = ref(false)
|
const importLoading = ref(false)
|
||||||
const fileList = ref<UploadFile[]>([])
|
const fileList = ref<UploadFile[]>([])
|
||||||
|
|
||||||
// ?????
|
// 表格列配置
|
||||||
const tableColumns = [
|
const tableColumns = [
|
||||||
{ prop: 'deptName', label: '????', minWidth: 150 },
|
{ prop: 'deptName', label: '学院名称', minWidth: 150 },
|
||||||
{ prop: 'classNo', label: '??', width: 120 },
|
{ prop: 'classNo', label: '班级', width: 120 },
|
||||||
{ prop: 'stuNo', label: '??', width: 120 },
|
{ prop: 'stuNo', label: '学号', width: 120 },
|
||||||
{ prop: 'realName', label: '??', width: 100 },
|
{ prop: 'realName', label: '姓名', width: 100 },
|
||||||
{ prop: 'phone', label: '???', width: 120 },
|
{ prop: 'phone', label: '手机号', width: 120 },
|
||||||
{ prop: 'enterTime', label: '????', width: 120 },
|
{ prop: 'enterTime', label: '入团时间', width: 120 },
|
||||||
{ prop: 'serNo', label: '????', width: 120 },
|
{ prop: 'serNo', label: '序列号', width: 120 },
|
||||||
{ prop: 'position', label: '????', width: 120 }
|
{ prop: 'position', label: '职务名称', width: 120 }
|
||||||
]
|
]
|
||||||
|
|
||||||
// ?????????????
|
// 列配置映射
|
||||||
const columnConfigMap: Record<string, { icon: any }> = {
|
const columnConfigMap: Record<string, { icon: any }> = {
|
||||||
deptName: { icon: OfficeBuilding },
|
deptName: { icon: OfficeBuilding },
|
||||||
classNo: { icon: Grid },
|
classNo: { icon: Grid },
|
||||||
@@ -291,22 +291,22 @@ const columnConfigMap: Record<string, { icon: any }> = {
|
|||||||
position: { icon: Briefcase }
|
position: { icon: Briefcase }
|
||||||
}
|
}
|
||||||
|
|
||||||
// ???????hook
|
// 表格列控制hook
|
||||||
const {
|
const {
|
||||||
visibleColumns,
|
visibleColumns,
|
||||||
visibleColumnsSorted,
|
visibleColumnsSorted,
|
||||||
checkColumnVisible,
|
checkColumnVisible,
|
||||||
handleColumnChange,
|
handleColumnChange,
|
||||||
handleColumnOrderChange
|
handleColumnOrderChange
|
||||||
} = useTableColumnControl(tableColumns, route.path)
|
} = useTableColumnControl(tableColumns)
|
||||||
|
|
||||||
// ????
|
// 表格样式
|
||||||
const tableStyle = {
|
const tableStyle = {
|
||||||
cellStyle: { padding: '8px 0' },
|
cellStyle: { padding: '8px 0' },
|
||||||
headerCellStyle: { background: '#f5f7fa', color: '#606266', fontWeight: 'bold' }
|
headerCellStyle: { background: '#f5f7fa', color: '#606266', fontWeight: 'bold' }
|
||||||
}
|
}
|
||||||
|
|
||||||
// ?? useTable
|
// 使用 useTable
|
||||||
const state: BasicTableProps = reactive<BasicTableProps>({
|
const state: BasicTableProps = reactive<BasicTableProps>({
|
||||||
queryForm: {
|
queryForm: {
|
||||||
classCode: '',
|
classCode: '',
|
||||||
@@ -331,7 +331,7 @@ const {
|
|||||||
tableStyle: _tableStyle
|
tableStyle: _tableStyle
|
||||||
} = useTable(state)
|
} = useTable(state)
|
||||||
|
|
||||||
// ??
|
// 重置
|
||||||
const handleReset = () => {
|
const handleReset = () => {
|
||||||
searchFormRef.value?.resetFields()
|
searchFormRef.value?.resetFields()
|
||||||
state.queryForm.classCode = ''
|
state.queryForm.classCode = ''
|
||||||
@@ -342,70 +342,70 @@ const handleReset = () => {
|
|||||||
getDataList()
|
getDataList()
|
||||||
}
|
}
|
||||||
|
|
||||||
// ??
|
// 编辑
|
||||||
const handleEdit = (row: any) => {
|
const handleEdit = (row: any) => {
|
||||||
formDialogRef.value?.openDialog('edit', row)
|
formDialogRef.value?.openDialog('edit', row)
|
||||||
}
|
}
|
||||||
|
|
||||||
// ??
|
// 删除
|
||||||
const handleDelete = async (row: any) => {
|
const handleDelete = async (row: any) => {
|
||||||
const { confirm } = useMessageBox()
|
const { confirm } = useMessageBox()
|
||||||
try {
|
try {
|
||||||
await confirm('???????????')
|
await confirm('确定要删除该记录吗?')
|
||||||
await delObj([row.id])
|
await delObj([row.id])
|
||||||
useMessage().success('????')
|
useMessage().success('删除成功')
|
||||||
getDataList()
|
getDataList()
|
||||||
} catch (err: any) {
|
} catch (err: any) {
|
||||||
if (err !== 'cancel') {
|
if (err !== 'cancel') {
|
||||||
useMessage().error(err.msg || '????')
|
useMessage().error(err.msg || '删除失败')
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// ??
|
// 导入
|
||||||
const handleImport = () => {
|
const handleImport = () => {
|
||||||
importDialogVisible.value = true
|
importDialogVisible.value = true
|
||||||
fileList.value = []
|
fileList.value = []
|
||||||
}
|
}
|
||||||
|
|
||||||
// ????
|
// 文件变化
|
||||||
const handleFileChange = (file: UploadFile, files: UploadFiles) => {
|
const handleFileChange = (file: UploadFile, files: UploadFiles) => {
|
||||||
fileList.value = [file]
|
fileList.value = [file]
|
||||||
}
|
}
|
||||||
|
|
||||||
// ??????
|
// 文件超出限制
|
||||||
const handleExceed = () => {
|
const handleExceed = () => {
|
||||||
useMessage().warning('????????')
|
useMessage().warning('文件数量超出限制')
|
||||||
}
|
}
|
||||||
|
|
||||||
// ????
|
// 提交导入
|
||||||
const handleImportSubmit = async () => {
|
const handleImportSubmit = async () => {
|
||||||
if (fileList.value.length === 0) {
|
if (fileList.value.length === 0) {
|
||||||
useMessage().warning('?????????')
|
useMessage().warning('请先选择要上传的文件')
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
const file = fileList.value[0].raw
|
const file = fileList.value[0].raw
|
||||||
if (!file) {
|
if (!file) {
|
||||||
useMessage().warning('?????')
|
useMessage().warning('文件无效')
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
importLoading.value = true
|
importLoading.value = true
|
||||||
try {
|
try {
|
||||||
await importExcel(file as File)
|
await importExcel(file as File)
|
||||||
useMessage().success('????')
|
useMessage().success('导入成功')
|
||||||
importDialogVisible.value = false
|
importDialogVisible.value = false
|
||||||
fileList.value = []
|
fileList.value = []
|
||||||
getDataList()
|
getDataList()
|
||||||
} catch (err: any) {
|
} catch (err: any) {
|
||||||
useMessage().error(err.msg || '????')
|
useMessage().error(err.msg || '导入失败')
|
||||||
} finally {
|
} finally {
|
||||||
importLoading.value = false
|
importLoading.value = false
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// ??
|
// 导出
|
||||||
const handleExport = async () => {
|
const handleExport = async () => {
|
||||||
try {
|
try {
|
||||||
const res = await exportExcel(state.queryForm)
|
const res = await exportExcel(state.queryForm)
|
||||||
@@ -413,18 +413,18 @@ const handleExport = async () => {
|
|||||||
const url = window.URL.createObjectURL(blob)
|
const url = window.URL.createObjectURL(blob)
|
||||||
const link = document.createElement('a')
|
const link = document.createElement('a')
|
||||||
link.href = url
|
link.href = url
|
||||||
link.download = `??_${parseTime(new Date(), '{y}{m}{d}{h}{i}{s}')}.xlsx`
|
link.download = `学生团组织_${parseTime(new Date(), '{y}{m}{d}{h}{i}{s}')}.xlsx`
|
||||||
document.body.appendChild(link)
|
document.body.appendChild(link)
|
||||||
link.click()
|
link.click()
|
||||||
document.body.removeChild(link)
|
document.body.removeChild(link)
|
||||||
window.URL.revokeObjectURL(url)
|
window.URL.revokeObjectURL(url)
|
||||||
useMessage().success('????')
|
useMessage().success('导出成功')
|
||||||
} catch (err: any) {
|
} catch (err: any) {
|
||||||
useMessage().error(err.msg || '????')
|
useMessage().error(err.msg || '导出失败')
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// ??????
|
// 获取班级列表
|
||||||
const getClassListData = async () => {
|
const getClassListData = async () => {
|
||||||
try {
|
try {
|
||||||
const res = await getClassListByRole()
|
const res = await getClassListByRole()
|
||||||
@@ -438,7 +438,7 @@ const getClassListData = async () => {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// ????????
|
// 获取入学年份列表
|
||||||
const getGradeListData = async () => {
|
const getGradeListData = async () => {
|
||||||
try {
|
try {
|
||||||
const res = await getGradeList()
|
const res = await getGradeList()
|
||||||
|
|||||||
@@ -1,21 +1,21 @@
|
|||||||
<template>
|
<template>
|
||||||
<div class="modern-page-container">
|
<div class="modern-page-container">
|
||||||
<div class="page-wrapper">
|
<div class="page-wrapper">
|
||||||
<!-- ?????? -->
|
<!-- 查询条件 -->
|
||||||
<el-card v-show="showSearch" class="search-card" shadow="never">
|
<el-card v-show="showSearch" class="search-card" shadow="never">
|
||||||
<template #header>
|
<template #header>
|
||||||
<div class="card-header">
|
<div class="card-header">
|
||||||
<span class="card-title">
|
<span class="card-title">
|
||||||
<el-icon class="title-icon"><Search /></el-icon>
|
<el-icon class="title-icon"><Search /></el-icon>
|
||||||
?????
|
查询条件
|
||||||
</span>
|
</span>
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
<el-form :model="state.queryForm" ref="searchFormRef" :inline="true" @keyup.enter="getDataList" class="search-form">
|
<el-form :model="state.queryForm" ref="searchFormRef" :inline="true" @keyup.enter="getDataList" class="search-form">
|
||||||
<el-form-item label="??" prop="termId">
|
<el-form-item label="学期" prop="termId">
|
||||||
<el-select
|
<el-select
|
||||||
v-model="state.queryForm.termId"
|
v-model="state.queryForm.termId"
|
||||||
placeholder="?????"
|
placeholder="请选择学期"
|
||||||
clearable
|
clearable
|
||||||
filterable
|
filterable
|
||||||
style="width: 200px">
|
style="width: 200px">
|
||||||
@@ -27,10 +27,10 @@
|
|||||||
</el-option>
|
</el-option>
|
||||||
</el-select>
|
</el-select>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item label="??" prop="deptCode">
|
<el-form-item label="学院" prop="deptCode">
|
||||||
<el-select
|
<el-select
|
||||||
v-model="state.queryForm.deptCode"
|
v-model="state.queryForm.deptCode"
|
||||||
placeholder="?????"
|
placeholder="请选择学院"
|
||||||
clearable
|
clearable
|
||||||
filterable
|
filterable
|
||||||
style="width: 200px">
|
style="width: 200px">
|
||||||
@@ -42,10 +42,10 @@
|
|||||||
</el-option>
|
</el-option>
|
||||||
</el-select>
|
</el-select>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item label="????" prop="grade">
|
<el-form-item label="入学年份" prop="grade">
|
||||||
<el-select
|
<el-select
|
||||||
v-model="state.queryForm.grade"
|
v-model="state.queryForm.grade"
|
||||||
placeholder="???????"
|
placeholder="请选择入学年份"
|
||||||
clearable
|
clearable
|
||||||
filterable
|
filterable
|
||||||
style="width: 200px">
|
style="width: 200px">
|
||||||
@@ -57,19 +57,19 @@
|
|||||||
</el-option>
|
</el-option>
|
||||||
</el-select>
|
</el-select>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item label="??" prop="gradeCurr">
|
<el-form-item label="年级" prop="gradeCurr">
|
||||||
<el-input-number
|
<el-input-number
|
||||||
v-model="state.queryForm.gradeCurr"
|
v-model="state.queryForm.gradeCurr"
|
||||||
placeholder="?????"
|
placeholder="请输入年级"
|
||||||
:min="1"
|
:min="1"
|
||||||
:max="10"
|
:max="10"
|
||||||
clearable
|
clearable
|
||||||
style="width: 200px" />
|
style="width: 200px" />
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item label="??" prop="classCode">
|
<el-form-item label="班级" prop="classCode">
|
||||||
<el-select
|
<el-select
|
||||||
v-model="state.queryForm.classCode"
|
v-model="state.queryForm.classCode"
|
||||||
placeholder="?????"
|
placeholder="请选择班级"
|
||||||
clearable
|
clearable
|
||||||
filterable
|
filterable
|
||||||
style="width: 200px">
|
style="width: 200px">
|
||||||
@@ -81,10 +81,10 @@
|
|||||||
</el-option>
|
</el-option>
|
||||||
</el-select>
|
</el-select>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item label="????" prop="checkStatus">
|
<el-form-item label="审核状态" prop="checkStatus">
|
||||||
<el-select
|
<el-select
|
||||||
v-model="state.queryForm.checkStatus"
|
v-model="state.queryForm.checkStatus"
|
||||||
placeholder="???????"
|
placeholder="请选择审核状态"
|
||||||
clearable
|
clearable
|
||||||
style="width: 200px">
|
style="width: 200px">
|
||||||
<el-option
|
<el-option
|
||||||
@@ -96,26 +96,26 @@
|
|||||||
</el-select>
|
</el-select>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item>
|
<el-form-item>
|
||||||
<el-button type="primary" plain icon="Search" @click="getDataList">??</el-button>
|
<el-button type="primary" plain icon="Search" @click="getDataList">查询</el-button>
|
||||||
<el-button icon="Refresh" @click="handleReset">??</el-button>
|
<el-button icon="Refresh" @click="handleReset">重置</el-button>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
</el-form>
|
</el-form>
|
||||||
</el-card>
|
</el-card>
|
||||||
|
|
||||||
<!-- ???? -->
|
<!-- 数据列表 -->
|
||||||
<el-card class="content-card" shadow="never">
|
<el-card class="content-card" shadow="never">
|
||||||
<template #header>
|
<template #header>
|
||||||
<div class="card-header">
|
<div class="card-header">
|
||||||
<span class="card-title">
|
<span class="card-title">
|
||||||
<el-icon class="title-icon"><Document /></el-icon>
|
<el-icon class="title-icon"><Document /></el-icon>
|
||||||
????????
|
免学费学生列表
|
||||||
</span>
|
</span>
|
||||||
<div class="header-actions">
|
<div class="header-actions">
|
||||||
<el-button
|
<el-button
|
||||||
icon="Plus"
|
icon="Plus"
|
||||||
type="primary"
|
type="primary"
|
||||||
@click="handleAdd">
|
@click="handleAdd">
|
||||||
??
|
新增
|
||||||
</el-button>
|
</el-button>
|
||||||
<el-button
|
<el-button
|
||||||
icon="Download"
|
icon="Download"
|
||||||
@@ -123,7 +123,7 @@
|
|||||||
class="ml10"
|
class="ml10"
|
||||||
:loading="exportLoading"
|
:loading="exportLoading"
|
||||||
@click="handleExport">
|
@click="handleExport">
|
||||||
??
|
导出
|
||||||
</el-button>
|
</el-button>
|
||||||
<right-toolbar
|
<right-toolbar
|
||||||
v-model:showSearch="showSearch"
|
v-model:showSearch="showSearch"
|
||||||
@@ -139,7 +139,7 @@
|
|||||||
@order-change="handleColumnOrderChange"
|
@order-change="handleColumnOrderChange"
|
||||||
>
|
>
|
||||||
<template #trigger>
|
<template #trigger>
|
||||||
<el-tooltip class="item" effect="dark" content="???" placement="top">
|
<el-tooltip class="item" effect="dark" content="列设置" placement="top">
|
||||||
<el-button circle style="margin-left: 0;">
|
<el-button circle style="margin-left: 0;">
|
||||||
<el-icon><Menu /></el-icon>
|
<el-icon><Menu /></el-icon>
|
||||||
</el-button>
|
</el-button>
|
||||||
@@ -151,7 +151,7 @@
|
|||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<!-- ?? -->
|
<!-- 表格 -->
|
||||||
<el-table
|
<el-table
|
||||||
:data="state.dataList"
|
:data="state.dataList"
|
||||||
v-loading="state.loading"
|
v-loading="state.loading"
|
||||||
@@ -159,7 +159,7 @@
|
|||||||
:cell-style="tableStyle.cellStyle"
|
:cell-style="tableStyle.cellStyle"
|
||||||
:header-cell-style="tableStyle.headerCellStyle"
|
:header-cell-style="tableStyle.headerCellStyle"
|
||||||
class="modern-table">
|
class="modern-table">
|
||||||
<el-table-column type="index" label="??" width="70" align="center">
|
<el-table-column type="index" label="序号" width="70" align="center">
|
||||||
<template #header>
|
<template #header>
|
||||||
<el-icon><List /></el-icon>
|
<el-icon><List /></el-icon>
|
||||||
</template>
|
</template>
|
||||||
@@ -169,7 +169,7 @@
|
|||||||
</el-table-column>
|
</el-table-column>
|
||||||
<template v-for="col in visibleColumnsSorted" :key="col.prop || col.label">
|
<template v-for="col in visibleColumnsSorted" :key="col.prop || col.label">
|
||||||
<el-table-column
|
<el-table-column
|
||||||
v-if="checkColumnVisible(col.prop || '') && col.prop !== '??'"
|
v-if="checkColumnVisible(col.prop || '') && col.prop !== '序号'"
|
||||||
:prop="col.prop"
|
:prop="col.prop"
|
||||||
:label="col.label"
|
:label="col.label"
|
||||||
show-overflow-tooltip
|
show-overflow-tooltip
|
||||||
@@ -180,39 +180,39 @@
|
|||||||
<el-icon><component :is="columnConfigMap[col.prop]?.icon || Calendar" /></el-icon>
|
<el-icon><component :is="columnConfigMap[col.prop]?.icon || Calendar" /></el-icon>
|
||||||
<span style="margin-left: 4px">{{ col.label }}</span>
|
<span style="margin-left: 4px">{{ col.label }}</span>
|
||||||
</template>
|
</template>
|
||||||
<!-- ????????-->
|
<!-- 年级格式化-->
|
||||||
<template v-if="col.prop === 'gradeCurr'" #default="scope">
|
<template v-if="col.prop === 'gradeCurr'" #default="scope">
|
||||||
<el-tag v-if="scope.row.gradeCurr !== undefined && scope.row.gradeCurr !== null" size="small" type="primary" effect="plain">
|
<el-tag v-if="scope.row.gradeCurr !== undefined && scope.row.gradeCurr !== null" size="small" type="primary" effect="plain">
|
||||||
{{ scope.row.gradeCurr }}
|
{{ scope.row.gradeCurr }}
|
||||||
</el-tag>
|
</el-tag>
|
||||||
<span v-else>-</span>
|
<span v-else>-</span>
|
||||||
</template>
|
</template>
|
||||||
<!-- ????????-->
|
<!-- 性别格式化-->
|
||||||
<template v-else-if="col.prop === 'gender'" #default="scope">
|
<template v-else-if="col.prop === 'gender'" #default="scope">
|
||||||
<GenderTag :sex="scope.row.gender" />
|
<GenderTag :sex="scope.row.gender" />
|
||||||
</template>
|
</template>
|
||||||
<!-- ????????-->
|
<!-- 学历格式化-->
|
||||||
<template v-else-if="col.prop === 'education'" #default="scope">
|
<template v-else-if="col.prop === 'education'" #default="scope">
|
||||||
<el-tag v-if="scope.row.education" size="small" type="info" effect="plain">
|
<el-tag v-if="scope.row.education" size="small" type="info" effect="plain">
|
||||||
{{ formatEducation(scope.row.education) }}
|
{{ formatEducation(scope.row.education) }}
|
||||||
</el-tag>
|
</el-tag>
|
||||||
<span v-else>-</span>
|
<span v-else>-</span>
|
||||||
</template>
|
</template>
|
||||||
<!-- ????????-->
|
<!-- 专业层次格式化-->
|
||||||
<template v-else-if="col.prop === 'majorLevel'" #default="scope">
|
<template v-else-if="col.prop === 'majorLevel'" #default="scope">
|
||||||
<el-tag v-if="scope.row.majorLevel" size="small" type="warning" effect="plain">
|
<el-tag v-if="scope.row.majorLevel" size="small" type="warning" effect="plain">
|
||||||
{{ formatMajorLevel(scope.row.majorLevel) }}
|
{{ formatMajorLevel(scope.row.majorLevel) }}
|
||||||
</el-tag>
|
</el-tag>
|
||||||
<span v-else>-</span>
|
<span v-else>-</span>
|
||||||
</template>
|
</template>
|
||||||
<!-- ????????-->
|
<!-- 金额格式化-->
|
||||||
<template v-else-if="col.prop === 'money'" #default="scope">
|
<template v-else-if="col.prop === 'money'" #default="scope">
|
||||||
<el-tag v-if="scope.row.money !== undefined && scope.row.money !== null" size="small" type="success" effect="plain">
|
<el-tag v-if="scope.row.money !== undefined && scope.row.money !== null" size="small" type="success" effect="plain">
|
||||||
?{{ scope.row.money }}
|
¥{{ scope.row.money }}
|
||||||
</el-tag>
|
</el-tag>
|
||||||
<span v-else>-</span>
|
<span v-else>-</span>
|
||||||
</template>
|
</template>
|
||||||
<!-- ????????? -->
|
<!-- 审核状态格式化 -->
|
||||||
<template v-else-if="col.prop === 'checkStatus'" #default="scope">
|
<template v-else-if="col.prop === 'checkStatus'" #default="scope">
|
||||||
<StatusTag
|
<StatusTag
|
||||||
:value="scope.row.checkStatus"
|
:value="scope.row.checkStatus"
|
||||||
@@ -222,10 +222,10 @@
|
|||||||
</template>
|
</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
</template>
|
</template>
|
||||||
<el-table-column label="??" width="150" align="center" fixed="right">
|
<el-table-column label="操作" width="150" align="center" fixed="right">
|
||||||
<template #header>
|
<template #header>
|
||||||
<el-icon><Setting /></el-icon>
|
<el-icon><Setting /></el-icon>
|
||||||
<span style="margin-left: 4px">??</span>
|
<span style="margin-left: 4px">操作</span>
|
||||||
</template>
|
</template>
|
||||||
<template #default="scope">
|
<template #default="scope">
|
||||||
<el-button
|
<el-button
|
||||||
@@ -233,20 +233,20 @@
|
|||||||
link
|
link
|
||||||
type="primary"
|
type="primary"
|
||||||
@click="handleEdit(scope.row)">
|
@click="handleEdit(scope.row)">
|
||||||
??
|
编辑
|
||||||
</el-button>
|
</el-button>
|
||||||
<el-button
|
<el-button
|
||||||
icon="Delete"
|
icon="Delete"
|
||||||
link
|
link
|
||||||
type="danger"
|
type="danger"
|
||||||
@click="handleDelete(scope.row)">
|
@click="handleDelete(scope.row)">
|
||||||
??
|
删除
|
||||||
</el-button>
|
</el-button>
|
||||||
</template>
|
</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
</el-table>
|
</el-table>
|
||||||
|
|
||||||
<!-- ?? -->
|
<!-- 分页 -->
|
||||||
<div class="pagination-wrapper">
|
<div class="pagination-wrapper">
|
||||||
<pagination
|
<pagination
|
||||||
@size-change="sizeChangeHandle"
|
@size-change="sizeChangeHandle"
|
||||||
@@ -256,7 +256,7 @@
|
|||||||
</el-card>
|
</el-card>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<!-- ??/?????? -->
|
<!-- 新增/编辑对话框 -->
|
||||||
<!-- <form-dialog ref="formDialogRef" @refresh="getDataList" /> -->
|
<!-- <form-dialog ref="formDialogRef" @refresh="getDataList" /> -->
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
@@ -282,11 +282,11 @@ import {
|
|||||||
import { useTableColumnControl } from '/@/hooks/tableColumn'
|
import { useTableColumnControl } from '/@/hooks/tableColumn'
|
||||||
|
|
||||||
|
|
||||||
// ????
|
// 异步组件
|
||||||
const GenderTag = defineAsyncComponent(() => import('/@/components/GenderTag/index.vue'))
|
const GenderTag = defineAsyncComponent(() => import('/@/components/GenderTag/index.vue'))
|
||||||
const StatusTag = defineAsyncComponent(() => import('/@/components/StatusTag/index.vue'))
|
const StatusTag = defineAsyncComponent(() => import('/@/components/StatusTag/index.vue'))
|
||||||
|
|
||||||
// ??????
|
// 定义变量
|
||||||
const route = useRoute()
|
const route = useRoute()
|
||||||
const searchFormRef = ref()
|
const searchFormRef = ref()
|
||||||
const columnControlRef = ref<any>()
|
const columnControlRef = ref<any>()
|
||||||
@@ -301,29 +301,29 @@ const genderList = ref<any[]>([])
|
|||||||
const educationList = ref<any[]>([])
|
const educationList = ref<any[]>([])
|
||||||
const majorLevelList = ref<any[]>([])
|
const majorLevelList = ref<any[]>([])
|
||||||
const checkStatusList = ref<any[]>([
|
const checkStatusList = ref<any[]>([
|
||||||
{ label: '???', value: '0' },
|
{ label: '未审核', value: '0' },
|
||||||
{ label: '????', value: '1' }
|
{ label: '已审核', value: '1' }
|
||||||
])
|
])
|
||||||
|
|
||||||
// ??????
|
// 表格列配置
|
||||||
const tableColumns = [
|
const tableColumns = [
|
||||||
{ prop: 'deptName', label: '??', minWidth: 150 },
|
{ prop: 'deptName', label: '学院', minWidth: 150 },
|
||||||
{ prop: 'majorName', label: '??', minWidth: 150 },
|
{ prop: 'majorName', label: '专业', minWidth: 150 },
|
||||||
{ prop: 'teacherName', label: '???', width: 100 },
|
{ prop: 'teacherName', label: '班主任', width: 100 },
|
||||||
{ prop: 'grade', label: '????', width: 100 },
|
{ prop: 'grade', label: '入学年份', width: 100 },
|
||||||
{ prop: 'gradeCurr', label: '??', width: 80 },
|
{ prop: 'gradeCurr', label: '年级', width: 80 },
|
||||||
{ prop: 'classNo', label: '??', width: 120 },
|
{ prop: 'classNo', label: '班级', width: 120 },
|
||||||
{ prop: 'stuNo', label: '??', width: 120 },
|
{ prop: 'stuNo', label: '学号', width: 120 },
|
||||||
{ prop: 'realName', label: '??', width: 100 },
|
{ prop: 'realName', label: '姓名', width: 100 },
|
||||||
{ prop: 'gender', label: '??', width: 80 },
|
{ prop: 'gender', label: '性别', width: 80 },
|
||||||
{ prop: 'education', label: '??', width: 100 },
|
{ prop: 'education', label: '学历', width: 100 },
|
||||||
{ prop: 'majorLevel', label: '??', width: 100 },
|
{ prop: 'majorLevel', label: '层次', width: 100 },
|
||||||
{ prop: 'phone', label: '????', width: 120 },
|
{ prop: 'phone', label: '联系电话', width: 120 },
|
||||||
{ prop: 'money', label: '??', width: 100 },
|
{ prop: 'money', label: '金额', width: 100 },
|
||||||
{ prop: 'checkStatus', label: '????', width: 100 }
|
{ prop: 'checkStatus', label: '审核状态', width: 100 }
|
||||||
]
|
]
|
||||||
|
|
||||||
// ????????????
|
// 列配置映射
|
||||||
const columnConfigMap: Record<string, { icon: any }> = {
|
const columnConfigMap: Record<string, { icon: any }> = {
|
||||||
deptName: { icon: OfficeBuilding },
|
deptName: { icon: OfficeBuilding },
|
||||||
majorName: { icon: Reading },
|
majorName: { icon: Reading },
|
||||||
@@ -341,22 +341,22 @@ const columnConfigMap: Record<string, { icon: any }> = {
|
|||||||
checkStatus: { icon: CircleCheck }
|
checkStatus: { icon: CircleCheck }
|
||||||
}
|
}
|
||||||
|
|
||||||
// ???????hook
|
// 表格列控制hook
|
||||||
const {
|
const {
|
||||||
visibleColumns,
|
visibleColumns,
|
||||||
visibleColumnsSorted,
|
visibleColumnsSorted,
|
||||||
checkColumnVisible,
|
checkColumnVisible,
|
||||||
handleColumnChange,
|
handleColumnChange,
|
||||||
handleColumnOrderChange
|
handleColumnOrderChange
|
||||||
} = useTableColumnControl(tableColumns, route.path)
|
} = useTableColumnControl(tableColumns)
|
||||||
|
|
||||||
// ????
|
// 表格样式
|
||||||
const tableStyle = {
|
const tableStyle = {
|
||||||
cellStyle: { padding: '8px 0' },
|
cellStyle: { padding: '8px 0' },
|
||||||
headerCellStyle: { background: '#f5f7fa', color: '#606266', fontWeight: 'bold' }
|
headerCellStyle: { background: '#f5f7fa', color: '#606266', fontWeight: 'bold' }
|
||||||
}
|
}
|
||||||
|
|
||||||
// ?? useTable
|
// 使用 useTable
|
||||||
const state: BasicTableProps = reactive<BasicTableProps>({
|
const state: BasicTableProps = reactive<BasicTableProps>({
|
||||||
queryForm: {
|
queryForm: {
|
||||||
termId: '',
|
termId: '',
|
||||||
@@ -382,7 +382,7 @@ const {
|
|||||||
tableStyle: _tableStyle
|
tableStyle: _tableStyle
|
||||||
} = useTable(state)
|
} = useTable(state)
|
||||||
|
|
||||||
// ?????
|
// 格式化性别
|
||||||
const formatGender = (value: string | number) => {
|
const formatGender = (value: string | number) => {
|
||||||
if (value === null || value === undefined || value === '') {
|
if (value === null || value === undefined || value === '') {
|
||||||
return '-'
|
return '-'
|
||||||
@@ -391,7 +391,7 @@ const formatGender = (value: string | number) => {
|
|||||||
return dictItem ? dictItem.label : value
|
return dictItem ? dictItem.label : value
|
||||||
}
|
}
|
||||||
|
|
||||||
// ??????
|
// 格式化学历
|
||||||
const formatEducation = (value: string | number) => {
|
const formatEducation = (value: string | number) => {
|
||||||
if (value === null || value === undefined || value === '') {
|
if (value === null || value === undefined || value === '') {
|
||||||
return '-'
|
return '-'
|
||||||
@@ -400,7 +400,7 @@ const formatEducation = (value: string | number) => {
|
|||||||
return dictItem ? dictItem.label : value
|
return dictItem ? dictItem.label : value
|
||||||
}
|
}
|
||||||
|
|
||||||
// ??????
|
// 格式化层次
|
||||||
const formatMajorLevel = (value: string | number) => {
|
const formatMajorLevel = (value: string | number) => {
|
||||||
if (value === null || value === undefined || value === '') {
|
if (value === null || value === undefined || value === '') {
|
||||||
return '-'
|
return '-'
|
||||||
@@ -409,7 +409,7 @@ const formatMajorLevel = (value: string | number) => {
|
|||||||
return dictItem ? dictItem.label : value
|
return dictItem ? dictItem.label : value
|
||||||
}
|
}
|
||||||
|
|
||||||
// ????????
|
// 格式化审核状态
|
||||||
const formatCheckStatus = (value: string | number) => {
|
const formatCheckStatus = (value: string | number) => {
|
||||||
if (value === null || value === undefined || value === '') {
|
if (value === null || value === undefined || value === '') {
|
||||||
return '-'
|
return '-'
|
||||||
@@ -418,7 +418,7 @@ const formatCheckStatus = (value: string | number) => {
|
|||||||
return dictItem ? dictItem.label : value
|
return dictItem ? dictItem.label : value
|
||||||
}
|
}
|
||||||
|
|
||||||
// ??
|
// 重置
|
||||||
const handleReset = () => {
|
const handleReset = () => {
|
||||||
searchFormRef.value?.resetFields()
|
searchFormRef.value?.resetFields()
|
||||||
state.queryForm.termId = ''
|
state.queryForm.termId = ''
|
||||||
@@ -430,40 +430,40 @@ const handleReset = () => {
|
|||||||
getDataList()
|
getDataList()
|
||||||
}
|
}
|
||||||
|
|
||||||
// ??
|
// 新增
|
||||||
const handleAdd = () => {
|
const handleAdd = () => {
|
||||||
useMessage().info('?????')
|
useMessage().info('功能开发中')
|
||||||
// formDialogRef.value?.openDialog('add')
|
// formDialogRef.value?.openDialog('add')
|
||||||
}
|
}
|
||||||
|
|
||||||
// ??
|
// 编辑
|
||||||
const handleEdit = (row: any) => {
|
const handleEdit = (row: any) => {
|
||||||
useMessage().info('?????')
|
useMessage().info('功能开发中')
|
||||||
// formDialogRef.value?.openDialog('edit', row.id)
|
// formDialogRef.value?.openDialog('edit', row.id)
|
||||||
}
|
}
|
||||||
|
|
||||||
// ??
|
// 删除
|
||||||
const handleDelete = async (row: any) => {
|
const handleDelete = async (row: any) => {
|
||||||
try {
|
try {
|
||||||
const { confirm } = useMessageBox()
|
const { confirm } = useMessageBox()
|
||||||
await confirm(`???????? ${row.stuNo} ????????`)
|
await confirm(`确定要删除学号为 ${row.stuNo} 的学生记录吗?`)
|
||||||
await delObj(row.id)
|
await delObj(row.id)
|
||||||
useMessage().success('????')
|
useMessage().success('删除成功')
|
||||||
getDataList()
|
getDataList()
|
||||||
} catch (err: any) {
|
} catch (err: any) {
|
||||||
if (err !== 'cancel') {
|
if (err !== 'cancel') {
|
||||||
useMessage().error(err.msg || '????')
|
useMessage().error(err.msg || '删除失败')
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// ??
|
// 导出
|
||||||
const handleExport = async () => {
|
const handleExport = async () => {
|
||||||
try {
|
try {
|
||||||
exportLoading.value = true
|
exportLoading.value = true
|
||||||
const res = await exportExcel(state.queryForm)
|
const res = await exportExcel(state.queryForm)
|
||||||
const blob = new Blob([res.data as BlobPart])
|
const blob = new Blob([res.data as BlobPart])
|
||||||
const fileName = `?????_${new Date().getTime()}.xls`
|
const fileName = `免学费学生_${new Date().getTime()}.xls`
|
||||||
const elink = document.createElement('a')
|
const elink = document.createElement('a')
|
||||||
elink.download = fileName
|
elink.download = fileName
|
||||||
elink.style.display = 'none'
|
elink.style.display = 'none'
|
||||||
@@ -472,15 +472,15 @@ const handleExport = async () => {
|
|||||||
elink.click()
|
elink.click()
|
||||||
URL.revokeObjectURL(elink.href)
|
URL.revokeObjectURL(elink.href)
|
||||||
document.body.removeChild(elink)
|
document.body.removeChild(elink)
|
||||||
useMessage().success('????')
|
useMessage().success('导出成功')
|
||||||
} catch (err: any) {
|
} catch (err: any) {
|
||||||
useMessage().error(err.msg || '????')
|
useMessage().error(err.msg || '导出失败')
|
||||||
} finally {
|
} finally {
|
||||||
exportLoading.value = false
|
exportLoading.value = false
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// ??????
|
// 获取学期列表
|
||||||
const getTermList = async () => {
|
const getTermList = async () => {
|
||||||
try {
|
try {
|
||||||
const res = await request({
|
const res = await request({
|
||||||
@@ -497,7 +497,7 @@ const getTermList = async () => {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// ??????
|
// 获取学院列表
|
||||||
const getDeptListData = async () => {
|
const getDeptListData = async () => {
|
||||||
try {
|
try {
|
||||||
const res = await getDeptList()
|
const res = await getDeptList()
|
||||||
@@ -511,7 +511,7 @@ const getDeptListData = async () => {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// ??????
|
// 获取班级列表
|
||||||
const getClassListData = async () => {
|
const getClassListData = async () => {
|
||||||
try {
|
try {
|
||||||
const res = await getClassListByRole()
|
const res = await getClassListByRole()
|
||||||
@@ -525,7 +525,7 @@ const getClassListData = async () => {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// ????????
|
// 获取入学年份列表
|
||||||
const getGradeList = async () => {
|
const getGradeList = async () => {
|
||||||
try {
|
try {
|
||||||
const res = await queryAllSchoolYear()
|
const res = await queryAllSchoolYear()
|
||||||
@@ -539,7 +539,7 @@ const getGradeList = async () => {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// ??????
|
// 获取性别字典
|
||||||
const getGenderDict = async () => {
|
const getGenderDict = async () => {
|
||||||
try {
|
try {
|
||||||
const res = await getDicts('sexy')
|
const res = await getDicts('sexy')
|
||||||
@@ -556,7 +556,7 @@ const getGenderDict = async () => {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// ??????
|
// 获取学历字典
|
||||||
const getEducationDict = async () => {
|
const getEducationDict = async () => {
|
||||||
try {
|
try {
|
||||||
const res = await getDicts('pre_school_education')
|
const res = await getDicts('pre_school_education')
|
||||||
@@ -573,7 +573,7 @@ const getEducationDict = async () => {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// ??????
|
// 获取层次字典
|
||||||
const getMajorLevelDict = async () => {
|
const getMajorLevelDict = async () => {
|
||||||
try {
|
try {
|
||||||
const res = await getDicts('basic_major_level')
|
const res = await getDicts('basic_major_level')
|
||||||
@@ -590,7 +590,7 @@ const getMajorLevelDict = async () => {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// ????
|
// 初始化
|
||||||
onMounted(() => {
|
onMounted(() => {
|
||||||
getTermList()
|
getTermList()
|
||||||
getDeptListData()
|
getDeptListData()
|
||||||
|
|||||||
@@ -1,40 +1,40 @@
|
|||||||
<template>
|
<template>
|
||||||
<div class="modern-page-container">
|
<div class="modern-page-container">
|
||||||
<div class="page-wrapper">
|
<div class="page-wrapper">
|
||||||
<!-- ?????? -->
|
<!-- 查询条件 -->
|
||||||
<el-card v-show="showSearch" class="search-card" shadow="never">
|
<el-card v-show="showSearch" class="search-card" shadow="never">
|
||||||
<template #header>
|
<template #header>
|
||||||
<div class="card-header">
|
<div class="card-header">
|
||||||
<span class="card-title">
|
<span class="card-title">
|
||||||
<el-icon class="title-icon"><Search /></el-icon>
|
<el-icon class="title-icon"><Search /></el-icon>
|
||||||
?????
|
查询条件
|
||||||
</span>
|
</span>
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
<el-form :model="searchForm" ref="searchFormRef" :inline="true" @keyup.enter="handleSearch" class="search-form">
|
<el-form :model="searchForm" ref="searchFormRef" :inline="true" @keyup.enter="handleSearch" class="search-form">
|
||||||
<el-form-item label="????" prop="effectiveMoney">
|
<el-form-item label="有效金额" prop="effectiveMoney">
|
||||||
<el-input-number
|
<el-input-number
|
||||||
v-model="searchForm.effectiveMoney"
|
v-model="searchForm.effectiveMoney"
|
||||||
placeholder="???????"
|
placeholder="请输入有效金额"
|
||||||
:precision="2"
|
:precision="2"
|
||||||
:min="0"
|
:min="0"
|
||||||
clearable
|
clearable
|
||||||
style="width: 200px" />
|
style="width: 200px" />
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item label="????" prop="isLiveNum">
|
<el-form-item label="是否住人" prop="isLiveNum">
|
||||||
<el-select
|
<el-select
|
||||||
v-model="searchForm.isLiveNum"
|
v-model="searchForm.isLiveNum"
|
||||||
placeholder="?????"
|
placeholder="请选择"
|
||||||
clearable
|
clearable
|
||||||
style="width: 200px">
|
style="width: 200px">
|
||||||
<el-option label="??0" :value="true" />
|
<el-option label="等于0" :value="true" />
|
||||||
<el-option label="??0" :value="false" />
|
<el-option label="不等于0" :value="false" />
|
||||||
</el-select>
|
</el-select>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item label="??" prop="buildNo">
|
<el-form-item label="楼号" prop="buildNo">
|
||||||
<el-select
|
<el-select
|
||||||
v-model="searchForm.buildNo"
|
v-model="searchForm.buildNo"
|
||||||
placeholder="?????"
|
placeholder="请选择楼号"
|
||||||
clearable
|
clearable
|
||||||
filterable
|
filterable
|
||||||
style="width: 200px">
|
style="width: 200px">
|
||||||
@@ -46,48 +46,48 @@
|
|||||||
</el-option>
|
</el-option>
|
||||||
</el-select>
|
</el-select>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item label="???" prop="roomNo">
|
<el-form-item label="房间号" prop="roomNo">
|
||||||
<el-input
|
<el-input
|
||||||
v-model="searchForm.roomNo"
|
v-model="searchForm.roomNo"
|
||||||
placeholder="??????"
|
placeholder="请输入房间号"
|
||||||
clearable
|
clearable
|
||||||
style="width: 200px" />
|
style="width: 200px" />
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item>
|
<el-form-item>
|
||||||
<el-button type="primary" plain icon="Search" @click="handleSearch">??</el-button>
|
<el-button type="primary" plain icon="Search" @click="handleSearch">查询</el-button>
|
||||||
<el-button icon="Refresh" @click="handleReset">??</el-button>
|
<el-button icon="Refresh" @click="handleReset">重置</el-button>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
</el-form>
|
</el-form>
|
||||||
</el-card>
|
</el-card>
|
||||||
|
|
||||||
<!-- ???? -->
|
<!-- 数据列表 -->
|
||||||
<el-card class="content-card" shadow="never">
|
<el-card class="content-card" shadow="never">
|
||||||
<template #header>
|
<template #header>
|
||||||
<div class="card-header">
|
<div class="card-header">
|
||||||
<span class="card-title">
|
<span class="card-title">
|
||||||
<el-icon class="title-icon"><Document /></el-icon>
|
<el-icon class="title-icon"><Document /></el-icon>
|
||||||
??????
|
水费明细列表
|
||||||
</span>
|
</span>
|
||||||
<div class="header-actions">
|
<div class="header-actions">
|
||||||
<el-button
|
<el-button
|
||||||
icon="FolderAdd"
|
icon="FolderAdd"
|
||||||
type="primary"
|
type="primary"
|
||||||
@click="formDialogRef.openDialog()">
|
@click="formDialogRef.openDialog()">
|
||||||
????
|
新增明细
|
||||||
</el-button>
|
</el-button>
|
||||||
<el-button
|
<el-button
|
||||||
icon="Download"
|
icon="Download"
|
||||||
type="success"
|
type="success"
|
||||||
class="ml10"
|
class="ml10"
|
||||||
@click="handleExport">
|
@click="handleExport">
|
||||||
????
|
导出数据
|
||||||
</el-button>
|
</el-button>
|
||||||
<el-button
|
<el-button
|
||||||
icon="Setting"
|
icon="Setting"
|
||||||
type="warning"
|
type="warning"
|
||||||
class="ml10"
|
class="ml10"
|
||||||
@click="handleInitWaterOrder">
|
@click="handleInitWaterOrder">
|
||||||
??????????
|
批量初始化订单
|
||||||
</el-button>
|
</el-button>
|
||||||
<right-toolbar
|
<right-toolbar
|
||||||
v-model:showSearch="showSearch"
|
v-model:showSearch="showSearch"
|
||||||
@@ -103,7 +103,7 @@
|
|||||||
@order-change="handleColumnOrderChange"
|
@order-change="handleColumnOrderChange"
|
||||||
>
|
>
|
||||||
<template #trigger>
|
<template #trigger>
|
||||||
<el-tooltip class="item" effect="dark" content="???" placement="top">
|
<el-tooltip class="item" effect="dark" content="列设置" placement="top">
|
||||||
<el-button circle style="margin-left: 0;">
|
<el-button circle style="margin-left: 0;">
|
||||||
<el-icon><Menu /></el-icon>
|
<el-icon><Menu /></el-icon>
|
||||||
</el-button>
|
</el-button>
|
||||||
@@ -115,7 +115,7 @@
|
|||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<!-- ?? -->
|
<!-- 表格 -->
|
||||||
<el-table
|
<el-table
|
||||||
:data="state.dataList"
|
:data="state.dataList"
|
||||||
v-loading="state.loading"
|
v-loading="state.loading"
|
||||||
@@ -124,7 +124,7 @@
|
|||||||
:header-cell-style="tableStyle.headerCellStyle"
|
:header-cell-style="tableStyle.headerCellStyle"
|
||||||
class="modern-table"
|
class="modern-table"
|
||||||
@sort-change="sortChangeHandle">
|
@sort-change="sortChangeHandle">
|
||||||
<el-table-column type="index" label="??" width="70" align="center">
|
<el-table-column type="index" label="序号" width="70" align="center">
|
||||||
<template #header>
|
<template #header>
|
||||||
<el-icon><List /></el-icon>
|
<el-icon><List /></el-icon>
|
||||||
</template>
|
</template>
|
||||||
@@ -134,7 +134,7 @@
|
|||||||
</el-table-column>
|
</el-table-column>
|
||||||
<template v-for="col in visibleColumnsSorted" :key="col.prop || col.label">
|
<template v-for="col in visibleColumnsSorted" :key="col.prop || col.label">
|
||||||
<el-table-column
|
<el-table-column
|
||||||
v-if="checkColumnVisible(col.prop || '') && col.prop !== '??'"
|
v-if="checkColumnVisible(col.prop || '') && col.prop !== '序号'"
|
||||||
:prop="col.prop"
|
:prop="col.prop"
|
||||||
:label="col.label"
|
:label="col.label"
|
||||||
show-overflow-tooltip
|
show-overflow-tooltip
|
||||||
@@ -145,53 +145,53 @@
|
|||||||
<el-icon><component :is="columnConfigMap[col.prop]?.icon || Money" /></el-icon>
|
<el-icon><component :is="columnConfigMap[col.prop]?.icon || Money" /></el-icon>
|
||||||
<span style="margin-left: 4px">{{ col.label }}</span>
|
<span style="margin-left: 4px">{{ col.label }}</span>
|
||||||
</template>
|
</template>
|
||||||
<!-- ???????? -->
|
<!-- 床位号格式化 -->
|
||||||
<template v-if="col.prop === 'bedNum'" #default="scope">
|
<template v-if="col.prop === 'bedNum'" #default="scope">
|
||||||
<el-tag v-if="scope.row.bedNum" size="small" type="info" effect="plain">
|
<el-tag v-if="scope.row.bedNum" size="small" type="info" effect="plain">
|
||||||
{{ scope.row.bedNum }}??
|
{{ scope.row.bedNum }}号床
|
||||||
</el-tag>
|
</el-tag>
|
||||||
<span v-else>-</span>
|
<span v-else>-</span>
|
||||||
</template>
|
</template>
|
||||||
<!-- ??????????-->
|
<!-- 住人数量格式化-->
|
||||||
<template v-else-if="col.prop === 'liveNum'" #default="scope">
|
<template v-else-if="col.prop === 'liveNum'" #default="scope">
|
||||||
<el-tag v-if="scope.row.liveNum !== undefined && scope.row.liveNum !== null" size="small" type="success" effect="plain">
|
<el-tag v-if="scope.row.liveNum !== undefined && scope.row.liveNum !== null" size="small" type="success" effect="plain">
|
||||||
{{ scope.row.liveNum }}
|
{{ scope.row.liveNum }}
|
||||||
</el-tag>
|
</el-tag>
|
||||||
<span v-else>-</span>
|
<span v-else>-</span>
|
||||||
</template>
|
</template>
|
||||||
<!-- ??????????-->
|
<!-- 期初余额格式化-->
|
||||||
<template v-else-if="col.prop === 'oddbMoney'" #default="scope">
|
<template v-else-if="col.prop === 'oddbMoney'" #default="scope">
|
||||||
<el-tag v-if="scope.row.oddbMoney" size="small" type="success" effect="plain">
|
<el-tag v-if="scope.row.oddbMoney" size="small" type="success" effect="plain">
|
||||||
?{{ Number(scope.row.oddbMoney).toFixed(2) }}
|
¥{{ Number(scope.row.oddbMoney).toFixed(2) }}
|
||||||
</el-tag>
|
</el-tag>
|
||||||
<span v-else>?0.00</span>
|
<span v-else>¥0.00</span>
|
||||||
</template>
|
</template>
|
||||||
<!-- ????????? -->
|
<!-- 充值金额格式化 -->
|
||||||
<template v-else-if="col.prop === 'rechargeMoney'" #default="scope">
|
<template v-else-if="col.prop === 'rechargeMoney'" #default="scope">
|
||||||
<el-tag v-if="scope.row.rechargeMoney" size="small" type="primary" effect="plain">
|
<el-tag v-if="scope.row.rechargeMoney" size="small" type="primary" effect="plain">
|
||||||
?{{ Number(scope.row.rechargeMoney).toFixed(2) }}
|
¥{{ Number(scope.row.rechargeMoney).toFixed(2) }}
|
||||||
</el-tag>
|
</el-tag>
|
||||||
<span v-else>?0.00</span>
|
<span v-else>¥0.00</span>
|
||||||
</template>
|
</template>
|
||||||
<!-- ??????????-->
|
<!-- 消费金额格式化-->
|
||||||
<template v-else-if="col.prop === 'costMoney'" #default="scope">
|
<template v-else-if="col.prop === 'costMoney'" #default="scope">
|
||||||
<el-tag v-if="scope.row.costMoney" size="small" type="warning" effect="plain">
|
<el-tag v-if="scope.row.costMoney" size="small" type="warning" effect="plain">
|
||||||
?{{ Number(scope.row.costMoney).toFixed(2) }}
|
¥{{ Number(scope.row.costMoney).toFixed(2) }}
|
||||||
</el-tag>
|
</el-tag>
|
||||||
<span v-else>?0.00</span>
|
<span v-else>¥0.00</span>
|
||||||
</template>
|
</template>
|
||||||
<!-- ??????????-->
|
<!-- 有效金额格式化-->
|
||||||
<template v-else-if="col.prop === 'effectiveMoney'" #default="scope">
|
<template v-else-if="col.prop === 'effectiveMoney'" #default="scope">
|
||||||
<el-tag size="small" :type="Number(scope.row.effectiveMoney) < 0 ? 'danger' : 'success'" effect="plain">
|
<el-tag size="small" :type="Number(scope.row.effectiveMoney) < 0 ? 'danger' : 'success'" effect="plain">
|
||||||
?{{ scope.row.effectiveMoney ? Number(scope.row.effectiveMoney).toFixed(2) : '0.00' }}
|
¥{{ scope.row.effectiveMoney ? Number(scope.row.effectiveMoney).toFixed(2) : '0.00' }}
|
||||||
</el-tag>
|
</el-tag>
|
||||||
</template>
|
</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
</template>
|
</template>
|
||||||
<el-table-column label="??" width="200" align="center" fixed="right">
|
<el-table-column label="操作" width="200" align="center" fixed="right">
|
||||||
<template #header>
|
<template #header>
|
||||||
<el-icon><Setting /></el-icon>
|
<el-icon><Setting /></el-icon>
|
||||||
<span style="margin-left: 4px">??</span>
|
<span style="margin-left: 4px">操作</span>
|
||||||
</template>
|
</template>
|
||||||
<template #default="scope">
|
<template #default="scope">
|
||||||
<el-button
|
<el-button
|
||||||
@@ -199,27 +199,27 @@
|
|||||||
link
|
link
|
||||||
type="primary"
|
type="primary"
|
||||||
@click="handleEdit(scope.row)">
|
@click="handleEdit(scope.row)">
|
||||||
??
|
编辑
|
||||||
</el-button>
|
</el-button>
|
||||||
<el-button
|
<el-button
|
||||||
icon="View"
|
icon="View"
|
||||||
link
|
link
|
||||||
type="info"
|
type="info"
|
||||||
@click="handleViewDetail(scope.row)">
|
@click="handleViewDetail(scope.row)">
|
||||||
??
|
详情
|
||||||
</el-button>
|
</el-button>
|
||||||
<el-button
|
<el-button
|
||||||
icon="Delete"
|
icon="Delete"
|
||||||
link
|
link
|
||||||
type="danger"
|
type="danger"
|
||||||
@click="handleDelete(scope.row)">
|
@click="handleDelete(scope.row)">
|
||||||
??
|
删除
|
||||||
</el-button>
|
</el-button>
|
||||||
</template>
|
</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
</el-table>
|
</el-table>
|
||||||
|
|
||||||
<!-- ?? -->
|
<!-- 分页 -->
|
||||||
<div class="pagination-wrapper">
|
<div class="pagination-wrapper">
|
||||||
<pagination
|
<pagination
|
||||||
@size-change="sizeChangeHandle"
|
@size-change="sizeChangeHandle"
|
||||||
@@ -229,28 +229,28 @@
|
|||||||
</el-card>
|
</el-card>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<!-- ???? -->
|
<!-- 新增/编辑对话框 -->
|
||||||
<FormDialog ref="formDialogRef" @refresh="getDataList()" />
|
<FormDialog ref="formDialogRef" @refresh="getDataList()" />
|
||||||
|
|
||||||
<!-- ???? -->
|
<!-- 详情对话框 -->
|
||||||
<DetailDialog ref="detailDialogRef" />
|
<DetailDialog ref="detailDialogRef" />
|
||||||
|
|
||||||
<!-- ??????????-->
|
<!-- 批量初始化对话框-->
|
||||||
<el-dialog v-model="initDialogVisible" title="???????" :width="500" :close-on-click-modal="false" draggable>
|
<el-dialog v-model="initDialogVisible" title="批量初始化订单" :width="500" :close-on-click-modal="false" draggable>
|
||||||
<el-form ref="initFormRef" :model="initForm" :rules="initRules" label-width="120px">
|
<el-form ref="initFormRef" :model="initForm" :rules="initRules" label-width="120px">
|
||||||
<el-form-item label="????" prop="costMoney">
|
<el-form-item label="消费金额" prop="costMoney">
|
||||||
<el-input-number
|
<el-input-number
|
||||||
v-model="initForm.costMoney"
|
v-model="initForm.costMoney"
|
||||||
:precision="2"
|
:precision="2"
|
||||||
:min="0"
|
:min="0"
|
||||||
placeholder="???????"
|
placeholder="请输入消费金额"
|
||||||
style="width: 100%" />
|
style="width: 100%" />
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
</el-form>
|
</el-form>
|
||||||
<template #footer>
|
<template #footer>
|
||||||
<span class="dialog-footer">
|
<span class="dialog-footer">
|
||||||
<el-button @click="initDialogVisible = false">??</el-button>
|
<el-button @click="initDialogVisible = false">取消</el-button>
|
||||||
<el-button type="primary" @click="confirmInit" :loading="initLoading">??</el-button>
|
<el-button type="primary" @click="confirmInit" :loading="initLoading">确认</el-button>
|
||||||
</span>
|
</span>
|
||||||
</template>
|
</template>
|
||||||
</el-dialog>
|
</el-dialog>
|
||||||
@@ -271,7 +271,7 @@ import { List, OfficeBuilding, House, UserFilled, Money, Setting, Menu, Search,
|
|||||||
import { useTableColumnControl } from '/@/hooks/tableColumn'
|
import { useTableColumnControl } from '/@/hooks/tableColumn'
|
||||||
|
|
||||||
|
|
||||||
// ??????
|
// 定义变量
|
||||||
const route = useRoute()
|
const route = useRoute()
|
||||||
const searchFormRef = ref()
|
const searchFormRef = ref()
|
||||||
const columnControlRef = ref<any>()
|
const columnControlRef = ref<any>()
|
||||||
@@ -283,19 +283,19 @@ const buildingList = ref<any[]>([])
|
|||||||
const initDialogVisible = ref(false)
|
const initDialogVisible = ref(false)
|
||||||
const initLoading = ref(false)
|
const initLoading = ref(false)
|
||||||
|
|
||||||
// ??????
|
// 表格列配置
|
||||||
const tableColumns = [
|
const tableColumns = [
|
||||||
{ prop: 'buildNo', label: '??' },
|
{ prop: 'buildNo', label: '楼号' },
|
||||||
{ prop: 'roomNo', label: '???' },
|
{ prop: 'roomNo', label: '房间号' },
|
||||||
{ prop: 'bedNum', label: '???' },
|
{ prop: 'bedNum', label: '床位号' },
|
||||||
{ prop: 'liveNum', label: '????' },
|
{ prop: 'liveNum', label: '住人数量' },
|
||||||
{ prop: 'oddbMoney', label: '????' },
|
{ prop: 'oddbMoney', label: '期初余额' },
|
||||||
{ prop: 'rechargeMoney', label: '????' },
|
{ prop: 'rechargeMoney', label: '充值金额' },
|
||||||
{ prop: 'costMoney', label: '????' },
|
{ prop: 'costMoney', label: '消费金额' },
|
||||||
{ prop: 'effectiveMoney', label: '????' }
|
{ prop: 'effectiveMoney', label: '有效金额' }
|
||||||
]
|
]
|
||||||
|
|
||||||
// ????????????
|
// 列配置映射
|
||||||
const columnConfigMap: Record<string, { icon: any }> = {
|
const columnConfigMap: Record<string, { icon: any }> = {
|
||||||
buildNo: { icon: OfficeBuilding },
|
buildNo: { icon: OfficeBuilding },
|
||||||
roomNo: { icon: House },
|
roomNo: { icon: House },
|
||||||
@@ -307,16 +307,16 @@ const columnConfigMap: Record<string, { icon: any }> = {
|
|||||||
effectiveMoney: { icon: Money }
|
effectiveMoney: { icon: Money }
|
||||||
}
|
}
|
||||||
|
|
||||||
// ???????hook
|
// 表格列控制hook
|
||||||
const {
|
const {
|
||||||
visibleColumns,
|
visibleColumns,
|
||||||
visibleColumnsSorted,
|
visibleColumnsSorted,
|
||||||
checkColumnVisible,
|
checkColumnVisible,
|
||||||
handleColumnChange,
|
handleColumnChange,
|
||||||
handleColumnOrderChange
|
handleColumnOrderChange
|
||||||
} = useTableColumnControl(tableColumns, route.path)
|
} = useTableColumnControl(tableColumns)
|
||||||
|
|
||||||
// ????
|
// 搜索表单
|
||||||
const searchForm = reactive({
|
const searchForm = reactive({
|
||||||
effectiveMoney: undefined as number | undefined,
|
effectiveMoney: undefined as number | undefined,
|
||||||
isLiveNum: undefined as boolean | undefined,
|
isLiveNum: undefined as boolean | undefined,
|
||||||
@@ -324,20 +324,20 @@ const searchForm = reactive({
|
|||||||
roomNo: ''
|
roomNo: ''
|
||||||
})
|
})
|
||||||
|
|
||||||
// ??????
|
// 初始化表单
|
||||||
const initForm = reactive({
|
const initForm = reactive({
|
||||||
costMoney: 0
|
costMoney: 0
|
||||||
})
|
})
|
||||||
|
|
||||||
// ??????????
|
// 初始化表单规则
|
||||||
const initRules = {
|
const initRules = {
|
||||||
costMoney: [
|
costMoney: [
|
||||||
{ required: true, message: '???????', trigger: 'blur' },
|
{ required: true, message: '请输入消费金额', trigger: 'blur' },
|
||||||
{ type: 'number', min: 0, message: '??????????0', trigger: 'blur' }
|
{ type: 'number', min: 0, message: '消费金额必须大于等于0', trigger: 'blur' }
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
|
|
||||||
// ?? useTable
|
// 使用 useTable
|
||||||
const state: BasicTableProps = reactive<BasicTableProps>({
|
const state: BasicTableProps = reactive<BasicTableProps>({
|
||||||
queryForm: searchForm,
|
queryForm: searchForm,
|
||||||
pageList: fetchList,
|
pageList: fetchList,
|
||||||
@@ -357,12 +357,12 @@ const {
|
|||||||
tableStyle
|
tableStyle
|
||||||
} = useTable(state)
|
} = useTable(state)
|
||||||
|
|
||||||
// ??
|
// 查询
|
||||||
const handleSearch = () => {
|
const handleSearch = () => {
|
||||||
getDataList()
|
getDataList()
|
||||||
}
|
}
|
||||||
|
|
||||||
// ??
|
// 重置
|
||||||
const handleReset = () => {
|
const handleReset = () => {
|
||||||
searchFormRef.value?.formRef?.resetFields()
|
searchFormRef.value?.formRef?.resetFields()
|
||||||
searchForm.effectiveMoney = undefined
|
searchForm.effectiveMoney = undefined
|
||||||
@@ -372,43 +372,43 @@ const handleReset = () => {
|
|||||||
getDataList()
|
getDataList()
|
||||||
}
|
}
|
||||||
|
|
||||||
// ??
|
// 编辑
|
||||||
const handleEdit = (row: any) => {
|
const handleEdit = (row: any) => {
|
||||||
formDialogRef.value.openDialog('edit', row)
|
formDialogRef.value.openDialog('edit', row)
|
||||||
}
|
}
|
||||||
|
|
||||||
// ????
|
// 查看详情
|
||||||
const handleViewDetail = (row: any) => {
|
const handleViewDetail = (row: any) => {
|
||||||
detailDialogRef.value.openDialog(row.roomNo)
|
detailDialogRef.value.openDialog(row.roomNo)
|
||||||
}
|
}
|
||||||
|
|
||||||
// ??
|
// 删除
|
||||||
const handleDelete = async (row: any) => {
|
const handleDelete = async (row: any) => {
|
||||||
try {
|
try {
|
||||||
await useMessageBox().confirm('???????????')
|
await useMessageBox().confirm('确定要删除该记录吗?')
|
||||||
await delObjs([row.id])
|
await delObjs([row.id])
|
||||||
useMessage().success('????')
|
useMessage().success('删除成功')
|
||||||
getDataList()
|
getDataList()
|
||||||
} catch (err: any) {
|
} catch (err: any) {
|
||||||
if (err !== 'cancel') {
|
if (err !== 'cancel') {
|
||||||
useMessage().error(err.msg || '????')
|
useMessage().error(err.msg || '删除失败')
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// ??
|
// 导出
|
||||||
const handleExport = () => {
|
const handleExport = () => {
|
||||||
// TODO: ????
|
// TODO: 实现导出
|
||||||
useMessage().warning('???????')
|
useMessage().warning('功能开发中')
|
||||||
}
|
}
|
||||||
|
|
||||||
// ??????????
|
// 批量初始化订单
|
||||||
const handleInitWaterOrder = () => {
|
const handleInitWaterOrder = () => {
|
||||||
initDialogVisible.value = true
|
initDialogVisible.value = true
|
||||||
initForm.costMoney = 0
|
initForm.costMoney = 0
|
||||||
}
|
}
|
||||||
|
|
||||||
// ??????
|
// 确认初始化
|
||||||
const confirmInit = async () => {
|
const confirmInit = async () => {
|
||||||
if (!initFormRef.value) return
|
if (!initFormRef.value) return
|
||||||
|
|
||||||
@@ -418,18 +418,18 @@ const confirmInit = async () => {
|
|||||||
initLoading.value = true
|
initLoading.value = true
|
||||||
try {
|
try {
|
||||||
await initWaterOrder({ costMoney: initForm.costMoney })
|
await initWaterOrder({ costMoney: initForm.costMoney })
|
||||||
useMessage().success('?????')
|
useMessage().success('初始化成功')
|
||||||
initDialogVisible.value = false
|
initDialogVisible.value = false
|
||||||
getDataList()
|
getDataList()
|
||||||
} catch (err: any) {
|
} catch (err: any) {
|
||||||
useMessage().error(err.msg || '?????')
|
useMessage().error(err.msg || '初始化失败')
|
||||||
} finally {
|
} finally {
|
||||||
initLoading.value = false
|
initLoading.value = false
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
// ??????
|
// 获取楼号列表
|
||||||
const getBuildingListData = async () => {
|
const getBuildingListData = async () => {
|
||||||
try {
|
try {
|
||||||
const res = await getBuildingList()
|
const res = await getBuildingList()
|
||||||
@@ -441,7 +441,7 @@ const getBuildingListData = async () => {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// ????
|
// 初始化
|
||||||
onMounted(() => {
|
onMounted(() => {
|
||||||
getBuildingListData()
|
getBuildingListData()
|
||||||
nextTick(() => {
|
nextTick(() => {
|
||||||
@@ -454,4 +454,3 @@ onMounted(() => {
|
|||||||
<style scoped lang="scss">
|
<style scoped lang="scss">
|
||||||
@import '/@/assets/styles/modern-page.scss';
|
@import '/@/assets/styles/modern-page.scss';
|
||||||
</style>
|
</style>
|
||||||
|
|
||||||
|
|||||||
@@ -1,28 +1,28 @@
|
|||||||
<template>
|
<template>
|
||||||
<div class="modern-page-container">
|
<div class="modern-page-container">
|
||||||
<div class="page-wrapper">
|
<div class="page-wrapper">
|
||||||
<!-- ?????? -->
|
<!-- 查询条件 -->
|
||||||
<el-card v-show="showSearch" class="search-card" shadow="never">
|
<el-card v-show="showSearch" class="search-card" shadow="never">
|
||||||
<template #header>
|
<template #header>
|
||||||
<div class="card-header">
|
<div class="card-header">
|
||||||
<span class="card-title">
|
<span class="card-title">
|
||||||
<el-icon class="title-icon"><Search /></el-icon>
|
<el-icon class="title-icon"><Search /></el-icon>
|
||||||
?????
|
查询条件
|
||||||
</span>
|
</span>
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
<el-form :model="searchForm" ref="searchFormRef" :inline="true" @keyup.enter="handleSearch" class="search-form">
|
<el-form :model="searchForm" ref="searchFormRef" :inline="true" @keyup.enter="handleSearch" class="search-form">
|
||||||
<el-form-item label="???" prop="roomNo">
|
<el-form-item label="宿舍号" prop="roomNo">
|
||||||
<el-input
|
<el-input
|
||||||
v-model="searchForm.roomNo"
|
v-model="searchForm.roomNo"
|
||||||
placeholder="??????"
|
placeholder="请输入宿舍号"
|
||||||
clearable
|
clearable
|
||||||
style="width: 200px" />
|
style="width: 200px" />
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item label="??" prop="year">
|
<el-form-item label="学年" prop="year">
|
||||||
<el-select
|
<el-select
|
||||||
v-model="searchForm.year"
|
v-model="searchForm.year"
|
||||||
placeholder="?????"
|
placeholder="请选择学年"
|
||||||
clearable
|
clearable
|
||||||
filterable
|
filterable
|
||||||
style="width: 200px">
|
style="width: 200px">
|
||||||
@@ -34,10 +34,10 @@
|
|||||||
</el-option>
|
</el-option>
|
||||||
</el-select>
|
</el-select>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item label="??" prop="period">
|
<el-form-item label="学期" prop="period">
|
||||||
<el-select
|
<el-select
|
||||||
v-model="searchForm.period"
|
v-model="searchForm.period"
|
||||||
placeholder="?????"
|
placeholder="请选择学期"
|
||||||
clearable
|
clearable
|
||||||
style="width: 200px">
|
style="width: 200px">
|
||||||
<el-option
|
<el-option
|
||||||
@@ -49,26 +49,26 @@
|
|||||||
</el-select>
|
</el-select>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item>
|
<el-form-item>
|
||||||
<el-button type="primary" plain icon="Search" @click="handleSearch">??</el-button>
|
<el-button type="primary" plain icon="Search" @click="handleSearch">查询</el-button>
|
||||||
<el-button icon="Refresh" @click="handleReset">??</el-button>
|
<el-button icon="Refresh" @click="handleReset">重置</el-button>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
</el-form>
|
</el-form>
|
||||||
</el-card>
|
</el-card>
|
||||||
|
|
||||||
<!-- ???? -->
|
<!-- 数据列表 -->
|
||||||
<el-card class="content-card" shadow="never">
|
<el-card class="content-card" shadow="never">
|
||||||
<template #header>
|
<template #header>
|
||||||
<div class="card-header">
|
<div class="card-header">
|
||||||
<span class="card-title">
|
<span class="card-title">
|
||||||
<el-icon class="title-icon"><Document /></el-icon>
|
<el-icon class="title-icon"><Document /></el-icon>
|
||||||
??????
|
水费订单列表
|
||||||
</span>
|
</span>
|
||||||
<div class="header-actions">
|
<div class="header-actions">
|
||||||
<el-button
|
<el-button
|
||||||
icon="FolderAdd"
|
icon="FolderAdd"
|
||||||
type="primary"
|
type="primary"
|
||||||
@click="formDialogRef.openDialog()">
|
@click="formDialogRef.openDialog()">
|
||||||
????
|
新增订单
|
||||||
</el-button>
|
</el-button>
|
||||||
<right-toolbar
|
<right-toolbar
|
||||||
v-model:showSearch="showSearch"
|
v-model:showSearch="showSearch"
|
||||||
@@ -84,7 +84,7 @@
|
|||||||
@order-change="handleColumnOrderChange"
|
@order-change="handleColumnOrderChange"
|
||||||
>
|
>
|
||||||
<template #trigger>
|
<template #trigger>
|
||||||
<el-tooltip class="item" effect="dark" content="???" placement="top">
|
<el-tooltip class="item" effect="dark" content="列设置" placement="top">
|
||||||
<el-button circle style="margin-left: 0;">
|
<el-button circle style="margin-left: 0;">
|
||||||
<el-icon><Menu /></el-icon>
|
<el-icon><Menu /></el-icon>
|
||||||
</el-button>
|
</el-button>
|
||||||
@@ -96,7 +96,7 @@
|
|||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<!-- ?? -->
|
<!-- 表格 -->
|
||||||
<el-table
|
<el-table
|
||||||
:data="state.dataList"
|
:data="state.dataList"
|
||||||
v-loading="state.loading"
|
v-loading="state.loading"
|
||||||
@@ -105,7 +105,7 @@
|
|||||||
:header-cell-style="tableStyle.headerCellStyle"
|
:header-cell-style="tableStyle.headerCellStyle"
|
||||||
class="modern-table"
|
class="modern-table"
|
||||||
@sort-change="sortChangeHandle">
|
@sort-change="sortChangeHandle">
|
||||||
<el-table-column type="index" label="??" width="70" align="center">
|
<el-table-column type="index" label="序号" width="70" align="center">
|
||||||
<template #header>
|
<template #header>
|
||||||
<el-icon><List /></el-icon>
|
<el-icon><List /></el-icon>
|
||||||
</template>
|
</template>
|
||||||
@@ -115,7 +115,7 @@
|
|||||||
</el-table-column>
|
</el-table-column>
|
||||||
<template v-for="col in visibleColumnsSorted" :key="col.prop || col.label">
|
<template v-for="col in visibleColumnsSorted" :key="col.prop || col.label">
|
||||||
<el-table-column
|
<el-table-column
|
||||||
v-if="checkColumnVisible(col.prop || '') && col.prop !== '??'"
|
v-if="checkColumnVisible(col.prop || '') && col.prop !== '序号'"
|
||||||
:prop="col.prop"
|
:prop="col.prop"
|
||||||
:label="col.label"
|
:label="col.label"
|
||||||
show-overflow-tooltip
|
show-overflow-tooltip
|
||||||
@@ -124,40 +124,40 @@
|
|||||||
<el-icon><component :is="columnConfigMap[col.prop]?.icon || Calendar" /></el-icon>
|
<el-icon><component :is="columnConfigMap[col.prop]?.icon || Calendar" /></el-icon>
|
||||||
<span style="margin-left: 4px">{{ col.label }}</span>
|
<span style="margin-left: 4px">{{ col.label }}</span>
|
||||||
</template>
|
</template>
|
||||||
<!-- ????????-->
|
<!-- 学期格式化-->
|
||||||
<template v-if="col.prop === 'period'" #default="scope">
|
<template v-if="col.prop === 'period'" #default="scope">
|
||||||
<el-tag size="small" type="primary" effect="plain">
|
<el-tag size="small" type="primary" effect="plain">
|
||||||
{{ formatSchoolTerm(scope.row.period) }}
|
{{ formatSchoolTerm(scope.row.period) }}
|
||||||
</el-tag>
|
</el-tag>
|
||||||
</template>
|
</template>
|
||||||
<!-- ????????-->
|
<!-- 类型格式化-->
|
||||||
<template v-else-if="col.prop === 'type'" #default="scope">
|
<template v-else-if="col.prop === 'type'" #default="scope">
|
||||||
<el-tag size="small" type="info" effect="plain">
|
<el-tag size="small" type="info" effect="plain">
|
||||||
{{ formatType(scope.row.type) }}
|
{{ formatType(scope.row.type) }}
|
||||||
</el-tag>
|
</el-tag>
|
||||||
</template>
|
</template>
|
||||||
<!-- ????????? -->
|
<!-- 支付方式格式化 -->
|
||||||
<template v-else-if="col.prop === 'paymentCode'" #default="scope">
|
<template v-else-if="col.prop === 'paymentCode'" #default="scope">
|
||||||
<el-tag size="small" type="warning" effect="plain">
|
<el-tag size="small" type="warning" effect="plain">
|
||||||
{{ formatPaymentType(scope.row.paymentCode) }}
|
{{ formatPaymentType(scope.row.paymentCode) }}
|
||||||
</el-tag>
|
</el-tag>
|
||||||
</template>
|
</template>
|
||||||
<!-- ????????-->
|
<!-- 金额格式化-->
|
||||||
<template v-else-if="col.prop === 'money'" #default="scope">
|
<template v-else-if="col.prop === 'money'" #default="scope">
|
||||||
<el-tag v-if="scope.row.money" size="small" type="success" effect="plain">
|
<el-tag v-if="scope.row.money" size="small" type="success" effect="plain">
|
||||||
?{{ scope.row.money }}
|
¥{{ scope.row.money }}
|
||||||
</el-tag>
|
</el-tag>
|
||||||
<span v-else>-</span>
|
<span v-else>-</span>
|
||||||
</template>
|
</template>
|
||||||
<!-- ????????? -->
|
<!-- 充值状态格式化 -->
|
||||||
<template v-else-if="col.prop === 'chargeState'" #default="scope">
|
<template v-else-if="col.prop === 'chargeState'" #default="scope">
|
||||||
<StatusTag
|
<StatusTag
|
||||||
:value="scope.row.chargeState"
|
:value="scope.row.chargeState"
|
||||||
:options="[{ label: '??', value: '1' }, { label: '??', value: '0' }]"
|
:options="[{ label: '已充值', value: '1' }, { label: '未充值', value: '0' }]"
|
||||||
:type-map="{ '1': { type: 'success', effect: 'light' }, '0': { type: 'danger', effect: 'light' } }"
|
:type-map="{ '1': { type: 'success', effect: 'light' }, '0': { type: 'danger', effect: 'light' } }"
|
||||||
/>
|
/>
|
||||||
</template>
|
</template>
|
||||||
<!-- ??????? -->
|
<!-- 订单状态 -->
|
||||||
<template v-else-if="col.prop === 'state'" #default="scope">
|
<template v-else-if="col.prop === 'state'" #default="scope">
|
||||||
<el-tag size="small" type="info" effect="plain">
|
<el-tag size="small" type="info" effect="plain">
|
||||||
{{ formatState(scope.row.state) }}
|
{{ formatState(scope.row.state) }}
|
||||||
@@ -165,10 +165,10 @@
|
|||||||
</template>
|
</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
</template>
|
</template>
|
||||||
<el-table-column label="??" width="150" align="center" fixed="right">
|
<el-table-column label="操作" width="150" align="center" fixed="right">
|
||||||
<template #header>
|
<template #header>
|
||||||
<el-icon><Setting /></el-icon>
|
<el-icon><Setting /></el-icon>
|
||||||
<span style="margin-left: 4px">??</span>
|
<span style="margin-left: 4px">操作</span>
|
||||||
</template>
|
</template>
|
||||||
<template #default="scope">
|
<template #default="scope">
|
||||||
<el-button
|
<el-button
|
||||||
@@ -176,20 +176,20 @@
|
|||||||
link
|
link
|
||||||
type="primary"
|
type="primary"
|
||||||
@click="handleEdit(scope.row)">
|
@click="handleEdit(scope.row)">
|
||||||
??
|
编辑
|
||||||
</el-button>
|
</el-button>
|
||||||
<el-button
|
<el-button
|
||||||
icon="Delete"
|
icon="Delete"
|
||||||
link
|
link
|
||||||
type="danger"
|
type="danger"
|
||||||
@click="handleDelete(scope.row)">
|
@click="handleDelete(scope.row)">
|
||||||
??
|
删除
|
||||||
</el-button>
|
</el-button>
|
||||||
</template>
|
</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
</el-table>
|
</el-table>
|
||||||
|
|
||||||
<!-- ?? -->
|
<!-- 分页 -->
|
||||||
<div class="pagination-wrapper">
|
<div class="pagination-wrapper">
|
||||||
<pagination
|
<pagination
|
||||||
@size-change="sizeChangeHandle"
|
@size-change="sizeChangeHandle"
|
||||||
@@ -199,7 +199,7 @@
|
|||||||
</el-card>
|
</el-card>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<!-- ???? -->
|
<!-- 新增/编辑对话框 -->
|
||||||
<FormDialog ref="formDialogRef" @refresh="getDataList()" />
|
<FormDialog ref="formDialogRef" @refresh="getDataList()" />
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
@@ -220,7 +220,7 @@ import { useTableColumnControl } from '/@/hooks/tableColumn'
|
|||||||
import { defineAsyncComponent } from 'vue'
|
import { defineAsyncComponent } from 'vue'
|
||||||
const StatusTag = defineAsyncComponent(() => import('/@/components/StatusTag/index.vue'))
|
const StatusTag = defineAsyncComponent(() => import('/@/components/StatusTag/index.vue'))
|
||||||
|
|
||||||
// ??????
|
// 定义变量
|
||||||
const route = useRoute()
|
const route = useRoute()
|
||||||
const searchFormRef = ref()
|
const searchFormRef = ref()
|
||||||
const columnControlRef = ref<any>()
|
const columnControlRef = ref<any>()
|
||||||
@@ -233,22 +233,22 @@ const paymentTypeList = ref<any[]>([])
|
|||||||
const chargeStateList = ref<any[]>([])
|
const chargeStateList = ref<any[]>([])
|
||||||
const stateList = ref<any[]>([])
|
const stateList = ref<any[]>([])
|
||||||
|
|
||||||
// ??????
|
// 表格列配置
|
||||||
const tableColumns = [
|
const tableColumns = [
|
||||||
{ prop: 'roomNo', label: '???' },
|
{ prop: 'roomNo', label: '宿舍号' },
|
||||||
{ prop: 'year', label: '??' },
|
{ prop: 'year', label: '学年' },
|
||||||
{ prop: 'period', label: '??' },
|
{ prop: 'period', label: '学期' },
|
||||||
{ prop: 'orderNum', label: '???' },
|
{ prop: 'orderNum', label: '订单号' },
|
||||||
{ prop: 'type', label: '??' },
|
{ prop: 'type', label: '类型' },
|
||||||
{ prop: 'paymentCode', label: '????' },
|
{ prop: 'paymentCode', label: '支付方式' },
|
||||||
{ prop: 'money', label: '??' },
|
{ prop: 'money', label: '金额' },
|
||||||
{ prop: 'chargeAccount', label: '??????' },
|
{ prop: 'chargeAccount', label: '充值账号' },
|
||||||
{ prop: 'chargeRealname', label: '????????' },
|
{ prop: 'chargeRealname', label: '充值人姓名' },
|
||||||
{ prop: 'chargeState', label: '????' },
|
{ prop: 'chargeState', label: '充值状态' },
|
||||||
{ prop: 'state', label: '??' }
|
{ prop: 'state', label: '状态' }
|
||||||
]
|
]
|
||||||
|
|
||||||
// ????????????
|
// 列配置映射
|
||||||
const columnConfigMap: Record<string, { icon: any }> = {
|
const columnConfigMap: Record<string, { icon: any }> = {
|
||||||
roomNo: { icon: House },
|
roomNo: { icon: House },
|
||||||
year: { icon: Calendar },
|
year: { icon: Calendar },
|
||||||
@@ -263,23 +263,23 @@ const columnConfigMap: Record<string, { icon: any }> = {
|
|||||||
state: { icon: CircleCheck }
|
state: { icon: CircleCheck }
|
||||||
}
|
}
|
||||||
|
|
||||||
// ???????hook
|
// 表格列控制hook
|
||||||
const {
|
const {
|
||||||
visibleColumns,
|
visibleColumns,
|
||||||
visibleColumnsSorted,
|
visibleColumnsSorted,
|
||||||
checkColumnVisible,
|
checkColumnVisible,
|
||||||
handleColumnChange,
|
handleColumnChange,
|
||||||
handleColumnOrderChange
|
handleColumnOrderChange
|
||||||
} = useTableColumnControl(tableColumns, route.path)
|
} = useTableColumnControl(tableColumns)
|
||||||
|
|
||||||
// ????
|
// 搜索表单
|
||||||
const searchForm = reactive({
|
const searchForm = reactive({
|
||||||
roomNo: '',
|
roomNo: '',
|
||||||
year: '',
|
year: '',
|
||||||
period: ''
|
period: ''
|
||||||
})
|
})
|
||||||
|
|
||||||
// ?? useTable
|
// 使用 useTable
|
||||||
const state: BasicTableProps = reactive<BasicTableProps>({
|
const state: BasicTableProps = reactive<BasicTableProps>({
|
||||||
queryForm: searchForm,
|
queryForm: searchForm,
|
||||||
pageList: fetchList,
|
pageList: fetchList,
|
||||||
@@ -299,12 +299,12 @@ const {
|
|||||||
tableStyle
|
tableStyle
|
||||||
} = useTable(state)
|
} = useTable(state)
|
||||||
|
|
||||||
// ??
|
// 查询
|
||||||
const handleSearch = () => {
|
const handleSearch = () => {
|
||||||
getDataList()
|
getDataList()
|
||||||
}
|
}
|
||||||
|
|
||||||
// ??
|
// 重置
|
||||||
const handleReset = () => {
|
const handleReset = () => {
|
||||||
searchFormRef.value?.formRef?.resetFields()
|
searchFormRef.value?.formRef?.resetFields()
|
||||||
searchForm.roomNo = ''
|
searchForm.roomNo = ''
|
||||||
@@ -313,27 +313,27 @@ const handleReset = () => {
|
|||||||
getDataList()
|
getDataList()
|
||||||
}
|
}
|
||||||
|
|
||||||
// ??
|
// 编辑
|
||||||
const handleEdit = (row: any) => {
|
const handleEdit = (row: any) => {
|
||||||
formDialogRef.value.openDialog('edit', row)
|
formDialogRef.value.openDialog('edit', row)
|
||||||
}
|
}
|
||||||
|
|
||||||
// ??
|
// 删除
|
||||||
const handleDelete = async (row: any) => {
|
const handleDelete = async (row: any) => {
|
||||||
try {
|
try {
|
||||||
await useMessageBox().confirm('??????????')
|
await useMessageBox().confirm('确定要删除该订单吗?')
|
||||||
const { delObjs } = await import("/@/api/stuwork/waterorder")
|
const { delObjs } = await import("/@/api/stuwork/waterorder")
|
||||||
await delObjs([row.id])
|
await delObjs([row.id])
|
||||||
useMessage().success('????')
|
useMessage().success('删除成功')
|
||||||
getDataList()
|
getDataList()
|
||||||
} catch (err: any) {
|
} catch (err: any) {
|
||||||
if (err !== 'cancel') {
|
if (err !== 'cancel') {
|
||||||
useMessage().error(err.msg || '????')
|
useMessage().error(err.msg || '删除失败')
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// ??????
|
// 格式化学期
|
||||||
const formatSchoolTerm = (value: string | number) => {
|
const formatSchoolTerm = (value: string | number) => {
|
||||||
if (value === null || value === undefined || value === '') {
|
if (value === null || value === undefined || value === '') {
|
||||||
return '-'
|
return '-'
|
||||||
@@ -342,7 +342,7 @@ const formatSchoolTerm = (value: string | number) => {
|
|||||||
return dictItem ? dictItem.label : value
|
return dictItem ? dictItem.label : value
|
||||||
}
|
}
|
||||||
|
|
||||||
// ??????
|
// 格式化类型
|
||||||
const formatType = (value: string | number) => {
|
const formatType = (value: string | number) => {
|
||||||
if (value === null || value === undefined || value === '') {
|
if (value === null || value === undefined || value === '') {
|
||||||
return '-'
|
return '-'
|
||||||
@@ -351,7 +351,7 @@ const formatType = (value: string | number) => {
|
|||||||
return dictItem ? dictItem.label : value
|
return dictItem ? dictItem.label : value
|
||||||
}
|
}
|
||||||
|
|
||||||
// ????????
|
// 格式化支付方式
|
||||||
const formatPaymentType = (value: string | number) => {
|
const formatPaymentType = (value: string | number) => {
|
||||||
if (value === null || value === undefined || value === '') {
|
if (value === null || value === undefined || value === '') {
|
||||||
return '-'
|
return '-'
|
||||||
@@ -360,7 +360,7 @@ const formatPaymentType = (value: string | number) => {
|
|||||||
return dictItem ? dictItem.label : value
|
return dictItem ? dictItem.label : value
|
||||||
}
|
}
|
||||||
|
|
||||||
// ????????
|
// 格式化充值状态
|
||||||
const formatChargeState = (value: string | number) => {
|
const formatChargeState = (value: string | number) => {
|
||||||
if (value === null || value === undefined || value === '') {
|
if (value === null || value === undefined || value === '') {
|
||||||
return '-'
|
return '-'
|
||||||
@@ -369,7 +369,7 @@ const formatChargeState = (value: string | number) => {
|
|||||||
return dictItem ? dictItem.label : value
|
return dictItem ? dictItem.label : value
|
||||||
}
|
}
|
||||||
|
|
||||||
// ??????
|
// 格式化状态
|
||||||
const formatState = (value: string | number) => {
|
const formatState = (value: string | number) => {
|
||||||
if (value === null || value === undefined || value === '') {
|
if (value === null || value === undefined || value === '') {
|
||||||
return '-'
|
return '-'
|
||||||
@@ -378,7 +378,7 @@ const formatState = (value: string | number) => {
|
|||||||
return dictItem ? dictItem.label : value
|
return dictItem ? dictItem.label : value
|
||||||
}
|
}
|
||||||
|
|
||||||
// ??????
|
// 获取学年列表
|
||||||
const getSchoolYearList = async () => {
|
const getSchoolYearList = async () => {
|
||||||
try {
|
try {
|
||||||
const res = await queryAllSchoolYear()
|
const res = await queryAllSchoolYear()
|
||||||
@@ -390,7 +390,7 @@ const getSchoolYearList = async () => {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// ??????
|
// 获取学期字典
|
||||||
const getSchoolTermDict = async () => {
|
const getSchoolTermDict = async () => {
|
||||||
try {
|
try {
|
||||||
const res = await getDicts('school_term')
|
const res = await getDicts('school_term')
|
||||||
@@ -405,7 +405,7 @@ const getSchoolTermDict = async () => {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// ??????
|
// 获取类型字典
|
||||||
const getTypeDict = async () => {
|
const getTypeDict = async () => {
|
||||||
try {
|
try {
|
||||||
const res = await getDicts('dorm_water_source_type')
|
const res = await getDicts('dorm_water_source_type')
|
||||||
@@ -420,7 +420,7 @@ const getTypeDict = async () => {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// ?????????
|
// 获取支付方式字典
|
||||||
const getPaymentTypeDict = async () => {
|
const getPaymentTypeDict = async () => {
|
||||||
try {
|
try {
|
||||||
const res = await getDicts('dorm_water_payment_type')
|
const res = await getDicts('dorm_water_payment_type')
|
||||||
@@ -435,7 +435,7 @@ const getPaymentTypeDict = async () => {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// ?????????
|
// 获取充值状态字典
|
||||||
const getChargeStateDict = async () => {
|
const getChargeStateDict = async () => {
|
||||||
try {
|
try {
|
||||||
const res = await getDicts('dorm_water_charge_state')
|
const res = await getDicts('dorm_water_charge_state')
|
||||||
@@ -450,7 +450,7 @@ const getChargeStateDict = async () => {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// ???????
|
// 获取状态字典
|
||||||
const getStateDict = async () => {
|
const getStateDict = async () => {
|
||||||
try {
|
try {
|
||||||
const res = await getDicts('dorm_water_state')
|
const res = await getDicts('dorm_water_state')
|
||||||
@@ -465,7 +465,7 @@ const getStateDict = async () => {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// ????
|
// 初始化
|
||||||
onMounted(() => {
|
onMounted(() => {
|
||||||
getSchoolYearList()
|
getSchoolYearList()
|
||||||
getSchoolTermDict()
|
getSchoolTermDict()
|
||||||
|
|||||||
@@ -1,21 +1,21 @@
|
|||||||
<template>
|
<template>
|
||||||
<div class="modern-page-container">
|
<div class="modern-page-container">
|
||||||
<div class="page-wrapper">
|
<div class="page-wrapper">
|
||||||
<!-- ?????? -->
|
<!-- 查询条件 -->
|
||||||
<el-card v-show="showSearch" class="search-card" shadow="never">
|
<el-card v-show="showSearch" class="search-card" shadow="never">
|
||||||
<template #header>
|
<template #header>
|
||||||
<div class="card-header">
|
<div class="card-header">
|
||||||
<span class="card-title">
|
<span class="card-title">
|
||||||
<el-icon class="title-icon"><Search /></el-icon>
|
<el-icon class="title-icon"><Search /></el-icon>
|
||||||
????
|
查询条件
|
||||||
</span>
|
</span>
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
<el-form :model="searchForm" ref="searchFormRef" :inline="true" @keyup.enter="handleSearch" class="search-form">
|
<el-form :model="searchForm" ref="searchFormRef" :inline="true" @keyup.enter="handleSearch" class="search-form">
|
||||||
<el-form-item label="??" prop="deptCode">
|
<el-form-item label="学院" prop="deptCode">
|
||||||
<el-select
|
<el-select
|
||||||
v-model="searchForm.deptCode"
|
v-model="searchForm.deptCode"
|
||||||
placeholder="?????"
|
placeholder="请选择学院"
|
||||||
clearable
|
clearable
|
||||||
filterable
|
filterable
|
||||||
style="width: 200px"
|
style="width: 200px"
|
||||||
@@ -28,10 +28,10 @@
|
|||||||
</el-option>
|
</el-option>
|
||||||
</el-select>
|
</el-select>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item label="??" prop="classCode">
|
<el-form-item label="班级" prop="classCode">
|
||||||
<el-select
|
<el-select
|
||||||
v-model="searchForm.classCode"
|
v-model="searchForm.classCode"
|
||||||
placeholder="?????"
|
placeholder="请选择班级"
|
||||||
clearable
|
clearable
|
||||||
filterable
|
filterable
|
||||||
style="width: 200px">
|
style="width: 200px">
|
||||||
@@ -43,31 +43,31 @@
|
|||||||
</el-option>
|
</el-option>
|
||||||
</el-select>
|
</el-select>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item label="??" prop="source">
|
<el-form-item label="来源" prop="source">
|
||||||
<el-select
|
<el-select
|
||||||
v-model="searchForm.source"
|
v-model="searchForm.source"
|
||||||
placeholder="?????"
|
placeholder="请选择来源"
|
||||||
clearable
|
clearable
|
||||||
style="width: 200px"
|
style="width: 200px"
|
||||||
@change="handleSourceChange">
|
@change="handleSourceChange">
|
||||||
<el-option label="????" value="history" />
|
<el-option label="历史记录" value="history" />
|
||||||
<el-option label="??" value="attendance" />
|
<el-option label="考勤" value="attendance" />
|
||||||
</el-select>
|
</el-select>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item>
|
<el-form-item>
|
||||||
<el-button type="primary" plain icon="Search" @click="handleSearch">??</el-button>
|
<el-button type="primary" plain icon="Search" @click="handleSearch">查询</el-button>
|
||||||
<el-button icon="Refresh" @click="handleReset">??</el-button>
|
<el-button icon="Refresh" @click="handleReset">重置</el-button>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
</el-form>
|
</el-form>
|
||||||
</el-card>
|
</el-card>
|
||||||
|
|
||||||
<!-- ???? -->
|
<!-- 数据列表 -->
|
||||||
<el-card class="content-card" shadow="never">
|
<el-card class="content-card" shadow="never">
|
||||||
<template #header>
|
<template #header>
|
||||||
<div class="card-header">
|
<div class="card-header">
|
||||||
<span class="card-title">
|
<span class="card-title">
|
||||||
<el-icon class="title-icon"><Document /></el-icon>
|
<el-icon class="title-icon"><Document /></el-icon>
|
||||||
????????
|
工学交替考勤列表
|
||||||
</span>
|
</span>
|
||||||
<div class="header-actions">
|
<div class="header-actions">
|
||||||
<right-toolbar
|
<right-toolbar
|
||||||
@@ -84,7 +84,7 @@
|
|||||||
@order-change="handleColumnOrderChange"
|
@order-change="handleColumnOrderChange"
|
||||||
>
|
>
|
||||||
<template #trigger>
|
<template #trigger>
|
||||||
<el-tooltip class="item" effect="dark" content="???" placement="top">
|
<el-tooltip class="item" effect="dark" content="列设置" placement="top">
|
||||||
<el-button circle style="margin-left: 0;">
|
<el-button circle style="margin-left: 0;">
|
||||||
<el-icon><Menu /></el-icon>
|
<el-icon><Menu /></el-icon>
|
||||||
</el-button>
|
</el-button>
|
||||||
@@ -96,7 +96,7 @@
|
|||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<!-- ?? -->
|
<!-- 表格 -->
|
||||||
<el-table
|
<el-table
|
||||||
:data="state.dataList"
|
:data="state.dataList"
|
||||||
v-loading="state.loading"
|
v-loading="state.loading"
|
||||||
@@ -104,7 +104,7 @@
|
|||||||
:cell-style="tableStyle.cellStyle"
|
:cell-style="tableStyle.cellStyle"
|
||||||
:header-cell-style="tableStyle.headerCellStyle"
|
:header-cell-style="tableStyle.headerCellStyle"
|
||||||
class="modern-table">
|
class="modern-table">
|
||||||
<el-table-column type="index" label="??" width="70" align="center">
|
<el-table-column type="index" label="序号" width="70" align="center">
|
||||||
<template #header>
|
<template #header>
|
||||||
<el-icon><List /></el-icon>
|
<el-icon><List /></el-icon>
|
||||||
</template>
|
</template>
|
||||||
@@ -114,7 +114,7 @@
|
|||||||
</el-table-column>
|
</el-table-column>
|
||||||
<template v-for="col in visibleColumnsSorted" :key="col.prop || col.label">
|
<template v-for="col in visibleColumnsSorted" :key="col.prop || col.label">
|
||||||
<el-table-column
|
<el-table-column
|
||||||
v-if="checkColumnVisible(col.prop || '') && col.prop !== '??'"
|
v-if="checkColumnVisible(col.prop || '') && col.prop !== '序号'"
|
||||||
:prop="col.prop"
|
:prop="col.prop"
|
||||||
:label="col.label"
|
:label="col.label"
|
||||||
show-overflow-tooltip
|
show-overflow-tooltip
|
||||||
@@ -125,28 +125,28 @@
|
|||||||
<el-icon><component :is="columnConfigMap[col.prop]?.icon || Calendar" /></el-icon>
|
<el-icon><component :is="columnConfigMap[col.prop]?.icon || Calendar" /></el-icon>
|
||||||
<span style="margin-left: 4px">{{ col.label }}</span>
|
<span style="margin-left: 4px">{{ col.label }}</span>
|
||||||
</template>
|
</template>
|
||||||
<!-- ??????? -->
|
<!-- 学期格式化 -->
|
||||||
<template v-if="col.prop === 'schoolTerm'" #default="scope">
|
<template v-if="col.prop === 'schoolTerm'" #default="scope">
|
||||||
<el-tag size="small" type="primary" effect="plain">
|
<el-tag size="small" type="primary" effect="plain">
|
||||||
{{ formatSchoolTerm(scope.row.schoolTerm) }}
|
{{ formatSchoolTerm(scope.row.schoolTerm) }}
|
||||||
</el-tag>
|
</el-tag>
|
||||||
</template>
|
</template>
|
||||||
<!-- ????????? -->
|
<!-- 考勤类型格式化 -->
|
||||||
<template v-else-if="col.prop === 'attendanceType'" #default="scope">
|
<template v-else-if="col.prop === 'attendanceType'" #default="scope">
|
||||||
<el-tag size="small" type="warning" effect="plain">
|
<el-tag size="small" type="warning" effect="plain">
|
||||||
{{ formatAttendanceType(scope.row.attendanceType) }}
|
{{ formatAttendanceType(scope.row.attendanceType) }}
|
||||||
</el-tag>
|
</el-tag>
|
||||||
</template>
|
</template>
|
||||||
<!-- ????????? -->
|
<!-- 备注格式化 -->
|
||||||
<template v-else-if="col.prop === 'remarks'" #default="scope">
|
<template v-else-if="col.prop === 'remarks'" #default="scope">
|
||||||
<span>{{ scope.row.remarks || '-' }}</span>
|
<span>{{ scope.row.remarks || '-' }}</span>
|
||||||
</template>
|
</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
</template>
|
</template>
|
||||||
<el-table-column label="??" width="150" align="center" fixed="right">
|
<el-table-column label="操作" width="150" align="center" fixed="right">
|
||||||
<template #header>
|
<template #header>
|
||||||
<el-icon><Setting /></el-icon>
|
<el-icon><Setting /></el-icon>
|
||||||
<span style="margin-left: 4px">??</span>
|
<span style="margin-left: 4px">操作</span>
|
||||||
</template>
|
</template>
|
||||||
<template #default="scope">
|
<template #default="scope">
|
||||||
<el-button
|
<el-button
|
||||||
@@ -154,13 +154,13 @@
|
|||||||
link
|
link
|
||||||
type="primary"
|
type="primary"
|
||||||
@click="handleView(scope.row)">
|
@click="handleView(scope.row)">
|
||||||
????
|
查看详情
|
||||||
</el-button>
|
</el-button>
|
||||||
</template>
|
</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
</el-table>
|
</el-table>
|
||||||
|
|
||||||
<!-- ?? -->
|
<!-- 分页 -->
|
||||||
<div class="pagination-wrapper">
|
<div class="pagination-wrapper">
|
||||||
<pagination
|
<pagination
|
||||||
@size-change="sizeChangeHandle"
|
@size-change="sizeChangeHandle"
|
||||||
@@ -185,30 +185,30 @@ import { List, Calendar, Clock, OfficeBuilding, Grid, Document, CreditCard, Avat
|
|||||||
import { useTableColumnControl } from '/@/hooks/tableColumn'
|
import { useTableColumnControl } from '/@/hooks/tableColumn'
|
||||||
|
|
||||||
|
|
||||||
// ??????
|
// 定义变量
|
||||||
const route = useRoute()
|
const route = useRoute()
|
||||||
const searchFormRef = ref()
|
const searchFormRef = ref()
|
||||||
const columnControlRef = ref<any>()
|
const columnControlRef = ref<any>()
|
||||||
const showSearch = ref(true)
|
const showSearch = ref(true)
|
||||||
const deptList = ref<any[]>([])
|
const deptList = ref<any[]>([])
|
||||||
const classList = ref<any[]>([])
|
const classList = ref<any[]>([])
|
||||||
const showRemarks = ref(false) // ??????????
|
const showRemarks = ref(false) // 是否显示备注列
|
||||||
|
|
||||||
// ?????
|
// 表格列配置
|
||||||
const tableColumns = [
|
const tableColumns = [
|
||||||
{ prop: 'schoolYear', label: '??' },
|
{ prop: 'schoolYear', label: '学年' },
|
||||||
{ prop: 'schoolTerm', label: '??' },
|
{ prop: 'schoolTerm', label: '学期' },
|
||||||
{ prop: 'deptName', label: '????' },
|
{ prop: 'deptName', label: '学院名称' },
|
||||||
{ prop: 'classCode', label: '????' },
|
{ prop: 'classCode', label: '班级编码' },
|
||||||
{ prop: 'classNo', label: '????' },
|
{ prop: 'classNo', label: '班级编号' },
|
||||||
{ prop: 'classProName', label: '??????', minWidth: 200 },
|
{ prop: 'classProName', label: '班级项目名称', minWidth: 200 },
|
||||||
{ prop: 'stuNo', label: '??' },
|
{ prop: 'stuNo', label: '学号' },
|
||||||
{ prop: 'realName', label: '??' },
|
{ prop: 'realName', label: '姓名' },
|
||||||
{ prop: 'attendanceType', label: '????' },
|
{ prop: 'attendanceType', label: '考勤类型' },
|
||||||
{ prop: 'remarks', label: '????', minWidth: 150 }
|
{ prop: 'remarks', label: '备注说明', minWidth: 150 }
|
||||||
]
|
]
|
||||||
|
|
||||||
// ?????????????
|
// 列配置映射
|
||||||
const columnConfigMap: Record<string, { icon: any }> = {
|
const columnConfigMap: Record<string, { icon: any }> = {
|
||||||
schoolYear: { icon: Calendar },
|
schoolYear: { icon: Calendar },
|
||||||
schoolTerm: { icon: Clock },
|
schoolTerm: { icon: Clock },
|
||||||
@@ -222,23 +222,23 @@ const columnConfigMap: Record<string, { icon: any }> = {
|
|||||||
remarks: { icon: Document }
|
remarks: { icon: Document }
|
||||||
}
|
}
|
||||||
|
|
||||||
// ??????? hook
|
// 表格列控制 hook
|
||||||
const {
|
const {
|
||||||
visibleColumns,
|
visibleColumns,
|
||||||
visibleColumnsSorted,
|
visibleColumnsSorted,
|
||||||
checkColumnVisible,
|
checkColumnVisible,
|
||||||
handleColumnChange,
|
handleColumnChange,
|
||||||
handleColumnOrderChange
|
handleColumnOrderChange
|
||||||
} = useTableColumnControl(tableColumns, route.path)
|
} = useTableColumnControl(tableColumns)
|
||||||
|
|
||||||
// ????
|
// 搜索表单
|
||||||
const searchForm = reactive({
|
const searchForm = reactive({
|
||||||
deptCode: '',
|
deptCode: '',
|
||||||
classCode: '',
|
classCode: '',
|
||||||
source: '' // ????????????
|
source: '' // 数据来源:history-历史记录,attendance-考勤记录
|
||||||
})
|
})
|
||||||
|
|
||||||
// ?? useTable
|
// 使用 useTable
|
||||||
const state: BasicTableProps = reactive<BasicTableProps>({
|
const state: BasicTableProps = reactive<BasicTableProps>({
|
||||||
queryForm: searchForm,
|
queryForm: searchForm,
|
||||||
pageList: fetchList,
|
pageList: fetchList,
|
||||||
@@ -257,26 +257,26 @@ const {
|
|||||||
tableStyle
|
tableStyle
|
||||||
} = useTable(state)
|
} = useTable(state)
|
||||||
|
|
||||||
// ???????
|
// 格式化考勤类型
|
||||||
const formatAttendanceType = (value: string | number) => {
|
const formatAttendanceType = (value: string | number) => {
|
||||||
if (value === '1' || value === 1) return '??'
|
if (value === '1' || value === 1) return '正常'
|
||||||
if (value === '2' || value === 2) return '???'
|
if (value === '2' || value === 2) return '迟到/早退'
|
||||||
if (value === '3' || value === 3) return '??'
|
if (value === '3' || value === 3) return '缺勤'
|
||||||
return '-'
|
return '-'
|
||||||
}
|
}
|
||||||
|
|
||||||
// ???????????
|
// 学院变化处理
|
||||||
const handleDeptChange = () => {
|
const handleDeptChange = () => {
|
||||||
searchForm.classCode = ''
|
searchForm.classCode = ''
|
||||||
getClassListData()
|
getClassListData()
|
||||||
}
|
}
|
||||||
|
|
||||||
// ??????
|
// 来源变化处理
|
||||||
const handleSourceChange = async (value: string) => {
|
const handleSourceChange = async (value: string) => {
|
||||||
if (value === 'history') {
|
if (value === 'history') {
|
||||||
// ???????????????
|
// 选择历史记录时显示备注列
|
||||||
showRemarks.value = true
|
showRemarks.value = true
|
||||||
// ??????????????????
|
// 查询历史记录数据
|
||||||
try {
|
try {
|
||||||
state.loading = true
|
state.loading = true
|
||||||
const params: any = {}
|
const params: any = {}
|
||||||
@@ -299,7 +299,7 @@ const handleSourceChange = async (value: string) => {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
} catch (err: any) {
|
} catch (err: any) {
|
||||||
useMessage().error(err.msg || '????????')
|
useMessage().error(err.msg || '查询失败')
|
||||||
state.dataList = []
|
state.dataList = []
|
||||||
if (state.pagination) {
|
if (state.pagination) {
|
||||||
state.pagination.total = 0
|
state.pagination.total = 0
|
||||||
@@ -308,17 +308,17 @@ const handleSourceChange = async (value: string) => {
|
|||||||
state.loading = false
|
state.loading = false
|
||||||
}
|
}
|
||||||
} else if (value === 'attendance') {
|
} else if (value === 'attendance') {
|
||||||
// ???????????????????????
|
// 选择考勤记录时隐藏备注列并刷新数据
|
||||||
showRemarks.value = false
|
showRemarks.value = false
|
||||||
getDataList()
|
getDataList()
|
||||||
} else {
|
} else {
|
||||||
// ??????????????
|
// 清空选择时隐藏备注列
|
||||||
showRemarks.value = false
|
showRemarks.value = false
|
||||||
getDataList()
|
getDataList()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// ??
|
// 查询
|
||||||
const handleSearch = () => {
|
const handleSearch = () => {
|
||||||
if (searchForm.source === 'history') {
|
if (searchForm.source === 'history') {
|
||||||
handleSourceChange('history')
|
handleSourceChange('history')
|
||||||
@@ -328,7 +328,7 @@ const handleSearch = () => {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// ??
|
// 重置
|
||||||
const handleReset = () => {
|
const handleReset = () => {
|
||||||
searchFormRef.value?.resetFields()
|
searchFormRef.value?.resetFields()
|
||||||
searchForm.deptCode = ''
|
searchForm.deptCode = ''
|
||||||
@@ -338,12 +338,12 @@ const handleReset = () => {
|
|||||||
getDataList()
|
getDataList()
|
||||||
}
|
}
|
||||||
|
|
||||||
// ????
|
// 查看详情
|
||||||
const handleView = (row: any) => {
|
const handleView = (row: any) => {
|
||||||
useMessage().warning('?????????')
|
useMessage().warning('功能开发中')
|
||||||
}
|
}
|
||||||
|
|
||||||
// ??????
|
// 获取学院列表
|
||||||
const getDeptListData = async () => {
|
const getDeptListData = async () => {
|
||||||
try {
|
try {
|
||||||
const res = await getDeptList()
|
const res = await getDeptList()
|
||||||
@@ -355,13 +355,13 @@ const getDeptListData = async () => {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// ??????
|
// 获取班级列表
|
||||||
const getClassListData = async () => {
|
const getClassListData = async () => {
|
||||||
try {
|
try {
|
||||||
const res = await getClassListByRole()
|
const res = await getClassListByRole()
|
||||||
if (res.data) {
|
if (res.data) {
|
||||||
let list = Array.isArray(res.data) ? res.data : []
|
let list = Array.isArray(res.data) ? res.data : []
|
||||||
// ??????????????
|
// 根据选择的学院筛选班级
|
||||||
if (searchForm.deptCode) {
|
if (searchForm.deptCode) {
|
||||||
list = list.filter((item: any) => item.deptCode === searchForm.deptCode)
|
list = list.filter((item: any) => item.deptCode === searchForm.deptCode)
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user