浏览代码

在线练习整合

shilipojs 2 年之前
父节点
当前提交
0b594380eb

+ 26 - 0
src/components/MxCondition/condition-object/condition-exe-grade.js

@@ -0,0 +1,26 @@
+import conditionObjectBase from '../condition-object-base.js'
+import {
+  smartGradeList,
+} from '@/api/webApi/webQue.js'
+
+export default {
+  ...conditionObjectBase,
+  dependentKeys: ['exeOrder'],
+  isDependencyReady(params) {
+    return params.exeOrder
+  },
+  key: 'exeGrade',
+  title: '学册',
+  getList: function(param,$ref) {
+    return new Promise((resolve, reject) => {
+      smartGradeList({subjectId:$ref.model.exeSubject,editionId:param.exeOrder}).then(res => resolve(res.data))
+        .catch(e => reject(e))
+    })
+  },
+  getCode: function(item) {
+    return item.gradeid
+  },
+  getLabel: function(item) {
+    return item.gradename
+  }
+}

+ 26 - 0
src/components/MxCondition/condition-object/condition-exe-order.js

@@ -0,0 +1,26 @@
+import conditionObjectBase from '../condition-object-base.js'
+import {
+  newEditionList,
+} from '@/api/webApi/webQue.js'
+
+export default {
+  ...conditionObjectBase,
+  dependentKeys: ['exeSubject'],
+  isDependencyReady(params) {
+    return params.exeSubject
+  },
+  key: 'exeOrder',
+  title: '版本',
+  getList: function(param,) {
+    return new Promise((resolve, reject) => {
+      newEditionList({subjectId:param.exeSubject}).then(res => resolve(res.data))
+        .catch(e => reject(e))
+    })
+  },
+  getCode: function(item) {
+    return item.id
+  },
+  getLabel: function(item) {
+    return item.name
+  }
+}

+ 22 - 0
src/components/MxCondition/condition-object/condition-exe-subject.js

@@ -0,0 +1,22 @@
+import conditionObjectBase from '../condition-object-base.js'
+import {
+  smartSubjectList,
+} from '@/api/webApi/webQue.js'
+
+export default {
+  ...conditionObjectBase,
+  key: 'exeSubject',
+  title: '科目',
+  getList: function(param) {
+    return new Promise((resolve, reject) => {
+      smartSubjectList().then(res => resolve(res.rows))
+        .catch(e => reject(e))
+    })
+  },
+  getCode: function(item) {
+    return item.subjectid
+  },
+  getLabel: function(item) {
+    return item.subjectname
+  }
+}

+ 490 - 0
src/views/questioncenter/components/smart-online.vue

