瀏覽代碼

Merge branch 'develop6.0-tmd' of http://52.130.252.100:10000/TEAMMODEL/TEAMModelOS into develop6.0-tmd

OnePsycho 3 年之前
父節點
當前提交
75eb17b7bc
共有 22 個文件被更改,包括 159 次插入63 次删除
  1. 55 9
      TEAMModelAPI/Controllers/School/CourseController.cs
  2. 3 0
      TEAMModelBI/Controllers/BISchool/RoomController.cs
  3. 1 1
      TEAMModelOS.FunctionV4/CosmosDB/TriggerCorrect.cs
  4. 1 1
      TEAMModelOS.FunctionV4/CosmosDB/TriggerExam.cs
  5. 1 1
      TEAMModelOS.FunctionV4/CosmosDB/TriggerExamLite.cs
  6. 1 1
      TEAMModelOS.FunctionV4/CosmosDB/TriggerHomework.cs
  7. 1 1
      TEAMModelOS.FunctionV4/CosmosDB/TriggerStudy.cs
  8. 1 1
      TEAMModelOS.FunctionV4/CosmosDB/TriggerSurvey.cs
  9. 1 1
      TEAMModelOS.FunctionV4/CosmosDB/TriggerVote.cs
  10. 7 7
      TEAMModelOS.FunctionV4/ServiceBus/ActiveTaskTopic.cs
  11. 14 0
      TEAMModelOS/ClientApp/src/assets/student-web/component_styles/quesnaire.less
  12. 1 1
      TEAMModelOS/ClientApp/src/components/student-web/EventView/EventContent.vue
  13. 51 26
      TEAMModelOS/ClientApp/src/components/student-web/EventView/EventContentTypeTemplate/QuesNaire.vue
  14. 2 2
      TEAMModelOS/ClientApp/src/locale/lang/en-US/studentWeb.js
  15. 2 1
      TEAMModelOS/ClientApp/src/locale/lang/en-US/survey.js
  16. 2 2
      TEAMModelOS/ClientApp/src/locale/lang/zh-CN/studentWeb.js
  17. 2 1
      TEAMModelOS/ClientApp/src/locale/lang/zh-CN/survey.js
  18. 2 2
      TEAMModelOS/ClientApp/src/locale/lang/zh-TW/studentWeb.js
  19. 2 1
      TEAMModelOS/ClientApp/src/locale/lang/zh-TW/survey.js
  20. 6 2
      TEAMModelOS/ClientApp/src/store/module/user.js
  21. 2 1
      TEAMModelOS/ClientApp/src/view/learnactivity/MgtSchoolEva.vue
  22. 1 1
      TEAMModelOS/Controllers/Teacher/TeacherCommonController.cs

+ 55 - 9
TEAMModelAPI/Controllers/School/CourseController.cs

@@ -75,11 +75,11 @@ namespace TEAMModelAPI.Controllers
                 return Ok(new { error = 1, msg = "学段不存在!" });
             }
         }
-       
+
 
         [ProducesDefaultResponseType]
         [HttpPost("upsert-course-info")]
-        [ApiToken(Auth = "1302", Name = "课程详细信息", RW = "R", Limit = false)]
+        [ApiToken(Auth = "1302", Name = "课程详细信息", RW = "W", Limit = false)]
         public async Task<IActionResult> UpsertCourseInfo(JsonElement json)
         {
             var (id, school) = HttpContext.GetApiTokenInfo();
@@ -102,19 +102,53 @@ namespace TEAMModelAPI.Controllers
                                 id = Guid.NewGuid().ToString(),
                                 code = $"Course-{school}",
                                 name = courseDto.name,
-                                subject = new SubjectSimple { id = subject.id, name = subject.name  },
-                                period= new PeriodSimple { id = period.id, name = period.name },
-
+                                subject = new SubjectSimple { id = subject.id, name = subject.name },
+                                period = new PeriodSimple { id = period.id, name = period.name },
+                                school = school,
+                                desc = courseDto.desc,
+                                scope = "school",
+                                no = courseDto.no,
                             };
