剧本添加提示
This commit is contained in:
parent
f25a73c4e7
commit
901ab1a8bd
@ -13,7 +13,7 @@ export function getScriptPageListOnline(params) {
|
|||||||
/** 分页查找上线的剧本(新版)*/
|
/** 分页查找上线的剧本(新版)*/
|
||||||
export function getScriptPageListOnlineNew(params) {
|
export function getScriptPageListOnlineNew(params) {
|
||||||
return request({
|
return request({
|
||||||
url: `/api/scirpt/v1/paging/online`,
|
url: `/api/script/v1/paging/online`,
|
||||||
method: 'get',
|
method: 'get',
|
||||||
params: params
|
params: params
|
||||||
});
|
});
|
||||||
@ -30,7 +30,7 @@ export function getScriptById(id) {
|
|||||||
/** 通过ID查询发布的剧本的详细信息(新版) */
|
/** 通过ID查询发布的剧本的详细信息(新版) */
|
||||||
export function getScriptByIdNew(id) {
|
export function getScriptByIdNew(id) {
|
||||||
return request({
|
return request({
|
||||||
url: `/api/scirpt/v1/${id}/detail`,
|
url: `/api/script/v1/${id}/detail`,
|
||||||
method: 'get'
|
method: 'get'
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
@ -371,7 +371,6 @@ export default {
|
|||||||
},
|
},
|
||||||
// 现地信号重开操作
|
// 现地信号重开操作
|
||||||
reopenSignalByRoute(selectType) {
|
reopenSignalByRoute(selectType) {
|
||||||
debugger;
|
|
||||||
commitOperate(menuOperate.Signal.reopenSignal, {signalCode:selectType.code}, 3).then(({valid, operate})=>{
|
commitOperate(menuOperate.Signal.reopenSignal, {signalCode:selectType.code}, 3).then(({valid, operate})=>{
|
||||||
}).catch(error=>{
|
}).catch(error=>{
|
||||||
this.$refs.noticeInfo.doShow({}, error.message);
|
this.$refs.noticeInfo.doShow({}, error.message);
|
||||||
|
@ -26,6 +26,9 @@ function handle(state, data) {
|
|||||||
case 'Simulation_User': // 仿真-聊天界面用户进出仿真消息
|
case 'Simulation_User': // 仿真-聊天界面用户进出仿真消息
|
||||||
handleSimulationUserinfo(state, msg); // 用户进出仿真消息
|
handleSimulationUserinfo(state, msg); // 用户进出仿真消息
|
||||||
break;
|
break;
|
||||||
|
case 'Simulation_Script_Tip': // 仿真-聊天界面用户进出仿真消息
|
||||||
|
handleSimulationScriptTipInfo(state, msg); // 用户进出仿真消息
|
||||||
|
break;
|
||||||
case 'Simulation_RunFact': // 仿真-列车实际到发车站消息
|
case 'Simulation_RunFact': // 仿真-列车实际到发车站消息
|
||||||
// let runFactMsg = msg;
|
// let runFactMsg = msg;
|
||||||
// if (runFactMsg.constructor !== Array ) {
|
// if (runFactMsg.constructor !== Array ) {
|
||||||
@ -136,7 +139,6 @@ function handleSimulationInfo(state, data) {
|
|||||||
if (data.member.userId == userId) {
|
if (data.member.userId == userId) {
|
||||||
isSelf = true;
|
isSelf = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
const myDate = new Date();
|
const myDate = new Date();
|
||||||
const myDate1 = myDate.toLocaleDateString().replace(/\//g, '-');
|
const myDate1 = myDate.toLocaleDateString().replace(/\//g, '-');
|
||||||
const chatTime = /\d{2}:\d{2}:\d{2}/.exec(data.chatTime)[0] || data.chatTime;
|
const chatTime = /\d{2}:\d{2}:\d{2}/.exec(data.chatTime)[0] || data.chatTime;
|
||||||
@ -156,61 +158,11 @@ function handleSimulationInfo(state, data) {
|
|||||||
date: +new Date(`${myDate1} ${chatTime}`)
|
date: +new Date(`${myDate1} ${chatTime}`)
|
||||||
};
|
};
|
||||||
state.simulationText = params;
|
state.simulationText = params;
|
||||||
// if (state.coversitionList[data.conversationId]) {
|
}
|
||||||
// state.coversitionList[data.conversationId].push(params);
|
|
||||||
// } else {
|
|
||||||
// state.coversitionList[data.conversationId] = [];
|
|
||||||
// state.coversitionList[data.conversationId].push(params);
|
|
||||||
// }
|
|
||||||
|
|
||||||
// switch (data.member.role) {
|
// 剧本提示
|
||||||
// case '01':
|
function handleSimulationScriptTipInfo(state, data) {
|
||||||
// role = '管理员';
|
state.simulationScriptTip = data;
|
||||||
// break;
|
|
||||||
// case '02':
|
|
||||||
// role = '教员';
|
|
||||||
// break;
|
|
||||||
// case '03':
|
|
||||||
// role = `调度员`;
|
|
||||||
// break;
|
|
||||||
// case '04':
|
|
||||||
// store.state.map.map.stationList.forEach(nor => {
|
|
||||||
// if (nor.code == data.member.deviceCode) {
|
|
||||||
// role = `${nor.name}`;
|
|
||||||
// }
|
|
||||||
// });
|
|
||||||
// break;
|
|
||||||
// }
|
|
||||||
// if (!data.member.userId && data.member.deviceName) {
|
|
||||||
// data.member.nickName = data.member.deviceName;
|
|
||||||
// }
|
|
||||||
// if (!data.targetMember.userId && data.targetMember.deviceName) {
|
|
||||||
// data.targetMember.nickName = data.targetMember.deviceName;
|
|
||||||
// }
|
|
||||||
|
|
||||||
// const param = {
|
|
||||||
// join: false,
|
|
||||||
// value: data.message,
|
|
||||||
// self: isSelf,
|
|
||||||
// voice: data.isAudio,
|
|
||||||
// src: data.isAudio ? `${process.env.process.env.VUE_VOICE_API}/jlcloud/audio/${data.audioPath}` : '',
|
|
||||||
// other: !isSelf,
|
|
||||||
// userName: '',
|
|
||||||
// id: data.member.id,
|
|
||||||
// chatTime: data.chatTime,
|
|
||||||
// date: +new Date(`${myDate1} ${chatTime}`),
|
|
||||||
// conversationId: data.conversationId,
|
|
||||||
// changeVO: data.changeVO || {},
|
|
||||||
// targetMember: data.targetMember,
|
|
||||||
// member: data.member,
|
|
||||||
// group: data.group
|
|
||||||
// };
|
|
||||||
// if (data.member.role) {
|
|
||||||
// param.userName = `${role}【${data.member.nickName}】`;
|
|
||||||
// } else {
|
|
||||||
// param.userName = `${data.member.nickName}`;
|
|
||||||
// }
|
|
||||||
// state.simulationText = param;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
function handleUserinfo(state, data) {
|
function handleUserinfo(state, data) {
|
||||||
@ -242,6 +194,7 @@ const socket = {
|
|||||||
chatContent: {}, // 聊天室聊天内容
|
chatContent: {}, // 聊天室聊天内容
|
||||||
roleList: [], // 设置角色信息
|
roleList: [], // 设置角色信息
|
||||||
simulationRoleList:[], // 设置仿真的聊天角色信息
|
simulationRoleList:[], // 设置仿真的聊天角色信息
|
||||||
|
simulationScriptTip:{}, // 剧本推送提示信息
|
||||||
jointRoomPrepare: false, // 演练房间准备状态
|
jointRoomPrepare: false, // 演练房间准备状态
|
||||||
equipmentStatus: [], // 仿真-设备状态消息
|
equipmentStatus: [], // 仿真-设备状态消息
|
||||||
trainStationList: [], // 仿真-列车实际到发车站消息
|
trainStationList: [], // 仿真-列车实际到发车站消息
|
||||||
|
@ -19,7 +19,7 @@
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="chat-box-content">
|
<div class="chat-box-content">
|
||||||
<chat-content ref="chatContent" :current-coversition="currentCoversition" @addCoversition="addCoversition" />
|
<chat-content ref="chatContent" :current-coversition="currentCoversition" @changeCoversition="changeCoversition" />
|
||||||
<div v-if="recordSending" class="chat_record_tip">
|
<div v-if="recordSending" class="chat_record_tip">
|
||||||
<div id="record_progress_bar" :style="'width:'+100/60*seconds+'%'" />
|
<div id="record_progress_bar" :style="'width:'+100/60*seconds+'%'" />
|
||||||
<div class="record_icon" />
|
<div class="record_icon" />
|
||||||
@ -31,6 +31,7 @@
|
|||||||
<div class="chat-box-footer">
|
<div class="chat-box-footer">
|
||||||
<div class="chat-box-footer-tool" />
|
<div class="chat-box-footer-tool" />
|
||||||
<div class="chat-box-footer-send" @click="startRecording()">发送语音</div>
|
<div class="chat-box-footer-send" @click="startRecording()">发送语音</div>
|
||||||
|
<div v-if="scriptTip" class="scriptTip">{{ scriptTip }}</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
@ -74,6 +75,7 @@ export default {
|
|||||||
inter:null,
|
inter:null,
|
||||||
recorders: null,
|
recorders: null,
|
||||||
microphone:null,
|
microphone:null,
|
||||||
|
scriptTip:'',
|
||||||
form:{
|
form:{
|
||||||
language:'zh',
|
language:'zh',
|
||||||
sex:'1'
|
sex:'1'
|
||||||
@ -89,6 +91,17 @@ export default {
|
|||||||
this.$refs.chatCoversitionList.setCoversitionStatus(val);
|
this.$refs.chatCoversitionList.setCoversitionStatus(val);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
},
|
||||||
|
'$store.state.socket.simulationScriptTip':function(val, old) {
|
||||||
|
if (val) {
|
||||||
|
if (val.type == 'Conversation') {
|
||||||
|
const target = this.$refs.chatMemberList.getMember(val.targetId);
|
||||||
|
if (target && target.length > 0) {
|
||||||
|
this.scriptTip = '请对' + target[0].memberName + '说:' + val.reply;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
mounted() {
|
mounted() {
|
||||||
@ -110,19 +123,24 @@ export default {
|
|||||||
},
|
},
|
||||||
setCurrentCoversition(coversition) {
|
setCurrentCoversition(coversition) {
|
||||||
this.currentCoversition = coversition;
|
this.currentCoversition = coversition;
|
||||||
|
if (this.recordSending) {
|
||||||
|
this.cancleRecording();
|
||||||
|
}
|
||||||
},
|
},
|
||||||
setHeadTitle(headerTitle) {
|
setHeadTitle(headerTitle) {
|
||||||
this.headerTitle = headerTitle;
|
this.headerTitle = headerTitle;
|
||||||
},
|
},
|
||||||
addCoversition({data, headerTitle}) {
|
addCoversition({data, headerTitle}) {
|
||||||
this.$refs.chatCoversitionList.addCoversition(data, headerTitle);
|
this.$refs.chatCoversitionList.addCoversition(data, headerTitle);
|
||||||
if (headerTitle) {
|
this.currentCoversition = {id:data.id, group:data.group};
|
||||||
this.currentCoversition = {id:data.id, group:data.group};
|
this.headerTitle = headerTitle;
|
||||||
this.headerTitle = headerTitle;
|
},
|
||||||
}
|
changeCoversition(data) {
|
||||||
|
this.$refs.chatCoversitionList.changeCoversitionOther(data);
|
||||||
},
|
},
|
||||||
// 语音录制开始
|
// 语音录制开始
|
||||||
startRecording() {
|
startRecording() {
|
||||||
|
this.scriptTip = '';
|
||||||
const that = this;
|
const that = this;
|
||||||
if (!this.recordSending && !this.recorders && !this.microphone) {
|
if (!this.recordSending && !this.recorders && !this.microphone) {
|
||||||
this.$refs.chatSetting.doClose();
|
this.$refs.chatSetting.doClose();
|
||||||
@ -267,6 +285,7 @@ export default {
|
|||||||
.chat-box-footer{
|
.chat-box-footer{
|
||||||
display: inline-block;
|
display: inline-block;
|
||||||
width: 100%;
|
width: 100%;
|
||||||
|
position: relative;
|
||||||
}
|
}
|
||||||
.chat-window{
|
.chat-window{
|
||||||
display: inline-block;
|
display: inline-block;
|
||||||
@ -322,6 +341,27 @@ export default {
|
|||||||
.coversition-list{
|
.coversition-list{
|
||||||
|
|
||||||
}
|
}
|
||||||
|
.scriptTip{
|
||||||
|
position: absolute;
|
||||||
|
width: 260px;
|
||||||
|
padding: 10px;
|
||||||
|
background: #ccc;
|
||||||
|
right: 7px;
|
||||||
|
bottom:45px;
|
||||||
|
border-radius: 5px;
|
||||||
|
font-size: 14px;
|
||||||
|
}
|
||||||
|
.scriptTip::after{
|
||||||
|
content: '';
|
||||||
|
position: absolute;
|
||||||
|
width: 0;
|
||||||
|
height: 0;
|
||||||
|
border-left: 10px solid transparent;
|
||||||
|
border-right: 10px solid transparent;
|
||||||
|
border-top: 8px solid #cccccc;
|
||||||
|
right: 16px;
|
||||||
|
bottom: -7px;
|
||||||
|
}
|
||||||
|
|
||||||
.showMembers{
|
.showMembers{
|
||||||
float: right;
|
float: right;
|
||||||
|
@ -8,7 +8,8 @@
|
|||||||
</div>
|
</div>
|
||||||
<div class="userBubble" @click="playAudio('audio'+index)">
|
<div class="userBubble" @click="playAudio('audio'+index)">
|
||||||
<div class="userMessage">
|
<div class="userMessage">
|
||||||
<span v-if="chatContent.group&&!(chatContent.member && chatContent.member.robot)">@{{ covertName(chatContent.targetName) }}</span>
|
<!-- &&!(chatContent.self) -->
|
||||||
|
<span v-if="chatContent.group">@{{ covertName(chatContent.targetName) }}</span>
|
||||||
<span class="el-icon-video-play playicon" />
|
<span class="el-icon-video-play playicon" />
|
||||||
<span class="messageText">{{ chatContent.message }}</span>
|
<span class="messageText">{{ chatContent.message }}</span>
|
||||||
<audio :id="'audio'+index" :src="baseUrl+chatContent.src" style="display:none" />
|
<audio :id="'audio'+index" :src="baseUrl+chatContent.src" style="display:none" />
|
||||||
@ -42,7 +43,8 @@ export default {
|
|||||||
if (this.currentCoversition.id == val.id) {
|
if (this.currentCoversition.id == val.id) {
|
||||||
this.chatContentList.push(simulationText);
|
this.chatContentList.push(simulationText);
|
||||||
} else {
|
} else {
|
||||||
this.$emit('addCoversition', {data:simulationText, headerTitle:''});
|
this.$emit('changeCoversition', simulationText);
|
||||||
|
// this.$emit('addCoversition', {data:simulationText, headerTitle:''});
|
||||||
this.chatContentList.push(simulationText);
|
this.chatContentList.push(simulationText);
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
@ -48,7 +48,6 @@ export default {
|
|||||||
addCoversition(data, headerTitle) {
|
addCoversition(data, headerTitle) {
|
||||||
const index = this.coversitionList.findIndex(item=>{ return item.id == data.id; });
|
const index = this.coversitionList.findIndex(item=>{ return item.id == data.id; });
|
||||||
if (index < 0) {
|
if (index < 0) {
|
||||||
debugger;
|
|
||||||
const objectCover = this.handleMemberName(data);
|
const objectCover = this.handleMemberName(data);
|
||||||
data.coverName = objectCover.coversitionName;
|
data.coverName = objectCover.coversitionName;
|
||||||
data.isOnline = objectCover.isOnline;
|
data.isOnline = objectCover.isOnline;
|
||||||
@ -64,6 +63,13 @@ export default {
|
|||||||
this.$emit('setCurrentCoversition', coversition);
|
this.$emit('setCurrentCoversition', coversition);
|
||||||
// this.$refs.chatContent.reloadData(this.currentCoversition);
|
// this.$refs.chatContent.reloadData(this.currentCoversition);
|
||||||
},
|
},
|
||||||
|
changeCoversitionOther(coversition) {
|
||||||
|
const objectCover = this.handleMemberName(coversition);
|
||||||
|
coversition.coverName = objectCover.coversitionName;
|
||||||
|
coversition.isOnline = objectCover.isOnline;
|
||||||
|
this.coversitionList.push(coversition);
|
||||||
|
this.changeCoversition(coversition);
|
||||||
|
},
|
||||||
handleMemberName(conversition) {
|
handleMemberName(conversition) {
|
||||||
if (conversition.group) {
|
if (conversition.group) {
|
||||||
return {coversitionName:conversition.name, isOnline:true};
|
return {coversitionName:conversition.name, isOnline:true};
|
||||||
|
@ -78,6 +78,11 @@ export default {
|
|||||||
this.memberList = lastData;
|
this.memberList = lastData;
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
|
getMember(memberId) {
|
||||||
|
return this.memberList.filter(member=>{
|
||||||
|
return member.id == memberId;
|
||||||
|
});
|
||||||
|
},
|
||||||
doShow() {
|
doShow() {
|
||||||
if (this.showMembers) {
|
if (this.showMembers) {
|
||||||
this.showMembers = false;
|
this.showMembers = false;
|
||||||
|
@ -51,6 +51,8 @@
|
|||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
|
import Cookies from 'js-cookie';
|
||||||
|
import ConstConfig from '@/scripts/ConstConfig';
|
||||||
import {getScriptPageListOnlineNew, getScriptByIdNew, getDraftScriptByGroupNew } from '@/api/script';
|
import {getScriptPageListOnlineNew, getScriptByIdNew, getDraftScriptByGroupNew } from '@/api/script';
|
||||||
|
|
||||||
// 剧本弹窗
|
// 剧本弹窗
|
||||||
@ -152,6 +154,24 @@ export default {
|
|||||||
},
|
},
|
||||||
async loadInitData() {
|
async loadInitData() {
|
||||||
|
|
||||||
|
},
|
||||||
|
covert(data, roleTypeList) {
|
||||||
|
let lastData = data;
|
||||||
|
roleTypeList.forEach(function(element) {
|
||||||
|
const rolename = element.value;
|
||||||
|
if (Cookies.get('user_lang') == 'en') {
|
||||||
|
lastData = lastData.replace(new RegExp(rolename, 'g'), element.enLabel);
|
||||||
|
} else {
|
||||||
|
lastData = lastData.replace(new RegExp(rolename, 'g'), element.label);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
lastData = JSON.parse(lastData);
|
||||||
|
lastData.forEach(each=>{
|
||||||
|
const name = each.name == undefined ? '' : '-' + each.name;
|
||||||
|
const deviceName = each.deviceName == undefined ? '' : '-' + each.deviceName;
|
||||||
|
each.name = each.role + deviceName + name;
|
||||||
|
});
|
||||||
|
return lastData;
|
||||||
},
|
},
|
||||||
async handleLoad(index, row) {
|
async handleLoad(index, row) {
|
||||||
this.row = row;
|
this.row = row;
|
||||||
@ -159,7 +179,9 @@ export default {
|
|||||||
let newMemberList = [];
|
let newMemberList = [];
|
||||||
if (res.code == 200) {
|
if (res.code == 200) {
|
||||||
if (res.data.playerList && res.data.playerList.length > 0) {
|
if (res.data.playerList && res.data.playerList.length > 0) {
|
||||||
newMemberList = res.data.playerList.filter(item => item.hasPlay === true);
|
const lastData = JSON.stringify(res.data.playerList);
|
||||||
|
const playerList = this.covert(lastData, ConstConfig.ConstSelect.roleTypeNew);
|
||||||
|
newMemberList = playerList.filter(item => item.hasPlay === true);
|
||||||
}
|
}
|
||||||
if (res.data.mapLocation) {
|
if (res.data.mapLocation) {
|
||||||
this.mapLocation = res.data.mapLocation;
|
this.mapLocation = res.data.mapLocation;
|
||||||
|
Loading…
Reference in New Issue
Block a user