Преглед на файлове

'视频会议文件编辑'

gyj преди 2 години
родител
ревизия
a2b625937e
променени са 4 файла, в които са добавени 142 реда и са изтрити 68 реда
  1. 1
    1
      src/api/home.js
  2. 9
    1
      src/api/room.js
  3. 60
    60
      src/views/onlyOffice.vue
  4. 72
    6
      src/views/room.vue

+ 1
- 1
src/api/home.js Целия файл

@@ -1,6 +1,6 @@
1 1
 import axios from "@/utils/request";
2 2
 let baseUrlZc = 'https://api.xayunmei.com/zhongcaiapi';
3
-let baseUrl = 'https://api.xayunmei.com/tiaojieapi';
3
+let baseUrl = 'https://api.xayunmei.com/tiaojieapitest';
4 4
 // let baseUrl = 'http://121.40.189.20:6001';
5 5
 // 获取usersig
6 6
 export function getUsersig(userId) {

+ 9
- 1
src/api/room.js Целия файл

@@ -1,6 +1,6 @@
1 1
 import axios from "@/utils/request";
2 2
 let baseUrlZC = 'https://api.xayunmei.com/zhongcaiapi';
3
-let baseUrl = 'https://api.xayunmei.com/tiaojieapi';
3
+let baseUrl = 'https://api.xayunmei.com/tiaojieapitest';
4 4
 // let baseUrl = 'http://121.40.189.20:6001';
5 5
 // 开始云端录制
6 6
 export function startVideo(data) {
@@ -55,3 +55,11 @@ export function selectById(caseId) {
55 55
 export function selectRoleMenuByCaseId(caseId) {
56 56
     return axios.get(`${baseUrl}/video/selectRoleMenuByCaseId?caseId=${caseId}`);
57 57
 }
58
+// 保存onlyOffice文档
59
+export function saveOnlyOfficeFile(data) {
60
+    return axios.post(`${baseUrl}/caseApplication/saveOnlyOfficeFile`, data);
61
+}
62
+//获取当前用户的操作权限
63
+export function getMenuPermsByUser(caseId) {
64
+    return axios.get(`${baseUrl}/system/menu/getMenuPermsByUser`);
65
+}

+ 60
- 60
src/views/onlyOffice.vue Целия файл

@@ -5,7 +5,7 @@
5 5
 </template>
6 6
 
7 7
 <script>
8
-// import { saveOnlyOfficeFile } from "@/api/room.js"
8
+import { saveOnlyOfficeFile } from "@/api/room.js"
9 9
 // import store from "@/store"
10 10
 import axios from 'axios'
11 11
 export default {
@@ -18,76 +18,76 @@ export default {
18 18
             websock: null
19 19
         };
20 20
     },
21
-    // destroyed() {
22
-    //     //页面销毁时关闭ws连接
23
-    //     if (this.websock) {
24
-    //         this.websock.close() // 关闭websocket
25
-    //     }
26
-    // },
21
+    destroyed() {
22
+        //页面销毁时关闭ws连接
23
+        if (this.websock) {
24
+            this.websock.close() // 关闭websocket
25
+        }
26
+    },
27 27
     methods: {
28 28
         getConfig(id) {
29 29
             this.userId = sessionStorage.getItem("userId");
30
-            // let edit = "edit";
31
-            // if (this.flag == 0) {
32
-            //     edit = 'view';
33
-            // } else {
34
-            //     edit = 'edit'
35
-            // }
36
-            axios.get(`http://121.40.189.20:9090/onlyOfficeConfig/view/${id}/${this.userId}/desktop/true`).then(res => {
30
+            let edit = "edit";
31
+            if (this.flag == 0) {
32
+                edit = 'view';
33
+            } else {
34
+                edit = 'edit'
35
+            }
36
+            axios.get(`http://121.40.189.20:9090/onlyOfficeConfig/${edit}/${id}/${this.userId}/desktop/true`).then(res => {
37 37
                 this.config = res.data;
38 38
                 var docEditor = new DocsAPI.DocEditor("placeholder", this.config);
39 39
             })
40 40
         },
41
-        //初始化weosocket
42
-        // initWebSocket() {
43
-        //     if (typeof (WebSocket) === "undefined") {
44
-        //         alert("您的浏览器不支持WebSocket")
45
-        //         return false
46
-        //     }
47
-        //     const wsuri = `ws://121.40.189.20:9090/api/websocket/${this.userId}` // websocket地址
48
-        //     this.websock = new WebSocket(wsuri)
49
-        //     this.websock.onopen = this.websocketonopen
50
-        //     this.websock.onmessage = this.websocketonmessage
51
-        //     this.websock.onerror = this.websocketonerror
52
-        //     this.websock.onclose = this.websocketclose
53
-        // },
54
-        // //连接成功
55
-        // websocketonopen() {
56
-        //     console.log('WebSocket连接成功')
57
-        // },
58
-        // //接收后端返回的数据
59
-        // websocketonmessage(e) {
60
-        //     let dataJson = e.data;
61
-        //     if (dataJson != "conn_success") {
62
-        //         dataJson = JSON.parse(dataJson);
63
-        //     }
64
-        //     if (dataJson.caseId) {
65
-        //         saveOnlyOfficeFile({
66
-        //             caseAppliId: Number(dataJson.caseId),
67
-        //             annexName: dataJson.fileName,
68
-        //             annexPath: dataJson.filePath,
69
-        //             onlyOfficeFileId: dataJson.fileId
70
-        //         }).then(res => {
71
-        //             this.websock.send()
72
-        //         })
73
-        //     }
74
-        //     // 在这里使用后端返回的数据,对数据进行处理渲染
75
-        // },
76
-        // //连接建立失败重连
77
-        // websocketonerror(e) {
78
-        //     console.log(`连接失败的信息:`, e)
79
-        //     this.initWebSocket() // 连接失败后尝试重新连接
80
-        // },
81
-        // //关闭连接
82
-        // websocketclose(e) {
83
-        //     console.log('断开连接', e)
84
-        // },
41
+        // 初始化weosocket
42
+        initWebSocket() { 
43
+            if (typeof (WebSocket) === "undefined") {
44
+                alert("您的浏览器不支持WebSocket")
45
+                return false
46
+            }
47
+            const wsuri = `ws://121.40.189.20:9090/api/websocket/${this.userId}` // websocket地址
48
+            this.websock = new WebSocket(wsuri)
49
+            this.websock.onopen = this.websocketonopen
50
+            this.websock.onmessage = this.websocketonmessage
51
+            this.websock.onerror = this.websocketonerror
52
+            this.websock.onclose = this.websocketclose
53
+        },
54
+        //连接成功
55
+        websocketonopen() {
56
+            console.log('WebSocket连接成功')
57
+        },
58
+        //接收后端返回的数据
59
+        websocketonmessage(e) {
60
+            let dataJson = e.data;
61
+            if (dataJson != "conn_success") {
62
+                dataJson = JSON.parse(dataJson);
63
+            }
64
+            if (dataJson.caseId) {
65
+                saveOnlyOfficeFile({    
66
+                    caseAppliId: Number(dataJson.caseId),
67
+                    annexName: dataJson.fileName,
68
+                    annexPath: dataJson.filePath,
69
+                    onlyOfficeFileId: dataJson.fileId  
70
+                }).then(res => {
71
+                    // this.websock.send()
72
+                })
73
+            }
74
+            // 在这里使用后端返回的数据,对数据进行处理渲染
75
+        },
76
+        //连接建立失败重连
77
+        websocketonerror(e) {
78
+            console.log(`连接失败的信息:`, e)
79
+            this.initWebSocket() // 连接失败后尝试重新连接
80
+        },
81
+        //关闭连接
82
+        websocketclose(e) {
83
+            console.log('断开连接', e)
84
+        },
85 85
     },
86 86
     mounted() {
87 87
         let id = this.$route.query.id;
88
-        // this.flag = this.$route.query.flag;
88
+        this.flag = this.$route.query.flag;
89 89
         this.getConfig(id);
90
-        // this.initWebSocket();
90
+        this.initWebSocket();
91 91
     },
92 92
     watch: {
93 93
 

+ 72
- 6
src/views/room.vue Целия файл

@@ -79,6 +79,22 @@
79 79
               >被申请人上传证据</el-button
80 80
             >
81 81
           </el-upload>
82
+          <el-upload
83
+            v-if="editFlag"
84
+            ref="upload3"
85
+            :limit="1"
86
+            action="https://api.xayunmei.com/tiaojieapi/video/upload"
87
+            :headers="headers3"
88
+            :data="filedata3"
89
+            :on-change="beforeUpload3"
90
+            :on-success="handlSuccess3"
91
+            :file-list="fileList3"
92
+            accept=".doc,.docx"
93
+          >
94
+            <el-button slot="trigger" size="small" type="primary"
95
+              >上传调解书</el-button
96
+            >
97
+          </el-upload>
82 98
         </div>
83 99
         <div class="list">
84 100
           <div class="applicant" v-if="applicantFile.length > 0">
@@ -87,7 +103,7 @@
87 103
               style="color: #104fad; cursor: pointer"
88 104
               v-for="(item, index) in applicantFile"
89 105
               :key="index"
90
-              @click="preview(item)"
106
+              @click="preview(item,0)"
91 107
             >
92 108
               {{ item.annexName }}
93 109
             </div>
@@ -98,7 +114,18 @@
98 114
               style="color: #104fad; cursor: pointer"
99 115
               v-for="(item, index) in resFile"
100 116
               :key="index"
101
-              @click="preview(item)"
117
+              @click="preview(item,0)"
118
+            >
119
+              {{ item.annexName }}
120
+            </div>
121
+          </div>
122
+          <div class="mediate" v-if="mediateFile.length > 0">
123
+            <div>调解书</div>
124
+            <div
125
+              style="color: #104fad; cursor: pointer"
126
+              v-for="(item, index) in mediateFile"
127
+              :key="index"
128
+              @click="preview(item,1)"
102 129
             >
103 130
               {{ item.annexName }}
104 131
             </div>
@@ -131,6 +158,7 @@ import {
131 158
   htmlToPDF,
132 159
   selectById,
133 160
   selectRoleMenuByCaseId,
161
+  getMenuPermsByUser,
134 162
 } from "@/api/room";
135 163
 import { getWidth, getHeight, getWidthPhone, getModile } from "@/utils/utils";
136 164
 import roomFooter from "./components/roomFooter.vue";
@@ -175,6 +203,7 @@ export default {
175 203
       token: "",
176 204
       applicantFile: [],
177 205
       resFile: [],
206
+      mediateFile:[],
178 207
       headers: {
179 208
         // Authorization: "Bearer " + token,
180 209
         Authorization: "",
@@ -195,9 +224,27 @@ export default {
195 224
         caseId: null,
196 225
       },
197 226
       fileList1: [],
227
+      headers3: {
228
+        // Authorization: "Bearer " + token,
229
+        Authorization: "",
230
+      },
231
+      filedata3: {
232
+        annexType: 7,
233
+        officeFlag: 0,
234
+        caseId: null,
235
+      },
236
+      fileList3: [],
237
+      editFlag: false,
198 238
     };
199 239
   },
200 240
   methods: {
241
+    /**获取当前用户操作权限 */
242
+    getMenuPermsByUserFn() {
243
+      getMenuPermsByUser().then((res) => {
244
+        // console.log(res.perms, "KKKKKKKKKKKKKKKKKKKKKKKKKKKKKK");
245
+        this.editFlag = res.perms.includes("caseManagement:list:editOffice");
246
+      });
247
+    },
201 248
     beforeUpload(file, fileList) {
202 249
       this.fileList = fileList;
203 250
       if (file.name.indexOf("docx") == -1) {
@@ -232,11 +279,24 @@ export default {
232 279
       this.$refs.upload1.clearFiles();
233 280
       this.selectByIdFn(this.caseId);
234 281
     },
235
-    preview(item) {
282
+    beforeUpload3(file, fileList) {
283
+      this.fileList3 = fileList;
284
+      this.filedata3.officeFlag = 1;
285
+    },
286
+    // 文件上传成功
287
+    handlSuccess3(res, file) {
288
+      this.$message({
289
+        message: "上传成功",
290
+        type: "success",
291
+      });
292
+      this.$refs.upload3.clearFiles();
293
+      this.selectByIdFn(this.caseId);
294
+    },
295
+    preview(item,flag) {
236 296
       if (item.onlyOfficeFileId) {
237 297
         this.$router.push({
238 298
           path: "/onlyoffice",
239
-          query: { id: item.onlyOfficeFileId },
299
+          query: { id: item.onlyOfficeFileId,flag:flag },
240 300
         });
241 301
       } else {
242 302
         window.open(
@@ -290,18 +350,22 @@ export default {
290 350
         this.selectByIdFn(this.caseId);
291 351
       }, 8000);
292 352
       this.selectRoleMenuByCaseIdFn(this.caseId);
353
+      this.getMenuPermsByUserFn();
293 354
     },
294 355
     /** 获取证据列表 */
295 356
     selectByIdFn(id) {
296 357
       selectById(id).then((res) => {
297 358
         this.applicantFile = [];
298 359
         this.resFile = [];
360
+        this.mediateFile = [];
299 361
         let fileList = res.data.caseAttachList;
300 362
         fileList.forEach((item) => {
301 363
           if (item.annexType == 2) {
302 364
             this.applicantFile.push(item);
303 365
           } else if (item.annexType == 12) {
304 366
             this.resFile.push(item);
367
+          }else if (item.annexType == 7){
368
+            this.mediateFile.push(item)
305 369
           }
306 370
         });
307 371
       });
@@ -423,7 +487,6 @@ export default {
423 487
     /**获取申请人被申请人权限 */
424 488
     selectRoleMenuByCaseIdFn(caseId) {
425 489
       selectRoleMenuByCaseId(caseId).then((res) => {
426
-        console.log(res, "LLLLLLLLLLLLLLLLLLLLLLLLLL");
427 490
         if (res.appFlag && res.appFlag == "1") {
428 491
           this.appFlag = true;
429 492
           this.resFlag = false;
@@ -451,8 +514,10 @@ export default {
451 514
     this.token = this.$route.query.token;
452 515
     this.headers.Authorization = "Bearer " + this.token;
453 516
     this.headers1.Authorization = "Bearer " + this.token;
517
+    this.headers3.Authorization = "Bearer " + this.token;
454 518
     this.filedata.caseId = this.caseId;
455 519
     this.filedata1.caseId = this.caseId;
520
+    this.filedata3.caseId = this.caseId;
456 521
     window.sessionStorage.setItem("token", this.token);
457 522
     window.sessionStorage.setItem("userId", this.id);
458 523
     this.secretaryRoleByUserIdFn(this.id, this.caseId);
@@ -675,7 +740,8 @@ export default {
675 740
   flex-wrap: wrap;
676 741
 }
677 742
 .applicant,
678
-.res {
743
+.res,
744
+.mediate {
679 745
   width: 100%;
680 746
   margin-left: 20px;
681 747
   margin-bottom: 10px;