This commit is contained in:
guochunsi
2026-01-16 15:55:28 +08:00
parent cb74e79383
commit bbbc9a0663
7 changed files with 102 additions and 132 deletions

View File

@@ -22,7 +22,7 @@
<!-- 操作按钮 -->
<div class="mb15">
<el-button
v-if="permissions.recruit_recruitstudentplancorrectscoreconfig_add"
v-auth="'recruit_recruitstudentplancorrectscoreconfig_add'"
type="primary"
icon="FolderAdd"
@click="addOrUpdateHandle"
@@ -52,7 +52,7 @@
<el-table-column label="操作" width="150" align="center" fixed="right">
<template #default="scope">
<el-button
v-if="permissions.recruit_recruitstudentplancorrectscoreconfig_edit"
v-auth="'recruit_recruitstudentplancorrectscoreconfig_edit'"
type="primary"
link
icon="EditPen"
@@ -61,8 +61,8 @@
修改
</el-button>
<el-button
v-if="permissions.recruit_recruitstudentplancorrectscoreconfig_del"
type="danger"
v-auth="'recruit_recruitstudentplancorrectscoreconfig_del'"
type="primary"
link
icon="Delete"
@click="deleteHandle(scope.row.id)"
@@ -87,9 +87,7 @@
</template>
<script setup lang="ts" name="recruitstudentplancorrectscoreconfig">
import { ref, reactive, computed, onMounted, nextTick, defineAsyncComponent } from 'vue'
import { storeToRefs } from 'pinia'
import { useUserInfo } from '/@/stores/userInfo'
import { ref, reactive, onMounted, nextTick, defineAsyncComponent } from 'vue'
import { BasicTableProps, useTable } from '/@/hooks/table'
import { useMessage, useMessageBox } from '/@/hooks/message'
import { getList } from '/@/api/recruit/recruitstudentplangroup'
@@ -97,19 +95,6 @@ import { fetchList, delObj } from '/@/api/recruit/recruitstudentplancorrectscore
const TableForm = defineAsyncComponent(() => import('./detaiform.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()
@@ -119,9 +104,6 @@ const tableRef = ref()
const searchFormRef = ref()
const addOrUpdateRef = ref()
// 弹窗状态
const addOrUpdateVisible = ref(false)
// 数据
const planList = ref<any[]>([])
@@ -164,7 +146,7 @@ const init = async () => {
}
getDataList()
} catch (error) {
console.error('初始化失败', error)
message.error('初始化失败')
}
}
@@ -192,9 +174,7 @@ const deleteHandle = async (id: string) => {
// 重置查询
const resetQuery = () => {
searchFormRef.value?.resetFields()
Object.keys(queryForm).forEach(key => {
queryForm[key] = ''
})
queryForm.groupId = ''
if (planList.value.length > 0) {
queryForm.groupId = planList.value[0].id
}