Merge branch 'test' of https://git.code.tencent.com/lian-cbtc/jl-client into test
# Conflicts: # src/views/newMap/jointTrainingNew/index.vue
This commit is contained in:
commit
eed312e72f
@ -123,6 +123,9 @@ const StudentManage = () => import('@/views/studentManage');
|
||||
|
||||
const CompetitionDetail = () => import('@/views/jsxt/competition/examDetail');
|
||||
const CompetitionManage = () => import('@/views/jsxt/competition/index');
|
||||
const CompetitionHome = () => import('@/views/jsxt/competition/home');
|
||||
const Refereedetail = () => import('@/views/jsxt/competition/theory/quiz/index');
|
||||
const theoryManage = () => import('@/views/jsxt/competition/theory/index');
|
||||
const RefereeList = () => import('@/views/jsxt/refereeList/index');
|
||||
const homeJsxt = () => import('@/views/jsxt/home/index');
|
||||
|
||||
@ -992,6 +995,7 @@ export const projectRoute = {
|
||||
export const JSXT = [
|
||||
{
|
||||
path: '/jsxt',
|
||||
redirect: '/jsxt/home',
|
||||
component: Layout,
|
||||
meta: {
|
||||
i18n: 'router.competitionManage',
|
||||
@ -1000,25 +1004,48 @@ export const JSXT = [
|
||||
hidden: getSessionStorage('project') ? !getSessionStorage('project').endsWith('jsxt') && !window.document.location.pathname.includes('jsxt') : !window.document.location.pathname.includes('jsxt'),
|
||||
children: [
|
||||
{
|
||||
path: 'home',
|
||||
path: '',
|
||||
redirect: '/jsxt/home',
|
||||
component: CompetitionManage,
|
||||
meta: {
|
||||
i18n: 'router.competitionManage',
|
||||
icon: 'design',
|
||||
hidden: true
|
||||
}
|
||||
},
|
||||
{
|
||||
path: 'examDetail',
|
||||
component: CompetitionDetail,
|
||||
meta: {
|
||||
il8n: 'router.examDetail',
|
||||
icon: 'design',
|
||||
hidden: true
|
||||
}
|
||||
icon: 'design'
|
||||
},
|
||||
children: [
|
||||
{
|
||||
path: 'home',
|
||||
component: CompetitionHome,
|
||||
meta: {
|
||||
hidden: true
|
||||
}
|
||||
},
|
||||
{
|
||||
path: 'theory/:id',
|
||||
component: theoryManage,
|
||||
meta: {
|
||||
hidden: true
|
||||
}
|
||||
},
|
||||
{
|
||||
path: 'examDetail',
|
||||
component: CompetitionDetail,
|
||||
meta: {
|
||||
il8n: 'router.examDetail',
|
||||
icon: 'design',
|
||||
hidden: true
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
path: '/jsxt/theory/detail/:id',
|
||||
component: Refereedetail,
|
||||
meta: {
|
||||
hidden: true
|
||||
}
|
||||
},
|
||||
{
|
||||
path: '/refereeJsxt',
|
||||
component: Layout,
|
||||
|
@ -5,7 +5,6 @@ import TurnbackBar from '@/components/TurnbackBar';
|
||||
import ConstConfig from '@/scripts/ConstConfig';
|
||||
import Dictionary from '@/scripts/DictionaryData';
|
||||
import Theme from '@/jmapNew/theme/factory';
|
||||
import store from './../store/index_Common';
|
||||
|
||||
// 全局组件
|
||||
Vue.component('DataForm', DataForm);
|
||||
@ -115,3 +114,24 @@ Vue.prototype.$copyClone = function(obj1, obj2 = {}) {
|
||||
}
|
||||
return obj1;
|
||||
};
|
||||
|
||||
Vue.prototype.$escapeHTML = function (context) {
|
||||
const pattern = /<\w*>(.*)<\/\w*>/;
|
||||
|
||||
if (pattern.test(context)) {
|
||||
context = pattern.exec(context)[1];
|
||||
}
|
||||
|
||||
context = context.replace(/</g, '<');
|
||||
context = context.replace(/>/g, '>');
|
||||
|
||||
return `${context}`;
|
||||
};
|
||||
|
||||
Vue.prototype.$str2number = function(str) {
|
||||
return parseInt(str);
|
||||
};
|
||||
|
||||
Vue.prototype.$asc2chart = function(ascii) {
|
||||
return String.fromCharCode(ascii);
|
||||
};
|
||||
|
@ -1,6 +1,6 @@
|
||||
import { setSessionStorage } from '@/utils/auth';
|
||||
import { login, logout, getInfo } from '@/api/login';
|
||||
import { getToken, setToken, removeToken, removeSessionStorage } from '@/utils/auth';
|
||||
import { getToken, setToken, removeToken } from '@/utils/auth';
|
||||
import { getUserConfigInfo } from '@/api/management/user';
|
||||
import { LoginParams } from '@/utils/login';
|
||||
import { creatSubscribe, clearSubscribe, perpetualTopic, disconnect} from '@/utils/stomp';
|
||||
@ -145,7 +145,6 @@ const user = {
|
||||
commit('SET_ID', '');
|
||||
commit('SET_ROLES', []);
|
||||
removeToken();
|
||||
removeSessionStorage('project');
|
||||
},
|
||||
|
||||
// 登出系统
|
||||
|
@ -2,10 +2,10 @@ export function getBaseUrl() {
|
||||
let BASE_API;
|
||||
if (process.env.NODE_ENV === 'development') {
|
||||
// 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.5:9000'; // 袁琪
|
||||
// BASE_API = 'http://192.168.3.6:9000'; // 旭强
|
||||
// BASE_API = 'http://192.168.3.41:9000'; // 张赛
|
||||
BASE_API = 'http://192.168.3.41:9000'; // 张赛
|
||||
// BASE_API = 'http://192.168.3.82:9000'; // 杜康
|
||||
// BASE_API = 'http://192.168.3.41:9000'; // 张S赛
|
||||
// BASE_API = 'http://b29z135112.zicp.vip';
|
||||
|
@ -15,13 +15,10 @@
|
||||
:filter-node-method="filterNode"
|
||||
:default-expanded-keys="expandList"
|
||||
@node-click="clickEvent"
|
||||
@node-expand="nodeExpand"
|
||||
@node-collapse="nodeCollapse"
|
||||
>
|
||||
<span slot-scope="{ node }">
|
||||
<span class="el-icon-tickets" />
|
||||
<span v-if="node.data.id ==='Simulation'"> 仿真系统</span>
|
||||
<span v-else> {{ node.data.name }}</span>
|
||||
<span> {{ node.data.name }}</span>
|
||||
</span>
|
||||
</el-tree>
|
||||
</div>
|
||||
@ -29,7 +26,6 @@
|
||||
</div>
|
||||
</template>
|
||||
<script>
|
||||
import localStore from 'storejs';
|
||||
import { getSessionStorage } from '@/utils/auth';
|
||||
|
||||
export default {
|
||||
@ -37,14 +33,18 @@ export default {
|
||||
data() {
|
||||
return {
|
||||
loading: false,
|
||||
treeList: [],
|
||||
treeList: [
|
||||
{name: '西安考试地图', id: '13', type: 'Map', children: [
|
||||
{name: '理论竞赛', type: 'theory'},
|
||||
{name: '考试系统', type: 'operation'}
|
||||
]}
|
||||
],
|
||||
defaultProps: {
|
||||
children: 'children',
|
||||
label: 'name'
|
||||
},
|
||||
mapId: '',
|
||||
expandList: [],
|
||||
filterSelect: ''
|
||||
expandList: []
|
||||
};
|
||||
},
|
||||
computed: {
|
||||
@ -68,29 +68,16 @@ export default {
|
||||
return data.name.indexOf(value) !== -1;
|
||||
},
|
||||
clickEvent(obj, data, ele) {
|
||||
localStore.set('trainingPlatformCheckId' + this.filterSelect + this.userId, obj.id);
|
||||
while (data) {
|
||||
if (data.data.type === 'Map') {
|
||||
this.mapId = data.data.id;
|
||||
break;
|
||||
}
|
||||
data = data.parent;
|
||||
if (obj.type === 'Map') {
|
||||
this.mapId = obj.id;
|
||||
this.$router.push({ path: `/jsxt/home`});
|
||||
} else if (obj.type === 'theory') {
|
||||
const query = {type: 'theory', mapId: this.mapId};
|
||||
this.$router.push({path: `/jsxt/examDetail`, query: query});
|
||||
} else if (obj.type === 'operation') {
|
||||
const query = {type: 'operation', mapId: this.mapId};
|
||||
this.$router.push({path: `/jsxt/examDetail`, query: query});
|
||||
}
|
||||
console.log(obj, data, ele);
|
||||
},
|
||||
setLocalRoute(path) {
|
||||
localStore.set('trainingPlatformRoute' + this.userId, path);
|
||||
},
|
||||
nodeExpand(obj, node, ele) {
|
||||
const key = obj.id + obj.type;
|
||||
this.expandList = this.expandList.filter(item => item !== key);
|
||||
this.expandList.push(key);
|
||||
localStore.set('trainIngPlatformExpandList' + this.filterSelect + this.userId, this.expandList);
|
||||
},
|
||||
nodeCollapse(obj, node, ele) {
|
||||
const key = obj.id + obj.type;
|
||||
this.expandList = this.expandList.filter(item => item !== key);
|
||||
localStore.set('trainIngPlatformExpandList' + this.filterSelect + this.userId, this.expandList);
|
||||
}
|
||||
}
|
||||
};
|
||||
|
@ -1,7 +1,7 @@
|
||||
<template>
|
||||
<div class="joylink-card">
|
||||
<div class="card-title">
|
||||
<b>{{ $t('exam.nameOfTestPaper') +': ' + examDetails.name }}</b>
|
||||
<b>{{ examType + $t('exam.nameOfTestPaper') +': ' + examDetails.name }}</b>
|
||||
</div>
|
||||
<div class="card_content">
|
||||
<el-scrollbar wrap-class="scrollbar-wrapper">
|
||||
@ -29,17 +29,17 @@
|
||||
</p>
|
||||
<p class="list-item">
|
||||
<span class="list-label">{{ $t('exam.examinationRules') + ':' }}</span>
|
||||
<span class="list-elem">
|
||||
<p class="list-table">
|
||||
<el-table :data="examDetails.examDefinitionRulesVOList" border show-summary>
|
||||
<el-table-column prop="name" :label="this.$t('exam.trainingType')" width="180" />
|
||||
<el-table-column prop="num" :label="this.$t('exam.numberOfQuestions')" />
|
||||
<el-table-column prop="point" :label="this.$t('exam.score')" />
|
||||
<el-table-column prop="chapterIdLong" :label="this.$t('exam.totalScore')" />
|
||||
</el-table>
|
||||
</p>
|
||||
</span>
|
||||
</p>
|
||||
<div class="list-elem">
|
||||
<p class="list-table">
|
||||
<el-table :data="examDetails.examDefinitionRulesVOList" border show-summary>
|
||||
<el-table-column prop="name" :label="this.$t('exam.trainingType')" width="180" />
|
||||
<el-table-column prop="num" :label="this.$t('exam.numberOfQuestions')" />
|
||||
<el-table-column prop="point" :label="this.$t('exam.score')" />
|
||||
<el-table-column prop="chapterIdLong" :label="this.$t('exam.totalScore')" />
|
||||
</el-table>
|
||||
</p>
|
||||
</div>
|
||||
<div class="btn-start">
|
||||
<el-button :disabled="disabled" type="primary" @click="exmaStart">{{ $t('exam.startTheExam') }}</el-button>
|
||||
<el-button :disabled="disabled" @click="back">{{ $t('global.back') }}</el-button>
|
||||
@ -89,7 +89,10 @@ export default {
|
||||
computed: {
|
||||
...mapGetters('trainingList', [
|
||||
'trainingList'
|
||||
])
|
||||
]),
|
||||
examType() {
|
||||
return this.$route.query.type === 'operation' ? '实操竞赛' : '理论竞赛';
|
||||
}
|
||||
},
|
||||
watch: {
|
||||
'$route.params.examId': function (val) {
|
||||
@ -170,17 +173,6 @@ export default {
|
||||
});
|
||||
}
|
||||
},
|
||||
buy() {
|
||||
getPublishLessonDetail({ id: this.examDetails.lessonId }).then((res) => {
|
||||
this.$router.push({
|
||||
path: `${UrlConfig.trainingPlatform.pay}/${this.examDetails.lessonId}`,
|
||||
query: { permissionType: PermissionType.EXAM, lessonId: this.examDetails.lessonId, prdType: res.data.prdType, mapId: res.data.mapId }
|
||||
});
|
||||
}).catch(() => {
|
||||
this.$messageBox(this.$t('error.obtainCourseDetailsFailed'));
|
||||
});
|
||||
|
||||
},
|
||||
async examDetail() {
|
||||
const data = this.examDetails;
|
||||
try {
|
||||
@ -192,17 +184,7 @@ export default {
|
||||
await this.$store.dispatch('exam/setTotalTime', this.userExam.duration);
|
||||
await this.$store.dispatch('trainingList/setTrainingList', list);
|
||||
} catch (error) {
|
||||
// 判断是否有考试权限,如果没有权限则跳到购买页面,否则报错
|
||||
if (error.code === 500004) {
|
||||
this.$confirm( this.$t('tip.noCourseAuthority'), this.$t('tip.hint'), {
|
||||
cancelButtonText: this.$t('global.cancel'),
|
||||
confirmButtonText: this.$t('global.confirm'),
|
||||
type: 'warning',
|
||||
center: true
|
||||
}).then(() => {
|
||||
this.buy();
|
||||
}).catch(() => { });
|
||||
} else if (error.code === 500005) {
|
||||
this.$messageBox(this.$t('tip.notWithinTheScopeOfTheExamination'));
|
||||
} else {
|
||||
this.$messageBox(`${error.message}`);
|
||||
@ -210,53 +192,14 @@ export default {
|
||||
}
|
||||
},
|
||||
async exmaStart() {
|
||||
this.disabled = true;
|
||||
await this.examDetail();
|
||||
if (this.examList.length && !this.drawWay) {
|
||||
examNotify({ examId: this.$route.params.examId }).then(resp => {
|
||||
const query = {
|
||||
group: resp.data,
|
||||
trainingId: this.examList[0].trainingId,
|
||||
userExamId: this.userExam.id,
|
||||
examQuestionId: this.examList[0].id,
|
||||
subSystem: this.$route.query.subSystem,
|
||||
examId: this.$route.params.examId,
|
||||
mapId: this.$route.query.mapId,
|
||||
lineCode: this.lineCode
|
||||
};
|
||||
this.$router.push({ path: `${UrlConfig.display}/exam`, query: query });
|
||||
launchFullscreen();
|
||||
}).catch(error => {
|
||||
this.disabled = false;
|
||||
this.$messageBox( this.$t('error.createSimulationFailed') + `: ${error.message}`);
|
||||
});
|
||||
} else if (this.examList.length && this.drawWay) {
|
||||
examNotifyNew({ examId: this.$route.params.examId }).then(resp => {
|
||||
const query = {
|
||||
group: resp.data,
|
||||
trainingId: this.examList[0].trainingId,
|
||||
userExamId: this.userExam.id,
|
||||
examQuestionId: this.examList[0].id,
|
||||
subSystem: this.$route.query.subSystem,
|
||||
examId: this.$route.params.examId,
|
||||
mapId: this.$route.query.mapId,
|
||||
lineCode: this.lineCode
|
||||
};
|
||||
this.$router.push({ path: `${UrlConfig.displayNew}/exam`, query: query });
|
||||
launchFullscreen();
|
||||
}).catch(error => {
|
||||
this.disabled = false;
|
||||
this.$messageBox( this.$t('error.createSimulationFailed') + `: ${error.message}`);
|
||||
});
|
||||
if (this.$route.query.type == 'theory') {
|
||||
this.$router.push(`/jsxt/theory/detail/${this.$route.query.mapId}`);
|
||||
} else {
|
||||
this.disabled = false;
|
||||
this.disabled = true;
|
||||
}
|
||||
},
|
||||
back() {
|
||||
this.disabled = true;
|
||||
setTimeout(() => {
|
||||
this.$router.push({ path: `${UrlConfig.trainingPlatform.course}/${this.$route.query.subSystem}`, query: {lessonId: this.examDetails.lessonId}});
|
||||
}, 100);
|
||||
this.$router.go(-1);
|
||||
}
|
||||
}
|
||||
};
|
||||
|
20
src/views/jsxt/competition/home.vue
Normal file
20
src/views/jsxt/competition/home.vue
Normal file
@ -0,0 +1,20 @@
|
||||
<template>
|
||||
<div class="">
|
||||
首页
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
export default {
|
||||
name: '',
|
||||
data() {
|
||||
return {
|
||||
|
||||
};
|
||||
}
|
||||
};
|
||||
</script>
|
||||
|
||||
<style rel="stylesheet/scss" lang="scss" scoped>
|
||||
|
||||
</style>
|
29
src/views/jsxt/competition/theory/index.vue
Normal file
29
src/views/jsxt/competition/theory/index.vue
Normal file
@ -0,0 +1,29 @@
|
||||
<template>
|
||||
<div class="">
|
||||
理论首页
|
||||
<el-button @click="startExam">开始考试</el-button>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
export default {
|
||||
name: '',
|
||||
data() {
|
||||
return {
|
||||
mapId: ''
|
||||
};
|
||||
},
|
||||
created() {
|
||||
this.mapId = this.$route.params.id;
|
||||
},
|
||||
methods: {
|
||||
startExam() {
|
||||
this.$router.push(`/jsxt/theory/detail/${this.mapId}`);
|
||||
}
|
||||
}
|
||||
};
|
||||
</script>
|
||||
|
||||
<style rel="stylesheet/scss" lang="scss" scoped>
|
||||
|
||||
</style>
|
243
src/views/jsxt/competition/theory/quiz/index.vue
Normal file
243
src/views/jsxt/competition/theory/quiz/index.vue
Normal file
@ -0,0 +1,243 @@
|
||||
<template>
|
||||
<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="commit">提 交</el-button>
|
||||
</el-button-group>
|
||||
</el-footer>
|
||||
</el-container>
|
||||
</el-container>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
// import { commitExam, getExamInfo, getUserExam, saveExamAnswer } from '@/api/exam.js';
|
||||
// import WindowResizeHandler from '@/mixin/WindowResizeHandler';
|
||||
import Question from './question';
|
||||
|
||||
export default {
|
||||
components: {
|
||||
Question
|
||||
},
|
||||
mixins: [
|
||||
// WindowResizeHandler
|
||||
],
|
||||
data() {
|
||||
return {
|
||||
index: 0,
|
||||
height: 0,
|
||||
loading: false,
|
||||
formModel: {
|
||||
description: '',
|
||||
duration: 10,
|
||||
name: '',
|
||||
status: '',
|
||||
totalScore: 0,
|
||||
passScore: 10
|
||||
},
|
||||
examQuestions: [
|
||||
{
|
||||
topic: 'PH玻璃电极只能在5~60℃范围内使用,而且还应通过温度校正装置来消除影响。',
|
||||
type: 'judge',
|
||||
optionList: [
|
||||
{id: '160', content: '√', correct: true},
|
||||
{id: '161', content: '×', correct: false}
|
||||
]
|
||||
},
|
||||
{
|
||||
topic: '调度工作是( ___ )工作中的一个重要组成部分。',
|
||||
type: 'select',
|
||||
optionList: [
|
||||
{id: '40', content: '<span style="color: windowtext;">煤矿管理</span>', correct: false},
|
||||
{id: '41', content: '<span style="color: windowtext;">企业管理</span>', correct: true},
|
||||
{id: '42', content: '<span style="color: windowtext;">安全生产</span>', correct: false},
|
||||
{id: '43', content: '<span style="color: windowtext;">生产组织</span>', correct: false}
|
||||
]
|
||||
}
|
||||
]
|
||||
};
|
||||
},
|
||||
computed: {
|
||||
examId() {
|
||||
return this.$route.params.examId;
|
||||
},
|
||||
userExamId() {
|
||||
return this.$route.params.userExamId;
|
||||
},
|
||||
question() {
|
||||
return this.examQuestions[this.index] || {};
|
||||
},
|
||||
index2UnicodeList() {
|
||||
return ['一', '二', '三', '四'];
|
||||
},
|
||||
sortedList() {
|
||||
return [
|
||||
{
|
||||
title: '判断题',
|
||||
children: this.examQuestions.filter(el => { return el.type === 'judge'; })
|
||||
},
|
||||
{
|
||||
title: '选择题',
|
||||
children: this.examQuestions.filter(el => { return el.type === 'select'; })
|
||||
}
|
||||
];
|
||||
}
|
||||
},
|
||||
watch: {
|
||||
'$router': function() {
|
||||
this.loadInitData();
|
||||
}
|
||||
},
|
||||
created() {
|
||||
this.loadInitData();
|
||||
},
|
||||
methods: {
|
||||
loadInitData() {
|
||||
console.log('获取试题详情');
|
||||
// getExamInfo(this.examId).then(resp => {
|
||||
// this.formModel = resp.data;
|
||||
// getUserExam(this.userExamId).then(rest => {
|
||||
// this.examQuestions = rest.data.map((el, i) => {
|
||||
// el.index = i;
|
||||
// return el;
|
||||
// });
|
||||
// });
|
||||
// }).catch(error => {
|
||||
// this.$message.error(`加载考试详情失败:${error.message}`);
|
||||
// });
|
||||
},
|
||||
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);
|
||||
},
|
||||
commit() {
|
||||
let isFinish = true;
|
||||
this.examQuestions.forEach(el => {
|
||||
if (!el.answer) { isFinish = false; }
|
||||
});
|
||||
|
||||
if (isFinish) {
|
||||
this.doEnd();
|
||||
} else {
|
||||
this.$confirm('存在试题未完成,是否继续?', '提 示', {
|
||||
confirmButtonText: '确 定',
|
||||
cancelButtonText: '取 消',
|
||||
type: 'warning'
|
||||
}).then(() => {
|
||||
this.doEnd();
|
||||
}).catch( () => { });
|
||||
}
|
||||
},
|
||||
doEnd() {
|
||||
// console.log('考试成绩');
|
||||
this.$router.push({ path: `/jsxt/home`});
|
||||
},
|
||||
onSave(data) {
|
||||
console.log(data, '问答题');
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
</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>
|
91
src/views/jsxt/competition/theory/quiz/question.vue
Normal file
91
src/views/jsxt/competition/theory/quiz/question.vue
Normal file
@ -0,0 +1,91 @@
|
||||
<template>
|
||||
<div class="question">
|
||||
<div class="ql-editor" v-html="appendIndex($escapeHTML(`${option.topic}`), $vnode.key)" />
|
||||
<template v-if="checkType(option, 'judge')">
|
||||
<el-radio-group v-model="answer" @change="onChnage">
|
||||
<el-radio v-for="(el,i) in option.optionList" :key="i" :label="$str2number(el.id)" style="display: inline">
|
||||
<span>{{ el.content }}</span>
|
||||
</el-radio>
|
||||
</el-radio-group>
|
||||
</template>
|
||||
<template v-else-if="checkType(option, 'select')">
|
||||
<el-radio-group v-model="answer" @change="onChnage">
|
||||
<el-radio v-for="(el,i) in option.optionList" :key="i" :label="$str2number(el.id)" style="display: block">
|
||||
<span>{{ $asc2chart(i+65) }}. </span>
|
||||
<div class="ql-editor" style="display: inline; padding: 0" v-html="$escapeHTML(el.content)" />
|
||||
</el-radio>
|
||||
</el-radio-group>
|
||||
</template>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
|
||||
export default {
|
||||
props: {
|
||||
value: {
|
||||
type: String,
|
||||
default: ''
|
||||
},
|
||||
option: {
|
||||
type: Object,
|
||||
required: true
|
||||
}
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
answer: 0
|
||||
};
|
||||
},
|
||||
watch: {
|
||||
value(val) {
|
||||
this.changeValue();
|
||||
}
|
||||
},
|
||||
mounted() {
|
||||
this.changeValue();
|
||||
},
|
||||
methods: {
|
||||
changeValue() {
|
||||
this.answer = parseInt(this.value);
|
||||
},
|
||||
checkType(option, type) {
|
||||
return option.type == type;
|
||||
},
|
||||
appendIndex(str, index) {
|
||||
return `${index + 1}. ${str}`;
|
||||
},
|
||||
onChnage(e) {
|
||||
const answer = `${e}`;
|
||||
this.$emit('input', answer);
|
||||
this.$emit('save', {userExamQuestionId: this.option.id, answer: answer});
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
</script>
|
||||
<style lang="scss" scoped>
|
||||
.rich-text {
|
||||
padding: 0;
|
||||
display: inline;
|
||||
}
|
||||
|
||||
.question {
|
||||
/deep/ {
|
||||
.ql-editor {
|
||||
line-height: 26px;
|
||||
padding: 0;
|
||||
}
|
||||
|
||||
.el-radio {
|
||||
color: #000;
|
||||
}
|
||||
|
||||
.el-radio__label {
|
||||
font-size: 16px;
|
||||
line-height: 26px;
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
</style>
|
@ -50,6 +50,7 @@ import { EventBus } from '@/scripts/event-bus';
|
||||
import ibpData from '@/ibp/constant/ibpData';
|
||||
import { timeFormat } from '@/utils/date';
|
||||
import { Message } from 'element-ui';
|
||||
import Vue from 'vue';
|
||||
|
||||
export default {
|
||||
name: 'JointTrainingDraft',
|
||||
@ -126,17 +127,17 @@ export default {
|
||||
this.setPosition();
|
||||
if (val === '01' && this.$route.query.lineCode === '06') {
|
||||
this.showSelectStation = true;
|
||||
// this.mapViewLoadedOver && this.$refs.mapCanvas && this.$refs.mapCanvas.setShowStation(this.showStation);
|
||||
this.mapViewLoadedOver && this.setShowStation(this.showStation);
|
||||
} else if (val === '02' && this.$route.query.lineCode === '06') {
|
||||
this.showSelectStation = false;
|
||||
// this.mapViewLoadedOver && this.$refs.mapCanvas && this.$refs.mapCanvas.setShowStation('');
|
||||
this.mapViewLoadedOver && this.setShowStation('');
|
||||
}
|
||||
},
|
||||
'$store.state.map.mapViewLoadedCount': function (val) {
|
||||
this.mapBoxP = document.getElementById(this.canvasId).children[0];
|
||||
this.mapBoxP.style.cursor = '';
|
||||
this.mapViewLoadedOver = true;
|
||||
// this.showSelectStation && this.$refs.mapCanvas && this.$refs.mapCanvas.setShowStation(this.showStation);
|
||||
this.showSelectStation && this.setShowStation(this.showStation);
|
||||
},
|
||||
'$store.state.socket.permissionOver': function () {
|
||||
this.$alert(this.$t('tip.userRightsHaveBeenReclaimed'), this.$t('tip.hint'), {
|
||||
@ -436,7 +437,18 @@ export default {
|
||||
},
|
||||
switchStationMode(val) {
|
||||
this.showStation = val;
|
||||
// this.$refs.mapCanvas && this.$refs.mapCanvas.setShowStation(this.showStation);
|
||||
this.setShowStation(this.showStation);
|
||||
},
|
||||
setShowStation(val) {
|
||||
const nameList = Object.keys(this.$store.state.map.map);
|
||||
let list = [];
|
||||
nameList.forEach(item => {
|
||||
if (this.$store.state.map.map[item] && this.$store.state.map.map[item].constructor === Array) {
|
||||
list = [...list, ...this.$store.state.map.map[item]];
|
||||
}
|
||||
});
|
||||
Vue.prototype.$jlmap.updateShowStation(list, val);
|
||||
Vue.prototype.$jlmap.setCenter(val);
|
||||
},
|
||||
setStationList(val) {
|
||||
this.stationList = [];
|
||||
|
@ -10,7 +10,7 @@
|
||||
>
|
||||
<el-option v-for="item in swchList" :key="item.value" :label="item.name" :value="item.value" />
|
||||
</el-select>
|
||||
<el-select v-if="showSelectStation" v-model="showStation" style="width: 100px;" size="small" @change="switchStationMode">
|
||||
<el-select v-if="showSelectStation" v-model="chiShowStation" style="width: 100px;" size="small" @change="switchStationMode">
|
||||
<el-option v-for="item in stationList" :key="item.value" :label="item.name" :value="item.value" />
|
||||
</el-select>
|
||||
<el-button-group>
|
||||
@ -91,6 +91,7 @@ export default {
|
||||
viewDisabled: true,
|
||||
realData: {},
|
||||
series: [],
|
||||
chiShowStation: '',
|
||||
kmRangeCoordMap: {},
|
||||
runPlanData: {},
|
||||
swch: '02',
|
||||
@ -156,6 +157,7 @@ export default {
|
||||
});
|
||||
},
|
||||
switchMode(swch) {
|
||||
this.chiShowStation = this.showStation;
|
||||
this.$store.dispatch('training/setPrdType', swch);
|
||||
},
|
||||
initPlannedDriving(isDisable) {
|
||||
|
@ -31,6 +31,11 @@
|
||||
</el-collapse-item>
|
||||
<el-collapse-item title="设置信号机类型" name="2">
|
||||
<el-form ref="signalType" label-width="130px" :model="typeModel" size="mini" style="margin-top: 40px">
|
||||
<el-form-item label="设置信号机范围:" prop="scope">
|
||||
<el-select v-model="typeModel.scope" placeholder="请选择">
|
||||
<el-option v-for="item in signalScopeList" :key="item.code" :label="item.name" :value="item.code" />
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="信号机类型:" prop="type">
|
||||
<el-select v-model="typeModel.type" placeholder="请选择">
|
||||
<el-option v-for="item in signalTypeList" :key="item.code" :label="item.name" :value="item.code" />
|
||||
@ -127,6 +132,11 @@ export default {
|
||||
{ code: 'BLOCKING', name: '阻挡信号机'},
|
||||
{ code: 'PASSING', name: '通过信号机'}
|
||||
],
|
||||
signalScopeList: [
|
||||
{ code: 'All', name: '全部信号机'},
|
||||
{ code: 'Virtual', name: '虚拟信号机'},
|
||||
{ code: 'NoVirtual', name: '非虚拟信号机'}
|
||||
],
|
||||
questionList: [],
|
||||
field:'',
|
||||
editModel: {
|
||||
@ -162,6 +172,7 @@ export default {
|
||||
number: 2
|
||||
},
|
||||
typeModel: {
|
||||
scope: 'All',
|
||||
type: 'PROTECTION'
|
||||
},
|
||||
ciModel: {
|
||||
@ -421,9 +432,11 @@ export default {
|
||||
setAllSignalType(val) {
|
||||
const models = [];
|
||||
this.signalList.forEach(item => {
|
||||
const signalModel = deepAssign({}, item); // 深拷贝
|
||||
signalModel.type = this.typeModel.type;
|
||||
models.push(signalModel);
|
||||
if (this.typeModel.scope === 'All' || (this.typeModel.scope === 'Virtual' && item.virtual) || (this.typeModel.scope === 'NoVirtual' && !item.virtual)) {
|
||||
const signalModel = deepAssign({}, item); // 深拷贝
|
||||
signalModel.type = this.typeModel.type;
|
||||
models.push(signalModel);
|
||||
}
|
||||
});
|
||||
this.$emit('updateMapModel', models);
|
||||
this.$message.success('数据构建成功!');
|
||||
|
@ -60,7 +60,7 @@
|
||||
</el-form-item>
|
||||
<el-form-item :label="$t('scriptRecord.executeCommand')" class="conditionVO">
|
||||
<el-input v-model="executeCommandName" disabled style="width:130px" />
|
||||
<el-button :type="field === 'commandActive' ? 'danger' : 'primary'" size="small" @click="hover('commandActive')">{{ $t('map.activate') }}</el-button>
|
||||
<!-- <el-button :type="field === 'commandActive' ? 'danger' : 'primary'" size="small" @click="hover('commandActive')">{{ $t('map.activate') }}</el-button> -->
|
||||
<div class="el-form-item__error">{{ messageTips2 }}</div>
|
||||
</el-form-item>
|
||||
<el-form-item>
|
||||
|
Loading…
Reference in New Issue
Block a user