Explorar o código

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

OnePsycho %!s(int64=2) %!d(string=hai) anos
pai
achega
777e6f4221

+ 23 - 0
TEAMModelOS.SDK/DI/CoreAPI/CoreAPIHttpService.cs

@@ -47,6 +47,29 @@ namespace TEAMModelOS.SDK
             _httpClient = httpClient;
             options = optionsMonitor;
         }
+        /*
+        hubName	string	Optional	指定要傳送到哪個訊息中樞,若沒給則不傳送端外通知,只會發送端內通知。(目前只有"hita"及"hita5"能使用)
+        sender	string	Optional	發送訊息的來源端
+        tags	string array	Required	接收對象或手機註冊的tag,ID或服務等...
+        title	string	Optional	標題,會"直接"顯示於端外通知的title位置
+        body	string	Optional	正文,會"直接"顯示於端外通知的body位置
+        eventId	string	Optional	事件ID
+        eventName	string	Optional	事件名稱
+        data	string	Optional	額外資料
+         */
+        /// <summary>
+        ///  發送端內外通知
+        /// </summary>
+        /// <param name="clientID"></param>
+        /// <param name="clientSecret"></param>
+        /// <param name="location"></param>
+        /// <param name="url"></param>
+        /// <param name="data"></param>
+        /// <returns></returns>
+        public async Task<(HttpStatusCode code, string content)> PushNotify(Dictionary<string, object> data, string location, IConfiguration _configuration, DI.DingDing _dingDing) {
+            return (HttpStatusCode.BadRequest, null);
+        }
+
         /// <summary>
         ///  发送短信验证码
         /// </summary>

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

@@ -160,6 +160,17 @@
                                 <!-- <p class="list-item-time isScore" v-show="timeStatus(item) == 'finish'">
                                     得分率:20%
                                 </p> -->
+                                <p v-if="item.owner === 'school'">
+                                    <span v-if="item.ext">
+                                        <span v-if="item.ext.subjects">
+                                            <span v-for="(item, index) in item.ext.subjects" :key="index"
+                                                class="tag-style tag-subject text-long" :title="item.name"
+                                            >
+                                                {{ item.name }}
+                                            </span>
+                                        </span>
+                                    </span>
+                                </p>
                                 <!-- <p style="font-size:12px; margin-top: 5px; word-break: keep-all;">
                                     <span v-if="item.ext">
                                         <span v-if="item.ext.subjects">
@@ -610,7 +621,7 @@ import QuesNaire from "./EventContentTypeTemplate/QuesNaire";
                             if(this.showType.length === 1) {
                             // if(this.showType[0] === 'Exam') {
                                 return this.showType.includes(item.type) && item.classIds.includes(this.courseNow.list) &&
-                                    (item.subjects.includes(this.courseNow.subject.id) || item.subjects.includes(this.courseNow.id))
+                                    item.owner === 'school' ? item.creatorId === this.courseNow.roster.teacherId : (item.subjects.includes(this.courseNow.subject.id) || item.subjects.includes(this.courseNow.id))
                             } else {
                                 return this.showType.includes(item.type)
                             }

+ 4 - 3
TEAMModelOS/ClientApp/src/components/student-web/HomeView/newHomeView.vue

@@ -642,7 +642,7 @@ export default {
         },
         sentSelectedEventTitle(item) {
             if(item.type === "Exam" || item.type === "Homework") {
-                let index =  this.getCourseIndex(item.subjects, item.classIds)
+                let index =  this.getCourseIndex(item.owner === 'school' ? item.creatorId : item.subjects, item.classIds, item.owner === 'school')
                 if(index === -1) {
                     this.$Message.error("未找到发布该活动的课程")
                 } else {
@@ -714,10 +714,11 @@ export default {
                 })
             }
         },
-        getCourseIndex(ids, classIds) {
+        getCourseIndex(ids, classIds, isSchool) {
             return this.getAllCourse.findIndex(course => {
                 // 要同时匹配课程和班级id
-                return (ids.includes(course.id) || ids.includes(course.subject.id)) && classIds.includes(course.list)
+                // 学校发布的只匹配老师和名单
+                return (isSchool ? ids === course.roster.teacherId : (ids.includes(course.id) || ids.includes(course.subject.id))) && classIds.includes(course.list)
             })
         },
     },