Parcourir la source

paper generating re-construction

hare8999@163.com il y a 2 ans
Parent
commit
b520f68231
30 fichiers modifiés avec 3442 ajouts et 1969 suppressions
  1. 1 1
      src/api/webApi/webQue.js
  2. 20 1
      src/common/mx-const.js
  3. 1 0
      src/components/MxCondition/condition-mixins-data.js
  4. 2 2
      src/components/MxCondition/condition-object/condition-chapter-tree.js
  5. 18 0
      src/components/MxCondition/condition-object/condition-exe-branch.js
  6. 1 0
      src/components/MxCondition/condition-object/condition-exe-grade.js
  7. 1 0
      src/components/MxCondition/condition-object/condition-exe-order.js
  8. 26 0
      src/components/MxCondition/condition-object/condition-exe-qType-chapter.js
  9. 9 0
      src/components/MxCondition/condition-object/condition-exe-qType-knowledge.js
  10. 1 0
      src/components/MxCondition/condition-object/condition-exe-subject.js
  11. 15 2
      src/components/MxCondition/mx-condition.vue
  12. 2 2
      src/views/accurateTeaching/custom/custom.vue
  13. 2 2
      src/views/accurateTeaching/library/addLibrary.vue
  14. 2 2
      src/views/accurateTeaching/library/index.vue
  15. 2 2
      src/views/cloudTank/index.vue
  16. 396 0
      src/views/questioncenter/components/generate-tabs/paper-by-hand.vue
  17. 213 0
      src/views/questioncenter/components/generate-tabs/paper-by-intelligent.vue
  18. 143 0
      src/views/questioncenter/components/generate-tabs/paper-record.vue
  19. 13 0
      src/views/questioncenter/components/generate-tabs/paper-work-history-detail.vue
  20. 13 0
      src/views/questioncenter/components/generate-tabs/paper-work-history.vue
  21. 12 0
      src/views/questioncenter/components/generate-tabs/paper-work-identifier-mixin.js
  22. 13 0
      src/views/questioncenter/components/generate-tabs/paper-work-past.vue
  23. 13 0
      src/views/questioncenter/components/generate-tabs/paper-work-publish.vue
  24. 13 0
      src/views/questioncenter/components/generate-tabs/paper-work-video.vue
  25. 21 0
      src/views/questioncenter/components/generate-tabs/plugins/left-tree-side.vue
  26. 2 2
      src/views/questioncenter/components/smart-online.vue
  27. 1359 0
      src/views/questioncenter/generating-bak.vue
  28. 508 1335
      src/views/questioncenter/generating.vue
  29. 5 3
      src/views/questioncenter/paper.vue
  30. 615 615
      src/views/system/role/index.vue

+ 1 - 1
src/api/webApi/webQue.js

@@ -69,7 +69,7 @@ export function newEditionList(query) {
 }
 
 // 获得章节树
