diff --git a/src/store/modules/worktab.ts b/src/store/modules/worktab.ts index b87838c..0e576f4 100644 --- a/src/store/modules/worktab.ts +++ b/src/store/modules/worktab.ts @@ -4,7 +4,7 @@ import { HOME_PAGE } from '@/router/routesAlias' import { router } from '@/router' import { LocationQueryRaw, Router } from 'vue-router' import { WorkTab } from '@/types' - +import { useUserStore } from '@/store/modules/user' interface WorktabState { current: Partial opened: WorkTab[] @@ -144,6 +144,7 @@ export const useWorktabStore = defineStore( * 关闭指定的选项卡 */ const removeTab = (path: string): void => { + const { home_page } = useUserStore() const targetTab = getTab(path) const targetIndex = findTabIndex(path) @@ -167,9 +168,9 @@ export const useWorktabStore = defineStore( // 如果关闭后无标签页,跳转首页 if (!hasOpenedTabs.value) { - if (path !== HOME_PAGE) { + if (path !== home_page) { current.value = {} - safeRouterPush({ path: HOME_PAGE }) + safeRouterPush({ path: home_page }) } return } @@ -287,12 +288,12 @@ export const useWorktabStore = defineStore( */ const removeAll = (): void => { const hasFixedTabs = opened.value.some((tab) => tab.fixedTab) - + const { home_page } = useUserStore() // 获取可关闭的标签页 const closableTabs = opened.value.filter((tab) => { if (!isTabClosable(tab)) return false // 如果有固定标签,则所有可关闭的都可以关闭;否则保留首页 - return hasFixedTabs || tab.path !== HOME_PAGE + return hasFixedTabs || tab.path !== home_page }) if (closableTabs.length === 0) { @@ -305,18 +306,18 @@ export const useWorktabStore = defineStore( // 保留不可关闭的标签页和首页(当没有固定标签时) opened.value = opened.value.filter((tab) => { - return !isTabClosable(tab) || (!hasFixedTabs && tab.path === HOME_PAGE) + return !isTabClosable(tab) || (!hasFixedTabs && tab.path === home_page) }) // 处理激活状态 if (!hasOpenedTabs.value) { current.value = {} - safeRouterPush({ path: HOME_PAGE }) + safeRouterPush({ path: home_page }) return } // 选择激活的标签页:优先首页,其次第一个可用标签 - const homeTab = opened.value.find((tab) => tab.path === HOME_PAGE) + const homeTab = opened.value.find((tab) => tab.path === home_page) const targetTab = homeTab || opened.value[0] current.value = targetTab diff --git a/src/views/crmpc/customer/index.vue b/src/views/crmpc/customer/index.vue index b791dab..a9229f6 100644 --- a/src/views/crmpc/customer/index.vue +++ b/src/views/crmpc/customer/index.vue @@ -22,12 +22,20 @@ {{ item.name }}
全部 + - {{ item1.name }}({{ item1.count }}) + + {{ item1.name }} + +
@@ -38,12 +46,20 @@ {{ item.name }}
全部 + - {{ item1.name }}({{ item1.count }}) + + {{ item1.name }} + +
@@ -156,12 +172,19 @@ { label: '近三天', value: '1' }, { label: '近七天', value: '2' } ] + // 获取列表数据 + const tagActiveMap = reactive<{ [groupId: string]: string }>({}) //获取标签 type TagGroup = { id: string; name: string; tags: { id: string; name: string; count: number }[] } const tagGroups = ref([]) const tagGrouplistfn = async () => { const res = await CrmService.tagGrouplist({ scene: 'customers' }) tagGroups.value = res || [] + tagGroups.value.forEach((group) => { + if (group.tags && Array.isArray(group.tags)) { + tagActiveMap[group.id] = '' + } + }) } // 计算前3组和更多组 // eslint-disable-next-line vue/valid-define-props @@ -179,8 +202,6 @@ pagination.currentPage = 1 gettableList() }) - // 获取列表数据 - const tagActiveMap = reactive<{ [groupId: string]: string }>({}) const gettableList = async () => { loading.value = true try { @@ -242,11 +263,11 @@ } // 标签选中状态,key为组id,值为选中的标签id function handleTagClick(groupId: string, tagId: string) { - if (tagActiveMap[groupId] === tagId) { - tagActiveMap[groupId] = '' // 取消选中 - } else { - tagActiveMap[groupId] = tagId // 选中 - } + // if (tagActiveMap[groupId] === tagId) { + // tagActiveMap[groupId] = '' // 取消选中 + // } else { + tagActiveMap[groupId] = tagId // 选中 + // } pagination.currentPage = 1 gettableList() } @@ -270,6 +291,13 @@ diff --git a/src/views/system/user-center/index.vue b/src/views/system/user-center/index.vue index e6515ec..bf959f0 100644 --- a/src/views/system/user-center/index.vue +++ b/src/views/system/user-center/index.vue @@ -11,7 +11,7 @@ " />

{{ userInfo.name }}

-

sn:{{ userInfo.sn }}

+

SN:{{ userInfo.sn }}

电 话: @@ -80,7 +80,7 @@ - + @@ -107,6 +107,11 @@ + + + + +