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

完成帖子管理

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