综合演练房间调整

This commit is contained in:
fan 2019-10-23 16:13:36 +08:00
parent 5abc54c522
commit 8710a6231a
3 changed files with 39 additions and 24 deletions

View File

@ -239,7 +239,7 @@ export function getPermissionJoint(group) {
});
}
//
// 添加或更新真实设备和仿真对象连接
export function setRealDevice(group, data) {
return request({
url: `/api/jointTraining/room/realDevice?group=${group}`,
@ -247,3 +247,20 @@ export function setRealDevice(group, data) {
data: data
});
}
// 删除真实设备和仿真对象连接
export function delRealDevice(id, group) {
return request({
url: `/api/jointTraining/room/realDevice/${id}`,
method: 'delete',
params: { group: group }
});
}
// 获取真实设备列表
export function getRealDevices(group) {
return request({
url: `/api/jointTraining/room/${group}/devices`,
method: 'get'
});
}

View File

@ -9,16 +9,6 @@
label-width="140px"
@submit.native.prevent
>
<el-form-item :label="this.$t('lesson.releaseAssociatedCity')" prop="cityCode">
<el-select v-model="editModel.cityCode" :placeholder="this.$t('rules.pleaseSelect')" :disabled="this.disabled" @change="cityChange">
<el-option v-for="item in cityList" :key="item.code" :label="item.name" :value="item.code" />
</el-select>
</el-form-item>
<el-form-item :label="this.$t('lesson.releaseAssociatedMap')" prop="mapId">
<el-select v-model="editModel.mapId" :placeholder="this.$t('rules.pleaseSelect')" :disabled="this.disabled" @change="mapChange">
<el-option v-for="item in mapList" :key="item.id" :label="item.name" :value="item.id" />
</el-select>
</el-form-item>
<el-form-item :label="this.$t('lesson.publishCourseName')" prop="name">
<el-input v-model="editModel.name" :disabled="!this.hasRelease" />
</el-form-item>
@ -33,7 +23,6 @@
<script>
import { getPublishMapListBySkinCode } from '@/api/jmap/map';
import { getLessonNameByMapIdAndLessonId } from '@/api/jmap/lessondraft';
import { adminPublishLesson, releaseOrCancel } from '@/api/designPlatform';
export default {
@ -78,16 +67,6 @@ export default {
}
},
methods: {
cityChange(code) {
this.editModel.mapId = '';
this.mapList = this.cityMapDict[code];
},
async mapChange(mapId) {
const resp = await getLessonNameByMapIdAndLessonId({ mapId: mapId, lessonId: this.editModel.id });
if (resp && resp.data) {
this.editModel.name = resp.data.name;
}
},
doShow(model) {
this.mapList = [];
this.cityList = [];

View File

@ -178,6 +178,11 @@
<ul>
<li v-for="(nor, index) in stationStandList" :key="index" class="selectPerson">
<span>{{ realDeviceType[nor.deviceType] }}</span>
<i
v-if="userId == roomInfo.creatorId"
class="el-icon-close delPerson"
@click="handleDelDevice(nor)"
/>
<div style="float: right; margin-right: 15px;">
<el-select
v-model="nor.deviceCode"
@ -284,7 +289,7 @@
</template>
<script>
import { getJoinTrainCode, deljointTrainRoom, putUserRoles, postRoomDetail, getJointTrainRoomUserList, putJointTrainingExit, startJointTraining, putJointTrainingSimulation, putJointTrainingSimulationEntrance, setRealDevice } from '@/api/chat';
import { getJoinTrainCode, deljointTrainRoom, putUserRoles, postRoomDetail, getJointTrainRoomUserList, putJointTrainingExit, startJointTraining, putJointTrainingSimulation, putJointTrainingSimulationEntrance, setRealDevice, delRealDevice, getRealDevices } from '@/api/chat';
import { getStationList } from '@/api/runplan';
import { launchFullscreen } from '@/utils/screen';
import { DeviceMenu, RealDeviceType } from '@/scripts/ConstDic';
@ -422,7 +427,8 @@ export default {
this.userId = this.$store.state.user.id;
this.getRoomInfo(); // info
this.getUserList(); //
// this.checkPlcGateway(); //PLC
this.checkPlcGateway(); // PLC
this.getDevicesList(); //
this.timeDemon = setInterval(() => {
checkLoginLine();
}, 5000 * 60);
@ -937,6 +943,19 @@ export default {
},
handlerDeviceList(data) {
this.stationStandList = [data];
},
getDevicesList() {
getRealDevices(this.$route.query.group).then( resp => {
this.stationStandList = resp.data;
}).catch(() => {
});
},
handleDelDevice(nor) {
delRealDevice(nor.id, this.$route.query.group).then( resp => {
}).catch(() => {
});
}
}
};