+                            await _azureCosmos.GetCosmosClient().GetContainer(Constant.TEAMModelOS, Constant.School).CreateItemAsync(course, new PartitionKey(course.code));
                         }
                         else
                         {
-
+                            Azure.Response response = await _azureCosmos.GetCosmosClient().GetContainer(Constant.TEAMModelOS, "School").ReadItemStreamAsync($"{course.id}", new PartitionKey($"Course-{school}"));
+                            if (response.Status == 200)
+                            {
+                                JsonDocument jsonDocument = JsonDocument.Parse(response.Content);
+                                course = jsonDocument.RootElement.ToObject<Course>();
+                                course.pk = "Course";
+                                course.name = string.IsNullOrWhiteSpace(courseDto.name) ? course.name : courseDto.name;
+                                course.subject = new SubjectSimple { id = subject.id, name = subject.name };
+                                course.period = new PeriodSimple { id = period.id, name = period.name };
+                                course.school = school;
+                                course.desc = string.IsNullOrWhiteSpace(courseDto.desc) ? course.desc : courseDto.desc;
+                                course.scope = "school";
+                                course.no = string.IsNullOrWhiteSpace(courseDto.no) ? course.no : courseDto.no;
+                                await _azureCosmos.GetCosmosClient().GetContainer(Constant.TEAMModelOS, Constant.School).CreateItemAsync(course, new PartitionKey(course.code));
+                            }
+                            else {
+                                course = new Course
+                                {
+                                    pk = "Course",
+                                    id = Guid.NewGuid().ToString(),
+                                    code = $"Course-{school}",
+                                    name = courseDto.name,
+                                    subject = new SubjectSimple { id = subject.id, name = subject.name },
+                                    period = new PeriodSimple { id = period.id, name = period.name },
+                                    school = school,
+                                    desc = courseDto.desc,
+                                    scope = "school",
+                                    no = courseDto.no,
+                                };
+                                await _azureCosmos.GetCosmosClient().GetContainer(Constant.TEAMModelOS, Constant.School).CreateItemAsync(course, new PartitionKey(course.code));
+                            }
                         }
-                        return Ok(new { period.subjects, period.timetable, period.grades, period.majors });
+                        return Ok(new { period.subjects, period.timetable, course = course });
                     }
                     else {
-                        return Ok(new { error = 2, msg = "科目不存在!" });
+                        return Ok(new { error =4, msg = "科目不存在!" });
                     }
                 }
                 else
@@ -126,8 +160,20 @@ namespace TEAMModelAPI.Controllers
             {
                 return Ok(new { error = 3, msg = courseDto.Valid() });
             }
-            
         }
+
+        [ProducesDefaultResponseType]
+        [HttpPost("upsert-course-schedule")]
+        [ApiToken(Auth = "1302", Name = "更新课程的排课信息", RW = "W", Limit = false)]
+        public async Task<IActionResult> UpsertCourseSchedule(JsonElement json)
+        {
+            var (id, school) = HttpContext.GetApiTokenInfo();
+            if (!json.TryGetProperty("courseId", out JsonElement _courseId)) { return Ok(new { error = 1, msg = "课程参数错误" }); }
+            School data = await _azureCosmos.GetCosmosClient().GetContainer(Constant.TEAMModelOS, "School").ReadItemAsync<School>(school, new PartitionKey("Base"));
+            Azure.Response response = await _azureCosmos.GetCosmosClient().GetContainer(Constant.TEAMModelOS, "School").ReadItemStreamAsync($"{_courseId}", new PartitionKey($"Course-{school}"));
+            return Ok();
+        }
+
         [ProducesDefaultResponseType]
         [HttpPost("get-course-list")]
         [ApiToken(Auth = "1303", Name = "获取课程列表信息", RW = "R", Limit = false)]

+ 3 - 0
TEAMModelBI/Controllers/BISchool/RoomController.cs

@@ -7,6 +7,7 @@ using System;
 using System.Text;
 using System.Text.Json;
 using System.Threading.Tasks;
+using TEAMModelBI.Filter;
 using TEAMModelBI.Tool.Extension;
 using TEAMModelOS.Models;
 using TEAMModelOS.SDK.DI;
@@ -41,6 +42,8 @@ namespace TEAMModelBI.Controllers.BISchool
         /// </summary>
         /// <param name="jsonElement"></param>
         /// <returns></returns>
