Forráskód Böngészése

Merge branch 'dev' into test_zyh

Jack Zhou 2 hónapja
szülő
commit
4a8b513bd0

+ 4 - 0
.gitignore

@@ -17,6 +17,10 @@ components.d.ts
 package-lock.json
 pnpm-lock.yaml
 auto-imports.d.ts
+*.zip
+*.rar
+
+stats.html
 
 /cypress/videos/
 /cypress/screenshots/

+ 1 - 0
package.json

@@ -71,6 +71,7 @@
     "postcss": "^8.4.41",
     "postcss-loader": "^8.1.1",
     "prettier": "^3.2.5",
+    "rollup-plugin-visualizer": "^6.0.3",
     "sass": "^1.79.4",
     "typescript": "~5.4.0",
     "unplugin-auto-import": "^0.18.2",

+ 2 - 1
src/auto-imports.d.ts

@@ -3,6 +3,7 @@
 // @ts-nocheck
 // noinspection JSUnusedGlobalSymbols
 // Generated by unplugin-auto-import
+// biome-ignore lint: disable
 export {}
 declare global {
   const $api: typeof import('@/api/index')['default']
@@ -68,6 +69,6 @@ declare global {
 // for type re-export
 declare global {
   // @ts-ignore
-  export type { Component, ComponentPublicInstance, ComputedRef, ExtractDefaultPropTypes, ExtractPropTypes, ExtractPublicPropTypes, InjectionKey, PropType, Ref, VNode, WritableComputedRef } from 'vue'
+  export type { Component, ComponentPublicInstance, ComputedRef, DirectiveBinding, ExtractDefaultPropTypes, ExtractPropTypes, ExtractPublicPropTypes, InjectionKey, PropType, Ref, MaybeRef, MaybeRefOrGetter, VNode, WritableComputedRef } from 'vue'
   import('vue')
 }

+ 3 - 1
src/components/ContainerStatus/src/ContainerStatus.vue

@@ -3,7 +3,9 @@ import { formatTimezone } from '@/utils/tools'
 import { useThemeStore } from '@/stores/modules/theme'
 import lightPng from './image/no_data.png'
 import darkPng from './image/no_data_dark.png'
+import { useUserStore } from '@/stores/modules/user'
 
+const userStore = useUserStore()
 const themeStore = useThemeStore()
 
 const emptyImg = computed(() => {
@@ -69,7 +71,7 @@ watch(
       <img :src="emptyImg" :class="{ 'is-dark': themeStore.theme === 'dark' }" alt="empty" />
       <div class="empty-text" style="">No data</div>
     </div>
-    <div class="footer" v-if="props.website">
+    <div class="footer" v-if="props.website && userStore.userInfo?.user_type === 'employee'">
       Tracking on carrier website:
       <a :href="props.website" target="_blank" class="link">{{ props.website }}</a>
     </div>

+ 1 - 0
src/stores/modules/user.ts

@@ -15,6 +15,7 @@ interface UserInfo {
   numbers_format: string
   PASSWORD_CHANGE_CYCLE: number // 密码修改周期(多少天需要改一次)
   last_pwd_change: string // 上次密码修改时间
+  is_desensitization_kln?: string // Mask Customer Information
 }
 interface UserState {
   userInfo: UserInfo

+ 28 - 13
src/views/SystemSettings/src/SystemSettings.vue

@@ -137,15 +137,19 @@ const AddRulesTable = ref()
 const subscribeInit = ref({})
 
 const DefaultTimeZone = ref()
-const isInitSystem = JSON.parse(localStorage.getItem('userInfo')).subscribe_notification_default_init
+const isInitSystem = JSON.parse(
+  localStorage.getItem('userInfo')
+).subscribe_notification_default_init
 DefaultTimeZone.value = 'UTC' + moment().tz(moment.tz.guess()).format('Z')
 const FirstInitSubscribe = () => {
-  if(isInitSystem) {
-    $api.FirstInitSubscribe({
-      default_time_zone: DefaultTimeZone.value
-    }).then((res:any) => {
-      getsubscribe()
-    })
+  if (isInitSystem) {
+    $api
+      .FirstInitSubscribe({
+        default_time_zone: DefaultTimeZone.value
+      })
+      .then((res: any) => {
+        getsubscribe()
+      })
   } else {
     getsubscribe()
   }
@@ -166,7 +170,7 @@ const getsubscribe = () => {
 }
 
 const handleTabClick = (tab: any) => {
-  if(tab.paneName == 'Subscribe Notifications') {
+  if (tab.paneName == 'Subscribe Notifications') {
     isMilestoneChecked.value = false
     isContainerChecked.value = false
     isDepartureChecked.value = false
@@ -266,7 +270,11 @@ onMounted(() => {
               ></AddRules>
             </div>
           </el-collapse-item>
-          <el-collapse-item style="margin: 8px 0;" name="Container" :class="isContainerChecked ? 'border_ischecked' : ''">
+          <el-collapse-item
+            style="margin: 8px 0"
+            name="Container"
+            :class="isContainerChecked ? 'border_ischecked' : ''"
+          >
             <template #title>
               <div class="flex">
                 <div class="collapse_left" :class="isContainerAdded ? 'text_ischecked' : ''">
@@ -286,7 +294,11 @@ onMounted(() => {
               ></AddRules>
             </div>
           </el-collapse-item>
-          <el-collapse-item style="margin-bottom: 8px;" name="Departure" :class="isDepartureChecked ? 'border_ischecked' : ''">
+          <el-collapse-item
+            style="margin-bottom: 8px"
+            name="Departure"
+            :class="isDepartureChecked ? 'border_ischecked' : ''"
+          >
             <template #title>
               <div class="flex">
                 <div class="collapse_left" :class="isDepartureAdded ? 'text_ischecked' : ''">
@@ -377,6 +389,9 @@ onMounted(() => {
 .SubscribeCollapse {
   padding: 0 24px 24px 24px;
   border-bottom: 1px solid var(--color-select-border);
+  :deep(.el-icon svg) {
+    width: 0;
+  }
 }
 :deep(.el-tabs__nav-wrap:after) {
   height: 2px;
@@ -471,9 +486,9 @@ onMounted(() => {
 :deep(.el-collapse-item__arrow.is-active) {
   transform: rotate(-180deg);
 }
-:deep(.el-icon svg) {
-  width: 0;
-}
+// :deep(.el-icon svg) {
+//   width: 0;
+// }
 .monitoring_flex {
   display: flex;
   justify-content: space-between;

+ 1 - 0
src/views/SystemSettings/src/components/MonitoringTable/src/MonitoringTable.vue

@@ -42,6 +42,7 @@ const columnstest = ref([
   }
 ])
 const datatest = ref([])
+
 const tableData = ref<VxeGridProps<any>>({
   border: true,
   round: true,

+ 19 - 7
src/views/SystemSettings/src/components/PersonalProfile.vue

@@ -10,6 +10,7 @@ const form = reactive({
   lastName: userStore.userInfo?.last_name,
   username: userStore.userInfo?.uname,
   email: userStore.userInfo?.email,
+  is_desensitization_kln: userStore.userInfo?.is_desensitization_kln || 'f',
   password: '**************'
 })
 
@@ -92,6 +93,12 @@ const saveConfig = (model: string) => {
       numbers_format: numbersFormat.value
     }
   }
+  if (userStore.userInfo?.user_type === 'employee') {
+    params = {
+      ...params,
+      is_desensitization_kln: form.is_desensitization_kln
+    }
+  }
   $api
     .saveUserInfo(params)
     .then((res: any) => {
@@ -109,6 +116,9 @@ const saveConfig = (model: string) => {
                 numbers_format: numbersFormat.value
               }
 
+        if (userStore.userInfo.user_type === 'employee' && model === 'profile') {
+          updatedInfo.is_desensitization_kln = form.is_desensitization_kln
+        }
         userStore.setUserInfo(updatedInfo)
         ElMessage.success('Save successfully')
       } else {
@@ -157,13 +167,7 @@ const saveConfig = (model: string) => {
               >
             </p>
             <div class="password-change">
-              <el-input
-                size="large"
-                type="password"
-                style="width: 330px"
-                :disabled="true"
-                v-model="form.password"
-              />
+              <el-input size="large" type="password" :disabled="true" v-model="form.password" />
               <el-button
                 @click="handleChangePassword"
                 class="el-button--main el-button--pain-theme"
@@ -173,6 +177,13 @@ const saveConfig = (model: string) => {
               >
             </div>
           </div>
+          <div class="item" v-if="userStore.userInfo?.user_type === 'employee'">
+            <p class="label">Mask Customer Information</p>
+            <el-select size="large" v-model="form.is_desensitization_kln">
+              <el-option label="Yes" value="t"></el-option>
+              <el-option label="No" value="f"></el-option>
+            </el-select>
+          </div>
         </div>
         <div class="row">
           <el-button @click="saveConfig('profile')" class="el-button--dark save-icon" size="large"
@@ -301,6 +312,7 @@ const saveConfig = (model: string) => {
       gap: 8px;
       .item {
         flex: 1;
+        max-width: calc(50% - 4px);
         margin-bottom: 16px;
         .label {
           margin-bottom: 4px;

+ 26 - 1
src/views/Tracking/src/components/TrackingDetail/src/components/BasicInformation.vue

@@ -47,6 +47,19 @@ const allData: any = ref({
       {
         label: 'Service Type',
         content: ''
+      },
+
+      {
+        label: 'Load Terms',
+        content: ''
+      },
+      {
+        label: 'Shipment Type',
+        content: ''
+      },
+      {
+        label: 'CO2 Emission',
+        content: ''
       }
     ]
   },
@@ -140,7 +153,7 @@ const convertData = (data: any) => {
         },
         {
           label: 'Ref No.',
-          content: data.ref_no
+          content: data.ref_no || '--'
         }
       ],
       bottom: [
@@ -159,6 +172,18 @@ const convertData = (data: any) => {
         {
           label: 'Service Type',
           content: data.basicInfo.Service_Type || '--'
+        },
+        {
+          label: 'Load Terms',
+          content: data.basicInfo['Load Terms'] || '--'
+        },
+        {
+          label: 'Shipment Type',
+          content: data.basicInfo['Shipment Type'] || '--'
+        },
+        {
+          label: 'CO2 Emission',
+          content: data.basicInfo['CO2 Emission'] || '--'
         }
       ]
     },

+ 1 - 1
src/views/Tracking/src/components/TrackingDetail/src/components/EmailDrawer.vue

@@ -168,7 +168,7 @@ const sendEmail = () => {
   <div class="email-view">
     <div class="email-path">
       <span class="font_family icon-icon_email_b" style="font-size: 18px"></span>
-      <span class="label">Communication to Apex: &nbsp;</span>
+      <span class="label">Communication to KLN: &nbsp;</span>
       <span class="content">{{ emailData.email }}</span>
     </div>
     <div class="separated-by">

+ 2 - 0
vite.config.ts

@@ -6,6 +6,7 @@ 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 { visualizer } from 'rollup-plugin-visualizer';
 
 // https://vitejs.dev/config/
 export default defineConfig(({ mode }) => {
@@ -18,6 +19,7 @@ export default defineConfig(({ mode }) => {
       }
     },
     plugins: [
+      visualizer(),
       vue(),
       AutoImport({
         resolvers: [