fix: 修复bug

This commit is contained in:
lilinyuan
2024-06-01 23:15:37 +08:00
parent 9acd05a2cc
commit e2d6722ec6
2 changed files with 16 additions and 9 deletions

View File

@@ -66,15 +66,15 @@ const filterConfig = computed(() => {
})
// 搜索功能表单元素默认值
const setDefaultFormValues = () => {
filterConfig.value.forEach(item => {
form.value[item.prop] = item.props?.defaultValue || null
})
}
// const setDefaultFormValues = () => {
// filterConfig.value.forEach(item => {
// form.value[item.prop] = item.props?.defaultValue || null
// })
// }
watchEffect(() => {
if (filterConfig.value.length) {
setDefaultFormValues()
// setDefaultFormValues()
}
})
@@ -86,7 +86,7 @@ const getValues = () => {
//重置
const handleReset = () => {
form.value = {}
setDefaultFormValues()
// setDefaultFormValues()
emits('search', form.value)
}

View File

@@ -67,6 +67,12 @@ const searchConfig = ref([
const tableIns = ref()
const auths = {
edit: ['admin:user:edit'],
del: ['admin:user:del'],
add: ['admin:user:add'],
}
const tableConfig = reactive({
columns: [
{
@@ -119,10 +125,10 @@ const tableConfig = reactive({
currentRender: ({row, index}) => {
return (
<div>
<el-button type="primary" link onClick={()=>handleEdit(row)} v-perm={['admin:user:edit']}>编辑</el-button>
<el-button type="primary" v-perm={auths.edit} link onClick={()=>handleEdit(row)}>编辑</el-button>
{
row.userType != 0 ?
<el-button type="danger" link onClick={()=>handleDel(row)} v-perm={['admin:user:del']}>删除</el-button> :
<el-button type="danger" v-perm={auths.del} link onClick={()=>handleDel(row)}>删除</el-button> :
null
}
@@ -148,6 +154,7 @@ const init = async () => {
searchConfig.value.find(item=>item.prop == 'departmentId').props.data = data
const res = await getSubCompOpt()
searchConfig.value.find(item=>item.prop == 'subCompanyId').props.data = res.data
console.log("🚀 ~ init ~ searchConfig.value:", searchConfig.value)
}
init()