代码调整

This commit is contained in:
fan 2022-08-23 18:07:28 +08:00
parent 5939dc773f
commit b66d899285
9 changed files with 302 additions and 25 deletions

View File

@ -159,11 +159,11 @@ export function getTrainingTypeAndNumByMapIdAndPrdType(params) {
});
}
/** 已发布实训分页列表 */
export function getPublishTrainingListPaged(params) {
export function getPublishTrainingListPaged(data) {
return request({
url: `/api/v2/training/published/page`,
method: 'get',
params
method: 'post',
data
});
}
/** 已发布实训上架 */
@ -182,3 +182,32 @@ export function publishTrainingPutOff(data) {
data
});
}
/** 已发布实训删除 */
export function publishTrainingDelete(data) {
return request({
url: `/api/v2/training/published`,
method: 'delete',
data
});
}
/** 根据mapId查所有的已发布单操实训的基础信息 */
export function getPublishSingleList(mapId) {
return request({
url: `/api/v2/training/published/${mapId}/singles`,
method: 'get'
});
}
/** 根据mapId查所有的已发布场景实训的基础信息 */
export function getPublishScenesList(mapId) {
return request({
url: `/api/v2/training/published/${mapId}/scenes`,
method: 'get'
});
}
/** 根据实训id查该已发布实训的所有信息 */
export function getPublishTrainingDetail(trainingId) {
return request({
url: `/api/v2/training/published/${trainingId}`,
method: 'get'
});
}

View File

