Browse Source

消息优化

xiaochan 1 year ago
parent
commit
c5e7d75a68

+ 34 - 26
src/App.vue

@@ -124,6 +124,33 @@ function checkTheCallbacks({data, isAdd}) {
   })
 }
 
+function systemNotification(data) {
+  console.log(data)
+  if (data.count) {
+    systemStore.addUnreadMessageCount(data.count)
+  }
+
+  if (data.refreshDelay) {
+    sleep(data.refreshDelay).then(() => {
+      location.reload();
+    })
+  }
+
+  if (data?.donTDisplay) {
+    return
+  }
+
+  ElNotification({
+    title: typeof data.title === 'undefined' ? '新消息' : data.title,
+    message: h('pre', {
+      class: 'message_pre'
+    }, data.message),
+    dangerouslyUseHTMLString: true,
+    type: typeof data.type === 'undefined' ? 'warning' : data.type,
+    duration: 0,
+  })
+}
+
 onMounted(() => {
   createChannel()
 
@@ -152,36 +179,17 @@ onMounted(() => {
     })
   })
 
-  setCallback('systemNotification', (data) => {
-    if (data.count) {
-      systemStore.addUnreadMessageCount(data.count)
-    }
-
-    if (data.refreshDelay) {
-      sleep(data.refreshDelay).then(() => {
-        location.reload();
-      })
-    }
-
-    if (data?.donTDisplay) {
-      return
-    }
-
-    ElNotification({
-      title: typeof data.title === 'undefined' ? '新消息' : data.title,
-      message: data.message,
-      dangerouslyUseHTMLString: true,
-      type: typeof data.type === 'undefined' ? 'warning' : data.type,
-      duration: 0,
-    })
-  })
-
+  setCallback('systemNotification', systemNotification)
   setCallback('checkTheCallbacks', checkTheCallbacks)
   setCallback('avatarNotification', avatarNotification);
 })
-
 </script>
 
 <style lang="scss">
-
+.message_pre {
+  font-weight: normal;
+  margin: 0;
+  font-size: 14px;
+  line-height: 1;
+}
 </style>

+ 2 - 1
src/layout/function-list/Message.vue

@@ -45,7 +45,7 @@
       :show-close="false"
   >
     <div class="system-message-time">{{ systemMessages.list[systemMessages.current].sendDatetime }}</div>
-    <div class="system-message-content">{{ systemMessages.list[systemMessages.current].content }}</div>
+    <pre class="system-message-content">{{ systemMessages.list[systemMessages.current].content }}</pre>
     <div class="system-message-footer">
       <el-button type="primary" icon="ArrowLeft" :disabled="systemMessages.current === 0" circle title="上一条"
                  @click="messageIndexIncrease(-1)"></el-button>
@@ -316,6 +316,7 @@ i {
   margin-top: 16px;
   font-size: 16px;
   font-weight: bold;
+  color: #303133;
 }
 
 .system-message-footer {

+ 4 - 8
src/views/hospitalization/zhu-yuan-yi-sheng/yi-zhu-lu-ru/components/table/YzTableV3.vue

@@ -323,13 +323,11 @@ yzMitt.on('scrollEndAndTwinkle', async (val: any) => {
   await nextTick()
   await sleep(500)
   if (queryParam.value.sort === OrderBy.asc) {
-    let endRow = tempYzData.value[tempYzData.value.length - 1]
-    // 滚动到最后一行
-    await tableRef.value?.scrollToRow(endRow, 'actOrderNo');
+    const tmp = tableRef.value!.getData()
+    await tableRef.value!.scrollTo(0, tmp.length * 24)
   } else {
     await tableRef.value?.scrollTo(0, 0);
   }
-
 })
 
 yzMitt.on('setOrderNoTwinkle', async (val: number) => {
@@ -338,8 +336,7 @@ yzMitt.on('setOrderNoTwinkle', async (val: number) => {
   await sleep(500)
   if (queryParam.value.sort === OrderBy.asc) {
     const tmp = tableRef.value!.getData()
-    const endRow = tmp[tmp.length - 1]
-    await tableRef.value?.scrollToRow(endRow, 'actOrderNo')
+    tableRef.value!.scrollTo(0, tmp.length * 24)
   } else {
     await tableRef.value?.scrollTo(0, 0);
   }
@@ -356,7 +353,6 @@ yzMitt.on('getSelectedData', () => {
       height="auto"
       sync-resize
       auto-resize
-      field="actOrderNo"
       :menu-config="menuConfig"
       @menu-click="tableRightClick"
       @cell-dblclick="setDefaultStopTime"
@@ -364,7 +360,7 @@ yzMitt.on('getSelectedData', () => {
       :scroll-x="{gt: 40,enabled: false}"
       :scroll-y="{gt: 0,enabled: true}"
       :column-config="{resizable: true}"
-      :row-config="{height: 24, isHover: true}"
+      :row-config="{height: 24, isHover: true, keyField:'actOrderNo'}"
       class="vxe-padding_zero vxe-header-max_content hl-style"
       header-row-class-name="padding_zero"
       show-header-overflow