Kaynağa Gözat

Merge branch 'dev_zyh' into feat_delivery_zyh

zhouyuhao 5 ay önce
ebeveyn
işleme
e3b2ae10d1
31 değiştirilmiş dosya ile 1605 ekleme ve 334 silme
  1. 103 0
      src/api/module/AIRobot.ts
  2. 14 8
      src/components/AIRobot/src/AIRobot.vue
  3. 15 0
      src/components/NotificationMessageCard/src/NotificationMessageCard.vue
  4. 3 2
      src/components/NotificationMessageCard/src/components/EventCard.vue
  5. 1 1
      src/components/ScoringGrade/src/ScoringGrade.vue
  6. 1 1
      src/components/VLoading/src/VLoading.vue
  7. 98 91
      src/components/VSliderVerification/src/VSliderVerification.vue
  8. 817 0
      src/components/VSliderVerification/src/components/SliderVerification.vue
  9. BIN
      src/components/VSliderVerification/src/image/reset.png
  10. 2 2
      src/styles/elementui.scss
  11. 0 9
      src/styles/index.scss
  12. 53 6
      src/styles/reset.scss
  13. 2 1
      src/styles/theme-g.scss
  14. 1 0
      src/styles/theme.scss
  15. 29 23
      src/views/AIApiLog/src/AIApiLog.vue
  16. 39 29
      src/views/AIApiLog/src/components/LogDialog.vue
  17. 43 29
      src/views/AIApiLog/src/components/TableView/src/TableView.vue
  18. 7 1
      src/views/AIApiLog/src/components/TableView/src/components/DownloadDialog.vue
  19. 189 59
      src/views/AIRobotChat/src/AIRobotChat.vue
  20. 10 2
      src/views/AIRobotChat/src/components/AIQuestions.vue
  21. 16 3
      src/views/AIRobotChat/src/components/AutoResizeTextarea.vue
  22. 1 0
      src/views/Booking/src/BookingView.vue
  23. 53 45
      src/views/ChatLog/src/ChatLog.vue
  24. 64 17
      src/views/ChatLog/src/components/TableView/src/TableView.vue
  25. 7 1
      src/views/ChatLog/src/components/TableView/src/components/DownloadDialog.vue
  26. 12 0
      src/views/Layout/src/LayoutView.vue
  27. 2 0
      src/views/Layout/src/components/Header/HeaderView.vue
  28. 2 2
      src/views/Layout/src/components/Menu/MenuView.vue
  29. 17 2
      src/views/Login/src/loginView.vue
  30. 3 0
      src/views/SystemMessage/src/SystemMessage.vue
  31. 1 0
      src/views/Tracking/src/TrackingView.vue

+ 103 - 0
src/api/module/AIRobot.ts

@@ -133,3 +133,106 @@ export const AIRobotInit = (params: any, config: any) => {
     config
   )
 }
+
+/**
+ * 获取chat log 表格列
+ */
+export const getChatLogTableColumn = (params: any, config: any) => {
+  return HttpAxios.post(
+    `${baseUrl}`,
+    {
+      action: 'robot_chat_log',
+      ...params
+    },
+    config
+  )
+}
+
+/**
+ * 根据筛选项获取chat log 表格数据
+ */
+export const getChatLogTableData = (params: any, config: any) => {
+  return HttpAxios.post(
+    `${baseUrl}`,
+    {
+      action: 'robot_chat_log',
+      operate: 'search',
+      ...params
+    },
+    config
+  )
+}
+
+/**
+ * 获取chat log 表格全部数据
+ */
+export const getChatLogAllTableData = (params: any, config: any) => {
+  return HttpAxios.post(
+    `${baseUrl}`,
+    {
+      action: 'robot_chat_log',
+      operate: 'excel',
+      ...params
+    },
+    config
+  )
+}
+
+/**
+ * 获取ai api log 表格列
+ */
+export const getAIApiLogTableColumn = (params: any, config: any) => {
+  return HttpAxios.post(
+    `${baseUrl}`,
+    {
+      action: 'robot_api_log',
+      ...params
+    },
+    config
+  )
+}
+
+/**
+ * 根据筛选项获取ai api log表格数据
+ */
+export const getAIApiLogTableData = (params: any, config: any) => {
+  return HttpAxios.post(
+    `${baseUrl}`,
+    {
+      action: 'robot_api_log',
+      operate: 'search',
+      ...params
+    },
+    config
+  )
+}
+
+/**
+ * 获取ai api log表格全部数据
+ */
+export const getAIApiLogAllTableData = (params: any, config: any) => {
+  return HttpAxios.post(
+    `${baseUrl}`,
+    {
+      action: 'robot_api_log',
+      operate: 'excel',
+      ...params
+    },
+    config
+  )
+}
+
+/**
+ * 获取ai api log弹窗详情
+ */
+export const getAIApiLogDialog = (params: any, config: any) => {
+  return HttpAxios.post(
+    `${baseUrl}`,
+    {
+      action: 'robot_chat_log',
+      operate: 'api_log',
+      ...params
+    },
+    config
+  )
+}

+ 14 - 8
src/components/AIRobot/src/AIRobot.vue

@@ -9,12 +9,12 @@ const AIRobotHoverVisible = ref(false)
 const clicked = ref(false)
 const isShowDefault = ref(false)
 const isShowAIRobotTop = ref(false)
