增加IBP盘操作

This commit is contained in:
ival 2019-09-03 11:12:48 +08:00
parent 2e10b39892
commit d60c989405
8 changed files with 175 additions and 190 deletions

View File

@ -3,8 +3,8 @@ export function getBaseUrl() {
let BASE_API;
if (process.env.NODE_ENV === 'development') {
// BASE_API = 'https://joylink.club/jlcloud';
BASE_API = 'https://test.joylink.club/jlcloud';
// BASE_API = 'http://192.168.3.5:9000'; // 袁琪
// BASE_API = 'https://test.joylink.club/jlcloud';
BASE_API = 'http://192.168.3.5:9000'; // 袁琪
// BASE_API = 'http://192.168.3.6:9000'; // 旭强
// BASE_API = 'http://192.168.3.4:9000' // 琰培
} else {

View File

@ -137,8 +137,7 @@ export default {
'02': '02', // =>
'04': '02', // =>
'05': '' // => null
},
ibpShow: false
}
};
},
computed: {
@ -230,7 +229,7 @@ export default {
});
},
'$store.state.app.windowSizeCount': function() {
this.resize();
this.setWindowSize();
},
$route() {
this.$nextTick(() => {
@ -247,8 +246,8 @@ export default {
this.clearCheckLogin();
});
await this.setWindowSize();
await this.initLoadData();
await this.resize();
},
async beforeDestroy() {
await this.clearAllTimer();
@ -579,7 +578,7 @@ export default {
faultChooseShow() {
this.$refs.faultChoose.doShow();
},
resize() {
setWindowSize() {
this.$nextTick(() => {
const width = this.size ? this.size.width : this.width;
const height = this.size ? this.size.height : this.height;

View File

@ -76,9 +76,6 @@ export default {
};
},
computed: {
isShowIbp() {
return this.$route.query.prdType == '06';
},
isShowQuest() {
return this.questId;
},

View File

@ -11,22 +11,7 @@
:default-expanded-keys="keyIdList"
@node-click="chatClick"
@node-contextmenu="showContextMenu"
>
<!-- <span slot-scope="{ node, data }">
<div style="height: 20px;" v-show="data.show">
<el-badge is-dot class="item-point">
<span style="font-size: 14px; color: #606266; cursor: pointer;">
{{ formatName(data) }}
</span>
</el-badge>
</div>
<div v-show="!data.show">
<span style="font-size: 14px; color: #606266; cursor: pointer;">
{{ formatName(data) }}
</span>
</div>
</span> -->
</el-tree>
/>
</el-scrollbar>
</div>
<operate-menu
@ -41,29 +26,29 @@
</template>
<script>
import Vue from 'vue';
import ChartWindow from './chatWindow';
import DrapLeft from '@/views/components/drapLeft/index';
import OperateMenu from './menuDraft/operateMenu';
import ModelType from '@/jmap/constant/deviceType';
import { mapGetters } from 'vuex';
import { DeviceMenu } from '@/scripts/ConstDic';
import { getHistoryVoice, getJointTrainRoomUserList, getUserRoles, putUserRoles } from '@/api/chat';
import { getJointTrainRoomUserList, getUserRoles } from '@/api/chat';
import { EventBus } from '@/scripts/event-bus';
export default {
name: 'ChartView',
components: {
ChartWindow,
DrapLeft,
OperateMenu
},
props: {
group: {
type: String
type: String,
required: true
},
stationList: {
type: Array
type: Array,
default() {
return [];
}
}
},
data() {
@ -371,57 +356,57 @@ export default {
},
hintInfo(data) {
switch (data.member.role) {
case '01': {
case '01':
this.treeData[0].show = true;
this.treeData[0].children.forEach(nor => {
if (nor.id == data.member.id) {
nor.show = true;
}
});
} break;
case '02': {
break;
case '02':
this.treeData[1].show = true;
this.treeData[1].children.forEach(nor => {
if (nor.id == data.member.id) {
nor.show = true;
}
});
} break;
case '03': {
break;
case '03':
this.treeData[2].show = true;
this.treeData[2].children.forEach(nor => {
if (nor.id == data.member.id) {
nor.show = true;
}
});
} break;
case '04': {
break;
case '04':
this.treeData[3].show = true;
this.treeData[3].children.forEach(nor => {
if (nor.id == data.member.id) {
nor.show = true;
}
});
} break;
case '05': {
break;
case '05':
this.treeData[4].show = true;
} break;
case '06': {
break;
case '06':
this.treeData[4].show = true;
this.treeData[4].children.forEach(nor => {
if (nor.driver && nor.driver.id == data.member.id) {
nor.show = true;
}
});
} break;
case '07': {
break;
case '07':
this.treeData[5].show = true;
this.treeData[5].children.forEach(nor => {
if (nor.id == data.member.id) {
nor.show = true;
}
});
} break;
break;
}
this.messageList.push(data);
}

View File

@ -138,10 +138,7 @@ export default {
}
},
'$store.state.app.windowSizeCount': function() {
this.$nextTick(() => {
this.$store.dispatch('config/resize', { width: this.width, height: this.height });
this.$store.dispatch('training/updateOffsetStationCode', { offsetStationCode: this.offsetStationCode });
});
this.setWindowSize();
},
$route() {
this.$nextTick(() => {
@ -155,6 +152,7 @@ export default {
this.skinCode = this.$route.query.skinCode;
},
async mounted() {
await this.setWindowSize();
await this.initLoadData();
},
async beforeDestroy() {
@ -296,7 +294,7 @@ export default {
// 01 02 ''
const resp = await this.getUserRole();
if (resp && resp.code == 200) {
// Admin Instructor Dispatcher Attendant Audience Driver Repair
// Admin Instructor Dispatcher Attendant Audience Driver Repair IBP:IBP
this.userRole = resp.data.userRole;
switch (this.userRole) {
case 'Admin': this.$store.dispatch('training/setPrdType', '02'); this.$store.dispatch('training/setRoles', 'Admin'); break;
@ -306,6 +304,7 @@ export default {
case 'Audience': this.$store.dispatch('training/setPrdType', ''); this.$store.dispatch('training/setRoles', 'Audience'); break;
case 'Driver': this.$store.dispatch('training/setPrdType', ''); this.$store.dispatch('training/setRoles', 'Driver'); break;
case 'Repair': this.$store.dispatch('training/setPrdType', ''); this.$store.dispatch('training/setRoles', 'Repair'); break;
case 'IBP': this.$store.dispatch('training/setPrdType', ''); this.$store.dispatch('training/setRoles', 'IBP'); break;
}
}
await this.getTrainDetail(this.skinCode);
@ -362,6 +361,12 @@ export default {
message: message,
type: type
});
},
setWindowSize() {
this.$nextTick(() => {
this.$store.dispatch('config/resize', { width: this.width, height: this.height });
this.$store.dispatch('training/updateOffsetStationCode', { offsetStationCode: this.offsetStationCode });
});
}
}
};

View File

@ -1,59 +1,13 @@
<template>
<div>
<!-- <div>
<div class="reminder-drag" v-show="!minimize">
<div v-if="userRole != '05' && userRole != ''">
<div class="tabs-roles">
<div class="roles roles-first" :class="activeName == 'first' ? 'roles-active':''"
@click="clickRoles('first')">角色
</div>
<div class="roles" :class="activeName == 'second' ? 'roles-active':''"
@click="clickRoles('second')">所有人
</div>
<div class="minimality" @click="handleMinimality('min')">
<i class="el-icon-remove"></i>
</div>
</div>
<div class="tabs-content">
<div v-show="activeName == 'first'">
<chart-view ref="chatView" @showChatSpeak="showChatSpeak" @showChat="showChat"
:group="group" @showChatNone="showChatNone" :stationList="stationLists">
</chart-view>
</div>
<div style="flex-grow: 1">
<chart-window ref="chat" @handleChatShow="handleChatShow" @handleChatList="handleChatList"
:group="group" :chatShow="chatShow" :speaking="isSpeaking" :isShowAuto="isShowAuto">
</chart-window>
</div>
</div>
</div>
<div v-else>
<el-tabs v-model="activeName2" type="card">
<el-tab-pane label="所有人" name="second">
<chart-window :speaking="isSpeaking" :group="group" :isShowAuto="true"></chart-window>
</el-tab-pane>
</el-tabs>
</div>
</div>
<div class="reminder-drag minimize-box" v-show="minimize">
<div class="chat-title">聊天窗口</div>
<div class="minimality" @click="handleMinimality('max')">
<i class="el-icon-circle-plus"></i>
</div>
</div>
</div> -->
<div class="display-draft">
<el-button-group>
<!--<el-button @click="jumpIbp">IBP盘</el-button>-->
<el-button v-if="userRole == 'Driver'" type="jumpjlmap3d" @click="jumpjlmap3d">司机视角</el-button>
<el-button
v-if="userRole == 'Admin'"
type="success"
:disabled="isDisable"
@click="selectBeginTime"
>按计划行车</el-button>
<el-button v-if="userRole == 'Admin'" type="danger" :disabled="!isDisable" @click="end">
退出计划</el-button>
<el-button v-if="isIBP" @click="jumpIbp">IBP盘</el-button>
<el-button v-if="isDriver" type="jumpjlmap3d" @click="jumpjlmap3d">司机视角</el-button>
<template v-if="isAdmin">
<el-button type="success" :disabled="isDisable" @click="selectBeginTime">按计划行车</el-button>
<el-button type="danger" :disabled="!isDisable" @click="end">退出计划</el-button>
</template>
<el-button type="primary" @click="back">返回</el-button>
</el-button-group>
</div>
@ -63,8 +17,6 @@
</template>
<script>
// import ChartView from '@/views/jointTraining/chartView';
// import ChartWindow from './chatWindow';
import QrCode from '@/components/QrCode';
import SetTime from '@/views/display/demon/setTime';
import { runDiagramIsStart, runDiagramStart, runDiagramOver, runDiagramGetTime } from '@/api/simulation';
@ -76,8 +28,6 @@ import { EventBus } from '@/scripts/event-bus';
export default {
name: 'MenuDemonJoint',
components: {
// ChartView,
// ChartWindow,
QrCode,
SetTime
},
@ -116,6 +66,15 @@ export default {
computed: {
isSpeaking() {
return this.userRole != 'Driver' && this.userRole != '';
},
isDriver() {
return this.userRole == 'Driver';
},
isAdmin() {
return this.userRole == 'Admin';
},
isIBP() {
return this.userRole == 'IBP';
}
},
watch: {

View File

@ -12,7 +12,7 @@
>
<el-input v-model="filterText" placeholder="输入名称进行过滤" clearable />
<ul class="listBox">
<li v-for="item in list" :key="item" class="listLi">
<li v-for="(item,index) in list" :key="index" class="listLi">
<input
v-model="item.select"
class="checkbox"

View File

@ -16,7 +16,7 @@
</div>
<!-- 参与人员 -->
<div class="personnel">
<div style="height: calc(100% - 64px); overflow-y: scroll;">
<div style="height: calc(100% - 20px); overflow-y: scroll;">
<div style="display: flex; justify-content: space-between;">
<div class="Scheduling">
<p class="title">调度员</p>
@ -124,6 +124,21 @@
<el-button icon="el-icon-plus" circle plain @click="addingRoles('driver', '增加司机')" />
</div>
</div>
<div class="Scheduling bottomNone">
<p class="title">IBP</p>
<ul>
<li v-for="(nor, index) in ibpList" :key="index" class="selectPerson">
<span>{{ nor.nickName }}</span>
<i
v-if="userId == roomInfo.creatorId"
class="el-icon-close delPerson"
@click="delIBP(nor, index)"
/>
</li>
</ul>
<div v-if="userId == roomInfo.creatorId" class="add-box">
<el-button icon="el-icon-plus" circle plain @click="addingRoles('ibp', '增加IBP')" />
</div>
</div>
</div>
<div class="start-box">
@ -175,6 +190,7 @@
</div>
</div>
</div>
</div>
<!-- 观众席 -->
<div class="person-box">
<div class="title">
@ -248,6 +264,7 @@ export default {
driverList: [],
signalList: [],
stationList: [], //
ibpList: [],
point: {
x: 0,
y: 0
@ -436,6 +453,10 @@ export default {
this.signalList.push(item);
this.num++;
break;
case 'IBP':
this.ibpList.push(item);
this.num++;
break;
default:
this.dispatchList.forEach((nor, index) => {
if (item.id == nor.id) {
@ -467,6 +488,12 @@ export default {
this.num--;
}
});
this.ibpList.forEach((nor, index) => {
if (item.id == nor.id) {
this.ibpList.splice(index, 1);
this.num--;
}
});
break;
}
});
@ -499,7 +526,7 @@ export default {
});
});
},
// list Admin Instructor Dispatcher Attendant Audience Driver Repair
// list Admin Instructor Dispatcher Attendant Audience Driver Repair IBP IBP
async getUserList() {
this.num = 0;
this.dispatchList = [];
@ -507,6 +534,7 @@ export default {
this.adminList = [];
this.driverList = [];
this.signalList = [];
this.ibpList = [];
const res = await getJointTrainRoomUserList(this.$route.query.group);
res.data.forEach(item => {
if (item.id == this.userId) {
@ -533,6 +561,11 @@ export default {
case 'Repair':
item.select = true;
this.signalList.push(item);
break;
case 'IBP':
item.select = true;
this.ibpList.push(item);
break;
}
this.treeData.push(item);
});
@ -651,6 +684,9 @@ export default {
case 'signal': //
params.userRole = 'Repair';
break;
case 'ibp': // IBP
params.userRole = 'IBP';
break;
}
arr.push(params);
});
@ -726,6 +762,10 @@ export default {
this.signalList.splice(index, 1);
this.handleProperty(item);
},
delIBP(item, index) {
this.ibpList.splice(index, 1);
this.handleProperty(item);
},
handleProperty(item) {
const treeIndex = this.treeData.findIndex(nor => nor.id == item.id);
if (treeIndex > -1) {
@ -833,7 +873,7 @@ export default {
}
.personnel {
padding: 0px 60px;
padding: 0px 20px;
width: calc(100% - 500px);
height: calc(100% - 60px);
float: left;