-export function treeList(query) {
+export function chapterTree(query) {
   return request({
     url: '/front/v2/chapterTree/list',
     method: 'get',

+ 20 - 1
src/common/mx-const.js

@@ -94,7 +94,26 @@ export default {
     librarySource: {
       question: 1,
       video: 2,
-      courseware: 3
+      courseware: 3,
+      custom: 4,
+      task: 5, // 班级任务
+      microclass: 6 // 名学微课宝
+    },
+    generateScene: {
+      // 组卷场景区分
+      none: { value: 0, key: 'none' },
+      normal: { value: 1, key: 'normal' },
+      paperWork: { value: 2, key: 'paperWork' }
+    },
+    questionBranches: {
+      chapter: {
+        label: '按章节选题',
+        value: 'chapter'
+      },
+      knowledge: {
+        label: '按知识点选题',
+        value: 'knowledge'
+      }
     },
     electiveReportType: {
       student: 1,

+ 1 - 0
src/components/MxCondition/condition-mixins-data.js

@@ -369,6 +369,7 @@ export default {
       // 包装并保存
       const wrappedList = {
         key: condition.key,
+        alias: condition.alias || condition.key,
         value: this.model[condition.key],
         title: condition.title,
         list: displayList,

+ 2 - 2
src/components/MxCondition/condition-object/condition-chapter-tree.js

@@ -1,6 +1,6 @@
 import conditionObjectBase from '../condition-object-base.js'
 import {
-  treeList
+  chapterTree
 } from '@/api/webApi/webQue.js'
 
 export default {
@@ -15,7 +15,7 @@ export default {
   },
   getList: function(param) {
     return new Promise((resolve, reject) => {
-      treeList({
+      chapterTree({
         subjectId: param.subjectId,
         editionId: param.editionId,
         gradeId: param.seniorGradeId

+ 18 - 0
src/components/MxCondition/condition-object/condition-exe-branch.js

@@ -0,0 +1,18 @@
+import conditionObjectBase from '../condition-object-base.js'
+import consts from '@/common/mx-const'
+
+export default {
+  ...conditionObjectBase,
+  key: 'exeBranch',
+  title: '选题',
+  getList: function(param) {
+    const branches = Object.values(consts.enum.questionBranches)
+    return Promise.resolve(branches)
+  },
+  getCode: function(item) {
+    return item.value
+  },
+  getLabel: function(item) {
+    return item.label
+  }
+}

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

@@ -10,6 +10,7 @@ export default {
     return params.exeOrder
   },
   key: 'exeGrade',
+  alias: 'gradeId',
   title: '学册',
   neverCache: true,
   getList: function(param,$ref) {

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

@@ -10,6 +10,7 @@ export default {
     return params.exeSubject
   },
   key: 'exeOrder',
+  alias: 'editionId',
   title: '版本',
   getList: function(param,) {
     return new Promise((resolve, reject) => {

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

@@ -0,0 +1,26 @@
+import conditionObjectBase from '../condition-object-base.js'
+import { qtBySubject } from '@/api/webApi/webQue'
+
+export default {
+  ...conditionObjectBase,
+  key: 'exeQTypeChapter',
+  alias: 'qtype',
+  title: '题型',
+  dependentKeys: ['exeGrade'],
+  getList: async function(param, vm) {
+    const query = {
+      subjectId: vm.model.exeSubject,
+      gradeId: vm.model.exeGrade,
+      editionId: vm.model.exeOrder,
+      ...vm.localData
+    }
+    const res = await qtBySubject(query)
+    return res.data
+  },
+  getCode: function(item) {
+    return item
+  },
+  getLabel: function(item) {
+    return item
+  }
+}

+ 9 - 0
src/components/MxCondition/condition-object/condition-exe-qType-knowledge.js

@@ -0,0 +1,9 @@
+import exeQTypeChapter from './condition-exe-qType-chapter'
+
+export default {
+  ...exeQTypeChapter,
+  key: 'exeQTypeKnowledge',
+  alias: 'qtype',
+  title: '题型',
+  dependentKeys: ['exeSubject']
+}

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

@@ -6,6 +6,7 @@ import {
 export default {
   ...conditionObjectBase,
   key: 'exeSubject',
+  alias: 'subjectId',
   title: '科目',
   getList: function(param) {
     return new Promise((resolve, reject) => {

+ 15 - 2
src/components/MxCondition/mx-condition.vue

@@ -35,6 +35,10 @@ export default {
     labelWidth: {
       type: String,
       default: '60px'
+    },
+    useAliasMapping: {
+      type: Boolean,
+      default: false
     }
   },
   mounted() {
@@ -54,16 +58,25 @@ export default {
       this.conditionChanged(key, value)
     },
     _triggerInitChangedEvent(model) {
-      this.$emit('query', model)
+      this.$emit('query', this.mappingAliasFields(model))
     },
     _triggerChangedEvent(model) {
-      this.$emit('query', model)
+      this.$emit('query', this.mappingAliasFields(model))
     },
     _triggerInvalidChangedEvent() {
       this.$emit('invalid')
     },
     _triggerInitInvalidChangedEvent() {
       this.$emit('invalid')
+    },
+    mappingAliasFields(model) {
+      if (!this.useAliasMapping) return model
+      const mapping = {}
+      Object.keys(model).forEach(key => {
+        const cond = this.conditionsOutput.find(c => c.key == key)
+        mapping[cond.alias] = model[key]
+      })
+      return mapping
     }
   }
 }

+ 2 - 2
src/views/accurateTeaching/custom/custom.vue

@@ -107,7 +107,7 @@
 
 <script>
 import { add, downToPersonResourse, getInfo, list, remove, update } from '@/api/webApi/school'
-import { knowledgeTree, treeList } from '@/api/webApi/webQue.js'
+import { knowledgeTree, chapterTree } from '@/api/webApi/webQue.js'
 import { mapGetters } from 'vuex'
 import ResourcePreviewButton from '@/views/accurateTeaching/components/resource-preview-button'
 import consts from '@/common/mx-const'
@@ -488,7 +488,7 @@ export default {
         this.deptOptions = []
         this.treeLoading = true
         this.queryParams.chapterId = ''
-        const resTree = await treeList(Ajax)
+        const resTree = await chapterTree(Ajax)
         this.deptOptions = resTree.data
         this.treeLoading = false
       } else {

+ 2 - 2
src/views/accurateTeaching/library/addLibrary.vue

@@ -47,7 +47,7 @@
 </template>
 
 <script>
-import { treeList } from '@/api/webApi/webQue.js'
+import { chapterTree } from '@/api/webApi/webQue.js'
 import { add } from '@/api/webApi/person.js'
 
 export default {
@@ -96,7 +96,7 @@ export default {
           gradeId: this.queryParams.slipid //学册
         }
         this.deptOptions = []
-        treeList(Ajax).then(response => {
+        chapterTree(Ajax).then(response => {
           this.treeDate = response.data
           this.treeLoading = false
         }).catch(response => {

+ 2 - 2
src/views/accurateTeaching/library/index.vue

@@ -166,7 +166,7 @@ import {
   upToSchoolResourse,
   upToSchoolStudent
 } from '@/api/webApi/person'
-import { knowledgeTree, treeList } from '@/api/webApi/webQue.js'
+import { knowledgeTree, chapterTree } from '@/api/webApi/webQue.js'
 import { mapGetters } from 'vuex'
 import ResourcePreviewButton from '@/views/accurateTeaching/components/resource-preview-button'
 import consts from '@/common/mx-const'
@@ -726,7 +726,7 @@ export default {
         if (!Ajax.gradeId) return
         this.treeLoading = true
         this.queryParams.chapterId = ''
-        const resTree = await treeList(Ajax)
+        const resTree = await chapterTree(Ajax)
         this.deptOptions = resTree.data
         this.treeLoading = false
       } else {

+ 2 - 2
src/views/cloudTank/index.vue

@@ -98,7 +98,7 @@ import {
   getCloudResources,
   modifyCloudResource
 } from '@/api/webApi/cloud'
-import { treeList } from '@/api/webApi/webQue.js'
+import { chapterTree } from '@/api/webApi/webQue.js'
 import { mapGetters } from 'vuex'
 import ResourcePreviewButton from '@/views/accurateTeaching/components/resource-preview-button'
 import consts from '@/common/mx-const'
@@ -482,7 +482,7 @@ export default {
       }
       this.treeLoading = true
       this.queryParams.chapterId = ''
-      const resTree = await treeList(Ajax)
+      const resTree = await chapterTree(Ajax)
       this.deptOptions = resTree.data
       this.treeLoading = false
     },

+ 396 - 0
src/views/questioncenter/components/generate-tabs/paper-by-hand.vue

@@ -0,0 +1,396 @@
+<template>
+  <div>
+    <el-card>
+      <mx-condition :local-data="extraData" :query-params="queryParams" :require-fields="requireFields"
+                    @query="handleQuery" use-alias-mapping></mx-condition>
+    </el-card>
+    <el-container>
+      <left-tree-side>
+        <span slot="title">{{ !isKnowledgeBranch ? '章节目录' : '知识点目录' }}</span>
+        <el-tree ref="branchTree" highlight-current :expand-on-click-node="false" :data="branchTree"
+                 :props="treeProps" node-key="id" @node-click="handleTreeNodeClick"></el-tree>
+      </left-tree-side>
+      <!-- 手动组卷 -->
+      <el-main style="background: #fff">
+        <!-- 头部 -->
+        <div class="main_header">
+          <div class="left">
+            <div class="main_tit">{{ title }}</div>
+            <!-- 暂不支持 -->
+            <div class="filter" style="display: flex; align-items: center" v-if="false">
+              <input type="checkbox"/><span>过滤已做题</span>
+            </div>
+          </div>
+          <div class="search_box">
+            <input v-model="searchTerm" placeholder="请输入内容"/>
+            <img src="@/assets/images/icon_search2.png" alt="" @click="resetQuestionQuery"/>
+          </div>
+        </div>
+        <!-- 主题内容 -->
+        <div class="main_con">
+          <!-- 题目 -->
+          <div class="paper_questions" :id="mathId">
+            <div class="que_item" v-for="(item, index) in queList" :key="item.id">
+              <div class="que_content">
+                <div class="que-content-title">
+                  <div class="index">{{ (pageSize * (pageNum - 1) + index + 1) }}.</div>
+                  <div v-html="item.title"></div>
+                </div>
+                <div class="que-option">
+                  <div v-if="item.optionA">
+                    <span>A</span>
+                    <span v-html="item.optionA"></span>
+                  </div>
+                  <div v-if="item.optionB">
+                    <span>B</span>
+                    <span v-html="item.optionB"></span>
+                  </div>
+                  <div v-if="item.optionC">
+                    <span>C</span>
+                    <span v-html="item.optionC"></span>
+                  </div>
+                  <div v-if="item.optionD">
+                    <span>D</span>
+                    <span v-html="item.optionD"></span>
+                  </div>
+                </div>
+              </div>
+              <div class="que_footer pd20 fx-row ai-center jc-between">
+                <div class="spans">
+                  <span class="id">ID: {{ item.id }}</span>
+                  <span>题型: {{ item.qtpye }}</span>
+                  <span>难度: 一般</span>
+                </div>
+                <div class="operation">
+                  <div class="shoucan">
+                    <div v-show="item.collect" @click="toCancelCollectQue(item)"
+                         style="display: flex; align-items: center">
+                      <img src="@/assets/images/icon_shoucang_s.png" alt="" style="margin-right: 8px"/>
+                      <span>已收藏</span>
+                    </div>
+                    <div v-show="!item.collect" @click="toCollectQue(item)" style="display: flex; align-items: center">
+                      <img src="@/assets/images/icon_shoucang_n.png" style="margin-right: 8px" alt=""/>
+                      <span>收藏</span>
+                    </div>
+                  </div>
+                  <div class="jiucuo" @click="$refs.correct.open(item.id)">
+                    <img src="@/assets/images/icon_jiucuo.png" alt=""/>
+                    <span>纠错</span>
+                  </div>
+                  <div class="detail" @click="viewDetail(item)">
+                    <img src="@/assets/images/icon_chakan.png" alt=""/>
+                    <span>查看详情>></span>
+                  </div>
+                  <div class="addQue">
+                    <el-button @click="addQueCard(item)" icon="el-icon-shopping-cart-2" type="success" plain
+                               :disabled="queCardForm.queList.some((q) => q.id == item.id)">加入选题
+                    </el-button>
+                  </div>
+                </div>
+              </div>
+              <div class="pd20" v-show="item.expand" v-html="item.answer2"></div>
+            </div>
+            <div v-if="queList.length == 0" class="empty-text">
+              暂时没有内容
+            </div>
+          </div>
+        </div>
+        <pagination v-if="total > 0" :total="total" :page.sync="pageNum" :limit.sync="pageSize"
+                    @pagination="queryQuestions"/>
+      </el-main>
+    </el-container>
+    <div v-if="enableBox" class="queBoxer">
+      <div class="left">
+        <div class="tit">
+          <i class="el-icon-shopping-cart-2" style="margin-bottom: 10px"></i>
+          <div style="width: 17px; margin-bottom: 10px">试题篮</div>
+          <span class="count" style="background: #ff4e00; padding: 2px 5px; margin-bottom: 15px">{{
+              queCardForm.queList.length
+            }}</span>
+        </div>
+        <div style="cursor: pointer" @click="show = !show">
+          <i :class="show ? 'el-icon-arrow-right' : 'el-icon-arrow-left'"></i>
+        </div>
+      </div>
+      <div class="main">
+        <el-collapse-transition>
+          <div v-show="show">
+            <div style="margin-bottom: 30px">
+              <div style="margin-bottom: 10px">
+                共({{ queCardForm.queList.length }})道题
+              </div>
+              <div v-for="(value, key) in groupedCardQueList" :key="key + value.length"
+                   style="margin-top: 3px; color: #666666">
+                <span>{{ key }}</span><span> {{ value.length }} </span>道
+              </div>
+            </div>
+            <div>
+              <p style="
+                  color: #ff4e00;
+                  text-align: right;
+                  border-bottom: 1px solid #dedede;
+                ">
+                <span @click="clearQueCard" style="cursor: pointer"> 清空</span>
+              </p>
+            </div>
+            <div class="btn" @click="createdPaper">生成试卷</div>
+          </div>
+        </el-collapse-transition>
+      </div>
+    </div>
+    <correct-question-dialog ref="correct"></correct-question-dialog>
+  </div>
+</template>
+
+<script>
+import consts from '@/common/mx-const'
+import MxCondition from '@/components/MxCondition/mx-condition'
+import {
+  addToQuestionCard,
+  chapterTree,
+  deleteQuestionCard,
+  getQuestionCardList,
+  knowledgeTree,
+  listByChapter,
+  listByKnowledge,
+  queCancelCollect,
+  queCollect
+} from '@/api/webApi/webQue'
+import CorrectQuestionDialog from '@/components/MxPaper/plus/correct-question-dialog'
+import LeftTreeSide from '@/views/questioncenter/components/generate-tabs/plugins/left-tree-side'
+import PaperWorkIdentifierMixin from './paper-work-identifier-mixin'
+
+export default {
+  mixins: [PaperWorkIdentifierMixin],
+  name: 'paper-by-hand',
+  components: { LeftTreeSide, CorrectQuestionDialog, MxCondition },
+  data() {
+    return {
+      queryParams: null,
+      queryOutput: null,
+      requireFields: [],
+      chapterTree: [],
+      knowledgeTree: [],
+      treeProps: {
+        label: 'name',
+        children: 'children'
+      },
+      treeCacheKey: '',
+      currentNode: null,
+      title: '',
+      searchTerm: '',
+      queList: [],
+      queCardForm: {
+        queList: []
+      },
+      total: 0,
+      pageNum: 1,
+      pageSize: 10,
+      mathId: 'question_by_hand',
+      show: false,
+      enableBox: true,
+      ignoreQType: false
+    }
+  },
+  computed: {
+    isKnowledgeBranch() {
+      return this.queryParams?.exeBranch == consts.enum.questionBranches.knowledge.value
+    },
+    branchTree() {
+      return this.isKnowledgeBranch ? this.knowledgeTree : this.chapterTree
+    },
+    groupedCardQueList() {
+      let groupedCard = {}
+      this.queCardForm.queList.forEach((que) => {
+        if (!groupedCard[que.qtpye]) groupedCard[que.qtpye] = []
+        let groupedQueByType = groupedCard[que.qtpye]
+        groupedQueByType.push(que)
+      })
+      return groupedCard
+    }
+  },
+  watch: {
+    'queryParams.exeBranch': async function(newVal, oldVal) {
+      if (newVal && oldVal) {
+        // ignored first mx-condition model assign
+        await this.$nextTick()
+        this.resetQueryParams(true)
+      }
+    }
+  },
+  mounted() {
+    this.resetQueryParams()
+    this.loadQuestionCard()
+  },
+  methods: {
+    loadQuestionCard() {
+      getQuestionCardList(this.extraData).then((res) => {
+        this.queCardForm.queList = res.data
+      })
+    },
+    resetQueryParams(force = false) {
+      if (!this.queryParams || force) {
+        const model = {}
+        model.exeBranch = this.queryParams?.exeBranch || consts.enum.questionBranches.chapter.value
+        switch (model.exeBranch) {
+          case consts.enum.questionBranches.chapter.value:
+            model.exeSubject = '' // 科目
+            model.exeOrder = '' // 版本
+            model.exeGrade = '' // 学册
+            if (!this.ignoreQType) model.exeQTypeChapter = '' // 题型
+            this.requireFields = ['exeBranch', 'exeSubject', 'exeOrder', 'exeGrade']
+            if (this.isPaperWork && !this.ignoreQType) this.requireFields.push('exeQTypeChapter')
+            break
+          case consts.enum.questionBranches.knowledge.value:
+            model.exeSubject = '' // 科目
+            if (!this.ignoreQType) model.exeQTypeKnowledge = '' // 题型
+            this.requireFields = ['exeBranch', 'exeSubject']
+            if (this.isPaperWork && !this.ignoreQType) this.requireFields.push('exeQTypeKnowledge')
+            break
+          default:
+            console.log('unexpected type for branch', model.exeBranch)
+            return
+        }
+        this.queryParams = model
+      }
+    },
+    async handleQuery(model) {
+      // temporary save & parameter check
+      this.queryOutput = model
+      delete this.queryOutput.exeBranch // 本页API调用并不需要这个参数
+      if (!this.isKnowledgeBranch && !this.queryOutput.gradeId) return // 这是exeBranch条件切换时的中间状态,不要触发后续查询
+
+      // refresh tree by need
+      // TODO: 这里最好是由mx-condition解析依赖关系,但现在mx-condition的渲染逻辑不太方便切入
+      const treeDependentKey = this.isKnowledgeBranch ? 'subjectId' : 'gradeId'
+      const newTreeCacheKey = `${model.exeBranch}_${treeDependentKey}_${model[treeDependentKey]}`
+      if (newTreeCacheKey != this.treeCacheKey) {
+        this.treeCacheKey = newTreeCacheKey
+        const treeFunc = this.isKnowledgeBranch ? knowledgeTree : chapterTree
+        const treeRes = await treeFunc(this.queryOutput)
+        this.branchTree.length = 0 // clear
+        this.branchTree.push(...treeRes.data)
+        // current & query question
+        if (!this.branchTree.length) return
+        const firstNode = this.branchTree[0]
+        this.setCurrentNodeAndTitle(firstNode)
+        await this.$nextTick()
+        this.$refs.branchTree.setCurrentNode(firstNode)
+      }
+
+      // query question
+      this.resetQuestionQuery()
+    },
+    setCurrentNodeAndTitle(nodeData) {
+      const branchKey = this.queryParams.exeBranch + 'Id'
+      const branchParam = {}
+      branchParam[branchKey] = nodeData.id
+      this.currentNode = branchParam
+      this.title = nodeData.name
+    },
+    handleTreeNodeClick(data) {
+      this.setCurrentNodeAndTitle(data)
+      this.resetQuestionQuery()
+    },
+    resetQuestionQuery() {
+      this.pageNum = 1
+      this.queryQuestions()
+    },
+    async queryQuestions() {
+      const commit = {
+        pageNum: this.pageNum,
+        pageSize: this.pageSize,
+        ...this.queryOutput,
+        ...this.currentNode,
+        searchTerm: this.searchTerm
+      }
+      const queryFunc = this.isKnowledgeBranch ? listByKnowledge : listByChapter
+      const res = await queryFunc(commit)
+      this.total = res.total
+      this.queList = res.rows.map(r => {
+        r.expand = false // add reactive field
+        return r
+      })
+
+      await this.$nextTick()
+      this.mxGlobal.MathQueue(this.mathId)
+    },
+    /* methods of question box */
+    addQueCard(item) {
+      if (this.queCardForm.queList.length == 0) {
+        // 为0直接添加
+        addToQuestionCard({
+          questionId: item.id
+        }).then(() => {
+          this.queCardForm.queList.push(item)
+        })
+      } else {
+        // 判断是否是同一个科目下的题目
+        if (item.subjectid == this.queCardForm.queList[0].subjectid) {
+          // 是,则添加
+          addToQuestionCard({
+            questionId: item.id
+          }).then((res) => {
+            this.queCardForm.queList.push(item)
+          })
+        } else {
+          // 不是,弹出警告
+          this.$message.error('科目不一致,请清空试题篮或选择同一科目')
+        }
+      }
+    },
+    clearQueCard() {
+      if (this.queCardForm.queList.length > 0) {
+        deleteQuestionCard().then((res) => {
+          console.log(res)
+          this.queCardForm.queList = []
+          this.msgSuccess('清空成功')
+        })
+      }
+    },
+    toCollectQue(item) {
+      queCollect({
+        questionId: item.id
+      }).then((res) => {
+        item.collect = !item.collect
+        this.msgSuccess('收藏成功')
+        console.log(res)
+      })
+    },
+    toCancelCollectQue(item) {
+      queCancelCollect({
+        questionId: item.id
+      }).then((res) => {
+        item.collect = !item.collect
+        this.msgSuccess('取消收藏成功')
+        console.log(res)
+      })
+    },
+    viewDetail(item) {
+      item.expand = !item.expand
+    },
+    createdPaper() {
+      if (this.queCardForm?.queList?.length > 0) {
+        localStorage.setItem(
+          'paperData',
+          JSON.stringify({
+            paperTitle: null,
+            subjectId: this.queryOutput.subjectId
+          })
+        )
+        localStorage.setItem(
+          'questionList',
+          JSON.stringify(this.queCardForm.queList)
+        )
+        this.$router.push({
+          path: '/question-center/generatingPaperCenter/paper',
+          query: this.extraData
+        })
+      }
+    }
+  }
+}
+</script>
+
+<style scoped>
+</style>

+ 213 - 0
src/views/questioncenter/components/generate-tabs/paper-by-intelligent.vue

@@ -0,0 +1,213 @@
+<template>
+  <div>
+    <el-card>
+      <mx-condition :local-data="extraData" :query-params="queryParams" :require-fields="requireFields"
+                    @query="handleQuery" use-alias-mapping></mx-condition>
+    </el-card>
+    <el-container>
+      <left-tree-side>
+        <span slot="title">{{ !isKnowledgeBranch ? '章节目录' : '知识点目录' }}</span>
+        <el-tree ref="branchTree" highlight-current :expand-on-click-node="false" :data="branchTree"
+                 :props="treeProps" node-key="id" @node-click="handleTreeNodeClick"></el-tree>
+      </left-tree-side>
+      <!-- 手动组卷 -->
+      <el-main style="background: #fff">
+        <div class="knowPoints">
+          <div class="tit">
+            <span>已选知识点({{ tags.length }})</span>
+            <div class="clear">
+              <img src="@/assets/images/icon_qingkong.png" alt=""/>
+              <span>清空</span>
+            </div>
+          </div>
+          <el-divider></el-divider>
+          <!--  tags -->
+          <div class="tags">
+            <el-tag v-for="tag in tags" :key="tag.id" closable style="margin-right: 24px; margin-bottom: 24px"
+                    @close="handleClose(tag)">
+              {{ tag.name }}
+            </el-tag>
+          </div>
+        </div>
+        <div class="que">
+          <div class="tit">
+            <span>题型/题量</span>
+            <div class="clear">
+              <img src="@/assets/images/icon_qingkong.png" alt=""/>
+              <span>清空</span>
+            </div>
+          </div>
+          <el-divider></el-divider>
+          <!-- 计数器 -->
+          <div class="computer">
+            <div class="computer_item" v-for="(item, index) in queCount" :key="index">
+              <div class="fx-column">
+                <div class="fx-row fx-sta-cen mb5">
+                  <span class="f14 f-333">{{ item.name }}</span>
+                  <span class="f12 f-999">(可选{{ item.num }}道)</span>
+                </div>
+                <el-input-number controls-position="right" v-model="item.count" :min="0" :max="item.num"></el-input-number>
+              </div>
+            </div>
+          </div>
+        </div>
+        <!-- 生成试卷 -->
+        <div style="
+            display: flex;
+            justify-content: center;
+            margin-top: 90px;
+            margin-bottom: 90px;
+          ">
+          <span class="generateExam" @click="createdPaper">生成试卷</span>
+        </div>
+      </el-main>
+    </el-container>
+    <correct-question-dialog ref="correct"></correct-question-dialog>
+  </div>
+</template>
+
+<script>
+
+import PaperByHand from '@/views/questioncenter/components/generate-tabs/paper-by-hand'
+import {
+  countByChapter,
+  countByKnowledge,
+  getQuestionsByQTypeAndNum,
+  knowByChapter,
+  listBottoms
+} from '@/api/webApi/webQue'
+
+export default {
+  extends: PaperByHand,
+  name: 'paper-by-intelligent',
+  data() {
+    return {
+      // override
+      mathId: 'question_by_intelligent',
+      enableBox: false,
+      ignoreQType: true,
+      // new
+      tags: [],
+      queCount: [],
+      knowledgeIds: [],
+      listBottoms: []
+    }
+  },
+  methods: {
+    loadQuestionCard() {
+      // override do-nothing
+    },
+    queryQuestions() {
+      // override core query
+      if (this.isKnowledgeBranch) {
+        this.getListBottoms()
+      } else {
+        this.getKnowByChapter()
+      }
+    },
+    getKnowByChapter() {
+      // 根据章节查找知识点
+      if (!this.currentNode.chapterId) return // 可能是切换的中间状态
+      knowByChapter({
+        ...this.queryOutput,
+        ...this.currentNode
+      }).then((res) => {
+        this.knowledgeIds = res.data.map(item => item.id)
+        this.tags = res.data
+        this.getCountByChapter()
+      })
+    },
+    getListBottoms() {
+      // 根据章节获取底层知识
+      if (!this.currentNode.knowledgeId) return // 可能是切换的中间状态
+      listBottoms({
+        ...this.queryOutput,
+        ...this.currentNode
+      }).then((res) => {
+        this.listBottoms = res.data.map(item => item.id)
+        this.tags = res.data
+        this.getCountByKnowledge()
+      })
+    },
+    getCountByChapter() {
+      // 根据章节获取题库类型和数量
+      countByChapter({
+        ...this.queryOutput,
+        ...this.currentNode,
+        knowledgeIds: this.knowledgeIds.toString()
+      }).then((res) => {
+        this.queCount = res.data
+      })
+    },
+    getCountByKnowledge() {
+      // 根据知识点获取题库类型和数量
+      countByKnowledge({
+        ...this.queryOutput,
+        ...this.currentNode,
+        knowledgeIds: this.listBottoms.toString()
+      }).then((res) => {
+        this.queCount = res.data
+      })
+    },
+    handleClose(tag) {
+      if (this.tags.length <= 1) {
+        this.msgError('至少查询1个')
+      }
+      this.tags.remove(tag)
+      if (this.isKnowledgeBranch) {
+        this.listBottoms.remove(tag.id)
+        this.getCountByKnowledge()
+      } else {
+        this.knowledgeIds.remove(tag.id)
+        this.getCountByChapter()
+      }
+    },
+    createdPaper() {
+      let queCount = this.queCount
+      let req = []
+      let allQue = 0
+      // TODO: hht 22.10.08 这里的参数构成逻辑还没有完全看明白,但目前没有报错,先保持原样
+      queCount.forEach((item) => {
+        if (item.count > 0) {
+          allQue = allQue + item.count
+          req.push({
+            subjectid: this.queryOutput.subjectId,
+            qtpye: item.name,
+            diff: 1,
+            number: item.count,
+            chapterid: this.currentNode.chapterId,
+            gradeid: this.queryOutput.gradeId,
+            editionid: this.queryOutput.editionId,
+            knowledgeIds: this.knowledgeIds
+          })
+        }
+      })
+      if (allQue > 100) {
+        this.msgError('选题上限是100题哦')
+        return
+      } else if (allQue == 0) {
+        this.msgError('你还未选择题目')
+        return
+      }
+      getQuestionsByQTypeAndNum(req).then((res) => {
+        localStorage.setItem(
+          'paperData',
+          JSON.stringify({
+            paperTitle: null,
+            subjectId: this.queryOutput.subjectId
+          })
+        )
+        localStorage.setItem('questionList', JSON.stringify(res.data))
+        this.$router.push({
+          path: '/question-center/generatingPaperCenter/paper',
+          query: this.extraData
+        })
+      })
+    }
+  }
+}
+</script>
+
+<style scoped>
+
+</style>

+ 143 - 0
src/views/questioncenter/components/generate-tabs/paper-record.vue

@@ -0,0 +1,143 @@
+<template>
+  <div>
+    <el-card>
+      <mx-condition :query-params="queryParams" @query="handleQuery" use-alias-mapping></mx-condition>
+    </el-card>
+    <el-container style="background: #fff; min-height: 500px; display: block">
+      <el-table :data="examRecord" style="width: 100%" v-loading="tableLoading">
+        <el-table-column type="index" label="序号" width="50px">
+        </el-table-column>
+        <el-table-column prop="subjectName" label="科目"></el-table-column>
+        <el-table-column prop="name" label="试卷标题">
+          <template slot-scope="scope">
+            <el-link @click="clickEditPaperName(scope.row)"><i class="el-icon-edit"></i>{{ scope.row.name }}</el-link>
+          </template>
+        </el-table-column>
+        <el-table-column prop="remark" label="试卷概要"></el-table-column>
+        <el-table-column prop="status" label="状态"></el-table-column>
+        <el-table-column prop="createdTime" label="组卷时间"></el-table-column>
+        <el-table-column label="操作">
+          <template slot-scope="scope">
+            <div>
+              <span style="color: #47c6a2; margin-right: 16px; cursor: pointer"
+                    @click="clickEditPaper(scope.row)">编辑</span>
+              <span style="color: #ff4e00; margin-right: 16px; cursor: pointer"
+                    @click="clickDownloadPaper(scope.row.paperId)">下载</span>
+              <i class="el-icon-delete table-delete-icon" @click="clickDeletePopup(scope.row.paperId)"></i>
+            </div>
+            <div v-hasPermi="['front:generatingPaperCenter:saveToPersonResources']"
+                 style="color: #608edf; margin-right: 16px; cursor: pointer"
+                 @click="clickSendToResource(scope.row.paperId)">
+              发送至个人资源库
+            </div>
+          </template>
+        </el-table-column>
+      </el-table>
+      <pagination v-if="examRecordTotal > 0" :total="examRecordTotal" :page.sync="pageNum" :limit.sync="pageSize"
+                  @pagination="getPaperRecords"/>
+    </el-container>
+    <el-dialog title="修改试卷标题" :visible.sync="dialogPaperNameVisible" width="400px">
+      <el-input v-model="dialogPaperName" placeholder="请输入试卷标题"></el-input>
+      <span slot="footer" class="dialog-footer">
+        <el-button type="primary" @click="savePaperName">确 定</el-button>
+      </span>
+    </el-dialog>
+  </div>
+</template>
+
+<script>
+import PaperWorkIdentifierMixin from './paper-work-identifier-mixin'
+import MxCondition from '@/components/MxCondition/mx-condition'
+import { deletePaper, download, listCustomerPaperQeustions, paperRecords } from '@/api/webApi/webQue'
+import consts from '@/common/mx-const'
+import { mapGetters } from 'vuex'
+
+export default {
+  mixins: [PaperWorkIdentifierMixin],
+  name: 'paper-record',
+  components: { MxCondition },
+  data() {
+    return {
+      queryParams: {
+        exeSubject: ''
+      },
+      queryOutput: null,
+      tableLoading: false,
+      pageNum: 1,
+      pageSize: 20,
+      examRecord: [],
+      examRecordTotal: 0,
+      //
+      dialogPaperNameVisible: false,
+      dialogPager: null,
+      dialogPaperName: ''
+    }
+  },
+  computed: {
+    ...mapGetters(['period'])
+  },
+  methods: {
+    handleQuery(model) {
+      this.queryOutput = model
+      this.pageNum = 1
+      this.getPaperRecords()
+    },
+    getPaperRecords() {
+      paperRecords({
+        pageNum: this.pageNum,
+        pageSize: this.pageSize,
+        ...this.queryOutput,
+        ...this.extraData
+      }).then((res) => {
+        this.examRecordTotal = res.total
+        this.examRecord = res.rows
+      })
+    },
+    clickEditPaperName(paper) {
+      this.dialogPager = paper
+      this.dialogPaperName = paper.name
+      this.dialogPaperNameVisible = true
+    },
+    clickEditPaper(paper) {
+      listCustomerPaperQeustions(paper.paperId).then((res) => {
+        localStorage.setItem(
+          'paperData',
+          JSON.stringify({
+            paperId: paper.paperId,
+            paperTitle: paper.name,
+            subjectId: paper.subjectid
+          })
+        )
+        localStorage.setItem('questionList', JSON.stringify(res.rows))
+        this.$router.push({
+          path: '/question-center/generatingPaperCenter/paper',
+          query: this.extraData
+        })
+      })
+    },
+    clickDownloadPaper(paperId) {
+      download(paperId, this.period)
+    },
+    async clickDeletePopup(paperId) {
+      await this.$confirm('是否删除该试卷?', '提示', {
+        confirmButtonText: '确定',
+        cancelButtonText: '取消',
+        type: 'warning'
+      })
+      await deletePaper({ paperId })
+      this.msgSuccess('删除成功!')
+      this.getPaperRecords()
+    },
+    clickSendToResource(paperId) {
+
+    },
+    savePaperName() {
+
+    }
+  }
+}
+</script>
+
+<style scoped>
+
+</style>

+ 13 - 0
src/views/questioncenter/components/generate-tabs/paper-work-history-detail.vue

@@ -0,0 +1,13 @@
+<template>
+
+</template>
+
+<script>
+export default {
+  name: 'paper-work-history-detail'
+}
+</script>
+
+<style scoped>
+
+</style>

+ 13 - 0
src/views/questioncenter/components/generate-tabs/paper-work-history.vue

@@ -0,0 +1,13 @@
+<template>
+
+</template>
+
+<script>
+export default {
+  name: 'paper-work-history'
+}
+</script>
+
+<style scoped>
+
+</style>

+ 12 - 0
src/views/questioncenter/components/generate-tabs/paper-work-identifier-mixin.js

@@ -0,0 +1,12 @@
+import consts from '@/common/mx-const'
+
+export default {
+  computed: {
+    isPaperWork() {
+      return this.$route.meta.category === consts.enum.generateScene.paperWork.key
+    },
+    extraData() {
+      return this.isPaperWork ? { type: consts.enum.generateScene.paperWork.value } : {}
+    }
+  }
+}

+ 13 - 0
src/views/questioncenter/components/generate-tabs/paper-work-past.vue

@@ -0,0 +1,13 @@
+<template>
+
+</template>
+
+<script>
+export default {
+  name: 'paper-work-past'
+}
+</script>
+
+<style scoped>
+
+</style>

+ 13 - 0
src/views/questioncenter/components/generate-tabs/paper-work-publish.vue

@@ -0,0 +1,13 @@
+<template>
+
+</template>
+
+<script>
+export default {
+  name: 'paper-work-publish'
+}
+</script>
+
+<style scoped>
+
+</style>

+ 13 - 0
src/views/questioncenter/components/generate-tabs/paper-work-video.vue

@@ -0,0 +1,13 @@
+<template>
+
+</template>
+
+<script>
+export default {
+  name: 'paper-work-video'
+}
+</script>
+
+<style scoped>
+
+</style>

+ 21 - 0
src/views/questioncenter/components/generate-tabs/plugins/left-tree-side.vue

@@ -0,0 +1,21 @@
+<template>
+  <el-aside width="284px" class="generating_aside">
+    <div class="aside_header">
+      <span>CONTACT</span>
+      <slot name="title"></slot>
+    </div>
+    <div class="aside_content">
+      <slot></slot>
+    </div>
+  </el-aside>
+</template>
+
+<script>
+export default {
+  name: 'left-tree-side'
+}
+</script>
+
+<style scoped>
+
+</style>

+ 2 - 2
src/views/questioncenter/components/smart-online.vue

@@ -149,7 +149,7 @@ import {
   getQuestionsNumByChapter,
   getQuestionsNumByKnowledge,
   knowledgeTree,
-  treeList
+  chapterTree
 } from '@/api/webApi/webQue.js'
 
 let flag = 1
@@ -220,7 +220,7 @@ export default {
     },
     // 获取章节树
     getTree() {
-      treeList({
+      chapterTree({
         subjectId: this.queryParams.exeSubject,
         editionId: this.queryParams.exeOrder,
         gradeId: this.queryParams.exeGrade,

+ 1359 - 0
src/views/questioncenter/generating-bak.vue

@@ -0,0 +1,1359 @@
+<template>
+  <div class="generating_container app-container">
+    <el-card>
+      <div class="header_top">
+        <div class="pointer" :class="tabActive == 0 ? 'active ' : ''" @click="switchTab(0)">
+          手动组卷
+        </div>
+        <div class="pointer"  :class="tabActive == 1 ? 'active' : ''" @click="switchTab(1)">
+          智能组卷
+        </div>
+        <div class="pointer"  :class="tabActive == 2 ? 'active' : ''" @click="switchTab(2)">
+          组卷记录
+        </div>
+      </div>
+      <div class="radio_contianer">
+        <div v-if="tabActive != 2">
+          <span>选题</span>
+          <el-radio-group v-model="selectQueId" size="mini" @change="toggleSelect">
+            <el-radio-button :label="index" v-for="(item, index) in selectQue" :key="index">{{ item }}</el-radio-button>
+          </el-radio-group>
+        </div>
+        <div v-show="tabActive == 2">
+          <span>科目</span>
+          <el-radio-group v-model="zujuanSubjectId" size="mini" @change="toggleZujuanSubject">
+            <el-radio-button :label="null"> 所有 </el-radio-button>
+            <el-radio-button :label="item.subjectid" v-for="(item, index) in subjectList" :key="index">
+              {{ item.subjectname }}
+            </el-radio-button>
+          </el-radio-group>
+        </div>
+        <div v-show="tabActive != 2">
+          <span>科目</span>
+          <el-radio-group v-model="form.subjectId" size="mini" @change="toggleSub">
+            <el-radio-button :label="item.subjectid" v-for="(item, index) in subjectList" :key="index">
+              {{ item.subjectname }}
+            </el-radio-button>
+          </el-radio-group>
+        </div>
+
+        <div v-show="selectQueId == 0 && tabActive != 2">
+          <span>版本</span>
+          <el-radio-group v-model="form.editionId" size="mini" @change="toggleEdi">>
+            <el-radio-button :label="key" v-for="(value, key) in editionList" :key="key">
+              {{ value }}
+            </el-radio-button>
+          </el-radio-group>
+        </div>
+        <div v-show="selectQueId == 0 && tabActive != 2">
+          <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>
+        </div>
+        <div v-show="tabActive == 0 && tabActive != 2">
+          <span>题型</span>
+          <el-radio-group v-model="form.queTypeName" size="mini" @change="toggleType">
+            <el-radio-button :label="item" v-for="(item, index) in queTypeList" :key="index">{{ item }}
+            </el-radio-button>
+          </el-radio-group>
+        </div>
+      </div>
+    </el-card>
+
+    <!-- 主体 -->
+    <el-container v-show="tabActive != 2">
+      <el-aside width="284px" style="
+          padding-bottom: 104px;
+          background: #fff;
+          margin-right: 24px;
+          height: 600px;
+          overflow: scroll;
+          overflow-x: hidden;
+        ">
+        <div class="aside_header">
+          <span>CONTACT</span>
+          <span>{{selectQueId == 0?'章节目录':'知识点目录'}}</span>
+        </div>
+        <div class="aside_content" v-show="selectQueId == 0">
+          <el-tree highlight-current :expand-on-click-node="false" :data="treeList" :props="defaultProps" node-key="$treeNodeId" @node-click="clickChapterNode" ref="chapterTree"></el-tree>
+        </div>
+        <div class="aside_content" v-show="selectQueId == 1">
+          <el-tree highlight-current :expand-on-click-node="false" :data="knowledgeTree" :props="knowledgeProps" node-key="$treeNodeId" @node-click="clickKonwNode" ref="knowTree"></el-tree>
+        </div>
+      </el-aside>
+      <!-- 手动组卷 -->
+      <el-main style="background: #fff" v-show="tabActive == 0">
+        <!-- 头部 -->
+        <div class="main_header">
+          <div class="left">
+            <div class="main_tit">{{ title }}</div>
+            <!-- 暂不支持 -->
+            <div class="filter" style="display: flex; align-items: center" v-if="false">
+              <input type="checkbox" /><span>过滤已做题</span>
+            </div>
+          </div>
+          <div class="search_box">
+            <input v-model="searchText" placeholder="请输入内容" />
+            <img src="@/assets/images/icon_search2.png" alt="" @click="toggleType(form.queTypeName)" />
+          </div>
+        </div>
+        <!-- 主题内容 -->
+        <div class="main_con">
+          <!-- 题目 -->
+          <div class="paper_questions" id="question_list">
+            <div class="que_item" v-for="(item, index) in queList" :key="item.id">
+              <div class="que_content">
+                <div class="que-content-title">
+                  <div class="index">{{ (pageSize*(pageNum-1)+index+1) }}.</div>
+                  <div v-html="item.title"></div>
+                </div>
+                <div class="que-option">
+                  <div v-if="item.optionA">
+                    <span>A</span>
+                    <span v-html="item.optionA"></span>
+                  </div>
+                  <div v-if="item.optionB">
+                    <span>B</span>
+                    <span v-html="item.optionB"></span>
+                  </div>
+                  <div v-if="item.optionC">
+                    <span>C</span>
+                    <span v-html="item.optionC"></span>
+                  </div>
+                  <div v-if="item.optionD">
+                    <span>D</span>
+                    <span v-html="item.optionD"></span>
+                  </div>
+                </div>
+              </div>
+              <div class="que_footer pd20 fx-row ai-center jc-between">
+                <div class="spans">
+                  <span class="id">ID: {{ item.id }}</span>
+                  <span>题型: {{ item.qtpye }}</span>
+                  <span>难度: 一般</span>
+                </div>
+                <div class="operation">
+                  <div class="shoucan">
+                    <div v-show="item.collect" @click="toCancelCollectQue(item)" style="display: flex; align-items: center">
+                      <img src="@/assets/images/icon_shoucang_s.png" alt="" style="margin-right: 8px" />
+                      <span>已收藏</span>
+                    </div>
+                    <div v-show="!item.collect" @click="toCollectQue(item)" style="display: flex; align-items: center">
+                      <img src="@/assets/images/icon_shoucang_n.png" style="margin-right: 8px" alt="" />
+                      <span>收藏</span>
+                    </div>
+                  </div>
+                  <div class="jiucuo" @click="$refs.correct.open(item.id)">
+                    <img src="@/assets/images/icon_jiucuo.png" alt="" />
+                    <span>纠错</span>
+                  </div>
+                  <div class="detail" @click="viewDetail(item)">
+                    <img src="@/assets/images/icon_chakan.png" alt="" />
+                    <span>查看详情>></span>
+                  </div>
+                  <div class="addQue">
+                    <el-button @click="addQueCard(item)" icon="el-icon-shopping-cart-2" type="success" plain :disabled="
+                        queCardForm.queList.some((q) => q.id == item.id)
+                      ">加入选题</el-button>
+                  </div>
+                </div>
+              </div>
+              <div class="pd20" v-show="item.expand" v-html="item.answer2"></div>
+            </div>
+            <div v-if="queList.length == 0" class="empty-text">
+              暂时没有内容
+            </div>
+          </div>
+        </div>
+        <pagination v-if="total > 0" :total="total" :page.sync="pageNum" :limit.sync="pageSize" @pagination="handleSizeChange" />
+      </el-main>
+      <!-- 智能组卷 -->
+      <el-main v-show="tabActive == 1" style="background: #fff">
+        <div class="knowPoints">
+          <div class="tit">
+            <span>已选知识点({{ tags.length }})</span>
+            <div class="clear">
+              <img src="@/assets/images/icon_qingkong.png" alt="" />
+              <span>清空</span>
+            </div>
+          </div>
+          <el-divider></el-divider>
+          <!--  tags -->
+          <div class="tags">
+            <el-tag v-for="tag in tags" :key="tag.id" closable style="margin-right: 24px; margin-bottom: 24px" @close="handleClose(tag)">
+              {{ tag.name }}
+            </el-tag>
+          </div>
+        </div>
+        <div class="que">
+          <div class="tit">
+            <span>题型/题量</span>
+            <div class="clear">
+              <img src="@/assets/images/icon_qingkong.png" alt="" />
+              <span>清空</span>
+            </div>
+          </div>
+          <el-divider></el-divider>
+          <!-- 计数器 -->
+          <div class="computer">
+            <div class="computer_item" v-for="(item, index) in queCount" :key="index">
+              <span class="tit">{{ item.name }}</span>
+              <el-input-number controls-position="right" @change="handleChange" v-model="item.count" :min="0" :max="item.num" style="margin: 0 8px"></el-input-number>
+              <span class="select">可选{{ item.num }}道</span>
+            </div>
+          </div>
+        </div>
+        <!-- 生成试卷 -->
+        <div style="
+            display: flex;
+            justify-content: center;
+            margin-top: 90px;
+            margin-bottom: 90px;
+          ">
+          <span class="generateExam" @click="getQuestionsByQTypeAndNum">生成试卷</span>
+        </div>
+      </el-main>
+    </el-container>
+    <!-- 组卷记录 -->
+    <el-container style="background: #fff; min-height: 500px; display: block" v-show="tabActive == 2">
+      <el-table :data="examRecord" style="width: 100%" v-loading="tableLoading">
+        <el-table-column type="index" label="序号" width="50px">
+        </el-table-column>
+        <el-table-column prop="subjectName" label="科目"> </el-table-column>
+        <el-table-column prop="name" label="试卷标题">
+          <template slot-scope="scope">
+            <el-link @click="clickEditPaperName(scope.row)"><i class="el-icon-edit"></i>{{ scope.row.name }}</el-link>
+          </template>
+        </el-table-column>
+        <el-table-column prop="remark" label="试卷概要"> </el-table-column>
+        <el-table-column prop="status" label="状态"> </el-table-column>
+        <el-table-column prop="createdTime" label="组卷时间"> </el-table-column>
+        <el-table-column label="操作">
+          <template slot-scope="scope">
+            <div>
+              <span style="color: #47c6a2; margin-right: 16px; cursor: pointer" @click="clickEditPaper(scope.row)">编辑</span>
+              <span style="color: #ff4e00; margin-right: 16px; cursor: pointer" @click="clickDownloadPaper(scope.row.paperId)">下载</span>
+              <i class="el-icon-delete table-delete-icon" @click="clickDeletePopup(scope.$index, examRecord)"></i>
+            </div>
+            <div v-hasPermi="['front:generatingPaperCenter:saveToPersonResources']" style="color: #608edf; margin-right: 16px; cursor: pointer" @click="clickSendToResource(scope.row.paperId)">
+              发送至个人资源库
+            </div>
+          </template>
+        </el-table-column>
+      </el-table>
+      <el-pagination :page-sizes="[100, 200, 300, 400]" :page-size="100" layout="prev,pager,next,jumper,total,sizes" :total="examRecordTotal">
+      </el-pagination>
+    </el-container>
+
+    <!-- 试题篮 -->
+    <div class="queBoxer" v-show="tabActive == 0">
+      <div class="left">
+        <div class="tit">
+          <i class="el-icon-shopping-cart-2" style="margin-bottom: 10px"></i>
+          <div style="width: 17px; margin-bottom: 10px">试题篮</div>
+          <span class="count" style="background: #ff4e00; padding: 2px 5px; margin-bottom: 15px">{{ queCardForm.queList.length }}</span>
+        </div>
+        <div style="cursor: pointer" @click="show = !show">
+          <i :class="show ? 'el-icon-arrow-right' : 'el-icon-arrow-left'"></i>
+        </div>
+      </div>
+      <div class="main">
+        <el-collapse-transition>
+          <div v-show="show">
+            <div style="margin-bottom: 30px">
+              <div style="margin-bottom: 10px">
+                共({{ queCardForm.queList.length }})道题
+              </div>
+              <div v-for="(value, key) in groupedCardQueList" :key="key + value.length" style="margin-top: 3px; color: #666666">
+                <span>{{ key }}</span><span> {{ value.length }} </span>道
+              </div>
+            </div>
+            <div>
+              <p style="
+                  color: #ff4e00;
+                  text-align: right;
+                  border-bottom: 1px solid #dedede;
+                ">
+                <span @click="clearQueCard" style="cursor: pointer"> 清空</span>
+              </p>
+            </div>
+            <div class="btn" @click="createdPaper">生成试卷</div>
+          </div>
+        </el-collapse-transition>
+      </div>
+    </div>
+    <!-- 弹出警告 -->
+    <el-dialog title="警告" :visible.sync="dialogVisible" width="30%">
+      <span>科目不一致,请清空试题篮或选择同一科目</span>
+      <span slot="footer" class="dialog-footer">
+        <el-button type="primary" @click="dialogVisible = false">确 定</el-button>
+      </span>
+    </el-dialog>
+    <el-dialog title="修改试卷标题" :visible.sync="dialogPaperNameVisible" width="400px">
+      <el-input v-model="dialogPaperName" placeholder="请输入试卷标题"></el-input>
+      <span slot="footer" class="dialog-footer">
+        <el-button type="primary" @click="savePaperName">确 定</el-button>
+      </span>
+    </el-dialog>
+    <correct-question ref="correct"></correct-question>
+  </div>
+</template>
+<script>
+import {
+  smartSubjectList,
+  smartGradeList,
+  editionList,
+  qtBySubject,
+  chapterTree,
+  listByChapter,
+  knowledgeTree,
+  listByKnowledge,
+  countByChapter,
+  queCollect,
+  queCancelCollect,
+  countByKnowledge,
+  paperRecords,
+  getQuestionCardList,
+  deleteQuestionCard,
+  addToQuestionCard,
+  listBottoms,
+  savePaperInfo,
+  knowByChapter,
+  deletePaper,
+  getQuestionsByQTypeAndNum,
+  getQuestionsByIds,
+  download,
+  listCustomerPaperQeustions,
+  saveToPersonResources,
+  updateNameById,
+} from "@/api/webApi/webQue.js";
+import { mapGetters } from "vuex"
+import correctQuestion from '../../components/MxPaper/plus/correct-question-dialog.vue';
+export default {
+  components: { correctQuestion },
+  data() {
+    return {
+      dialogVisible: false,
+      tableLoading: false,
+      examRecord: [],
+      tabActive: 0,
+      searchText: '',
+      form: {
+        subjectId: 0,
+        editionId: 0,
+        gradeId: 0,
+        queTypeName: "",
+        chapterId: 0,
+        knowledgeId: 0,
+        knowledgeIds: [],
+        listBottoms: [],
+      },
+      show: false,
+      // 知识点标签
+      tags: [],
+      // 题型/选题数据
+      queCount: [],
+      knowledgeProps: {
+        label: "name",
+        children: "children",
+      },
+      defaultProps: {
+        label: "name",
+        children: "children",
+      },
+      selectQueId: 0,
+      selectQue: ["按章节选题", "按知识点选题"],
+      subjectList: [],
+      gradeList: [],
+      editionList: [],
+      queTypeList: [],
+      allQueType: "所有",
+      treeList: [],
+      queList: [],
+      title: "",
+      knowledgeTree: [],
+      queCardForm: {
+        queList: [],
+      },
+      total: 0,
+      pageNum: 0,
+      pageSize: 10,
+      examRecordTotal: 0,
+      // 在选题栏里面的题目id集合
+      topicblueIds: [],
+      // 修改试卷标题
+      dialogPaperNameVisible: false,
+      dialogPager: {},
+      dialogPaperName: "",
+      zujuanSubjectId: null,
+    };
+  },
+  computed: {
+    formQueTypeName() {
+      return this.form.queTypeName == this.allQueType
+        ? ""
+        : this.form.queTypeName;
+    },
+    groupedCardQueList() {
+      let groupedCard = {};
+      this.queCardForm.queList.forEach((que) => {
+        if (!groupedCard[que.qtpye]) groupedCard[que.qtpye] = [];
+        let groupedQueByType = groupedCard[que.qtpye];
+        groupedQueByType.push(que);
+      });
+      return groupedCard;
+    },
+    ...mapGetters(["period"])
+  },
+  created() {
+    let query = this.$route.query;
+    if (query.hasOwnProperty("tabActive")) {
+      this.switchTab(query.tabActive);
+    }
+    this.getSubjectList();
+    getQuestionCardList().then((res) => {
+      this.queCardForm.queList = res.data;
+      this.topicblueIds = res.data.map((item) => {
+        return item.id;
+      });
+    });
+  },
+  methods: {
+    getQuestionsByQTypeAndNum() {
+      // 智能组卷的生成试卷
+      if (this.tabActive == 1) {
+        let queCount = this.queCount;
+        let req = [];
+        let allQue = 0;
+        queCount.forEach((item) => {
+          if (item.count > 0) {
+            allQue = allQue + item.count;
+            req.push({
+              subjectid: this.form.subjectId,
+              qtpye: item.name,
+              diff: 1,
+              number: item.count,
+              chapterid: this.form.chapterId,
+              gradeid: this.form.gradeId,
+              editionid: this.form.editionId,
+              knowledgeIds: this.form.knowledgeIds,
+            });
+          }
+        });
+        if (allQue > 100) {
+          this.msgError("选题上限是100题哦");
+          return;
+        } else if (allQue == 0) {
+          this.msgError("你还未选择题目");
+          return;
+        }
+        getQuestionsByQTypeAndNum(req).then((res) => {
+          console.log(res);
+          localStorage.setItem(
+            "paperData",
+            JSON.stringify({
+              paperTitle: null,
+              subjectId: this.form.subjectId,
+            })
+          );
+          localStorage.setItem("questionList", JSON.stringify(res.data));
+          this.$router.push({
+            path: "/question-center/generatingPaperCenter/paper",
+          });
+        });
+      } else if (this.tabActive == 0) {
+        localStorage.setItem(
+          "paperData",
+          JSON.stringify({
+            paperTitle: null,
+            subjectId: this.form.subjectId,
+          })
+        );
+        localStorage.setItem(
+          "questionList",
+          JSON.stringify(this.queCardForm.queList)
+        );
+        this.$router.push({
+          path: "/question-center/generatingPaperCenter/paper",
+        });
+      }
+    },
+    createdPaper() {
+      if (this.queCardForm.queList && this.queCardForm.queList.length > 0) {
+        localStorage.setItem(
+          "paperData",
+          JSON.stringify({
+            paperTitle: null,
+            subjectId: this.form.subjectId,
+          })
+        );
+        localStorage.setItem(
+          "questionList",
+          JSON.stringify(this.queCardForm.queList)
+        );
+        this.$router.push({
+          path: "/question-center/generatingPaperCenter/paper",
+        });
+      }
+    },
+    toSavePaperInfo() {
+      let req = [
+        {
+          subjectid: 1,
+          qtpye: "选择题",
+          diff: 1,
+          number: 1,
+          chapterid: 1,
+          knowledgeIds: [1, 2, 3],
+        },
+      ];
+      savePaperInfo(req).then((res) => {
+        console.log(res);
+      });
+    },
+    switchTab(index) {
+      this.tabActive = index;
+      if (this.tabActive == 2) {
+        this.getPaperRecords();
+      }
+    },
+    clearQueCard() {
+      if (this.queCardForm.queList.length > 0) {
+        deleteQuestionCard().then((res) => {
+          console.log(res);
+          this.queCardForm.queList = [];
+          this.msgSuccess("清空成功");
+        });
+      }
+    },
+    // 查询组卷记录
+    getPaperRecords() {
+      paperRecords({
+        subjectId: this.zujuanSubjectId,
+      }).then((res) => {
+        this.examRecordTotal = res.total;
+        this.examRecord = res.rows;
+      });
+    },
+    /**
+     * 删除试卷
+     */
+    httpDeletePaper(id) {
+      deletePaper({
+        paperId: id,
+      }).then((res) => {
+        this.getPaperRecords();
+        this.$message({
+          type: "success",
+          message: "删除成功!",
+        });
+      });
+    },
+    clickDeletePopup(index, data) {
+      let self = this;
+      if (data[index] && data[index]["paperId"]) {
+        this.$confirm("是否删除该试卷?", "提示", {
+          confirmButtonText: "确定",
+          cancelButtonText: "取消",
+          type: "warning",
+        }).then(() => {
+          self.httpDeletePaper(data[index]["paperId"]);
+        });
+      }
+    },
+    clickEditPaper(paper) {
+      listCustomerPaperQeustions(paper.paperId).then((res) => {
+        localStorage.setItem(
+          "paperData",
+          JSON.stringify({
+            paperId: paper.paperId,
+            paperTitle: paper.name,
+            subjectId: paper.subjectid,
+          })
+        );
+        localStorage.setItem("questionList", JSON.stringify(res.rows));
+        this.$router.push({
+          path: "/question-center/generatingPaperCenter/paper",
+        });
+      });
+    },
+    clickDownloadPaper(paperId) {
+      download(paperId, this.period);
+    },
+    clickSendToResource(paperId) {
+      this.tableLoading = true;
+      saveToPersonResources(paperId).then((res) => {
+        this.tableLoading = false;
+        this.msgSuccess("发送成功");
+      });
+    },
+    clickEditPaperName(paper) {
+      this.dialogPager = paper;
+      this.dialogPaperName = paper.name;
+      this.dialogPaperNameVisible = true;
+    },
+    savePaperName() {
+      const paperName = this.dialogPaperName?.trim();
+      if (!paperName) {
+        this.msgError("试卷标题不能为空");
+        return;
+      }
+
+      updateNameById(this.dialogPager.paperId, paperName).then((res) => {
+        this.dialogPager.name = paperName;
+        this.dialogPaperNameVisible = false;
+        this.msgSuccess("修改成功");
+      });
+    },
+    // 添加试题
+    addQueCard(item) {
+      if (this.queCardForm.queList.length == 0) {
+        console.log("直接添加");
+        // 为0直接添加
+        addToQuestionCard({
+          questionId: item.id,
+        }).then((res) => {
+          this.queCardForm.queList.push(item);
+          console.log(res);
+        });
+      } else {
+        console.log(this.queCardForm.queList[0]);
+        // 判断是否是同一个科目下的题目
+        if (item.subjectid == this.queCardForm.queList[0].subjectid) {
+          // 是,则添加
+          addToQuestionCard({
+            questionId: item.id,
+          }).then((res) => {
+            this.queCardForm.queList.push(item);
+            console.log("this.queCardForm.queList", this.queCardForm.queList);
+          });
+        } else {
+          // 不是,弹出警告
+          this.dialogVisible = true;
+        }
+      }
+    },
+    clickChapterNode(item) {
+      console.log(item);
+      this.form.chapterId = item.id;
+      if (this.tabActive == 0) {
+        this.title = item.name;
+        this.getQueBychapter();
+      } else if (this.tabActive == 1) {
+        this.getKnowByChapter();
+        /*     this.getCountByChapter(); */
+      }
+    },
+    clickKonwNode(item) {
+      console.log(item);
+      this.form.knowledgeId = item.id;
+      if (this.tabActive == 0) {
+        this.title = item.name;
+        this.getQueByKnowleged();
+      } else if (this.tabActive == 1) {
+        this.getListBottoms();
+      }
+    },
+    handleClose(tag) {
+      this.tags.splice(this.tags.indexOf(tag), 1);
+      console.log(tag);
+      if (this.selectQueId == 0) {
+        let index = this.form.knowledgeIds.findIndex((item) => item == tag.id);
+        this.form.knowledgeIds.splice(index, 1);
+        this.getCountByChapter();
+      } else if (this.selectQueId == 1) {
+        console.log(1111);
+        let index = this.form.listBottoms.findIndex((item) => item == tag.id);
+        this.form.listBottoms.splice(index, 1);
+        this.getCountByKnowledged();
+      }
+    },
+    handleChange(e) { },
+    // 课程
+    getSubjectList() {
+      smartSubjectList().then((res) => {
+        this.form.subjectId = res.rows[0].subjectid;
+        this.subjectList = res.rows;
+        this.getEidtion();
+      });
+    },
+    getQueType() {
+      qtBySubject({
+        subjectId: this.form.subjectId,
+        gradeId: this.form.gradeId,
+        editionId: this.form.editionId,
+      }).then((res) => {
+        const qTypes = [this.allQueType, ...res.data];
+        this.form.queTypeName = qTypes[0];
+        this.queTypeList = qTypes;
+        console.log(res);
+      });
+    },
+    // 获取所有版本
+    getEidtion() {
+      editionList({
+        subjectId: this.form.subjectId,
+      }).then((res) => {
+        this.form.editionId = Object.keys(res.data)[0];
+        this.editionList = res.data;
+        this.getGrade();
+      });
+    },
+    // 获取所有的学册
+    getGrade() {
+      smartGradeList({
+        subjectId: this.form.subjectId,
+        editionId: this.form.editionId,
+      }).then((res) => {
+        console.log(res);
+        if (res.data.length > 0) {
+          this.form.gradeId = res.data[0].gradeid;
+        }
+
+        this.gradeList = res.data;
+        this.getTree();
+        this.getQueType();
+      });
+    },
+    // 获取章节树
+    getTree() {
+      chapterTree({
+        ...this.form,
+      }).then((res) => {
+        console.log(res);
+        this.treeList = res.data;
+        this.clickChapterNode(this.treeList[0]);
+        this.$nextTick(() => {
+          if (!this.$refs.chapterTree) {
+            return;
+          }
+          this.$refs.chapterTree.$el.children[0].classList.add("is_current");
+          this.$refs.chapterTree.setCurrentKey(this.treeList[0].$treeNodeId);
+          let d = this.$refs.chapterTree.getCheckedNodes();
+        });
+      });
+    },
+    // 根据知识点获取题库列表
+    getQueByKnowleged() {
+      listByKnowledge({
+        pageNum: this.pageNum,
+        pageSize: this.pageSize,
+        qtpye: this.formQueTypeName,
+        knowledgeId: this.form.knowledgeId,
+        subjectId: this.form.subjectId,
+        searchTerm: this.searchText
+      }).then((res) => {
+        console.log(res);
+        this.total = res.total;
+        this.queList = res.rows.map(item => {
+          item.expand  = false
+          return item
+        });
+        this.$nextTick((_) => this.mxGlobal.MathQueue("question_list"));
+      });
+    },
+    handleSizeChange(data) {
+      this.pageNum = data.page || 1;
+      this.pageSize = data.limit || 10;
+      this.getQueBychapter();
+    },
+    // 根据章节获取题库列表
+    getQueBychapter() {
+      listByChapter({
+        pageNum: this.pageNum,
+        pageSize: this.pageSize,
+        qtpye: this.formQueTypeName,
+        chapterId: this.form.chapterId,
+        subjectId: this.form.subjectId,
+        searchTerm: this.searchText
+      }).then((res) => {
+        console.log(res);
+        this.total = res.total;
+        this.queList = res.rows.map(item => {
+          item.expand  = false
+          return item
+        });
+        this.$nextTick((_) => this.mxGlobal.MathQueue("question_list"));
+        console.log(this.queList);
+      });
+    },
+    // 根据章节获取题库类型和数量
+    getCountByChapter() {
+      countByChapter({
+        chapterId: this.form.chapterId,
+        subjectId: this.form.subjectId,
+        editionId: this.form.editionId,
+        gradeId: this.form.gradeId,
+        knowledgeIds: this.form.knowledgeIds.join(","),
+      }).then((res) => {
+        console.log(res);
+        this.queCount = res.data;
+      });
+    },
+    // 根据知识点获取题库类型和数量
+    getCountByKnowledged() {
+      console.log(this.form.listBottoms);
+      countByKnowledge({
+        knowledgeIds: this.form.listBottoms.join(","),
+        subjectId: this.form.subjectId,
+      }).then((res) => {
+        console.log(res);
+        this.queCount = res.data;
+      });
+    },
+    toggleZujuanSubject(e) {
+      this.zujuanSubjectId = e;
+      if (this.tabActive == 2) {
+        this.getPaperRecords();
+        return;
+      }
+    },
+    toggleSub(e) {
+      this.form.subjectId = e;
+
+      if (this.selectQueId == 1) {
+        this.getKnowledges();
+        return;
+      }
+      this.getEidtion();
+    },
+    toggleEdi(e) {
+      this.form.editionId = e;
+      this.getGrade();
+    },
+    toggleGrade(e) {
+      this.form.gradeId = e;
+      this.getTree();
+      this.getQueType();
+    },
+    viewDetail(item) {
+      item.expand = !item.expand
+    },
+    getKnowledges() {
+      knowledgeTree({
+        subjectId: this.form.subjectId,
+        pharseId: 3,
+      }).then((res) => {
+        this.knowledgeTree = res.data;
+        this.clickKonwNode(res.data[0]);
+      });
+    },
+    toggleSelect(e) {
+      this.selectQueId = e;
+      if (e == 1) {
+        this.getKnowledges();
+      }
+    },
+    toggleType(e) {
+      this.form.queTypeName = e;
+      this.pageNum = 1
+      if (this.selectQueId == 0) {
+        if (this.tabActive == 0) {
+          this.getQueBychapter();
+        } else {
+          this.getCountByChapter();
+        }
+      } else if (this.selectQueId == 1) {
+        if (this.tabActive == 0) {
+          this.getQueByKnowleged();
+        } else {
+          this.getCountByKnowledged();
+        }
+      }
+    },
+    // 获取底层知识
+    getListBottoms() {
+      listBottoms({
+        knowledgeId: this.form.knowledgeId,
+      }).then((res) => {
+        this.form.listBottoms = res.data.map((item) => {
+          return item.id;
+        });
+        this.tags = res.data;
+        this.getCountByKnowledged();
+      });
+    },
+    // 根据章节查找知识点
+    getKnowByChapter() {
+      knowByChapter({
+        chapterId: this.form.chapterId,
+        gradeId: this.form.gradeId,
+        subjectId: this.form.subjectId,
+      }).then((res) => {
+        let arr = [];
+        for (let item of res.data) {
+          arr.push(item.id);
+        }
+        this.form.knowledgeIds = arr;
+        this.tags = res.data;
+        this.getCountByChapter();
+      });
+    },
+    toCollectQue(item) {
+      queCollect({
+        questionId: item.id,
+      }).then((res) => {
+        item.collect = !item.collect;
+        this.msgSuccess("收藏成功");
+        console.log(res);
+      });
+    },
+    toCancelCollectQue(item) {
+      queCancelCollect({
+        questionId: item.id,
+      }).then((res) => {
+        item.collect = !item.collect;
+        this.msgSuccess("取消收藏成功");
+        console.log(res);
+      });
+    },
+  },
+};
+</script>
+<style scoped>
+
+.active {
+  color: #47c6a2;
+}
+
+.active::after {
+  content: "";
+  width: 100%;
+  height: 4px;
+  position: absolute;
+  background: #47c6a2;
+  left: 0;
+  transform: translateY(50%);
+  bottom: 0;
+}
+
+.header_top {
+  display: flex;
+  border-bottom: 1px solid #b7b7b7;
+  margin-bottom: 20px;
+}
+
+.header_top > div {
+  position: relative;
+  flex: 1;
+  text-align: center;
+  padding: 30px 0;
+}
+
+
+.radio_contianer .el-radio-button {
+  margin-right: 8px;
+}
+
+.radio_contianer > div {
+  margin-bottom: 16px;
+  display: flex;
+  justify-content: flex-start;
+  align-items: center;
+}
+
+.radio_contianer > div > span {
+  flex-shrink: 0;
+  font-size: 14px;
+  font-family: PingFangSC-Regular, PingFang SC;
+  font-weight: 400;
+  color: #232323;
+  line-height: 20px;
+  height: 20px;
+  width: 50px;
+}
+
+.el-card {
+  margin-bottom: 20px;
+}
+
+.el-aside {
+  margin-bottom: 0;
+  padding: 24px 0 0 16px;
+}
+
+.aside_header {
+  display: flex;
+  flex-direction: column;
+  justify-content: left;
+}
+
+.aside_header > span:first-child {
+  width: 173px;
+  height: 27px;
+  background: -webkit-gradient(
+    linear,
+    left top,
+    left bottom,
+    from(#ffffff),
+    to(#47c6a2)
+  );
+  background: linear-gradient(180deg, #ffffff 0%, #47c6a2 100%);
+  opacity: 0.5;
+}
+
+.aside_header > span:last-child {
+  margin-bottom: 20px;
+}
+
+.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;
+}
+
+.el-main {
+  padding: 37px 28px 0 28px;
+}
+
+.main_header {
+  display: flex;
+  align-items: center;
+  justify-content: space-between;
+  margin-bottom: 20px;
+}
+
+.main_header .main_tit {
+  font-size: 16px;
+  font-weight: 500;
+  color: #47c6a2;
+  line-height: 22px;
+  margin-right: 64px;
+}
+
+.main_header .filter {
+  font-weight: 400;
+  color: #4c4c4c;
+  line-height: 20px;
+}
+
+.main_header .left {
+  display: flex;
+}
+
+.search_box {
+  display: flex;
+  flex-direction: row;
+  align-items: center;
+  justify-content: flex-end;
+  position: relative;
+  margin-right: 20px;
+}
+
+.search_box img {
+  position: absolute;
+  right: 20px;
+  cursor: pointer;
+  top: 6px;
+}
+
+.search_box input {
+  background: #f7f7ff;
+  border-radius: 20px;
+  border: 1px solid #c6cbf5;
+  outline: none;
+  width: 340px;
+  height: 32px;
+  padding-left: 24px;
+}
+
+.que_item {
+  border-radius: 1px;
+  border: 1px solid #dedede;
+  margin-bottom: 8px;
+}
+
+.que_content {
+  padding: 12px 24px 0 33px;
+  font-size: 14px;
+  font-family: PingFangSC-Medium, PingFang SC;
+  font-weight: 500;
+  color: #4c4c4c;
+  line-height: 27px;
+  margin-bottom: 40px;
+}
+
+.que-content-title {
+  font-size: 14px;
+  display: flex;
+}
+
+
+.que-option {
+  line-height: 40px;
+}
+
+.que-option span {
+  margin-right: 5px;
+}
+
+.que_footer {
+  border-top: 1px solid #dedede;
+  padding-left: 33px;
+  overflow: hidden;
+  padding-bottom: 23px;
+  padding-top: 21px;
+}
+
+.que_footer .spans {
+  float: left;
+  font-size: 12px;
+  font-family: PingFangSC-Regular, PingFang SC;
+  font-weight: 400;
+  color: #979797;
+  line-height: 20px;
+}
+
+.que_footer .spans > span {
+  margin-right: 20px;
+}
+
+.operation {
+  display: flex;
+  align-items: center;
+  font-size: 14px;
+  font-family: PingFangSC-Regular, PingFang SC;
+  font-weight: 400;
+  color: #47c6a2;
+  line-height: 20px;
+  float: right;
+}
+
+.operation > div {
+  display: flex;
+  align-items: center;
+  cursor: pointer;
+}
+
+.operation .shoucan {
+  margin-right: 46px;
+}
+
+.operation .jiucuo {
+  color: #ff4e00;
+  margin-right: 32px;
+}
+
+.operation .detail span {
+  border-radius: 1px;
+  border-bottom: 1px solid #47c6a2;
+}
+
+.operation .detail {
+  margin-right: 32px;
+}
+
+.operation > div > img {
+  margin-right: 10px;
+}
+
+.knowPoints .tags {
+  margin-top: 24px;
+  margin-bottom: 72px;
+}
+
+.knowPoints .tit {
+  margin-bottom: 16px;
+  overflow: hidden;
+  color: #47c6a2;
+}
+
+.knowPoints .clear {
+  float: right;
+  margin-right: 40px;
+}
+
+.knowPoints .clear img {
+  margin-right: 16px;
+}
+
+.que .tit {
+  margin-bottom: 16px;
+  overflow: hidden;
+  color: #47c6a2;
+}
+
+.que .clear {
+  float: right;
+  margin-right: 40px;
+}
+
+.que .clear img {
+  margin-right: 16px;
+}
+
+.el-divider {
+  margin: 0;
+  background: #47c6a2;
+}
+
+.computer {
+  margin-top: 24px;
+  display: flex;
+  justify-content: flex-start;
+  flex-wrap: wrap;
+}
+
+.computer .computer_item {
+  flex: 33% 0 0;
+  margin-bottom: 32px;
+}
+
+.computer .computer_item .tit {
+  height: 20px;
+  font-size: 14px;
+  font-family: PingFangSC-Regular, PingFang SC;
+  font-weight: 400;
+  color: #343434;
+  line-height: 20px;
+}
+
+.computer .computer_item .select {
+  width: 58px;
+  height: 17px;
+  font-size: 12px;
+  font-family: PingFangSC-Regular, PingFang SC;
+  font-weight: 400;
+  color: #969696;
+  line-height: 17px;
+}
+
+
+::-webkit-scrollbar {
+  width: 4px;
+}
+
+::-webkit-scrollbar-thumb {
+  -webkit-box-shadow: inset 0 0 1px rgba(136, 136, 136, 0.3);
+  background-color: rgb(238, 241, 245);
+}
+
+.queBoxer {
+  display: flex;
+  position: fixed;
+  right: 0;
+  top: 50%;
+  transform: translateY(-50%);
+}
+
+.queBoxer .main {
+  border-top: 2px solid #47c6a2;
+  padding: 10px 0;
+  border-bottom: 2px solid #47c6a2;
+  background: #fff;
+}
+
+.queBoxer > div > div {
+  padding: 0 10px;
+}
+
+.queBoxer .left {
+  padding: 10px;
+  background: #47c6a2;
+  color: white;
+  display: flex;
+  flex-direction: column;
+  justify-content: space-between;
+  align-items: center;
+}
+
+.queBoxer .main .btn {
+  background: #47c6a2;
+  color: white;
+  border-radius: 4px;
+  padding: 4px;
+  cursor: pointer;
+  margin: 5px 10px;
+  text-align: center;
+}
+
+.queBoxer .left .tit {
+  display: flex;
+  writing-mode: lr-tb;
+  align-items: center;
+  flex-direction: column;
+  justify-content: space-between;
+}
+
+.generateExam {
+  padding: 14px 29px;
+  background: #47c6a2;
+  border-radius: 4px;
+  cursor: pointer;
+  color: white;
+}
+
+/deep/.el-button--success.is-plain.is-disabled {
+  background-color: #ffffff;
+  border-color: #e6ebf5;
+  color: #c0c4cc;
+}
+/deep/ .el-tree-node__content {
+  padding-top: 6px;
+  padding-bottom: 6px;
+  height: 32px;
+  font-size: 14px;
+  font-family: PingFangSC-Medium, PingFang SC;
+  font-weight: 500;
+  color: #343434;
+  line-height: 20px;
+}
+
+.generating_container >>> .el-radio-button__inner {
+  border-left: 1px solid #dcdfe6;
+}
+
+.generating_container >>> .radio_contianer .el-radio-button .el-radio-button__inner {
+  border-radius: 16px;
+}
+
+.generating_container >>> .split_page .el-pager > li {
+  border-radius: 50%;
+}
+.generating_container >>> .el-tree-node {
+  padding-left: 16px;
+}
+.generating_container >>> .el-tree-node__expand-icon.expanded {
+  content: "";
+}
+
+.generating_container >>> .el-tree-node__content > .el-tree-node__expand-icon {
+  padding: 6px;
+  /* position: absolute; */
+  right: 16px;
+}
+.generating_container >>> .radio_contianer .is-active .el-radio-button__inner{
+  border-left: none;
+}
+.empty-text {
+  margin-top: 150px;
+  text-align: center;
+  color: #ccc;
+}
+
+.generating_container >>>.el-input-number.is-controls-right .el-input-number__decrease {
+  width: 16px;
+}
+
+.generating_container >>>.el-input-number.is-controls-right[class*="medium"] [class*="increase"],
+.generating_container >>>.el-input-number.is-controls-right[class*="medium"] [class*="decrease"] {
+  width: 16px;
+}
+
+.generating_container >>>.el-tree--highlight-current .el-tree-node.is-current > .el-tree-node__content {
+  color: #47c6a2;
+  background: #ffffff;
+}
+
+.generating_container >>>.table-delete-icon {
+  cursor: pointer;
+}
+</style>

+ 508 - 1335
src/views/questioncenter/generating.vue

@@ -2,1358 +2,531 @@
   <div class="generating_container app-container">
     <el-card>
       <div class="header_top">
-        <div class="pointer" :class="tabActive == 0 ? 'active ' : ''" @click="switchTab(0)">
-          手动组卷
-        </div>
-        <div class="pointer"  :class="tabActive == 1 ? 'active' : ''" @click="switchTab(1)">
-          智能组卷
-        </div>
-        <div class="pointer"  :class="tabActive == 2 ? 'active' : ''" @click="switchTab(2)">
-          组卷记录
-        </div>
-      </div>
-      <div class="radio_contianer">
-        <div v-if="tabActive != 2">
-          <span>选题</span>
-          <el-radio-group v-model="selectQueId" size="mini" @change="toggleSelect">
-            <el-radio-button :label="index" v-for="(item, index) in selectQue" :key="index">{{ item }}</el-radio-button>
-          </el-radio-group>
-        </div>
-        <div v-show="tabActive == 2">
-          <span>科目</span>
-          <el-radio-group v-model="zujuanSubjectId" size="mini" @change="toggleZujuanSubject">
-            <el-radio-button :label="null"> 所有 </el-radio-button>
-            <el-radio-button :label="item.subjectid" v-for="(item, index) in subjectList" :key="index">
-              {{ item.subjectname }}
-            </el-radio-button>
-          </el-radio-group>
-        </div>
-        <div v-show="tabActive != 2">
-          <span>科目</span>
-          <el-radio-group v-model="form.subjectId" size="mini" @change="toggleSub">
-            <el-radio-button :label="item.subjectid" v-for="(item, index) in subjectList" :key="index">
-              {{ item.subjectname }}
-            </el-radio-button>
-          </el-radio-group>
-        </div>
-
-        <div v-show="selectQueId == 0 && tabActive != 2">
-          <span>版本</span>
-          <el-radio-group v-model="form.editionId" size="mini" @change="toggleEdi">>
-            <el-radio-button :label="key" v-for="(value, key) in editionList" :key="key">
-              {{ value }}
-            </el-radio-button>
-          </el-radio-group>
-        </div>
-        <div v-show="selectQueId == 0 && tabActive != 2">
-          <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>
-        </div>
-        <div v-show="tabActive == 0 && tabActive != 2">
-          <span>题型</span>
-          <el-radio-group v-model="form.queTypeName" size="mini" @change="toggleType">
-            <el-radio-button :label="item" v-for="(item, index) in queTypeList" :key="index">{{ item }}
-            </el-radio-button>
-          </el-radio-group>
+        <div v-for="(tab,idx) in visibleTabs" :key="idx" class="pointer" :class="{'active-tab': idx== tabActive}"
+             @click="handleTabChange(idx)">
+          {{ tab.label }}
         </div>
       </div>
     </el-card>
-
-    <!-- 主体 -->
-    <el-container v-show="tabActive != 2">
-      <el-aside width="284px" style="
-          padding-bottom: 104px;
-          background: #fff;
-          margin-right: 24px;
-          height: 600px;
-          overflow: scroll;
-          overflow-x: hidden;
-        ">
-        <div class="aside_header">
-          <span>CONTACT</span>
-          <span>{{selectQueId == 0?'章节目录':'知识点目录'}}</span>
-        </div>
-        <div class="aside_content" v-show="selectQueId == 0">
-          <el-tree highlight-current :expand-on-click-node="false" :data="treeList" :props="defaultProps" node-key="$treeNodeId" @node-click="clickChapterNode" ref="chapterTree"></el-tree>
-        </div>
-        <div class="aside_content" v-show="selectQueId == 1">
-          <el-tree highlight-current :expand-on-click-node="false" :data="knowledgeTree" :props="knowledgeProps" node-key="$treeNodeId" @node-click="clickKonwNode" ref="knowTree"></el-tree>
-        </div>
-      </el-aside>
-      <!-- 手动组卷 -->
-      <el-main style="background: #fff" v-show="tabActive == 0">
-        <!-- 头部 -->
-        <div class="main_header">
-          <div class="left">
-            <div class="main_tit">{{ title }}</div>
-            <!-- 暂不支持 -->
-            <div class="filter" style="display: flex; align-items: center" v-if="false">
-              <input type="checkbox" /><span>过滤已做题</span>
-            </div>
-          </div>
-          <div class="search_box">
-            <input v-model="searchText" placeholder="请输入内容" />
-            <img src="@/assets/images/icon_search2.png" alt="" @click="toggleType(form.queTypeName)" />
-          </div>
-        </div>
-        <!-- 主题内容 -->
-        <div class="main_con">
-          <!-- 题目 -->
-          <div class="paper_questions" id="question_list">
-            <div class="que_item" v-for="(item, index) in queList" :key="item.id">
-              <div class="que_content">
-                <div class="que-content-title">
-                  <div class="index">{{ (pageSize*(pageNum-1)+index+1) }}.</div>
-                  <div v-html="item.title"></div>
-                </div>
-                <div class="que-option">
-                  <div v-if="item.optionA">
-                    <span>A</span>
-                    <span v-html="item.optionA"></span>
-                  </div>
-                  <div v-if="item.optionB">
-                    <span>B</span>
-                    <span v-html="item.optionB"></span>
-                  </div>
-                  <div v-if="item.optionC">
-                    <span>C</span>
-                    <span v-html="item.optionC"></span>
-                  </div>
-                  <div v-if="item.optionD">
-                    <span>D</span>
-                    <span v-html="item.optionD"></span>
-                  </div>
-                </div>
-              </div>
-              <div class="que_footer pd20 fx-row ai-center jc-between">
-                <div class="spans">
-                  <span class="id">ID: {{ item.id }}</span>
-                  <span>题型: {{ item.qtpye }}</span>
-                  <span>难度: 一般</span>
-                </div>
-                <div class="operation">
-                  <div class="shoucan">
-                    <div v-show="item.collect" @click="toCancelCollectQue(item)" style="display: flex; align-items: center">
-                      <img src="@/assets/images/icon_shoucang_s.png" alt="" style="margin-right: 8px" />
-                      <span>已收藏</span>
-                    </div>
-                    <div v-show="!item.collect" @click="toCollectQue(item)" style="display: flex; align-items: center">
-                      <img src="@/assets/images/icon_shoucang_n.png" style="margin-right: 8px" alt="" />
-                      <span>收藏</span>
-                    </div>
-                  </div>
-                  <div class="jiucuo" @click="$refs.correct.open(item.id)">
-                    <img src="@/assets/images/icon_jiucuo.png" alt="" />
-                    <span>纠错</span>
-                  </div>
-                  <div class="detail" @click="viewDetail(item)">
-                    <img src="@/assets/images/icon_chakan.png" alt="" />
-                    <span>查看详情>></span>
-                  </div>
-                  <div class="addQue">
-                    <el-button @click="addQueCard(item)" icon="el-icon-shopping-cart-2" type="success" plain :disabled="
-                        queCardForm.queList.some((q) => q.id == item.id)
-                      ">加入选题</el-button>
-                  </div>
-                </div>
-              </div>
-              <div class="pd20" v-show="item.expand" v-html="item.answer2"></div>
-            </div>
-            <div v-if="queList.length == 0" class="empty-text">
-              暂时没有内容
-            </div>
-          </div>
-        </div>
-        <pagination v-if="total > 0" :total="total" :page.sync="pageNum" :limit.sync="pageSize" @pagination="handleSizeChange" />
-      </el-main>
-      <!-- 智能组卷 -->
-      <el-main v-show="tabActive == 1" style="background: #fff">
-        <div class="knowPoints">
-          <div class="tit">
-            <span>已选知识点({{ tags.length }})</span>
-            <div class="clear">
-              <img src="@/assets/images/icon_qingkong.png" alt="" />
-              <span>清空</span>
-            </div>
-          </div>
-          <el-divider></el-divider>
-          <!--  tags -->
-          <div class="tags">
-            <el-tag v-for="tag in tags" :key="tag.id" closable style="margin-right: 24px; margin-bottom: 24px" @close="handleClose(tag)">
-              {{ tag.name }}
-            </el-tag>
-          </div>
-        </div>
-        <div class="que">
-          <div class="tit">
-            <span>题型/题量</span>
-            <div class="clear">
-              <img src="@/assets/images/icon_qingkong.png" alt="" />
-              <span>清空</span>
-            </div>
-          </div>
-          <el-divider></el-divider>
-          <!-- 计数器 -->
-          <div class="computer">
-            <div class="computer_item" v-for="(item, index) in queCount" :key="index">
-              <span class="tit">{{ item.name }}</span>
-              <el-input-number controls-position="right" @change="handleChange" v-model="item.count" :min="0" :max="item.num" style="margin: 0 8px"></el-input-number>
-              <span class="select">可选{{ item.num }}道</span>
-            </div>
-          </div>
-        </div>
-        <!-- 生成试卷 -->
-        <div style="
-            display: flex;
-            justify-content: center;
-            margin-top: 90px;
-            margin-bottom: 90px;
-          ">
-          <span class="generateExam" @click="getQuestionsByQTypeAndNum">生成试卷</span>
-        </div>
-      </el-main>
-    </el-container>
-    <!-- 组卷记录 -->
-    <el-container style="background: #fff; min-height: 500px; display: block" v-show="tabActive == 2">
-      <el-table :data="examRecord" style="width: 100%" v-loading="tableLoading">
-        <el-table-column type="index" label="序号" width="50px">
-        </el-table-column>
-        <el-table-column prop="subjectName" label="科目"> </el-table-column>
-        <el-table-column prop="name" label="试卷标题">
-          <template slot-scope="scope">
-            <el-link @click="clickEditPaperName(scope.row)"><i class="el-icon-edit"></i>{{ scope.row.name }}</el-link>
-          </template>
-        </el-table-column>
-        <el-table-column prop="remark" label="试卷概要"> </el-table-column>
-        <el-table-column prop="status" label="状态"> </el-table-column>
-        <el-table-column prop="createdTime" label="组卷时间"> </el-table-column>
-        <el-table-column label="操作">
-          <template slot-scope="scope">
-            <div>
-              <span style="color: #47c6a2; margin-right: 16px; cursor: pointer" @click="clickEditPaper(scope.row)">编辑</span>
-              <span style="color: #ff4e00; margin-right: 16px; cursor: pointer" @click="clickDownloadPaper(scope.row.paperId)">下载</span>
-              <i class="el-icon-delete table-delete-icon" @click="clickDeletePopup(scope.$index, examRecord)"></i>
-            </div>
-            <div v-hasPermi="['front:generatingPaperCenter:saveToPersonResources']" style="color: #608edf; margin-right: 16px; cursor: pointer" @click="clickSendToResource(scope.row.paperId)">
-              发送至个人资源库
-            </div>
-          </template>
-        </el-table-column>
-      </el-table>
-      <el-pagination :page-sizes="[100, 200, 300, 400]" :page-size="100" layout="prev,pager,next,jumper,total,sizes" :total="examRecordTotal">
-      </el-pagination>
-    </el-container>
-
-    <!-- 试题篮 -->
-    <div class="queBoxer" v-show="tabActive == 0">
-      <div class="left">
-        <div class="tit">
-          <i class="el-icon-shopping-cart-2" style="margin-bottom: 10px"></i>
-          <div style="width: 17px; margin-bottom: 10px">试题篮</div>
-          <span class="count" style="background: #ff4e00; padding: 2px 5px; margin-bottom: 15px">{{ queCardForm.queList.length }}</span>
-        </div>
-        <div style="cursor: pointer" @click="show = !show">
-          <i :class="show ? 'el-icon-arrow-right' : 'el-icon-arrow-left'"></i>
-        </div>
-      </div>
-      <div class="main">
-        <el-collapse-transition>
-          <div v-show="show">
-            <div style="margin-bottom: 30px">
-              <div style="margin-bottom: 10px">
-                共({{ queCardForm.queList.length }})道题
-              </div>
-              <div v-for="(value, key) in groupedCardQueList" :key="key + value.length" style="margin-top: 3px; color: #666666">
-                <span>{{ key }}</span><span> {{ value.length }} </span>道
-              </div>
-            </div>
-            <div>
-              <p style="
-                  color: #ff4e00;
-                  text-align: right;
-                  border-bottom: 1px solid #dedede;
-                ">
-                <span @click="clearQueCard" style="cursor: pointer"> 清空</span>
-              </p>
-            </div>
-            <div class="btn" @click="createdPaper">生成试卷</div>
-          </div>
-        </el-collapse-transition>
-      </div>
-    </div>
-    <!-- 弹出警告 -->
-    <el-dialog title="警告" :visible.sync="dialogVisible" width="30%">
-      <span>科目不一致,请清空试题篮或选择同一科目</span>
-      <span slot="footer" class="dialog-footer">
-        <el-button type="primary" @click="dialogVisible = false">确 定</el-button>
-      </span>
-    </el-dialog>
-    <el-dialog title="修改试卷标题" :visible.sync="dialogPaperNameVisible" width="400px">
-      <el-input v-model="dialogPaperName" placeholder="请输入试卷标题"></el-input>
-      <span slot="footer" class="dialog-footer">
-        <el-button type="primary" @click="savePaperName">确 定</el-button>
-      </span>
-    </el-dialog>
-    <correct-question ref="correct"></correct-question>
+    <!--  效果不好,每次tab切换时都会完全重新加载组件,没有缓存效果  -->
+    <!--<component v-if="currentTab" :is="currentTab.content"></component>-->
+    <!--  NOTE:类似延迟加载  -->
+    <paper-by-hand v-if="tabVisited.includes('paper-by-hand')"
+                   v-show="currentTab.content=='paper-by-hand'"></paper-by-hand>
+    <paper-by-intelligent v-if="tabVisited.includes('paper-by-intelligent')"
+                          v-show="currentTab.content=='paper-by-intelligent'"></paper-by-intelligent>
+    <paper-record v-if="tabVisited.includes('paper-record')"
+                  v-show="currentTab.content=='paper-record'"></paper-record>
   </div>
 </template>
 <script>
-import {
-  smartSubjectList,
-  smartGradeList,
-  editionList,
-  qtBySubject,
-  treeList,
-  listByChapter,
-  knowledgeTree,
-  listByKnowledge,
-  countByChapter,
-  queCollect,
-  queCancelCollect,
-  countByKnowledge,
-  paperRecords,
-  getQuestionCardList,
-  deleteQuestionCard,
-  addToQuestionCard,
-  listBottoms,
-  savePaperInfo,
-  knowByChapter,
-  deletePaper,
-  getQuestionsByQTypeAndNum,
-  getQuestionsByIds,
-  download,
-  listCustomerPaperQeustions,
-  saveToPersonResources,
-  updateNameById,
-} from "@/api/webApi/webQue.js";
-import { mapGetters } from "vuex"
-import correctQuestion from '../../components/MxPaper/plus/correct-question-dialog.vue';
+import PaperByHand from '@/views/questioncenter/components/generate-tabs/paper-by-hand'
+import PaperByIntelligent from '@/views/questioncenter/components/generate-tabs/paper-by-intelligent'
+import PaperRecord from '@/views/questioncenter/components/generate-tabs/paper-record'
+import PaperWorkIdentifierMixin from './components/generate-tabs/paper-work-identifier-mixin'
+
 export default {
-  components: { correctQuestion },
+  mixins: [PaperWorkIdentifierMixin],
+  components: { PaperRecord, PaperByIntelligent, PaperByHand },
   data() {
     return {
-      dialogVisible: false,
-      tableLoading: false,
-      examRecord: [],
+      tabs: [{
+        label: '手动组卷',
+        content: PaperByHand.name
+      }, {
+        label: '智能组卷',
+        content: PaperByIntelligent.name
+      }, {
+        label: '组卷记录',
+        content: PaperRecord.name
+      }],
       tabActive: 0,
-      searchText: '',
-      form: {
-        subjectId: 0,
-        editionId: 0,
-        gradeId: 0,
-        queTypeName: "",
-        chapterId: 0,
-        knowledgeId: 0,
-        knowledgeIds: [],
-        listBottoms: [],
-      },
-      show: false,
-      // 知识点标签
-      tags: [],
-      // 题型/选题数据
-      queCount: [],
-      knowledgeProps: {
-        label: "name",
-        children: "children",
-      },
-      defaultProps: {
-        label: "name",
-        children: "children",
-      },
-      selectQueId: 0,
-      selectQue: ["按章节选题", "按知识点选题"],
-      subjectList: [],
-      gradeList: [],
-      editionList: [],
-      queTypeList: [],
-      allQueType: "所有",
-      treeList: [],
-      queList: [],
-      title: "",
-      knowledgeTree: [],
-      queCardForm: {
-        queList: [],
-      },
-      total: 0,
-      pageNum: 0,
-      pageSize: 10,
-      examRecordTotal: 0,
-      // 在选题栏里面的题目id集合
-      topicblueIds: [],
-      // 修改试卷标题
-      dialogPaperNameVisible: false,
-      dialogPager: {},
-      dialogPaperName: "",
-      zujuanSubjectId: null,
-    };
+      tabVisited: []
+    }
   },
   computed: {
-    formQueTypeName() {
-      return this.form.queTypeName == this.allQueType
-        ? ""
-        : this.form.queTypeName;
-    },
-    groupedCardQueList() {
-      let groupedCard = {};
-      this.queCardForm.queList.forEach((que) => {
-        if (!groupedCard[que.qtpye]) groupedCard[que.qtpye] = [];
-        let groupedQueByType = groupedCard[que.qtpye];
-        groupedQueByType.push(que);
-      });
-      return groupedCard;
+    visibleTabs() {
+      return this.tabs
     },
-    ...mapGetters(["period"])
+    currentTab() {
+      return this.visibleTabs[this.tabActive]
+    }
   },
-  created() {
-    let query = this.$route.query;
-    if (query.hasOwnProperty("tabActive")) {
-      this.switchTab(query.tabActive);
+  watch: {
+    currentTab: function(newVal) {
+      const key = newVal.content
+      if (this.tabVisited.includes(key)) return
+      this.tabVisited.push(key)
     }
-    this.getSubjectList();
-    getQuestionCardList().then((res) => {
-      this.queCardForm.queList = res.data;
-      this.topicblueIds = res.data.map((item) => {
-        return item.id;
-      });
-    });
   },
-  methods: {
-    getQuestionsByQTypeAndNum() {
-      // 智能组卷的生成试卷
-      if (this.tabActive == 1) {
-        let queCount = this.queCount;
-        let req = [];
-        let allQue = 0;
-        queCount.forEach((item) => {
-          if (item.count > 0) {
-            allQue = allQue + item.count;
-            req.push({
-              subjectid: this.form.subjectId,
-              qtpye: item.name,
-              diff: 1,
-              number: item.count,
-              chapterid: this.form.chapterId,
-              gradeid: this.form.gradeId,
-              editionid: this.form.editionId,
-              knowledgeIds: this.form.knowledgeIds,
-            });
-          }
-        });
-        if (allQue > 100) {
-          this.msgError("选题上限是100题哦");
-          return;
-        } else if (allQue == 0) {
-          this.msgError("你还未选择题目");
-          return;
-        }
-        getQuestionsByQTypeAndNum(req).then((res) => {
-          console.log(res);
-          localStorage.setItem(
-            "paperData",
-            JSON.stringify({
-              paperTitle: null,
-              subjectId: this.form.subjectId,
-            })
-          );
-          localStorage.setItem("questionList", JSON.stringify(res.data));
-          this.$router.push({
-            path: "/question-center/generatingPaperCenter/paper",
-          });
-        });
-      } else if (this.tabActive == 0) {
-        localStorage.setItem(
-          "paperData",
-          JSON.stringify({
-            paperTitle: null,
-            subjectId: this.form.subjectId,
-          })
-        );
-        localStorage.setItem(
-          "questionList",
-          JSON.stringify(this.queCardForm.queList)
-        );
-        this.$router.push({
-          path: "/question-center/generatingPaperCenter/paper",
-        });
-      }
-    },
-    createdPaper() {
-      if (this.queCardForm.queList && this.queCardForm.queList.length > 0) {
-        localStorage.setItem(
-          "paperData",
-          JSON.stringify({
-            paperTitle: null,
-            subjectId: this.form.subjectId,
-          })
-        );
-        localStorage.setItem(
-          "questionList",
-          JSON.stringify(this.queCardForm.queList)
-        );
-        this.$router.push({
-          path: "/question-center/generatingPaperCenter/paper",
-        });
-      }
-    },
-    toSavePaperInfo() {
-      let req = [
-        {
-          subjectid: 1,
-          qtpye: "选择题",
-          diff: 1,
-          number: 1,
-          chapterid: 1,
-          knowledgeIds: [1, 2, 3],
-        },
-      ];
-      savePaperInfo(req).then((res) => {
-        console.log(res);
-      });
-    },
-    switchTab(index) {
-      this.tabActive = index;
-      if (this.tabActive == 2) {
-        this.getPaperRecords();
-      }
-    },
-    clearQueCard() {
-      if (this.queCardForm.queList.length > 0) {
-        deleteQuestionCard().then((res) => {
-          console.log(res);
-          this.queCardForm.queList = [];
-          this.msgSuccess("清空成功");
-        });
-      }
-    },
-    // 查询组卷记录
-    getPaperRecords() {
-      paperRecords({
-        subjectId: this.zujuanSubjectId,
-      }).then((res) => {
-        this.examRecordTotal = res.total;
-        this.examRecord = res.rows;
-      });
-    },
-    /**
-     * 删除试卷
-     */
-    httpDeletePaper(id) {
-      deletePaper({
-        paperId: id,
-      }).then((res) => {
-        this.getPaperRecords();
-        this.$message({
-          type: "success",
-          message: "删除成功!",
-        });
-      });
-    },
-    clickDeletePopup(index, data) {
-      let self = this;
-      if (data[index] && data[index]["paperId"]) {
-        this.$confirm("是否删除该试卷?", "提示", {
-          confirmButtonText: "确定",
-          cancelButtonText: "取消",
-          type: "warning",
-        }).then(() => {
-          self.httpDeletePaper(data[index]["paperId"]);
-        });
-      }
-    },
-    clickEditPaper(paper) {
-      listCustomerPaperQeustions(paper.paperId).then((res) => {
-        localStorage.setItem(
-          "paperData",
-          JSON.stringify({
-            paperId: paper.paperId,
-            paperTitle: paper.name,
-            subjectId: paper.subjectid,
-          })
-        );
-        localStorage.setItem("questionList", JSON.stringify(res.rows));
-        this.$router.push({
-          path: "/question-center/generatingPaperCenter/paper",
-        });
-      });
-    },
-    clickDownloadPaper(paperId) {
-      download(paperId, this.period);
-    },
-    clickSendToResource(paperId) {
-      this.tableLoading = true;
-      saveToPersonResources(paperId).then((res) => {
-        this.tableLoading = false;
-        this.msgSuccess("发送成功");
-      });
-    },
-    clickEditPaperName(paper) {
-      this.dialogPager = paper;
-      this.dialogPaperName = paper.name;
-      this.dialogPaperNameVisible = true;
-    },
-    savePaperName() {
-      const paperName = this.dialogPaperName?.trim();
-      if (!paperName) {
-        this.msgError("试卷标题不能为空");
-        return;
-      }
-
-      updateNameById(this.dialogPager.paperId, paperName).then((res) => {
-        this.dialogPager.name = paperName;
-        this.dialogPaperNameVisible = false;
-        this.msgSuccess("修改成功");
-      });
-    },
-    // 添加试题
-    addQueCard(item) {
-      if (this.queCardForm.queList.length == 0) {
-        console.log("直接添加");
-        // 为0直接添加
-        addToQuestionCard({
-          questionId: item.id,
-        }).then((res) => {
-          this.queCardForm.queList.push(item);
-          console.log(res);
-        });
-      } else {
-        console.log(this.queCardForm.queList[0]);
-        // 判断是否是同一个科目下的题目
-        if (item.subjectid == this.queCardForm.queList[0].subjectid) {
-          // 是,则添加
-          addToQuestionCard({
-            questionId: item.id,
-          }).then((res) => {
-            this.queCardForm.queList.push(item);
-            console.log("this.queCardForm.queList", this.queCardForm.queList);
-          });
-        } else {
-          // 不是,弹出警告
-          this.dialogVisible = true;
-        }
-      }
-    },
-    clickChapterNode(item) {
-      console.log(item);
-      this.form.chapterId = item.id;
-      if (this.tabActive == 0) {
-        this.title = item.name;
-        this.getQueBychapter();
-      } else if (this.tabActive == 1) {
-        this.getKnowByChapter();
-        /*     this.getCountByChapter(); */
-      }
-    },
-    clickKonwNode(item) {
-      console.log(item);
-      this.form.knowledgeId = item.id;
-      if (this.tabActive == 0) {
-        this.title = item.name;
-        this.getQueByKnowleged();
-      } else if (this.tabActive == 1) {
-        this.getListBottoms();
-      }
-    },
-    handleClose(tag) {
-      this.tags.splice(this.tags.indexOf(tag), 1);
-      console.log(tag);
-      if (this.selectQueId == 0) {
-        let index = this.form.knowledgeIds.findIndex((item) => item == tag.id);
-        this.form.knowledgeIds.splice(index, 1);
-        this.getCountByChapter();
-      } else if (this.selectQueId == 1) {
-        console.log(1111);
-        let index = this.form.listBottoms.findIndex((item) => item == tag.id);
-        this.form.listBottoms.splice(index, 1);
-        this.getCountByKnowledged();
-      }
-    },
-    handleChange(e) { },
-    // 课程
-    getSubjectList() {
-      smartSubjectList().then((res) => {
-        this.form.subjectId = res.rows[0].subjectid;
-        this.subjectList = res.rows;
-        this.getEidtion();
-      });
-    },
-    getQueType() {
-      qtBySubject({
-        subjectId: this.form.subjectId,
-        gradeId: this.form.gradeId,
-        editionId: this.form.editionId,
-      }).then((res) => {
-        const qTypes = [this.allQueType, ...res.data];
-        this.form.queTypeName = qTypes[0];
-        this.queTypeList = qTypes;
-        console.log(res);
-      });
-    },
-    // 获取所有版本
-    getEidtion() {
-      editionList({
-        subjectId: this.form.subjectId,
-      }).then((res) => {
-        this.form.editionId = Object.keys(res.data)[0];
-        this.editionList = res.data;
-        this.getGrade();
-      });
-    },
-    // 获取所有的学册
-    getGrade() {
-      smartGradeList({
-        subjectId: this.form.subjectId,
-        editionId: this.form.editionId,
-      }).then((res) => {
-        console.log(res);
-        if (res.data.length > 0) {
-          this.form.gradeId = res.data[0].gradeid;
-        }
-
-        this.gradeList = res.data;
-        this.getTree();
-        this.getQueType();
-      });
-    },
-    // 获取章节树
-    getTree() {
-      treeList({
-        ...this.form,
-      }).then((res) => {
-        console.log(res);
-        this.treeList = res.data;
-        this.clickChapterNode(this.treeList[0]);
-        this.$nextTick(() => {
-          if (!this.$refs.chapterTree) {
-            return;
-          }
-          this.$refs.chapterTree.$el.children[0].classList.add("is_current");
-          this.$refs.chapterTree.setCurrentKey(this.treeList[0].$treeNodeId);
-          let d = this.$refs.chapterTree.getCheckedNodes();
-        });
-      });
-    },
-    // 根据知识点获取题库列表
-    getQueByKnowleged() {
-      listByKnowledge({
-        pageNum: this.pageNum,
-        pageSize: this.pageSize,
-        qtpye: this.formQueTypeName,
-        knowledgeId: this.form.knowledgeId,
-        subjectId: this.form.subjectId,
-        searchTerm: this.searchText
-      }).then((res) => {
-        console.log(res);
-        this.total = res.total;
-        this.queList = res.rows.map(item => {
-          item.expand  = false
-          return item
-        });
-        this.$nextTick((_) => this.mxGlobal.MathQueue("question_list"));
-      });
-    },
-    handleSizeChange(data) {
-      this.pageNum = data.page || 1;
-      this.pageSize = data.limit || 10;
-      this.getQueBychapter();
-    },
-    // 根据章节获取题库列表
-    getQueBychapter() {
-      listByChapter({
-        pageNum: this.pageNum,
-        pageSize: this.pageSize,
-        qtpye: this.formQueTypeName,
-        chapterId: this.form.chapterId,
-        subjectId: this.form.subjectId,
-        searchTerm: this.searchText
-      }).then((res) => {
-        console.log(res);
-        this.total = res.total;
-        this.queList = res.rows.map(item => {
-          item.expand  = false
-          return item
-        });
-        this.$nextTick((_) => this.mxGlobal.MathQueue("question_list"));
-        console.log(this.queList);
-      });
-    },
-    // 根据章节获取题库类型和数量
-    getCountByChapter() {
-      countByChapter({
-        chapterId: this.form.chapterId,
-        subjectId: this.form.subjectId,
-        editionId: this.form.editionId,
-        gradeId: this.form.gradeId,
-        knowledgeIds: this.form.knowledgeIds.join(","),
-      }).then((res) => {
-        console.log(res);
-        this.queCount = res.data;
-      });
-    },
-    // 根据知识点获取题库类型和数量
-    getCountByKnowledged() {
-      console.log(this.form.listBottoms);
-      countByKnowledge({
-        knowledgeIds: this.form.listBottoms.join(","),
-        subjectId: this.form.subjectId,
-      }).then((res) => {
-        console.log(res);
-        this.queCount = res.data;
-      });
-    },
-    toggleZujuanSubject(e) {
-      this.zujuanSubjectId = e;
-      if (this.tabActive == 2) {
-        this.getPaperRecords();
-        return;
-      }
-    },
-    toggleSub(e) {
-      this.form.subjectId = e;
-
-      if (this.selectQueId == 1) {
-        this.getKnowledges();
-        return;
-      }
-      this.getEidtion();
-    },
-    toggleEdi(e) {
-      this.form.editionId = e;
-      this.getGrade();
-    },
-    toggleGrade(e) {
-      this.form.gradeId = e;
-      this.getTree();
-      this.getQueType();
-    },
-    viewDetail(item) {
-      item.expand = !item.expand
-    },
-    getKnowledges() {
-      knowledgeTree({
-        subjectId: this.form.subjectId,
-        pharseId: 3,
-      }).then((res) => {
-        this.knowledgeTree = res.data;
-        this.clickKonwNode(res.data[0]);
-      });
-    },
-    toggleSelect(e) {
-      this.selectQueId = e;
-      if (e == 1) {
-        this.getKnowledges();
-      }
-    },
-    toggleType(e) {
-      this.form.queTypeName = e;
-      this.pageNum = 1
-      if (this.selectQueId == 0) {
-        if (this.tabActive == 0) {
-          this.getQueBychapter();
-        } else {
-          this.getCountByChapter();
-        }
-      } else if (this.selectQueId == 1) {
-        if (this.tabActive == 0) {
-          this.getQueByKnowleged();
-        } else {
-          this.getCountByKnowledged();
-        }
-      }
-    },
-    // 获取底层知识
-    getListBottoms() {
-      listBottoms({
-        knowledgeId: this.form.knowledgeId,
-      }).then((res) => {
-        this.form.listBottoms = res.data.map((item) => {
-          return item.id;
-        });
-        this.tags = res.data;
-        this.getCountByKnowledged();
-      });
-    },
-    // 根据章节查找知识点
-    getKnowByChapter() {
-      knowByChapter({
-        chapterId: this.form.chapterId,
-        gradeId: this.form.gradeId,
-        subjectId: this.form.subjectId,
-      }).then((res) => {
-        let arr = [];
-        for (let item of res.data) {
-          arr.push(item.id);
-        }
-        this.form.knowledgeIds = arr;
-        this.tags = res.data;
-        this.getCountByChapter();
-      });
-    },
-    toCollectQue(item) {
-      queCollect({
-        questionId: item.id,
-      }).then((res) => {
-        item.collect = !item.collect;
-        this.msgSuccess("收藏成功");
-        console.log(res);
-      });
-    },
-    toCancelCollectQue(item) {
-      queCancelCollect({
-        questionId: item.id,
-      }).then((res) => {
-        item.collect = !item.collect;
-        this.msgSuccess("取消收藏成功");
-        console.log(res);
-      });
-    },
+  created() {
+    let query = this.$route.query
+    this.tabActive = query.tabActive * 1 || 0
+    this.tabVisited.push(this.currentTab.content)
   },
-};
-</script>
-<style scoped>
-
-.active {
-  color: #47c6a2;
-}
-
-.active::after {
-  content: "";
-  width: 100%;
-  height: 4px;
-  position: absolute;
-  background: #47c6a2;
-  left: 0;
-  transform: translateY(50%);
-  bottom: 0;
-}
-
-.header_top {
-  display: flex;
-  border-bottom: 1px solid #b7b7b7;
-  margin-bottom: 20px;
-}
-
-.header_top > div {
-  position: relative;
-  flex: 1;
-  text-align: center;
-  padding: 30px 0;
-}
-
-
-.radio_contianer .el-radio-button {
-  margin-right: 8px;
-}
-
-.radio_contianer > div {
-  margin-bottom: 16px;
-  display: flex;
-  justify-content: flex-start;
-  align-items: center;
-}
-
-.radio_contianer > div > span {
-  flex-shrink: 0;
-  font-size: 14px;
-  font-family: PingFangSC-Regular, PingFang SC;
-  font-weight: 400;
-  color: #232323;
-  line-height: 20px;
-  height: 20px;
-  width: 50px;
-}
-
-.el-card {
-  margin-bottom: 20px;
-}
-
-.el-aside {
-  margin-bottom: 0;
-  padding: 24px 0 0 16px;
-}
-
-.aside_header {
-  display: flex;
-  flex-direction: column;
-  justify-content: left;
-}
-
-.aside_header > span:first-child {
-  width: 173px;
-  height: 27px;
-  background: -webkit-gradient(
-    linear,
-    left top,
-    left bottom,
-    from(#ffffff),
-    to(#47c6a2)
-  );
-  background: linear-gradient(180deg, #ffffff 0%, #47c6a2 100%);
-  opacity: 0.5;
-}
-
-.aside_header > span:last-child {
-  margin-bottom: 20px;
-}
-
-.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;
-}
-
-.el-main {
-  padding: 37px 28px 0 28px;
-}
-
-.main_header {
-  display: flex;
-  align-items: center;
-  justify-content: space-between;
-  margin-bottom: 20px;
-}
-
-.main_header .main_tit {
-  font-size: 16px;
-  font-weight: 500;
-  color: #47c6a2;
-  line-height: 22px;
-  margin-right: 64px;
-}
-
-.main_header .filter {
-  font-weight: 400;
-  color: #4c4c4c;
-  line-height: 20px;
-}
-
-.main_header .left {
-  display: flex;
-}
-
-.search_box {
-  display: flex;
-  flex-direction: row;
-  align-items: center;
-  justify-content: flex-end;
-  position: relative;
-  margin-right: 20px;
-}
-
-.search_box img {
-  position: absolute;
-  right: 20px;
-  cursor: pointer;
-  top: 6px;
-}
-
-.search_box input {
-  background: #f7f7ff;
-  border-radius: 20px;
-  border: 1px solid #c6cbf5;
-  outline: none;
-  width: 340px;
-  height: 32px;
-  padding-left: 24px;
-}
-
-.que_item {
-  border-radius: 1px;
-  border: 1px solid #dedede;
-  margin-bottom: 8px;
-}
-
-.que_content {
-  padding: 12px 24px 0 33px;
-  font-size: 14px;
-  font-family: PingFangSC-Medium, PingFang SC;
-  font-weight: 500;
-  color: #4c4c4c;
-  line-height: 27px;
-  margin-bottom: 40px;
-}
-
-.que-content-title {
-  font-size: 14px;
-  display: flex;
-}
-
-
-.que-option {
-  line-height: 40px;
-}
-
-.que-option span {
-  margin-right: 5px;
-}
-
-.que_footer {
-  border-top: 1px solid #dedede;
-  padding-left: 33px;
-  overflow: hidden;
-  padding-bottom: 23px;
-  padding-top: 21px;
-}
-
-.que_footer .spans {
-  float: left;
-  font-size: 12px;
-  font-family: PingFangSC-Regular, PingFang SC;
-  font-weight: 400;
-  color: #979797;
-  line-height: 20px;
-}
-
-.que_footer .spans > span {
-  margin-right: 20px;
-}
-
-.operation {
-  display: flex;
-  align-items: center;
-  font-size: 14px;
-  font-family: PingFangSC-Regular, PingFang SC;
-  font-weight: 400;
-  color: #47c6a2;
-  line-height: 20px;
-  float: right;
-}
-
-.operation > div {
-  display: flex;
-  align-items: center;
-  cursor: pointer;
-}
-
-.operation .shoucan {
-  margin-right: 46px;
-}
-
-.operation .jiucuo {
-  color: #ff4e00;
-  margin-right: 32px;
-}
-
-.operation .detail span {
-  border-radius: 1px;
-  border-bottom: 1px solid #47c6a2;
-}
-
-.operation .detail {
-  margin-right: 32px;
-}
-
-.operation > div > img {
-  margin-right: 10px;
-}
-
-.knowPoints .tags {
-  margin-top: 24px;
-  margin-bottom: 72px;
-}
-
-.knowPoints .tit {
-  margin-bottom: 16px;
-  overflow: hidden;
-  color: #47c6a2;
-}
-
-.knowPoints .clear {
-  float: right;
-  margin-right: 40px;
-}
-
-.knowPoints .clear img {
-  margin-right: 16px;
-}
-
-.que .tit {
-  margin-bottom: 16px;
-  overflow: hidden;
-  color: #47c6a2;
-}
-
-.que .clear {
-  float: right;
-  margin-right: 40px;
-}
-
-.que .clear img {
-  margin-right: 16px;
-}
-
-.el-divider {
-  margin: 0;
-  background: #47c6a2;
-}
-
-.computer {
-  margin-top: 24px;
-  display: flex;
-  justify-content: flex-start;
-  flex-wrap: wrap;
-}
-
-.computer .computer_item {
-  flex: 33% 0 0;
-  margin-bottom: 32px;
-}
-
-.computer .computer_item .tit {
-  height: 20px;
-  font-size: 14px;
-  font-family: PingFangSC-Regular, PingFang SC;
-  font-weight: 400;
-  color: #343434;
-  line-height: 20px;
-}
-
-.computer .computer_item .select {
-  width: 58px;
-  height: 17px;
-  font-size: 12px;
-  font-family: PingFangSC-Regular, PingFang SC;
-  font-weight: 400;
-  color: #969696;
-  line-height: 17px;
-}
-
-
-::-webkit-scrollbar {
-  width: 4px;
-}
-
-::-webkit-scrollbar-thumb {
-  -webkit-box-shadow: inset 0 0 1px rgba(136, 136, 136, 0.3);
-  background-color: rgb(238, 241, 245);
-}
-
-.queBoxer {
-  display: flex;
-  position: fixed;
-  right: 0;
-  top: 50%;
-  transform: translateY(-50%);
-}
-
-.queBoxer .main {
-  border-top: 2px solid #47c6a2;
-  padding: 10px 0;
-  border-bottom: 2px solid #47c6a2;
-  background: #fff;
-}
-
-.queBoxer > div > div {
-  padding: 0 10px;
-}
-
-.queBoxer .left {
-  padding: 10px;
-  background: #47c6a2;
-  color: white;
-  display: flex;
-  flex-direction: column;
-  justify-content: space-between;
-  align-items: center;
-}
-
-.queBoxer .main .btn {
-  background: #47c6a2;
-  color: white;
-  border-radius: 4px;
-  padding: 4px;
-  cursor: pointer;
-  margin: 5px 10px;
-  text-align: center;
-}
-
-.queBoxer .left .tit {
-  display: flex;
-  writing-mode: lr-tb;
-  align-items: center;
-  flex-direction: column;
-  justify-content: space-between;
-}
-
-.generateExam {
-  padding: 14px 29px;
-  background: #47c6a2;
-  border-radius: 4px;
-  cursor: pointer;
-  color: white;
-}
-
-/deep/.el-button--success.is-plain.is-disabled {
-  background-color: #ffffff;
-  border-color: #e6ebf5;
-  color: #c0c4cc;
-}
-/deep/ .el-tree-node__content {
-  padding-top: 6px;
-  padding-bottom: 6px;
-  height: 32px;
-  font-size: 14px;
-  font-family: PingFangSC-Medium, PingFang SC;
-  font-weight: 500;
-  color: #343434;
-  line-height: 20px;
-}
-
-.generating_container >>> .el-radio-button__inner {
-  border-left: 1px solid #dcdfe6;
-}
-
-.generating_container >>> .radio_contianer .el-radio-button .el-radio-button__inner {
-  border-radius: 16px;
-}
-
-.generating_container >>> .split_page .el-pager > li {
-  border-radius: 50%;
-}
-.generating_container >>> .el-tree-node {
-  padding-left: 16px;
-}
-.generating_container >>> .el-tree-node__expand-icon.expanded {
-  content: "";
-}
-
-.generating_container >>> .el-tree-node__content > .el-tree-node__expand-icon {
-  padding: 6px;
-  /* position: absolute; */
-  right: 16px;
-}
-.generating_container >>> .radio_contianer .is-active .el-radio-button__inner{
-  border-left: none;
-}
-.empty-text {
-  margin-top: 150px;
-  text-align: center;
-  color: #ccc;
-}
-
-.generating_container >>>.el-input-number.is-controls-right .el-input-number__decrease {
-  width: 16px;
-}
-
-.generating_container >>>.el-input-number.is-controls-right[class*="medium"] [class*="increase"],
-.generating_container >>>.el-input-number.is-controls-right[class*="medium"] [class*="decrease"] {
-  width: 16px;
-}
-
-.generating_container >>>.el-tree--highlight-current .el-tree-node.is-current > .el-tree-node__content {
-  color: #47c6a2;
-  background: #ffffff;
+  methods: {
+    handleTabChange(idx) {
+      this.tabActive = idx
+    }
+  }
 }
-
-.generating_container >>>.table-delete-icon {
-  cursor: pointer;
+</script>
+<style lang="scss">
+.generating_container {
+  .active-tab {
+    color: #47c6a2;
+  }
+
+  .active-tab::after {
+    content: "";
+    width: 100%;
+    height: 4px;
+    position: absolute;
+    background: #47c6a2;
+    left: 0;
+    transform: translateY(50%);
+    bottom: 0;
+  }
+
+  .header_top {
+    display: flex;
+    border-bottom: 1px solid #b7b7b7;
+    margin-bottom: 20px;
+  }
+
+  .header_top > div {
+    position: relative;
+    flex: 1;
+    text-align: center;
+    padding: 8px 0 24px 0;
+  }
+
+
+  .radio_contianer .el-radio-button {
+    margin-right: 8px;
+  }
+
+  .radio_contianer > div {
+    margin-bottom: 16px;
+    display: flex;
+    justify-content: flex-start;
+    align-items: center;
+  }
+
+  .radio_contianer > div > span {
+    flex-shrink: 0;
+    font-size: 14px;
+    font-family: PingFangSC-Regular, PingFang SC;
+    font-weight: 400;
+    color: #232323;
+    line-height: 20px;
+    height: 20px;
+    width: 50px;
+  }
+
+  .el-card {
+    margin-bottom: 20px;
+  }
+
+  .generating_aside {
+    padding-bottom: 104px;
+    background: #fff;
+    margin-right: 24px;
+    height: 600px;
+    overflow: scroll;
+    overflow-x: hidden;
+  }
+
+  .el-aside {
+    margin-bottom: 0;
+    padding: 24px 0 0 16px;
+  }
+
+  .aside_header {
+    display: flex;
+    flex-direction: column;
+    justify-content: left;
+  }
+
+  .aside_header > span:first-child {
+    width: 173px;
+    height: 27px;
+    background: -webkit-gradient(
+        linear,
+        left top,
+        left bottom,
+        from(#ffffff),
+        to(#47c6a2)
+    );
+    background: linear-gradient(180deg, #ffffff 0%, #47c6a2 100%);
+    opacity: 0.5;
+  }
+
+  .aside_header > span:last-child {
+    margin-bottom: 20px;
+  }
+
+  .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;
+  }
+
+  .el-main {
+    padding: 37px 28px 0 28px;
+  }
+
+  .main_header {
+    display: flex;
+    align-items: center;
+    justify-content: space-between;
+    margin-bottom: 20px;
+  }
+
+  .main_header .main_tit {
+    font-size: 16px;
+    font-weight: 500;
+    color: #47c6a2;
+    line-height: 22px;
+    margin-right: 64px;
+  }
+
+  .main_header .filter {
+    font-weight: 400;
+    color: #4c4c4c;
+    line-height: 20px;
+  }
+
+  .main_header .left {
+    display: flex;
+  }
+
+  .search_box {
+    display: flex;
+    flex-direction: row;
+    align-items: center;
+    justify-content: flex-end;
+    position: relative;
+    margin-right: 20px;
+  }
+
+  .search_box img {
+    position: absolute;
+    right: 20px;
+    cursor: pointer;
+    top: 6px;
+  }
+
+  .search_box input {
+    background: #f7f7ff;
+    border-radius: 20px;
+    border: 1px solid #c6cbf5;
+    outline: none;
+    width: 340px;
+    height: 32px;
+    padding-left: 24px;
+  }
+
+  .que_item {
+    border-radius: 1px;
+    border: 1px solid #dedede;
+    margin-bottom: 8px;
+  }
+
+  .que_content {
+    padding: 12px 24px 0 33px;
+    font-size: 14px;
+    font-family: PingFangSC-Medium, PingFang SC;
+    font-weight: 500;
+    color: #4c4c4c;
+    line-height: 27px;
+    margin-bottom: 40px;
+  }
+
+  .que-content-title {
+    font-size: 14px;
+    display: flex;
+  }
+
+
+  .que-option {
+    line-height: 40px;
+  }
+
+  .que-option span {
+    margin-right: 5px;
+  }
+
+  .que_footer {
+    border-top: 1px solid #dedede;
+    padding-left: 33px;
+    overflow: hidden;
+    padding-bottom: 23px;
+    padding-top: 21px;
+  }
+
+  .que_footer .spans {
+    float: left;
+    font-size: 12px;
+    font-family: PingFangSC-Regular, PingFang SC;
+    font-weight: 400;
+    color: #979797;
+    line-height: 20px;
+  }
+
+  .que_footer .spans > span {
+    margin-right: 20px;
+  }
+
+  .operation {
+    display: flex;
+    align-items: center;
+    font-size: 14px;
+    font-family: PingFangSC-Regular, PingFang SC;
+    font-weight: 400;
+    color: #47c6a2;
+    line-height: 20px;
+    float: right;
+  }
+
+  .operation > div {
+    display: flex;
+    align-items: center;
+    cursor: pointer;
+  }
+
+  .operation .shoucan {
+    margin-right: 46px;
+  }
+
+  .operation .jiucuo {
+    color: #ff4e00;
+    margin-right: 32px;
+  }
+
+  .operation .detail span {
+    border-radius: 1px;
+    border-bottom: 1px solid #47c6a2;
+  }
+
+  .operation .detail {
+    margin-right: 32px;
+  }
+
+  .operation > div > img {
+    margin-right: 10px;
+  }
+
+  .knowPoints .tags {
+    margin-top: 24px;
+    margin-bottom: 72px;
+  }
+
+  .knowPoints .tit {
+    margin-bottom: 16px;
+    overflow: hidden;
+    color: #47c6a2;
+  }
+
+  .knowPoints .clear {
+    float: right;
+    margin-right: 40px;
+  }
+
+  .knowPoints .clear img {
+    margin-right: 16px;
+  }
+
+  .que .tit {
+    margin-bottom: 16px;
+    overflow: hidden;
+    color: #47c6a2;
+  }
+
+  .que .clear {
+    float: right;
+    margin-right: 40px;
+  }
+
+  .que .clear img {
+    margin-right: 16px;
+  }
+
+  .el-divider {
+    margin: 0;
+    background: #47c6a2;
+  }
+
+  .computer {
+    margin-top: 24px;
+    display: flex;
+    justify-content: flex-start;
+    flex-wrap: wrap;
+  }
+
+  .computer .computer_item {
+    flex: 33% 0 0;
+    margin-bottom: 32px;
+  }
+
+  .computer .computer_item .tit {
+    height: 20px;
+    font-size: 14px;
+    font-family: PingFangSC-Regular, PingFang SC;
+    font-weight: 400;
+    color: #343434;
+    line-height: 20px;
+  }
+
+  .computer .computer_item .select {
+    width: 58px;
+    height: 17px;
+    font-size: 12px;
+    font-family: PingFangSC-Regular, PingFang SC;
+    font-weight: 400;
+    color: #969696;
+    line-height: 17px;
+  }
+
+
+  ::-webkit-scrollbar {
+    width: 4px;
+  }
+
+  ::-webkit-scrollbar-thumb {
+    -webkit-box-shadow: inset 0 0 1px rgba(136, 136, 136, 0.3);
+    background-color: rgb(238, 241, 245);
+  }
+
+  .queBoxer {
+    display: flex;
+    position: fixed;
+    right: 0;
+    top: 50%;
+    transform: translateY(-50%);
+  }
+
+  .queBoxer .main {
+    border-top: 2px solid #47c6a2;
+    padding: 10px 0;
+    border-bottom: 2px solid #47c6a2;
+    background: #fff;
+  }
+
+  .queBoxer > div > div {
+    padding: 0 10px;
+  }
+
+  .queBoxer .left {
+    padding: 10px;
+    background: #47c6a2;
+    color: white;
+    display: flex;
+    flex-direction: column;
+    justify-content: space-between;
+    align-items: center;
+  }
+
+  .queBoxer .main .btn {
+    background: #47c6a2;
+    color: white;
+    border-radius: 4px;
+    padding: 4px;
+    cursor: pointer;
+    margin: 5px 10px;
+    text-align: center;
+  }
+
+  .queBoxer .left .tit {
+    display: flex;
+    writing-mode: lr-tb;
+    align-items: center;
+    flex-direction: column;
+    justify-content: space-between;
+  }
+
+  .generateExam {
+    padding: 14px 29px;
+    background: #47c6a2;
+    border-radius: 4px;
+    cursor: pointer;
+    color: white;
+  }
+
+  .el-button--success.is-plain.is-disabled {
+    background-color: #ffffff;
+    border-color: #e6ebf5;
+    color: #c0c4cc;
+  }
+
+  .el-tree-node__content {
+    padding-top: 6px;
+    padding-bottom: 6px;
+    height: 32px;
+    font-size: 14px;
+    font-family: PingFangSC-Medium, PingFang SC;
+    font-weight: 500;
+    color: #343434;
+    line-height: 20px;
+  }
+
+  & .el-radio-button__inner {
+    border-left: 1px solid #dcdfe6;
+  }
+
+  & .radio_contianer .el-radio-button .el-radio-button__inner {
+    border-radius: 16px;
+  }
+
+  & .split_page .el-pager > li {
+    border-radius: 50%;
+  }
+
+  & .el-tree-node {
+    padding-left: 16px;
+  }
+
+  & .el-tree-node__expand-icon.expanded {
+    content: "";
+  }
+
+  & .el-tree-node__content > .el-tree-node__expand-icon {
+    padding: 6px;
+    /* position: absolute; */
+    right: 16px;
+  }
+
+  & .radio_contianer .is-active .el-radio-button__inner {
+    border-left: none;
+  }
+
+  .empty-text {
+    margin-top: 150px;
+    text-align: center;
+    color: #ccc;
+  }
+
+  & .el-input-number.is-controls-right .el-input-number__decrease {
+    width: 16px;
+  }
+
+  & .el-input-number.is-controls-right[class*="medium"] [class*="increase"],
+  & .el-input-number.is-controls-right[class*="medium"] [class*="decrease"] {
+    width: 16px;
+  }
+
+  & .el-tree--highlight-current .el-tree-node.is-current > .el-tree-node__content {
+    color: #47c6a2;
+    background: #ffffff;
+  }
+
+  & .table-delete-icon {
+    cursor: pointer;
+  }
 }
 </style>

+ 5 - 3
src/views/questioncenter/paper.vue

@@ -99,6 +99,7 @@ export default {
   },
   data() {
     return {
+      extraData: {},
       isLoading: false,
       currentTypeIndex: 0,
       currentQuestionIndex: 0,
@@ -129,6 +130,7 @@ export default {
   },
   watch: {
     $route() {
+      this.extraData = this.$route.query || {}
       this.getQuestionList();
     },
   },
@@ -159,7 +161,6 @@ export default {
       }))
 
       this.$nextTick(_=>this.mxGlobal.MathQueue("paperContainer"))
-      console.log(this.questionList);
     },
 
     SectionToChinese(section) {
@@ -259,7 +260,7 @@ export default {
         this.questionList[pIndex].score - data.score;
     },
     toQuestionList() {
-      this.$router.push("/question-center/generatingPaperCenter");
+      this.$router.back()
     },
     savePaper() {
       let list = [];
@@ -283,6 +284,7 @@ export default {
         }
       }
       let param = {
+        ...this.extraData,
         subjectid: this.jsonData.subjectId ? this.jsonData.subjectId : 0,
         gradeId: this.jsonData.gradeId,
         buildType: this.jsonData.buildType,
@@ -298,7 +300,7 @@ export default {
           this.isLoading = false;
           localStorage.setItem("paperData", JSON.stringify({}));
           localStorage.setItem("questionList", JSON.stringify([]));
-          deleteQuestionCard().then(res => this.$router.push("/question-center/generatingPaperCenter"))
+          deleteQuestionCard().then(res => this.$router.back())
         })
         .catch((err) => {
           this.isLoading = false;

+ 615 - 615
src/views/system/role/index.vue

@@ -1,615 +1,615 @@
-<template>
-  <div class="app-container">
-    <el-form :model="queryParams" ref="queryForm" v-show="showSearch" :inline="true">
-      <el-form-item label="角色名称" prop="roleName">
-        <el-input
-          v-model="queryParams.roleName"
-          placeholder="请输入角色名称"
-          clearable
-          size="small"
-          style="width: 240px"
-          @keyup.enter.native="handleQuery"
-        />
-      </el-form-item>
-      <el-form-item label="权限字符" prop="roleKey">
-        <el-input
-          v-model="queryParams.roleKey"
-          placeholder="请输入权限字符"
-          clearable
-          size="small"
-          style="width: 240px"
-          @keyup.enter.native="handleQuery"
-        />
-      </el-form-item>
-      <el-form-item label="状态" prop="status">
-        <el-select
-          v-model="queryParams.status"
-          placeholder="角色状态"
-          clearable
-          size="small"
-          style="width: 240px"
-        >
-          <el-option
-            v-for="dict in statusOptions"
-            :key="dict.dictValue"
-            :label="dict.dictLabel"
-            :value="dict.dictValue"
-          />
-        </el-select>
-      </el-form-item>
-      <el-form-item label="创建时间">
-        <el-date-picker
-          v-model="dateRange"
-          size="small"
-          style="width: 240px"
-          value-format="yyyy-MM-dd"
-          type="daterange"
-          range-separator="-"
-          start-placeholder="开始日期"
-          end-placeholder="结束日期"
-        ></el-date-picker>
-      </el-form-item>
-      <el-form-item>
-        <el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery">搜索</el-button>
-        <el-button icon="el-icon-refresh" size="mini" @click="resetQuery">重置</el-button>
-      </el-form-item>
-    </el-form>
-
-    <el-row :gutter="10" class="mb8">
-      <el-col :span="1.5">
-        <el-button
-          type="primary"
-          plain
-          icon="el-icon-plus"
-          size="mini"
-          @click="handleAdd"
-          v-hasPermi="['system:role:add']"
-        >新增</el-button>
-      </el-col>
-      <el-col :span="1.5">
-        <el-button
-          type="success"
-          plain
-          icon="el-icon-edit"
-          size="mini"
-          :disabled="single"
-          @click="handleUpdate"
-          v-hasPermi="['system:role:edit']"
-        >修改</el-button>
-      </el-col>
-      <el-col :span="1.5">
-        <el-button
-          type="danger"
-          plain
-          icon="el-icon-delete"
-          size="mini"
-          :disabled="multiple"
-          @click="handleDelete"
-          v-hasPermi="['system:role:remove']"
-        >删除</el-button>
-      </el-col>
-      <el-col :span="1.5">
-        <el-button
-          type="warning"
-          plain
-          icon="el-icon-download"
-          size="mini"
-          :loading="exportLoading"
-          @click="handleExport"
-          v-hasPermi="['system:role:export']"
-        >导出</el-button>
-      </el-col>
-      <right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
-    </el-row>
-
-    <el-table v-loading="loading" :data="roleList" @selection-change="handleSelectionChange">
-      <el-table-column type="selection" width="55" align="center" />
-      <el-table-column label="角色编号" prop="roleId" width="120" />
-      <el-table-column label="角色名称" prop="roleName" :show-overflow-tooltip="true" width="150" />
-      <el-table-column label="权限字符" prop="roleKey" :show-overflow-tooltip="true" width="150" />
-      <el-table-column label="显示顺序" prop="roleSort" width="100" />
-      <el-table-column label="状态" align="center" width="100">
-        <template slot-scope="scope">
-          <el-switch
-            v-model="scope.row.status"
-            active-value="0"
-            inactive-value="1"
-            @change="handleStatusChange(scope.row)"
-          ></el-switch>
-        </template>
-      </el-table-column>
-      <el-table-column label="创建时间" align="center" prop="createTime" width="180">
-        <template slot-scope="scope">
-          <span>{{ parseTime(scope.row.createTime) }}</span>
-        </template>
-      </el-table-column>
-      <el-table-column label="操作" align="center" class-name="small-padding fixed-width">
-        <template slot-scope="scope">
-          <el-button
-            size="mini"
-            type="text"
-            icon="el-icon-edit"
-            @click="handleUpdate(scope.row)"
-            v-hasPermi="['system:role:edit']"
-          >修改</el-button>
-          <el-button
-            size="mini"
-            type="text"
-            icon="el-icon-circle-check"
-            @click="handleDataScope(scope.row)"
-            v-hasPermi="['system:role:edit']"
-          >数据权限</el-button>
-          <el-button
-            size="mini"
-            type="text"
-            icon="el-icon-delete"
-            @click="handleDelete(scope.row)"
-            v-hasPermi="['system:role:remove']"
-          >删除</el-button>
-        </template>
-      </el-table-column>
-    </el-table>
-
-    <pagination
-      v-show="total>0"
-      :total="total"
-      :page.sync="queryParams.pageNum"
-      :limit.sync="queryParams.pageSize"
-      @pagination="getList"
-    />
-
-    <!-- 添加或修改角色配置对话框 -->
-    <el-dialog :title="title" :visible.sync="open" width="500px" append-to-body>
-      <el-form ref="form" :model="form" :rules="rules" label-width="80px">
-        <el-form-item label="角色名称" prop="roleName">
-          <el-input v-model="form.roleName" placeholder="请输入角色名称" />
-        </el-form-item>
-        <el-form-item label="权限字符" prop="roleKey">
-          <el-input v-model="form.roleKey" placeholder="请输入权限字符" />
-        </el-form-item>
-        <el-form-item label="角色顺序" prop="roleSort">
-          <el-input-number v-model="form.roleSort" controls-position="right" :min="0" />
-        </el-form-item>
-        <el-form-item label="状态">
-          <el-radio-group v-model="form.status">
-            <el-radio
-              v-for="dict in statusOptions"
-              :key="dict.dictValue"
-              :label="dict.dictValue"
-            >{{dict.dictLabel}}</el-radio>
-          </el-radio-group>
-        </el-form-item>
-        <el-form-item label="菜单权限">
-          <el-checkbox v-model="menuExpand" @change="handleCheckedTreeExpand($event, 'menu')">展开/折叠</el-checkbox>
-          <el-checkbox v-model="menuNodeAll" @change="handleCheckedTreeNodeAll($event, 'menu')">全选/全不选</el-checkbox>
-          <el-checkbox v-model="form.menuCheckStrictly" @change="handleCheckedTreeConnect($event, 'menu')">父子联动</el-checkbox>
-          <el-tree
-            class="tree-border"
-            :data="menuOptions"
-            show-checkbox
-            ref="menu"
-            node-key="id"
-            :check-strictly="!form.menuCheckStrictly"
-            empty-text="加载中,请稍后"
-            :props="defaultProps"
-          ></el-tree>
-        </el-form-item>
-        <el-form-item label="备注">
-          <el-input v-model="form.remark" type="textarea" placeholder="请输入内容"></el-input>
-        </el-form-item>
-      </el-form>
-      <div slot="footer" class="dialog-footer">
-        <el-button type="primary" @click="submitForm">确 定</el-button>
-        <el-button @click="cancel">取 消</el-button>
-      </div>
-    </el-dialog>
-
-    <!-- 分配角色数据权限对话框 -->
-    <el-dialog :title="title" :visible.sync="openDataScope" width="500px" append-to-body>
-      <el-form :model="form" label-width="80px">
-        <el-form-item label="角色名称">
-          <el-input v-model="form.roleName" :disabled="true" />
-        </el-form-item>
-        <el-form-item label="权限字符">
-          <el-input v-model="form.roleKey" :disabled="true" />
-        </el-form-item>
-        <el-form-item label="权限范围">
-          <el-select v-model="form.dataScope" @change="dataScopeSelectChange">
-            <el-option
-              v-for="item in dataScopeOptions"
-              :key="item.value"
-              :label="item.label"
-              :value="item.value"
-            ></el-option>
-          </el-select>
-        </el-form-item>
-        <el-form-item label="数据权限" v-show="form.dataScope == 2">
-          <el-checkbox v-model="deptExpand" @change="handleCheckedTreeExpand($event, 'dept')">展开/折叠</el-checkbox>
-          <el-checkbox v-model="deptNodeAll" @change="handleCheckedTreeNodeAll($event, 'dept')">全选/全不选</el-checkbox>
-          <el-checkbox v-model="form.deptCheckStrictly" @change="handleCheckedTreeConnect($event, 'dept')">父子联动</el-checkbox>
-          <el-tree
-            class="tree-border"
-            :data="deptOptions"
-            show-checkbox
-            default-expand-all
-            ref="dept"
-            node-key="id"
-            :check-strictly="!form.deptCheckStrictly"
-            empty-text="加载中,请稍后"
-            :props="defaultProps"
-          ></el-tree>
-        </el-form-item>
-      </el-form>
-      <div slot="footer" class="dialog-footer">
-        <el-button type="primary" @click="submitDataScope">确 定</el-button>
-        <el-button @click="cancelDataScope">取 消</el-button>
-      </div>
-    </el-dialog>
-  </div>
-</template>
-
-<script>
-import { listRole, getRole, delRole, addRole, updateRole, exportRole, dataScope, changeRoleStatus } from "@/api/system/role";
-import { treeselect as menuTreeselect, roleMenuTreeselect } from "@/api/system/menu";
-import { treeselect as deptTreeselect, roleDeptTreeselect } from "@/api/system/dept";
-
-export default {
-  name: "Role",
-  data() {
-    return {
-      // 遮罩层
-      loading: true,
-      // 导出遮罩层
-      exportLoading: false,
-      // 选中数组
-      ids: [],
-      // 非单个禁用
-      single: true,
-      // 非多个禁用
-      multiple: true,
-      // 显示搜索条件
-      showSearch: true,
-      // 总条数
-      total: 0,
-      // 角色表格数据
-      roleList: [],
-      // 弹出层标题
-      title: "",
-      // 是否显示弹出层
-      open: false,
-      // 是否显示弹出层(数据权限)
-      openDataScope: false,
-      menuExpand: false,
-      menuNodeAll: false,
-      deptExpand: true,
-      deptNodeAll: false,
-      // 日期范围
-      dateRange: [],
-      // 状态数据字典
-      statusOptions: [],
-      // 数据范围选项
-      dataScopeOptions: [
-        {
-          value: "1",
-          label: "全部数据权限"
-        },
-        {
-          value: "2",
-          label: "自定数据权限"
-        },
-        {
-          value: "3",
-          label: "本部门数据权限"
-        },
-        {
-          value: "4",
-          label: "本部门及以下数据权限"
-        },
-        {
-          value: "5",
-          label: "仅本人数据权限"
-        }
-      ],
-      // 菜单列表
-      menuOptions: [],
-      // 部门列表
-      deptOptions: [],
-      // 查询参数
-      queryParams: {
-        pageNum: 1,
-        pageSize: 10,
-        roleName: undefined,
-        roleKey: undefined,
-        status: undefined
-      },
-      // 表单参数
-      form: {},
-      defaultProps: {
-        children: "children",
-        label: "label"
-      },
-      // 表单校验
-      rules: {
-        roleName: [
-          { required: true, message: "角色名称不能为空", trigger: "blur" }
-        ],
-        roleKey: [
-          { required: true, message: "权限字符不能为空", trigger: "blur" }
-        ],
-        roleSort: [
-          { required: true, message: "角色顺序不能为空", trigger: "blur" }
-        ]
-      }
-    };
-  },
-  created() {
-    this.getList();
-    this.getDicts("sys_normal_disable").then(response => {
-      this.statusOptions = response.data;
-    });
-  },
-  methods: {
-    /** 查询角色列表 */
-    getList() {
-      this.loading = true;
-      listRole(this.addDateRange(this.queryParams, this.dateRange)).then(
-        response => {
-          this.roleList = response.rows;
-          this.total = response.total;
-          this.loading = false;
-        }
-      );
-    },
-    /** 查询菜单树结构 */
-    getMenuTreeselect() {
-      menuTreeselect().then(response => {
-        this.menuOptions = response.data;
-      });
-    },
-    /** 查询部门树结构 */
-    getDeptTreeselect() {
-      deptTreeselect().then(response => {
-        this.deptOptions = response.data;
-      });
-    },
-    // 所有菜单节点数据
-    getMenuAllCheckedKeys() {
-      // 目前被选中的菜单节点
-      let checkedKeys = this.$refs.menu.getCheckedKeys();
-      // 半选中的菜单节点
-      let halfCheckedKeys = this.$refs.menu.getHalfCheckedKeys();
-      checkedKeys.unshift.apply(checkedKeys, halfCheckedKeys);
-      return checkedKeys;
-    },
-    // 所有部门节点数据
-    getDeptAllCheckedKeys() {
-      // 目前被选中的部门节点
-      let checkedKeys = this.$refs.dept.getCheckedKeys();
-      // 半选中的部门节点
-      let halfCheckedKeys = this.$refs.dept.getHalfCheckedKeys();
-      checkedKeys.unshift.apply(checkedKeys, halfCheckedKeys);
-      return checkedKeys;
-    },
-    /** 根据角色ID查询菜单树结构 */
-    getRoleMenuTreeselect(roleId) {
-      return roleMenuTreeselect(roleId).then(response => {
-        this.menuOptions = response.menus;
-        return response;
-      });
-    },
-    /** 根据角色ID查询部门树结构 */
-    getRoleDeptTreeselect(roleId) {
-      return roleDeptTreeselect(roleId).then(response => {
-        this.deptOptions = response.depts;
-        return response;
-      });
-    },
-    // 角色状态修改
-    handleStatusChange(row) {
-      let text = row.status === "0" ? "启用" : "停用";
-      this.$confirm('确认要"' + text + '""' + row.roleName + '"角色吗?', "警告", {
-          confirmButtonText: "确定",
-          cancelButtonText: "取消",
-          type: "warning"
-        }).then(function() {
-          return changeRoleStatus(row.roleId, row.status);
-        }).then(() => {
-          this.msgSuccess(text + "成功");
-        }).catch(function() {
-          row.status = row.status === "0" ? "1" : "0";
-        });
-    },
-    // 取消按钮
-    cancel() {
-      this.open = false;
-      this.reset();
-    },
-    // 取消按钮(数据权限)
-    cancelDataScope() {
-      this.openDataScope = false;
-      this.reset();
-    },
-    // 表单重置
-    reset() {
-      if (this.$refs.menu != undefined) {
-        this.$refs.menu.setCheckedKeys([]);
-      }
-      this.menuExpand = false,
-      this.menuNodeAll = false,
-      this.deptExpand = true,
-      this.deptNodeAll = false,
-      this.form = {
-        roleId: undefined,
-        roleName: undefined,
-        roleKey: undefined,
-        roleSort: 0,
-        status: "0",
-        menuIds: [],
-        deptIds: [],
-        menuCheckStrictly: true,
-        deptCheckStrictly: true,
-        remark: undefined
-      };
-      this.resetForm("form");
-    },
-    /** 搜索按钮操作 */
-    handleQuery() {
-      this.queryParams.pageNum = 1;
-      this.getList();
-    },
-    /** 重置按钮操作 */
-    resetQuery() {
-      this.dateRange = [];
-      this.resetForm("queryForm");
-      this.handleQuery();
-    },
-    // 多选框选中数据
-    handleSelectionChange(selection) {
-      this.ids = selection.map(item => item.roleId)
-      this.single = selection.length!=1
-      this.multiple = !selection.length
-    },
-    // 树权限(展开/折叠)
-    handleCheckedTreeExpand(value, type) {
-      if (type == 'menu') {
-        let treeList = this.menuOptions;
-        for (let i = 0; i < treeList.length; i++) {
-          this.$refs.menu.store.nodesMap[treeList[i].id].expanded = value;
-        }
-      } else if (type == 'dept') {
-        let treeList = this.deptOptions;
-        for (let i = 0; i < treeList.length; i++) {
-          this.$refs.dept.store.nodesMap[treeList[i].id].expanded = value;
-        }
-      }
-    },
-    // 树权限(全选/全不选)
-    handleCheckedTreeNodeAll(value, type) {
-      if (type == 'menu') {
-        this.$refs.menu.setCheckedNodes(value ? this.menuOptions: []);
-      } else if (type == 'dept') {
-        this.$refs.dept.setCheckedNodes(value ? this.deptOptions: []);
-      }
-    },
-    // 树权限(父子联动)
-    handleCheckedTreeConnect(value, type) {
-      if (type == 'menu') {
-        this.form.menuCheckStrictly = value ? true: false;
-      } else if (type == 'dept') {
-        this.form.deptCheckStrictly = value ? true: false;
-      }
-    },
-    /** 新增按钮操作 */
-    handleAdd() {
-      this.reset();
-      this.getMenuTreeselect();
-      this.open = true;
-      this.title = "添加角色";
-    },
-    /** 修改按钮操作 */
-    handleUpdate(row) {
-      this.reset();
-      const roleId = row.roleId || this.ids
-      const roleMenu = this.getRoleMenuTreeselect(roleId);
-      getRole(roleId).then(response => {
-        this.form = response.data;
-        this.open = true;
-        this.$nextTick(() => {
-          roleMenu.then(res => {
-            let checkedKeys = res.checkedKeys
-            checkedKeys.forEach((v) => {
-                this.$nextTick(()=>{
-                    this.$refs.menu.setChecked(v, true ,false);
-                })
-            })
-          });
-        });
-        this.title = "修改角色";
-      });
-    },
-    /** 选择角色权限范围触发 */
-    dataScopeSelectChange(value) {
-      if(value !== '2') {
-        this.$refs.dept.setCheckedKeys([]);
-      }
-    },
-    /** 分配数据权限操作 */
-    handleDataScope(row) {
-      this.reset();
-      const roleDeptTreeselect = this.getRoleDeptTreeselect(row.roleId);
-      getRole(row.roleId).then(response => {
-        this.form = response.data;
-        this.openDataScope = true;
-        this.$nextTick(() => {
-          roleDeptTreeselect.then(res => {
-            this.$refs.dept.setCheckedKeys(res.checkedKeys);
-          });
-        });
-        this.title = "分配数据权限";
-      });
-    },
-    /** 提交按钮 */
-    submitForm: function() {
-      this.$refs["form"].validate(valid => {
-        if (valid) {
-          if (this.form.roleId != undefined) {
-            this.form.menuIds = this.getMenuAllCheckedKeys();
-            updateRole(this.form).then(response => {
-              this.msgSuccess("修改成功");
-              this.open = false;
-              this.getList();
-            });
-          } else {
-            this.form.menuIds = this.getMenuAllCheckedKeys();
-            addRole(this.form).then(response => {
-              this.msgSuccess("新增成功");
-              this.open = false;
-              this.getList();
-            });
-          }
-        }
-      });
-    },
-    /** 提交按钮(数据权限) */
-    submitDataScope: function() {
-      if (this.form.roleId != undefined) {
-        this.form.deptIds = this.getDeptAllCheckedKeys();
-        dataScope(this.form).then(response => {
-          this.msgSuccess("修改成功");
-          this.openDataScope = false;
-          this.getList();
-        });
-      }
-    },
-    /** 删除按钮操作 */
-    handleDelete(row) {
-      const roleIds = row.roleId || this.ids;
-      this.$confirm('是否确认删除角色编号为"' + roleIds + '"的数据项?', "警告", {
-          confirmButtonText: "确定",
-          cancelButtonText: "取消",
-          type: "warning"
-        }).then(function() {
-          return delRole(roleIds);
-        }).then(() => {
-          this.getList();
-          this.msgSuccess("删除成功");
-        })
-    },
-    /** 导出按钮操作 */
-    handleExport() {
-      const queryParams = this.queryParams;
-      this.$confirm('是否确认导出所有角色数据项?', "警告", {
-          confirmButtonText: "确定",
-          cancelButtonText: "取消",
-          type: "warning"
-        }).then(() => {
-          this.exportLoading = true;
-          return exportRole(queryParams);
-        }).then(response => {
-          this.download(response.msg);
-          this.exportLoading = false;
-        })
-    }
-  }
-};
-</script>
+<template>
+  <div class="app-container">
+    <el-form :model="queryParams" ref="queryForm" v-show="showSearch" :inline="true">
+      <el-form-item label="角色名称" prop="roleName">
+        <el-input
+          v-model="queryParams.roleName"
+          placeholder="请输入角色名称"
+          clearable
+          size="small"
+          style="width: 240px"
+          @keyup.enter.native="handleQuery"
+        />
+      </el-form-item>
+      <el-form-item label="权限字符" prop="roleKey">
+        <el-input
+          v-model="queryParams.roleKey"
+          placeholder="请输入权限字符"
+          clearable
+          size="small"
+          style="width: 240px"
+          @keyup.enter.native="handleQuery"
+        />
+      </el-form-item>
+      <el-form-item label="状态" prop="status">
+        <el-select
+          v-model="queryParams.status"
+          placeholder="角色状态"
+          clearable
+          size="small"
+          style="width: 240px"
+        >
+          <el-option
+            v-for="dict in statusOptions"
+            :key="dict.dictValue"
+            :label="dict.dictLabel"
+            :value="dict.dictValue"
+          />
+        </el-select>
+      </el-form-item>
+      <el-form-item label="创建时间">
+        <el-date-picker
+          v-model="dateRange"
+          size="small"
+          style="width: 240px"
+          value-format="yyyy-MM-dd"
+          type="daterange"
+          range-separator="-"
+          start-placeholder="开始日期"
+          end-placeholder="结束日期"
+        ></el-date-picker>
+      </el-form-item>
+      <el-form-item>
+        <el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery">搜索</el-button>
+        <el-button icon="el-icon-refresh" size="mini" @click="resetQuery">重置</el-button>
+      </el-form-item>
+    </el-form>
+
+    <el-row :gutter="10" class="mb8">
+      <el-col :span="1.5">
+        <el-button
+          type="primary"
+          plain
+          icon="el-icon-plus"
+          size="mini"
+          @click="handleAdd"
+          v-hasPermi="['system:role:add']"
+        >新增</el-button>
+      </el-col>
+      <el-col :span="1.5">
+        <el-button
+          type="success"
+          plain
+          icon="el-icon-edit"
+          size="mini"
+          :disabled="single"
+          @click="handleUpdate"
+          v-hasPermi="['system:role:edit']"
+        >修改</el-button>
+      </el-col>
+      <el-col :span="1.5">
+        <el-button
+          type="danger"
+          plain
+          icon="el-icon-delete"
+          size="mini"
+          :disabled="multiple"
+          @click="handleDelete"
+          v-hasPermi="['system:role:remove']"
+        >删除</el-button>
+      </el-col>
+      <el-col :span="1.5">
+        <el-button
+          type="warning"
+          plain
+          icon="el-icon-download"
+          size="mini"
+          :loading="exportLoading"
+          @click="handleExport"
+          v-hasPermi="['system:role:export']"
+        >导出</el-button>
+      </el-col>
+      <right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
+    </el-row>
+
+    <el-table v-loading="loading" :data="roleList" @selection-change="handleSelectionChange">
+      <el-table-column type="selection" width="55" align="center" />
+      <el-table-column label="角色编号" prop="roleId" width="120" />
+      <el-table-column label="角色名称" prop="roleName" :show-overflow-tooltip="true" width="150" />
+      <el-table-column label="权限字符" prop="roleKey" :show-overflow-tooltip="true" width="150" />
+      <el-table-column label="显示顺序" prop="roleSort" width="100" />
+      <el-table-column label="状态" align="center" width="100">
+        <template slot-scope="scope">
+          <el-switch
+            v-model="scope.row.status"
+            active-value="0"
+            inactive-value="1"
+            @change="handleStatusChange(scope.row)"
+          ></el-switch>
+        </template>
+      </el-table-column>
+      <el-table-column label="创建时间" align="center" prop="createTime" width="180">
+        <template slot-scope="scope">
+          <span>{{ parseTime(scope.row.createTime) }}</span>
+        </template>
+      </el-table-column>
+      <el-table-column label="操作" align="center" class-name="small-padding fixed-width">
+        <template slot-scope="scope">
+          <el-button
+            size="mini"
+            type="text"
+            icon="el-icon-edit"
+            @click="handleUpdate(scope.row)"
+            v-hasPermi="['system:role:edit']"
+          >修改</el-button>
+          <el-button
+            size="mini"
+            type="text"
+            icon="el-icon-circle-check"
+            @click="handleDataScope(scope.row)"
+            v-hasPermi="['system:role:edit']"
+          >数据权限</el-button>
+          <el-button
+            size="mini"
+            type="text"
+            icon="el-icon-delete"
+            @click="handleDelete(scope.row)"
+            v-hasPermi="['system:role:remove']"
+          >删除</el-button>
+        </template>
+      </el-table-column>
+    </el-table>
+
+    <pagination
+      v-show="total>0"
+      :total="total"
+      :page.sync="queryParams.pageNum"
+      :limit.sync="queryParams.pageSize"
+      @pagination="getList"
+    />
+
+    <!-- 添加或修改角色配置对话框 -->
+    <el-dialog :title="title" :visible.sync="open" width="500px" append-to-body>
+      <el-form ref="form" :model="form" :rules="rules" label-width="80px">
+        <el-form-item label="角色名称" prop="roleName">
+          <el-input v-model="form.roleName" placeholder="请输入角色名称" />
+        </el-form-item>
+        <el-form-item label="权限字符" prop="roleKey">
+          <el-input v-model="form.roleKey" placeholder="请输入权限字符" />
+        </el-form-item>
+        <el-form-item label="角色顺序" prop="roleSort">
+          <el-input-number v-model="form.roleSort" controls-position="right" :min="0" />
+        </el-form-item>
+        <el-form-item label="状态">
+          <el-radio-group v-model="form.status">
+            <el-radio
+              v-for="dict in statusOptions"
+              :key="dict.dictValue"
+              :label="dict.dictValue"
+            >{{dict.dictLabel}}</el-radio>
+          </el-radio-group>
+        </el-form-item>
+        <el-form-item label="菜单权限">
+          <el-checkbox v-model="menuExpand" @change="handleCheckedTreeExpand($event, 'menu')">展开/折叠</el-checkbox>
+          <el-checkbox v-model="menuNodeAll" @change="handleCheckedTreeNodeAll($event, 'menu')">全选/全不选</el-checkbox>
+          <el-checkbox v-model="form.menuCheckStrictly" @change="handleCheckedTreeConnect($event, 'menu')">父子联动</el-checkbox>
+          <el-tree
+            class="tree-border"
+            :data="menuOptions"
+            show-checkbox
+            ref="menu"
+            node-key="id"
+            :check-strictly="!form.menuCheckStrictly"
+            empty-text="加载中,请稍后"
+            :props="defaultProps"
+          ></el-tree>
+        </el-form-item>
+        <el-form-item label="备注">
+          <el-input v-model="form.remark" type="textarea" placeholder="请输入内容"></el-input>
+        </el-form-item>
+      </el-form>
+      <div slot="footer" class="dialog-footer">
+        <el-button type="primary" @click="submitForm">确 定</el-button>
+        <el-button @click="cancel">取 消</el-button>
+      </div>
+    </el-dialog>
+
+    <!-- 分配角色数据权限对话框 -->
+    <el-dialog :title="title" :visible.sync="openDataScope" width="500px" append-to-body>
+      <el-form :model="form" label-width="80px">
+        <el-form-item label="角色名称">
+          <el-input v-model="form.roleName" :disabled="true" />
+        </el-form-item>
+        <el-form-item label="权限字符">
+          <el-input v-model="form.roleKey" :disabled="true" />
+        </el-form-item>
+        <el-form-item label="权限范围">
+          <el-select v-model="form.dataScope" @change="dataScopeSelectChange">
+            <el-option
+              v-for="item in dataScopeOptions"
+              :key="item.value"
+              :label="item.label"
+              :value="item.value"
+            ></el-option>
+          </el-select>
+        </el-form-item>
+        <el-form-item label="数据权限" v-show="form.dataScope == 2">
+          <el-checkbox v-model="deptExpand" @change="handleCheckedTreeExpand($event, 'dept')">展开/折叠</el-checkbox>
+          <el-checkbox v-model="deptNodeAll" @change="handleCheckedTreeNodeAll($event, 'dept')">全选/全不选</el-checkbox>
+          <el-checkbox v-model="form.deptCheckStrictly" @change="handleCheckedTreeConnect($event, 'dept')">父子联动</el-checkbox>
+          <el-tree
+            class="tree-border"
+            :data="deptOptions"
+            show-checkbox
+            default-expand-all
+            ref="dept"
+            node-key="id"
+            :check-strictly="!form.deptCheckStrictly"
+            empty-text="加载中,请稍后"
+            :props="defaultProps"
+          ></el-tree>
+        </el-form-item>
+      </el-form>
+      <div slot="footer" class="dialog-footer">
+        <el-button type="primary" @click="submitDataScope">确 定</el-button>
+        <el-button @click="cancelDataScope">取 消</el-button>
+      </div>
+    </el-dialog>
+  </div>
+</template>
+
+<script>
+import { listRole, getRole, delRole, addRole, updateRole, exportRole, dataScope, changeRoleStatus } from "@/api/system/role";
+import { treeselect as menuTreeselect, roleMenuTreeselect } from "@/api/system/menu";
+import { treeselect as deptTreeselect, roleDeptTreeselect } from "@/api/system/dept";
+
+export default {
+  name: "Role",
+  data() {
+    return {
+      // 遮罩层
+      loading: true,
+      // 导出遮罩层
+      exportLoading: false,
+      // 选中数组
+      ids: [],
+      // 非单个禁用
+      single: true,
+      // 非多个禁用
+      multiple: true,
+      // 显示搜索条件
+      showSearch: true,
+      // 总条数
+      total: 0,
+      // 角色表格数据
+      roleList: [],
+      // 弹出层标题
+      title: "",
+      // 是否显示弹出层
+      open: false,
+      // 是否显示弹出层(数据权限)
+      openDataScope: false,
+      menuExpand: false,
+      menuNodeAll: false,
+      deptExpand: true,
+      deptNodeAll: false,
+      // 日期范围
+      dateRange: [],
+      // 状态数据字典
+      statusOptions: [],
+      // 数据范围选项
+      dataScopeOptions: [
+        {
+          value: "1",
+          label: "全部数据权限"
+        },
+        {
+          value: "2",
+          label: "自定数据权限"
+        },
+        {
+          value: "3",
+          label: "本部门数据权限"
+        },
+        {
+          value: "4",
+          label: "本部门及以下数据权限"
+        },
+        {
+          value: "5",
+          label: "仅本人数据权限"
+        }
+      ],
+      // 菜单列表
+      menuOptions: [],
+      // 部门列表
+      deptOptions: [],
+      // 查询参数
+      queryParams: {
+        pageNum: 1,
+        pageSize: 10,
+        roleName: undefined,
+        roleKey: undefined,
+        status: undefined
+      },
+      // 表单参数
+      form: {},
+      defaultProps: {
+        children: "children",
+        label: "label"
+      },
+      // 表单校验
+      rules: {
+        roleName: [
+          { required: true, message: "角色名称不能为空", trigger: "blur" }
+        ],
+        roleKey: [
+          { required: true, message: "权限字符不能为空", trigger: "blur" }
+        ],
+        roleSort: [
+          { required: true, message: "角色顺序不能为空", trigger: "blur" }
+        ]
+      }
+    };
+  },
+  created() {
+    this.getList();
+    this.getDicts("sys_normal_disable").then(response => {
+      this.statusOptions = response.data;
+    });
+  },
+  methods: {
+    /** 查询角色列表 */
+    getList() {
+      this.loading = true;
+      listRole(this.addDateRange(this.queryParams, this.dateRange)).then(
+        response => {
+          this.roleList = response.rows;
+          this.total = response.total;
+          this.loading = false;
+        }
+      );
+    },
+    /** 查询菜单树结构 */
+    getMenuTreeselect() {
+      menuTreeselect().then(response => {
+        this.menuOptions = response.data;
+      });
+    },
+    /** 查询部门树结构 */
+    getDeptTreeselect() {
+      deptTreeselect().then(response => {
+        this.deptOptions = response.data;
+      });
+    },
+    // 所有菜单节点数据
+    getMenuAllCheckedKeys() {
+      // 目前被选中的菜单节点
+      let checkedKeys = this.$refs.menu.getCheckedKeys();
+      // 半选中的菜单节点
+      let halfCheckedKeys = this.$refs.menu.getHalfCheckedKeys();
+      checkedKeys.unshift.apply(checkedKeys, halfCheckedKeys);
+      return checkedKeys;
+    },
+    // 所有部门节点数据
+    getDeptAllCheckedKeys() {
+      // 目前被选中的部门节点
+      let checkedKeys = this.$refs.dept.getCheckedKeys();
+      // 半选中的部门节点
+      let halfCheckedKeys = this.$refs.dept.getHalfCheckedKeys();
+      checkedKeys.unshift.apply(checkedKeys, halfCheckedKeys);
+      return checkedKeys;
+    },
+    /** 根据角色ID查询菜单树结构 */
+    getRoleMenuTreeselect(roleId) {
+      return roleMenuTreeselect(roleId).then(response => {
+        this.menuOptions = response.menus;
+        return response;
+      });
+    },
+    /** 根据角色ID查询部门树结构 */
+    getRoleDeptTreeselect(roleId) {
+      return roleDeptTreeselect(roleId).then(response => {
+        this.deptOptions = response.depts;
+        return response;
+      });
+    },
+    // 角色状态修改
+    handleStatusChange(row) {
+      let text = row.status === "0" ? "启用" : "停用";
+      this.$confirm('确认要"' + text + '""' + row.roleName + '"角色吗?', "警告", {
+          confirmButtonText: "确定",
+          cancelButtonText: "取消",
+          type: "warning"
+        }).then(function() {
+          return changeRoleStatus(row.roleId, row.status);
+        }).then(() => {
+          this.msgSuccess(text + "成功");
+        }).catch(function() {
+          row.status = row.status === "0" ? "1" : "0";
+        });
+    },
+    // 取消按钮
+    cancel() {
+      this.open = false;
+      this.reset();
+    },
+    // 取消按钮(数据权限)
+    cancelDataScope() {
+      this.openDataScope = false;
+      this.reset();
+    },
+    // 表单重置
+    reset() {
+      if (this.$refs.menu != undefined) {
+        this.$refs.menu.setCheckedKeys([]);
+      }
+      this.menuExpand = false,
+      this.menuNodeAll = false,
+      this.deptExpand = true,
+      this.deptNodeAll = false,
+      this.form = {
+        roleId: undefined,
+        roleName: undefined,
+        roleKey: undefined,
+        roleSort: 0,
+        status: "0",
+        menuIds: [],
+        deptIds: [],
+        menuCheckStrictly: true,
+        deptCheckStrictly: true,
+        remark: undefined
+      };
+      this.resetForm("form");
+    },
+    /** 搜索按钮操作 */
+    handleQuery() {
+      this.queryParams.pageNum = 1;
+      this.getList();
+    },
+    /** 重置按钮操作 */
+    resetQuery() {
+      this.dateRange = [];
+      this.resetForm("queryForm");
+      this.handleQuery();
+    },
+    // 多选框选中数据
+    handleSelectionChange(selection) {
+      this.ids = selection.map(item => item.roleId)
+      this.single = selection.length!=1
+      this.multiple = !selection.length
+    },
+    // 树权限(展开/折叠)
+    handleCheckedTreeExpand(value, type) {
+      if (type == 'menu') {
+        let chapterTree = this.menuOptions;
+        for (let i = 0; i < treeList.length; i++) {
+          this.$refs.menu.store.nodesMap[treeList[i].id].expanded = value;
+        }
+      } else if (type == 'dept') {
+        let chapterTree = this.deptOptions;
+        for (let i = 0; i < treeList.length; i++) {
+          this.$refs.dept.store.nodesMap[treeList[i].id].expanded = value;
+        }
+      }
+    },
+    // 树权限(全选/全不选)
+    handleCheckedTreeNodeAll(value, type) {
+      if (type == 'menu') {
+        this.$refs.menu.setCheckedNodes(value ? this.menuOptions: []);
+      } else if (type == 'dept') {
+        this.$refs.dept.setCheckedNodes(value ? this.deptOptions: []);
+      }
+    },
+    // 树权限(父子联动)
+    handleCheckedTreeConnect(value, type) {
+      if (type == 'menu') {
+        this.form.menuCheckStrictly = value ? true: false;
+      } else if (type == 'dept') {
+        this.form.deptCheckStrictly = value ? true: false;
+      }
+    },
+    /** 新增按钮操作 */
+    handleAdd() {
+      this.reset();
+      this.getMenuTreeselect();
+      this.open = true;
+      this.title = "添加角色";
+    },
+    /** 修改按钮操作 */
+    handleUpdate(row) {
+      this.reset();
+      const roleId = row.roleId || this.ids
+      const roleMenu = this.getRoleMenuTreeselect(roleId);
+      getRole(roleId).then(response => {
+        this.form = response.data;
+        this.open = true;
+        this.$nextTick(() => {
+          roleMenu.then(res => {
+            let checkedKeys = res.checkedKeys
+            checkedKeys.forEach((v) => {
+                this.$nextTick(()=>{
+                    this.$refs.menu.setChecked(v, true ,false);
+                })
+            })
+          });
+        });
+        this.title = "修改角色";
+      });
+    },
+    /** 选择角色权限范围触发 */
+    dataScopeSelectChange(value) {
+      if(value !== '2') {
+        this.$refs.dept.setCheckedKeys([]);
+      }
+    },
+    /** 分配数据权限操作 */
+    handleDataScope(row) {
+      this.reset();
+      const roleDeptTreeselect = this.getRoleDeptTreeselect(row.roleId);
+      getRole(row.roleId).then(response => {
+        this.form = response.data;
+        this.openDataScope = true;
+        this.$nextTick(() => {
+          roleDeptTreeselect.then(res => {
+            this.$refs.dept.setCheckedKeys(res.checkedKeys);
+          });
+        });
+        this.title = "分配数据权限";
+      });
+    },
+    /** 提交按钮 */
+    submitForm: function() {
+      this.$refs["form"].validate(valid => {
+        if (valid) {
+          if (this.form.roleId != undefined) {
+            this.form.menuIds = this.getMenuAllCheckedKeys();
+            updateRole(this.form).then(response => {
+              this.msgSuccess("修改成功");
+              this.open = false;
+              this.getList();
+            });
+          } else {
+            this.form.menuIds = this.getMenuAllCheckedKeys();
+            addRole(this.form).then(response => {
+              this.msgSuccess("新增成功");
+              this.open = false;
+              this.getList();
+            });
+          }
+        }
+      });
+    },
+    /** 提交按钮(数据权限) */
+    submitDataScope: function() {
+      if (this.form.roleId != undefined) {
+        this.form.deptIds = this.getDeptAllCheckedKeys();
+        dataScope(this.form).then(response => {
+          this.msgSuccess("修改成功");
+          this.openDataScope = false;
+          this.getList();
+        });
+      }
+    },
+    /** 删除按钮操作 */
+    handleDelete(row) {
+      const roleIds = row.roleId || this.ids;
+      this.$confirm('是否确认删除角色编号为"' + roleIds + '"的数据项?', "警告", {
+          confirmButtonText: "确定",
+          cancelButtonText: "取消",
+          type: "warning"
+        }).then(function() {
+          return delRole(roleIds);
+        }).then(() => {
+          this.getList();
+          this.msgSuccess("删除成功");
+        })
+    },
+    /** 导出按钮操作 */
+    handleExport() {
+      const queryParams = this.queryParams;
+      this.$confirm('是否确认导出所有角色数据项?', "警告", {
+          confirmButtonText: "确定",
+          cancelButtonText: "取消",
+          type: "warning"
+        }).then(() => {
+          this.exportLoading = true;
+          return exportRole(queryParams);
+        }).then(response => {
+          this.download(response.msg);
+          this.exportLoading = false;
+        })
+    }
+  }
+};
+</script>