Squashed commit of the following:
All checks were successful
local-test分支构建发布到本地服务器 / Build-Publish (push) Successful in 11m33s

commit cef55a4c6b
Author: joylink_zhaoerwei <Bob_Engineer@163.com>
Date:   Mon May 27 17:09:01 2024 +0800

    三维url调整

commit 869c86b94d
Author: joylink_zhaoerwei <Bob_Engineer@163.com>
Date:   Mon May 27 16:57:01 2024 +0800

    更改三维地址

commit dc2165733e
Author: joylink_zhaoerwei <Bob_Engineer@163.com>
Date:   Mon May 27 16:33:48 2024 +0800

    场景添加三维场景,实训中可根据url打开三维场景(待测试)
This commit is contained in:
joylink_zhaoerwei 2024-05-27 17:39:39 +08:00
parent 7d774db362
commit 1b0ddc2740
3 changed files with 140 additions and 3 deletions

View File

@ -44,7 +44,8 @@
</div>
<div style="text-align: center;margin-top: 15px;">
<el-button v-show="nowData.ruleId" v-loading="loading" type="primary" @click="showScoreRule">评分表</el-button>
<el-button v-show="nowData.sceneId&&nowData.scenetype!=='Video'" v-loading="loading" type="primary" @click="startTask">开始任务</el-button>
<el-button v-show="nowData.sceneId&&nowData.scenetype=='Local'" v-loading="loading" type="primary" @click="startTask">开始任务</el-button>
<el-button v-show="nowData.sceneId&&nowData.scenetype=='Link'" v-loading="loading" type="primary" @click="startThreeTask">开始任务</el-button>
<el-button v-show="nowData.sceneId&&nowData.scenetype=='Video'" type="primary" @click="playSceneVideo">播放视频</el-button>
<el-button v-loading="loading" type="primary" :disabled="nowKey === taskList.length-1" @click="nextTask">下一任务</el-button>
</div>
@ -58,6 +59,7 @@
<script>
import { getTaskTree, getContextSenceDetail} from '@/api/contest';
import { createSimulationNoFunction } from '@/api/simulation';
import { getToken } from '@/utils/auth';
import { getPublishMapInfo } from '@/api/jmap/map';
import ScoreRule from './scoreRule';
import PlayVideo from './PlayVideo';
@ -180,6 +182,17 @@ export default {
this.loading = false;
}
},
startThreeTask() {
this.loading = true;
getContextSenceDetail(this.nowData.sceneId).then((res) => {
const url = res.data.scene.url;
const token = getToken();
window.open(`${url}${token}`, '_blank');
this.loading = false;
}).catch(error => {
this.$message.error(error.message);
});
},
showScoreRule() {
this.$refs.scoreRule.doShow(this.nowData.ruleId);
},

View File

@ -2,16 +2,18 @@
<div>
<query-list-page ref="user" :card-padding="10" :pager-config="pagerConfig" :query-form="queryForm" :query-list="queryList" />
<upload-Video ref="uploadVideo" @reloadTable="reloadTable" />
<add-three ref="upThree" @reloadTable="reloadTable" />
</div>
</template>
<script>
import { queryContestSencePaged, deleteContestSence } from '@/api/contest';
import UploadVideo from './UploadVideo';
import addThree from './addThree';
export default {
name: 'ContestSeasonManage',
components: {
UploadVideo
UploadVideo, addThree
},
data() {
return {
@ -92,6 +94,13 @@ export default {
return row.type == 'Video';
}
},
{
name: '编辑',
handleClick: this.doEditLink,
showControl: row => {
return row.type == 'Link';
}
},
{
name: '删 除',
handleClick: this.doDelete,
@ -101,7 +110,8 @@ export default {
}
],
actions: [
{ text: '上 传', handler: this.doUpload }
{ text: '上 传', handler: this.doUpload },
{ text: '添 加', handler: this.doUpThree }
]
}
};
@ -116,6 +126,12 @@ export default {
doEdit(index, row) {
this.$refs.uploadVideo.doShow(row.id);
},
doUpThree() {
this.$refs.upThree.doShow();
},
doEditLink(index, row) {
this.$refs.upThree.doShow(row.id);
},
doDelete(index, row) {
this.$confirm('该操作将删除竞赛场景,是否继续?', '提 示', {
confirmButtonText: '确 定',

View File

@ -0,0 +1,108 @@
<template>
<el-dialog v-dialogDrag :title="title" :visible.sync="dialogVisible" width="500px" :before-close="handleClose" center :close-on-click-modal="false">
<el-form ref="ruleForm" :model="formModel" :rules="rules" label-width="100px">
<el-form-item label="场景名称:" prop="name">
<el-input v-model="formModel.name" style="width: 350px;" />
</el-form-item>
<el-form-item label="场景url:" prop="url">
<el-input v-model="formModel.url" type="textarea" style="width:350px;" />
</el-form-item>
</el-form>
<span slot="footer" class="dialog-footer">
<el-button v-loading="loading" type="primary" @click="doSave">{{ $t('global.confirm') }}</el-button>
<el-button @click="handleClose">{{ $t('global.cancel') }}</el-button>
</span>
</el-dialog>
</template>
<script>
import { saveSceneVideo, editSceneVideo, getContextSenceDetail } from '@/api/contest';
export default {
name: 'AddContestTask',
data() {
return {
dialogVisible: false,
formModel: {
id: '',
name: '',
url: ''
},
loading: false
};
},
computed: {
rules() {
const crules = {
name: [
{ required: true, message: '请输入场景名称', trigger: 'blur' }
],
url: [
{ required: true, message: '请输入场景url', trigger: 'blur' }
]
};
return crules;
},
title() {
return this.formModel.id ? '修改三维场景' : '新建三维场景';
}
},
methods:{
doShow(sceneId) {
this.dialogVisible = true;
if (sceneId) {
this.formModel.id = sceneId;
getContextSenceDetail(sceneId).then((res) => {
this.formModel.name = res.data.name;
this.formModel.url = res.data.scene.url;
}).catch(error => {
this.$message.error(error.message);
});
} else {
this.formModel = {
id: '',
name: '',
url: ''
};
}
},
handleClose() {
this.formModel = {
id: '',
name: '',
url: ''
};
this.dialogVisible = false;
this.loading = false;
},
doSave() {
this.$refs.ruleForm.validate((valid) => {
if (valid) {
this.loading = true;
const data = { name:this.formModel.name, type:'Link',
scene:{url:this.formModel.url}};
if (this.formModel.id) {
editSceneVideo(this.formModel.id, data).then(() => {
this.$message.success('修改三维场景成功!');
this.handleClose();
this.$emit('reloadTable');
}).catch(error => {
this.$message.error(error.message);
this.loading = false;
});
} else {
saveSceneVideo(data).then(() => {
this.$message.success('创建三维场景成功!');
this.handleClose();
this.$emit('reloadTable');
}).catch(error => {
this.$message.error(error.message);
this.loading = false;
});
}
}
});
}
}
};
</script>