This commit is contained in:
sunzhenyu 2020-11-16 10:07:44 +08:00
commit 301ffac035
6 changed files with 6 additions and 635 deletions

View File

@ -1,8 +1,10 @@
import { BASE_ASSET_API } from '@/api/jlmap3d/assets3d.js'; import { BASE_ASSET_API } from '@/api/jlmap3d/assets3d.js';
import store from '@/store/index_APP_TARGET';
//模型管理器 //模型管理器
let mode = "0"; let mode = "0";
export function ModelManager(){ export function ModelManager(){
let scope = this; let scope = this;
this.man1 = { this.man1 = {
code:null, code:null,
locateType:"01", locateType:"01",
@ -100,6 +102,7 @@ export function ModelManager(){
Promise.all(initlist).then((result) => { Promise.all(initlist).then((result) => {
console.log("success"); console.log("success");
store.dispatch('app/animationsClose');
resolve("success"); //['成功了', 'success'] resolve("success"); //['成功了', 'success']
}).catch((error) => { }).catch((error) => {
//console.log(error); //console.log(error);
@ -113,11 +116,8 @@ export function ModelManager(){
function fbxpromise(asset,mixers,model){ function fbxpromise(asset,mixers,model){
return new Promise(function(resolve, reject){ return new Promise(function(resolve, reject){
var loader = new THREE.FBXLoader(); var loader = new THREE.FBXLoader();
if( mode == "2"){ if( mode == "2"){
loader.load( asset.url, function ( object ) { loader.load( asset.url, function ( object ) {
model.mesh = object; model.mesh = object;
resolve(asset.deviceType); resolve(asset.deviceType);

View File

@ -1,172 +0,0 @@
<template>
<el-dialog :visible.sync="dialogVisible" :before-close="handleClose" title="试卷导出" width="500px">
<el-form ref="form" :model="form" label-width="150px" :rules="rules">
<el-form-item label="理论竞赛时长:" prop="theoryExamTime">
<el-input-number v-model="form.theoryExamTime" controls-position :min="1" /><span>&nbsp;&nbsp;</span>
</el-form-item>
<el-form-item label="实操竞赛时长:" prop="operateExamTime">
<el-input-number v-model="form.operateExamTime" controls-position :min="1" /><span>&nbsp;&nbsp;</span>
</el-form-item>
<el-form-item>
<el-button type="primary" @click="handleExport">导出</el-button>
<el-button @click="handleClose">取消</el-button>
</el-form-item>
</el-form>
</el-dialog>
</template>
<script>
import { getRaceById } from '@/api/competition';
export default {
mixins: [
// WindowResizeHandler
],
props: {
operateQuestionList: {
type: Array,
default() {
return [];
}
},
theoryQuestionList: {
type: Array,
default() {
return [];
}
}
},
data() {
return {
index: 0,
height: 0,
loading: false,
dialogVisible: false,
form: {
theoryExamTime: 1,
operateExamTime: 1
},
rules: {
theoryExamTime: [
{ required: true, message: '请输入理论竞赛时长', trigger: 'blur' }
],
operateExamTime: [
{ required: true, message: '请输入实操竞赛时长', trigger: 'blur' }
]
}
};
},
computed: {
},
watch: {
},
methods: {
doShow() {
this.dialogVisible = true;
},
handleClose() {
this.dialogVisible = false;
},
handleExport() {
getRaceById(this.$route.query.raceId).then(resp => {
const exportData = {
practicalQuestions: this.operateQuestionList,
theoryQuestions: this.theoryQuestionList,
competitionId: this.$route.query.raceId,
theoryExamTime: this.form.theoryExamTime,
practicalExamTime: this.form.operateExamTime
};
const content = new Blob([JSON.stringify(exportData)]);
const urlObject = window.URL || window.webkitURL || window;
const url = urlObject.createObjectURL(content);
const el = document.createElement('a');
el.href = url;
el.download = `${resp.data.name}试卷.json`;
el.click();
urlObject.revokeObjectURL(url);
this.dialogVisible = false;
}).catch(()=> {
this.$message.error('查询竞赛详情失败!');
});
}
}
};
</script>
<style lang="scss" scoped>
.layer-center {
width: 900px;
height: 100%;
margin: auto;
background: #fff;
}
.quiz {
background: #eee;
height: 100%;
&::-webkit-scrollbar {
display:none
}
&__card {
height: 100%;
.dir-item {
padding-left: 25px;
}
.dir-caption {
padding-left: 10px;
line-height: 26px;
background: #f1f1f1;
}
}
&__container {
height: 100%;
&-header {
height: auto !important;
.title {
font-size: 24px;
line-height: 60px;
font-weight: bold;
text-align: center;
}
.notes {
color:#606266;
white-space: nowrap;
overflow: hidden;
text-overflow: ellipsis;
margin: 0 20px;
}
}
&-main {
.section {
padding: 5px 20px;
.caption {
line-height: 26px;
}
.context {
}
}
}
&-footer {
text-align: right;
position: sticky;
bottom: 0px;
padding: 40px ;
.buttons {
position: relative;
bottom: 20px;
}
}
}
}
</style>

View File

@ -1,244 +0,0 @@
<template>
<el-dialog :visible.sync="dialogVisible" :before-close="handleClose" title="理论试题" width="80%">
<query-list-page ref="user" :pager-config="pagerConfig" :query-form="queryForm" :query-list="queryList" />
</el-dialog>
</template>
<script>
import { listQuestionPage } from '@/api/questionBank.js';
export default {
mixins: [
// WindowResizeHandler
],
props: {
theoryIndexList: {
type: Array,
default() {
return [];
}
}
},
data() {
return {
index: 0,
height: 0,
loading: false,
dialogVisible: false,
pagerConfig: {
pageSize: 'pageSize',
pageIndex: 'pageNum'
},
queryForm: {
reset: true,
labelWidth: '80px',
queryObject: {
type: {
type: 'select',
label: '类 型',
config: {
data: this.$ConstSelect.QuestionTypeList
}
},
topic: {
type: 'text',
label: '题 目'
}
}
},
queryList: {
query: listQuestionPage,
selectCheckShow: false,
indexShow: true,
afterQuery: this.afterQuery,
columns: [
{
title: '类 型',
prop: 'type',
type: 'tag',
width: '120',
columnValue: (row) => { return this.$ConstSelect.translate(row.type, 'QuestionTypeList'); },
tagType: (row) => {
return '';
}
},
{
title: '题 目',
prop: 'topic',
type: 'html'
},
{
title: '答 案',
prop: 'answer',
type: 'tagMore',
width: '100',
columnValue: (row) => { return this.answerTags(row); },
tagType: (row) => {
return '';
}
},
{
title: '创建人',
prop: 'createUserName',
width: '100'
},
{
type: 'button',
title: '操 作',
width: '100',
buttons: [
{
name: '添加',
handleClick: this.addQuestion,
showControl: (row) => { return !row.paper; },
type: 'success'
},
{
name: '移出',
handleClick: this.removeQuestion,
showControl: (row) => { return row.paper; },
type: 'warning'
}
]
}
]
}
};
},
computed: {
},
watch: {
},
methods: {
loadInitData() {
this.$nextTick(() => {
this.queryList.reload();
});
},
doShow() {
this.dialogVisible = true;
this.loadInitData();
},
handleClose() {
this.dialogVisible = false;
},
addQuestion(index, row) {
this.$set(row, 'paper', true);
row.score = 0;
this.$emit('addQuestion', row);
},
afterQuery(data) {
if (data && data.list) {
const that = this;
const list = data.list;
if (list) {
list.map(elem => {
this.$set(elem, 'paper', that.theoryIndexList.includes(elem.id));
});
}
}
return data;
},
removeQuestion(index, row) {
this.$set(row, 'paper', false);
this.$emit('removeQuestion', row);
},
answerTags(row) {
const answer = [];
row.optionList.forEach((el, i) => {
switch (row.type) {
case 'select':
if (el.correct) {
answer.push(this.$asc2chart(i + 65));
}
break;
case 'judge':
if (el.correct) {
answer.push(el.content);
}
break;
}
});
return answer;
}
}
};
</script>
<style lang="scss" scoped>
.layer-center {
width: 900px;
height: 100%;
margin: auto;
background: #fff;
}
.quiz {
background: #eee;
height: 100%;
&::-webkit-scrollbar {
display:none
}
&__card {
height: 100%;
.dir-item {
padding-left: 25px;
}
.dir-caption {
padding-left: 10px;
line-height: 26px;
background: #f1f1f1;
}
}
&__container {
height: 100%;
&-header {
height: auto !important;
.title {
font-size: 24px;
line-height: 60px;
font-weight: bold;
text-align: center;
}
.notes {
color:#606266;
white-space: nowrap;
overflow: hidden;
text-overflow: ellipsis;
margin: 0 20px;
}
}
&-main {
.section {
padding: 5px 20px;
.caption {
line-height: 26px;
}
.context {
}
}
}
&-footer {
text-align: right;
position: sticky;
bottom: 0px;
padding: 40px ;
.buttons {
position: relative;
bottom: 20px;
}
}
}
}
</style>

View File

@ -1,213 +0,0 @@
<template>
<el-dialog fullscreen :visible.sync="dialogVisible" :before-close="handleClose" style="height: 100%;" title="理论试题预览" :show-close="showClose" center>
<el-container class="quiz">
<el-container class="quiz__container">
<el-header class="quiz__container-header layer-center">
<div class="title">{{ formModel.name }}</div>
<div class="notes">{{ formModel.description }}</div>
</el-header>
<el-main class="quiz__container-main layer-center">
<div v-for="(el,i) in sortedList" :id="'anchor__lst-'+i" :key="i" class="section">
<template v-if="el.children.length">
<div class="caption">{{ index2UnicodeList[i] }}{{ el.title }} </div>
<question v-for="(item,j) in el.children" :id="'anchor__lst-'+item.type+'-'+item.index" :key="j" v-model="item.answer" class="context" :option="item" @save="onSave" />
</template>
</div>
</el-main>
<el-footer class="quiz__container-footer layer-center" @click="returnTop">
<el-button-group class="buttons">
<el-button v-loading="loading" type="primary" @click="handleClose">返回</el-button>
</el-button-group>
</el-footer>
</el-container>
</el-container>
</el-dialog>
</template>
<script>
import Question from '@/views/jsxt/competition/theory/quiz/question';
export default {
components: {
Question
},
mixins: [
// WindowResizeHandler
],
props: {
theoryQuestionList: {
type: Array,
default() {
return [];
}
}
},
data() {
return {
index: 0,
height: 0,
loading: false,
showClose: false,
dialogVisible: false,
formModel: {
description: '',
duration: 10,
name: '',
status: '',
totalScore: 0,
passScore: 10
}
};
},
computed: {
examId() {
return this.$route.params.examId;
},
userExamId() {
return this.$route.params.userExamId;
},
question() {
return this.theoryQuestionList[this.index] || {};
},
index2UnicodeList() {
return ['一', '二', '三', '四'];
},
sortedList() {
return [
{
title: '判断题',
children: this.theoryQuestionList.filter(el => { return el.type === 'judge'; })
},
{
title: '选择题',
children: this.theoryQuestionList.filter(el => { return el.type === 'select'; })
}
];
}
},
watch: {
'$router': function() {
this.loadInitData();
}
},
methods: {
loadInitData() {
console.log('获取试题详情');
},
doShow() {
this.dialogVisible = true;
this.loadInitData();
},
resizeHandler() {
this.height = this._clientHeight;
},
appendIndex(str, index) {
return `${index + 1}. ${str}`;
},
goAnchor(selector) {
const anchor = this.$el.querySelector(selector);
const el = this.$el.querySelector('.el-main');
if (anchor && el) {
el.scrollTop = anchor.offsetTop;
}
},
returnTop() {
document.querySelector('.el-header').scrollIntoView(true);
},
onSave(data) {
console.log(data, '问答题');
},
handleClose() {
this.dialogVisible = false;
}
}
};
</script>
<style lang="scss" scoped>
.layer-center {
width: 900px;
height: 100%;
margin: auto;
background: #fff;
}
.quiz {
background: #eee;
height: 100%;
&::-webkit-scrollbar {
display:none
}
&__card {
height: 100%;
.dir-item {
padding-left: 25px;
}
.dir-caption {
padding-left: 10px;
line-height: 26px;
background: #f1f1f1;
}
}
&__container {
height: 100%;
&-header {
height: auto !important;
.title {
font-size: 24px;
line-height: 60px;
font-weight: bold;
text-align: center;
}
.notes {
color:#606266;
white-space: nowrap;
overflow: hidden;
text-overflow: ellipsis;
margin: 0 20px;
}
}
&-main {
.section {
padding: 5px 20px;
.caption {
line-height: 26px;
}
.context {
}
}
}
&-footer {
text-align: right;
position: sticky;
bottom: 0px;
padding: 40px ;
.buttons {
position: relative;
bottom: 20px;
}
}
}
}
/deep/
.el-dialog__body {
height: calc(100% - 24px);
padding: 0;
}
/deep/
.el-dialog__header {
padding: 0;
background: #409EFF;
height: 24px;
}
</style>

View File

@ -57,7 +57,7 @@ export default {
group:'', group:'',
mapId:'', mapId:'',
lineCode:'', lineCode:'',
loadingProjectList: ['login', 'design', 'xty', 'designxty', 'gzb', 'designxty', 'xadt', 'designxadt', 'drts', 'designdrts'] loadingProjectList: ['login', 'design', 'xty', 'designxty', 'gzb', 'designxty', 'xadt', 'designxadt', 'drts', 'designdrts','bjd']
}; };
}, },
computed: { computed: {

View File

@ -105,7 +105,7 @@
<script> <script>
import Vue from 'vue'; import Vue from 'vue';
import { Jl3dTrafficTrain } from '@/jlmap3d/jl3dtrafficplan/jl3dtraffictrain.js'; import { Jl3dTrafficTrain } from '@/jlmap3d/jl3dtrafficplan/jl3dtraffictrain.js';
import { ProjectIcon, loginInfo } from '@/scripts/ProjectConfig';
import { JL3D_LOCAL_STATIC } from '@/api/jlmap3d/assets3d.js'; import { JL3D_LOCAL_STATIC } from '@/api/jlmap3d/assets3d.js';
export default { export default {
name: 'TrafficTrain', name: 'TrafficTrain',
@ -135,7 +135,7 @@ export default {
value:'', value:'',
isCctv:true, isCctv:true,
allPassers:0, allPassers:0,
loadingProjectList: ['login', 'design', 'xty', 'designxty', 'gzb', 'designxty', 'xadt', 'designxadt', 'drts', 'designdrts'] loadingProjectList: ['login', 'design', 'xty', 'designxty', 'gzb', 'designxty', 'xadt', 'designxadt', 'drts', 'designdrts','bjd']
}; };
}, },
computed: { computed: {