'视频会议文件编辑'

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