From 53feaf3462165e238e99499dddd8444a94fe4721 Mon Sep 17 00:00:00 2001 From: zegezy <1098696801@qq.com> Date: Tue, 5 Mar 2024 20:42:12 +0800 Subject: [PATCH] =?UTF-8?q?=E5=8A=A8=E6=80=81=E7=BB=84=E4=BB=B6=E5=8D=87?= =?UTF-8?q?=E7=BA=A7?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- data/magic-api/api/系统管理/组件/保存tree.ms | 19 +- data/magic-api/api/系统管理/组件/保存代码.ms | 34 +++ data/magic-api/api/系统管理/组件/列表.ms | 11 +- data/magic-api/api/系统管理/组件/删除组件.ms | 37 +++ data/magic-api/api/系统管理/组件/获取源码.ms | 6 +- data/magic-api/api/系统管理/组件/选择组件.ms | 263 ------------------ .../api/系统管理/菜单管理/当前用户菜单.ms | 35 +-- 7 files changed, 109 insertions(+), 296 deletions(-) create mode 100644 data/magic-api/api/系统管理/组件/保存代码.ms create mode 100644 data/magic-api/api/系统管理/组件/删除组件.ms delete mode 100644 data/magic-api/api/系统管理/组件/选择组件.ms diff --git a/data/magic-api/api/系统管理/组件/保存tree.ms b/data/magic-api/api/系统管理/组件/保存tree.ms index 75079e3..8b6360e 100644 --- a/data/magic-api/api/系统管理/组件/保存tree.ms +++ b/data/magic-api/api/系统管理/组件/保存tree.ms @@ -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 -}) \ No newline at end of file +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) \ No newline at end of file diff --git a/data/magic-api/api/系统管理/组件/保存代码.ms b/data/magic-api/api/系统管理/组件/保存代码.ms new file mode 100644 index 0000000..01869d3 --- /dev/null +++ b/data/magic-api/api/系统管理/组件/保存代码.ms @@ -0,0 +1,34 @@ +{ + "properties" : { }, + "id" : "ac35656c8123461e8c01e5bfa604a0ee", + "script" : null, + "groupId" : "6f106ebdee21489db34b956f7770ff03", + "name" : "保存代码", + "createTime" : null, + "updateTime" : 1709621424466, + "lock" : null, + "createBy" : null, + "updateBy" : null, + "path" : "/saveCode", + "method" : "POST", + "parameters" : [ ], + "options" : [ ], + "requestBody" : "", + "headers" : [ ], + "paths" : [ ], + "responseBody" : null, + "description" : null, + "requestBodyDefinition" : null, + "responseBodyDefinition" : null +} +================================ + +if(db.selectInt("select count(1) from sys_dynamic_component where id = #{id} and is_del = 0") == 0){ + exit 0, '文件不存在' +} + +return db.table("sys_dynamic_component").where().eq("id",id).update({ + sourceCode, + compileJs, + compileCss +}) \ No newline at end of file diff --git a/data/magic-api/api/系统管理/组件/列表.ms b/data/magic-api/api/系统管理/组件/列表.ms index beccd17..20b2aaf 100644 --- a/data/magic-api/api/系统管理/组件/列表.ms +++ b/data/magic-api/api/系统管理/组件/列表.ms @@ -5,7 +5,7 @@ "groupId" : "6f106ebdee21489db34b956f7770ff03", "name" : "列表", "createTime" : null, - "updateTime" : 1648611595092, + "updateTime" : 1709626054292, "lock" : "0", "createBy" : null, "updateBy" : null, @@ -16,7 +16,7 @@ "requestBody" : "", "headers" : [ ], "paths" : [ ], - "responseBody" : "{\n \"code\": 200,\n \"message\": \"success\",\n \"data\": [{\n \"name\": \"data-test-list\",\n \"code\": \"\\n \\n