会话群调整

This commit is contained in:
dong 2023-04-21 11:02:38 +08:00
parent 2d2f3e9fdc
commit 6d4e28a0dc
2 changed files with 24 additions and 12 deletions

View File

@ -511,7 +511,9 @@ export default {
}, },
Conversation: { Conversation: {
CMD_Conversation_Chat_Text: {value: 'Conversation_Chat_Text', label: '发送文本消息'}, CMD_Conversation_Chat_Text: {value: 'Conversation_Chat_Text', label: '发送文本消息'},
CMD_Conversation_Chat_Audio_Base64: {value: 'Conversation_Chat_Audio_Base64', label: '发送语音消息'} CMD_Conversation_Chat_Audio_Base64: {value: 'Conversation_Chat_Audio_Base64', label: '发送语音消息'},
CMD_Conversation_Group_Text_Chat: {value: 'Conversation_Group_Text_Chat', label: '发送会话群文字消息'},
CMD_Conversation_Group_Audio_Base64: {value: 'Conversation_Group_Audio_Base64', label: '发送会话群语音消息'}
}, },
PSL: { PSL: {
CMD_PSL_PRESS_BUTTON: {value: 'PSL_PRESS_BUTTON', label: 'PSL按钮操作'} CMD_PSL_PRESS_BUTTON: {value: 'PSL_PRESS_BUTTON', label: 'PSL按钮操作'}

View File

@ -41,7 +41,6 @@
<script> <script>
import RecordRTC from 'recordrtc'; import RecordRTC from 'recordrtc';
import { sendText } from '@/api/newChat';
import { OperationEvent } from '@/scripts/cmdPlugin/OperationHandler'; import { OperationEvent } from '@/scripts/cmdPlugin/OperationHandler';
import {UserOperationType} from '@/scripts/ConstDic'; import {UserOperationType} from '@/scripts/ConstDic';
import CMD from '@/scripts/cmdPlugin/CommandEnum'; import CMD from '@/scripts/cmdPlugin/CommandEnum';
@ -105,7 +104,7 @@ export default {
this.trainingDesign = val.trainingDesign; this.trainingDesign = val.trainingDesign;
}, },
lastMessage(newVal, oldVal) { lastMessage(newVal, oldVal) {
if (newVal.id != oldVal.id) { if (newVal && oldVal && (newVal.id != oldVal.id)) {
this.scrollTop(); this.scrollTop();
} }
} }
@ -163,12 +162,22 @@ export default {
return name; return name;
}, },
sendText() { sendText() {
sendText(this.group, {id: this.id, content:this.textContent}).then(res => { const operate = {
console.log(res, '--res--'); over: true,
this.textContent = ''; cmdType: CMD.Conversation.CMD_Conversation_Group_Text_Chat,
}).catch(err => { operation: OperationEvent.Conversation.Chat.menu.operation,
console.log(err, '--err--'); userOperationType: UserOperationType.LEFTCLICK,
this.$message.error('发送会话文字失败:' + err.message); param: {
id: this.id,
content:this.textContent
}
};
this.$store.dispatch('trainingNew/next', operate).then(({ valid }) => {
if (valid) {
this.textContent = '';
}
}).catch(error => {
this.$message.error('发送会话文字失败:' + error.message);
}); });
}, },
cancelRecording() { cancelRecording() {
@ -191,10 +200,11 @@ export default {
that.recorders.getDataURL(function(BaseURL) { that.recorders.getDataURL(function(BaseURL) {
const operate = { const operate = {
over: true, over: true,
cmdType: CMD.Conversation.CMD_Conversation_Chat_Audio_Base64, cmdType: CMD.Conversation.CMD_Conversation_Group_Audio_Base64,
operation: OperationEvent.Conversation.Chat.record.operation, operation: OperationEvent.Conversation.Chat.record.operation,
userOperationType: UserOperationType.LEFTCLICK, userOperationType: UserOperationType.LEFTCLICK,
param: { param: {
id: that.id,
fileBase64Str: BaseURL fileBase64Str: BaseURL
} }
}; };
@ -409,14 +419,14 @@ export default {
float: left; float: left;
margin-left: 10px; margin-left: 10px;
margin-top: 10px; margin-top: 10px;
display: inline-block; // display: inline-block;
max-width: 80%; max-width: 80%;
} }
.rightUser{ .rightUser{
float: right; float: right;
margin-right: 10px; margin-right: 10px;
margin-top: 10px; margin-top: 10px;
display: inline-block; // display: inline-block;
max-width: 80%; max-width: 80%;
text-align: right; text-align: right;
} }