e1f9a259750f387fbaa4b60295f42eaf9b74cfd8..57c6a02c135c1224e9de2766e412eedd4cd18d58
2025-08-29 p-honggang.li
Merge remote-tracking branch 'origin/master'
57c6a0 对比 | 目录
2025-08-29 p-honggang.li
修改配置
ad106d 对比 | 目录
1个文件已添加
3个文件已修改
96 ■■■■ 已修改文件
src/components/fileInfoPreview/index.vue 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/utils/env.ts 65 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/layout/index.vue 23 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/productManage/price/index.vue 6 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/components/fileInfoPreview/index.vue
@@ -6,7 +6,7 @@
        <div v-if="state.fileSuffix == '.doc'" ref="fileT" class="files"></div>
        <div v-if="state.fileSuffix == '.pdf'" style="height: 81vh">
          <iframe
            :src="`/manage/pdfjs/web/viewer.html?file=${encodeURIComponent(pdfurl)}`"
            :src="`/trade/pdfjs/web/viewer.html?file=${encodeURIComponent(pdfurl)}`"
            width="100%"
            height="100%"
          />
src/utils/env.ts
New file
@@ -0,0 +1,65 @@
/**
 * 环境配置管理
 */
// 环境类型枚举
export enum Environment {
  DEVELOPMENT = 'development',
  PRODUCTION = 'production',
  TEST = 'test'
}
// 获取当前环境
export const getCurrentEnvironment = (): Environment => {
  const mode = import.meta.env.MODE
  if (mode === 'development') return Environment.DEVELOPMENT
  if (mode === 'production') return Environment.PRODUCTION
  if (mode === 'test') return Environment.TEST
  return Environment.DEVELOPMENT // 默认开发环境
}
// 是否为开发环境
export const isDevelopment = (): boolean => {
  return import.meta.env.DEV
}
// 是否为生产环境
export const isProduction = (): boolean => {
  return import.meta.env.PROD
}
// 是否为测试环境
export const isTest = (): boolean => {
  return import.meta.env.MODE === 'test'
}
// 菜单显示配置
export const getMenuConfig = () => {
  return {
    // 开发环境显示所有菜单
    showLeftMenu: isDevelopment(),
    showTopMenu: isDevelopment(),
    showHeader: isDevelopment(),
    showFooter: isDevelopment(),
    // 生产环境只显示页面内容
    showPageContent: true
  }
}
// 布局样式配置
export const getLayoutConfig = () => {
  const isDev = isDevelopment()
  return {
    // 主容器高度
    mainContainerHeight: isDev ? 'calc(95vh - 90px)' : '100vh',
    // 是否显示侧边栏
    showSidebar: isDev,
    // 是否显示顶部导航
    showTopNav: isDev,
    // 是否显示头部
    showHeader: isDev,
    // 是否显示底部版权信息
    showFooter: isDev
  }
}
src/views/layout/index.vue
@@ -1,27 +1,30 @@
<template>
  <div class="app-wrapper" :class="classObj">
    <div class="header" style="width: auto; overflow: inherit" v-if="!containerOperate?.specialcontainer">
    <!-- 头部菜单 - 根据环境配置显示 -->
    <div class="header" style="width: auto; overflow: inherit" v-if="!containerOperate?.specialcontainer && menuConfig.showHeader">
      <AppHeader @menuCollapse="changeMenuCollapse"></AppHeader>
    </div>
    <div class="header" style="width: auto; overflow: inherit" v-if="containerOperate?.specialcontainer">
    <div class="header" style="width: auto; overflow: inherit" v-if="containerOperate?.specialcontainer && menuConfig.showHeader">
      <template v-if="currentMenuCode!='activityInitiate'&&currentMenuCode!='activityInitiate6'">
          <AppActHeader ref='appActHeaderRef' ></AppActHeader>
      </template>
    </div>
    <div   :class="containerOperate?.specialcontainer?'content-wrapperall':'content-wrapper'">
      <!-- 左侧菜单 - 根据环境配置显示 -->
      <LeftSidebar
        v-if="!containerOperate?.specialcontainer"
        v-if="!containerOperate?.specialcontainer && menuConfig.showLeftMenu"
        class="sidebar-container"
        :menuState="menuState"
      ></LeftSidebar>
      <div class="main-container">
        <topMenu class="nav-head"  v-if="!containerOperate?.specialcontainer"></topMenu>
        <!-- 顶部菜单 - 根据环境配置显示 -->
        <topMenu class="nav-head"  v-if="!containerOperate?.specialcontainer && menuConfig.showTopMenu"></topMenu>
        <!-- <el-main class="main">
          <Breadcrumb id="breadcrumb" class="breadcrumb" />
        </el-main> -->
        <el-scrollbar
          class="scrollbar-main"
          :style="{ 'max-height': 'calc(95vh - 90px)','min-width':'900px' }"
          :style="{ 'max-height': layoutConfig.mainContainerHeight, 'min-width':'900px' }"
          ref="scrollViewContainer"
        >
          <router-view v-slot="{ Component, route }">
@@ -36,7 +39,8 @@
            </transition>
          </router-view>
        </el-scrollbar>
        <div class="fontDiv">中国交通建设集团有限公司 版权所有</div>
        <!-- 版权信息 - 根据环境配置显示 -->
        <div class="fontDiv" v-if="menuConfig.showFooter">中国交通建设集团有限公司 版权所有</div>
      </div>
    </div>
  </div>
@@ -53,6 +57,8 @@
import { storeToRefs } from 'pinia'
import { useNavTabs } from '@/stores/modules/navTabs'
import { useRoute } from 'vue-router'
// 导入环境配置工具
import { getMenuConfig, getLayoutConfig } from '@/utils/env'
const navTabsStore = useNavTabs()
const appActHeaderRef=ref()
@@ -60,6 +66,11 @@
const { cachedViews, excludeViews } = storeToRefs(navTabsStore)
const scrollViewContainer = ref()
const isRouterAlive = ref<boolean>(true)
// 环境配置
const menuConfig = computed(() => getMenuConfig())
const layoutConfig = computed(() => getLayoutConfig())
const reload = () => {
  isRouterAlive.value = false
  nextTick(() => {
src/views/productManage/price/index.vue
@@ -223,12 +223,6 @@
      </template>
    </el-dialog>
    <!-- 价格查看器 -->
    <ProductPriceViewer
      v-model="showPriceViewer"
      :product-id="currentProductId"
      @order="handleOrderResult"
    />
  </div>
</template>