干燥机配套车间生产管理系统/云平台服务端
baoshiwei
2024-05-27 fa3ac93010bea3805438ee3ab0a182bfbf7423da
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
<template>
  <ScrollContainer>
    <div ref="wrapperRef" :class="prefixCls">
      <Tabs tab-position="left" :tabBarStyle="tabBarStyle" @tabClick="componentClick">
        <template v-for="item in settingList" :key="item.key">
          <TabPane>
            <template #tab>
                <span>
                  <Icon :icon="item.icon" class="icon-font-color"/>
                  {{item.name}}
                </span>
            </template>
            <component :is="item.component" v-if="activeKey === item.key" />
          </TabPane>
        </template>
      </Tabs>
    </div>
  </ScrollContainer>
</template>
 
<script lang="ts">
import { ref, defineComponent } from "vue";
import { Tabs } from "ant-design-vue";
import { ScrollContainer } from "/@/components/Container";
import { settingList } from "./UserSetting.data";
import BaseSetting from "./BaseSetting.vue";
import AccountSetting from "./AccountSetting.vue";
import TenantSetting from "./TenantSetting.vue";
import WeChatDingSetting from './WeChatDingSetting.vue';
export default defineComponent({
  components: {
    ScrollContainer,
    Tabs,
    TabPane: Tabs.TabPane,
    BaseSetting,
    AccountSetting,
    TenantSetting,
    WeChatDingSetting,
  }, 
  setup() {
    const activeKey = ref<string>('1');
 
    /**
     * 组件标题点击事件,解决第二次不加载数据
     * @param key
     */
    function componentClick(key) {
      activeKey.value = key;
    }
    
    return {
      prefixCls: "account-setting",
      settingList,
      tabBarStyle: {
        width: "220px",
        marginBottom: "200px"
      },
      componentClick,
      activeKey,
    };
  }
});
</script>
<style lang="less" scoped>
.account-setting {
  margin: 12px;
 
  .base-title {
    padding-left: 0;
  }
 
  .ant-tabs-tab-active {
    background-color: @item-active-bg;
  }
  //tabs弹窗左边样式
  :deep(.ant-tabs-nav){
    background-color: #FFFFFF;
    height: 260px;
  }
  //tabs弹窗右边边样式
  :deep(.ant-tabs-content-holder){
    position: relative;
    left: 12px;
    background: #FFFFFF;
    height: auto !important;
  }
}
//tab点击样式
:deep(.ant-tabs-tab-active){
  border-radius: 0 20px 20px 0;
  background-color: #1294f7!important;
  color: #fff!important;
  .icon-font-color{
    color: #fff;
  }
}
:deep(.ant-tabs-tab.ant-tabs-tab-active .ant-tabs-tab-btn){
  color: white !important;
}
:deep(.ant-tabs-ink-bar){
  visibility: hidden;
}
:deep(.ant-tabs-nav-list){
  padding-top:14px;
  padding-right:14px;
}
.icon-font-color{
  color: #9e9e9e;
}
</style>