| | |
| | | ENV = 'development' |
| | | |
| | | # base路径 |
| | | #VITE_BASE_PATH = '/trade-api' |
| | | VITE_BASE_PATH = '/api' |
| | | #VITE_BASE_PATH = '/admin' |
| | | |
| | |
| | | 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'] |
| | |
| | | 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'] |
| | |
| | | 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, |
| | |
| | | // 根据ID获取产品详情 |
| | | getProductById(data: any): ApiPromise { |
| | | return createAxios({ |
| | | baseURL: '/api', |
| | | url: `${url}get`, |
| | | method: 'post', |
| | | data: data, |
| | |
| | | }, |
| | | getCategoryByParent(data: any):ApiPromise{ |
| | | return createAxios({ |
| | | baseURL: '/api', |
| | | url: `${url}categoryByParent`, |
| | | method: 'post', |
| | | data: data, |
| | |
| | | <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%" |
| | | /> |
| | |
| | | import { queryUserDetail } from '@/api/userInfo' |
| | | |
| | | const router = createRouter({ |
| | | history: createWebHistory('/manage/'), |
| | | history: createWebHistory('/trade/'), |
| | | routes: staticRoutes, |
| | | scrollBehavior(to, from, savedPosition) { |
| | | return { top: 0 } |
New file |
| | |
| | | /** |
| | | * 环境配置管理 |
| | | */ |
| | | |
| | | // 环境类型枚举 |
| | | 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 |
| | | } |
| | | } |
| | | |
| | |
| | | <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'&¤tMenuCode!='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 }"> |
| | |
| | | </transition> |
| | | </router-view> |
| | | </el-scrollbar> |
| | | <div class="fontDiv">中国交通建设集团有限公司 版权所有</div> |
| | | <!-- 版权信息 - 根据环境配置显示 --> |
| | | <div class="fontDiv" v-if="menuConfig.showFooter">中国交通建设集团有限公司 版权所有</div> |
| | | </div> |
| | | </div> |
| | | </div> |
| | |
| | | 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() |
| | |
| | | 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(() => { |
| | |
| | | </template> |
| | | </el-dialog> |
| | | |
| | | <!-- 价格查看器 --> |
| | | <ProductPriceViewer |
| | | v-model="showPriceViewer" |
| | | :product-id="currentProductId" |
| | | @order="handleOrderResult" |
| | | /> |
| | | </div> |
| | | </template> |
| | | |
| | |
| | | objectName: fileUrl.split('/').pop(), |
| | | uploadUserId: userId, |
| | | uploadUserName: userName, |
| | | attachmentType: 'TRADE_FILE', |
| | | attachmentType: '其他', |
| | | description: '交易文件' |
| | | } |
| | | |
| | |
| | | objectName: fileUrl.split('/').pop(), |
| | | uploadUserId: userId, |
| | | uploadUserName: userName, |
| | | attachmentType: 'TRADE_FILE', |
| | | attachmentType: '其他', |
| | | description: '交易文件' |
| | | } |
| | | |
| | |
| | | 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', // 李 |
| | |
| | | '@': path.resolve(__dirname, './src'), |
| | | }, |
| | | }, |
| | | base: '/manage/', |
| | | base: '/trade/', |
| | | server: { |
| | | host: '0.0.0.0', |
| | | port: 1000, |