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