mirror of https://github.com/halo-dev/halo-admin
Complete select attachment component.
parent
125faa2a43
commit
e03fc86b44
|
@ -15,7 +15,7 @@
|
|||
<a-row type="flex" align="middle">
|
||||
<a-skeleton active :loading="skeletonLoading" :paragraph="{ rows: 8 }">
|
||||
<a-col :span="24">
|
||||
<div class="attach-item" v-for="(item, index) in attachments" :key="index">
|
||||
<div class="attach-item" v-for="(item, index) in attachments" :key="index" @click="selectAttachment(item)">
|
||||
<img :src="item.thumbPath">
|
||||
</div>
|
||||
</a-col>
|
||||
|
@ -72,8 +72,6 @@ export default {
|
|||
},
|
||||
data() {
|
||||
return {
|
||||
detailVisiable: false,
|
||||
attachmentDrawerVisible: false,
|
||||
uploadVisible: false,
|
||||
skeletonLoading: true,
|
||||
pagination: {
|
||||
|
@ -82,7 +80,6 @@ export default {
|
|||
sort: ''
|
||||
},
|
||||
attachments: [],
|
||||
selectedAttachment: {},
|
||||
attachmentUploadHandler: attachmentApi.upload
|
||||
}
|
||||
},
|
||||
|
@ -115,6 +112,9 @@ export default {
|
|||
this.pagination.total = response.data.data.total
|
||||
})
|
||||
},
|
||||
selectAttachment(item) {
|
||||
this.$emit('listenToSelect', item)
|
||||
},
|
||||
handlePaginationChange(page, pageSize) {
|
||||
this.pagination.page = page
|
||||
this.pagination.size = pageSize
|
||||
|
|
|
@ -97,7 +97,7 @@
|
|||
</a-col>
|
||||
</a-row>
|
||||
|
||||
<AttachmentSelectDrawer v-model="attachmentDrawerVisible"/>
|
||||
<AttachmentSelectDrawer v-model="attachmentDrawerVisible" @listenToSelect="selectAvatar"/>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
|
@ -120,7 +120,8 @@ export default {
|
|||
oldPassword: null,
|
||||
newPassword: null,
|
||||
confirmPassword: null
|
||||
}
|
||||
},
|
||||
attachment: {}
|
||||
}
|
||||
},
|
||||
computed: {
|
||||
|
@ -162,6 +163,9 @@ export default {
|
|||
this.user = response.data.data
|
||||
this.$message.success('资料更新成功!')
|
||||
})
|
||||
},
|
||||
selectAvatar(data) {
|
||||
this.user.avatar = data.path
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue