fix : 修复标签关闭bug, 表格组件列配置, 完善用户管理页面

This commit is contained in:
2024-09-14 16:44:45 +08:00
parent 556c87812a
commit 5e6fd1420f
17 changed files with 537 additions and 587 deletions

View File

@@ -28,7 +28,8 @@
</template>
</el-form-item>
</el-col>
<el-col :span="filterConfig.length % 4 == 0 ? 4 : 6" class="btn-col">
<!-- class="btn-col"-->
<el-col :span="filterConfig.length % 4 == 0 ? 4 : 6" :offset="1">
<el-form-item>
<el-button v-if="searchConfig.length>=4" link type="primary" @click="showMore = !showMore">
{{ showMore ? '收起' : '展开' }}
@@ -65,21 +66,25 @@ const filterConfig = computed(()=>{
return arr.length >= 4 && showMore.value ? arr : arr.slice(0, 3)
})
console.log(filterConfig.value, 'filterConfig');
// 搜索功能表单元素默认值
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()
watchEffect(() => {
if (filterConfig.value.length) {
// setDefaultFormValues()
}
})
const elChange = () => {
setTimeout(() => {
getValues()
}, 500)
}
const getValues = () => {
emits('search', form.value)
return form.value
@@ -88,7 +93,7 @@ const getValues = () => {
//重置
const handleReset = () => {
form.value = {}
setDefaultFormValues()
// setDefaultFormValues()
emits('search', form.value)
}