Bläddra i källkod

style: 完成notification部分不同消息类型的样式

zhouyuhao 10 månader sedan
förälder
incheckning
2b88b4a6e2

+ 36 - 4
src/styles/icons/iconfont.css

@@ -1,9 +1,9 @@
 @font-face {
   font-family: "font_family"; /* Project id 4672385 */
-  src: url('iconfont.woff2?t=1736324058852') format('woff2'),
-       url('iconfont.woff?t=1736324058852') format('woff'),
-       url('iconfont.ttf?t=1736324058852') format('truetype'),
-       url('iconfont.svg?t=1736324058852#font_family') format('svg');
+  src: url('iconfont.woff2?t=1738829511248') format('woff2'),
+       url('iconfont.woff?t=1738829511248') format('woff'),
+       url('iconfont.ttf?t=1738829511248') format('truetype'),
+       url('iconfont.svg?t=1738829511248#font_family') format('svg');
 }
 
 .font_family {
@@ -14,6 +14,38 @@
   -moz-osx-font-smoothing: grayscale;
 }
 
+.icon-icon_container__maintenance_b:before {
+  content: "\e705";
+}
+
+.icon-icon_up_b:before {
+  content: "\e704";
+}
+
+.icon-icon_route_b:before {
+  content: "\e700";
+}
+
+.icon-icon_model_b:before {
+  content: "\e701";
+}
+
+.icon-icon_delay_b:before {
+  content: "\e702";
+}
+
+.icon-icon_container__filled_b:before {
+  content: "\e703";
+}
+
+.icon-icon_po__sscc_b:before {
+  content: "\e6fe";
+}
+
+.icon-icon_po__request_b:before {
+  content: "\e6ff";
+}
+
 .icon-icon_currentlink_b:before {
   content: "\e6fc";
 }

Filskillnaden har hållts tillbaka eftersom den är för stor
+ 0 - 0
src/styles/icons/iconfont.js


+ 16 - 0
src/styles/icons/iconfont.svg

@@ -14,6 +14,22 @@
     />
       <missing-glyph />
       
