|
@@ -1,176 +1,16 @@
|
|
|
<template>
|
|
<template>
|
|
|
- <div>
|
|
|
|
|
- <h1>Question Repository</h1>
|
|
|
|
|
- <div v-if="!multipleMode">
|
|
|
|
|
- <el-button icon="el-icon-search" type="primary">搜索</el-button>
|
|
|
|
|
- <el-button icon="el-icon-folder-add" type="success">新建</el-button>
|
|
|
|
|
- <el-button @click="clickMulSelect" icon="el-icon-more" type="warning">批量处理</el-button>
|
|
|
|
|
- </div>
|
|
|
|
|
- <div v-else>
|
|
|
|
|
- <el-button type="danger" icon="el-icon-delete" @click="clickMulDelete">删除</el-button>
|
|
|
|
|
- <el-button @click="multipleMode = !multipleMode" type="info" icon="el-icon-finished">完成
|
|
|
|
|
- </el-button>
|
|
|
|
|
- </div>
|
|
|
|
|
- <div>
|
|
|
|
|
- <el-space direction="vertical">
|
|
|
|
|
- <h2>筛选</h2>
|
|
|
|
|
- <el-button type="danger" @click="clearFilter">清空</el-button>
|
|
|
|
|
- <el-space direction="vertical">
|
|
|
|
|
- <div class="filter-point">
|
|
|
|
|
- <el-space>
|
|
|
|
|
- <h3>题型</h3>
|
|
|
|
|
- <el-checkbox-group v-model="knowledgeFilter">
|
|
|
|
|
- <el-checkbox-button label="选择">选择</el-checkbox-button>
|
|
|
|
|
- <el-checkbox-button label="填空">填空</el-checkbox-button>
|
|
|
|
|
- </el-checkbox-group>
|
|
|
|
|
- </el-space>
|
|
|
|
|
- </div>
|
|
|
|
|
- <div class="filter-point">
|
|
|
|
|
- <el-space>
|
|
|
|
|
- <h3>知识点</h3>
|
|
|
|
|
- <el-checkbox-group v-model="knowledgeFilter">
|
|
|
|
|
- <el-checkbox-button label="java">Java</el-checkbox-button>
|
|
|
|
|
- <el-checkbox-button label="python">Python</el-checkbox-button>
|
|
|
|
|
- </el-checkbox-group>
|
|
|
|
|
- </el-space>
|
|
|
|
|
- </div>
|
|
|
|
|
- <div class="filter-point">
|
|
|
|
|
- <el-space>
|
|
|
|
|
- <h3>难度</h3>
|
|
|
|
|
- <el-checkbox-group v-model="levelFilter">
|
|
|
|
|
- <el-checkbox-button label="简单">简单</el-checkbox-button>
|
|
|
|
|
- <el-checkbox-button label="中等">中等</el-checkbox-button>
|
|
|
|
|
- <el-checkbox-button label="困难">困难</el-checkbox-button>
|
|
|
|
|
- </el-checkbox-group>
|
|
|
|
|
- </el-space>
|
|
|
|
|
- </div>
|
|
|
|
|
- <div class="filter-point">
|
|
|
|
|
- <el-space>
|
|
|
|
|
- <h3>排序</h3>
|
|
|
|
|
- <el-radio-group v-model="sortFilter" @change="changeSort">
|
|
|
|
|
- <el-radio-button v-for="(item, index) in sortOption" :label="item.label">
|
|
|
|
|
- {{ item.title }}
|
|
|
|
|
- </el-radio-button>
|
|
|
|
|
- </el-radio-group>
|
|
|
|
|
- <el-button @click="changeSortDirection" size="small" type="success">{{ sortDirection ? "正序" : "倒序" }}
|
|
|
|
|
- </el-button>
|
|
|
|
|
- </el-space>
|
|
|
|
|
- </div>
|
|
|
|
|
- </el-space>
|
|
|
|
|
- </el-space>
|
|
|
|
|
- </div>
|
|
|
|
|
- <div class="ql-container">
|
|
|
|
|
- <question-list ref="qr-list"></question-list>
|
|
|
|
|
- </div>
|
|
|
|
|
- </div>
|
|
|
|
|
|
|
+<el-space direction="vertical">
|
|
|
|
|
+ <h1>Question Repository</h1>
|
|
|
|
|
+ <router-view :key="$route.path"/>
|
|
|
|
|
+</el-space>
|
|
|
</template>
|
|
</template>
|
|
|
|
|
|
|
|
<script>
|
|
<script>
|
|
|
-import QuestionList from "@/components/QuestionItem/ListItem";
|
|
|
|
|
-
|
|
|
|
|
export default {
|
|
export default {
|
|
|
- name: "QuestionRepository",
|
|
|
|
|
- components: {
|
|
|
|
|
- QuestionList,
|
|
|
|
|
- },
|
|
|
|
|
- data() {
|
|
|
|
|
- return {
|
|
|
|
|
- // 点击批量处理
|
|
|
|
|
- multipleMode: false,
|
|
|
|
|
-
|
|
|
|
|
- // 筛选条件
|
|
|
|
|
- typeFilter: [],
|
|
|
|
|
- knowledgeFilter: [],
|
|
|
|
|
- levelFilter: [],
|
|
|
|
|
- sortFilter: 'index',
|
|
|
|
|
- sortFilterBackup: 'index',
|
|
|
|
|
- sortOption: [
|
|
|
|
|
- {
|
|
|
|
|
- label: 'index',
|
|
|
|
|
- title: '序号',
|
|
|
|
|
- },
|
|
|
|
|
- {
|
|
|
|
|
- label: 'type',
|
|
|
|
|
- title: '题型',
|
|
|
|
|
- },
|
|
|
|
|
- {
|
|
|
|
|
- label: 'level',
|
|
|
|
|
- title: '难度',
|
|
|
|
|
- },
|
|
|
|
|
- ],
|
|
|
|
|
- sortDirection: true,
|
|
|
|
|
- }
|
|
|
|
|
- },
|
|
|
|
|
- methods: {
|
|
|
|
|
- // 点击批量处理
|
|
|
|
|
- clickMulSelect() {
|
|
|
|
|
- const _this = this
|
|
|
|
|
- _this.multipleMode = !_this.multipleMode
|
|
|
|
|
- },
|
|
|
|
|
-
|
|
|
|
|
- // 批量处理时点击删除
|
|
|
|
|
- clickMulDelete() {
|
|
|
|
|
- const _this = this
|
|
|
|
|
- },
|
|
|
|
|
-
|
|
|
|
|
- // 清空筛选条件
|
|
|
|
|
- clearFilter() {
|
|
|
|
|
- const _this = this
|
|
|
|
|
-
|
|
|
|
|
- _this.knowledgeFilter = [];
|
|
|
|
|
- _this.levelFilter = [];
|
|
|
|
|
- _this.typeFilter = [];
|
|
|
|
|
- },
|
|
|
|
|
-
|
|
|
|
|
- // 改变排序方式
|
|
|
|
|
- changeSort(param) {
|
|
|
|
|
- const _this = this
|
|
|
|
|
- _this.sortDirection = true
|
|
|
|
|
- },
|
|
|
|
|
-
|
|
|
|
|
- // 改变正序或倒序
|
|
|
|
|
- changeSortDirection() {
|
|
|
|
|
- const _this = this
|
|
|
|
|
- _this.sortDirection = !_this.sortDirection
|
|
|
|
|
- },
|
|
|
|
|
-
|
|
|
|
|
- // 获取排序上面的值
|
|
|
|
|
- getSortOptionTitle(label, title) {
|
|
|
|
|
- const _this = this
|
|
|
|
|
-
|
|
|
|
|
- let res = title
|
|
|
|
|
- if (_this.sortFilter.indexOf(label) !== -1) {
|
|
|
|
|
- res += _this.sortDirection ? "↑" : "↓"
|
|
|
|
|
- }
|
|
|
|
|
- console.log(res)
|
|
|
|
|
- return res;
|
|
|
|
|
- }
|
|
|
|
|
- },
|
|
|
|
|
|
|
+ name: "index"
|
|
|
}
|
|
}
|
|
|
</script>
|
|
</script>
|
|
|
|
|
|
|
|
<style scoped>
|
|
<style scoped>
|
|
|
-.filter-point {
|
|
|
|
|
- /*float: left;*/
|
|
|
|
|
- width: auto;
|
|
|
|
|
- height: auto;
|
|
|
|
|
- overflow: auto;
|
|
|
|
|
- /*margin-top: 20px;*/
|
|
|
|
|
- position: relative;
|
|
|
|
|
-}
|
|
|
|
|
-
|
|
|
|
|
-.filter-point span {
|
|
|
|
|
- padding-right: 20px;
|
|
|
|
|
-}
|
|
|
|
|
|
|
|
|
|
-.filter-point .el-checkbox-group {
|
|
|
|
|
- display: unset
|
|
|
|
|
-}
|
|
|
|
|
-
|
|
|
|
|
-.ql-container{
|
|
|
|
|
- height: auto;
|
|
|
|
|
- width: auto;
|
|
|
|
|
- overflow: auto;
|
|
|
|
|
- border: 1px solid black;
|
|
|
|
|
-}
|
|
|
|
|
</style>
|
|
</style>
|