Ver Fonte

答题卡row修复&&共编教师教研组筛选

OnePsycho há 3 anos atrás
pai
commit
fe2bed2672

+ 18 - 0
TEAMModelOS/ClientApp/src/components/syllabus/InviteTeacher.vue

@@ -24,6 +24,11 @@
 						<span style="margin-left: 10px;">{{ row.name }}</span>
 					</div>
 				</template>
+				<template slot-scope="{ row }" slot="groupName">
+					<div style="display: flex;align-items: center;">
+						<span style="margin-left: 10px;">{{ row.groups.length ? row.groups.map(i => i.name).join(',') : '-' }}</span>
+					</div>
+				</template>
 				<template slot-scope="{ row }" slot="action">
 					<div style="display: flex;align-items: center;">
 						<i-switch true-color="#13ce66" :value="hasAuth(row.id)" :before-change="handleBeforeChange"  @on-change="onSwitchChange(row,$event)"></i-switch>
@@ -76,6 +81,7 @@
 				hasSearchResult:false,
 				searchVal:'',
 				searchIdVal:'',
+				groupFilterData:[],
 				nodeInfo: {
 					title: ''
 				},
@@ -94,6 +100,15 @@
 						title: this.$t('teachermgmt.table.th1'),
 						key: 'id'
 					},
