Prefect attachment drawer and detail drawer

pull/3445/head
johnniang 2019-04-20 00:46:00 +08:00
parent 828c8ad624
commit f0dc466760
2 changed files with 50 additions and 16 deletions

View File

@ -143,11 +143,24 @@ export default {
} }
}, },
created() { created() {
setTimeout(() => { this.loadSkeleton()
this.detailLoading = false },
}, 300) watch: {
visiable: function(newValue, oldValue) {
this.$log.debug('old value', oldValue)
this.$log.debug('new value', newValue)
if (newValue) {
this.loadSkeleton()
}
}
}, },
methods: { methods: {
loadSkeleton() {
this.detailLoading = true
setTimeout(() => {
this.detailLoading = false
}, 500)
},
deleteAttachment() { deleteAttachment() {
attachmentApi.delete(this.attachment.id).then(response => { attachmentApi.delete(this.attachment.id).then(response => {
this.$message.success('删除成功!') this.$message.success('删除成功!')

View File

@ -17,10 +17,15 @@
enterButton enterButton
/> />
</a-row> </a-row>
<a-divider></a-divider> <a-divider />
<a-row <a-row
type="flex" type="flex"
align="middle" align="middle"
>
<a-skeleton
active
:loading="skeletonLoading"
:paragraph="{ rows: 8 }"
> >
<a-col :span="24"> <a-col :span="24">
<div <div
@ -32,8 +37,9 @@
<img :src="item.thumbPath"> <img :src="item.thumbPath">
</div> </div>
</a-col> </a-col>
</a-skeleton>
</a-row> </a-row>
<a-divider></a-divider> <a-divider />
<a-row <a-row
type="flex" type="flex"
justify="end" justify="end"
@ -108,9 +114,10 @@ export default {
detailVisiable: false, detailVisiable: false,
attachmentDrawerVisible: false, attachmentDrawerVisible: false,
uploadVisible: false, uploadVisible: false,
skeletonLoading: true,
pagination: { pagination: {
page: 1, page: 1,
size: 8, size: 14,
sort: '' sort: ''
}, },
attachments: [], attachments: [],
@ -119,9 +126,23 @@ export default {
} }
}, },
created() { created() {
this.loadSkeleton()
this.loadAttachments() this.loadAttachments()
}, },
watch: {
visiable: function(newValue, oldValue) {
if (newValue) {
this.loadSkeleton()
}
}
},
methods: { methods: {
loadSkeleton() {
this.skeletonLoading = true
setTimeout(() => {
this.skeletonLoading = false
}, 500)
},
showUploadModal() { showUploadModal() {
this.uploadVisible = true this.uploadVisible = true
}, },