From 352c53cc5456abfe5b4fbd5d35568980afd602ce Mon Sep 17 00:00:00 2001 From: 梁保满 Date: Tue, 19 Dec 2023 17:05:27 +0800 Subject: [PATCH] 上传word回传数据 --- package.json | 5 +++-- src/api/apis/apis.js | 18 ++++++++++++++++++ src/api/urls/apis.js | 8 ++++++++ src/main.js | 1 + src/mock/index.js | 44 ++++++++++++++++++++++++++++++++++++++++++++ src/views/basic/setUp/archived.vue | 117 ++++++++++++++++++++++++++++++++++++++------------------------------------------------------------------------------- src/views/examinationPaper/add.vue | 1189 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- src/views/examinationPaper/index.vue | 241 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++-------------------------------------------------------------------------------------- 8 files changed, 711 insertions(+), 912 deletions(-) create mode 100644 src/mock/index.js diff --git a/package.json b/package.json index 814e581..02c8f96 100755 --- a/package.json +++ b/package.json @@ -21,8 +21,9 @@ "vue": "^2.6.11", "vue-i18n": "^8.4.0", "vue-router": "^3.5.1", + "vuedraggable": "^2.24.3", "vuex": "^3.6.2", - "vuedraggable": "^2.24.3" + "mockjs": "1.1.0" }, "devDependencies": { "@vue/cli-plugin-babel": "~4.5.0", @@ -45,4 +46,4 @@ "sass-loader": "^7.1.0", "vue-template-compiler": "^2.5.2" } -} +} \ No newline at end of file diff --git a/src/api/apis/apis.js b/src/api/apis/apis.js index fa4985a..5418797 100644 --- a/src/api/apis/apis.js +++ b/src/api/apis/apis.js @@ -1604,4 +1604,22 @@ export default { }); }, + + /** v1.5 */ + // 教师/个人版查询答题卡列表的分享数量 + paperShareCount(data) { + return service({ + url: setUpUrls.paperShareCount, + method: "POST", + data + }); + }, + // 教师/个人版导入备题组卷Word文档 + paperWordUpload(data) { + return service({ + url: setUpUrls.paperWordUpload, + method: "POST", + data + }); + }, }; diff --git a/src/api/urls/apis.js b/src/api/urls/apis.js index 18587c7..be7bfa2 100644 --- a/src/api/urls/apis.js +++ b/src/api/urls/apis.js @@ -416,4 +416,12 @@ export default { exportExamMultiReport: "/api_html/teaching/exportExamMultiReport", //查询即时测多班默认等级列表 defaultLevels: "/api_html/teaching/defaultLevels", + + + + /** v1.5 */ + //教师/个人版查询答题卡列表的分享数量 + paperShareCount: "/api_html/common/paper/paperShareCount", + //教师/个人版导入备题组卷Word文档 + paperWordUpload: "/api_html/common/paper/upload", } diff --git a/src/main.js b/src/main.js index b36367a..51b1cce 100755 --- a/src/main.js +++ b/src/main.js @@ -28,6 +28,7 @@ Vue.use(permission) NProgress.inc(0.2) NProgress.configure({ easing: "ease", speed: 500, showSpinner: false }) +import "@/mock/index.js" Array.prototype.remove = function (val) { var index = this.indexOf(val); diff --git a/src/mock/index.js b/src/mock/index.js new file mode 100644 index 0000000..92b0be2 --- /dev/null +++ b/src/mock/index.js @@ -0,0 +1,44 @@ +import Mock from "mockjs" +Mock.mock( + "/api_html/common/paper/paperShareCount", { + info: "success", + status: 0, + data: { + myCount: 24, + grade: 30 + } +} +) +Mock.mock( + "/api_html/common/paper/upload", { + info: "success", + status: 0, + data: { + "name": "@cname", + "id|+1": 11, + "questionList": [ + { + "examQuestionId|+1": 0, + "questionId|+1": 1, + "questionTitle": "@cname", + "questionType|1-4": 1, + "score|1-2": 1, + "partScore|0.5-1": 0.5, + "answerOptions": "A,B,C,D", + "correctAnswer|1": ["A", "B", "C", "D"], + "subQuestions": [ + { + "questionType|1-4": 1, + "score": 1, + "partScore": 0, + "selectNum": 4, + "answerOptions": "A,B,C,D", + "correctAnswer|1": ["A", "B", "C", "D"], + "screenshot": "xxxx", + } + ] + } + ] + } +} +) \ No newline at end of file diff --git a/src/views/basic/setUp/archived.vue b/src/views/basic/setUp/archived.vue index 7e1b9be..2edd079 100644 --- a/src/views/basic/setUp/archived.vue +++ b/src/views/basic/setUp/archived.vue @@ -16,18 +16,8 @@
  • 选择分班年级: - - + +
    @@ -36,18 +26,11 @@

    - 全选 + 全选

    - - {{ + + {{ item.className }} @@ -56,39 +39,23 @@

    - 请谨慎操作,班级归档后,学生解除班级关系且相关老师任课信息将不存在。 + 请谨慎操作,班级归档后,学生解除班级关系且相关老师任课信息将不存在。

    取消 - - 归档 + + 归档
  • - +

    通过Excel名单导入学生名单模板,点击 - 导出未分配学生 + 导出未分配学生

    @@ -96,17 +63,10 @@
  • - +

    通过Excel名单导入任课老师名单模板,点击 - 导出未分配教师。 + 导出未分配教师

    @@ -114,14 +74,8 @@
  • - 恭喜您,分班已经完成,分班后老师第一次上课时注意事项: + 恭喜您,分班已经完成,分班后老师第一次上课时注意事项:

    1、点击授课端的设置—应用设置—初始化设置—重新选择绑定班级。 @@ -135,21 +89,8 @@

  • 上一步 - 下一步完成 + 下一步完成
  • @@ -183,8 +124,8 @@ export default { handleCheckAllChange(val) { this.classIds = val ? this.classList.map((item) => { - return item.id; - }) + return item.id; + }) : []; this.isIndeterminate = false; }, @@ -315,59 +256,73 @@ export default { padding: 20px; box-sizing: border-box; } + .step { margin-bottom: 40px; } + .form-item { width: 70%; display: flex; margin: 0 auto 20px; + .check-box { flex: 1; } + .all-check { margin-right: 30px; } + &:first-of-type { .s-txt { line-height: 40px; } } + .s-txt { width: 160px; flex-shrink: 0; } + .sel { :deep(.el-input__inner) { border-radius: 20px; } } + :deep(.el-checkbox) { margin-bottom: 12px; } + .tips { display: flex; align-items: center; color: #666; } + .el-icon-warning { font-size: 20px; color: #ec7f8c; margin-right: 10px; } } + .btn-box { width: 80%; margin: 60px auto 0; display: flex; justify-content: flex-end; + .btn { margin: 0 10px; } } + .step-item { text-align: center; } + .step-item2 { width: 100%; display: flex; @@ -375,19 +330,23 @@ export default { align-items: center; color: #000; font-weight: 500; + .p2 { font-size: 16px; margin: 0 0 20px -68px; + .btn { margin-right: 14px; } } + .p1 { width: 450px; text-align: left; margin-bottom: 20px; } } + :deep(.down-txt) { justify-content: center; padding-left: 0; diff --git a/src/views/examinationPaper/add.vue b/src/views/examinationPaper/add.vue index 3df8442..9205513 100644 --- a/src/views/examinationPaper/add.vue +++ b/src/views/examinationPaper/add.vue @@ -6,102 +6,44 @@
    - + - +
    - + - + - {{ item.typeName }} + {{ + item.typeName }} - + - - - + + + - {{ item.label }} + {{ + item.label }} - + - + 任课班级分享 全年级分享 @@ -109,52 +51,24 @@
    - 取消 - 下一步 + 取消 + 下一步
    - +

    - + - + - - + + @@ -163,25 +77,13 @@

    - + - + @@ -192,438 +94,223 @@

    -
    -
    -

    - - - - {{ setBigNum(index) }}、 - - - - - 共:{{ question.subQuestions.length }}题 - 共:{{ setScore(question) }}分 -

    - -
      -
    • -
      题号
      -
      题型
      -
      分数
      -
      漏选得分
      -
      选项设置
      -
      操作
      -
    • -
    • -
      {{ setNum(index, indexs) }}
      -
      - - - - - - -
      -
      - -
      -
      -

      --

      - -
      -
      -

      --

      -

      - - -

      -

      - {{ option }} -

      -

      - {{ option }} -

      -

      +

      +
      +

      + + + + {{ setBigNum(index) }}、 + + + + + 共:{{ question.subQuestions?.length }}题 + 共:{{ setScore(question) }}分 +

      + +
        +
      • +
        题号
        +
        题型
        +
        分数
        +
        漏选得分
        +
        选项设置
        +
        操作
        +
      • +
      • +
        {{ setNum(index, indexs) }}
        +
        + + + + + + +
        +
        + +
        +
        +

        --

        + +
        +
        +

        --

        +

        + + +

        +

        + {{ option }} +

        +

        + {{ option }} +

        +

        - - -

        -
        -
        - - - -
        -
      • -
      • -
        添加
        -
        - - - - - + " class="answer-box answer-box2"> + + +

        +
        +
        + + + +
        +
      • +
      • +
        添加
        +
        + + + + + + +
        +
        +
        +
        +
        +
      • +
      +
      +
      +
      +

      + + 添加大题 +

      +
      +
      + 取消 + 上一步 + 下一步 +
      + +
      + + + + + + + + + + + -
      -
      -
      -
      -
      -
    • -
    -
    -
    -
    -

    - - 添加大题 -

    -
    -
    - 取消 - 上一步 - 下一步 -
    - -
    - - - - - - - - - - - - - - - - - + + + - - - - - - - - - + + + + + + + + + -
    -

    - +

    +

    + - -

    -

    -

    {{ form.title }}

    卷面总分:{{ allScore }}分

    -
    +

    {{ setBigNum(index) }}、 {{ question.questionTitle }} @@ -638,21 +325,12 @@

    漏选得分
    选项设置
    -
  • -

    - 批量设置答案 +

  • +

    + 批量设置答案

    @@ -662,158 +340,77 @@ {{ setSubPro(subQuestions.questionType) }}
    - +

    --

    - +

    --

    - - + +

    - {{ option }} + {{ option }}

    - {{ option }} + {{ option }}

  • - +

    请点击选项按钮设置答案,多选题题目之间用“,”隔开,若添加5道题:“AC,AD,BD,AC,CD”

    {{ setSubPro(formAns.qusType) }}:

    - - + @input="setAllAnswer($event, formAns.qusType)"> +

    - x - ac + x + ac

    - 取消 + 取消 上一步 保存
    + +
    + + + {{ + stem.screenshot ? "重新上传" : "选择照片" + }} + +
    +
    + 关闭弹窗 +
    +
    @@ -857,7 +466,7 @@ export default { allScore: function () { let score = 0; this.form.questionList.map((item) => { - score += item.subQuestions.reduce((a, b) => { + score += item.subQuestions?.reduce((a, b) => { return a + Number(b.score ? b.score : 0); }, 0); }, 0); @@ -941,6 +550,15 @@ export default { ], rightOptions: ["A", "B", "C", "D", "E", "F", "G", "H", "I", "J"], addSubQuestionsType: "", + + //v1.5 + isUpload: false, + dialogStem: false, //截图开关 + stem: { + index: 0, //大题位置 + indexs: 0, //小题位置 + screenshot: "", //题干图片地址 + }, }; }, async created() { @@ -954,6 +572,13 @@ export default { ]; await this._GradeList(); } + this.isUpload = this.$route.query.isUpload || false + if (this.isUpload) { + let params = this.$route.query.params && JSON.parse(this.$route.query.params) || null + this.form.title = params?.name + this.form.id = params?.id + this.formatData(params) + } await this._QuerySubjectList(this.gradeList[0]); await this._TypeList(); if (this.type == 2) { @@ -961,11 +586,41 @@ export default { } }, methods: { - + + // v1.5 + //上传截图 + openStem(obj, index, indexs) { + this.stem.index = index; + this.stem.indexs = indexs; + if (type == 1) { + this.stem.screenshot = obj.screenshot || ""; + } else { + this.stem.screenshot = ""; + } + this.dialogStem = true; + }, + //图片上传成功 + upSuccess(res, file) { + if (res && res.status == 0) { + this.stem.screenshot = res.data.url; + this.form.questionList[this.stem.index].subQuestions[this.stem.indexs][ + keys + ] = this.stem.screenshot; + this.$message.success("上传成功"); + } else { + this.$message.error(res.info); + } + }, + + upError(res) { + this.$message.error("上传失败"); + }, + //end + linkBack() { this.$confirm( (this.type == 2 ? "修改复制的" : "组建的") + - "答题卡未保存,确认退出吗?", + "答题卡未保存,确认退出吗?", "提示", { confirmButtonText: "取消", @@ -978,7 +633,7 @@ export default { type: "warning", } ) - .then(() => {}) + .then(() => { }) .catch(() => { this.$router.push({ path: "/examinationPaper", @@ -1022,9 +677,9 @@ export default { }, setNums(ques) { let lengths = 0; - let subArr = ques.filter((item) => { + let subArr = ques?.filter((item) => { return !!item.questionType; - }); + }) || []; lengths = subArr.length; return lengths; }, @@ -1169,8 +824,8 @@ export default { this.formAns.answerList[subNum - i] == "✓" ? 1 : this.formAns.answerList[subNum - i] == "✗" - ? 2 - : ""; + ? 2 + : ""; } this.form.questionList[this.formAns.listIndex].subQuestions[ EndIndex - i @@ -1244,7 +899,7 @@ export default { }, backStep1() { this.formatQuestionList(); - this.step = 1; + this.step = this.isUpload ? 0 : 1 }, setStep1() { if (this.subjectList.length == 0) { @@ -1269,7 +924,7 @@ export default { //添加题目ID、序号 this.form.questionList.map((item, index) => { item.questionType = 0; - item.subQuestions.map((items, indexs) => { + item.subQuestions?.map((items, indexs) => { items.questionId = this.setNum(index, indexs); items.questionIndex = this.setNum(index, indexs); }); @@ -1278,7 +933,7 @@ export default { this.form.questionList?.map((item) => { let types = [{}]; let addndex = 0; - item.subQuestions.map((sub, index) => { + item.subQuestions?.map((sub, index) => { if (!!sub.questionType) { if ( sub.questionType == types[addndex].qusType && @@ -1323,7 +978,7 @@ export default { }); for (let i = 0; i < types.length; i++) { if (types[i].subNum >= 5) { - item.subQuestions.splice( + item.subQuestions?.splice( types[i].index + i + 1, 0, deepClone(types[i]) @@ -1339,11 +994,11 @@ export default { for (let i = 0; i < this.form.questionList.length; i++) { for ( let j = 0; - j < this.form.questionList[i].subQuestions.length; + j < this.form.questionList[i].subQuestions?.length; j++ ) { - if (this.form.questionList[i].subQuestions[j].qusType) { - this.form.questionList[i].subQuestions.splice(j, 1); + if (this.form.questionList[i].subQuestions[j]?.qusType) { + this.form.questionList[i].subQuestions?.splice(j, 1); } } } @@ -1391,8 +1046,8 @@ export default { this.questionForm.answerList[i] == "✓" ? 1 : this.questionForm.answerList[i] == "✗" - ? 2 - : ""; + ? 2 + : ""; } else if (questionsOptions.questionType == 3) { answer = this.questionForm.answerList.split(",")[i] || ""; } else if (questionsOptions.questionType == 2) { @@ -1415,7 +1070,7 @@ export default { this.form.questionList[index].subQuestions.splice(subIndex, 1); }, setScore(question) { - let score = question.subQuestions.reduce((a, b) => { + let score = question.subQuestions?.reduce((a, b) => { return a + (b.score ? b.score : 0); }, 0); return Number(score).toFixed(2); @@ -1446,7 +1101,7 @@ export default { questionsOptions.selectNum = 0; break; } - question.subQuestions.push(questionsOptions); + question.subQuestions ? question.subQuestions.push(questionsOptions) : question.subQuestions = [(questionsOptions)]; this.addSubQuestionsType = ""; } }, @@ -1600,15 +1255,6 @@ export default { let formDatas = deepClone(this.form); for (let i = 0; i < formDatas.questionList.length; i++) { delete formDatas.questionList[i].show; - for (let j = 0; j < formDatas.questionList[i].subQuestions; j++) { - if (!!formDatas.questionList[i].subQuestions[j].answerScreenshotSrc) { - delete formDatas.questionList[i].subQuestions[j] - .answerScreenshotSrc; - } - if (!!formDatas.questionList[i].subQuestions[j].screenshotSrc) { - delete formDatas.questionList[i].subQuestions[j].screenshotSrc; - } - } } let addPaper = this.role == "ROLE_PERSONAL" @@ -1668,7 +1314,7 @@ export default { }, async _QuerySubjectList(grade) { //查询科目列表 - if (!grade) { + if (!grade && this.role != "ROLE_PERSONAL") { return; } let query = {}; @@ -1707,56 +1353,56 @@ export default { if (status == 0) { this.form.title = data.title + "_副本"; this.form.tagId = data.tagId === 0 ? "" : data.tagId; - if (this.subjectList.length) { - this.subjectList.map((item) => { - if (item.label == data.subjectName) { - this.form.subjectName = item.value; + + this.formatData(data) + } else { + this.$message.error(info); + } + }, + + formatData(data) { + if (this.subjectList.length) { + this.subjectList.map((item) => { + if (item.label == data.subjectName) { + this.form.subjectName = item.value; + } + }); + } else { + this.form.subjectName = ""; + } + this.form.examsDuration = data.examsDuration; + if (this.role != "ROLE_PERSONAL") { + this.form.sharingType = data.sharingType; + if (this.gradeList.length) { + this.gradeList.map((item) => { + if (item == data.gradeName) { + this.form.gradeName = data.gradeName; } }); } else { - this.form.subjectName = ""; + this.form.gradeName = ""; } - this.form.examsDuration = data.examsDuration; - if (this.role != "ROLE_PERSONAL") { - this.form.sharingType = data.sharingType; - if (this.gradeList.length) { - this.gradeList.map((item) => { - if (item == data.gradeName) { - this.form.gradeName = data.gradeName; - } - }); - } else { - this.form.gradeName = ""; - } - } - this.form.questionList = data.questionList?.map((item) => { - let subQuestions = - item.subQuestions?.map((items) => { - return { - questionType: items.questionType, - score: items.score, - partScore: items.partScore, - selectNum: items.answerOptions.split(",").length, - answerOptions: items.answerOptions || "A,B,C,D", - correctAnswer: items.correctAnswer, - screenshot: items.screenshot || "", - screenshotSrc: items.screenshot || "", - answerScreenshot: items.answerScreenshot || "", - answerScreenshotSrc: items.answerScreenshot || "", - difficultyFactor: items.difficultyFactor || "", //题目难度 - knowledge: items.knowledge || null, //知识点 - }; - }) || []; - return { - questionTitle: item.questionTitle, - subQuestions: subQuestions, - show: false, - }; - }); - } else { - this.$message.error(info); } - }, + this.form.questionList = data.questionList?.map((item) => { + let subQuestions = + item.subQuestions?.map((items) => { + return { + questionType: items.questionType, + score: items.score, + partScore: items.partScore, + selectNum: items.answerOptions.split(",").length, + answerOptions: items.answerOptions || "A,B,C,D", + correctAnswer: items.correctAnswer, + screenshot: items.screenshot || "", + }; + }) || []; + return { + questionTitle: item.questionTitle, + subQuestions: subQuestions, + show: false, + }; + }); + } }, }; @@ -1765,24 +1411,30 @@ export default { .red { color: #f30; } + .qs-options { flex: 1; + .ipt { margin-bottom: 5px; } + .answer-box { .answer-s { cursor: pointer; user-select: none; margin-bottom: 10px; + &:first-of-type { margin-left: 0; } } } + .answer-box2 { margin-bottom: 10px; } + .delButton { text-indent: -9999999px; border-color: #ff6868; @@ -1790,9 +1442,11 @@ export default { background-size: 19px; color: transparent; } + .answer-s.ac { border: none; } + .ac { border-color: #ff6868; background: #ff6868; @@ -1803,6 +1457,7 @@ export default { .sel2 { width: 480px; } + .set-ans-btn { width: 100%; padding: 10px 0 10px 630px; @@ -1810,23 +1465,28 @@ export default { border-right: 1px solid #e2e2e2; border-bottom: 1px solid #e2e2e2; } + .content-box { width: 100%; height: 100%; overflow-y: auto; } + .content { width: 100%; box-sizing: border-box; padding: 0 24px; + .ml-20 { margin-left: 20px; } + .btn-box { text-align: right; margin-left: 140px; } } + .dia-content { .dia-tit { font-size: 20px; @@ -1834,27 +1494,33 @@ export default { font-weight: 700; text-align: center; } + .add-type { width: 100%; margin-bottom: 10px; + .js-set { margin: 2.5px 10px 0 0; font-size: 14px; } } + .add-btn { margin-left: 20px; } } + .el-message-box { :deep(.el-button--default) { color: #fff; } } + .add-box { display: flex; justify-content: center; align-items: center; + .add-question { display: flex; justify-content: center; @@ -1863,84 +1529,103 @@ export default { font-weight: bolder; padding: 2px; cursor: pointer; + .s1 { margin-left: 6px; } + :deep(.el-icon-plus) { font-size: 24px; font-weight: 900; } + :deep(.el-button--mini.is-circle) { padding: 3px; } } } + .dialog-footer { text-align: center; + :deep(.el-button) { border-radius: 20px; padding: 8px 20px 7px; margin: 0 12px; } } + .question-box { margin-bottom: 20px; } + .question-title { line-height: 40px; display: flex; align-items: center; margin-bottom: 12px; + .m20 { margin: 0 20px; } + .ipt { width: 300px; margin: 0 16px 0 10px; + :deep(.el-input__inner) { border-radius: 20px; border-color: #667ffd; background: rgba($color: #667ffd, $alpha: 0.05); } } + .delete { margin-right: 8px; } + .title-txt { margin-right: 20px; font-size: 16px; font-weight: 700; } + .el-icon-caret-right { font-size: 24px; color: #888; transition: all 0.4s; margin-right: 12px; cursor: pointer; + &.active { transform: rotate(90deg); } } } + .questions-ul { border-left: 1px solid #e2e2e2; border-top: 1px solid #e2e2e2; } + .el-input-number { width: 140px; } + .answer-title { text-align: center; font-size: 20px; color: #333; font-weight: 700; padding-bottom: 20px; + .totals { font-size: 16px; color: #888; font-weight: normal; } } + .answer-box { .answer-s { display: inline-block; @@ -1953,6 +1638,7 @@ export default { color: #333; text-align: center; line-height: 30px; + &.active { background: #5e78fa; border-color: #5e78fa; @@ -1960,6 +1646,7 @@ export default { } } } + .qs-options { .answer-s { display: inline-block; @@ -1973,6 +1660,7 @@ export default { text-align: center; line-height: 30px; cursor: pointer; + &.active { background: #5e78fa; border-color: #5e78fa; @@ -1980,11 +1668,13 @@ export default { } } } + .sub-questions { width: 100%; display: flex; border-bottom: 1px solid #e2e2e2; - & > div { + + &>div { min-height: 40px; padding: 5px; flex-shrink: 0; @@ -1993,30 +1683,38 @@ export default { justify-content: center; align-items: center; } + .qs-num { width: 70px; } + .qs-type { width: 160px; } + .qs-score, .qs-partScore { width: 160px; } + .qs-options { flex: 1; } + .qs-set { width: 60px; } + .qs-options2 { text-align: left; justify-content: flex-start; padding-left: 20px; + .answer-s { cursor: pointer; } } + :deep(.el-select) { .el-input__inner { border-radius: 20px; @@ -2026,6 +1724,7 @@ export default { line-height: 32px; background: rgba($color: #667ffd, $alpha: 0.05); } + .el-input__icon { line-height: 32px; } diff --git a/src/views/examinationPaper/index.vue b/src/views/examinationPaper/index.vue index 1ec108e..402d088 100644 --- a/src/views/examinationPaper/index.vue +++ b/src/views/examinationPaper/index.vue @@ -38,14 +38,13 @@ - + - - + +
    @@ -53,63 +52,72 @@ 回收站内已有{{ archivedTotal }}份答题卡, 点击查看>>

    - -
      -
    • -
      -

      -

      {{ item.id }}

      -
      -
      -

      - {{ item.title }} - {{ item.tag }} -

      -

      - 总题数:{{ item.questionNum }} - | - 预计时长:{{ item.examsDuration }} - | - -

      -

      - {{ item.realName }}|{{ item.modifiedTime }} -

      -
      -
      - - - - - - - 修改分享范围 - 复制 - 放入回收站 - - -
      -
    • -
    -
    - - +
    +

    + 我自编的 ({{ totalCount.my + }}) + 年级共享的 ({{ totalCount.share + }}) +

    +
      +
    • +
      +

      +

      {{ item.id }}

      +
      +
      +

      + {{ item.title }} + {{ item.tag }} +

      +

      + 总题数:{{ item.questionNum }} + | + 预计时长:{{ item.examsDuration }} + | + +

      +

      + {{ item.realName }}|{{ item.modifiedTime }} +

      +
      +
      + + + + + + + 修改分享范围 + 复制 + 放入回收站 + + +
      +
    • +
    +
    + + +
    +
    - + + @@ -125,7 +133,7 @@
    - +

    第一步:导出菁优网试卷或 模板下载 。 @@ -154,6 +162,7 @@ export default { classId: "", subjectName: "", title: "", + type: 1, //试卷类型 }, classList: [], subjectList: [], @@ -173,9 +182,13 @@ export default { size: 20, // v1.5 - diaUp: false, + totalCount: {//数量统计 + my: 0, + share: 0, + }, + diaUp: false,//上传word弹窗开关 examinationPaperType: 1,//题型类型 - url: "xxxxx",//上传文档地址 + url: "/api_html/common/paper/upload",//上传文档地址 }; }, async created() { @@ -184,13 +197,14 @@ export default { this.$store.getters.info.showRole || this.$store.getters.info.permissions[0].role; this.userName = this.$store.getters.info.name || ""; - // this._QueryClassList2() - // await this._QueryClassList(); - // if (!this.query.classId) { - // return; - // } - // await this._QuerySubjectList(); - // this._QueryData(); + this._QueryClassList2() + await this._QueryClassList(); + if (!this.query.classId) { + return; + } + await this._QuerySubjectList(); + this._QueryData(); + this._QueryTotal(); }, methods: { refreshStic() { @@ -222,8 +236,7 @@ export default { }, }); }, - handleDropdownClick(value, item) { - //更多 + handleDropdownClick(value, item) {//更多 const that = this; switch (value) { case 1: @@ -246,8 +259,8 @@ export default { this.page = page; this._QueryData(this.query.title); }, + //修改分享范围 async saveShare() { - //修改分享范围 const { data, status, info } = await this.$request.modifyPaper({ paperId: this.shareForm.id, sharingType: this.shareForm.sharingType, @@ -262,8 +275,8 @@ export default { this.$message.error(info); } }, + //归档 async recovery(item) { - //归档 let modifyPaper = this.role == "ROLE_PERSONAL" ? this.$request.pModifyPaper @@ -273,17 +286,29 @@ export default { status: 2, }); if (status === 0) { - let type = this.query.title ? 1 : 0; + let type = this.query.title ? true : false; this.page = 1; this._QueryData(type); } else { this.$message.error(info); } }, + //根据试卷名称查找 + async getData(bool) { + this._QueryData(bool); + this._QueryTotal(); + }, //切换班级 async changClazz() { await this._QuerySubjectList(); this._QueryData(false); + this._QueryTotal(); + }, + //切换类型 + async changType(type) { + this.query.type = type + this.page = 1; + this._QueryData(false); }, // 查找班级 async _QueryClassList2() { @@ -363,7 +388,7 @@ export default { query.subjectName = this.query.subjectName; for (let key in query) { if (!query[key]) { - query[key] = null; + delete query[key] } } if (!query.classId) { @@ -393,20 +418,41 @@ export default { this.$message.error(info); } }, + async _QueryTotal() { + //获取答题卡列表 + let query = { ...this.query }; + for (let key in query) { + if (!query[key]) { + delete query[key] + } + } + const { data, status, info } = await this.$request.paperShareCount({ + ...query, + }); + if (status === 0) { + this.totalCount.my = data?.myCount || 0; + this.totalCount.share = data?.grade || 0; + } else { + this.$message.error(info); + } + }, //v1.5 upSuccess(res) { - //导入成功 - this.$message.closeAll(); - this.$message({ - showClose: true, - message: `成功(${res.data.success})`, - type: "success", - duration: 5000, - }); - this.diaUp = false; - + if (res.status == 0) { + //导入成功 + this.$message.closeAll(); + this.$message({ + showClose: true, + message: `${res.info}`, + type: "success", + duration: 2000, + }); + this.diaUp = false; + let params = JSON.stringify(res.data) + this.toAdd({ params, isUpload: 1 }) + } }, handleAdd(value) { if (value == 2) { @@ -589,4 +635,27 @@ export default { display: flex; justify-content: space-between; } + +.content { + .tab-box { + padding-bottom: 10px; + + .tab-s { + margin: 0 10px; + font-size: 17px; + line-height: 24px; + font-weight: 500; + cursor: pointer; + + &:hover { + color: #667ffd; + } + + &.active { + color: #667ffd; + border-bottom: 1px solid #667ffd + } + } + } +} \ No newline at end of file -- libgit2 0.21.4