+        [ProducesDefaultResponseType]
+        [AuthToken(Roles = "assist")]
         [HttpPost("set-bind")]
         public async Task<IActionResult> SetBindProduct(JsonElement jsonElement) 
         {

+ 1 - 1
TEAMModelOS.FunctionV4/CosmosDB/TriggerCorrect.cs

@@ -424,7 +424,7 @@ namespace TEAMModelOS.FunctionV4
             }
             catch (CosmosException e)
             {
-                await _dingDing.SendBotMsg($"{Environment.GetEnvironmentVariable("Option:Location")}-CosmosDB异常{e.Message}\n{e.Status}", GroupNames.成都开发測試群組);
+                await _dingDing.SendBotMsg($"{Environment.GetEnvironmentVariable("Option:Location")}-CosmosDB异常{e.StackTrace}{e.Message}\n{e.Status}", GroupNames.成都开发測試群組);
             }
             catch (Exception e)
             {

+ 1 - 1
TEAMModelOS.FunctionV4/CosmosDB/TriggerExam.cs

@@ -425,7 +425,7 @@ namespace TEAMModelOS.FunctionV4
             }
             catch (CosmosException e)
             {
-                await _dingDing.SendBotMsg($"{Environment.GetEnvironmentVariable("Option:Location")}-CosmosDB异常{e.Message}\n{e.Status}", GroupNames.成都开发測試群組);
+                await _dingDing.SendBotMsg($"{Environment.GetEnvironmentVariable("Option:Location")}-CosmosDB异常{e.StackTrace}{e.Message}\n{e.Status}", GroupNames.成都开发測試群組);
             }
             catch (Exception e)
             {

+ 1 - 1
TEAMModelOS.FunctionV4/CosmosDB/TriggerExamLite.cs

@@ -163,7 +163,7 @@ namespace TEAMModelOS.FunctionV4
             }
             catch (CosmosException e)
             {
-                await _dingDing.SendBotMsg($"{Environment.GetEnvironmentVariable("Option:Location")}-CosmosDB异常{e.Message}\n{e.Status}", GroupNames.成都开发測試群組);
+                await _dingDing.SendBotMsg($"{Environment.GetEnvironmentVariable("Option:Location")}-CosmosDB异常{e.StackTrace}{e.Message}\n{e.Status}", GroupNames.成都开发測試群組);
             }
             catch (Exception ex)
             {

+ 1 - 1
TEAMModelOS.FunctionV4/CosmosDB/TriggerHomework.cs

@@ -250,7 +250,7 @@ namespace TEAMModelOS.FunctionV4
             }
             catch (CosmosException e)
             {
-                await _dingDing.SendBotMsg($"{Environment.GetEnvironmentVariable("Option:Location")}-CosmosDB异常{e.Message}\n{e.Status}", GroupNames.成都开发測試群組);
+                await _dingDing.SendBotMsg($"{Environment.GetEnvironmentVariable("Option:Location")}-CosmosDB异常{e.StackTrace}{e.Message}\n{e.Status}", GroupNames.成都开发測試群組);
             }
             catch (Exception ex)
             {

+ 1 - 1
TEAMModelOS.FunctionV4/CosmosDB/TriggerStudy.cs

@@ -175,7 +175,7 @@ namespace TEAMModelOS.FunctionV4
             }
             catch (CosmosException e)
             {
-                await _dingDing.SendBotMsg($"{Environment.GetEnvironmentVariable("Option:Location")}-CosmosDB异常{e.Message}\n{e.Status}", GroupNames.成都开发測試群組);
+                await _dingDing.SendBotMsg($"{Environment.GetEnvironmentVariable("Option:Location")}-CosmosDB异常{e.StackTrace}{e.Message}\n{e.Status}", GroupNames.成都开发測試群組);
             }
             catch (Exception ex)
             {

+ 1 - 1
TEAMModelOS.FunctionV4/CosmosDB/TriggerSurvey.cs

@@ -398,7 +398,7 @@ namespace TEAMModelOS.FunctionV4
 
             catch (CosmosException e)
             {
-                await _dingDing.SendBotMsg($"{Environment.GetEnvironmentVariable("Option:Location")}-CosmosDB异常{e.Message}\n{e.Status}", GroupNames.成都开发測試群組);
+                await _dingDing.SendBotMsg($"{Environment.GetEnvironmentVariable("Option:Location")}-CosmosDB异常{e.StackTrace}{e.Message}\n{e.Status}", GroupNames.成都开发測試群組);
             }
             catch (Exception ex)
             {

+ 1 - 1
TEAMModelOS.FunctionV4/CosmosDB/TriggerVote.cs

@@ -336,7 +336,7 @@ namespace TEAMModelOS.FunctionV4
             }
             catch (CosmosException e)
             {
-                await _dingDing.SendBotMsg($"{Environment.GetEnvironmentVariable("Option:Location")}-CosmosDB异常{e.Message}\n{e.Status}", GroupNames.成都开发測試群組);
+                await _dingDing.SendBotMsg($"{Environment.GetEnvironmentVariable("Option:Location")}-CosmosDB异常{e.StackTrace}{e.Message}\n{e.Status}", GroupNames.成都开发測試群組);
             }
             catch (Exception ex)
             {

+ 7 - 7
TEAMModelOS.FunctionV4/ServiceBus/ActiveTaskTopic.cs

@@ -68,7 +68,7 @@ namespace TEAMModelOS.FunctionV4.ServiceBus
             }
             catch (CosmosException e)
             {
-                await _dingDing.SendBotMsg($"{Environment.GetEnvironmentVariable("Option:Location")}-ServiceBus,ExamBus()-CosmosDB异常{e.Message}\n{e.Status}", GroupNames.成都开发測試群組);
+                await _dingDing.SendBotMsg($"{Environment.GetEnvironmentVariable("Option:Location")}-ServiceBus,ExamBus()-CosmosDB异常{e.Message}\n{e.Status}{e.StackTrace}", GroupNames.成都开发測試群組);
             }
             catch (Exception ex)
             {
@@ -92,7 +92,7 @@ namespace TEAMModelOS.FunctionV4.ServiceBus
             }
             catch (CosmosException e)
             {
-                await _dingDing.SendBotMsg($"{Environment.GetEnvironmentVariable("Option:Location")}-ServiceBus,VoteBus()-CosmosDB异常{e.Message}\n{e.Status}", GroupNames.成都开发測試群組);
+                await _dingDing.SendBotMsg($"{Environment.GetEnvironmentVariable("Option:Location")}-ServiceBus,VoteBus()-CosmosDB异常{e.Message}\n{e.Status}{e.StackTrace}", GroupNames.成都开发測試群組);
             }
             catch (Exception ex)
             {
@@ -116,7 +116,7 @@ namespace TEAMModelOS.FunctionV4.ServiceBus
             }
             catch (CosmosException e)
             {
-                await _dingDing.SendBotMsg($"{Environment.GetEnvironmentVariable("Option:Location")}-ServiceBus,Correct()-CosmosDB异常{e.Message}\n{e.Status}", GroupNames.成都开发測試群組);
+                await _dingDing.SendBotMsg($"{Environment.GetEnvironmentVariable("Option:Location")}-ServiceBus,Correct()-CosmosDB异常{e.Message}\n{e.Status}{e.StackTrace}", GroupNames.成都开发測試群組);
             }
             catch (Exception ex)
             {
@@ -141,7 +141,7 @@ namespace TEAMModelOS.FunctionV4.ServiceBus
             }
             catch (CosmosException e)
             {
-                await _dingDing.SendBotMsg($"{Environment.GetEnvironmentVariable("Option:Location")}-ServiceBus,SurveyBus()-CosmosDB异常{e.Message}\n{e.Status}", GroupNames.成都开发測試群組);
+                await _dingDing.SendBotMsg($"{Environment.GetEnvironmentVariable("Option:Location")}-ServiceBus,SurveyBus()-CosmosDB异常{e.StackTrace}{e.Message}\n{e.Status}", GroupNames.成都开发測試群組);
             }
             catch (Exception ex)
             {
@@ -164,7 +164,7 @@ namespace TEAMModelOS.FunctionV4.ServiceBus
             }
             catch (CosmosException e)
             {
-                await _dingDing.SendBotMsg($"{Environment.GetEnvironmentVariable("Option:Location")}-ServiceBus,Homework()-CosmosDB异常{e.Message}\n{e.Status}", GroupNames.成都开发測試群組);
+                await _dingDing.SendBotMsg($"{Environment.GetEnvironmentVariable("Option:Location")}-ServiceBus,Homework()-CosmosDB异常{e.StackTrace}{e.Message}{e.StackTrace}\n{e.Status}", GroupNames.成都开发測試群組);
             }
             catch (Exception ex)
             {
@@ -190,7 +190,7 @@ namespace TEAMModelOS.FunctionV4.ServiceBus
             }
             catch (CosmosException e)
             {
-                await _dingDing.SendBotMsg($"{Environment.GetEnvironmentVariable("Option:Location")}-ServiceBus,Study()-CosmosDB异常{e.Message}\n{e.Status}\n{e.StackTrace}\n{activityId}", GroupNames.成都开发測試群組);
+                await _dingDing.SendBotMsg($"{Environment.GetEnvironmentVariable("Option:Location")}-ServiceBus,Study()-CosmosDB异常{e.StackTrace}{e.Message}\n{e.Status}", GroupNames.成都开发測試群組);
             }
             catch (Exception ex)
             {
@@ -214,7 +214,7 @@ namespace TEAMModelOS.FunctionV4.ServiceBus
             }
             catch (CosmosException e)
             {
-                await _dingDing.SendBotMsg($"{Environment.GetEnvironmentVariable("Option:Location")}-ServiceBus,ExamLite()-CosmosDB异常{e.Message}\n{e.Status}", GroupNames.成都开发測試群組);
+                await _dingDing.SendBotMsg($"{Environment.GetEnvironmentVariable("Option:Location")}-ServiceBus,ExamLite()-CosmosDB异常{e.StackTrace}{e.Message}\n{e.Status}", GroupNames.成都开发測試群組);
             }
             catch (Exception ex)
             {

+ 14 - 0
TEAMModelOS/ClientApp/src/assets/student-web/component_styles/quesnaire.less

@@ -95,4 +95,18 @@
         left: 0px;
         margin: 10px 0px;
     }
+
+    
+    .scoreboard {
+        width: 100%;
+        /*height: 638px;*/
+        background: rgb(240, 240, 240);
+        /*border: 1px solid rgba(0, 0, 0, 0.1);*/
+        border-radius: 8px;
+        padding: 15px;
+
+        .ivu-card {
+            margin-bottom: 20px;
+        }
+    }
 }

