|
@@ -19,9 +19,9 @@
|
|
|
<img v-else class="icon" src="../../../assets/svg/folder/other.svg">
|
|
<img v-else class="icon" src="../../../assets/svg/folder/other.svg">
|
|
|
</div>
|
|
</div>
|
|
|
<div v-else class="flex-1">
|
|
<div v-else class="flex-1">
|
|
|
- <img v-if="item.IsAccess === '1'" src="../../../assets/svg/folder/see.svg" style="width: 50px;height: 46px">
|
|
|
|
|
- <img v-if="item.IsAccess === '2'" src="../../../assets/svg/folder/edit.svg" style="width: 50px;height: 46px">
|
|
|
|
|
- <img v-if="item.IsAccess === '3'" src="../../../assets/svg/folder/invisible.svg"
|
|
|
|
|
|
|
+ <img v-if="item.isAccess === '1'" src="../../../assets/svg/folder/see.svg" style="width: 50px;height: 46px">
|
|
|
|
|
+ <img v-if="item.isAccess === '2'" src="../../../assets/svg/folder/edit.svg" style="width: 50px;height: 46px">
|
|
|
|
|
+ <img v-if="item.isAccess === '3'" src="../../../assets/svg/folder/invisible.svg"
|
|
|
style="width: 50px;height: 46px">
|
|
style="width: 50px;height: 46px">
|
|
|
</div>
|
|
</div>
|
|
|
<span style="flex: 2;text-align: left">{{ item.title }}</span>
|
|
<span style="flex: 2;text-align: left">{{ item.title }}</span>
|
|
@@ -35,9 +35,9 @@
|
|
|
<div class="flex flex-center" style="flex: 3">
|
|
<div class="flex flex-center" style="flex: 3">
|
|
|
<main-button icon="View" title="详情" width="85" @click="View(item)"/>
|
|
<main-button icon="View" title="详情" width="85" @click="View(item)"/>
|
|
|
<main-button v-if="item.type === '1'" icon="Download" title="下载" width="85" @click="downFile(item)"/>
|
|
<main-button v-if="item.type === '1'" icon="Download" title="下载" width="85" @click="downFile(item)"/>
|
|
|
- <main-button v-else-if="item.type === '2' && item.IsAccess === '2'" icon="Upload" title="上传文件" width="85"
|
|
|
|
|
|
|
+ <main-button v-else-if="item.type === '2' && item.isAccess === '2'" icon="Upload" title="上传文件" width="85"
|
|
|
@click="upload(item)"/>
|
|
@click="upload(item)"/>
|
|
|
- <main-button v-else-if="item.type === '2' && item.IsAccess === '3'" icon="Position"
|
|
|
|
|
|
|
+ <main-button v-else-if="item.type === '2' && item.isAccess === '3'" icon="Position"
|
|
|
title="授权申请" width="85" @click="folderApply(item)"/>
|
|
title="授权申请" width="85" @click="folderApply(item)"/>
|
|
|
<main-button v-else='item.del' icon="Delete" title="删除" width="85" @click="removeFile(item)"/>
|
|
<main-button v-else='item.del' icon="Delete" title="删除" width="85" @click="removeFile(item)"/>
|
|
|
</div>
|
|
</div>
|
|
@@ -91,20 +91,20 @@
|
|
|
|
|
|
|
|
<script>
|
|
<script>
|
|
|
import mainButton from '../../../components/main-button.vue'
|
|
import mainButton from '../../../components/main-button.vue'
|
|
|
-import {bytesToSize} from '@/utils/tools.js'
|
|
|
|
|
-import {useStore} from '@/store/user.js'
|
|
|
|
|
|
|
+import { bytesToSize } from '@/utils/tools.js'
|
|
|
|
|
+import { useStore } from '@/store/user.js'
|
|
|
import permissionStore from '@/store/permission.js'
|
|
import permissionStore from '@/store/permission.js'
|
|
|
import uploadFile from '../../../components/upload-file.vue'
|
|
import uploadFile from '../../../components/upload-file.vue'
|
|
|
|
|
|
|
|
export default {
|
|
export default {
|
|
|
name: 'files_list',
|
|
name: 'files_list',
|
|
|
- components: {mainButton, uploadFile},
|
|
|
|
|
|
|
+ components: { mainButton, uploadFile },
|
|
|
props: {
|
|
props: {
|
|
|
data: Object
|
|
data: Object
|
|
|
},
|
|
},
|
|
|
watch: {
|
|
watch: {
|
|
|
data: {
|
|
data: {
|
|
|
- handler(val) {
|
|
|
|
|
|
|
+ handler (val) {
|
|
|
if (val === '' || val === null) {
|
|
if (val === '' || val === null) {
|
|
|
return
|
|
return
|
|
|
}
|
|
}
|
|
@@ -131,12 +131,12 @@ export default {
|
|
|
immediate: true
|
|
immediate: true
|
|
|
}
|
|
}
|
|
|
},
|
|
},
|
|
|
- setup() {
|
|
|
|
|
|
|
+ setup () {
|
|
|
const user = useStore()
|
|
const user = useStore()
|
|
|
const permission = permissionStore()
|
|
const permission = permissionStore()
|
|
|
- return {user, permission}
|
|
|
|
|
|
|
+ return { user, permission }
|
|
|
},
|
|
},
|
|
|
- data() {
|
|
|
|
|
|
|
+ data () {
|
|
|
return {
|
|
return {
|
|
|
show: false,
|
|
show: false,
|
|
|
applyShow: false,
|
|
applyShow: false,
|
|
@@ -154,14 +154,14 @@ export default {
|
|
|
projectId: ''
|
|
projectId: ''
|
|
|
},
|
|
},
|
|
|
currentFolder: null,
|
|
currentFolder: null,
|
|
|
- applyTime: [],
|
|
|
|
|
|
|
+ applyTime: []
|
|
|
}
|
|
}
|
|
|
},
|
|
},
|
|
|
- created() {
|
|
|
|
|
|
|
+ created () {
|
|
|
this.query = this.$route.query
|
|
this.query = this.$route.query
|
|
|
},
|
|
},
|
|
|
methods: {
|
|
methods: {
|
|
|
- View(item) {
|
|
|
|
|
|
|
+ View (item) {
|
|
|
if (item.type === '1') {
|
|
if (item.type === '1') {
|
|
|
if (['png', 'jpg'].includes(item.suffix)) {
|
|
if (['png', 'jpg'].includes(item.suffix)) {
|
|
|
this.showImage = true
|
|
this.showImage = true
|
|
@@ -171,6 +171,7 @@ export default {
|
|
|
this.$router.push('/home/file_detail?id=' + item.fileId)
|
|
this.$router.push('/home/file_detail?id=' + item.fileId)
|
|
|
} else if (item.type === '2') {
|
|
} else if (item.type === '2') {
|
|
|
this.query.id = item.id
|
|
this.query.id = item.id
|
|
|
|
|
+ console.log(item)
|
|
|
this.$router.push({
|
|
this.$router.push({
|
|
|
path: '/home/files',
|
|
path: '/home/files',
|
|
|
query: {
|
|
query: {
|
|
@@ -178,18 +179,19 @@ export default {
|
|
|
projectId: this.query.projectId,
|
|
projectId: this.query.projectId,
|
|
|
projectStageId: this.query.projectStageId,
|
|
projectStageId: this.query.projectStageId,
|
|
|
dictKey: this.query.dictKey,
|
|
dictKey: this.query.dictKey,
|
|
|
- parentId: item.id
|
|
|
|
|
|
|
+ parentId: item.id,
|
|
|
|
|
+ isAccess: item.isAccess
|
|
|
}
|
|
}
|
|
|
})
|
|
})
|
|
|
}
|
|
}
|
|
|
},
|
|
},
|
|
|
- upload(item) {
|
|
|
|
|
|
|
+ upload (item) {
|
|
|
this.show = true
|
|
this.show = true
|
|
|
console.log(item)
|
|
console.log(item)
|
|
|
this.fileFolderId = item.id
|
|
this.fileFolderId = item.id
|
|
|
console.log(this.fileFolderId)
|
|
console.log(this.fileFolderId)
|
|
|
},
|
|
},
|
|
|
- success(res) {
|
|
|
|
|
|
|
+ success (res) {
|
|
|
console.log(this.fileFolderId)
|
|
console.log(this.fileFolderId)
|
|
|
this.fileList = res.fileList.map(res => {
|
|
this.fileList = res.fileList.map(res => {
|
|
|
const item = {}
|
|
const item = {}
|
|
@@ -197,8 +199,9 @@ export default {
|
|
|
item.suffix = res.response.data.suffix
|
|
item.suffix = res.response.data.suffix
|
|
|
item.volume = res.response.data.volume
|
|
item.volume = res.response.data.volume
|
|
|
item.fileId = res.response.data.id
|
|
item.fileId = res.response.data.id
|
|
|
|
|
+ item.url = res.response.data.filePath
|
|
|
item.fileFolderId = this.fileFolderId
|
|
item.fileFolderId = this.fileFolderId
|
|
|
- item.projectId = this.query.projectId
|
|
|
|
|
|
|
+ item.projectId = this.$route.query.projectId
|
|
|
return item
|
|
return item
|
|
|
})
|
|
})
|
|
|
this.fileList.forEach(sub => {
|
|
this.fileList.forEach(sub => {
|
|
@@ -212,8 +215,8 @@ export default {
|
|
|
}
|
|
}
|
|
|
})
|
|
})
|
|
|
},
|
|
},
|
|
|
- saveLibrary(sub) {
|
|
|
|
|
- const data = {category: 4, content: ''}
|
|
|
|
|
|
|
+ saveLibrary (sub) {
|
|
|
|
|
+ const data = { category: 4, content: '' }
|
|
|
this.$api.common.submit(Object.assign(sub, data)).then(res => {
|
|
this.$api.common.submit(Object.assign(sub, data)).then(res => {
|
|
|
if (res.code === 200) {
|
|
if (res.code === 200) {
|
|
|
this.saveCount++
|
|
this.saveCount++
|
|
@@ -223,7 +226,7 @@ export default {
|
|
|
}
|
|
}
|
|
|
})
|
|
})
|
|
|
},
|
|
},
|
|
|
- addFile() {
|
|
|
|
|
|
|
+ addFile () {
|
|
|
this.$api.project.fileAdd(this.fileList).then(res => {
|
|
this.$api.project.fileAdd(this.fileList).then(res => {
|
|
|
if (res.code === 200) {
|
|
if (res.code === 200) {
|
|
|
this.show = false
|
|
this.show = false
|
|
@@ -235,9 +238,9 @@ export default {
|
|
|
cancelButtonText: '取消',
|
|
cancelButtonText: '取消',
|
|
|
type: 'warning'
|
|
type: 'warning'
|
|
|
})
|
|
})
|
|
|
- .then(() => {
|
|
|
|
|
- this.SendMsg()
|
|
|
|
|
- })
|
|
|
|
|
|
|
+ .then(() => {
|
|
|
|
|
+ this.SendMsg()
|
|
|
|
|
+ })
|
|
|
}
|
|
}
|
|
|
} else {
|
|
} else {
|
|
|
this.show = false
|
|
this.show = false
|
|
@@ -245,9 +248,10 @@ export default {
|
|
|
}
|
|
}
|
|
|
})
|
|
})
|
|
|
},
|
|
},
|
|
|
- SendMsg() {
|
|
|
|
|
|
|
+ SendMsg () {
|
|
|
this.sendParams.ids = this.fileList.map(e => e.fileId).join(',')
|
|
this.sendParams.ids = this.fileList.map(e => e.fileId).join(',')
|
|
|
- this.sendParams.projectId = this.projectId
|
|
|
|
|
|
|
+ this.sendParams.projectId = this.$route.query.projectId
|
|
|
|
|
+ this.sendParams.ownerId = this.$route.query.ownerId
|
|
|
this.$api.project.send(this.sendParams).then(res => {
|
|
this.$api.project.send(this.sendParams).then(res => {
|
|
|
if (res.code === 200) {
|
|
if (res.code === 200) {
|
|
|
this.$message.success('消息已经发送成功!')
|
|
this.$message.success('消息已经发送成功!')
|
|
@@ -258,61 +262,61 @@ export default {
|
|
|
}
|
|
}
|
|
|
})
|
|
})
|
|
|
},
|
|
},
|
|
|
- downFile(item) {
|
|
|
|
|
|
|
+ downFile (item) {
|
|
|
window.open(item.url, '')
|
|
window.open(item.url, '')
|
|
|
},
|
|
},
|
|
|
- viewerClose() {
|
|
|
|
|
|
|
+ viewerClose () {
|
|
|
this.showImage = false
|
|
this.showImage = false
|
|
|
this.imgList = []
|
|
this.imgList = []
|
|
|
},
|
|
},
|
|
|
- removeFile(item) {
|
|
|
|
|
|
|
+ removeFile (item) {
|
|
|
if (item.type === '1') {
|
|
if (item.type === '1') {
|
|
|
this.$confirm('确认是否删除所选文件/文件夹?', {
|
|
this.$confirm('确认是否删除所选文件/文件夹?', {
|
|
|
confirmButtonText: '确定',
|
|
confirmButtonText: '确定',
|
|
|
cancelButtonText: '取消',
|
|
cancelButtonText: '取消',
|
|
|
type: 'warning'
|
|
type: 'warning'
|
|
|
})
|
|
})
|
|
|
- .then(() => {
|
|
|
|
|
- this.$api.project.fileRemove({ids: item.id}).then(res => {
|
|
|
|
|
- if (res.code === 200) {
|
|
|
|
|
- this.$bus.emit('delete')
|
|
|
|
|
- this.$message.success(res.msg)
|
|
|
|
|
- } else {
|
|
|
|
|
- this.$message.error(res.msg)
|
|
|
|
|
- }
|
|
|
|
|
- })
|
|
|
|
|
|
|
+ .then(() => {
|
|
|
|
|
+ this.$api.project.fileRemove({ ids: item.id }).then(res => {
|
|
|
|
|
+ if (res.code === 200) {
|
|
|
|
|
+ this.$bus.emit('delete')
|
|
|
|
|
+ this.$message.success(res.msg)
|
|
|
|
|
+ } else {
|
|
|
|
|
+ this.$message.error(res.msg)
|
|
|
|
|
+ }
|
|
|
})
|
|
})
|
|
|
|
|
+ })
|
|
|
} else if (item.type === '2') {
|
|
} else if (item.type === '2') {
|
|
|
this.$confirm('确认是否删除所选文件/文件夹?', {
|
|
this.$confirm('确认是否删除所选文件/文件夹?', {
|
|
|
confirmButtonText: '确定',
|
|
confirmButtonText: '确定',
|
|
|
cancelButtonText: '取消',
|
|
cancelButtonText: '取消',
|
|
|
type: 'warning'
|
|
type: 'warning'
|
|
|
})
|
|
})
|
|
|
- .then(() => {
|
|
|
|
|
- this.$api.project.folderRemove({ids: item.id}).then(res => {
|
|
|
|
|
- if (res.code === 200) {
|
|
|
|
|
- this.$message.success(res.msg)
|
|
|
|
|
- this.$bus.emit('delete')
|
|
|
|
|
- } else {
|
|
|
|
|
- this.$message.error(res.msg)
|
|
|
|
|
- }
|
|
|
|
|
- })
|
|
|
|
|
|
|
+ .then(() => {
|
|
|
|
|
+ this.$api.project.folderRemove({ ids: item.id }).then(res => {
|
|
|
|
|
+ if (res.code === 200) {
|
|
|
|
|
+ this.$message.success(res.msg)
|
|
|
|
|
+ this.$bus.emit('delete')
|
|
|
|
|
+ } else {
|
|
|
|
|
+ this.$message.error(res.msg)
|
|
|
|
|
+ }
|
|
|
})
|
|
})
|
|
|
|
|
+ })
|
|
|
}
|
|
}
|
|
|
},
|
|
},
|
|
|
- folderApply(item) {
|
|
|
|
|
|
|
+ folderApply (item) {
|
|
|
this.currentFolder = item
|
|
this.currentFolder = item
|
|
|
this.applyShow = true
|
|
this.applyShow = true
|
|
|
},
|
|
},
|
|
|
- submit() {
|
|
|
|
|
|
|
+ submit () {
|
|
|
if (this.applyTime.length !== 2) {
|
|
if (this.applyTime.length !== 2) {
|
|
|
this.$message.error('请选择授权时间')
|
|
this.$message.error('请选择授权时间')
|
|
|
return
|
|
return
|
|
|
}
|
|
}
|
|
|
- const tmp = {projectId: this.projectId, ownerId: this.ownerId}
|
|
|
|
|
- const item = {startTime: this.applyTime[0], endTime: this.applyTime[1], folderId: this.currentFolder.fileFolderId}
|
|
|
|
|
|
|
+ const tmp = { projectId: this.projectId, ownerId: this.ownerId }
|
|
|
|
|
+ const item = { startTime: this.applyTime[0], endTime: this.applyTime[1], folderId: this.currentFolder.fileFolderId }
|
|
|
const list = [item]
|
|
const list = [item]
|
|
|
- this.$api.project.apply(Object.assign(tmp, {folders: list})).then(res => {
|
|
|
|
|
|
|
+ this.$api.project.apply(Object.assign(tmp, { folders: list })).then(res => {
|
|
|
if (res.code === 200) {
|
|
if (res.code === 200) {
|
|
|
this.applyShow = false
|
|
this.applyShow = false
|
|
|
this.$confirm(res.data, {
|
|
this.$confirm(res.data, {
|
|
@@ -324,7 +328,7 @@ export default {
|
|
|
this.$message.error(res.msg)
|
|
this.$message.error(res.msg)
|
|
|
}
|
|
}
|
|
|
})
|
|
})
|
|
|
- },
|
|
|
|
|
|
|
+ }
|
|
|
|
|
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|