| | |
| | | <el-form-item> |
| | | <el-upload name="multipartFile" class="upload-demo" action="/api/publicity/upload " :show-file-list="false" |
| | | :before-upload="beforeAvatarUpload" :on-success="respond" :limit="1"> |
| | | <el-button type="primary">导入</el-button> |
| | | <!-- <el-button type="primary">导入</el-button>--> |
| | | </el-upload> |
| | | </el-form-item> |
| | | </el-form> |
| | |
| | | <span v-else>发布</span> |
| | | </el-button> |
| | | <el-button type="text" size="medium" @click="remove(scope.row.id)" style="color:#ff0000">删除 |
| | | </el-button> |
| | | <el-button type="text" size="medium" @click="delTime(scope.row.id)" style="color:#ff0000">修改时间 |
| | | </el-button> |
| | | </template> |
| | | </el-table-column> |
| | |
| | | </el-table-column> --> |
| | | |
| | | </el-dialog> |
| | | |
| | | <el-dialog |
| | | title="修改时间" |
| | | :visible.sync="dialogVisibleTime" |
| | | width="30%" |
| | | :before-close="handleCloseTime"> |
| | | <el-date-picker v-model="detailsRow.releaseTime" type="datetime" placeholder="选择日期时间" |
| | | :style="{ width: '100%' }" value-format="yyyy-MM-dd HH:mm:ss"> |
| | | </el-date-picker> |
| | | <span slot="footer" class="dialog-footer"> |
| | | <el-button @click="dialogVisibleTime = false">取 消</el-button> |
| | | <el-button type="primary" @click="subTIme">确 定</el-button> |
| | | </span> |
| | | </el-dialog> |
| | | </div> |
| | | </template> |
| | | |
| | |
| | | name: "Publicity", |
| | | data() { |
| | | return { |
| | | detailsId:null, |
| | | dialogVisibleTime:false, |
| | | fileList: [], |
| | | dialogImageUrl: '', |
| | | dialogVisible: false, |
| | |
| | | addPublicityForm: { |
| | | publicityTitle: '', |
| | | text: '', |
| | | img: [] |
| | | img: [], |
| | | releaseTime:[] |
| | | }, |
| | | //添加弹框 |
| | | addPublicityVisibel: false, |
| | |
| | | }, |
| | | methods: |
| | | { |
| | | handleCloseTime(){ |
| | | this.dialogVisibleTime = false |
| | | }, |
| | | uploadSuccess3(res, file) { |
| | | if (res.code === 200) { |
| | | this.addPublicityForm.img.push({ |
| | |
| | | |
| | | this.search(); |
| | | }) |
| | | }, |
| | | subTIme(){ |
| | | let obj = { |
| | | id: this.detailsId, |
| | | time:this.detailsRow.releaseTime |
| | | } |
| | | this.$http.get('/api/publicity/changTime?id='+obj.id+'&'+'time='+obj.time).then(res=>{ |
| | | console.log(res) |
| | | let val = res.data |
| | | if (val.code ==200){ |
| | | |
| | | this.dialogVisibleTime =false |
| | | this.init() |
| | | }else { |
| | | this.$message.error(val.msg) |
| | | } |
| | | }) |
| | | |
| | | }, |
| | | delTime(e){ |
| | | console.log(e) |
| | | this.getDelial(e) |
| | | this.detailsId = e |
| | | this.dialogVisibleTime =true |
| | | |
| | | }, |
| | | getDelial(val){ |
| | | this.$http.get('/api/publicity/' + val).then(res => { |
| | | this.detailsRow = res.data.data |
| | | this.detailsRow.img = this.detailsRow['photoStr'].split(',').map(item => { |
| | | return { |
| | | name: item, |
| | | url: '/minio/img/' + item, |
| | | uid: this.detailsRow['photoStr'].split(',').length |
| | | } |
| | | }) |
| | | this.fileList = this.detailsRow.img |
| | | }); |
| | | }, |
| | | //发布/下架 |
| | | punlish(val, val2) { |
| | |
| | | if (!vaild) return this.$message.error('输入有误') |
| | | let param = null; |
| | | param = JSON.parse(JSON.stringify(this.addPublicityForm)); |
| | | console.log(param) |
| | | param.photoStr = param.img.map(item => item.name).join(','); |
| | | addPublicityList(param).then(res => { |
| | | this.$message({ |
| | |
| | | .freePic ::v-deep .el-upload--picture-card { |
| | | display: none; |
| | | } |
| | | </style> |
| | | </style> |