动态组件升级

This commit is contained in:
zegezy
2024-03-05 20:42:12 +08:00
parent 70be66fd66
commit 53feaf3462
7 changed files with 109 additions and 296 deletions
@@ -5,7 +5,7 @@
"groupId" : "6f106ebdee21489db34b956f7770ff03",
"name" : "保存tree",
"createTime" : null,
"updateTime" : 1709468623502,
"updateTime" : 1709539934808,
"lock" : null,
"createBy" : null,
"updateBy" : null,
@@ -22,7 +22,16 @@
"responseBodyDefinition" : null
}
================================
return db.table("sys_dynamic_component").primary("id").saveOrUpdate({
pid,
name
})
let data
if(id){
data = {id, name}
if(db.selectInt("select count(1) from sys_dynamic_component where is_del = 0 and name = #{name} and id != #{id}") > 0){
exit 0, '名称不能重复'
}
}else{
data = {pid, name}
if(db.selectInt("select count(1) from sys_dynamic_component where is_del = 0 and name = #{name}") > 0){
exit 0, '名称不能重复'
}
}
return db.table("sys_dynamic_component").primary("id").saveOrUpdate(data)