+      <glyph glyph-name="icon_container__maintenance_b" unicode="&#59141;" d="M416.448 697.664a32 32 0 0 1-6.848-0.704l-302.4-59.584a32 32 0 0 1-25.856-31.36v-445.76a32 32 0 0 1 25.856-31.424l302.4-59.584a32 32 0 0 1 10.56-0.512l228.096 22.976-6.4 63.68-193.408-19.52V630.272l528.896-53.248v-107.776h64V605.952a32 32 0 0 1-28.8 31.872l-592.384 59.648a32.128 32.128 0 0 1-3.712 0.192zM283.712 606.912l100.736 19.84v-487.296l-100.736 19.84V358.144h31.872v51.2h-31.872V606.912z m-51.2-437.568l-87.168 17.216V579.648l87.168 17.152v-187.456H198.4v-51.2h34.112v-188.8z m517.312 247.488a28.8 28.8 0 0 0 24.96 14.4h167.68c10.24 0 19.84-5.44 24.96-14.4l83.84-145.216c5.12-8.96 5.12-19.84 0-28.8l-83.84-145.216a28.8 28.8 0 0 0-24.96-14.4h-167.68a28.8 28.8 0 0 0-24.96 14.4l-83.84 145.28a28.8 28.8 0 0 0 0 28.8l83.84 145.152z m41.6-43.2l-67.2-116.416 67.2-116.416h134.4l67.2 116.48-67.2 116.352h-134.4z m67.2-79.104a37.312 37.312 0 1 1 0-74.688 37.312 37.312 0 0 1 0 74.688z m-94.912-37.376a94.976 94.976 0 1 0 189.888 0 94.976 94.976 0 0 0-189.888 0z"  horiz-adv-x="1088" />
+      
+      <glyph glyph-name="icon_up_b" unicode="&#59140;" d="M503.488 519.104a32 32 0 0 0 44.992 0l227.072-224.64a32 32 0 0 0-22.528-54.784H299.008A32 32 0 0 0 276.48 294.4l227.008 224.704z"  horiz-adv-x="1088" />
+      
+      <glyph glyph-name="icon_route_b" unicode="&#59136;" d="M428.544 674.816a131.008 131.008 0 1 0-0.768-76.8H332.672a89.024 89.024 0 0 1 0-178.112h387.2a165.312 165.312 0 0 0 0-330.56h-43.072a130.944 130.944 0 1 0 3.2 76.8h39.872a88.512 88.512 0 1 1 0 176.96h-387.2a165.824 165.824 0 1 0 0 331.712h95.872z"  horiz-adv-x="1088" />
+      
+      <glyph glyph-name="icon_model_b" unicode="&#59137;" d="M540.096 858.112A28.8 28.8 0 0 1 515.904 858.24L80 657.6a28.8 28.8 0 0 1-14.272-37.76v-483.264a28.8 28.8 0 0 1 16.64-26.112l428.928-200.32a28.8 28.8 0 0 1 24.768-0.32l435.968 200.576a28.8 28.8 0 0 1 16.704 26.176V631.424a28.8 28.8 0 0 1-18.88 27.072L540.096 858.24z m12.8-445.76l378.24 174.08v-431.424l-378.24-174.08v431.36z m-429.568 172.8l371.84-172.8v-431.104l-371.84 173.632V585.152z m767.872 46.336L524.16 462.72 161.792 631.808l366.08 168.448 363.328-168.768z"  horiz-adv-x="1088" />
+      
+      <glyph glyph-name="icon_delay_b" unicode="&#59138;" d="M489.984 631.182222a56.888889 56.888889 0 0 0 96.142222-0.227555l288.483556-458.126223a56.888889 56.888889 0 0 0-48.128-87.210666H247.068444A56.888889 56.888889 0 0 0 199.111111 172.942222l290.929778 458.183111z m48.014222-30.492444l-290.929778-458.183111h579.413334L537.998222 600.689778z m27.136-146.773334v-180.906666h-56.888889V453.973333h56.888889z m0-275.000888v47.104h-56.888889v-47.104h56.888889z"  horiz-adv-x="1080" />
+      
+      <glyph glyph-name="icon_container__filled_b" unicode="&#59139;" d="M422.336 113.728V654.272a12.8 12.8 0 0 0 15.104 12.608l526.08-95.36a12.8 12.8 0 0 0 10.496-12.544v-344.064a12.8 12.8 0 0 0-10.432-12.544l-526.08-101.248a12.8 12.8 0 0 0-15.168 12.608z m78.464 57.856l23.168 3.584V596.672l-23.168 3.712v-428.8z m102.976 15.488l23.168 3.2V580.928l-23.168 3.776v-397.632z m102.976 381.44v-365.504l23.232 3.2V565.12l-23.232 3.328z m102.976-349.76l23.232 3.456V549.12l-23.232 3.52v-333.824z m103.04 318.08v-301.952l23.168 3.328v295.04l-23.232 3.584zM396.352 652.352v-537.6a12.8 12.8 0 0 0-14.976-12.672l-134.4 22.976V375.36h73.216v23.232H246.976V644.096l134.656 20.864a12.8 12.8 0 0 0 14.784-12.608z m-172.672-523.392v246.4H141.888v23.232h81.92v241.92l-134.976-20.928a12.8 12.8 0 0 1-10.88-12.672v-442.24a12.8 12.8 0 0 1 10.688-12.608l135.104-23.04z"  horiz-adv-x="1088" />
+      
+      <glyph glyph-name="icon_po__sscc_b" unicode="&#59134;" d="M216.768 864a32 32 0 0 1-32-32v-896a32 32 0 0 1 32-32h284.8v64h-252.8v832H579.2v-160.064a128 128 0 0 1 128-128h160.064v-176.384h64v204.8 1.92a32 32 0 0 1-9.344 24.32L633.728 854.528A32 32 0 0 1 608.448 864h-391.68z m426.432-112.128l175.424-176H707.2a64 64 0 0 0-64 64v112z m-63.552-640a143.808 143.808 0 1 0 287.616-0.064 143.808 143.808 0 0 0-287.616 0z m143.808 207.744a207.808 207.808 0 1 1 0-415.616 207.808 207.808 0 0 1 0 415.616z m80-207.808a80 80 0 1 0-160 0 80 80 0 0 0 160 0z"  horiz-adv-x="1088" />
+      
+      <glyph glyph-name="icon_po__request_b" unicode="&#59135;" d="M184.768 832a32 32 0 0 0 32 32h391.68a32 32 0 0 0 25.344-9.344l288.128-288.128a32 32 0 0 0 9.28-24.32l0.064-1.792v-270.784h-64V511.936H707.2a128 128 0 0 0-128 128V800H248.768v-832h309.248v-64H216.768a32 32 0 0 0-32 32V832z m633.856-256.064L643.2 751.872v-112a64 64 0 0 1 64-64h111.424z m-23.104-672v135.808h135.744v64H795.52v135.744h-64v-135.744H595.776v-64h135.68V-96h64z"  horiz-adv-x="1088" />
+      
       <glyph glyph-name="icon_currentlink_b" unicode="&#59132;" d="M102.4 384a409.6 409.6 0 1 0 819.2 0A409.6 409.6 0 0 0 102.4 384zM512 870.4a486.4 486.4 0 1 1 0-972.8A486.4 486.4 0 0 1 512 870.4z m0-742.336a256 256 0 1 1 0 512 256 256 0 0 1 0-512z"  horiz-adv-x="1024" />
       
       <glyph glyph-name="icon_jumplink_b1" unicode="&#59133;" d="M636.416 633.28h-252.16v96h368a48 48 0 0 0 48-48v-368h-96v252.16l-370.56-370.624-67.904 67.84 370.56 370.624z m305.6-610.24h-832v96h832v-96z"  horiz-adv-x="1088" />

