Преглед на файлове

Merge branch 'develop' of http://52.130.252.100:10000/TEAMMODEL/TEAMModelOS into develop

HiITEdenX преди 2 години
родител
ревизия
5d1dae507b

+ 1 - 1
TEAMModelOS/ClientApp/src/components/evaluation/ExerciseList.less

@@ -47,7 +47,7 @@
     flex-direction: row;
     justify-content: center;
     margin: 20px 0;
-    position: fixed;
+    // position: fixed;
     bottom: 5px;
     background: #fff;
     width: 100%;

+ 137 - 0
TEAMModelOS/ClientApp/src/view/evaluation/components/BasePaperItemPicker.vue

@@ -0,0 +1,137 @@
+<template>
+  <div class="paper-item-picker-container">
+    <div class="paper-list">
+      <p style="font-size:16px;margin-left:20px;" v-if="paperList.length">当前已挑选 <span style="font-weight:bold;color:#42a676">{{ checkList.length }}</span> 题</p>
+      <p style="font-size:16px;margin-left:20px;" v-if="!paperList.length">当前无试卷可选择!</p>
+      <Collapse simple v-if="paperList.length" accordion @on-change="onPaperClick">
+        <Panel v-for="(paper,index) in paperList" color="primary" :name="paper.id">
+          <span style="display:inline-flex;align-items: center">
+            <span style="margin-right:10px">{{ paper.name }}</span>
+            <Tag color="blue">{{ paper.scoring ? paper.scoring.length : 0 }}题</Tag>
+            <span style="margin-left: 8px;" v-for="(tag,tagIndex) in paper.tags">
+              <Tag color="geekblue">{{ tag }}</Tag>
+            </span>
+            <span style="margin-left: 8px;" v-if="paper.mode">
+              <Tag color="green">{{ paper.mode }}</Tag>
+            </span>
+          </span>
+          <template #content>
+            <div class="question-list" v-if="questionList.length">
+              <div :class="[ 'question-item',checkList.find(i => i.id === item.id) ? 'question-item-active' : 'question-item' ]" v-for="(item,index) in questionList" @click="onQuestionClick(item,index)">
+                <div class="question-stem">
+                  <span>{{ index + 1 }}.</span>
+                  <span v-html="item.question">{{  }}</span>
+                </div>
+              </div>
+            </div>
+          </template>
+        </Panel>
+      </Collapse>
+    </div>
+  </div>
+</template>
+
+<script>
+export default {
+  name: 'BasePaperItemPicker',
+  props: {
+    gradeCode: {
+      type: Array,
+      default: () => []
+    },
+    subjectCode: {
+      type: String,
+      default: ''
+    },
+    periodCode: {
+      type: String,
+      default: ''
+    },
+  },
+  data() {
+    return {
+      paperList: [],
+      questionList: [],
+      checkList: [],
+      originQuestionList: [],
+    }
+  },
+  created() {
+    console.error(this.gradeCode, this.subjectCode, this.periodCode)
+    this.findPaper()
+  },
+  methods: {
+    onQuestionClick(item, index) {
+      let findIndex = this.checkList.findIndex(i => i.id === item.id)
+      if (findIndex > -1) {
+        this.checkList.splice(findIndex, 1)
+      } else {
+        let newItem = this.originQuestionList.find(i => i.id === item.id)
+        newItem.score = 0
+        this.checkList.push(newItem)
+      }
+    },
+    findPaper() {
+      this.$api.learnActivity.FindExamPaper({
+        '@DESC': "createTime",
+        'code': this.isSchool ? this.$store.state.userInfo.schoolCode : this.$store.state.userInfo.TEAMModelId,
+        'gradeIds[*]': this.isSchool ? this.gradeCode.map(i => i + '') : [],
+        'periodId': this.isSchool ? this.periodCode : [],
+        'scope': this.isSchool ? 'school' : "private",
+        'subjectId': this.isSchool ? [this.subjectCode] : []
+      }).then(res => {
+        this.paperList = res.papers
+      })
+    },
+    async onPaperClick(paperId) {
+      if (!paperId.length) return
+      this.question = []
+      let paper = this.paperList.find(i => i.id === paperId[0])
+      let fullPaperJson = await this.$evTools.getFullPaper(paper)
+      this.questionList = fullPaperJson.item
+      this.originQuestionList = this._.cloneDeep(fullPaperJson.item)
+      this.questionList.forEach(i => {
+        i.question = i.question.replace(/<[^>]+>/g, "")
+      })
+      console.log(fullPaperJson)
+    },
+
+
+  },
+  computed: {
+    isSchool() {
+      return this.$route.name === 'newSchoolPaper'
+    },
+  }
+}
+</script>
+
+<style lang="less">
+.paper-item-picker-container {
+  .ivu-collapse {
+    border: none;
+  }
+  .ivu-collapse-header {
+    height: 50px !important;
+    line-height: 50px !important;
+  }
+
+  .ivu-collapse-content {
+    padding: 0 45px;
+  }
+
+  .question-item {
+    margin: 10px 0;
+    display: flex;
+    justify-content: space-between;
+    border: 1px dashed #ccc;
+    padding: 10px;
+    cursor: pointer;
+  }
+
+  .question-item-active {
+    background: #42a676;
+    color: #fff;
+  }
+}
+</style>

