Commit 5507e229 authored by 华国豪's avatar 华国豪 🙄

1

parent 58659b8e
......@@ -52,8 +52,8 @@
</div>
</div>
<user-card v-if='usercardInfo.searchName!=""' :usercard='usercardInfo'></user-card>
<div class="at-him-box" :style="{'top': atInfo.top+'px','left': atInfo.left+'px'}" v-if="atInfo.atName!=''" @click="atMsg">@{{atInfo.atName}}</div>
</div>
</transition>
</template>
<script>
......@@ -61,6 +61,7 @@ import msg from './msssage/index'
import mail from './team/maillist'
import userCard from './team/usercard'
import empty from './tools/emptyPage'
import { setInterval } from 'timers'
export default {
components: {
msg,
......@@ -76,6 +77,13 @@ export default {
val: 0,
name: "消息"
},
atInfo: {
left: 0,
top: 0,
atId: 0,
atName: '',
scene: '',
},
noticeObj:{},
isMaxed: false,
usercardInfo:{
......@@ -101,13 +109,35 @@ export default {
this.usercardInfo.currentAccount=this.user.ImAccount
this.$electron.ipcRenderer.send('create-session')
let that=this
this.MsgBus.$on("open-card", function(name,top,left) {
that.usercardInfo={
searchName:name,
top,
left,
currentAccount:that.user.ImAccount
this.MsgBus.$on("open-card", function(name,top,left, id, openChat) {
if (id && that.usercardInfo.currentAccount !== id) {
that.usercardInfo.searchName = ""
}
setTimeout(()=>{
that.usercardInfo={
searchName: name,
top,
left,
currentAccount:id ? id : that.user.ImAccount,
openChat: openChat ? openChat : false
}
that.atInfo.atName = ''
}, 10)
});
this.MsgBus.$on("open-atBox", function(name,top,left, id, scene) {
if (id && that.atInfo.atId !== id) {
that.atInfo.atName = ""
}
setTimeout(()=>{
that.atInfo={
atName: name,
top,
left,
atId:id ? id : that.user.ImAccount,
scene: scene,
}
that.usercardInfo.searchName = ''
}, 10)
});
this.MsgBus.$on("change-create-session", function(obj) {
that.chosenState={
......@@ -137,13 +167,30 @@ export default {
}
//
})
document.getElementById('homebox').addEventListener("click", function() {
if (that.usercardInfo.searchName!="") {
that.usercardInfo.searchName=""
document.getElementById('homebox').addEventListener("click", function(e) {
console.log(e.target.className.indexOf('u-circle'))
if ((that.usercardInfo.searchName!="" || that.atInfo.atName != '') && e.target.className.indexOf('u-circle') == -1) {
that.usercardInfo.searchName = ""
that.atInfo.atName = ''
}
});
},
methods: {
atMsg(){
console.log(this.atInfo)
accids.push({
account: this.atInfo.atId,
alias:'@'+ this.atInfo.atName
})
this.$store.dispatch("sendMsg", {
type: "at",
scene: this.scene,
to: this.to,
text: this.msgToSent,
content: accids,
callbackTeam: this.callBackTeam
});
},
showCard(e){
this.MsgBus.$emit('open-card',this.user.emName,e.clientY,e.clientX)
},
......@@ -323,4 +370,20 @@ export default {
left: 0;
right: 0;
}
.at-him-box {
position: absolute;
top: 0;
left: 0;
z-index: 5;
padding: 10px;
background: rgba(255, 255, 255, 1);
box-shadow: 0px 2px 5px 0px rgba(170, 170, 170, 0.75);
border: 1px solid rgb(170, 170, 170, 0.65);
cursor: pointer;
font-size: 14px;
padding: 5px 10px;
}
.at-him-box:hover{
background: #eeeeee;
}
</style>
......@@ -402,7 +402,7 @@ export default {
return;
})
}
console.log(msgs)
// console.log(msgs)
return msgs;
},
teamInfo() {
......@@ -551,7 +551,7 @@ export default {
},
changeAtShow(){
this.showAt=false
console.log(this.idServer)
// console.log(this.idServer)
if(this.idServer && this.idServer!=''){
if(this.isNotExsitAtMsg()){
......
......@@ -39,8 +39,8 @@
<v-contextmenu-item @click="revocateMsg" v-if="msg.flow==='out'">撤回消息</v-contextmenu-item>
</v-contextmenu>
<!-- v-touch:hold="revocateMsg" -->
<a class="msg-head" v-if="msg.avatar">
<img class="icon u-circle" :src="msg.avatar">
<a class="msg-head" v-if="msg.avatar" @click="headAtBoxShow" @contextmenu="AtHim">
<img class="icon u-circle" :data-id="msg.from" :data-name="msg.fromNick" :data-scene="msg.scene" :src="msg.avatar">
</a>
<div class="msg-info">
<div class="u-member-name" v-if="msg.flow=='in' && msg.scene==='team'">{{msg.fromNick}}</div>
......@@ -58,12 +58,12 @@
<span v-else-if="msg.type==='custom-type1'" class="msg-text" ref="mediaMsg"></span>
<span v-else-if="msg.type==='custom-type3'" class="msg-text" ref="mediaMsg"></span>
<span
v-else-if="msg.type==='image'"
class="msg-text"
style="width: 170px; overflow: hidden;"
@click="openPreviwerImg(msg.file.url)"
v-contextmenu:msg-contextmenu
>
v-else-if="msg.type==='image'"
class="msg-text"
style="width: 170px; overflow: hidden;"
@click="openPreviwerImg(msg.file.url)"
v-contextmenu:msg-contextmenu
>
<img
class="imimage"
:src="msg.file.url"
......@@ -81,25 +81,24 @@
</div>
</span>
<span
v-else-if="msg.type==='video'"
class="msg-text video"
@click="openPreviwerVideo(msg.file.url)"
v-contextmenu:msg-contextmenu
>
v-else-if="msg.type==='video'"
class="msg-text video"
@click="openPreviwerVideo(msg.file.url)"
v-contextmenu:msg-contextmenu
>
<div class="process-box" v-if="progess!=-1">
<el-progress type="circle" :percentage="progess" :stroke-width="3" :width="50"></el-progress>
</div>
<video :src="msg.file.url" loop muted width="200" ref="msgvideo"></video>
</span>
<span
v-else-if="msg.type==='audio'"
class="msg-text msg-audio"
:class="{'unreadAudio': msg.unreadAudio}"
:style="'width: ' + msg.width"
:id="`audio_${msg.idClient}`"
@click="playAudio(msg, $event)"
v-contextmenu:msg-contextmenu
>
<span v-else-if="msg.type==='audio'"
class="msg-text msg-audio"
:class="{'unreadAudio': msg.unreadAudio}"
:style="'width: ' + msg.width"
:id="`audio_${msg.idClient}`"
@click="playAudio(msg, $event)"
v-contextmenu:msg-contextmenu
>
{{msg.showText}}
<div class="play-box">
<img src="../../assets/img/im/gif-left.png" v-if="msg.flow==='in' && !playState">
......@@ -205,7 +204,8 @@ export default {
progess: -1,
douTimer: null,
playState: false,
idClient: ""
idClient: "",
user: {},
};
},
computed: {
......@@ -240,6 +240,7 @@ export default {
this.computedItem();
},
mounted() {
let that=this
let item = this.msg;
if (
window.localStorage.errorMsg &&
......@@ -290,6 +291,13 @@ export default {
}); // end this.nextTick
},
methods: {
AtHim(e){
this.MsgBus.$emit('open-atBox', e.target.dataset.name, e.clientY, e.clientX, e.target.dataset.id, e.target.dataset.scene)
},
headAtBoxShow(e){
console.log(e)
this.MsgBus.$emit('open-card', e.target.dataset.name, e.clientY-30, e.clientX+30, e.target.dataset.id, true)
},
showMenu() {
let dom = document.querySelector("#chat-list");
if (dom.scrollHeight > dom.clientHeight) {
......@@ -1013,6 +1021,9 @@ export default {
width: 74%;
flex-direction: row-reverse;
}
.item-you .in .msg-head{
cursor: pointer;
}
.item-you .in .msg-head,
.item-me .out .msg-head {
display: inline-block;
......@@ -1257,4 +1268,5 @@ export default {
right: 0;
top: 0;
} */
</style>
\ No newline at end of file
......@@ -417,6 +417,7 @@ export default {
top: 2px;
left: 0;
padding-left: 7px;
max-width: 24px !important;
}
.addNewUser .content .panle .search__user_box .seach_ctr .seach__item__icon i {
font-size: 12px;
......
......@@ -170,7 +170,10 @@ export default {
this.loadingUser = true;
this.apipost(
"admin_Get_Chat_All_SelectEmpName",
{ EmName: data.Name },
{
EmName: data.Name,
EmpId: data.EmpId
},
res => {
if (res.data.resultCode == 1) {
this.createUserInf(res.data.data[0]);
......
......@@ -22,8 +22,8 @@
<span class="label">职务</span>
<span class="val">{{user.postName}}</span>
</div>
<div class="items btn" v-if="usercard.currentAccount!=user.account">
<el-button type="primary" :disabled="!user.account" icon="iconfont iconliaotian" size="small">和TA聊聊</el-button>
<div class="items btn" v-if="usercard.currentAccount!=user.account || usercard.openChat">
<el-button type="primary" :disabled="!user.account" icon="iconfont iconliaotian" size="small" @click="openChat">和TA聊聊</el-button>
<div class="err" v-if="!user.account">对方还未开通IM账户,无法和他聊天</div>
</div>
</div>
......@@ -39,7 +39,20 @@ export default {
},
data() {
return {
user: null,
user: {
id: '',
account: '',
avatar: '',
alias: '',
name: '',
companyName: '',
departmentName: '',
postName: '',
unread: 0,
isMute: false,
top: false,
lastMsgShow: ""
},
loading:false
};
},
......@@ -48,6 +61,11 @@ export default {
console.log(this.usercard)
},
methods: {
openChat(){
let _this = this
console.log(_this.user.id)
this.MsgBus.$emit("change-create-session", _this.user);
},
getUserInfo() {
this.loading=true
if (this.usercard.searchName) {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment