Forráskód Böngészése

Merge branch 'develop' of http://163.228.141.122:3000/TEAMMODEL/TEAMModelOS into develop

hhb 5 hónapja
szülő
commit
ec5491992c

+ 2 - 2
TEAMModelOS.Function/CosmosDBTriggers/TriggerExam.cs

@@ -363,7 +363,7 @@ namespace TEAMModelOS.CosmosDBTriggers
                                     await tasks.TaskPage(10);
 
                                 }
-                                else
+                                /*else
                                 {
                                     //处理单科结算时科目与试卷信息匹配的问题
                                     int gno = 0;
@@ -392,7 +392,7 @@ namespace TEAMModelOS.CosmosDBTriggers
                                         info.average = settlement.score;
                                         await client.GetContainer(Constant.TEAMModelOS, "Common").ReplaceItemAsync<ExamInfo>(info, info.id, new PartitionKey(info.code));
                                     }
-                                }
+                                }*/
                             }
                             catch (Exception e)
                             {

+ 1 - 0
TEAMModelOS.SDK/Extension/CoreTokenExtensions.cs

@@ -53,6 +53,7 @@ namespace TEAMModelOS.SDK.Extension
             return result;
         }
         //https://learn.microsoft.com/zh-cn/entra/identity-platform/access-tokens   验证的相关文档
