From e6b1d2777aa97317607cf5cec38c8f95ff4e2ce1 Mon Sep 17 00:00:00 2001
From: dong <58670809@qq.com>
Date: Mon, 22 May 2023 09:43:36 +0800
Subject: [PATCH] =?UTF-8?q?=E6=B7=BB=E5=8A=A0=E7=A7=81=E8=81=8A=E5=8F=8A?=
=?UTF-8?q?=E6=88=90=E5=91=98=E6=9F=A5=E7=9C=8B?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
src/api/newChat.js | 32 ++
src/scripts/cmdPlugin/CommandEnum.js | 4 +-
src/views/newMap/display/index.vue | 4 +-
.../newMap/display/newChat/addressBook.vue | 138 ++++++
.../newMap/display/newChat/chatContent.vue | 19 +-
.../newMap/display/newChat/chatDialog.vue | 450 ++++++++++++++++--
.../newMap/display/newChat/dialogMember.vue | 87 ++++
.../newMap/display/newChat/editGroup.vue | 323 +++----------
8 files changed, 754 insertions(+), 303 deletions(-)
create mode 100644 src/views/newMap/display/newChat/addressBook.vue
create mode 100644 src/views/newMap/display/newChat/dialogMember.vue
diff --git a/src/api/newChat.js b/src/api/newChat.js
index bdcc96501..6ded7fe84 100644
--- a/src/api/newChat.js
+++ b/src/api/newChat.js
@@ -187,3 +187,35 @@ export function setGroupReadMessage(groupId, data) {
data
});
}
+
+/**
+ * 发送私聊文字信息
+ * @param {String} groupId 房间号
+ * @param {Object} data
+ * @param {Number} data.memberId 角色id
+ * @param {String} data.content 文字内容
+ * @returns
+ */
+export function sendPrivateText(groupId, data) {
+ return request({
+ url: `/simulation/${groupId}/operate/Conversation_Group_Private_Text_Chat`,
+ method: 'post',
+ data
+ });
+}
+
+/**
+ * 发送私聊BASE64信息
+ * @param {String} groupId 房间号
+ * @param {Object} data
+ * @param {Number} data.memberId 角色id
+ * @param {String} data.fileBase64Str 文件base64码
+ * @returns
+ */
+export function sendPrivateBase64(groupId, data) {
+ return request({
+ url: `/simulation/${groupId}/operate/Conversation_Group_Private_Audio_Base64`,
+ method: 'post',
+ data
+ });
+}
diff --git a/src/scripts/cmdPlugin/CommandEnum.js b/src/scripts/cmdPlugin/CommandEnum.js
index f3a89f7b7..ceca49be2 100644
--- a/src/scripts/cmdPlugin/CommandEnum.js
+++ b/src/scripts/cmdPlugin/CommandEnum.js
@@ -514,7 +514,9 @@ export default {
CMD_Conversation_Chat_Text: {value: 'Conversation_Chat_Text', 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: '发送会话群语音消息'}
+ 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: '发送私聊语音消息'}
},
PSL: {
CMD_PSL_PRESS_BUTTON: {value: 'PSL_PRESS_BUTTON', label: 'PSL按钮操作'}
diff --git a/src/views/newMap/display/index.vue b/src/views/newMap/display/index.vue
index 7c632e682..93fbdc7b6 100644
--- a/src/views/newMap/display/index.vue
+++ b/src/views/newMap/display/index.vue
@@ -30,8 +30,8 @@ import TrainingTip from './trainingList/trainingTip';
import TrainingPositionTip from './trainingList/trainingPositionTip.vue';
import TrainingMenu from './trainingList/trainingMenu';
import TrainingDesign from './trainingDesign/designPane.vue';
-// import ChatBox from './newChat/index.vue';
-import ChatBox from './chatBox';
+import ChatBox from './newChat/index.vue';
+// import ChatBox from './chatBox';
import TrainingLeftSlider from './trainingList/trainingLeftSlider';
import LineBoard from './lineBoard';
import BottomTable from './bottomTable';
diff --git a/src/views/newMap/display/newChat/addressBook.vue b/src/views/newMap/display/newChat/addressBook.vue
new file mode 100644
index 000000000..919e08620
--- /dev/null
+++ b/src/views/newMap/display/newChat/addressBook.vue
@@ -0,0 +1,138 @@
+
+
+
+
+
+
+
+
+
+
+
+ {{ data.labelName }}
+
+
+
+
+
+
+
+ {{ activeNode.labelName }}
+
+
+ {{ activeNode.typeName }}
+
+
+ {{ activeNode.children.length }}
+
+
+ 发消息
+
+
+
+
+
+
+
+
+
diff --git a/src/views/newMap/display/newChat/chatContent.vue b/src/views/newMap/display/newChat/chatContent.vue
index ec5b057de..1ab489559 100644
--- a/src/views/newMap/display/newChat/chatContent.vue
+++ b/src/views/newMap/display/newChat/chatContent.vue
@@ -27,7 +27,7 @@
-
+
@@ -25,7 +25,7 @@
{{ item.label }}
-
+
-
+
+
+
+
+
diff --git a/src/views/newMap/display/newChat/editGroup.vue b/src/views/newMap/display/newChat/editGroup.vue
index ccf6c815b..c75931693 100644
--- a/src/views/newMap/display/newChat/editGroup.vue
+++ b/src/views/newMap/display/newChat/editGroup.vue
@@ -2,7 +2,7 @@
{{ selectTreeNode.length }}
)
-
+
{{ tag.labelName }}
-
+
-
+
取消
确定
@@ -77,102 +77,56 @@ export default {
},
props: {
-
+ memberTreeData: {
+ type: Array,
+ default: () => {
+ return [];
+ }
+ }
},
data() {
return {
+ title: '创建会话群',
dialogVisible: false,
queryMember: '',
defaultProps: {
children: 'children',
- label: 'labelName'
+ label: 'labelName',
+ disabled: (node) => {
+ if (node.disabled || this.treeDisabled) {
+ return true;
+ } else {
+ return false;
+ }
+ }
},
activeTrains: [],
+ defaultCheckedKeys: [],
selectTreeNode: [],
- treeData: [{
- labelName: '行调',
- children: []
- }, {
- labelName: 'NCC调度',
- children: []
- }, {
- labelName: '车站值班员',
- children: []
- }, {
- labelName: '司机',
- children: []
- }, {
- labelName: '通号',
- children: []
- }, {
- labelName: '车辆段',
- children: []
- }, {
- labelName: 'CTC操作员',
- children: []
- }, {
- labelName: '车站助理',
- children: []
- },
- {
- labelName: '车站站长',
- children: []
- },
- {
- labelName: '车站信号员',
- children: []
- },
- {
- labelName: '车站客运员',
- children: []
- },
- {
- labelName: '车站扳道员',
- children: []
- },
- {
- labelName: '车站引导员',
- children: []
- },
- {
- labelName: '车站工务工',
- children: []
- },
- {
- labelName: '设备管理员',
- children: []
- }
- ],
form: {
name: '',
imageUrl: ''
- }
+ },
+ treeDisabled: false,
+ nameDisabled: false,
+ showSubmitBtn: true
};
},
computed: {
groupId() {
return this.$route.query.group;
},
- memberList() {
- return this.$store.state.training.memberList;
- },
memberData() {
return this.$store.state.training.memberData;
},
myMemberId() {
return this.$store.state.training.myMemberId;
- },
- defaultCheckedKeys() {
- return [this.myMemberId];
}
},
watch: {
queryMember(val) {
this.$refs.tree.filter(val);
},
- memberList () {
- this.getTreeData();
- },
myMemberId(val) {
this.initData();
if (!val) {
@@ -181,13 +135,23 @@ export default {
},
'$store.state.map.activeTrainListChange': function () {
this.getActiveTrains();
+ },
+ title() {
+ if (this.title == '创建会话群') {
+ this.showSubmitBtn = true;
+ this.treeDisabled = false;
+ this.nameDisabled = false;
+ } else {
+ this.showSubmitBtn = false;
+ this.treeDisabled = true;
+ this.nameDisabled = true;
+ }
}
},
mounted() {
this.initData();
},
created() {
- this.getTreeData();
this.getActiveTrains();
},
beforeDestroy() {
@@ -215,200 +179,6 @@ export default {
}
this.$refs.tree && this.$refs.tree.filter(this.queryMember);
},
- getTreeData() {
- const val = this.memberList;
- if (val && val.length) {
- // this.memberData = this.$store.state.training.memberData;
- const dispatcherList = [];
- const nccDispatcherList = [];
- const electricDispatcherList = [];
- const depotDispatcherList = [];
- const stationSupervisorList = [];
- const driverList = [];
- const maintainerList = [];
- const ctcOperatorList = [];
- const stationAssistantList = [];
- const stationMasterList = [];
- const stationSignalerList = [];
- const stationPassengerList = [];
- const stationSwitchManList = [];
- const stationFacilitatorList = [];
- const stationWorkerList = [];
- const deviceManagerList = [];
- const trainMasterList = [];
- const stationElectricWorkerList = [];
- val.forEach(item => {
- const device = this.$store.getters['map/getDeviceByCode'](item.deviceCode);
- switch (item.type) {
- case 'DISPATCHER':
- this.memberData[item.id].labelName = '行调' + (item.name || '');
- dispatcherList.push(this.memberData[item.id]);
- break;
- case 'NCC_DISPATCHER':
- this.memberData[item.id].labelName = 'NCC调度' + (item.name || '');
- nccDispatcherList.push(this.memberData[item.id]);
- break;
- case 'ELECTRIC_DISPATCHER':
- this.memberData[item.id].labelName = '电力调度' + (item.name || '');
- electricDispatcherList.push(this.memberData[item.id]);
- break;
- case 'DEPOT_DISPATCHER':
- this.memberData[item.id].labelName = '信号楼-' + device.name + (item.name || '');
- depotDispatcherList.push(this.memberData[item.id]);
- break;
- case 'STATION_SUPERVISOR':
- this.memberData[item.id].labelName = '值班员-' + device.name + (item.name ? `-${item.name }` : '');
- stationSupervisorList.push(this.memberData[item.id]);
- break;
- case 'DRIVER':
- this.memberData[item.id].labelName = '司机-列车' + item.deviceCode;
- driverList.push(this.memberData[item.id]);
- break;
- case 'MAINTAINER':
- this.memberData[item.id].labelName = '通号' + (item.name || '');
- maintainerList.push(this.memberData[item.id]);
- break;
- case 'RAIL_CTC':
- this.memberData[item.id].labelName = 'CTC操作员' + device.name;
- ctcOperatorList.push(this.memberData[item.id]);
- break;
- case 'STATION_ASSISTANT':
- this.memberData[item.id].labelName = '车站助理-' + device.name + (item.name ? `-${item.name }` : '');
- stationAssistantList.push(this.memberData[item.id]);
- break;
- case 'STATION_MASTER':
- this.memberData[item.id].labelName = '车站站长-' + device.name + (item.name ? `-${item.name }` : '');
- stationMasterList.push(this.memberData[item.id]);
- break;
- case 'STATION_SIGNALER':
- this.memberData[item.id].labelName = '车站信号员-' + device.name + (item.name ? `-${item.name }` : '');
- stationSignalerList.push(this.memberData[item.id]);
- break;
- case 'STATION_PASSENGER':
- this.memberData[item.id].labelName = '车站客运员-' + device.name + (item.name ? `-${item.name }` : '');
- stationPassengerList.push(this.memberData[item.id]);
- break;
- case 'STATION_SWITCH_MAN':
- this.memberData[item.id].labelName = '车站扳道员-' + device.name + (item.name ? `-${item.name }` : '');
- stationSwitchManList.push(this.memberData[item.id]);
- break;
- case 'STATION_FACILITATOR':
- this.memberData[item.id].labelName = '车站引导员-' + device.name + (item.name ? `-${item.name }` : '');
- stationFacilitatorList.push(this.memberData[item.id]);
- break;
- case 'STATION_WORKER':
- this.memberData[item.id].labelName = '车站工务工-' + device.name + (item.name ? `-${item.name }` : '');
- stationWorkerList.push(this.memberData[item.id]);
- break;
- case 'DEVICE_MANAGER':
- this.memberData[item.id].labelName = '设备管理员-' + device.name + (item.name ? `-${item.name }` : '');
- deviceManagerList.push(this.memberData[item.id]);
- break;
- case 'TRAIN_MASTER':
- // device.name;
- this.memberData[item.id].labelName = '车务段段长-' + (item.name ? `-${item.name }` : '');
- trainMasterList.push(this.memberData[item.id]);
- break;
- case 'PARENT_DEPARTMENT':
- this.memberData[item.id].labelName = '上级部门' + (item.name ? `-${item.name }` : '');
- break;
- case 'STATION_ELECTRIC_WORKER':
- this.memberData[item.id].labelName = '电力工务' + (item.name || '');
- stationElectricWorkerList.push(this.memberData[item.id]);
- break;
- // DEVICE_MANAGER:'设备管理员' deviceManager
- }
- });
- this.treeData = [{
- labelName: '行调',
- id: 'dispatcher',
- children: dispatcherList
- }, {
- labelName: 'NCC调度',
- id: 'nccDispatcher',
- children: nccDispatcherList
- }, {
- labelName: '车站值班员',
- id: 'stationSupervisor',
- children: stationSupervisorList
- }, {
- labelName: '司机',
- id: 'driver',
- children: driverList
- }, {
- labelName: '通号',
- id: 'maintainer',
- children: maintainerList
- }, {
- labelName: '车辆段信号楼',
- id: 'depotDispatcher',
- children: depotDispatcherList
- }, {
- labelName: '电力调度',
- id: 'electricDispatcher',
- children: electricDispatcherList
- }, {
- labelName: 'CTC操作员',
- id: 'ctcOperator',
- children: ctcOperatorList
- }, {
- labelName: '车站助理',
- id: 'stationAssistant',
- children: stationAssistantList
- },
- {
- labelName: '车站站长',
- id: 'stationMaster',
- children: stationMasterList
- },
- {
- labelName: '车站信号员',
- id: 'stationSignaler',
- children: stationSignalerList
- },
- {
- labelName: '车站客运员',
- id: 'stationPassenger',
- children: stationPassengerList
- },
- {
- labelName: '车站扳道员',
- id: 'stationSwitchMan',
- children: stationSwitchManList
- },
- {
- labelName: '车站引导员',
- id: 'stationFacilitator',
- children: stationFacilitatorList
- },
- {
- labelName: '车站工务工',
- id: 'stationWorker',
- children: stationWorkerList
- },
- {
- labelName: '设备管理员',
- id: 'deviceManager',
- children: deviceManagerList
- },
- {
- labelName: '车务段段长 ',
- id: 'trainMaster',
- children: trainMasterList
- },
- {
- labelName: '电力工务 ',
- id: 'stationElectricWorker',
- children: stationElectricWorkerList
- }
- ];
- this.$nextTick(() => {
- if (this.$refs.tree) {
- this.$refs.tree.filter(this.queryMember);
- }
- });
- }
- },
checkChange(data, node, val) {
const filter = node.checkedNodes.filter(ii => {
return !ii.children;
@@ -446,6 +216,7 @@ export default {
},
initData() {
this.$refs.form && this.$refs.form.resetFields();
+ this.defaultCheckedKeys = [this.myMemberId];
this.selectTreeNode = [];
const node = this.memberData[this.myMemberId];
node && this.selectTreeNode.push(node);
@@ -499,7 +270,9 @@ export default {
// fileName:存储文件名
// method:生成链接的请求方式
},
- doShow() {
+ doShow(info, title) {
+ this.title = title || '创建会话群';
+ this.setInfo(info);
this.dialogVisible = true;
this.$nextTick(() => {
if (this.$refs.tree) {
@@ -507,6 +280,21 @@ export default {
}
});
},
+ setInfo(info) {
+ if (info) {
+ this.form.name = info.name || '';
+ this.form.imageUrl = info.imageUrl || '';
+ this.defaultCheckedKeys = [];
+ this.selectTreeNode = [];
+ info.memberList.forEach(item => {
+ this.defaultCheckedKeys.push(item.memberId);
+ const node = this.memberData[item.memberId];
+ node && this.selectTreeNode.push(node);
+ });
+ } else {
+ this.initData();
+ }
+ },
handleClose() {
this.dialogVisible = false;
}
@@ -549,6 +337,7 @@ $imgHeight: 70px;
.disableClose {
/deep/ .el-icon-close {
cursor: not-allowed;
+ display: none !important;
}
}
}