会话群创建添加实训操作
This commit is contained in:
parent
5ad0421991
commit
252d3d69e4
@ -516,7 +516,9 @@ export default {
|
||||
CMD_Conversation_Group_Text_Chat: {value: 'Conversation_Group_Text_Chat', label: '发送会话群文字消息'},
|
||||
CMD_Conversation_Group_Audio_Base64: {value: 'Conversation_Group_Audio_Base64', label: '发送会话群语音消息'},
|
||||
CMD_Conversation_Group_Private_Text_Chat: {value: 'Conversation_Group_Private_Text_Chat', label: '发送私聊文字消息'},
|
||||
CMD_Conversation_Group_Private_Audio_Base64: {value: 'Conversation_Group_Private_Audio_Base64', label: '发送私聊语音消息'}
|
||||
CMD_Conversation_Group_Private_Audio_Base64: {value: 'Conversation_Group_Private_Audio_Base64', label: '发送私聊语音消息'},
|
||||
CMD_Conversation_Group_Create: {value: 'Conversation_Group_Create', label: '创建会话群'},
|
||||
CMD_Conversation_Group_Invite_Member: {value: 'Conversation_Group_Invite_Member', label: '邀请人员入群'}
|
||||
},
|
||||
PSL: {
|
||||
CMD_PSL_PRESS_BUTTON: {value: 'PSL_PRESS_BUTTON', label: 'PSL按钮操作'}
|
||||
|
@ -5165,6 +5165,14 @@ export const OperationEvent = {
|
||||
record: {
|
||||
operation: '1403',
|
||||
domId: '_Tips-Conversation-Chat-record'
|
||||
},
|
||||
createGroup: {
|
||||
operation: '1404',
|
||||
domId: '_Tips-Conversation-Chat-createGroup'
|
||||
},
|
||||
inviteToGroup: {
|
||||
operation: '1405',
|
||||
domId: '_Tips-Conversation-Chat-inviteToGroup'
|
||||
}
|
||||
}
|
||||
},
|
||||
|
@ -33,8 +33,8 @@
|
||||
<div class="activeLine" />
|
||||
</div>
|
||||
<div class="nullDiv" />
|
||||
<div class="editFilter " :class="myMemberId ? 'pointer' : 'disable'">
|
||||
<i class="el-icon-plus" title="创建会话群" @click="createGroup" />
|
||||
<div class="editFilter" :class="myMemberId ? 'pointer' : 'disable'">
|
||||
<i :id="createGroupDomId" class="el-icon-plus" title="创建会话群" @click="createGroup" />
|
||||
<!-- <i class="el-icon-more" /> -->
|
||||
</div>
|
||||
</div>
|
||||
@ -63,7 +63,7 @@
|
||||
<address-book ref="addressBook" :member-tree-data="memberTreeData" @sendPrivateMsg="sendPrivateMsg" />
|
||||
</div>
|
||||
</div>
|
||||
<edit-group ref="editGroup" :member-tree-data="memberTreeData" />
|
||||
<edit-group ref="editGroup" :member-tree-data="memberTreeData" @handleEditGroup="handleEditGroup" />
|
||||
<pop-menu ref="popMenu" :menu="menu" />
|
||||
<dialog-member ref="dialogMember" :member-tree-data="memberTreeData" @updateLeaderId="updateLeaderId" />
|
||||
</el-dialog>
|
||||
@ -79,6 +79,7 @@ import AddressBook from './addressBook';
|
||||
import PopMenu from '@/components/PopMenu';
|
||||
import DialogMember from './dialogMember';
|
||||
import { objectIsEqual } from '@/utils/date';
|
||||
import { OperationEvent } from '@/scripts/cmdPlugin/OperationHandler';
|
||||
export default {
|
||||
name: 'ChatDialog',
|
||||
components: {
|
||||
@ -95,6 +96,7 @@ export default {
|
||||
return {
|
||||
logoImgUrl: '',
|
||||
dialogVisible: false,
|
||||
showEditGroup: false,
|
||||
tabs: [
|
||||
{label:'消息', icon:'el-icon-chat-dot-square'},
|
||||
{label:'通讯录', icon:'el-icon-notebook-1'}
|
||||
@ -119,6 +121,9 @@ export default {
|
||||
groupId() {
|
||||
return this.$route.query.group;
|
||||
},
|
||||
createGroupDomId() {
|
||||
return this.showEditGroup ? '' : OperationEvent.Conversation.Chat.createGroup.domId;
|
||||
},
|
||||
myMemberId() {
|
||||
return this.$store.state.training.myMemberId;
|
||||
},
|
||||
@ -275,6 +280,9 @@ export default {
|
||||
this.handleClose();
|
||||
},
|
||||
methods: {
|
||||
handleEditGroup(val) {
|
||||
this.showEditGroup = val;
|
||||
},
|
||||
showMenu(event, item) {
|
||||
this.groupClick(item);
|
||||
this.initMenu(item);
|
||||
|
@ -59,7 +59,7 @@
|
||||
</el-form-item> -->
|
||||
<el-form-item v-if="showSubmitBtn">
|
||||
<el-button @click="handleClose">取消</el-button>
|
||||
<el-button type="primary" @click="onSubmit">确定</el-button>
|
||||
<el-button :id="submitDomId" type="primary" @click="onSubmit">确定</el-button>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
</div>
|
||||
@ -69,8 +69,11 @@
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import { createGroup, inviteMemberToGroup } from '@/api/newChat';
|
||||
import { inviteMemberToGroup } from '@/api/newChat';
|
||||
import { getUploadUrl } from '@/api/projectConfig';
|
||||
import { OperationEvent } from '@/scripts/cmdPlugin/OperationHandler';
|
||||
import {UserOperationType} from '@/scripts/ConstDic';
|
||||
import CMD from '@/scripts/cmdPlugin/CommandEnum';
|
||||
export default {
|
||||
name: 'EditGroup',
|
||||
components: {
|
||||
@ -118,6 +121,15 @@ export default {
|
||||
groupId() {
|
||||
return this.$route.query.group;
|
||||
},
|
||||
submitDomId() {
|
||||
let domId = '';
|
||||
if (this.title == '邀请成员') {
|
||||
domId = OperationEvent.Conversation.Chat.inviteToGroup.domId;
|
||||
} else if (this.title == '创建会话群') {
|
||||
domId = OperationEvent.Conversation.Chat.createGroup.domId;
|
||||
}
|
||||
return this.dialogVisible ? domId : '';
|
||||
},
|
||||
memberData() {
|
||||
return this.$store.state.training.memberData;
|
||||
},
|
||||
@ -155,6 +167,12 @@ export default {
|
||||
this.treeDisabled = true;
|
||||
this.nameDisabled = true;
|
||||
}
|
||||
},
|
||||
dialogVisible() {
|
||||
this.$emit('handleEditGroup', this.dialogVisible);
|
||||
this.$nextTick(() => {
|
||||
this.$store.dispatch('training/emitTipFresh');
|
||||
});
|
||||
}
|
||||
},
|
||||
mounted() {
|
||||
@ -231,21 +249,27 @@ export default {
|
||||
}).catch(err => {
|
||||
this.$message.error(`邀请成员失败!${err.message}`);
|
||||
});
|
||||
|
||||
} else if (this.title == '创建会话群') {
|
||||
const list = [];
|
||||
this.selectTreeNode.forEach(item => {
|
||||
list.push(item.id);
|
||||
});
|
||||
const params = {
|
||||
name: this.form.name,
|
||||
imageUrl: this.form.imageUrl,
|
||||
memberIds: list
|
||||
const operate = {
|
||||
over: true,
|
||||
cmdType: CMD.Conversation.CMD_Conversation_Group_Create,
|
||||
operation: OperationEvent.Conversation.Chat.createGroup.operation,
|
||||
userOperationType: UserOperationType.LEFTCLICK,
|
||||
param: {
|
||||
name: this.form.name,
|
||||
memberIds: list
|
||||
}
|
||||
};
|
||||
createGroup(this.groupId, params).then(res => {
|
||||
this.initData();
|
||||
this.handleClose();
|
||||
this.$message.success('创建会话群成功!');
|
||||
this.$store.dispatch('trainingNew/next', operate).then(({ valid }) => {
|
||||
if (valid) {
|
||||
this.initData();
|
||||
this.handleClose();
|
||||
this.$message.success('创建会话群成功!');
|
||||
}
|
||||
}).catch(err => {
|
||||
this.$message.error(`创建会话群失败!${err.message}`);
|
||||
});
|
||||
|
Loading…
Reference in New Issue
Block a user