Files
maintenance_system/src/layout/components/AppMain.vue
re-JZzzz febbcb3241 fix: 修复样式和组件问题并增强数据图表功能
修复多个组件中的::v-deep语法错误和el-row的gutter属性绑定
将el-button的type="text"更新为link类型
在AppMain.vue中添加div包裹keep-alive以解决过渡问题
增强DataAnalysis组件的数据处理能力,添加计算属性和默认值
添加fetchChuRuKuCountBarData调用以完善库存管理功能
2025-10-09 20:22:04 +08:00

102 lines
2.1 KiB
Vue

<template>
<section class="app-main">
<router-view v-slot="{ Component, route }">
<transition :enter-active-class="animate" mode="out-in">
<div>
<keep-alive :include="tagsViewStore.cachedViews">
<component :is="Component" v-if="!route.meta.link" :key="route.path" />
</keep-alive>
</div>
</transition>
</router-view>
<iframe-toggle />
</section>
</template>
<script setup name="AppMain" lang="ts">
import { useSettingsStore } from '@/store/modules/settings';
import { useTagsViewStore } from '@/store/modules/tagsView';
import IframeToggle from './IframeToggle/index.vue';
const { proxy } = getCurrentInstance() as ComponentInternalInstance;
const route = useRoute();
const tagsViewStore = useTagsViewStore();
// 随机动画集合
const animate = ref<string>('');
const animationEnable = ref(useSettingsStore().animationEnable);
watch(
() => useSettingsStore().animationEnable,
(val: boolean) => {
animationEnable.value = val;
if (val) {
animate.value = proxy?.animate.animateList[Math.round(Math.random() * proxy?.animate.animateList.length)] as string;
} else {
animate.value = proxy?.animate.defaultAnimate as string;
}
},
{ immediate: true }
);
onMounted(() => {
addIframe();
});
watchEffect(() => {
addIframe();
});
function addIframe() {
if (route.meta.link) {
useTagsViewStore().addIframeView(route);
}
}
</script>
<style lang="scss" scoped>
.app-main {
/* 50= navbar 50 */
min-height: calc(100vh - 50px);
width: 100%;
position: relative;
overflow: hidden;
}
.fixed-header + .app-main {
padding-top: 50px;
}
.hasTagsView {
.app-main {
/* 84 = navbar + tags-view = 50 + 34 */
min-height: calc(100vh - 84px);
}
.fixed-header + .app-main {
padding-top: 84px;
}
}
</style>
<style lang="scss">
// fix css style bug in open el-dialog
.el-popup-parent--hidden {
.fixed-header {
padding-right: 6px;
}
}
::-webkit-scrollbar {
width: 6px;
height: 6px;
}
::-webkit-scrollbar-track {
background-color: #f1f1f1;
}
::-webkit-scrollbar-thumb {
background-color: #c0c0c0;
border-radius: 3px;
}
</style>