Browse Source

图片上传删除,首页按钮,发布地点

feature
是小王呀\24601 2 years ago
parent
commit
23410184b3
  1. 16
      src/views/modules/communityParty/comPromotion/add.vue
  2. 4
      src/views/modules/communityParty/comPromotion/index.vue
  3. 10
      src/views/modules/plugins/rent/upload-image.vue

16
src/views/modules/communityParty/comPromotion/add.vue

@ -25,7 +25,7 @@
<el-form-item label="封面图片" label-width="140px" prop="coverPic">
<template>
<upload-image :defaultFileList="fileList" :limit="1" @change="onChangeFileList"></upload-image>
<upload-image :defaultFileList="fileList" :limit="1" @file-removed="handleFileRemoved" @change="onChangeFileList"></upload-image>
</template>
</el-form-item>
@ -90,6 +90,7 @@ export default {
sendMsg: 0,//
top: 0,//
status: 0 //
}
return _form
@ -121,6 +122,7 @@ export default {
serviceList: [],
// gridList: [],
agencyId: '',
agencyName:"",
demandOptions: [],
uploadUrl: window.SITE_CONFIG['apiURL'] + '/oss/file/uploadqrcodeV2',
@ -130,11 +132,19 @@ export default {
},
components: { Tinymce, UploadImage },
mounted() {
this.agencyName=this.$store.state.user.agencyName,
this.agencyId=this.$store.state.user.agencyId,
this.advertisingTag()
},
methods: {
handleFileRemoved(file) {
//
console.log('File removed:', file);
this.formData.coverPic=""
//
},
// 广
advertisingTag(){
@ -251,11 +261,14 @@ export default {
}, 10000)
this.$refs['ref_form'].validate((valid, messageObj) => {
this.formData.agencyName= this.agencyName
this.formData.agencyId= this.agencyId
console.log("this.formData看看里面村的什么",this.formData)
if (!valid) {
app.util.validateRule(messageObj)
this.btnDisable = false
} else {
this.addActivity()
}
})
@ -264,6 +277,7 @@ export default {
if (this.formType === 'edit') {
let url = '/actual/base/communityPublicity/update'
this.formData.sendMsg= this.formData.sendMsg? 1:0
const { data, code, msg } = await requestPost(url, this.formData)
if (code === 0) {
this.$message({

4
src/views/modules/communityParty/comPromotion/index.vue

@ -53,13 +53,13 @@
<span>{{ scope.row.status === 1 ? '已下线' : '已发布' }}</span>
</template>
</el-table-column>
<el-table-column prop="createdTime" header-align="center" align="center" label="发布单位" width="200">
<el-table-column prop="agencyName" header-align="center" align="center" label="发布单位" width="200">
</el-table-column>
<el-table-column prop="releaseTime" header-align="center" align="center" label="发布时间" width="200">
</el-table-column>
<el-table-column prop="top" header-align="center" align="center" label="置顶" width="100">
<template slot-scope="scope">
<span>{{ scope.row.top === 1 ? '是' : '否' }}</span>
<span>{{ scope.row.top === 0 ? '是' : '否' }}</span>
</template>
</el-table-column>
<el-table-column prop="topp" header-align="center" align="center" label="点赞数" width="100">

10
src/views/modules/plugins/rent/upload-image.vue

@ -15,7 +15,7 @@
<div slot="file" slot-scope="{file}">
<img class="el-upload-list__item-thumbnail" :src="file.url" alt="">
<span class="el-upload-list__item-actions">
<span class="el-upload-list__item-preview" @click="handlePictureCardPreview(file)">
<span class="el-upload-list__item-preview"@file-removed="handleFileRemoved" @click="handlePictureCardPreview(file)">
<i class="el-icon-zoom-in"></i>
</span>
<span v-if="!disabled" class="el-upload-list__item-delete" @click="handleRemove(file)">
@ -73,6 +73,11 @@ export default {
console.log('xxxxxx', this.rowIndex)
},
methods: {
handleFileRemoved(file) {
//
console.log('File removed:', file);
//
},
handleRemove(file) {
const delFile = file.url
this.fileList.forEach((item, key) => {
@ -80,7 +85,10 @@ export default {
this.fileList.splice(key, 1)
}
})
this.$emit('file-removed', file);
console.log(this.fileList);
},
handlePictureCardPreview(file) {
this.dialogImageUrl = file.url
this.dialogVisible = true

Loading…
Cancel
Save