提交 96ffc33a authored 作者: 吴德鹏's avatar 吴德鹏

帖子管理

上级 98d3fd21
...@@ -106,4 +106,18 @@ public class HashtagController { ...@@ -106,4 +106,18 @@ public class HashtagController {
return R.ok().put("list", list); return R.ok().put("list", list);
} }
/**
* 根据名字查找标签
*/
@RequestMapping("/getTagsByName")
@ResponseBody
public R getTagsByName(@RequestParam String name) {
List<HashtagEntity> list = hashtagService.getTagsByName(name);
return R.ok().put("list", list);
}
} }
...@@ -2,6 +2,8 @@ package com.platform.dao; ...@@ -2,6 +2,8 @@ package com.platform.dao;
import com.platform.entity.HashtagEntity; import com.platform.entity.HashtagEntity;
import java.util.List;
/** /**
* Dao * Dao
* *
...@@ -10,4 +12,5 @@ import com.platform.entity.HashtagEntity; ...@@ -10,4 +12,5 @@ import com.platform.entity.HashtagEntity;
*/ */
public interface HashtagDao extends BaseDao<HashtagEntity> { public interface HashtagDao extends BaseDao<HashtagEntity> {
List<HashtagEntity> getTagsByName(String name);
} }
package com.platform.service; package com.platform.service;
import com.platform.entity.HashtagEntity; import com.platform.entity.HashtagEntity;
import org.springframework.web.bind.annotation.RequestParam;
import java.util.List; import java.util.List;
import java.util.Map; import java.util.Map;
...@@ -68,4 +69,13 @@ public interface HashtagService { ...@@ -68,4 +69,13 @@ public interface HashtagService {
* @return 删除条数 * @return 删除条数
*/ */
int deleteBatch(String[] ids); int deleteBatch(String[] ids);
/**
* 根据名字查找标签
*
* @param name
* @return list
*/
List<HashtagEntity> getTagsByName(String name);
} }
...@@ -93,4 +93,9 @@ public class HashtagServiceImpl implements HashtagService { ...@@ -93,4 +93,9 @@ public class HashtagServiceImpl implements HashtagService {
public int deleteBatch(String[] ids) { public int deleteBatch(String[] ids) {
return hashtagDao.deleteBatch(ids); return hashtagDao.deleteBatch(ids);
} }
@Override
public List<HashtagEntity> getTagsByName(String name) {
return hashtagDao.getTagsByName(name);
}
} }
...@@ -60,6 +60,22 @@ ...@@ -60,6 +60,22 @@
</if> </if>
</select> </select>
<select id="getTagsByName" resultType="com.platform.entity.HashtagEntity">
select
`id`,
`archived`,
`archived_by`,
`archived_date`,
`create_date`,
`created_by`,
`update_date`,
`updated_by`,
`version`,
`name`,
`user_id`
from hashtag
where name LIKE concat('%',#{name},'%')
</select>
<select id="queryTotal" resultType="int"> <select id="queryTotal" resultType="int">
select count(*) from hashtag select count(*) from hashtag
WHERE 1=1 WHERE 1=1
......
...@@ -4,70 +4,80 @@ ...@@ -4,70 +4,80 @@
<title></title> <title></title>
#parse("sys/header.html") #parse("sys/header.html")
<style> <style>
.tag-wrapper li{ .tag-wrapper li {
display: inline-block; display: inline-block;
padding:4px 16px; padding: 4px 16px;
border-radius: 4px; border-radius: 4px;
border: 1px solid grey; border: 1px solid grey;
line-height: 16px; line-height: 16px;
margin-right:8px; margin-right: 8px;
} }
.tag-wrapper .add-tag-btn{
.tag-wrapper .add-tag-btn {
cursor: pointer; cursor: pointer;
color:white; color: white;
border: 1px solid #2db7f5; border: 1px solid #2db7f5;
background: #2db7f5; background: #2db7f5;
} }
.modal-wrapper{
.modal-wrapper {
position: fixed; position: fixed;
width:100vw; width: 100vw;
height:100vh; height: 100vh;
top:0; top: 0;
left:0; left: 0;
z-index: 1000; z-index: 1000;
} }
.modal-bg{
.modal-bg {
position: absolute; position: absolute;
width:100vw; width: 100vw;
height:100vh; height: 100vh;
top:0; top: 0;
left:0; left: 0;
background: #000; background: #000;
opacity: 0.5; opacity: 0.5;
} }
.modal-container{
.modal-container {
position: absolute; position: absolute;
width:800px; width: 800px;
height:600px; height: 600px;
left:50%; left: 50%;
top:50%; top: 50%;
transform: translate(-50%,-50%); transform: translate(-50%, -50%);
border-radius: 6px; border-radius: 6px;
background: white; background: white;
padding:50px 14px 14px 14px; padding: 50px 14px 14px 14px;
} }
.modal-container .modal-close{
.modal-container .modal-close {
position: absolute; position: absolute;
right: 18px; right: 18px;
top:18px; top: 18px;
font-size: 20px; font-size: 20px;
cursor: pointer; cursor: pointer;
} }
.tag-search{
.tag-search {
display: flex; display: flex;
} }
.tag-search>:first-child{
.tag-search > :first-child {
margin-right: 10px; margin-right: 10px;
} }
.tag-search-result{
height:450px; .tag-search-result {
height: 450px;
overflow: auto; overflow: auto;
} }
.bottom-btn-group{
.bottom-btn-group {
float: right; float: right;
} }
.product-container >ul li{
.product-container > ul li {
border-radius: 4px; border-radius: 4px;
cursor: pointer; cursor: pointer;
text-align: center; text-align: center;
...@@ -75,25 +85,30 @@ ...@@ -75,25 +85,30 @@
align-items: center; align-items: center;
justify-content: center; justify-content: center;
} }
.product-container >ul>.add-product{
width:120px; .product-container > ul > .add-product {
width: 120px;
height: 120px; height: 120px;
border:1px solid #dddee1 border: 1px solid #dddee1
} }
.productList-style-start{
.productList-style-start {
display: flex; display: flex;
justify-content: start; justify-content: start;
} }
.search{
.search {
display: flex; display: flex;
justify-content: start; justify-content: start;
} }
.search>button{
margin-left:10px; .search > button {
margin-left: 10px;
} }
#showItems{
height:380px; #showItems {
margin:15px 0; height: 380px;
margin: 15px 0;
} }
</style> </style>
</head> </head>
...@@ -195,26 +210,34 @@ ...@@ -195,26 +210,34 @@
<div class="modal-bg"></div> <div class="modal-bg"></div>
<div class="modal-container"> <div class="modal-container">
<i @click="isShownProductMadal = false"> <i @click="isShownProductMadal = false">
<Icon type="close" class="modal-close" ></Icon> <Icon type="close" class="modal-close"></Icon>
</i> </i>
<div class="productList-style-start"> <div class="productList-style-start">
<div> <div>
<span>一级分类</span> <span>一级分类</span>
<i-Select v-model="commoditycategoryListsActive1" style="width:100px" @on-change="changeSubCateType"> <i-Select v-model="commoditycategoryListsActive1" style="width:100px"
<i-Option v-for="item in commodityCategoryLists1" :value="item.value" :key="item.value">{{ item.label }}</i-Option> @on-change="changeSubCateType">
<i-Option v-for="item in commodityCategoryLists1" :value="item.value"
:key="item.value">{{ item.label }}
</i-Option>
</i-Select> </i-Select>
</div> </div>
<div> <div>
<span style="margin-left:20px;" >二级分类</span> <span style="margin-left:20px;">二级分类</span>
<i-Select v-model="commoditycategoryListsActive2" @on-change="queryMiniCatagory(3)" style="width:100px"> <i-Select v-model="commoditycategoryListsActive2" @on-change="queryMiniCatagory(3)"
<i-Option v-for="item in commodityCategoryLists2" :value="item.value" :key="item.value">{{ item.label }}</i-Option> style="width:100px">
<i-Option v-for="item in commodityCategoryLists2" :value="item.value"
:key="item.value">{{ item.label }}
</i-Option>
</i-Select> </i-Select>
</div> </div>
<div> <div>
<span style="margin-left:20px;" >三级分类</span> <span style="margin-left:20px;">三级分类</span>
<i-Select v-model="commoditycategoryListsActive3" style="width:100px"> <i-Select v-model="commoditycategoryListsActive3" style="width:100px">
<i-Option v-for="item in commodityCategoryLists3" :value="item.value" :key="item.value">{{ item.label }}</i-Option> <i-Option v-for="item in commodityCategoryLists3" :value="item.value"
:key="item.value">{{ item.label }}
</i-Option>
</i-Select> </i-Select>
</div> </div>
</div> </div>
...@@ -223,14 +246,15 @@ ...@@ -223,14 +246,15 @@
<i-Input <i-Input
v-model="productSearch" v-model="productSearch"
placeholder="请输入搜索内容(可选)" placeholder="请输入搜索内容(可选)"
style="width:500px;" /> style="width:500px;"/>
</div> </div>
<i-Button <i-Button
type="primary" type="primary"
style="width:100px;" style="width:100px;"
@click='handleSearchProduct()' @click='handleSearchProduct()'
>搜索</i-Button> >搜索
<i-Button style="width:100px;" >重置</i-Button> </i-Button>
<i-Button style="width:100px;">重置</i-Button>
</div> </div>
<section id="showItems"> <section id="showItems">
<table id="searchjqGrid"></table> <table id="searchjqGrid"></table>
...@@ -254,17 +278,21 @@ ...@@ -254,17 +278,21 @@
<div class="modal-bg"></div> <div class="modal-bg"></div>
<div class="modal-container"> <div class="modal-container">
<i @click="isShownTagMadal = false"> <i @click="isShownTagMadal = false">
<Icon type="close" class="modal-close" ></Icon> <Icon type="close" class="modal-close"></Icon>
</i> </i>
<div class="tag-search"> <div class="tag-search">
<i-input v-model="tagSearchValue" placeholder="请输入搜索的标签..." icon="close" @on-click="tagSearchValue=''" ></i-input> <i-input v-model="tagSearchValue" placeholder="请输入搜索的标签..." icon="close"
<i-button type="info">搜索</i-button> @on-click="tagSearchValue=''"></i-input>
<i-button type="info" @click='searchTags'>搜索</i-button>
</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 in 100"> <li v-for="(el,i) in tagList" :value="el.value" :key="el.value" @click="chooseTags(el,i)"
<p>#shoe</p> class="label label-primary"
<p>192POST</p> >
<p>#{{el.label}}</p>
<p v-if="el.isSelected" style="background: #c9302c">#{{el.label}}</p>
</li> </li>
</ul> </ul>
<div class="bottom-btn-group"> <div class="bottom-btn-group">
......
...@@ -38,10 +38,9 @@ $(function () { ...@@ -38,10 +38,9 @@ $(function () {
let vm = new Vue({ let vm = new Vue({
el: '#rrapp', el: '#rrapp',
components:{ components: {},
},
data: { data: {
tagList: [],
uploadList: [], uploadList: [],
account: true, account: true,
typeList: [ typeList: [
...@@ -72,10 +71,10 @@ let vm = new Vue({ ...@@ -72,10 +71,10 @@ let vm = new Vue({
topic: '' topic: ''
}, },
isShownTagMadal:false, isShownTagMadal: false,
tagSearchValue:"", tagSearchValue: "",
isShownProductMadal:false, isShownProductMadal: false,
productSearch:'', productSearch: '',
commodityCategoryLists1: [ commodityCategoryLists1: [
{ {
value: '商品一级', value: '商品一级',
...@@ -101,18 +100,41 @@ let vm = new Vue({ ...@@ -101,18 +100,41 @@ let vm = new Vue({
commoditycategoryListsActive3: null, commoditycategoryListsActive3: null,
}, },
methods: { methods: {
handleSearchProduct(e){ chooseTags(tag, index) {
1==1 ? (()=>{ this.tagList[index].isSelected = !this.tagList[index].isSelected;
console.log(tag.isSelected+':'+index)
if (this.tagList[index].isSelected) {
tag.isSelected = true;
}
},
searchTags() {
$.get('../hashtag/getTagsByName?name=' + this.tagSearchValue, res => {
this.tagList = [];
let _res = JSON.parse(res);
_res.code === 0 ? (() => {
_res.list.forEach((item) => {
this.tagList.push({
label: item.name,
value: item.id
})
})
})() : null
})
},
handleSearchProduct(e) {
1 == 1 ? (() => {
$('#showItems').children().remove(); $('#showItems').children().remove();
$('#showItems').append(`<table id="searchjqGrid"></table>`); $('#showItems').append(`<table id="searchjqGrid"></table>`);
function beforeSelectRow(){
function beforeSelectRow() {
$("#searchjqGrid").jqGrid('resetSelection'); $("#searchjqGrid").jqGrid('resetSelection');
return(true); return (true);
} }
let _this = this; let _this = this;
$(function () { $(function () {
$("#searchjqGrid").Grid({ $("#searchjqGrid").Grid({
url: `../tbcfstationitem/list?itemCategory=${_this.commoditycategoryListsActive1||''}&typeTwo=${_this.commoditycategoryListsActive2||''}&typeThree=${_this.commoditycategoryListsActive3||''}&name=${vm.productSearch||e||''}`, url: `../tbcfstationitem/list?itemCategory=${_this.commoditycategoryListsActive1 || ''}&typeTwo=${_this.commoditycategoryListsActive2 || ''}&typeThree=${_this.commoditycategoryListsActive3 || ''}&name=${vm.productSearch || e || ''}`,
colModel: [ colModel: [
{label: 'itemId', name: 'itemId', index: 'item_id', key: true, hidden: true}, {label: 'itemId', name: 'itemId', index: 'item_id', key: true, hidden: true},
{label: '商品图片', name: 'itemImg', index: 'item_img', width: 50, formatter: imageFormat}, {label: '商品图片', name: 'itemImg', index: 'item_img', width: 50, formatter: imageFormat},
...@@ -130,11 +152,17 @@ let vm = new Vue({ ...@@ -130,11 +152,17 @@ let vm = new Vue({
{label: '商品一级分类', name: 'goodtype', index: 'goodtype', width: 80}, {label: '商品一级分类', name: 'goodtype', index: 'goodtype', width: 80},
{label: '商品二级分类', name: 'title', index: 'title', width: 80}, {label: '商品二级分类', name: 'title', index: 'title', width: 80},
{label: '商品品名', name: 'dname', index: 'itemDescritionId', width: 120}, {label: '商品品名', name: 'dname', index: 'itemDescritionId', width: 120},
{label: '状态', name: 'enableFlag', index: 'enable_flag', width: 120, formatter: itemStatusFormat}, {
label: '状态',
name: 'enableFlag',
index: 'enable_flag',
width: 120,
formatter: itemStatusFormat
},
{label: '创建日期', name: 'createTime', index: 'create_time', width: 160} {label: '创建日期', name: 'createTime', index: 'create_time', width: 160}
], ],
multiselect: true, multiselect: true,
multiboxonly:true, multiboxonly: true,
beforeSelectRow: beforeSelectRow, beforeSelectRow: beforeSelectRow,
}); });
}); });
...@@ -142,7 +170,7 @@ let vm = new Vue({ ...@@ -142,7 +170,7 @@ let vm = new Vue({
})() : alert('未输入搜索内容~'); })() : alert('未输入搜索内容~');
}, },
//查询二级分类 //查询二级分类
changeSubCateType(){ changeSubCateType() {
this.commodityCategoryLists2 = []; this.commodityCategoryLists2 = [];
$.get('../tbcfstationitem/queryByItemType?typeId=' + this.commoditycategoryListsActive1, res => { $.get('../tbcfstationitem/queryByItemType?typeId=' + this.commoditycategoryListsActive1, res => {
let _res = JSON.parse(res); let _res = JSON.parse(res);
...@@ -157,7 +185,7 @@ let vm = new Vue({ ...@@ -157,7 +185,7 @@ let vm = new Vue({
}) })
}, },
//查询三级分类 //查询三级分类
queryMiniCatagory(){ queryMiniCatagory() {
$.get('../tbcfstationitem/queryByItemTypeTwo?typeTwoId=' + this.commoditycategoryListsActive2, res => { $.get('../tbcfstationitem/queryByItemTypeTwo?typeTwoId=' + this.commoditycategoryListsActive2, res => {
this.commodityCategoryLists3 = []; this.commodityCategoryLists3 = [];
let _res = JSON.parse(res); let _res = JSON.parse(res);
...@@ -423,7 +451,7 @@ let vm = new Vue({ ...@@ -423,7 +451,7 @@ let vm = new Vue({
handleResetForm(this, name); handleResetForm(this, name);
} }
}, },
created(){ created() {
//获取分类子页面一级分类数据 //获取分类子页面一级分类数据
$.get('../tbcfgoodstype/queryAll', res => { $.get('../tbcfgoodstype/queryAll', res => {
res.code === 0 ? (() => { res.code === 0 ? (() => {
...@@ -436,5 +464,16 @@ let vm = new Vue({ ...@@ -436,5 +464,16 @@ let vm = new Vue({
}) })
})() : null })() : null
}) })
//获取所有的标签
$.get('../hashtag/queryAll', res => {
let OBJ_res = JSON.parse(res);
OBJ_res.list.forEach((item) => {
console.log('labelName', item.name)
this.tagList.push({
label: item.name,
value: item.id
});
})
})
} }
}); });
...@@ -812,7 +812,7 @@ let vm = new Vue({ ...@@ -812,7 +812,7 @@ let vm = new Vue({
}, },
// 选中子标签 // 选中子标签
selectSubTag(element, index, parentIndex) { selectSubTag(element, index, parentIndex) {
this.tagLists[parentIndex].isSelected = false; this.tagLists[parentIndex].selectSubTag = false;
this.subtaglist[parentIndex][index].isSelected = !this.subtaglist[parentIndex][index].isSelected; this.subtaglist[parentIndex][index].isSelected = !this.subtaglist[parentIndex][index].isSelected;
let allSelected = this.subtaglist[parentIndex].every(item => item.isSelected === true); let allSelected = this.subtaglist[parentIndex].every(item => item.isSelected === true);
allSelected ? this.tagLists[parentIndex].isSelected = true : null; allSelected ? this.tagLists[parentIndex].isSelected = true : null;
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论