فهرست منبع

feat: 解决打包错误问题

zhouyuhao 1 سال پیش
والد
کامیت
5c7b12f0aa

+ 2 - 2
package.json

@@ -46,7 +46,7 @@
     "@types/leaflet": "^1.9.12",
     "@types/lodash": "^4.17.7",
     "@types/node": "^20.14.5",
-    "@vitejs/plugin-vue": "^5.0.5",
+    "@vitejs/plugin-vue": "^5.1.4",
     "@vue/eslint-config-prettier": "^9.0.0",
     "@vue/eslint-config-typescript": "^13.0.0",
     "@vue/tsconfig": "^0.5.1",
@@ -60,7 +60,7 @@
     "sass": "^1.79.4",
     "typescript": "~5.4.0",
     "unplugin-auto-import": "^0.18.2",
-    "unplugin-icons": "^0.19.2",
+    "unplugin-icons": "^0.19.3",
     "unplugin-vue-components": "^0.27.4",
     "vite": "^5.3.1",
     "vue-tsc": "^2.0.21"

+ 1 - 1
src/components/ScoringGrade/src/ScoringGrade.vue

@@ -309,4 +309,4 @@ const submitDetails = (val: any) => {
 .result {
   height: 578px;
 }
-</style>
+</style>

+ 1 - 1
src/router/index.ts

@@ -2,7 +2,7 @@ import { createRouter, createWebHistory } from 'vue-router'
 import { useUserStore } from '@/stores/modules/user'
 
 const router = createRouter({
-  history: createWebHistory(import.meta.env.BASE_URL),
+  history: createWebHistory('/k_new_online/'),
   routes: [
     {
       path: '/',

+ 0 - 11
src/views/Booking/src/components/BookingTable/src/components/DownloadDialog.vue

@@ -140,17 +140,6 @@ defineExpose({
       font-size: 12px;
     }
 
-    .el-icon {
-      margin-left: 4px;
-      color: var(--color-theme);
-      transform: rotate(0deg);
-      transition: all 0.3s;
-
-      &.is-rotate {
-        transform: rotate(180deg);
-      }
-    }
-
     .select-columns {
       padding: 8px;
       margin-top: 8px;

+ 1 - 1
src/views/Dashboard/src/components/ScoringSystem.vue

@@ -563,4 +563,4 @@ const submitDetails = (val: any) => {
 .el-radio {
   margin-right: 0;
 }
-</style>
+</style>

+ 0 - 9
src/views/Login/src/loginView.vue

@@ -156,20 +156,11 @@ const handleDeleteEmailTips = (type?: any) => {
 }
 
 const errorTipsRef = ref()
-
-const handleChangeStatus = (newStatus: string) => {
-  status.value = newStatus
-}
-const test = () => {
-  status.value = 'changePwd'
-  router.push('/reset-password')
-}
 </script>
 
 <template>
   <div class="login">
     <ScoringSystem class="scoring-system"></ScoringSystem>
-    <el-button @click="test">测试</el-button>
     <el-card class="login-card" v-if="status === 'login'">
       <div class="title">
         <span class="welcome">Welcome to KLN Portal</span>

+ 2 - 0
src/views/Tracking/src/components/TrackingTable/src/TrackingTable.vue

@@ -431,6 +431,8 @@ defineExpose({
           background
           layout="sizes, prev, pager, next"
           :total="pageInfo.total"
+          @size-change="getTableData(false, true)"
+          @current-change="getTableData(false, true)"
         />
       </div>
     </div>

+ 0 - 11
src/views/Tracking/src/components/TrackingTable/src/components/DownloadDialog.vue

@@ -139,17 +139,6 @@ defineExpose({
       font-size: 12px;
     }
 
-    .el-icon {
-      margin-left: 4px;
-      color: var(--color-theme);
-      transform: rotate(0deg);
-      transition: all 0.3s;
-
-      &.is-rotate {
-        transform: rotate(180deg);
-      }
-    }
-
     .select-columns {
       padding: 8px;
       margin-top: 8px;

+ 1 - 0
src/views/Tracking/src/components/TrackingTable/src/components/VGMView.vue

@@ -55,6 +55,7 @@ const generalInfo = ref({
 const tableRef = ref<VxeGridInstance | null>(null)
 const tableData = ref<VxeGridProps<any>>({
   minHeight: 70,
+  height: '330',
   border: true,
   round: true,
   columns: [],

+ 9 - 14
vite.config.ts

@@ -1,18 +1,18 @@
+import { fileURLToPath, URL } from 'node:url'
 import { defineConfig } from 'vite'
 import vue from '@vitejs/plugin-vue'
 import AutoImport from 'unplugin-auto-import/vite'
 import Components from 'unplugin-vue-components/vite'
 import { ElementPlusResolver } from 'unplugin-vue-components/resolvers'
 import Icons from 'unplugin-icons/vite'
-import IconsResolver from 'unplugin-icons/resolvers'
-import path from 'path'
+import IconsResolver from 'unplugin-icons/resolver'
 
 // https://vitejs.dev/config/
 export default defineConfig({
-  base: './',
+  base: '/k_new_online/',
   resolve: {
     alias: {
-      '@': path.resolve(__dirname, './src')
+      '@': fileURLToPath(new URL('./src', import.meta.url))
     }
   },
   plugins: [
@@ -26,7 +26,10 @@ export default defineConfig({
       ],
       imports: [
         'vue',
+        // 自定义全局引入
         {
+          // 全局引入"src/api/index.ts"的`default`导出,注册为全局变量`api`
+          // 相当于在每个ts/vue文件中执行了一次 `import api from "@/api/index"`;
           '@/api/index': [['default', '$api']]
         }
       ],
@@ -34,7 +37,7 @@ export default defineConfig({
     }),
     Components({
       resolvers: [
-        ElementPlusResolver(),
+        ElementPlusResolver(), // 自动注册图标组件
         IconsResolver({
           enabledCollections: ['ep']
         })
@@ -48,6 +51,7 @@ export default defineConfig({
     port: 80,
     hmr: true,
     open: true,
+    // 设置 https 代理
     proxy: {
       '/api': {
         target: 'http://192.168.0.161',
@@ -55,14 +59,5 @@ export default defineConfig({
         rewrite: (path: string) => path.replace(/^\/api/, '')
       }
     }
-  },
-  build: {
-    rollupOptions: {
-      output: {
-        entryFileNames: `[name].[hash].js`,
-        chunkFileNames: `[name].[hash].js`,
-        assetFileNames: `[name].[hash].[ext]`
-      }
-    }
   }
 })