Переглянути джерело

处理校本个人入库的调整

OnePsycho 4 роки тому
батько
коміт
51661d299d
1 змінених файлів з 11 додано та 10 видалено
  1. 11 10
      TEAMModelOS/ClientApp/src/view/syllabus/Syllabus.vue

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

@@ -961,8 +961,11 @@
 					let privateSas = await this.$tools.getPrivateSas()
 					let privateBlobTool = new BlobTool(privateSas.url, privateSas.name, privateSas.sas,
 						'private')
-					let toClient = privateToSchool ? this.containerClient : privateBlobTool
-					let fromClient = privateToSchool ? privateBlobTool : this.containerClient
+					let schoolSas = await this.$tools.getSchoolSas()
+					let schoolBlobTool = new BlobTool(schoolSas.url, schoolSas.name, schoolSas.sas,
+						'school')	
+					let toClient = privateToSchool ? schoolBlobTool : privateBlobTool
+					let fromClient = privateToSchool ? privateBlobTool : schoolBlobTool
 					const itemJsonFile = await this.$evTools.createBlobItem(pItem);
 					let file = new File([JSON.stringify(itemJsonFile)], pItem.id + ".json", {
 						type: "",
@@ -1008,7 +1011,7 @@
 								pItem.gradeIds = [this.curVolume.gradeId + '']
 								pItem.scope = 'school'
 								pItem.code = this.$store.state.userInfo.schoolCode
-								promiseArr.push(this.saveItemToBlob(pItem, false))
+								promiseArr.push(this.saveItemToBlob(pItem, true))
 							})
 							Promise.all(promiseArr).then(result => {
 								list.forEach(i => {
@@ -1040,7 +1043,7 @@
 								pItem.gradeIds = null
 								pItem.scope = 'private'
 								pItem.code = this.$store.state.userInfo.TEAMModelId
-								promiseArr.push(this.saveItemToBlob(pItem, true))
+								promiseArr.push(this.saveItemToBlob(pItem, false))
 							})
 							Promise.all(promiseArr).then(result => {
 								list.forEach(i => {
@@ -1292,12 +1295,10 @@
 				this.isRelateLoading = true
 				Promise.all([this.onSelectFile(), this.onSelectQuestion(), this.onSelectPaper()]).then(result => {
 					console.log(result)
-					setTimeout(() => {
-						this.isRelateLoading = false
-						this.isRelateContentModal = false
-						this.hasModify = true
-						this.modifyIdArr.push(this.curChapter.data.id)
-					}, 500)
+					this.isRelateLoading = false
+					this.isRelateContentModal = false
+					this.hasModify = true
+					this.modifyIdArr.push(this.curChapter.data.id)
 				}).catch(err => {
 					console.log(err)
 					this.isRelateLoading = false