This commit is contained in:
hanchaobo
2024-04-16 09:50:00 +08:00
28557 changed files with 822 additions and 2815948 deletions
+5 -1
View File
@@ -1,7 +1,7 @@
import axios from "@/utils/request";
let baseUrlZc = 'https://api.xayunmei.com/zhongcaiapi';
let baseUrl = 'https://api.xayunmei.com/tiaojieapi';
// let baseUrl = 'http://121.40.189.20:6001';
// let baseUrl = 'http://172.16.1.4:6001';
// 获取usersig
export function getUsersig(userId) {
let appType = sessionStorage.getItem('type');
@@ -29,4 +29,8 @@ export function reserveConferenceList(caseId) {
return axios.get(`${baseUrlZc}/caseApplication/reserveConferenceList?caseId=${caseId}`);
}
}
//根据id查询密文信息
export function getEncryptInfoByid(caseId) {
return axios.get(`${baseUrl}/shortMessage/getMeetingInfo?authId=${caseId}`);
}
+19 -3
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) {
@@ -39,11 +39,27 @@ export function htmlToPDF(data) {
}
}
// 根据userId查询该用户是否是秘书
export function secretaryRoleByUserId(userId) {
export function secretaryRoleByUserId(userId, caseId) {
let appType = sessionStorage.getItem('type');
if (appType == 'tiaojie') {
return axios.get(`${baseUrl}/video/secretaryRoleByUserId?userId=${userId}`);
return axios.get(`${baseUrl}/video/secretaryRoleByUserId?userId=${userId}&caseId=${caseId}`);
} else {
return axios.get(`${baseUrlZC}/video/secretaryRoleByUserId?userId=${userId}`);
}
}
// 获取证据列表
export function selectById(caseId) {
return axios.get(`${baseUrl}/caseApplication/selectById?id=${caseId}`);
}
// 根据案件id查询登录人是否为申请人被申请人
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`);
}
+5 -2
View File
@@ -30,7 +30,8 @@ export default {
userId: null,
userCode: null,
caseId: null,
roleFlag: false
roleFlag: false,
token:""
};
},
methods: {
@@ -49,7 +50,8 @@ export default {
roomId: this.roomId,
flag: this.roleFlag,
caseId: this.caseId,
id: this.userCode
id: this.userCode,
token: this.token
}
});
},
@@ -77,6 +79,7 @@ export default {
this.roomId = routeParams.roomId;
this.userCode = routeParams.userId;
this.caseId = routeParams.id;
this.token = routeParams.token;
if (this.caseId) {
await this.reserveConferenceListFn(this.caseId);
await this.enterRoom();
+39 -15
View File
@@ -8,7 +8,12 @@
<el-form-item>
<el-input placeholder="请输入房间号" v-model="enterRoomFrom.roomId">
<template slot="append">
<el-button type="primary" @click="enterRoom" icon="el-icon-right">进入</el-button>
<el-button
type="primary"
@click="enterRoom"
icon="el-icon-right"
>进入</el-button
>
</template>
</el-input>
</el-form-item>
@@ -19,7 +24,7 @@
</template>
<script>
import { reserveConferenceList } from "@/api/home.js";
import { reserveConferenceList, getEncryptInfoByid } from "@/api/home.js";
import TRTC from "trtc-sdk-v5";
let trtc = null;
export default {
@@ -32,10 +37,18 @@ export default {
userId: null,
userCode: null,
caseId: null,
roleFlag: false
roleFlag: false,
token: "",
queryObj: {},
};
},
methods: {
/**获取链接参数 */
async getEncryptInfoByidFn(data) {
await getEncryptInfoByid(data).then((res) => {
this.queryObj = res;
});
},
async enterRoom() {
// if (this.roomId != this.enterRoomFrom.roomId) {
// this.$message({
@@ -51,34 +64,45 @@ export default {
roomId: this.roomId,
flag: this.roleFlag,
caseId: this.caseId,
id: this.userCode
}
id: this.userCode,
token: this.token,
},
});
},
submitRoom() {
this.$refs["formLabelAlign"].validate(valid => {});
this.$refs["formLabelAlign"].validate((valid) => {});
},
// 根据案件id查询主持人信息
async reserveConferenceListFn(data) {
await reserveConferenceList(data).then(res => {
await reserveConferenceList(data).then((res) => {
if (res.data.length >= 1) {
if (this.userCode == res.data[0].userId) {
this.roleFlag = true;
} else {
this.roleFlag = false;
}
}else{
} else {
this.roleFlag = false;
}
});
}
},
},
async mounted() {
let routeParams = this.$route.query;
this.userId = routeParams.name;
this.roomId = routeParams.roomId;
this.userCode = routeParams.userId;
this.caseId = routeParams.id;
await this.getEncryptInfoByidFn(routeParams.authId);
if (routeParams.authId) {
this.userId = this.queryObj.userName;
this.roomId = this.queryObj.roomId;
this.userCode = this.queryObj.userId;
this.caseId = this.queryObj.caseId;
this.token = this.queryObj.token;
} else {
this.userId = routeParams.name;
this.roomId = routeParams.roomId;
this.userCode = routeParams.userId;
this.caseId = routeParams.id;
this.token = routeParams.token;
}
if (this.caseId) {
await this.reserveConferenceListFn(this.caseId);
await this.enterRoom();
@@ -86,10 +110,10 @@ export default {
trtc = TRTC.create();
const config = {
view: document.getElementById("video"),
publish: false
publish: false,
};
await trtc.startLocalVideo(config);
}
},
};
</script>
+7 -1
View File
@@ -20,7 +20,13 @@ const routes = [
name:"Room",
component:()=>import("../views/room.vue"),
meta:{title:"房间"}
}
},
{
path:"/onlyOffice",
name:"onlyOffice",
component:()=>import("../views/onlyOffice.vue"),
meta:{title:"在线文档"}
}
]
const router = new VueRouter({
+1
View File
@@ -13,6 +13,7 @@ const server = axios.create({
server.interceptors.request.use(config => {
// config包含了请求相关的所有信息
// 可以同过config对象给请求配置或者修改信息
config.headers.Authorization = sessionStorage.getItem('token');
return config // 将配置完成的token返回 如果不返回 请求不会继续进行
}, err => {
// 请求发生错误时的回调函数
+102
View File
@@ -0,0 +1,102 @@
<template>
<div style="width: 100%;height: 100vh;">
<div id="placeholder"></div>
</div>
</template>
<script>
import { saveOnlyOfficeFile } from "@/api/room.js"
// import store from "@/store"
import axios from 'axios'
export default {
props: [],
data() {
return {
config: {},
flag: 0,
userId: null,
websock: null
};
},
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/${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)
},
},
mounted() {
let id = this.$route.query.id;
this.flag = this.$route.query.flag;
this.getConfig(id);
this.initWebSocket();
},
watch: {
}
};
</script>
<style scoped>
.placeholder{
width: 100%;
height: 100%;
}
</style>
+643 -330
View File
File diff suppressed because it is too large Load Diff