Bladeren bron

feat: 加入試卷下載功能

terry 3 maanden geleden
bovenliggende
commit
1c2ffc5415

+ 0 - 1
TEAMModelOS/ClientApp/src/components/hiTeachSideMenu/evaluation/bank/ExerciseList.vue

@@ -333,7 +333,6 @@ export default {
             this.schoolInfo = schoolBaseInfo;
             this.schoolCode = schoolBaseInfo.id;
             this.userId = this.$store.state.userInfo.TEAMModelId;
-            this.filterOrigin = this.isShowSchoolBank ? this.$store.state.userInfo.schoolCode : this.$store.state.userInfo.TEAMModelId;
             this.periodList = schoolBaseInfo.period;
             if (schoolBaseInfo.period.length) {
               let inBank = this.$route.name === 'schoolBank'

+ 1 - 7
TEAMModelOS/ClientApp/src/components/hiTeachSideMenu/evaluation/bank/PaperDownload.vue

@@ -236,13 +236,7 @@ export default {
     },
     /* 返回上级 */
     goBack() {
-      // this.$router.go(-1)
-      this.$router.push({
-        name: this.fromRouter || 'schoolBank',
-        params: {
-          tabName: 'paper'
-        }
-      })
+      this.$router.back();
     },
     /* 拉平所有题目 */
     getFlatItems(arr) {

+ 10 - 7
TEAMModelOS/ClientApp/src/components/hiTeachSideMenu/evaluation/bank/TestPaperList.vue

@@ -43,7 +43,7 @@
     <div class="pl-content-wrap" v-else>
       <Loading :top="100" v-show="dataLoading" type="1" hideMask></Loading>
       <div style="width: 100%;" v-if="!isPreview">
-        <div class="paper-item" v-for="(paper, index) in paperList" :key="index" @click="onPreviewPaper(paper)">
+        <div class="paper-item" v-for="(paper, index) in paperList" :key="index" >
           <div class="paper-item-name">
             <span class="paper-item-tag" v-if="isSchool">{{ paper.subjectName }}</span>
             <span style="margin-left: 8px;">{{ paper.name }}</span>
@@ -77,12 +77,16 @@
 							<span class="info-bold" v-for="(tag,tagIndex) in paper.tags"><Tag color="blue">{{ tag }}</Tag></span>
 						</span> -->
           </div>
-          <!--<div class="paper-item-tools" v-if="!chooseModel">
+          <div class="paper-item-tools" v-if="!chooseModel">
+            <span class="paper-item-tools-edit" @click.stop="onPreviewPaper(paper)">
+              <Icon type="md-eye" />
+              <span>{{ $t('syllabus.preview') }}</span>
+            </span>
             <span class="paper-item-tools-edit" @click.stop="goToDownload(paper)">
               <Icon type="md-download" />
               <span>{{ $t('syllabus.download') }}</span>
             </span>
-            <span class="paper-item-tools-edit" @click.stop="doCopyPaper(paper)">
+            <!-- <span class="paper-item-tools-edit" @click.stop="doCopyPaper(paper)">
               <Icon type="md-copy" />
                       <span>{{ $t('evaluation.paperList.copyTip3') }}</span>
             </span>
@@ -95,8 +99,8 @@
               v-if="($access.can('admin.*||exercise-upd') || !isSchool)">
               <Icon type="md-trash" />
               <span>{{ $t('evaluation.deleteItem') }}</span>
-            </span>
-          </div>-->
+            </span> -->
+          </div>
           <div v-if="chooseModel" class="paper-item-select">
             <div v-if="!singleChoose">
               <Button :type="checkedPaperList.map(i => i.id).includes(paper.id) ? 'warning' : 'info'"
@@ -594,13 +598,12 @@ export default {
       this.fullPaperJson = fullPaperJson
       // this.isShowDownLoad = true'
       this.$router.push({
-        name: 'paperDownload',
+        name: 'HTPaperDownload',
         params: {
           paper: fullPaperJson,
           fromRouter: this.$route.name
         }
       })
-      console.log('要下载的试卷', fullPaperJson)
     },
 
     /**

+ 16 - 8
TEAMModelOS/ClientApp/src/components/hiTeachSideMenu/evaluation/bank/index.vue

@@ -110,6 +110,14 @@
 			},
 			onTabClick(val) {
 				this.currentTab = val;
+				this.$router.replace({
+					path: this.$route.path,
+					query: {
+						params: JSON.stringify({
+							tab: val
+						})
+					}
+				});
 				this.onBackToTop();
 			},
 			/* 展示试卷列表 */
@@ -273,14 +281,6 @@
 			}
 		},
 		mounted() {
-			let parentVm = this.$parent.$parent.$parent;
-			parentVm.$refs["evScroll"].scrollTo(
-				{
-					y: 0
-				},
-				500,
-				"easeInQuad"
-			);
 
 			if (this.$route.params.tabName) {
 				this.currentTab = this.$route.params.tabName;
@@ -290,6 +290,14 @@
 			if (this.$route.name === "schoolBank" && this.$route.params.activePeriod) {
 				this.$EventBus.$emit("showSchoolBank", this.$route.params.activePeriod);
 			}
+
+			if (this.$route.query.params) {
+				const params = JSON.parse(this.$route.query.params);
+				const tab = params.tab;
+
+				this.tabName = tab;
+				this.onTabClick(tab);
+			}
 		},
 		computed: {
 			isSchool() {

+ 6 - 1
TEAMModelOS/ClientApp/src/components/hiTeachSideMenu/navbar/IdentityNavbar.vue

@@ -6,6 +6,11 @@ export default {
             required: true
         }
     },
+    data() {
+        return {
+            hidePaths: ['HTPaperDownload']
+        }
+    },
     methods: {
         refresh() {
             this.$router.go(0);
@@ -23,7 +28,7 @@ export default {
 </script>
 
 <template>
-    <div class="identityNavbar">
+    <div class="identityNavbar" v-show="!hidePaths.includes($route.name)">
         <button @click="navigateToSchool" :class="{ active: identity === 'school' }" class="navBtn">
             {{ $t("hiTeachSideMenu.school") }}
         </button>

+ 5 - 0
TEAMModelOS/ClientApp/src/router/routes.js

@@ -2161,6 +2161,11 @@ export const routes = [{
                     component: () => import('@/view/hiTeachSideMenu/private/bank.vue'),
                 }
             ]
+        },
+        {
+            path: 'paperDownload',
+            name: 'HTPaperDownload',
+            component: () => import('@/view/hiTeachSideMenu/paperDownload.vue')
         }
     ]
 }

+ 13 - 0
TEAMModelOS/ClientApp/src/view/hiTeachSideMenu/paperDownload.vue

@@ -0,0 +1,13 @@
+<script>
+import PaperDownload from '@/components/hiTeachSideMenu/evaluation/bank/PaperDownload.vue'
+
+export default {
+  components: {
+    PaperDownload
+  }
+}
+</script>
+
+<template>
+  <PaperDownload />
+</template>