|
@@ -103,30 +103,60 @@
|
|
|
<TabPane label="题目">
|
|
|
<div class="tab-wrap">
|
|
|
<vuescroll v-if="questionList.length > 0">
|
|
|
- <div class="content-filter-wrap">
|
|
|
- <div class="content-filter-item">
|
|
|
- <span class="content-filter-label">题目范围:</span>
|
|
|
- <RadioGroup v-model="syllabusFilter.type" style="display:inline-block;">
|
|
|
- <Radio :label="0" class="radio-width">私有题库</Radio>
|
|
|
- <Radio :label="1" class="radio-width">校本题库</Radio>
|
|
|
- </RadioGroup>
|
|
|
+ <Row class="question-filter-wrap">
|
|
|
+ <Col :xs="24" :sm="24" :md="24" :lg="24" :xl="12">
|
|
|
+ <div class="manual-filter-item">
|
|
|
+ <span class="manual-filter-label">来源:</span>
|
|
|
+ <CheckboxGroup v-model="questionFilter.scopeCode" style="display:inline-block;" @on-change="checkAll($event,'scopeCode')">
|
|
|
+ <Checkbox label="all">全部</Checkbox>
|
|
|
+ <Checkbox :label="demoLoginInfo.TEAMModelId">私有题库</Checkbox>
|
|
|
+ <Checkbox :label="demoLoginInfo.schoolCode">校本题库</Checkbox>
|
|
|
+ </CheckboxGroup>
|
|
|
</div>
|
|
|
- <div class="content-filter-item">
|
|
|
- <span class="content-filter-label">题型:</span>
|
|
|
- <RadioGroup v-model="syllabusFilter.periodCode" style="display:inline-block;" @on-change="getSubjectList">
|
|
|
- <Radio label="All" class="radio-width">全部</Radio>
|
|
|
- <Radio label="Single" class="radio-width">单选题</Radio>
|
|
|
- <Radio label="Multiple" class="radio-width">多选题</Radio>
|
|
|
- <Radio label="Judge" class="radio-width">判断题</Radio>
|
|
|
- <Radio label="Complete" class="radio-width">填空题</Radio>
|
|
|
- <Radio label="Subjective" class="radio-width">问答题</Radio>
|
|
|
- <Radio label="Compose" class="radio-width">综合题</Radio>
|
|
|
- </RadioGroup>
|
|
|
+ </Col>
|
|
|
+ <Col :xs="24" :sm="24" :md="24" :lg="24" :xl="12">
|
|
|
+ <div class="manual-filter-item">
|
|
|
+ <span class="manual-filter-label">学段:</span>
|
|
|
+ <CheckboxGroup v-model="questionFilter.periodCode" style="display: inline-block;" @on-change="checkAll($event,'periodCode')">
|
|
|
+ <Checkbox label="all">全部</Checkbox>
|
|
|
+ <Checkbox v-for="(item,index) in $store.state.schoolBaseInfo.schoolBaseInfo.period" :label="item.periodCode">{{item.periodName}}</Checkbox>
|
|
|
+ </CheckboxGroup>
|
|
|
</div>
|
|
|
- <Input class="seach-input" suffix="ios-search" placeholder="关键字搜索" clearable style="width: 240px" size="small" />
|
|
|
- </div>
|
|
|
+ </Col>
|
|
|
+ <Col :xs="24" :sm="24" :md="24" :lg="24" :xl="12">
|
|
|
+ <div class="manual-filter-item">
|
|
|
+ <span class="manual-filter-label">题型:</span>
|
|
|
+ <CheckboxGroup v-model="questionFilter.type" border style="display: inline-block;" @on-change="checkAll($event,'type')">
|
|
|
+ <Checkbox label="all">全部</Checkbox>
|
|
|
+ <Checkbox label="Single">单选</Checkbox>
|
|
|
+ <Checkbox label="Multiple">多选</Checkbox>
|
|
|
+ <Checkbox label="Judge">判断</Checkbox>
|
|
|
+ <Checkbox label="Complete">填空</Checkbox>
|
|
|
+ <Checkbox label="Subjective">问答</Checkbox>
|
|
|
+ <Checkbox label="Compose">综合</Checkbox>
|
|
|
+ </CheckboxGroup>
|
|
|
+ </div>
|
|
|
+ </Col>
|
|
|
+ <Col :xs="24" :sm="24" :md="24" :lg="24" :xl="12">
|
|
|
+ <div class="manual-filter-item">
|
|
|
+ <span class="manual-filter-label">难度:</span>
|
|
|
+ <CheckboxGroup v-model="questionFilter.level" border style="display: inline-block;" @on-change="checkAll($event,'level')">
|
|
|
+ <Checkbox label="all">全部</Checkbox>
|
|
|
+ <Checkbox v-for="(item,index) in exersicesDiff" :key="index" :label="index + 1">{{ item }}</Checkbox>
|
|
|
+ </CheckboxGroup>
|
|
|
+ </div>
|
|
|
+ </Col>
|
|
|
+ <Col :xs="24" :sm="24" :md="24" :lg="24" :xl="12">
|
|
|
+ <div class="manual-filter-item">
|
|
|
+ <span class="manual-filter-label">知识点:</span>
|
|
|
+ <span>暂无知识点</span>
|
|
|
+ <Icon @click="addKnowledge" type="md-add-circle" title="添加知识点" color="white" style="margin-left:15px;cursor:pointer;" size="18" />
|
|
|
+ </div>
|
|
|
+ </Col>
|
|
|
+ </Row>
|
|
|
<div class="choose-question-wrap">
|
|
|
- <QuestionList :config="questionConfig" @seleteQuestion="seleteQuestion" :questions="questionList"></QuestionList>
|
|
|
+ <Loading :top="100" v-show="isLoading"></Loading>
|
|
|
+ <QuestionList :class="isLoading ? '':'animated fadeIn'" v-show="!isLoading" :config="questionConfig" @seleteQuestion="seleteQuestion" :questions="questionList"></QuestionList>
|
|
|
<NoData style="margin-top:30px;" v-if="questionList.length == 0"></NoData>
|
|
|
<div class="page-wrap">
|
|
|
<Page :current.sync="pageNum" :total="totalNum" :page-size="pageSize" size="small" show-elevator show-sizer @on-change="getCurrentPageData" />
|
|
@@ -142,18 +172,28 @@
|
|
|
import NoData from '@/common/NoData.vue'
|
|
|
import JSONPath from 'jsonpath'
|
|
|
import QuestionList from '@/components/learnactivity/QuestionList.vue'
|
|
|
- import questions from '../../view/evaluation/index/list.json'
|
|
|
+ import Loading from '@/common/Loading.vue'
|
|
|
export default {
|
|
|
components: {
|
|
|
NoData,
|
|
|
- QuestionList
|
|
|
+ QuestionList,
|
|
|
+ Loading
|
|
|
},
|
|
|
data() {
|
|
|
return {
|
|
|
- pageNum: 0,
|
|
|
- totalNum: 100,
|
|
|
+ isLoading: false,
|
|
|
+ questionFilter: {
|
|
|
+ periodCode: ['all'],
|
|
|
+ scopeCode: ['all'],
|
|
|
+ points: ['all'],
|
|
|
+ type: ['all'],
|
|
|
+ level: ['all'],
|
|
|
+ subjectCode: ['all']
|
|
|
+ },
|
|
|
+ exersicesDiff: ['容易', '较易', '一般', '较难', '困难'],
|
|
|
+ pageNum: 1,
|
|
|
+ totalNum: 0,
|
|
|
pageSize: 20,
|
|
|
-
|
|
|
questionConfig: {
|
|
|
showSelect: true
|
|
|
},
|
|
@@ -191,7 +231,6 @@
|
|
|
}
|
|
|
],
|
|
|
questionList: [],
|
|
|
- //selectedFiles:[],
|
|
|
selectedQuestions: [],
|
|
|
searchBefore: [],
|
|
|
defaultProps: {
|
|
@@ -213,12 +252,89 @@
|
|
|
status: 1,
|
|
|
scopeCode: 'HBCN'
|
|
|
},
|
|
|
-
|
|
|
+ addKnowledgeStatus: false
|
|
|
}
|
|
|
},
|
|
|
methods: {
|
|
|
- getCurrentPageData(page) {
|
|
|
+ /**
|
|
|
+ * 查询当前页题目
|
|
|
+ */
|
|
|
+ getCurrentPageData(pageNum) {
|
|
|
+ this.queryQuestionByPage()
|
|
|
+ },
|
|
|
+ /**
|
|
|
+ * 选择全部逻辑
|
|
|
+ * @param data:选中数据
|
|
|
+ * @param field:字段名
|
|
|
+ */
|
|
|
+ checkAll(data, field) {
|
|
|
+ if (this.questionFilter[field].length !== 1 && this.questionFilter[field].indexOf('all') === 0) {
|
|
|
+ this.questionFilter[field].splice(this.questionFilter[field].indexOf('all'), 1)
|
|
|
+ } else if (this.questionFilter[field].indexOf('all') > 0) {
|
|
|
+ this.questionFilter[field].length = 0
|
|
|
+ this.$set(this.questionFilter[field], 0, 'all')
|
|
|
+ }
|
|
|
+ console.log(this.questionFilter)
|
|
|
+ this.pageNum = 1
|
|
|
+ this.getResultCount()
|
|
|
+ this.queryQuestionByPage()
|
|
|
+ },
|
|
|
+ /**
|
|
|
+ * 获取题库数量
|
|
|
+ */
|
|
|
+ getResultCount() {
|
|
|
+ let findCountParams = {
|
|
|
+ "collectionName": "ExamItem",
|
|
|
+ "queryDict": {
|
|
|
+ 'scopeCode': this.deleteAll(this.questionFilter.scopeCode),
|
|
|
+ 'periodCode': this.deleteAll(this.questionFilter.periodCode),
|
|
|
+ 'level': this.deleteAll(this.questionFilter.level),
|
|
|
+ 'type': this.deleteAll(this.questionFilter.type),
|
|
|
+ 'gradeCode': [],
|
|
|
+ 'subjectCode': [],
|
|
|
+ 'field': [],
|
|
|
+ }
|
|
|
+ }
|
|
|
+ this.$api.newEvaluation.FindCount(findCountParams).then(res => {
|
|
|
+ this.totalNum = res.result.data[0]
|
|
|
+ })
|
|
|
+ },
|
|
|
+ /**
|
|
|
+ * 分页查询题目
|
|
|
+ */
|
|
|
+ queryQuestionByPage() {
|
|
|
+ let queryData = {
|
|
|
+ '@CURRPAGE': this.pageNum,
|
|
|
+ '@PAGESIZE': this.pageSize,
|
|
|
+ 'scopeCode': this.deleteAll(this.questionFilter.scopeCode),
|
|
|
+ 'periodCode': this.deleteAll(this.questionFilter.periodCode),
|
|
|
+ 'level': this.deleteAll(this.questionFilter.level),
|
|
|
+ 'type': this.deleteAll(this.questionFilter.type),
|
|
|
+ 'gradeCode': [],
|
|
|
+ 'subjectCode': [],
|
|
|
|
|
|
+ }
|
|
|
+ this.isLoading = true
|
|
|
+ this.$api.newEvaluation.FindExerciseList(queryData).then(res => {
|
|
|
+ this.questionList = res.result.data
|
|
|
+ setTimeout(() => {
|
|
|
+ this.isLoading = false
|
|
|
+ }, 500)
|
|
|
+ })
|
|
|
+ },
|
|
|
+ deleteAll(data) {
|
|
|
+ if (data.length == 1) {
|
|
|
+ if (data[0] == 'all') {
|
|
|
+ return []
|
|
|
+ } else {
|
|
|
+ return data
|
|
|
+ }
|
|
|
+ } else {
|
|
|
+ return data
|
|
|
+ }
|
|
|
+ },
|
|
|
+ addKnowledge() {
|
|
|
+ this.addKnowledgeStatus = true
|
|
|
},
|
|
|
setScopeCode(type) {
|
|
|
|
|
@@ -226,7 +342,7 @@
|
|
|
seleteQuestion(question) {
|
|
|
let flag = true
|
|
|
for (let item of this.selectedQuestions) {
|
|
|
- if (item.shaCode == question.shaCode) {
|
|
|
+ if (item.id == question.id) {
|
|
|
flag = false
|
|
|
break
|
|
|
}
|
|
@@ -303,18 +419,6 @@
|
|
|
key: 'fileName',
|
|
|
sortable: true
|
|
|
},
|
|
|
- //{
|
|
|
- // title: this.$t('teachContent.tableC2'),
|
|
|
- // slot: 'action',
|
|
|
- // width: 210,
|
|
|
- // align: 'center'
|
|
|
- //},
|
|
|
- //{
|
|
|
- // title: this.$t('teachContent.tableC3'),
|
|
|
- // slot: 'knowledges',
|
|
|
- // width: 180,
|
|
|
- // align: 'center'
|
|
|
- //},
|
|
|
{
|
|
|
title: this.$t('teachContent.tableC4'),
|
|
|
slot: 'size',
|
|
@@ -425,7 +529,8 @@
|
|
|
Date.prototype.toLocaleString = function () {
|
|
|
return this.getFullYear() + "/" + (this.getMonth() + 1) + "/" + this.getDate();
|
|
|
}
|
|
|
- this.questionList = questions.result.data
|
|
|
+ this.getResultCount()
|
|
|
+ this.queryQuestionByPage()
|
|
|
}
|
|
|
}
|
|
|
</script>
|