diff --git a/src/utils/baseUrl.js b/src/utils/baseUrl.js
index 4050e7e22..72be3b2f1 100644
--- a/src/utils/baseUrl.js
+++ b/src/utils/baseUrl.js
@@ -4,8 +4,8 @@ export function getBaseUrl() {
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 = 'http://192.168.3.6:9000'; // 旭强
+ 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 {
BASE_API = process.env.VUE_APP_BASE_API;
diff --git a/src/views/jointTraining/menuDemon.vue b/src/views/jointTraining/menuDemon.vue
index 4c5592596..93e3f7693 100644
--- a/src/views/jointTraining/menuDemon.vue
+++ b/src/views/jointTraining/menuDemon.vue
@@ -2,7 +2,7 @@
- IBP盘
+ IBP盘
司机视角
按计划行车
diff --git a/src/views/trainRoom/index.vue b/src/views/trainRoom/index.vue
index 38cddd486..6607867fc 100644
--- a/src/views/trainRoom/index.vue
+++ b/src/views/trainRoom/index.vue
@@ -42,7 +42,7 @@
@@ -281,6 +303,28 @@ export default {
computed: {
height() {
return this.$store.state.app.height - 95;
+ },
+ stationListForEquipment() {
+ return this.stationList.filter(elem => { return elem.centralized; }).map(item => {
+ const elem = { code: item.code, name: item.name, disabled: false };
+ this.equipmentList.forEach(nor => {
+ if (elem.code == nor.deviceCode) {
+ elem.disabled = true;
+ }
+ });
+ return elem;
+ });
+ },
+ stationListForIBP() {
+ return this.stationList.map(item => {
+ const elem = { code: item.code, name: item.name, disabled: false };
+ this.ibpList.forEach(nor => {
+ if (elem.code == nor.deviceCode) {
+ elem.disabled = true;
+ }
+ });
+ return elem;
+ });
}
},
watch: {
@@ -446,7 +490,13 @@ export default {
this.num++;
break;
case 'IBP':
- this.ibpList.push(item);
+ this.ibpList.forEach((nor, index) => {
+ if (nor.id == item.id) { // 修改状态
+ this.ibpList.splice(index, 1);
+ this.num--;
+ }
+ });
+ this.ibpList.push(item); // 新增
this.num++;
break;
default:
@@ -507,19 +557,7 @@ export default {
// 获取设备集中站
const resp = await getStationList(res.data.mapId);
- resp.data.forEach(item => {
- if (item.centralized) {
- this.stationList.push(item);
- }
- });
- this.stationList.forEach(item => {
- item.disabled = false;
- this.equipmentList.forEach(nor => {
- if (item.code == nor.deviceCode) {
- item.disabled = true;
- }
- });
- });
+ this.stationList = resp.data;
},
// 获取观众席list 分配角色 Admin 管理员 Instructor 教员 Dispatcher 行调 Attendant 车站 Audience 观众 Driver 司机 Repair 通号 IBP IBP盘
async getUserList() {
@@ -636,24 +674,6 @@ export default {
}
});
},
- // 设置所属集中站信息
- changeEquipment(val) {
- const params = [{
- id: val.id,
- nickName: val.nickName,
- userRole: 'Attendant',
- deviceCode: val.deviceCode
- }];
- putUserRoles(params, this.$route.query.group);
- this.stationList.forEach(item => {
- item.disabled = false;
- this.equipmentList.forEach(nor => {
- if (item.code == nor.deviceCode) {
- item.disabled = true;
- }
- });
- });
- },
// 打开弹窗
addingRoles(name, title) {
this.listName = name;
@@ -676,22 +696,22 @@ export default {
userRole: ''
};
switch (this.listName) {
- case 'admin': // 教员
+ case 'admin': // 教员
params.userRole = 'Instructor';
break;
- case 'dispatch': // 调度员
+ case 'dispatch': // 调度员
params.userRole = 'Dispatcher';
break;
- case 'equipment': // 车站值班员
+ case 'equipment': // 车站值班员
params.userRole = 'Attendant';
break;
- case 'driver': // 司机
+ case 'driver': // 司机
params.userRole = 'Driver';
break;
- case 'signal': // 通号
+ case 'signal': // 通号
params.userRole = 'Repair';
break;
- case 'ibp': // IBP
+ case 'ibp': // IBP
params.userRole = 'IBP';
break;
}
@@ -712,7 +732,7 @@ export default {
this.messageInfo('分配角色数量已超过可分配角色总数!', 'error');
}
this.treeData.forEach(item => {
- if (item.userRole == '' || item.userRole == 'Audience') {
+ if (item.userRole == '' || item.userRole == 'Audience' || item.userRole == 'IBP') {
item.select = false;
}
});
@@ -728,15 +748,32 @@ export default {
});
});
},
+ handleChangeUser(val, role, stationList, list) {
+ const params = [{
+ id: val.id,
+ nickName: val.nickName,
+ userRole: role,
+ deviceCode: val.deviceCode
+ }];
+ putUserRoles(params, this.$route.query.group);
+ stationList.forEach(item => {
+ item.disabled = false;
+ list.forEach(nor => {
+ if (item.code == nor.deviceCode) {
+ item.disabled = true;
+ }
+ });
+ });
+ },
handleDelUser(list, item, index) {
list.splice(index, 1);
this.handleProperty(item);
},
- handleDelEquipment(item, index) {
- this.equipmentList.splice(index, 1);
- this.stationList.forEach(item => {
+ handleDelUserForStation(item, index, stationList, list) {
+ list.splice(index, 1);
+ stationList.forEach(item => {
item.disabled = false;
- this.equipmentList.forEach(nor => {
+ list.forEach(nor => {
if (item.code == nor.deviceCode) {
item.disabled = true;
}
@@ -744,7 +781,7 @@ export default {
});
this.handleProperty(item);
},
- handleProperty(item) {
+ handleProperty(item, role) {
const treeIndex = this.treeData.findIndex(nor => nor.id == item.id);
if (treeIndex > -1) {
this.num--;