no message

This commit is contained in:
kuaifan 2022-06-06 14:27:01 +08:00
parent c5c9e19f76
commit 62b8b623ec
6 changed files with 54 additions and 24 deletions

View File

@ -1110,6 +1110,20 @@
*/
getAttr(el, attrName, def = "") {
return el ? el.getAttribute(attrName) : def;
},
/**
* 主动失去焦点
* @param el
*/
onBlur(el = null) {
if (el) {
el.blur();
} else {
if (document.activeElement && typeof document.activeElement.blur === "function") {
document.activeElement.blur();
}
}
}
});

View File

@ -340,33 +340,18 @@ export default {
}
},
mounted() {
if (this.$store.state.dialogMsgTransfer.time > $A.Time()) {
this.$store.state.dialogMsgTransfer.time = 0;
const {msgFile, msgRecord, msgText} = this.$store.state.dialogMsgTransfer;
this.$nextTick(() => {
if ($A.isArray(msgFile) && msgFile.length > 0) {
this.sendFileMsg(msgFile);
} else if ($A.isJson(msgRecord) && msgRecord.duration > 0) {
this.sendRecord(msgRecord);
} else if (msgText) {
this.sendMsg(msgText);
}
});
}
},
beforeDestroy() {
this.$store.dispatch('forgetInDialog', this._uid)
},
computed: {
...mapState([
'cacheDialogs',
'taskId',
'dialogMsgs',
'dialogMsgTransfer',
'cacheDialogs',
'wsOpenNum',
'touchBackInProgress',
'taskId',
]),
isReady() {
@ -490,6 +475,24 @@ export default {
immediate: true
},
dialogMsgTransfer: {
handler({time, msgFile, msgRecord, msgText}) {
if (time > $A.Time()) {
this.$store.state.dialogMsgTransfer.time = 0;
this.$nextTick(() => {
if ($A.isArray(msgFile) && msgFile.length > 0) {
this.sendFileMsg(msgFile);
} else if ($A.isJson(msgRecord) && msgRecord.duration > 0) {
this.sendRecord(msgRecord);
} else if (msgText) {
this.sendMsg(msgText);
}
});
}
},
immediate: true
},
wsOpenNum(num) {
if (num <= 1) return
this.$store.dispatch("getDialogMsgs", this.dialogId).catch(_ => {});

View File

@ -734,6 +734,9 @@ export default {
if (id > 0) {
this.ready = true;
} else {
if (this.windowSmall) {
$A.onBlur();
}
this.timeOpen = false;
this.timeForce = false;
this.assistForce = false;
@ -742,9 +745,6 @@ export default {
this.$refs.owner && this.$refs.owner.handleClose();
this.$refs.assist && this.$refs.assist.handleClose();
this.$refs.chatInput && this.$refs.chatInput.hidePopover();
if (this.windowSmall) {
document.activeElement.blur();
}
}
},
immediate: true
@ -1103,6 +1103,7 @@ export default {
} else {
this.$nextTick(() => {
if (this.windowSmall) {
$A.onBlur();
this.$store.state.dialogMsgTransfer = {
time: $A.Time() + 10,
msgText: this.msgText,

View File

@ -611,7 +611,11 @@ export default {
},
tableHeight() {
return Math.max(300, this.windowHeight - 160)
if (this.windowLarge) {
return Math.max(300, this.windowHeight - 160)
} else {
return Math.max(300, this.windowHeight - 200)
}
}
},

View File

@ -589,7 +589,7 @@
position: absolute;
transform: scale(0.8) translateX(100%);
transform-origin: right center;
top: 2px;
bottom: 28px;
right: 22px;
z-index: 2;
height: 20px;

View File

@ -286,6 +286,10 @@
}
}
}
.ivu-table-overflowY,
.ivu-table-overflowX {
-webkit-overflow-scrolling: touch;
}
}
.file-nbox {
display: flex;
@ -669,11 +673,15 @@
grid-gap: 4px;
> li {
width: 80px;
.file-check,
.file-menu {
display: none;
}
}
}
}
.file-table {
margin: 16px 24px 24px;
margin: 16px 0 0;
}
}
}