BIN
src/styles/icons/iconfont.ttf


BIN
src/styles/icons/iconfont.woff


BIN
src/styles/icons/iconfont.woff2


+ 31 - 11
src/views/SystemMessage/src/SystemMessage.vue

@@ -1,5 +1,6 @@
 <script setup lang="ts">
 import NotificationCard from './components/NotificationCard.vue'
+import DelayNotificationCard from './components/DelayNotificationCard.vue'
 
 const collapseVModel = ref<string[]>(['1'])
 
@@ -43,31 +44,44 @@ const notificationList = [
     time: 'Jan 10, 2025 14:30 UTC+8'
   },
   {
+    type: 'container',
+    isRead: false,
+    mode: '',
+    no: 'HBOL: SHJN2301234',
+    tag: 'Unloaded From Vessel',
+    location: 'Hong Kong',
+    time: 'Jan 10, 2025 14:30 UTC+8',
+    previous: 'Previous: Departure from Shanghai (08:15 UTC+8)'
+  },
+  {
+    type: 'delay',
     numericRecords: 0,
     isRead: false,
-    title: 'Milestone Update Daily Summary (Jan 10, 2025)',
+    title: 'Delay Daily Summary (Jan 10, 2025)',
     mode: 'Air Freight',
     no: 'HBOL: SHJN2301234',
-    tag: 'Booking Confirmed',
+    tag: 'Departure Delay',
     location: 'Hong Kong',
-    time: 'Jan 10, 2025 14:30 UTC+8'
+    time: 'Jan 10, 2025 14:30 UTC+8',
+    delayTime: 'ATD: Jan 12, 16:30 (+2 days delay)'
   },
   {
+    type: 'change',
     numericRecords: 0,
     isRead: false,
-    title: '',
+    title: 'ETD/ETA  Change Weekly Summary (Jan 4- 10, 2025) ',
     mode: 'Air Freight',
     no: 'HBOL: SHJN2301234',
-    tag: 'Booking Confirmed',
+    tag: 'ETD Change',
     location: 'Hong Kong',
-    time: 'Jan 10, 2025 14:30 UTC+8',
-    previous: 'Previous: Departure from Shanghai (08:15 UTC+8)'
+    changeTime: 'Updated ETD: Jan 17, 15:00',
+    time: 'Jan 10, 2025 14:30 UTC+8'
   }
 ]
 </script>
 
 <template>
-  <div class="Title">System Massage</div>
+  <div class="Title">System Message</div>
   <div class="system-message">
     <div class="left-nav">
       <el-collapse v-model="collapseVModel">
