This commit is contained in:
zhoutianchi
2026-01-29 14:02:46 +08:00
40 changed files with 6908 additions and 4623 deletions

View File

@@ -56,10 +56,10 @@
<el-row>
<div class="mb15" style="width: 100%;">
<el-button
v-auth="'professional_professionalteacherhonor_add'"
type="primary"
icon="FolderAdd"
@click="handleAdd"
v-if="permissions.professional_professionalteacherhonor_add">
@click="handleAdd">
</el-button>
<el-button
type="warning"
@@ -118,17 +118,19 @@
<el-table-column label="操作" width="280" align="center" fixed="right">
<template #default="scope">
<el-button
v-auth="'professional_professionalteacherhonor_edit'"
v-if="scope.row.state === '0' || scope.row.state === '-2'"
type="primary"
link
icon="edit-pen"
v-if="permissions.professional_professionalteacherhonor_edit && (scope.row.state === '0' || scope.row.state === '-2')"
@click="handleEdit(scope.row)">编辑
@click="handleEdit(scope.row)">修改
</el-button>
<el-button
v-auth="'professional_professionalteacherhonor_exam'"
v-if="scope.row.canExam"
type="success"
link
icon="CircleCheck"
v-if="permissions.professional_professionalteacherhonor_exam && scope.row.canExam"
@click="changeState(scope.row, 1)">通过
</el-button>
<el-button
@@ -139,10 +141,11 @@
@click="changeState(scope.row, 1)">部门通过
</el-button>
<el-button
v-auth="'professional_professionalteacherhonor_exam'"
v-if="scope.row.canBack"
type="danger"
link
icon="CircleClose"
v-if="permissions.professional_professionalteacherhonor_exam && scope.row.canBack"
@click="changeState(scope.row, -2)">驳回
</el-button>
<el-button
@@ -153,10 +156,10 @@
@click="changeState(scope.row, -2)">部门驳回
</el-button>
<el-button
v-auth="'professional_professionalteacherhonor_del'"
type="danger"
link
icon="delete"
v-if="permissions.professional_professionalteacherhonor_del"
style="margin-left: 12px"
@click="handleDel(scope.row)">删除
</el-button>
@@ -187,9 +190,7 @@
</template>
<script setup lang="ts">
import { ref, reactive, computed, onMounted, nextTick } from 'vue'
import { storeToRefs } from 'pinia'
import { useUserInfo } from '/@/stores/userInfo'
import { ref, reactive, nextTick } from 'vue'
import { BasicTableProps, useTable } from '/@/hooks/table'
import { useMessage } from '/@/hooks/message'
import { useMessageBox } from '/@/hooks/message'
@@ -199,6 +200,7 @@ import {
examObj,
delObj
} from '/@/api/professional/professionaluser/professionalteacherhonor'
import { PROFESSIONAL_AUDIT_STATE_OPTIONS } from '/@/config/global'
import { defineAsyncComponent } from 'vue'
const TeacherNameNo = defineAsyncComponent(() => import('/@/components/TeacherNameNo/index.vue'))
const AuditState = defineAsyncComponent(() => import('/@/components/AuditState/index.vue'))
@@ -206,19 +208,6 @@ const ProfessionalBackResaon = defineAsyncComponent(() => import('/@/views/profe
const DataForm = defineAsyncComponent(() => import('./form.vue'))
const previewFile = defineAsyncComponent(() => import('/@/components/tools/preview-file.vue'))
// 使用 Pinia store
const userInfoStore = useUserInfo()
const { userInfos } = storeToRefs(userInfoStore)
// 创建权限对象
const permissions = computed(() => {
const perms: Record<string, boolean> = {}
userInfos.value.authBtnList.forEach((perm: string) => {
perms[perm] = true
})
return perms
})
// 消息提示 hooks
const message = useMessage()
const messageBox = useMessageBox()
@@ -226,13 +215,8 @@ const messageBox = useMessageBox()
// 字典数据
const { professional_state: professionalState } = useDict('professional_state')
// 审核状态选项(独立定义,防止其他页面修改时被波及)
import type { StateOption } from '/@/components/AuditState/index.vue'
const auditStateOptions: StateOption[] = [
{ value: '1', label: '已通过', type: 'success', icon: 'fa-solid fa-circle-check', effect: 'dark' },
{ value: '-2', label: '已驳回', type: 'danger', icon: 'fa-solid fa-circle-xmark', effect: 'dark' },
{ value: '0', label: '待审核', type: 'warning', icon: 'fa-regular fa-clock', effect: 'light' }
]
// 审核状态选项
const auditStateOptions = PROFESSIONAL_AUDIT_STATE_OPTIONS
// 表格引用
const tableRef = ref()
@@ -379,10 +363,7 @@ const handleDownLoadWord = async () => {
}
}
// 初始化
onMounted(() => {
getDataList()
})
// 表格数据由 useTablecreatedIsNeed 默认 true在挂载时自动请求
</script>
<style lang="scss" scoped>