This commit is contained in:
zyy 2020-05-27 11:15:31 +08:00
commit b4c6c2a5dd
6 changed files with 240 additions and 45 deletions

View File

@ -70,7 +70,7 @@ export function deletePractice(id) {
/** 录制实操试题 */ /** 录制实操试题 */
export function practiceRecordNotify(practiceId) { export function practiceRecordNotify(practiceId) {
return request({ return request({
url: `/api/simulation/scriptWrite/${practiceId}`, url: `/api/scriptSimulation/${practiceId}/scriptWrite`,
method: 'get' method: 'get'
}); });
} }

View File

@ -19,7 +19,7 @@ function hasPermission(roles, permissionRoles) {
const whiteList = ['/login', '/design/login', '/gzzbxy/relay']; // 不重定向白名单 const whiteList = ['/login', '/design/login', '/gzzbxy/relay']; // 不重定向白名单
const designPageRegex = [/^\/design/, /^\/scriptDisplay/, /^\/publish/, /^\/orderauthor/, /^\/system/, /^\/iscs/, /^\/display\/record/, /^\/display\/manage/, /^\/apply/, /^\/plan/, /^\/display\/plan/, /^\/displayNew\/record/, /^\/displayNew\/manage/, /^\/displayNew\/plan/]; const designPageRegex = [/^\/design/, /^\/scriptDisplay/, /^\/publish/, /^\/orderauthor/, /^\/system/, /^\/iscs/, /^\/display\/record/, /^\/display\/manage/, /^\/apply/, /^\/plan/, /^\/display\/plan/, /^\/displayNew\/record/, /^\/displayNew\/manage/, /^\/displayNew\/plan/, /^\/practiceDisplayNew/];
function isDesignPage(toRoutePath) { function isDesignPage(toRoutePath) {
return designPageRegex.some(item => item.test(toRoutePath) ); return designPageRegex.some(item => item.test(toRoutePath) );

View File

@ -36,7 +36,7 @@
<template slot-scope="scope"> <template slot-scope="scope">
<span v-if="!scope.row.editScope" @click="editScope(scope.row)">{{ scope.row.score }}</span> <span v-if="!scope.row.editScope" @click="editScope(scope.row)">{{ scope.row.score }}</span>
<i v-if="!scope.row.editScope" class="el-icon-edit" @click="editScope(scope.row)" /> <i v-if="!scope.row.editScope" class="el-icon-edit" @click="editScope(scope.row)" />
<el-input v-if="scope.row.editScope" v-model="scope.row.score" v-focus="scope.row.editFocus" size="small" style="width: 50px;" @blur="editScopeBlur(scope.row)" /> <el-input v-if="scope.row.editScope" :ref="'input'+scope.row.id" v-model="scope.row.score" size="small" style="width: 50px;" @blur="editScopeBlur(scope.row)" />
</template> </template>
</el-table-column> </el-table-column>
<el-table-column prop="operate" label="操作11"> <el-table-column prop="operate" label="操作11">
@ -49,7 +49,7 @@
<el-card style="width: 45%;margin-left: calc(10% - 100px);margin-top: 60px;display: inline-block;height: calc(100% - 100px);"> <el-card style="width: 45%;margin-left: calc(10% - 100px);margin-top: 60px;display: inline-block;height: calc(100% - 100px);">
<div slot="header"> <div slot="header">
<span>实操试题列表</span> <span>实操试题列表</span>
<el-button style="float: right; padding: 3px 0" type="text">添加试题</el-button> <el-button style="float: right; padding: 3px 0" type="text" @click="addOperateQuestion">添加试题</el-button>
<el-button style="float: right; padding: 3px 0;margin-right: 5px" type="text" @click="operateReview">预览</el-button> <el-button style="float: right; padding: 3px 0;margin-right: 5px" type="text" @click="operateReview">预览</el-button>
</div> </div>
<el-table <el-table
@ -57,19 +57,12 @@
style="width: 100%" style="width: 100%"
> >
<el-table-column <el-table-column
prop="type" prop="name"
label="类型" label="实操名称"
> />
<template slot-scope="scope">
<el-tag
type="primary"
disable-transitions
>{{ QuestionTypeMap[scope.row.type] }}</el-tag>
</template>
</el-table-column>
<el-table-column <el-table-column
prop="topic" prop="creatorName"
label="题目" label="创建人"
/> />
<el-table-column prop="score" label="分值"> <el-table-column prop="score" label="分值">
<template slot-scope="scope"> <template slot-scope="scope">
@ -85,17 +78,20 @@
</el-card> </el-card>
<theory-review ref="theoryReview" :theory-question-list="theoryQuestionList" /> <theory-review ref="theoryReview" :theory-question-list="theoryQuestionList" />
<theory-question ref="theoryQuestion" :theory-index-list="theoryIndexList" @addQuestion="addTheoryQuestionList" @removeQuestion="removeTheoryQuestion" /> <theory-question ref="theoryQuestion" :theory-index-list="theoryIndexList" @addQuestion="addTheoryQuestionList" @removeQuestion="removeTheoryQuestion" />
<operate-question ref="operateQuestion" :operate-index-list="operateIndexList" @addQuestion="addOperateQuestionList" @removeQuestion="removeOperateQuestion" />
</div> </div>
</template> </template>
<script> <script>
import TheoryReview from './theoryReview'; import TheoryReview from './theoryReview';
import TheoryQuestion from './theoryQuestion'; import TheoryQuestion from './theoryQuestion';
import OperateQuestion from './operateQuestion';
export default { export default {
name: 'GeneratPaper', name: 'GeneratPaper',
components: { components: {
TheoryReview, TheoryReview,
TheoryQuestion TheoryQuestion,
OperateQuestion
}, },
data() { data() {
return { return {
@ -131,6 +127,9 @@ export default {
addTheoryQuestion() { addTheoryQuestion() {
this.$refs.theoryQuestion.doShow(); this.$refs.theoryQuestion.doShow();
}, },
addOperateQuestion() {
this.$refs.operateQuestion.doShow();
},
goBack() { goBack() {
this.$router.go(-1); this.$router.go(-1);
}, },
@ -142,13 +141,11 @@ export default {
editScope(row) { editScope(row) {
this.$set(row, 'editScope', true); this.$set(row, 'editScope', true);
this.$nextTick(() => { this.$nextTick(() => {
this.$set(row, 'editFocus', true); this.$refs['input' + row.id].focus();
console.log(row);
}); });
}, },
editScopeBlur(row) { editScopeBlur(row) {
this.$set(row, 'editScope', false); this.$set(row, 'editScope', false);
this.$set(row, 'editFocus', false);
} }
} }
}; };

View File

@ -0,0 +1,218 @@
<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>
export default {
mixins: [
// WindowResizeHandler
],
props: {
operateIndexList: {
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: {
name: {
type: 'text',
label: '实操名称'
}
}
},
queryList: {
// query: getPracticeList,
data:[
{id:1, raceId:2, name:'行调进行扣车操作', creatorName:'水墨'},
{id:2, raceId:4, name:'行调进行扣车操作', creatorName:'zyy'},
{id:3, raceId:3, name:'行调进行扣车操作', creatorName:'水墨'}
],
selectCheckShow: false,
indexShow: true,
columns: [
{
title: '实操名称',
prop: 'name'
},
{
title: '创建人',
prop: 'creatorName',
width: '100'
},
{
type: 'button',
title: '操 作',
width: '420',
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);
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.operateIndexList.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

@ -3,7 +3,7 @@
<div class="script-card" :style="{width: widthLeft+'px'}"> <div class="script-card" :style="{width: widthLeft+'px'}">
<practice-record ref="tipTaskRecord" :group="group" :width="widthLeft" /> <practice-record ref="tipTaskRecord" :group="group" :width="widthLeft" />
</div> </div>
<drap-left :width-left="widthLeft" :min="780" :max="980" @drapWidth="drapWidth" /> <drap-left :width-left="widthLeft" :min="480" :max="580" @drapWidth="drapWidth" />
<div class="script-display"> <div class="script-display">
<display ref="display" :size="size" /> <display ref="display" :size="size" />
</div> </div>
@ -24,9 +24,9 @@ export default {
}, },
data() { data() {
return { return {
widthLeft: 780, widthLeft: 480,
size: { size: {
width: document.documentElement.clientWidth - 780, width: document.documentElement.clientWidth - 480,
height: document.documentElement.clientHeight height: document.documentElement.clientHeight
}, },
group: this.$route.query.group group: this.$route.query.group
@ -34,7 +34,7 @@ export default {
}, },
watch: { watch: {
'$store.state.app.windowSizeCount': function() { '$store.state.app.windowSizeCount': function() {
this.size = { width: this.$store.state.app.width - 780, height: this.$store.state.app.height}; this.size = { width: this.$store.state.app.width - 480, height: this.$store.state.app.height};
}, },
widthLeft: function(val) { widthLeft: function(val) {
this.size = { width: this.$store.state.app.width - val, height: this.$store.state.app.height}; this.size = { width: this.$store.state.app.width - val, height: this.$store.state.app.height};

View File

@ -57,27 +57,7 @@ export default {
status: '', status: '',
totalScore: 0, totalScore: 0,
passScore: 10 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: { computed: {