监管仿真增加进入仿真

This commit is contained in:
fan 2022-12-13 15:50:27 +08:00
parent 15226a3406
commit 83d1342110
3 changed files with 36 additions and 4 deletions

View File

@ -567,3 +567,10 @@ export function exitSimulation(group) {
method: 'put'
});
}
/** 仿真监管那里进入仿真 */
export function enterSimulationByTeacher(group) {
return request({
url: `/simulation/${group}/monitor`,
method: 'post'
});
}

View File

@ -72,9 +72,11 @@ export default {
this.position = { x: 0, y: 0 };
},
'$store.state.training.tipEvent': function (val) {
if (this.tip) {
setTimeout(() => { this.tipInit(); }, 10);
}
setTimeout(() => {
if (this.tip) {
this.tipInit();
}
}, 10);
}
},
methods: {

View File

@ -7,7 +7,7 @@
<script>
import ViewMember from './viewMember';
import { getExistSimulationList, getSuperviseSimulation } from '@/api/rtSimulation';
import { destroySimulationByAdmin } from '@/api/simulation';
import { destroySimulationByAdmin, enterSimulationByTeacher } from '@/api/simulation';
export default {
name: 'SimulationManage',
components: {
@ -82,6 +82,11 @@ export default {
handleClick: this.viewMember,
type: ''
},
{
name: '进入仿真',
handleClick: this.enterSimulation,
type: ''
},
{
name: this.$t('system.destory'),
handleClick: this.handleDelete,
@ -120,6 +125,24 @@ export default {
});
});
},
enterSimulation(index, row) {
enterSimulationByTeacher(row.id).then(resp => {
const query = {
lineCode: row.map.lineCode,
group: row.id,
mapId: row.map.id,
simType: row.workParamVO.type,
project: this.project
};
if (row.workParamVO && row.workParamVO.domConfig && row.workParamVO.domConfig.client) {
query.client = row.workParamVO.domConfig.client;
}
if (row.workParamVO && row.workParamVO.domConfig && row.workParamVO.domConfig.singleClient) {
query.singleClient = row.workParamVO.domConfig.singleClient;
}
this.$router.push({ path: `/display/demon`, query: query });
});
},
reloadTable() {
this.queryList.reload();
}