yujialong 4 years ago
parent 0694358cf3
commit 34edeb2af3
  1. 6
      src/components/testPaperDetail/index.vue
  2. 11
      src/layouts/navbar/index.vue
  3. 20
      src/pages/achievement/statistics/index.vue
  4. 5
      src/pages/assessment/list/index.vue
  5. 1
      src/pages/assessment/monitor/index.vue
  6. 4
      src/pages/index/list/index.vue
  7. 8
      src/pages/practice/list/index.vue
  8. 41
      src/pages/testPaper/add/index.vue
  9. 21
      src/pages/testPaper/list/myTestPaper.vue
  10. 2
      src/setting.js
  11. 7
      src/styles/common.scss

@ -1,6 +1,6 @@
<template> <template>
<div class="box"> <div class="box">
<breadcrumb :data="'试卷管理/试卷预览'"></breadcrumb> <breadcrumb :data="'试卷管理/试卷预览'" v-if="!isDia"></breadcrumb>
<div class="page"> <div class="page">
<div class="page-content"> <div class="page-content">
<h1 class="title">{{paperName}}</h1> <h1 class="title">{{paperName}}</h1>
@ -56,12 +56,10 @@
</div> </div>
</template> </template>
<script> <script>
import mixins from '@/mixins/setBackground'
import { mapState } from 'vuex' import { mapState } from 'vuex'
import breadcrumb from '@/components/breadcrumb' import breadcrumb from '@/components/breadcrumb'
export default { export default {
props: ['data'], props: ['data','isDia'],
mixins: [ mixins ],
data() { data() {
return { return {
assPaperName: '', assPaperName: '',

@ -91,11 +91,11 @@ export default {
index: '/achievement/list', index: '/achievement/list',
title: '成绩管理' title: '成绩管理'
}, },
{ // {
icon: 'menu-icon icon-msg', // icon: 'menu-icon icon-msg',
index: '/messageBoard/list', // index: '/messageBoard/list',
title: '交流互动' // title: ''
}, // },
{ {
icon: 'menu-icon icon-student', icon: 'menu-icon icon-student',
index: '/student/list', index: '/student/list',
@ -112,6 +112,7 @@ export default {
testPaper: ['testPaper-add','testPaper-show'], testPaper: ['testPaper-add','testPaper-show'],
practice: ['practice-review','practice-result','practice-doReview','practice-scoreQuery','practice-detail'], practice: ['practice-review','practice-result','practice-doReview','practice-scoreQuery','practice-detail'],
assessment: ['assessment-monitor','assessment-review','assessment-doReview','assessment-scoreQuery','assessment-detail'], assessment: ['assessment-monitor','assessment-review','assessment-doReview','assessment-scoreQuery','assessment-detail'],
achievement: ['achievement-statistics'],
} }
} }
}, },

@ -108,6 +108,7 @@ export default {
totalScore: '', totalScore: '',
}, },
statData: [], statData: [],
listDataAll: [],
listData: [], listData: [],
page: 1, page: 1,
pageSize: 10, pageSize: 10,
@ -165,9 +166,13 @@ export default {
}) })
}, },
getList() { getList() {
this.$get(`${this.api.getRanking}?pageNum=${this.page}&pageSize=${this.pageSize}&assessmentId=${this.assessmentId}`) this.$get(`${this.api.getRanking}?pageNum=${this.page}&pageSize=10000&assessmentId=${this.assessmentId}`)
.then(res => { .then(res => {
let list = res.data.list.list let temp = res.data.list.list
let list = []
temp.map(n => {
n.classId == this.classId && list.push(n)
})
let len = list.length - 1 let len = list.length - 1
for(let i = 0; i < len; i++){ for(let i = 0; i < len; i++){
for(let j = 0; j < len; j++){ for(let j = 0; j < len; j++){
@ -181,14 +186,19 @@ export default {
let hasRank = list.filter(n => n.rank) let hasRank = list.filter(n => n.rank)
let notRank = list.filter(n => !n.rank) let notRank = list.filter(n => !n.rank)
list = [...hasRank,...notRank] list = [...hasRank,...notRank]
this.listData = list this.listDataAll = list
this.total = res.data.list.totalCount this.total = list.length
this.handlePage()
}) })
.catch(err => {}) .catch(err => {})
}, },
handlePage(){
let list = this.listDataAll
this.listData = list.slice((this.page - 1) * this.pageSize,this.page * this.pageSize)
},
handleCurrentChange(val) { handleCurrentChange(val) {
this.page = val this.page = val
this.getList() this.handlePage()
}, },
exportData(){ exportData(){
location.href = `${this.api.getRankingExport}?assessmentId=${this.assessmentId}` location.href = `${this.api.getRankingExport}?assessmentId=${this.assessmentId}`

@ -171,8 +171,8 @@
</span> </span>
</el-dialog> </el-dialog>
<el-dialog title="试卷详情" :visible.sync="previewVisible" width="90%"> <el-dialog title="试卷详情" :visible.sync="previewVisible" custom-class="testpaperDia" top="140px">
<test-paper-detail :key="previewId"></test-paper-detail> <test-paper-detail :isDia="true" :key="previewId"></test-paper-detail>
</el-dialog> </el-dialog>
</div> </div>
</template> </template>
@ -495,7 +495,6 @@ export default {
finish(row){ finish(row){
this.$confirm('是否结束此次考试?', '提示', { this.$confirm('是否结束此次考试?', '提示', {
type: 'warning', type: 'warning',
customClass: 'normal'
}).then(() => { }).then(() => {
this.$post(`${this.api.compulsory}?id=${row.id}`).then(res => { this.$post(`${this.api.compulsory}?id=${row.id}`).then(res => {
util.successMsg('结束成功') util.successMsg('结束成功')

@ -210,7 +210,6 @@ export default {
if(this.listData.length){ if(this.listData.length){
this.$confirm('是否强制终止此次考试?', '提示', { this.$confirm('是否强制终止此次考试?', '提示', {
type: 'warning', type: 'warning',
customClass: 'normal'
}).then(() => { }).then(() => {
this.$post(`${this.api.compulsory}?id=${this.id}`).then(res => { this.$post(`${this.api.compulsory}?id=${this.id}`).then(res => {
util.successMsg('强制收卷成功') util.successMsg('强制收卷成功')

@ -91,7 +91,7 @@
</div> </div>
</div> </div>
<div class="page"> <!-- <div class="page">
<div class="tabs"> <div class="tabs">
<a class="item active">待回复的提问</a> <a class="item active">待回复的提问</a>
</div> </div>
@ -124,7 +124,7 @@
</template> </template>
<div class="none" v-else>暂无待回复的提问</div> <div class="none" v-else>暂无待回复的提问</div>
</div> </div>
</div> </div> -->
<el-dialog title="编辑班级" :visible.sync="classVisible" width="24%" center :close-on-click-modal="false"> <el-dialog title="编辑班级" :visible.sync="classVisible" width="24%" center :close-on-click-modal="false">
<el-input placeholder="请输入班级名称" v-model="curClass.className"></el-input> <el-input placeholder="请输入班级名称" v-model="curClass.className"></el-input>

@ -114,8 +114,8 @@
</span> </span>
</el-dialog> </el-dialog>
<el-dialog title="试卷详情" :visible.sync="previewVisible" width="95%" custom-class="testpaperDia"> <el-dialog title="试卷详情" :visible.sync="previewVisible" custom-class="testpaperDia" top="140px">
<test-paper-detail :key="previewId"></test-paper-detail> <test-paper-detail :isDia="true" :key="previewId"></test-paper-detail>
</el-dialog> </el-dialog>
</div> </div>
</template> </template>
@ -477,8 +477,4 @@ export default {
} }
} }
} }
// /deep/.testpaperDia{
// width: calc(100% - 220px) !important;
// margin-left: 240px;
// }
</style> </style>

@ -172,6 +172,7 @@
</el-table-column> </el-table-column>
<el-table-column prop="name" label="试题类型" align="center"></el-table-column> <el-table-column prop="name" label="试题类型" align="center"></el-table-column>
<el-table-column prop="courses" label="对应课程" align="center"></el-table-column> <el-table-column prop="courses" label="对应课程" align="center"></el-table-column>
<el-table-column prop="typeName" label="所属题库" min-width="140" align="center"></el-table-column>
<el-table-column prop="knowledgePoints" label="知识点" align="center"></el-table-column> <el-table-column prop="knowledgePoints" label="知识点" align="center"></el-table-column>
<el-table-column prop="useNum" label="使用次数" width="100" align="center"></el-table-column> <el-table-column prop="useNum" label="使用次数" width="100" align="center"></el-table-column>
<el-table-column prop="createTime" label="上传时间" width="150" align="center"></el-table-column> <el-table-column prop="createTime" label="上传时间" width="150" align="center"></el-table-column>
@ -240,8 +241,8 @@
</span> </span>
</el-dialog> </el-dialog>
<el-dialog title="试卷预览" :visible.sync="previewVisible" fullscreen> <el-dialog title="试卷预览" :visible.sync="previewVisible" custom-class="testpaperDia" top="140px">
<test-paper :data="previewList" :key="previewIndex"></test-paper> <test-paper :data="previewList" :isDia="true" :key="previewIndex"></test-paper>
</el-dialog> </el-dialog>
</div> </div>
</template> </template>
@ -334,7 +335,8 @@ export default {
countCheck5: false, countCheck5: false,
}, },
pointRules: [30,20,10,10,2], pointRules: [30,20,10,10,2],
selectedData: [] selectedData: [],
isOpen: false
}; };
}, },
components: {testPaper,breadcrumb}, components: {testPaper,breadcrumb},
@ -489,7 +491,7 @@ export default {
if(this.type == 0){ if(this.type == 0){
this.getSelectFilter() this.getSelectFilter()
this.getType() this.getType()
this.getQuesBank() // this.getQuesBank()
this.getManualData() this.getManualData()
this.manualVisible = true this.manualVisible = true
}else{ }else{
@ -515,10 +517,37 @@ export default {
n.questionStem = n.questionStem.replace(/\(\)\(\)\(\)/g,`______`) n.questionStem = n.questionStem.replace(/\(\)\(\)\(\)/g,`______`)
}) })
this.listData = list this.listData = list
if(!this.isOpen) this.getCourse()
this.isOpen = true
this.total = res.data.list.totalCount this.total = res.data.list.totalCount
this.$refs.listTable.clearSelection() this.$refs.listTable.clearSelection()
}).catch(err => {}) }).catch(err => {})
}, },
getCourse(){
let data = {
courses: this.selectManual.courses,
knowledgePoints: this.selectManual.knowledgePoints,
name: this.selectManual.name,
pageNum: this.page,
pageSize: 10000,
questionStem: this.keyword,
typeName: this.selectManual.typeName,
userId: this.userId,
}
this.$post(this.api.pageByChoiceList,data).then(res => {
let list = res.data.list.list
let quesBankList = []
list.map(n => {
quesBankList.includes(n.typeName) || quesBankList.push(n.typeName)
})
this.quesBankList = quesBankList.map(n => {
return {
typeName: n
}
})
}).catch(err => {})
},
initData(){ initData(){
this.page = 1 this.page = 1
this.getManualData() this.getManualData()
@ -596,8 +625,7 @@ export default {
schoolId: this.clientId, schoolId: this.clientId,
source: 2 source: 2
} }
this.$post(this.api.listByPage,data) this.$post(this.api.listByPage,data).then(res => {
.then(res => {
let list = res.data.list.list let list = res.data.list.list
let result = list let result = list
list.map((n,i) => { list.map((n,i) => {
@ -655,6 +683,7 @@ export default {
this.$refs.selectedTable.clearSelection() this.$refs.selectedTable.clearSelection()
this.keyword = '' this.keyword = ''
this.page = 1 this.page = 1
this.isOpen = false
}, },
getInteData() { getInteData() {
let data = { let data = {

@ -40,9 +40,6 @@
<span class="index">{{index+1}}.</span> <span class="index">{{index+1}}.</span>
<div v-html="item.questionStem"></div> <div v-html="item.questionStem"></div>
</div> </div>
<div class="options">
<p v-for="(option,i) in item.options" :key="i">{{i}}.{{item.options[i]}}</p>
</div>
</li> </li>
</ul> </ul>
</li> </li>
@ -68,9 +65,6 @@
<span class="index">{{index+1}}.</span> <span class="index">{{index+1}}.</span>
<div v-html="item.questionStem"></div> <div v-html="item.questionStem"></div>
</div> </div>
<div class="options">
<p v-for="(option,i) in item.options" :key="i">{{i}}.{{item.options[i]}}</p>
</div>
</li> </li>
</ul> </ul>
</li> </li>
@ -175,9 +169,9 @@ function getUrlBase64(url, ext, callback) {
img.crossOrigin = 'Anonymous'; img.crossOrigin = 'Anonymous';
img.src = url; img.src = url;
img.onload = function () { img.onload = function () {
canvas.height = 60; //, canvas.height = 300; //,
canvas.width = 85; // canvas.width = 300; //
ctx.drawImage(img, 0, 0, 60, 85); // ctx.drawImage(img, 0, 0, 300, 300); //
var dataURL = canvas.toDataURL("image/" + ext); var dataURL = canvas.toDataURL("image/" + ext);
callback.call(this, dataURL); //Base64 callback.call(this, dataURL); //Base64
canvas = null; canvas = null;
@ -327,8 +321,7 @@ export default {
this.loading = true this.loading = true
this.exportVisible = true this.exportVisible = true
this.paperName = row.name this.paperName = row.name
this.$post(`${this.api.previewtestPaper}?id=${row.id}`) this.$post(`${this.api.previewtestPaper}?id=${row.id}`).then(res => {
.then(res => {
let list = res.data let list = res.data
let reg = /<img src=".*?">/gi let reg = /<img src=".*?">/gi
let index = 0 let index = 0
@ -342,9 +335,10 @@ export default {
list[i].map(n => { list[i].map(n => {
let src = reg.exec(n.questionStem) let src = reg.exec(n.questionStem)
if(src){ if(src){
console.log(11,src,src[0],reg.lastIndex)
src = src[0].replace('<img src="','').replace('">','') src = src[0].replace('<img src="','').replace('">','')
getUrlBase64(src, 'jpg', function (base64) { getUrlBase64(src, 'jpg', function (base64) {
n.questionStem = n.questionStem.replace(reg,`<img src="${base64}">`) n.questionStem = n.questionStem.replace(reg,`<img width="300" src="${base64}">`)
}) })
} }
}) })
@ -355,7 +349,8 @@ export default {
this.$nextTick(() => { this.$nextTick(() => {
setTimeout(() => { setTimeout(() => {
html2Canvas(document.querySelector('#pdfDom'), { html2Canvas(document.querySelector('#pdfDom'), {
allowTaint: true allowTaint: true,
tainttest : true,
}).then(canvas => { }).then(canvas => {
let contentWidth = canvas.width let contentWidth = canvas.width
let contentHeight = canvas.height let contentHeight = canvas.height

@ -16,7 +16,7 @@ const Setting = {
showProgressBar: true, showProgressBar: true,
// 接口请求地址 // 接口请求地址
// apiBaseURL: env === 'development' ? 'http://192.168.31.151:8001' : 'http://39.108.250.202:8000/', // apiBaseURL: env === 'development' ? 'http://192.168.31.151:8001' : 'http://39.108.250.202:8000/',
apiBaseURL: env === 'development' ? 'http://39.108.250.202:9000' : 'http://39.108.250.202:9000', apiBaseURL: env === 'development' ? 'http://192.168.31.151:8001' : 'http://39.108.250.202:9000',
// 接口请求返回错误时,弹窗的持续时间,单位:秒 // 接口请求返回错误时,弹窗的持续时间,单位:秒
modalDuration: 3, modalDuration: 3,
// 接口请求返回错误时,弹窗的类型,可选值为 Message 或 Notice // 接口请求返回错误时,弹窗的类型,可选值为 Message 或 Notice

@ -304,6 +304,13 @@
} }
} }
.testpaperDia{
width: calc(100% - 260px) !important;
height: calc(100% - 160px) !important;
overflow: auto;
margin-left: 240px;
}
.el-message{ .el-message{
padding: 11px 20px; padding: 11px 20px;
.el-message__icon{ .el-message__icon{

Loading…
Cancel
Save