mirror of
https://gitee.com/ssssssss-team/magic-boot.git
synced 2026-04-26 00:00:04 +08:00
字典项 添加上移下移功能,修复样式
This commit is contained in:
@@ -5,7 +5,7 @@
|
||||
"groupId" : "c7ce65f5b3cf4aaa913f6fec7d35d176",
|
||||
"name" : "列表",
|
||||
"createTime" : null,
|
||||
"updateTime" : 1646552464246,
|
||||
"updateTime" : 1649169225411,
|
||||
"lock" : "0",
|
||||
"createBy" : null,
|
||||
"updateBy" : null,
|
||||
@@ -119,7 +119,7 @@
|
||||
}
|
||||
================================
|
||||
return db.page("""
|
||||
select id,dict_type,desc_ribe,type,remarks,sort from sys_dict
|
||||
select id,dict_type,desc_ribe,type,remarks,create_date from sys_dict
|
||||
where is_del = 0
|
||||
?{type, and type like concat('%',#{type},'%')}
|
||||
?{dictType, and dict_type = #{dictType}}
|
||||
|
||||
@@ -0,0 +1,46 @@
|
||||
{
|
||||
"properties" : { },
|
||||
"id" : "08f29d784ed94b318ea2209997b6d426",
|
||||
"script" : null,
|
||||
"groupId" : "376f26eb43a44a3daeafd27020a96f48",
|
||||
"name" : "上移",
|
||||
"createTime" : null,
|
||||
"updateTime" : 1649170147768,
|
||||
"lock" : null,
|
||||
"createBy" : null,
|
||||
"updateBy" : null,
|
||||
"path" : "/sort/up",
|
||||
"method" : "GET",
|
||||
"parameters" : [ ],
|
||||
"options" : [ ],
|
||||
"requestBody" : "",
|
||||
"headers" : [ ],
|
||||
"paths" : [ ],
|
||||
"responseBody" : null,
|
||||
"description" : null,
|
||||
"requestBodyDefinition" : null,
|
||||
"responseBodyDefinition" : null
|
||||
}
|
||||
================================
|
||||
var top = db.selectOne("""
|
||||
SELECT
|
||||
id,
|
||||
sort
|
||||
FROM
|
||||
sys_dict_items
|
||||
WHERE
|
||||
is_del = 0
|
||||
and dict_id = #{dictId}
|
||||
AND sort < ( SELECT sort FROM sys_dict_items WHERE is_del = 0 AND id = #{id} )
|
||||
ORDER BY
|
||||
sort DESC
|
||||
LIMIT 1
|
||||
""")
|
||||
if(top){
|
||||
db.update("""
|
||||
update sys_dict_items set sort = #{top.sort} where id = #{id}
|
||||
""")
|
||||
db.update("""
|
||||
update sys_dict_items set sort = #{sort} where id = #{top.id}
|
||||
""")
|
||||
}
|
||||
@@ -0,0 +1,46 @@
|
||||
{
|
||||
"properties" : { },
|
||||
"id" : "3cc33992bf1b4ad38223da5ae302ce79",
|
||||
"script" : null,
|
||||
"groupId" : "376f26eb43a44a3daeafd27020a96f48",
|
||||
"name" : "下移",
|
||||
"createTime" : null,
|
||||
"updateTime" : 1649170144718,
|
||||
"lock" : null,
|
||||
"createBy" : null,
|
||||
"updateBy" : null,
|
||||
"path" : "/sort/down",
|
||||
"method" : "GET",
|
||||
"parameters" : [ ],
|
||||
"options" : [ ],
|
||||
"requestBody" : "",
|
||||
"headers" : [ ],
|
||||
"paths" : [ ],
|
||||
"responseBody" : null,
|
||||
"description" : null,
|
||||
"requestBodyDefinition" : null,
|
||||
"responseBodyDefinition" : null
|
||||
}
|
||||
================================
|
||||
var top = db.selectOne("""
|
||||
SELECT
|
||||
id,
|
||||
sort
|
||||
FROM
|
||||
sys_dict_items
|
||||
WHERE
|
||||
is_del = 0
|
||||
and dict_id = #{dictId}
|
||||
AND sort > ( SELECT sort FROM sys_dict_items WHERE is_del = 0 AND id = #{id} )
|
||||
ORDER BY
|
||||
sort
|
||||
LIMIT 1
|
||||
""")
|
||||
if(top){
|
||||
db.update("""
|
||||
update sys_dict_items set sort = #{top.sort} where id = #{id}
|
||||
""")
|
||||
db.update("""
|
||||
update sys_dict_items set sort = #{sort} where id = #{top.id}
|
||||
""")
|
||||
}
|
||||
@@ -5,7 +5,7 @@
|
||||
"groupId" : "376f26eb43a44a3daeafd27020a96f48",
|
||||
"name" : "列表",
|
||||
"createTime" : null,
|
||||
"updateTime" : 1646552463663,
|
||||
"updateTime" : 1649169185265,
|
||||
"lock" : "0",
|
||||
"createBy" : null,
|
||||
"updateBy" : null,
|
||||
@@ -232,5 +232,5 @@ return db.page("""
|
||||
?{label, and label like concat('%',#{label},'%')}
|
||||
?{dictId, and dict_id = #{dictId}}
|
||||
?{value, and value like concat('%',#{value},'%')}
|
||||
order by create_date desc
|
||||
order by sort
|
||||
""")
|
||||
@@ -1,25 +0,0 @@
|
||||
{
|
||||
"properties" : { },
|
||||
"id" : "247133030553488a8871aa47b9f5e76c",
|
||||
"script" : null,
|
||||
"groupId" : "c7ce65f5b3cf4aaa913f6fec7d35d176",
|
||||
"name" : "获取排序号",
|
||||
"createTime" : 1646490239435,
|
||||
"updateTime" : 1634735056733,
|
||||
"lock" : "0",
|
||||
"createBy" : null,
|
||||
"updateBy" : null,
|
||||
"path" : "/sort",
|
||||
"method" : "GET",
|
||||
"parameters" : [ ],
|
||||
"options" : [ ],
|
||||
"requestBody" : "",
|
||||
"headers" : [ ],
|
||||
"paths" : [ ],
|
||||
"responseBody" : null,
|
||||
"description" : null,
|
||||
"requestBodyDefinition" : null,
|
||||
"responseBodyDefinition" : null
|
||||
}
|
||||
================================
|
||||
return db.selectInt("""select max(sort) + 10 from sys_dict where is_del = '0'""") || 10;
|
||||
Reference in New Issue
Block a user