Bläddra i källkod

websocket & 财务实收款认领列表

wucl 6 månader sedan
förälder
incheckning
c32f50f6ee

+ 2 - 0
.env.development

@@ -48,3 +48,5 @@ VUE_APP_ONLYOFFICE_API_URL=$VUE_APP_ONLYOFFICE_SERVER/web-apps/apps/api/document
 VUE_APP_PRODUCTIVITY_PLATFORM_URL=http://127.0.0.1:8080/#/home/index
 
 # 只有以VUE_APP_开头的变量才会被webpack.DefinePlugin静态嵌入到客户端侧的包中
+
+VUE_APP_WEBSOCKET = ws://127.0.0.1:8088/api/ws

+ 3 - 1
.env.production

@@ -43,4 +43,6 @@ VUE_APP_ONLYOFFICE_CONVERT=$VUE_APP_ONLYOFFICE_SERVER/api/onlyoffice/callback
 VUE_APP_ONLYOFFICE_API_URL=$VUE_APP_ONLYOFFICE_SERVER/web-apps/apps/api/documents/api.js
 
 # 生产力平台URL
-VUE_APP_PRODUCTIVITY_PLATFORM_URL=http://doc.scdayou.com/prod/
+VUE_APP_PRODUCTIVITY_PLATFORM_URL=http://doc.scdayou.com/prod/
+
+VUE_APP_WEBSOCKET = ws://mbs.scdayou.com/api/ws

+ 4 - 1
src/api/modules/financeClaim.js

@@ -38,6 +38,9 @@ export default {
    },
    getPersonalStat(params){
     return request.get(`financeClaim/personal/stat`, { params: params })
-   }
+   },
+   claimPage(params) {
+    return request.get(`financeClaim/page`, { params: params })
+  },
 
 }

+ 30 - 2
src/components/TaskReminder/index.vue

@@ -9,11 +9,13 @@
           <el-button type="text" @click="closeReminder">标记已读</el-button>
         </div>
     </div>
-    <p class="card__content">{{user}}提交{{businessType}}{{no}}的新的流程待办,请及时处理。</p>
+    <div class="card__content"><span style="color: red;">{{user}}</span>提交了<span style="color: red;">{{businessType}}{{no}}</span>
+      <span>新的流程待办给您,请及时处理!</span>
+    </div>
     <div class="card__date">
         {{ created }}
     </div>
-    <div class="card__arrow">
+    <div class="card__arrow" @click="jump()">
         <svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" height="15" width="15">
             <path fill="#fff" d="M13.4697 17.9697C13.1768 18.2626 13.1768 18.7374 13.4697 19.0303C13.7626 19.3232 14.2374 19.3232 14.5303 19.0303L20.3232 13.2374C21.0066 12.554 21.0066 11.446 20.3232 10.7626L14.5303 4.96967C14.2374 4.67678 13.7626 4.67678 13.4697 4.96967C13.1768 5.26256 13.1768 5.73744 13.4697 6.03033L18.6893 11.25H4C3.58579 11.25 3.25 11.5858 3.25 12C3.25 12.4142 3.58579 12.75 4 12.75H18.6893L13.4697 17.9697Z"></path>
         </svg>
@@ -66,6 +68,31 @@ export default {
           closeReminder(){
             this.$emit('doRead',this.id);
             this.show = false;
+          },
+          jump(){
+            let tag = null;
+            if (this.businessType=='大中型业务'){
+              tag = 'major'
+            }
+            if (this.businessType=='个贷业务'){
+              tag = 'personal'
+            }
+            if (this.businessType=='资产业务'){
+              tag = 'assets'
+            }
+            if (this.businessType=='大中型-提成申报-市场人员'){
+              tag = 'majorCheck'
+            }
+            if (this.businessType=='大中型-提成申报-评估人员'){
+              tag = 'majorCheck'
+            }
+            if (this.businessType=='资产-提成申报-市场人员'){
+              tag = 'assetsDeclareCheckList'
+            }
+            if (this.businessType=='资产-提成申报-评估人员'){
+              tag = 'assetsDeclareCheckList'
+            }
+            this.$router.push(`/complex/index?businessType=${tag}`)
           }
     },
       
@@ -100,6 +127,7 @@ export default {
 .card .card__content {
   color: var(--secondary-color);
   font-size: 0.86rem;
+  font-size: 16px;
 }
 
 .card .card__title {

+ 14 - 18
src/layout/components/Navbar.vue

@@ -57,8 +57,8 @@
       <img src="../../assets/icon/logout.png" alt=""
         style="width: 16px;position: absolute;top: 22px;right: 20px;cursor: pointer;" @click="logout">
     </div>
-    <taskReminder v-for="(r,index) in reminders" 
-    :count="reminders.length" :user="r.user" 
+    <taskReminder v-for="(r,index) in client.messages" 
+    :count="client.messages.length" :user="r.user" 
     :businessType="r.businessType" :id="r.id"
     :no="r.no" :created="r.created" @doRead="doRead"></taskReminder>
   </div>
@@ -101,8 +101,7 @@ export default {
       reminders:[],
       client: {
                 messages: [
-                    { data: "*" },
-                    { userSize: 0 }
+                    
                 ]
             },
     }
@@ -114,13 +113,14 @@ export default {
   },
 
   mounted() {
-        //this.init();
+        this.init();
     },
 
   methods: {
     async logout() {
       await this.$store.dispatch('user/logout');
       // this.$router.push(`/login?redirect=${this.$route.fullPath}`)
+      this.client.disconnect();
       this.$router.push(`/login`);
     },
     setStatus(data) {
@@ -194,8 +194,8 @@ export default {
      
     },
     doRead(value){
-      this.reminders = this.reminders.filter(item =>item.id != value);
-      console.log(this.reminders.length)
+      this.client.messages = this.client.messages.filter(item =>item.id != value);
+      this.$api.message.updateRead(value);
     },
 
     init() {
@@ -203,20 +203,16 @@ export default {
             console.log("您的浏览器不支持socket")
         } else {
             // 创建 WebSocketClient 实例并连接到服务端 API 接口
-            // this.client = new WebSocketClient('wss://kps.scdayou.com/ws/apo/ws')
-            this.client = new WebSocketClient('ws://127.0.0.1:8088/api/ws')
+            console.log("websocket-url",process.env.VUE_APP_WEBSOCKET)
+            this.client = new WebSocketClient(process.env.VUE_APP_WEBSOCKET)
             this.client.connect()
         }
     },
-    // destoryed() {
-    //     // 在组件销毁前断开 WebSocket 连接
-    //     this.client.disconnect()
-    //     console.log("websocket 断开")
-    // },
-    // beforeDestory() {
-    //     this.client.disconnect()
-    //     console.log("websocket 断开")
-    // }
+    destoryed() {
+        // 在组件销毁前断开 WebSocket 连接
+        this.client.disconnect()
+        console.log("websocket 断开")
+    },
 
   }
 }

+ 6 - 1
src/views/complex/index.vue

@@ -946,7 +946,12 @@ export default {
     this.getBusinessTotalNum();
     this.majorDeclareTodoList();
     this.assetsDeclareTodoList();
-    this.getToDoMaxNum();
+    if (this.$route.query.businessType){
+      this.maxTagKey = this.$route.query.businessType
+    }else{
+      this.getToDoMaxNum();
+    }
+    
   },
 
   methods: {

Filskillnaden har hållts tillbaka eftersom den är för stor
+ 521 - 412
src/views/finance/fundList.vue