实训调整
This commit is contained in:
parent
82857e9808
commit
aef684e320
@ -27,11 +27,11 @@ export function handlerUrl(data) {
|
|||||||
// BASE_API = 'https://test.joylink.club/jlcloud';
|
// BASE_API = 'https://test.joylink.club/jlcloud';
|
||||||
// BASE_API = 'http://192.168.3.233/rtss-server';
|
// BASE_API = 'http://192.168.3.233/rtss-server';
|
||||||
// BASE_API = 'http://114.116.51.125/jlcloud';
|
// BASE_API = 'http://114.116.51.125/jlcloud';
|
||||||
BASE_API = 'http://192.168.3.90:9100'; // 周寅
|
// BASE_API = 'http://192.168.3.90:9100'; // 周寅
|
||||||
// BASE_API = 'http://192.168.3.94:9000'; // 旭强
|
// BASE_API = 'http://192.168.3.94:9000'; // 旭强
|
||||||
// BASE_API = 'http://192.168.3.15:9000'; // 张赛
|
// BASE_API = 'http://192.168.3.15:9000'; // 张赛
|
||||||
// BASE_API = 'http://192.168.3.5:9000'; // 夏增彬
|
// BASE_API = 'http://192.168.3.5:9000'; // 夏增彬
|
||||||
// BASE_API = 'http://192.168.3.37:9000'; // 卫志宏
|
BASE_API = 'http://192.168.3.37:9000'; // 卫志宏
|
||||||
// BASE_API = 'http://b29z135112.zicp.vip';
|
// BASE_API = 'http://b29z135112.zicp.vip';
|
||||||
// BASE_API = 'http://2925963m2a.zicp.vip'; // 杜康
|
// BASE_API = 'http://2925963m2a.zicp.vip'; // 杜康
|
||||||
// BASE_API = 'http://2i38984j47.qicp.vip'; // 张赛
|
// BASE_API = 'http://2i38984j47.qicp.vip'; // 张赛
|
||||||
|
@ -1,28 +1,104 @@
|
|||||||
<template>
|
<template>
|
||||||
<el-dialog
|
<el-dialog
|
||||||
title="提示"
|
title="角色扮演"
|
||||||
:visible.sync="dialogVisible"
|
:visible.sync="dialogVisible"
|
||||||
width="30%"
|
width="30%"
|
||||||
:before-close="doClose"
|
:before-close="doClose"
|
||||||
|
center
|
||||||
>
|
>
|
||||||
<span />
|
<template v-for="user in userList">
|
||||||
|
<div :key="user.id" style="display: flex;justify-content: space-between;">
|
||||||
|
<div>{{ user.nickName }}</div>
|
||||||
|
<el-select v-model="user.memberId" size="mini" placeholder="请选择">
|
||||||
|
<el-option
|
||||||
|
v-for="item in roleList"
|
||||||
|
:key="item.id"
|
||||||
|
:label="item.label"
|
||||||
|
:value="item.id"
|
||||||
|
/>
|
||||||
|
</el-select>
|
||||||
|
</div>
|
||||||
|
</template>
|
||||||
|
<span slot="footer" class="dialog-footer">
|
||||||
|
<el-button @click="dialogVisible = false">取 消</el-button>
|
||||||
|
<el-button type="primary" @click="commit">确 定</el-button>
|
||||||
|
</span>
|
||||||
</el-dialog>
|
</el-dialog>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
|
import {covertMemberData} from '@/views/newMap/displayNew/utils';
|
||||||
|
import { assignUsersPlayRoles } from '@/api/jointSimulation';
|
||||||
export default {
|
export default {
|
||||||
name: 'ScenePlayRole',
|
name: 'ScenePlayRole',
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
dialogVisible: false
|
dialogVisible: false,
|
||||||
|
userList: [],
|
||||||
|
roleList: []
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
|
computed: {
|
||||||
|
trainingDetail() {
|
||||||
|
return this.$store.state.trainingNew.trainingDetail;
|
||||||
|
}
|
||||||
|
},
|
||||||
|
watch: {
|
||||||
|
'$store.state.training.simulationUserList': function(val) {
|
||||||
|
this.userList = [];
|
||||||
|
this.$store.state.training.simulationUserList.forEach(user => {
|
||||||
|
this.userList.push({id: user.userId, nickName: user.nickName, memberId: ''});
|
||||||
|
});
|
||||||
|
}
|
||||||
|
// '$store.state.training.memberList': function (val) {
|
||||||
|
// if (val && val.length) {
|
||||||
|
// const memberData = this.$store.state.training.memberData;
|
||||||
|
// let activeTrainList = [];
|
||||||
|
// if (this.$store.state.training.started) {
|
||||||
|
// activeTrainList = this.$store.state.map.activeTrainList;
|
||||||
|
// }
|
||||||
|
// // 获取仿真成员列表
|
||||||
|
// const result = covertMemberData(activeTrainList, Object.values(memberData));
|
||||||
|
// let list = [];
|
||||||
|
// result.deviceListData.forEach(item => {
|
||||||
|
// list = list.concat(item);
|
||||||
|
// });
|
||||||
|
// this.roleList = list;
|
||||||
|
// }
|
||||||
|
// }
|
||||||
|
},
|
||||||
methods: {
|
methods: {
|
||||||
doClose() {
|
doClose() {
|
||||||
this.dialogVisible = false;
|
this.dialogVisible = false;
|
||||||
},
|
},
|
||||||
doShow() {
|
doShow() {
|
||||||
|
const playerList = JSON.parse(this.trainingDetail.playerIdJson);
|
||||||
|
const memberData = this.$store.state.training.memberData;
|
||||||
|
const activeTrainList = this.$store.state.map.activeTrainList || [];
|
||||||
|
const newMemberData = {};
|
||||||
|
playerList.forEach(playerId => {
|
||||||
|
newMemberData[playerId] = memberData[playerId];
|
||||||
|
});
|
||||||
|
const result = covertMemberData(activeTrainList, Object.values(newMemberData));
|
||||||
|
let list = [];
|
||||||
|
result.deviceListData.forEach(item => {
|
||||||
|
list = list.concat(item);
|
||||||
|
});
|
||||||
|
this.roleList = list;
|
||||||
this.dialogVisible = true;
|
this.dialogVisible = true;
|
||||||
|
},
|
||||||
|
commit() {
|
||||||
|
const list = [];
|
||||||
|
this.userList.forEach(user => {
|
||||||
|
list.push({userId: user.id, memberId: user.memberId});
|
||||||
|
});
|
||||||
|
console.log(this.userList, '-----');
|
||||||
|
assignUsersPlayRoles(list, this.$route.query.group).then(resp => {
|
||||||
|
this.$emit('startTraining');
|
||||||
|
this.doClose();
|
||||||
|
}).catch(() => {
|
||||||
|
this.$message.error('扮演角色失败!');
|
||||||
|
});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
@ -4,6 +4,7 @@
|
|||||||
<training-jlmap refs="trainingJlmap" />
|
<training-jlmap refs="trainingJlmap" />
|
||||||
<training-tip ref="trainingTip" />
|
<training-tip ref="trainingTip" />
|
||||||
<training-position-tip ref="trainingPositionTip" />
|
<training-position-tip ref="trainingPositionTip" />
|
||||||
|
<scene-play-role ref="scenePlayRole" @startTraining="startTraining" />
|
||||||
<!-- <training-menu ref="trainingMenu" :offset-bottom="offsetBottom" />-->
|
<!-- <training-menu ref="trainingMenu" :offset-bottom="offsetBottom" />-->
|
||||||
<div class="trainBack">
|
<div class="trainBack">
|
||||||
<el-button-group>
|
<el-button-group>
|
||||||
@ -21,6 +22,7 @@ import MenuDemon from './demonMenu.vue';
|
|||||||
import TrainingTip from './trainingTip';
|
import TrainingTip from './trainingTip';
|
||||||
import TrainingPositionTip from './trainingPositionTip';
|
import TrainingPositionTip from './trainingPositionTip';
|
||||||
import TrainingJlmap from './trainingJlmap';
|
import TrainingJlmap from './trainingJlmap';
|
||||||
|
import ScenePlayRole from './scenePlayRole';
|
||||||
// import TrainingMenu from './trainingMenu';
|
// import TrainingMenu from './trainingMenu';
|
||||||
export default {
|
export default {
|
||||||
name: 'TrainingDesign',
|
name: 'TrainingDesign',
|
||||||
@ -28,7 +30,8 @@ export default {
|
|||||||
MenuDemon,
|
MenuDemon,
|
||||||
TrainingTip,
|
TrainingTip,
|
||||||
TrainingJlmap,
|
TrainingJlmap,
|
||||||
TrainingPositionTip
|
TrainingPositionTip,
|
||||||
|
ScenePlayRole
|
||||||
// TrainingMenu
|
// TrainingMenu
|
||||||
},
|
},
|
||||||
props: {
|
props: {
|
||||||
@ -102,6 +105,13 @@ export default {
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
handlerStart() {
|
handlerStart() {
|
||||||
|
if (this.trainingDetail.type === 'SCENE') {
|
||||||
|
this.$refs.scenePlayRole.doShow();
|
||||||
|
} else {
|
||||||
|
this.startTraining();
|
||||||
|
}
|
||||||
|
},
|
||||||
|
startTraining() {
|
||||||
startTraining(this.group, {mode: this.teachMode}).then(() => {
|
startTraining(this.group, {mode: this.teachMode}).then(() => {
|
||||||
this.$store.dispatch('trainingNew/trainingStart');
|
this.$store.dispatch('trainingNew/trainingStart');
|
||||||
this.$store.dispatch('trainingNew/setTrainingScore', '');
|
this.$store.dispatch('trainingNew/setTrainingScore', '');
|
||||||
|
Loading…
Reference in New Issue
Block a user