Bläddra i källkod

问卷nbsp调整&&课纲节点个人试题试卷入库

OnePsycho 4 år sedan
förälder
incheckning
8b7c36ffb3

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

@@ -182,7 +182,7 @@
 			}
 		},
 		data() {
-			return {
+			return { 
 				examPropScope:null,
 				dataLoading: false,
 				exersicesType: this.$GLOBAL.EXERCISE_TYPES(),

+ 5 - 8
TEAMModelOS/ClientApp/src/components/questionnaire/BaseQuestionnaire.vue

@@ -182,7 +182,7 @@
 			// 提取富文本内容中的文本
 			getSimpleText(html) {
 				var r = /<(?!img|video|audio).*?>/g;
-				return html.replace(r, "");
+				return html.replace(r, "").replace(/&nbsp;/g, ' ');
 			},
 			
 			// 检测是否有空选项
@@ -354,12 +354,7 @@
 					return 0 
 				}
 			},
-			
-			// 提取富文本内容中的文本
-			getSimpleText(html) {
-				var r = /<(?!img|video|audio).*?>/g;
-				return html.replace(r, "");
-			},
+
 			
 			async getQnRecord(item) {
 				return new Promise(async (r, j) => {
@@ -434,7 +429,9 @@
 			isEdit:{
 				handler(n,o){
 					this.editable = n
-				}
+					console.log(n)
+				},
+				immediate:true
 			}
 		}
 	};

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

@@ -537,7 +537,7 @@ export default class BlobTool {
                                     }], cont)
                                 }
                             }
-                            r('复制结束后')
+                            r(blobItem)
                         }
                     })
                 })

+ 124 - 36
TEAMModelOS/ClientApp/src/utils/evTools.js

@@ -10,13 +10,11 @@ import { app } from '@/boot-app.js'
 
 
 export default {
-	
 	/* 根据登录后的用户信息获取blobHOST域名 */
 	getBlobHost(){
 		let s = store.state.user.userProfile.blob_uri || store.state.user.studentProfile.blob_uri || 'https://teammodelstorage.blob.core.chinacloudapi.cn/hbcn'
 		return s.split(s.substring(s.lastIndexOf('/')))[0]
 	},
-	
 	/* 获取试题保存在Blob的JSON文件 */
 	createBlobItem(item){
 		return new Promise((r,j) => {
@@ -53,7 +51,6 @@ export default {
 			r(itemJson)
 		})
 	},
-	
 	/* 获取保存在COSMOS里面的试题格式 */
 	createCosmosItem(item){
 		return new Promise((r,j) => {
@@ -81,7 +78,6 @@ export default {
 			r(cosmosItem)
 		})
 	},
-	
 	/* 生成试卷的index.json文件格式 */
 	createBlobPaper(paper,slides){
 		return new Promise((r,j) => {
@@ -102,7 +98,6 @@ export default {
 			r(paperItem)
 		})
 	},
-	
 	/* 生成试卷保存在cosmos的数据结构 */
 	createCosmosPaper(paper){
 		return new Promise((r,j) => {
@@ -124,7 +119,41 @@ export default {
 			r(paperItem)
 		})
 	},
-	
+	/* 根据醍摩豆ID获取对应用户Blob内部的完整试题 */
+	getFullItemByTmdId(tmdId,blob){
+		return new Promise(async (r,j) => {
+			let privateSas = await this.getBlobPrivateSas(tmdId)
+			let fullPath = this.getBlobHost() +  '/' + tmdId + blob + privateSas
+			let jsonData = JSON.parse(await $tools.getFile(fullPath))
+			// 如果是综合题 那就拿到children里面的小题id集合 去换取小题的blobJSON文件 然后替换children的内容
+			if(jsonData.exercise.children.length && jsonData.exercise.type === 'compose'){
+				let childrenUrls = jsonData.exercise.children.map(i => this.getBlobHost() +  '/' + tmdId + '/item/' + i + '/' + i + '.json' + privateSas)
+				jsonData.exercise.children = await this.getFullChildren(childrenUrls,tmdId)
+			}
+			// 调整渲染试题数据结构
+			jsonData.exercise.question = jsonData.item[0].question
+			jsonData.exercise.blob = fullPath
+			jsonData.exercise.code = tmdId
+			jsonData.exercise.option = jsonData.item[0].option
+			jsonData.exercise.id = jsonData.id
+			jsonData.exercise.pid = jsonData.pid
+			jsonData.exercise = await this.doAddHost(jsonData.exercise,null,tmdId)
+			r(jsonData.exercise)
+		})
+	},
+	/* 根据醍摩豆ID获取对应BLOB个人容器授权信息 */
+	getBlobPrivateSas(tmdId){
+		return new Promise((r,j) => {
+			$api.blob.blobSasR({
+				name:tmdId,
+				role:'teacher'
+			}).then(res => {
+				if(!res.error){
+					r('?' + res.sas)
+				}
+			})
+		})
+	},
 	/* 获取完整的试题数据 */
 	getFullItem(list,examScope){
 		console.log('接受到的examScope',examScope)
@@ -140,24 +169,30 @@ export default {
 						const blobHost = curScope === 'school' ?  JSON.parse(decodeURIComponent(localStorage.school_profile, "utf-8")).blob_uri :  JSON.parse(decodeURIComponent(localStorage.user_profile, "utf-8")).blob_uri
 						// 根据试题的Blob地址 去读取JSON文件
 						let sasString = curScope === 'school' ?  await $tools.getSchoolSas() : await $tools.getPrivateSas()
-						let jsonInfo = list[i].blob.includes('https://') ? await $tools.getFile(list[i].blob + sasString.sas) : await $tools.getFile(blobHost + list[i].blob + sasString.sas)
-						let jsonData = JSON.parse(jsonInfo)
-						// 如果是综合题 那就拿到children里面的小题id集合 去换取小题的blobJSON文件 然后替换children的内容
-						if(jsonData.exercise.children.length && jsonData.exercise.type === 'compose'){
-							let childrenUrls = jsonData.exercise.children.map(i => blobHost + '/item/' + i + '/' + i + '.json' + sasString.sas)
-							jsonData.exercise.children = await this.getFullChildren(childrenUrls,list[i].code)
+						try{
+							let jsonInfo = list[i].blob.includes('https://') ? await $tools.getFile(list[i].blob + sasString.sas) : await $tools.getFile(blobHost + list[i].blob + sasString.sas)
+							let jsonData = JSON.parse(jsonInfo)
+							// 如果是综合题 那就拿到children里面的小题id集合 去换取小题的blobJSON文件 然后替换children的内容
+							if(jsonData.exercise.children.length && jsonData.exercise.type === 'compose'){
+								let childrenUrls = jsonData.exercise.children.map(i => blobHost + '/item/' + i + '/' + i + '.json' + sasString.sas)
+								jsonData.exercise.children = await this.getFullChildren(childrenUrls,list[i].code)
+							}
+							// 调整渲染试题数据结构
+							jsonData.id = list[i].id
+							jsonData.exercise.question = jsonData.item[0].question
+							jsonData.exercise.createTime = list[i].createTime || 0
+							jsonData.exercise.blob = list[i].blob
+							jsonData.exercise.code = list[i].code
+							jsonData.exercise.option = jsonData.item[0].option
+							jsonData.exercise.id = list[i].id
+							jsonData.exercise.pid = jsonData.pid
+							jsonData.exercise = await this.doAddHost(jsonData.exercise)
+							r(jsonData.exercise)
+						}catch(e){
+							console.log(e)
+							this.$Message.error(e)
 						}
-						// 调整渲染试题数据结构
-						jsonData.id = list[i].id
-						jsonData.exercise.question = jsonData.item[0].question
-						jsonData.exercise.createTime = list[i].createTime || 0
-						jsonData.exercise.blob = list[i].blob
-						jsonData.exercise.code = list[i].code
-						jsonData.exercise.option = jsonData.item[0].option
-						jsonData.exercise.id = list[i].id
-						jsonData.exercise.pid = jsonData.pid
-						jsonData.exercise = await this.doAddHost(jsonData.exercise)
-						r(jsonData.exercise)
+						
 					}else{
 						r(null)
 					}
@@ -172,12 +207,11 @@ export default {
 			})
 		})
 	},
-	
-	/* 给富文本添加 */
-	doAddHost(exerciseItem,paperItem){
+	/* 给富文本添加 cntr是防止读取的是其他用户的BLOB */
+	doAddHost(exerciseItem,paperItem,cntr){
 		/* 如果操作的是试卷内的试题 则需要拿试卷的code来作为containerName */
 		let curScope = paperItem ? paperItem.scope : exerciseItem.scope
-		let container = curScope === 'school' ? store.state.userInfo.schoolCode : store.state.userInfo.TEAMModelId
+		let container = cntr || (curScope === 'school' ? store.state.userInfo.schoolCode : store.state.userInfo.TEAMModelId)
 		let isSubjective = exerciseItem.type === 'complete' || exerciseItem.type === 'subjective' || exerciseItem.type === 'compose'
 		let richTextObj = {
 			question: exerciseItem.question,
@@ -245,7 +279,6 @@ export default {
 			})
 		})
 	},
-	
 	/* 保存综合题小题 */
 	saveChildren(children,containerClient){
 		return new Promise((resolve,reject) => {
@@ -289,7 +322,6 @@ export default {
 		})
 		
 	},
-	
 	/* 获取综合题子题的Blob数据 */
 	getFullChildren(urls,code){
 		return new Promise((resolve,reject) => {
@@ -317,7 +349,66 @@ export default {
 			})
 		})
 	},
-	
+	/* 根据醍摩豆ID获取对应用户Blob内部的完整试卷 */
+	getFullPaperByTmdId(tmdId,blob){
+		return new Promise(async (r,j) => {
+			console.log('根据ID获取试题')
+			let privateSas = await this.getBlobPrivateSas(tmdId)
+			let fullPath = this.getBlobHost() +  '/' + tmdId + blob + '/index.json' + privateSas
+			try{
+				let jsonInfo = await $tools.getFile(fullPath)
+				let jsonData = JSON.parse(jsonInfo)
+				// 获取试卷包含的试题数据并包装好
+				if(jsonData.slides && jsonData.slides.length){
+					let promiseArr = []
+					let allItems = []
+					jsonData.item = []
+					const path = this.getBlobHost() +  '/' + tmdId + blob
+					jsonData.slides.forEach(async (item,index) => {
+						promiseArr.push(new Promise(async (resolve,reject) => {
+							try{
+								// 获取题目JSON并且包装成完整试题对象
+								let itemJson = JSON.parse(await $tools.getFile(path + '/' + item.url + privateSas))
+								itemJson.exercise.question = itemJson.item[0].question
+								itemJson.exercise.option = itemJson.item[0].option
+								itemJson.exercise.id = itemJson.id 
+								itemJson.exercise.pid = itemJson.pid 
+								itemJson.exercise.blob = path + '/' + item.url // 添加blob是方便在保存试卷是 refresh 与导入的试题区分开
+								itemJson.exercise.score = item.scoring ? item.scoring.score : 0
+								try{
+									itemJson.exercise = await this.doAddHost(itemJson.exercise,{ name : jsonData.name },tmdId) // 检测试题中的富文本 为有src为相对路径的音视频文件添加blob的HOST地址
+									resolve(itemJson.exercise)
+								}catch(e){
+									reject(e)
+								}
+							}catch(e){
+								reject(e)
+							}
+						}))
+					})
+					
+					Promise.all(promiseArr).then(res => {
+						res.forEach((resItem,resIndex) => {
+							resItem.children = []
+							if(resItem.pid){
+								let pItem = res.filter(i => i.id === resItem.pid)[0]
+								pItem.children.push(resItem)
+								pItem.score = pItem.score + resItem.score
+							}
+						})
+						jsonData.item = res.filter(i => !i.pid)
+						r(jsonData)
+					}).catch(e => {
+						// Message.error('试卷文件读取失败')
+						j(e)
+					})
+				}
+			}catch(e){
+				console.log(e)
+				j(e)
+			}
+		})
+	},
 	/* 获取完整的试卷数据 */
 	getFullPaper(paper,examScope){
 		console.log(paper)
@@ -385,8 +476,6 @@ export default {
 			}
 		})
 	},
-	
-	
 	/* 获取完整的试卷数据 */
 	getStuPaper(paper, examScope) {
 		let curScope = examScope || paper.scope
@@ -458,18 +547,17 @@ export default {
 			}
 		})
 	},
-	
-	// 提取富文本内容中的文本
+	/* 提取富文本内容中的文本 */
 	getSimpleText(html) {
 		var r = /<\/?(img)[^>]*>/gi;
 		return html.replace(r, "");
 	},
-	
+	/* 判断是否为客观题 */
 	getItemType(type){
 		const objective = ['single','multiple','judge']
 		return objective.includes(type)
 	},
