zhuhao 1 ano atrás
pai
commit
b2ca846475
1 arquivos alterados com 23 adições e 16 exclusões
  1. 23 16
      src/views/layout/mixins/index.js

+ 23 - 16
src/views/layout/mixins/index.js

@@ -11,15 +11,22 @@ export const webSocket = {
         console.log('WebSocket连接成功')
       }
       webSocket.onmessage = async (e) => {
-        if(e.data.indexOf('{') == -1){
+        if (e.data.indexOf('{') == -1) {
           return false
-      }
+        }
         const { code, data, message } = JSON.parse(e.data)
+
+        if (code == 903 || code == 600) {
+          if (data.complete) {
+            this.$message.success(`导入完成`)
+          } else {
+          }
+        }
         // 603导出专利完成605导出PDF完成
-        if(code == 903 || code == 600|| code == 603|| code == 605){
+        if (code == 603 || code == 605) {
           if (data.complete) {
-              this.$message.success(`导入完成`)
-          }else{
+            this.$message.success(`导出完成`)
+          } else {
           }
         }
       }
@@ -33,45 +40,45 @@ export const webSocket = {
   }
 }
 
-export const commonData={
+export const commonData = {
   mounted() {
     // this.DictMessage()
     // this.getUserInfo()
     // this.getScenario()
   },
-  methods:{
+  methods: {
     //获取个人信息
     getUserInfo() {
       this.$api.getUserInfo().then(response => {
         localStorage.tenant = response.data.tenantId
         this.$store.commit('SET_USERINFO', response.data)
-        
+
       })
     },
     //获取字典项
     DictMessage() {
       this.$api.getOsSystemDict([]).then(response => {
-        this.$store.commit("SET_DictMessage",response.data)
+        this.$store.commit("SET_DictMessage", response.data)
       })
     },
     //获取应用场景
-    getScenario(){
+    getScenario() {
       this.$api.getScenario().then(response => {
-        this.$store.commit("SET_Scenario",response.data.data)
+        this.$store.commit("SET_Scenario", response.data.data)
       })
     },
     //获取调查类型
-    getMatter(){
+    getMatter() {
       this.$api.getMatter([]).then(response => {
-        this.$store.commit("SET_Matter",response.data.data)
+        this.$store.commit("SET_Matter", response.data.data)
       })
     },
     //获取权限
-    getPermissionList(){
+    getPermissionList() {
       var code = "e424f3cc4f8138f0f68bef092b92212f;6a8d3f4d1d5f11eda41c00163e2f0200"
-      this.$api.getPermissionList({code:code}).then(response=>{
+      this.$api.getPermissionList({ code: code }).then(response => {
         this.$store.commit('SET_PERMISSION', response.data)
-      }).catch(error=>{
+      }).catch(error => {
         this.$store.commit('SET_PERMISSION', [])
       })
     },