Merge branch 'test' of https://git.code.tencent.com/lian-cbtc/jl-client into test
This commit is contained in:
commit
69388e4f91
@ -355,6 +355,7 @@ class SkinCode extends defaultStyle {
|
||||
fontWeight: 'normal'
|
||||
},
|
||||
stopTime: { // 停站时间
|
||||
position: 1, // 停站时间方向
|
||||
offset: { x: -8, y: 4 }, // 运行时间偏移量
|
||||
textColor: 'white', // 停站时间字体颜色
|
||||
textFontSize: 10 // 停站时间字体大小
|
||||
|
@ -409,6 +409,7 @@ class SkinCode extends defaultStyle {
|
||||
specialShape: 'rect' // 扣车标志形状
|
||||
},
|
||||
stopTime: { // 停站时间
|
||||
position: 1, // 停站时间方向
|
||||
offset: { x: -8, y: 4 }, // 运行时间偏移量
|
||||
textColor: 'white', // 停站时间字体颜色
|
||||
textFontSize: 10 // 停站时间字体大小
|
||||
|
@ -29,7 +29,6 @@ class ETime extends Group {
|
||||
textVerticalAlign: style.textStyle.textVerticalAlign
|
||||
}
|
||||
});
|
||||
|
||||
this.add(this.time);
|
||||
}
|
||||
}
|
||||
@ -45,13 +44,12 @@ class ETime extends Group {
|
||||
}
|
||||
|
||||
hideMode() {
|
||||
this.create();
|
||||
this.time.hide();
|
||||
this.time && this.time.hide();
|
||||
}
|
||||
|
||||
showMode() {
|
||||
this.create();
|
||||
this.time.show();
|
||||
this.time && this.time.show();
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -210,7 +210,7 @@ export default {
|
||||
},
|
||||
commit() {
|
||||
this.loading = true;
|
||||
commitOperate(menuOperate.StationStand.setStopTime, {parkingTime: this.control == '01' ? -1 : this.parkingTime, parkingAlwaysValid: this.effective}, 2).then(({ valid })=>{
|
||||
commitOperate(menuOperate.StationStand.setStopTime, {parkingTime: this.control == '01' ? -1 : this.time, parkingAlwaysValid: this.effective}, 2).then(({ valid })=>{
|
||||
this.loading = false;
|
||||
if (valid) {
|
||||
this.doClose();
|
||||
|
@ -87,8 +87,8 @@ export default {
|
||||
stepVOList: [
|
||||
{ deviceType: '06', orderNum: 1, operateCode: '502', tip: '鼠标右键菜单选择【设置跳停】' },
|
||||
{ deviceType: '06', orderNum: 2, operateCode: '5024', tip: '鼠标左键点击' },
|
||||
{ deviceType: '06', orderNum: 2, operateCode: '5022', tip: '请选择001号车', val: '001' },
|
||||
{ deviceType: '06', orderNum: 2, operateCode: '502', tip: '鼠标左键点击【确定】按钮' }
|
||||
{ deviceType: '06', orderNum: 3, operateCode: '5022', tip: '请选择001号车', val: '001' },
|
||||
{ deviceType: '06', orderNum: 4, operateCode: '502', tip: '鼠标左键点击【确定】按钮' }
|
||||
]
|
||||
},
|
||||
{
|
||||
|
@ -249,6 +249,7 @@ export default {
|
||||
},
|
||||
handleSwicthMenu() { // 转换底部道岔菜单栏
|
||||
// 获取道岔相关区段显示高亮
|
||||
this.clearAllMenuShow();
|
||||
const section = this.$store.getters['map/getDeviceByCode'](this.selectedObj.sectionParentCode);
|
||||
const sectionA = this.$store.getters['map/getDeviceByCode'](this.selectedObj.sectionACode); // 获取道岔相关的道岔计轴区段
|
||||
const sectionB = this.$store.getters['map/getDeviceByCode'](this.selectedObj.sectionBCode);
|
||||
@ -274,6 +275,7 @@ export default {
|
||||
};
|
||||
},
|
||||
handleSingalMenu() {
|
||||
this.clearAllMenuShow();
|
||||
this.deviceHighLight(this.oldDevice, false);
|
||||
this.deviceHighLight(this.selectedObj, true);
|
||||
this.oldDevice = this.selectedObj;
|
||||
@ -351,6 +353,7 @@ export default {
|
||||
}
|
||||
},
|
||||
handleSectionMenu() {
|
||||
this.clearAllMenuShow();
|
||||
this.deviceHighLight(this.oldDevice, false);
|
||||
this.deviceHighLight(this.selectedObj, true);
|
||||
this.oldDevice = this.selectedObj;
|
||||
@ -386,6 +389,7 @@ export default {
|
||||
};
|
||||
},
|
||||
handleStationMenu() {
|
||||
this.clearAllMenuShow();
|
||||
this.centralizedStationList = new Array(15).fill({});
|
||||
this.stationParamList.forEach((station, index) => {
|
||||
this.centralizedStationList[index] = station;
|
||||
@ -398,6 +402,7 @@ export default {
|
||||
this.param = { stationCode: this.selectedObj.code };
|
||||
},
|
||||
handleStandMenu() {
|
||||
this.clearAllMenuShow();
|
||||
this.centralizedStationList = new Array(15).fill({});
|
||||
this.standParamList.forEach((stand, index) => {
|
||||
this.centralizedStationList[index] = stand;
|
||||
|
@ -70,7 +70,7 @@ export default {
|
||||
cmdType:CMD.Stand.CMD_STAND_EARLY_DEPART
|
||||
},
|
||||
{
|
||||
label: '站台详细信息',
|
||||
label: '查看站台信息',
|
||||
handler: this.detail,
|
||||
cmdType:CMD.Stand.CMD_STAND_VIEW_STATUS
|
||||
}
|
||||
|
@ -84,6 +84,22 @@ export default {
|
||||
{ deviceType: '06', orderNum: 2, operateCode: '502', tip: '鼠标左键点击【确定】按钮' }
|
||||
]
|
||||
},
|
||||
{
|
||||
maxDuration: 15,
|
||||
minDuration: 8,
|
||||
operateType: 'Stand_Set_Jump_Stop',
|
||||
skinCode: '06',
|
||||
trainingName: '设置跳停({10}-{12}站台)',
|
||||
trainingRemark: '设置指定001号列车跳停功能',
|
||||
trainingType: 'Stand',
|
||||
productTypes: ['02'],
|
||||
stepVOList: [
|
||||
{ deviceType: '06', orderNum: 1, operateCode: '502', tip: '鼠标右键菜单选择【设置跳停】' },
|
||||
{ deviceType: '06', orderNum: 2, operateCode: '5024', tip: '鼠标左键点击' },
|
||||
{ deviceType: '06', orderNum: 3, operateCode: '5022', tip: '请选择001号车', val: '001' },
|
||||
{ deviceType: '06', orderNum: 4, operateCode: '502', tip: '鼠标左键点击【确定】按钮' }
|
||||
]
|
||||
},
|
||||
{
|
||||
maxDuration: 15,
|
||||
minDuration: 8,
|
||||
@ -212,12 +228,12 @@ export default {
|
||||
minDuration: 5,
|
||||
operateType: 'Stand_View_Status',
|
||||
skinCode: '06',
|
||||
trainingName: '站台详细信息({10}-{12}站台)',
|
||||
trainingRemark: '站台详细信息功能',
|
||||
trainingName: '查看站台信息({10}-{12}站台)',
|
||||
trainingRemark: '查看站台信息功能',
|
||||
trainingType: 'Stand',
|
||||
productTypes: ['01', '02'],
|
||||
stepVOList: [
|
||||
{ deviceType: '06', orderNum: 1, operateCode: '507', tip: '鼠标右键菜单选择【站台详细信息】' },
|
||||
{ deviceType: '06', orderNum: 1, operateCode: '507', tip: '鼠标右键菜单选择【查看站台信息】' },
|
||||
{ deviceType: '06', orderNum: 2, operateCode: '0012', tip: '鼠标左键点击【确定】按钮' }
|
||||
]
|
||||
},
|
||||
@ -808,6 +824,62 @@ export default {
|
||||
{ deviceType: '10', orderNum: 5, operateCode: '8005', tip: '鼠标左键点击【关闭】'},
|
||||
{ deviceType: '10', orderNum: 6, operateCode: '8006', tip: '鼠标左键点击【确认】' }
|
||||
]
|
||||
},
|
||||
{
|
||||
maxDuration: 15,
|
||||
minDuration: 8,
|
||||
operateType: 'Station_Close_Auto_Setting',
|
||||
skinCode: '06',
|
||||
trainingName: ' 所有进路自排关({26})',
|
||||
trainingRemark: ' 所有进路自排关',
|
||||
trainingType: 'Station',
|
||||
productTypes: ['02'],
|
||||
stepVOList: [
|
||||
{ deviceType: '05', orderNum: 1, operateCode: '605', tip: '鼠标右键菜单选择【所有进路自排关】'},
|
||||
{ deviceType: '05', orderNum: 2, operateCode: '605', tip: '鼠标左键点击【确定】' }
|
||||
]
|
||||
},
|
||||
{
|
||||
maxDuration: 15,
|
||||
minDuration: 8,
|
||||
operateType: 'Station_Open_Auto_Setting',
|
||||
skinCode: '06',
|
||||
trainingName: ' 所有进路自排开({26})',
|
||||
trainingRemark: ' 所有进路自排开',
|
||||
trainingType: 'Station',
|
||||
productTypes: ['02'],
|
||||
stepVOList: [
|
||||
{ deviceType: '05', orderNum: 1, operateCode: '606', tip: '鼠标右键菜单选择【所有进路自排开】'},
|
||||
{ deviceType: '05', orderNum: 2, operateCode: '606', tip: '鼠标左键点击【确定】' }
|
||||
]
|
||||
},
|
||||
{
|
||||
maxDuration: 15,
|
||||
minDuration: 8,
|
||||
operateType: 'Station_Cancel_CI_Auto_Trigger',
|
||||
skinCode: '06',
|
||||
trainingName: ' 全站取消联锁自动触发({26})',
|
||||
trainingRemark: ' 全站取消联锁自动触发',
|
||||
trainingType: 'Station',
|
||||
productTypes: ['01'],
|
||||
stepVOList: [
|
||||
{ deviceType: '05', orderNum: 1, operateCode: '602', tip: '鼠标右键菜单选择【全站取消联锁自动触发】'},
|
||||
{ deviceType: '05', orderNum: 2, operateCode: '602', tip: '鼠标左键点击【确定】' }
|
||||
]
|
||||
},
|
||||
{
|
||||
maxDuration: 15,
|
||||
minDuration: 8,
|
||||
operateType: 'Station_Set_CI_Auto_Trigger',
|
||||
skinCode: '06',
|
||||
trainingName: ' 全站设置联锁自动触发({26})',
|
||||
trainingRemark: ' 全站设置联锁自动触发',
|
||||
trainingType: 'Station',
|
||||
productTypes: ['01'],
|
||||
stepVOList: [
|
||||
{ deviceType: '05', orderNum: 1, operateCode: '601', tip: '鼠标右键菜单选择【全站设置联锁自动触发】'},
|
||||
{ deviceType: '05', orderNum: 2, operateCode: '601', tip: '鼠标左键点击【确定】' }
|
||||
]
|
||||
}
|
||||
]
|
||||
};
|
||||
|
@ -1,44 +1,77 @@
|
||||
<template>
|
||||
<el-dialog v-dialogDrag class="ningbo-01__systerm route-setting" :title="title" :visible.sync="show" width="600px" :before-close="doClose" :z-index="2000" :modal="false" :close-on-click-modal="false">
|
||||
<el-dialog v-dialogDrag class="ningbo-01__systerm route-setting" :title="title" :visible.sync="show" width="800px" :before-close="doClose" :z-index="2000" :modal="false" :close-on-click-modal="false">
|
||||
<el-row>
|
||||
<el-col :span="3">
|
||||
<el-col :span="4" style="border-bottom: 1px solid #ACABAA;border-left: 1px solid #ACABAA;border-top: 1px solid #ACABAA;padding-left: 8px;padding-bottom: 8px;">
|
||||
<el-row>
|
||||
<div>开始</div>
|
||||
<div style="color: #000;position: relative; top: 15px;left: 5px;width: 40px;background: #F0F0F0;text-align: center;">开始</div>
|
||||
<div style="border: 1px solid #ACABAA;padding: 8px;">
|
||||
<el-table :data="signalList" height="150">
|
||||
<el-table-column prop="name" label="信号机" />
|
||||
<el-table-column prop="name" width="70" label="信号机" />
|
||||
</el-table>
|
||||
</div>
|
||||
</el-row>
|
||||
<el-row>
|
||||
<div>结束</div>
|
||||
<div style="color: #000;position: relative; top: 15px;left: 5px;width: 40px;background: #F0F0F0;text-align: center;">结束</div>
|
||||
<div style="border: 1px solid #ACABAA;padding: 8px;">
|
||||
<el-table :data="signalList" height="150">
|
||||
<el-table-column prop="name" label="信号机" />
|
||||
<el-table-column prop="name" width="70" label="信号机" />
|
||||
</el-table>
|
||||
</div>
|
||||
</el-row>
|
||||
</el-col>
|
||||
<el-col :span="6">
|
||||
<el-table :data="tempData">
|
||||
<el-col :span="6" style="padding: 30px 10px 0;border-bottom: 1px solid #ACABAA;border-right: 1px solid #ACABAA;border-top: 1px solid #ACABAA;">
|
||||
<el-table :data="tempData" height="344px">
|
||||
<el-table-column prop="path" label="路径" />
|
||||
<el-table-column prop="direction" label="运行方向" />
|
||||
</el-table>
|
||||
<el-checkbox v-model="checked">显示复制路径</el-checkbox>
|
||||
</el-col>
|
||||
<el-col :span="15">
|
||||
<el-col :span="14" style="padding-left: 8px;">
|
||||
<el-tabs v-model="activeName" type="card">
|
||||
<el-tab-pane label="设置进路" name="first">用户管理</el-tab-pane>
|
||||
<el-tab-pane label="取消进路" name="second">配置管理</el-tab-pane>
|
||||
<el-tab-pane label="禁止进路" name="third">角色管理</el-tab-pane>
|
||||
<el-tab-pane label="设置进路" name="first">
|
||||
<el-row>
|
||||
<el-col :span="18">
|
||||
<el-table :data="routeList" height="120px">
|
||||
<el-table-column prop="name" width="140" label="进路" />
|
||||
<el-table-column prop="area" label="区域" />
|
||||
<el-table-column prop="status" label="状态" />
|
||||
</el-table>
|
||||
</el-col>
|
||||
<el-col :span="6">
|
||||
<div class="radio-box-title">解锁类型</div>
|
||||
<div class="radio-box">
|
||||
<el-radio v-model="unlockType" label="auto" style="display: block;margin-bottom: 10px;">自动</el-radio>
|
||||
<el-radio v-model="unlockType" label="artificial" style="display: block;">人工</el-radio>
|
||||
</div>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<el-row>
|
||||
<el-table :data="routeList" height="120px">
|
||||
<el-table-column prop="name" width="140" label="进路" />
|
||||
<el-table-column prop="area" label="区域" />
|
||||
<el-table-column prop="area" label="区域" />
|
||||
<el-table-column prop="status" label="状态" />
|
||||
</el-table>
|
||||
</el-row>
|
||||
</el-tab-pane>
|
||||
<el-tab-pane label="取消进路" name="second">取消进路</el-tab-pane>
|
||||
<el-tab-pane label="禁止进路" name="third">禁止进路</el-tab-pane>
|
||||
</el-tabs>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<el-row justify="center" class="button-group">
|
||||
<el-col :span="6" :offset="2">
|
||||
<el-col :span="4" :offset="2">
|
||||
<el-button :id="domIdConfirm" type="primary" :loading="loading" @click="commit">确定(O)</el-button>
|
||||
</el-col>
|
||||
<el-col :span="6" :offset="2">
|
||||
<el-col :span="4" :offset="2">
|
||||
<el-button :id="domIdConfirm" type="primary" :loading="loading" @click="commit">应用(A)</el-button>
|
||||
</el-col>
|
||||
<el-col :span="6" :offset="2">
|
||||
<el-col :span="4" :offset="2">
|
||||
<el-button :id="domIdCancel" @click="cancel">关闭(C)</el-button>
|
||||
</el-col>
|
||||
<el-col :span="4" :offset="2">
|
||||
<el-button>帮助(H)</el-button>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<notice-info ref="noticeInfo" pop-class="ningbo-01__systerm" />
|
||||
</el-dialog>
|
||||
@ -65,12 +98,15 @@ export default {
|
||||
selected: null,
|
||||
active: false,
|
||||
activeName: 'first',
|
||||
tempData: []
|
||||
tempData: [],
|
||||
checked: false,
|
||||
unlockType: ''
|
||||
};
|
||||
},
|
||||
computed: {
|
||||
...mapGetters('map', [
|
||||
'signalList'
|
||||
'signalList',
|
||||
'routeList'
|
||||
]),
|
||||
show() {
|
||||
return this.dialogShow && !this.$store.state.menuOperation.break;
|
||||
@ -147,15 +183,14 @@ export default {
|
||||
.radio-box {
|
||||
position: relative;
|
||||
border: 1px solid #BBBBBB;
|
||||
width: 130px;
|
||||
top: 100px;
|
||||
width: 100px;
|
||||
left: 8px;
|
||||
padding: 15px;
|
||||
}
|
||||
.radio-box-title {
|
||||
position: relative;
|
||||
left: 18px;
|
||||
top: 115px;
|
||||
top: 15px;
|
||||
text-align: center;
|
||||
color: #000;
|
||||
width: 60px;
|
||||
|
@ -40,7 +40,6 @@ const training = {
|
||||
memberList: [], // 综合仿真成员列表
|
||||
memberData: {}, // 综合仿真成员列表
|
||||
simulationUserList: [], // 综合仿真用户列表
|
||||
addMemberInScript:{}, // 剧本录制新增角色
|
||||
orignalUserRoleId:'' // 设置旧的角色的id
|
||||
},
|
||||
|
||||
@ -253,13 +252,6 @@ const training = {
|
||||
state.memberData[newMemberId].disabled = true;
|
||||
},
|
||||
|
||||
addMemberListInScript:(state, newMember) => {
|
||||
if (!state.memberData[newMember.id]) {
|
||||
// state.memberData[newMember.id] = newMember;
|
||||
state.addMemberInScript = newMember;
|
||||
}
|
||||
},
|
||||
|
||||
updateMemberAndUser: (state, {simulationUserList, userId}) => {
|
||||
simulationUserList.forEach(item => {
|
||||
let memberIndex = -1;
|
||||
@ -720,10 +712,6 @@ const training = {
|
||||
setRoleDeviceCode:({ commit }, roleDeviceCode) => {
|
||||
commit('setRoleDeviceCode', roleDeviceCode);
|
||||
},
|
||||
/** 添加新成员(剧本录制)*/
|
||||
addMemberListInScript:({ commit }, data) => {
|
||||
commit('addMemberListInScript', data);
|
||||
},
|
||||
/** 剧本仿真 设置旧的角色的id */
|
||||
setOrignalUserRoleId:({ commit }, data) => {
|
||||
commit('setOrignalUserRoleId', data);
|
||||
|
@ -72,7 +72,7 @@ export default {
|
||||
getSimulationMemberList(this.group).then(resp => {
|
||||
this.driverList = [];
|
||||
this.treeData = [];
|
||||
const result = covertMemberData(this.activeTrainList, resp);
|
||||
const result = covertMemberData(this.activeTrainList, resp.data);
|
||||
this.driverList = result.driverList;
|
||||
this.treeData = [{
|
||||
label: '行调',
|
||||
@ -207,6 +207,7 @@ export default {
|
||||
});
|
||||
}
|
||||
this.treeData[2].children = driverList;
|
||||
this.memberData = [...this.treeData[0].children, ...this.treeData[1].children, ...this.treeData[2].children, ...this.treeData[3].children, ...this.treeData[4].children];
|
||||
} else {
|
||||
this.activeTrainList = activeTrainList;
|
||||
}
|
||||
|
@ -117,8 +117,29 @@ export const operateEnum = {
|
||||
type:'车站'
|
||||
},
|
||||
Driver:{
|
||||
// code:'stationCode',
|
||||
type:'司机'
|
||||
code:'groupNumber',
|
||||
type:'司机',
|
||||
Driver_Door_On_Off:{
|
||||
isList:true,
|
||||
params:[
|
||||
{
|
||||
code:'open',
|
||||
name:'',
|
||||
result:[
|
||||
{data:true, name:'开', judge:'='},
|
||||
{data:false, name:'关', judge:'='}
|
||||
]
|
||||
},
|
||||
{
|
||||
code:'right',
|
||||
name:'',
|
||||
result:[
|
||||
{data:true, name:'左门', judge:'='},
|
||||
{data:false, name:'右门', judge:'='}
|
||||
]
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
|
@ -36,6 +36,7 @@
|
||||
<script>
|
||||
import DemonMenu from '@/views/newMap/displayNew/demonMenu';
|
||||
import { EventBus } from '@/scripts/event-bus';
|
||||
import {covertMemberData} from '@/views/newMap/displayNew/utils';
|
||||
import { timeFormat } from '@/utils/date';
|
||||
import { OperateMode } from '@/scripts/ConstDic';
|
||||
import { clearSimulation, getSimulationInfoNew } from '@/api/simulation';
|
||||
@ -74,6 +75,7 @@ export default {
|
||||
faultMode: false,
|
||||
viewDisabled: true,
|
||||
firstLoad:true,
|
||||
activeTrainList:[],
|
||||
isscriptRun:false // 剧本是否正在加载
|
||||
};
|
||||
},
|
||||
@ -191,98 +193,40 @@ export default {
|
||||
if (resp.code == 200) {
|
||||
if (resp.data.memberList && resp.data.memberList.length > 0) {
|
||||
this.$store.dispatch('training/setMemberList', {memberList:resp.data.memberList, userId:this.$store.state.user.id});
|
||||
// 以下待优化
|
||||
const memberList = this.$store.state.training.memberData;
|
||||
// if (data.id) {
|
||||
// memberList[data.id].userId = this.$store.state.user.id;
|
||||
// memberList[data.id].name = this.$store.state.user.nickname;
|
||||
// memberList[data.id].disabled = true;
|
||||
// }
|
||||
let lastData = JSON.stringify(memberList);
|
||||
const roleTypeList = ConstConfig.ConstSelect.roleTypeNew;
|
||||
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);
|
||||
if (this.$store.state.training.started) {
|
||||
this.activeTrainList = this.$store.state.map.activeTrainList;
|
||||
}
|
||||
});
|
||||
lastData = JSON.parse(lastData);
|
||||
lastData = Object.values(lastData);
|
||||
const lastMemberList = [];
|
||||
const dispatcherList = [];
|
||||
// const electricDispatcherList = [];
|
||||
// const depotDispatcherList = [];
|
||||
const stationSupervisorList = [];
|
||||
const driverList = [];
|
||||
const maintainerList = [];
|
||||
this.treeData = [];
|
||||
lastData.forEach((member, index)=>{
|
||||
if (!member.userId) {
|
||||
member.userId = '';
|
||||
member.disabled = false;
|
||||
} else {
|
||||
member.disabled = true;
|
||||
member.userName = this.$store.state.user.nickname;
|
||||
}
|
||||
if (member.type != '观众') {
|
||||
const userName = member.userName ? '-' + member.userName : '';
|
||||
const name = member.name == undefined ? '' : '-' + member.name;
|
||||
if (member.deviceCode) {
|
||||
const device = this.$store.getters['map/getDeviceByCode'](member.deviceCode);
|
||||
if (device) {
|
||||
if (device._type == 'Train') {
|
||||
member.deviceName = device.groupNumber;
|
||||
member.label = member.type + device.groupNumber + name + userName;
|
||||
lastMemberList.push(member);
|
||||
driverList.push(member);
|
||||
} else {
|
||||
member.deviceName = device.name;
|
||||
member.label = member.type + device.name + name + userName;
|
||||
lastMemberList.push(member);
|
||||
if (device._type == 'Station') {
|
||||
stationSupervisorList.push(member);
|
||||
}
|
||||
}
|
||||
} else {
|
||||
member.deviceName = member.deviceCode;
|
||||
member.label = member.type + member.deviceCode + name + userName;
|
||||
lastMemberList.push(member);
|
||||
}
|
||||
} else {
|
||||
member.label = member.type + name + userName;
|
||||
member.deviceName = '';
|
||||
if (member.type == '行调') {
|
||||
dispatcherList.push(member);
|
||||
} else if (member.type == '通号') {
|
||||
maintainerList.push(member);
|
||||
}
|
||||
lastMemberList.push(member);
|
||||
}
|
||||
}
|
||||
});
|
||||
const memberList = resp.data.memberList;
|
||||
// 获取仿真成员列表
|
||||
const result = covertMemberData(this.activeTrainList, memberList);
|
||||
this.driverList = result.driverList;
|
||||
const treeData = [{
|
||||
label: '行调',
|
||||
id: 'dispatcher',
|
||||
type: 'role',
|
||||
children: dispatcherList
|
||||
children: result.deviceListData[0]
|
||||
}, {
|
||||
label: '车站值班员',
|
||||
id: 'stationSupervisor',
|
||||
type: 'role',
|
||||
children: stationSupervisorList
|
||||
children: result.deviceListData[2]
|
||||
}, {
|
||||
label: '司机',
|
||||
id: 'driver',
|
||||
type: 'role',
|
||||
children: driverList
|
||||
children: result.deviceListData[3]
|
||||
}, {
|
||||
label: '通号',
|
||||
id: 'maintainer',
|
||||
type: 'role',
|
||||
children: maintainerList
|
||||
children: result.deviceListData[1]
|
||||
}, {
|
||||
label: '车辆段',
|
||||
id: 'depotDispatcher',
|
||||
type: 'role',
|
||||
children: result.deviceListData[4]
|
||||
}];
|
||||
const lastMemberList = result.lastMemberList;
|
||||
this.$emit('setTreeData', treeData);
|
||||
this.$emit('setMemberData', lastMemberList);
|
||||
}
|
||||
|
@ -27,9 +27,25 @@
|
||||
:offset-bottom="offsetBottom"
|
||||
/>
|
||||
|
||||
<script-chat ref="chatbox" :group="group" :user-role="userRole" />
|
||||
<script-chat
|
||||
ref="chatbox"
|
||||
:group="group"
|
||||
:user-role="userRole"
|
||||
:tree-data="treeData"
|
||||
:member-data="memberData"
|
||||
/>
|
||||
<set-time ref="setTime" @ConfirmSelectBeginTime="start" />
|
||||
<tip-script-record-new ref="tipTaskRecordNew" :group="group" :offset-bottom="offsetBottom" :offset="offset" />
|
||||
<tip-script-record-new
|
||||
ref="tipTaskRecordNew"
|
||||
:group="group"
|
||||
:offset-bottom="offsetBottom"
|
||||
:offset="offset"
|
||||
:tree-data="treeData"
|
||||
:member-list="memberData"
|
||||
@changeTreeData="changeTreeData"
|
||||
@addScriptMember="addScriptMember"
|
||||
@resetChat="resetChat"
|
||||
/>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
@ -43,7 +59,8 @@ import TipScriptRecordNew from '@/views/scriptManage/tipScriptRecord';
|
||||
import SetTime from '@/views/newMap/displayNew/demon/setTime';
|
||||
import { Notification } from 'element-ui';
|
||||
import { ranAsPlan, exitRunPlan } from '@/api/simulation';
|
||||
import { mapGetters } from 'vuex';
|
||||
import {covertMemberData} from '@/views/newMap/displayNew/utils';
|
||||
import { getSimulationMemberList} from '@/api/simulation';
|
||||
|
||||
export default {
|
||||
name: 'MenuScript',
|
||||
@ -85,7 +102,12 @@ export default {
|
||||
data() {
|
||||
return {
|
||||
isDisable: false,
|
||||
isScriptCommand:false
|
||||
isScriptCommand:false,
|
||||
driverList:[],
|
||||
treeData:[],
|
||||
memberData:[],
|
||||
activeTrainList:[],
|
||||
userRole:''
|
||||
};
|
||||
},
|
||||
|
||||
@ -93,17 +115,14 @@ export default {
|
||||
scriptId() {
|
||||
return this.$route.query.scriptId;
|
||||
},
|
||||
...mapGetters('map', [
|
||||
'trainList'
|
||||
]),
|
||||
group() {
|
||||
return this.$route.query.group;
|
||||
},
|
||||
userRole() {
|
||||
return this.$store.state.scriptRecord.userRole ? this.$store.state.scriptRecord.userRole : 'DISPATCHER';
|
||||
},
|
||||
// userRole() {
|
||||
// return this.$store.state.scriptRecord.userRole ? this.$store.state.scriptRecord.userRole : 'DISPATCHER';
|
||||
// },
|
||||
isDriver() {
|
||||
return this.$store.state.scriptRecord.userRole == 'DRIVER';
|
||||
return this.userRole == 'DRIVER';
|
||||
},
|
||||
isShowScheduling() {
|
||||
return this.$store.state.training.prdType == '05';
|
||||
@ -115,26 +134,108 @@ export default {
|
||||
watch: {
|
||||
'$store.state.scriptRecord.bgSet':function (val) {
|
||||
this.isScriptCommand = val;
|
||||
},
|
||||
// 按计划行车的列车列表更新(更新司机列表)
|
||||
'$store.state.map.activeTrainListChange': function (val) {
|
||||
// driverList
|
||||
const activeTrainList = this.$store.state.map.activeTrainList;
|
||||
if (this.driverList.length > 0) {
|
||||
const driverList = [];
|
||||
if (activeTrainList && activeTrainList.length) {
|
||||
activeTrainList.sort();
|
||||
activeTrainList.forEach(groupNumber => {
|
||||
const drivers = this.driverList.find(driver=>{
|
||||
return driver.deviceCode == groupNumber;
|
||||
});
|
||||
if (drivers) {
|
||||
driverList.push(drivers);
|
||||
this.memberData.push(drivers);
|
||||
}
|
||||
});
|
||||
}
|
||||
this.treeData[2].children = driverList;
|
||||
} else {
|
||||
this.activeTrainList = activeTrainList;
|
||||
}
|
||||
},
|
||||
'$store.state.map.mapViewLoadedCount': function (val) { // 地图视图加载完成标识
|
||||
getSimulationMemberList(this.group).then(resp => {
|
||||
this.$store.dispatch('training/setMemberList', {memberList:resp.data, userId:this.$store.state.user.id});
|
||||
this.driverList = [];
|
||||
this.treeData = [];
|
||||
if (this.$store.state.training.started) {
|
||||
this.activeTrainList = this.$store.state.map.activeTrainList;
|
||||
}
|
||||
// 获取仿真成员列表
|
||||
const result = covertMemberData(this.activeTrainList, resp.data);
|
||||
this.driverList = result.driverList;
|
||||
this.treeData = [{
|
||||
label: '行调',
|
||||
id: 'dispatcher',
|
||||
type: 'role',
|
||||
children: result.deviceListData[0]
|
||||
}, {
|
||||
label: '车站值班员',
|
||||
id: 'stationSupervisor',
|
||||
type: 'role',
|
||||
children: result.deviceListData[2]
|
||||
}, {
|
||||
label: '司机',
|
||||
id: 'driver',
|
||||
type: 'role',
|
||||
children: result.deviceListData[3]
|
||||
}, {
|
||||
label: '通号',
|
||||
id: 'maintainer',
|
||||
type: 'role',
|
||||
children: result.deviceListData[1]
|
||||
}, {
|
||||
label: '车辆段',
|
||||
id: 'depotDispatcher',
|
||||
type: 'role',
|
||||
children: result.deviceListData[4]
|
||||
}];
|
||||
this.memberData = result.lastMemberList;
|
||||
|
||||
// 设置当前角色
|
||||
const member = resp.data.find(mem=>{
|
||||
return mem.userId != '' && mem.userId != undefined;
|
||||
});
|
||||
if (member) {
|
||||
const memberType = ['STATION_SUPERVISOR', 'DISPATCHER', 'DRIVER', 'MAINTAINER', 'DEPOT_DISPATCHER'];
|
||||
const prdTypeList = ['01', '02', '04', '', ''];
|
||||
const index = memberType.indexOf(member.type);
|
||||
let prdType;
|
||||
if (index >= 0) {
|
||||
prdType = prdTypeList[index];
|
||||
}
|
||||
this.userRole = member.type;
|
||||
this.$store.dispatch('training/setRoles', member.type);
|
||||
this.$store.dispatch('scriptRecord/updateRole', member.type + ':' + member.id);
|
||||
this.$store.dispatch('training/setPrdType', prdType);
|
||||
}
|
||||
|
||||
}).catch(() => {
|
||||
this.$messageBox('获取仿真成员列表失败!');
|
||||
});
|
||||
}
|
||||
},
|
||||
beforeDestroy() {
|
||||
// this.clearAutoSave();
|
||||
this.$store.dispatch('training/setMemberList', {memberList:[], userId:this.$store.state.user.id});
|
||||
this.$store.dispatch('map/resetActiveTrainList', true);
|
||||
this.$store.dispatch('scriptRecord/updateBgSet', false);
|
||||
this.$store.dispatch('scriptRecord/updateRole', null);
|
||||
this.$store.dispatch('training/setRoles', null);
|
||||
},
|
||||
mounted() {
|
||||
// this.$store.state.training.prdType
|
||||
this.isScriptCommand = this.$store.state.scriptRecord.bgSet;
|
||||
// if (!this.isScriptCommand) {
|
||||
// this.$store.dispatch('training/setPrdType', '02');
|
||||
// }
|
||||
this.$store.dispatch('training/end', TrainingMode.NORMAL);
|
||||
this.$store.dispatch('training/setPrdType', '01');
|
||||
this.$nextTick(() => {
|
||||
this.$refs.demonMenu.menuClick();
|
||||
});
|
||||
},
|
||||
methods: {
|
||||
initPlannedDriving(isDisable) {
|
||||
this.isDisable = isDisable;
|
||||
},
|
||||
selectBeginTime() {
|
||||
this.$refs.setTime.doShow();
|
||||
},
|
||||
@ -196,6 +297,51 @@ export default {
|
||||
history.go(-1);
|
||||
Notification.closeAll();
|
||||
});
|
||||
},
|
||||
resetChat() {
|
||||
this.$refs.chatbox.resetCoversition();
|
||||
},
|
||||
changeTreeData({newRole, oldRole}) {
|
||||
const deviceTypeList = ['DISPATCHER', 'STATION_SUPERVISOR', 'DRIVER', 'MAINTAINER', 'DEPOT_DISPATCHER'];
|
||||
if (oldRole.id) {
|
||||
const oldIndex = deviceTypeList.indexOf(oldRole.type);
|
||||
if (oldIndex >= 0) {
|
||||
const oldTreeDataIn = this.treeData[oldIndex];
|
||||
oldTreeDataIn.children.map(device=>{
|
||||
if (device.id == oldRole.id) {
|
||||
device.userName = '';
|
||||
delete device.userId;
|
||||
device.disabled = false;
|
||||
device.label = device.type + (device.deviceName ? '- ' + device.deviceName : '') + (device.name ? device.name : '');
|
||||
}
|
||||
});
|
||||
this.treeData[oldIndex] = oldTreeDataIn;
|
||||
}
|
||||
}
|
||||
const newIndex = deviceTypeList.indexOf(newRole.type);
|
||||
if (newIndex >= 0) {
|
||||
const newTreeDataIn = this.treeData[newIndex];
|
||||
newTreeDataIn.children.map(device=>{
|
||||
if (device.id == newRole.id) {
|
||||
device.userName = this.$store.state.user.nickname;
|
||||
device.userId = this.$store.state.user.id;
|
||||
device.disabled = true;
|
||||
device.label = device.type + (device.deviceName ? '- ' + device.deviceName : '') + (device.name ? device.name : '') + '-' + device.userName;
|
||||
}
|
||||
});
|
||||
this.treeData[newIndex] = newTreeDataIn;
|
||||
}
|
||||
this.userRole = newRole.type;
|
||||
},
|
||||
addScriptMember(member) {
|
||||
this.memberData.push(member);
|
||||
const deviceTypeList = ['行调', '行值', '司机', '通号', '车辆段调度'];
|
||||
const index = deviceTypeList.indexOf(member.type);
|
||||
if (index >= 0) {
|
||||
const treeDataIn = this.treeData[index];
|
||||
treeDataIn.children.push(member);
|
||||
this.treeData[index] = treeDataIn;
|
||||
}
|
||||
}
|
||||
}
|
||||
};
|
||||
|
@ -15,9 +15,7 @@
|
||||
</template>
|
||||
<script>
|
||||
import ChatBox from '@/views/newMap/chatView/chatBox.vue';
|
||||
import {covertMemberData} from '@/views/newMap/displayNew/utils';
|
||||
import {getAllConversition} from '@/api/chat';
|
||||
import { getSimulationMemberList} from '@/api/simulation';
|
||||
export default {
|
||||
name:'ScriptChat',
|
||||
components:{
|
||||
@ -31,6 +29,14 @@ export default {
|
||||
userRole: {
|
||||
type: String,
|
||||
required: true
|
||||
},
|
||||
treeData:{
|
||||
type:Array,
|
||||
required:true
|
||||
},
|
||||
memberData:{
|
||||
type:Array,
|
||||
required:true
|
||||
}
|
||||
},
|
||||
data() {
|
||||
@ -38,15 +44,15 @@ export default {
|
||||
isHasCoversition:false,
|
||||
conversitionId:'',
|
||||
currentMemberList:[],
|
||||
memberData:{},
|
||||
// memberData:{},
|
||||
chatContentList:[],
|
||||
activeTrainList:[],
|
||||
isStartRecord:false,
|
||||
inviteUserName:'',
|
||||
inviteUser:{},
|
||||
isQuitShow:false,
|
||||
treeData:[],
|
||||
driverList:[]
|
||||
isQuitShow:false
|
||||
// treeData:[],
|
||||
// driverList:[]
|
||||
};
|
||||
},
|
||||
computed:{
|
||||
@ -57,80 +63,6 @@ export default {
|
||||
}
|
||||
},
|
||||
watch:{
|
||||
'$store.state.map.mapViewLoadedCount': function (val) { // 地图视图加载完成标识 开始获取仿真成员
|
||||
getSimulationMemberList(this.group).then(resp => {
|
||||
this.driverList = [];
|
||||
this.treeData = [];
|
||||
const result = covertMemberData(this.activeTrainList, resp);
|
||||
this.driverList = result.driverList;
|
||||
this.treeData = [{
|
||||
label: '行调',
|
||||
id: 'dispatcher',
|
||||
type: 'role',
|
||||
children: result.deviceListData[0]
|
||||
}, {
|
||||
label: '车站值班员',
|
||||
id: 'stationSupervisor',
|
||||
type: 'role',
|
||||
children: result.deviceListData[2]
|
||||
}, {
|
||||
label: '司机',
|
||||
id: 'driver',
|
||||
type: 'role',
|
||||
children: result.deviceListData[3]
|
||||
}, {
|
||||
label: '通号',
|
||||
id: 'maintainer',
|
||||
type: 'role',
|
||||
children: result.deviceListData[1]
|
||||
}, {
|
||||
label: '车辆段',
|
||||
id: 'depotDispatcher',
|
||||
type: 'role',
|
||||
children: result.deviceListData[4]
|
||||
}];
|
||||
this.memberData = result.lastMemberList;
|
||||
}).catch(() => {
|
||||
this.$messageBox('获取仿真成员列表失败!');
|
||||
});
|
||||
},
|
||||
'$store.state.training.addMemberInScript':function(val, oldval) {
|
||||
this.memberData.push(val);
|
||||
const roleList = ['行调', '车站值班员', '司机', '通号', '车辆段'];
|
||||
const roleIndex = roleList.indexOf(val.type);
|
||||
if (roleIndex >= 0) {
|
||||
this.treeData[roleIndex].children.push(val);
|
||||
}
|
||||
},
|
||||
'userRole':function(val, oldval) {
|
||||
// 切换对象
|
||||
this.changeRole(oldval, val);
|
||||
},
|
||||
'$store.state.scriptRecord.updateRoleStatus':function(val) {
|
||||
// 切换对象
|
||||
this.changeRole(this.$store.state.scriptRecord.userRole, this.$store.state.scriptRecord.userRole);
|
||||
},
|
||||
// 按计划行车的列车列表更新(更新司机列表)
|
||||
'$store.state.map.activeTrainListChange': function (val) {
|
||||
const activeTrainList = this.$store.state.map.activeTrainList;
|
||||
if (this.driverList.length > 0) {
|
||||
const driverList = [];
|
||||
if (activeTrainList && activeTrainList.length) {
|
||||
activeTrainList.sort();
|
||||
activeTrainList.forEach(groupNumber => {
|
||||
const drivers = this.driverList.find(driver=>{
|
||||
return driver.deviceCode == groupNumber;
|
||||
});
|
||||
if (drivers) {
|
||||
driverList.push(drivers);
|
||||
}
|
||||
});
|
||||
}
|
||||
this.treeData[2].children = driverList;
|
||||
} else {
|
||||
this.activeTrainList = activeTrainList;
|
||||
}
|
||||
},
|
||||
// 创建会话
|
||||
'$store.state.socket.createConversition':function(val) {
|
||||
if (this.memberData.length > 0) {
|
||||
@ -214,31 +146,6 @@ export default {
|
||||
this.inviteUser = {};
|
||||
this.isQuitShow = false;
|
||||
},
|
||||
changeRole(oldval, val) {
|
||||
const userList = ['DISPATCHER', 'STATION_SUPERVISOR', 'DRIVER', 'MAINTAINER', 'DEPOT_DISPATCHER'];
|
||||
// 切换对象 待优化
|
||||
this.getAllConversition();
|
||||
const oldIndex = userList.indexOf(oldval);
|
||||
if (oldIndex >= 0) {
|
||||
this.treeData[oldIndex].children.forEach(child=>{
|
||||
if (child.userId) {
|
||||
child.userId = '';
|
||||
child.disabled = false;
|
||||
child.label = child.type + (child.deviceName ? child.deviceName : '');
|
||||
}
|
||||
});
|
||||
}
|
||||
const index = userList.indexOf(val);
|
||||
if (index >= 0) {
|
||||
this.treeData[index].children.forEach(child=>{
|
||||
if (child.id == this.$store.state.scriptRecord.updateRoleId) {
|
||||
child.userId = this.$store.state.user.id;
|
||||
child.disabled = true;
|
||||
child.label = child.label + '-' + this.$store.state.user.nickname;
|
||||
}
|
||||
});
|
||||
}
|
||||
},
|
||||
getAllConversition() {
|
||||
// 获取会话列表
|
||||
getAllConversition(this.$route.query.group).then(resp=>{
|
||||
|
@ -2,7 +2,7 @@ import ConstConfig from '@/scripts/ConstConfig';
|
||||
import Cookies from 'js-cookie';
|
||||
import store from '@/store/index_APP_TARGET';
|
||||
export function covertMemberData (activeTrainList, resp) {
|
||||
let lastData = JSON.stringify(resp.data);
|
||||
let lastData = JSON.stringify(resp);
|
||||
const roleTypeList = ConstConfig.ConstSelect.roleTypeNew;
|
||||
roleTypeList.forEach(function(element) {
|
||||
const rolename = element.value;
|
||||
@ -18,25 +18,26 @@ export function covertMemberData (activeTrainList, resp) {
|
||||
const deviceListData = [[], [], [], [], []];
|
||||
const driverList = [];
|
||||
lastData.forEach((member, index)=>{
|
||||
if (!member.userId) {
|
||||
member.disabled = false;
|
||||
} else {
|
||||
if (member.userId && member.userId == store.state.user.id) {
|
||||
member.disabled = true;
|
||||
member.userName = store.state.user.nickname;
|
||||
store.dispatch('training/setOrignalUserRoleId', member.id);
|
||||
} else {
|
||||
member.disabled = false;
|
||||
}
|
||||
const userName = member.userName ? '-' + member.userName : '';
|
||||
const name = member.name ? '-' + member.name : '';
|
||||
if (member.deviceCode) {
|
||||
const device = store.getters['map/getDeviceByCode'](member.deviceCode);
|
||||
const deviceName = device.name || device.groupNumber;
|
||||
member.deviceName = deviceName;
|
||||
member.label = member.type + deviceName + name + userName;
|
||||
member.deviceName = device.name || device.groupNumber;
|
||||
member.label = member.type + member.deviceName + name + userName;
|
||||
member.normalName = member.type + member.deviceName + name;
|
||||
} else {
|
||||
member.deviceName = '';
|
||||
member.label = member.type + name + userName;
|
||||
member.normalName = member.type + name;
|
||||
}
|
||||
lastMemberList.push(member);
|
||||
|
||||
const deviceType = ['行调', '通号', '行值', '司机', '车辆段调度'];
|
||||
const deviceTypeIndex = deviceType.indexOf(member.type);
|
||||
if (deviceTypeIndex >= 0) {
|
||||
@ -44,12 +45,13 @@ export function covertMemberData (activeTrainList, resp) {
|
||||
if (activeTrainList.length > 0) {
|
||||
if (activeTrainList.includes(member.deviceCode)) {
|
||||
deviceListData[deviceTypeIndex].push(member);
|
||||
lastMemberList.push(member);
|
||||
}
|
||||
}
|
||||
} else {
|
||||
driverList.push(member);
|
||||
}
|
||||
} else {
|
||||
deviceListData[deviceTypeIndex].push(member);
|
||||
lastMemberList.push(member);
|
||||
}
|
||||
}
|
||||
});
|
||||
|
@ -355,7 +355,7 @@ export default {
|
||||
async simulationReset() {
|
||||
await this.$store.dispatch('map/clearJlmapTrainView');
|
||||
await this.$store.dispatch('map/setTrainWindowShow', false);
|
||||
// await this.$store.dispatch('training/over');
|
||||
await this.$store.dispatch('map/resetActiveTrainList');
|
||||
await this.$store.dispatch('socket/setSimulationReset'); // 清空
|
||||
await this.$store.dispatch('socket/setSimulationStart');
|
||||
await this.$store.dispatch('training/setMapDefaultState');
|
||||
@ -392,7 +392,6 @@ export default {
|
||||
},
|
||||
// 设置地图加载状态
|
||||
mapViewLoaded(loading) {
|
||||
// console.log(loading, '**************');
|
||||
this.loading = loading;
|
||||
if (loading) {
|
||||
this.$refs.progressBar && this.$refs.progressBar.start();
|
||||
|
@ -59,11 +59,7 @@ export default {
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
initData(row) {
|
||||
|
||||
},
|
||||
doShow(row) {
|
||||
this.initData(row);
|
||||
this.dialogVisible = true;
|
||||
},
|
||||
doSave() {
|
||||
@ -71,9 +67,9 @@ export default {
|
||||
if (valid) {
|
||||
this.lodaing = true;
|
||||
addSimulationMember(this.formModel, this.$route.query.group).then((res) => {
|
||||
this.lodaing = false;
|
||||
this.$message.success('添加仿真角色成员成功!');
|
||||
this.$emit('addScriptMember', res.data);
|
||||
this.lodaing = false;
|
||||
this.handleClose();
|
||||
}).catch(() => {
|
||||
this.lodaing = false;
|
||||
|
@ -8,7 +8,7 @@
|
||||
</div>
|
||||
<el-tree
|
||||
ref="tree"
|
||||
:data="covertMemberList"
|
||||
:data="treeData"
|
||||
:props="defaultProps"
|
||||
node-key="id"
|
||||
default-expand-all
|
||||
@ -16,24 +16,28 @@
|
||||
style="margin: 10px;overflow-y:auto;height:255px;margin-right: 0;"
|
||||
>
|
||||
<span :id="data.id" slot-scope="{ node, data }" style="width:100%">
|
||||
<span v-if="data.children">
|
||||
<span style="font-size: 14px">{{ data.label }}</span>
|
||||
</span>
|
||||
<span v-else>
|
||||
<span style="font-size: 14px">{{ data.normalName }}</span>
|
||||
<span v-if="data.type!='role'" class="setGroup">
|
||||
<span v-if="data.id!=memberId" class="settingBtn" @click="changeRole(data)">设置</span>
|
||||
<span v-if="!data.disabled" class="settingBtn" @click="changeRole(data)">设置</span>
|
||||
<span v-else class="hasSetted">已设置</span>
|
||||
</span>
|
||||
</span>
|
||||
|
||||
</span>
|
||||
</el-tree>
|
||||
</div>
|
||||
</template>
|
||||
<script>
|
||||
import { getToken } from '@/utils/auth';
|
||||
import ConstConfig from '@/scripts/ConstConfig';
|
||||
|
||||
import {changeScriptRole} from '@/api/script';
|
||||
export default {
|
||||
name:'AllScriptRole',
|
||||
props:{
|
||||
memberList:{
|
||||
treeData:{
|
||||
type: Array,
|
||||
default() {
|
||||
return [];
|
||||
@ -54,8 +58,8 @@ export default {
|
||||
return {
|
||||
covertMemberList:[],
|
||||
driverList:[],
|
||||
oldMember:{id:null, type:''},
|
||||
queryMember:'',
|
||||
oldMemberId:'',
|
||||
defaultProps: {
|
||||
children: 'children',
|
||||
label: 'label'
|
||||
@ -63,117 +67,51 @@ export default {
|
||||
};
|
||||
},
|
||||
watch:{
|
||||
'memberList':function(val) {
|
||||
if (val && val.length > 0) {
|
||||
this.covertMember();
|
||||
}
|
||||
},
|
||||
queryMember(val) {
|
||||
if (this.$refs.tree) {
|
||||
this.$refs.tree.filter(val);
|
||||
}
|
||||
},
|
||||
'treeData':function(val) {
|
||||
const roleName = this.$store.state.scriptRecord.userRole;
|
||||
this.oldMember = {id:this.memberId, type:roleName};
|
||||
}
|
||||
},
|
||||
methods:{
|
||||
filterNode(value, data) {
|
||||
return data.label.indexOf(value) !== -1;
|
||||
},
|
||||
covertMember() {
|
||||
// if (this.covertMemberList.length > 0) {
|
||||
// this.setMemmberList(this.driverList, this.memberList[0].children, this.memberList[1].children, this.memberList[3].children);
|
||||
// } else {
|
||||
const dispatcherList = [];
|
||||
// const electricDispatcherList = [];
|
||||
// const depotDispatcherList = [];
|
||||
const stationSupervisorList = [];
|
||||
const driverList = [];
|
||||
const maintainerList = [];
|
||||
this.memberList.forEach((member, index)=>{
|
||||
if (member.type != '观众') {
|
||||
if (member.deviceCode) {
|
||||
const device = this.$store.getters['map/getDeviceByCode'](member.deviceCode);
|
||||
if (device) {
|
||||
if (device._type == 'Train') {
|
||||
driverList.push(member);
|
||||
} else {
|
||||
if (device._type == 'Station') {
|
||||
stationSupervisorList.push(member);
|
||||
}
|
||||
}
|
||||
}
|
||||
} else {
|
||||
if (member.type == '行调') {
|
||||
dispatcherList.push(member);
|
||||
} else if (member.type == '通号') {
|
||||
maintainerList.push(member);
|
||||
}
|
||||
}
|
||||
}
|
||||
});
|
||||
this.driverList = driverList;
|
||||
this.setMemmberList(driverList, dispatcherList, stationSupervisorList, maintainerList);
|
||||
// }
|
||||
},
|
||||
setMemmberList(driverList, dispatcherList, stationSupervisorList, maintainerList) {
|
||||
this.oldMemberId = this.memberId;
|
||||
// if (this.$store.state.training.started) {
|
||||
// const activeList = this.$store.state.map.activeTrainList;
|
||||
// driverList = driverList.filter(driver=>{
|
||||
// return activeList.length > 0 && activeList.includes(driver.deviceCode);
|
||||
// });
|
||||
|
||||
// } else {
|
||||
// driverList = [];
|
||||
// }
|
||||
this.covertMemberList = [{
|
||||
label: '行调',
|
||||
id: 'dispatcher',
|
||||
type: 'role',
|
||||
children: dispatcherList
|
||||
}, {
|
||||
label: '车站值班员',
|
||||
id: 'stationSupervisor',
|
||||
type: 'role',
|
||||
children: stationSupervisorList
|
||||
}, {
|
||||
label: '司机',
|
||||
id: 'driver',
|
||||
type: 'role',
|
||||
children: driverList
|
||||
}, {
|
||||
label: '通号',
|
||||
id: 'maintainer',
|
||||
type: 'role',
|
||||
children: maintainerList
|
||||
}];
|
||||
},
|
||||
changeRole(member) {
|
||||
if (member) {
|
||||
// this.$store.dispatch('scriptRecord/updateIsScriptCommand', true);
|
||||
this.switchMode(member);
|
||||
}
|
||||
},
|
||||
addMember() {
|
||||
this.$emit('addMember');
|
||||
},
|
||||
switchMode(role) {
|
||||
changeScriptRole(this.group, role.id).then(res=>{
|
||||
switchMode(member) {
|
||||
changeScriptRole(this.group, member.id).then(res=>{
|
||||
let prdType = '';
|
||||
if (this.openWindow) {
|
||||
this.openWindow.close();
|
||||
}
|
||||
const role = Object.assign({}, member);
|
||||
if (role.type == '行值') {
|
||||
prdType = '01';
|
||||
role.type = 'STATION_SUPERVISOR';
|
||||
this.$store.dispatch('training/setRoles', 'STATION_SUPERVISOR');
|
||||
this.$store.dispatch('training/setRoleDeviceCode', role.deviceCode);
|
||||
} else if (role.type == '行调') {
|
||||
prdType = '02';
|
||||
role.type = 'DISPATCHER';
|
||||
this.$store.dispatch('training/setRoles', 'DISPATCHER');
|
||||
} else if (role.type == '司机') {
|
||||
prdType = '04';
|
||||
role.type = 'DRIVER';
|
||||
this.$store.dispatch('training/setRoles', 'DRIVER');
|
||||
} else if (role.type == '通号') {
|
||||
prdType = '';
|
||||
role.type = 'MAINTAINER';
|
||||
this.$store.dispatch('training/setRoles', 'MAINTAINER');
|
||||
const routeData = this.$router.resolve({
|
||||
path:'/jlmap3d/maintainer',
|
||||
@ -186,25 +124,25 @@ export default {
|
||||
}
|
||||
});
|
||||
this.openWindow = window.open(routeData.href);
|
||||
} else if (role.type == '车辆段') {
|
||||
prdType = '05';
|
||||
role.type = 'DEPOT_DISPATCHER';
|
||||
this.$store.dispatch('training/setRoles', 'DEPOT_DISPATCHER');
|
||||
} else {
|
||||
prdType = '';
|
||||
}
|
||||
this.$store.dispatch('training/updateMemberListInScript',
|
||||
{
|
||||
oldMemberId:this.oldMemberId,
|
||||
oldMemberId:this.oldMember.id,
|
||||
newMemberId:role.id,
|
||||
userId:this.$store.state.user.id,
|
||||
name:this.$store.state.user.nickname
|
||||
}
|
||||
);
|
||||
this.oldMemberId = role.id;
|
||||
this.$store.dispatch('training/setPrdType', prdType);
|
||||
ConstConfig.ConstSelect.roleTypeNew.forEach(each=>{
|
||||
if (each.label == role.type) {
|
||||
this.$store.dispatch('scriptRecord/updateRole', each.value + ':' + role.id);
|
||||
}
|
||||
});
|
||||
this.$emit('setMemberId', role);
|
||||
this.$store.dispatch('scriptRecord/updateRole', role.type + ':' + role.id);
|
||||
this.$emit('setMemberId', {newRole:role, oldRole:this.oldMember});
|
||||
this.oldMember = {id:role.id, type:role.type};
|
||||
this.$message('切换角色成功');
|
||||
// this.$refs.changeScriptRole.blur();
|
||||
}).catch(()=>{
|
||||
|
@ -86,12 +86,6 @@ export default {
|
||||
memberName: ''
|
||||
};
|
||||
},
|
||||
computed:{
|
||||
// drawWay() {
|
||||
// const drawWay = this.$route.query.drawWay;
|
||||
// return drawWay && JSON.parse(drawWay);
|
||||
// }
|
||||
},
|
||||
watch: {
|
||||
actionInfoList: function(val) {
|
||||
this.$nextTick(function() {
|
||||
@ -114,7 +108,7 @@ export default {
|
||||
},
|
||||
covertData(memberList, element) {
|
||||
const member = memberList.find(elem=>{ return elem.id == element.memberId; });
|
||||
const memberName = member.name;
|
||||
const memberName = member.type + member.deviceName + (member.name ? member.name : '');
|
||||
switch (element.type) {
|
||||
case 'Start_Conversation': {
|
||||
// isStartCoversition
|
||||
@ -122,7 +116,7 @@ export default {
|
||||
element.conversationMemberIds.forEach(id=>{
|
||||
if (member.id != id) {
|
||||
const userName = memberList.find(elem=>{ return elem.id == id; });
|
||||
targetNameList.push(userName.name);
|
||||
targetNameList.push(userName.type + userName.deviceName + (userName.name ? userName.name : ''));
|
||||
}
|
||||
});
|
||||
this.actionInfoList.push({id: element.id, isStartCoversition: true, memberName: memberName, targetName:targetNameList.toString() });
|
||||
|
@ -14,11 +14,11 @@
|
||||
<div class="quickChange">
|
||||
<!-- <div class="quickChange_head">快捷切换</div> -->
|
||||
<div class="quickChangeList" style="margin:10px 0px 10px 0px;overflow-y:auto;height:200px;">
|
||||
<div v-for="member in quickChangeMember" :key="member.id" class="setGroupOut">
|
||||
<span style="font-size: 14px">{{ member.label }}</span>
|
||||
<div v-for="member in quickChangeMember.list" :key="member.id" class="setGroupOut">
|
||||
<span style="font-size: 14px">{{ member.normalName }}</span>
|
||||
<span class="setGroup">
|
||||
<span v-if="member.id!=memberId" class="settingBtn" @click="changeRole(member)">设置</span>
|
||||
<span v-else class="hasSetted">已设置</span>
|
||||
<span v-if="member.userId" class="hasSetted">已设置</span>
|
||||
<span v-else class="settingBtn" @click="changeRole(member)">设置</span>
|
||||
</span>
|
||||
</div>
|
||||
</div>
|
||||
@ -39,7 +39,14 @@
|
||||
</el-tab-pane>
|
||||
<el-tab-pane label="所有成员">
|
||||
<div class="eachScriptPanel">
|
||||
<all-script-role ref="allScriptRole" :member-list="memberList" :member-id="memberId" :group="group" @setMemberId="setMemberId" @addMember="addMember" />
|
||||
<all-script-role
|
||||
ref="allScriptRole"
|
||||
:member-id="memberId"
|
||||
:tree-data="treeData"
|
||||
:group="group"
|
||||
@setMemberId="setMemberId"
|
||||
@addMember="addMember"
|
||||
/>
|
||||
</div>
|
||||
</el-tab-pane>
|
||||
</el-tabs>
|
||||
@ -54,7 +61,8 @@
|
||||
<script>
|
||||
import Vue from 'vue';
|
||||
import GetActionNew from './getAction';
|
||||
import {getSimulationMemberList, executeScriptNew, dumpScriptDataNew, saveScriptDataNew, saveScriptScenesNew, updateMapLocationNew, simulationPause} from '@/api/simulation';
|
||||
// getSimulationMemberList
|
||||
import {executeScriptNew, dumpScriptDataNew, saveScriptDataNew, saveScriptScenesNew, updateMapLocationNew, simulationPause} from '@/api/simulation';
|
||||
import ConstConfig from '@/scripts/ConstConfig';
|
||||
import {getDraftScriptByGroupNew, getAllSelectedScriptRole } from '@/api/script';
|
||||
import AddScriptMember from './addScriptMember';
|
||||
@ -80,11 +88,20 @@ export default {
|
||||
offset:{
|
||||
type: Number,
|
||||
required: true
|
||||
},
|
||||
treeData:{
|
||||
type:Array,
|
||||
required: true
|
||||
},
|
||||
memberList:{
|
||||
type:Array,
|
||||
required: true
|
||||
}
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
isShow:true,
|
||||
isFirst:true,
|
||||
language:'',
|
||||
isPause:false,
|
||||
executeDisabled: false,
|
||||
@ -92,11 +109,7 @@ export default {
|
||||
autoSaveScript: null,
|
||||
isSavingScript: false,
|
||||
mapLocation:null,
|
||||
memberId:'',
|
||||
oldMemberId:'',
|
||||
allMemberList:[],
|
||||
memberList:[],
|
||||
quickChangeMember:[],
|
||||
quickChangeMember:{list:[]},
|
||||
size: {
|
||||
width: 300,
|
||||
height: 300
|
||||
@ -104,6 +117,14 @@ export default {
|
||||
openWindow:null
|
||||
};
|
||||
},
|
||||
computed:{
|
||||
memberId() {
|
||||
return this.$store.state.scriptRecord.updateRoleId;
|
||||
},
|
||||
orignalUserRoleId() {
|
||||
return this.$store.state.training.orignalUserRoleId;
|
||||
}
|
||||
},
|
||||
watch:{
|
||||
'$store.state.map.mapViewLoadedCount': function (val) {
|
||||
Vue.prototype.$jlmap.setOptions(this.$store.state.scriptRecord.mapLocation);
|
||||
@ -112,10 +133,6 @@ export default {
|
||||
const newMapLocation = {'offsetX': this.mapLocation.x, 'offsetY': this.mapLocation.y, 'scaleRate': this.mapLocation.scale};
|
||||
Vue.prototype.$jlmap.setOptions(newMapLocation);
|
||||
}
|
||||
// if (this.$store.state.scriptRecord.bgSet) {
|
||||
// this.$store.dispatch('training/setPrdType', null);
|
||||
// }
|
||||
this.initData();
|
||||
},
|
||||
'$store.state.scriptRecord.bgSet': function (val) {
|
||||
this.backDisabled = val;
|
||||
@ -123,16 +140,12 @@ export default {
|
||||
'$store.state.scriptRecord.simulationPause': function(val) {
|
||||
this.isPause = !(this.$store.state.scriptRecord.simulationPause);
|
||||
},
|
||||
'$store.state.map.activeTrainListChange':function (val) {
|
||||
this.changeRunPlanStatus();
|
||||
'memberList':function(val) {
|
||||
if (this.isFirst) {
|
||||
this.isFirst = false;
|
||||
this.initData();
|
||||
}
|
||||
}
|
||||
},
|
||||
beforeDestroy() {
|
||||
// this.clearAutoSave();
|
||||
this.$store.dispatch('training/setMemberList', {memberList:[], userId:this.$store.state.user.id});
|
||||
this.$store.dispatch('map/resetActiveTrainList', true);
|
||||
this.$store.dispatch('scriptRecord/updateBgSet', false);
|
||||
this.$store.dispatch('scriptRecord/updateRole', null);
|
||||
},
|
||||
mounted() {
|
||||
this.language = this.$route.query.lang == 'en' ? this.$t('scriptRecord.english') : this.$t('scriptRecord.chinese');
|
||||
@ -144,27 +157,13 @@ export default {
|
||||
},
|
||||
methods:{
|
||||
initData() {
|
||||
getSimulationMemberList(this.group).then(resp => {
|
||||
const lastData = JSON.stringify(resp.data);
|
||||
this.$store.dispatch('training/setMemberList', {memberList:resp.data, userId:this.$store.state.user.id});
|
||||
this.allMemberList = this.covert(lastData, ConstConfig.ConstSelect.roleTypeNew);
|
||||
this.changeRunPlanStatus();
|
||||
const member = this.memberList.find(mem=>{
|
||||
return mem.type == '行调';
|
||||
});
|
||||
if (member) {
|
||||
this.memberId = member.id;
|
||||
this.oldMemberId = member.id;
|
||||
}
|
||||
this.$store.dispatch('training/setPrdType', '02');
|
||||
this.$store.dispatch('training/setRoles', 'DISPATCHER');
|
||||
this.$store.dispatch('scriptRecord/updateRole', 'DISPATCHER' + ':' + this.memberId);
|
||||
getAllSelectedScriptRole(this.group).then(res=>{
|
||||
const lastData = JSON.stringify(res.data);
|
||||
this.quickChangeMember = this.covert(lastData, ConstConfig.ConstSelect.roleTypeNew);
|
||||
res.data.forEach(each=>{
|
||||
const eachMember = this.memberList.find(member=>{ return member.id == each.id; });
|
||||
if (eachMember) {
|
||||
this.quickChangeMember.list.push(eachMember);
|
||||
}
|
||||
});
|
||||
}).catch(error => {
|
||||
this.$message(error.message);
|
||||
});
|
||||
},
|
||||
addScriptMember(member) {
|
||||
@ -172,39 +171,28 @@ export default {
|
||||
member.disabled = false;
|
||||
const lastData = JSON.stringify([member]);
|
||||
const covertmember = this.covert(lastData, ConstConfig.ConstSelect.roleTypeNew);
|
||||
covertmember.forEach(each=>{
|
||||
this.memberList.push(each);
|
||||
this.$store.dispatch('training/addMemberListInScript', each);
|
||||
});
|
||||
|
||||
this.$emit('addScriptMember', covertmember[0]);
|
||||
},
|
||||
setMemberId(member) {
|
||||
this.memberId = member.id;
|
||||
const memberdata = this.quickChangeMember.find(mem=>{ return mem.id == member.id; });
|
||||
if (!memberdata) { this.quickChangeMember.push(member); }
|
||||
setMemberId({newRole, oldRole}) {
|
||||
this.$emit('changeTreeData', {newRole:newRole, oldRole:oldRole});
|
||||
const quickChangeMember = this.quickChangeMember.list;
|
||||
quickChangeMember.forEach((mem, index)=>{
|
||||
if (oldRole.id && mem.id == oldRole.id) {
|
||||
delete mem.userId;
|
||||
}
|
||||
if (newRole.id == mem.id) {
|
||||
mem.userId = this.$store.state.user.id;
|
||||
}
|
||||
});
|
||||
this.quickChangeMember = {list:quickChangeMember};
|
||||
const memberdata = this.quickChangeMember.list.find(mem=>{ return mem.id == newRole.id; });
|
||||
if (!memberdata) {
|
||||
newRole.userId = this.$store.state.user.id; this.quickChangeMember.list.push(newRole);
|
||||
}
|
||||
},
|
||||
addMember() {
|
||||
this.$refs.addScriptMember.doShow();
|
||||
},
|
||||
changeRunPlanStatus() {
|
||||
this.memberList = [];
|
||||
if (this.$store.state.training.started) {
|
||||
const activeList = this.$store.state.map.activeTrainList;
|
||||
this.allMemberList.forEach(allmember=>{
|
||||
if (allmember.type == '司机') {
|
||||
if (activeList.length > 0 && activeList.includes(allmember.deviceCode)) {
|
||||
this.memberList.push(allmember);
|
||||
}
|
||||
} else {
|
||||
this.memberList.push(allmember);
|
||||
}
|
||||
});
|
||||
} else {
|
||||
this.memberList = this.allMemberList.filter(member=>{
|
||||
return member.type != '司机';
|
||||
});
|
||||
}
|
||||
},
|
||||
changeRole(member) {
|
||||
this.$refs.allScriptRole.changeRole(member);
|
||||
},
|
||||
@ -213,7 +201,7 @@ export default {
|
||||
return member.id == memberId;
|
||||
});
|
||||
if (currentMember) {
|
||||
return currentMember.name;
|
||||
return currentMember.type + currentMember.deviceName + (currentMember.name ? currentMember.name : '');
|
||||
}
|
||||
return '';
|
||||
},
|
||||
@ -236,7 +224,6 @@ export default {
|
||||
});
|
||||
lastData = JSON.parse(lastData);
|
||||
lastData.forEach(each=>{
|
||||
// const name = each.name == undefined ? '' : '-' + each.name;
|
||||
let deviceName = '';
|
||||
if (each.deviceCode) {
|
||||
const device = this.$store.getters['map/getDeviceByCode'](each.deviceCode);
|
||||
@ -250,7 +237,8 @@ export default {
|
||||
deviceName = each.deviceCode;
|
||||
}
|
||||
}
|
||||
each.name = each.type + deviceName + (each.name ? '' + each.name : '');
|
||||
each.normalName = each.type + deviceName + (each.name ? '' + each.name : '');
|
||||
each.name = each.normalName;
|
||||
each.label = each.name;
|
||||
});
|
||||
return lastData;
|
||||
@ -338,21 +326,41 @@ export default {
|
||||
dumpScriptDataNew(group).then(resp => {
|
||||
this.$parent.resetBeginTime();
|
||||
this.$refs['getAction'].loadInitData();
|
||||
this.changeRunPlanStatus();
|
||||
this.$store.dispatch('training/setPrdType', '02');
|
||||
this.$store.dispatch('map/resetActiveTrainList');
|
||||
// this.changeRunPlanStatus();
|
||||
this.$store.dispatch('training/updateMemberListInScript',
|
||||
{
|
||||
oldMemberId:this.memberId,
|
||||
newMemberId:this.oldMemberId,
|
||||
newMemberId:this.orignalUserRoleId,
|
||||
userId:this.$store.state.user.id,
|
||||
name:this.$store.state.user.nickname
|
||||
}
|
||||
);
|
||||
const new_member = this.memberList.find(mem=>{ return mem.id == this.orignalUserRoleId; });
|
||||
const old_member = this.memberList.find(mem=>{ return mem.id == this.memberId; });
|
||||
if (new_member && old_member) {
|
||||
new_member.userId = this.$store.state.user.id;
|
||||
new_member.disabled = true;
|
||||
this.quickChangeMember.list = [new_member];
|
||||
const deviceList = ['行值', '行调', '司机', '通号', '车辆段'];
|
||||
const deviceType = ['STATION_SUPERVISOR', 'DISPATCHER', 'DRIVER', 'MAINTAINER', 'DEPOT_DISPATCHER'];
|
||||
const new_index = deviceList.indexOf(new_member.type);
|
||||
const old_index = deviceList.indexOf(old_member.type);
|
||||
let oldType, newType;
|
||||
if (new_index >= 0) {
|
||||
newType = deviceType[new_index];
|
||||
}
|
||||
if (old_index >= 0) {
|
||||
oldType = deviceType[old_index];
|
||||
}
|
||||
this.$emit('changeTreeData', {oldRole:{id:this.memberId, type:oldType }, newRole:{id:this.orignalUserRoleId, type:newType}});
|
||||
this.$emit('resetChat');
|
||||
}
|
||||
// this.initAutoSaveScript();
|
||||
this.$store.dispatch('scriptRecord/updateRole', 'DISPATCHER:' + this.oldMemberId);
|
||||
this.$store.dispatch('training/setPrdType', '02');
|
||||
this.$store.dispatch('map/resetActiveTrainList');
|
||||
this.$store.dispatch('scriptRecord/updateRole', new_member.type + ':' + this.orignalUserRoleId);
|
||||
this.$store.dispatch('scriptRecord/updateBgSet', false);
|
||||
this.memberId = this.oldMemberId;
|
||||
// this.memberId = this.orignalUserRoleId;
|
||||
this.$message.success(this.$t('scriptRecord.resetDataSuccess'));
|
||||
}).catch(() => {
|
||||
this.$messageBox(this.$t('scriptRecord.resetDataFail'));
|
||||
|
Loading…
Reference in New Issue
Block a user