Răsfoiți Sursa

feat: 修改打包后浏览器

zhouyuhao 1 an în urmă
părinte
comite
f8bce21350

+ 1 - 1
src/api/module/tracking.ts

@@ -97,7 +97,7 @@ export const getVGMData = (params: any, config: any) => {
  * 保存 vgm页面数据
  */
 export const saveVGMData = (params: any, config: any) => {
-  return HttpAxios.get(
+  return HttpAxios.post(
     `${baseUrl}`,
     {
       action: 'ocean_order',

+ 1 - 1
src/utils/table.ts

@@ -17,7 +17,7 @@ export const autoWidth = (tableData: VxeGridProps, grid: VxeGridInstance) => {
       let width = 0
       const field = column.field
       // 判断表头的宽度
-      if (column.title.length < 10) {
+      if (column.title.length < 12) {
         width = column.title.length * 11 + 40
       } else if (column.title.length < 20) {
         width = column.title.length * 8 + 40

+ 2 - 2
src/views/Booking/src/components/BookingTable/src/BookingTable.vue

@@ -314,12 +314,12 @@ const handleCellDblclick = ({ row }: any) => {
 }
 // 点击link字段是时
 const handleLinkClick = (row: any, column: any) => {
-  if (column.field === 'booking_no') {
+  if (column.title === 'Booking No.') {
     router.push({
       path: '/booking/detail',
       query: { a: row.__serial_no, _schemas: row._schemas }
     })
-  } else if (column.field === 'h_bol') {
+  } else if (column.title === 'HBL No.') {
     router.push({
       path: '/tracking/detail',
       query: { a: row.__serial_no, _schemas: row._schemas }

+ 1 - 1
src/views/Layout/src/components/Header/HeaderView.vue

@@ -11,7 +11,7 @@ const userStore = useUserStore()
 const router = useRouter()
 const headerSearch = useHeaderSearch()
 
-const searchValue = ref('')
+const searchValue = ref('A1703530062')
 const handleSearch = () => {
   // 先判断是否登录
   // 未登录

+ 0 - 1
src/views/Layout/src/components/Menu/MenuView.vue

@@ -40,7 +40,6 @@ const menuList = [
     index: '6',
     label: 'System Management',
     icon: 'icon_system__management_fill_b',
-    path: '/test5',
     type: 'list',
     children: [
       // {

+ 3 - 3
src/views/Tracking/src/components/TrackingTable/src/TrackingTable.vue

@@ -313,14 +313,14 @@ const handleCellDblclick = ({ row }: any) => {
     query: { a: row.__serial_no, _schemas: row._schemas }
   })
 }
-// 点击link字段
+// 点击link字段时
 const handleLinkClick = (row: any, column: any) => {
-  if (column.field === 'booking_no') {
+  if (column.title === 'Booking No.') {
     router.push({
       path: '/booking/detail',
       query: { a: row.__serial_no, _schemas: row._schemas }
     })
-  } else if (column.field === 'h_bol') {
+  } else if (column.title === 'HBL No.') {
     router.push({
       path: '/tracking/detail',
       query: { a: row.__serial_no, _schemas: row._schemas, serial_no: row.serial_no }

+ 39 - 23
src/views/Tracking/src/components/TrackingTable/src/components/VGMView.vue

@@ -52,7 +52,6 @@ const generalInfo = ref({
     is_send: false
   }
 })
-const testValue = ref('')
 const tableRef = ref<VxeGridInstance | null>(null)
 const tableData = ref<VxeGridProps<any>>({
   minHeight: 70,
@@ -130,14 +129,14 @@ const handleColumns = (columns: any) => {
       }
     }
 
-    if (item.title === 'VGM Weight') {
+    if (item.title === 'VGM Unit') {
       curColumn = {
         ...curColumn,
         editRender: {
-          name: 'vWeightSelect'
+          name: 'vUnitSelect'
         },
         slots: {
-          edit: 'vWeightSelect'
+          edit: 'vUnitSelect'
         }
       }
     } else if (item.title === 'VGM Method') {
@@ -230,14 +229,14 @@ const getData = () => {
         tableData.value.columns = handleColumns(
           res.data?.detail_information?.detail_information_column
         )
-        // tableData.value.data = res.data?.detail_information?.detail_information_data
+        tableData.value.data = res.data?.detail_information?.detail_information_data
         nextTick(() => {
           tableRef.value && autoWidth(tableData.value, tableRef.value)
           tableData.value.columns.forEach((item) => {
             if (item.title === 'SN') {
               item.width = 50
             } else if (item.title === 'VGM Time') {
-              item.width = 190
+              item.width = 210
             }
           })
         })
@@ -271,15 +270,32 @@ const handleSave = () => {
   const tableInfo = {}
   variableList.forEach((item) => {
     if (item === '_X_ROW_KEY') return
+    if (item === 'vgm_date' || item === 'vgm_time') {
+      Object.assign(tableInfo, {
+        [item]: tableRowData.map((row) =>
+          row[item] ? dayjs(row[item]).format('YYYY-MM-DD HH:mm:ss') : ''
+        )
+      })
+      return
+    }
     Object.assign(tableInfo, {
       [item]: tableRowData.map((row) => row[item])
     })
   })
-  // $api.saveVGMData({
-  //   serial_no: allData.value.serial_no,
-  //   _schemas: allData.value.schemas,
-  //   ...generalData
-  // })
+  console.log({ ...tableInfo, ...generalData })
+  $api
+    .saveVGMData({
+      serial_no: allData.value.serial_no,
+      _schemas: allData.value.schemas,
+      ...generalData,
+      ...tableInfo
+    })
+    .then((res) => {
+      console.log(res, '数据')
+      if (res.code === 200) {
+        // router.push({ name: 'Tracking' })
+      }
+    })
 }
 </script>
 
@@ -379,7 +395,7 @@ const handleSave = () => {
               ></el-input>
             </template>
 
-            <template #vWeightSelect="{ row, column }">
+            <template #vUnitSelect="{ row, column }">
               <vxe-select v-model="row[column.field]" placeholder="Please select..." clearable>
                 <vxe-option label="KGS" value="KGS"></vxe-option>
                 <vxe-option label="LBS" value="LBS"></vxe-option>
@@ -397,10 +413,10 @@ const handleSave = () => {
               <el-date-picker
                 v-model="row[column.field]"
                 type="datetime"
-                style="width: 170px"
+                style="width: 190px"
                 placeholder="Pick a Date"
-                format="MMM-DD-DD HH:mm:ss"
-                date-format="MMM-DD-DD"
+                format="MMM-DD-YYYY HH:mm:ss"
+                date-format="MMM-DD-YYYY"
                 time-format="HH:mm:ss"
               />
               <!-- <a-date-picker
@@ -530,14 +546,14 @@ const handleSave = () => {
 .el-checkbox__input.is-checked + .el-checkbox__label {
   color: var(--color-neutral-1);
 }
-.test-date-picker {
-  .ant-picker-dropdown {
-    // top: 40px !important;
-  }
-  .anticon svg {
-    color: #202020;
-  }
-}
+// .test-date-picker {
+//   .ant-picker-dropdown {
+//     // top: 40px !important;
+//   }
+//   .anticon svg {
+//     color: #202020;
+//   }
+// }
 
 // .vgm-table {
 //   .vxe-grid .vxe-grid--table-wrapper,

+ 13 - 9
vite.config.ts

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