瀏覽代碼

文件系统websocket连接

zhuliu 7 月之前
父節點
當前提交
3462671ebf

+ 1 - 1
src/components/VabOnlyOffice/index.vue

@@ -88,7 +88,7 @@ import mixins from './index.js'
           name:option.user.name
         }
         
-        let callbackUrl = `http://192.168.2.109:8803/onlyOffice/callback?guid=${option.id}`
+        let callbackUrl = `${this.$c.url}/onlyOffice/callback?guid=${option.id}`
         if(option.title){
           callbackUrl += `&fileName=${option.title}`
         }

+ 2 - 1
src/config/index.js

@@ -4,7 +4,8 @@ export default {
     updateTime:'2023-08-04 08:00:00',
     specialDays:['05-12','09-18','12-13'],
     host: window.location.host,
-    url:process.env.NODE_ENV === 'production' ? 'https://xsip.cn' : 'http://192.168.2.24:8803',
+    url:process.env.NODE_ENV === 'production' ? 'https://xsip.cn' : 'http://192.168.2.109:8803',
     staticURL: process.env.NODE_ENV === 'production' ? 'https://xsip.cn/onlinePreview' : 'http://192.168.2.24:8879/onlinePreview',
     WebSocketPath: process.env.NODE_ENV === 'production' ? 'wss://xsip.cn' : 'ws://192.168.2.24:8879',
+    WebSocketPathFMS: process.env.NODE_ENV === 'production' ? 'wss://xsip.cn' : 'ws://192.168.2.109:8803',
 }

+ 15 - 5
src/views/components/onlyOffice/index.js

@@ -6,12 +6,16 @@ export default{
         addNewFile
     },
     computed:{
-        ...mapGetters(['webSocket']),
+        // ...mapGetters(['webSocket']),
+        userinfo(){
+            return this.$s.getObj('userinfo')
+        },
     },
     data() {
         return {
             fun:null,
-            isOtherComponent:null
+            isOtherComponent:null,
+            waitLoading:false
         }
     },
     mounted() {
@@ -19,10 +23,12 @@ export default{
     },
     methods: {
         initWebSocket() {
-            this.webSocket.onmessage = (e) => {
+            let webSocket = new WebSocket(`${this.$c.WebSocketPathFMS}/api/fms/ws/` + this.userinfo.id)
+            webSocket.onmessage = (e) => {
               const { code, data, message } = JSON.parse(e.data)
-              if (code == 1) {//文件保存成功
-                this.$message.success('文件保存成功')
+              if (code == 702) {//文件保存成功
+                // this.$message.success('文件保存成功')
+                this.waitLoading = false
                 if(this.fun){
                     if(this.isOtherComponent){
                         this.$emit(this.fun)
@@ -33,6 +39,9 @@ export default{
                     this.fun = null
                 }
               }
+              if(code == 703){//恢复版本
+
+              }
             }
         },
         //调用强制保存
@@ -63,6 +72,7 @@ export default{
                 }
                 
             }else if(data == 2){
+                this.waitLoading = true
                 this.isOtherComponent = type
                 this.fun = fun
             }

+ 1 - 1
src/views/components/onlyOffice/index.vue

@@ -1,7 +1,7 @@
 <template>
     <div class='qualityManual-container'>
         <div class="menu_btn">
-            <el-button size="small" type="primary" @click="requestSave('examine')">提交审核</el-button>
+            <el-button size="small" type="primary" @click="requestSave('examine')" :loading="waitLoading">提交审核</el-button>
         </div>
         <div v-if='show' class='qualityManual-container-office'>
             <vab-only-office :option='option'/>

+ 0 - 2
src/views/task/components/examine/components/examine.vue

@@ -229,11 +229,9 @@ export default {
             this.submitResult()
             return
         }
-        console.log(this.$refs.openFile)
         this.$refs.openFile.requestSave('submitResult',1)
     },
     submitResult(){
-        console.log(1)
         var params = {
             taskId:this.taskId,
             projectId:this.taskMessage.projectId,