fix: 格式化 UserSetting 文件

pull/960/head
ykcory 2023-12-28 06:40:44 +08:00
parent 6a97711ec9
commit 2a960133ac
1 changed files with 149 additions and 145 deletions

View File

@ -1,18 +1,24 @@
<template> <template>
<ScrollContainer> <ScrollContainer>
<div ref="wrapperRef" class="user-account-setting" :class="[prefixCls,activeKey==5?'vip-background':'']"> <div ref="wrapperRef" class="user-account-setting" :class="[prefixCls, activeKey == 5 ? 'vip-background' : '']">
<Tabs tab-position="left" :tabBarStyle="tabBarStyle" @tabClick="componentClick" v-model:activeKey="activeKey" :class="showVip?'vip-height':''"> <Tabs
tab-position="left"
:tabBarStyle="tabBarStyle"
@tabClick="componentClick"
v-model:activeKey="activeKey"
:class="showVip ? 'vip-height' : ''"
>
<template v-for="item in componentList" :key="item.key"> <template v-for="item in componentList" :key="item.key">
<TabPane> <TabPane>
<template #tab> <template #tab>
<span style="display:flex;align-items: center;cursor: pointer"> <span style="display: flex; align-items: center; cursor: pointer">
<!--<Icon :icon="item.icon" class="icon-font-color"/>--> <!--<Icon :icon="item.icon" class="icon-font-color"/>-->
<span style="width: 30px"> <span style="width: 30px">
<img v-if="activeKey === item.key || isDark" :src="item.img2" style="height: 18px"/> <img v-if="activeKey === item.key || isDark" :src="item.img2" style="height: 18px" />
<img v-else :src="item.img1" style="height: 16px"/> <img v-else :src="item.img1" style="height: 16px" />
</span>
{{item.name}}
</span> </span>
{{ item.name }}
</span>
</template> </template>
<component :is="item.component" v-if="activeKey === item.key" /> <component :is="item.component" v-if="activeKey === item.key" />
</TabPane> </TabPane>
@ -23,155 +29,153 @@
</template> </template>
<script lang="ts"> <script lang="ts">
import { ref, defineComponent, onMounted, provide, computed } from "vue"; import { ref, defineComponent, onMounted, computed } from 'vue';
import { Tabs } from "ant-design-vue"; import { Tabs } from 'ant-design-vue';
import { ScrollContainer } from "/@/components/Container"; import { ScrollContainer } from '/@/components/Container';
import { settingList } from "./UserSetting.data"; import { settingList } from './UserSetting.data';
import BaseSetting from "./BaseSetting.vue"; import BaseSetting from './BaseSetting.vue';
import AccountSetting from "./AccountSetting.vue"; import AccountSetting from './AccountSetting.vue';
import TenantSetting from "./TenantSetting.vue"; import TenantSetting from './TenantSetting.vue';
import WeChatDingSetting from './WeChatDingSetting.vue'; import WeChatDingSetting from './WeChatDingSetting.vue';
import { useRouter } from "vue-router"; import { useRouter } from 'vue-router';
import { useDesign } from '/@/hooks/web/useDesign'; import { useDesign } from '/@/hooks/web/useDesign';
import {useRootSetting} from "/@/hooks/setting/useRootSetting"; import { useRootSetting } from '/@/hooks/setting/useRootSetting';
import {ThemeEnum} from "/@/enums/appEnum"; import { ThemeEnum } from '/@/enums/appEnum';
export default defineComponent({ export default defineComponent({
components: { components: {
ScrollContainer, ScrollContainer,
Tabs, Tabs,
TabPane: Tabs.TabPane, TabPane: Tabs.TabPane,
BaseSetting, BaseSetting,
AccountSetting, AccountSetting,
TenantSetting, TenantSetting,
WeChatDingSetting, WeChatDingSetting,
}, },
setup() { setup() {
const { prefixCls } = useDesign('user-account-setting-container'); const { prefixCls } = useDesign('user-account-setting-container');
const { getDarkMode} = useRootSetting(); const { getDarkMode } = useRootSetting();
const isDark = computed(() => getDarkMode.value === ThemeEnum.DARK); const isDark = computed(() => getDarkMode.value === ThemeEnum.DARK);
const activeKey = ref<string>('1'); const activeKey = ref<string>('1');
//vip //vip
const showVip = ref<boolean>(false); const showVip = ref<boolean>(false);
//vip const router = useRouter();
const vipCode = ref<string>(''); const componentList = computed(() => {
const router = useRouter(); if (showVip.value) {
const componentList = computed(()=>{ return settingList;
if(showVip.value){ }
return settingList; return settingList.filter((item) => item.component != 'MyVipSetting');
} });
return settingList.filter((item)=> item.component != 'MyVipSetting');
})
/** /**
* 组件标题点击事件,解决第二次不加载数据 * 组件标题点击事件,解决第二次不加载数据
* @param key * @param key
*/ */
function componentClick(key) { function componentClick(key) {
activeKey.value = key; activeKey.value = key;
} }
function goToMyTeantPage(){ function goToMyTeantPage() {
//update-begin---author:wangshuai ---date:20230721 forQQYUN-5726------------ //update-begin---author:wangshuai ---date:20230721 forQQYUN-5726------------
// //
let query = router.currentRoute.value.query; let query = router.currentRoute.value.query;
if(query && query.page === 'tenantSetting'){ if (query && query.page === 'tenantSetting') {
activeKey.value = "2"; activeKey.value = '2';
}
//update-end---author:wangshuai ---date:20230721 forQQYUN-5726------------
} }
//update-end---author:wangshuai ---date:20230721 forQQYUN-5726------------ onMounted(() => {
} goToMyTeantPage();
onMounted(()=>{ if (router.currentRoute.value.fullPath == '/system/usersetting') {
goToMyTeantPage(); showVip.value = false;
if(router.currentRoute.value.fullPath == '/system/usersetting'){ return;
showVip.value = false; }
return; showVip.value = true;
} });
showVip.value = true; return {
}) prefixCls,
return { settingList,
prefixCls, tabBarStyle: {
settingList, width: '220px',
tabBarStyle: { marginBottom: '200px',
width: "220px", },
marginBottom: "200px" componentClick,
}, activeKey,
componentClick, showVip,
activeKey, componentList,
showVip, isDark,
componentList, };
isDark },
}; });
}
});
</script> </script>
<style lang="less" scoped> <style lang="less" scoped>
.user-account-setting { .user-account-setting {
margin: 20px; margin: 20px;
.base-title { .base-title {
padding-left: 0; padding-left: 0;
}
//tabs
:deep(.ant-tabs-nav) {
height: 260px;
}
//tabs
:deep(.ant-tabs-content-holder) {
position: relative;
left: 12px;
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;
} }
//tabs .vip-height {
:deep(.ant-tabs-nav){ //tabs
height: 260px; :deep(.ant-tabs-nav) {
height: 310px !important;
}
} }
//tabs .vip-background {
:deep(.ant-tabs-content-holder){ :deep(.ant-tabs-content-holder) {
position: relative; background: transparent;
left: 12px; }
height: auto !important; :deep(.ant-tabs-tabpane) {
padding-left: 0 !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;
}
.vip-height{
//tabs
:deep(.ant-tabs-nav){
height: 310px !important;
}
}
.vip-background{
:deep(.ant-tabs-content-holder){
background: transparent;
}
:deep(.ant-tabs-tabpane){
padding-left: 0 !important;
}
}
</style> </style>
<style lang="less"> <style lang="less">
@prefix-cls: ~'@{namespace}-user-account-setting-container'; @prefix-cls: ~'@{namespace}-user-account-setting-container';
.@{prefix-cls} { .@{prefix-cls} {
.ant-tabs-tab-active { .ant-tabs-tab-active {
background-color: @item-active-bg; background-color: @item-active-bg;
}
//tabs
.ant-tabs-nav {
background-color: @component-background;
}
//tabs
.ant-tabs-content-holder {
background: @component-background;
}
} }
//tabs
.ant-tabs-nav{
background-color: @component-background;
}
//tabs
.ant-tabs-content-holder{
background: @component-background;
}
}
</style> </style>