+					{
+						title: this.$t('teachermgmt.page.text3'),
+						slot: 'groupName',
+						filters: [],
+						filterMultiple: false,
+						filterMethod (value, row) {
+							return row.groups.map(j => j.name).includes(value)
+						}
+					},
 					{
 					  title: this.$t('teachermgmt.table.th3'),
 					  key: 'job',
@@ -128,6 +143,9 @@
 						} else {
 							this.teacherList = this.$store.state.user.schoolUserList.filter(i => i.status === 'join' && i.id !== this.$store.state.userInfo.TEAMModelId)
 							this.originList = JSON.parse(JSON.stringify(this.teacherList))
+							this.groupFilterData = [...new Set(this.teacherList.map(i => i.groups).flat(1).map(i => i.name))].map(i => { return { label:i,value:i} })
+							this.teacherCol[2].filters = this.groupFilterData
+							console.log(this.groupFilterData);
 						}
 					},
 					err => {

+ 13 - 3
TEAMModelOS/ClientApp/src/store/module/answerSheet.js

@@ -30,6 +30,7 @@ export default {
 		isNewPage: false,
 		isAutoCreate: false,
 		needFixArr: [26],
+		ansOrder:-1,
 		paperItem: {
 			name: ''
 		},
@@ -183,7 +184,7 @@ export default {
 				let prePageItems = state.config.contents.filter(i => i.pageNum === val.pageNum - 1)
 				let preItem = prePageItems[prePageItems.length - 1]
 				preItem.count++
-				val.count++
+				// val.count++
 			}
 			if(state.config.contents.length){
 				let infoItem = state.config.contents.find(i => i.index === val.index && i.pageNum === val.pageNum)
@@ -201,16 +202,23 @@ export default {
 				// delete val.startOrder
 				state.config.contents.push(val)
 			}
-			
 			/* 加入新的contents里面 */
 			let curTypeContentArr = state.config.newContents.filter(i => i.type ===  val.type)
 			let newContent = curTypeContentArr[curTypeContentArr.length - 1]
+			/* row代表的是按照ans数据结构排列(小题也算单独的一个) 但是同一题跨页 两个框的row一致 */
 			newContent.points.push({
 				ans:val.id + '',
-				row:val.startOrder,
+				row: state.ansOrder === -1 ? val.startOrder : (val.id > 0 ? val.startOrder : state.ansOrder + 1),
 				name:val.displayName,
 				pos:$tools.getBoxPos(val.x,val.y,val.width,val.height)
 			})
+			if(state.ansOrder === -1){
+				state.ansOrder = val.startOrder
+			}else{
+				if(val.id === 0){
+					state.ansOrder++
+				}
+			}
 		},
 		deleteItem(state, val) {
 			let index = state.paperItem.item.map(i => i.id).indexOf(val)
@@ -227,10 +235,12 @@ export default {
 			})
 		},
 		clearPage(state) {
+			state.ansOrder = -1
 			 state.pages = 1
 			 state.config.contents = state.config.contents.filter(i => i.type !== 2)
 		},
 		clearAllConfig(state){
+			state.ansOrder = -1
 			state.config.contents = []
 			state.config.newContents = []
 		},

+ 22 - 3
TEAMModelOS/ClientApp/src/view/newsheet/BaseEditor.vue

@@ -341,12 +341,16 @@
 					if (!scrollDom) return
 					let editorDom = this.myEditor.$textElem.elems[0]
 					let scrollDis = scrollDom.getPosition().scrollTop
+					// 整个试卷题目的ID集合
 					let allItemIds = this.$store.state.answerSheet.paperItem.item.map(i => i.id)
+					// 小题拉平的ID集合
+					let flatIds = this.flatSubjectiveItems(this.$store.state.answerSheet.paperItem.item).map(i => i.id)
 					let subjectiveItem = items[0];
 					// 拿到当前题目序号
 					let curItemId = subjectiveItem.pid || subjectiveItem.id
 					let itemOrder = this.isAutoCreate ? allItemIds.indexOf(curItemId) + 1 : subjectiveItem.order;
-					let configIndex = subjectiveItem.pid ? (itemOrder + subjectiveItem.childIndex - 1 ): itemOrder
+					// let configIndex = subjectiveItem.pid ? (itemOrder + subjectiveItem.childIndex - 1 ): itemOrder
+					let configIndex = flatIds.indexOf(subjectiveItem.id) + 1
 					if(subjectiveItem.pid){
 						itemOrder = itemOrder + '-' + subjectiveItem.childIndex
 					}
@@ -441,8 +445,8 @@
 								this.$nextTick(() => {
 									let splitHtmlArr = this.getSplitHtml(this.pArr,heightArr)
 									splitHtmlArr.forEach((curEditorContent,editorIndex) => {
-										console.log('富文本的分割高度',heightArr)
-										console.log('富文本的分割',splitHtmlArr)
+										// console.log('富文本的分割高度',heightArr)
+										// console.log('富文本的分割',splitHtmlArr)
 										let editorHeight = curEditorContent.html === '' ? heightArr[editorIndex] : heightArr[editorIndex]
 										// let curEditorContent = this.getSplitHtml(this.pArr,curEditorHeight)
 										if(editorIndex !== 0){
@@ -482,6 +486,21 @@
 				});
 			},
 			
+			flatSubjectiveItems(arr){
+			  let flatItems = []
+			  arr.forEach(i => {
+				  if(i.children.length){
+					  i.children.forEach((child,childIndex) => {
+						  child.childIndex = childIndex + 1
+						 flatItems.push(child)
+					  })
+				  }else{
+					  flatItems.push(i)
+				  }
+			  })
+			  return flatItems
+			},
+			
 			// 跨页内容分割处理
 			getSplitHtml(pArr,heightArr){
 				let result = []

+ 1 - 1
TEAMModelOS/ClientApp/src/view/syllabus/Syllabus.vue

@@ -274,7 +274,7 @@
 		</Modal>
 
 		<!-- 选择共编、分享弹窗 -->
-		<Modal v-model="isInviteModal" width="750" footer-hide class="tree-modal add-volume-modal choose-content-modal">
+		<Modal v-model="isInviteModal" width="1200" footer-hide class="tree-modal add-volume-modal choose-content-modal">
 			<div class="modal-header" slot="header">
 				{{ isSchool ? $t('syllabus.chooseCoTeacher') : $t('syllabus.chooseShareTeacher') }}
 			</div>