1个文件已添加
9个文件已修改
120 ■■■■ 已修改文件
.env.development 1 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
components.d.ts 6 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/api/productApi.ts 5 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/components/fileInfoPreview/index.vue 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/router/index.ts 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/utils/env.ts 65 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/layout/index.vue 23 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/productManage/price/index.vue 6 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/tradeManage/upload/index.vue 4 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
vite.config.ts 6 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
.env.development
@@ -2,6 +2,7 @@
ENV = 'development'
# base路径
#VITE_BASE_PATH = '/trade-api'
VITE_BASE_PATH = '/api'
#VITE_BASE_PATH = '/admin'
components.d.ts
@@ -12,8 +12,6 @@
    Editor: typeof import('./src/components/Editor/src/Editor.vue')['default']
    ElButton: typeof import('element-plus/es')['ElButton']
    ElCard: typeof import('element-plus/es')['ElCard']
    ElCheckbox: typeof import('element-plus/es')['ElCheckbox']
    ElCol: typeof import('element-plus/es')['ElCol']
    ElConfigProvider: typeof import('element-plus/es')['ElConfigProvider']
    ElDatePicker: typeof import('element-plus/es')['ElDatePicker']
    ElDescriptions: typeof import('element-plus/es')['ElDescriptions']
@@ -33,10 +31,6 @@
    ElMenuItem: typeof import('element-plus/es')['ElMenuItem']
    ElOption: typeof import('element-plus/es')['ElOption']
    ElPagination: typeof import('element-plus/es')['ElPagination']
    ElRadio: typeof import('element-plus/es')['ElRadio']
    ElRadioButton: typeof import('element-plus/es')['ElRadioButton']
    ElRadioGroup: typeof import('element-plus/es')['ElRadioGroup']
    ElRow: typeof import('element-plus/es')['ElRow']
    ElScrollbar: typeof import('element-plus/es')['ElScrollbar']
    ElSelect: typeof import('element-plus/es')['ElSelect']
    ElStep: typeof import('element-plus/es')['ElStep']
src/api/productApi.ts
@@ -1,11 +1,12 @@
import createAxios from '@/utils/axios'
let url = '/test/report/product/'
let url = '/report/product/'
const productApi = {
    // 获取产品列表
    getProductList(data: any): ApiPromise {
        return createAxios({
            baseURL: '/api',
            url: `${url}accessApplyList`,
            method: 'POST',
            data: data,
@@ -15,6 +16,7 @@
    // 根据ID获取产品详情
    getProductById(data: any): ApiPromise {
        return createAxios({
            baseURL: '/api',
            url: `${url}get`,
            method: 'post',
            data: data,
@@ -22,6 +24,7 @@
    },
   getCategoryByParent(data: any):ApiPromise{
    return createAxios({
        baseURL: '/api',
        url: `${url}categoryByParent`,
        method: 'post',
        data: data,
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/router/index.ts
@@ -15,7 +15,7 @@
import { queryUserDetail } from '@/api/userInfo'
const router = createRouter({
  history: createWebHistory('/manage/'),
  history: createWebHistory('/trade/'),
  routes: staticRoutes,
  scrollBehavior(to, from, savedPosition) {
    return { top: 0 }
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>
src/views/tradeManage/upload/index.vue
@@ -579,7 +579,7 @@
          objectName: fileUrl.split('/').pop(),
          uploadUserId: userId,
          uploadUserName: userName,
          attachmentType: 'TRADE_FILE',
          attachmentType: '其他',
          description: '交易文件'
        }
@@ -852,7 +852,7 @@
      objectName: fileUrl.split('/').pop(),
      uploadUserId: userId,
      uploadUserName: userName,
      attachmentType: 'TRADE_FILE',
      attachmentType: '其他',
      description: '交易文件'
    }
vite.config.ts
@@ -17,10 +17,10 @@
const viteConfig = ({ mode }: ConfigEnv): UserConfig => {
  let proxy: Record<string, string | ProxyOptions> = {}
  proxy = {
    '/api/test': {
    '/api/report': {
      target: 'http://36.133.126.111:7099',
      changeOrigin: true,
      rewrite: (path) => path.replace(/^\/api\/test/, '/api'),
      // rewrite: (path) => path.replace(/^\/api/, '/'),
    },
    '/api': {
      // target: 'http://192.168.0.38:8088', // 李
@@ -77,7 +77,7 @@
        '@': path.resolve(__dirname, './src'),
      },
    },
    base: '/manage/',
    base: '/trade/',
    server: {
      host: '0.0.0.0',
      port: 1000,