Browse Source

上传图片加loding

master
qushutong 7 years ago
parent
commit
e12cc25bbc
  1. 6
      src/views/modules/news/banner-add-or-update.vue
  2. 4
      src/views/modules/news/news-publish.vue

6
src/views/modules/news/banner-add-or-update.vue

@ -74,6 +74,7 @@
</el-select>
</el-form-item>
<el-form-item label="banner图片"
v-loading="loading"
prop="imgUrl">
<el-upload class="avatar-uploader"
:action="this.uploadUrl"
@ -122,7 +123,8 @@ export default {
communityList: [],
gridList: [],
uploadUrl: '',
positionList: []
positionList: [],
loading: false
}
},
computed: {
@ -214,8 +216,10 @@ export default {
//
handleAvatarSuccess (res, file) {
this.dataForm.imgUrl = res.data.url
this.loading = false
},
beforeAvatarUpload (file) {
this.loading = true
},
getListFromDict (dictType) {
this.$http.get(`/sys/dict/listSimple/` + dictType).then(({ data: res }) => {

4
src/views/modules/news/news-publish.vue

@ -89,6 +89,7 @@
</el-row>
<el-row>
<el-form-item prop="newsImageUrl"
v-loading="loading"
label="新闻首图">
<el-upload class="avatar-uploader"
:action="uploadUrl"
@ -160,6 +161,7 @@ export default {
communityList: [],
gridList: [],
categorys: [],
loading: false,
//
quillEditor: null,
quillEditorToolbarOptions: [
@ -375,6 +377,7 @@ export default {
})
}, 1000, { 'leading': true, 'trailing': false }),
handleAvatarSuccess (res, file) {
this.loading = false
this.dataForm.newsImageUrl = res.data.url
},
beforeAvatarUpload (file) {
@ -387,6 +390,7 @@ export default {
if (!isLt2M) {
this.$message.error('上传图片大小不能超过 500KB!')
}
this.loading = true
return isJPG && isLt2M
}
},

Loading…
Cancel
Save