Skip to content
项目
群组
代码片段
帮助
正在加载...
帮助
为 GitLab 提交贡献
登录/注册
切换导航
C
chinafrica
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
分枝图
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
计划
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
分枝图
统计图
创建新议题
作业
提交
议题看板
打开侧边栏
zhengfg
chinafrica
Commits
c8981712
提交
c8981712
authored
3月 17, 2020
作者:
zgy
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
标签管理优化
上级
c412de24
隐藏空白字符变更
内嵌
并排
正在显示
8 个修改的文件
包含
146 行增加
和
53 行删除
+146
-53
TbCfLabelController.java
...ain/java/com/platform/controller/TbCfLabelController.java
+13
-1
TbCfLabelDao.java
...rm-admin/src/main/java/com/platform/dao/TbCfLabelDao.java
+8
-0
TbCfLabelEntity.java
...in/src/main/java/com/platform/entity/TbCfLabelEntity.java
+18
-1
TbCfLabelService.java
.../src/main/java/com/platform/service/TbCfLabelService.java
+7
-0
TbCfLabelServiceImpl.java
.../java/com/platform/service/impl/TbCfLabelServiceImpl.java
+11
-0
TbCfLabelDao.xml
...dmin/src/main/resources/com/platform/dao/TbCfLabelDao.xml
+61
-44
tbcflabel.html
...orm-admin/src/main/webapp/WEB-INF/page/sys/tbcflabel.html
+16
-6
tbcflabel.js
platform-admin/src/main/webapp/js/sys/tbcflabel.js
+12
-1
没有找到文件。
platform-admin/src/main/java/com/platform/controller/TbCfLabelController.java
浏览文件 @
c8981712
...
...
@@ -42,7 +42,7 @@ public class TbCfLabelController {
List
<
TbCfLabelEntity
>
tbCfLabelList
=
tbCfLabelService
.
queryList
(
query
);
int
total
=
tbCfLabelService
.
queryTotal
(
query
);
PageUtils
pageUtil
=
new
PageUtils
(
tbCfLabelList
,
total
,
query
.
getLimit
(),
query
.
getPage
());
PageUtils
pageUtil
=
new
PageUtils
(
tbCfLabelList
,
total
,
query
.
getLimit
(),
query
.
getPage
());
return
R
.
ok
().
put
(
"page"
,
pageUtil
);
}
...
...
@@ -106,4 +106,16 @@ public class TbCfLabelController {
return
R
.
ok
().
put
(
"list"
,
list
);
}
/**
* 查询父标签的子类
*
* @return list
*/
@RequestMapping
(
"/queryParentLabels"
)
@ResponseBody
public
R
queryParentLabels
(
@RequestParam
(
value
=
"parentId"
,
defaultValue
=
"0"
)
String
parentId
)
{
List
<
TbCfLabelEntity
>
labelList
=
tbCfLabelService
.
queryParentLabels
(
parentId
);
return
R
.
ok
().
put
(
"list"
,
labelList
);
}
}
platform-admin/src/main/java/com/platform/dao/TbCfLabelDao.java
浏览文件 @
c8981712
...
...
@@ -2,6 +2,8 @@ package com.platform.dao;
import
com.platform.entity.TbCfLabelEntity
;
import
java.util.List
;
/**
* 商品标签Dao
*
...
...
@@ -10,4 +12,10 @@ import com.platform.entity.TbCfLabelEntity;
*/
public
interface
TbCfLabelDao
extends
BaseDao
<
TbCfLabelEntity
>
{
/**
* 查询所有父标签
*
* @return list
*/
List
<
TbCfLabelEntity
>
queryParentLabels
(
String
parentId
);
}
platform-admin/src/main/java/com/platform/entity/TbCfLabelEntity.java
浏览文件 @
c8981712
...
...
@@ -8,7 +8,7 @@ import java.util.Date;
* 表名 tb_cf_label
*
* @author lipengjun
* @date 2020-03-1
2 16:20:26
* @date 2020-03-1
7 10:38:00
*/
public
class
TbCfLabelEntity
implements
Serializable
{
private
static
final
long
serialVersionUID
=
1L
;
...
...
@@ -17,6 +17,10 @@ public class TbCfLabelEntity implements Serializable {
* 标签ID
*/
private
String
id
;
/**
* 父标签ID,如果没有父标签,则为:0
*/
private
String
parentId
;
/**
* 标签名
*/
...
...
@@ -47,6 +51,19 @@ public class TbCfLabelEntity implements Serializable {
public
String
getId
()
{
return
id
;
}
/**
* 设置:父标签ID,如果没有父标签,则为:0
*/
public
void
setParentId
(
String
parentId
)
{
this
.
parentId
=
parentId
;
}
/**
* 获取:父标签ID,如果没有父标签,则为:0
*/
public
String
getParentId
()
{
return
parentId
;
}
/**
* 设置:标签名
*/
...
...
platform-admin/src/main/java/com/platform/service/TbCfLabelService.java
浏览文件 @
c8981712
...
...
@@ -68,4 +68,11 @@ public interface TbCfLabelService {
* @return 删除条数
*/
int
deleteBatch
(
String
[]
ids
);
/**
* 查询父标签的子类
*
* @return list
*/
List
<
TbCfLabelEntity
>
queryParentLabels
(
String
parentId
);
}
platform-admin/src/main/java/com/platform/service/impl/TbCfLabelServiceImpl.java
浏览文件 @
c8981712
...
...
@@ -60,4 +60,15 @@ public class TbCfLabelServiceImpl implements TbCfLabelService {
public
int
deleteBatch
(
String
[]
ids
)
{
return
tbCfLabelDao
.
deleteBatch
(
ids
);
}
/**
* 查询父标签的子类
*
* @return list
*/
@Override
public
List
<
TbCfLabelEntity
>
queryParentLabels
(
String
parentId
)
{
return
tbCfLabelDao
.
queryParentLabels
(
parentId
);
}
}
platform-admin/src/main/resources/com/platform/dao/TbCfLabelDao.xml
浏览文件 @
c8981712
...
...
@@ -5,15 +5,17 @@
<resultMap
type=
"com.platform.entity.TbCfLabelEntity"
id=
"tbCfLabelMap"
>
<result
property=
"id"
column=
"id"
/>
<result
property=
"parentId"
column=
"parent_id"
/>
<result
property=
"labelName"
column=
"label_name"
/>
<result
property=
"enableFlag"
column=
"enable_flag"
/>
<result
property=
"createTime"
column=
"create_time"
/>
<result
property=
"updateTime"
column=
"update_time"
/>
</resultMap>
<select
id=
"queryObject"
resultType=
"com.platform.entity.TbCfLabelEntity"
>
<select
id=
"queryObject"
resultType=
"com.platform.entity.TbCfLabelEntity"
>
select
`id`,
`parent_id`,
`label_name`,
`enable_flag`,
`create_time`,
...
...
@@ -22,74 +24,89 @@
where id = #{id}
</select>
<select
id=
"queryList"
resultType=
"com.platform.entity.TbCfLabelEntity"
>
<select
id=
"queryList"
resultType=
"com.platform.entity.TbCfLabelEntity"
>
select
`id`,
`parent_id`,
`label_name`,
`enable_flag`,
`create_time`,
`update_time`
from tb_cf_label
WHERE 1=1
<if
test=
"name != null and name.trim() != ''"
>
AND name LIKE concat('%',#{name},'%')
</if>
<choose>
<when
test=
"sidx != null and sidx.trim() != ''"
>
order by ${sidx} ${order}
</when>
<otherwise>
order by id desc
</otherwise>
</choose>
<if
test=
"offset != null and limit != null"
>
limit #{offset}, #{limit}
</if>
</select>
<select
id=
"queryParentLabels"
resultType=
"com.platform.entity.TbCfLabelEntity"
>
select
`id`,
`parent_id`,
`label_name`,
`enable_flag`,
`create_time`,
`update_time`
from tb_cf_label
WHERE 1=1
<if
test=
"name != null and name.trim() != ''"
>
AND name LIKE concat('%',#{name},'%')
</if>
<choose>
<when
test=
"sidx != null and sidx.trim() != ''"
>
order by ${sidx} ${order}
</when>
<otherwise>
order by id desc
</otherwise>
</choose>
<if
test=
"offset != null and limit != null"
>
limit #{offset}, #{limit}
</if>
WHERE parent_id=#{parentId}
</select>
<select
id=
"queryTotal"
resultType=
"int"
>
select count(*) from tb_cf_label
WHERE 1=1
<select
id=
"queryTotal"
resultType=
"int"
>
select count(*) from tb_cf_label
WHERE 1=1
<if
test=
"name != null and name.trim() != ''"
>
AND name LIKE concat('%',#{name},'%')
</if>
</select>
<insert
id=
"save"
parameterType=
"com.platform.entity.TbCfLabelEntity"
>
</select>
<insert
id=
"save"
parameterType=
"com.platform.entity.TbCfLabelEntity"
>
insert into tb_cf_label(
`id`,
`parent_id`,
`label_name`,
`enable_flag`,
`create_time`,
`update_time`)
values(
#{id},
#{parentId},
#{labelName},
#{enableFlag},
#{createTime},
#{updateTime})
</insert>
<update
id=
"update"
parameterType=
"com.platform.entity.TbCfLabelEntity"
>
update tb_cf_label
<set>
<if
test=
"labelName != null"
>
`label_name` = #{labelName},
</if>
<if
test=
"enableFlag != null"
>
`enable_flag` = #{enableFlag},
</if>
<if
test=
"createTime != null"
>
`create_time` = #{createTime},
</if>
<if
test=
"updateTime != null"
>
`update_time` = #{updateTime}
</if>
</set>
where id = #{id}
</update>
<delete
id=
"delete"
>
<update
id=
"update"
parameterType=
"com.platform.entity.TbCfLabelEntity"
>
update tb_cf_label
<set>
<if
test=
"parentId != null"
>
`parent_id` = #{parentId},
</if>
<if
test=
"labelName != null"
>
`label_name` = #{labelName},
</if>
<if
test=
"enableFlag != null"
>
`enable_flag` = #{enableFlag},
</if>
<if
test=
"createTime != null"
>
`create_time` = #{createTime},
</if>
<if
test=
"updateTime != null"
>
`update_time` = #{updateTime}
</if>
</set>
where id = #{id}
</update>
<delete
id=
"delete"
>
delete from tb_cf_label where id = #{value}
</delete>
<delete
id=
"deleteBatch"
>
delete from tb_cf_label where id in
<foreach
item=
"id"
collection=
"array"
open=
"("
separator=
","
close=
")"
>
#{id}
</foreach>
</delete>
<delete
id=
"deleteBatch"
>
delete from tb_cf_label where id in
<foreach
item=
"id"
collection=
"array"
open=
"("
separator=
","
close=
")"
>
#{id}
</foreach>
</delete>
</mapper>
\ No newline at end of file
platform-admin/src/main/webapp/WEB-INF/page/sys/tbcflabel.html
浏览文件 @
c8981712
...
...
@@ -6,7 +6,7 @@
</head>
<body>
<div
id=
"rrapp"
v-cloak
style=
"height: calc(100% - 15px);"
>
<div
v-show=
"showList"
style=
"height: 100%;"
>
<div
v-show=
"showList"
style=
"height: 100%;"
>
<Row
:gutter=
"16"
>
<div
class=
"search-group"
>
<i-col
span=
"4"
>
...
...
@@ -27,26 +27,36 @@
#end
</div>
</Row>
<table
id=
"jqGrid"
></table>
<table
id=
"jqGrid"
></table>
</div>
<Card
v-show=
"!showList"
>
<p
slot=
"title"
>
{{title}}
</p>
<i-form
ref=
"formValidate"
:model=
"tbCfLabel"
:rules=
"ruleValidate"
:label-width=
"80"
>
<i-form
ref=
"formValidate"
:model=
"tbCfLabel"
:rules=
"ruleValidate"
:label-width=
"80"
>
<!-- <Form-item label="标签组名" prop="parentId">
<i-input v-model="tbCfLabel.parentId" placeholder="父标签ID,如果没有父标签,则为:0"/>
</Form-item>-->
<Form-item
label=
"标签组名"
prop=
"parentId"
>
<i-select
placeholder=
"请选择"
v-model=
"tbCfLabel.parentId"
>
<i-option
v-for=
"(el,i) in labelList"
:key=
'el.id'
:value=
"el.id"
>
{{el.labelName}}
</i-option>
</i-select>
</Form-item>
<Form-item
label=
"标签名"
prop=
"labelName"
>
<i-input
v-model=
"tbCfLabel.labelName"
placeholder=
"标签名"
/>
</Form-item>
<Form-item
label=
"是否启用"
prop=
"enableFlag"
>
<i-input
v-model=
"tbCfLabel.enableFlag"
placeholder=
"是否启用 0:不启用 1:启用"
/>
</Form-item>
<Form-item>
<i-button
type=
"primary"
@
click=
"handleSubmit('formValidate')"
>
提交
</i-button>
<i-button
type=
"warning"
@
click=
"reload"
style=
"margin-left: 8px"
/>
返回
</i-button>
<i-button
type=
"warning"
@
click=
"reload"
style=
"margin-left: 8px"
/>
返回
</i-button>
<i-button
type=
"ghost"
@
click=
"handleReset('formValidate')"
style=
"margin-left: 8px"
>
重置
</i-button>
</Form-item>
</i-form>
</Card>
</Card>
</div>
<script
src=
"${rc.contextPath}/js/sys/tbcflabel.js?_${date.systemTime}"
></script>
...
...
platform-admin/src/main/webapp/js/sys/tbcflabel.js
浏览文件 @
c8981712
...
...
@@ -3,8 +3,9 @@ $(function () {
url
:
'../tbcflabel/list'
,
colModel
:
[
{
label
:
'id'
,
name
:
'id'
,
index
:
'id'
,
key
:
true
,
hidden
:
true
},
/*{label: '标签组名', name: 'parentId', index: 'parent_id', width: 80},*/
{
label
:
'标签名'
,
name
:
'labelName'
,
index
:
'label_name'
,
width
:
80
},
{
label
:
'是否启用'
,
name
:
'enableFlag'
,
index
:
'enable_flag'
,
width
:
80
,
formatter
:
validFormat
},
{
label
:
'是否启用'
,
name
:
'enableFlag'
,
index
:
'enable_flag'
,
width
:
80
,
formatter
:
validFormat
},
{
label
:
'创建时间'
,
name
:
'createTime'
,
index
:
'create_time'
,
width
:
80
}
]
});
...
...
@@ -13,6 +14,7 @@ $(function () {
let
vm
=
new
Vue
({
el
:
'#rrapp'
,
data
:
{
labelList
:
null
,
showList
:
true
,
title
:
null
,
tbCfLabel
:
{},
...
...
@@ -110,5 +112,14 @@ let vm = new Vue({
handleReset
:
function
(
name
)
{
handleResetForm
(
this
,
name
);
}
},
created
(){
$
.
get
(
'../tbcflabel/queryParentLabels'
,
res
=>
{
this
.
labelList
=
JSON
.
parse
(
res
).
list
;
this
.
labelList
.
unshift
({
id
:
"0"
,
labelName
:
"标签组"
,
})
})
}
});
\ No newline at end of file
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论