This commit is contained in:
2026-04-21 23:17:28 +08:00
parent cf455216f9
commit dbc6ecf62d
4 changed files with 41 additions and 181 deletions

View File

@ -24,7 +24,7 @@ const modleType = ref('')
const store = useStore();
const inDustRialId = getItem('inDustRialId'); // 当前用户的警号
const sdkBDModule = useBaseDataModule();
const baseInfo = getItem('rhInfo') || {};
const baseInfo = ref(getItem('rhInfo') || {});
const showVideo = ref(false)//拖动视频
const showDailog = ref(false)//showDailog
const openMeeting = ref(false) //打开会议
@ -97,10 +97,8 @@ const handleTime = (n=10) =>{
// 创建会议
const conferenceActionSDK = async (record ) => {
console.log(record,'=======创建会议的参数=========');
const createRes = await lemon.conference.createConference({
subject: record.glxsmc, //主题
let data = {
subject: record.hsbt, //主题
type: 1, //会议类型 0=即时会议1=预约会议
emergency_flag: 0, //会议紧急标识 0 = 非紧急会议1 = 紧急会议
duration: 60, //预计时长 (分钟)
@ -109,15 +107,14 @@ const conferenceActionSDK = async (record ) => {
appointment: handleTime(), // start_date 和 start_time 对应的 UTC 时间
members:[
{
alias:baseInfo.dispatcher_name,
basedata_id:baseInfo.basedata_id,
guid:baseInfo.user_guid,
number:baseInfo.user_id,
alias:baseInfo.value.dispatcher_name,
basedata_id:baseInfo.value.basedata_id,
guid:baseInfo.value.user_guid,
number:baseInfo.value.user_id,
}
],//当前创建人
});
console.log(createRes,'=======创建会议的结果=========');
}
const createRes = await lemon.conference.createConference(data);
if (createRes.result === 0) {
ElMessage.success(jsonData.value['data']['conference.book.result.ok']);
record.number = createRes.meeting.number;
@ -130,7 +127,6 @@ const conferenceActionSDK = async (record ) => {
// 通过会议编号进入会议
const enterConferenceByNumber = (it) =>{
console.log(it,'=============进入会议========');
openMeeting.value = true;
nextTick(()=>{
let params = {
@ -151,11 +147,9 @@ const enterConferenceByNumber = (it) =>{
// 获取会议
const fetchConferences = (it) =>{
lemon.conference.fetchConferences().then(res=> {
console.log(res,'===============获取会议');
meetList.value = res.conferenceList;
let obj = meetList.value.find(v=>v.number == it.number);
// 会议存在 ? 进入会议 : 创建会议 ;
console.log(obj,'=============会议是否存在');
obj ? enterConferenceByNumber(it) : conferenceActionSDK(it) ;
}).catch(err=> {})
}
@ -172,8 +166,8 @@ const listenerEvents = () =>{
const getLoginAccountInfo =() =>{
lemon.login.getLoginAccountInfo().then(res => {
console.log(res,'=======获取登录账号信息=========');
let info = JSON.stringify(res.account_info)
baseInfo.value = res.account_info;
window.localStorage.setItem("rhInfo",info);
window.localStorage.setItem("user_basedata_id",res.account_info.basedata_id);
}).catch(err => {
@ -183,9 +177,6 @@ const getLoginAccountInfo =() =>{
// 加入会议
const openInit = (it,type) =>{
console.log(it,'===========假日会议的数据===========');
console.log(type,'===========会议的类型===========');
modleType.value = type;
if(type == '会议'){
//判断是否有会议号
@ -195,8 +186,6 @@ const openInit = (it,type) =>{
cancelButtonText:'取消',
type:'warning',
}).then(res=>{
console.log(it.number,'===============会议号========');
// 会议号存在 ? 获取会议列表里面是否包含该条会议 : 创建会议 ;
it.number ? fetchConferences(it) : conferenceActionSDK(it);
}).catch(()=>{ })
@ -215,17 +204,17 @@ const Init = () => {
let token = window.localStorage.getItem("rhToken");
if (!token || 'undefined' == token || token == 'null') {
let userInfo = {
username: inDustRialId, //用户名
username: 'sgxtcs', //用户名
// username: inDustRialId, //用户名
password: "123456",
realm: "puc.com",
webpucUrl: "https://89.40.9.95:16888"
};
lemon.login.login(userInfo).then((esacpe) => {
console.log(esacpe,'=======登录成功=========');
token = esacpe.access_token;
window.localStorage.setItem("rhToken", esacpe.access_token);
token = esacpe.token;
window.localStorage.setItem("rhToken", esacpe.token);
listenerEvents()
});
})
} else {
ConnectWebsocket(token);
}
@ -233,7 +222,8 @@ const Init = () => {
const ConnectWebsocket = (token) => {
lemon.login.reConnectWebsocket({
username: inDustRialId, //用户名
username: 'sgxtcs', //用户名
// username: inDustRialId, //用户名
realm: "puc.com",
webpucUrl: "https://89.40.9.95:16888",
token: token
@ -262,7 +252,7 @@ onUnmounted(()=>{
lemon.login.removeLoginStatusChangeListener(loginStatusCallbackId.value);
})
defineExpose({openInit});
defineExpose({openInit,Init});
</script>
<style lang="scss" scoped>