提交 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
......
...@@ -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 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论