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 = "") { getAttr(el, attrName, def = "") {
return el ? el.getAttribute(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() { beforeDestroy() {
this.$store.dispatch('forgetInDialog', this._uid) this.$store.dispatch('forgetInDialog', this._uid)
}, },
computed: { computed: {
...mapState([ ...mapState([
'cacheDialogs', 'taskId',
'dialogMsgs', 'dialogMsgs',
'dialogMsgTransfer',
'cacheDialogs',
'wsOpenNum', 'wsOpenNum',
'touchBackInProgress', 'touchBackInProgress',
'taskId',
]), ]),
isReady() { isReady() {
@ -490,6 +475,24 @@ export default {
immediate: true 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) { wsOpenNum(num) {
if (num <= 1) return if (num <= 1) return
this.$store.dispatch("getDialogMsgs", this.dialogId).catch(_ => {}); this.$store.dispatch("getDialogMsgs", this.dialogId).catch(_ => {});

View File

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

View File

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

View File

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

View File

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