瀏覽代碼

Merge branch 'develop5.0-tmd' of http://106.12.23.251:10080/TEAMMODEL/TEAMModelOS into develop5.0-tmd

zhouj1203@hotmail.com 4 年之前
父節點
當前提交
43e4ac7971

+ 6 - 2
TEAMModelOS.SDK/Models/Cosmos/Common/Snode.cs

@@ -30,10 +30,15 @@ namespace TEAMModelOS.SDK.Models.Cosmos.Common
         [Required(ErrorMessage = "{0} 必须填写")]
 
         public string pid { get; set; }
+        /// <summary>
+        /// 排序
+        /// </summary>
+        [Required(ErrorMessage = "{0} 必须填写")]
 
-        public List<Tnode> tnodes { get; set; }
+        public int order { get; set; }
         public List<string> points { get; set; } = new List<string> { "" };
         public List<Rnode> rnodes { get; set; }
+        public string code { get; set; }
 
     }
     /// <summary>
@@ -42,7 +47,6 @@ namespace TEAMModelOS.SDK.Models.Cosmos.Common
     public class Rnode : Snode
     {
         public string id { get; set; }
-        public string name { get; set; }
         public string code { get; set; }
         public List<string> link { get; set; }
     }

+ 21 - 0
TEAMModelOS.SDK/Models/Cosmos/School/Inner/Period.cs

@@ -13,7 +13,12 @@ namespace TEAMModelOS.SDK.Models
             subjects = new List<Subject>();
             semesters = new List<Semester>();
             analysis = new Analysis();
+            majors = new List<Major>();
         }
+        /// <summary>
+        /// 高职教专业
+        /// </summary>
+        public List<Major> majors { get; set; }
         public List<Grade> grades { get; set; }
         public List<Subject> subjects { get; set; }
         public List<Semester> semesters { get; set; }
@@ -30,6 +35,22 @@ namespace TEAMModelOS.SDK.Models
         /// </summary>
         public List<TimeTable> timetable { get; set; }
     }
+
+    /// <summary>
+    /// 高职教的专业
+    /// </summary>
+    public class Major
+    {
+        /// <summary>
+        /// id
+        /// </summary>
+        public string id { get; set; }
+        /// <summary>
+        /// 名称
+        /// </summary>
+        public string name { get; set; }
+    }
+
     public class Analysis
     {
         public List<ExamSimple> type { get; set; }

+ 4 - 2
TEAMModelOS.SDK/Models/Cosmos/School/Inner/Subject.cs

@@ -8,7 +8,9 @@ namespace TEAMModelOS.SDK.Models
     {
         public string id { get; set; }
         public string name { get; set; }
-        
-
+        /// <summary>
+        ///学科类型: 通用1  学科2  专业3
+        /// </summary>
+        public int type { get; set; }
     }
 }

+ 4 - 0
TEAMModelOS.SDK/Models/Cosmos/School/School.cs

@@ -33,6 +33,10 @@ namespace TEAMModelOS.SDK.Models
         public string picture { get; set; }
 
         public TimeZone timeZone { get; set; }
+        /// <summary>
+        /// 1 普教,2 高职教
+        /// </summary>
+        public int type { get; set; }
 
     }
 

+ 0 - 1
TEAMModelOS/ClientApp/src/view/evaluation/components/BaseImport.vue

@@ -309,7 +309,6 @@
 				// 解析成题目列表
 				this.$api.SaveAnalyzeHtml({ html : html }).then(response => {
 					if(response.tests.length && !response.emferror.length){
-						this.$Message.success(this.$t('evaluation.importFile.warningTips3'))
 						this.$emit('importFinish',response.tests)
 						this.isImportFinish = false
 						this.isBtnLoading = false

+ 16 - 9
TEAMModelOS/ClientApp/src/view/evaluation/index/CreatePaper.vue

@@ -223,18 +223,24 @@
 				this.errorList = []
 				this.$refs.testPaper.$refs.exList.errorList = []
 				this.evaluationInfo.item = []
-				let importList = await this.refreshImportItems(list)
-				this.evaluationInfo.item = importList
-				this.activeTab = 'preview'
-				console.log(this.evaluationInfo)
-				if (this.errorList.length) {
-					this.$EventBus.$emit('importFinish', this.errorList)
+				try{
+					let importList = await this.refreshImportItems(list)
+					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)
+					}
+				}catch(e){
+					this.$Message.error(this.$t('evaluation.importFile.warningTips5'))
 				}
+				
 			},
 
 			/* 给导入的试题 补充最新的试卷学段年级以及科目信息 */
 			refreshImportItems(list) {
-				return new Promise((r, j) => {
+				return new Promise((r, reject) => {
 					let objectiveTypes = ['single', 'multiple']
 					let code = this.isSchool ? this.$store.state.userInfo.schoolCode : this.$store.state.userInfo.TEAMModelId
 					let gradeIds = this.isSchool ? this.evaluationInfo.paperGrade.length ? this.evaluationInfo.paperGrade : this.gradeList
@@ -270,9 +276,10 @@
 							})
 						}
 						// 如果导入的是客观题 则需要检测答案与选项是否为空
-						if (objectiveTypes.includes(i.type) && (!i.question.replace(/\s*/g, "") || !i.option.length || !i.answer.length ||
-								!i.option || !i.answer)) {
+						if (objectiveTypes.includes(i.type) && (!i.question.replace(/\s*/g, "") || !i.option || !i.answer ||
+								!i.option.length || !i.answer.length)) {
 							this.errorList.push(i)
+							reject(500)
 						}
 					}
 					r(list)