+ 1 - 1
TEAMModelOS/ClientApp/src/components/student-web/EventView/EventContent.vue

@@ -22,7 +22,7 @@
         </template>
         <!-- 如果篩選時未選的時候預設顯示列表第一個-->
         <div class="noSelected" v-if="!getIsSelectedNow">
-            <h3>{{$t("studentWeb.event.selectActivity")}}</h3>
+            <h3>{{ $t("studentWeb.event.selectActivity") }}</h3>
         </div>
     </div>
 </template>

+ 51 - 26
TEAMModelOS/ClientApp/src/components/student-web/EventView/EventContentTypeTemplate/QuesNaire.vue

@@ -44,31 +44,24 @@
 		<Loading v-show="isLoad" bgColor="rgba(0, 0, 0, 0.3)"></Loading>
 		<EventBasicInfo :info="nowActive" />
 		<div>
-			<!-- 已提交 -->
-			<div v-if="alreadyAnswered" style="text-align: center; padding-top: 15%;">
-				<Icon type="md-checkmark-circle-outline" color="#00ad6c" size="80"/>
-				<p style="font-size: 30px; color:#00ad6c; font-weight: 600; margin:20px;">{{ $t('survey.studentWeb.already') }}</p>
-			</div>
-			<!-- 活动结束 -->
-			<div v-if="!alreadyAnswered && surveyInfo.progress === 'finish'" style="text-align: center; padding-top: 15%;">
-				<Icon type="md-stopwatch" color="#00ad6c" size="80"/>
-				<p style="font-size: 30px; color:#00ad6c; font-weight: 600; margin:20px;">{{ $t('survey.studentWeb.overtime') }}</p>
-			</div>
-			
-
 			<!--問卷完成後,在時間結束前仍可修改答案再提交-->
