
4 changed files with 387 additions and 376 deletions
@ -1,281 +1,291 @@ |
|||||
<template> |
<template> |
||||
<div> |
<div> |
||||
|
|
||||
<div class="tab-header webtop"> |
<div class="tab-header webtop"> |
||||
<!-- 标题 --> |
<!-- 标题 --> |
||||
<div>轮播图信息</div> |
<div>轮播图信息</div> |
||||
<!-- start 添加修改按钮 --> |
<!-- start 添加修改按钮 --> |
||||
<div> |
<div> |
||||
<el-button type="primary" size="small" :disabled="submitdisabled" @click="saveOrUpdate">保存</el-button> |
<el-button type="primary" size="small" :disabled="submitdisabled" @click="saveOrUpdate">保存</el-button> |
||||
<el-button type="info" size="small" @click="handleReturn()">关闭</el-button> |
<el-button type="info" size="small" @click="handleReturn()">关闭</el-button> |
||||
</div> |
</div> |
||||
<!-- end 添加修改按钮 --> |
<!-- end 添加修改按钮 --> |
||||
<!-- end 详情按钮 --> |
<!-- end 详情按钮 --> |
||||
</div> |
|
||||
|
|
||||
<div class="listconadd"> |
|
||||
|
|
||||
<el-card class="box-card"> |
|
||||
|
|
||||
<div class="item"> |
|
||||
<span class="item_text">标题:</span> |
|
||||
<el-input v-model="formobj.title" placeholder="" class="item_input" clearable /> |
|
||||
</div> |
</div> |
||||
|
|
||||
<div class="item" style="margin-bottom: 100px;margin-top: 100px;"> |
<div class="listconadd"> |
||||
<span class="item_text">轮播图图片:</span> |
|
||||
<upload |
<el-card class="box-card"> |
||||
ref="uploadImg2" |
|
||||
v-model="imgList" |
<div class="item"> |
||||
style="margin-top: 20px;" |
<span class="item_text">标题:</span> |
||||
class="item_input" |
<el-input v-model="formobj.title" placeholder="" class="item_input" clearable /> |
||||
:limit="1" |
</div> |
||||
bucket="map" |
|
||||
:class="{ hide: hideUploadBtn }" |
<div class="item" style="margin-bottom: 100px;margin-top: 100px;"> |
||||
:upload-data="{ type: '0001' }" |
<span class="item_text">轮播图图片:</span> |
||||
@change="backData" |
<upload ref="uploadImg2" v-model="imgList" style="margin-top: 20px;" class="item_input" :limit="1" |
||||
/> |
bucket="map" :class="{ hide: hideUploadBtn }" :upload-data="{ type: '0001' }" |
||||
</div> |
@change="backData" /> |
||||
<div class="item"> |
</div> |
||||
<span class="item_text">发布人:</span> |
<div class="item"> |
||||
<el-input v-model="formobj.publisher" placeholder="" class="item_input" clearable /> |
<span class="item_text">发布人:</span> |
||||
</div> |
<el-input v-model="formobj.publisher" placeholder="" class="item_input" clearable /> |
||||
<div class="item"> |
</div> |
||||
<span class="item_text">发布日期:</span> |
<div class="item"> |
||||
<el-date-picker v-model="formobj.releaseTime" type="date" class="item_input" value-format="yyyy-MM-dd" placeholder="选择日期" /> |
<span class="item_text">发布日期:</span> |
||||
</div> |
<el-date-picker v-model="formobj.releaseTime" type="date" class="item_input" |
||||
<div class="item"> |
value-format="yyyy-MM-dd" placeholder="选择日期" /> |
||||
<span class="item_text">时效开始日期:</span> |
</div> |
||||
<el-date-picker v-model="formobj.startDate" type="date" class="item_input" value-format="yyyy-MM-dd" placeholder="选择日期" /> |
<div class="item"> |
||||
</div> |
<span class="item_text">时效开始日期:</span> |
||||
<div class="item"> |
<el-date-picker v-model="formobj.startDate" type="date" class="item_input" value-format="yyyy-MM-dd" |
||||
<span class="item_text">时效结束日期:</span> |
placeholder="选择日期" /> |
||||
<el-date-picker v-model="formobj.endDate" type="date" class="item_input" value-format="yyyy-MM-dd" placeholder="选择日期" /> |
</div> |
||||
</div> |
<div class="item"> |
||||
|
<span class="item_text">时效结束日期:</span> |
||||
<!-- <div class="item2"> |
<el-date-picker v-model="formobj.endDate" type="date" class="item_input" value-format="yyyy-MM-dd" |
||||
|
placeholder="选择日期" /> |
||||
|
</div> |
||||
|
|
||||
|
<!-- <div class="item2"> |
||||
<span class="item_text">内容:</span> |
<span class="item_text">内容:</span> |
||||
<el-input v-model="formobj.content" type="textarea" :rows="6" placeholder="商品简介" class="item_input" |
<el-input v-model="formobj.content" type="textarea" :rows="6" placeholder="商品简介" class="item_input" |
||||
clearable /> |
clearable /> |
||||
|
|
||||
</div> --> |
</div> --> |
||||
|
|
||||
<div class="item" style="margin-bottom: 100px;margin-top: 100px;"> |
<div class="item" style="margin-bottom: 100px;margin-top: 100px;"> |
||||
<span class="item_text">内容图片:</span> |
<span class="item_text">内容图片:</span> |
||||
<upload |
<upload ref="uploadImg3" v-model="imgListnr" style="margin-top: 20px;" class="item_input" :limit="1" |
||||
ref="uploadImg3" |
bucket="map" :class="{ hide: hideUploadBtnNr }" :upload-data="{ type: '0001' }" |
||||
v-model="imgListnr" |
@change="backDataNr" /> |
||||
style="margin-top: 20px;" |
</div> |
||||
class="item_input" |
<div class="item2"> |
||||
:limit="1" |
<span class="item_text">轮播图内容:</span> |
||||
bucket="map" |
<editor class="item_input" :height="300" :min-height="100" :value="formobj.content" |
||||
:class="{ hide: hideUploadBtnNr }" |
@input="editinput" /> |
||||
:upload-data="{ type: '0001' }" |
</div> |
||||
@change="backDataNr" |
|
||||
/> |
|
||||
</div> |
|
||||
<div class="item2"> |
|
||||
<span class="item_text">轮播图内容:</span> |
|
||||
<editor class="item_input" :height="300" :min-height="100" :value="formobj.content" @input="editinput" /> |
|
||||
</div> |
|
||||
|
|
||||
</el-card> |
</el-card> |
||||
|
|
||||
</div> |
</div> |
||||
|
|
||||
</div> |
</div> |
||||
</template> |
</template> |
||||
|
|
||||
<script> |
<script> |
||||
import req from '@/api/lpk/banner.js' |
import req from '@/api/lpk/banner.js' |
||||
import Editor from '@/components/Editor' |
import Editor from '@/components/Editor' |
||||
import upload from '@/components/uploadFile/upload_yanchejianchaTuBiao.vue' |
import upload from '@/components/uploadFile/upload_yanchejianchaTuBiao.vue' |
||||
|
|
||||
export default { |
export default { |
||||
components: { |
components: { |
||||
upload, |
upload, |
||||
Editor |
Editor |
||||
}, |
}, |
||||
data() { |
data() { |
||||
return { |
return { |
||||
imgList: [], |
imgList: [], |
||||
imgListnr: [], |
imgListnr: [], |
||||
hideUploadBtn: false, |
hideUploadBtn: false, |
||||
hideUploadBtnNr: false, |
hideUploadBtnNr: false, |
||||
submitdisabled: false, |
submitdisabled: false, |
||||
formobj: { |
formobj: { |
||||
sid: '', |
sid: '', |
||||
title: '', |
title: '', |
||||
publisher: '', |
publisher: '', |
||||
releaseTime: '', |
releaseTime: '', |
||||
startDate: '', |
startDate: '', |
||||
endDate: '', |
endDate: '', |
||||
content: '', |
content: '', |
||||
bannerUrl: '', |
bannerUrl: '', |
||||
bannerPath: '', |
bannerPath: '', |
||||
contentUrl: '' |
contentUrl: '' |
||||
} |
} |
||||
} |
|
||||
}, |
|
||||
methods: { |
|
||||
editinput(text) { |
|
||||
this.formobj.content = text |
|
||||
}, |
|
||||
saveOrUpdate() { |
|
||||
console.log('>>>>>>>>>saveOrUpdate', this.formobj) |
|
||||
req.saveNotice(this.formobj) |
|
||||
.then(resp => { |
|
||||
if (resp.success) { |
|
||||
this.$message({ |
|
||||
showClose: true, |
|
||||
type: 'success', |
|
||||
message: resp.msg |
|
||||
}) |
|
||||
this.handleReturn('true') |
|
||||
} else { |
|
||||
// 根据resp.code进行异常情况处理 |
|
||||
} |
} |
||||
}) |
}, |
||||
.catch(() => {}) |
methods: { |
||||
}, |
editinput(text) { |
||||
handleReturn(isreload) { |
this.formobj.content = text |
||||
if (isreload === 'true') this.$emit('reloadlist') |
}, |
||||
this.formobj = { |
saveOrUpdate() { |
||||
sid: '', |
console.log('>>>>>>>>>saveOrUpdate', this.formobj) |
||||
title: '', |
req.saveNotice(this.formobj) |
||||
publisher: '', |
.then(resp => { |
||||
releaseTime: '', |
if (resp.success) { |
||||
startDate: '', |
this.$message({ |
||||
endDate: '', |
showClose: true, |
||||
content: '', |
type: 'success', |
||||
bannerUrl: '', |
message: resp.msg |
||||
bannerPath: '', |
}) |
||||
contentUrl: '' |
this.handleReturn('true') |
||||
} |
} else { |
||||
this.$emit('doback') |
// 根据resp.code进行异常情况处理 |
||||
}, |
} |
||||
showAdd() {}, |
}) |
||||
showEdit(row) { |
.catch(() => {}) |
||||
req.noticeInit(row.sid) |
}, |
||||
.then(resp => { |
handleReturn(isreload) { |
||||
if (resp.success) { |
if (isreload === 'true') this.$emit('reloadlist') |
||||
this.formobj = resp.data |
this.formobj = { |
||||
this.imgList[0].url = resp.data.bannerUrl |
sid: '', |
||||
|
title: '', |
||||
|
publisher: '', |
||||
|
releaseTime: '', |
||||
|
startDate: '', |
||||
|
endDate: '', |
||||
|
content: '', |
||||
|
bannerUrl: '', |
||||
|
bannerPath: '', |
||||
|
contentUrl: '' |
||||
|
} |
||||
|
this.$emit('doback') |
||||
|
}, |
||||
|
showAdd() {}, |
||||
|
showEdit(row) { |
||||
|
req.noticeInit(row.sid) |
||||
|
.then(resp => { |
||||
|
if (resp.success) { |
||||
|
this.formobj = resp.data |
||||
|
this.imgList = [] |
||||
|
if (resp.data.bannerUrl != '') { |
||||
|
this.imgList.push({ |
||||
|
url: resp.data.bannerUrl |
||||
|
}) |
||||
|
} |
||||
|
this.hideUploadBtn = this.imgList.length != 0 |
||||
|
|
||||
|
this.imgListnr = [] |
||||
|
if (resp.data.contentUrl != '') { |
||||
|
this.imgListnr.push({ |
||||
|
url: resp.data.contentUrl |
||||
|
}) |
||||
|
} |
||||
|
this.hideUploadBtnNr = this.imgListnr.length != 0 |
||||
|
} |
||||
|
}) |
||||
|
.catch(e => { |
||||
|
this.formobj = row |
||||
|
this.imgList = [] |
||||
|
this.imgListnr = [] |
||||
|
}) |
||||
|
}, |
||||
|
backData(value) { |
||||
|
console.log('backData》》》》', value) |
||||
|
console.log('imgList', this.imgList) |
||||
|
|
||||
|
if (this.imgList.length > 0) { |
||||
|
this.formobj.bannerUrl = this.imgList[0].url |
||||
|
} else { |
||||
|
this.formobj.bannerUrl = '' |
||||
|
} |
||||
|
|
||||
|
this.hideUploadBtn = this.imgList.length !== 0 |
||||
|
console.log('this.hideUploadBtn', this.hideUploadBtn) |
||||
|
}, |
||||
|
backDataNr(value) { |
||||
|
if (this.imgListnr.length > 0) { |
||||
|
this.formobj.contentUrl = this.imgListnr[0].url |
||||
|
} else { |
||||
|
this.formobj.contentUrl = '' |
||||
|
} |
||||
|
|
||||
|
this.hideUploadBtnNr = this.imgListnr.length !== 0 |
||||
} |
} |
||||
}) |
|
||||
.catch(e => { |
|
||||
this.formobj = row |
|
||||
}) |
|
||||
}, |
|
||||
backData(value) { |
|
||||
console.log('backData》》》》', value) |
|
||||
console.log('imgList', this.imgList) |
|
||||
|
|
||||
if (this.imgList.length > 0) { |
|
||||
this.formobj.bannerUrl = this.imgList[0].url |
|
||||
} else { |
|
||||
this.formobj.bannerUrl = '' |
|
||||
} |
|
||||
|
|
||||
this.hideUploadBtn = this.imgList.length !== 0 |
|
||||
console.log('this.hideUploadBtn', this.hideUploadBtn) |
|
||||
}, |
|
||||
backDataNr(value) { |
|
||||
if (this.imgListnr.length > 0) { |
|
||||
this.formobj.contentUrl = this.imgListnr[0].url |
|
||||
} else { |
|
||||
this.formobj.contentUrl = '' |
|
||||
} |
} |
||||
|
|
||||
this.hideUploadBtnNr = this.imgListnr.length !== 0 |
|
||||
} |
|
||||
} |
} |
||||
} |
|
||||
</script> |
</script> |
||||
<style lang="scss" scoped> |
<style lang="scss" scoped> |
||||
// 隐藏上传组件 |
// 隐藏上传组件 |
||||
|
|
||||
.box-card { |
::v-deep .hide { |
||||
margin-left: 60px; |
.el-upload--picture-card { |
||||
margin-right: 60px; |
display: none !important; |
||||
min-width: 70%; |
|
||||
margin-top: 20px; |
|
||||
height: auto; |
|
||||
|
|
||||
.item { |
|
||||
display: flex; |
|
||||
flex-direction: row; |
|
||||
align-items: center; |
|
||||
margin-top: 15px; |
|
||||
height: 40px; |
|
||||
line-height: 40px; |
|
||||
|
|
||||
.item_text { |
|
||||
flex: 0.8; |
|
||||
font-size: 18px; |
|
||||
text-align: right; |
|
||||
} |
|
||||
|
|
||||
.item_input { |
|
||||
flex: 4; |
|
||||
font-size: 16px; |
|
||||
margin-left: 10px; |
|
||||
margin-right: 80px; |
|
||||
} |
|
||||
|
|
||||
.item_left_input { |
|
||||
width: 20%; |
|
||||
} |
|
||||
|
|
||||
.item_left_text { |
|
||||
height: 30px; |
|
||||
margin-left: 20px; |
|
||||
line-height: 30px; |
|
||||
color: #018AD2; |
|
||||
padding: 0px 15px; |
|
||||
border: 1.5px solid #018AD2; |
|
||||
border-radius: 5px; |
|
||||
|
|
||||
} |
|
||||
|
|
||||
.item_right { |
|
||||
flex: 1; |
|
||||
justify-items: center; |
|
||||
|
|
||||
.item_right_list_text { |
|
||||
font-size: 16px; |
|
||||
} |
} |
||||
|
} |
||||
|
|
||||
|
.box-card { |
||||
|
margin-left: 60px; |
||||
|
margin-right: 60px; |
||||
|
min-width: 70%; |
||||
|
margin-top: 20px; |
||||
|
height: auto; |
||||
|
|
||||
|
.item { |
||||
|
display: flex; |
||||
|
flex-direction: row; |
||||
|
align-items: center; |
||||
|
margin-top: 15px; |
||||
|
height: 40px; |
||||
|
line-height: 40px; |
||||
|
|
||||
|
.item_text { |
||||
|
flex: 0.8; |
||||
|
font-size: 18px; |
||||
|
text-align: right; |
||||
|
} |
||||
|
|
||||
|
.item_input { |
||||
|
flex: 4; |
||||
|
font-size: 16px; |
||||
|
margin-left: 10px; |
||||
|
margin-right: 80px; |
||||
|
} |
||||
|
|
||||
|
.item_left_input { |
||||
|
width: 20%; |
||||
|
} |
||||
|
|
||||
|
.item_left_text { |
||||
|
height: 30px; |
||||
|
margin-left: 20px; |
||||
|
line-height: 30px; |
||||
|
color: #018AD2; |
||||
|
padding: 0px 15px; |
||||
|
border: 1.5px solid #018AD2; |
||||
|
border-radius: 5px; |
||||
|
|
||||
|
} |
||||
|
|
||||
|
.item_right { |
||||
|
flex: 1; |
||||
|
justify-items: center; |
||||
|
|
||||
|
.item_right_list_text { |
||||
|
font-size: 16px; |
||||
|
} |
||||
|
|
||||
|
.item_right_list_delect { |
||||
|
color: #5E94FF; |
||||
|
margin-left: 20px; |
||||
|
font-size: 16px; |
||||
|
text-decoration: underline; |
||||
|
} |
||||
|
} |
||||
|
|
||||
.item_right_list_delect { |
|
||||
color: #5E94FF; |
|
||||
margin-left: 20px; |
|
||||
font-size: 16px; |
|
||||
text-decoration: underline; |
|
||||
} |
} |
||||
} |
|
||||
|
|
||||
} |
.item2 { |
||||
|
display: flex; |
||||
|
flex-direction: row; |
||||
|
align-items: center; |
||||
|
margin-top: 15px; |
||||
|
|
||||
|
.item_text { |
||||
|
flex: 0.8; |
||||
|
font-size: 18px; |
||||
|
text-align: right; |
||||
|
} |
||||
|
|
||||
.item2 { |
.item_input { |
||||
display: flex; |
flex: 4; |
||||
flex-direction: row; |
font-size: 16px; |
||||
align-items: center; |
margin-left: 10px; |
||||
margin-top: 15px; |
margin-right: 80px; |
||||
|
} |
||||
.item_text { |
|
||||
flex: 0.8; |
|
||||
font-size: 18px; |
|
||||
text-align: right; |
|
||||
} |
|
||||
|
|
||||
.item_input { |
|
||||
flex: 4; |
|
||||
font-size: 16px; |
|
||||
margin-left: 10px; |
|
||||
margin-right: 80px; |
|
||||
} |
|
||||
|
|
||||
} |
} |
||||
|
|
||||
} |
} |
||||
</style> |
</style> |
Loading…
Reference in new issue