|
@@ -1,17 +1,80 @@
|
|
|
<template>
|
|
|
- <slideMenu :activeName="activeName" @change-item="item => activeName = item.name" />
|
|
|
- <!-- 123123123 -->
|
|
|
- <component :is="component"></component>
|
|
|
+ <div class="imiate">
|
|
|
+ <div :class="{ hideLeft: !custom.showLeftPano }">
|
|
|
+ <slideMenu :activeName="activeName" @change-item="item => activeName = item.name" />
|
|
|
+ <component :is="component" v-if="component"></component>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
</template>
|
|
|
|
|
|
<script lang="ts" setup>
|
|
|
+import { useViewStack } from '@/hook';
|
|
|
import slideMenu from '@/layout/show/slide-menu.vue';
|
|
|
import { getRouteConfig, RoutesName } from '@/router'
|
|
|
-import { computed, ref } from 'vue';
|
|
|
+import { ref, shallowRef, watch, watchEffect } from 'vue';
|
|
|
+import { togetherCallback } from '@/utils'
|
|
|
+import {
|
|
|
+ custom,
|
|
|
+ showLeftCtrlPanoStack,
|
|
|
+ showLeftPanoStack,
|
|
|
+ showRightCtrlPanoStack,
|
|
|
+ showRightPanoStack
|
|
|
+} from '@/env'
|
|
|
+
|
|
|
+import type { Component } from 'vue'
|
|
|
+import { currentModel } from '@/model';
|
|
|
|
|
|
const activeName = ref(RoutesName.summaryShow)
|
|
|
-const component = computed(() => {
|
|
|
+const component = shallowRef<Component | null>(null)
|
|
|
+
|
|
|
+watchEffect(() => {
|
|
|
const route = getRouteConfig(activeName.value)
|
|
|
- return route?.component
|
|
|
+ route?.component().then(comp => component.value = comp.default)
|
|
|
+})
|
|
|
+
|
|
|
+const showLeftPano = ref(false)
|
|
|
+
|
|
|
+watch(currentModel, () => {
|
|
|
+ if (currentModel.value) {
|
|
|
+ showLeftPano.value = false
|
|
|
+ }
|
|
|
+})
|
|
|
+
|
|
|
+useViewStack(() => {
|
|
|
+ const style = document.createElement('style')
|
|
|
+ style.type = 'text/css'
|
|
|
+ style.textContent = `
|
|
|
+ #app {
|
|
|
+ --editor-menu-width: 80px;
|
|
|
+ }
|
|
|
+ #app .edit-mode {
|
|
|
+ --editor-menu-left: 0px;
|
|
|
+ }
|
|
|
+ #app .hideLeft {
|
|
|
+ --editor-menu-left: calc(-1 * var(--editor-menu-width));
|
|
|
+ --left-pano-left: calc(var(--editor-menu-left) + var(--editor-menu-width) - var(--left-pano-width)) !important
|
|
|
+ }
|
|
|
+ #app .ctrl-pano-c,
|
|
|
+ #app .left-pano,
|
|
|
+ #app .ui-editor-toolbox {
|
|
|
+ display: none;
|
|
|
+ }
|
|
|
+ #app .imiate .ctrl-pano-c,
|
|
|
+ #app .imiate .ui-editor-toolbox {
|
|
|
+ display: flex;
|
|
|
+ }
|
|
|
+ #app .imiate .left-pano {
|
|
|
+ display: block;
|
|
|
+ }
|
|
|
+ `
|
|
|
+ document.head.appendChild(style)
|
|
|
+
|
|
|
+ return togetherCallback([
|
|
|
+ showLeftCtrlPanoStack.push(ref(true)),
|
|
|
+ showLeftPanoStack.push(showLeftPano),
|
|
|
+ showRightCtrlPanoStack.push(ref(true)),
|
|
|
+ showRightPanoStack.push(ref(false)),
|
|
|
+ () => document.head.removeChild(style)
|
|
|
+ ])
|
|
|
})
|
|
|
-</script>
|
|
|
+</script>
|