-const AIIconVisible = ref(true)
+const AIIconVisible = ref(false)
 const DeQuestions = ref([])
 const itemGroups = ref([])
 
 const AIRobotInit = () => {
-  $api.AIRobotInit({}).then((res:any) => {
+  $api.AIRobotInit({}).then((res: any) => {
     DeQuestions.value = res.data.fixed_question
     prepareGroups()
   })
@@ -81,13 +81,14 @@ const prepareGroups = () => {
   itemGroups.value = groups
 }
 const isShowLogin = () => {
-  const LoginDays = 0
+  AIRobotInit()
+  const loginCount = JSON.parse(localStorage.getItem('userInfo')).loginCount
   let settimeouttime = 0
   AIIconVisible.value = true
   isShowDefault.value = true
-  if (LoginDays == 0) {
+  if (loginCount <= 0) {
     settimeouttime = 45000
-  } else if (LoginDays == 2) {
+  } else if (loginCount <= 2) {
     settimeouttime = 15000
   } else {
     settimeouttime = 10000
@@ -108,6 +109,7 @@ const Logout = () => {
 
 // 退出登录后隐藏icon
 const checknoPrompt = () => {
+  AIRobotInit()
   AIIconVisible.value = true
 }
 
@@ -121,6 +123,9 @@ const handelClick = (item: any) => {
 }
 
 onMounted(() => {
+  if(localStorage.getItem('userInfo') != null) {
+    AIIconVisible.value = true
+  }
   AIRobotInit()
   emitter.on('login-success', isShowLogin)
   emitter.on('login-out', Logout)
@@ -151,7 +156,7 @@ defineExpose({
       <div class="dialogue_title">Hi! I'm your Freight Assistant, always on call</div>
     </div>
     <div class="flex_end">
-      <div class="dialogue_content">
+      <div class="dialogue_content"  style="box-shadow: -10px 10px 24px rgba(58, 0, 78, 0.15);">
         <div class="dialogue_content_title">
           <div class="dialogue_title_left">
             <img src="../image/icon_faq_b@2x.png" width="24px" />
@@ -230,7 +235,7 @@ defineExpose({
 }
 .AIRobot-top {
   position: absolute;
-  z-index: 2013;
+  z-index: 1999;
   right: 35px;
   bottom: 188px;
 }
@@ -272,7 +277,7 @@ defineExpose({
   background: var(--color-dialogue-icon-bg);
   position: absolute;
   box-shadow: -2px 2px 12px rgba(0, 0, 0, 15%);
-  z-index: 2013;
+  z-index: 1999;
   right: 10px;
   bottom: 130px;
   img {
@@ -288,6 +293,7 @@ defineExpose({
 }
 .dialogue_title {
   background: var(--color-dialogue-text-bg);
+  box-shadow: -10px 10px 24px rgba(58, 0, 78, 0.15);
   padding: 8px;
   border-radius: 12px;
   margin: 10px 0;

+ 15 - 0
src/components/NotificationMessageCard/src/NotificationMessageCard.vue

@@ -6,6 +6,7 @@ import { useNotificationMessage } from '@/stores/modules/notificationMessage'
 import { cloneDeep } from 'lodash'
 import { DynamicScroller, DynamicScrollerItem } from 'vue3-virtual-scroller'
 import 'vue3-virtual-scroller/dist/vue3-virtual-scroller.css'
+import { formatTimezone } from '@/utils/tools'
 
 const notificationMsgStore = useNotificationMessage()
 const props = withDefaults(
@@ -15,6 +16,7 @@ const props = withDefaults(
     isScrollPadding?: boolean // 是否有padding
     updateReadCardsOnChange?: boolean // 是否在数据变化时请求接口更新已读卡片
     topOffset?: number // 应减去高度
+    isShowInsertionTime?: boolean // 是否显示插入时间
   }>(),
   {
     isObserver: true,
@@ -228,6 +230,9 @@ const scrollParentBoxStyle = computed(() => {
             :data="item.info"
           />
           <slot></slot>
+          <div class="insertion-time" v-if="isShowInsertionTime">
+            {{ formatTimezone(item.info.first_notifiation_date) }}
+          </div>
         </div>
       </DynamicScrollerItem>
     </template>
@@ -242,4 +247,14 @@ const scrollParentBoxStyle = computed(() => {
     padding: 0px 140px 0px 16px;
   }
 }
+.notification-message-card {
+  position: relative;
+  .insertion-time {
+    position: absolute;
+    right: 0;
+    top: 4px;
+    font-size: 12px;
+    color: var(--color-neutral-2);
+  }
+}
 </style>

+ 3 - 2
src/components/NotificationMessageCard/src/components/EventCard.vue

@@ -161,6 +161,7 @@ const jumpTracking = (data: EventCardPropsData) => {
           dayjs(data.info.time).format('MMM DD, YYYY HH:mm')
         }}</span>
         <span>{{ getTimezone(data.info.timezone, data.info.time) }}</span>
+        <span>&nbsp;({{ data.info.delayTimeTip }})</span>
       </div>
       <!-- <div class="change-time" v-if="data.type === 'change' && data.info?.time">
         <span style="margin-left: 1px" class="font_family icon-icon_time_b"></span>
@@ -345,8 +346,8 @@ const jumpTracking = (data: EventCardPropsData) => {
     }
     .previous {
       margin-top: 8px;
-      padding-left: 8px;
-      line-height: 24px;
+      padding: 4px 8px;
+      line-height: 16px;
       background-color: var(--color-previous-bg);
       border-radius: 6px;
       span {

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

@@ -412,7 +412,7 @@ div.scoring {
   background-color: var(--management-bg-color);
   position: absolute;
   box-shadow: -2px 2px 12px rgba(0, 0, 0, 15%);
-  z-index: 2013;
+  z-index: 1999;
   right: 10px;
   bottom: 64px;
   display: flex;

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

@@ -36,7 +36,7 @@ const props = withDefaults(defineProps<internalProps>(), {
 <style scoped>
 .v-loading-mask {
   position: absolute;
-  z-index: 2000;
+  z-index: 1499;
   margin: 0;
   top: 0;
   right: 0;

+ 98 - 91
src/components/VSliderVerification/src/VSliderVerification.vue

@@ -6,7 +6,8 @@ import Img03 from './image/verification-img-3.png'
 import Img04 from './image/verification-img-4.png'
 import { ref } from 'vue'
 //引入'vue3-puzzle-vcode'插件
-import Vcode from 'vue3-puzzle-vcode'
+import Vcode from './components/SliderVerification.vue'
+// import Vcode from 'vue3-puzzle-vcode'
 
 const openDialog = () => {
   isShow.value = true
@@ -31,10 +32,13 @@ const updateRefreshImg = () => {
   }
 }
 const addTipsNode = () => {
+  if (document.querySelector('.v-slider-verification-tips')) {
+    return
+  }
   const childNode = document.createElement('div')
-  childNode.className = 'tips'
+  childNode.className = 'v-slider-verification-tips'
   childNode.innerHTML = `
-    <div style="margin-bottom: 15px; text-align: right;">
+    <div style="margin-bottom: 5px; text-align: right;">
       <span class="font_family icon-icon_reject_b close-icon" style="margin-right: -20px;">
       </span>
     </div>
@@ -54,6 +58,7 @@ const addTipsNode = () => {
 }
 
 const closeDialog = () => {
+  isShow.value = false
   emit('close')
 }
 
@@ -131,6 +136,7 @@ const onSuccess = () => {
 }
 const close = () => {
   isShow.value = true
+  emit('close')
 }
 const fail = () => {
   updateSliderBackground('error')
@@ -146,113 +152,114 @@ defineExpose({
 })
 </script>
 <template>
-  <Vcode
-    :show="isShow"
-    @close="close"
-    @fail="fail"
-    :canvasWidth="320"
-    :canvasHeight="180"
-    sliderText="Swipe to verify"
-    :sliderSize="38"
-    successText="Verification successful"
-    failText="Verification failed"
-    :range="5"
-    :imgs="[Img01, Img02, Img03, Img04]"
-  ></Vcode>
+  <div>
+    <Vcode
+      :show="isShow"
+      @close="close"
+      @fail="fail"
+      :canvasWidth="320"
+      :canvasHeight="180"
+      sliderText="Swipe to verify"
+      :sliderSize="38"
+      successText="Verification successful"
+      failText="Verification failed"
+      :range="5"
+      :imgs="[Img01, Img02, Img03, Img04]"
+    ></Vcode>
+  </div>
 </template>
 <style lang="scss" scoped>
 .slider-verification {
   width: 400px;
-  height: 373px;
+  height: 365px;
   padding: 40px;
-  .tips {
-    text-align: center;
-  }
 }
 </style>
 <style lang="scss">
-// 整体框架
-.vue-auth-box_ {
-  width: 400px;
-  height: 373px;
-  padding: 40px;
-  padding-top: 20px;
-  background-color: var(--color-slider-bg);
-  border-radius: 16px;
-  box-shadow: -2px 2px 12px 0 rgba(0, 0, 0, 0.5);
-  .tips {
-    margin-bottom: 16px;
-    text-align: center;
-    .close-icon {
-      cursor: pointer;
-      &:hover {
-        color: var(--color-theme);
+.vue-puzzle-vcode {
+  // 整体框架
+  div.vue-auth-box_ {
+    width: 400px;
+    height: 365px;
+    padding: 40px;
+    padding-top: 16px;
+    background-color: var(--color-slider-bg);
+    border-radius: 16px;
+    box-shadow: -2px 2px 12px 0 rgba(0, 0, 0, 0.5);
+    .v-slider-verification-tips {
+      margin-bottom: 16px;
+      text-align: center;
+      .close-icon {
+        cursor: pointer;
+        &:hover {
+          color: var(--color-theme);
+        }
       }
     }
-  }
-  .icon-border {
-    display: flex;
-    justify-content: center;
-    align-items: center;
-    width: 16px !important;
-    height: 16px !important;
-    border-radius: 50%;
-    border: none !important;
-    span {
-      font-size: 14px !important;
+    .icon-border {
+      display: flex;
+      justify-content: center;
+      align-items: center;
+      width: 16px !important;
+      height: 16px !important;
+      border-radius: 50%;
+      border: none !important;
+      span {
+        font-size: 14px !important;
+      }
     }
   }
-}
 
-div.vue-puzzle-vcode {
-  background-color: rgba(43, 47, 54, 0.7);
-}
+  div.vue-puzzle-vcode {
+    background-color: rgba(43, 47, 54, 0.7);
+  }
 
-.vue-auth-box_ .auth-control_ div.range-box {
-  background-color: #87909e;
-  box-shadow: none;
-}
-.vue-auth-box_ div.auth-body_ {
-  border-radius: 6px;
-}
-// 已滑动区域的样式
-.vue-auth-box_ .auth-control_ .range-box div.range-slider {
-  background-color: var(--color-success);
-}
+  .vue-auth-box_ .auth-control_ div.range-box {
+    background-color: #87909e;
+    box-shadow: none;
+  }
+  .vue-auth-box_ div.auth-body_ {
+    border-radius: 6px;
+  }
+  // 已滑动区域的样式
+  .vue-auth-box_ .auth-control_ .range-box div.range-slider {
+    background-color: var(--color-success);
+  }
 
-.vue-auth-box_ .auth-body_ div.loading-box_.hide_ {
-  display: none;
-}
+  .vue-auth-box_ .auth-body_ div.loading-box_.hide_ {
+    display: none;
+  }
 
-// 成功的提示
-.vue-auth-box_ .auth-body_ div.info-box_ {
-  background: var(--color-success);
-}
-// 失败的提示
-.vue-auth-box_ .auth-body_ div.info-box_.fail {
-  background: #c7353f;
-}
+  // 成功的提示
+  .vue-auth-box_ .auth-body_ div.info-box_ {
+    background: var(--color-success);
+  }
+  // 失败的提示
+  .vue-auth-box_ .auth-body_ div.info-box_.fail {
+    background: #c7353f;
+  }
 
-.vue-auth-box_ .auth-control_ .range-box .range-slider {
-  border-radius: 6px;
-}
+  .vue-auth-box_ .auth-control_ .range-box .range-slider {
+    border-radius: 6px;
+  }
 
-.vue-auth-box_ .auth-control_ div.range-box {
-  border-radius: 6px;
-}
-// 滑块
-.vue-auth-box_ .auth-control_ .range-box .range-slider .range-btn {
-  border-radius: 6px;
-}
+  .vue-auth-box_ .auth-control_ div.range-box {
+    border-radius: 6px;
+  }
+  // 滑块
+  .vue-auth-box_ .auth-control_ .range-box .range-slider .range-btn {
+    border-radius: 6px;
+  }
 
-.vue-auth-box_ .auth-body_ .reset_ {
-  width: 20px;
-  height: 20px;
-  top: 10px;
-  right: 10px;
-}
+  .vue-auth-box_ .auth-body_ .reset_ {
+    width: 20px;
+    height: 20px;
+    top: 10px;
+    right: 10px;
+  }
 
-.vue-auth-box_ .auth-control_ .range-box .range-text {
-  color: #fff;
+  .vue-auth-box_ .auth-control_ .range-box .range-text {
+    color: #fff;
+  }
 }
 </style>

+ 817 - 0
src/components/VSliderVerification/src/components/SliderVerification.vue

@@ -0,0 +1,817 @@
+<template>
+  <!-- 本体部分 -->
+  <div
+    :class="['vue-puzzle-vcode', { show_: show }]"
+    @mousedown="onCloseMouseDown"
+    @mouseup="onCloseMouseUp"
+    @touchstart="onCloseMouseDown"
+    @touchend="onCloseMouseUp"
+  >
+    <div class="vue-auth-box_" @mousedown.stop @touchstart.stop>
+      <div class="auth-body_" :style="`height: ${canvasHeight}px`">
+        <!-- 主图,有缺口 -->
+        <canvas
+          ref="canvas1"
+          :width="canvasWidth"
+          :height="canvasHeight"
+          :style="`width:${canvasWidth}px;height:${canvasHeight}px`"
+        />
+        <!-- 成功后显示的完整图 -->
+        <canvas
+          ref="canvas3"
+          :class="['auth-canvas3_', { show: isSuccess }]"
+          :width="canvasWidth"
+          :height="canvasHeight"
+          :style="`width:${canvasWidth}px;height:${canvasHeight}px`"
+        />
+        <!-- 小图 -->
+        <canvas
+          :width="puzzleBaseSize"
+          class="auth-canvas2_"
+          :height="canvasHeight"
+          ref="canvas2"
+          @mousedown="onRangeMouseDown($event)"
+          @touchstart="onRangeMouseDown($event)"
+          :style="`width:${puzzleBaseSize}px;height:${canvasHeight}px;transform:translateX(${
+            styleWidth -
+            sliderBaseSize -
+            (puzzleBaseSize - sliderBaseSize) *
+              ((styleWidth - sliderBaseSize) / (canvasWidth - sliderBaseSize))
+          }px)`"
+        />
+        <div :class="['loading-box_', { hide_: !loading }]">
+          <div class="loading-gif_">
+            <span></span>
+            <span></span>
+            <span></span>
+            <span></span>
+            <span></span>
+          </div>
+        </div>
+        <div :class="['info-box_', { show: infoBoxShow }, { fail: infoBoxFail }]">
+          {{ infoText }}
+        </div>
+        <div
+          :class="['flash_', { show: isSuccess }]"
+          :style="`transform: translateX(${
+            isSuccess ? `${canvasWidth + canvasHeight * 0.578}px` : `-${canvasHeight * 0.578}px`
+          }) skew(-30deg, 0);`"
+        ></div>
+        <img class="reset_" @click="reset" :src="resetSvg" />
+      </div>
+      <div class="auth-control_">
+        <div class="range-box" :style="`height:${sliderBaseSize}px`">
+          <div class="range-text">{{ sliderText }}</div>
+          <div class="range-slider" ref="range-slider" :style="`width:${styleWidth}px`">
+            <div
+              :class="['range-btn', { isDown: mouseDown }]"
+              :style="`width:${sliderBaseSize}px`"
+              @mousedown="onRangeMouseDown($event)"
+              @touchstart="onRangeMouseDown($event)"
+            >
+              <div></div>
+              <div></div>
+              <div></div>
+            </div>
+          </div>
+        </div>
+      </div>
+    </div>
+  </div>
+</template>
+<script>
+import resetSvg from '../image/reset.png'
+export default {
+  props: {
+    canvasWidth: { type: Number, default: 310 }, // 主canvas的宽
+    canvasHeight: { type: Number, default: 160 }, // 主canvas的高
+    // 是否出现,由父级控制
+    show: { type: Boolean, default: false },
+    puzzleScale: { type: Number, default: 1 }, // 拼图块的大小缩放比例
+    sliderSize: { type: Number, default: 50 }, // 滑块的大小
+    range: { type: Number, default: 10 }, // 允许的偏差值
+    // 所有的背景图片
+    imgs: {
+      type: Array
+    },
+    successText: {
+      type: String,
+      default: '验证通过!'
+    },
+    failText: {
+      type: String,
+      default: '验证失败,请重试'
+    },
+    sliderText: {
+      type: String,
+      default: '拖动滑块完成拼图'
+    }
+  },
+
+  data() {
+    return {
+      mouseDown: false, // 鼠标是否在按钮上按下
+      startWidth: 50, // 鼠标点下去时父级的width
+      startX: 0, // 鼠标按下时的X
+      newX: 0, // 鼠标当前的偏移X
+      pinX: 0, // 拼图的起始X
+      pinY: 0, // 拼图的起始Y
+      loading: false, // 是否正在加在中,主要是等图片onload
+      isCanSlide: false, // 是否可以拉动滑动条
+      error: false, // 图片加在失败会出现这个,提示用户手动刷新
+      infoBoxShow: false, // 提示信息是否出现
+      infoText: '', // 提示等信息
+      infoBoxFail: false, // 是否验证失败
+      timer1: null, // setTimout1
+      closeDown: false, // 为了解决Mac上的click BUG
+      isSuccess: false, // 验证成功
+      imgIndex: -1, // 用于自定义图片时不会随机到重复的图片
+      isSubmting: false, // 是否正在判定,主要用于判定中不能点击重置按钮
+      resetSvg
+    }
+  },
+
+  /** 生命周期 **/
+  mounted() {
+    document.body.appendChild(this.$el)
+    document.addEventListener('mousemove', this.onRangeMouseMove, false)
+    document.addEventListener('mouseup', this.onRangeMouseUp, false)
+
+    document.addEventListener('touchmove', this.onRangeMouseMove, {
+      passive: false
+    })
+    document.addEventListener('touchend', this.onRangeMouseUp, false)
+    if (this.show) {
+      document.body.classList.add('vue-puzzle-overflow')
+      this.reset()
+    }
+  },
+  beforeUnmount() {
+    clearTimeout(this.timer1)
+    document.body.removeChild(this.$el)
+    document.removeEventListener('mousemove', this.onRangeMouseMove, false)
+    document.removeEventListener('mouseup', this.onRangeMouseUp, false)
+
+    document.removeEventListener('touchmove', this.onRangeMouseMove, {
+      passive: false
+    })
+    document.removeEventListener('touchend', this.onRangeMouseUp, false)
+  },
+
+  /** 监听 **/
+  watch: {
+    show(newV) {
+      // 每次出现都应该重新初始化
+      if (newV) {
+        document.body.classList.add('vue-puzzle-overflow')
+        this.reset()
+      } else {
+        this.isSubmting = false
+        this.isSuccess = false
+        this.infoBoxShow = false
+        document.body.classList.remove('vue-puzzle-overflow')
+      }
+    }
+  },
+
+  /** 计算属性 **/
+  computed: {
+    // styleWidth是底部用户操作的滑块的父级,就是轨道在鼠标的作用下应该具有的宽度
+    styleWidth() {
+      const w = this.startWidth + this.newX - this.startX
+      return w < this.sliderBaseSize
+        ? this.sliderBaseSize
+        : w > this.canvasWidth
+          ? this.canvasWidth
+          : w
+    },
+    // 图中拼图块的60 * 用户设定的缩放比例计算之后的值 0.2~2
+    puzzleBaseSize() {
+      return Math.round(Math.max(Math.min(this.puzzleScale, 2), 0.2) * 52.5 + 6)
+    },
+    // 处理一下sliderSize,弄成整数,以免计算有偏差
+    sliderBaseSize() {
+      return Math.max(Math.min(Math.round(this.sliderSize), Math.round(this.canvasWidth * 0.5)), 10)
+    }
+  },
+
+  /** 方法 **/
+  methods: {
+    // 关闭
+    onClose() {
+      if (!this.mouseDown && !this.isSubmting) {
+        clearTimeout(this.timer1)
+        this.$emit('close')
+      }
+    },
+    onCloseMouseDown() {
+      this.closeDown = true
+    },
+    onCloseMouseUp() {
+      if (this.closeDown) {
+        this.onClose()
+      }
+      this.closeDown = false
+    },
+    // 鼠标按下准备拖动
+    onRangeMouseDown(e) {
+      if (this.isCanSlide) {
+        this.mouseDown = true
+        this.startWidth = this.$refs['range-slider'].clientWidth
+        this.newX = e.clientX || e.changedTouches[0].clientX
+        this.startX = e.clientX || e.changedTouches[0].clientX
+      }
+    },
+    // 鼠标移动
+    onRangeMouseMove(e) {
+      if (this.mouseDown) {
+        e.preventDefault()
+        this.newX = e.clientX || e.changedTouches[0].clientX
+      }
+    },
+    // 鼠标抬起
+    onRangeMouseUp() {
+      if (this.mouseDown) {
+        this.mouseDown = false
+        this.submit()
+      }
+    },
+    /**
+     * 开始进行
+     * @param withCanvas 是否强制使用canvas随机作图
+     */
+    init(withCanvas) {
+      // 防止重复加载导致的渲染错误
+      if (this.loading && !withCanvas) {
+        return
+      }
+      this.loading = true
+      this.isCanSlide = false
+      const c = this.$refs.canvas1
+      const c2 = this.$refs.canvas2
+      const c3 = this.$refs.canvas3
+      const ctx = c.getContext('2d')
+      const ctx2 = c2.getContext('2d')
+      const ctx3 = c3.getContext('2d')
+      const isFirefox =
+        navigator.userAgent.indexOf('Firefox') >= 0 && navigator.userAgent.indexOf('Windows') >= 0 // 是windows版火狐
+      const img = document.createElement('img')
+      ctx.fillStyle = 'rgba(255,255,255,1)'
+      ctx3.fillStyle = 'rgba(255,255,255,1)'
+      ctx.clearRect(0, 0, this.canvasWidth, this.canvasHeight)
+      ctx2.clearRect(0, 0, this.canvasWidth, this.canvasHeight)
+
+      // 取一个随机坐标,作为拼图块的位置
+      this.pinX = this.getRandom(this.puzzleBaseSize, this.canvasWidth - this.puzzleBaseSize - 20) // 留20的边距
+      this.pinY = this.getRandom(20, this.canvasHeight - this.puzzleBaseSize - 20) // 主图高度 - 拼图块自身高度 - 20边距
+      img.crossOrigin = 'anonymous' // 匿名,想要获取跨域的图片
+      img.onload = () => {
+        const [x, y, w, h] = this.makeImgSize(img)
+        ctx.save()
+        // 先画小图
+        this.paintBrick(ctx)
+        ctx.closePath()
+        if (!isFirefox) {
+          ctx.shadowOffsetX = 0
+          ctx.shadowOffsetY = 0
+          ctx.shadowColor = '#000'
+          ctx.shadowBlur = 3
+          ctx.fill()
+          ctx.clip()
+        } else {
+          ctx.clip()
+          ctx.save()
+          ctx.shadowOffsetX = 0
+          ctx.shadowOffsetY = 0
+          ctx.shadowColor = '#000'
+          ctx.shadowBlur = 3
+          ctx.fill()
+          ctx.restore()
+        }
+
+        ctx.drawImage(img, x, y, w, h)
+        ctx3.fillRect(0, 0, this.canvasWidth, this.canvasHeight)
+        ctx3.drawImage(img, x, y, w, h)
+
+        // 设置小图的内阴影
+        ctx.globalCompositeOperation = 'source-atop'
+
+        this.paintBrick(ctx)
+
+        ctx.arc(
+          this.pinX + Math.ceil(this.puzzleBaseSize / 2),
+          this.pinY + Math.ceil(this.puzzleBaseSize / 2),
+          this.puzzleBaseSize * 1.2,
+          0,
+          Math.PI * 2,
+          true
+        )
+        ctx.closePath()
+        ctx.shadowColor = 'rgba(255, 255, 255, .8)'
+        ctx.shadowOffsetX = -1
+        ctx.shadowOffsetY = -1
+        ctx.shadowBlur = Math.min(Math.ceil(8 * this.puzzleScale), 12)
+        ctx.fillStyle = '#ffffaa'
+        ctx.fill()
+
+        // 将小图赋值给ctx2
+        const imgData = ctx.getImageData(
+          this.pinX - 3, // 为了阴影 是从-3px开始截取,判定的时候要+3px
+          this.pinY - 20,
+          this.pinX + this.puzzleBaseSize + 5,
+          this.pinY + this.puzzleBaseSize + 5
+        )
+        ctx2.putImageData(imgData, 0, this.pinY - 20)
+
+        // ctx2.drawImage(c, this.pinX - 3,this.pinY - 20,this.pinX + this.puzzleBaseSize + 5,this.pinY + this.puzzleBaseSize + 5,
+        // 0, this.pinY - 20, this.pinX + this.puzzleBaseSize + 5, this.pinY + this.puzzleBaseSize + 5);
+
+        // 清理
+        ctx.restore()
+        ctx.clearRect(0, 0, this.canvasWidth, this.canvasHeight)
+
+        // 画缺口
+        ctx.save()
+        this.paintBrick(ctx)
+        ctx.globalAlpha = 0.8
+        ctx.fillStyle = '#ffffff'
+        ctx.fill()
+        ctx.restore()
+
+        // 画缺口的内阴影
+        ctx.save()
+        ctx.globalCompositeOperation = 'source-atop'
+        this.paintBrick(ctx)
+        ctx.arc(
+          this.pinX + Math.ceil(this.puzzleBaseSize / 2),
+          this.pinY + Math.ceil(this.puzzleBaseSize / 2),
+          this.puzzleBaseSize * 1.2,
+          0,
+          Math.PI * 2,
+          true
+        )
+        ctx.shadowColor = '#000'
+        ctx.shadowOffsetX = 2
+        ctx.shadowOffsetY = 2
+        ctx.shadowBlur = 16
+        ctx.fill()
+        ctx.restore()
+
+        // 画整体背景图
+        ctx.save()
+        ctx.globalCompositeOperation = 'destination-over'
+        ctx.drawImage(img, x, y, w, h)
+        ctx.restore()
+
+        this.loading = false
+        this.isCanSlide = true
+      }
+      img.onerror = () => {
+        this.init(true) // 如果图片加载错误就重新来,并强制用canvas随机作图
+      }
+
+      if (!withCanvas && this.imgs && this.imgs.length) {
+        let randomNum = this.getRandom(0, this.imgs.length - 1)
+        if (randomNum === this.imgIndex) {
+          if (randomNum === this.imgs.length - 1) {
+            randomNum = 0
+          } else {
+            randomNum++
+          }
+        }
+        this.imgIndex = randomNum
+        img.src = this.imgs[randomNum]
+      } else {
+        img.src = this.makeImgWithCanvas()
+      }
+    },
+    // 工具 - 范围随机数
+    getRandom(min, max) {
+      return Math.ceil(Math.random() * (max - min) + min)
+    },
+    // 工具 - 设置图片尺寸cover方式贴合canvas尺寸 w/h
+    makeImgSize(img) {
+      const imgScale = img.width / img.height
+      const canvasScale = this.canvasWidth / this.canvasHeight
+      let x = 0,
+        y = 0,
+        w = 0,
+        h = 0
+      if (imgScale > canvasScale) {
+        h = this.canvasHeight
+        w = imgScale * h
+        y = 0
+        x = (this.canvasWidth - w) / 2
+      } else {
+        w = this.canvasWidth
+        h = w / imgScale
+        x = 0
+        y = (this.canvasHeight - h) / 2
+      }
+      return [x, y, w, h]
+    },
+    // 绘制拼图块的路径
+    paintBrick(ctx) {
+      const moveL = Math.ceil(15 * this.puzzleScale) // 直线移动的基础距离
+      ctx.beginPath()
+      ctx.moveTo(this.pinX, this.pinY)
+      ctx.lineTo(this.pinX + moveL, this.pinY)
+      ctx.arcTo(
+        this.pinX + moveL,
+        this.pinY - moveL / 2,
+        this.pinX + moveL + moveL / 2,
+        this.pinY - moveL / 2,
+        moveL / 2
+      )
+      ctx.arcTo(
+        this.pinX + moveL + moveL,
+        this.pinY - moveL / 2,
+        this.pinX + moveL + moveL,
+        this.pinY,
+        moveL / 2
+      )
+      ctx.lineTo(this.pinX + moveL + moveL + moveL, this.pinY)
+      ctx.lineTo(this.pinX + moveL + moveL + moveL, this.pinY + moveL)
+      ctx.arcTo(
+        this.pinX + moveL + moveL + moveL + moveL / 2,
+        this.pinY + moveL,
+        this.pinX + moveL + moveL + moveL + moveL / 2,
+        this.pinY + moveL + moveL / 2,
+        moveL / 2
+      )
+      ctx.arcTo(
+        this.pinX + moveL + moveL + moveL + moveL / 2,
+        this.pinY + moveL + moveL,
+        this.pinX + moveL + moveL + moveL,
+        this.pinY + moveL + moveL,
+        moveL / 2
+      )
+      ctx.lineTo(this.pinX + moveL + moveL + moveL, this.pinY + moveL + moveL + moveL)
+      ctx.lineTo(this.pinX, this.pinY + moveL + moveL + moveL)
+      ctx.lineTo(this.pinX, this.pinY + moveL + moveL)
+
+      ctx.arcTo(
+        this.pinX + moveL / 2,
+        this.pinY + moveL + moveL,
+        this.pinX + moveL / 2,
+        this.pinY + moveL + moveL / 2,
+        moveL / 2
+      )
+      ctx.arcTo(this.pinX + moveL / 2, this.pinY + moveL, this.pinX, this.pinY + moveL, moveL / 2)
+      ctx.lineTo(this.pinX, this.pinY)
+    },
+    // 用canvas随机生成图片
+    makeImgWithCanvas() {
+      const canvas = document.createElement('canvas')
+      const ctx = canvas.getContext('2d')
+      canvas.width = this.canvasWidth
+      canvas.height = this.canvasHeight
+      ctx.fillStyle = `rgb(${this.getRandom(100, 255)},${this.getRandom(100, 255)},${this.getRandom(
+        100,
+        255
+      )})`
+      ctx.fillRect(0, 0, this.canvasWidth, this.canvasHeight)
+      // 随机画10个图形
+      for (let i = 0; i < 12; i++) {
+        ctx.fillStyle = `rgb(${this.getRandom(100, 255)},${this.getRandom(
+          100,
+          255
+        )},${this.getRandom(100, 255)})`
+        ctx.strokeStyle = `rgb(${this.getRandom(100, 255)},${this.getRandom(
+          100,
+          255
+        )},${this.getRandom(100, 255)})`
+
+        if (this.getRandom(0, 2) > 1) {
+          // 矩形
+          ctx.save()
+          ctx.rotate((this.getRandom(-90, 90) * Math.PI) / 180)
+          ctx.fillRect(
+            this.getRandom(-20, canvas.width - 20),
+            this.getRandom(-20, canvas.height - 20),
+            this.getRandom(10, canvas.width / 2 + 10),
+            this.getRandom(10, canvas.height / 2 + 10)
+          )
+          ctx.restore()
+        } else {
+          // 圆
+          ctx.beginPath()
+          const ran = this.getRandom(-Math.PI, Math.PI)
+          ctx.arc(
+            this.getRandom(0, canvas.width),
+            this.getRandom(0, canvas.height),
+            this.getRandom(10, canvas.height / 2 + 10),
+            ran,
+            ran + Math.PI * 1.5
+          )
+          ctx.closePath()
+          ctx.fill()
+        }
+      }
+      return canvas.toDataURL('image/png')
+    },
+    // 开始判定
+    submit() {
+      this.isSubmting = true
+      // 偏差 x = puzzle的起始X - (用户真滑动的距离) + (puzzle的宽度 - 滑块的宽度) * (用户真滑动的距离/canvas总宽度)
+      // 最后+ 的是补上slider和滑块宽度不一致造成的缝隙
+      const x = Math.abs(
+        this.pinX -
+          (this.styleWidth - this.sliderBaseSize) +
+          (this.puzzleBaseSize - this.sliderBaseSize) *
+            ((this.styleWidth - this.sliderBaseSize) / (this.canvasWidth - this.sliderBaseSize)) -
+          3
+      )
+      if (x < this.range) {
+        // 成功
+        this.infoText = this.successText
+        this.infoBoxFail = false
+        this.infoBoxShow = true
+        this.isCanSlide = false
+        this.isSuccess = true
+        // 成功后准备关闭
+        clearTimeout(this.timer1)
+        this.timer1 = setTimeout(() => {
+          // 成功的回调
+          this.isSubmting = false
+          this.$emit('success', x)
+        }, 400)
+      } else {
+        // 失败
+        this.infoText = this.failText
+        this.infoBoxFail = true
+        this.infoBoxShow = true
+        this.isCanSlide = false
+        // 失败的回调
+        this.$emit('fail', x)
+        // 400ms后重置
+        clearTimeout(this.timer1)
+        this.timer1 = setTimeout(() => {
+          this.isSubmting = false
+          this.reset()
+        }, 400)
+      }
+    },
+    // 重置 - 重新设置初始状态
+    resetState() {
+      this.infoBoxFail = false
+      this.infoBoxShow = false
+      this.isCanSlide = false
+      this.isSuccess = false
+      this.startWidth = this.sliderBaseSize // 鼠标点下去时父级的width
+      this.startX = 0 // 鼠标按下时的X
+      this.newX = 0 // 鼠标当前的偏移X
+    },
+
+    // 重置
+    reset() {
+      if (this.isSubmting) {
+        return
+      }
+      this.resetState()
+      this.init()
+    }
+  }
+}
+</script>
+<style lang="scss" scoped>
+.vue-puzzle-vcode {
+  position: fixed;
+  top: 0;
+  left: 0;
+  bottom: 0;
+  right: 0;
+  background-color: rgba(0, 0, 0, 0.3);
+  z-index: 999;
+  opacity: 0;
+  pointer-events: none;
+  transition: opacity 200ms;
+  &.show_ {
+    opacity: 1;
+    pointer-events: auto;
+  }
+}
+.vue-auth-box_ {
+  position: absolute;
+  top: 40%;
+  left: 50%;
+  transform: translate(-50%, -50%);
+  padding: 20px;
+  background: #fff;
+  user-select: none;
+  border-radius: 3px;
+  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
+  .auth-body_ {
+    position: relative;
+    overflow: hidden;
+    border-radius: 3px;
+    .loading-box_ {
+      position: absolute;
+      top: 0;
+      left: 0;
+      bottom: 0;
+      right: 0;
+      background-color: rgba(0, 0, 0, 0.8);
+      z-index: 20;
+      opacity: 1;
+      transition: opacity 200ms;
+      display: flex;
+      align-items: center;
+      justify-content: center;
+      &.hide_ {
+        opacity: 0;
+        pointer-events: none;
+        .loading-gif_ {
+          span {
+            animation-play-state: paused;
+          }
+        }
+      }
+      .loading-gif_ {
+        flex: none;
+        height: 5px;
+        line-height: 0;
+        @keyframes load {
+          0% {
+            opacity: 1;
+            transform: scale(1.3);
+          }
+          100% {
+            opacity: 0.2;
+            transform: scale(0.3);
+          }
+        }
+        span {
+          display: inline-block;
+          width: 5px;
+          height: 100%;
+          margin-left: 2px;
+          border-radius: 50%;
+          background-color: #888;
+          animation: load 1.04s ease infinite;
+          &:nth-child(1) {
+            margin-left: 0;
+          }
+          &:nth-child(2) {
+            animation-delay: 0.13s;
+          }
+          &:nth-child(3) {
+            animation-delay: 0.26s;
+          }
+          &:nth-child(4) {
+            animation-delay: 0.39s;
+          }
+          &:nth-child(5) {
+            animation-delay: 0.52s;
+          }
+        }
+      }
+    }
+    .info-box_ {
+      position: absolute;
+      bottom: 0;
+      left: 0;
+      width: 100%;
+      height: 24px;
+      line-height: 24px;
+      text-align: center;
+      overflow: hidden;
+      font-size: 13px;
+      background-color: #83ce3f;
+      opacity: 0;
+      transform: translateY(24px);
+      transition: all 200ms;
+      color: #fff;
+      z-index: 10;
+      &.show {
+        opacity: 0.95;
+        transform: translateY(0);
+      }
+      &.fail {
+        background-color: #ce594b;
+      }
+    }
+    .auth-canvas2_ {
+      position: absolute;
+      top: 0;
+      left: 0;
+      width: 60px;
+      height: 100%;
+      z-index: 4;
+    }
+    .auth-canvas3_ {
+      position: absolute;
+      top: 0;
+      left: 0;
+      opacity: 0;
+      transition: opacity 600ms;
+      z-index: 3;
+      &.show {
+        opacity: 1;
+      }
+    }
+    .flash_ {
+      position: absolute;
+      top: 0;
+      left: 0;
+      width: 30px;
+      height: 100%;
+      background-color: rgba(255, 255, 255, 0.1);
+      z-index: 3;
+      &.show {
+        transition: transform 600ms;
+      }
+    }
+    .reset_ {
+      position: absolute;
+      top: 2px;
+      right: 2px;
+      width: 35px;
+      height: auto;
+      z-index: 12;
+      cursor: pointer;
+      transition: transform 200ms;
+      transform: rotate(0deg);
+      &:hover {
+        transform: rotate(-90deg);
+      }
+    }
+  }
+  .auth-control_ {
+    .range-box {
+      position: relative;
+      width: 100%;
+      background-color: #eef1f8;
+      margin-top: 20px;
+      border-radius: 3px;
+      box-shadow: 0 0 8px rgba(240, 240, 240, 0.6) inset;
+      .range-text {
+        position: absolute;
+        top: 50%;
+        left: 50%;
+        transform: translate(-50%, -50%);
+        font-size: 14px;
+        color: #b7bcd1;
+        white-space: nowrap;
+        overflow: hidden;
+        text-overflow: ellipsis;
+        text-align: center;
+        width: 100%;
+      }
+      .range-slider {
+        position: absolute;
+        height: 100%;
+        width: 50px;
+        background-color: rgba(106, 160, 255, 0.8);
+        border-radius: 3px;
+        .range-btn {
+          position: absolute;
+          display: flex;
+          align-items: center;
+          justify-content: center;
+          right: 0;
+          width: 50px;
+          height: 100%;
+          background-color: #fff;
+          border-radius: 3px;
+          box-shadow: 0 0 4px #ccc;
+          cursor: pointer;
+          & > div {
+            width: 0;
+            height: 40%;
+
+            transition: all 200ms;
+            &:nth-child(2) {
+              margin: 0 4px;
+            }
+            border: solid 1px #6aa0ff;
+          }
+          &:hover,
+          &.isDown {
+            & > div:first-child {
+              border: solid 4px transparent;
+              height: 0;
+              border-right-color: #6aa0ff;
+            }
+            & > div:nth-child(2) {
+              border-width: 3px;
+              height: 0;
+              border-radius: 3px;
+              margin: 0 6px;
+              border-right-color: #6aa0ff;
+            }
+            & > div:nth-child(3) {
+              border: solid 4px transparent;
+              height: 0;
+              border-left-color: #6aa0ff;
+            }
+          }
+        }
+      }
+    }
+  }
+}
+.vue-puzzle-overflow {
+  overflow: hidden !important;
+}
+</style>

BIN
src/components/VSliderVerification/src/image/reset.png


+ 2 - 2
src/styles/elementui.scss

@@ -817,7 +817,7 @@ div .avatar_bg {
   background-color: transparent !important;
 }
 div .carousel .el-carousel__indicator--horizontal {
-  padding: 4px 8px;
+  padding: 4px;
 }
 div .carousel .el-carousel__button {
   width: 6px;
@@ -834,7 +834,7 @@ div .carousel .el-carousel__item--card,
   display: flex;
   align-items: center;
   justify-content: center;
-  padding-bottom: 15px;
+  padding-bottom: 9px;
 }
 div .carousel .el-carousel__arrow {
   opacity: 1;

+ 0 - 9
src/styles/index.scss

@@ -56,12 +56,3 @@
 .icon_dark {
   fill: var(--color-neutral-1);
 }
-div.markdown-body {
-  background: transparent;
-  table {
-    th,
-    td {
-      white-space: nowrap;
-    }
-  }
-}

+ 53 - 6
src/styles/reset.scss

@@ -134,12 +134,27 @@ div {
     margin: 0;
   }
 }
+div.markdown-body {
+  background: transparent;
+  table {
+    th,
+    td {
+      white-space: nowrap;
+    }
+  }
+}
+
+.query-style {
+  .markdown-body {
+    p {
+      color: #b5b9bf;
+    }
+  }
+}
 
 .markdown-body {
   display: inline-block;
   width: 100%;
-  line-height: 1.6;
-  font-size: 16px;
   color: #333;
 }
 
@@ -162,16 +177,36 @@ div {
   padding-left: 1em;
 }
 
-.markdown-body ul {
+div.markdown-body {
+  li,
+  th,
+  p,
+  td,
+  span {
+    font-size: 14px;
+  }
+}
+
+div.markdown-body ul {
   list-style-type: disc;
+  margin-left: 8px;
+  padding-left: 16px;
 }
 
 .markdown-body ol {
   list-style-type: decimal;
+  margin-left: 8px;
+  padding-left: 16px;
 }
 
 .markdown-body li {
   margin: 0.5em 0;
+  & > ul {
+    margin-left: 0;
+  }
+  &:last-child {
+    margin-bottom: 0;
+  }
 }
 
 .markdown-body blockquote {
@@ -181,9 +216,21 @@ div {
   margin: 1em 0;
 }
 
-.markdown-body a {
-  color: #0366d6;
-  text-decoration: underline;
+div.markdown-body a {
+  color: var(--color-theme);
+  text-decoration: none;
+  & + a {
+    margin-left: 6px;
+  }
+}
+
+.markdown-body {
+  table {
+    td,
+    th {
+      text-align: left;
+    }
+  }
 }
 
 .markdown-body code {

+ 2 - 1
src/styles/theme-g.scss

@@ -58,6 +58,7 @@
   // tag
   --tag-bg-color: rgba(239, 239, 240, 0.1);
   --tag-info-text-color: #fff;
+  --tag-boder-color: rgba(239, 239, 240, 0.1);
   --tips-bg-color: rgba(26, 28, 32, 1);
   --tag-info-bg-color: rgba(239, 239, 240, 0.1);
 
@@ -90,7 +91,7 @@
   --color-dialogue_container-bg:rgba(255, 255, 255, 0.10);
   --color-dialogue_title: linear-gradient(90deg, var(--1-gradient-ai-robot-faq-0, #FFA8C7) 1.77%, var(--1-gradient-ai-robot-faq-46, #5988f3) 46.77%);
   --color-dialogue_content-bg:linear-gradient(117deg, var(--1-gradient-ai-robot-0, #525CBA) 4.31%, var(--1-gradient-ai-robot-15, #5A57B2) 14.24%, var(--1-gradient-ai-robot-38, #5F54AD) 29.71%, var(--1-gradient-ai-robot-59, #664EA2) 43.72%, var(--1-gradient-ai-robot-83, #694CA0) 59.35%, var(--1-gradient-ai-robot-100, #724493) 70.56%);
-  --color-arrow-hoverL: #FCEEE3;
+  --color-arrow-hoverL: rgb(252,238,227,0.4);
   --color-prompt-preview-bg: #403844;
   --color-prompt-diaolog-bg: #3A4149;
   --color-prompt-disabled-bg: rgba(244, 244, 244, 0.20);

+ 1 - 0
src/styles/theme.scss

@@ -171,6 +171,7 @@
 
   --color-range-text: #2b2f36;
   --tag-bg-color: rgba(239, 239, 240);
+  --tag-boder-color: #efeff0;
   --tips-bg-color: rgba(26, 28, 32, 1);
   --scoring-bg-color: #f2f4f7;
 

+ 29 - 23
src/views/AIApiLog/src/AIApiLog.vue

@@ -1,31 +1,27 @@
 <script lang="ts" setup>
 import { useCalculatingHeight } from '@/hooks/calculatingHeight'
 import TableView from './components/TableView'
+import dayjs from 'dayjs'
 
-const OperationSearch = ref()
 const filterRef: Ref<HTMLElement | null> = ref(null)
 const containerHeight = useCalculatingHeight(document.documentElement, 290, [filterRef])
 const searchData = ref({
-  inputModel: '',
-  startDate: '',
-  endDate: '',
-  aiModel: '',
-  comparator: 'thanOrEqual',
-  responseDuration: 0
+  text_search: '',
+  request_date_start: '',
+  request_date_end: '',
+  ai_model: '',
+  response_duration_type: '',
+  response_duration_num: null
 })
 
 const aiModelList = [
   {
-    label: 'Deepseek-chat',
-    value: 'deepseekChat'
+    label: 'Deepseek',
+    value: 'Deepseek'
   },
   {
-    label: 'Deepseek-search',
-    value: 'deepseekSearch'
-  },
-  {
-    label: 'Claude 3.7 Sonnet',
-    value: 'claude'
+    label: 'Claude',
+    value: 'Claude'
   }
 ]
 
@@ -50,8 +46,13 @@ const Search = () => {
   tableRef.value.SearchOperationLog(searchData.value)
 }
 const DateChange = (date: any) => {
-  searchData.value.startDate = date[0]
-  searchData.value.endDate = date[1]
+  if (!date) {
+    searchData.value.request_date_start = ''
+    searchData.value.request_date_end = ''
+  } else {
+    searchData.value.request_date_start = dayjs(date[0]).format('MM/DD/YYYY')
+    searchData.value.request_date_end = dayjs(date[1]).format('MM/DD/YYYY')
+  }
   tableRef.value.SearchOperationLog(searchData.value)
 }
 </script>
@@ -63,7 +64,7 @@ const DateChange = (date: any) => {
         <div class="input-tips_filter">
           <el-input
             placeholder="Search Request ID、Question ID"
-            v-model="OperationSearch"
+            v-model="searchData.text_search"
             class="log_input"
           >
             <template #prefix>
@@ -80,7 +81,7 @@ const DateChange = (date: any) => {
           <CalendarDate @DateChange="DateChange"></CalendarDate>
         </div>
         <div class="tips_filter">
-          <el-select v-model="searchData.aiModel" placeholder="AI Model">
+          <el-select v-model="searchData.ai_model" clearable placeholder="AI Model">
             <el-option
               v-for="item in aiModelList"
               :key="item.value"
@@ -91,7 +92,12 @@ const DateChange = (date: any) => {
         </div>
         <div class="comparator-tips_filter">
           <span>Response Duration</span>
-          <el-select v-model="searchData.comparator" style="width: 70px; margin: 0 6px">
+          <el-select
+            placeholder=""
+            clearable
+            v-model="searchData.response_duration_type"
+            style="width: 70px; margin: 0 6px"
+          >
             <el-option
               v-for="item in comparatorList"
               :key="item.value"
@@ -101,11 +107,11 @@ const DateChange = (date: any) => {
             </el-option>
           </el-select>
           <el-input-number
-            v-model="searchData.responseDuration"
-            placeholder="s"
+            v-model="searchData.response_duration_num"
+            placeholder=""
             :controls="false"
             :min="0"
-            style="width: 60px"
+            style="width: 60px; height: 34px"
           ></el-input-number>
         </div>
 

+ 39 - 29
src/views/AIApiLog/src/components/LogDialog.vue

@@ -1,8 +1,24 @@
 <script setup lang="ts">
 const dialogVisible = ref(false)
 
-const openDialog = () => {
+const requestContent = ref()
+// const requestList = ref([])
+const responseContent = ref()
+// const responseList = ref()
+const requestContentRef = ref<HTMLElement | null>(null)
+const responseHeight = ref(580)
+const openDialog = (request, response) => {
   dialogVisible.value = true
+  requestContent.value = request
+  responseContent.value = response.choices[0].message.content
+  // requestList.value = JSON.stringify(request).split('\n')
+  // responseList.value = JSON.stringify(response).split('\n')
+  nextTick(() => {
+    if (requestContentRef.value) {
+      const height = requestContentRef.value.scrollHeight
+      responseHeight.value = 726 - height - 122
+    }
+  })
 }
 defineExpose({
   openDialog
@@ -10,38 +26,31 @@ defineExpose({
 </script>
 
 <template>
-  <el-dialog v-model="dialogVisible" class="log-dialog" title="AI API Log" width="1000" top="10vh">
+  <el-dialog
+    v-model="dialogVisible"
+    class="ai-api-log-dialog"
+    title="AI API Log"
+    width="1000"
+    top="10vh"
+  >
     <div class="request-section">
       <div class="title">Request Content</div>
-      <div class="content">
-        Hello, I would like to check the status of my package. The tracking number is ABC123456789.
+      <div class="content" ref="requestContentRef">
+        {{ requestContent }}
+        <!-- <p v-for="(item, index) in requestList" :key="index">
+          {{ item }}
+        </p> -->
       </div>
     </div>
     <el-divider style="margin: 16px 0" />
     <div class="response-section">
-      <div class="title">Request Content</div>
-      <p class="content">
-        Hey there! For the package with tracking number ABC123456789, the latest update is: [insert
-        latest tracking status here, e.g., shipped, in transit, arrived at the delivery hub, out for
-        delivery, etc.]. You can see more details by clicking this link: [insert detailed tracking
-        link here].Hey there! For the package with tracking number ABC123456789, the latest update
-        is: [insert latest tracking status here, e.g., shipped, in transit, arrived at the delivery
-        hub, out for delivery, etc.]. You can see more details by clicking this link: [insert
-        detailed tracking link here].Hey there! For the package with tracking number ABC123456789,
-        the latest update is: [insert latest tracking status here, e.g., shipped, in transit,
-        arrived at the delivery hub, out for delivery, etc.]. You can see more details by clicking
-        this link: [insert detailed tracking link here].Hey there! For the package with tracking
-        number ABC123456789, the latest update is: [insert latest tracking status here, e.g.,
-        shipped, in transit, arrived at the delivery hub, out for delivery, etc.]. You can see more
-        details by clicking this link: [insert detailed tracking link here].Hey there! For the
-        package with tracking number ABC123456789, the latest update is: [insert latest tracking
-        status here, e.g., shipped, in transit, arrived at the delivery hub, out for delivery,
-        etc.]. You can see more details by clicking this link: [insert detailed tracking link
-        here].Hey there! For the package with tracking number ABC123456789, the latest update is:
-        [insert latest tracking status here, e.g., shipped, in transit, arrived at the delivery hub,
-        out for delivery, etc.]. You can see more details by clicking this link: [insert detailed
-        tracking link here].
-      </p>
+      <div class="title">Response Content</div>
+      <div class="content" :style="{ height: responseHeight + 'px' }">
+        <!-- <p v-for="(item, index) in responseList" :key="index">
+          {{ item }}
+        </p> -->
+        {{ responseContent }}
+      </div>
     </div>
   </el-dialog>
 </template>
@@ -67,12 +76,13 @@ defineExpose({
   .content {
     padding: 8px 16px 20px 16px;
     border-radius: 6px;
+    overflow: auto;
     background-color: var(--color-share-link-bg);
   }
 }
 </style>
-<style>
-.log-dialog {
+<style lang="scss">
+.ai-api-log-dialog {
   height: 80%;
   .el-dialog__body {
     padding: 0;

+ 43 - 29
src/views/AIApiLog/src/components/TableView/src/TableView.vue

@@ -2,7 +2,7 @@
 import { ref, nextTick, onMounted } from 'vue'
 import { type VxeGridInstance, type VxeGridProps } from 'vxe-table'
 import DownloadDialog from './components/DownloadDialog.vue'
-// import { autoWidth } from '@/utils/table'
+import { autoWidth } from '@/utils/table'
 import { useRowClickStyle } from '@/hooks/rowClickStyle'
 import dayjs from 'dayjs'
 import { formatTimezone, formatNumber } from '@/utils/tools'
@@ -60,18 +60,17 @@ const handleColumns = (columns: any, status?: string) => {
 // 获取表格列
 const getTableColumns = async () => {
   tableLoadingColumn.value = true
-  await $api.getOperationTableColumns().then((res: any) => {
+  await $api.getAIApiLogTableColumn().then((res: any) => {
     if (res.code === 200) {
       tableData.value.columns = [
         { type: 'checkbox', width: 50, fixed: 'left' },
-        ...handleColumns(res.data.OperationTableColumns),
-        { title: 'Action', width: 106, fixed: 'right', slots: { default: 'action' } }
+        ...handleColumns(res.data.OperationTableColumns)
       ]
       tableOriginColumnsField.value = res.data.OperationTableColumns
     }
   })
   nextTick(() => {
-    // tableRef.value && autoWidth(tableData.value, tableRef.value)
+    tableRef.value && autoWidth(tableData.value, tableRef.value)
     tableLoadingColumn.value = false
     selectedNumber.value = 0
     selectedTableData.value = []
@@ -91,7 +90,7 @@ const assignTableData = (data: any) => {
     allTable.value.data = data.searchData || []
     // 为了让导出的表格列宽度自适应
     nextTick(() => {
-      // allTableRef.value && autoWidth(allTable.value, allTableRef.value)
+      allTableRef.value && autoWidth(allTable.value, allTableRef.value)
     })
   }, 1000)
 }
@@ -102,7 +101,7 @@ const getTableData = async (isPageChange?: boolean) => {
   const rc = isPageChange ? pageInfo.value.total : -1
   tableLoadingTableData.value = true
   await $api
-    .SearchOperationLog({
+    .getAIApiLogTableData({
       cp: pageInfo.value.pageNo,
       ps: pageInfo.value.pageSize,
       rc,
@@ -117,7 +116,7 @@ const getTableData = async (isPageChange?: boolean) => {
       selectedNumber.value = 0
       selectedTableData.value = []
       nextTick(() => {
-        // tableRef.value && autoWidth(tableData.value, tableRef.value)
+        tableRef.value && autoWidth(tableData.value, tableRef.value)
         tableLoadingTableData.value = false
       })
     })
@@ -126,7 +125,7 @@ const SearchOperationLog = (val: any) => {
   searchdata = val
   tableLoadingTableData.value = true
   $api
-    .SearchOperationLog({
+    .getAIApiLogTableData({
       cp: pageInfo.value.pageNo,
       ps: pageInfo.value.pageSize,
       rc: -1,
@@ -141,7 +140,7 @@ const SearchOperationLog = (val: any) => {
       selectedNumber.value = 0
       selectedTableData.value = []
       nextTick(() => {
-        // tableRef.value && autoWidth(tableData.value, tableRef.value)
+        tableRef.value && autoWidth(tableData.value, tableRef.value)
         tableLoadingTableData.value = false
       })
     })
@@ -149,7 +148,7 @@ const SearchOperationLog = (val: any) => {
 onMounted(() => {
   Promise.all([getTableColumns(), getTableData(false)]).finally(() => {
     nextTick(() => {
-      // tableRef.value && autoWidth(tableData.value, tableRef.value)
+      tableRef.value && autoWidth(tableData.value, tableRef.value)
     })
   })
 })
@@ -276,7 +275,7 @@ const getExportTableData = (status: number) => {
     column = buildColumnString(allTable.value.columns)
   }
   $api
-    .OperationLogDownload({
+    .getAIApiLogAllTableData({
       selected_fields: column,
       tmp_search: tempSearch.value
     })
@@ -299,7 +298,7 @@ const exportTable = (status: number) => {
   const exportConfig: any = {
     type: 'xlsx',
     message: false,
-    filename: `Chat Log_${dayjs().format('YYYYMMDDHH[h]mm[m]ss[s]')}`
+    filename: `AI API Log_${dayjs().format('YYYYMMDDHH[h]mm[m]ss[s]')}`
   }
   if (status === 1) {
     exportConfig.columnFilterMethod = ({ column }: any) => {
@@ -336,8 +335,21 @@ const handleCheckAllChange = ({ records }: any) => {
 }
 
 const logDialogRef = ref()
-const handleLogDetail = (row) => {
-  logDialogRef.value.openDialog(row)
+const logLoading = ref(false)
+const handleLinkClick = (row) => {
+  logLoading.value = true
+  $api
+    .getAIApiLogDialog({
+      request_id: row['Request ID']
+    })
+    .then((res: any) => {
+      if (res.code === 200) {
+        logLoading.value = false
+        const data = res.data.Data
+        // 打开日志详情对话框
+        logDialogRef.value.openDialog(data.request_content, data.ai_response_content)
+      }
+    })
 }
 
 defineExpose({
@@ -354,7 +366,13 @@ defineExpose({
     element-loading-custom-class="element-loading"
     element-loading-background="rgb(43, 47, 54, 0.7)"
   >
-    <div class="table-tools">
+    <div
+      class="table-tools"
+      v-loading.fullscreen.lock="logLoading"
+      element-loading-text="Loading..."
+      element-loading-custom-class="element-loading"
+      element-loading-background="rgb(43, 47, 54, 0.7)"
+    >
       <div class="left-total-records">{{ selectedNumber }} Selected</div>
       <div class="right-tools-btn">
         <el-button class="el-button--main el-button--pain-theme" @click="handleDownload">
@@ -376,18 +394,10 @@ defineExpose({
       <template #empty v-if="!tableLoadingTableData && tableData.data.length === 0">
         <VEmpty></VEmpty>
       </template>
-      <!-- action操作栏的插槽 -->
-      <template #action="{ row }">
-        <el-button
-          style="height: 24px; padding: 8px 4px; padding-left: 5px; font-size: 12px"
-          @click="handleLogDetail(row)"
-        >
-          <span
-            style="margin-right: 2px; font-size: 15px"
-            class="font_family icon-icon_ai_api_log_b"
-          ></span
-          >AI API Log
-        </el-button>
+      <template #link="{ row, column }">
+        <span style="color: var(--color-theme); cursor: pointer" @click="handleLinkClick(row)">
+          {{ row[column.field] }}
+        </span>
       </template>
     </vxe-grid>
     <vxe-grid :height="10" ref="allTableRef" class="all-table" v-bind="allTable"> </vxe-grid>
@@ -407,7 +417,11 @@ defineExpose({
         />
       </div>
     </div>
-    <DownloadDialog @export="getExportTableData" ref="downloadDialogRef" />
+    <DownloadDialog
+      @export="getExportTableData"
+      :isHideSelectColumn="true"
+      ref="downloadDialogRef"
+    />
     <LogDialog ref="logDialogRef" />
   </div>
 </template>

+ 7 - 1
src/views/AIApiLog/src/components/TableView/src/components/DownloadDialog.vue

@@ -1,4 +1,10 @@
 <script setup lang="ts">
+const props = withDefaults(
+  defineProps<{
+    isHideSelectColumn: boolean
+  }>(),
+  { isHideSelectColumn: false }
+)
 const dialogVisible = ref(false)
 
 const openDialog = (selectedColumns: string[], slectedDataNumber: number) => {
@@ -41,7 +47,7 @@ defineExpose({
             }}</span>
           </div>
         </div>
-        <div class="download-filter">
+        <div class="download-filter" v-if="!props.isHideSelectColumn">
           <el-radio-group v-model="downloadFilter">
             <el-radio :value="1"
               >Download with selected columns

+ 189 - 59
src/views/AIRobotChat/src/AIRobotChat.vue

@@ -12,6 +12,7 @@ import MarkdownIt from 'markdown-it'
 import 'github-markdown-css/github-markdown.css'
 
 const userStore = useUserStore()
+const AIQuestion = ref()
 const md = new MarkdownIt({
   html: true,
   linkify: true,
@@ -20,7 +21,6 @@ const md = new MarkdownIt({
 })
 
 const renderedMessage = (content) => {
-  // console.log('content', content)
   if (!content) {
     return ''
   }
@@ -49,7 +49,7 @@ const isShowFooterShadow = ref(false)
 // 是否显示header的底部阴影
 const isShowHeaderShadow = ref(false)
 
-const loadingAnswer = ref(false) // 是否正在加载答案
+const loadingAnswer = ref(false) // 是否正在请求答案
 interface MessageItem {
   id?: string // 唯一标识
   type: 'robot' | 'user'
@@ -97,9 +97,14 @@ const progressStatus = {
 
 const isShowTips = ref(false) // 是否展示提示信息
 
+const isShowLoadingDots = ref(false) // 是否展示加载点(加载答案)
 const parseHtmlString = (data) => {
+  if (!data) {
+    isShowLoadingDots.value = false // 停止显示加载点
+    return
+  }
   const lines = data.split('\n')
-
+  isShowLoadingDots.value = true // 开始显示加载点
   function streamMarkdown() {
     const lastMsg: any = messages.value[messages.value.length - 1]
     let index = 0
@@ -111,6 +116,7 @@ const parseHtmlString = (data) => {
         index++
         scrollToBottom() // 滚动到底部
       } else {
+        isShowLoadingDots.value = false // 停止显示加载点
         clearInterval(timer)
       }
     }, 150)
@@ -123,24 +129,34 @@ const progressInterval = ref()
 const serial_no = ref()
 const is_FixedAnswer = ref(true) // 是否为预设问题 true是自由问题 false是预设问题
 const aiChat = (question, isPresetQuestion) => {
+  AIQuestion.value.AIRobotInit()
   serial_no.value = userStore.userInfo?.uname + Date.now().toString()
+  let fixed_faq = ''
+  if (!is_FixedAnswer.value) {
+    fixed_faq = messages.value[messages.value.length - 3].content
+  } else if (isPresetQuestion) {
+    fixed_faq = question
+  }
   $api
     .aiChat({
       serial_no: serial_no.value,
       prompt: sessionStorage.getItem('prompt'),
-      question_type: isPresetQuestion || !is_FixedAnswer ? 'Predefined Question' : 'Free Question',
-      // question_type: 'Free Question',
+      question_type:
+        isPresetQuestion || !is_FixedAnswer.value ? 'Predefined Question' : 'Free Question',
       question_content: question,
-      fixed_faq: !is_FixedAnswer ? messages.value[messages.value.length - 2].content : ''
+      fixed_faq: fixed_faq
     })
     .then((res) => {
-      if (isPause.value) {
+      if (isPause.value || queryTime.value === -1) {
         return
       }
       if (res.code === 200) {
         clearInterval(progressInterval.value)
 
-        is_FixedAnswer.value = res.data.is_fixedAnswer_end || false
+        is_FixedAnswer.value =
+          res.data.is_fixedAnswer_end !== null || res.data.is_fixedAnswer_end !== undefined
+            ? res.data.is_fixedAnswer_end
+            : true
         const { data } = res.data
         messages.value[messages.value.length - 1] = {
           id: serial_no.value,
@@ -158,6 +174,9 @@ const aiChat = (question, isPresetQuestion) => {
       } else {
         loadingAnswer.value = false
         messages.value[messages.value.length - 1].isError = true
+        messages.value[messages.value.length - 1].content = progressStatus[120]
+        clearInterval(progressInterval.value)
+        queryTime.value = -1
       }
     })
 }
@@ -179,15 +198,16 @@ const handleSend = (question, isPresetQuestion = true, isExternal = false) => {
   }
   isPause.value = false
   loadingAnswer.value = true
-
-  aiChat(question, isPresetQuestion)
   // 将用户内容添加到消息列表
   messages.value.push({
     type: 'user',
-    content: question
+    content: question,
+    isAnswer: true
   })
   !isPresetQuestion ? (userQuestion.value = '') : ''
   queryTime.value = 0
+
+  aiChat(question, isPresetQuestion)
   messages.value.push({
     type: 'robot',
     content: progressStatus[0]
@@ -218,6 +238,7 @@ const handleSend = (question, isPresetQuestion = true, isExternal = false) => {
     }
   }, 1000)
 }
+
 const showScrollButton = ref(false) // 控制按钮显示
 const messagesRef = ref()
 const autoScroll = ref(true)
@@ -236,7 +257,8 @@ function handleScroll() {
 
   isShowHeaderShadow.value = !!messagesRef.value?.scrollTop
 }
-function scrollToBottom() {
+const scrollToBottom = (isScroll = false) => {
+  if (!isScroll && (!autoScroll.value || !messagesRef.value)) return
   nextTick(() => {
     if (messagesRef.value) {
       messagesRef.value.scrollTop = messagesRef.value.scrollHeight
@@ -280,6 +302,13 @@ const handleFeedback = (index, feedback) => {
       }
     })
 }
+// 判断是否展示评价icon
+const shouldShowFeedback = (msg, index) => {
+  if (index === messages.value.length - 1 && isShowLoadingDots.value) {
+    return false
+  }
+  return msg.type === 'robot' && msg.isAnswer
+}
 
 const emit = defineEmits(['close'])
 // 关闭聊天窗口
@@ -288,9 +317,27 @@ const handleClose = () => {
   emit('close')
 }
 
+const clearData = () => {
+  messages.value = [
+    {
+      type: 'robot',
+      isShowFeedback: false,
+      content: 'You can click on Frequently Asked Questions above or type your own question'
+    }
+  ]
+  progressInterval.value && clearInterval(progressInterval.value)
+  sessionStorage.removeItem('AIChat')
+}
+
+const liabilityExeDialog = ref(false) // 免责声明弹窗
+const handleLiabilityExeDialog = () => {
+  liabilityExeDialog.value = true
+}
+
 defineExpose({
   handleSend,
-  handleOpen
+  handleOpen,
+  clearData
 })
 </script>
 
@@ -300,20 +347,38 @@ defineExpose({
       <div class="header">
         <span class="welcome">Hi! I'm your Freight Assistant</span>
         <div class="option-icon">
-          <span
-            v-if="modalSize === 'large'"
-            class="font_family icon-icon_sidebar__window_b"
-            @click="modalSize = 'small'"
-          ></span>
-          <span
-            v-else-if="modalSize !== 'large'"
-            class="font_family icon-icon_maximized__window_b"
-            @click="modalSize = 'large'"
-          ></span>
-          <span @click="handleClose" class="font_family icon-icon_collapsed__to_widget_b"></span>
+          <el-tooltip v-if="modalSize === 'large'" trigger="hover" content="Sidebar Window">
+            <el-button
+              style="width: 24px; height: 24px"
+              class="el-button--text"
+              @click="modalSize = 'small'"
+              ><span class="font_family icon-icon_sidebar__window_b"></span
+            ></el-button>
+          </el-tooltip>
+
+          <el-tooltip v-else-if="modalSize !== 'large'" trigger="hover" content="Maximized Window">
+            <el-button
+              style="width: 24px; height: 24px"
+              class="el-button--text"
+              @click="modalSize = 'large'"
+              ><span class="font_family icon-icon_maximized__window_b"></span
+            ></el-button>
+          </el-tooltip>
+
+          <el-tooltip trigger="hover" content="Collapsed to Widget">
+            <el-button
+              style="width: 24px; height: 24px"
+              class="el-button--text"
+              @click="handleClose"
+              ><span
+                @click="handleClose"
+                class="font_family icon-icon_collapsed__to_widget_b"
+              ></span
+            ></el-button>
+          </el-tooltip>
         </div>
       </div>
-      <AIQuestions :modalSize="modalSize" @question="handleSend"></AIQuestions>
+      <AIQuestions ref="AIQuestion" :modalSize="modalSize" @question="handleSend"></AIQuestions>
       <div class="warning-tips" v-if="isShowTips">
         <div class="warning-bg">
           <span class="warning-icon font_family icon-icon_warning_fill_b"></span>
@@ -353,10 +418,15 @@ defineExpose({
           <div v-html="msg.html || renderedMessage(msg.content)" class="markdown-body"></div>
         </div>
         <LoadingDots
-          v-if="index === messages.length - 1 && msg.isAnswer && loadingAnswer"
+          v-if="
+            index === messages.length - 1 &&
+            msg.isAnswer &&
+            isShowLoadingDots &&
+            msg.type === 'robot'
+          "
         ></LoadingDots>
         <!-- 评价  -->
-        <div class="review" v-if="msg.isShowFeedback && msg.isAnswer">
+        <div class="review" v-if="shouldShowFeedback(msg, index)">
           <el-button
             v-if="msg.feedback !== 'Cood'"
             class="el-button--text"
@@ -366,7 +436,7 @@ defineExpose({
           </el-button>
           <div v-if="msg.feedback === 'Cood'" style="width: 16px; text-align: center">
             <span
-              style="color: var(--color-theme); font-size: 14px"
+              style="color: var(--color-theme)"
               class="font_family icon-icon_good__filled_b"
             ></span>
           </div>
@@ -379,7 +449,7 @@ defineExpose({
           </el-button>
           <div v-if="msg.feedback === 'Not Good'" style="width: 16px; text-align: center">
             <span
-              style="color: var(--color-theme); font-size: 14px"
+              style="color: var(--color-theme)"
               class="font_family icon-icon_notgood__filled_b"
             ></span>
           </div>
@@ -388,16 +458,18 @@ defineExpose({
         <img class="robot-bubble-img" v-if="msg.type === 'robot'" :src="robotBubbleImg" alt="" />
         <img class="user-bubble-img" v-else-if="msg.type === 'user'" :src="userBubbleImg" alt="" />
         <!-- 暂停回答 icon -->
-        <div
-          class="pause-btn"
+        <el-tooltip
           v-if="index === messages.length - 1 && queryTime > 29 && queryTime < 120"
-          @click="handlePause"
-        >
-          <div class="dot"></div>
-        </div>
+          content="Cancel Answer"
+          placement="bottom-start"
+          effect="dark"
+          ><div class="pause-btn" @click="handlePause">
+            <div class="dot"></div>
+          </div>
+        </el-tooltip>
       </div>
       <!-- 滚动到底部icon -->
-      <div v-if="showScrollButton" class="scroll-to-bottom-btn" @click="scrollToBottom">
+      <div v-if="showScrollButton" class="scroll-to-bottom-btn" @click="scrollToBottom(true)">
         <span class="font_family icon-icon_movedown_b"></span>
       </div>
     </div>
@@ -422,17 +494,61 @@ defineExpose({
           <span class="font_family icon-icon_send_b"></span>
         </div>
       </div>
+      <div class="liability-exemption">
+        <span>Content is generated by Al, please check carefully!</span>
+        <span class="liability-exemption-btn" @click="handleLiabilityExeDialog">Disclaimer</span>
+      </div>
     </div>
+    <el-dialog
+      class="liability-exemption-dialog"
+      v-model="liabilityExeDialog"
+      title="Disclaimer"
+      width="800"
+      top="20vh"
+    >
+      <div
+        class="title"
+        style="margin-bottom: 8px; font-size: 16px; font-weight: 700; line-height: 24px"
+      >
+        Important Notice: AI-Generated Content
+      </div>
+      <p>
+        This chat assistant is powered by artificial intelligence (AI) and is designed to help you
+        access information and answer your queries efficiently. Please be aware of the following:
+      </p>
+      <p>
+        <strong>• AI-Generated Responses: </strong>All responses are automatically generated by AI.
+        While we strive for accuracy, errors or inaccuracies may occur. Please verify critical
+        information independently before making business decisions.
+      </p>
+      <p>
+        <strong>• Data Privacy & Security:</strong> You can only access shipment data within your
+        authorized account permissions. Your data remains confidential and will not be shared with
+        other users or third parties.
+      </p>
+      <p>
+        <strong>• Information Accuracy: </strong> For critical business decisions or time-sensitive
+        matters, we recommend contacting our customer service team directly for verification.
+      </p>
+      <p>
+        <strong>• Service Limitations: </strong> This assistant provides general guidance and data
+        queries. For complex or specialized requests, please reach out to our support team.
+      </p>
+      <p>
+        By using this AI assistant, you acknowledge these limitations and agree to use the
+        information provided accordingly.
+      </p>
+    </el-dialog>
   </div>
 </template>
 
 <style lang="scss" scoped>
 .ai-robot {
   position: absolute;
-  top: 74px;
+  top: 24px;
   right: 24px;
-  height: calc(100% - 98px);
-  z-index: 4000;
+  height: calc(100% - 48px);
+  z-index: 2000;
   display: flex;
   flex-direction: column;
   border-radius: 12px;
@@ -466,7 +582,6 @@ defineExpose({
       .option-icon {
         display: flex;
         align-items: center;
-        gap: 6px;
         .font_family {
           font-size: 16px;
           cursor: pointer;
@@ -519,22 +634,15 @@ defineExpose({
     .message-item {
       position: relative;
       display: inline-block;
-      padding: 11px 8px;
+      padding: 12px 16px;
       margin-bottom: 7px;
       border-radius: 12px;
       background-color: var(--scoring-bg-color);
       .review {
-        position: absolute;
-        bottom: -24px;
-        left: 0;
         display: flex;
         align-items: center;
-        gap: 13px;
-        width: 100%;
-        height: 30px;
-        margin-top: 10px;
-        padding-left: 30px;
-        padding-top: 5px;
+        gap: 16px;
+        margin-top: 12px;
 
         button.el-button + .el-button {
           margin-left: 0px;
@@ -563,7 +671,6 @@ defineExpose({
         width: 16px;
         span {
           color: var(--color-neutral-2);
-          font-size: 14px;
         }
         &:hover {
           span {
@@ -591,7 +698,7 @@ defineExpose({
         height: 16px;
         width: 16px;
         border-radius: 50%;
-        background-color: var(--color-customize-column-right-section-bg);
+        background-color: var(--color-pause-btn-bg);
         .dot {
           height: 5px;
           width: 5px;
@@ -600,11 +707,7 @@ defineExpose({
         }
       }
     }
-    .query-style {
-      span {
-        color: #b5b9bf;
-      }
-    }
+
     .robot-bubble {
       background: var(--scoring-bg-color);
       align-self: flex-start;
@@ -631,7 +734,7 @@ defineExpose({
       position: absolute;
       right: 50%;
       transform: translateX(50%);
-      bottom: 58px;
+      bottom: 76px;
       display: flex;
       justify-content: center;
       align-items: center;
@@ -641,7 +744,7 @@ defineExpose({
       // background-color: #f5f4f4;
       background: rgba(255, 255, 255, 0.6); /* 半透明背景色 */
       box-shadow: 2px 2px 12px 0px rgba(0, 0, 0, 0.3);
-      backdrop-filter: blur(1px); /* 应用10px的模糊效果 */
+      backdrop-filter: blur(1.7px); /* 应用10px的模糊效果 */
       span {
         color: #2b2f36;
       }
@@ -698,6 +801,20 @@ defineExpose({
       }
     }
   }
+  .liability-exemption {
+    margin-top: 8px;
+    font-size: 12px;
+    text-align: center;
+    span {
+      color: var(--color-neutral-3);
+    }
+    .liability-exemption-btn {
+      margin-left: 2px;
+      text-decoration: underline;
+      color: var(--color-theme);
+      cursor: pointer;
+    }
+  }
 
   @keyframes loading-rotate {
     0% {
@@ -709,4 +826,17 @@ defineExpose({
     }
   }
 }
+:deep(.liability-exemption-dialog) {
+  padding-bottom: 0;
+  .el-dialog__body {
+    padding-top: 8px;
+    p {
+      margin-bottom: 8px;
+      line-height: 21px;
+      &:last-child {
+        margin-bottom: 0;
+      }
+    }
+  }
+}
 </style>

+ 10 - 2
src/views/AIRobotChat/src/components/AIQuestions.vue

@@ -98,6 +98,10 @@ onMounted(() => {
   AIRobotInit()
 })
 
+defineExpose({
+  AIRobotInit
+})
+
 const emit = defineEmits<{ question: [string] }>()
 const clickQuestion = (question) => {
   emit('question', question)
@@ -120,7 +124,7 @@ const clickQuestion = (question) => {
         v-if="props.modalSize === 'large'"
         class="carousel large_carousel"
         :autoplay="false"
-        height="115px"
+        height="105px"
       >
         <el-carousel-item v-for="(page, index) in pages" :key="index">
           <div class="dialogue_container dialogue_container_large">
@@ -190,7 +194,7 @@ const clickQuestion = (question) => {
   color: transparent;
   font-size: 14px;
   font-weight: 700;
-  margin: 5px 0 0 55px;
+  margin: 1px 0 0 55px;
 }
 .small_carousel {
   width: 452px;
@@ -239,4 +243,8 @@ const clickQuestion = (question) => {
 :deep(.el-carousel__item--card, .el-carousel__item.is-animating) {
   padding-bottom: 0 !important;
 }
+:deep(.el-carousel__indicators--horizontal) {
+  bottom: -2px;
+  height: 16px;
+}
 </style>

+ 16 - 3
src/views/AIRobotChat/src/components/AutoResizeTextarea.vue

@@ -11,14 +11,14 @@ watch(
   }
 )
 const textareaRef = ref(null)
+const isComposing = ref(false)
+
 // 实现自适应高度(最多 4 行)
 const resize = () => {
   const el = textareaRef.value
   if (!el) return
-
   el.style.height = 'auto' // 先清空旧高度
   const scrollHeight = el.scrollHeight
-
   const maxHeight = 92 // 四行时高度
 
   if (scrollHeight <= maxHeight) {
@@ -29,6 +29,17 @@ const resize = () => {
     el.style.height = maxHeight + 'px'
   }
 }
+
+// 处理中文输入法
+const handleCompositionStart = () => {
+  isComposing.value = true
+}
+
+const handleCompositionEnd = () => {
+  isComposing.value = false
+  nextTick(resize)
+}
+
 const emit = defineEmits(['focus', 'blur'])
 </script>
 
@@ -39,7 +50,9 @@ const emit = defineEmits(['focus', 'blur'])
     class="input-area"
     rows="1"
     :placeholder="props.placeholder"
-    @input="resize"
+    @input="!isComposing && resize()"
+    @compositionstart="handleCompositionStart"
+    @compositionend="handleCompositionEnd"
     @focus="emit('focus')"
     @blur="emit('blur')"
   />

+ 1 - 0
src/views/Booking/src/BookingView.vue

@@ -519,6 +519,7 @@ const SearchInput = () => {
   color: var(--color-neutral-1);
   font-weight: 600;
   font-size: var(--font-size-2);
+  border-color: var(--tag-boder-color);
   background-color: var(--tag-bg-color) !important;
 }
 .iconfont_icon_tip {

+ 53 - 45
src/views/ChatLog/src/ChatLog.vue

@@ -1,21 +1,20 @@
 <script lang="ts" setup>
 import { useCalculatingHeight } from '@/hooks/calculatingHeight'
 import TableView from './components/TableView'
-import LogDialog from '@/views/AIApiLog/src/components/LogDialog.vue'
+import dayjs from 'dayjs'
 
-const OperationSearch = ref()
 const filterRef: Ref<HTMLElement | null> = ref(null)
 const containerHeight = useCalculatingHeight(document.documentElement, 290, [filterRef])
 const searchData = ref({
-  inputModel: '',
-  startDate: '',
-  endDate: '',
-  userType: '',
-  questionType: '',
-  answerType: '',
-  answerSatisfaction: '',
-  comparator: 'thanOrEqual',
-  responseDuration: 0
+  text_search: '',
+  question_date_start: '',
+  question_date_end: '',
+  user_type: '',
+  question_type: '',
+  answer_type: '',
+  answer_satisfication: '',
+  response_duration_type: '',
+  response_duration_num: null
 })
 
 const userTypeList = [
@@ -31,47 +30,47 @@ const userTypeList = [
 const questionTypeList = [
   {
     label: 'Predefined Question',
-    value: 'predefinedQuestion'
+    value: 'Predefined Question'
   },
   {
-    label: 'free text',
-    value: 'freeText'
+    label: 'Free Text',
+    value: 'Free Text'
   }
 ]
 const AnswerTypeList = [
   {
     label: 'Suspend',
-    value: 'suspend'
+    value: 'Suspend'
   },
   {
     label: 'Timeout',
-    value: 'timeout'
+    value: 'Timeout'
   },
   {
     label: 'Predefined Template',
-    value: 'predefinedTemplate'
+    value: 'Predefined Template'
   },
   {
     label: 'AI Answer',
-    value: 'AIAnswer'
+    value: 'AI Answer'
   }
 ]
 const answerSatisfactionList = [
   {
     label: 'Null',
-    value: 'null'
+    value: 'Null'
   },
   {
     label: 'Good',
-    value: 'good'
+    value: 'Good'
   },
   {
     label: 'Not Good',
-    value: 'notGood'
+    value: 'Not Good'
   }
 ]
 
-const comparatorList = [
+const response_duration_typeList = [
   {
     label: '>=',
     value: 'thanOrEqual'
@@ -88,17 +87,17 @@ const comparatorList = [
 const tableRef = ref()
 
 const Search = () => {
-  tableRef.value.SearchOperationLog(searchData.value)
+  tableRef.value.searchTableData(searchData.value)
 }
 const DateChange = (date: any) => {
-  searchData.value.startDate = date[0]
-  searchData.value.endDate = date[1]
-  tableRef.value.SearchOperationLog(searchData.value)
-}
-
-const logDialogRef = ref()
-const openDialog = () => {
-  logDialogRef.value.openDialog()
+  if (!date) {
+    searchData.value.question_date_start = ''
+    searchData.value.question_date_end = ''
+  } else {
+    searchData.value.question_date_start = dayjs(date[0]).format('MM/DD/YYYY')
+    searchData.value.question_date_end = dayjs(date[1]).format('MM/DD/YYYY')
+  }
+  tableRef.value.searchTableData(searchData.value)
 }
 </script>
 <template>
@@ -109,7 +108,8 @@ const openDialog = () => {
         <div class="input-tips_filter">
           <el-input
             placeholder="Search Question ID、User"
-            v-model="OperationSearch"
+            v-model="searchData.text_search"
+            clearable
             class="log_input"
           >
             <template #prefix>
@@ -126,7 +126,7 @@ const openDialog = () => {
           <CalendarDate @DateChange="DateChange"></CalendarDate>
         </div>
         <div class="tips_filter">
-          <el-select v-model="searchData.userType" placeholder="User Type">
+          <el-select v-model="searchData.user_type" clearable placeholder="User Type">
             <el-option
               v-for="item in userTypeList"
               :key="item.value"
@@ -136,7 +136,7 @@ const openDialog = () => {
           </el-select>
         </div>
         <div class="tips_filter">
-          <el-select v-model="searchData.questionType" placeholder="Question Type">
+          <el-select clearable v-model="searchData.question_type" placeholder="Question Type">
             <el-option
               v-for="item in questionTypeList"
               :key="item.value"
@@ -147,7 +147,7 @@ const openDialog = () => {
           </el-select>
         </div>
         <div class="tips_filter">
-          <el-select v-model="searchData.answerType" placeholder="Answer Type">
+          <el-select clearable v-model="searchData.answer_type" placeholder="Answer Type">
             <el-option
               v-for="item in AnswerTypeList"
               :key="item.value"
@@ -158,7 +158,11 @@ const openDialog = () => {
           </el-select>
         </div>
         <div class="tips_filter">
-          <el-select v-model="searchData.answerSatisfaction" placeholder="Answer Satisfaction">
+          <el-select
+            clearable
+            v-model="searchData.answer_satisfication"
+            placeholder="Answer Satisfaction"
+          >
             <el-option
               v-for="item in answerSatisfactionList"
               :key="item.value"
@@ -168,11 +172,16 @@ const openDialog = () => {
             </el-option>
           </el-select>
         </div>
-        <div class="comparator-tips_filter">
+        <div class="response_duration_type-tips_filter">
           <span>Response Duration</span>
-          <el-select v-model="searchData.comparator" style="width: 70px; margin: 0 6px">
+          <el-select
+            clearable
+            v-model="searchData.response_duration_type"
+            style="width: 70px; margin: 0 6px"
+            placeholder=""
+          >
             <el-option
-              v-for="item in comparatorList"
+              v-for="item in response_duration_typeList"
               :key="item.value"
               :label="item.label"
               :value="item.value"
@@ -180,18 +189,17 @@ const openDialog = () => {
             </el-option>
           </el-select>
           <el-input-number
-            v-model="searchData.responseDuration"
-            placeholder="s"
+            v-model="searchData.response_duration_num"
+            placeholder=""
             :controls="false"
             :min="0"
-            style="width: 60px"
+            style="width: 60px; height: 34px"
           ></el-input-number>
         </div>
         <el-button class="el-button--dark" @click="Search">Search</el-button>
       </div>
     </div>
-    <TableView :height="containerHeight" ref="tableRef"></TableView>
-    <LogDialog ref="logDialogRef" />
+    <TableView :height="containerHeight" :searchData="searchData" ref="tableRef"></TableView>
   </div>
 </template>
 
@@ -249,7 +257,7 @@ const openDialog = () => {
   height: 32px;
   margin-right: 8px;
 }
-.comparator-tips_filter {
+.response_duration_type-tips_filter {
   flex: 1;
   display: flex;
   align-items: center;

+ 64 - 17
src/views/ChatLog/src/components/TableView/src/TableView.vue

@@ -2,15 +2,20 @@
 import { ref, nextTick, onMounted } from 'vue'
 import { type VxeGridInstance, type VxeGridProps } from 'vxe-table'
 import DownloadDialog from './components/DownloadDialog.vue'
-// import { autoWidth } from '@/utils/table'
+import { autoWidth } from '@/utils/table'
 import { useRowClickStyle } from '@/hooks/rowClickStyle'
 import dayjs from 'dayjs'
 import { formatTimezone, formatNumber } from '@/utils/tools'
+import LogDialog from '@/views/AIApiLog/src/components/LogDialog.vue'
 
 const props = defineProps({
   height: {
     type: Number,
     default: 440
+  },
+  searchdata: {
+    type: Object,
+    default: () => ({})
   }
 })
 
@@ -58,11 +63,12 @@ const handleColumns = (columns: any, status?: string) => {
 // 获取表格列
 const getTableColumns = async () => {
   tableLoadingColumn.value = true
-  await $api.getOperationTableColumns().then((res: any) => {
+  await $api.getChatLogTableColumn().then((res: any) => {
     if (res.code === 200) {
       tableData.value.columns = [
         { type: 'checkbox', width: 50, fixed: 'left' },
-        ...handleColumns(res.data.OperationTableColumns)
+        ...handleColumns(res.data.OperationTableColumns),
+        { title: 'Action', width: 106, fixed: 'right', slots: { default: 'action' } }
       ]
       tableOriginColumnsField.value = res.data.OperationTableColumns
     }
@@ -88,22 +94,21 @@ const assignTableData = (data: any) => {
     allTable.value.data = data.searchData || []
     // 为了让导出的表格列宽度自适应
     nextTick(() => {
-      // allTableRef.value && autoWidth(allTable.value, allTableRef.value)
+      allTableRef.value && autoWidth(allTable.value, allTableRef.value)
     })
   }, 1000)
 }
 
-let searchdata: any = {}
 // 获取表格数据
 const getTableData = async (isPageChange?: boolean) => {
   const rc = isPageChange ? pageInfo.value.total : -1
   tableLoadingTableData.value = true
   await $api
-    .SearchOperationLog({
+    .getChatLogTableData({
       cp: pageInfo.value.pageNo,
       ps: pageInfo.value.pageSize,
       rc,
-      ...searchdata
+      ...props.searchdata
     })
     .then((res: any) => {
       if (res.code === 200) {
@@ -114,16 +119,15 @@ const getTableData = async (isPageChange?: boolean) => {
       selectedNumber.value = 0
       selectedTableData.value = []
       nextTick(() => {
-        // tableRef.value && autoWidth(tableData.value, tableRef.value)
+        tableRef.value && autoWidth(tableData.value, tableRef.value)
         tableLoadingTableData.value = false
       })
     })
 }
-const SearchOperationLog = (val: any) => {
-  searchdata = val
+const searchTableData = (val: any) => {
   tableLoadingTableData.value = true
   $api
-    .SearchOperationLog({
+    .getChatLogTableData({
       cp: pageInfo.value.pageNo,
       ps: pageInfo.value.pageSize,
       rc: -1,
@@ -138,7 +142,7 @@ const SearchOperationLog = (val: any) => {
       selectedNumber.value = 0
       selectedTableData.value = []
       nextTick(() => {
-        // tableRef.value && autoWidth(tableData.value, tableRef.value)
+        tableRef.value && autoWidth(tableData.value, tableRef.value)
         tableLoadingTableData.value = false
       })
     })
@@ -146,7 +150,7 @@ const SearchOperationLog = (val: any) => {
 onMounted(() => {
   Promise.all([getTableColumns(), getTableData(false)]).finally(() => {
     nextTick(() => {
-      // tableRef.value && autoWidth(tableData.value, tableRef.value)
+      tableRef.value && autoWidth(tableData.value, tableRef.value)
     })
   })
 })
@@ -274,7 +278,7 @@ const getExportTableData = (status: number) => {
   }
   $api
     .OperationLogDownload({
-      selected_fields: column,
+      // selected_fields: column,
       tmp_search: tempSearch.value
     })
     .then((res: any) => {
@@ -331,8 +335,26 @@ const handleCheckAllChange = ({ records }: any) => {
   selectedNumber.value = records.length
   selectedTableData.value = records
 }
+
+const logDialogRef = ref()
+const logLoading = ref(false)
+const handleLogDetail = (row: any) => {
+  logLoading.value = true
+  $api
+    .getAIApiLogDialog({
+      request_id: row.request_id
+    })
+    .then((res: any) => {
+      if (res.code === 200) {
+        logLoading.value = false
+        const data = res.data.Data
+        // 打开日志详情对话框
+        logDialogRef.value.openDialog(data.request_content, data.ai_response_content)
+      }
+    })
+}
 defineExpose({
-  SearchOperationLog
+  searchTableData
 })
 </script>
 
@@ -345,7 +367,13 @@ defineExpose({
     element-loading-custom-class="element-loading"
     element-loading-background="rgb(43, 47, 54, 0.7)"
   >
-    <div class="table-tools">
+    <div
+      class="table-tools"
+      v-loading.fullscreen.lock="logLoading"
+      element-loading-text="Loading..."
+      element-loading-custom-class="element-loading"
+      element-loading-background="rgb(43, 47, 54, 0.7)"
+    >
       <div class="left-total-records">{{ selectedNumber }} Selected</div>
       <div class="right-tools-btn">
         <el-button class="el-button--main el-button--pain-theme" @click="handleDownload">
@@ -367,6 +395,20 @@ defineExpose({
       <template #empty v-if="!tableLoadingTableData && tableData.data.length === 0">
         <VEmpty> </VEmpty>
       </template>
+      <!-- action操作栏的插槽 -->
+      <template #action="{ row }">
+        <el-button
+          style="height: 24px; padding: 8px 4px; padding-left: 5px; font-size: 12px"
+          @click="handleLogDetail(row)"
+          v-if="row['Question Type'] !== 'Predefined Question'"
+        >
+          <span
+            style="margin-right: 2px; font-size: 15px"
+            class="font_family icon-icon_ai_api_log_b"
+          ></span
+          >AI API Log
+        </el-button>
+      </template>
     </vxe-grid>
     <vxe-grid :height="10" ref="allTableRef" class="all-table" v-bind="allTable"> </vxe-grid>
     <div class="bottom-pagination">
@@ -385,7 +427,12 @@ defineExpose({
         />
       </div>
     </div>
-    <DownloadDialog @export="getExportTableData" ref="downloadDialogRef" />
+    <DownloadDialog
+      @export="getExportTableData"
+      ref="downloadDialogRef"
+      :isHideSelectColumn="true"
+    />
+    <LogDialog ref="logDialogRef" />
   </div>
 </template>
 

+ 7 - 1
src/views/ChatLog/src/components/TableView/src/components/DownloadDialog.vue

@@ -1,4 +1,10 @@
 <script setup lang="ts">
+const props = withDefaults(
+  defineProps<{
+    isHideSelectColumn: boolean
+  }>(),
+  { isHideSelectColumn: false }
+)
 const dialogVisible = ref(false)
 
 const openDialog = (selectedColumns: string[], slectedDataNumber: number) => {
@@ -41,7 +47,7 @@ defineExpose({
             }}</span>
           </div>
         </div>
-        <div class="download-filter">
+        <div class="download-filter" v-if="!props.isHideSelectColumn">
           <el-radio-group v-model="downloadFilter">
             <el-radio :value="1"
               >Download with selected columns

+ 12 - 0
src/views/Layout/src/LayoutView.vue

@@ -7,7 +7,9 @@ import ScoringGrade from '@/components/ScoringGrade'
 import AIRobot from '@/components/AIRobot'
 import AIRobotChat from '@/views/AIRobotChat/src/AIRobotChat.vue'
 import LogoMenu from './images/logo_menu.png'
+import { useUserStore } from '@/stores/modules/user'
 
+const userStore = useUserStore()
 const leftAsideWidth = ref('232px')
 const isCollapse = ref(false)
 const handleMenuCollapse = (val: boolean) => {
@@ -36,6 +38,16 @@ const handelClickAIDefault = async (item: any) => {
   }
 }
 
+watch(
+  () => userStore.isLogin,
+  (newVal) => {
+    if (newVal) {
+      getPrompt()
+    } else {
+      AIRobotChatref.value?.clearData()
+    }
+  }
+)
 const getPrompt = () => {
   $api.getPrompt().then((res) => {
     if (res.code === 200) {

+ 2 - 0
src/views/Layout/src/components/Header/HeaderView.vue

@@ -11,6 +11,7 @@ import { useThemeStore } from '@/stores/modules/theme'
 import { useNotificationMessage } from '@/stores/modules/notificationMessage'
 import NotificationDrawer from './components/NotificationDrawer.vue'
 import TrainingCard from './components/TrainingCard.vue'
+import emitter from '@/utils/bus'
 
 const notificationMsgStore = useNotificationMessage()
 const themeStore = useThemeStore()
@@ -132,6 +133,7 @@ const handleUserManual = () => {
         }
         if (res.data?.code === 403) {
           sessionStorage.clear()
+          emitter.emit('login-out');
           router.push('/login')
           userStore.logout()
           ElMessage.warning({

+ 2 - 2
src/views/Layout/src/components/Menu/MenuView.vue

@@ -231,13 +231,13 @@ const jumpLink = (link: string) => {
       <el-collapse v-model="activeName" accordion>
         <el-collapse-item title="REGIONAL SOLUTIONS" name="1" :icon="CaretRight">
           <div class="blogroll-content">
-            <div class="blogroll-item" @click="jumpLink('https://www.kerrysiamseaport.com/')">
+            <div class="blogroll-item" @click="jumpLink('https://www.ksp.kln.com/')">
               <img
                 style="height: 16px; width: 16px; margin-right: 4px"
                 src="./images/flag.png"
                 alt="string"
               />
-              <span class="title">Kerry Siam Seaport Web Service</span>
+              <span class="title">KLN Siam Seaport Web Service</span>
             </div>
           </div>
         </el-collapse-item>

+ 17 - 2
src/views/Login/src/loginView.vue

@@ -173,13 +173,14 @@ const handleVerification = () => {
   // 这里是登录逻辑
   // handleLoginAfterVerify()
 }
+const loginLoading = ref(false)
 // 验证结束后通过status值判断调登录还是忘记密码接口
 const confirmVerification = () => {
   // 生成验证成功的密文
   const pwd = dayjs().unix()
   confirmVerifyStatus.value = encryptVerificationPwd(pwd)
   isShowSliderVerification.value = false
-
+  loginLoading.value = true
   if (status.value === 'login') {
     handleLoginAfterVerify()
   } else {
@@ -259,6 +260,9 @@ const handleLoginAfterVerify = () => {
       }
       handleResult(res)
     })
+    .finally(() => {
+      loginLoading.value = false
+    })
 }
 
 // 从忘记密码返回登录
@@ -285,6 +289,7 @@ const handleForgot = () => {
 }
 const handleSendPassword = () => {
   if (!isUserNameExit.value || !loginForm.value.username) {
+    loginLoading.value = false
     return
   }
   // 这里是发送密码逻辑
@@ -299,6 +304,9 @@ const handleSendPassword = () => {
         backLogin(true)
       }
     })
+    .finally(() => {
+      loginLoading.value = false
+    })
 }
 
 const isEmailTips = ref(false)
@@ -327,7 +335,14 @@ const firstLoginTipsRef = ref()
 </script>
 
 <template>
-  <div class="login" :class="{ 'dark-bg': themeStore.theme === 'dark' }">
+  <div
+    class="login"
+    v-loading.fullscreen.lock="loginLoading"
+    element-loading-text="Loading..."
+    element-loading-custom-class="element-loading"
+    element-loading-background="rgb(43, 47, 54, 0.7)"
+    :class="{ 'dark-bg': themeStore.theme === 'dark' }"
+  >
     <ScoringSystem class="scoring-system"></ScoringSystem>
     <el-card class="login-card" v-if="status === 'login'">
       <div class="card-title" :class="{ 'is-dark': themeStore.theme === 'dark' }">

+ 3 - 0
src/views/SystemMessage/src/SystemMessage.vue

@@ -176,6 +176,7 @@ onMounted(() => {
                 :data="notificationList"
                 @hasCardRead="changeCardRead"
                 :isScrollPadding="true"
+                :isShowInsertionTime="true"
                 :updateReadCardsOnChange="false"
               ></NotificationMessageCard>
             </div>
@@ -196,6 +197,7 @@ onMounted(() => {
                 v-if="activeTabName === 'Unread'"
                 :data="unreadNotificationList"
                 :isScrollPadding="true"
+                :isShowInsertionTime="true"
                 :updateReadCardsOnChange="false"
               ></NotificationMessageCard>
             </div>
@@ -207,6 +209,7 @@ onMounted(() => {
                 v-if="activeTabName === 'Read'"
                 :updateReadCardsOnChange="false"
                 :isScrollPadding="true"
+                :isShowInsertionTime="true"
                 :data="readNotificationList"
               >
               </NotificationMessageCard>

+ 1 - 0
src/views/Tracking/src/TrackingView.vue

@@ -767,6 +767,7 @@ const SearchInput = () => {
   color: var(--color-neutral-1);
   font-weight: 600;
   font-size: var(--font-size-2);
+  border-color: var(--tag-boder-color);
   background-color: var(--tag-bg-color) !important;
 }
 .iconfont_icon_tip {