fix: 修复bug
This commit is contained in:
@@ -66,15 +66,15 @@ const filterConfig = computed(() => {
|
|||||||
})
|
})
|
||||||
|
|
||||||
// 搜索功能表单元素默认值
|
// 搜索功能表单元素默认值
|
||||||
const setDefaultFormValues = () => {
|
// const setDefaultFormValues = () => {
|
||||||
filterConfig.value.forEach(item => {
|
// filterConfig.value.forEach(item => {
|
||||||
form.value[item.prop] = item.props?.defaultValue || null
|
// form.value[item.prop] = item.props?.defaultValue || null
|
||||||
})
|
// })
|
||||||
}
|
// }
|
||||||
|
|
||||||
watchEffect(() => {
|
watchEffect(() => {
|
||||||
if (filterConfig.value.length) {
|
if (filterConfig.value.length) {
|
||||||
setDefaultFormValues()
|
// setDefaultFormValues()
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
|
||||||
@@ -86,7 +86,7 @@ const getValues = () => {
|
|||||||
//重置
|
//重置
|
||||||
const handleReset = () => {
|
const handleReset = () => {
|
||||||
form.value = {}
|
form.value = {}
|
||||||
setDefaultFormValues()
|
// setDefaultFormValues()
|
||||||
emits('search', form.value)
|
emits('search', form.value)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -67,6 +67,12 @@ const searchConfig = ref([
|
|||||||
|
|
||||||
const tableIns = ref()
|
const tableIns = ref()
|
||||||
|
|
||||||
|
const auths = {
|
||||||
|
edit: ['admin:user:edit'],
|
||||||
|
del: ['admin:user:del'],
|
||||||
|
add: ['admin:user:add'],
|
||||||
|
}
|
||||||
|
|
||||||
const tableConfig = reactive({
|
const tableConfig = reactive({
|
||||||
columns: [
|
columns: [
|
||||||
{
|
{
|
||||||
@@ -119,10 +125,10 @@ const tableConfig = reactive({
|
|||||||
currentRender: ({row, index}) => {
|
currentRender: ({row, index}) => {
|
||||||
return (
|
return (
|
||||||
<div>
|
<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 ?
|
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
|
null
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -148,6 +154,7 @@ const init = async () => {
|
|||||||
searchConfig.value.find(item=>item.prop == 'departmentId').props.data = data
|
searchConfig.value.find(item=>item.prop == 'departmentId').props.data = data
|
||||||
const res = await getSubCompOpt()
|
const res = await getSubCompOpt()
|
||||||
searchConfig.value.find(item=>item.prop == 'subCompanyId').props.data = res.data
|
searchConfig.value.find(item=>item.prop == 'subCompanyId').props.data = res.data
|
||||||
|
console.log("🚀 ~ init ~ searchConfig.value:", searchConfig.value)
|
||||||
}
|
}
|
||||||
|
|
||||||
init()
|
init()
|
||||||
|
|||||||
Reference in New Issue
Block a user