Преглед на файлове

feat: 修改测试服配置

zhouyuhao преди 7 месеца
родител
ревизия
d0055fb502
променени са 4 файла, в които са добавени 59 реда и са изтрити 53 реда
  1. 2 2
      .env.test
  2. 1 0
      package.json
  3. 4 1
      src/components/NotificationMessageCard/src/components/EventCard.vue
  4. 52 50
      vite.config.ts

+ 2 - 2
.env.test

@@ -1,2 +1,2 @@
-VITE_API_HOST = 'https://ra.kerryapex.com/new/online_backend'
-VITE_BASE_URL = '/new/'
+VITE_API_HOST = '/kln/online_backend'
+VITE_BASE_URL = /kln/

+ 1 - 0
package.json

@@ -12,6 +12,7 @@
     "build-only": "vite build",
     "build:dev": "vite build --mode development",
     "build:pro": "vite build --mode product",
+    "build:test": "vite build --mode test",
     "type-check": "vue-tsc --build --force",
     "lint": "eslint . --ext .vue,.js,.jsx,.cjs,.mjs,.ts,.tsx,.cts,.mts --fix --ignore-path .gitignore",
     "format": "prettier --write src/"

+ 4 - 1
src/components/NotificationMessageCard/src/components/EventCard.vue

@@ -23,6 +23,7 @@ interface EventCardPropsData {
   insert_date_format?: string // 用来跳转到System Message详情页
   frequency_type?: string // 用来跳转到System Message详情页
   rules_type?: string // 用来跳转到System Message详情页
+  is_display_hbol: boolean // 是否显示HBOL
   previous?: {
     date: string
     tag: string
@@ -110,7 +111,9 @@ const jumpTracking = (data: EventCardPropsData) => {
         <!-- 除了container类型,其他类型都显示运输方式图标 -->
         <div style="display: inline-block" v-if="data.type !== 'container'">
           <span class="font_family" :class="[`icon-${transportationMode?.[data.mode]}`]"></span>
-          <span @click="jumpTracking(data)" class="no no-link">HBOL: {{ data.no }}</span>
+          <span @click="jumpTracking(data)" class="no no-link"
+            >{{ data.is_display_hbol ? 'HBOL:' : 'MAWB:' }} {{ data.no }}</span
+          >
         </div>
         <!-- container类型显示图标 -->
         <div v-else>

+ 52 - 50
vite.config.ts

@@ -1,5 +1,5 @@
 import { fileURLToPath, URL } from 'node:url'
-import { defineConfig } from 'vite'
+import { defineConfig, loadEnv } from 'vite'
 import vue from '@vitejs/plugin-vue'
 import AutoImport from 'unplugin-auto-import/vite'
 import Components from 'unplugin-vue-components/vite'
@@ -8,56 +8,58 @@ import Icons from 'unplugin-icons/vite'
 import IconsResolver from 'unplugin-icons/resolver'
 
 // https://vitejs.dev/config/
-export default defineConfig({
-  base: `/`,
-  // base: `/k_new_online/`,
-  resolve: {
-    alias: {
-      '@': fileURLToPath(new URL('./src', import.meta.url))
-    }
-  },
-  plugins: [
-    vue(),
-    AutoImport({
-      resolvers: [
-        ElementPlusResolver(),
-        IconsResolver({
-          prefix: 'Icon'
-        })
-      ],
-      imports: [
-        'vue',
-        // 自定义全局引入
-        {
-          // 全局引入"src/api/index.ts"的`default`导出,注册为全局变量`api`
-          // 相当于在每个ts/vue文件中执行了一次 `import api from "@/api/index"`;
-          '@/api/index': [['default', '$api']]
+export default defineConfig((mode) => {
+  const env = loadEnv(mode, process.cwd())
+  return {
+    base: env.VITE_BASE_URL || '/',
+    resolve: {
+      alias: {
+        '@': fileURLToPath(new URL('./src', import.meta.url))
+      }
+    },
+    plugins: [
+      vue(),
+      AutoImport({
+        resolvers: [
+          ElementPlusResolver(),
+          IconsResolver({
+            prefix: 'Icon'
+          })
+        ],
+        imports: [
+          'vue',
+          // 自定义全局引入
+          {
+            // 全局引入"src/api/index.ts"的`default`导出,注册为全局变量`api`
+            // 相当于在每个ts/vue文件中执行了一次 `import api from "@/api/index"`;
+            '@/api/index': [['default', '$api']]
+          }
+        ],
+        dts: './src/auto-imports.d.ts'
+      }),
+      Components({
+        resolvers: [
+          ElementPlusResolver(), // 自动注册图标组件
+          IconsResolver({
+            enabledCollections: ['ep']
+          })
+        ]
+      }),
+      Icons({
+        autoInstall: true
+      })
+    ],
+    server: {
+      port: 80,
+      hmr: true,
+      open: true,
+      // 设置 https 代理
+      proxy: {
+        '/api': {
+          target: 'http://192.168.0.161',
+          changeOrigin: true,
+          rewrite: (path: string) => path.replace(/^\/api/, '')
         }
-      ],
-      dts: './src/auto-imports.d.ts'
-    }),
-    Components({
-      resolvers: [
-        ElementPlusResolver(), // 自动注册图标组件
-        IconsResolver({
-          enabledCollections: ['ep']
-        })
-      ]
-    }),
-    Icons({
-      autoInstall: true
-    })
-  ],
-  server: {
-    port: 80,
-    hmr: true,
-    open: true,
-    // 设置 https 代理
-    proxy: {
-      '/api': {
-        target: 'http://192.168.0.161',
-        changeOrigin: true,
-        rewrite: (path: string) => path.replace(/^\/api/, '')
       }
     }
   }