+        //https://login.chinacloudapi.cn/4807e9cf-87b8-4174-aa5b-e76497d7392b/v2.0/.well-known/openid-configuration
         public static async Task<JwtSecurityToken> Validate(string jwtTokenToValidate, string location,string tenantId, IConfiguration configuration)
         {
           //  var tenantId = "4807e9cf-87b8-4174-aa5b-e76497d7392b";

+ 0 - 2
TEAMModelOS.SDK/Extension/Utils.cs

@@ -202,8 +202,6 @@ namespace TEAMModelOS.SDK.Extension
         #endregion
 
 
-
-
         #region private
         private static int SetRandomSeeds(int length)
         {

+ 89 - 62
TEAMModelOS/ClientApp/src/components/student-web/EventView/EventContentTypeTemplate/PaperViewBox/ArtTestReport.vue

@@ -1,14 +1,15 @@
 <template>
     <div class="art-paper-content">
-        <div v-show="isLoad">
-            <Spin fix style="background-color: rgba(0, 0, 0, 0.3); color: #1e79da; font-size: 30px;">
-                <i-circle :percent="quesProcess" stroke-color="#1e79da" trail-color="#d4d4d4" :size="160">
-                    <span class="demo-Circle-inner" style="font-size: 34px">{{ quesProcess }}%</span>
+        <div v-show="isLoadQues">
+            <Spin fix class="art-spin" style="background-color: rgba(0, 0, 0, 0.6); color: #07ac88; font-size: 20px;">
+                <i-circle :percent="quesProcess" stroke-color="#07ac88" trail-color="#fff" :size="120">
+                    <span class="demo-Circle-inner" style="font-size: 30px">{{ quesProcess }}%</span>
                 </i-circle>
-                <div>试题加载中</div>
+                <div>试题载入中,请耐心等待</div>
+                <span style="font-size: 12px;color: #666 !important;">若长时间卡住,请 <a href="#" @click.prevent="handleLink()">刷新页面</a> 后重试 </span>
             </Spin>
         </div>
-        <!-- <Loading v-show="isLoad" bgColor="rgba(0, 0, 0, 0.3)"></Loading> -->
+        <Loading v-show="isLoad" bgColor="rgba(0, 0, 0, 0.3)"></Loading>
         <vuescroll>
             <EventBasicInfo :info="nowActive" />
             <div class="art-box">
@@ -23,26 +24,20 @@
                             </h2>
                         </div>
                         <div class="scoreboard">
-                            <div v-if="!item.paperInfo.length" style="padding: 25px;">
-                                <Icon type="md-alert" size="18" color="orange" class="warm-icon" style="margin-right: 5px;" />
-                                <span class="warm-hint">
-                                    试卷存在问题,无法查看
-                                </span>
-                            </div>
-                            <template v-else>
-                                <div v-show="item.testState === 1" @click="showTest(item)" style="width: 100%; font-size: 25px; font-weight: 800; padding: 17px;cursor: pointer;">
+                            <div v-show="item.testState === 1">
+                                <div @click="onLoadQues(item)" style="width: 100%; font-size: 25px; font-weight: 800; padding: 17px;cursor: pointer;">
                                     <Icon custom="iconfont icon-dianji" size="30" color="#03966a" />
                                     <span style="color: #03966a; margin-left: 10px;">{{ $t("studentWeb.exam.report.anwser") }}</span>
                                     <Icon custom="iconfont icon-weizuoda" size="50" style="margin-left: 50px;" />
                                 </div>
-                                <h4 v-show="item.testState === 2 || item.testState === 3" style="padding: 25px;">
-                                    <Icon type="md-checkmark-circle-outline" class="warm-icon" color="green" />
-                                    {{ $t("studentWeb.exam.report.noRes") }}
-                                    <!-- <Icon type="md-ribbon" size="50" color="#03966a" style="margin-left: 20px;" /> -->
-                                    <!-- <Icon type="md-thumbs-up" size="50" color="#03966a" style="margin-left: 20px;" /> -->
-                                    <Icon custom="iconfont icon-yiwancheng" size="50" color="#01adff" style="margin-left: 50px;" />
-                                </h4>
-                            </template>
+                            </div>
+                            <h4 v-show="item.testState === 2 || item.testState === 3" style="padding: 25px;">
+                                <Icon type="md-checkmark-circle-outline" class="warm-icon" color="green" />
+                                {{ $t("studentWeb.exam.report.noRes") }}
+                                <!-- <Icon type="md-ribbon" size="50" color="#03966a" style="margin-left: 20px;" /> -->
+                                <!-- <Icon type="md-thumbs-up" size="50" color="#03966a" style="margin-left: 20px;" /> -->
+                                <Icon custom="iconfont icon-yiwancheng" size="50" color="#01adff" style="margin-left: 50px;" />
+                            </h4>
                         </div>
                         <template v-if="item.homework.length">
                             <div v-for="(hw, index) in item.homework" :key="index">
@@ -87,6 +82,7 @@ export default {
     data () {
         return {
             isLoad: false,
+            isLoadQues: false,
             paperData: [], //试卷信息:学生作答记录、批注、知识点等
             artExam: [],
             artInfo: undefined, //艺术活动信息
@@ -252,9 +248,9 @@ export default {
                     this.artExam = subList
                     let listss = await this.getSubPaper()
                     console.log('试卷列表', listss);
-                    if(listss.length) {
+                    /* if(listss.length) {
                         let infos = await this.getPaper()
-                    }
+                    } */
                 }
             }).finally(() => {
                 this.isLoad = false
@@ -279,6 +275,7 @@ export default {
                             this.$api.studentWeb.FindStudentPaper(params).then(res => {
                                 if(res.status === 200) {
                                     if(res.papers.length) {
+                                        let date = (new Date()).getTime() //当前时间
                                         let blob = this.stusInfo.find(stu => {
                                             return stu.subject === res.subjects[0].id
                                         })
@@ -296,11 +293,12 @@ export default {
                                             item.examInfo[i].subject = res.subjects[i]
                                             item.examInfo[i].allClass = res.claId
                                             item.examInfo[i].isOrder = this.getItemTitle.type === 'Art' ? item.exam[0].isOrder : 0
+                                            let queNum = res.subjects[i].id === 'subject_music' ? 17 : 32
                                             if(res.stuAns.length) {
                                                 console.log(res.stuAns, i, res.stuAns[i]);
                                                 if (!res.stuAns[i].length) {
                                                     item.examInfo[i].stuAns = []
-                                                    item.examInfo[i].stuScore = []
+                                                    item.examInfo[i].stuScore = (item.examInfo[i].point && item.examInfo[i].point.length) ? Array(item.examInfo[i].point.length).fill(-1) : Array(queNum).fill(-1)
                                                 } else {
                                                     item.examInfo[i].stuAns = res.stuAns[i]
                                                     // 批注
@@ -309,9 +307,17 @@ export default {
                                                 }
                                             } else {
                                                 item.examInfo[i].stuAns = []
-                                                item.examInfo[i].stuScore = []
+                                                item.examInfo[i].stuScore = (item.examInfo[i].point && item.examInfo[i].point.length) ? Array(item.examInfo[i].point.length).fill(-1) : Array(queNum).fill(-1)
                                             }
                                             item.examInfo[i].taskStatus = item.exam[0].taskStatus
+                                            
+                                            let k = 0
+                                            for (let score of item.examInfo[i].stuScore) {
+                                                if (score == -1) {   //有未打分
+                                                    k++
+                                                }
+                                            }
+                                            item.testState = k ? (item.examInfo[i].stuAns ? (this.artInfo.examDeadline && this.artInfo.examDeadline < date) ? 2 : 1 : 2) : 3
                                         }
                                         r(true)
                                     } else {
@@ -337,52 +343,62 @@ export default {
                 })
             })
         },
+        async onLoadQues(art) {
+            // this.artQuesTotal = 0
+            this.processNum = 0
+            this.isLoadQues = true
+            let infos = await this.getPaper(art.subject.id)
+            // this.isLoadQues = false
+            this.showTest(art)
+        },
         // 获取试卷信息
-        getPaper() {
+        getPaper(type) {
             return new Promise((resolve, reject) => {
                 let date = (new Date()).getTime() //当前时间
                 let promiseArr = []
                 this.artExam.forEach(item => {
-                    promiseArr.push(new Promise(async (r, j) => {
-                        let codes = this.getItemTitle.scope == 'school' ? this.getItemTitle.school : this.getItemTitle.creatorId
-                        if(item.examInfo[0]?.blob) {
-                            let code = {
-                                scope: this.getItemTitle.scope,
-                                code: codes,
-                                blob: item.examInfo[0].blob,
-                                examId: codes
-                            }
-                            try {
-                                item.paperInfo.push(await this.getStuPaper(code))
-                            } catch (error) {
-                                this.$Message.error(this.$t("studentWeb.exam.examError"))
-                                this.isLoad = false
-                                r(undefined)
-                            }
-                            if(item.examInfo[0].stuScore != undefined) {
-                                if (item.examInfo[0].stuScore[0] == undefined) {
-                                    let score = []
-                                    for (let info of item.paperInfo[0].slides) {
-                                        if (info.type !== 'compose') {
-                                            score.push(-1)
+                    if(type === item.subject.id) {
+                        promiseArr.push(new Promise(async (r, j) => {
+                            let codes = this.getItemTitle.scope == 'school' ? this.getItemTitle.school : this.getItemTitle.creatorId
+                            if(item.examInfo[0]?.blob) {
+                                let code = {
+                                    scope: this.getItemTitle.scope,
+                                    code: codes,
+                                    blob: item.examInfo[0].blob,
+                                    examId: codes
+                                }
+                                try {
+                                    item.paperInfo.push(await this.getStuPaper(code))
+                                } catch (error) {
+                                    this.$Message.error(this.$t("studentWeb.exam.examError"))
+                                    this.isLoad = false
+                                    r(undefined)
+                                }
+                                if(item.examInfo[0].stuScore != undefined) {
+                                    if (item.examInfo[0].stuScore[0] == undefined) {
+                                        let score = []
+                                        for (let info of item.paperInfo[0].slides) {
+                                            if (info.type !== 'compose') {
+                                                score.push(-1)
+                                            }
                                         }
+                                        item.examInfo[0].stuScore = score
                                     }
-                                    item.examInfo[0].stuScore = score
                                 }
-                            }
-                            let k = 0
-                            for (let score of item.examInfo[0].stuScore) {
-                                if (score == -1) {   //有未打分
-                                    k++
+                                let k = 0
+                                for (let score of item.examInfo[0].stuScore) {
+                                    if (score == -1) {   //有未打分
+                                        k++
+                                    }
                                 }
+                                item.testState = k ? (item.examInfo[0].stuAns ? (this.artInfo.examDeadline && this.artInfo.examDeadline < date) ? 2 : 1 : 2) : 3
+                                console.error('试卷信息', item.paperInfo)
+                                r(true)
+                            } else {
+                                r(undefined)
                             }
-                            item.testState = k ? (item.examInfo[0].stuAns ? (this.artInfo.examDeadline && this.artInfo.examDeadline < date) ? 2 : 1 : 2) : 3
-                            console.error('试卷信息', item.paperInfo)
-                            r(true)
-                        } else {
-                            r(undefined)
-                        }
-                    }))
+                        }))
+                    }
                 })
                 Promise.allSettled(promiseArr).then(result => {
                     console.log('Promise', result);
@@ -518,10 +534,21 @@ export default {
             this.previewFile = item
             this.previewStatus = true
         },
+        handleLink() {
+            window.location.reload()
+        },
     }
 }
 </script>
 
+
+<style lang="less">
+.art-spin .ivu-spin-text {
+    background: #ffffff;
+    padding: 30px;
+    border-radius: 10px;
+}
+</style>
 <style lang="less" scoped>
 @import "./ArtTestReport.less";
 </style>

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

@@ -656,7 +656,13 @@ import ArtTestReport from "./EventContentTypeTemplate/PaperViewBox/ArtTestReport
                         // 同学名单
                         let names = ids.length ? await this.getClassName(ids, true) : []
                         let todayDay = new Date().getTime()
-                        for (let item of res.datas) {
+                        let datasss = res.datas
+                        
+                        // let filterNames = ['2024青羊区艺术评测五年级','2024青羊区艺术评测八年级']
+                        // if(!localStorage.testView){
+                        //     datasss = datasss.filter(i => !filterNames.includes(i.name))
+                        // }
+                        for (let item of datasss) {
                             if(this.isScale && item.type === 'Art' || !this.isScale) {
                                 item.progress = this.timeStatus(item, true)
                                 item.stuProgress = this.timeStatus(item)

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

@@ -621,6 +621,10 @@ export default {
                     ids = Array.from(new Set([].concat.apply([], ids)))
                     let names = ids.length ? await this.getClassName(ids, true) : []
                     let todayDay = new Date().getTime()
+                    // let filterNames = ['2024青羊区艺术评测五年级','2024青羊区艺术评测八年级']
+                    // if(!localStorage.testView){
+                    //     datasss = datasss.filter(i => !filterNames.includes(i.name))
+                    // }
                     for (let item of datasss) {
                         if(this.isScale && item.type === 'Art' || !this.isScale) {
                             item.className = []

+ 33 - 0
TEAMModelOS/Dockerfile

@@ -0,0 +1,33 @@
+# 请参阅 https://aka.ms/customizecontainer 以了解如何自定义调试容器,以及 Visual Studio 如何使用此 Dockerfile 生成映像以更快地进行调试。
+
+# 此阶段用于在快速模式(默认为调试配置)下从 VS 运行时
+FROM mcr.microsoft.com/dotnet/aspnet:8.0-noble AS base
+USER app
+WORKDIR /app
+EXPOSE 8080
+EXPOSE 8081
+
+
+# 此阶段用于生成服务项目
+FROM mcr.microsoft.com/dotnet/sdk:8.0-noble AS build
+ARG BUILD_CONFIGURATION=Release
+WORKDIR /src
+COPY ["nuget.config", "."]
+COPY ["TEAMModelOS/TEAMModelOS.csproj", "TEAMModelOS/"]
+COPY ["TEAMModelOS.Extension/HTEX.Lib/HTEX.Lib.csproj", "TEAMModelOS.Extension/HTEX.Lib/"]
+COPY ["TEAMModelOS.SDK/TEAMModelOS.SDK.csproj", "TEAMModelOS.SDK/"]
+RUN dotnet restore "./TEAMModelOS/TEAMModelOS.csproj"
+COPY . .
+WORKDIR "/src/TEAMModelOS"
+RUN dotnet build "./TEAMModelOS.csproj" -c $BUILD_CONFIGURATION -o /app/build
+
+# 此阶段用于发布要复制到最终阶段的服务项目
+FROM build AS publish
+ARG BUILD_CONFIGURATION=Release
+RUN dotnet publish "./TEAMModelOS.csproj" -c $BUILD_CONFIGURATION -o /app/publish /p:UseAppHost=false
+
+# 此阶段在生产中使用,或在常规模式下从 VS 运行时使用(在不使用调试配置时为默认值)
+FROM base AS final
+WORKDIR /app
+COPY --from=publish /app/publish .
+ENTRYPOINT ["dotnet", "TEAMModelOS.dll"]

+ 3 - 3
TEAMModelOS/Startup.cs

@@ -202,9 +202,9 @@ namespace TEAMModelOS
             services.AddXkwAPIHttpService(Configuration);
             //services.AddHostedService<>
            // services.AddSingleton<ILoggerProvider, BlobLoggerProvider>();
-            services.AddMvcFilter<RequestAuditFilter>();
+           // services.AddMvcFilter<RequestAuditFilter>();
             services.AddNetMail();
-            services.AddSignalR().AddAzureSignalR(o=>o.ConnectionString=Configuration.GetValue<string>("Azure:SignalR:ConnectionString"));
+            //services.AddSignalR().AddAzureSignalR(o=>o.ConnectionString=Configuration.GetValue<string>("Azure:SignalR:ConnectionString"));
             //services.AddSignalR();
 #if !DEBUG
  //第一步: 配置gzip与br的压缩等级为最优
@@ -283,7 +283,7 @@ namespace TEAMModelOS
             app.UseEndpoints(endpoints =>
             {
                 //  endpoints.MapHub<IESHybridCloudHub>("/hub/hybrid-cloud").RequireCors("any");
-                endpoints.MapHub<IESHybridCloudHub>("/hub/hybrid-cloud");
+                //endpoints.MapHub<IESHybridCloudHub>("/hub/hybrid-cloud");
                 endpoints.MapControllers();
                 endpoints.MapServerSentEvents("/service/sse", new ServerSentEventsOptions
                 {

+ 2 - 0
TEAMModelOS/TEAMModelOS.csproj

@@ -9,6 +9,7 @@
 		<PackageReference Include="IP2Region.Net" Version="2.0.2" />
 		<!--<PackageReference Include="JsonPath.Net" Version="1.1.2" />-->
 		<PackageReference Include="Microsoft.Extensions.DependencyInjection" Version="8.0.0" />
+		<PackageReference Include="Microsoft.VisualStudio.Azure.Containers.Tools.Targets" Version="1.21.0" />
 		<PackageReference Include="SKIT.FlurlHttpClient.Wechat.TenpayV3" Version="2.20.0" />
 		<!--<PackageReference Include="System.Security.Cryptography.Algorithms" Version="3.5.0" />-->
 	</ItemGroup>
@@ -90,6 +91,7 @@
 		<Product>TEAMModelOS</Product>
 		<Copyright>© 2021 HABOOK Group 醍摩豆</Copyright>
 		<PackageProjectUrl>https://www.teammodel.cn</PackageProjectUrl>
+		<DockerDefaultTargetOS>Linux</DockerDefaultTargetOS>
 	</PropertyGroup>
 
 	<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|AnyCPU'">