This commit is contained in:
zyy 2020-05-27 14:14:00 +08:00
commit 3a68650a89
6 changed files with 235 additions and 21 deletions

View File

@ -4,7 +4,7 @@
class="xian-02__system train-move"
:title="title"
:visible.sync="show"
width="360px"
width="760px"
:before-close="doClose"
:z-index="2000"
:modal="false"
@ -15,20 +15,29 @@
<el-col :span="12">追踪号:</el-col>
</el-row>
<el-row>
<el-col :span="12">
<el-input :id="domIdInput" v-model="addModel.groupNumber" style="width: 100px;" @change="inputGroupNumber" />
</el-col>
<el-col :span="12">
<el-input :id="domIdInput" v-model="addModel.groupNumber" style="width: 100px;" @change="inputGroupNumber" />
</el-col>
</el-row>
<el-row>
<el-col :span="12">实际的DID</el-col>
<el-col :span="12">
<el-input :id="domIdInput" v-model="addModel.groupNumber" @change="inputGroupNumber" />
</el-col>
</el-row>
<el-row>
<el-col :span="12">车站</el-col>
<el-col :span="11" :offset="1">车次窗</el-col>
<el-col :span="12">被请求的DID</el-col>
<el-col :span="12">
<el-input :id="domIdInput" v-model="addModel.groupNumber" @change="inputGroupNumber" />
</el-col>
</el-row>
<el-row>
<el-col :span="12">DID浏览选项</el-col>
<el-col :span="12">
<el-input v-model="addModel.stationName" :disabled="true" />
</el-col>
<el-col :span="11" :offset="1">
<el-input v-model="addModel.trainWindowCode" :disabled="true" />
<el-input :id="domIdInput" v-model="addModel.groupNumber" @change="inputGroupNumber" />
</el-col>
</el-row>
<el-row justify="center" class="button-group">

View File

