|
@@ -1,37 +1,37 @@
|
|
<template>
|
|
<template>
|
|
<div class="ev-list-container">
|
|
<div class="ev-list-container">
|
|
<div class="ev-header">
|
|
<div class="ev-header">
|
|
- <Icon type="md-bookmarks" size="30" color="rgb(16, 171, 231)"/>
|
|
|
|
|
|
+ <Icon type="md-bookmarks" size="30" color="rgb(16, 171, 231)" />
|
|
<span class="ev-title">我的题库</span>
|
|
<span class="ev-title">我的题库</span>
|
|
- <span class="ev-length">共 {{allList.length}} 道题</span>
|
|
|
|
|
|
+ <span class="ev-length">共 {{list.length}} 道题</span>
|
|
</div>
|
|
</div>
|
|
<!-- 筛选部分 -->
|
|
<!-- 筛选部分 -->
|
|
<div class="filter-wrap">
|
|
<div class="filter-wrap">
|
|
<div class="filter-item">
|
|
<div class="filter-item">
|
|
<span class="filter-title">题型:</span>
|
|
<span class="filter-title">题型:</span>
|
|
- <RadioGroup v-model="filterType" type="button">
|
|
|
|
- <Radio label="0">全部</Radio>
|
|
|
|
- <Radio label="1">单选</Radio>
|
|
|
|
- <Radio label="2">多选</Radio>
|
|
|
|
- <Radio label="3">判断</Radio>
|
|
|
|
- <Radio label="4">填空</Radio>
|
|
|
|
- <Radio label="5">问答</Radio>
|
|
|
|
|
|
+ <RadioGroup v-model="filterType" type="button" @on-change="filterTypeChange">
|
|
|
|
+ <Radio label="all">全部</Radio>
|
|
|
|
+ <Radio label="single">单选</Radio>
|
|
|
|
+ <Radio label="multiple">多选</Radio>
|
|
|
|
+ <Radio label="judge">判断</Radio>
|
|
|
|
+ <Radio label="complete">填空</Radio>
|
|
|
|
+ <Radio label="subjective">问答</Radio>
|
|
</RadioGroup>
|
|
</RadioGroup>
|
|
</div>
|
|
</div>
|
|
<div class="filter-item">
|
|
<div class="filter-item">
|
|
<span class="filter-title">难度:</span>
|
|
<span class="filter-title">难度:</span>
|
|
- <RadioGroup v-model="filterDiff" type="button">
|
|
|
|
- <Radio label="0">全部</Radio>
|
|
|
|
- <Radio label="1">容易</Radio>
|
|
|
|
- <Radio label="2">较易</Radio>
|
|
|
|
- <Radio label="3">一般</Radio>
|
|
|
|
- <Radio label="4">较难</Radio>
|
|
|
|
- <Radio label="5">困难</Radio>
|
|
|
|
|
|
+ <RadioGroup v-model="filterDiff" type="button" @on-change="filterDiffChange">
|
|
|
|
+ <Radio label="all">全部</Radio>
|
|
|
|
+ <Radio label="0">容易</Radio>
|
|
|
|
+ <Radio label="1">较易</Radio>
|
|
|
|
+ <Radio label="2">一般</Radio>
|
|
|
|
+ <Radio label="3">较难</Radio>
|
|
|
|
+ <Radio label="4">困难</Radio>
|
|
</RadioGroup>
|
|
</RadioGroup>
|
|
</div>
|
|
</div>
|
|
<div class="filter-item">
|
|
<div class="filter-item">
|
|
<span class="filter-title">排序:</span>
|
|
<span class="filter-title">排序:</span>
|
|
- <RadioGroup v-model="filterSort" type="button">
|
|
|
|
|
|
+ <RadioGroup v-model="filterSort" type="button" @on-change="filterSortChange">
|
|
<Radio label="0">新增时间<Icon type="md-arrow-round-down" /></Radio>
|
|
<Radio label="0">新增时间<Icon type="md-arrow-round-down" /></Radio>
|
|
<Radio label="1">使用次数<Icon type="md-arrow-round-down" /></Radio>
|
|
<Radio label="1">使用次数<Icon type="md-arrow-round-down" /></Radio>
|
|
</RadioGroup>
|
|
</RadioGroup>
|
|
@@ -70,7 +70,7 @@
|
|
<Button type="primary" @click="handleEdit(item)">编辑题目</Button>
|
|
<Button type="primary" @click="handleEdit(item)">编辑题目</Button>
|
|
<Button type="info">选题</Button>
|
|
<Button type="info">选题</Button>
|
|
<span class="item-tools-bind">
|
|
<span class="item-tools-bind">
|
|
- <span class="item-tools-tool"><Icon type="ios-link" />绑定知识点</span>
|
|
|
|
|
|
+ <span class="item-tools-tool" @click="handleBindPoint"><Icon type="ios-link" />绑定知识点</span>
|
|
<span class="item-tools-tool"><Icon type="ios-link" />绑定科目</span>
|
|
<span class="item-tools-tool"><Icon type="ios-link" />绑定科目</span>
|
|
<span class="item-tools-tool"><Icon type="ios-link" />绑定课纲</span>
|
|
<span class="item-tools-tool"><Icon type="ios-link" />绑定课纲</span>
|
|
</span>
|
|
</span>
|
|
@@ -81,9 +81,29 @@
|
|
show-sizer
|
|
show-sizer
|
|
@on-page-size-change="pageSizeChange"
|
|
@on-page-size-change="pageSizeChange"
|
|
@on-change="pageChange"
|
|
@on-change="pageChange"
|
|
- :page-size-opts="[5,10,15,20]"
|
|
|
|
- />
|
|
|
|
|
|
+ :page-size-opts="[5,10,15,20]" />
|
|
<Button type="success" @click="backToAdd" style="margin:10px;">返回</Button>
|
|
<Button type="success" @click="backToAdd" style="margin:10px;">返回</Button>
|
|
|
|
+
|
|
|
|
+ <!-- 绑定知识点弹窗 Transfer -->
|
|
|
|
+ <Modal v-model="bindPointModal"
|
|
|
|
+ title="绑定知识点"
|
|
|
|
+ width="500"
|
|
|
|
+ class-name="transferModal"
|
|
|
|
+ @on-ok="handleTransferBlock"
|
|
|
|
+ @on-cancel="">
|
|
|
|
+ <div class="point-list">
|
|
|
|
+ <p class="bind-title">选择知识点</p>
|
|
|
|
+ <Input search placeholder="搜索知识点..." />
|
|
|
|
+ <Tree :data="knowPointList" ref="pointTree" :render="renderContent" @on-check-change="pointTreeCheck" check-strictly></Tree>
|
|
|
|
+ </div>
|
|
|
|
+
|
|
|
|
+ <div class="selected-point-list">
|
|
|
|
+ <p class="bind-title">已选知识点<span style="font-weight:500"> (最多绑定5个知识点)</span><span class="btn-clear" @click="handleClearChecked">清空</span></p>
|
|
|
|
+ <span class="checked-point" v-for="item in checkedPointList">{{item.name}}</span>
|
|
|
|
+ </div>
|
|
|
|
+ </Modal>
|
|
|
|
+
|
|
|
|
+
|
|
</div>
|
|
</div>
|
|
</template>
|
|
</template>
|
|
<script>
|
|
<script>
|
|
@@ -97,6 +117,7 @@ import { setTimeout } from 'core-js';
|
|
data() {
|
|
data() {
|
|
return {
|
|
return {
|
|
list: [],
|
|
list: [],
|
|
|
|
+ bindPointModal: false,
|
|
exersicesType: {
|
|
exersicesType: {
|
|
single: "单选",
|
|
single: "单选",
|
|
multiple: "多选",
|
|
multiple: "多选",
|
|
@@ -106,14 +127,15 @@ import { setTimeout } from 'core-js';
|
|
},
|
|
},
|
|
exersicesDiff: ["容易", "较易", "一般", "较难", "困难"],
|
|
exersicesDiff: ["容易", "较易", "一般", "较难", "困难"],
|
|
diffColors: ['#32CF74', '#E8BE15', '#F19300', '#EB5E00', '#D30000'],
|
|
diffColors: ['#32CF74', '#E8BE15', '#F19300', '#EB5E00', '#D30000'],
|
|
- filterType:"0",
|
|
|
|
- filterDiff:"0",
|
|
|
|
|
|
+ filterType:"all",
|
|
|
|
+ filterDiff:"all",
|
|
filterSort: "0",
|
|
filterSort: "0",
|
|
pageSize: 5,
|
|
pageSize: 5,
|
|
pageNum: 1,
|
|
pageNum: 1,
|
|
totalNum: 100,
|
|
totalNum: 100,
|
|
- allList: questions.list
|
|
|
|
-
|
|
|
|
|
|
+ allList: questions.list,
|
|
|
|
+ knowPointList: [],
|
|
|
|
+ checkedPointList: []
|
|
}
|
|
}
|
|
},
|
|
},
|
|
created() {
|
|
created() {
|
|
@@ -126,6 +148,30 @@ import { setTimeout } from 'core-js';
|
|
|
|
|
|
},
|
|
},
|
|
methods: {
|
|
methods: {
|
|
|
|
+
|
|
|
|
+ //筛选题型
|
|
|
|
+ filterTypeChange(val) {
|
|
|
|
+ if (val == "all") {
|
|
|
|
+ this.list = questions.list;
|
|
|
|
+ } else {
|
|
|
|
+ this.list = questions.list.filter(item => item.type == val);
|
|
|
|
+ }
|
|
|
|
+ },
|
|
|
|
+
|
|
|
|
+ //筛选难度
|
|
|
|
+ filterDiffChange(val) {
|
|
|
|
+ if (val == "all") {
|
|
|
|
+ this.list = questions.list;
|
|
|
|
+ } else {
|
|
|
|
+ this.list = questions.list.filter(item => item.difficulty == val);
|
|
|
|
+ }
|
|
|
|
+ },
|
|
|
|
+
|
|
|
|
+ //排序条件更换
|
|
|
|
+ filterSortChange(val) {
|
|
|
|
+ console.log(val);
|
|
|
|
+ },
|
|
|
|
+
|
|
//展开与收起答案
|
|
//展开与收起答案
|
|
showAnswer(e, type) {
|
|
showAnswer(e, type) {
|
|
let el = e.currentTarget;
|
|
let el = e.currentTarget;
|
|
@@ -171,6 +217,119 @@ import { setTimeout } from 'core-js';
|
|
item: item,
|
|
item: item,
|
|
}
|
|
}
|
|
})
|
|
})
|
|
|
|
+ },
|
|
|
|
+
|
|
|
|
+ //绑定知识点操作
|
|
|
|
+ handleBindPoint() {
|
|
|
|
+ this.bindPointModal = true;
|
|
|
|
+ this.getStandardList();
|
|
|
|
+ },
|
|
|
|
+
|
|
|
|
+ //获取标准知识块数据
|
|
|
|
+ getStandardList() {
|
|
|
|
+ let data = {
|
|
|
|
+ periods: ["Period_21"],
|
|
|
|
+ pointParams: {
|
|
|
|
+ SubjectCode: "Subject_Chinese",
|
|
|
|
+ PartitionKey: "zh-CN",
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ this.$api.FindKnowledgeBlockAndPointByDict(data).then(res => {
|
|
|
|
+ let list = res.result.data;
|
|
|
|
+ this.knowPointList = list;
|
|
|
|
+ })
|
|
|
|
+ },
|
|
|
|
+
|
|
|
|
+ //确认编辑知识块
|
|
|
|
+ handleTransferBlock() {
|
|
|
|
+
|
|
|
|
+ },
|
|
|
|
+
|
|
|
|
+ //知识点绑定选中事件
|
|
|
|
+ pointTreeCheck(val, data) {
|
|
|
|
+ //let list = this.checkedPointList;
|
|
|
|
+ //if (data.children.length == 0 && list.length < 5 && val.indexOf(data) > -1) {
|
|
|
|
+ // list.push(data);
|
|
|
|
+ //} else if (list.length === 5) {
|
|
|
|
+ // this.$Message.warning("最多绑定5个知识点!");
|
|
|
|
+ //} else if (val.indexOf(data) === -1 && list.indexOf(data) > -1) {
|
|
|
|
+ // list.splice(list.indexOf(data), 1);
|
|
|
|
+ //}
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+ let points = val.filter(item => item.children.length == 0);
|
|
|
|
+ if (points.length > 5) {
|
|
|
|
+ this.checkedPointList = points.slice(0, 5);
|
|
|
|
+ this.$Message.warning("最多绑定5个知识点!");
|
|
|
|
+ } else {
|
|
|
|
+ this.checkedPointList = points;
|
|
|
|
+ }
|
|
|
|
+ console.log(val, data);
|
|
|
|
+ },
|
|
|
|
+
|
|
|
|
+ //知识点树形结构渲染
|
|
|
|
+ renderContent(h, { root, node, data }) {
|
|
|
|
+ return h(
|
|
|
|
+ "span",
|
|
|
|
+ {
|
|
|
|
+ domProps: {
|
|
|
|
+ className: "singleClass"
|
|
|
|
+ },
|
|
|
|
+ on: {
|
|
|
|
+ click: () => {
|
|
|
|
+ this.titleClick(root, node, data, event);
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ },[
|
|
|
|
+ h("span", [
|
|
|
|
+ h("Icon", {
|
|
|
|
+ props: {
|
|
|
|
+ type:
|
|
|
|
+ data.children && data.children.length > 0
|
|
|
|
+ ? "md-albums"
|
|
|
|
+ : "ios-paper-outline"
|
|
|
|
+ },
|
|
|
|
+ style: {
|
|
|
|
+ marginRight: "5px",
|
|
|
|
+ }
|
|
|
|
+ }),
|
|
|
|
+ h("span", data.name),
|
|
|
|
+ h('span',{
|
|
|
|
+ domProps: {
|
|
|
|
+ className: this.checkedPointList.indexOf(data) > -1 ? "point-checked" : "point-unchecked"
|
|
|
|
+ },
|
|
|
|
+ style: {
|
|
|
|
+ display: data.children && data.children.length > 0
|
|
|
|
+ ? "none"
|
|
|
|
+ : "inline-block"
|
|
|
|
+ },
|
|
|
|
+ on: {
|
|
|
|
+ click: () => {
|
|
|
|
+ if (this.checkedPointList.indexOf(data) == -1) {
|
|
|
|
+ if (this.checkedPointList.length < 5) {
|
|
|
|
+ this.checkedPointList.push(data);
|
|
|
|
+ } else {
|
|
|
|
+ this.$Message.warning("最多绑定5个知识点!");
|
|
|
|
+ }
|
|
|
|
+ } else {
|
|
|
|
+ this.checkedPointList.splice(this.checkedPointList.indexOf(data), 1);
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ })
|
|
|
|
+ ])
|
|
|
|
+ ]
|
|
|
|
+ );
|
|
|
|
+ },
|
|
|
|
+ // 标题点击收缩展开
|
|
|
|
+ titleClick(root, node, data, event) {
|
|
|
|
+ data.expand = !data.expand;
|
|
|
|
+ },
|
|
|
|
+
|
|
|
|
+ handleClearChecked() {
|
|
|
|
+ console.log(this.$refs.pointTree.getCheckedNodes());
|
|
|
|
+ //this.$refs.pointTree.getSelectedNodes() = [];
|
|
|
|
+ this.checkedPointList = [];
|
|
}
|
|
}
|
|
|
|
|
|
},
|
|
},
|