+ 1 - 4
TEAMModelOS/ClientApp/src/view/evaluation/index/CreatePaper.vue

@@ -86,7 +86,7 @@
                 <!-- 预览试卷 -->
                 <TabPane :label="$t('evaluation.paperList.tab5')" name="preview" :index="4" tab="createTest">
                   <vuescroll ref="paperRef" @handle-scroll="handleScroll">
-                    <TestPaper v-if="!examAnalysisStatus" :paper="evaluationInfo" :class="examAnalysisStatus ? '':'animated fadeIn'" ref="testPaper" @onViewModelChange="onViewModelChange" :isPreviewItems="!isGeneratePaper">
+                    <TestPaper v-if="!examAnalysisStatus" :subjectCode="propSubject" :periodCode="propPeriod" :gradeCode="propGrades" :paper="evaluationInfo" :class="examAnalysisStatus ? '':'animated fadeIn'" ref="testPaper" @onViewModelChange="onViewModelChange" :isPreviewItems="!isGeneratePaper">
                     </TestPaper>
                   </vuescroll>
                 </TabPane>
@@ -336,7 +336,6 @@ export default {
         this.evaluationInfo.item = importList
         this.activeTab = 'preview'
         this.$Message.success(this.$t('evaluation.importFile.warningTips3'))
-        console.log(this.evaluationInfo)
         if (this.errorList.length) {
           this.$EventBus.$emit('importFinish', this.errorList)
         }
@@ -427,7 +426,6 @@ export default {
     },
     /* 获取手动组题的数据 */
     getSelectedQuestion(data) {
-      console.log(data)
       let arr = data.questions
       // 如果是编辑试卷 则往原试卷添加不包含的新题目进入
       if (this.isEditPaper) {
@@ -559,7 +557,6 @@ export default {
         let promiseArr = []
         for (let i = 0; i < list.length; i++) {
           let exerciseItem = list[i]
-          console.log(exerciseItem.blob)
           // 如果题目是来自题库或者试卷库 (不需要进行入库操作)
           if (exerciseItem.blob) {
             if (exerciseItem.children.length) {

+ 59 - 57
TEAMModelOS/ClientApp/src/view/evaluation/index/TestPaper.less

@@ -1,37 +1,35 @@
 .paper-container {
-	position: relative;
-	
-	.back-to-top {
-	    position:fixed;
-	    right:-98%;
-	    bottom:60px;
-	    height:48px;
-	    width:50px;
-	    background:#595959;
-	    z-index:99999;
-		border-radius: 50%;
-	    cursor:pointer;
-	}
-	
-	 .back-to-top:hover {
-	    background:rgb(128,128,128);
-	}
-	
-	    .back-to-top .ivu-icon {
-	        font-size:26px;
-	        color:white;
-	    }
-	
+    position: relative;
+
+    .back-to-top {
+        position: fixed;
+        right: -98%;
+        bottom: 60px;
+        height: 48px;
+        width: 50px;
+        background: #595959;
+        z-index: 99999;
+        border-radius: 50%;
+        cursor: pointer;
+    }
+
+    .back-to-top:hover {
+        background: rgb(128, 128, 128);
+    }
 
+    .back-to-top .ivu-icon {
+        font-size: 26px;
+        color: white;
+    }
 
 
     .paper-title {
         font-size: 30px;
-		margin: 30px 0;
+        margin: 30px 0;
         font-weight: bold;
         vertical-align: middle;
         text-align: center;
-		cursor: pointer;
+        cursor: pointer;
     }
 
     .paper-subTitle {
@@ -65,14 +63,14 @@
     padding: 20px 0;
 
     .paper-analysis {
-        position:sticky;
-        top:0;
+        position: sticky;
+        top: 0;
         background: White;
         width: 20%;
         padding: 20px 10px;
 
-        .ivu-radio-group{
-            margin:15px 0 0 0;
+        .ivu-radio-group {
+            margin: 15px 0 0 0;
         }
 
         .analysis-btns {
@@ -148,12 +146,12 @@
 .paper-content {
     width: 100%;
     height: ~"calc(100% - 5px)";
-	min-height: 1552px;
+    min-height: 1552px;
     background: #fff;
-    padding:10px;
+    padding: 10px;
     display: flex;
     flex-direction: row;
-	// min-height: 73vh;
+    // min-height: 73vh;
 
     .paper-body {
         width: 98%;
@@ -197,15 +195,16 @@
                 height: 50px;
             }
         }
+
         // .base-info-item:not(:first-child) {
         //     margin-left: 30px;
         // }
-		
-		.base-info-btn{
-			padding: 0 8px;
-			margin-bottom: 8px;
-		}
-		
+
+        .base-info-btn {
+            padding: 0 8px;
+            margin-bottom: 8px;
+        }
+
         .base-info-btn:not(:last-child) {
             margin-right: 10px;
         }
@@ -228,7 +227,7 @@
         padding: 5px 10px !important;
         box-sizing: border-box;
         background: transparent;
-        border: 1px solid rgba(1,1,1,0);
+        border: 1px solid rgba(1, 1, 1, 0);
 
         .item-concept {
             margin-top: 10px;
@@ -282,10 +281,12 @@
         }
     }
 }
+
 /*.paper-content .paper-part:hover {
             background: #bfcdad45;
         }*/
-.paper-content .item-answer, .paper-content .item-explain {
+.paper-content .item-answer,
+.paper-content .item-explain {
     line-height: 26px;
 }
 
@@ -320,22 +321,22 @@
     }
 }
 
-.rules-modal{
-	
-	.ivu-modal-body{
-		
-		.rule-item{
-			display: flex;
-			flex-direction: column;
-			
-			&-title{
-				margin: 10px 0;
-				font-weight: bold;
-			}
-		}
-		
-	}
-	
+.rules-modal {
+
+    .ivu-modal-body {
+
+        .rule-item {
+            display: flex;
+            flex-direction: column;
+
+            &-title {
+                margin: 10px 0;
+                font-weight: bold;
+            }
+        }
+
+    }
+
 }
 
 
@@ -346,10 +347,11 @@
     justify-content: center;
     align-items: center;
 }
+
 /*向垂直水平居中*/
 .flex-col-center {
     display: flex;
     flex-direction: column;
     justify-content: center;
     align-items: center;
-}
+}

+ 43 - 4
TEAMModelOS/ClientApp/src/view/evaluation/index/TestPaper.vue

@@ -64,6 +64,12 @@
         <TabPane :label="$t('evaluation.quickCreate')" name="name2" tab="newExerciseTab" v-if="isDevEnv">
           <BasePasteTool v-if="addNewModal" @addFinish="onAddNewFinish"></BasePasteTool>
         </TabPane>
+        <!-- <TabPane :label="`从题库挑选`" name="name3" tab="newExerciseTab">
+          <ManualCreate v-if="curModalTab === 'name3'" ref="bankPicker" :subjectCode="subjectCode" :periodCode="periodCode" :gradeCode="gradeCode"></ManualCreate>
+        </TabPane> -->
+        <TabPane :label="`从试卷挑选`" name="name4" tab="newExerciseTab">
+          <BasePaperItemPicker v-if="curModalTab === 'name4'" ref='paperPicker' :subjectCode="subjectCode" :periodCode="periodCode" :gradeCode="gradeCode"></BasePaperItemPicker>
+        </TabPane>
       </Tabs>
       <div slot="footer">
         <Button @click="addNewModal = false">{{$t('evaluation.cancel')}}</Button>
@@ -91,8 +97,11 @@
 </template>
 <script>
 import ExamPaperAnalysis from '@/view/learnactivity/ExamPaperAnalysis.vue'
+import ManualCreate from '@/view/learnactivity/ManualCreate.vue'
+
 export default {
   components: {
+    ManualCreate,
     ExamPaperAnalysis,
   },
   props: {
@@ -140,6 +149,18 @@ export default {
       type: Boolean,
       default: false
     },
+    gradeCode: {
+      type: Array,
+      default: () => []
+    },
+    subjectCode: {
+      type: String,
+      default: ''
+    },
+    periodCode: {
+      type: String,
+      default: ''
+    }
   },
   data() {
     return {
@@ -191,11 +212,17 @@ export default {
       downLoading: false,
       analysisTableData: [],
       viewModel: 'type',
-      paperDiff: 0
+      paperDiff: 0,
+      curModalTab: ''
 
     }
   },
   methods: {
+    getSelectedQuestion(val) {
+      // this.onAddNewFinish(val.item)
+      // this.paperInfo.item = this._.cloneDeep(val.item)
+
+    },
     /* 退出预览 */
     exitPreview() {
       this.$emit('exitPreview')
@@ -203,15 +230,23 @@ export default {
     /* 手动保存 */
     doSaveEdit() {
       this.editLoading = true
-      this.$refs.newEdit.getContent(this.$refs.newEdit.exersicesType)
+      if (this.curModalTab === 'name4') {
+        let newItems = this.$refs.paperPicker.checkList
+        this.onAddNewFinish(newItems)
+      } else if (this.curModalTab === 'name3') {
+        let newItems = this.$refs.bankPicker.shoppingQuestionList
+        this.onAddNewFinish(newItems)
+      } else {
+        this.$refs.newEdit.getContent(this.$refs.newEdit.exersicesType)
+      }
     },
     onTabChange(val) {
+      this.curModalTab = val
       // if (val === 'name1') {
       // 	this.isShowPasteTool = true
       // }
     },
     onClickOrderTemp(val) {
-      console.log(val);
       this.curOrderTempIndex = val
     },
     onChooseOrderTemp() {
@@ -222,7 +257,6 @@ export default {
     },
     /* 下载Blob答题卡 */
     async downloadSheet() {
-      console.log(this.paperInfo)
       this.downLoading = true
       let examId = this.paperInfo.examId
       let sheetMode = this.paperInfo.mode ? `(${this.paperInfo.mode})` : ``
@@ -409,6 +443,11 @@ export default {
     this.paperDiff = paper.item ? this.handleDiffCalc(paper.item) : 0
     this.curOrderTempIndex = paper.orderTemp || 0
 
+    console.error(this.$parent)
+    console.error(this.$parent.propPeriod)
+    console.error(this.$parent.propSubject)
+    console.error(this.$parent.propGrades)
+
   },
   computed: {
     isAuto() {

Файловите разлики са ограничени, защото са твърде много
+ 499 - 500
TEAMModelOS/ClientApp/src/view/learnactivity/ManualCreate.vue


+ 1 - 1
TEAMModelOS/Controllers/Common/ArtController.cs

@@ -75,7 +75,7 @@ namespace TEAMModelOS.Controllers.Common
                 if (!ae.owner.Equals("area"))
                 {
                     ae.owner = "school";
-                    ae.code = "Study-" + code;
+                    ae.code = "Art-" + code;
                     ae.scope = "school";
                     long now = DateTimeOffset.UtcNow.ToUnixTimeMilliseconds();
                     ae.createTime = now;