Browse Source

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

Li 3 years ago
parent
commit
6d39d95e4b

+ 9 - 5
TEAMModelOS.SDK/Models/Service/StatisticsService.cs

@@ -436,13 +436,17 @@ namespace TEAMModelOS.SDK
             {
                 studyRecords.Add(item);
             }
-            string rcdsql  = $" where c.id in ({string.Join(",", studies.FindAll(x=>!string.IsNullOrEmpty(x.workId)).Select(o => $"'{o.workId}'"))})";
             List<HomeworkRecord> homeworkRecords = new List<HomeworkRecord>();
-            await foreach (var item in client.GetContainer("TEAMModelOS", "Teacher")
-            .GetItemQueryIterator<HomeworkRecord>(queryText: $"select value(c) from c {rcdsql} ", requestOptions: new QueryRequestOptions() { PartitionKey = new PartitionKey($"HomeworkRecord-{_tmdid}") }))
-            {
-                homeworkRecords.Add(item);
+            List<Study> workids= studies.FindAll(x => !string.IsNullOrEmpty(x.workId));
+            if (workids.IsNotEmpty()) {
+                string rcdsql = $" where c.id in ({string.Join(",", workids.Select(o => $"'{o.workId}'"))})";
+                await foreach (var item in client.GetContainer("TEAMModelOS", "Teacher")
+                .GetItemQueryIterator<HomeworkRecord>(queryText: $"select value(c) from c {rcdsql} ", requestOptions: new QueryRequestOptions() { PartitionKey = new PartitionKey($"HomeworkRecord-{_tmdid}") }))
+                {
+                    homeworkRecords.Add(item);
+                }
             }
+           
             List<OfflineRecord> offlines = new List<OfflineRecord>();
             activities.ForEach(item => {
                 Study study = studies.Find(y=>y.id.Equals(item.id));

+ 9 - 3
TEAMModelOS/ClientApp/src/components/syllabus/DragTree.vue

@@ -511,12 +511,14 @@
 						this.doDeleteBlobResource(rNodeLinks,data).then(result => {
 							// 如果是删除的第一层的节点 则直接访问API进行删除 如果不是 则记录子节点的PID
 							if(isFirstLevel){
-								this.$api.syllabus.DeleteTree({
+								let delParams = {
 									id:data.id,
 									code:this.curCode,
-									scope:this.volume.scope,
+									scope: this.isAbilityTree ? 'standard' : this.volume.scope,
 									standard:sessionStorage.getItem('standard')
-								}).then(res => {
+								}
+								let delFn = this.isAbilityTree ? this.$api.ability.DeleteTree(delParams) : this.$api.syllabus.DeleteTree(delParams)
+								delFn.then(res => {
 									if (!res.error) {
 										if(res.code === 404){
 											this.$parent.modifyIdArr  = this.$parent.modifyIdArr.filter(i => i !== data.id)
@@ -787,6 +789,10 @@
 			inSchoolAbility(){
 				return this.$route.name === 'abilityMgmt'
 			},
+			// 判断是否是微能力点的树形组件
+			isAbilityTree(){
+				return this.inSchoolAbility || this.$route.name === 'areaAbilityMgmt'
+			},
 			volumeList(){
 				return this.$parent.myVolumeList
 			}

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

@@ -110,7 +110,7 @@ export default {
 		place1:'输入能力点名称...',
 		compulsory:'必修',
 		hour:'总学时',
-		count:'能力点数',
+		count:'成长值',
 		dimension:'维度',
 		paper:'自我检测试卷',
 		add:'新增试题',

+ 3 - 3
TEAMModelOS/ClientApp/src/locale/lang/zh-CN/jyzx.js

@@ -129,7 +129,7 @@ export default{
         disByMe: "自评结果",
         disBySchool: "校评结果",
         spotCheck: "专家抽查",
-        testByMe: "自我检测结果",
+        testByMe: "自我练习结果",
         fine: "优秀",
         qualified: "合格",
         unqualified: "不合格",
@@ -137,8 +137,8 @@ export default{
         pass: "通过",
         noPass: "未通过",
         load: "提交材料",
-        againTest: "重新检测",
-        meTest: "自我检测",
+        againTest: "重新练习",
+        meTest: "自我练习",
         score: "前往评分",
         againScore: "重新评分",
         evaName: "评价人",

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

@@ -110,7 +110,7 @@ export default {
 		place1: '輸入能力點名稱...',
 		compulsory: '必修',
 		hour: '總學時',
-		count: '能力點數',
+		count: '成長值',
 		dimension: '維度',
 		paper: '自我檢測試卷',
 		add: '新增試題',

+ 3 - 3
TEAMModelOS/ClientApp/src/locale/lang/zh-TW/jyzx.js

@@ -129,7 +129,7 @@ export default{
         disByMe: "自評結果",
         disBySchool: "校評結果",
         spotCheck: "專家抽查",
-        testByMe: "自我檢測結果",
+        testByMe: "自我練習結果",
         fine: "優秀",
         qualified: "合格",
         unqualified: "不合格",
@@ -137,8 +137,8 @@ export default{
         pass: "通過",
         noPass: "未通過",
         load: "上傳文件",
-        againTest: "重新檢測",
-        meTest: "自我檢測",
+        againTest: "重新練習",
+        meTest: "自我練習",
         score: "前往評分",
         againScore: "重新評分",
         evaName: "評估人",

+ 1 - 1
TEAMModelOS/ClientApp/src/utils/directive.js

@@ -13,7 +13,7 @@ const specialChar = {
     bind: function (el, binding, vnode) {
         // 正则规则可根据需求自定义
         // var regRule = /[`~!@#$%^&*()\-+=<>?:"{}|,.\/;'\\[\]·~!@#¥%……&*()——\-+={}|《》?:“”【】、;‘’,。、]/g
-        let regRule = /[`~!#$^&*\+=<>?"{}|,;'\\[\]·~!#&*\-+={}|]/g
+        let regRule = /[`~?$^&*\|]/g
         let isChinese = false
         let $inp = findEle(el, 'input')
         el.$inp = $inp

+ 2 - 2
TEAMModelOS/ClientApp/src/view/abilityMgmt/Index.vue

@@ -103,7 +103,7 @@
 					{{ $t('ability.mgmt.chapter') }}
 					<span class="syllabus-content-header-tools"
 						v-if="volumeList.length && curVolume.id && !inShareView">
-						<Icon type="md-add" @click="isAddTreeModal = true" v-if="(hasSyllabusAuth || hasVolumeAuth(curVolume.auth)) &&  hasAbilityAuth" />
+						<Icon type="md-add" @click="isAddTreeModal = true" v-if="hasAbilityAuth" />
 					</span>
 				</div>
 				<div class="syllabus-tree-box">
@@ -259,7 +259,7 @@
 									<InputNumber :max="100" :min="1" v-model="addVolumeForm.hour"></InputNumber>
 								</FormItem>
 								<FormItem :label="$t('ability.mgmt.count')" prop="abilityCount">
-									<InputNumber :max="100" :min="1" v-model="addVolumeForm.abilityCount"></InputNumber>
+									<InputNumber :max="100" :min="1" v-model="addVolumeForm.abilityCount" disabled></InputNumber>
 								</FormItem>
 							</div>
 						</div>

+ 18 - 1
TEAMModelOS/Controllers/Research/AbilitySubController.cs

@@ -925,15 +925,32 @@ namespace TEAMModelOS.Controllers
                     case "ReadSelfFileRcd":
                         //获取视文件学习记录
                         List<dynamic> files = new List<dynamic>();
+                        List<dynamic> abilityFiles = new List<dynamic>();
                         try {
                             TeacherFile teacherFilercd = await client.GetContainer("TEAMModelOS", "Teacher").ReadItemAsync<TeacherFile>($"{_tmdid}", new PartitionKey($"TeacherFile-{_school}"));
+                            HashSet<string> abilityIds= teacherFilercd.fileRecords.SelectMany(x => x.files).Select(x => x.abilityId).ToHashSet() ;
                             teacherFilercd.fileRecords.ForEach(x => {
                                 var file = x.files.FindAll(y => y.abilityId.Equals($"{_abilityId}"));
                                 if (file.IsNotEmpty()) {
                                     files.Add(new { ability =file,view=x.view,hash=x.hash,done=x.done });
                                 }
                             });
-                            return Ok(new { status, files  });
+
+                            foreach (var abid in abilityIds) {
+                               var record= teacherFilercd.fileRecords.FindAll(x => x.files.Where(y => y.abilityId.Equals(abid)).Count() > 0);
+                                long  view = 0;
+                                List<dynamic> urls = new List<dynamic>();
+                                record.ForEach(x => {
+                                    var file= x.files.FindAll(y => y.abilityId.Equals($"{abid}"));
+                                    if (file.IsNotEmpty())
+                                    {
+                                        view += x.view;
+                                        urls.Add(new { ability = file, view = x.view, hash = x.hash, done = x.done });
+                                    }
+                                });
+                                abilityFiles.Add(new { view, urls , abilityId= abid });
+                            }
+                            return Ok(new { status, files, abilityFiles });
                         } catch (Exception ex) { 
                         
                         }

+ 4 - 1
TEAMModelOS/Controllers/Teacher/InitController.cs

@@ -225,7 +225,10 @@ namespace TEAMModelOS.Controllers
                             {
                                 access = 1;
                             }
-                            setting.accessConfig = null;
+                            if (setting != null)
+                            {
+                                setting.accessConfig = null;
+                            }
                             areas.Add(new AreaDto { areaId = area.id, name = area.name, standard = area.standard, standardName = area.standardName, setting= setting, access = access });
                         }
                         catch (CosmosException)

+ 3 - 1
TEAMModelOS/Services/Common/TeacherService.cs

@@ -76,7 +76,9 @@ namespace TEAMModelOS.Services
                             if (setting != null && !string.IsNullOrWhiteSpace(setting.accessConfig)) {
                                 access = 1;
                             }
-                            setting.accessConfig = null;
+                            if (setting != null) {
+                                setting.accessConfig = null;
+                            }
                             areas.Add(new AreaDto { areaId = area.id, name = area.name,standard= area.standard,standardName= area.standardName,setting=setting, access= access });
                         }
                         catch (CosmosException)