CEES-manage/src/layouts/default/content/index.vue

67 lines
2.0 KiB
Vue
Raw Normal View History

2021-10-20 14:32:09 +08:00
<template>
<div :class="[prefixCls, getLayoutContentMode]" v-loading="getOpenPageLoading && getPageLoading">
<PageLayout />
2022-03-10 09:47:29 +08:00
<!-- update-begin-author:zyf date:20211129 for:qiankun 挂载子应用盒子 -->
2022-06-10 10:44:44 +08:00
<div id="content" class="app-view-box" v-if="openQianKun == 'true'"></div>
2022-03-10 09:47:29 +08:00
<!-- update-end-author:zyf date:20211129 for: qiankun 挂载子应用盒子-->
2021-10-20 14:32:09 +08:00
</div>
</template>
<script lang="ts">
2022-06-10 10:44:44 +08:00
import { defineComponent, onMounted } from 'vue';
2021-10-20 14:32:09 +08:00
import PageLayout from '/@/layouts/page/index.vue';
import { useDesign } from '/@/hooks/web/useDesign';
import { useRootSetting } from '/@/hooks/setting/useRootSetting';
import { useTransitionSetting } from '/@/hooks/setting/useTransitionSetting';
import { useContentViewHeight } from './useContentViewHeight';
2022-06-10 10:44:44 +08:00
import registerApps from '/@/qiankun';
2022-03-10 09:47:29 +08:00
import { useGlobSetting } from '/@/hooks/setting';
2021-10-20 14:32:09 +08:00
export default defineComponent({
name: 'LayoutContent',
components: { PageLayout },
setup() {
const { prefixCls } = useDesign('layout-content');
const { getOpenPageLoading } = useTransitionSetting();
const { getLayoutContentMode, getPageLoading } = useRootSetting();
2022-03-10 09:47:29 +08:00
const globSetting = useGlobSetting();
2022-06-10 10:44:44 +08:00
const openQianKun = globSetting.openQianKun;
2021-10-20 14:32:09 +08:00
useContentViewHeight();
2022-03-10 09:47:29 +08:00
onMounted(() => {
2022-06-10 10:44:44 +08:00
//注册openQianKun
if (openQianKun == 'true') {
if (!window.qiankunStarted) {
window.qiankunStarted = true;
registerApps();
2022-03-10 09:47:29 +08:00
}
2022-06-10 10:44:44 +08:00
}
2022-03-10 09:47:29 +08:00
});
2021-10-20 14:32:09 +08:00
return {
prefixCls,
2022-03-10 09:47:29 +08:00
openQianKun,
2021-10-20 14:32:09 +08:00
getOpenPageLoading,
getLayoutContentMode,
getPageLoading,
};
},
});
</script>
<style lang="less">
@prefix-cls: ~'@{namespace}-layout-content';
.@{prefix-cls} {
position: relative;
flex: 1 1 auto;
min-height: 0;
&.fixed {
width: 1200px;
margin: 0 auto;
}
&-loading {
position: absolute;
top: 200px;
z-index: @page-loading-z-index;
}
}
</style>