From 84349062d42c6bb33354bdd19cad743d3faeb450 Mon Sep 17 00:00:00 2001 From: raofuzi <2641346316@qq.com> Date: Sun, 31 Mar 2024 17:35:40 +0800 Subject: [PATCH] =?UTF-8?q?feat:=20=E4=BF=AE=E6=94=B9bug?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/layout/components/Header/index.vue | 2 +- src/views/home/aside/Aside.vue | 2 +- src/views/home/aside/comp/Search.vue | 13 ++-- .../aside/comp/modals/CustomFilterModal.vue | 21 ++++-- src/views/home/content/Content.vue | 64 +++++++++++++------ 5 files changed, 70 insertions(+), 32 deletions(-) diff --git a/src/layout/components/Header/index.vue b/src/layout/components/Header/index.vue index 2fa42b6..0dd4002 100644 --- a/src/layout/components/Header/index.vue +++ b/src/layout/components/Header/index.vue @@ -227,7 +227,7 @@ export default defineComponent({
- +
diff --git a/src/views/home/aside/Aside.vue b/src/views/home/aside/Aside.vue index b5e764e..f6c6efe 100644 --- a/src/views/home/aside/Aside.vue +++ b/src/views/home/aside/Aside.vue @@ -130,7 +130,7 @@ configStore.$subscribe(() => { return acc } }, []) - // console.log("items", items); + console.log("items", items); showItems.value = items }) diff --git a/src/views/home/aside/comp/Search.vue b/src/views/home/aside/comp/Search.vue index ba057e6..2f6cea7 100644 --- a/src/views/home/aside/comp/Search.vue +++ b/src/views/home/aside/comp/Search.vue @@ -54,6 +54,11 @@ const searchName = () => { configStore.setSearchValue(searchKeyword.value); } +const close = () => { + searchKeyword.value = ""; + emit('close'); +} + diff --git a/src/views/home/aside/comp/modals/CustomFilterModal.vue b/src/views/home/aside/comp/modals/CustomFilterModal.vue index 211e841..f5131be 100644 --- a/src/views/home/aside/comp/modals/CustomFilterModal.vue +++ b/src/views/home/aside/comp/modals/CustomFilterModal.vue @@ -3,7 +3,7 @@ import { getAllfieldList, getfieldList, setFilter } from '@/api/home/filter' import { asideMap } from '@/config/aside' import { useConfig } from '@/store/modules/asideConfig' import { useUser } from "@/store/modules/user" -import { debounce, difference } from 'lodash-es' +import { debounce, difference, cloneDeep } from 'lodash-es' import { computed, defineOptions, onMounted, ref, watch } from 'vue' import { VueDraggable } from 'vue-draggable-plus' @@ -25,6 +25,7 @@ function showModal() { if (config == null || customConfig == null) return const { showList, hideList } = generatList(config, customConfig) + console.log("showList", showList); onList.value = showList offList.value = hideList // 重置全选状态 @@ -124,7 +125,15 @@ function generatList(config, customConfig) { const fixedList = generateDefaultList(config) offList.unshift(...fixedList) onList.unshift(...fixedList) - return { showList: onList, hideList: offList } + // onList按照customConfig排序 + let tempOnList = cloneDeep(onList); + let sortList: any = []; + customConfig.map(key => { + let tempItem = tempOnList.find(item => item.id == key); + sortList.push(tempItem); + }); + // return { showList: onList, hideList: offList } + return { showList: sortList, hideList: offList } } configStore.$subscribe(() => { @@ -313,7 +322,7 @@ onMounted(() => {
- +
{