@ -116,7 +116,6 @@ class Jlmap {
this.$options.scaleRate = scaling;
this.$options.offsetX = origin ? origin.x : 0;
this.$options.offsetY = origin ? origin.y : 0;
console.log(scaling, origin, '****************');
this.$painter.updateTransform({ scaleRate: scaling, offsetX: origin ? origin.x : 0, offsetY: origin ? origin.y : 0 });
}
setMap(map, mapDevice, logicData) {
@ -221,7 +220,6 @@ class Jlmap {
}
setCenter(deviceCode) {
console.log('setCenter');
const arr = Object.keys(this.mapDevice);
if (arr.length != 0) {
const device = this.mapDevice[deviceCode];

View File

@ -24,13 +24,13 @@ export function handlerUrl(data) {
if (process.env.NODE_ENV === 'development') {
// const data = null;
// BASE_API = 'https://joylink.club/jlcloud';
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://114.116.51.125/jlcloud';
// BASE_API = 'http://192.168.8.152:9000'; // 袁琪
// BASE_API = 'http://192.168.3.94:9000'; // 旭强
// BASE_API = 'http://192.168.3.15:9000'; // 张赛
// BASE_API = 'http://192.168.8.140:9000'; // 杜康
BASE_API = 'http://192.168.3.5:9000'; // 杜康
// BASE_API = 'http://192.168.3.37:9000'; // 卫志宏
// BASE_API = 'http://b29z135112.zicp.vip';
// BASE_API = 'http://2925963m2a.zicp.vip'; // 杜康

View File

@ -93,7 +93,6 @@ export default {
}
},
clickEvent(obj, data, ele) {
console.log(obj.type, '----------');
switch (obj.type) {
case 'scriptDesign': {
const query = {lineCode:obj.lineCode};

View File

@ -0,0 +1,88 @@
<template>
<div>
<div class="display_top_draft">
<div class="btn_hover" @click="menuClick">菜单</div>
<el-button-group ref="button_group_box" class="button_group_box" :style="`margin-left:${btnWidth}px`">
<el-button size="small" @click="showList">实训列表</el-button>
</el-button-group>
</div>
<TrainingList ref="trainingList" @editBlob="editBlob" />
</div>
</template>
<script>
import TrainingList from './trainingList.vue';
export default {
name:'DemonMenu',
components:{
TrainingList
},
props:{
},
data() {
return {
hoverBtn: false,
btnWidth: -600
};
},
computed:{
group() {
return this.$route.query.group;
},
mapId() {
return this.$route.query.mapId;
},
lineCode() {
return this.$route.query.lineCode;
}
},
mounted() {
},
methods:{
menuClick() {
this.hoverBtn = !this.hoverBtn;
if (this.hoverBtn) {
this.btnWidth = 0; //
} else {
this.btnWidth = -600;
}
},
showList() {
this.$refs.trainingList.doShow();
},
editBlob() {
}
}
};
</script>
<style lang="scss" scoped>
.display_top_draft{
position: absolute;
left: 5px;
top: 15px;
height: 32px;
overflow: hidden;
padding-left: 44px;
z-index: 35;
.btn_hover{
position: absolute;
left: 0;
top: 0;
z-index: 2;
color: #4e4d4d;
font-size: 14px;
background: #fff;
padding: 8px;
border-radius: 5px;
display: block;
cursor: pointer;
float: left;
height: 32px;
}
.button_group_box{
float: left;
transition: all 0.5s;
overflow: hidden;
}
}
</style>

View File

@ -37,7 +37,7 @@
</template>
<script>
import { getPublishLessonTree } from '@/api/jmap/lesson';
import { getPublishSingleList } from '@/api/jmap/training';
// import { trainingNotifyNew } from '@/api/simulation';
import { launchFullscreen } from '@/utils/screen';
import { UrlConfig } from '@/scripts/ConstDic';
@ -69,13 +69,13 @@ export default {
},
methods: {
initLoadPage() {
/* getPublishLessonTree(this.$route.query.lessonId).then(response => {
getPublishSingleList(this.$route.query.mapId).then(response => {
if (response.data.tree && response.data.tree.length > 0) {
this.treeList = response.data.tree;
}
}).catch(error => {
this.$message.error(this.$t('tip.failedCourse') + ':' + error.message);
});*/
});
},
handleSliderShow(flag) {
this.$emit('overallTranslation', flag);

View File

@ -0,0 +1,143 @@
<template>
<el-dialog v-dialogDrag title="实训" :visible.sync="dialogVisible" width="1000px" :before-close="doClose" center>
<div>
<el-card class="box-card">
<div style="margin-bottom: 10px;font-size: 14px;">{{ `当前实训名称:${training.name}` }}</div>
<div>{{ `当前实训描述:${training.description}` }}</div>
</el-card>
<div class="trainingHeader">
<div class="trainingList">实训列表</div>
<div class="flexNull" />
</div>
<QueryListPage ref="queryListPage" :card-padding="10" :pager-config="pagerConfig" :query-form="queryForm" :query-list="queryList" />
</div>
</el-dialog>
</template>
<script>
import { getPublishSingleList } from '@/api/jmap/training';
import Cookies from 'js-cookie';
import ConstConfig from '@/scripts/ConstConfig';
export default {
name: 'TrainingList',
components:{
},
props: {},
data() {
return {
dialogVisible: false,
pagerConfig: {
pageSize: 'pageSize',
pageIndex: 'pageNum'
},
training: {
name: '',
description: ''
},
queryForm: {
labelWidth: '100px',
reset: true,
show:false
},
queryList: {
query: this.queryFunction,
selectCheckShow: false,
paginationHiden: true,
indexShow: true,
columns: [
{
title: this.$t('trainingManage.name'),
prop: 'name'
},
{
title: this.$t('trainingManage.description'),
prop: 'description'
},
{
title: this.$t('trainingManage.type'),
prop: 'type',
type: 'tag',
columnValue: (row) => { return this.covertData(row); },
tagType: (row) => { return ''; }
},
{
title: this.$t('trainingManage.labelJson'),
prop: 'labelJson'
},
{
type: 'button',
title: this.$t('trainingManage.operate'),
width: '150',
buttons: [
{
name: '加载',
handleClick: this.loadScript,
type: 'primary',
showControl:(row) => { return row.id; }
}
]
}
]
}
};
},
computed: {
},
methods: {
queryFunction() {
return getPublishSingleList(this.$route.query.mapId);
},
doShow() {
this.getListData();
this.dialogVisible = true;
},
doClose() {
this.dialogVisible = false;
},
loadScript() {
},
covertData(row) {
const releaseReview = ConstConfig.ConstSelect.trainingType;
const lastData = Object.assign({}, row);
if (Cookies.get('user_lang') == 'en') {
releaseReview.forEach(function(element) {
const rolename = element.value;
if (lastData.type == rolename) {
lastData.type = element.enlabel;
}
});
} else {
releaseReview.forEach(function(element) {
const rolename = element.value;
if (lastData.type == rolename) {
lastData.type = element.label;
}
});
}
return lastData.type;
},
getListData() {
this.$refs.queryListPage && this.$refs.queryListPage.commitQuery();
}
}
};
</script>
<style lang="scss" scoped>
/deep/ .el-dialog--center .el-dialog__body{
padding: 10px 25px 10px 25px;
}
.box-card{
padding: 10px;
font-size: 14px;
}
.trainingHeader {
display: flex;
justify-content: space-between;
align-items: center;
padding: 10px 5px;
.flexNull {
flex: 1;
}
}
</style>

View File

@ -5,11 +5,9 @@
<menu-demon ref="menuDemon" />
<voice-chat-box v-if="$route.query.lineCode == '16'" ref="chatbox" :group="group" :user-role="userRole" />
<chat-box v-else ref="chatbox" :group="group" :user-role="userRole" />
<tip-training-detail :training-obj="trainingObj" :offset-bottom="offsetBottom" />
<left-slider :offset-bottom="offsetBottom" @overallTranslation="overallTranslation" />
<div class="trainBack">
<el-button-group>
<el-button v-if="!starting" type="primary">开始</el-button>
<el-button v-if="!starting" type="success">开始</el-button>
<el-button v-if="starting" type="danger">结束</el-button>
<el-button type="primary" @click="back">返回</el-button>
</el-button-group>
@ -24,18 +22,16 @@ import { creatSubscribe, clearSubscribe, displayTopic} from '@/utils/stomp';
import { getToken } from '@/utils/auth';
import chatBox from '@/views/newMap/chatView/chatBox.vue';
import VoiceChatBox from '@/views/newMap/chatView/voiceChatBox.vue';
import MenuDemon from '@/views/trainingManage/demonMenu.vue';
import LeftSlider from './leftSlider';
import TipTrainingDetail from './tipTrainingDetail';
import MenuDemon from './demonMenu.vue';
// import LeftSlider from './leftSlider';
// import TipTrainingDetail from './tipTrainingDetail';
export default {
name: 'TrainingDesign',
components: {
JlmapVisual,
MenuDemon,
chatBox,
VoiceChatBox,
LeftSlider,
TipTrainingDetail
VoiceChatBox
},
props: {
widthLeft: {

View File

@ -5,7 +5,7 @@
</template>
<script>
import { getPublishTrainingListPaged, publishTrainingPutOn, publishTrainingPutOff} from '@/api/jmap/training';
import { getPublishTrainingListPaged, publishTrainingPutOn, publishTrainingPutOff, publishTrainingDelete} from '@/api/jmap/training';
import { getPublishMapListOnline } from '@/api/jmap/map';
export default {
@ -75,6 +75,10 @@ export default {
},
tagType: (row) => { return ''; }
},
{
title: '标签',
prop: 'labelJson'
},
{
title: '实训描述',
prop: 'description'
@ -96,13 +100,18 @@ export default {
name: this.$t('global.putaway'),
handleClick: this.handlePutaway,
type: '',
showControl: (row) => { return row.status != 1; }
showControl: (row) => { return row.state != 1; }
},
{
name: this.$t('global.soldOut'),
handleClick: this.handleSoldOut,
type: 'warning',
showControl: (row) => { return row.status != 2; }
showControl: (row) => { return row.state != 2; }
},
{
name: '删除',
handleClick: this.handleDelete,
type: 'danger'
}
]
}
@ -136,7 +145,7 @@ export default {
cancelButtonText: this.$t('global.cancel'),
type: 'warning'
}).then(() => {
publishTrainingPutOn(row.id).then(response => {
publishTrainingPutOn({ids: [row.id]}).then(response => {
this.$message.success(this.$t('publish.operationSuccess'));
this.reloadTable();
}).catch(() => {
@ -151,7 +160,22 @@ export default {
cancelButtonText: this.$t('global.cancel'),
type: 'warning'
}).then(() => {
publishTrainingPutOff(row.id).then(response => {
publishTrainingPutOff({ids: [row.id]}).then(response => {
this.$message.success(this.$t('publish.operationSuccess'));
this.reloadTable();
}).catch(() => {
this.reloadTable();
this.$messageBox(this.$t('error.operationFailure'));
});
}).catch(() => { });
},
handleDelete(index, row) {
this.$confirm('此操作将删除改实训,是否继续', this.$t('global.tips'), {
confirmButtonText: this.$t('global.confirm'),
cancelButtonText: this.$t('global.cancel'),
type: 'warning'
}).then(() => {
publishTrainingDelete({ids: [row.id]}).then(resp => {
this.$message.success(this.$t('publish.operationSuccess'));
this.reloadTable();
}).catch(() => {