소스 검색

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

zhouj1203@hotmail.com 2 년 전
부모
커밋
e844354d33

+ 5 - 3
TEAMModelOS.SDK/Models/Service/Common/SyllabusService.cs

@@ -28,7 +28,7 @@ namespace TEAMModelOS.SDK.Services
         /// <param name="pid"></param>
         /// <param name="newNodes"></param>
         /// <returns></returns>
-        public async static Task<(List<List<IdCode>> idCodes, List<SyllabusTreeNode> tree)> ImportSyllabus(List<List<string>> nodes,string volumeId,string scope ,string code,string creatorId ,string creatorName, AzureCosmosFactory azureCosmos, bool ignoreCharacter = true) { 
+        public async static Task<(List<List<IdCode>> idCodes, List<SyllabusTreeNode> tree)> ImportSyllabus(List<List<string>> nodes,string volumeId,string scope ,string code,string creatorId ,string creatorName,string grant_type, AzureCosmosFactory azureCosmos, bool ignoreCharacter = true) { 
             HashSet<Syllabus> syllabuses= new HashSet<Syllabus>();
             string tbname = scope.Equals("school", StringComparison.OrdinalIgnoreCase) ? Constant.School : Constant.Teacher;
             await foreach (var item in azureCosmos.GetCosmosClient().GetContainer(Constant.TEAMModelOS, tbname).GetItemQueryIterator<Syllabus>(queryText: $"select value(c) from c where c.volumeId='{volumeId}'",
@@ -142,13 +142,15 @@ namespace TEAMModelOS.SDK.Services
                     volume.syllabusIds.Add(chapter.id);
                     volumeChange = true;
                 }
-                await azureCosmos.GetCosmosClient().GetContainer(Constant.TEAMModelOS, tbname).UpsertItemAsync(chapter);
+                if (!string.IsNullOrWhiteSpace(grant_type) && grant_type.Equals("upsert")) {
+                    await azureCosmos.GetCosmosClient().GetContainer(Constant.TEAMModelOS, tbname).UpsertItemAsync(chapter);
+                }
                 List<SyllabusTree> trees = SyllabusService.ListToTree(chapter.children);
                 SyllabusTreeNode tree = new SyllabusTreeNode() { id = chapter.id, scope = chapter.scope, trees = trees, volumeId = chapter.volumeId, auth = chapter.auth, codeval = code };
                 treeNodes.Add(tree);
 
             }
-            if (volumeChange)
+            if (volumeChange && !string.IsNullOrWhiteSpace(grant_type) && grant_type.Equals("upsert"))
             {
                 await azureCosmos.GetCosmosClient().GetContainer(Constant.TEAMModelOS, tbname).ReplaceItemAsync(volume, volume.id, new PartitionKey(volume.code));
             }

+ 2 - 1
TEAMModelOS/ClientApp/public/index.html

@@ -21,7 +21,8 @@
 		const navLang = curLang || navigator.language.toLowerCase()
 		const localLang = (navLang === 'zh' || navLang === 'zh-tw' || navLang === 'zh-cn' || navLang === 'zh-hk') ? navLang : false
 		const lang = localLang || 'en-us'
-		const langJsUrl = 'https://' + window.location.host + '/lang/' + lang + '.js'
+		const timestamp = new Date().getTime()
+		const langJsUrl = 'https://' + window.location.host + '/lang/' + lang + '.js?t=' + timestamp
 		document.write('<script  src="' + langJsUrl + '"><\/script>')
 		// 公式MathJax配置
 		MathJax = {

+ 1 - 1
TEAMModelOS/ClientApp/public/lang/en-US.js

@@ -1160,7 +1160,7 @@ const LANG_EN_US = {
         confirmAdd: 'Confirm Add',
         cancelAdd: 'Cancel Add',
         createList: 'Create Customized Class',
-        name: 'Name: ',
+        name: 'Name ',
         nameHolder: 'Please enter list name...',
         nameRepeat: 'The customized class name is duplicated',
         pdHolder: 'Please set the school system',

+ 1 - 0
TEAMModelOS/ClientApp/public/lang/zh-CN.js

@@ -5656,6 +5656,7 @@ const LANG_ZH_CN = {
             policy: '政策文件',
             research: '课例数据',
             toSokrates: '苏格拉底管理',
+            toSokrates2: '苏格拉底',
             researchBoard: '数据看板',
             cusVideos: '课例数据',
             cusVideoMgt: '课堂记录管理',

+ 1 - 1
TEAMModelOS/ClientApp/public/lang/zh-TW.js

@@ -1160,7 +1160,7 @@ const LANG_ZH_TW = {
         confirmAdd: '確認新增',
         cancelAdd: '取消新增',
         createList: '新增選課班',
-        name: '名稱',
+        name: '名稱 ',
         nameHolder: '請輸入名單名稱…',
         nameRepeat: '選課班名稱重複',
         pdHolder: '請設定學段',

+ 7 - 5
TEAMModelOS/ClientApp/src/components/student-web/EventView/EventContentTypeTemplate/LessonTestReportCharts/BaseScatter.vue

@@ -60,11 +60,13 @@ export default {
             height: '150px'
           },
           formatter: function (params) {
-            const item = params
-            return `${_this.$t('totalAnalysis.base_name')}:${item.data[2]}
-                        <br/>${_this.$t('totalAnalysis.sca_chart_text1')}:${item.data[1]}%
-                        <br/>${_this.$t('totalAnalysis.sca_chart_text2')}:${item.data[0]}
-                       `
+            if(params.data[4] === _this.$store.state.userInfo.sub) {
+              const item = params
+              return `${_this.$t('totalAnalysis.base_name')}:${item.data[2]}
+                          <br/>${_this.$t('totalAnalysis.sca_chart_text1')}:${item.data[1]}%
+                          <br/>${_this.$t('totalAnalysis.sca_chart_text2')}:${item.data[0]}
+                        `
+            }
           }
         },
         // toolbox: {

+ 3 - 1
TEAMModelOS/Controllers/Both/SyllabusController.cs

@@ -66,11 +66,13 @@ namespace TEAMModelOS.Controllers
             if (!request.TryGetProperty("volumeId", out JsonElement _volumeId)) return BadRequest();
             if (!request.TryGetProperty("scope", out JsonElement _scope)) return BadRequest();
             if (!request.TryGetProperty("code", out JsonElement _code)) return BadRequest();
+            //操作类型  preview  upsert
+            if (!request.TryGetProperty("grant_type", out JsonElement _grant_type)) return BadRequest();
             bool ignoreCharacter = false;
             if (request.TryGetProperty("ignoreCharacter", out JsonElement _ignoreCharacter)) {
                 ignoreCharacter = _ignoreCharacter.ValueKind.Equals(JsonValueKind.True)?true:false;
             }
-            (List<List<IdCode>> idCodes, List<SyllabusTreeNode> tree) data =  await  SyllabusService.ImportSyllabus(nodes, $"{_volumeId}", $"{_scope}", $"{_code}", userid, name,_azureCosmos,ignoreCharacter);
+            (List<List<IdCode>> idCodes, List<SyllabusTreeNode> tree) data =  await  SyllabusService.ImportSyllabus(nodes, $"{_volumeId}", $"{_scope}", $"{_code}", userid, name,$"{_grant_type}",_azureCosmos,ignoreCharacter);
             return Ok(new {codes= data.idCodes, data.tree });
         }
         /// <summary>