|
@@ -40,6 +40,24 @@
|
|
|
:ids="id"
|
|
:ids="id"
|
|
|
v-if="isAccess === 2"
|
|
v-if="isAccess === 2"
|
|
|
/>
|
|
/>
|
|
|
|
|
+ <el-button
|
|
|
|
|
+ class="ml-20"
|
|
|
|
|
+ type="primary"
|
|
|
|
|
+ @click="moreDetail"
|
|
|
|
|
+ v-if="liButton"
|
|
|
|
|
+ >文件历史
|
|
|
|
|
+ </el-button>
|
|
|
|
|
+ <el-drawer v-model="liShow" :size="600">
|
|
|
|
|
+ <div
|
|
|
|
|
+ class="flex ml-10"
|
|
|
|
|
+ v-for="item in fileHistoryList"
|
|
|
|
|
+ @click="newDetail(item)"
|
|
|
|
|
+ >
|
|
|
|
|
+ <div class="mt-10">{{ item.coverUser }}</div>
|
|
|
|
|
+ <div class="ml-20 mt-10">在{{ item.createTime }}上传,</div>
|
|
|
|
|
+ <div class="ml-20 mt-10">编码{{ item.fileVO.md5 }}</div>
|
|
|
|
|
+ </div>
|
|
|
|
|
+ </el-drawer>
|
|
|
</div>
|
|
</div>
|
|
|
</div>
|
|
</div>
|
|
|
</el-drawer>
|
|
</el-drawer>
|
|
@@ -78,11 +96,25 @@ export default {
|
|
|
default: null
|
|
default: null
|
|
|
}
|
|
}
|
|
|
},
|
|
},
|
|
|
|
|
+ watch: {
|
|
|
|
|
+ id: {
|
|
|
|
|
+ handler(val) {
|
|
|
|
|
+ if (val != null) {
|
|
|
|
|
+ this.fileId = val
|
|
|
|
|
+ }
|
|
|
|
|
+ },
|
|
|
|
|
+ immediate: true
|
|
|
|
|
+ }
|
|
|
|
|
+ },
|
|
|
data() {
|
|
data() {
|
|
|
return {
|
|
return {
|
|
|
|
|
+ fileId: '',
|
|
|
|
|
+ liButton: false,
|
|
|
|
|
+ liShow: false,
|
|
|
show: false,
|
|
show: false,
|
|
|
data: null,
|
|
data: null,
|
|
|
preList: [],
|
|
preList: [],
|
|
|
|
|
+ fileHistoryList: [1, 2, 3],
|
|
|
showImage: false,
|
|
showImage: false,
|
|
|
watermarkOptions: {
|
|
watermarkOptions: {
|
|
|
content: 'watermark',
|
|
content: 'watermark',
|
|
@@ -94,18 +126,34 @@ export default {
|
|
|
}
|
|
}
|
|
|
},
|
|
},
|
|
|
methods: {
|
|
methods: {
|
|
|
|
|
+ newDetail(item) {
|
|
|
|
|
+ this.fileId = item.fileVO.id
|
|
|
|
|
+ this.detail()
|
|
|
|
|
+ },
|
|
|
detail() {
|
|
detail() {
|
|
|
- if (Number(this.id, 10).toString() === 'NaN') {
|
|
|
|
|
|
|
+ //先判断是否存在历史列表
|
|
|
|
|
+ this.$api.project
|
|
|
|
|
+ .fileHistory({ fileId: this.fileId, current: 1, size: 100 })
|
|
|
|
|
+ .then(res => {
|
|
|
|
|
+ if (res.code === 200) {
|
|
|
|
|
+ console.log(res)
|
|
|
|
|
+ if (res.data.total > 0) {
|
|
|
|
|
+ this.liButton = true
|
|
|
|
|
+ this.fileHistoryList = res.data.records
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+ })
|
|
|
|
|
+ if (Number(this.fileId, 10).toString() === 'NaN') {
|
|
|
console.log('yyyy')
|
|
console.log('yyyy')
|
|
|
// 如果id 不是数字开头,即mongo 62开头的id,查看文章详情
|
|
// 如果id 不是数字开头,即mongo 62开头的id,查看文章详情
|
|
|
- this.$api.resource.fileDetail(this.id).then(res => {
|
|
|
|
|
|
|
+ this.$api.resource.fileDetail(this.fileId).then(res => {
|
|
|
if (res.code === 200) {
|
|
if (res.code === 200) {
|
|
|
this.data = res.data
|
|
this.data = res.data
|
|
|
this.show = true
|
|
this.show = true
|
|
|
}
|
|
}
|
|
|
})
|
|
})
|
|
|
} else {
|
|
} else {
|
|
|
- this.$api.resource.fileInfo({ id: this.id }).then(res => {
|
|
|
|
|
|
|
+ this.$api.resource.fileInfo({ id: this.fileId }).then(res => {
|
|
|
if (res.code === 200) {
|
|
if (res.code === 200) {
|
|
|
const tmp = res.data
|
|
const tmp = res.data
|
|
|
if (api.offices.includes(tmp.suffix)) {
|
|
if (api.offices.includes(tmp.suffix)) {
|
|
@@ -119,14 +167,19 @@ export default {
|
|
|
})
|
|
})
|
|
|
}
|
|
}
|
|
|
},
|
|
},
|
|
|
|
|
+ moreDetail() {
|
|
|
|
|
+ //显示侧边
|
|
|
|
|
+ this.liShow = true
|
|
|
|
|
+ },
|
|
|
openByFile() {
|
|
openByFile() {
|
|
|
- this.$api.resource.fileDetailByFile(this.id).then(res => {
|
|
|
|
|
|
|
+ this.$api.resource.fileDetailByFile(this.fileId).then(res => {
|
|
|
if (res.code === 200) {
|
|
if (res.code === 200) {
|
|
|
this.data = res.data
|
|
this.data = res.data
|
|
|
this.show = true
|
|
this.show = true
|
|
|
}
|
|
}
|
|
|
})
|
|
})
|
|
|
},
|
|
},
|
|
|
|
|
+ moreClick() {},
|
|
|
async downloadClick() {
|
|
async downloadClick() {
|
|
|
const link = document.createElement('a')
|
|
const link = document.createElement('a')
|
|
|
link.href = this.data.url
|
|
link.href = this.data.url
|