riku
2025-09-18 c1d2051abc8ca88cd07f0d7c56c0dbf8165d5c33
src/views/fysp/data-product/base-data-product/ProdManage.vue
@@ -5,7 +5,6 @@
      default-active="scene"
      ellipsis
      mode="horizontal"
      style="max-width: 600px; background-color: aliceblue"
    >
      <el-menu-item
        v-for="item in menu"
@@ -16,7 +15,7 @@
      >
    </el-menu>
  </el-affix>
  <router-view v-slot="{ Component, route }" :style="'height: ' + height">
  <router-view v-slot="{ Component, route }" :style="{ height: height + 'px' }">
    <keep-alive>
      <component
        v-if="route.meta.keepAlive"
@@ -28,14 +27,16 @@
  </router-view>
</template>
<script setup>
import { ref, onMounted, provide } from 'vue';
import { ref, onMounted, provide, inject, computed } from 'vue';
import { useRouter, useRoute } from 'vue-router';
const contentMaxHeight = inject('contentMaxHeight');
const router = useRouter();
const route = useRoute();
const menuRef = ref(null);
const height = ref('calc(100vh - 64px)');
const height = ref(contentMaxHeight.value);
const menu = ref([
  {
@@ -48,7 +49,7 @@
    path: 'evaluate'
  },
  {
    name: '巡查信息',
    name: '整改清单',
    path: 'inspection'
  },
  {
@@ -67,7 +68,8 @@
function calcTableHeight() {
  const h = menuRef.value.$el.offsetHeight;
  return `calc(100vh - ${h}px - 60px - var(--el-main-padding) * 2)`;
  return contentMaxHeight.value - h;
  // return `calc(100vh - ${h}px - 60px - var(--el-main-padding) * 2)`;
}
onMounted(() => {
@@ -75,6 +77,9 @@
});
// 提供给内部组件视图最大高度
provide('viewHeight', height);
provide(
  'viewHeight',
  computed(() => height.value)
);
</script>
<style scoped></style>