@@ -0,0 +1,490 @@
+<template>
+  <div>
+    <el-card class="mb10">
+      <mx-condition ref="condition" :query-params="queryParams" :require-fields="requireFields" @query="handleQuery"
+                    @invalid="handleInvalidQuery"
+      ></mx-condition>
+    </el-card>
+    <el-container>
+      <el-aside width="284px" style="padding-bottom: 104px">
+        <div class="aside_header">
+          <span>CONTACT</span>
+          <span>章节目录</span>
+        </div>
+        <div class="aside_content">
+          <el-tree
+            v-show="tabActive == 0"
+            :data="treeList"
+            :props="defaultProps"
+            node-key="$treeNodeId"
+            @node-click="clickChapterNode"
+            highlight-current
+            ref="treeChapter"
+            :expand-on-click-node="false"
+          ></el-tree>
+          <el-tree
+            v-show="tabActive == 1"
+            :data="knowTreeList"
+            :props="knowDefaultProps"
+            node-key="knowledgeId"
+            @node-click="clickKnowNode"
+            :expand-on-click-node="false"
+            highlight-current
+            ref="tree"
+          ></el-tree>
+        </div>
+      </el-aside>
+      <el-main style="padding: 0; background: #fff">
+        <div class="main_tit">
+          <div class="tit_left" v-show="tabActive == 0">{{ chapterTitle }}</div>
+          <div class="tit_left" v-show="tabActive == 1">{{ konwTitle }}</div>
+          <div class="tit_right">
+            <div>
+              <input type="checkbox"/>
+              <span>过滤已做题</span>
+            </div>
+            <div
+              class="btn"
+              style="cursor: pointer"
+              @click="httpDiagnosticRecords(1)"
+            >
+              诊断记录
+            </div>
+          </div>
+        </div>
+        <!-- 主题内容 -->
+        <div class="main_con" v-show="tabActive == 0">
+          <div class="con_item" v-for="item in chapterList" :key="item.id">
+            <img src="@/assets/images/img_bg_tongbulianxi.png" alt=""/>
+            <div class="con_info">
+              <div class="tit">
+                {{ item.chapterName }}
+              </div>
+              <div class="count">共{{ item.num }}题</div>
+              <div class="btn" @click="toChapterQue(item)">马上做题</div>
+            </div>
+          </div>
+        </div>
+        <!-- 主题内容 -->
+        <div class="main_con" v-show="tabActive == 1">
+          <div
+            class="con_item"
+            v-for="item in knowList"
+            :key="item.knowledgeId"
+          >
+            <img src="@/assets/images/img_bg_tongbulianxi.png" alt=""/>
+            <div class="con_info">
+              <p class="tit">{{ item.knowledgeName }}</p>
+              <p class="count">共{{ item.num }}题</p>
+              <p class="btn" @click="toKnowQue(item)">马上做题</p>
+            </div>
+          </div>
+        </div>
+      </el-main>
+    </el-container>
+    <!-- 诊断的弹窗 -->
+    <el-dialog
+      title="同步在线诊断记录"
+      :visible.sync="dialogVisible"
+      width="50%"
+    >
+      <div class="tables">
+        <el-table :data="tableData.rows" stripe style="width: 100%">
+          <el-table-column type="index" width="50" label="序号">
+          </el-table-column>
+          <el-table-column prop="coursename" label="科目"></el-table-column>
+          <el-table-column prop="day" label="日期"></el-table-column>
+          <el-table-column label="用时">
+            <template slot-scope="scope">
+              <span>{{ scope.row.seconds + '秒' }}</span>
+            </template>
+          </el-table-column>
+          <el-table-column label="正确率">
+            <template slot-scope="scope">
+              <span>{{ scope.row.rate + '%' }}</span>
+            </template>
+          </el-table-column>
+          <el-table-column label="操作">
+            <template slot-scope="scope">
+              <span
+                style="color: #47c6a2; cursor: pointer"
+                @click="toDetails(scope.row)"
+              >
+                <i class="el-icon-search" style="margin-right: 4px"></i
+                >操作</span
+              >
+            </template>
+          </el-table-column>
+        </el-table>
+        <div class="block">
+          <el-pagination
+            :page-sizes="[tablePageSize]"
+            layout="prev, pager, next"
+            :page-count="tableData.pageNum"
+            style="backgrond: #47c6a2"
+            @current-change="httpDiagnosticRecords"
+          >
+          </el-pagination>
+          <div class="count">
+            共{{ tableData.pageNum }}页 {{ tableData.total }}条
+          </div>
+        </div>
+      </div>
+    </el-dialog>
+  </div>
+</template>
+<script>
+import MxCondition from '@/components/MxCondition/mx-condition'
+
+let flag = 1
+import {
+  treeList,
+  smartSubjectList,
+  smartGradeList,
+  newEditionList,
+  getQuestionsNumByChapter,
+  getQuestionsNumByKnowledge,
+  knowledgeTree,
+  diagnosticRecords
+} from '@/api/webApi/webQue.js'
+
+export default {
+  components:{
+    MxCondition
+  },
+  props:{
+    requireFields:{
+      type:Array,
+      default:[]
+    },
+    queryParams:{
+      type:Object,
+      default:[]
+    },
+    tabActive:0,
+  },
+  data() {
+    return {
+      form: {
+        chapterId: 0,
+        knowledgeId: 0
+      },
+      tablePageSize: 5,
+      chapterTitle: '',
+      konwTitle: '',
+      dialogVisible: false,
+      tableData: [],
+      defaultProps: {
+        children: 'children',
+        label: 'name'
+      },
+      knowDefaultProps: {
+        children: 'children',
+        label: 'name'
+      },
+      treeList: [],
+      knowTreeList: [],
+      knowList: [],
+      chapterList: []
+    }
+  },
+  methods: {
+    handleInvalidQuery() {
+      // this.getTree()
+    },
+    handleQuery() {
+      if (this.tabActive == 0) {
+        this.getTree()
+      } else {
+        this.getTreeByKnowledge()
+      }
+    },
+    httpDiagnosticRecords(pageNum) {
+      diagnosticRecords({
+        pageNum: pageNum,
+        pageSize: this.tablePageSize,
+        type: 1
+      }).then((res) => {
+        this.dialogVisible = true
+        this.tableData = res
+        this.tableData['pageNum'] = Math.ceil(res.total / this.tablePageSize)
+        console.log(res)
+      })
+    },
+    // 获取章节树
+    getTree() {
+      treeList({
+        subjectId:this.queryParams.exeSubject,
+        editionId:this.queryParams.exeOrder,
+        gradeId:this.queryParams.exeGrade,
+        chapterId:this.form.chapterId
+      }).then((res) => {
+        console.log('gettree', res)
+        this.treeList = res.data
+        this.$nextTick(() => {
+          if (res.data.length > 0) {
+            this.chapterTitle = res.data[0].name
+            this.$refs.treeChapter.setCurrentKey(res.data[0].$treeNodeId)
+            this.form.chapterId = res.data[0].id
+          }
+          this.getQueByChapter()
+        })
+      })
+    },
+    // 获取知识点树
+    getTreeByKnowledge() {
+      knowledgeTree({ pharseId: 3, subjectId: this.queryParams.exeSubject }).then(
+        (res) => {
+          this.knowTreeList = res.data
+          this.$nextTick(() => {
+            this.konwTitle = res.data[0].name
+            this.form.knowledgeId = res.data[0].id
+            this.getQueByKnowledge()
+          })
+        }
+      )
+    },
+    toDetails(item) {
+      this.dialogVisible=false
+      this.$router.push({
+        path: '/question-center/smartExercise/answerDetailas',
+        query: {
+          batchno: item.batchno,
+          info: encodeURIComponent(JSON.stringify(item))
+        }
+      })
+    },
+    // 根据章节来获取题目
+    getQueByChapter() {
+      getQuestionsNumByChapter({
+        chapterId: this.form.chapterId,
+        subjectId:this.queryParams.exeSubject,
+        editionId:this.queryParams.exeOrder,
+        gradeId:this.queryParams.exeGrade,
+      }).then((res) => {
+        this.chapterList = res.data
+      })
+    },
+    // 根据知识点来获取题目
+    getQueByKnowledge() {
+      getQuestionsNumByKnowledge({
+        knowledgeId: this.form.knowledgeId,
+        subjectId: this.form.subjectId
+      }).then((res) => {
+        this.knowList = res.data
+        console.log(res)
+      })
+    },
+    clickChapterNode(item) {
+      console.log(item)
+      this.chapterTitle = item.name
+      this.form.chapterId = item.id
+      this.getQueByChapter()
+    },
+    clickKnowNode(item) {
+      console.log(item)
+      this.form.knowledgeId = item.id
+      this.konwTitle = item.name
+      this.getQueByKnowledge()
+    },
+    // 做章节题目
+    toChapterQue(item) {
+      console.log(item)
+      this.$router.push({
+        path: '/question-center/smartExercise/practice',
+        query: {
+          chapterId: item.chapterId,
+          title: item.chapterName,
+          subjectId: this.form.subjectId
+        }
+      })
+    },
+    // 做知识点题目
+    toKnowQue(item) {
+      console.log(item)
+      this.$router.push({
+        path: '/question-center/smartExercise/practice',
+        query: {
+          knowledgeId: item.knowledgeId,
+          title: item.knowledgeName,
+          subjectId: this.form.subjectId
+        }
+      })
+    }
+  }
+}
+</script>
+<style scoped>
+
+
+.radio_contianer span {
+  font-size: 14px;
+  font-family: PingFangSC-Regular, PingFang SC;
+  font-weight: 400;
+  color: #232323;
+  line-height: 20px;
+  height: 20px;
+  margin-right: 16px;
+}
+
+.radio_contianer .el-radio-button {
+  margin-right: 8px;
+}
+
+.aside_header {
+  background: white;
+  display: flex;
+  flex-direction: column;
+  justify-content: flex-end;
+  padding: 24px 16px 0 16px;
+  margin-bottom: 16px;
+}
+
+.el-aside {
+  background: white;
+  padding: 0;
+  margin-bottom: 0;
+  margin-right: 16px;
+}
+
+.aside_header span {
+  margin-top: 5px;
+  width: 84px;
+  height: 22px;
+  font-size: 16px;
+  font-family: PingFangSC-Medium, PingFang SC;
+  font-weight: 500;
+  color: #343434;
+  line-height: 22px;
+}
+
+.aside_header span:first-child {
+  width: 173px;
+  height: 27px;
+  background: linear-gradient(180deg, #ffffff 0%, #47c6a2 100%);
+  opacity: 0.5;
+}
+
+.main_tit {
+  display: flex;
+  justify-content: space-between;
+  padding-top: 52px;
+  padding-bottom: 19px;
+  border-bottom: 1px solid #eee;
+  padding-left: 19px;
+  margin-bottom: 23px;
+}
+
+.main_tit .tit_right {
+  display: flex;
+  justify-content: space-between;
+  align-items: center;
+}
+
+.main_tit .tit_right .btn {
+  background: #47c6a2;
+  border-radius: 16px;
+  padding: 6px 19px;
+  font-size: 14px;
+  font-family: PingFangSC-Regular, PingFang SC;
+  font-weight: 400;
+  color: #ffffff;
+  margin-left: 32px;
+  margin-right: 57px;
+}
+
+.tit_right input {
+  background: #d8d8d8;
+  margin: 0;
+}
+
+.tit_right span {
+  margin-left: 8px;
+  font-size: 14px;
+  font-family: PingFangSC-Regular, PingFang SC;
+  font-weight: 400;
+  color: #47c6a2;
+}
+
+.main_con {
+  display: flex;
+  flex-wrap: wrap;
+  padding: 0 21px 0 16px;
+}
+
+.main_con .con_item {
+  position: absolute;
+  top: 0;
+  left: 0;
+  width: 100%;
+  flex: 0 0 33%;
+  padding-right: 15px;
+  position: relative;
+  margin-bottom: 20px;
+}
+
+.main_con .con_item img {
+  width: 100%;
+  height: 100%;
+}
+
+.main_con .con_item .con_info {
+  position: absolute;
+  top: 24px;
+  left: 24px;
+}
+
+.main_con .con_item .con_info p {
+  margin: 0;
+}
+
+.main_con .con_item .con_info .tit {
+  height: 22px;
+  font-size: 16px;
+  font-family: PingFangSC-Medium, PingFang SC;
+  font-weight: 500;
+  color: #343434;
+  line-height: 22px;
+}
+
+.main_con .con_item .con_info .count {
+  height: 16px;
+  font-size: 12px;
+  font-family: PingFangSC-Regular, PingFang SC;
+  font-weight: 400;
+  color: #717171;
+  line-height: 17px;
+  margin-top: 8px;
+}
+
+.main_con .con_item .con_info .btn {
+  cursor: pointer;
+  display: inline-block;
+  font-size: 12px;
+  font-family: PingFangSC-Regular, PingFang SC;
+  font-weight: 400;
+  color: #ffffff;
+  line-height: 17px;
+  padding: 4px 12px;
+  background: #47c6a2;
+  margin-top: 20px;
+  text-align: center;
+}
+
+.block {
+  text-align: center;
+  margin-top: 20px;
+  position: relative;
+  display: flex;
+  justify-content: center;
+}
+
+.block > .count {
+  top: 10px;
+  left: 0;
+  position: absolute;
+}
+
+</style>
+
+

+ 37 - 578
src/views/questioncenter/smart.vue

@@ -4,419 +4,61 @@
       <div class="smart_tabs">
         <div
           class="tab pointer"
-          :class="tabActive == 0 ? 'tab_active' : ''"
-          @click="switchTab(0)"
+          v-for="item in tabList"
+          :class="tabActive == item.code ? 'tab_active' : ''"
+          @click="switchTab(item.code)"
         >
-          同步在线练习
-        </div>
-        <div
-          class="tab pointer"
-          :class="tabActive == 1 ? 'tab_active' : ''"
-          @click="switchTab(1)"
-        >
-          知识点在线练习
-        </div>
-      </div>
-      <div class="radio_contianer">
-        <div style="margin-bottom: 16px">
-          <span>科目</span>
-          <el-radio-group
-            v-model="form.subjectId"
-            size="mini"
-            @change="toggleSub"
-          >
-            <el-radio-button
-              :label="item.subjectid"
-              v-for="item in subjectList"
-              :key="item.subjectid"
-            >{{ item.subjectname }}
-            </el-radio-button
-            >
-          </el-radio-group>
-        </div>
-        <div style="margin-bottom: 16px" v-show="tabActive == 0">
-          <span>版本</span>
-          <el-radio-group
-            v-model="form.editionId"
-            size="mini"
-            @change="toggleEdi"
-          >
-            <el-radio-button
-              :label="item.id"
-              v-for="(item,i) in editionList"
-              :key="i"
-            >{{ item.name }}
-            </el-radio-button
-            >
-          </el-radio-group>
-        </div>
-        <div style="margin-bottom: 16px" v-show="tabActive == 0">
-          <span>学册</span>
-          <el-radio-group
-            v-model="form.gradeId"
-            size="mini"
-            @change="toggleGrade"
-          >
-            <el-radio-button
-              :label="item.gradeid"
-              v-for="item in gradeList"
-              :key="item.gradeid"
-            >{{ item.gradename }}
-            </el-radio-button
-            >
-          </el-radio-group>
+          {{ item.label }}
         </div>
       </div>
     </el-card>
-    <el-container>
-      <el-aside width="284px" style="padding-bottom: 104px">
-        <div class="aside_header">
-          <span>CONTACT</span>
-          <span>章节目录</span>
-        </div>
-        <div class="aside_content">
-          <el-tree
-            v-show="tabActive == 0"
-            :data="treeList"
-            :props="defaultProps"
-            node-key="$treeNodeId"
-            @node-click="clickChapterNode"
-            highlight-current
-            ref="treeChapter"
-            :expand-on-click-node="false"
-          ></el-tree>
-          <el-tree
-            v-show="tabActive == 1"
-            :data="knowTreeList"
-            :props="knowDefaultProps"
-            node-key="knowledgeId"
-            @node-click="clickKnowNode"
-            :expand-on-click-node="false"
-            highlight-current
-            ref="tree"
-          ></el-tree>
-        </div>
-      </el-aside>
-      <el-main style="padding: 0; background: #fff">
-        <div class="main_tit">
-          <div class="tit_left" v-show="tabActive == 0">{{ chapterTitle }}</div>
-          <div class="tit_left" v-show="tabActive == 1">{{ konwTitle }}</div>
-          <div class="tit_right">
-            <div>
-              <input type="checkbox"/>
-              <span>过滤已做题</span>
-            </div>
-            <div
-              class="btn"
-              style="cursor: pointer"
-              @click="httpDiagnosticRecords(1)"
-            >
-              诊断记录
-            </div>
-          </div>
-        </div>
-        <!-- 主题内容 -->
-        <div class="main_con" v-show="tabActive == 0">
-          <div class="con_item" v-for="item in chapterList" :key="item.id">
-            <img src="@/assets/images/img_bg_tongbulianxi.png" alt=""/>
-            <div class="con_info">
-              <div class="tit">
-                {{ item.chapterName }}
-              </div>
-              <div class="count">共{{ item.num }}题</div>
-              <div class="btn" @click="toChapterQue(item)">马上做题</div>
-            </div>
-          </div>
-        </div>
-        <!-- 主题内容 -->
-        <div class="main_con" v-show="tabActive == 1">
-          <div
-            class="con_item"
-            v-for="item in knowList"
-            :key="item.knowledgeId"
-          >
-            <img src="@/assets/images/img_bg_tongbulianxi.png" alt=""/>
-            <div class="con_info">
-              <p class="tit">{{ item.knowledgeName }}</p>
-              <p class="count">共{{ item.num }}题</p>
-              <p class="btn" @click="toKnowQue(item)">马上做题</p>
-            </div>
-          </div>
-        </div>
-      </el-main>
-    </el-container>
-    <!-- 诊断的弹窗 -->
-    <el-dialog
-      title="同步在线诊断记录"
-      :visible.sync="dialogVisible"
-      width="50%"
-    >
-      <div class="tables">
-        <el-table :data="tableData.rows" stripe style="width: 100%">
-          <el-table-column type="index" width="50" label="序号">
-          </el-table-column>
-          <el-table-column prop="coursename" label="科目"></el-table-column>
-          <el-table-column prop="day" label="日期"></el-table-column>
-          <el-table-column label="用时">
-            <template slot-scope="scope">
-              <span>{{ scope.row.seconds + '秒' }}</span>
-            </template>
-          </el-table-column>
-          <el-table-column label="正确率">
-            <template slot-scope="scope">
-              <span>{{ scope.row.rate + '%' }}</span>
-            </template>
-          </el-table-column>
-          <el-table-column label="操作">
-            <template slot-scope="scope">
-              <span
-                style="color: #47c6a2; cursor: pointer"
-                @click="toDetails(scope.row)"
-              >
-                <i class="el-icon-search" style="margin-right: 4px"></i
-                >操作</span
-              >
-            </template>
-          </el-table-column>
-        </el-table>
-        <div class="block">
-          <el-pagination
-            :page-sizes="[tablePageSize]"
-            layout="prev, pager, next"
-            :page-count="tableData.pageNum"
-            style="backgrond: #47c6a2"
-            @current-change="httpDiagnosticRecords"
-          >
-          </el-pagination>
-          <div class="count">
-            共{{ tableData.pageNum }}页 {{ tableData.total }}条
-          </div>
-        </div>
-      </div>
-    </el-dialog>
+    <div>
+      <SmartOnline :requireFields="requireFields" :tabActive="tabActive" :queryParams="queryParams"></SmartOnline>
+    </div>
   </div>
 </template>
 <script>
-let flag = 1
-import {
-  treeList,
-  smartSubjectList,
-  smartGradeList,
-  newEditionList,
-  getQuestionsNumByChapter,
-  getQuestionsNumByKnowledge,
-  knowledgeTree,
-  diagnosticRecords
-} from '@/api/webApi/webQue.js'
-
+import SmartOnline from './components/smart-online'
 export default {
+  components:{
+    SmartOnline
+  },
   data() {
     return {
-      tabActive: 0,
-      form: {
-        subjectId: 0,
-        editionId: 0,
-        gradeId: 0,
-        chapterId: 0,
-        knowledgeId: 0
-      },
-      tablePageSize: 5,
-      chapterTitle: '',
-      konwTitle: '',
-      dialogVisible: false,
-      tableData: [],
-      // 章节树的prop
-      defaultProps: {
-        children: 'children',
-        label: 'name'
-      },
-      // 知识树的prop
-      knowDefaultProps: {
-        children: 'children',
-        label: 'name'
-      },
-      subjectList: [],
-      editionList: {},
-      gradeList: [],
-      treeList: [],
-      knowTreeList: [],
-      knowList: [],
-      chapterList: []
+      tabActive:0,
+      tabList:[
+        {
+          label:'同步在线练习',
+          code:0
+        },
+        {
+          label:'知识点在线练习',
+          code:1
+        }
+      ],
     }
   },
   created() {
     // 设置默认高亮
-    this.tabActive = this.$route.query.tabActive
-      ? this.$route.query.tabActive
-      : 0
-    this.getSubjects()
+    this.tabActive = this.$route.query.tabActive ? this.$route.query.tabActive : 0
   },
-  methods: {
-    // 获取所有课程
-    getSubjects() {
-      smartSubjectList().then((res) => {
-        console.log(res)
-        this.form.subjectId = res.rows[0].subjectid
-        this.subjectList = res.rows
-        this.getEidtion()
-      })
-    },
-    getEidtion() {
-      newEditionList({ subjectId: this.form.subjectId }).then((res) => {
-        this.form.editionId = res.data[0].id
-        this.editionList = res.data
-        this.getGrade()
-      })
-    },
-    httpDiagnosticRecords(pageNum) {
-      diagnosticRecords({
-        pageNum: pageNum,
-        pageSize: this.tablePageSize,
-        type: 1
-      }).then((res) => {
-        this.dialogVisible = true
-        this.tableData = res
-        this.tableData['pageNum'] = Math.ceil(res.total / this.tablePageSize)
-        console.log(res)
-      })
-    },
-    // 获取所有的学册
-    getGrade() {
-      smartGradeList({ ...this.form }).then((res) => {
-        console.log(res)
-        if (res.data.length > 0) {
-          this.form.gradeId = res.data[0].gradeid
-        }
-        this.gradeList = res.data
-        if (this.tabActive == 0) {
-          this.getTree()
-        } else {
-          this.getTreeByKnowledge()
-        }
-      })
-    },
-    // 获取章节树
-    getTree() {
-      treeList({ ...this.form }).then((res) => {
-        console.log('gettree', res)
-        this.treeList = res.data
-        this.$nextTick(() => {
-          if (res.data.length > 0) {
-            this.chapterTitle = res.data[0].name
-            this.$refs.treeChapter.setCurrentKey(res.data[0].$treeNodeId)
-            this.form.chapterId = res.data[0].id
-          }
-          this.getQueByChapter()
-        })
-      })
-    },
-    // 获取知识点树
-    getTreeByKnowledge() {
-      knowledgeTree({ pharseId: 3, subjectId: this.form.subjectId }).then(
-        (res) => {
-          this.knowTreeList = res.data
-          console.log(res)
-          this.$nextTick(() => {
-            this.konwTitle = res.data[0].name
-            this.form.knowledgeId = res.data[0].id
-            this.getQueByKnowledge()
-          })
-        }
-      )
-    },
-    toDetails(item) {
-      this.dialogVisible=false
-      this.$router.push({
-        path: '/question-center/smartExercise/answerDetailas',
-        query: {
-          batchno: item.batchno,
-          info: encodeURIComponent(JSON.stringify(item))
-        }
-      })
-    },
-    // 根据章节来获取题目
-    getQueByChapter() {
-      console.log('-------获取题目-------')
-      getQuestionsNumByChapter({
-        chapterId: this.form.chapterId,
-        subjectId: this.form.subjectId,
-        gradeId: this.form.gradeId,
-        editionId: this.form.editionId
-      }).then((res) => {
-        console.log(res)
-        this.chapterList = res.data
-      })
-    },
-    // 根据知识点来获取题目
-    getQueByKnowledge() {
-      getQuestionsNumByKnowledge({
-        knowledgeId: this.form.knowledgeId,
-        subjectId: this.form.subjectId
-      }).then((res) => {
-        this.knowList = res.data
-        console.log(res)
-      })
-    },
-    toggleSub(e) {
-      this.form.subjectId = e
-      this.getEidtion()
-      if (this.tabActive == 1) {
-        this.getTreeByKnowledge()
-      }
-    },
-    toggleEdi(e) {
-      this.form.editionId = e
-      this.getGrade()
-    },
-    toggleGrade(e) {
-      this.form.gradeId = e
-      this.getTree()
-    },
-    clickChapterNode(item) {
-      console.log(item)
-      this.chapterTitle = item.name
-      this.form.chapterId = item.id
-      this.getQueByChapter()
-    },
-    clickKnowNode(item) {
-      console.log(item)
-      this.form.knowledgeId = item.id
-      this.konwTitle = item.name
-      this.getQueByKnowledge()
-    },
-    switchTab(index) {
-      this.tabActive = index
-      if (index == 1) {
-        console.log(111111111111)
-        this.getTreeByKnowledge()
-      } else {
-        console.log(22222222)
-        this.getTree()
+  computed:{
+    queryParams(){
+      if(this.tabActive == 0) return {
+        exeSubject: '',
+        exeOrder: '',
+        exeGrade: ''
       }
+      if(this.tabActive == 1) return { exeSubject: '',}
     },
-    // 做章节题目
-    toChapterQue(item) {
-      console.log(item)
-      this.$router.push({
-        path: '/question-center/smartExercise/practice',
-        query: {
-          chapterId: item.chapterId,
-          title: item.chapterName,
-          subjectId: this.form.subjectId
-        }
-      })
+    requireFields(){
+      if(this.tabActive == 0) return ['exeSubject','exeOrder','exeGrade']
+      if(this.tabActive == 1) return ['exeSubject']
     },
-    // 做知识点题目
-    toKnowQue(item) {
-      console.log(item)
-      this.$router.push({
-        path: '/question-center/smartExercise/practice',
-        query: {
-          knowledgeId: item.knowledgeId,
-          title: item.knowledgeName,
-          subjectId: this.form.subjectId
-        }
-      })
+  },
+  methods:{
+    switchTab(code) {
+      this.tabActive = code
     }
   }
 }
@@ -445,189 +87,6 @@ export default {
   border-bottom: 4px solid #47c6a2;
 }
 
-.radio_contianer span {
-  font-size: 14px;
-  font-family: PingFangSC-Regular, PingFang SC;
-  font-weight: 400;
-  color: #232323;
-  line-height: 20px;
-  height: 20px;
-  margin-right: 16px;
-}
-
-.radio_contianer .el-radio-button {
-  margin-right: 8px;
-}
-
-.aside_header {
-  background: white;
-  display: flex;
-  flex-direction: column;
-  justify-content: flex-end;
-  padding: 24px 16px 0 16px;
-  margin-bottom: 16px;
-}
-
-.el-aside {
-  background: white;
-  padding: 0;
-  margin-bottom: 0;
-  margin-right: 16px;
-}
-
-.aside_header span {
-  margin-top: 5px;
-  width: 84px;
-  height: 22px;
-  font-size: 16px;
-  font-family: PingFangSC-Medium, PingFang SC;
-  font-weight: 500;
-  color: #343434;
-  line-height: 22px;
-}
-
-.aside_header span:first-child {
-  width: 173px;
-  height: 27px;
-  background: linear-gradient(180deg, #ffffff 0%, #47c6a2 100%);
-  opacity: 0.5;
-}
-
-.main_tit {
-  display: flex;
-  justify-content: space-between;
-  padding-top: 52px;
-  padding-bottom: 19px;
-  border-bottom: 1px solid #eee;
-  padding-left: 19px;
-  margin-bottom: 23px;
-}
-
-.main_tit .tit_right {
-  display: flex;
-  justify-content: space-between;
-  align-items: center;
-}
-
-.main_tit .tit_right .btn {
-  background: #47c6a2;
-  border-radius: 16px;
-  padding: 6px 19px;
-  font-size: 14px;
-  font-family: PingFangSC-Regular, PingFang SC;
-  font-weight: 400;
-  color: #ffffff;
-  margin-left: 32px;
-  margin-right: 57px;
-}
-
-.tit_right input {
-  background: #d8d8d8;
-  margin: 0;
-}
-
-.tit_right span {
-  margin-left: 8px;
-  font-size: 14px;
-  font-family: PingFangSC-Regular, PingFang SC;
-  font-weight: 400;
-  color: #47c6a2;
-}
-
-.main_con {
-  display: flex;
-  flex-wrap: wrap;
-  padding: 0 21px 0 16px;
-}
-
-.main_con .con_item {
-  position: absolute;
-  top: 0;
-  left: 0;
-  width: 100%;
-  flex: 0 0 33%;
-  padding-right: 15px;
-  position: relative;
-  margin-bottom: 20px;
-}
-
-.main_con .con_item img {
-  width: 100%;
-  height: 100%;
-}
-
-.main_con .con_item .con_info {
-  position: absolute;
-  top: 24px;
-  left: 24px;
-}
-
-.main_con .con_item .con_info p {
-  margin: 0;
-}
-
-.main_con .con_item .con_info .tit {
-  height: 22px;
-  font-size: 16px;
-  font-family: PingFangSC-Medium, PingFang SC;
-  font-weight: 500;
-  color: #343434;
-  line-height: 22px;
-}
-
-.main_con .con_item .con_info .count {
-  height: 16px;
-  font-size: 12px;
-  font-family: PingFangSC-Regular, PingFang SC;
-  font-weight: 400;
-  color: #717171;
-  line-height: 17px;
-  margin-top: 8px;
-}
-
-.main_con .con_item .con_info .btn {
-  cursor: pointer;
-  display: inline-block;
-  font-size: 12px;
-  font-family: PingFangSC-Regular, PingFang SC;
-  font-weight: 400;
-  color: #ffffff;
-  line-height: 17px;
-  padding: 4px 12px;
-  background: #47c6a2;
-  margin-top: 20px;
-  text-align: center;
-}
-
-.block {
-  text-align: center;
-  margin-top: 20px;
-  position: relative;
-  display: flex;
-  justify-content: center;
-}
-
-.block > .count {
-  top: 10px;
-  left: 0;
-  position: absolute;
-}
-
-.smart_container >>> .el-radio-button__inner {
-  border-left: 1px solid #dcdfe6;
-}
-
-.smart_container >>> .radio_contianer .el-radio-button .el-radio-button__inner {
-  border-radius: 16px;
-  margin-bottom: 5px;
-}
-
-.smart_container >>> .split_page .el-pager > li {
-  border-radius: 50%;
-}
-.smart_container >>> .radio_contianer .is-active .el-radio-button__inner{
-  border-left: none;
-}
 </style>