|
|
@@ -83,7 +83,7 @@
|
|
|
>
|
|
|
</el-pagination>
|
|
|
<el-dialog :title="title" :visible.sync="addDialogVisible">
|
|
|
- <el-form ref="form" :model="form" :rules="rules" label-width="80px">
|
|
|
+ <el-form ref="form" :model="form" :rules="rules" label-width="100px">
|
|
|
<el-form-item label="公告名称" prop="announcementName">
|
|
|
<el-input v-model="form.announcementName"></el-input>
|
|
|
</el-form-item>
|
|
|
@@ -96,7 +96,6 @@
|
|
|
action="/api/announcement/uploadImage"
|
|
|
list-type="picture-card"
|
|
|
accept=".jpg,.jpeg,.png"
|
|
|
- :auto-upload="false"
|
|
|
:file-list="fileList"
|
|
|
:class="objClass"
|
|
|
:limit="1"
|
|
|
@@ -255,7 +254,11 @@ export default {
|
|
|
this.form = JSON.parse(JSON.stringify(row))
|
|
|
this.objClass.upLoadHide = true
|
|
|
this.objClass.upLoadShow = false
|
|
|
- this.fileList = [{url:row.images}]
|
|
|
+ console.info(row)
|
|
|
+ if(row.images!=null){
|
|
|
+ const fileName = row.images.substring(row.images.lastIndexOf('/') + 1);
|
|
|
+ this.fileList = [{name:fileName,url:row.images}]
|
|
|
+ }
|
|
|
const obj = this.statusOptions.find((item) => item.label == row.announcementStatus)
|
|
|
this.form.announcementStatus = obj ? obj.value : 2
|
|
|
this.title = '编辑公告'
|
|
|
@@ -292,10 +295,10 @@ export default {
|
|
|
this.total = res.data.total
|
|
|
})
|
|
|
},
|
|
|
- handleAvatarSuccess(res, file) {
|
|
|
- this.form.images = res.data.url
|
|
|
- this.imageUrl = res.url
|
|
|
- this.fileList = [file]
|
|
|
+ handleAvatarSuccess(res, file,fileList) {
|
|
|
+ this.form.images = res.fileUrl
|
|
|
+ this.imageUrl = res.fileUrl
|
|
|
+ this.fileList = fileList
|
|
|
},
|
|
|
beforeUpload(file) {
|
|
|
const isImage = ['image/jpeg', 'image/png', 'image/jpg'].includes(file.type)
|
|
|
@@ -319,6 +322,10 @@ export default {
|
|
|
images: '',
|
|
|
announcementStatus: 2,
|
|
|
announcementContent: ''
|
|
|
+ }
|
|
|
+ this.objClass= {
|
|
|
+ upLoadShow: true,
|
|
|
+ upLoadHide: false
|
|
|
}
|
|
|
this.addDialogVisible = true
|
|
|
},
|
|
|
@@ -408,6 +415,8 @@ export default {
|
|
|
handleRemove(file, fileList) {
|
|
|
this.objClass.upLoadHide = false
|
|
|
this.objClass.upLoadShow = true
|
|
|
+ this.fileList = []
|
|
|
+ this.form.images = ''
|
|
|
},
|
|
|
handlePictureCardPreview(file) {
|
|
|
this.imageUrl = file.url
|