Merge remote-tracking branch 'origin/multi-tenant' into multi-tenant
This commit is contained in:
@@ -20,6 +20,7 @@ import {
|
|||||||
import { useRouter } from 'vue-router';
|
import { useRouter } from 'vue-router';
|
||||||
import useLayoutStore from '@/store/modules/layout';
|
import useLayoutStore from '@/store/modules/layout';
|
||||||
import useAppStore from '@/store/modules/app';
|
import useAppStore from '@/store/modules/app';
|
||||||
|
import useUserStore from '@/store/modules/user';
|
||||||
import useRouterStore from '@/store/modules/router';
|
import useRouterStore from '@/store/modules/router';
|
||||||
import useTabsStore from '@/store/modules/tabs';
|
import useTabsStore from '@/store/modules/tabs';
|
||||||
import useI18n from '@/hooks/useI18n';
|
import useI18n from '@/hooks/useI18n';
|
||||||
@@ -64,9 +65,10 @@ watch(
|
|||||||
{ immediate: true }
|
{ immediate: true }
|
||||||
);
|
);
|
||||||
|
|
||||||
// 动态路由添加到菜单面板
|
const menuData = computed(() => {
|
||||||
const rootRoute = router.getRoutes().find(r => r.name === 'Root');
|
// 动态路由添加到菜单面板
|
||||||
if (rootRoute) {
|
const rootRoute = router.getRoutes().find(r => r.name === 'Root');
|
||||||
|
if (rootRoute) {
|
||||||
const children = routerStore.setRootRouterData(rootRoute.children);
|
const children = routerStore.setRootRouterData(rootRoute.children);
|
||||||
const buildRouterData = routerStore.buildRouterData;
|
const buildRouterData = routerStore.buildRouterData;
|
||||||
if (buildRouterData.length > 0) {
|
if (buildRouterData.length > 0) {
|
||||||
@@ -74,9 +76,17 @@ if (rootRoute) {
|
|||||||
} else {
|
} else {
|
||||||
rootRoute.children = children;
|
rootRoute.children = children;
|
||||||
}
|
}
|
||||||
}
|
// console.log(JSON.parse(JSON.stringify(rootRoute.children)));
|
||||||
|
if (!useUserStore().roles.includes('tenant')) {
|
||||||
|
rootRoute.children = rootRoute.children.filter(
|
||||||
|
item => item.name !== 'Index'
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
const { menuData } = getMenuData(clearMenuItem(router.getRoutes()));
|
const { menuData } = getMenuData(clearMenuItem(router.getRoutes()));
|
||||||
|
return menuData;
|
||||||
|
});
|
||||||
|
|
||||||
/**面包屑数据对象,排除根节点和首页不显示 */
|
/**面包屑数据对象,排除根节点和首页不显示 */
|
||||||
const breadcrumb = computed(() => {
|
const breadcrumb = computed(() => {
|
||||||
@@ -214,7 +224,10 @@ function fnGetServerTime() {
|
|||||||
// serverTimeStr.value = parseDateToStr(serverTime.timestamp);
|
// serverTimeStr.value = parseDateToStr(serverTime.timestamp);
|
||||||
// 用DOM直接修改
|
// 用DOM直接修改
|
||||||
if (serverTimeDom) {
|
if (serverTimeDom) {
|
||||||
serverTimeDom.innerText = parseDateToStr(serverTime.timestamp, YYYY_MM_DD_HH_MM_SSZ);
|
serverTimeDom.innerText = parseDateToStr(
|
||||||
|
serverTime.timestamp,
|
||||||
|
YYYY_MM_DD_HH_MM_SSZ
|
||||||
|
);
|
||||||
}
|
}
|
||||||
}, 1000);
|
}, 1000);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -30,14 +30,16 @@ const constantRoutes: RouteRecordRaw[] = [
|
|||||||
path: '/',
|
path: '/',
|
||||||
name: 'Root',
|
name: 'Root',
|
||||||
component: BasicLayout,
|
component: BasicLayout,
|
||||||
redirect: '/monitor/dashboard',
|
redirect: '/index',
|
||||||
|
// redirect: '/monitor/dashboard',
|
||||||
children: [
|
children: [
|
||||||
{
|
{
|
||||||
path: '/index',
|
path: '/index',
|
||||||
name: 'Index',
|
name: 'Index',
|
||||||
meta: { title: 'router.index', icon: 'icon-pcduan', hideInMenu: true },
|
meta: { title: 'router.index', icon: 'icon-pcduan' },
|
||||||
redirect: '/monitor/dashboard',
|
component: () => import('@/views/index.vue'),
|
||||||
// component: () => import('@/views/index.vue'),
|
// meta: { title: 'router.index', icon: 'icon-pcduan', hideInMenu: true },
|
||||||
|
// redirect: '/monitor/dashboard',
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
path: '/account',
|
path: '/account',
|
||||||
|
|||||||
@@ -5,7 +5,6 @@ import BaseInfo from './components/base-info.vue';
|
|||||||
import ResetPasswd from './components/reset-passwd.vue';
|
import ResetPasswd from './components/reset-passwd.vue';
|
||||||
import StyleLayout from './components/style-layout.vue';
|
import StyleLayout from './components/style-layout.vue';
|
||||||
import { useRoute } from 'vue-router';
|
import { useRoute } from 'vue-router';
|
||||||
import { hasRoles } from '@/plugins/auth-user';
|
|
||||||
import useAppStore from '@/store/modules/app';
|
import useAppStore from '@/store/modules/app';
|
||||||
import useI18n from '@/hooks/useI18n';
|
import useI18n from '@/hooks/useI18n';
|
||||||
import useUserStore from '@/store/modules/user';
|
import useUserStore from '@/store/modules/user';
|
||||||
@@ -53,7 +52,7 @@ onActivated(() => {
|
|||||||
<a-tab-pane
|
<a-tab-pane
|
||||||
key="style-layout"
|
key="style-layout"
|
||||||
:tab="t('views.account.settings.styleLayout')"
|
:tab="t('views.account.settings.styleLayout')"
|
||||||
v-if="hasRoles(['admin'])"
|
v-if="false"
|
||||||
>
|
>
|
||||||
<StyleLayout></StyleLayout>
|
<StyleLayout></StyleLayout>
|
||||||
</a-tab-pane>
|
</a-tab-pane>
|
||||||
|
|||||||
@@ -3,6 +3,7 @@ import Index from '@/views/index/tenantIndex.vue';
|
|||||||
import { getConfigKey } from '@/api/system/config';
|
import { getConfigKey } from '@/api/system/config';
|
||||||
import {
|
import {
|
||||||
defineAsyncComponent,
|
defineAsyncComponent,
|
||||||
|
nextTick,
|
||||||
onMounted,
|
onMounted,
|
||||||
ref,
|
ref,
|
||||||
shallowRef,
|
shallowRef,
|
||||||
@@ -11,8 +12,9 @@ import {
|
|||||||
import { RESULT_CODE_SUCCESS } from '@/constants/result-constants';
|
import { RESULT_CODE_SUCCESS } from '@/constants/result-constants';
|
||||||
import useUserStore from '@/store/modules/user';
|
import useUserStore from '@/store/modules/user';
|
||||||
import useLayoutStore from '@/store/modules/layout';
|
import useLayoutStore from '@/store/modules/layout';
|
||||||
|
import { useRouter } from 'vue-router';
|
||||||
const currentComponent = shallowRef<Component | null>(null);
|
const currentComponent = shallowRef<Component | null>(null);
|
||||||
|
const router = useRouter();
|
||||||
const spinning = ref<boolean>(false);
|
const spinning = ref<boolean>(false);
|
||||||
|
|
||||||
/**匹配views里面所有的.vue或.tsx文件 */
|
/**匹配views里面所有的.vue或.tsx文件 */
|
||||||
@@ -48,6 +50,15 @@ onMounted(() => {
|
|||||||
useLayoutStore().changeConf('menuTheme', 'light');
|
useLayoutStore().changeConf('menuTheme', 'light');
|
||||||
useLayoutStore().changeConf('tabRender', false);
|
useLayoutStore().changeConf('tabRender', false);
|
||||||
} else {
|
} else {
|
||||||
|
useLayoutStore().changeConf('layout', 'mix');
|
||||||
|
useLayoutStore().changeConf('menuTheme', 'light');
|
||||||
|
useLayoutStore().changeConf('tabRender', true);
|
||||||
|
|
||||||
|
// location.replace(location.origin);
|
||||||
|
router.replace({ name: 'Monitor_2087' }).finally(() => {
|
||||||
|
nextTick(() => location.reload());
|
||||||
|
});
|
||||||
|
return;
|
||||||
useLayoutStore().changeConf('layout', 'mix');
|
useLayoutStore().changeConf('layout', 'mix');
|
||||||
//获取当前系统设置的首页路径
|
//获取当前系统设置的首页路径
|
||||||
spinning.value = true;
|
spinning.value = true;
|
||||||
|
|||||||
@@ -1,28 +1,29 @@
|
|||||||
<script setup lang="ts">
|
<script setup lang="ts">
|
||||||
import { ref, onMounted, markRaw } from 'vue';
|
import { onMounted } from 'vue';
|
||||||
import { PageContainer } from 'antdv-pro-layout';
|
|
||||||
import useI18n from '@/hooks/useI18n';
|
|
||||||
import UPFTEST from './tenantUPF.vue';
|
import UPFTEST from './tenantUPF.vue';
|
||||||
import MODULE from './moduleInfo.vue';
|
import MODULE from './moduleInfo.vue';
|
||||||
import { upfFlowData } from '../dashboard/overview/hooks/useUPFTotalFlow';
|
|
||||||
|
|
||||||
onMounted(() => {});
|
onMounted(() => {});
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<template>
|
<template>
|
||||||
<PageContainer>
|
<div>
|
||||||
<div style="background-color: #f7f8fc; padding: 20px">
|
<div class="container">
|
||||||
<MODULE />
|
<MODULE />
|
||||||
</div>
|
</div>
|
||||||
|
<div class="container">
|
||||||
<UPFTEST />
|
<UPFTEST />
|
||||||
</PageContainer>
|
</div>
|
||||||
|
</div>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<style lang="less" scoped>
|
<style lang="less" scoped>
|
||||||
.cardClass {
|
.container {
|
||||||
height: 100%;
|
background-color: #fff;
|
||||||
width: 100%;
|
margin: 40px;
|
||||||
border-radius: 10px;
|
border-radius: 6px;
|
||||||
|
}
|
||||||
|
[data-theme='dark'] .container {
|
||||||
|
background-color: #141414;
|
||||||
}
|
}
|
||||||
</style>
|
</style>
|
||||||
|
|||||||
@@ -262,6 +262,8 @@ function fnGetInitData() {
|
|||||||
}
|
}
|
||||||
})
|
})
|
||||||
.finally(() => {
|
.finally(() => {
|
||||||
|
// reSendUPF(selectRmUid.value);
|
||||||
|
// upfFlowParse({});
|
||||||
handleRanderChart();
|
handleRanderChart();
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
@@ -302,7 +304,6 @@ onUnmounted(() => {
|
|||||||
</script>
|
</script>
|
||||||
|
|
||||||
<template>
|
<template>
|
||||||
<div style="background-color: #f7f8fc; padding: 20px">
|
|
||||||
<a-card
|
<a-card
|
||||||
:bordered="false"
|
:bordered="false"
|
||||||
class="cardClass"
|
class="cardClass"
|
||||||
@@ -324,7 +325,6 @@ onUnmounted(() => {
|
|||||||
|
|
||||||
<div ref="upfFlow" style="padding: 24px" class="chart-container"></div>
|
<div ref="upfFlow" style="padding: 24px" class="chart-container"></div>
|
||||||
</a-card>
|
</a-card>
|
||||||
</div>
|
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<style lang="less" scoped>
|
<style lang="less" scoped>
|
||||||
|
|||||||
Reference in New Issue
Block a user