'视频会议文件编辑'

This commit is contained in:
gyj
2024-04-15 09:40:00 +08:00
parent a551f33a6e
commit a2b625937e
4 changed files with 142 additions and 68 deletions
+1 -1
View File
@@ -1,6 +1,6 @@
import axios from "@/utils/request";
let baseUrlZc = 'https://api.xayunmei.com/zhongcaiapi';
let baseUrl = 'https://api.xayunmei.com/tiaojieapi';
let baseUrl = 'https://api.xayunmei.com/tiaojieapitest';
// let baseUrl = 'http://121.40.189.20:6001';
// 获取usersig
export function getUsersig(userId) {
+9 -1
View File
@@ -1,6 +1,6 @@
import axios from "@/utils/request";
let baseUrlZC = 'https://api.xayunmei.com/zhongcaiapi';
let baseUrl = 'https://api.xayunmei.com/tiaojieapi';
let baseUrl = 'https://api.xayunmei.com/tiaojieapitest';
// let baseUrl = 'http://121.40.189.20:6001';
// 开始云端录制
export function startVideo(data) {
@@ -55,3 +55,11 @@ export function selectById(caseId) {
export function selectRoleMenuByCaseId(caseId) {
return axios.get(`${baseUrl}/video/selectRoleMenuByCaseId?caseId=${caseId}`);
}
// 保存onlyOffice文档
export function saveOnlyOfficeFile(data) {
return axios.post(`${baseUrl}/caseApplication/saveOnlyOfficeFile`, data);
}
//获取当前用户的操作权限
export function getMenuPermsByUser(caseId) {
return axios.get(`${baseUrl}/system/menu/getMenuPermsByUser`);
}
+60 -60
View File
@@ -5,7 +5,7 @@
</template>
<script>
// import { saveOnlyOfficeFile } from "@/api/room.js"
import { saveOnlyOfficeFile } from "@/api/room.js"
// import store from "@/store"
import axios from 'axios'
export default {
@@ -18,76 +18,76 @@ export default {
websock: null
};
},
// destroyed() {
// //页面销毁时关闭ws连接
// if (this.websock) {
// this.websock.close() // 关闭websocket
// }
// },
destroyed() {
//页面销毁时关闭ws连接
if (this.websock) {
this.websock.close() // 关闭websocket
}
},
methods: {
getConfig(id) {
this.userId = sessionStorage.getItem("userId");
// let edit = "edit";
// if (this.flag == 0) {
// edit = 'view';
// } else {
// edit = 'edit'
// }
axios.get(`http://121.40.189.20:9090/onlyOfficeConfig/view/${id}/${this.userId}/desktop/true`).then(res => {
let edit = "edit";
if (this.flag == 0) {
edit = 'view';
} else {
edit = 'edit'
}
axios.get(`http://121.40.189.20:9090/onlyOfficeConfig/${edit}/${id}/${this.userId}/desktop/true`).then(res => {
this.config = res.data;
var docEditor = new DocsAPI.DocEditor("placeholder", this.config);
})
},
//初始化weosocket
// initWebSocket() {
// if (typeof (WebSocket) === "undefined") {
// alert("您的浏览器不支持WebSocket")
// return false
// }
// const wsuri = `ws://121.40.189.20:9090/api/websocket/${this.userId}` // websocket地址
// this.websock = new WebSocket(wsuri)
// this.websock.onopen = this.websocketonopen
// this.websock.onmessage = this.websocketonmessage
// this.websock.onerror = this.websocketonerror
// this.websock.onclose = this.websocketclose
// },
// //连接成功
// websocketonopen() {
// console.log('WebSocket连接成功')
// },
// //接收后端返回的数据
// websocketonmessage(e) {
// let dataJson = e.data;
// if (dataJson != "conn_success") {
// dataJson = JSON.parse(dataJson);
// }
// if (dataJson.caseId) {
// saveOnlyOfficeFile({
// caseAppliId: Number(dataJson.caseId),
// annexName: dataJson.fileName,
// annexPath: dataJson.filePath,
// onlyOfficeFileId: dataJson.fileId
// }).then(res => {
// this.websock.send()
// })
// }
// // 在这里使用后端返回的数据,对数据进行处理渲染
// },
// //连接建立失败重连
// websocketonerror(e) {
// console.log(`连接失败的信息:`, e)
// this.initWebSocket() // 连接失败后尝试重新连接
// },
// //关闭连接
// websocketclose(e) {
// console.log('断开连接', e)
// },
// 初始化weosocket
initWebSocket() {
if (typeof (WebSocket) === "undefined") {
alert("您的浏览器不支持WebSocket")
return false
}
const wsuri = `ws://121.40.189.20:9090/api/websocket/${this.userId}` // websocket地址
this.websock = new WebSocket(wsuri)
this.websock.onopen = this.websocketonopen
this.websock.onmessage = this.websocketonmessage
this.websock.onerror = this.websocketonerror
this.websock.onclose = this.websocketclose
},
//连接成功
websocketonopen() {
console.log('WebSocket连接成功')
},
//接收后端返回的数据
websocketonmessage(e) {
let dataJson = e.data;
if (dataJson != "conn_success") {
dataJson = JSON.parse(dataJson);
}
if (dataJson.caseId) {
saveOnlyOfficeFile({
caseAppliId: Number(dataJson.caseId),
annexName: dataJson.fileName,
annexPath: dataJson.filePath,
onlyOfficeFileId: dataJson.fileId
}).then(res => {
// this.websock.send()
})
}
// 在这里使用后端返回的数据,对数据进行处理渲染
},
//连接建立失败重连
websocketonerror(e) {
console.log(`连接失败的信息:`, e)
this.initWebSocket() // 连接失败后尝试重新连接
},
//关闭连接
websocketclose(e) {
console.log('断开连接', e)
},
},
mounted() {
let id = this.$route.query.id;
// this.flag = this.$route.query.flag;
this.flag = this.$route.query.flag;
this.getConfig(id);
// this.initWebSocket();
this.initWebSocket();
},
watch: {
+72 -6
View File
@@ -79,6 +79,22 @@
>被申请人上传证据</el-button
>
</el-upload>
<el-upload
v-if="editFlag"
ref="upload3"
:limit="1"
action="https://api.xayunmei.com/tiaojieapi/video/upload"
:headers="headers3"
:data="filedata3"
:on-change="beforeUpload3"
:on-success="handlSuccess3"
:file-list="fileList3"
accept=".doc,.docx"
>
<el-button slot="trigger" size="small" type="primary"
>上传调解书</el-button
>
</el-upload>
</div>
<div class="list">
<div class="applicant" v-if="applicantFile.length > 0">
@@ -87,7 +103,7 @@
style="color: #104fad; cursor: pointer"
v-for="(item, index) in applicantFile"
:key="index"
@click="preview(item)"
@click="preview(item,0)"
>
{{ item.annexName }}
</div>
@@ -98,7 +114,18 @@
style="color: #104fad; cursor: pointer"
v-for="(item, index) in resFile"
:key="index"
@click="preview(item)"
@click="preview(item,0)"
>
{{ item.annexName }}
</div>
</div>
<div class="mediate" v-if="mediateFile.length > 0">
<div>调解书</div>
<div
style="color: #104fad; cursor: pointer"
v-for="(item, index) in mediateFile"
:key="index"
@click="preview(item,1)"
>
{{ item.annexName }}
</div>
@@ -131,6 +158,7 @@ import {
htmlToPDF,
selectById,
selectRoleMenuByCaseId,
getMenuPermsByUser,
} from "@/api/room";
import { getWidth, getHeight, getWidthPhone, getModile } from "@/utils/utils";
import roomFooter from "./components/roomFooter.vue";
@@ -175,6 +203,7 @@ export default {
token: "",
applicantFile: [],
resFile: [],
mediateFile:[],
headers: {
// Authorization: "Bearer " + token,
Authorization: "",
@@ -195,9 +224,27 @@ export default {
caseId: null,
},
fileList1: [],
headers3: {
// Authorization: "Bearer " + token,
Authorization: "",
},
filedata3: {
annexType: 7,
officeFlag: 0,
caseId: null,
},
fileList3: [],
editFlag: false,
};
},
methods: {
/**获取当前用户操作权限 */
getMenuPermsByUserFn() {
getMenuPermsByUser().then((res) => {
// console.log(res.perms, "KKKKKKKKKKKKKKKKKKKKKKKKKKKKKK");
this.editFlag = res.perms.includes("caseManagement:list:editOffice");
});
},
beforeUpload(file, fileList) {
this.fileList = fileList;
if (file.name.indexOf("docx") == -1) {
@@ -232,11 +279,24 @@ export default {
this.$refs.upload1.clearFiles();
this.selectByIdFn(this.caseId);
},
preview(item) {
beforeUpload3(file, fileList) {
this.fileList3 = fileList;
this.filedata3.officeFlag = 1;
},
// 文件上传成功
handlSuccess3(res, file) {
this.$message({
message: "上传成功",
type: "success",
});
this.$refs.upload3.clearFiles();
this.selectByIdFn(this.caseId);
},
preview(item,flag) {
if (item.onlyOfficeFileId) {
this.$router.push({
path: "/onlyoffice",
query: { id: item.onlyOfficeFileId },
query: { id: item.onlyOfficeFileId,flag:flag },
});
} else {
window.open(
@@ -290,18 +350,22 @@ export default {
this.selectByIdFn(this.caseId);
}, 8000);
this.selectRoleMenuByCaseIdFn(this.caseId);
this.getMenuPermsByUserFn();
},
/** 获取证据列表 */
selectByIdFn(id) {
selectById(id).then((res) => {
this.applicantFile = [];
this.resFile = [];
this.mediateFile = [];
let fileList = res.data.caseAttachList;
fileList.forEach((item) => {
if (item.annexType == 2) {
this.applicantFile.push(item);
} else if (item.annexType == 12) {
this.resFile.push(item);
}else if (item.annexType == 7){
this.mediateFile.push(item)
}
});
});
@@ -423,7 +487,6 @@ export default {
/**获取申请人被申请人权限 */
selectRoleMenuByCaseIdFn(caseId) {
selectRoleMenuByCaseId(caseId).then((res) => {
console.log(res, "LLLLLLLLLLLLLLLLLLLLLLLLLL");
if (res.appFlag && res.appFlag == "1") {
this.appFlag = true;
this.resFlag = false;
@@ -451,8 +514,10 @@ export default {
this.token = this.$route.query.token;
this.headers.Authorization = "Bearer " + this.token;
this.headers1.Authorization = "Bearer " + this.token;
this.headers3.Authorization = "Bearer " + this.token;
this.filedata.caseId = this.caseId;
this.filedata1.caseId = this.caseId;
this.filedata3.caseId = this.caseId;
window.sessionStorage.setItem("token", this.token);
window.sessionStorage.setItem("userId", this.id);
this.secretaryRoleByUserIdFn(this.id, this.caseId);
@@ -675,7 +740,8 @@ export default {
flex-wrap: wrap;
}
.applicant,
.res {
.res,
.mediate {
width: 100%;
margin-left: 20px;
margin-bottom: 10px;