This commit is contained in:
guochunsi
2026-01-29 11:56:37 +08:00
parent 043c92efc9
commit 9fea29454f
28 changed files with 230 additions and 384 deletions

View File

@@ -88,17 +88,17 @@
<el-row>
<div class="mb15" style="width: 100%;">
<el-button
v-auth="'professional_professionaltitlerelation_add'"
type="primary"
icon="FolderAdd"
@click="handleAdd"
v-if="permissions.professional_professionaltitlerelation_add">
@click="handleAdd">
</el-button>
<el-button
v-auth="'professional_teacherbase_export'"
class="ml10"
type="warning"
plain
icon="Download"
v-if="permissions.professional_teacherbase_export"
@click="handleDownLoadWord"
:loading="exportLoading">导出信息
</el-button>
@@ -162,31 +162,34 @@
<el-table-column label="操作" width="280" align="center" fixed="right">
<template #default="scope">
<el-button
v-auth="'professional_professionaltitlerelation_edit'"
v-if="scope.row.state === '0' || scope.row.state === '-2'"
type="primary"
link
icon="edit-pen"
v-if="permissions.professional_professionaltitlerelation_edit && (scope.row.state === '0' || scope.row.state === '-2')"
@click="handleEdit(scope.row)">编辑
@click="handleEdit(scope.row)">修改
</el-button>
<el-button
v-auth="'professional_professionaltitlerelation_exam'"
v-if="scope.row.state === '0'"
type="success"
link
icon="CircleCheck"
v-if="permissions.professional_professionaltitlerelation_exam && scope.row.state === '0'"
@click="changeState(scope.row, 1)">通过
</el-button>
<el-button
v-auth="'professional_professionaltitlerelation_exam'"
v-if="scope.row.state === '0' || scope.row.state === '1'"
type="danger"
link
icon="CircleClose"
v-if="permissions.professional_professionaltitlerelation_exam && (scope.row.state === '0' || scope.row.state === '1')"
@click="changeState(scope.row, -2)">驳回
</el-button>
<el-button
v-auth="'professional_professionaltitlerelation_del'"
type="danger"
link
icon="delete"
v-if="permissions.professional_professionaltitlerelation_del"
style="margin-left: 12px"
@click="handleDel(scope.row)">删除
</el-button>
@@ -218,9 +221,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, onMounted, nextTick } from 'vue'
import { BasicTableProps, useTable } from '/@/hooks/table'
import { useMessage } from '/@/hooks/message'
import { useMessageBox } from '/@/hooks/message'
@@ -244,18 +245,6 @@ const ProfessionalBackResaon = defineAsyncComponent(() => import('/@/views/profe
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()
@@ -452,11 +441,9 @@ const loadDictData = async () => {
}
}
// 初始化
// 初始化:仅加载下拉字典,表格数据由 useTable 在 createdIsNeed: true 时自动请求
onMounted(async () => {
await loadDictData()
dataFormRef.value?.init()
getDataList()
})
</script>