a
This commit is contained in:
@@ -35,7 +35,7 @@
|
||||
<template #footer>
|
||||
<div class="dialog-footer">
|
||||
<el-button @click="visible = false">取消</el-button>
|
||||
<el-button type="primary" @click="dataFormSubmit" v-if="canSubmit">确定</el-button>
|
||||
<el-button type="primary" @click="dataFormSubmit" :disabled="!canSubmit">确定</el-button>
|
||||
</div>
|
||||
</template>
|
||||
</el-dialog>
|
||||
@@ -63,7 +63,7 @@ const regionList = ref<any[]>([])
|
||||
const planList = ref<any[]>([])
|
||||
|
||||
const dataForm = reactive({
|
||||
id: "",
|
||||
id: "" as string | null,
|
||||
groupId: "",
|
||||
regionId: "",
|
||||
fullScore: null as number | null,
|
||||
@@ -131,7 +131,7 @@ const dataFormSubmit = () => {
|
||||
|
||||
// 初始化方法
|
||||
const init = (id: string | null) => {
|
||||
dataForm.id = id || null
|
||||
dataForm.id = id || ""
|
||||
visible.value = true
|
||||
canSubmit.value = true
|
||||
nextTick(() => {
|
||||
|
||||
@@ -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
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user