-	
+	/* 获取img标签内的src */
 	getImgSrc(richtext) {
 	    let imgList = [];
 	    richtext.replace(/<video [^>]*src=['"]([^'"]+)[^>]*>/g, (match, capture) => {

+ 17 - 1
TEAMModelOS/ClientApp/src/utils/public.js

@@ -1,6 +1,9 @@
 import $api from '@/api'
 import store from '@/store'
 import { app } from '@/boot-app.js'
+import {
+	Message
+} from 'view-design'
 /**
  * 校验blob授权是否过期
  * */
@@ -272,7 +275,19 @@ export default {
 			xhr.open('get', url); //url填写后台的接口地址,如果是post,在formData append参数(参考原文地址)
 			// xhr.responseType = 'arraybuffer';
 			xhr.onload = function(e) {
-				resolve(e.currentTarget.response)
+				switch (e.currentTarget.status){
+					case 200:
+						resolve(e.currentTarget.response)
+						break;
+					case 404:
+						Message.error('未访问到资源!')
+						break;
+					case 403:
+						Message.error('授权异常,无法访问!')
+						break;		
+					default:
+						break;
+				}
 			};
 			xhr.send(formData);
 		})
@@ -423,6 +438,7 @@ export default {
 	 * 获取单个文件授权
 	 */
 	getFileSas(param) {
+		console.log('获取单个文件授权',param)
 		return new Promise((r, j) => {
 			$api.blob.urlSasR({
 				url: param

+ 1 - 1
TEAMModelOS/ClientApp/src/view/evaluation/index/index.vue

@@ -44,7 +44,7 @@
       },
 	  // 判断容器滚动距离
 	  handleScroll(vertical, horizontal, nativeEvent) {
-	  	console.log(vertical.scrollTop)
+	  	// console.log(vertical.scrollTop)
 	  },
 
       

+ 411 - 179
TEAMModelOS/ClientApp/src/view/syllabus/Syllabus.vue

@@ -14,8 +14,10 @@
 				]" @click="onSubjectChange(subject,subjectIndex)">{{ subject.name }}</span>
 			</div>
 			<div v-if="!isSchool">
-				<span :class="['syllabus-tab-item',activeTab === 'fromCreate' ? 'syllabus-tab-item-active' : '']" @click="onChangeSyllabusTab('fromCreate')">我创建的课纲</span>
-				<span :class="['syllabus-tab-item',activeTab === 'fromShare' ? 'syllabus-tab-item-active' : '']" @click="onChangeSyllabusTab('fromShare')">他人分享的课纲</span>
+				<span :class="['syllabus-tab-item',activeTab === 'fromCreate' ? 'syllabus-tab-item-active' : '']"
+					@click="onChangeSyllabusTab('fromCreate')">我创建的课纲</span>
+				<span :class="['syllabus-tab-item',activeTab === 'fromShare' ? 'syllabus-tab-item-active' : '']"
+					@click="onChangeSyllabusTab('fromShare')">他人分享的课纲</span>
 			</div>
 			<Button @click="onSaveSyllabus" class="btn-save-modify" icon="md-folder"
 				v-if="(hasSyllabusAuth || hasEditAuth(curNode)) && hasModify">存储变更</Button>
@@ -27,14 +29,14 @@
 						<span>册别清单</span>
 						<span class="syllabus-content-header-tools">
 							<Icon type="md-search" @click="doSearchVolume" />
-							<Icon type="md-create" @click="doEditVolume" v-if="hasSyllabusAuth"/>
-							<Icon type="md-trash" @click="doDeleteVolume" v-if="hasSyllabusAuth"/>
-							<Icon type="md-add" @click="doAddVolume" v-if="hasSyllabusAuth"/>
+							<Icon type="md-create" @click="doEditVolume" v-if="hasSyllabusAuth" />
+							<Icon type="md-trash" @click="doDeleteVolume" v-if="hasSyllabusAuth" />
+							<Icon type="md-add" @click="doAddVolume" v-if="hasSyllabusAuth" />
 						</span>
 					</div>
 					<div style="width: 90%;" v-else>
-						<Input v-model="searchVolumeVal"  placeholder="输入册别名称..." 
-						icon="ios-close-circle-outline" @on-click="onCloseSearch" @on-change="onSearchChange"/>
+						<Input v-model="searchVolumeVal" placeholder="输入册别名称..." icon="ios-close-circle-outline"
+							@on-click="onCloseSearch" @on-change="onSearchChange" />
 					</div>
 				</div>
 				<vuescroll>
@@ -57,13 +59,14 @@
 				<div class="syllabus-content-header">
 					<span>课纲目录</span>
 					<span class="syllabus-content-header-tools">
-						<Icon type="md-add" @click="isAddTreeModal = true" v-if="hasSyllabusAuth"/>
+						<Icon type="md-add" @click="isAddTreeModal = true" v-if="hasSyllabusAuth" />
 					</span>
 				</div>
 				<div class="syllabus-tree-box">
 					<EmptyData :top="-240" v-if="!treeOrigin.length"></EmptyData>
 					<Tree ref="treeRef" :treeData="treeOrigin" :volume="curVolume"
-						:editable="hasSyllabusAuth || hasEditAuth(curNode)" @onNodeClick="onNodeClick" @doShare="doShare" @addModifyId="addModifyId"v-else></Tree>
+						:editable="hasSyllabusAuth || hasEditAuth(curNode)" @onNodeClick="onNodeClick"
+						@doShare="doShare" @addModifyId="addModifyId" v-else></Tree>
 				</div>
 			</div>
 			<div class="syllabus-right">
@@ -71,7 +74,8 @@
 					<span>关联资源</span>
 					<span class="syllabus-content-header-tools">
 						<!-- <Icon type="md-add" @click="onAddResource" v-if="curNode.id"/> -->
-						<Dropdown @on-click="onAddResource" v-if="curNode.id && (hasSyllabusAuth || hasEditAuth(curNode))">
+						<Dropdown @on-click="onAddResource"
+							v-if="curNode.id && (hasSyllabusAuth || hasEditAuth(curNode))">
 							<a href="javascript:void(0)" style="color: #ddd;">
 								添加资源
 								<Icon type="ios-arrow-down"></Icon>
@@ -91,10 +95,14 @@
 					<div class="node-resource-box" v-else>
 						<div class="node-resource-item" v-for="(item,index) in curNode.rnodes">
 							<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))" />
-							<img src="../../assets/source/ppt.png" v-else-if="item.type === 'doc' && pptType.includes(getSuffix(item.title))" />
-							<img src="../../assets/source/pdf.png" v-else-if="item.type === 'doc' && getSuffix(item.title) === 'pdf'" />
+							<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))" />
+							<img src="../../assets/source/ppt.png"
+								v-else-if="item.type === 'doc' && pptType.includes(getSuffix(item.title))" />
+							<img src="../../assets/source/pdf.png"
+								v-else-if="item.type === 'doc' && getSuffix(item.title) === 'pdf'" />
 							<img src="../../assets/source/video.png" v-else-if="item.type === 'video'" />
 							<img src="../../assets/source/audio.png" v-else-if="item.type === 'audio'" />
 							<img src="../../assets/source/item.png" v-else-if="item.type === 'item'" />
@@ -188,11 +196,11 @@
 
 		<!-- 关联内容弹窗 -->
 		<Modal v-model="isRelateContentModal" width="900" class="tree-modal add-volume-modal choose-content-modal">
-			<ChooseContent v-if="isRelateContentModal" ref="chooseContentRef"
-				 :showSyllabus="false" @previewPaper="onPreviewPaper"></ChooseContent>
+			<ChooseContent v-if="isRelateContentModal" ref="chooseContentRef" :showSyllabus="false"
+				@previewPaper="onPreviewPaper"></ChooseContent>
 			<Button slot="footer" @click="onRelateContent" style="margin-bottom: 20px;" class="modal-btn">确认</Button>
 		</Modal>
-		
+
 		<!-- 选择共编、分享弹窗 -->
 		<Modal v-model="isInviteModal" width="750" footer-hide class="tree-modal add-volume-modal choose-content-modal">
 			<div class="modal-header" slot="header">
@@ -211,7 +219,7 @@
 					<span style="margin-left: 50px;">题数:{{ previewPaper.item.length  }}</span>
 				</p>
 			</div>
-			<ExerciseList :propsList="questionList" ref="exList" isAnalysis></ExerciseList>
+			<ExerciseList :propsList="questionList" ref="exList" :examScope="isFullList" isAnalysis></ExerciseList>
 		</Modal>
 
 		<!--文件预览-->
@@ -251,13 +259,14 @@
 		},
 		data() {
 			return {
-				containerClient:null,
-				docType:['doc','docx'],
-				excelType:['xls','csv','xlsx'],
-				pptType:['ppt','pptx'],
+				containerClient: null,
+				docType: ['doc', 'docx'],
+				excelType: ['xls', 'csv', 'xlsx'],
+				pptType: ['ppt', 'pptx'],
 				folder: '',
-				searchVolumeVal:'',
-				activeTab:'fromCreate',
+				searchVolumeVal: '',
+				activeTab: 'fromCreate',
+				isFullList: null,
 				isPreviewPaper: false,
 				previewStatus: false,
 				hasModify: false,
@@ -269,7 +278,7 @@
 				isAddTreeModal: false,
 				isAddVolumeModal: false,
 				isRelateContentModal: false,
-				isInviteModal:false,
+				isInviteModal: false,
 				isEditVolume: false,
 				isSchool: false,
 				currentPeriodIndex: 0,
@@ -280,14 +289,14 @@
 				subjectList: [],
 				semesterList: [],
 				volumeList: [],
-				originVolumeList:[],
+				originVolumeList: [],
 				questionList: [],
-				allChapterIds:[],
+				allChapterIds: [],
 				schoolInfo: null,
 				previewFile: {},
 				previewPaper: null,
-				curShareNode:null,
-				curChapter:null,
+				curShareNode: null,
+				curChapter: null,
 				curLink: {
 					name: '',
 					link: ''
@@ -319,8 +328,8 @@
 					"children": [],
 					"rnodes": []
 				},
-				modifyIdArr:[],
-				flatArr:[]
+				modifyIdArr: [],
+				flatArr: []
 			}
 		},
 		created() {
@@ -330,8 +339,9 @@
 		},
 		methods: {
 			/* 初始化BLOB对象 */
-			async initBlobTool(){
-				let n = this.$route.name === 'syllabus'  ? await this.$tools.getSchoolSas() : await this.$tools.getPrivateSas()
+			async initBlobTool() {
+				let n = this.$route.name === 'syllabus' ? await this.$tools.getSchoolSas() : await this.$tools
+					.getPrivateSas()
 				this.containerClient = new BlobTool(n.url, n.name, n.sas, this.curScope)
 			},
 			/* 获取学校基础信息 */
@@ -353,7 +363,7 @@
 			/* 提取富文本内容中的文本 */
 			getSimpleText(html) {
 				html = html || '';
-				    return html.replace(/<[^>]+>/g, "");//去掉所有的html标记
+				return html.replace(/<[^>]+>/g, ""); //去掉所有的html标记
 			},
 			/* 切换学段的操作 */
 			onPeriodChange(val) {
@@ -368,7 +378,8 @@
 				this.activeSubjectIndex = index
 				this.getVolumeList()
 			},
-			onChangeSyllabusTab(type){
+			/* 切换个人创建的课纲和他人分享的课纲 */
+			onChangeSyllabusTab(type) {
 				this.activeTab = type
 				type === 'fromCreate' ? this.getVolumeList() : this.getShareVolumeList()
 			},
@@ -399,37 +410,36 @@
 					this.$Message.error(err);
 				})
 			},
-			
 			/* 获取分享来的册别列表 */
-			getShareVolumeList(){
+			getShareVolumeList() {
 				this.$api.syllabus.FindShare({
 					"code": this.$store.state.userInfo.TEAMModelId,
-					"type":"share"
+					"type": "share"
 				}).then(res => {
 					if (!res.error) {
 						this.isLoading = false
-						if(res.shares.length){
+						if (res.shares.length) {
 							let shareList = res.shares.map(i => {
 								return {
-									id:i.id,
-									creatorId:i.code,
-									name:i.list[0].volumeName,
-									children:i.list,
-									pk:'Volume',
-									school:'',
-									scope:'private',
-									status:1
+									id: i.id,
+									creatorId: i.code,
+									name: i.list[0].volumeName,
+									children: i.list,
+									pk: 'Volume',
+									school: '',
+									scope: 'private',
+									status: 1
 								}
 							})
 							this.volumeList = shareList
 							this.originVolumeList = JSON.parse(JSON.stringify(this.volumeList))
 							let activeIndex = this.isEditVolume ? this.activeVolumeIndex : 0
 							shareList.length && this.onVolumeClick(shareList[activeIndex], activeIndex)
-						}else{
+						} else {
 							this.volumeList = []
 							this.originVolumeList = []
 						}
-						
+
 					} else {
 						this.$Message.warning(res.error);
 					}
@@ -458,16 +468,16 @@
 				this.isAddVolumeModal = true
 			},
 			/* 搜索册别 */
-			doSearchVolume(){
+			doSearchVolume() {
 				this.isSearchVolume = true
 			},
 			/* 搜索词汇发生变化 */
-			onSearchChange(){
+			onSearchChange() {
 				this.volumeList = this.originVolumeList.filter(i => i.name.indexOf(this.searchVolumeVal) > -1)
 				this.volumeList.length && this.onVolumeClick(this.volumeList[0], 0)
 			},
 			/* 关闭搜索 */
-			onCloseSearch(){
+			onCloseSearch() {
 				this.isSearchVolume = false
 				this.searchVolumeVal = ''
 				this.volumeList = JSON.parse(JSON.stringify(this.originVolumeList))
@@ -537,9 +547,8 @@
 					this.isLoading = false
 				})
 			},
-			
 			/* 获取分享课纲的树形数据 */
-			getShareTree(volume){
+			getShareTree(volume) {
 				this.$api.syllabus.ViewShare({
 					"scope": "private",
 					"school": "",
@@ -563,21 +572,6 @@
 					this.isLoading = false
 				})
 			},
-			
-			/* 根据醍摩豆ID获取对应BLOB个人容器授权信息 */
-			getBlobPrivateSas(tmdId){
-				return new Promise((r,j) => {
-					this.$api.blob.blobSasR({
-						name:tmdId,
-						role:'teacher'
-					}).then(res => {
-						if(!res.error){
-							r('?' + res.sas)
-						}
-					})
-				})
-			},
-			
 			/* 添加课纲的第一层节点 */
 			onAddTreeNode() {
 				this.nodeInfo.id = this.$tools.guid()
@@ -585,11 +579,11 @@
 				this.nodeInfo.creatorId = this.$store.state.userInfo.TEAMModelId
 				// 统一传给树形组件的数据结构
 				this.treeOrigin.push({
-					auth:null,
-					id:this.nodeInfo.id,
-					scope:this.curVolume.scope,
-					trees:[this.nodeInfo],
-					volumeId:this.curVolume.id
+					auth: null,
+					id: this.nodeInfo.id,
+					scope: this.curVolume.scope,
+					trees: [this.nodeInfo],
+					volumeId: this.curVolume.id
 				})
 				// 只要本地新增的章节 都要记录到修改数据里
 				this.$nextTick(() => {
@@ -605,10 +599,10 @@
 				})
 				this.hasModify = true;
 				this.isAddTreeModal = false
-				
+
 			},
 			/* 有章节发生变化记录章节ID */
-			addModifyId(id){
+			addModifyId(id) {
 				this.modifyIdArr.push(id)
 			},
 			/* 存储变更保存最新课纲数据 */
@@ -620,10 +614,10 @@
 				let allChapter = this.$refs.treeRef ? this.$refs.treeRef.treeDatas : [];
 				let modifyChapters = modifyIdArr.length ? modifyIdArr.map(id => {
 					return {
-						id:id,
-						volumeId:this.curVolume.id,
-						scope:this.curVolume.scope,
-						trees:[allChapter.find(i => i.id === id)]
+						id: id,
+						volumeId: this.curVolume.id,
+						scope: this.curVolume.scope,
+						trees: [allChapter.find(i => i.id === id)]
 					}
 				}) : [];
 				this.allChapterIds = allChapter.map(i => i.id)
@@ -647,20 +641,20 @@
 				this.curNode = data.data
 			},
 			/* 根据节点获取它所在的章节信息 */
-			getChapterByNode(node){
-				if(node.level === 1){
+			getChapterByNode(node) {
+				if (node.level === 1) {
 					return node
-				}else{
+				} else {
 					return this.getChapterByNode(node.parent)
 				}
 			},
 			/* 点击节点进行分享 */
-			doShare(data){
+			doShare(data) {
 				this.curShareNode = data
 				this.isInviteModal = true
 			},
 			/* 点击确认进行课纲的共编或者分享功能 */
-			doInviteTeacher(){
+			doInviteTeacher() {
 				let selectedTeacher = this.$refs.inviteRef.teacherList
 			},
 			/* 添加超链接 */
@@ -717,32 +711,35 @@
 			},
 			/* 获取关联的内容数据,需要进行相应的文件拷贝 */
 			async onSelectFile() {
-				return new Promise(async (r,j) => {
+				return new Promise(async (r, j) => {
 					let list = this.$refs.chooseContentRef.selectedFiles
-					if(!list.length){
+					if (!list.length) {
 						r(200)
-					}else{
+					} else {
 						let promiseArr = []
 						let privateSas = await this.$tools.getPrivateSas()
 						let schoolSas = await this.$tools.getSchoolSas()
 						let curResourceArr = this.$refs.treeRef.curData.rnodes
-						for(let i = 0 ; i < list.length ; i++){
-							promiseArr.push(new Promise((r2,j2) => {
+						for (let i = 0; i < list.length; i++) {
+							promiseArr.push(new Promise((r2, j2) => {
 								let file = list[i]
 								let sas = file.scope === 'school' ? schoolSas.sas : privateSas.sas
-								this.containerClient.copyBlob('syllabus/' + file.name,file.url,sas).then(res => {
+								this.containerClient.copyBlob('syllabus/' + file.name, file
+									.url, sas).then(res => {
 									curResourceArr.push({
 										type: file.type,
 										title: file.name,
 										id: this.$tools.guid(),
 										code: this.curCode,
 										scope: file.scope,
-										cntr: file.scope === 'school' ? this.$store.state.userInfo.schoolCode : this.$store.state
+										cntr: file.scope === 'school' ? this
+											.$store.state.userInfo.schoolCode :
+											this.$store.state
 											.userInfo.TEAMModelId,
 										link: [file.url]
 									})
 									r2(200)
-									
+
 								}).catch(err => {
 									console.log(err)
 									j2(err)
@@ -757,47 +754,261 @@
 						})
 					}
 				})
-				
+
+			},
+			/* 保存单个试题 */
+			saveExercise(item) {
+				return new Promise(async (r, j) => {
+					let cosmosItem = await this.$editorTools.transBase64Src(item)
+					this.$api.newEvaluation.SaveSingleExercise({
+						itemInfo: await this.$evTools.createCosmosItem(cosmosItem),
+						option: "insert",
+					}).then((res) => {
+						r(res)
+					}).catch(err => {
+						j(err)
+					});
+				});
+			},
+			/* 校本课纲关联个人试题试卷要进行入库操作 */
+			saveItemToSchoolBlob(pItem) {
+				return new Promise(async (r, j) => {
+					pItem = await this.$editorTools.doRemoveMideaHost(pItem)
+					console.log(pItem)
+					let path = 'item/' + pItem.id + '/'
+					let privateSas = await this.$tools.getPrivateSas()
+					let privareBlobTool = new BlobTool(privateSas.url, privateSas.name, privateSas.sas,'private')
+					const itemJsonFile = await this.$evTools.createBlobItem(pItem);
+					let file = new File([JSON.stringify(itemJsonFile)], pItem.id + ".json", {type: "",});
+					// 先把对应试题目录下的全部复制到校本BLOB 然后再更新添加学段科目等字段后的题目Json文件
+					this.containerClient.copyFolder(path,path.slice(0,path.length - 1),privareBlobTool).then(async res => {
+						try{
+							let blobFile = await this.containerClient.upload(file, "item/" + pItem.id);
+							if(blobFile.blob){
+								this.saveExercise(pItem).then(result => {
+									console.log(result)
+									r(result)
+								})
+							}
+						}catch(e){
+							j(e)
+						}
+					}).catch(err => {
+						j(err)
+					})
+				})
 			},
 			/* 获取关联的试题数据 */
 			onSelectQuestion(val) {
 				let list = this.$refs.chooseContentRef.$refs.exListRef.selectItems
-				if(!list.length) return
+				if (!list.length) return
 				let curResourceArr = this.$refs.treeRef.curData.rnodes
-				list.forEach(i => {
-					if(!curResourceArr.filter(j => j.type === 'item').map(k => k.id).includes(i.id)){
-						curResourceArr.push({
-							type: 'item',
-							title: i.question,
-							id: i.id,
-							code: i.code,
-							scope: i.scope,
-							cntr: i.scope === 'school' ? this.$store.state.userInfo.schoolCode : this.$store.state
-								.userInfo.TEAMModelId,
-							link: [i.blob]
+				// 拿到关联的个人试题
+				let privateItems = list.filter(i => i.scope === 'private')
+				// 如果是在校本课纲关联的个人试题 则需要进行入库操作
+				if (this.isSchool && privateItems.length) {
+					let promiseArr = []
+					// 个人试题入库前需要补充必要的学段科目年级信息
+					privateItems.forEach(pItem => {
+						pItem.periodId = this.periodList[this.currentPeriodIndex].id
+						pItem.subjectId = this.subjectList[this.activeSubjectIndex].id
+						pItem.gradeIds = [this.curVolume.gradeId + '']
+						pItem.scope = 'school'
+						pItem.code = this.$store.state.userInfo.schoolCode
+						promiseArr.push(this.saveItemToSchoolBlob(pItem))
+					})
+					Promise.all(promiseArr).then(result => {
+						list.forEach(i => {
+							if (!curResourceArr.filter(j => j.type === 'item').map(k => k.id).includes(i
+									.id)) {
+								curResourceArr.push({
+									type: 'item',
+									title: i.question,
+									id: i.id,
+									code: 'Item-' + this.$store.state.userInfo.schoolCode,
+									scope: 'school',
+									cntr: this.$store.state.userInfo.schoolCode,
+									link: [i.blob]
+								})
+							}
 						})
+					}).catch(err => {
+						this.$Message.error(err)
+					})
+				} else {
+					list.forEach(i => {
+						if (!curResourceArr.filter(j => j.type === 'item').map(k => k.id).includes(i.id)) {
+							curResourceArr.push({
+								type: 'item',
+								title: i.question,
+								id: i.id,
+								code: i.code,
+								scope: i.scope,
+								cntr: i.scope === 'school' ? this.$store.state.userInfo.schoolCode : this
+									.$store.state
+									.userInfo.TEAMModelId,
+								link: [i.blob]
+							})
+						}
+					})
+				}
+
+			},
+			/* 判断试卷名称是否已存在校本库中 */
+			getSchoolPaperList(){
+				return new Promise((r,j) => {
+					this.$api.learnActivity.FindExamPaper({
+						"code": this.$store.state.userInfo.schoolCode,
+						"scope": "school"
+					}).then(result => {
+						if(!result.error){
+							r(result.papers)
+						}else{
+							j(result.error)
+						}
+					}).catch(e =>{
+						j(false)
+					})
+				})
+			},
+			/* 将个人同步到校本的试卷 保存一份到cosmos */
+			savePaperToCosmos(paper,scoring,isUpdate){
+				paper.scoring = scoring
+				paper.blob = '/paper/' + paper.name
+				return new Promise(async (r,j) => {
+					let params = {
+						paper: await this.$evTools.createCosmosPaper(paper),
+						option: isUpdate ? 'update' : 'insert'
 					}
+					//  保存试卷到cosmos
+					this.$api.learnActivity.SaveExamPaper(params).then(
+						res => {
+							if (res.error == null) {
+								r(res)
+								this.$Message.success('保存成功!')
+							} else {
+								r(res.error)
+								this.$Message.error(this.$t('evaluation.paperList.saveFail'))
+							}
+						},
+						err => {
+							j(err)
+							this.$Message.error(this.$t('evaluation.paperList.saveFail'))
+						}
+					)
+				})
+				
+			},
+			/* 将个人试卷导入到校本试卷库中 */
+			savePaperToSchoolBlob(paper,scoring,isUpdate){
+				return new Promise(async (r, j) => {
+					let path = 'paper/' + paper.name + '/'
+					let privateSas = await this.$tools.getPrivateSas()
+					let privareBlobTool = new BlobTool(privateSas.url, privateSas.name, privateSas.sas,'private')
+					let file = new File([JSON.stringify(paper)], "index.json", {type: "",});
+					// 先把对应试题目录下的全部复制到校本BLOB 然后再更新添加学段科目等字段后的题目Json文件
+					this.containerClient.copyFolder(path,path.slice(0,path.length - 1),privareBlobTool).then(async res => {
+						try{
+							let blobFile = await this.containerClient.upload(file, "paper/" + paper.name);
+							if(blobFile.blob){
+								this.savePaperToCosmos(paper,scoring,isUpdate).then(result => {
+									console.log(result)
+									r(result)
+								})
+							}
+						}catch(e){
+							j(e)
+						}
+					}).catch(err => {
+						j(err)
+					})
 				})
 			},
 			/* 获取关联的试卷数据 */
-			onSelectPaper(){
+			async onSelectPaper() {
 				let list = this.$refs.chooseContentRef.$refs.paperListRef.checkedPaperList
-				if(!list.length) return
+				if (!list.length) return
 				let curResourceArr = this.$refs.treeRef.curData.rnodes
-				list.forEach(i => {
-					if(!curResourceArr.filter(j => j.type === 'paper').map(k => k.id).includes(i.id)){
-						curResourceArr.push({
-							type: 'paper',
-							title: i.name,
-							id: i.id,
-							code: i.code,
-							scope: i.scope,
-							cntr: i.scope === 'school' ? this.$store.state.userInfo.schoolCode : this.$store.state
-								.userInfo.TEAMModelId,
-							link: [i.blob]
+				// 拿到关联的个人试卷
+				let privatePapers = list.filter(i => i.scope === 'private')
+				let privateSas = await this.$tools.getPrivateSas()
+				// 如果是在校本课纲关联的个人试卷 则需要进行入库操作
+				if (this.isSchool && privatePapers.length) {
+					let schoolPaperList = await this.getSchoolPaperList()
+					console.log(privatePapers)
+					let promiseArr = []
+					privatePapers.forEach(async paper => {
+						if(schoolPaperList.map(i => i.name).includes(paper.name)){
+							this.$Modal.confirm({
+								title: '提示',
+								content: '校本试卷库中已存在名称为' + paper.name + '的试卷,是否继续操作覆盖原试卷?',
+								onOk: async () => {
+									// 继续进行操作完成试卷覆盖
+									// 拿到试卷的index.json 先完善学段科目年级信息后 去进行上传覆盖操作
+									let indexJsonFile = await this.$tools.getFile(this.$evTools.getBlobHost() + '/' + paper.code.replace('Paper-','') + paper.blob + '/index.json' + privateSas.sas)
+									let paperIndexJson = JSON.parse(indexJsonFile)
+									paperIndexJson.periodId = this.periodList[this.currentPeriodIndex].id
+									paperIndexJson.subjectId = this.subjectList[this.activeSubjectIndex].id
+									paperIndexJson.subjectName = this.subjectList[this.activeSubjectIndex].name
+									paperIndexJson.gradeIds = [this.curVolume.gradeId + '']
+									paperIndexJson.scope = 'school'
+									paperIndexJson.code = this.$store.state.userInfo.schoolCode
+									console.log(paperIndexJson)
+									promiseArr.push(this.savePaperToSchoolBlob(paperIndexJson,paper.scoring,true))
+								},
+								onCancel: () => {
+									// 取消则无法关联当前试卷到节点
+									curResourceArr.splice(curResourceArr.map(i => i.id).indexOf(paper.id),1)
+								}
+							})
+						}else{
+							// 拿到试卷的index.json 先完善学段科目年级信息后 去进行上传覆盖操作
+							let indexJsonFile = await this.$tools.getFile(this.$evTools.getBlobHost() + '/' + paper.code.replace('Paper-','') + paper.blob + '/index.json' + privateSas.sas)
+							let paperIndexJson = JSON.parse(indexJsonFile)
+							paperIndexJson.periodId = this.periodList[this.currentPeriodIndex].id
+							paperIndexJson.subjectId = this.subjectList[this.activeSubjectIndex].id
+							paperIndexJson.subjectName = this.subjectList[this.activeSubjectIndex].name
+							paperIndexJson.gradeIds = [this.curVolume.gradeId + '']
+							paperIndexJson.scope = 'school'
+							paperIndexJson.code = this.$store.state.userInfo.schoolCode
+							console.log(paperIndexJson)
+							promiseArr.push(this.savePaperToSchoolBlob(paperIndexJson,paper.scoring))
+						}
+						
+					})
+					Promise.all(promiseArr).then(result => {
+						console.log(result)
+						list.forEach(i => {
+							if (!curResourceArr.filter(j => j.type === 'paper').map(k => k.id).includes(i.id)) {
+								curResourceArr.push({
+									type: 'paper',
+									title: i.name,
+									id: i.id,
+									code: 'Paper-' + this.$store.state.userInfo.schoolCode,
+									scope: 'school',
+									cntr:this.$store.state.userInfo.schoolCode,
+									link: [i.blob]
+								})
+							}
 						})
-					}
-				})
+					})
+				}else{
+					list.forEach(i => {
+						if (!curResourceArr.filter(j => j.type === 'paper').map(k => k.id).includes(i.id)) {
+							curResourceArr.push({
+								type: 'paper',
+								title: i.name,
+								id: i.id,
+								code: i.code,
+								scope: i.scope,
+								cntr: i.scope === 'school' ? this.$store.state.userInfo.schoolCode : this
+									.$store.state
+									.userInfo.TEAMModelId,
+								link: [i.blob]
+							})
+						}
+					})
+				}
 			},
 			/* 点击确认 去获取关联的内容数据、试题试卷数据 */
 			onRelateContent() {
@@ -810,7 +1021,7 @@
 					this.isRelateContentModal = false
 					this.hasModify = true
 					this.modifyIdArr.push(this.curChapter.data.id)
-				}).catch(err=> {
+				}).catch(err => {
 					this.$Message.error(err)
 				})
 			},
@@ -818,29 +1029,48 @@
 			async onPreview(item) {
 				console.log(item)
 				this.questionList = []
-				let sasObj = item.scope === 'school' ? await this.$tools.getSchoolSas() : await this.$tools.getPrivateSas()
+				let sasObj = item.scope === 'school' ? await this.$tools.getSchoolSas() : await this.$tools
+					.getPrivateSas()
 				switch (item.type) {
 					case 'item':
 						this.previewPaper = null
-						this.questionList = [{
-							code: item.code,
-							id: item.id,
-							blob: item.link[0],
-							scope: item.scope
-						}]
+						let tmdId = item.code.replace('Item-', '')
+						// 如果不是当前用户自己的试题 则需要去获取他人BLOB内部的试题JSON文件
+						if (tmdId !== this.$store.state.userInfo.TEAMModelId) {
+							this.isFullList = 'true'
+							let fullItemJson = await this.$evTools.getFullItemByTmdId(tmdId, item.link[0])
+							this.questionList = [fullItemJson]
+						} else {
+							this.isFullList = null
+							this.questionList = [{
+								code: item.code,
+								id: item.id,
+								blob: item.link[0],
+								scope: item.scope
+							}]
+						}
 						this.$nextTick(() => {
 							this.$refs.exList.collapseList = [0]
 						})
 						this.isPreviewPaper = true
 						break;
 					case 'paper':
-						let paper = {
-							code: item.code,
-							id: item.id,
-							blob: item.link[0],
-							scope: item.scope,
+						let paperTmdId = item.code.replace('Paper-', '')
+						let fullPaper = null
+						// 如果不是当前用户自己的试题 则需要去获取他人BLOB内部的试卷JSON文件
+						if (paperTmdId !== this.$store.state.userInfo.TEAMModelId) {
+							this.isFullList = 'true'
+							fullPaper = await this.$evTools.getFullPaperByTmdId(paperTmdId, item.link[0])
+						} else {
+							this.isFullList = null
+							let paper = {
+								code: item.code,
+								id: item.id,
+								blob: item.link[0],
+								scope: item.scope,
+							}
+							fullPaper = await this.$evTools.getFullPaper(paper)
 						}
-						let fullPaper = await this.$evTools.getFullPaper(paper)
 						this.previewPaper = fullPaper
 						this.questionList = fullPaper.item
 						this.$nextTick(() => {
@@ -853,9 +1083,9 @@
 						break;
 					case 'doc':
 						let copyLink = JSON.parse(JSON.stringify(item.link))
-						
+
 						if (this.getSuffix(item.title) === 'pdf') {
-							this.openPdf(item.link[0] + sasObj.sas,item.title)
+							this.openPdf(item.link[0] + sasObj.sas, item.title)
 							// window.open(item.link[0]+ sasObj.sas);
 						} else {
 							this.previewFile = JSON.parse(JSON.stringify(item))
@@ -871,14 +1101,14 @@
 				}
 			},
 			/* 点击试卷列表预览试卷 */
-			async onPreviewPaper(paper){
+			async onPreviewPaper(paper) {
 				let fullPaper = await this.$evTools.getFullPaper(paper)
 				this.previewPaper = fullPaper
 				this.questionList = fullPaper.item
 				this.isPreviewPaper = true
 			},
 			/* 打开PDF文件进行预览 */
-			openPdf(url){
+			openPdf(url) {
 				window.open('/web/viewer.html?file=' + encodeURIComponent(url));
 			},
 			/* 删除关联资源 */
@@ -888,7 +1118,7 @@
 					content: '确定要移除该资源吗?',
 					onOk: () => {
 						// 需要删除blob对应目录下的文件
-						if(this.needDeleteFile(item)){
+						if (this.needDeleteFile(item)) {
 							this.isLoading = true
 							this.deleteBlobPrefix(item).then(r => {
 								this.$Message.success(this.$t('evaluation.deleteSuc'))
@@ -900,7 +1130,7 @@
 							}).finally(() => {
 								this.isLoading = false
 							})
-						}else{
+						} else {
 							this.$refs.treeRef.curData.rnodes.splice(index, 1)
 							this.hasModify = true
 							this.modifyIdArr.push(this.curChapter.data.id)
@@ -930,7 +1160,7 @@
 			},
 			/* 提交新增册别 */
 			handleSubmit() {
-				return new Promise((r,j) => {
+				return new Promise((r, j) => {
 					this.isAddLoading = true
 					let addVolumeParams = {
 						"code": this.curCode,
@@ -943,7 +1173,7 @@
 						"creatorId": this.$store.state.userInfo.TEAMModelId,
 						"school": this.isSchool ? this.$store.state.userInfo.schoolCode : '',
 						"scope": this.curScope,
-						"syllabusIds":[]
+						"syllabusIds": []
 					}
 					if (this.isEditVolume && this.curVolume) {
 						addVolumeParams.id = this.curVolume.id
@@ -967,41 +1197,38 @@
 						this.isAddLoading = false
 					})
 				})
-				
+
 			},
-			
 			/* 获取整个树的章节与子节点归属 */
-			getAllChild(arr){
+			getAllChild(arr) {
 				let result = []
 				arr.forEach(item => {
 					result.push({
-						chapterId:item.id,
-						children:this.flatChildren(item.children)
+						chapterId: item.id,
+						children: this.flatChildren(item.children)
 					})
 				})
 				this.flatArr = result
 			},
-			
 			/* 递归拉平所有children */
-			flatChildren(children){
+			flatChildren(children) {
 				let result = []
-				const fn = (source)=>{
-				    source.forEach(i => {
-				    	result.push(i.id)
-				    	if(i.children.length){
-				    		fn(i.children)
-				    	}
-				    })
+				const fn = (source) => {
+					source.forEach(i => {
+						result.push(i.id)
+						if (i.children.length) {
+							fn(i.children)
+						}
+					})
 				}
 				fn(children)
 				return result
 			},
-			
 			/* 根据某个节点ID换取它对应的章节ID */
-			getChapterIdById(id){
-				if(this.flatArr.map(i => i.chapterId).includes(id)){
+			getChapterIdById(id) {
+				if (this.flatArr.map(i => i.chapterId).includes(id)) {
 					return id
-				}else{
+				} else {
 					console.log(this.flatArr)
 					console.log(id);
 					let targetChapter = this.flatArr.find(i => i.children.includes(id))
@@ -1031,29 +1258,31 @@
 			curScope() {
 				return this.isSchool ? "school" : "private"
 			},
-			
+
 			getSuffix() {
 				return name => {
 					return name.substr(name.lastIndexOf(".") + 1)
 				}
 			},
-			needDeleteFile(){
+			needDeleteFile() {
 				return item => {
 					return item.type !== 'item' && item.type !== 'paper' && item.type !== 'link'
 				}
 			},
-			hasEditAuth(){
+			hasEditAuth() {
 				return nodeData => {
-					if(!nodeData.id) return false
+					if (!nodeData.id) return false
 					let userId = this.$store.state.userInfo.TEAMModelId
 					// 判断是否为一级节点,如果是二级节点则需要拿对应的一级节点去做判断
-					let chapterId = nodeData.pid === this.curVolume.id ? nodeData.id : this.getChapterIdById(nodeData.id)
+					let chapterId = nodeData.pid === this.curVolume.id ? nodeData.id : this.getChapterIdById(nodeData
+						.id)
 					let chapterNode = this.treeOrigin.find(i => i.id === chapterId)
-					return this.curVolume.creatorId === userId || (chapterNode.auth && chapterNode.auth.length && chapterNode.auth.map(i => i.tmdid).includes(userId))
+					return this.curVolume.creatorId === userId || (chapterNode.auth && chapterNode.auth.length &&
+						chapterNode.auth.map(i => i.tmdid).includes(userId))
 				}
 			},
 			// 是否可以操作课纲模块(个人课纲或者管理员或者有课纲权限)
-			hasSyllabusAuth(){
+			hasSyllabusAuth() {
 				return !this.isSchool || this.$access.can('admin.*|Syllabus_Edit')
 			}
 		},
@@ -1087,16 +1316,16 @@
 			}
 		}
 	}
-	
-	.syllabus-content-header{
-		.ivu-input{
+
+	.syllabus-content-header {
+		.ivu-input {
 			background-color: #262626;
 			border-color: #333;
 			font-size: 12px;
 			color: #ddd;
 		}
 	}
-	
+
 	.tree-upload-modal {
 		.ivu-modal-body {
 			padding: 10px 40px;
@@ -1215,14 +1444,17 @@
 		border: none;
 		color: #fff;
 	}
-	
-	.choose-content-modal{
-		.ev-list-container , .pl-container{
-			  height: 600px !important;
-			  overflow: auto;
-			  padding-right: 10px;
+
+	.choose-content-modal {
+
+		.ev-list-container,
+		.pl-container {
+			height: 600px !important;
+			overflow: auto;
+			padding-right: 10px;
 		}
-		.modal-btn{
+
+		.modal-btn {
 			width: 100%;
 			margin: 20px 10px;
 		}