fix: 合并冲突

This commit is contained in:
lilinyuan
2024-05-13 22:27:35 +08:00
38 changed files with 1665 additions and 549 deletions

View File

@@ -1,28 +1,28 @@
<template>
<el-form
:model="form"
v-bind="$attrs"
label-width="auto"
ref="formInstance"
class="search-form"
:model="form"
v-bind="$attrs"
label-width="auto"
ref="formInstance"
class="search-form"
>
<el-row>
<el-col
v-for="(item, index) in filterConfig"
:span="5"
:offset="index == 0 || index / 4 ==1 ? 0 : 1"
:key="item.prop"
>
<el-form-item
v-bind="item"
v-for="(item, index) in filterConfig"
:span="5"
:offset="index == 0 || index / 4 ==1 ? 0 : 1"
:key="item.prop"
>
<el-form-item
v-bind="item"
:key="item.prop"
>
<template #default>
<component
:is="item.component"
v-bind="item.props || {}"
v-on="item.on || {}"
v-model="form[item.prop]"
<component
:is="item.component"
v-bind="item.props || {}"
v-on="item.on || {}"
v-model="form[item.prop]"
>
</component>
</template>
@@ -33,7 +33,7 @@
<el-button v-if="searchConfig.length>=4" link type="primary" @click="showMore = !showMore">
{{ showMore ? '收起' : '展开' }}
</el-button>
<el-button type="primary" @click="getValues" :icon="Search">搜索</el-button>
<el-button @click="getValues" color="#DED0B2" :icon="Search">搜索</el-button>
<el-button @click="handleReset" :icon="Refresh">重置</el-button>
</el-form-item>
</el-col>
@@ -58,22 +58,22 @@ const formInstance = ref(null)
const showMore = ref(false)
const filterConfig = computed(()=>{
const arr = props.searchConfig.filter(item=>{
if(item.prop) return true
const filterConfig = computed(() => {
const arr = props.searchConfig.filter(item => {
if (item.prop) return true
})
return arr.length >= 4 && showMore.value ? arr : arr.slice(0, 3)
})
// 搜索功能表单元素默认值
const setDefaultFormValues = () => {
filterConfig.value.forEach(item=>{
form.value[item.prop] = item.props.defaultValue || null
filterConfig.value.forEach(item => {
form.value[item.prop] = item.props?.defaultValue || null
})
}
watchEffect(()=>{
if(filterConfig.value.length) {
watchEffect(() => {
if (filterConfig.value.length) {
setDefaultFormValues()
}
})
@@ -90,8 +90,8 @@ const handleReset = () => {
emits('search', form.value)
}
onMounted(()=>{
emits('getInstance', Object.assign({}, unref(formInstance),{
onMounted(() => {
emits('getInstance', Object.assign({}, unref(formInstance), {
getValues,
handleReset,
}))
@@ -103,9 +103,10 @@ onMounted(()=>{
.search-form {
padding-top: 18px;
}
.btn-col {
display: flex;
justify-content: space-evenly;
align-items: center;
}
</style>
</style>

View File

@@ -80,7 +80,7 @@
</template>
</el-table>
<!-- 分页 -->
<fvPagination
<fvPagination
v-if="pagination"
:current-page="localData.query.pageNum"
:page-size="localData.query.pageSize"
@@ -269,7 +269,7 @@ defineExpose({ refresh, updateLoading, getQuery, tableInstance })
onMounted(() => {
getList()
})
</script>
<style lang="scss" scoped>
@@ -290,4 +290,4 @@ onMounted(() => {
justify-content: space-between;
align-content: center;
}
</style>
</style>