From 529f48641122af7c0aec185e4283d02e97aa0f89 Mon Sep 17 00:00:00 2001
From: shikeying <pxzsky@163.com>
Date: 星期三, 19 四月 2023 14:40:51 +0800
Subject: [PATCH] 增加 websocket

---
 src/layout/index.vue |   92 +++++++++++++++++++++++++++++++++++++++++++++
 1 files changed, 91 insertions(+), 1 deletions(-)

diff --git a/src/layout/index.vue b/src/layout/index.vue
index f048657..c9032db 100644
--- a/src/layout/index.vue
+++ b/src/layout/index.vue
@@ -16,7 +16,7 @@
 </template>
 
 <script>
-import RightPanel from '@/components/RightPanel'
+import RightPanel from '@/components/RuoYi/RightPanel'
 import { AppMain, Navbar, Settings, Sidebar, TagsView } from './components'
 import ResizeMixin from './mixin/ResizeHandler'
 import { mapState } from 'vuex'
@@ -52,8 +52,37 @@
     },
     variables() {
       return variables;
+    },
+
+    // 2023-04-17锛屽畾涔夋帴鏀秝ebsocket娑堟伅
+    getWsMsg (){
+      // return this.$store.websocket.state.webSocketMsg;
+      return this.$store.state.user.webSocketMsg;
     }
   },
+  // 2023-04-17
+  watch: {
+    getWsMsg:{
+      handler: function(newVal) {
+        // console.log(newVal)
+        // alert('鎺ユ敹鍒皐ebSocket鎺ㄩ��:'+ newVal);
+        this.$notify({
+          title: '鏂版秷鎭彁閱掞細',  //鏍囬
+          // message: '杩欐槸涓�鏉′笉浼氳嚜鍔ㄥ叧闂殑娑堟伅',  //鍐呭
+          duration: 0,  //璁剧疆寮规娑堝け浜嬩欢
+          position:'bottom-right',  // 璁剧疆寮规鍦ㄥ睆骞曠殑鍝釜瑙掑脊鍑猴紙鍙兘璁剧疆4涓锛�
+          type: 'info',  //缁欐爣棰樺墠鍔犱竴涓皬鍥炬爣
+          offset: 100,  //鍋忕Щ閲忥細璺濈鍥涗釜瑙掔殑鍋忕Щ绋嬪害锛堥粯璁ゅ亸绉讳簡16px锛�
+          dangerouslyUseHTMLString: true,  //鏄惁鏀寔寮瑰嚭妗嗗唴浼犲叆 HTML 鐗囨
+          message: '<strong>杩欐槸 <i>HTML</i> 鐗囨</strong>' + newVal,   //寮�鍚悗锛岃繖閲屽彲浠ュ啓html
+          showClose: true,  //闅愯棌鍏抽棴鎸夐挳锛堝彸涓婅鐨剎  榛樿涓簍rue锛屾樉绀猴級
+          onClose() {console.log('鍏抽棴鍟�', event)},  // 鎵嬪姩鍏抽棴鏃剁殑鍥炶皟鍑芥暟
+        });
+        this.$store.state.app.tts.speak("鏈夋柊娑堟伅鎻愰啋锛岃鐐瑰嚮鏌ョ湅");
+      }
+    }
+  },
+
   methods: {
     handleClickOutside() {
       this.$store.dispatch('app/closeSideBar', { withoutAnimation: false })
@@ -108,4 +137,65 @@
   .mobile .fixed-header {
     width: 100%;
   }
+
+  // mike, 2023-04-11
+  .noselect {
+    -webkit-touch-callout: none; /* iOS Safari */
+    -webkit-user-select: none; /* Chrome/Safari/Opera */
+    -khtml-user-select: none; /* Konqueror */
+    -moz-user-select: none; /* Firefox */
+    -ms-user-select: none; /* Internet Explorer/Edge */
+    user-select: none; /* Non-prefixed version, currently not supported by any browser */
+  }
+  .main {
+    max-width: 1200px;
+    margin-left: auto;
+    margin-right: auto;
+    padding-left: 25px;
+  }
+
+  .app-main {
+    width: 100%;
+    display: flex;
+  }
+
+  .base-container {
+    /*50 = navbar  */
+    flex: 1;
+    height: calc(100vh - 198px);
+    border-radius:10px;
+    overflow: auto;
+    scrollbar-width: none; /* Firefox */
+    -ms-overflow-style: none; /* IE 10+ */
+    &::-webkit-scrollbar {
+      display: none; /* Chrome Safari */
+    }
+    .box-card{
+      .el-card__body{
+        padding-top: 0;
+        .el-form-item--small.el-form-item{
+          margin-top: 20px;
+          margin-bottom: 0;
+        }
+        .el-form-item--mini.el-form-item{
+          margin-top: 20px;
+          margin-bottom: 0;
+        }
+      }
+    }
+  }
+
+  .sidebar-box {
+    margin: 0 20px 0 0 ;
+    .box-card{
+      min-height: 300px;
+      max-height: calc(100vh - 198px);
+      overflow: auto;
+      scrollbar-width: none; /* Firefox */
+      -ms-overflow-style: none; /* IE 10+ */
+      &::-webkit-scrollbar {
+        display: none; /* Chrome Safari */
+      }
+    }
+  }
 </style>

--
Gitblit v1.9.1