|
@@ -36,6 +36,9 @@
|
|
|
{{$jsFn.formatBytes(sizeInfo.total)}}/{{ $jsFn.formatBytes(storageSpace)}}
|
|
|
</span>
|
|
|
<span v-if="sizeInfo.total > storageSpace">{{$t('teachContent.blobFull')}}</span>
|
|
|
+ <Tooltip :content="$t('teachContent.spaceTips')" v-show="routerScope == 'school'" transfer max-width="500" theme="light">
|
|
|
+ <Icon type="ios-information-circle-outline" class="space-tips" />
|
|
|
+ </Tooltip>
|
|
|
</p>
|
|
|
<div class="percent-detail-box">
|
|
|
<p class="percent-detail-text" v-if="sizeInfo.res != 0">
|
|
@@ -230,6 +233,7 @@ export default {
|
|
|
},
|
|
|
data() {
|
|
|
return {
|
|
|
+ teachSpace: 0,
|
|
|
schoolBase: {
|
|
|
period: []
|
|
|
},
|
|
@@ -252,7 +256,7 @@ export default {
|
|
|
fileColumns: [],
|
|
|
previewFile: {},
|
|
|
previewStatus: false,
|
|
|
- storageSpace: 0,
|
|
|
+ // storageSpace: 0,
|
|
|
keyWord: '',
|
|
|
activeType: 'recent',
|
|
|
fileList: {},
|
|
@@ -284,6 +288,22 @@ export default {
|
|
|
}
|
|
|
},
|
|
|
methods: {
|
|
|
+ // 获取容器空间情况
|
|
|
+ getSize() {
|
|
|
+ this.sizeLoading = true
|
|
|
+ BlobTool.getContainerSize(this.containerName, this.routerScope).then(
|
|
|
+ res => {
|
|
|
+ this.sizeInfo = res
|
|
|
+ console.log(res, res.teach)
|
|
|
+ this.teachSpace = res.teachSpace || 0
|
|
|
+ },
|
|
|
+ err => {
|
|
|
+ this.$Message.error(this.$t('teachContent.sizeErr'))
|
|
|
+ }
|
|
|
+ ).finally(() => {
|
|
|
+ this.sizeLoading = false
|
|
|
+ })
|
|
|
+ },
|
|
|
//根据学科id换取名称
|
|
|
getSubjects(ids) {
|
|
|
if (this.schoolBase && this.schoolBase.period && this.filterPeriod && ids) {
|
|
@@ -350,52 +370,86 @@ export default {
|
|
|
},
|
|
|
confirmRename() {
|
|
|
let editIndex = this.editIndex
|
|
|
- if (this.fileListShow[this.editIndex].extension == 'HTEX') {
|
|
|
- let newName = this.fileListShow[editIndex].name
|
|
|
- this.containerClient.copyFolder(`res/${newName.replace('.HTEX', '/')}`, `res/${this.renameBefore.replace('.HTEX', '')}`).then(
|
|
|
- res => {
|
|
|
- this.$api.blob.deletePrefix({
|
|
|
- cntr: this.routerScope == 'school' ? this.$store.state.userInfo.schoolCode : this.$store.state.userInfo.TEAMModelId,
|
|
|
- prefix: `res/${this.renameBefore.replace('.HTEX', '')}`
|
|
|
- }).then(
|
|
|
- res => {
|
|
|
- this.$Message.success(this.$t('teachContent.nameOk'))
|
|
|
- let orginUrl = this.fileListShow[editIndex].url
|
|
|
- this.fileListShow[editIndex].blob = `/res/${this.newName}/index.json`
|
|
|
- this.fileListShow[editIndex].url = orginUrl.replace(this.renameBefore, this.fileListShow[editIndex].name)
|
|
|
- }
|
|
|
- )
|
|
|
- },
|
|
|
- err => {
|
|
|
- this.$Message.error(this.$t('teachContent.nameErr'))
|
|
|
- }
|
|
|
- ).finally(() => {
|
|
|
- this.editIndex = -1
|
|
|
- })
|
|
|
- } else {
|
|
|
- let sourceUrl = this.fileListShow[this.editIndex].url.substring(0, this.fileListShow[this.editIndex].url.lastIndexOf('?')) //截取授权之前的,授权不能encode
|
|
|
- let targetUrl = this.fileListShow[this.editIndex].blob
|
|
|
- targetUrl = targetUrl.replace(this.renameBefore, this.fileListShow[this.editIndex].name)
|
|
|
- targetUrl = targetUrl.substring(1)
|
|
|
- this.containerClient.copyBlob(targetUrl, sourceUrl, this.sasString).then(
|
|
|
- res => {
|
|
|
- //这里虽然是复制,但是是重命名操作,所以空间不会变化,就设置为0
|
|
|
- this.containerClient.deleteBlob(this.fileListShow[editIndex].blob, 0).then(
|
|
|
- res => {
|
|
|
- this.$Message.success(this.$t('teachContent.nameOk'))
|
|
|
- let orginUrl = this.fileListShow[editIndex].url
|
|
|
- this.fileListShow[editIndex].blob = '/' + targetUrl
|
|
|
- this.fileListShow[editIndex].url = orginUrl.replace(this.renameBefore, this.fileListShow[editIndex].name)
|
|
|
- }
|
|
|
- )
|
|
|
- },
|
|
|
- err => {
|
|
|
- this.$Message.error(this.$t('teachContent.nameErr'))
|
|
|
- }
|
|
|
- ).finally(() => {
|
|
|
- this.editIndex = -1
|
|
|
- })
|
|
|
+ console.log(this.fileListShow[editIndex])
|
|
|
+ let newName = this.fileListShow[editIndex].name
|
|
|
+
|
|
|
+ let params = {
|
|
|
+ scope: this.routerScope,
|
|
|
+ cntr: this.routerScope == 'school' ? this.$store.state.userInfo.schoolCode : this.$store.state.userInfo.TEAMModelId,
|
|
|
+ id: this.fileListShow[editIndex].id,
|
|
|
+ newName: this.fileListShow[editIndex].blob.replace(this.renameBefore, newName).substring(1)
|
|
|
}
|
|
|
+ this.$api.blob.blobRename(params).then(
|
|
|
+ res => {
|
|
|
+ this.$Message.success(this.$t('teachContent.nameOk'))
|
|
|
+ let orginUrl = this.fileListShow[editIndex].url
|
|
|
+ let thum = this.fileListShow[editIndex].url
|
|
|
+ this.fileListShow[editIndex].blob = '/' + params.newName
|
|
|
+ this.fileListShow[editIndex].url = orginUrl.replace(this.renameBefore, newName)
|
|
|
+ this.fileListShow[editIndex].thum = thum.replace(this.renameBefore, newName)
|
|
|
+ // 更新本地数据
|
|
|
+ this.renameCacheFiles(this.fileListShow[editIndex])
|
|
|
+ // 更新源数据
|
|
|
+ let type = this.fileListShow[editIndex].type
|
|
|
+ for (let index = 0; index < this.fileList[type].length; index++) {
|
|
|
+ if(this.fileList[type][index].id == this.fileListShow[editIndex].id){
|
|
|
+ this.fileList[type].splice(index, 1, this.fileListShow[editIndex])
|
|
|
+ break
|
|
|
+ }
|
|
|
+ }
|
|
|
+ },
|
|
|
+ err => {
|
|
|
+ this.$Message.error(this.$t('teachContent.nameErr'))
|
|
|
+ }
|
|
|
+ ).finally(() => {
|
|
|
+ this.editIndex = -1
|
|
|
+ })
|
|
|
+ // if (this.fileListShow[this.editIndex].extension == 'HTEX') {
|
|
|
+ // let newName = this.fileListShow[editIndex].name
|
|
|
+ // this.containerClient.copyFolder(`res/${newName.replace('.HTEX', '/')}`, `res/${this.renameBefore.replace('.HTEX', '')}`).then(
|
|
|
+ // res => {
|
|
|
+ // this.$api.blob.deletePrefix({
|
|
|
+ // cntr: this.routerScope == 'school' ? this.$store.state.userInfo.schoolCode : this.$store.state.userInfo.TEAMModelId,
|
|
|
+ // prefix: `res/${this.renameBefore.replace('.HTEX', '')}`
|
|
|
+ // }).then(
|
|
|
+ // res => {
|
|
|
+ // this.$Message.success(this.$t('teachContent.nameOk'))
|
|
|
+ // let orginUrl = this.fileListShow[editIndex].url
|
|
|
+ // this.fileListShow[editIndex].blob = `/res/${this.newName}/index.json`
|
|
|
+ // this.fileListShow[editIndex].url = orginUrl.replace(this.renameBefore, this.fileListShow[editIndex].name)
|
|
|
+ // }
|
|
|
+ // )
|
|
|
+ // },
|
|
|
+ // err => {
|
|
|
+ // this.$Message.error(this.$t('teachContent.nameErr'))
|
|
|
+ // }
|
|
|
+ // ).finally(() => {
|
|
|
+ // this.editIndex = -1
|
|
|
+ // })
|
|
|
+ // } else {
|
|
|
+ // let sourceUrl = this.fileListShow[this.editIndex].url.substring(0, this.fileListShow[this.editIndex].url.lastIndexOf('?')) //截取授权之前的,授权不能encode
|
|
|
+ // let targetUrl = this.fileListShow[this.editIndex].blob
|
|
|
+ // targetUrl = targetUrl.replace(this.renameBefore, this.fileListShow[this.editIndex].name)
|
|
|
+ // targetUrl = targetUrl.substring(1)
|
|
|
+ // this.containerClient.copyBlob(targetUrl, sourceUrl, this.sasString).then(
|
|
|
+ // res => {
|
|
|
+ // //这里虽然是复制,但是是重命名操作,所以空间不会变化,就设置为0
|
|
|
+ // this.containerClient.deleteBlob(this.fileListShow[editIndex].blob, 0).then(
|
|
|
+ // res => {
|
|
|
+ // this.$Message.success(this.$t('teachContent.nameOk'))
|
|
|
+ // let orginUrl = this.fileListShow[editIndex].url
|
|
|
+ // this.fileListShow[editIndex].blob = '/' + targetUrl
|
|
|
+ // this.fileListShow[editIndex].url = orginUrl.replace(this.renameBefore, this.fileListShow[editIndex].name)
|
|
|
+ // }
|
|
|
+ // )
|
|
|
+ // },
|
|
|
+ // err => {
|
|
|
+ // this.$Message.error(this.$t('teachContent.nameErr'))
|
|
|
+ // }
|
|
|
+ // ).finally(() => {
|
|
|
+ // this.editIndex = -1
|
|
|
+ // })
|
|
|
+ // }
|
|
|
},
|
|
|
getFileUrl(files) { // 获取文件地址
|
|
|
this.preUpdFiles.push(...files)
|
|
@@ -525,7 +579,26 @@ export default {
|
|
|
} else {
|
|
|
localStorage.setItem('cacheSchoolFiles', JSON.stringify(cacheFiles))
|
|
|
}
|
|
|
-
|
|
|
+ },
|
|
|
+ //重命名更新本地数据
|
|
|
+ renameCacheFiles(file) {
|
|
|
+ let cacheFiles
|
|
|
+ if (this.routerScope == 'private') {
|
|
|
+ cacheFiles = JSON.parse(localStorage.getItem('cachePrivFiles') || '[]')
|
|
|
+ } else {
|
|
|
+ cacheFiles = JSON.parse(localStorage.getItem('cacheSchoolFiles') || '[]')
|
|
|
+ }
|
|
|
+ for (let i = 0; i < cacheFiles.length; i++) {
|
|
|
+ if (file.id == cacheFiles[i].id) {
|
|
|
+ cacheFiles.splice(i, 1, file)
|
|
|
+ break
|
|
|
+ }
|
|
|
+ }
|
|
|
+ if (this.routerScope == 'private') {
|
|
|
+ localStorage.setItem('cachePrivFiles', JSON.stringify(cacheFiles))
|
|
|
+ } else {
|
|
|
+ localStorage.setItem('cacheSchoolFiles', JSON.stringify(cacheFiles))
|
|
|
+ }
|
|
|
},
|
|
|
//计算空间占比
|
|
|
getPercent(size) {
|
|
@@ -619,7 +692,6 @@ export default {
|
|
|
let gradeFilters = []
|
|
|
|
|
|
// 获取当前年级做筛选条件
|
|
|
-
|
|
|
let arr = [
|
|
|
{
|
|
|
title: this.$t('teachContent.applySub'),
|
|
@@ -734,20 +806,6 @@ export default {
|
|
|
this.$Message.error(this.$t('teachContent.authErr'))
|
|
|
}
|
|
|
},
|
|
|
- // 获取容器空间情况
|
|
|
- getSize() {
|
|
|
- this.sizeLoading = true
|
|
|
- BlobTool.getContainerSize(this.containerName, this.routerScope).then(
|
|
|
- res => {
|
|
|
- this.sizeInfo = res
|
|
|
- },
|
|
|
- err => {
|
|
|
- this.$Message.error(this.$t('teachContent.sizeErr'))
|
|
|
- }
|
|
|
- ).finally(() => {
|
|
|
- this.sizeLoading = false
|
|
|
- })
|
|
|
- },
|
|
|
//批量删除
|
|
|
delFileBatch() {
|
|
|
if (this.selections.length == 0) {
|
|
@@ -763,115 +821,155 @@ export default {
|
|
|
title: this.$t('teachContent.props1'),
|
|
|
content: "<p class='dialog-p'>" + names.join(', ') + '</p>',
|
|
|
onOk: () => {
|
|
|
- if (this.activeType == 'res') {
|
|
|
- //批量删除HTEX需要循环删除每个文件夹下面的文件
|
|
|
- this.selections.forEach((item, index) => {
|
|
|
- this.$api.blob.deletePrefix({
|
|
|
- cntr: this.routerScope == 'school' ? this.$store.state.userInfo.schoolCode : this.$store.state.userInfo.TEAMModelId,
|
|
|
- prefix: `res/${item.name.replace('.HTEX', '')}`,
|
|
|
- scope: this.routerScope
|
|
|
- }).then(
|
|
|
- res => {
|
|
|
- let fileNames = this.selections.map((item) => { return item.name })
|
|
|
- for (let i = 0; i < this.fileList[this.activeType].length; i++) {
|
|
|
- let index = fileNames.indexOf(this.fileList[this.activeType][i].name)
|
|
|
- if (index > -1) {
|
|
|
- this.sizeInfo[this.activeType] -= this.fileList[this.activeType][i].size
|
|
|
- this.sizeInfo.total -= this.fileList[this.activeType][i].size
|
|
|
- this.fileList[this.activeType].splice(i, 1)
|
|
|
- i--
|
|
|
- }
|
|
|
- }
|
|
|
- let fs = this.fileList[this.activeType] ? this.fileList[this.activeType] : []
|
|
|
- this.fileListShow = this._.cloneDeep(fs)
|
|
|
- this.$Message.success(this.$t('teachContent.props2'))
|
|
|
- },
|
|
|
- err => {
|
|
|
- this.$Message.error(this.$t('teachContent.props3'))
|
|
|
- }
|
|
|
- ).finally(() => {
|
|
|
- this.isLoading = false
|
|
|
- })
|
|
|
- })
|
|
|
- //删除本地最近上传数据
|
|
|
- let ids = this.selections.map(item => {
|
|
|
- return item.id
|
|
|
- })
|
|
|
- this.delCacheFiles(ids)
|
|
|
- } else {
|
|
|
- let blobs = this.selections.map((item) => {
|
|
|
- return item.url.substring(0, item.url.lastIndexOf('?'))
|
|
|
- })
|
|
|
- let ids = this.selections.map((item) => {
|
|
|
- return item.id
|
|
|
+ let params = {
|
|
|
+ scope: this.routerScope,
|
|
|
+ cntr: this.routerScope == 'school' ? this.$store.state.userInfo.schoolCode : this.$store.state.userInfo.TEAMModelId,
|
|
|
+ blobs: []
|
|
|
+ }
|
|
|
+ this.selections.forEach(item => {
|
|
|
+ params.blobs.push({
|
|
|
+ path: item.blob.substring(1),
|
|
|
+ id: item.id
|
|
|
})
|
|
|
- this.$api.blob.deleteBlobs({
|
|
|
- cntr: this.routerScope == 'school' ? this.$store.state.userInfo.schoolCode : this.$store.state.userInfo.TEAMModelId,
|
|
|
- urls: blobs,
|
|
|
- scope: this.routerScope,
|
|
|
- ids
|
|
|
- }).then(
|
|
|
- res => {
|
|
|
- let thums = this.selections.map((item) => {
|
|
|
- if (item.type == 'image') {
|
|
|
- return item.url.substring(0, item.url.lastIndexOf('?')).replace('/image/', '/thum/')
|
|
|
- } else if (item.extension == 'MP4') {
|
|
|
- let n = item.url.substring(0, item.url.lastIndexOf('?')).replace('/video/', '/thum/')
|
|
|
- return n.slice(0, n.lastIndexOf('.')) + '.png'
|
|
|
- }
|
|
|
-
|
|
|
- })
|
|
|
- // if (this.activeType == 'image') {
|
|
|
- // thums = blobs.map((item) => { return item.replace('/image/', '/thum/') })
|
|
|
- // } else if (this.activeType == 'video') {
|
|
|
- // thums = blobs.map((item) => {
|
|
|
- // let n = item.replace('/video/', '/thum/')
|
|
|
- // return n.slice(0, n.lastIndexOf('.')) + '.png'
|
|
|
- // })
|
|
|
- // }
|
|
|
- if (thums.length) {
|
|
|
- this.$api.blob.deleteBlobs({
|
|
|
- cntr: this.routerScope == 'school' ? this.$store.state.userInfo.schoolCode : this.$store.state.userInfo.TEAMModelId,
|
|
|
- urls: thums,
|
|
|
- scope: this.routerScope,
|
|
|
- ids: []
|
|
|
- })
|
|
|
- }
|
|
|
-
|
|
|
- let files = this.selections.map((item) => { return item.blob })
|
|
|
- for (let i = 0; i < this.fileList[this.activeType].length; i++) {
|
|
|
- let index = files.indexOf(this.fileList[this.activeType][i].blob)
|
|
|
- if (index != -1) {
|
|
|
- this.sizeInfo[this.activeType] -= this.fileList[this.activeType][i].size
|
|
|
- this.sizeInfo.total -= this.fileList[this.activeType][i].size
|
|
|
- this.fileList[this.activeType].splice(i, 1)
|
|
|
- i--
|
|
|
- }
|
|
|
+ })
|
|
|
+ this.$api.blob.deleteBlobs(params).then(
|
|
|
+ res => {
|
|
|
+ let ids = this.selections.map(item => {
|
|
|
+ return item.id
|
|
|
+ })
|
|
|
+ //删除本地最近上传数据
|
|
|
+ this.delCacheFiles(ids)
|
|
|
+ this.fileList[this.activeType] = this.fileList[this.activeType] ? this.fileList[this.activeType] : []
|
|
|
+ for (let i = 0; i < this.fileList[this.activeType].length; i++) {
|
|
|
+ if (ids.includes(this.fileList[this.activeType][i].id)) {
|
|
|
+ this.sizeInfo[this.activeType] -= this.fileList[this.activeType][i].size
|
|
|
+ this.sizeInfo.total -= this.fileList[this.activeType][i].size
|
|
|
+ this.fileList[this.activeType].splice(i, 1)
|
|
|
+ i--
|
|
|
}
|
|
|
- let fs = this.fileList[this.activeType] ? this.fileList[this.activeType] : []
|
|
|
- this.fileListShow = this._.cloneDeep(fs)
|
|
|
- this.$Message.success(this.$t('teachContent.props2'))
|
|
|
-
|
|
|
- if (this.activeType == 'recent') {
|
|
|
- this.selections.forEach(item => {
|
|
|
- let type = item.type
|
|
|
- if (this.fileList[type]) {
|
|
|
- for (let i = 0; i < this.fileList[type].length; i++) {
|
|
|
- if (item.id == this.fileList[type][i].id) {
|
|
|
- this.fileList[type].splice(i, 1)
|
|
|
- }
|
|
|
+ }
|
|
|
+ this.fileListShow = this._.cloneDeep(this.fileList[this.activeType])
|
|
|
+ this.$Message.success(this.$t('teachContent.props2'))
|
|
|
+ //如果是从最近删除,需要更新其他类型列表
|
|
|
+ if (this.activeType == 'recent') {
|
|
|
+ this.selections.forEach(item => {
|
|
|
+ let type = item.type
|
|
|
+ if (this.fileList[type]) {
|
|
|
+ for (let i = 0; i < this.fileList[type].length; i++) {
|
|
|
+ if (item.id == this.fileList[type][i].id) {
|
|
|
+ this.fileList[type].splice(i, 1)
|
|
|
+ break
|
|
|
}
|
|
|
}
|
|
|
- })
|
|
|
- }
|
|
|
- //删除本地最近上传数据
|
|
|
- this.delCacheFiles(ids)
|
|
|
- },
|
|
|
- err => {
|
|
|
- this.$Message.success(this.$t('teachContent.props3'))
|
|
|
+ }
|
|
|
+ })
|
|
|
}
|
|
|
- )
|
|
|
- }
|
|
|
+ },
|
|
|
+ err => {
|
|
|
+ this.$Message.error(this.$t('teachContent.props3'))
|
|
|
+ }
|
|
|
+ )
|
|
|
+ // if (this.activeType == 'res') {
|
|
|
+ // //批量删除HTEX需要循环删除每个文件夹下面的文件
|
|
|
+ // this.selections.forEach((item, index) => {
|
|
|
+ // this.$api.blob.deletePrefix({
|
|
|
+ // cntr: this.routerScope == 'school' ? this.$store.state.userInfo.schoolCode : this.$store.state.userInfo.TEAMModelId,
|
|
|
+ // prefix: `res/${item.name.replace('.HTEX', '')}`,
|
|
|
+ // scope: this.routerScope
|
|
|
+ // }).then(
|
|
|
+ // res => {
|
|
|
+ // let fileNames = this.selections.map((item) => { return item.name })
|
|
|
+ // for (let i = 0; i < this.fileList[this.activeType].length; i++) {
|
|
|
+ // let index = fileNames.indexOf(this.fileList[this.activeType][i].name)
|
|
|
+ // if (index > -1) {
|
|
|
+ // this.sizeInfo[this.activeType] -= this.fileList[this.activeType][i].size
|
|
|
+ // this.sizeInfo.total -= this.fileList[this.activeType][i].size
|
|
|
+ // this.fileList[this.activeType].splice(i, 1)
|
|
|
+ // i--
|
|
|
+ // }
|
|
|
+ // }
|
|
|
+ // let fs = this.fileList[this.activeType] ? this.fileList[this.activeType] : []
|
|
|
+ // this.fileListShow = this._.cloneDeep(fs)
|
|
|
+ // this.$Message.success(this.$t('teachContent.props2'))
|
|
|
+ // },
|
|
|
+ // err => {
|
|
|
+ // this.$Message.error(this.$t('teachContent.props3'))
|
|
|
+ // }
|
|
|
+ // ).finally(() => {
|
|
|
+ // this.isLoading = false
|
|
|
+ // })
|
|
|
+ // })
|
|
|
+ // //删除本地最近上传数据
|
|
|
+ // let ids = this.selections.map(item => {
|
|
|
+ // return item.id
|
|
|
+ // })
|
|
|
+ // this.delCacheFiles(ids)
|
|
|
+ // } else {
|
|
|
+ // let blobs = this.selections.map((item) => {
|
|
|
+ // return item.url.substring(0, item.url.lastIndexOf('?'))
|
|
|
+ // })
|
|
|
+ // let ids = this.selections.map((item) => {
|
|
|
+ // return item.id
|
|
|
+ // })
|
|
|
+ // this.$api.blob.deleteBlobs({
|
|
|
+ // cntr: this.routerScope == 'school' ? this.$store.state.userInfo.schoolCode : this.$store.state.userInfo.TEAMModelId,
|
|
|
+ // urls: blobs,
|
|
|
+ // scope: this.routerScope,
|
|
|
+ // ids
|
|
|
+ // }).then(
|
|
|
+ // res => {
|
|
|
+ // let thums = this.selections.map((item) => {
|
|
|
+ // if (item.type == 'image') {
|
|
|
+ // return item.url.substring(0, item.url.lastIndexOf('?')).replace('/image/', '/thum/')
|
|
|
+ // } else if (item.extension == 'MP4') {
|
|
|
+ // let n = item.url.substring(0, item.url.lastIndexOf('?')).replace('/video/', '/thum/')
|
|
|
+ // return n.slice(0, n.lastIndexOf('.')) + '.png'
|
|
|
+ // }
|
|
|
+
|
|
|
+ // })
|
|
|
+ // if (thums.length) {
|
|
|
+ // this.$api.blob.deleteBlobs({
|
|
|
+ // cntr: this.routerScope == 'school' ? this.$store.state.userInfo.schoolCode : this.$store.state.userInfo.TEAMModelId,
|
|
|
+ // urls: thums,
|
|
|
+ // scope: this.routerScope,
|
|
|
+ // ids: []
|
|
|
+ // })
|
|
|
+ // }
|
|
|
+
|
|
|
+ // let files = this.selections.map((item) => { return item.blob })
|
|
|
+ // for (let i = 0; i < this.fileList[this.activeType].length; i++) {
|
|
|
+ // let index = files.indexOf(this.fileList[this.activeType][i].blob)
|
|
|
+ // if (index != -1) {
|
|
|
+ // this.sizeInfo[this.activeType] -= this.fileList[this.activeType][i].size
|
|
|
+ // this.sizeInfo.total -= this.fileList[this.activeType][i].size
|
|
|
+ // this.fileList[this.activeType].splice(i, 1)
|
|
|
+ // i--
|
|
|
+ // }
|
|
|
+ // }
|
|
|
+ // let fs = this.fileList[this.activeType] ? this.fileList[this.activeType] : []
|
|
|
+ // this.fileListShow = this._.cloneDeep(fs)
|
|
|
+ // this.$Message.success(this.$t('teachContent.props2'))
|
|
|
+
|
|
|
+ // if (this.activeType == 'recent') {
|
|
|
+ // this.selections.forEach(item => {
|
|
|
+ // let type = item.type
|
|
|
+ // if (this.fileList[type]) {
|
|
|
+ // for (let i = 0; i < this.fileList[type].length; i++) {
|
|
|
+ // if (item.id == this.fileList[type][i].id) {
|
|
|
+ // this.fileList[type].splice(i, 1)
|
|
|
+ // }
|
|
|
+ // }
|
|
|
+ // }
|
|
|
+ // })
|
|
|
+ // }
|
|
|
+ // //删除本地最近上传数据
|
|
|
+ // this.delCacheFiles(ids)
|
|
|
+ // },
|
|
|
+ // err => {
|
|
|
+ // this.$Message.success(this.$t('teachContent.props3'))
|
|
|
+ // }
|
|
|
+ // )
|
|
|
+ // }
|
|
|
}
|
|
|
})
|
|
|
},
|
|
@@ -1251,6 +1349,10 @@ export default {
|
|
|
|
|
|
},
|
|
|
computed: {
|
|
|
+ ...mapGetters({
|
|
|
+ SCHOOL_SPACE: 'SCHOOL_SPACE',
|
|
|
+ PRIVATE_SPACE: 'PRIVATE_SPACE'
|
|
|
+ }),
|
|
|
filterPeriodName() {
|
|
|
if (this.schoolBase && this.schoolBase.period) {
|
|
|
let data = this.schoolBase.period
|
|
@@ -1266,8 +1368,16 @@ export default {
|
|
|
} else {
|
|
|
return ''
|
|
|
}
|
|
|
-
|
|
|
},
|
|
|
+ storageSpace() {
|
|
|
+ if (this.routerScope == 'school') {
|
|
|
+ console.log('空间', this.SCHOOL_SPACE, this.teachSpace)
|
|
|
+ return (this.SCHOOL_SPACE - this.teachSpace) * 1024 * 1024 * 1024
|
|
|
+ } else {
|
|
|
+ console.log('空间', this.PRIVATE_SPACE)
|
|
|
+ return this.PRIVATE_SPACE * 1024 * 1024 * 1024
|
|
|
+ }
|
|
|
+ }
|
|
|
},
|
|
|
mounted() {
|
|
|
let box = document.getElementById('card-box')
|
|
@@ -1311,11 +1421,10 @@ export default {
|
|
|
this.initData()
|
|
|
if (this.$route.name == 'schoolcontent') {
|
|
|
this.routerScope = 'school'
|
|
|
- this.storageSpace = this.$GLOBAL.SCHOOL_SPACE
|
|
|
} else {
|
|
|
this.routerScope = 'private'
|
|
|
- this.storageSpace = this.$GLOBAL.PRIVATE_SPACE
|
|
|
}
|
|
|
+
|
|
|
this.getSasStr()
|
|
|
},
|
|
|
immediate: true
|