-			<div v-if="surveyInfo.progress !== 'finish' && !alreadyAnswered">
+			<div style="margin-bottom: 100px;">
+				<div class="scoreboard" v-if="!alreadyAnswered && surveyInfo.progress === 'finish'">
+					<!-- 未作答 -->
+					<h4 style="padding: 25px;">
+						<svg-icon icon-class="handonHint" class="warm-icon" />
+						{{ $t('survey.studentWeb.noanswer') }}
+					</h4>
+				</div>
 				<!-- 描述 -->
 				<BillBoardandLightBox :activityData="surveyInfo" />
 				<!-- 内容 -->
-				<div class="title-rect-group">
+				<div class="title-rect-group" style="margin-bottom: 20px;">
 					<!-- <div class="title-rect" /> -->
 					<h2 class="title-rect-name">{{ $t('survey.studentWeb.content') }}</h2>
 				</div>
-				<br />
 				<!-- 问卷内容 -->
 				<div v-for="(item, index) in surveyInfo.items" :key="index" class="survey-item">
-					<!-- <br /> -->
 					<div style="display: flex; font-weight: bold;">
 						<span>{{ index + 1 }}. </span>
 						<span v-html="item.question" @click="showImg($event)"></span>({{ typeList[item.type] }})<span></span>
@@ -77,7 +70,9 @@
 					<div v-if="item.type !== 'subjective'">
 						<div class="unitTestBtn" v-for="(option, optionIndex) in item.option" :key="optionIndex">
 							<div class="unitTestbg" @click="onOptionClick(item, index, option.code)"
