{"version":3,"file":"paper.cb196776.mjs","sources":["../../../../pages/account/paper.vue"],"sourcesContent":["<template>\n  <NuxtLayout name=\"account\">\n    <div class=\"page-account-collect\">\n      <el-tabs v-model=\"tabType\" class=\"demo-tabs\" @tab-change=\"handleClick\">\n        <el-tab-pane v-for=\"(item, index) in data.tabsList\" :key=\"index\" :label=\"item.name\" :name=\"item.type\"></el-tab-pane>\n      </el-tabs>\n      <div class=\"category_wrapper\" v-show=\"tabType === '2'\">\n        <el-cascader\n          ref=\"cascader\"\n          v-model=\"data.questionCategoryId\"\n          :options=\"data.categoryList\"\n          :props=\"{\n            value: 'id',\n            label: 'categoryName',\n            children: 'childrenList',\n            checkStrictly: true,\n            emitPath: false,\n          }\"\n          filterable\n          clearable\n          placeholder=\"请选择试题分类\"\n          :show-all-levels=\"false\"\n          size=\"default\"\n          @change=\"handleChangeCategory\"\n        />\n      </div>\n      <div v-if=\"tabType === '2'\" class=\"question\">\n        <div class=\"flex_row\">\n          <div class=\"source_type_row\">\n            <div class=\"text\">错题来源：</div>\n            <div class=\"btn\" :class=\"{active: data.sourceType === 1}\" @click=\"handleChangeSourceType(1)\">课程中心</div>\n            <div class=\"btn\" :class=\"{active: data.sourceType === 3}\" @click=\"handleChangeSourceType(3)\">班级中心</div>\n            <div class=\"btn\" :class=\"{active: data.sourceType === 2}\" @click=\"handleChangeSourceType(2)\">试卷中心</div>\n          </div>\n          <div>\n            <span class=\"c_999 mgr20 pointer\" @click=\"handleClear\">清空错题</span>\n            <span class=\"c_999 pointer\" @click=\"handleSet\">移除设置</span>\n          </div>\n        </div>\n        <div class=\"row\" v-for=\"(value, key, index) in data.nameEnum\" :key=\"index\">\n          <div class=\"row_left\">\n            <img v-if=\"index === 0\" src=\"@/assets/images/all.svg\" />\n            <div\n              v-else\n              class=\"iconfont\"\n              :class=\"{\n                'icon-radio': index === 1,\n                'icon-checkbox': index === 2,\n                'icon-judge': index === 3,\n                'icon-fill': index === 4,\n                'icon-short': index === 5,\n              }\"\n            ></div>\n            <div class=\"name\">{{ data.nameEnum[key] }}</div>\n          </div>\n          <div class=\"row_right\">\n            <span class=\"right_text c_999\">共&nbsp;<span class=\"c_333\">{{ data.count[key] || 0 }}</span>&nbsp;题</span>\n            <div class=\"btns\">\n              <div class=\"view_answer_btn\" @click.stop=\"toProblem(index, data.count[key] || 0)\">查看答案</div>\n              <el-button type=\"primary\" @click=\"handleErrorPractice(index,  data.count[key] || 0)\">错题练习</el-button>\n            </div>\n          </div>\n        </div>\n      </div>\n      <div class=\"list\" v-if=\"tabType === '1'\">\n        <div class=\"flex_row\">\n          <div class=\"source_type_row\">\n            <div class=\"text\">试卷类型：</div>\n            <div class=\"btn\" :class=\"{active: data.practiceType === 1}\" @click=\"handleChangePracticeType(1)\">每日一练</div>\n            <div class=\"btn\" :class=\"{active: data.practiceType === 2}\" @click=\"handleChangePracticeType(2)\">章节练习</div>\n            <div class=\"btn\" :class=\"{active: data.practiceType === 3}\" @click=\"handleChangePracticeType(3)\">闯关练习</div>\n            <div class=\"btn\" :class=\"{active: data.practiceType === 4}\" @click=\"handleChangePracticeType(4)\">模拟考试</div>\n          </div>\n        </div>\n        <div v-loading=\"ctrl.loading\">\n          <div class=\"record_item\" v-for=\"(item, index) in data.recordList\" :key=\"index\">\n            <div>\n              <p class=\"font16 mgb10\">{{item.practiceName || item.paperName}}</p>\n              <p class=\"c_999\" v-if=\"data.practiceType < 4\">{{item.gmtModified}}&nbsp;&nbsp;&nbsp;已做{{item.practiceTitleCount}}/{{item.questionCount}}题</p>\n              <p class=\"c_999\" v-else>{{item.gmtModified}}&nbsp;&nbsp;&nbsp;已做{{item.examCount}}次</p>\n            </div>\n            <div class=\"btn pointer\" @click=\"goToView(item)\">前往查看</div>\n          </div>\n        </div>\n      </div>\n      <client-only>\n        <el-pagination\n          v-if=\"tabType === '1'\"\n          class=\"pagination\"\n          v-model:currentPage=\"data.pageCurrent\"\n          layout=\"prev, pager, next, jumper\"\n          :total=\"data.totalCount\"\n          background\n          hide-on-single-page\n          @current-change=\"handleCurrentChange\"\n        >\n        </el-pagination>\n      </client-only>\n      <remove-wrong v-model=\"ctrl.removeCtr.visible\" @close=\"handleCloseSet\"></remove-wrong>\n    </div>\n  </NuxtLayout>\n</template>\n\n<script setup>\nimport { ElMessageBox, ElMessage } from 'element-plus'\nimport {categoryLists} from \"~/api/system\";\nimport {errorQuestionCount, errorQuestionBatchDelete, practiceAuthOldPage, authPaperConfigOldPage} from '~/api/paper'\nimport removeWrong from '~/components/exam/removeWrong.vue'\nimport {userView} from '~/api/user'\nuseHead({\n  title:'我的试卷'\n});\nconst router = useRouter()\nconst route = useRoute()\nconst cascader = ref('')\nconst tabType = ref('1')\nconst data = reactive({\n  tabsList: [\n    {\n      name: '做题记录',\n      type: '1',\n    },\n    {\n      name: '错题集',\n      type: '2',\n    }\n  ],\n  pageCurrent: 1,\n  pageSize: 10,\n  totalCount: 0,\n  totalPage: 1,\n  categoryList: [],\n  sourceType: 1,\n  questionCategoryId: '',\n  nameEnum: {\n    allQuestionCount: '全部',\n    singleChoiceCount: '单选题',\n    multipleChoiceCount: '多选题',\n    judgmentCount: '判断题',\n    gapFillingCount: '填空题',\n    shortAnswerCount: '简答题'\n  },\n  count: {},\n  practiceType: 1,\n  recordList: []\n})\nconst ctrl = reactive({\n  loading: false,\n  removeCtr: {\n    visible: false,\n    questionType: ''\n  }\n})\n\nonMounted(() => {\n  categoryLists({categoryType: 3}).then(res => {\n    if(res) {\n      data.categoryList = res\n    }\n  })\n  tabType.value = route.query.type || '1'\n  data.sourceType = Number(route.query.sourceType) || 1\n  data.practiceType = Number(route.query.practiceType) || 1\n  data.questionCategoryId = route.query.questionCategoryId || ''\n  data.pageCurrent = 1\n  if (tabType.value === '2') {\n    getCollectionQuestionData()\n  }\n  if (tabType.value === '1') {\n    getData()\n  }\n})\nconst handleClick = (paneName) => {\n  if (paneName === '2') {\n    getCollectionQuestionData()\n  }\n  if (paneName === '1') {\n    getData()\n  }\n  router.replace({\n    path:'/account/paper',\n    query:{\n      type:paneName\n    }\n  })\n}\nconst handleCloseSet = () => {\n  ctrl.removeCtr.visible = false\n  if(ctrl.removeCtr.isJump) {\n    router.replace({\n      path: '/practice/error',\n      query: {\n        questionType: ctrl.removeCtr.questionType,\n        questionCategoryId: data.questionCategoryId,\n        sourceType: data.sourceType,\n        operateType: 1 //1：错题、2：收藏\n      }\n    })\n  }\n}\nconst handleSet = () => {\n  ctrl.removeCtr.isJump = false\n  ctrl.removeCtr.visible = true\n}\nconst handleClear = () => {\n  if(data.count['allQuestionCount'] === 0) {\n    ElMessage.error('当前已无更多错题')\n    return\n  }\n  const sourceName = data.sourceType === 1 ? '课程' : data.sourceType === 2 ? '试卷' : '班级'\n  let text = ''\n  if(cascader.value.getCheckedNodes().length === 0) {\n    text = `确定清空来源于【${sourceName}】的错题集吗？此操作不可逆，请谨慎操作。`\n  } else {\n    text =  `确定清空所属分类是【${cascader.value.getCheckedNodes()[0].text}】且是来源于【${sourceName}】的错题集吗？此操作不可逆，请谨慎操作。`\n  }\n  ElMessageBox.confirm(text, \"清空错题提示\", {\n    cancelButtonText: \"取消\",\n    confirmButtonText: \"确定\",\n    type: \"warning\",\n  }).then(() => {\n      errorQuestionBatchDelete({\n        operateType: 1,\n        questionCategoryId: data.questionCategoryId || '',\n        sourceType: data.sourceType\n      }).then(res => {\n        ElMessage.success(res)\n        getCollectionQuestionData()\n      })\n    })\n    .catch(() => {\n    });\n}\nconst handleChangeCategory = (val) => {\n  getCollectionQuestionData()\n}\nconst handleChangePracticeType = (type) => {\n  data.practiceType = type\n  getData()\n}\nconst handleChangeSourceType = (type) => {\n  data.sourceType = type\n  getCollectionQuestionData()\n}\n\nconst getCollectionQuestionData = () => {\n  errorQuestionCount({\n    operateType: 1, //1：错题、2：收藏\n    questionCategoryId: data.questionCategoryId || '',\n    sourceType:data.sourceType\n  }).then(res => {\n    if(res) {\n      data.count = res\n    }\n  })\n}\nconst handleErrorPractice = async (questionType, number) => {\n  if(number === 0) {\n    ElMessage.error('暂无更多试题')\n    return\n  }\n  const user = await userView();\n  if(user && user.promptSet) {\n    ctrl.removeCtr.questionType = questionType\n    ctrl.removeCtr.isJump = true\n    ctrl.removeCtr.visible = true\n    return\n  }\n  router.replace({\n    path: '/practice/error',\n    query: {\n      questionType,\n      questionCategoryId: data.questionCategoryId,\n      sourceType: data.sourceType,\n      operateType: 1 //1：错题、2：收藏\n    }\n  })\n}\nconst goToView = (row) => {\n  const text = row.practiceType ? 'practice' : 'paper'\n  router.push({\n    path: `/${text}/view`,\n    query: {\n      id: row.id\n    }\n  })\n}\nconst toProblem = (questionType, number) => {\n  if(number === 0) {\n    ElMessage.error('暂无更多试题')\n    return\n  }\n  router.replace({\n    path: '/practice/errorAnalysis',\n    query: {\n      questionType,\n      questionCategoryId: data.questionCategoryId,\n      sourceType: data.sourceType,\n      operateType: 1 //1：错题、2：收藏\n    }\n  })\n}\n\nconst handleCurrentChange = (val) => {\n  getData(val)\n  document.querySelector('#app').scrollTop = 150\n}\n\nconst getData = (page = 1) => {\n  ctrl.loading = true\n  const d = {\n    personalBool: true,\n    pageCurrent: data.pageCurrent,\n    pageSize: data.pageSize,\n    practiceType: data.practiceType\n  }\n  let method = practiceAuthOldPage\n  if(data.practiceType === 4) {\n    delete d.practiceType\n    method = authPaperConfigOldPage\n  }\n  method(d).then(res => {\n    data.recordList = res.list\n    data.pageCurrent = res.pageCurrent;\n    data.totalCount = res.totalCount;\n    data.totalPage = res.totalPage;\n    ctrl.loading = false\n  })\n}\n</script>\n\n<style lang=\"scss\">\n.page-account-collect {\n  position: relative;\n  .el-tabs__header {\n    margin: 0;\n  }\n  .el-tabs__nav-wrap {\n    padding: 0 30px;\n  }\n  .el-tabs__nav {\n    padding: 10px 0;\n  }\n}\n</style>\n<style lang=\"scss\" scoped>\n.list {\n  padding: 16px 30px;\n  .record_item {\n    padding: 20px 0;\n    display: flex;\n    justify-content: space-between;\n    align-items: center;\n    box-shadow: inset 0px -1px 0px #EBEEF5;\n    p {\n      width: 617px;\n      text-overflow: ellipsis;\n      display: -webkit-box;\n      -webkit-line-clamp: 1;\n      word-break: break-all;\n      -webkit-box-orient: vertical;\n      overflow: hidden;\n    }\n    .btn {\n      width: 100px;\n      height: 38px;\n      line-height: 38px;\n      text-align: center;\n      background: #3D7FFF;\n      border-radius: 5px;\n      color: #FFFFFF;\n    }\n  }\n}\n.category_wrapper {\n  position: absolute;\n  top: 14px;\n  right: 36px;\n}\n.question {\n  padding: 16px 30px;\n  .row {\n    height: 64px;\n    display: flex;\n    justify-content: space-between;\n    align-items: center;\n    border-radius: 5px;\n    margin-top: 24px;\n    .el-button {\n      font-size: 14px;\n      color: #999999;\n      border-radius: 5px;\n    }\n    &:hover button {\n      display: block;\n    }\n    &:last-child {\n      border: 0;\n    }\n    .row_left {\n      display: flex;\n      justify-content: center;\n      align-items: center;\n      height: 64px;\n      width: 180px;\n      background: rgba(242, 243, 245, 0.5);\n      border-top-left-radius: 5px;\n      border-bottom-left-radius: 5px;\n      img,\n      .iconfont {\n        margin-right: 6px;\n        font-size: 20px;\n        cursor: default;\n      }\n      .name {\n        font-style: normal;\n        font-weight: 400;\n        font-size: 16px;\n        color: #333333;\n      }\n    }\n    .row_right {\n      width: calc(100% - 180px);\n      display: flex;\n      align-items: center;\n      justify-content: space-between;\n      height: 64px;\n      border-top-right-radius: 5px;\n      border-bottom-right-radius: 5px;\n      border: 1px solid #ebeef5;\n      .right_text {\n        padding-left: 24px;\n      }\n      .btns {\n        display: flex;\n        flex-direction: row;\n        align-items: center;\n        column-gap: 16px;\n      }\n      .view_answer_btn {\n        width: 100px;\n        height: 38px;\n        text-align: center;\n        line-height: 38px;\n        border: 1px solid #3D7FFF;\n        border-radius: 5px;\n        color: #3D7FFF;\n        cursor: pointer;\n      }\n      .el-button {\n        display: inline-block;\n        width: 100px;\n        height: 38px;\n        color: #ffffff;\n        margin-right: 10px;\n      }\n    }\n  }\n}\n.flex_row {\n  display: flex;\n  justify-content: space-between;\n  align-items: center;\n}\n.source_type_row {\n  display: flex;\n  align-items: center;\n  font-size: 14px;\n  .text {\n    color: #999999;\n  }\n  .btn {\n    padding: 5px 10px;\n    border: 1px solid #D9D9D9;\n    border-radius: 5px;\n    margin-right: 12px;\n    cursor: pointer;\n  }\n  .active {\n    background: #3D7FFF;\n    border: 1px solid #3D7FFF;\n    color: #FFFFFF;\n  }\n}\n.cgray {\n  color: #999;\n  display: flex;\n  .type {\n    margin-right: 15px;\n    color: #999999;\n    font-size: 14px;\n    font-weight: 400;\n    padding-right: 15px;\n    position: relative;\n    display: flex;\n    align-items: center;\n    &:first-child:after {\n      content: '';\n      background: #becadb;\n      height: 10px;\n      width: 1px;\n      padding-right: 1px;\n      right: 0;\n      position: absolute;\n    }\n  }\n}\n.cred {\n  color: #f61818;\n}\n.cgreen {\n  color: #58b85c;\n}\n.cancel_collect,\n.cancel_collect:visited,\n.cancel_collect:focus {\n  color: #ffffff;\n  border-radius: 5px;\n}\n.cancel_collect:hover {\n  background: #2256f6;\n  color: #ffffff;\n}\n.have {\n  color: #999;\n  margin-top: 5px;\n}\n.have_item {\n  padding-right: 12px;\n}\n.have_item + .have_item {\n  padding-left: 10px;\n  position: relative;\n}\n.have_item + .have_item:before {\n  width: 0;\n  height: 10px;\n  padding-left: 1px;\n  background-color: #becadb;\n  content: '';\n  position: absolute;\n  left: 0;\n  top: 25%;\n}\n</style>\n"],"names":["useHead","title","router","useRouter","route","useRoute","cascader","ref","tabType","data","reactive","tabsList","name","type","pageCurrent","pageSize","totalCount","totalPage","categoryList","sourceType","questionCategoryId","nameEnum","allQuestionCount","singleChoiceCount","multipleChoiceCount","judgmentCount","gapFillingCount","shortAnswerCount","count","practiceType","recordList","ctrl","loading","removeCtr","visible","questionType","onMounted","categoryLists","categoryType","then","res","value","query","Number","getCollectionQuestionData","getData","handleClick","paneName","replace","path","handleCloseSet","isJump","operateType","handleSet","handleClear","ElMessage","error","sourceName","text","getCheckedNodes","length","ElMessageBox","confirm","cancelButtonText","confirmButtonText","errorQuestionBatchDelete","success","catch","handleChangeCategory","val","handleChangePracticeType","handleChangeSourceType","errorQuestionCount","handleCurrentChange","document","querySelector","scrollTop","page","d","personalBool","method","practiceAuthOldPage","authPaperConfigOldPage","list","async","number","user","userView","promptSet","row","push","id"],"mappings":"s+BA6GAA,EAAA,CACAC,MAAA,SAEA,MAAAC,EAAAC,IACAC,EAAAC,IACAC,EAAAC,EAAA,IACAC,EAAAD,EAAA,KACAE,EAAAC,EAAA,CACAC,SAAA,CACA,CACAC,KAAA,OACAC,KAAA,KAEA,CACAD,KAAA,MACAC,KAAA,MAGAC,YAAA,EACAC,SAAA,GACAC,WAAA,EACAC,UAAA,EACAC,aAAA,GACAC,WAAA,EACAC,mBAAA,GACAC,SAAA,CACAC,iBAAA,KACAC,kBAAA,MACAC,oBAAA,MACAC,cAAA,MACAC,gBAAA,MACAC,iBAAA,OAEAC,MAAA,CAAA,EACAC,aAAA,EACAC,WAAA,KAEAC,GAAArB,EAAA,CACAsB,SAAA,EACAC,UAAA,CACAC,SAAA,EACAC,aAAA,MAIAC,GAAA,KACAC,EAAA,CAAAC,aAAA,IAAAC,MAAAC,IACAA,IACA/B,EAAAS,aAAAsB,EACA,IAEAhC,EAAAiC,MAAArC,EAAAsC,MAAA7B,MAAA,IACAJ,EAAAU,WAAAwB,OAAAvC,EAAAsC,MAAAvB,aAAA,EACAV,EAAAoB,aAAAc,OAAAvC,EAAAsC,MAAAb,eAAA,EACApB,EAAAW,mBAAAhB,EAAAsC,MAAAtB,oBAAA,GACAX,EAAAK,YAAA,EACA,MAAAN,EAAAiC,OACAG,KAEA,MAAApC,EAAAiC,OACAI,IACA,IAEA,MAAAC,GAAAC,IACA,MAAAA,GACAH,KAEA,MAAAG,GACAF,KAEA3C,EAAA8C,QAAA,CACAC,KAAA,iBACAP,MAAA,CACA7B,KAAAkC,IAEA,EAEAG,GAAA,KACAnB,GAAAE,UAAAC,SAAA,EACAH,GAAAE,UAAAkB,QACAjD,EAAA8C,QAAA,CAC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