|
@@ -38,17 +38,12 @@
|
|
|
<Option v-for="(item,index) in testType" :value="item.id" :key="index">{{ item.name }}</Option>
|
|
|
</Select>
|
|
|
</FormItem>
|
|
|
- <!-- 校园评测施测对象为系统班级 -->
|
|
|
+ <!-- 校园评测施测对象为教学班或行政班 -->
|
|
|
<FormItem :label="$t('learnActivity.createEv.evTarget')" prop="targets">
|
|
|
<el-cascader size="small" :show-all-levels="false" clearable filterable v-model="evaluationInfo.targets" :options="csOptions" :props="props" @change="treeChange" style="width:100%;">
|
|
|
</el-cascader>
|
|
|
</FormItem>
|
|
|
<FormItem :label="$t('learnActivity.createEv.publishType')" prop="publish">
|
|
|
- <!-- <RadioGroup v-model="evaluationInfo.publish" style="color:white;">
|
|
|
- <Radio :label="item.value" :key="index" v-for="(item,index) in $GLOBAL.PUBLISH_TYPE()" style="width:120px;">
|
|
|
- <span>{{ item.label }}</span>
|
|
|
- </Radio>
|
|
|
- </RadioGroup> -->
|
|
|
<Checkbox v-model="evaluationInfo.publish" :true-value="$GLOBAL.PUBLISH_TYPE()[0].value" :false-value="$GLOBAL.PUBLISH_TYPE()[1].value" @on-change="publishChange">
|
|
|
<span style="color:white;margin-left:5px;user-select: none;">{{$GLOBAL.PUBLISH_TYPE()[0].label}}</span>
|
|
|
</Checkbox>
|
|
@@ -79,14 +74,24 @@
|
|
|
<ManualPaper :periodId="evaluationInfo.period.id" :gradesObj="evaluationInfo.grades" :subjectId="evaluationInfo.paperInfo[curSubIndex].subjectId" @selectPaper="selectPaper" :selectedId="evaluationInfo.paperInfo[curSubIndex].id" :source="$store.state.userInfo.schoolCode"></ManualPaper>
|
|
|
</TabPane>
|
|
|
<TabPane :label="$t('learnActivity.createEv.perviewLabel')" name="preview" :index="2" tab="createTest">
|
|
|
- <TeacherPreview :testPaper="evaluationInfo.paperInfo[curSubIndex]" :examAnalysisStatus="examAnalysisStatus"></TeacherPreview>
|
|
|
+ <!-- <TeacherPreview :testPaper="evaluationInfo.paperInfo[curSubIndex]" :examAnalysisStatus="examAnalysisStatus"></TeacherPreview> -->
|
|
|
+ <div class="teacher-preview-container">
|
|
|
+ <!--返回顶部-->
|
|
|
+ <div class="back-to-top" :title="$t('learnActivity.mgtScEv.returnTop')" v-show="showBack" @click="handleBackToTop">
|
|
|
+ <Icon type="ios-arrow-up" />
|
|
|
+ </div>
|
|
|
+ <vuescroll ref="paper-preview" @handle-scroll="checkBackTop">
|
|
|
+ <TestPaper :paper="evaluationInfo.paperInfo[curSubIndex]" isExamPaper @createSheetId="getSheetId"></TestPaper>
|
|
|
+ </vuescroll>
|
|
|
+ </div>
|
|
|
</TabPane>
|
|
|
<TabPane :label="$t('learnActivity.createEv.importLabel')" name="import" v-if="evaluationInfo.paperInfo[curSubIndex].createType == 'import'" :index="4" tab="createTest">
|
|
|
<BaseImport @importedQuestions="getImportQuestions" @goToPreview="goToPreview"></BaseImport>
|
|
|
</TabPane>
|
|
|
- <TabPane :label="$t('learnActivity.createEv.answerPreview')" name="student" :index="6" tab="createTest">
|
|
|
+ <!-- 去掉作答预览功能 -->
|
|
|
+ <!-- <TabPane :label="$t('learnActivity.createEv.answerPreview')" name="student" :index="6" tab="createTest">
|
|
|
<StudentPreview></StudentPreview>
|
|
|
- </TabPane>
|
|
|
+ </TabPane> -->
|
|
|
</Tabs>
|
|
|
</div>
|
|
|
</div>
|
|
@@ -105,20 +110,21 @@
|
|
|
</template>
|
|
|
<script>
|
|
|
import BlobTool from '@/utils/blobTool.js'
|
|
|
+import TestPaper from '@/view/evaluation/index/TestPaper.vue'
|
|
|
import ManualPaper from './ManualPaper.vue'
|
|
|
import BaseImport from '@/view/evaluation/components/BaseImport.vue'
|
|
|
-import TeacherPreview from './TeacherPreview.vue'
|
|
|
import StudentPreview from './StudentPreview.vue'
|
|
|
export default {
|
|
|
components: {
|
|
|
- TeacherPreview,
|
|
|
StudentPreview,
|
|
|
BaseImport,
|
|
|
ManualPaper,
|
|
|
+ TestPaper
|
|
|
},
|
|
|
data() {
|
|
|
let _this = this
|
|
|
return {
|
|
|
+ showBack: false,
|
|
|
schoolClasses: [],
|
|
|
props: {
|
|
|
multiple: true,
|
|
@@ -202,10 +208,57 @@ export default {
|
|
|
befPeriod: {
|
|
|
id: '',
|
|
|
name: ''
|
|
|
- }
|
|
|
+ },
|
|
|
+ stuList: []
|
|
|
}
|
|
|
},
|
|
|
+ mounted() {
|
|
|
+ this.$EventBus.$off('createSheetId')
|
|
|
+ this.$EventBus.$on('createSheetId', sheetId => {
|
|
|
+ this.getSheetId(sheetId)
|
|
|
+ })
|
|
|
+ },
|
|
|
methods: {
|
|
|
+ //获取答题卡id
|
|
|
+ getSheetId(id) {
|
|
|
+ console.log('答题卡id:', id)
|
|
|
+ },
|
|
|
+ /**vuescroll回到顶部 */
|
|
|
+ handleBackToTop() {
|
|
|
+ this.$refs['paper-preview'].scrollTo(
|
|
|
+ {
|
|
|
+ y: '0'
|
|
|
+ },
|
|
|
+ 300
|
|
|
+ )
|
|
|
+ },
|
|
|
+ /**
|
|
|
+ * 判断是否显示回到顶部按钮
|
|
|
+ * @param vertical
|
|
|
+ * @param horizontal
|
|
|
+ * @param nativeEvent
|
|
|
+ */
|
|
|
+ checkBackTop(vertical, horizontal, nativeEvent) {
|
|
|
+ if (vertical.scrollTop > 100) {
|
|
|
+ this.showBack = true
|
|
|
+ } else {
|
|
|
+ this.showBack = false
|
|
|
+ }
|
|
|
+ },
|
|
|
+ findStuList() {
|
|
|
+ let params = {
|
|
|
+ code: this.$store.state.userInfo.schoolCode,
|
|
|
+ scope: 'school'
|
|
|
+ }
|
|
|
+ this.$api.courseMgmt.findStulist(params).then(
|
|
|
+ res => {
|
|
|
+ this.stuList = res.stuList
|
|
|
+ },
|
|
|
+ err => {
|
|
|
+ this.$Message.error('API error')
|
|
|
+ }
|
|
|
+ )
|
|
|
+ },
|
|
|
test() {
|
|
|
console.log(this.evaluationInfo)
|
|
|
},
|
|
@@ -254,6 +307,7 @@ export default {
|
|
|
},
|
|
|
|
|
|
treeChange(data) {
|
|
|
+ console.log('选择数据', data)
|
|
|
//获取classIds
|
|
|
this.evaluationInfo.classes = data.map(item => {
|
|
|
return item[1]
|
|
@@ -304,6 +358,7 @@ export default {
|
|
|
})
|
|
|
},
|
|
|
comfirmSelectPaper(simplePaper, fullPaper) {
|
|
|
+ console.log('挑选试卷', arguments)
|
|
|
let curSubName = this.evaluationInfo.paperInfo[this.curSubIndex].subjectName
|
|
|
let curSubId = this.evaluationInfo.paperInfo[this.curSubIndex].subjectId
|
|
|
this.evaluationInfo.paperInfo[this.curSubIndex] = fullPaper
|
|
@@ -412,7 +467,9 @@ export default {
|
|
|
score: 100,
|
|
|
item: [],
|
|
|
filter: {},
|
|
|
- name: this.$t('learnActivity.createEv.defaultPaper')
|
|
|
+ name: this.$t('learnActivity.createEv.defaultPaper'),
|
|
|
+ examScope: this.mode,
|
|
|
+ examCode: this.$store.state.userInfo.schoolCode
|
|
|
})
|
|
|
}
|
|
|
}
|
|
@@ -506,8 +563,21 @@ export default {
|
|
|
if (!flag) {
|
|
|
return
|
|
|
}
|
|
|
+ let apiPapers = this.getPaperInfo()
|
|
|
+ //线下阅卷需要检查答题卡数据
|
|
|
+ if (this.evaluationInfo.source == '2') {
|
|
|
+ apiPapers.forEach((item, index) => {
|
|
|
+ if (!item.sheet) {
|
|
|
+ this.$Message.error(this.evaluationInfo.subjects[index].name + '暂无答题卡信息')
|
|
|
+ this.isLoading = false
|
|
|
+ }
|
|
|
+ })
|
|
|
+ console.log('查看数据:', this.evaluationInfo)
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
//通过验证,保存评测
|
|
|
- this.isLoading = true
|
|
|
+ // this.isLoading = true
|
|
|
let requestData = {
|
|
|
pk: 'Exam',
|
|
|
id: this.evaluationInfo.id || null,
|
|
@@ -519,7 +589,7 @@ export default {
|
|
|
period: this.evaluationInfo.period,
|
|
|
grades: this.evaluationInfo.grades,
|
|
|
subjects: this.evaluationInfo.subjects,
|
|
|
- papers: this.getPaperInfo(),
|
|
|
+ papers: apiPapers,
|
|
|
examType: this.evaluationInfo.examType,
|
|
|
year: new Date().getFullYear(),
|
|
|
range: this.mode,
|
|
@@ -533,88 +603,87 @@ export default {
|
|
|
// blobcntr: this.$store.state.userInfo.schoolCode //后面新增字段 (废弃)
|
|
|
owner: 'school' //后面新增字段
|
|
|
}
|
|
|
+ console.log('API数据:', requestData)
|
|
|
|
|
|
- this.$api.learnActivity.SaveExamInfo(requestData).then(
|
|
|
- res => {
|
|
|
- if (res.error == null) {
|
|
|
-
|
|
|
- //发布成功需要备份试卷数据
|
|
|
- let examId = res.exam.id
|
|
|
- // let privateSas = this.$store.state.privateSas
|
|
|
- let privateSas = {}
|
|
|
- if(this.$store.state.user.userProfile){
|
|
|
- let blobInfo = this.$store.state.user.userProfile
|
|
|
- privateSas.sas = '?' + blobInfo.blob_sas
|
|
|
- privateSas.url = blobInfo.blob_uri.slice(0, blobInfo.blob_uri.lastIndexOf(this.$store.state.userInfo.TEAMModelId) - 1)
|
|
|
- privateSas.name = this.$store.state.userInfo.TEAMModelId
|
|
|
- }
|
|
|
+ // this.$api.learnActivity.SaveExamInfo(requestData).then(
|
|
|
+ // res => {
|
|
|
+ // if (res.error == null) {
|
|
|
+ // //发布成功需要备份试卷数据
|
|
|
+ // let examId = res.exam.id
|
|
|
+ // let privateSas = {}
|
|
|
+ // if (this.$store.state.user.userProfile) {
|
|
|
+ // let blobInfo = this.$store.state.user.userProfile
|
|
|
+ // privateSas.sas = '?' + blobInfo.blob_sas
|
|
|
+ // privateSas.url = blobInfo.blob_uri.slice(0, blobInfo.blob_uri.lastIndexOf(this.$store.state.userInfo.TEAMModelId) - 1)
|
|
|
+ // privateSas.name = this.$store.state.userInfo.TEAMModelId
|
|
|
+ // }
|
|
|
|
|
|
- let schoolSas = {
|
|
|
- sas: '?' + this.$store.state.user.schoolProfile.blob_sas,
|
|
|
- url: this.$store.state.user.schoolProfile.blob_uri.slice(0, this.$store.state.user.schoolProfile.blob_uri.lastIndexOf(this.$store.state.userInfo.schoolCode) - 1),
|
|
|
- name: this.$store.state.userInfo.schoolCode
|
|
|
- }
|
|
|
- let schoolBlob = new BlobTool(schoolSas.url, schoolSas.name, schoolSas.sas, 'school')
|
|
|
- let privateBlob = undefined
|
|
|
- let targetFolder = 'exam/' + examId + '/paper/'
|
|
|
- let count = 0
|
|
|
- requestData.papers.forEach(async (item, index) => {
|
|
|
- if (item.blob.indexOf('/exam/') == 0) {
|
|
|
- if (++count == (requestData.papers.length)) {
|
|
|
- setTimeout(() => {
|
|
|
- this.$Message.success(this.$t('learnActivity.createEv.publishOk'))
|
|
|
- this.isLoading = false
|
|
|
- let route = this.mode + 'Evaluation'
|
|
|
- this.$router.push({
|
|
|
- name: route
|
|
|
- })
|
|
|
- }, 2000)
|
|
|
- }
|
|
|
- return
|
|
|
- }
|
|
|
- if (item.scope == 'school') {
|
|
|
- schoolBlob.copyFolder(targetFolder + requestData.subjects[index].id + '/', item.blob.substring(1)).then().finally(
|
|
|
- () => {
|
|
|
- if (++count == (requestData.papers.length)) {
|
|
|
- setTimeout(() => {
|
|
|
- this.$Message.success(this.$t('learnActivity.createEv.publishOk'))
|
|
|
- this.isLoading = false
|
|
|
- let route = this.mode + 'Evaluation'
|
|
|
- this.$router.push({
|
|
|
- name: route
|
|
|
- })
|
|
|
- }, 2000)
|
|
|
- }
|
|
|
- }
|
|
|
- )
|
|
|
- } else if (item.scope == 'private') {
|
|
|
- if (!privateBlob) privateBlob = new BlobTool(privateSas.url, privateSas.name, privateSas.sas, 'private')
|
|
|
- schoolBlob.copyFolder(targetFolder + requestData.subjects[index].id + '/', item.blob.substring(1), privateBlob).then().finally(
|
|
|
- () => {
|
|
|
- if (++count == (requestData.papers.length)) {
|
|
|
- setTimeout(() => {
|
|
|
- this.$Message.success(this.$t('learnActivity.createEv.publishOk'))
|
|
|
- this.isLoading = false
|
|
|
- let route = this.mode + 'Evaluation'
|
|
|
- this.$router.push({
|
|
|
- name: route
|
|
|
- })
|
|
|
- }, 2000)
|
|
|
- }
|
|
|
- }
|
|
|
- )
|
|
|
- }
|
|
|
- })
|
|
|
- } else {
|
|
|
- this.$Message.error('API ERROR!')
|
|
|
- this.isLoading = false
|
|
|
- }
|
|
|
- },
|
|
|
- err => {
|
|
|
- this.isLoading = false
|
|
|
- this.$Message.error('API ERROR!')
|
|
|
- }
|
|
|
- )
|
|
|
+ // let schoolSas = {
|
|
|
+ // sas: '?' + this.$store.state.user.schoolProfile.blob_sas,
|
|
|
+ // url: this.$store.state.user.schoolProfile.blob_uri.slice(0, this.$store.state.user.schoolProfile.blob_uri.lastIndexOf(this.$store.state.userInfo.schoolCode) - 1),
|
|
|
+ // name: this.$store.state.userInfo.schoolCode
|
|
|
+ // }
|
|
|
+ // let schoolBlob = new BlobTool(schoolSas.url, schoolSas.name, schoolSas.sas, 'school')
|
|
|
+ // let privateBlob = undefined
|
|
|
+ // let targetFolder = 'exam/' + examId + '/paper/'
|
|
|
+ // let count = 0
|
|
|
+ // requestData.papers.forEach(async (item, index) => {
|
|
|
+ // if (item.blob.indexOf('/exam/') == 0) {
|
|
|
+ // if (++count == (requestData.papers.length)) {
|
|
|
+ // setTimeout(() => {
|
|
|
+ // this.$Message.success(this.$t('learnActivity.createEv.publishOk'))
|
|
|
+ // this.isLoading = false
|
|
|
+ // let route = this.mode + 'Evaluation'
|
|
|
+ // this.$router.push({
|
|
|
+ // name: route
|
|
|
+ // })
|
|
|
+ // }, 2000)
|
|
|
+ // }
|
|
|
+ // return
|
|
|
+ // }
|
|
|
+ // if (item.scope == 'school') {
|
|
|
+ // schoolBlob.copyFolder(targetFolder + requestData.subjects[index].id + '/', item.blob.substring(1)).then().finally(
|
|
|
+ // () => {
|
|
|
+ // if (++count == (requestData.papers.length)) {
|
|
|
+ // setTimeout(() => {
|
|
|
+ // this.$Message.success(this.$t('learnActivity.createEv.publishOk'))
|
|
|
+ // this.isLoading = false
|
|
|
+ // let route = this.mode + 'Evaluation'
|
|
|
+ // this.$router.push({
|
|
|
+ // name: route
|
|
|
+ // })
|
|
|
+ // }, 2000)
|
|
|
+ // }
|
|
|
+ // }
|
|
|
+ // )
|
|
|
+ // } else if (item.scope == 'private') {
|
|
|
+ // if (!privateBlob) privateBlob = new BlobTool(privateSas.url, privateSas.name, privateSas.sas, 'private')
|
|
|
+ // schoolBlob.copyFolder(targetFolder + requestData.subjects[index].id + '/', item.blob.substring(1), privateBlob).then().finally(
|
|
|
+ // () => {
|
|
|
+ // if (++count == (requestData.papers.length)) {
|
|
|
+ // setTimeout(() => {
|
|
|
+ // this.$Message.success(this.$t('learnActivity.createEv.publishOk'))
|
|
|
+ // this.isLoading = false
|
|
|
+ // let route = this.mode + 'Evaluation'
|
|
|
+ // this.$router.push({
|
|
|
+ // name: route
|
|
|
+ // })
|
|
|
+ // }, 2000)
|
|
|
+ // }
|
|
|
+ // }
|
|
|
+ // )
|
|
|
+ // }
|
|
|
+ // })
|
|
|
+ // } else {
|
|
|
+ // this.$Message.error('API ERROR!')
|
|
|
+ // this.isLoading = false
|
|
|
+ // }
|
|
|
+ // },
|
|
|
+ // err => {
|
|
|
+ // this.isLoading = false
|
|
|
+ // this.$Message.error('API ERROR!')
|
|
|
+ // }
|
|
|
+ // )
|
|
|
},
|
|
|
//拼接API需要的paper数据
|
|
|
getPaperInfo() {
|
|
@@ -633,6 +702,7 @@ export default {
|
|
|
paper.name = data[i].name
|
|
|
paper.blob = data[i].blob
|
|
|
paper.scope = data[i].scope
|
|
|
+ paper.sheet = data[i].sheet //答题卡
|
|
|
paper.multipleRule = rule[i].multipleRule
|
|
|
paper.answers = []
|
|
|
paper.point = []
|
|
@@ -709,15 +779,30 @@ export default {
|
|
|
)
|
|
|
this.activeTab = 'preview'
|
|
|
}
|
|
|
+ this.findStuList()
|
|
|
},
|
|
|
computed: {
|
|
|
//级联选择年级班级
|
|
|
csOptions() {
|
|
|
let data = []
|
|
|
+ //填充行政班数据
|
|
|
if (this.evaluationInfo.period.id && this.schoolBase.period.length && this.schoolClasses.length) {
|
|
|
let curPd = this.schoolBase.period.find((item) => {
|
|
|
return item.id == this.evaluationInfo.period.id
|
|
|
})
|
|
|
+ data = [
|
|
|
+ {
|
|
|
+ id: 'class',
|
|
|
+ name: '行政班',
|
|
|
+ children: []
|
|
|
+ },
|
|
|
+ {
|
|
|
+ id: 'stulist',
|
|
|
+ name: '教学班',
|
|
|
+ disabled: true,
|
|
|
+ children: []
|
|
|
+ }
|
|
|
+ ]
|
|
|
if (curPd) {
|
|
|
//计算学级逻辑
|
|
|
let date = new Date()
|
|
@@ -741,9 +826,12 @@ export default {
|
|
|
return (classItem.year == curYear - index) && classItem.periodId == this.evaluationInfo.period.id
|
|
|
})
|
|
|
dataItem.children = child
|
|
|
- data.push(dataItem)
|
|
|
+ data[0].children.push(dataItem)
|
|
|
})
|
|
|
}
|
|
|
+ // 填充教学班数据
|
|
|
+ data[1].children.push(...this.stuList)
|
|
|
+ console.log('data数据', data)
|
|
|
}
|
|
|
return data
|
|
|
},
|
|
@@ -794,20 +882,22 @@ export default {
|
|
|
<style scoped lang="less">
|
|
|
@import "./CreateSchoolEva.less";
|
|
|
</style>
|
|
|
-<style scoped>
|
|
|
+<style>
|
|
|
.evaluation-attr-wrap .ivu-form .ivu-form-item-label {
|
|
|
color: #a5a5a5;
|
|
|
}
|
|
|
|
|
|
.evaluation-question-main
|
|
|
.ivu-tabs.ivu-tabs-card
|
|
|
- /deep/
|
|
|
.ivu-tabs-bar
|
|
|
.ivu-tabs-tab-active {
|
|
|
- background-color: #404040;
|
|
|
+ background-color: #404040 !important;
|
|
|
font-weight: 600;
|
|
|
}
|
|
|
-
|
|
|
+.teacher-preview-container .paper-main-wrap {
|
|
|
+ padding: 0px;
|
|
|
+ margin-top: 0px;
|
|
|
+}
|
|
|
.evaluation-question-main .ivu-tabs .ivu-tabs-content-animated {
|
|
|
height: 100%;
|
|
|
margin-bottom: 10px;
|