-								:style="{ backgroundColor: submitArr[index].includes(option.code) ? '#24b880' : 'transparent'}"
+								:style="{ backgroundColor: submitArr[index].includes(option.code) ? '#24b880' : 'transparent',
+											cursor: (alreadyAnswered || surveyInfo.progress === 'finish') ? 'not-allowed' : 'pointer'
+								}"
 							>
 								{{ option.code }}. <span v-html="option.value" style="margin-left: 10px;" @click="showImg($event)"></span>
 							</div>
@@ -85,13 +80,14 @@
 					</div>
 					<!-- 问答 -->
 					<div v-if="item.type === 'subjective'">
-						<Input v-special-char v-model="submitArr[index][0]" type="textarea" :rows="8" :placeholder="$t('studentWeb.exam.inputAnswers')" />
+						<Input v-special-char v-model="submitArr[index][0]" type="textarea" :rows="8"
+								:placeholder="$t('studentWeb.exam.inputAnswers')"
+								:disabled="alreadyAnswered || surveyInfo.progress === 'finish'"
+						/>
 					</div>
 					<Divider v-if="index != surveyInfo.items.length - 1" />
 				</div>
-				<br />
-				<br />
-				<button class="uploadBtn" @click="submitMessage()">
+				<button class="uploadBtn" @click="submitMessage()" v-if="!alreadyAnswered && surveyInfo.progress != 'finish'">
 					<svg-icon icon-class="quesnaire" class="uloadBtn-icon" />
 					<span>{{ $t('survey.studentWeb.submit') }}</span>
 				</button>
@@ -135,7 +131,7 @@
 				surveyInfo: { //问卷信息
 					items: []
 				},
-				alreadyAnswered:false, //提交状态
+				alreadyAnswered: false, //提交状态
 				undo: 0,
 				showMessageNum: 0,
 				WarmMessageisOpen: false,
@@ -154,6 +150,7 @@
                     img: "",
                     show: false
                 },
