658 lines
21 KiB
Vue
658 lines
21 KiB
Vue
<template>
|
|
<div class="layout-padding">
|
|
<div class="layout-padding-auto layout-padding-view">
|
|
<!-- 搜索表单 -->
|
|
<el-row v-show="showSearch">
|
|
<el-form :model="searchForm" ref="searchFormRef" :inline="true" @keyup.enter="handleSearch">
|
|
<el-form-item label="学年" prop="schoolYear">
|
|
<el-select
|
|
v-model="searchForm.schoolYear"
|
|
placeholder="请选择学年"
|
|
clearable
|
|
filterable
|
|
style="width: 200px">
|
|
<el-option
|
|
v-for="item in schoolYearList"
|
|
:key="item.year"
|
|
:label="item.year"
|
|
:value="item.year">
|
|
</el-option>
|
|
</el-select>
|
|
</el-form-item>
|
|
<el-form-item label="学期" prop="schoolTerm">
|
|
<el-select
|
|
v-model="searchForm.schoolTerm"
|
|
placeholder="请选择学期"
|
|
clearable
|
|
style="width: 200px">
|
|
<el-option
|
|
v-for="item in schoolTermList"
|
|
:key="item.value"
|
|
:label="item.label"
|
|
:value="item.value">
|
|
</el-option>
|
|
</el-select>
|
|
</el-form-item>
|
|
<el-form-item label="学院" prop="deptCode">
|
|
<el-select
|
|
v-model="searchForm.deptCode"
|
|
placeholder="请选择学院"
|
|
clearable
|
|
filterable
|
|
style="width: 200px">
|
|
<el-option
|
|
v-for="item in deptList"
|
|
:key="item.deptCode"
|
|
:label="item.deptName"
|
|
:value="item.deptCode">
|
|
</el-option>
|
|
</el-select>
|
|
</el-form-item>
|
|
<el-form-item label="班号" prop="classCode">
|
|
<el-select
|
|
v-model="searchForm.classCode"
|
|
placeholder="请选择班号"
|
|
clearable
|
|
filterable
|
|
style="width: 200px">
|
|
<el-option
|
|
v-for="item in classList"
|
|
:key="item.classCode"
|
|
:label="item.classNo"
|
|
:value="item.classCode">
|
|
</el-option>
|
|
</el-select>
|
|
</el-form-item>
|
|
<el-form-item label="请假类型" prop="leaveType">
|
|
<el-select
|
|
v-model="searchForm.leaveType"
|
|
placeholder="请选择请假类型"
|
|
clearable
|
|
style="width: 200px">
|
|
<el-option
|
|
v-for="item in leaveTypeList"
|
|
:key="item.value"
|
|
:label="item.label"
|
|
:value="item.value">
|
|
</el-option>
|
|
</el-select>
|
|
</el-form-item>
|
|
<el-form-item label="校门" prop="schoolDoor">
|
|
<el-select
|
|
v-model="searchForm.schoolDoor"
|
|
placeholder="请选择校门"
|
|
clearable
|
|
style="width: 200px">
|
|
<el-option
|
|
v-for="item in schoolDoorList"
|
|
:key="item.value"
|
|
:label="item.label"
|
|
:value="item.value">
|
|
</el-option>
|
|
</el-select>
|
|
</el-form-item>
|
|
<el-form-item>
|
|
<el-button type="primary" plain icon="Search" @click="handleSearch">查询</el-button>
|
|
<el-button icon="Refresh" @click="handleReset">重置</el-button>
|
|
</el-form-item>
|
|
</el-form>
|
|
</el-row>
|
|
|
|
<!-- 操作按钮 -->
|
|
<el-row>
|
|
<div class="mb8" style="width: 100%">
|
|
<el-button
|
|
icon="Plus"
|
|
type="primary"
|
|
class="ml10"
|
|
@click="formDialogRef.openDialog()">
|
|
批量新增
|
|
</el-button>
|
|
<el-button
|
|
icon="Delete"
|
|
type="danger"
|
|
class="ml10"
|
|
@click="handleDeleteByClass">
|
|
整班删除
|
|
</el-button>
|
|
<right-toolbar
|
|
v-model:showSearch="showSearch"
|
|
class="ml10 mr20"
|
|
style="float: right;"
|
|
@queryTable="getDataList">
|
|
<TableColumnControl
|
|
ref="columnControlRef"
|
|
:columns="tableColumns"
|
|
v-model="visibleColumns"
|
|
trigger-type="default"
|
|
trigger-circle
|
|
@change="handleColumnChange"
|
|
@order-change="handleColumnOrderChange"
|
|
>
|
|
<template #trigger>
|
|
<el-tooltip class="item" effect="dark" content="列设置" placement="top">
|
|
<el-button circle style="margin-left: 0;">
|
|
<el-icon><Menu /></el-icon>
|
|
</el-button>
|
|
</el-tooltip>
|
|
</template>
|
|
</TableColumnControl>
|
|
</right-toolbar>
|
|
</div>
|
|
</el-row>
|
|
|
|
<!-- 表格 -->
|
|
<el-table
|
|
:data="state.dataList"
|
|
v-loading="state.loading"
|
|
border
|
|
:cell-style="tableStyle.cellStyle"
|
|
:header-cell-style="tableStyle.headerCellStyle">
|
|
<el-table-column type="index" label="序号" width="60" align="center">
|
|
<template #header>
|
|
<el-icon><List /></el-icon>
|
|
</template>
|
|
</el-table-column>
|
|
<el-table-column
|
|
v-for="col in visibleColumnsSorted"
|
|
:key="col.prop"
|
|
:prop="col.prop"
|
|
:label="col.label"
|
|
:width="col.width"
|
|
:min-width="col.minWidth"
|
|
:show-overflow-tooltip="col.showOverflowTooltip !== false"
|
|
:align="col.align || 'center'">
|
|
<template #header>
|
|
<el-icon v-if="col.icon"><component :is="col.icon" /></el-icon>
|
|
<span :style="{ marginLeft: col.icon ? '4px' : '0' }">{{ col.label }}</span>
|
|
</template>
|
|
<template #default="scope" v-if="col.prop === 'schoolTerm'">
|
|
<el-tag size="small" type="primary" effect="plain">
|
|
{{ formatSchoolTerm(scope.row.schoolTerm) }}
|
|
</el-tag>
|
|
</template>
|
|
<template #default="scope" v-else-if="col.prop === 'num'">
|
|
<el-tag v-if="scope.row.num" size="small" type="success" effect="plain">
|
|
{{ scope.row.num }}
|
|
</el-tag>
|
|
<span v-else>-</span>
|
|
</template>
|
|
<template #default="scope" v-else-if="col.prop === 'startTime'">
|
|
<span>{{ scope.row.startTime ? formatDateTime(scope.row.startTime) : '-' }}</span>
|
|
</template>
|
|
<template #default="scope" v-else-if="col.prop === 'endTime'">
|
|
<span>{{ scope.row.endTime ? formatDateTime(scope.row.endTime) : '-' }}</span>
|
|
</template>
|
|
<template #default="scope" v-else-if="col.prop === 'leaveType'">
|
|
<el-tag size="small" type="info" effect="plain">
|
|
{{ formatLeaveType(scope.row.leaveType) }}
|
|
</el-tag>
|
|
</template>
|
|
<template #default="scope" v-else-if="col.prop === 'stayDorm'">
|
|
<StatusTag
|
|
:value="scope.row.stayDorm"
|
|
:options="[{ label: '是', value: '1' }, { label: '否', value: '0' }]"
|
|
:type-map="{ '1': { type: 'success', effect: 'light' }, '0': { type: 'info', effect: 'light' } }"
|
|
/>
|
|
</template>
|
|
<template #default="scope" v-else-if="col.prop === 'isSegment'">
|
|
<StatusTag
|
|
:value="scope.row.isSegment"
|
|
:options="[{ label: '是', value: '1' }, { label: '否', value: '0' }]"
|
|
:type-map="{ '1': { type: 'success', effect: 'light' }, '0': { type: 'info', effect: 'light' } }"
|
|
/>
|
|
</template>
|
|
<template #default="scope" v-else-if="col.prop === 'schoolDoor'">
|
|
<el-tag size="small" type="warning" effect="plain">
|
|
{{ formatSchoolDoor(scope.row.schoolDoor) }}
|
|
</el-tag>
|
|
</template>
|
|
<template #default="scope" v-else-if="col.prop === 'deptAudit'">
|
|
<StatusTag
|
|
:value="scope.row.deptAudit"
|
|
:options="[{ label: '待审核', value: '0' }, { label: '通过', value: '1' }, { label: '驳回', value: '2' }]"
|
|
:type-map="{ '0': { type: 'warning', effect: 'light' }, '1': { type: 'success', effect: 'light' }, '2': { type: 'danger', effect: 'light' } }"
|
|
/>
|
|
</template>
|
|
<template #default="scope" v-else-if="col.prop === 'schoolAudit'">
|
|
<StatusTag
|
|
:value="scope.row.schoolAudit"
|
|
:options="[{ label: '待审核', value: '0' }, { label: '通过', value: '1' }, { label: '驳回', value: '2' }]"
|
|
:type-map="{ '0': { type: 'warning', effect: 'light' }, '1': { type: 'success', effect: 'light' }, '2': { type: 'danger', effect: 'light' } }"
|
|
/>
|
|
</template>
|
|
</el-table-column>
|
|
<el-table-column label="操作" width="150" align="center" fixed="right">
|
|
<template #header>
|
|
<el-icon><Setting /></el-icon>
|
|
<span style="margin-left: 4px">操作</span>
|
|
</template>
|
|
<template #default="scope">
|
|
<el-button
|
|
icon="View"
|
|
text
|
|
type="primary"
|
|
@click="handleView(scope.row)">
|
|
查看
|
|
</el-button>
|
|
<el-button
|
|
icon="Delete"
|
|
text
|
|
type="danger"
|
|
@click="handleDelete(scope.row)">
|
|
删除
|
|
</el-button>
|
|
</template>
|
|
</el-table-column>
|
|
</el-table>
|
|
|
|
<!-- 分页 -->
|
|
<pagination
|
|
@size-change="sizeChangeHandle"
|
|
@current-change="currentChangeHandle"
|
|
v-bind="state.pagination" />
|
|
</div>
|
|
|
|
<!-- 批量新增表单弹窗 -->
|
|
<form-dialog ref="formDialogRef" @refresh="getDataList" />
|
|
|
|
<!-- 查看详情弹窗 -->
|
|
<detail-dialog ref="detailDialogRef" />
|
|
</div>
|
|
</template>
|
|
|
|
<script setup lang="ts" name="ClassLeaveApply">
|
|
import { reactive, ref, onMounted, computed } from 'vue'
|
|
import { useRoute } from 'vue-router'
|
|
import { BasicTableProps, useTable } from "/@/hooks/table";
|
|
import { fetchList, delObj, deleteByClass } from "/@/api/stuwork/classleaveapply";
|
|
import { queryAllSchoolYear } from "/@/api/basic/basicyear";
|
|
import { getDicts } from "/@/api/admin/dict";
|
|
import { getDeptListByLevelTwo } from "/@/api/basic/basicdept";
|
|
import { getClassListByRole } from "/@/api/basic/basicclass";
|
|
import { useMessage, useMessageBox } from "/@/hooks/message";
|
|
import TableColumnControl from '/@/components/TableColumnControl/index.vue'
|
|
import FormDialog from './form.vue'
|
|
import DetailDialog from './detail.vue'
|
|
import { List, Calendar, Clock, OfficeBuilding, Grid, UserFilled, Collection, Document, House, Location, CircleCheck, Warning, Setting, Menu } from '@element-plus/icons-vue'
|
|
import { getTableConfigFromLocal, saveTableConfigToLocal, updateUserTableConfig } from '/@/api/admin/usertable'
|
|
import { defineAsyncComponent } from 'vue'
|
|
const StatusTag = defineAsyncComponent(() => import('/@/components/StatusTag/index.vue'))
|
|
|
|
// 定义变量内容
|
|
const route = useRoute()
|
|
const searchFormRef = ref()
|
|
const columnControlRef = ref()
|
|
const showSearch = ref(true)
|
|
const schoolYearList = ref<any[]>([])
|
|
const schoolTermList = ref<any[]>([])
|
|
const deptList = ref<any[]>([])
|
|
const classList = ref<any[]>([])
|
|
const leaveTypeList = ref<any[]>([])
|
|
const yesNoList = ref<any[]>([])
|
|
const auditTypeList = ref<any[]>([])
|
|
const schoolDoorList = ref<any[]>([])
|
|
const formDialogRef = ref()
|
|
const detailDialogRef = ref()
|
|
|
|
// 表格列配置
|
|
const tableColumns = [
|
|
{ prop: 'schoolYear', label: '学年', icon: Calendar },
|
|
{ prop: 'schoolTerm', label: '学期', icon: Clock },
|
|
{ prop: 'deptName', label: '学院', icon: OfficeBuilding },
|
|
{ prop: 'classNo', label: '班号', icon: Grid },
|
|
{ prop: 'teacherRealName', label: '班主任', icon: UserFilled },
|
|
{ prop: 'num', label: '人数', icon: UserFilled },
|
|
{ prop: 'startTime', label: '请假开始时间', icon: Calendar, width: 180 },
|
|
{ prop: 'endTime', label: '请假结束时间', icon: Calendar, width: 180 },
|
|
{ prop: 'leaveType', label: '请假类型', icon: Collection },
|
|
{ prop: 'reason', label: '请假事由', icon: Document, minWidth: 150 },
|
|
{ prop: 'stayDorm', label: '是否住宿', icon: House },
|
|
{ prop: 'isSegment', label: '时段请假', icon: Clock },
|
|
{ prop: 'segmentString', label: '请假时段', icon: Clock, minWidth: 150 },
|
|
{ prop: 'schoolDoor', label: '请假校门', icon: Location },
|
|
{ prop: 'deptAudit', label: '基础部审核', icon: CircleCheck },
|
|
{ prop: 'schoolAudit', label: '学工处审批', icon: CircleCheck },
|
|
{ prop: 'rejectReason', label: '驳回原因', icon: Warning, minWidth: 150 }
|
|
]
|
|
|
|
// 当前显示的列
|
|
const visibleColumns = ref<string[]>([])
|
|
// 列排序顺序
|
|
const columnOrder = ref<string[]>([])
|
|
|
|
// 从本地统一存储加载配置
|
|
const loadSavedConfig = () => {
|
|
const routePath = route.path.replace(/^\//, '').replace(/\//g, '-')
|
|
const storageKey = `table-columns-${routePath}`
|
|
const savedConfig = getTableConfigFromLocal(storageKey)
|
|
|
|
if (savedConfig && savedConfig.visibleColumns) {
|
|
const validColumns = tableColumns.map(col => col.prop || col.label)
|
|
const filteredSaved = savedConfig.visibleColumns.filter((col: string) => validColumns.includes(col))
|
|
visibleColumns.value = filteredSaved.length > 0 ? filteredSaved : validColumns
|
|
} else {
|
|
visibleColumns.value = tableColumns.map(col => col.prop || col.label)
|
|
}
|
|
|
|
if (savedConfig && savedConfig.columnOrder) {
|
|
const validColumns = tableColumns.map(col => col.prop || col.label)
|
|
columnOrder.value = savedConfig.columnOrder.filter((key: string) => validColumns.includes(key))
|
|
validColumns.forEach(key => {
|
|
if (!columnOrder.value.includes(key)) {
|
|
columnOrder.value.push(key)
|
|
}
|
|
})
|
|
} else {
|
|
columnOrder.value = tableColumns.map(col => col.prop || col.label)
|
|
}
|
|
}
|
|
|
|
// 列变化处理
|
|
const handleColumnChange = (value: string[]) => {
|
|
visibleColumns.value = value
|
|
const routePath = route.path.replace(/^\//, '').replace(/\//g, '-')
|
|
const storageKey = `table-columns-${routePath}`
|
|
const selectableColumns = value.filter(col => {
|
|
const column = tableColumns.find(c => (c.prop || c.label) === col)
|
|
return column && !column.alwaysShow && !column.fixed
|
|
})
|
|
// 保存到本地统一存储
|
|
saveTableConfigToLocal(storageKey, { visibleColumns: selectableColumns })
|
|
// 异步保存到后端
|
|
updateUserTableConfig(storageKey, { visibleColumns: selectableColumns }).catch(() => {})
|
|
}
|
|
|
|
// 列排序变化处理
|
|
const handleColumnOrderChange = (order: string[]) => {
|
|
columnOrder.value = order
|
|
const routePath = route.path.replace(/^\//, '').replace(/\//g, '-')
|
|
const storageKey = `table-columns-${routePath}`
|
|
// 保存到本地统一存储
|
|
saveTableConfigToLocal(storageKey, { columnOrder: order })
|
|
// 异步保存到后端
|
|
updateUserTableConfig(storageKey, { columnOrder: order }).catch(() => {})
|
|
}
|
|
|
|
// 排序后的表格列
|
|
const visibleColumnsSorted = computed(() => {
|
|
const columns = tableColumns.filter(col => {
|
|
const key = col.prop || col.label
|
|
return visibleColumns.value.includes(key)
|
|
})
|
|
|
|
if (columnOrder.value.length > 0) {
|
|
const orderedColumns: any[] = []
|
|
const unorderedColumns: any[] = []
|
|
|
|
columnOrder.value.forEach(key => {
|
|
const col = columns.find(c => (c.prop || c.label) === key)
|
|
if (col) {
|
|
orderedColumns.push(col)
|
|
}
|
|
})
|
|
|
|
columns.forEach(col => {
|
|
const key = col.prop || col.label
|
|
if (!columnOrder.value.includes(key)) {
|
|
unorderedColumns.push(col)
|
|
}
|
|
})
|
|
|
|
return [...orderedColumns, ...unorderedColumns]
|
|
}
|
|
|
|
return columns
|
|
})
|
|
|
|
// 校门列表
|
|
const schoolDoorListData = [
|
|
{ label: '校门东', value: '0' },
|
|
{ label: '校门南', value: '1' },
|
|
{ label: '校门西', value: '2' }
|
|
]
|
|
|
|
// 搜索表单
|
|
const searchForm = reactive({
|
|
schoolYear: '',
|
|
schoolTerm: '',
|
|
deptCode: '',
|
|
classCode: '',
|
|
leaveType: '',
|
|
schoolDoor: ''
|
|
})
|
|
|
|
// 配置 useTable
|
|
const state: BasicTableProps = reactive<BasicTableProps>({
|
|
queryForm: searchForm,
|
|
pageList: fetchList,
|
|
props: {
|
|
item: 'records',
|
|
totalCount: 'total'
|
|
},
|
|
createdIsNeed: true
|
|
})
|
|
|
|
// table hook
|
|
const {
|
|
getDataList,
|
|
currentChangeHandle,
|
|
sizeChangeHandle,
|
|
tableStyle
|
|
} = useTable(state)
|
|
|
|
// 格式化学期
|
|
const formatSchoolTerm = (value: string | number) => {
|
|
if (value === null || value === undefined || value === '') {
|
|
return '-'
|
|
}
|
|
const dictItem = schoolTermList.value.find(item => item.value == value)
|
|
return dictItem ? dictItem.label : value
|
|
}
|
|
|
|
// 格式化日期时间
|
|
const formatDateTime = (dateTime: string) => {
|
|
if (!dateTime) return '-'
|
|
if (dateTime.includes(' ')) {
|
|
return dateTime.split('.')[0]
|
|
}
|
|
return dateTime
|
|
}
|
|
|
|
// 格式化请假类型
|
|
const formatLeaveType = (value: string) => {
|
|
if (!value) return '-'
|
|
const item = leaveTypeList.value.find((item: any) => item.value === value)
|
|
return item ? item.label : value
|
|
}
|
|
|
|
// 格式化是否
|
|
const formatYesNo = (value: string) => {
|
|
if (value === null || value === undefined || value === '') {
|
|
return '-'
|
|
}
|
|
const dictItem = yesNoList.value.find(item => item.value == value)
|
|
return dictItem ? dictItem.label : value
|
|
}
|
|
|
|
// 格式化校门
|
|
const formatSchoolDoor = (value: string) => {
|
|
if (!value) return '-'
|
|
const item = schoolDoorList.value.find((item: any) => item.value === value)
|
|
return item ? item.label : value
|
|
}
|
|
|
|
// 格式化审核类型
|
|
const formatAuditType = (value: string) => {
|
|
if (value === null || value === undefined || value === '') {
|
|
return '-'
|
|
}
|
|
const dictItem = auditTypeList.value.find(item => item.value == value)
|
|
return dictItem ? dictItem.label : value
|
|
}
|
|
|
|
// 查询
|
|
const handleSearch = () => {
|
|
getDataList()
|
|
}
|
|
|
|
// 重置
|
|
const handleReset = () => {
|
|
searchFormRef.value?.resetFields()
|
|
getDataList()
|
|
}
|
|
|
|
// 查看
|
|
const handleView = (row: any) => {
|
|
detailDialogRef.value.openDialog(row.id)
|
|
}
|
|
|
|
// 删除
|
|
const handleDelete = async (row: any) => {
|
|
const { confirm } = useMessageBox()
|
|
try {
|
|
await confirm('确定要删除该批量请假记录吗?')
|
|
await delObj([row.id])
|
|
useMessage().success('删除成功')
|
|
getDataList()
|
|
} catch (err: any) {
|
|
if (err !== 'cancel') {
|
|
useMessage().error(err.msg || '删除失败')
|
|
}
|
|
}
|
|
}
|
|
|
|
// 整班删除
|
|
const handleDeleteByClass = async () => {
|
|
const { confirm, prompt } = useMessageBox()
|
|
try {
|
|
const { value } = await prompt('请输入要删除的班级ID')
|
|
if (!value) {
|
|
useMessage().warning('请输入班级ID')
|
|
return
|
|
}
|
|
await confirm('确定要删除该班级的所有请假记录吗?')
|
|
await deleteByClass(value)
|
|
useMessage().success('删除成功')
|
|
getDataList()
|
|
} catch (err: any) {
|
|
if (err !== 'cancel') {
|
|
useMessage().error(err.msg || '删除失败')
|
|
}
|
|
}
|
|
}
|
|
|
|
// 获取学年列表
|
|
const getSchoolYearListData = async () => {
|
|
try {
|
|
const res = await queryAllSchoolYear()
|
|
if (res.data) {
|
|
schoolYearList.value = Array.isArray(res.data) ? res.data : []
|
|
}
|
|
} catch (err) {
|
|
schoolYearList.value = []
|
|
}
|
|
}
|
|
|
|
// 获取学期字典
|
|
const getSchoolTermDict = async () => {
|
|
try {
|
|
const res = await getDicts('school_term')
|
|
if (res.data) {
|
|
schoolTermList.value = Array.isArray(res.data) ? res.data.map((item: any) => ({
|
|
label: item.label || item.dictLabel || item.name,
|
|
value: item.value || item.dictValue || item.code
|
|
})) : []
|
|
}
|
|
} catch (err) {
|
|
schoolTermList.value = []
|
|
}
|
|
}
|
|
|
|
// 获取系部列表
|
|
const getDeptListData = async () => {
|
|
try {
|
|
const res = await getDeptListByLevelTwo()
|
|
if (res.data) {
|
|
deptList.value = Array.isArray(res.data) ? res.data : []
|
|
}
|
|
} catch (err) {
|
|
deptList.value = []
|
|
}
|
|
}
|
|
|
|
// 获取班级列表
|
|
const getClassListData = async () => {
|
|
try {
|
|
const res = await getClassListByRole()
|
|
if (res.data) {
|
|
classList.value = Array.isArray(res.data) ? res.data : []
|
|
}
|
|
} catch (err) {
|
|
classList.value = []
|
|
}
|
|
}
|
|
|
|
// 获取请假类型字典
|
|
const getLeaveTypeDict = async () => {
|
|
try {
|
|
const res = await getDicts('leave_type')
|
|
if (res.data) {
|
|
leaveTypeList.value = Array.isArray(res.data) ? res.data.map((item: any) => ({
|
|
label: item.label || item.dictLabel || item.name,
|
|
value: item.value || item.dictValue || item.code
|
|
})) : []
|
|
}
|
|
} catch (err) {
|
|
leaveTypeList.value = []
|
|
}
|
|
}
|
|
|
|
// 获取是否字典
|
|
const getYesNoDict = async () => {
|
|
try {
|
|
const res = await getDicts('yes_no')
|
|
if (res.data) {
|
|
yesNoList.value = Array.isArray(res.data) ? res.data.map((item: any) => ({
|
|
label: item.label || item.dictLabel || item.name,
|
|
value: item.value || item.dictValue || item.code
|
|
})) : []
|
|
}
|
|
} catch (err) {
|
|
yesNoList.value = []
|
|
}
|
|
}
|
|
|
|
// 获取审核类型字典
|
|
const getAuditTypeDict = async () => {
|
|
try {
|
|
const res = await getDicts('class_audit_type')
|
|
if (res.data) {
|
|
auditTypeList.value = Array.isArray(res.data) ? res.data.map((item: any) => ({
|
|
label: item.label || item.dictLabel || item.name,
|
|
value: item.value || item.dictValue || item.code
|
|
})) : []
|
|
}
|
|
} catch (err) {
|
|
auditTypeList.value = []
|
|
}
|
|
}
|
|
|
|
// 初始化
|
|
loadSavedConfig()
|
|
onMounted(() => {
|
|
schoolDoorList.value = schoolDoorListData
|
|
getSchoolYearListData()
|
|
getSchoolTermDict()
|
|
getDeptListData()
|
|
getClassListData()
|
|
getLeaveTypeDict()
|
|
getYesNoDict()
|
|
getAuditTypeDict()
|
|
})
|
|
</script>
|
|
|
|
<style scoped lang="scss">
|
|
</style>
|
|
|