|
@@ -14,19 +14,27 @@
|
|
|
<Input v-model="evaluationInfo.name" placeholder="评测名称" @on-change="handlePaperName"></Input>
|
|
|
</FormItem>
|
|
|
<FormItem label="评量模式" prop="evaType">
|
|
|
- <Select v-model="evaluationInfo.evaType" >
|
|
|
+ <Select v-model="evaluationInfo.evaType">
|
|
|
<Option v-for="(item,index) in evaType" :value="item.value" :key="index">{{ item.label }}</Option>
|
|
|
</Select>
|
|
|
</FormItem>
|
|
|
+ <FormItem label="测试類別" prop="type">
|
|
|
+ <Select v-model="evaluationInfo.type">
|
|
|
+ <Option v-for="(item,index) in typeList" :value="item.value" :key="index">{{ item.label }}</Option>
|
|
|
+ </Select>
|
|
|
+ </FormItem>
|
|
|
<FormItem label="测试类型" prop="type">
|
|
|
<Select v-model="evaluationInfo.type">
|
|
|
<Option v-for="(item,index) in typeList" :value="item.value" :key="index">{{ item.label }}</Option>
|
|
|
</Select>
|
|
|
</FormItem>
|
|
|
+
|
|
|
<FormItem label="施测对象">
|
|
|
- <Select v-model="evaluationInfo.target" multiple>
|
|
|
- <Option v-for="(item,index) in classroomList" :value="item.id" :key="index">{{ item.name }}</Option>
|
|
|
- </Select>
|
|
|
+ <!--<Cascader :list="list" @onClick="handleClick"></Cascader>-->
|
|
|
+ <!--<Select v-model="evaluationInfo.target" multiple>
|
|
|
+ <Option v-for="(item,index) in classroomList" :value="item.id" :key="index">{{ item.name }}</Option>
|
|
|
+ </Select>-->
|
|
|
+ <MultiCascader ref="addMulti" v-bind="config" @son="changeSon" hasValue :firstOpen="open" v-model="formChange.scope" @on-change="setChangeScope"></MultiCascader>
|
|
|
</FormItem>
|
|
|
<FormItem label="发布方式" prop="publish">
|
|
|
<RadioGroup v-model="evaluationInfo.publish" style="color:white;">
|
|
@@ -48,44 +56,43 @@
|
|
|
<div class="evaluation-question-wrap">
|
|
|
<div class="wrap-label" v-if="mode == 'school'">
|
|
|
<p>测试科目:</p>
|
|
|
- <span v-for="(item,index) in evaluationInfo.testPaper" :key="index" :class="index == currentSubjectIndex ? 'subject-item subject-item-active':'subject-item'" @click="selectSubject(index)">
|
|
|
- {{ jsFn.getPeriod($store.state.schoolBaseInfo.schoolBaseInfo, item.periodCode).name}}
|
|
|
+ <span v-for="(item,index) in evaluationInfo.paperInfo" :key="index" :class="index == currentSubjectIndex ? 'subject-item subject-item-active':'subject-item'" @click="selectSubject(index)">
|
|
|
+ {{ jsFn.getPeriod($store.state.schoolBaseInfo.schoolBaseInfo, item.periodId).name}}
|
|
|
<span style="margin:0px 5px;">·</span>
|
|
|
- {{jsFn.getSubjectName(jsFn.getPeriod($store.state.schoolBaseInfo.schoolBaseInfo, item.periodCode), item.subjectCode)}}
|
|
|
+ {{jsFn.getSubjectName(jsFn.getPeriod($store.state.schoolBaseInfo.schoolBaseInfo, item.periodId), item.subjectId)}}
|
|
|
<Icon type="ios-close" size="18" class="delete-subject-btn" @click="deleteSubject(index)" />
|
|
|
</span>
|
|
|
<Icon @click="addSubject" type="md-add-circle" title="添加科目" color="white" class="add-subject-icon" size="20" />
|
|
|
</div>
|
|
|
|
|
|
<div class="evaluation-question-main">
|
|
|
- <EmptyData :top="0" style="padding-top:100px;" v-if="evaluationInfo.testPaper.length == 0" textContent="暂无科目,请添加科目"></EmptyData>
|
|
|
- <div class="create-type-wrap" v-if="evaluationInfo.testPaper.length > 0 || mode == 'class'" >
|
|
|
+ <EmptyData :top="0" style="padding-top:100px;" v-if="evaluationInfo.paperInfo.length == 0" textContent="暂无科目,请添加科目"></EmptyData>
|
|
|
+ <div class="create-type-wrap" v-if="evaluationInfo.paperInfo.length > 0 || mode == 'class'" >
|
|
|
<span>创建方式:</span>
|
|
|
- <RadioGroup v-model="evaluationInfo.testPaper[currentSubjectIndex].createType" style="margin-left:25px;" @on-change="setActiveTab">
|
|
|
+ <RadioGroup v-model="evaluationInfo.paperInfo[currentSubjectIndex].createType" style="margin-left:25px;" @on-change="setActiveTab">
|
|
|
<!--<Radio label="auto">自动组题</Radio>-->
|
|
|
<Radio label="manualPaper">手动挑卷</Radio>
|
|
|
<!--<Radio label="manualQuestion">手动挑题</Radio>-->
|
|
|
<Radio label="import">试卷导入</Radio>
|
|
|
</RadioGroup>
|
|
|
</div>
|
|
|
- <Tabs v-model="activeTab" type="card" class="question-main-tabs" v-if="evaluationInfo.testPaper.length > 0 || mode == 'class' " name="createTest">
|
|
|
- <!--<TabPane label="组题条件" name="auto" v-if="evaluationInfo.testPaper[currentSubjectIndex].createType == 'auto'" :index="1" tab="createTest">
|
|
|
- <AutoCreate :subjectCode="evaluationInfo.testPaper[currentSubjectIndex].subjectCode" :periodCode="evaluationInfo.testPaper[currentSubjectIndex].periodCode" @goToPreview="goToPreview" @autoQuestions="getAutoQuestions"></AutoCreate>
|
|
|
+
|
|
|
+
|
|
|
+ <Tabs v-model="activeTab" type="card" class="question-main-tabs" v-if="evaluationInfo.paperInfo.length > 0 || mode == 'class' " name="createTest">
|
|
|
+ <!--<TabPane label="组题条件" name="auto" v-if="evaluationInfo.paperInfo[currentSubjectIndex].createType == 'auto'" :index="1" tab="createTest">
|
|
|
+ <AutoCreate :subjectCode="evaluationInfo.paperInfo[currentSubjectIndex].subjectCode" :periodCode="evaluationInfo.paperInfo[currentSubjectIndex].periodCode" @goToPreview="goToPreview" @autoQuestions="getAutoQuestions"></AutoCreate>
|
|
|
</TabPane>-->
|
|
|
- <!--<TabPane label="备选题目" name="manualQuestion" v-if="evaluationInfo.testPaper[currentSubjectIndex].createType == 'manualQuestion'" :index="2" tab="createTest">
|
|
|
+ <!--<TabPane label="备选题目" name="manualQuestion" v-if="evaluationInfo.paperInfo[currentSubjectIndex].createType == 'manualQuestion'" :index="2" tab="createTest">
|
|
|
<ManualCreate @goToPreview="goToPreview" @selectedQuestion="getSelectedQuestion"></ManualCreate>
|
|
|
</TabPane>-->
|
|
|
- <TabPane label="备选试卷" name="manualPaper" v-if="evaluationInfo.testPaper[currentSubjectIndex].createType == 'manualPaper'" :index="3" tab="createTest">
|
|
|
- <ManualPaper :periodCode="evaluationInfo.testPaper[currentSubjectIndex].periodCode" :subjectCode="evaluationInfo.testPaper[currentSubjectIndex].subjectCode" @selectPaper="selectPaper"></ManualPaper>
|
|
|
+ <TabPane label="备选试卷" name="manualPaper" v-if="evaluationInfo.paperInfo[currentSubjectIndex].createType == 'manualPaper'" :index="3" tab="createTest">
|
|
|
+ <ManualPaper :periodCode="evaluationInfo.paperInfo[currentSubjectIndex].periodCode" :subjectCode="evaluationInfo.paperInfo[currentSubjectIndex].subjectCode" @selectPaper="selectPaper"></ManualPaper>
|
|
|
</TabPane>
|
|
|
- <TabPane label="导入说明" name="import" v-if="evaluationInfo.testPaper[currentSubjectIndex].createType == 'import'" :index="4" tab="createTest">
|
|
|
+ <TabPane label="导入说明" name="import" v-if="evaluationInfo.paperInfo[currentSubjectIndex].createType == 'import'" :index="4" tab="createTest">
|
|
|
<ImportCreate @importedQuestions="getImportQuestions" @goToPreview="goToPreview"></ImportCreate>
|
|
|
</TabPane>
|
|
|
<TabPane label="试题预览" name="preview" :index="5" tab="createTest">
|
|
|
- <TeacherPreview :testPaper="evaluationInfo.testPaper[currentSubjectIndex]" :examAnalysisStatus="examAnalysisStatus"></TeacherPreview>
|
|
|
- <!--<div class="back-to-top" title="返回顶部" v-show="showBack" @click="handleBackToTop">
|
|
|
- <Icon type="ios-arrow-up" />
|
|
|
- </div>-->
|
|
|
+ <TeacherPreview :testPaper="evaluationInfo.paperInfo[currentSubjectIndex]" :examAnalysisStatus="examAnalysisStatus"></TeacherPreview>
|
|
|
</TabPane>
|
|
|
<TabPane label="学生作答体验" name="student" :index="6" tab="createTest">
|
|
|
<StudentPreview></StudentPreview>
|
|
@@ -95,25 +102,31 @@
|
|
|
{{examAnalysisStatus ? '试卷预览':'试卷分析'}}
|
|
|
</span>
|
|
|
</Tabs>
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
</div>
|
|
|
</div>
|
|
|
</div>
|
|
|
+
|
|
|
<Modal v-model="addSubjectStatus"
|
|
|
title="添加测试学科"
|
|
|
class-name="dark-iview-modal"
|
|
|
@on-ok="confirmAddSubject"
|
|
|
- @on-cancel="cancelAddSubject">
|
|
|
+ >
|
|
|
+ <!--@on-cancel="cancelAddSubject"-->
|
|
|
<div v-for="(item,index) in $store.state.schoolBaseInfo.schoolBaseInfo.period" :key="index" style="margin-top:10px;margin-bottom:30px;color:white;">
|
|
|
<div style="padding-bottom:6px;margin-bottom:6px;">
|
|
|
<span>{{item.name}}</span>
|
|
|
</div>
|
|
|
<CheckboxGroup v-model="testSubjects[index]">
|
|
|
- <Checkbox v-for="(subjectItem,i) in item.subjects" :key="i" :label="subjectItem.id" :disabled="checkIsDisabled(index,subjectItem.id)" @input="newAddSubject(index,i,subjectItem.id)">
|
|
|
+ <Checkbox v-for="(subjectItem,indexs) in item.subjects" :key="indexs" :label="subjectItem.id" :disabled="checkIsDisabled(index,subjectItem.id)" @input="newAddSubject(index,indexs,subjectItem.id)">
|
|
|
<span>{{subjectItem.name}}</span>
|
|
|
</Checkbox>
|
|
|
</CheckboxGroup>
|
|
|
</div>
|
|
|
</Modal>
|
|
|
+
|
|
|
<Modal v-model="goToManageStatus"
|
|
|
title="管理评测"
|
|
|
:mask-closable="false"
|
|
@@ -122,13 +135,13 @@
|
|
|
@on-ok="confirmToManage">
|
|
|
<p>评测保存成功,是否跳转到管理评测页面查看?</p>
|
|
|
</Modal>
|
|
|
- <Modal v-model="comfirmPreviewStatus"
|
|
|
+ <!--<Modal v-model="comfirmPreviewStatus"
|
|
|
ok-text="是"
|
|
|
cancel-text="否"
|
|
|
:mask-closable="false"
|
|
|
@on-ok="goToPreview">
|
|
|
<p style="font-size:18px;padding-top:15px;">自动组题成功,是否跳转到试题预览界面预览题目?</p>
|
|
|
- </Modal>
|
|
|
+ </Modal>-->
|
|
|
<Modal v-model="confirmPaperStatus"
|
|
|
title="挑选试卷"
|
|
|
ok-text="是"
|
|
@@ -140,6 +153,7 @@
|
|
|
</template>
|
|
|
<script>
|
|
|
import AutoCreate from './AutoCreate.vue'
|
|
|
+ import MultiCascader from './MultiCascader.vue'
|
|
|
import ManualCreate from './ManualCreate.vue'
|
|
|
import ManualPaper from './ManualPaper.vue'
|
|
|
import ImportCreate from './ImportCreate.vue'
|
|
@@ -154,16 +168,19 @@
|
|
|
TeacherPreview,
|
|
|
StudentPreview,
|
|
|
ImportCreate,
|
|
|
- ManualPaper
|
|
|
+ ManualPaper,
|
|
|
+ MultiCascader
|
|
|
},
|
|
|
data() {
|
|
|
return {
|
|
|
+ data3: [],
|
|
|
//isTeacher: true, //判定当前教师是否分配学校
|
|
|
startTime: '',
|
|
|
endTime:'',
|
|
|
examAnalysisStatus: false,
|
|
|
confirmPaperStatus: false,
|
|
|
selectedPaper: {},
|
|
|
+ selectedPaperInfo: {},
|
|
|
jsFn,
|
|
|
isLoading: false,
|
|
|
comfirmPreviewStatus: false,
|
|
@@ -204,25 +221,22 @@
|
|
|
publish: '',
|
|
|
startTime: undefined,
|
|
|
endTime: undefined,
|
|
|
- testPaper: []
|
|
|
+ paperInfo: [],
|
|
|
+ papers: []
|
|
|
},
|
|
|
classroomList: [],
|
|
|
typeList: [
|
|
|
{
|
|
|
value: '1',
|
|
|
- label: '联考'
|
|
|
+ label: '正規考'
|
|
|
},
|
|
|
{
|
|
|
value: '2',
|
|
|
- label: '段考'
|
|
|
+ label: '模擬考'
|
|
|
},
|
|
|
{
|
|
|
value: '3',
|
|
|
- label: '平常考'
|
|
|
- },
|
|
|
- {
|
|
|
- value: '4',
|
|
|
- label: '其他'
|
|
|
+ label: '普通考'
|
|
|
}
|
|
|
],
|
|
|
evaType: [
|
|
@@ -245,17 +259,101 @@
|
|
|
label:'定时发布'
|
|
|
}
|
|
|
],
|
|
|
- mode:''
|
|
|
+ mode: '',
|
|
|
+
|
|
|
+
|
|
|
+ config: {
|
|
|
+ clearable: true,
|
|
|
+ multiple: true,
|
|
|
+ data: [
|
|
|
+ {
|
|
|
+ value: 'beijing',
|
|
|
+ label: '北京',
|
|
|
+ children: [
|
|
|
+ {
|
|
|
+ value: 'gugong',
|
|
|
+ label: '故宫'
|
|
|
+ },
|
|
|
+ {
|
|
|
+ value: 'tiantan',
|
|
|
+ label: '天坛'
|
|
|
+ },
|
|
|
+ {
|
|
|
+ value: 'wangfujing',
|
|
|
+ label: '王府井'
|
|
|
+ }
|
|
|
+ ]
|
|
|
+ }, {
|
|
|
+ value: 'jiangsu',
|
|
|
+ label: '江苏',
|
|
|
+ children: [
|
|
|
+ {
|
|
|
+ value: 'nanjing',
|
|
|
+ label: '南京',
|
|
|
+ children: [
|
|
|
+ {
|
|
|
+ value: 'fuzimiao',
|
|
|
+ label: '夫子庙',
|
|
|
+ }
|
|
|
+ ]
|
|
|
+ },
|
|
|
+ {
|
|
|
+ value: 'suzhou',
|
|
|
+ label: '苏州',
|
|
|
+ children: [
|
|
|
+ {
|
|
|
+ value: 'zhuozhengyuan',
|
|
|
+ label: '拙政园',
|
|
|
+ },
|
|
|
+ {
|
|
|
+ value: 'shizilin',
|
|
|
+ label: '狮子林',
|
|
|
+ }
|
|
|
+ ]
|
|
|
+ }
|
|
|
+ ],
|
|
|
+ }
|
|
|
+ ],
|
|
|
+ placeholder: '请选择施測對象',
|
|
|
+ style: "width:100%"
|
|
|
+ },
|
|
|
+ formChange: {
|
|
|
+ id: '',
|
|
|
+ status: false,
|
|
|
+ scope: [],
|
|
|
+ end_date: ''
|
|
|
+ },
|
|
|
+ open: false
|
|
|
+
|
|
|
}
|
|
|
},
|
|
|
methods: {
|
|
|
+ /**
|
|
|
+ * 多選組件配置信息
|
|
|
+ * */
|
|
|
+ setChangeScope(value) {
|
|
|
+ console.log(value)
|
|
|
+ let self = this;
|
|
|
+ let data = [];
|
|
|
+ if (value) {
|
|
|
+ for (let i = 0; i < value.length; i++) {
|
|
|
+ data.push(value[i].value)
|
|
|
+ }
|
|
|
+ self.formChange.scope = data
|
|
|
+ }
|
|
|
+ },
|
|
|
+ changeSon() {
|
|
|
+ this.open = false
|
|
|
+ },
|
|
|
+
|
|
|
+
|
|
|
/**显示试卷分析 */
|
|
|
showAnalysis() {
|
|
|
this.examAnalysisStatus = !this.examAnalysisStatus
|
|
|
},
|
|
|
/**修改评测名称时修改试卷名称 */
|
|
|
handlePaperName() {
|
|
|
- for (let item of this.evaluationInfo.testPaper) {
|
|
|
+ for (let item of this.evaluationInfo.paperInfo) {
|
|
|
item.name = this.evaluationInfo.name + '--' + item.subjectName
|
|
|
}
|
|
|
},
|
|
@@ -277,16 +375,22 @@
|
|
|
* 处理挑选试卷事件
|
|
|
* @param data
|
|
|
*/
|
|
|
- selectPaper(data) {
|
|
|
- this.selectedPaper = data
|
|
|
+ selectPaper(data,info) {
|
|
|
+ console.log('返回試卷')
|
|
|
+ console.log(data)
|
|
|
+ console.log(info)
|
|
|
+ this.selectedPaper = info
|
|
|
+ this.selectedPaperInfo = data
|
|
|
+ console.log(this.selectedPaperInfo)
|
|
|
this.confirmPaperStatus = true
|
|
|
},
|
|
|
comfirmSelectPaper() {
|
|
|
- //this.evaluationInfo.testPaper[this.currentSubjectIndex].item = [...this.selectedPaper.item]
|
|
|
- //this.evaluationInfo.testPaper[this.currentSubjectIndex].markConfig = this.selectedPaper.markConfig
|
|
|
- this.evaluationInfo.testPaper[this.currentSubjectIndex] = JSON.parse(JSON.stringify(this.selectedPaper))
|
|
|
- this.evaluationInfo.testPaper[this.currentSubjectIndex].id = undefined
|
|
|
- console.log(this.evaluationInfo.testPaper)
|
|
|
+ //this.evaluationInfo.paperInfo[this.currentSubjectIndex].item = [...this.selectedPaper.item]
|
|
|
+ //this.evaluationInfo.paperInfo[this.currentSubjectIndex].markConfig = this.selectedPaper.markConfig
|
|
|
+ console.log(this.evaluationInfo.paperInfo)
|
|
|
+ this.evaluationInfo.paperInfo[this.currentSubjectIndex] = JSON.parse(JSON.stringify(this.selectedPaper))
|
|
|
+ this.evaluationInfo.papers[this.currentSubjectIndex] = JSON.parse(JSON.stringify(this.selectedPaperInfo))
|
|
|
+ this.evaluationInfo.paperInfo[this.currentSubjectIndex].id = undefined
|
|
|
this.goToPreview()
|
|
|
},
|
|
|
|
|
@@ -306,51 +410,52 @@
|
|
|
* 获取自动组题结果
|
|
|
* @param questions
|
|
|
*/
|
|
|
- getAutoQuestions(questions) {
|
|
|
- if (this.evaluationInfo.testPaper[this.currentSubjectIndex].item != undefined) {
|
|
|
- this.evaluationInfo.testPaper[this.currentSubjectIndex].item = [...questions, ...this.evaluationInfo.testPaper[this.currentSubjectIndex].item]
|
|
|
- } else {
|
|
|
- this.evaluationInfo.testPaper[this.currentSubjectIndex].item = [...questions]
|
|
|
- }
|
|
|
- //this.comfirmPreviewStatus = true//自动跳转到预览页面,无需手动确认
|
|
|
- this.goToPreview()//自动跳转
|
|
|
- },
|
|
|
+ //getAutoQuestions(questions) {
|
|
|
+ // if (this.evaluationInfo.paperInfo[this.currentSubjectIndex].item != undefined) {
|
|
|
+ // this.evaluationInfo.paperInfo[this.currentSubjectIndex].item = [...questions, ...this.evaluationInfo.paperInfo[this.currentSubjectIndex].item]
|
|
|
+ // } else {
|
|
|
+ // this.evaluationInfo.paperInfo[this.currentSubjectIndex].item = [...questions]
|
|
|
+ // }
|
|
|
+ // //this.comfirmPreviewStatus = true//自动跳转到预览页面,无需手动确认
|
|
|
+ // this.goToPreview()//自动跳转
|
|
|
+ //},
|
|
|
/**
|
|
|
* 获取导入试卷题目
|
|
|
* @param questions
|
|
|
*/
|
|
|
getImportQuestions(questions) {
|
|
|
- if (this.evaluationInfo.testPaper[this.currentSubjectIndex].item != undefined) {
|
|
|
- this.evaluationInfo.testPaper[this.currentSubjectIndex].item = [...questions, ...this.evaluationInfo.testPaper[this.currentSubjectIndex].item]
|
|
|
+ if (this.evaluationInfo.paperInfo[this.currentSubjectIndex].item != undefined) {
|
|
|
+ this.evaluationInfo.paperInfo[this.currentSubjectIndex].item = [...questions, ...this.evaluationInfo.paperInfo[this.currentSubjectIndex].item]
|
|
|
} else {
|
|
|
- this.evaluationInfo.testPaper[this.currentSubjectIndex].item = [...questions]
|
|
|
+ this.evaluationInfo.paperInfo[this.currentSubjectIndex].item = [...questions]
|
|
|
}
|
|
|
},
|
|
|
getSelectedQuestion(data) {
|
|
|
- this.evaluationInfo.testPaper[this.currentSubjectIndex].item = []
|
|
|
- this.evaluationInfo.testPaper[this.currentSubjectIndex].item = data.questions
|
|
|
+ this.evaluationInfo.paperInfo[this.currentSubjectIndex].item = []
|
|
|
+ this.evaluationInfo.paperInfo[this.currentSubjectIndex].item = data.questions
|
|
|
},
|
|
|
goToPreview() {
|
|
|
this.activeTab = 'preview'
|
|
|
+ this.evaluationInfo.paperInfo[this.currentSubjectIndex].createType = 'manualPaper'
|
|
|
},
|
|
|
deleteSubject(index) {
|
|
|
this.deleteIndex = index
|
|
|
this.$Modal.confirm({
|
|
|
title: '删除科目',
|
|
|
- content: '确认删除' + this.evaluationInfo.testPaper[index].periodName + '·' + this.evaluationInfo.testPaper[index].subjectName + '吗?',
|
|
|
+ content: '确认删除' + this.evaluationInfo.paperInfo[index].periodName + '·' + this.evaluationInfo.paperInfo[index].subjectName + '吗?',
|
|
|
onOk: () => {
|
|
|
let periodIndex = -1
|
|
|
for (let i in this.$store.state.schoolBaseInfo.schoolBaseInfo.period) {
|
|
|
- if (this.$store.state.schoolBaseInfo.schoolBaseInfo.period[i].id == this.evaluationInfo.testPaper[index].periodCode) {
|
|
|
+ if (this.$store.state.schoolBaseInfo.schoolBaseInfo.period[i].id == this.evaluationInfo.paperInfo[index].periodCode) {
|
|
|
periodIndex = i
|
|
|
}
|
|
|
}
|
|
|
for (let i = 0; i < this.testSubjects[periodIndex].length; i++) {
|
|
|
- if (this.evaluationInfo.testPaper[index].subjectCode == this.testSubjects[periodIndex][i]) {
|
|
|
+ if (this.evaluationInfo.paperInfo[index].subjectCode == this.testSubjects[periodIndex][i]) {
|
|
|
this.testSubjects[periodIndex].splice(i, 1)
|
|
|
}
|
|
|
}
|
|
|
- this.evaluationInfo.testPaper.splice(this.deleteIndex, 1)
|
|
|
+ this.evaluationInfo.paperInfo.splice(this.deleteIndex, 1)
|
|
|
this.currentSubjectIndex = 0
|
|
|
this.deleteIndex = -1
|
|
|
this.$Message.success('删除成功!')
|
|
@@ -360,25 +465,25 @@
|
|
|
},
|
|
|
})
|
|
|
},
|
|
|
- //newAddSubject(index, i, code) {
|
|
|
- // if (!this.checkIsDisabled(index, code)) {
|
|
|
- // let flag = true
|
|
|
- // for (let j = 0; j < this.newAddSubjects.length; j++) {
|
|
|
- // if (this.newAddSubjects[j].index == index && this.newAddSubjects[j].i == i) {
|
|
|
- // flag = false
|
|
|
- // this.newAddSubjects.splice(j, 1)
|
|
|
- // break
|
|
|
- // }
|
|
|
- // }
|
|
|
- // if (flag) {
|
|
|
- // this.newAddSubjects.push({
|
|
|
- // index, i
|
|
|
- // })
|
|
|
- // }
|
|
|
- // } else {
|
|
|
- // alert('disabled')
|
|
|
- // }
|
|
|
- //},
|
|
|
+ newAddSubject(index, i, code) {
|
|
|
+ if (!this.checkIsDisabled(index, code)) {
|
|
|
+ let flag = true
|
|
|
+ for (let j = 0; j < this.newAddSubjects.length; j++) {
|
|
|
+ if (this.newAddSubjects[j].index == index && this.newAddSubjects[j].i == i) {
|
|
|
+ flag = false
|
|
|
+ this.newAddSubjects.splice(j, 1)
|
|
|
+ break
|
|
|
+ }
|
|
|
+ }
|
|
|
+ if (flag) {
|
|
|
+ this.newAddSubjects.push({
|
|
|
+ index, code,i
|
|
|
+ })
|
|
|
+ }
|
|
|
+ } else {
|
|
|
+ alert('disabled')
|
|
|
+ }
|
|
|
+ },
|
|
|
checkIsDisabled(index, code) {
|
|
|
if (this.addSubjectBefore[index] !== undefined) {
|
|
|
return this.addSubjectBefore[index].indexOf(code) !== -1
|
|
@@ -393,8 +498,8 @@
|
|
|
this.activeTab = data
|
|
|
},
|
|
|
//getClassType() {
|
|
|
- // if (this.evaluationInfo.testPaper.length == 0) {
|
|
|
- // this.evaluationInfo.testPaper.push({
|
|
|
+ // if (this.evaluationInfo.paperInfo.length == 0) {
|
|
|
+ // this.evaluationInfo.paperInfo.push({
|
|
|
// periodName: '默认学段',
|
|
|
// periodCode: '80650390',
|
|
|
// subjectName: '默认学科',
|
|
@@ -408,30 +513,54 @@
|
|
|
// this.newAddSubjects.length = 0
|
|
|
// this.addSubjectBefore.length = 0
|
|
|
// } else {
|
|
|
- // this.evaluationInfo.testPaper.length = 0
|
|
|
+ // this.evaluationInfo.paperInfo.length = 0
|
|
|
// }
|
|
|
//},
|
|
|
- //confirmAddSubject() {
|
|
|
- // for (let item of this.newAddSubjects) {
|
|
|
- // this.evaluationInfo.testPaper.push({
|
|
|
- // periodName: this.$store.state.schoolBaseInfo.schoolBaseInfo.period[item.index].name,
|
|
|
- // periodCode: this.$store.state.schoolBaseInfo.schoolBaseInfo.period[item.index].id,
|
|
|
- // subjectName: this.$store.state.schoolBaseInfo.schoolBaseInfo.period[item.index].subjects[item.i].name,
|
|
|
- // subjectCode: this.$store.state.schoolBaseInfo.schoolBaseInfo.period[item.index].subjects[item.i].id,
|
|
|
- // createType: 'manualPaper',
|
|
|
- // score: 100,
|
|
|
- // item: [],
|
|
|
- // filter: {},
|
|
|
- // name: this.evaluationInfo.name + '--' + this.$store.state.schoolBaseInfo.schoolBaseInfo.period[item.index].subjects[item.i].name
|
|
|
- // })
|
|
|
- // }
|
|
|
- // this.newAddSubjects.length = 0
|
|
|
- // this.addSubjectBefore.length = 0
|
|
|
- //},
|
|
|
- //cancelAddSubject() {
|
|
|
- // [...this.testSubjects] = this.addSubjectBefore
|
|
|
- // this.addSubjectBefore.length = 0
|
|
|
- //},
|
|
|
+ confirmAddSubject() {
|
|
|
+ let data = {
|
|
|
+ pk: 'Exam',
|
|
|
+ code: "Exam-" + this.$store.state.userInfo.schoolCode,
|
|
|
+ school: this.$store.state.userInfo.schoolCode,
|
|
|
+ id: this.$jsFn.uuid(),
|
|
|
+ name: this.evaluationInfo.name,
|
|
|
+ creatorId: this.$store.state.userInfo.TEAMModelId,
|
|
|
+ type: "union",
|
|
|
+ period: {},
|
|
|
+ grades: [],
|
|
|
+ subjects: [],
|
|
|
+ examType: {},
|
|
|
+ year: new Date().getFullYear(),
|
|
|
+ range: this.mode,
|
|
|
+ source: this.evaluationInfo.evaType,
|
|
|
+ targetClasseIds: [],
|
|
|
+ startTime: this.evaluationInfo.startTime,
|
|
|
+ endTime: this.evaluationInfo.endTime,
|
|
|
+ progress: 'going',
|
|
|
+ scope: this.mode,
|
|
|
+ create: Math.round(new Date() / 1000)
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+ }
|
|
|
+ for (let item of this.newAddSubjects) {
|
|
|
+ this.evaluationInfo.paperInfo.push({
|
|
|
+ periodName: this.$store.state.schoolBaseInfo.schoolBaseInfo.period[item.index].name,
|
|
|
+ periodId: this.$store.state.schoolBaseInfo.schoolBaseInfo.period[item.index].id,
|
|
|
+ subjectName: this.$store.state.schoolBaseInfo.schoolBaseInfo.period[item.index].subjects[item.i].name,
|
|
|
+ subjectId: this.$store.state.schoolBaseInfo.schoolBaseInfo.period[item.index].subjects[item.i].id,
|
|
|
+ createType: 'manualPaper',
|
|
|
+ score: 100,
|
|
|
+ item: [],
|
|
|
+ filter: {},
|
|
|
+ name: this.evaluationInfo.name + '--' + this.$store.state.schoolBaseInfo.schoolBaseInfo.period[item.index].subjects[item.i].name
|
|
|
+ })
|
|
|
+ }
|
|
|
+ this.newAddSubjects.length = 0
|
|
|
+ this.addSubjectBefore.length = 0
|
|
|
+ },
|
|
|
+ cancelAddSubject() {
|
|
|
+ this.addSubjectBefore = [...this.testSubjects]
|
|
|
+ },
|
|
|
getSchoolBaseInfo() {
|
|
|
this.$store.dispatch('schoolBaseInfo/getSchoolBaseData').then(
|
|
|
(res) => {
|
|
@@ -443,6 +572,16 @@
|
|
|
this.$Message.error('API error!')
|
|
|
}
|
|
|
)
|
|
|
+ this.$store.dispatch('schoolBaseInfo/getClassroom').then(
|
|
|
+ (res) => {
|
|
|
+ if (res.code == 2) {
|
|
|
+ alert('数据为空!')
|
|
|
+ }
|
|
|
+ },
|
|
|
+ (err) => {
|
|
|
+ this.$Message.error('API error!')
|
|
|
+ }
|
|
|
+ )
|
|
|
},
|
|
|
/**
|
|
|
* 查找教师课程下的班级
|
|
@@ -459,9 +598,6 @@
|
|
|
res => {
|
|
|
if (res.error == null) {
|
|
|
this.classroomList = res.courses
|
|
|
- console.log(this.$store.state)
|
|
|
- //console.log(jsFn.getPeriod($store.state.schoolBaseInfo.schoolBaseInfo, item.periodCode))
|
|
|
- console.log(this.classroomList)
|
|
|
} else {
|
|
|
this.$Message.error('API ERROR!')
|
|
|
}
|
|
@@ -471,7 +607,7 @@
|
|
|
},
|
|
|
selectSubject(index) {
|
|
|
this.currentSubjectIndex = index
|
|
|
- this.activeTab = this.evaluationInfo.testPaper[index].createType
|
|
|
+ this.activeTab = this.evaluationInfo.paperInfo[index].createType
|
|
|
},
|
|
|
checkData() {
|
|
|
let flag = true
|
|
@@ -504,11 +640,10 @@
|
|
|
res => {
|
|
|
if (res.error == null) {
|
|
|
this.examInfo = res.result.data
|
|
|
- for (let index in this.evaluationInfo.testPaper) {
|
|
|
- this.saveTestPaper(this.evaluationInfo.testPaper[index], index)
|
|
|
+ for (let index in this.evaluationInfo.paperInfo) {
|
|
|
+ this.saveTestPaper(this.evaluationInfo.paperInfo[index], index)
|
|
|
}
|
|
|
this.goToManageStatus = true
|
|
|
-
|
|
|
} else {
|
|
|
this.$Message.error('API ERROR!')
|
|
|
}
|
|
@@ -521,14 +656,14 @@
|
|
|
},
|
|
|
/**
|
|
|
* 检查试卷数据完整性
|
|
|
- * @param testPaper
|
|
|
+ * @param paperInfo
|
|
|
*/
|
|
|
- checkPaper(testPaper) {
|
|
|
- if (!testPaper.code) {
|
|
|
- testPaper.code = this.examInfo.id
|
|
|
+ checkPaper(paperInfo) {
|
|
|
+ if (!paperInfo.code) {
|
|
|
+ paperInfo.code = this.examInfo.id
|
|
|
}
|
|
|
- if (!testPaper.markConfig) {
|
|
|
- testPaper.markConfig = {
|
|
|
+ if (!paperInfo.markConfig) {
|
|
|
+ paperInfo.markConfig = {
|
|
|
"auto": false,
|
|
|
"type": 0,
|
|
|
"score": 0
|
|
@@ -537,29 +672,29 @@
|
|
|
},
|
|
|
/**
|
|
|
* 保存试卷
|
|
|
- * @param testPaper
|
|
|
+ * @param paperInfo
|
|
|
* @param index
|
|
|
*/
|
|
|
- saveTestPaper(testPaper, index) {
|
|
|
+ saveTestPaper(paperInfo, index) {
|
|
|
|
|
|
if (this.examInfo.id == undefined) {
|
|
|
this.saveEvaluation()
|
|
|
} else {
|
|
|
//let requestData = {
|
|
|
- // id: testPaper.id == undefined ? null : testPaper.id,
|
|
|
+ // id: paperInfo.id == undefined ? null : paperInfo.id,
|
|
|
// code: this.examInfo.id,
|
|
|
// schoolCode: this.$store.state.userInfo.schoolCode,
|
|
|
- // subjectCode: testPaper.subjectCode,
|
|
|
- // periodCode: testPaper.periodCode,
|
|
|
- // item: testPaper.item,
|
|
|
- // score: testPaper.score,
|
|
|
- // name: testPaper.name
|
|
|
+ // subjectCode: paperInfo.subjectCode,
|
|
|
+ // periodCode: paperInfo.periodCode,
|
|
|
+ // item: paperInfo.item,
|
|
|
+ // score: paperInfo.score,
|
|
|
+ // name: paperInfo.name
|
|
|
//}
|
|
|
- this.checkPaper(testPaper)
|
|
|
- this.$api.learnActivity.SaveExamPaper(testPaper).then(
|
|
|
+ this.checkPaper(paperInfo)
|
|
|
+ this.$api.learnActivity.SaveExamPaper(paperInfo).then(
|
|
|
res => {
|
|
|
if (res.error == null) {
|
|
|
- this.evaluationInfo.testPaper[index].id = res.result.data.id
|
|
|
+ this.evaluationInfo.paperInfo[index].id = res.result.data.id
|
|
|
} else {
|
|
|
this.$Message.error('API ERROR!')
|
|
|
}
|
|
@@ -571,12 +706,14 @@
|
|
|
}
|
|
|
},
|
|
|
saveEvaluation() {
|
|
|
- if (this.checkData()) {
|
|
|
- this.handleData()
|
|
|
+ console.log('最後數據')
|
|
|
+ console.log(this.evaluationInfo)
|
|
|
+ //if (this.checkData()) {
|
|
|
+ // this.handleData()
|
|
|
|
|
|
- } else {
|
|
|
- this.$Message.error('请完善基础信息,再保存!')
|
|
|
- }
|
|
|
+ //} else {
|
|
|
+ // this.$Message.error('请完善基础信息,再保存!')
|
|
|
+ //}
|
|
|
},
|
|
|
addSubject() {
|
|
|
[...this.addSubjectBefore] = this.testSubjects
|
|
@@ -589,15 +726,15 @@
|
|
|
if (routerData !== undefined) {
|
|
|
this.startTime = new Date(routerData.startTime)
|
|
|
this.endTime = new Date(routerData.endTime)
|
|
|
- for (let i = 0; i < routerData.testPaper.length; i++) {
|
|
|
- routerData.testPaper[i].createType = 'manualPaper'
|
|
|
+ for (let i = 0; i < routerData.paperInfo.length; i++) {
|
|
|
+ routerData.paperInfo[i].createType = 'manualPaper'
|
|
|
}
|
|
|
this.evaluationInfo = routerData
|
|
|
|
|
|
/**
|
|
|
处理无接口数据时返回为个人课程或校本课程
|
|
|
*/
|
|
|
- if (routerData.testPaper.length > 1) {
|
|
|
+ if (routerData.paperInfo.length > 1) {
|
|
|
this.mode = 'school'
|
|
|
} else {
|
|
|
this.mode = 'class'
|