+				answerRec: [],
 			};
 		},
 		created() {
@@ -170,6 +167,9 @@
 		methods: {
 			// 非问答的答案
 			onOptionClick(item, index, code) {
+				if(this.alreadyAnswered || this.surveyInfo.progress === 'finish') {
+					return
+				}
 				if (this.submitArr[index].includes(code)) {
 					this.submitArr[index].splice(this.submitArr[index].indexOf(code), 1)
 				} else {
@@ -239,16 +239,18 @@
 			async getSurveyInfo() {
 				// this.surveyInfo = {}
 				this.isLoad = true
+				this.answerRec = []
 				if(this.getItemTitle.id) {
 					let params = {
 						"id": this.getItemTitle.id,
 						"code": this.getItemTitle.scode
 					}
 					let isAnswerd = await this.isAnswerd(params)
-					if(!isAnswerd) {
+					// if(!isAnswerd) {
 						// 没有提交
 						this.$api.studentWeb.getSurveyInfo(params).then(async res => {
 							if (res) {
+								this.alreadyAnswered = isAnswerd
 								this.isLoad = false
 								if(res.status == 404) {
 									this.$Modal.confirm({
@@ -262,6 +264,9 @@
 								} else if(res.status == 200) {
 									this.surveyInfo = res.survey
 									this.surveyInfo.items = await this.getBlobItems(res.survey)
+									if(isAnswerd) {
+										this.answerRec = await this.getRecordItems(res.survey)
+									}
 									this.submitArr = []
 									this.surveyInfo.items.forEach(i => {
 										this.submitArr.push([])
@@ -272,10 +277,10 @@
 						}).catch(err => {
 							console.log(err)
 						})
-					} else {
+					/* } else {
 						this.isLoad = false
 						this.alreadyAnswered = true
-					}
+					} */
 				}
 			},
 			//放大图片
@@ -347,6 +352,19 @@
 					
 				})
 			},
+			// 获取作答的内容
+			getRecordItems(qnItem) {
+				return new Promise(async (resolve, reject) => {
+					// let blobHost = this.$tools.getBlobHost()
+					let cntr = qnItem.scope === 'school' ? qnItem.school : qnItem.code.replace('Survey-','')
+					let sas = await this.$tools.getBlobSas(cntr)
+					let sasString = "?" + sas.sas
+					let blobHost = sas.url
+					let fullIndexJsonPath = blobHost + '/' + cntr + qnItem.recordUrl + sasString
+					let indexJson = await this.getBlobJsonFile(fullIndexJsonPath)
+					resolve(indexJson.urecord[0].ans)
+				})
+			},
 			
 			// 获取blob里的问卷信息
 			getBlobJsonFile(indexJsonUrl) {
@@ -425,7 +443,14 @@
 					this.alreadyAnswered = false
 					this.getSurveyInfo()
 				}
-			}
+			},
+			answerRec: {
+				handler(n, o) {
+					// if(n.length) {
+						this.submitArr = n
+					// }
+				},
+			},
 		},
 		
 		computed: {

+ 2 - 2
TEAMModelOS/ClientApp/src/locale/lang/en-US/studentWeb.js

@@ -195,8 +195,8 @@ export default {
     newAddCourse: 'The latest addition',
     addTime: "Join time",
     missionListCardTitle: 'Activity Task List',
-    missionListCardTitle1: 'Task List',
-    missionListCardTitle2: 'Activity List',
+    missionListCardTitle1: 'Task',
+    missionListCardTitle2: 'Activity',
     choiceTime: "Filter Time",
     missionListCardPlace: "Default display activities within 30 days",
     missionListCardLoading: 'Loading',

+ 2 - 1
TEAMModelOS/ClientApp/src/locale/lang/en-US/survey.js

@@ -89,7 +89,8 @@ export default {
 		content:'Content',
 		submit:'Submit Survey',
 		already:'You have successfully submitted the response record for this activity',
-		overtime:'This activity has ended'
+		overtime:'This activity has ended',
+		noanswer: "該活動已結束,無法提交作答資訊",
 	},
 	optionLimitTip:'Keep at least two options',
 	optionMaxTip:'Maximum of 9 options',

+ 2 - 2
TEAMModelOS/ClientApp/src/locale/lang/zh-CN/studentWeb.js

@@ -195,8 +195,8 @@ export default {
     newAddCourse: '最新加入课程',
     addTime: "加入时间",
     missionListCardTitle: '活动任务清单',
-    missionListCardTitle1: '任务清单',
-    missionListCardTitle2: '活动清单',
+    missionListCardTitle1: '任务',
+    missionListCardTitle2: '活动',
     choiceTime: "筛选时间",
     missionListCardPlace: "默认展示近30天的活动",
     missionListCardLoading: '载入中',

+ 2 - 1
TEAMModelOS/ClientApp/src/locale/lang/zh-CN/survey.js

@@ -89,7 +89,8 @@ export default {
 		content:'内容',
 		submit:'提交问卷',
 		already:'该活动已成功提交作答记录',
-		overtime:'当前活动已结束'
+		overtime:'当前活动已结束',
+		noanswer: "该活动已结束,无法提交作答信息",
 	},
 	optionLimitTip:'至少保留两个选项',
 	optionMaxTip:'最多只有9个选项',

+ 2 - 2
TEAMModelOS/ClientApp/src/locale/lang/zh-TW/studentWeb.js

@@ -195,8 +195,8 @@ export default {
     newAddCourse: '最新加入課程',
     addTime: "加入時間",
     missionListCardTitle: '活動任務清單',
-    missionListCardTitle1: '任務清單',
-    missionListCardTitle2: '活動清單',
+    missionListCardTitle1: '任務',
+    missionListCardTitle2: '活動',
     choiceTime: "篩選時間",
     missionListCardPlace: "預設展示近30天的活動",
     missionListCardLoading: '載入中',

+ 2 - 1
TEAMModelOS/ClientApp/src/locale/lang/zh-TW/survey.js

@@ -89,7 +89,8 @@ export default {
 		content: '內容',
 		submit: '提交問卷',
 		already:'該活動已成功提交作答記錄',
-		overtime:'當前活動已結束'
+		overtime:'當前活動已結束',
+		noanswer: "該活動已結束,無法提交作答資訊",
 	},
 	optionLimitTip:'至少保留兩個選項',
 	optionMaxTip:'最多只有9個選項',

+ 6 - 2
TEAMModelOS/ClientApp/src/store/module/user.js

@@ -170,6 +170,7 @@ export default {
         /* 设置当前学段 */
         setCurPeriod(state, data) {
             state.curPeriod = data
+            localStorage.setItem('curPeriod', JSON.stringify(data))
         },
         //更新userProfile schools
         setSchoolsInfo(state, data) {
@@ -268,8 +269,8 @@ export default {
             state.schoolProfile.school_base = data.school_base // 区班校基础数据
             state.schoolProfile.svcStatus = data.svcStatus //学校购买服务模组状态
             state.schoolProfile.productSum = data.productSum //学校购买服务模组信息
-            state.osblob_sas = data.osblob_sas 
-            state.osblob_uri = data.osblob_uri 
+            state.osblob_sas = data.osblob_sas
+            state.osblob_uri = data.osblob_uri
             sessionStorage.setItem('standard', data.school_base.standard)
         },
         setStudentProfile(state, data) {
@@ -749,6 +750,9 @@ export default {
             }
             data.svcStatus = svcStatus
             context.commit('setSchoolProfile', data)
+            let curPd = data.school_base.period.find(item => item.id === context.state.curPeriod?.id)
+            if (curPd) context.commit('setCurPeriod', curPd)
+
             // 设置学校空间
             context.commit('setSchoolSpace', data.school_base.size, { root: true })
         },

+ 2 - 1
TEAMModelOS/ClientApp/src/view/learnactivity/MgtSchoolEva.vue

@@ -83,7 +83,8 @@
                                 <Icon size="25" custom="iconfont icon-qr-code" class="qr-code-icon" />
                             </span>
                         </div>
-                        <EmptyData v-if="evaListShow.length == 0" style="margin-top:100px;" :textContent="`${scope == 'school' ? curPdInfo.name || '' : ''}${$t('learnActivity.mgtScEv.nodata')}`"></EmptyData>
+                        <!-- <EmptyData v-if="evaListShow.length == 0" style="margin-top:100px;" :textContent="`${scope == 'school' ? curPdInfo.name || '' : ''}${$t('learnActivity.mgtScEv.nodata')}`"></EmptyData> -->
+                        <EmptyData v-if="evaListShow.length == 0" style="margin-top:100px;" :textContent="`${$t('learnActivity.mgtScEv.nodata')}`"></EmptyData>
                     </vuescroll>
                 </div>
             </div>

+ 1 - 1
TEAMModelOS/Controllers/Teacher/TeacherCommonController.cs

@@ -147,7 +147,7 @@ namespace TEAMModelOS.Controllers
             }
             List<CourseCount> schoolCourse = new List<CourseCount>();
             if (!string.IsNullOrEmpty(school)) {
-                await foreach (var item in client.GetContainer(Constant.TEAMModelOS, "Teacher").GetItemQueryIterator<CourseCount>(courseSql, requestOptions: new QueryRequestOptions() { PartitionKey = new PartitionKey($"Course-{school}") }))
+                await foreach (var item in client.GetContainer(Constant.TEAMModelOS, Constant.School).GetItemQueryIterator<CourseCount>(courseSql, requestOptions: new QueryRequestOptions() { PartitionKey = new PartitionKey($"Course-{school}") }))
                 {   
                     schoolCourse.Add(item);
                 }