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

帖子管理

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