提交 861b16d1 authored 作者: 吴德鹏's avatar 吴德鹏

完成帖子管理

上级 c4c2e15f
......@@ -76,10 +76,12 @@
.bottom-btn-group {
float: right;
}
.product-container > ul{
.product-container > ul {
display: flex;
flex-wrap: wrap;
}
.product-container > ul li {
border-radius: 4px;
cursor: pointer;
......@@ -96,14 +98,16 @@
margin-right: 10px;
position: relative;
}
.product-container > ul > .add-product .modal-close{
.product-container > ul > .add-product .modal-close {
position: absolute;
right:5px;
top:5px;
right: 5px;
top: 5px;
}
.product-container > ul > .add-product>img{
width:100%;
height:100%;
.product-container > ul > .add-product > img {
width: 100%;
height: 100%;
object-fit: cover;
}
......@@ -125,7 +129,8 @@
height: 380px;
margin: 15px 0;
}
.Tag-active{
.Tag-active {
background: #0d8ddb;
color: white;
}
......@@ -311,15 +316,15 @@
</div>
<ul class="tag-wrapper tag-search-result" style="margin-top:10px;">
<li v-for="(el,i) in tagList" :value="el.value" :key="el.value" @click="chooseTags(el,i)"
<li v-for="(el,i) in allTagList" :value="el.value" :key="el.value" @click="chooseTags(el,i)"
:class="el.isSelected?'Tag-active':null"
>
<!-- label-primary-->
<p >#{{el.label}}</p>
<!-- label-primary-->
<p>#{{el.label}}</p>
</li>
</ul>
<div class="bottom-btn-group">
<i-button type="success" @click="isShownTagMadal = false">确认</i-button>
<i-button type="success" @click="toChooseTags">确认</i-button>
<i-button type="warning" @click="isShownTagMadal = false">取消</i-button>
</div>
</div>
......
......@@ -40,6 +40,7 @@ let vm = new Vue({
el: '#rrapp',
components: {},
data: {
allTagList: [],
tagList: [],
uploadList: [],
account: true,
......@@ -102,6 +103,20 @@ let vm = new Vue({
postProductArr: [],
},
methods: {
toChooseTags() {
vm.tagList = [];
vm.isShownTagMadal = false;
vm.allTagList.forEach(res => {
if (res.isSelected) {
console.log(res)
vm.tagList.push({
value: res.value,
label: res.label,
isSelected: true
})
}
});
},
deleteProduct(index) {
this.$delete(this.postProductArr, index);
},
......@@ -120,7 +135,7 @@ let vm = new Vue({
}
},
chooseTags(tag, index) {
this.tagList[index].isSelected = !this.tagList[index].isSelected;
this.allTagList[index].isSelected = !this.allTagList[index].isSelected;
},
searchTags() {
$.get('../hashtag/getTagsByName?name=' + this.tagSearchValue, res => {
......@@ -328,6 +343,9 @@ let vm = new Vue({
vm.reload();
},
add: function () {
vm.allTagList.forEach(res => {
res.isSelected = false;
})
vm.uploadList = [];
vm.tagList = [];
vm.postProductArr = [];
......@@ -513,7 +531,7 @@ let vm = new Vue({
let OBJ_res = JSON.parse(res);
OBJ_res.list.forEach((item) => {
console.log('labelName', item.name)
this.tagList.push({
this.allTagList.push({
label: item.name,
value: item.id,
isSelected: false,
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论