Sanakey
3 天以前 b5c1614fe473330ceca8b7cff0f1802e19bd5039
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
<template>
  <PageWrapper title="客户设置" :class="`${prefixCls}`" dense contentFullHeight fixedHeight>
  <div class="px-20px">
    <a-tabs v-model:activeKey="activeKey">
      <template v-for="item in tabList" :key="item.key">
        <a-tab-pane :tab="item.name">
          <ScrollContainer class="scroll-wrap">
            <component :is="tabs[item.component]" />
          </ScrollContainer>
        </a-tab-pane>
      </template>
    </a-tabs>
<!--    <a-tabs v-model:activeKey="activeKey">-->
<!--      <a-tab-pane key="1" tab="移入公海规则">-->
<!--        <PublicPoolRule v-if="activeKey === '1'"></PublicPoolRule>-->
<!--      </a-tab-pane>-->
<!--      <a-tab-pane key="2" tab="分组设置" force-render>-->
<!--        <MailboxManagement v-if="activeKey === '2'"></MailboxManagement>-->
<!--      </a-tab-pane>-->
<!--      <a-tab-pane key="3" tab="标签管理"-->
<!--      ><QuickText v-if="activeKey === '3'"></QuickText-->
<!--      ></a-tab-pane>-->
<!--      <a-tab-pane key="4" tab="客户来源"><Folder v-if="activeKey === '4'" /></a-tab-pane>-->
<!--    </a-tabs>-->
  </div>
  </PageWrapper>
</template>
 
<script lang="ts" setup>
import { PageWrapper } from '@/components/Page';
import PublicPoolRule from "./settings/PublicPoolRule.vue";
import Group from "./settings/Group.vue";
import Tags from "./settings/Tags.vue";
import From from "./settings/From.vue";
import QuickText from "@/views/email/Utils/quickText.vue";
import MailboxManagement from "@/views/email/Utils/mailboxManagement.vue";
import Convention from "@/views/email/Utils/convention.vue";
import Label from "@/views/email/Utils/label.vue";
import Blacklist from "@/views/email/Utils/blacklist.vue";
import Folder from "@/views/email/Utils/folder.vue";
import {useDesign} from "@/hooks/web/useDesign";
import {ref,onMounted} from "vue";
import { useRoute } from 'vue-router';
import ScrollContainer from "@/components/Container/src/ScrollContainer.vue";
 
const {prefixCls} = useDesign('customer-settings');
const activeKey = ref('1');
 
const tabs = {
  PublicPoolRule,
  Group,
  Tags,
  From,
  MailboxManagement,
  QuickText,
  Label,
  Convention,
  Folder,
  Blacklist,
}
 
const tabList = [
  {
    key: '1',
    name: '移入公海规则',
    component: 'PublicPoolRule',
  },
  {
    key: '2',
    name: '分组设置',
    component: 'Group',
  },
  {
    key: '3',
    name: '标签管理',
    component: 'Tags',
  },
  {
    key: '4',
    name: '客户来源',
    component: 'From',
  },
  // {
  //   key: '4',
  //   name: '文件夹',
  //   component: 'Folder',
  // },
  // {
  //   key: '6',
  //   name: '黑名单',
  //   component: 'Blacklist',
  // },
];
 
const route = useRoute();
const urlParams = {};
 
onMounted(() => {
  // 将路由的查询参数复制到响应式对象
  for (const [key, value] of Object.entries(route.query)) {
    urlParams[key] = value;
  }
  Logger.info('urlParams', urlParams);
  activeKey.value = urlParams['tab'] || '1';
  Logger.info('activeKey', activeKey);
});
 
</script>
 
<style lang="less" scoped>
@prefix-cls: ~'@{namespace}-customer-settings';
.@{prefix-cls} {
  background-color: var(--component-background-color);
  :deep(.ant-page-header) {
    padding: 15px 24px;
  }
  .scroll-wrap{
    height: calc(100vh - 220px);
  }
}
</style>