@ -1,7 +1,7 @@
<template>
<div style="width: 100%;height: 100%;">
<div style="margin-top: 10px;position: absolute; right: 50px;">
<el-button size="small" type="primary">导出试题</el-button>
<el-button size="small" type="primary" @click="exportPaper">导出试题</el-button>
<el-button size="small" type="primary" @click="goBack">返回</el-button>
</div>
<el-card style="width: 45%;margin-left: 50px;margin-top: 60px;display: inline-block;height: calc(100% - 100px);">
@ -13,10 +13,12 @@
<el-table
:data="theoryQuestionList"
style="width: 100%"
height="100%"
>
<el-table-column
prop="type"
label="类型"
width="100"
>
<template slot-scope="scope">
<el-tag
@ -32,14 +34,15 @@
<el-table-column
prop="score"
label="分值"
width="100"
>
<template slot-scope="scope">
<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)" />
<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)" />
<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)" />
</template>
</el-table-column>
<el-table-column prop="operate" label="操作11">
<el-table-column prop="operate" label="操作" width="100">
<template slot-scope="scope">
<el-button type="warning" size="mini" @click="removeTheoryQuestion(scope)">移出</el-button>
</template>
@ -55,6 +58,7 @@
<el-table
:data="operateQuestionList"
style="width: 100%"
height="100%"
>
<el-table-column
prop="name"
@ -66,7 +70,9 @@
/>
<el-table-column prop="score" label="分值">
<template slot-scope="scope">
<el-input v-model="scope.row.score" size="small" />
<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)" />
<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)" />
</template>
</el-table-column>
<el-table-column prop="operate" label="操作">
@ -76,6 +82,7 @@
</el-table-column>
</el-table>
</el-card>
<set-exam-time ref="setExamTime" :theory-question-list="theoryQuestionList" :operate-question-list="operateQuestionList" />
<theory-review ref="theoryReview" :theory-question-list="theoryQuestionList" />
<theory-question ref="theoryQuestion" :theory-index-list="theoryIndexList" @addQuestion="addTheoryQuestionList" @removeQuestion="removeTheoryQuestion" />
<operate-question ref="operateQuestion" :operate-index-list="operateIndexList" @addQuestion="addOperateQuestionList" @removeQuestion="removeOperateQuestion" />
@ -86,9 +93,11 @@
import TheoryReview from './theoryReview';
import TheoryQuestion from './theoryQuestion';
import OperateQuestion from './operateQuestion';
import SetExamTime from './setExamTime';
export default {
name: 'GeneratPaper',
components: {
SetExamTime,
TheoryReview,
TheoryQuestion,
OperateQuestion
@ -141,16 +150,23 @@ export default {
editScope(row) {
this.$set(row, 'editScope', true);
this.$nextTick(() => {
this.$refs['input' + row.id].focus();
this.$set(row, 'editFocus', true);
});
},
editScopeBlur(row) {
this.$set(row, 'editScope', false);
this.$set(row, 'editFocus', true);
},
exportPaper() {
this.$refs.setExamTime.doShow();
}
}
};
</script>
<style scoped>
/deep/
.el-card__body{
height: calc(100% - 50px);
}
</style>

View File

@ -19,13 +19,18 @@ export default {
default() {
return '';
}
},
raceList:{
type: Array,
default() {
return '';
}
}
},
data() {
return {
dialogVisible: false,
mapList: [],
taskStatusList: [],
isEdit:false,
formModel: {
name: '',
mapId: '',
@ -34,11 +39,19 @@ export default {
};
},
computed: {
raceInfoList() {
const racelist = [];
this.raceList.forEach(each=>{
racelist.push({label:each.name, value:each.id});
});
return racelist;
},
form() {
const form = {
labelWidth: '120px',
items: [
{ prop: 'name', label: '实操名称', type: 'text' },
{ prop:'raceId', label:'竞赛名称', type:'select', options:this.raceInfoList, disabled:this.isEdit},
{ prop: 'description', label: '实操描述', type: 'textarea' }
]
};
@ -53,6 +66,9 @@ export default {
description: [
{ validator: this.validateDescription, trigger: 'blur' },
{ validator: this.validateDescription, trigger: 'change' }
],
raceId:[
{ required: true, message: '请选择竞赛', trigger: 'change' }
]
};
return crules;
@ -82,12 +98,13 @@ export default {
this.formModel = data;
this.formModel.id = questid;
this.dialogVisible = true;
this.isEdit = true;
});
} else {
this.formModel.mapId = this.$route.params.mapId;
this.dialogVisible = true;
this.isEdit = false;
}
},
doCreate() {
const self = this;

View File

@ -1,8 +1,8 @@
<template>
<div>
<query-list-page ref="user" :pager-config="pagerConfig" :query-form="queryForm" :query-list="queryList" />
<create-practice ref="createPractice" title="创建实操" @reloadTable="reloadTable" @create="handleConfirmCreate" />
<create-practice ref="modifyPractice" title="修改实操" @reloadTable="reloadTable" @create="handleConfirmModify" />
<create-practice ref="createPractice" :race-list="raceList" title="创建实操" @reloadTable="reloadTable" @create="handleConfirmCreate" />
<create-practice ref="modifyPractice" :race-list="raceList" title="修改实操" @reloadTable="reloadTable" @create="handleConfirmModify" />
</div>
</template>
<script>
@ -132,7 +132,8 @@ export default {
}).catch(() => { });
},
doRecord(index, row) {
practiceRecordNotify(row.id).then(resp => {
// row.id
practiceRecordNotify(83).then(resp => {
const query = { mapId: row.mapId, group: resp.data, scriptId: row.id, lang:row.lang, lineCode:this.$route.query.lineCode};
this.$router.push({ path: `${UrlConfig.practiceDisplayNew}/practice`, query });
launchFullscreen();

View File

@ -0,0 +1,173 @@
<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 = {
operateQuestionList: this.operateQuestionList,
theoryQuestionList: this.theoryQuestionList,
raceId: this.$route.query.raceId,
theoryExamTime: this.form.theoryExamTime,
operateExamTime: this.form.operateExamTime
};
console.log(exportData, '11111111');
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

@ -24,8 +24,6 @@ export default {
data() {
return {
dialogVisible: false,
mapList: [],
taskStatusList: [],
formModel: {
name: '',
mapId: '',