|
|
|
@ -5,25 +5,23 @@
|
|
|
|
|
<a-button class="add-btn" style="margin: 10px" @click="newSwiper"
|
|
|
|
|
>添加轮播图</a-button
|
|
|
|
|
>
|
|
|
|
|
<!-- list -->
|
|
|
|
|
<a-card
|
|
|
|
|
hoverable
|
|
|
|
|
style="width: 70%; margin-top: 10px"
|
|
|
|
|
style="width:1000px; margin-top: 10px"
|
|
|
|
|
v-for="item in cardList"
|
|
|
|
|
:key="item.id"
|
|
|
|
|
>
|
|
|
|
|
<span class="card-close" @click="del(item.id)">×</span>
|
|
|
|
|
<a-row>
|
|
|
|
|
<a-col :span="9">
|
|
|
|
|
<div style="color: #00000073; padding-bottom: 10px">
|
|
|
|
|
上传图片尺寸: 750*300
|
|
|
|
|
</div>
|
|
|
|
|
<a-col :span="9" style="display:flex;justify-content: center">
|
|
|
|
|
<img
|
|
|
|
|
:src="$ImgUrl(item.imgList[0].url)"
|
|
|
|
|
v-if="item.imgList.length > 0"
|
|
|
|
|
class="list-img"
|
|
|
|
|
alt=""
|
|
|
|
|
/>
|
|
|
|
|
<span v-else>暂无图片</span>
|
|
|
|
|
<div v-else style="align-self:center">暂无图片</div>
|
|
|
|
|
</a-col>
|
|
|
|
|
<a-col :span="11">
|
|
|
|
|
<a-descriptions layout="vertical" :column="1">
|
|
|
|
@ -43,7 +41,7 @@
|
|
|
|
|
</a-col>
|
|
|
|
|
</a-row>
|
|
|
|
|
</a-card>
|
|
|
|
|
<!-- list -->
|
|
|
|
|
<!-- 添加 -->
|
|
|
|
|
<a-modal
|
|
|
|
|
:title="add.title"
|
|
|
|
|
:visible="add.show"
|
|
|
|
@ -53,7 +51,7 @@
|
|
|
|
|
>
|
|
|
|
|
<a-row>
|
|
|
|
|
<a-col :span="9">
|
|
|
|
|
<div style="color: #00000073; padding-bottom: 10px">
|
|
|
|
|
<div style="color: #00000073; padding-bottom: 10px;">
|
|
|
|
|
上传图片尺寸: 750*300
|
|
|
|
|
</div>
|
|
|
|
|
<commonUpload
|
|
|
|
@ -118,7 +116,7 @@
|
|
|
|
|
<chooseTable
|
|
|
|
|
:show="table.show"
|
|
|
|
|
:type="form.type"
|
|
|
|
|
@submit="submit"
|
|
|
|
|
@submit="submitURL"
|
|
|
|
|
@close="close"
|
|
|
|
|
/>
|
|
|
|
|
</div>
|
|
|
|
@ -166,6 +164,28 @@ export default {
|
|
|
|
|
title: "添加轮播图",
|
|
|
|
|
};
|
|
|
|
|
},
|
|
|
|
|
// 保存
|
|
|
|
|
async saveSetting() {
|
|
|
|
|
if (this.add.title === "添加轮播图") {
|
|
|
|
|
let res = await swiperInsert(this.form);
|
|
|
|
|
if (res.code === 200) {
|
|
|
|
|
this.$message.success(res.msg);
|
|
|
|
|
this.newSwiperClose();
|
|
|
|
|
this.getData();
|
|
|
|
|
} else {
|
|
|
|
|
this.$message.error(res.msg);
|
|
|
|
|
}
|
|
|
|
|
} else if (this.add.title === "修改轮播图") {
|
|
|
|
|
let res = await swiperUpdate(this.form);
|
|
|
|
|
if (res.code === 200) {
|
|
|
|
|
this.$message.success(res.msg);
|
|
|
|
|
this.getData();
|
|
|
|
|
this.newSwiperClose();
|
|
|
|
|
} else {
|
|
|
|
|
this.$message.error(res.msg);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
},
|
|
|
|
|
// 编辑
|
|
|
|
|
edit(data) {
|
|
|
|
|
this.add = {
|
|
|
|
@ -214,33 +234,11 @@ export default {
|
|
|
|
|
};
|
|
|
|
|
},
|
|
|
|
|
// 选择链接确定
|
|
|
|
|
submit(data, customizeUrl) {
|
|
|
|
|
submitURL(data, customizeUrl) {
|
|
|
|
|
this.form.customizeUrl = customizeUrl;
|
|
|
|
|
this.form.associationId = data[0];
|
|
|
|
|
this.close();
|
|
|
|
|
},
|
|
|
|
|
// 保存
|
|
|
|
|
async saveSetting() {
|
|
|
|
|
if (this.add.title === "添加轮播图") {
|
|
|
|
|
let res = await swiperInsert(this.form);
|
|
|
|
|
if (res.code === 200) {
|
|
|
|
|
this.$message.success(res.msg);
|
|
|
|
|
this.getData();
|
|
|
|
|
this.newSwiperClose();
|
|
|
|
|
} else {
|
|
|
|
|
this.$message.error(res.msg);
|
|
|
|
|
}
|
|
|
|
|
} else if (this.add.title === "修改轮播图") {
|
|
|
|
|
let res = await swiperUpdate(this.form);
|
|
|
|
|
if (res.code === 200) {
|
|
|
|
|
this.$message.success(res.msg);
|
|
|
|
|
this.getData();
|
|
|
|
|
this.newSwiperClose();
|
|
|
|
|
} else {
|
|
|
|
|
this.$message.error(res.msg);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
},
|
|
|
|
|
// 关闭选择
|
|
|
|
|
close() {
|
|
|
|
|
this.table.show = false;
|
|
|
|
@ -294,7 +292,7 @@ export default {
|
|
|
|
|
height: 200px;
|
|
|
|
|
}
|
|
|
|
|
.list-img {
|
|
|
|
|
width: 90%;
|
|
|
|
|
width: 300px;
|
|
|
|
|
height: 200px;
|
|
|
|
|
}
|
|
|
|
|
.card-close {
|
|
|
|
|