刘洋 2 years ago
parent
commit
3bd30d76ad

+ 41 - 4
src/components/shared/MarkHeader.vue

@@ -20,7 +20,11 @@
       <span class="data-item">
         <message :reply-user-id="props.replyUserId" :paper-path="props.paperPath"></message>
       </span>
-      <span class="data-item"><user-info></user-info></span>
+      <span class="data-item is-last"><user-info></user-info></span>
+
+      <div class="grid fill-light-gray pointer close-icon" @click="willLogout">
+        <el-icon><close /></el-icon>
+      </div>
     </div>
   </div>
 </template>
@@ -34,7 +38,10 @@ import SvgIcon from '@/components/common/SvgIcon.vue'
 import ColorPicker from '@/components/common/ColorPicker.vue'
 import Message from '@/components/shared/message/Message.vue'
 import UserInfo from '@/components/shared/UserInfo.vue'
-
+import { ElIcon } from 'element-plus'
+import { Close } from '@element-plus/icons-vue'
+import { logout } from '@/utils/shared'
+import { sessionStorage } from '@/plugins/storage'
 type ButtonType =
   | 'back'
   | 'scale-up'
@@ -212,9 +219,22 @@ watch(
   },
   { immediate: true }
 )
-
+const willLogout = async () => {
+  if (fullPath && !!sessionStorage.get('LOGIN_RESULT')) {
+    await mainStore.setUserMarkConfig({
+      [fullPath]: {
+        center: center.value,
+        ratio: ratio.value,
+        rotate: rotate.value,
+        frontColor: frontColor.value,
+        backgroundColor: backgroundColor.value,
+      },
+    })
+    logout()
+  }
+}
 onUnmounted(() => {
-  if (fullPath) {
+  if (fullPath && !!sessionStorage.get('LOGIN_RESULT')) {
     mainStore.setUserMarkConfig({
       [fullPath]: {
         center: center.value,
@@ -262,6 +282,23 @@ onUnmounted(() => {
         vertical-align: middle;
         background-color: #eeeeee;
       }
+      &.is-last:after {
+        width: 0;
+      }
+    }
+
+    .close-icon {
+      width: 32px;
+      height: 32px;
+      font-size: 1.4em;
+      border-radius: 50%;
+      place-items: center;
+      color: #666;
+      transition: all 0.3s ease-in-out;
+      &:hover {
+        background-color: #dfdfdf;
+        color: #444;
+      }
     }
   }
 }

+ 1 - 1
src/components/shared/MarkHistoryList.vue

@@ -77,7 +77,7 @@ const columns = computed<EpTableColumn<ExtractArrayValue<ExtractApiResponse<'get
       prop: 'markScore',
       width: 48,
       formatter(row) {
-        return `${row.markScore}${props.showLevel ? `(${row.scoreLevel})` : ''}`
+        return `${row.markScore === null ? '' : row.markScore}${props.showLevel ? `(${row.scoreLevel})` : ''}`
       },
     },
     { label: '类型', prop: 'historyType' },

+ 10 - 6
src/components/shared/message/Message.vue

@@ -2,7 +2,11 @@
   <message-component>
     <div ref="messageIcon" v-bind="$attrs" class="message-icon">
       <span v-show="unReadMessages?.newCount" class="un-read-num">
-        {{ Math.min(unReadMessages?.newCount || 0, 99) }}
+        {{
+          Math.min(unReadMessages?.newCount || 0, 99) > 99
+            ? Math.min(unReadMessages?.newCount || 0, 99) + '+'
+            : Math.min(unReadMessages?.newCount || 0, 99)
+        }}
       </span>
       <svg-icon name="message"></svg-icon>
     </div>
@@ -143,11 +147,11 @@ const onSendMessage = () => {
   position: relative;
   .un-read-num {
     position: absolute;
-    width: 16px;
-    height: 16px;
-    line-height: 16px;
-    right: -8px;
-    top: -8px;
+    width: 24px;
+    height: 24px;
+    line-height: 24px;
+    right: -12px;
+    top: -12px;
     text-align: center;
     color: $color--white;
     font-size: 10px;

+ 2 - 1
src/hooks/useSetImgBg.ts

@@ -37,7 +37,8 @@ function getRgba(canvas: any, that: any) {
   const imgdata = imgdatas.data
   const newJson: any = {}
   const length = imgdata.length
-  for (let i = 0; i < length; i++) {
+  console.log('length:' + length)
+  for (let i = 0; i < 250; i++) {
     if (i % 4 === 0) {
       const alpha = Math.round((imgdata[i + 3] / 255) * 100) / 100
       const rgba = imgdata[i] + ',' + imgdata[i + 1] + ',' + imgdata[i + 2] + ',' + alpha

+ 1 - 1
src/modules/bootstrap/change-password/index.vue

@@ -52,7 +52,7 @@ const rules: EpFormRules = {
           cb()
         }
       },
-      trigger: 'change',
+      trigger: 'blur',
     },
   ],
 }

+ 1 - 1
src/modules/marking/mark/index.vue

@@ -334,7 +334,7 @@ const checkMarkStatus = async (): Promise<boolean> => {
   const { markDayCount, markTotalCount } = myUserInfo
   let res: any = await getMarkStatus()
   if (!!markDayCount && res.personDayCount === markDayCount) {
-    ElMessage.success(`您当天的任务量${res.persionDayCount}已完成`)
+    ElMessage.success(`您当天的任务量${res.personDayCount}已完成`)
     clearTaskView()
     return false
   } else if (!!markTotalCount && res.personCount === markTotalCount) {