2020-06-12 11:31:30 +08:00
|
|
|
<template>
|
|
|
|
<el-scrollbar ref="elActionScrollbar" wrap-class="scrollbar-wrapper" class="scriptBottom" :style="{width:370+'px',height:size.height+'px'}">
|
|
|
|
<el-timeline :reverse="reverse" class="el_timeline">
|
|
|
|
<el-timeline-item v-for="(actionInfo,index) in actionInfoList" :key="index">
|
|
|
|
<el-card>
|
|
|
|
<div class="actionTable">
|
|
|
|
<span class="detail" v-html="actionInfo.detail" />
|
|
|
|
<span class="otherInfo" v-html="actionInfo.otherInfo" />
|
2020-06-12 17:44:18 +08:00
|
|
|
<span v-if="actionInfo.isStartCoversition">
|
2020-06-12 11:31:30 +08:00
|
|
|
<span class="roleClass">{{ actionInfo.memberName }}</span>
|
2020-06-12 17:44:18 +08:00
|
|
|
<span>邀请</span>
|
2020-06-12 11:31:30 +08:00
|
|
|
<span class="roleClass">{{ actionInfo.targetName }}</span>
|
2020-06-22 18:37:09 +08:00
|
|
|
<span>开始会话</span>
|
2020-06-12 17:44:18 +08:00
|
|
|
</span>
|
2020-06-19 19:08:33 +08:00
|
|
|
<span v-else-if="actionInfo.isDrive">
|
|
|
|
<span class="roleClass">{{ actionInfo.memberName }}</span>
|
|
|
|
<span>把车开到</span>
|
|
|
|
<span class="commandStyle">区段{{ actionInfo.targetName }}</span>
|
|
|
|
</span>
|
2020-09-21 10:53:45 +08:00
|
|
|
<!-- <span v-else-if="actionInfo.isClose">
|
2020-07-08 18:56:32 +08:00
|
|
|
<span class="roleClass">{{ actionInfo.memberName }}</span>
|
|
|
|
<span>结束了会话</span>
|
2020-09-21 10:53:45 +08:00
|
|
|
</span> -->
|
2020-06-12 18:29:14 +08:00
|
|
|
<span v-else-if="actionInfo.isCoversition">
|
2020-06-12 17:44:18 +08:00
|
|
|
<span class="roleClass">{{ actionInfo.memberName }}</span>
|
|
|
|
<!-- <span>{{ $t('scriptRecord.speakTo') }}</span> -->
|
|
|
|
<!-- <span class="roleClass">{{ actionInfo.targetName }}</span> -->
|
2020-06-12 11:31:30 +08:00
|
|
|
<span>: </span>
|
2020-06-23 14:17:35 +08:00
|
|
|
<span v-if="!actionInfo.isModify">{{ actionInfo.reply }}</span>
|
|
|
|
<textarea v-else v-model="actionInfo.modifyText" type="text" class="modifyText" />
|
2020-06-12 11:31:30 +08:00
|
|
|
</span>
|
2020-08-07 19:02:59 +08:00
|
|
|
<span v-else-if="actionInfo.isOperation">
|
2020-06-12 11:31:30 +08:00
|
|
|
<span class="roleClass">{{ actionInfo.memberName }}</span>
|
|
|
|
<span>{{ $t('scriptRecord.executeCommandTips') }}</span>
|
|
|
|
<span class="commandStyle">{{ actionInfo.command }}</span>
|
|
|
|
</span>
|
2020-08-07 19:02:59 +08:00
|
|
|
<span v-else-if="actionInfo.isCommand">
|
|
|
|
<span class="roleClass">{{ actionInfo.memberName }}</span>
|
|
|
|
<span>对</span>
|
|
|
|
<span class="roleClass">{{ actionInfo.targetName }}</span>
|
|
|
|
<span>下达了</span>
|
|
|
|
<span class="commandStyle">{{ actionInfo.command }}</span>
|
|
|
|
</span>
|
2020-06-12 11:31:30 +08:00
|
|
|
</div>
|
|
|
|
<div class="btnGroup">
|
2020-06-23 14:17:35 +08:00
|
|
|
<el-button v-if="actionInfo.visible && !actionInfo.isModify" type="primary" size="mini" style="margin-left:10px;" @click="modifyAction(actionInfo)">{{ $t('scriptRecord.modifyConversitionButton') }}</el-button>
|
|
|
|
<el-button v-if="actionInfo.visible && actionInfo.isModify" :loading="modifyTextLoading" type="danger" size="mini" style="margin-left:10px;" @click="confirmModify(actionInfo)">确定</el-button>
|
|
|
|
<el-button v-if="actionInfo.visible && actionInfo.isModify" type="" size="mini" style="margin-left:10px;" @click="cancleModify(actionInfo)">取消</el-button>
|
2020-06-12 11:31:30 +08:00
|
|
|
<!-- <el-button type="danger" size="mini" @click="deleteAction(actionInfo.id)">删除</el-button> -->
|
|
|
|
</div>
|
|
|
|
</el-card>
|
|
|
|
</el-timeline-item>
|
|
|
|
</el-timeline>
|
|
|
|
</el-scrollbar>
|
|
|
|
</template>
|
|
|
|
<script>
|
2020-07-08 13:05:09 +08:00
|
|
|
import {getScriptAllAction, modifyScriptActionNew } from '@/api/simulation';
|
2020-06-12 11:31:30 +08:00
|
|
|
import CMD from '@/scripts/cmdPlugin/CommandEnum';
|
2020-10-28 13:51:26 +08:00
|
|
|
|
2020-06-12 11:31:30 +08:00
|
|
|
export default {
|
|
|
|
name: 'GetActionNew',
|
|
|
|
props: {
|
|
|
|
group: {
|
|
|
|
type: String,
|
|
|
|
required: true
|
|
|
|
},
|
|
|
|
size: {
|
|
|
|
type: Object,
|
|
|
|
required: true
|
2020-07-08 13:05:09 +08:00
|
|
|
},
|
|
|
|
memberList:{
|
|
|
|
type:Array,
|
|
|
|
required:true
|
2020-06-12 11:31:30 +08:00
|
|
|
}
|
|
|
|
},
|
|
|
|
data() {
|
|
|
|
return {
|
|
|
|
actionInfoList: [],
|
|
|
|
deviceCommandList: [],
|
|
|
|
reverse: false,
|
|
|
|
loading: true,
|
2020-06-23 14:17:35 +08:00
|
|
|
// isModify:false,
|
|
|
|
// modifyText:'',
|
2020-06-23 10:27:18 +08:00
|
|
|
modifyTextLoading:false,
|
2020-06-12 11:31:30 +08:00
|
|
|
// behaviorName:"",
|
|
|
|
memberName: ''
|
|
|
|
};
|
|
|
|
},
|
|
|
|
watch: {
|
|
|
|
actionInfoList: function(val) {
|
|
|
|
this.$nextTick(function() {
|
|
|
|
var div = this.$refs['elActionScrollbar'].$refs['wrap'];
|
|
|
|
div.scrollTop = this.$refs['elActionScrollbar'].wrap.scrollHeight;
|
|
|
|
});
|
2020-06-12 17:44:18 +08:00
|
|
|
},
|
|
|
|
'$store.state.socket.scriptAction':function(val) {
|
2020-07-08 13:05:09 +08:00
|
|
|
this.covertData(this.memberList, val);
|
|
|
|
},
|
|
|
|
'memberList':function(val) {
|
|
|
|
this.loadInitData();
|
2020-06-12 11:31:30 +08:00
|
|
|
}
|
|
|
|
},
|
|
|
|
mounted() {
|
|
|
|
},
|
|
|
|
methods: {
|
|
|
|
loadInitData() {
|
|
|
|
this.loadOtherData(this.$route.query);
|
|
|
|
},
|
2020-07-08 13:05:09 +08:00
|
|
|
covertData(memberList, element) {
|
|
|
|
const member = memberList.find(elem=>{ return elem.id == element.memberId; });
|
2020-09-01 18:27:36 +08:00
|
|
|
const memberName = member.type + member.deviceName + (member.name ? member.name : '');
|
2020-06-12 18:29:14 +08:00
|
|
|
switch (element.type) {
|
|
|
|
case 'Start_Conversation': {
|
|
|
|
// isStartCoversition
|
|
|
|
const targetNameList = [];
|
2020-10-13 14:41:42 +08:00
|
|
|
if (element.communicationObject) {
|
|
|
|
if (element.communicationObject == 'ALL_STATION') {
|
|
|
|
targetNameList.push('所有车站');
|
|
|
|
} else if (element.communicationObject == 'ALL_TRAIN') {
|
|
|
|
targetNameList.push('所有司机');
|
2020-06-17 18:36:22 +08:00
|
|
|
}
|
2020-10-13 14:41:42 +08:00
|
|
|
} else {
|
|
|
|
element.conversationMemberIds.forEach(id=>{
|
|
|
|
if (member.id != id) {
|
|
|
|
const userName = memberList.find(elem=>{ return elem.id == id; });
|
|
|
|
targetNameList.push(userName.type + userName.deviceName + (userName.name ? userName.name : ''));
|
|
|
|
}
|
|
|
|
});
|
|
|
|
}
|
|
|
|
|
2020-06-12 18:29:14 +08:00
|
|
|
this.actionInfoList.push({id: element.id, isStartCoversition: true, memberName: memberName, targetName:targetNameList.toString() });
|
|
|
|
break;
|
|
|
|
}
|
2020-06-19 19:08:33 +08:00
|
|
|
case 'Drive': {
|
|
|
|
this.actionInfoList.push({id: element.id, isDrive: true, memberName: memberName, targetName:this.covertSection(element.targetSectionCode)});
|
|
|
|
break;
|
|
|
|
}
|
2020-06-12 18:29:14 +08:00
|
|
|
case 'Conversation':
|
|
|
|
{
|
2020-06-23 14:17:35 +08:00
|
|
|
this.actionInfoList.push({id: element.id, isCoversition: true, memberName: memberName, reply: element.content, row: element, visible: true, isModify:false, modifyText:''});
|
2020-06-12 18:29:14 +08:00
|
|
|
break;
|
|
|
|
}
|
2020-09-21 14:20:33 +08:00
|
|
|
// case 'Exit_Conversation': {
|
2020-09-21 10:53:45 +08:00
|
|
|
// this.actionInfoList.push({id: element.id, isClose: true, memberName: memberName});
|
|
|
|
// break;
|
|
|
|
// }
|
2020-08-04 14:02:10 +08:00
|
|
|
case 'Operation':
|
2020-06-12 18:29:14 +08:00
|
|
|
{
|
2020-06-19 10:06:58 +08:00
|
|
|
// const command = CommandHandler.getScriptDefinition(element.operationType);
|
|
|
|
const commandName = element.operationType;
|
2020-08-21 14:16:44 +08:00
|
|
|
if (commandName != 'Set_Fault' && commandName != 'Cancel_Fault' ) {
|
2020-10-13 14:41:42 +08:00
|
|
|
const list = ['Train_Update_Type',
|
|
|
|
'Train_Add_Train_Trace',
|
|
|
|
'Train_Remove_Train_Trace',
|
|
|
|
'Train_Move_Train_Trace',
|
|
|
|
'Train_Set_Plan',
|
|
|
|
'Train_Set_Head',
|
|
|
|
'Train_Set_Manual',
|
|
|
|
'Train_Set_Crew_Number',
|
|
|
|
'Train_Tag_Atp_Cut',
|
|
|
|
'Train_Tag_Atp_Recover',
|
|
|
|
'Train_Allow_Pass',
|
|
|
|
'Train_Info'];
|
2020-08-07 19:02:59 +08:00
|
|
|
let operateType = commandName.split('_')[0];
|
2020-10-13 14:41:42 +08:00
|
|
|
if (list.includes(commandName)) {
|
|
|
|
operateType = 'TrainWindow';
|
|
|
|
}
|
2020-08-07 19:02:59 +08:00
|
|
|
if (operateType == 'CM') {
|
|
|
|
operateType = 'ControlConvertMenu';
|
|
|
|
}
|
|
|
|
const operateName = Object.values(CMD[operateType]).find(res=>{ return res.value == commandName; });
|
2020-10-13 14:41:42 +08:00
|
|
|
const deviceTypeList = {Section:'区段', Switch:'道岔', Signal:'信号机', Stand:'站台', Station:'车站', TrainWindow:'车次窗', ControlConvertMenu:'控制模式', Driver:'司机', Train:'列车'};
|
2020-08-07 19:02:59 +08:00
|
|
|
const operateTypeName = deviceTypeList[operateType];
|
|
|
|
this.actionInfoList.push({id: element.id, isOperation: true, memberName: memberName, command: operateTypeName + '(' + operateName.label + ')', row: element, visible: false});
|
|
|
|
} else {
|
|
|
|
// deviceFaultType
|
|
|
|
// element.operationParamMap.faultType;
|
|
|
|
// '(' + operateName.label + ')'
|
2020-08-21 14:16:44 +08:00
|
|
|
if (commandName == 'Set_Fault') {
|
|
|
|
this.actionInfoList.push({id: element.id, isOperation: true, memberName: memberName, command: '设置故障', row: element, visible: false});
|
|
|
|
} else if (commandName == 'Cancel_Fault') {
|
|
|
|
this.actionInfoList.push({id: element.id, isOperation: true, memberName: memberName, command: '取消故障', row: element, visible: false});
|
|
|
|
}
|
2020-06-12 18:29:14 +08:00
|
|
|
}
|
2020-08-07 19:02:59 +08:00
|
|
|
break;
|
|
|
|
}
|
|
|
|
case 'Command': {
|
|
|
|
const targetName = memberList.find(elem=>{ return elem.id == element.commandInitiateVO.targetMemberId; });
|
|
|
|
const CommandList = {
|
|
|
|
Drive_Ahead:'确认运行至前方站',
|
|
|
|
Route_Block_Drive:'进路闭塞法行车',
|
|
|
|
Drive_Through_The_Guide_Signal:'越引导信号行驶',
|
2020-08-10 09:47:01 +08:00
|
|
|
Drive_Through_The_Red_Light:'越红灯行驶',
|
|
|
|
Drive_In_Urm_Mode:'URM模式驾驶',
|
|
|
|
Set_Speed_Limit:'设置限速',
|
|
|
|
Open_Or_Close_Door:'开关门',
|
|
|
|
Switch_Hook_Lock: '道岔钩锁'
|
2020-08-07 19:02:59 +08:00
|
|
|
};
|
|
|
|
this.actionInfoList.push({id: element.id, isCommand: true, memberName: memberName, command: CommandList[element.commandInitiateVO.commandType], targetName:targetName.name, row: element, visible: false});
|
2020-06-12 18:29:14 +08:00
|
|
|
break;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
},
|
2020-06-19 19:08:33 +08:00
|
|
|
covertSection(sectionCode) {
|
|
|
|
const section = this.$store.getters['map/getDeviceByCode'](sectionCode);
|
|
|
|
if (section && section.name) {
|
|
|
|
return section.name;
|
|
|
|
} else {
|
|
|
|
return '';
|
|
|
|
}
|
|
|
|
},
|
2020-06-12 11:31:30 +08:00
|
|
|
loadOtherData(obj) {
|
|
|
|
const group = obj.group;
|
2020-07-08 13:05:09 +08:00
|
|
|
getScriptAllAction(group).then(resp=>{
|
|
|
|
this.actionInfoList = [];
|
|
|
|
const actionList = resp.data;
|
|
|
|
actionList.forEach(element => {
|
|
|
|
this.covertData(this.memberList, element);
|
2020-06-12 11:31:30 +08:00
|
|
|
});
|
|
|
|
}).catch(error => {
|
|
|
|
this.$message(error.message);
|
|
|
|
});
|
|
|
|
},
|
|
|
|
reloadTable() {
|
|
|
|
this.loadInitData();
|
2020-06-23 10:27:18 +08:00
|
|
|
},
|
2020-06-23 14:17:35 +08:00
|
|
|
modifyAction(actionInfo) {
|
|
|
|
actionInfo.modifyText = actionInfo.row.content;
|
|
|
|
actionInfo.isModify = true;
|
2020-06-23 10:27:18 +08:00
|
|
|
},
|
2020-06-23 14:17:35 +08:00
|
|
|
cancleModify(actionInfo) {
|
|
|
|
actionInfo.modifyText = '';
|
|
|
|
actionInfo.isModify = false;
|
2020-06-23 10:57:35 +08:00
|
|
|
this.modifyTextLoading = false;
|
2020-06-23 10:27:18 +08:00
|
|
|
},
|
2020-06-23 14:17:35 +08:00
|
|
|
confirmModify(actionInfo) {
|
|
|
|
const row = actionInfo.row;
|
|
|
|
if (actionInfo.modifyText != row.content) {
|
2020-06-23 10:27:18 +08:00
|
|
|
const data = {id:row.id};
|
2020-06-23 14:17:35 +08:00
|
|
|
data.content = actionInfo.modifyText;
|
2020-06-23 10:27:18 +08:00
|
|
|
this.modifyTextLoading = true;
|
|
|
|
modifyScriptActionNew(this.group, data).then(response=>{
|
2020-06-23 14:17:35 +08:00
|
|
|
actionInfo.modifyText = '';
|
|
|
|
actionInfo.isModify = false;
|
2020-06-23 10:27:18 +08:00
|
|
|
this.modifyTextLoading = false;
|
2020-06-23 10:57:35 +08:00
|
|
|
this.reloadTable();
|
|
|
|
this.$store.dispatch('scriptRecord/updateCoversitionInfo');
|
2020-06-23 15:15:46 +08:00
|
|
|
}).catch(error=>{
|
|
|
|
this.modifyTextLoading = false;
|
|
|
|
this.$messageBox('修改会话失败:' + error.message);
|
2020-06-23 10:27:18 +08:00
|
|
|
});
|
|
|
|
} else {
|
2020-06-23 14:17:35 +08:00
|
|
|
if (!actionInfo.modifyText) {
|
2020-06-23 10:27:18 +08:00
|
|
|
this.$messageBox('请输入修改的会话');
|
|
|
|
} else {
|
2020-06-23 14:17:35 +08:00
|
|
|
actionInfo.modifyText = '';
|
|
|
|
actionInfo.isModify = false;
|
2020-06-23 10:27:18 +08:00
|
|
|
}
|
|
|
|
}
|
2020-06-12 11:31:30 +08:00
|
|
|
}
|
|
|
|
}
|
|
|
|
};
|
|
|
|
</script>
|
|
|
|
<style rel="stylesheet/scss" lang="scss" scoped>
|
|
|
|
@import "src/styles/mixin.scss";
|
|
|
|
.actionTable{
|
|
|
|
width:280px;
|
|
|
|
padding: 15px 0px 10px 15px;
|
|
|
|
display: inline-block;
|
|
|
|
line-height: 200%;
|
|
|
|
}
|
|
|
|
.btnGroup{
|
2020-06-23 10:27:18 +08:00
|
|
|
padding: 0px 10px 10px 10px;
|
2020-06-12 11:31:30 +08:00
|
|
|
float: right;
|
|
|
|
vertical-align: top;
|
|
|
|
display: inline-block;
|
|
|
|
}
|
|
|
|
.el_timeline{
|
|
|
|
width: 350px;
|
|
|
|
margin-top:5px;
|
|
|
|
padding-left: 25px;
|
|
|
|
}
|
|
|
|
.el-timeline{
|
|
|
|
font-size:13px;
|
|
|
|
}
|
|
|
|
.roleClass{
|
|
|
|
color:#409EFF
|
|
|
|
}
|
|
|
|
.commandStyle{
|
|
|
|
color:#F00;
|
|
|
|
}
|
|
|
|
.scriptPane{
|
|
|
|
height: 100%;
|
|
|
|
padding-top:200px;
|
|
|
|
}
|
|
|
|
.scriptBottom{
|
|
|
|
margin-left:300px;
|
|
|
|
margin-top: 0px;
|
|
|
|
font-size:13px;
|
|
|
|
}
|
2020-06-23 10:27:18 +08:00
|
|
|
.modifyText{
|
|
|
|
height: 70px;
|
|
|
|
border: 1px #ccc solid;
|
|
|
|
border-radius: 3px;
|
2020-06-23 10:57:35 +08:00
|
|
|
width: 270px;
|
2020-06-23 10:27:18 +08:00
|
|
|
outline: none;
|
|
|
|
font-size: 13px;
|
|
|
|
resize: none;
|
|
|
|
vertical-align: top;
|
|
|
|
padding: 5px;
|
|
|
|
line-height: 20px;
|
|
|
|
}
|
2020-06-12 11:31:30 +08:00
|
|
|
</style>
|