@@ -103,12 +117,18 @@ const notificationList = [
     <div class="right-content">
       <el-tabs v-model="activeName" class="demo-tabs" @tab-click="handleClick">
         <el-tab-pane label="All Notifications" name="first">
-          <div style="padding: 10px 16px 40px">
-            <NotificationCard
+          <div style="padding: 10px 140px 40px 16px">
+            <!-- <NotificationCard
+              v-for="(item, index) in notificationList"
+              :key="index"
+              :data="item"
+            ></NotificationCard> -->
+
+            <DelayNotificationCard
               v-for="(item, index) in notificationList"
               :key="index"
               :data="item"
-            ></NotificationCard>
+            ></DelayNotificationCard>
           </div>
         </el-tab-pane>
         <el-tab-pane label="Unread" name="second">Config</el-tab-pane>

+ 252 - 0
src/views/SystemMessage/src/components/DelayNotificationCard.vue

@@ -0,0 +1,252 @@
+<script setup lang="ts">
+import { transportationMode } from '@/components/TransportationMode'
+import { useRouter } from 'vue-router'
+
+const router = useRouter()
+const props = defineProps<{
+  data: {
+    type: 'milestone' | 'container' | 'delay' | 'change'
+    numericRecords?: number // 是否有多条记录
+    isRead: boolean // 是否已读
+    title?: string
+    mode: string // 运输方式
+    no: string // HBOL: SHJN2301234
+    tag: string // tag
+    location: string
+    delayTime?: string
+    changeTime?: string
+    time: string
+    previous?: string
+  }
+}>()
+
+const handleSeeAll = () => {
+  console.log('see all')
+  router.push({
+    name: 'System Message Detail'
+  })
+}
+</script>
+
+<template>
+  <div class="notification-card" :class="{ 'is-read': data.isRead }">
+    <div class="header" v-if="data.title">
+      <div class="status-icon"></div>
+      <div class="title">{{ data.title }}</div>
+    </div>
+    <div class="content">
+      <div class="more-tips" v-if="data.numericRecords">
+        <span>Latest Status Updates ({{ data.numericRecords }})</span>
+        <el-button @click="handleSeeAll" class="see-all-icon el-button--text">
+          See All
+          <span class="font_family icon-icon_next_b"></span>
+        </el-button>
+      </div>
+      <div class="base-info">
+        <span
+          v-if="data.type !== 'container'"
+          class="font_family"
+          :class="[`icon-${transportationMode?.[data.mode]}`]"
+        ></span>
+        <span v-else class="font_family icon-icon_container__filled_b"></span>
+        <span class="no">{{ data.no }}</span>
+        <div class="tag" :class="{ delay: data.type === 'delay', change: data.type === 'change' }">
+          <span class="dot"></span>
+          <span class="text">{{ data.tag }}</span>
+        </div>
+      </div>
+      <div class="route">
+        <span class="font_family icon-icon_route_b"></span>
+        <span>{{ data.location }}</span>
+      </div>
+      <div class="location">
+        <span class="font_family icon-icon_location_b"></span>
+        <span>{{ data.location }}</span>
+      </div>
+      <div class="delay-time" v-if="data.delayTime">
+        <span class="font_family icon-icon_delay_b"></span>
+        <span>{{ data.time }}</span>
+      </div>
+      <div class="change-time" v-if="data.changeTime">
+        <span style="margin-left: 1px" class="font_family icon-icon_time_b"></span>
+        <span>{{ data.changeTime }}</span>
+      </div>
+      <div class="time">
+        <span style="margin-left: 1px" class="font_family icon-icon_time_b"></span>
+        <span>{{ data.time }}</span>
+      </div>
+      <div class="previous" v-if="data.previous">
+        <span class="previous-icon"></span>
+        <span>{{ data.previous }}</span>
+      </div>
+    </div>
+  </div>
+</template>
+
+<style lang="scss" scoped>
+.notification-card {
+  // max-width: 640px;
+  margin-bottom: 16px;
+  &.is-read {
+    .header {
+      .status-icon {
+        background-color: var(--color-border);
+      }
+      .title {
+        color: var(--color-neutral-1);
+        opacity: 0.5;
+      }
+    }
+  }
+  .header {
+    display: flex;
+    align-items: center;
+    margin-bottom: 8px;
+    .status-icon {
+      width: 8px;
+      height: 8px;
+      border-radius: 50%;
+      background-color: var(--color-theme);
+      margin-right: 10px;
+    }
+    .title {
+      font-weight: 700;
+    }
+  }
+  .content {
+    padding: 16px 8px;
+    padding-top: 0;
+    background-color: var(--color-header-bg);
+    border-radius: 6px;
+    .more-tips {
+      display: flex;
+      justify-content: space-between;
+      padding: 8px 0;
+      border-bottom: 1px dashed var(--color-border);
+      font-size: 12px;
+      line-height: 24px;
+      .see-all-icon {
+        width: 68px;
+        height: 24px;
+        :deep(span) {
+          color: var(--color-theme);
+        }
+      }
+    }
+    .base-info {
+      display: flex;
+      padding-top: 16px;
+      .no {
+        margin-left: 8px;
+        font-weight: 700;
+        line-height: 18px;
+      }
+      .tag {
+        display: flex;
+        align-items: center;
+        margin-left: 4px;
+        padding-left: 8px;
+        padding-right: 6px;
+        background-color: #e6f1eb;
+        border-radius: 3px;
+        &.delay {
+          background-color: #f7e7e9;
+          .dot {
+            background-color: #c9353f;
+          }
+          .text {
+            color: #c9353f;
+          }
+        }
+        &.change {
+          background-color: #f5f2e6;
+          .dot {
+            background-color: #edb82f;
+          }
+          .text {
+            margin-top: 0;
+            color: #edb82f;
+          }
+        }
+        .dot {
+          width: 5px;
+          height: 5px;
+          border-radius: 50%;
+          background-color: #5bb462;
+          margin-right: 4px;
+        }
+        .text {
+          margin-top: 2px;
+          font-size: 10px;
+          font-weight: 600;
+          color: #5bb462;
+          line-height: 10px;
+          vertical-align: middle;
+        }
+      }
+    }
+    .route,
+    .location,
+    .change-time,
+    .delay-time,
+    .time {
+      display: flex;
+      align-items: center;
+      margin-top: 8px;
+      height: 16px;
+      span {
+        color: var(--color-neutral-2);
+        font-size: 12px;
+      }
+      .font_family {
+        font-size: 16px;
+        font-family: 'iconfont';
+        color: var(--color-neutral-2);
+        margin-right: 8px;
+      }
+    }
+    div.delay-time {
+      margin-top: 6px;
+      span,
+      .font_family {
+        color: #c9353f;
+      }
+      span {
+        line-height: 19px;
+      }
+      .font_family {
+        line-height: 12px;
+        margin-left: -1px;
+        margin-right: 6px;
+        font-size: 19px;
+      }
+    }
+    div.change-time {
+      span,
+      .font_family {
+        color: #edb82f;
+      }
+    }
+    .previous {
+      height: 24px;
+      margin-top: 8px;
+      padding-left: 8px;
+      line-height: 24px;
+      background-color: #e1e3e9;
+      border-radius: 6px;
+      span {
+        font-size: 12px;
+      }
+      .previous-icon {
+        display: inline-block;
+        width: 4px;
+        height: 4px;
+        background-color: var(--color-neutral-1);
+        border-radius: 50%;
+        margin-right: 8px;
+        vertical-align: middle;
+      }
+    }
+  }
+}
+</style>

+ 20 - 7
src/views/SystemMessage/src/components/NotificationCard.vue

@@ -9,6 +9,7 @@ const props = defineProps<{
     isRead: boolean
     title?: string
     mode: string
+    container?: string
     no: string
     tag: string
     location: string
@@ -40,11 +41,16 @@ const handleSeeAll = () => {
         </el-button>
       </div>
       <div class="base-info">
-        <span class="font_family" :class="[`icon-${transportationMode?.[data.mode]}`]"></span>
+        <span
+          v-if="data.mode"
+          class="font_family"
+          :class="[`icon-${transportationMode?.[data.mode]}`]"
+        ></span>
+        <span v-else-if="data.container" class="font_family icon-icon_container__filled_b"></span>
         <span class="no">{{ data.no }}</span>
         <div class="tag">
           <span class="dot"></span>
-          {{ data.tag }}
+          <span class="text">{{ data.tag }}</span>
         </div>
       </div>
       <div class="location">
@@ -65,7 +71,7 @@ const handleSeeAll = () => {
 
 <style lang="scss" scoped>
 .notification-card {
-  max-width: 640px;
+  // max-width: 640px;
   margin-bottom: 16px;
   &.is-read {
     .header {
@@ -129,10 +135,7 @@ const handleSeeAll = () => {
         padding-right: 6px;
         line-height: 18px;
         background-color: #e6f1eb;
-        font-size: 12px;
-        font-weight: 600;
         border-radius: 3px;
-        color: #5bb462;
         .dot {
           width: 5px;
           height: 5px;
@@ -140,6 +143,14 @@ const handleSeeAll = () => {
           background-color: var(--color-tag-completed);
           margin-right: 4px;
         }
+        .text {
+          margin-top: 2px;
+          font-size: 10px;
+          font-weight: 600;
+          color: #5bb462;
+          line-height: 10px;
+          vertical-align: middle;
+        }
       }
     }
     .location,
@@ -147,8 +158,10 @@ const handleSeeAll = () => {
       display: flex;
       align-items: center;
       margin-top: 8px;
-      color: var(--color-neutral-2);
       font-size: 12px;
+      span {
+        color: var(--color-neutral-2);
+      }
       .font_family {
         font-family: 'iconfont';
         color: var(--color-neutral-2);

Vissa filer visades inte eftersom för många filer har ändrats