فهرست منبع

Add: 课纲试题预览优化&&课堂记录开关

OnePsycho 2 سال پیش
والد
کامیت
14a325b0b3

+ 5 - 3
TEAMModelOS/ClientApp/public/lang/en-US.js

@@ -3560,6 +3560,7 @@ const LANG_EN_US = {
         scType: 'School Type:',
         scType1: 'K–12',
         scType2: 'Higher Education Institutions (HEIs)',
+        openLessonRecord: 'Lesson Record Management',
         proSetting: 'Professional Subject',
         curSemSta: 'Current Status:',
         schoolNameLabel: 'School Name:',
@@ -5473,6 +5474,7 @@ const LANG_EN_US = {
         type3: 'Exam File',
         type4: 'Local File',
         type5: 'Hyperlink',
+        type6: 'Other File',
         preview: 'View',
         remove: 'Delete',
         upload: 'Upload Local File',
@@ -5647,11 +5649,11 @@ const LANG_EN_US = {
             appAssassment: 'Evaluation Item',
             discuss: 'Discussion Center',
             policy: 'Policy Document',
-            research: 'Lesson',
-            toSokrates: 'Sokrates',
+            research: 'Lesson Data',
+            toSokrates: 'Sokrates Management',
             researchBoard: 'Data Board',
             cusVideos: 'Lesson Data',
-            cusVideoMgt: 'Records',
+            cusVideoMgt: 'Records Management',
             lockTips: 'Lock Menu Bar',
             unlockTips: 'Unlock Menu Bar',
             platform: 'Resource Platform',

+ 5 - 3
TEAMModelOS/ClientApp/public/lang/zh-CN.js

@@ -3563,6 +3563,7 @@ const LANG_ZH_CN = {
         scType: '学校类型:',
         scType1: '普教',
         scType2: '高教',
+        openLessonRecord: '课堂记录管理',
         proSetting: '专业设置',
         curSemSta: '当前状态:',
         schoolNameLabel: '学校名称:',
@@ -5476,6 +5477,7 @@ const LANG_ZH_CN = {
         type3: '试卷资源',
         type4: '本地文件',
         type5: '超链接',
+        type6: '其它资源',
         preview: '查看',
         remove: '删除',
         upload: '上传本地文件',
@@ -5650,11 +5652,11 @@ const LANG_ZH_CN = {
             appAssassment: '认证材料',
             discuss: '讨论中心',
             policy: '政策文件',
-            research: '课例中心',
-            toSokrates: '苏格拉底',
+            research: '课例数据',
+            toSokrates: '苏格拉底管理',
             researchBoard: '数据看板',
             cusVideos: '课例数据',
-            cusVideoMgt: '课堂记录',
+            cusVideoMgt: '课堂记录管理',
             lockTips: '锁定菜单栏',
             unlockTips: '解锁菜单栏',
             platform: '资源平台',

+ 5 - 3
TEAMModelOS/ClientApp/public/lang/zh-TW.js

@@ -3564,6 +3564,7 @@ const LANG_ZH_TW = {
         scType: '學校類型:',
         scType1: '國教(K-12)',
         scType2: '大專院校',
+        openLessonRecord: '課堂記錄管理',
         proSetting: '專業學科',
         curSemSta: '當前狀態:',
         schoolNameLabel: '學校名稱:',
@@ -5477,6 +5478,7 @@ const LANG_ZH_TW = {
         type3: '試卷資源',
         type4: '本機檔案',
         type5: '超連結',
+        type6: '其它资源',
         preview: '查看',
         remove: '刪除',
         upload: '上傳本機檔案',
@@ -5651,11 +5653,11 @@ const LANG_ZH_TW = {
             appAssassment: '認證材料',
             discuss: '討論中心',
             policy: '政策文件',
-            research: '課堂中心',
-            toSokrates: '蘇格拉底',
+            research: '課堂數據',
+            toSokrates: '蘇格拉底管理',
             researchBoard: '校園大數據',
             cusVideos: '課堂記錄數據',
-            cusVideoMgt: '課堂記錄',
+            cusVideoMgt: '課堂記錄管理',
             lockTips: '鎖定菜單欄',
             unlockTips: '解鎖菜單欄',
             platform: '資源平臺',

+ 5 - 1
TEAMModelOS/ClientApp/src/common/BaseLayout.vue

@@ -299,6 +299,10 @@ export default {
     isGlobalSite() {
       return this.$store.state.config.srvAdr !== 'China'
     },
+    /* 是否开启课堂记录管理开关 */
+    isOpenLessonRecord() {
+      return this.$store.state.user.schoolProfile.school_base?.openLessonRecord
+    },
     jinniuMenu() {
       return this.$jsFn.checkJinNiu()
     },
@@ -582,7 +586,7 @@ export default {
               role: 'admin',
               permission: 'research-read|research-upd',
               menuName: 'ResearchMgt',
-              isShow: !this.isGlobalSite
+              isShow: this.isOpenLessonRecord
             },
             {
               icon: 'iconfont icon-data-count',

+ 1 - 1
TEAMModelOS/ClientApp/src/components/evaluation/ExerciseList.less

@@ -305,7 +305,7 @@
     }
 
     .explain-title {
-      width: 12%;
+      width: 13%;
       max-width: 85px;
       display: inline-block;
       color: rgb(16, 171, 231);

+ 1 - 0
TEAMModelOS/ClientApp/src/components/evaluation/ExerciseList.vue

@@ -413,6 +413,7 @@ export default {
     propsList: {
       handler(n, o) {
         if (n) {
+          console.error('接收到的试题', n)
           if (n.length) {
             this.originData = n
             this.totalNum = n.length

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

@@ -373,14 +373,12 @@ import BlobTool from '@/utils/blobTool.js'
 import Tree from "@/components/syllabus/DragTree";
 import InviteTeacher from "@/components/syllabus/InviteTeacher";
 import ChooseContent from '@/components/selflearn/NewChooseContent'
-import ExerciseList from '@/components/evaluation/ExerciseList.vue'
 import TestPaper from '@/view/ability/TestPaper.vue'
 export default {
   components: {
     Tree,
     InviteTeacher,
     ChooseContent,
-    ExerciseList,
     TestPaper
   },
   data(vm) {

+ 21 - 1
TEAMModelOS/ClientApp/src/view/schoolmgmt/SystemSetting/SystemSetting.vue

@@ -58,6 +58,13 @@
           </Radio>
         </RadioGroup>
       </div>
+      <div class="base-info-item custom-radio-box">
+        <span class="setting-label">{{$t('schoolBaseInfo.openLessonRecord')}}</span>
+        <i-switch v-model="schoolSetting.openLessonRecord" size="large" :before-change="beforeLessonSwitchChange">
+          <span slot="open">{{ $t('assessment.on') }}</span>
+          <span slot="close">{{ $t('assessment.off') }}</span>
+        </i-switch>
+      </div>
 
     </div>
     <!-- 学段/学院管理 -->
@@ -582,6 +589,17 @@ export default {
     }
   },
   methods: {
+    beforeLessonSwitchChange() {
+      return new Promise((resolve) => {
+        this.$Modal.confirm({
+          title: this.$t('syllabus.modifyTip'),
+          content: `${this.$t('assessment.tip11')} ${this.schoolSetting.openLessonRecord ? this.$t('assessment.off') : this.$t('assessment.on')} ${this.$t('schoolBaseInfo.openLessonRecord')}`,
+          onOk: () => {
+            resolve();
+          }
+        });
+      });
+    },
     confirmInit() {
       if (this.alreadyInit) {
         this.schoolSetting.isinit = false
@@ -1392,12 +1410,14 @@ export default {
                 this.$store.dispatch('user/setSchoolProfile', schoolJson)
                 //更新头部学校信息
                 this.$store.commit('user/setSchoolsInfo', schoolJson)
+                console.error(this.$store.state.user.schoolProfile.school_base.openLessonRecord)
+                console.error(this.schoolSetting)
 
                 //更新当前选中学段信息
                 let curPd = this.schoolSetting.period.find(item => this.$store.state.user.curPeriod && item.id === this.$store.state.user.curPeriod.id)
                 console.log(curPd)
                 if (curPd) {
-                  let periodIndex = this.schoolSetting.find(item => item.id === curPd.id)
+                  let periodIndex = this.schoolSetting.period.findIndex(item => item.id === curPd.id)
                   curPd.periodIndex = periodIndex
                   this.$store.commit('user/setCurPeriod', curPd)
                   // 保存Stroage

+ 67 - 38
TEAMModelOS/ClientApp/src/view/syllabus/Syllabus.less

@@ -1,9 +1,10 @@
 @primaryColor: #1CC0F3;
 @borderColor: #eeeeee;
-@highlightColor:#1fb06d;
+@highlightColor: #1fb06d;
 @second-textColor: var(--second-text-color); //文本副级颜色
 @borderColor: var(--border-color);
-.syllabus-container{
+
+.syllabus-container {
 	width: 100%;
 	height: 100%;
 	display: flex;
@@ -15,8 +16,8 @@
 		position: relative;
 		width: 100%;
 		// min-height: 45px;
-        box-shadow: 0 2px 5px #e9e9e9;
-        margin-bottom: 5px;
+		box-shadow: 0 2px 5px #e9e9e9;
+		margin-bottom: 5px;
 		// border-bottom: 1px solid @borderColor;
 		display: flex;
 		padding-left: 15px;
@@ -41,6 +42,7 @@
 
 		.subject-select {
 			max-width: 80%;
+
 			&-item {
 				margin: 5px 10px;
 				display: inline-block;
@@ -50,8 +52,8 @@
 				color: var(--primary-text-color);
 				border-radius: 5px;
 			}
-			
-			.item-active{
+
+			.item-active {
 				background-color: var(--assist-color-light);
 				border-color: var(--assist-color-light);
 				color: white;
@@ -85,11 +87,11 @@
 
 
 
-			.ivu-icon{
+			.ivu-icon {
 				color: var(--normal-icon-color);
 			}
-			
-			
+
+
 			&::before {
 				content: '';
 				display: inline-block;
@@ -102,14 +104,14 @@
 			&-tools {
 				position: absolute;
 				right: 0;
-				top:10px;
+				top: 10px;
 
 				.ivu-icon {
 					cursor: pointer;
 					margin-right: 15px;
 				}
-				
-				.btn-batch-download{
+
+				.btn-batch-download {
 					font-weight: 500;
 					margin-right: 10px;
 					color: #6b6b6b;
@@ -125,10 +127,10 @@
 			}
 		}
 
-		.syllabus-paper{
+		.syllabus-paper {
 			width: 80%;
 		}
-		
+
 		.syllabus-left {
 			height: 100%;
 			width: 20%;
@@ -148,7 +150,8 @@
 					justify-content: center;
 					border-bottom: 1px solid #efefef;
 					cursor: pointer;
-					&-name{
+
+					&-name {
 						color: var(--primary-text-color);
 						font-size: 16px;
 						// font-weight: bold;
@@ -158,8 +161,8 @@
 						align-items: center;
 						justify-content: space-between;
 					}
-					
-					
+
+
 
 					.status-idDel {
 						font-size: 12px;
@@ -173,36 +176,36 @@
 						border-radius: 4px;
 						zoom: 0.9;
 					}
-					
-					.status-compulsory{
+
+					.status-compulsory {
 						background-color: transparent;
 						color: #108d6c;
 						margin-left: 5px;
 						border: 1px solid #108d6c;
 					}
 
-					.status-coedit{
+					.status-coedit {
 						min-width: 54px;
 						background-color: var(--assist-color-light);
 					}
-					
-					&-tools{
+
+					&-tools {
 						position: absolute;
 						right: 20px;
 						top: 30%;
 						opacity: 0;
 						display: flex;
 						align-items: center;
-						
-						.ivu-icon{
+
+						.ivu-icon {
 							font-size: 20px;
 							margin-right: 10px;
 							color: var(--normal-icon-color);
 						}
 					}
-					
-					&:hover{
-						.volume-item-tools{
+
+					&:hover {
+						.volume-item-tools {
 							opacity: 1;
 						}
 					}
@@ -271,6 +274,30 @@
 			width: 45%;
 			border-right: 1px solid @borderColor;
 
+			.syllabus-content-tab {
+				width: 100%;
+				display: flex;
+				border-bottom: 1px solid rgb(240, 240, 240);
+
+				.tab-item {
+					width: 50%;
+					display: flex;
+					justify-content: center;
+					cursor: pointer;
+				}
+
+				.label {
+					display: inline-block;
+					width: 160px;
+					text-align: center;
+					padding-bottom: 10px;
+
+					&-active {
+						border-bottom: 2px solid @primaryColor;
+					}
+				}
+			}
+
 			.syllabus-tree-box {
 				height: 100%;
 				overflow: auto;
@@ -291,10 +318,11 @@
 					display: flex;
 					align-items: center;
 					cursor: pointer;
-					
-					&:hover{
+
+					&:hover {
 						background-color: var(--hover-text-color);
-						.node-resource-tools{
+
+						.node-resource-tools {
 							display: flex;
 						}
 					}
@@ -322,8 +350,8 @@
 							margin-right: 15px;
 							cursor: pointer;
 						}
-						
-						.ivu-icon{
+
+						.ivu-icon {
 							color: var(--normal-icon-color);
 							font-size: 16px;
 							margin-right: 5px;
@@ -335,7 +363,7 @@
 	}
 
 	.volume-active {
-	    /* background-image: -webkit-linear-gradient(90deg, rgba(30,30,30,0) 0%, rgba(110,110,110,.2) 50%, rgba(110,110,110,.4) 100%);
+		/* background-image: -webkit-linear-gradient(90deg, rgba(30,30,30,0) 0%, rgba(110,110,110,.2) 50%, rgba(110,110,110,.4) 100%);
 	    background-image: -o-linear-gradient(90deg, rgba(30,30,30,0) 0%, rgba(110,110,110,.2) 50%, rgba(110,110,110,.4) 100%);
 	    background-image: -moz-linear-gradient(90deg, rgba(30,30,30,0) 0%, rgba(110,110,110,.2) 50%, rgba(110,110,110,.4) 100%);
 	    background-image: linear-gradient(90deg, rgba(30,30,30,0) 0%, rgba(110,110,110,.2) 50%, rgba(110,110,110,.4) 100%); */
@@ -373,11 +401,12 @@
 	}
 
 	@media screen and (min-width:1280px) and (max-width:1366px) {
-		.volume-item-info{
-			margin-left:0px !important;
-			span{
-				margin:0px !important;
+		.volume-item-info {
+			margin-left: 0px !important;
+
+			span {
+				margin: 0px !important;
 			}
 		}
 	}
-}
+}

+ 55 - 11
TEAMModelOS/ClientApp/src/view/syllabus/Syllabus.vue

@@ -127,14 +127,22 @@
               </DropdownMenu>
             </Dropdown>
           </span>
-
+        </div>
+        <div class="syllabus-content-tab">
+          <span class="tab-item" @click="onChooseTab('item')">
+            <span :class="['label',activeContentTab === 'item' ? 'label-active' : '']">{{ $t('syllabus.type2') }}({{ Math.max(nodeItems.length,0) }})</span>
+          </span>
+          <span class="tab-item" @click="onChooseTab('other')">
+            <span :class="['label',activeContentTab === 'other' ? 'label-active' : '']">{{ $t('syllabus.type6') }}({{ Math.max(curNode.rnodes.length - nodeItems.length,0) }})</span>
+          </span>
         </div>
         <div class="syllabus-tree-box">
-          <EmptyData v-if="curNode.rnodes && !curNode.rnodes.length"></EmptyData>
-          <div class="node-resource-box" v-else>
-            <draggable class="list-group" tag="div" v-model="curNode.rnodes" v-bind="dragOptions" @end="onDragFilesEnd">
+          <EmptyData v-show="!tabResources.length" :top="220"></EmptyData>
+          <div class="node-resource-box" v-show="tabResources.length">
+            <ExerciseList :propsList="nodeItems" ref="exList" :examScope="isFullList" isAnalysis hasSas v-show="activeContentTab==='item'"></ExerciseList>
+            <draggable class="list-group" tag="div" v-model="tabResources" v-bind="dragOptions" @end="onDragFilesEnd" v-show="activeContentTab!=='item'">
               <transition-group type="transition" :name="!drag ? 'flip-list' : null">
-                <div class="node-resource-item" v-for="(item,index) in curNode.rnodes" :key="index" @click="onPreview(item)" :title="item.title">
+                <div class="node-resource-item" v-for="(item,index) in tabResources" :key="index" @click="onPreview(item)" :title="item.title">
                   <img src="../../assets/source/image.png" v-if="item.type === 'image'" />
                   <img src="../../assets/source/word.png" v-else-if="item.type === 'doc' && docType.includes(getSuffix(item.title))" />
                   <img src="../../assets/source/excel.png" v-else-if="item.type === 'doc' && excelType.includes(getSuffix(item.title))" />
@@ -395,6 +403,7 @@ export default {
   },
   data() {
     return {
+      tabResources: [],
       importPercent: 0,
       isImporting: false,
       newVolumeName: '',
@@ -486,11 +495,13 @@ export default {
       flatArr: [],
       myCreateChapters: [],
       isSaveSyllabus: false,
+      nodeItems: [],
       qrConfig: {
         title: this.$t('syllabus.shareSyllabus'),
         url: '',//二维码内容 不用转短网址,组件内部处理
         shareContent: '',//复制链接内容,支持字符串模板,如果包含网址需要处理好短网址
       },
+      activeContentTab: 'item',
       shareQrModal: false,
       targetId: null,
       fieldArr: ['記憶记忆1', '理解2', '應用应用3', '分析4', '评价評鑒5', '创造創造6'],
@@ -523,6 +534,11 @@ export default {
     }
   },
   methods: {
+    onChooseTab(tab) {
+      this.activeContentTab = tab
+      this.tabResources = tab === 'item' ? this.nodeItems : this.curNode.rnodes.filter(i => i.type !== 'item')
+      console.error('onChooseTab', this.nodeItems, this.tabResources, this.curNode.rnodes)
+    },
     onDownloadTemp(val) {
       const fileUrl = this.files[val].link
       console.log(this.$evTools.getBlobHost() + fileUrl)
@@ -800,6 +816,7 @@ export default {
             this.gradeList = schoolBaseInfo.period[periodIndex].grades;
             this.subjectList = schoolBaseInfo.period[periodIndex].subjects;
             this.semesterList = schoolBaseInfo.period[periodIndex].semesters;
+            console.error('xxxxxxxxxxxxxxxx===getSchoolInfo', this.volumeList)
             this.getVolumeList(true)
           }
         }
@@ -823,8 +840,7 @@ export default {
     /* 提取富文本内容中的文本 */
     async getItemSimpleText(item, sas) {
       try {
-        let indexJsonFile = await this.$tools.getFile(this.$evTools.getBlobHost() + '/' + item.cntr + item
-          .link + sas)
+        let indexJsonFile = await this.$tools.getFile(this.$evTools.getBlobHost() + '/' + item.cntr + item.link + sas)
         let itemJson = JSON.parse(indexJsonFile)
         return itemJson.item[0].question.replace(/<[^>]+>/g, "") //去掉所有的html标记
       } catch (e) {
@@ -868,12 +884,15 @@ export default {
       }
       this.hasModify = false
       this.activeVolumeIndex = 0
+      console.error('xxxxxxxxxxxxxxxx===onChangeSyllabusTab')
+
       type === 'fromCreate' ? this.getVolumeList(true) : this.getShareVolumeList(true)
     },
     /* 获取册别列表 */
     getVolumeList(needRefresh) {
       // 如果当前学校没有科目信息 直接返回
       if (this.isSchool && !this.subjectList.length) return
+
       this.isLoading = true
       this.treeOrigin = []
       this.curNode = {
@@ -1032,7 +1051,6 @@ export default {
           }
         });
       } else {
-        console.log(volume);
         if (volume && volume.id !== this.curVolume.id) {
           sessionStorage.removeItem('highlightId')
         }
@@ -1396,15 +1414,35 @@ export default {
         let itemNodeArr = data.data.rnodes.filter(i => i.type === 'item')
         if (itemNodeArr.length) {
           let sas = await this.$evTools.getBlobPrivateSas(itemNodeArr[0].cntr)
+          let promiseArr = []
+          // 获取关联的试题数据
           itemNodeArr.forEach(async item => {
-            item.title = await this.getItemSimpleText(item, sas)
+            promiseArr.push(new Promise(async (r, j) => {
+              let indexJsonFile = await this.$tools.getFile(this.$evTools.getBlobHost() + '/' + item.cntr + item.link + sas)
+              let jsonData = JSON.parse(indexJsonFile)
+              jsonData.exercise.question = jsonData.item[0].question
+              jsonData.exercise.option = jsonData.item[0].option
+              jsonData.exercise.id = jsonData.id
+              jsonData.exercise.pid = jsonData.pid
+              jsonData.exercise = await this.$evTools.doAddHost(jsonData.exercise, null, null, true)
+              r(jsonData.exercise)
+            }))
+          })
+          Promise.all(promiseArr).then(result => {
             this.curNode = data.data
+            this.nodeItems = result
+            console.error(this.nodeItems)
+            this.onChooseTab('item')
           })
         } else {
+          this.nodeItems = []
           this.curNode = data.data
+          this.onChooseTab('item')
         }
       } else {
         this.curNode = data.data
+        this.tabResources = []
+        this.nodeItems = []
       }
       console.log('当前点击节点数据 ==== ', data.data.title, data.data.rnodes)
     },
@@ -2700,6 +2738,8 @@ export default {
       handler(n, o) {
         if (n.length === 0) {
           this.treeOrigin = []
+          this.nodeItems = []
+          this.tabResources = []
           this.curNode = {
             id: '',
             rnodes: []
@@ -2711,9 +2751,13 @@ export default {
     '$store.state.user.curPeriod': {
       deep: true,
       immediate: true,
-      handler(n, o) {
+      handler(n, old) {
         if (n && this.$route.name === 'syllabus') {
-          this.getSchoolInfo(n.periodIndex)
+          this.nodeItems = []
+          this.tabResources = []
+          if (old && old.id) {
+            this.getSchoolInfo(n.periodIndex)
+          }
           this.currentPeriodIndex = n.periodIndex
         }
       }