组件管理

This commit is contained in:
吕金泽 2022-03-05 10:28:20 +08:00
parent d9beca5433
commit 84b4df338b
6 changed files with 377 additions and 0 deletions

View File

@ -0,0 +1,10 @@
{
"properties" : { },
"id" : "6f106ebdee21489db34b956f7770ff03",
"name" : "组件",
"type" : "1",
"parentId" : "02df51e4d7184780a98b632f43dc5848",
"path" : "/component",
"paths" : [ ],
"options" : [ ]
}

View File

@ -0,0 +1,26 @@
{
"properties" : { },
"id" : "7879aae4cb5f40969b7de3db0dc4307c",
"script" : null,
"groupId" : "6f106ebdee21489db34b956f7770ff03",
"name" : "保存",
"createTime" : null,
"updateTime" : 1646401456776,
"lock" : "0",
"method" : "POST",
"path" : "/save",
"parameters" : [ ],
"option" : "[{\"name\":\"wrap_request_parameter\",\"value\":\"data\",\"description\":\"包装请求参数到一个变量中\"}]",
"requestBody" : "",
"headers" : [ ],
"paths" : [ ],
"responseBody" : null,
"description" : null,
"requestBodyDefinition" : null,
"responseBodyDefinition" : null,
"optionMap" : {
"wrap_request_parameter" : "data"
}
}
================================
return db.table("sys_component").primary("id").saveOrUpdate(data)

View File

@ -0,0 +1,27 @@
{
"properties" : { },
"id" : "56ed96789b1e4b649265da83a7b3b8b4",
"script" : null,
"groupId" : "6f106ebdee21489db34b956f7770ff03",
"name" : "列表",
"createTime" : null,
"updateTime" : 1646401619732,
"lock" : "0",
"method" : "GET",
"path" : "/list",
"parameters" : [ ],
"option" : "[]",
"requestBody" : "",
"headers" : [ ],
"paths" : [ ],
"responseBody" : null,
"description" : null,
"requestBodyDefinition" : null,
"responseBodyDefinition" : null,
"optionMap" : { }
}
================================
return db.page("""
select * from sys_component where 1=1
?{name, and name like concat('%',#{name},'%')}
""")

View File

@ -0,0 +1,24 @@
{
"properties" : { },
"id" : "529cbe774ebe4565b091a30e806a5085",
"script" : null,
"groupId" : "6f106ebdee21489db34b956f7770ff03",
"name" : "删除",
"createTime" : null,
"updateTime" : 1646401575406,
"lock" : "0",
"method" : "POST",
"path" : "/delete",
"parameters" : [ ],
"option" : "[]",
"requestBody" : "",
"headers" : [ ],
"paths" : [ ],
"responseBody" : null,
"description" : null,
"requestBodyDefinition" : null,
"responseBodyDefinition" : null,
"optionMap" : { }
}
================================
return db.table("sys_component").logic().where().eq("id",id).delete()

View File

@ -0,0 +1,192 @@
{
"properties" : { },
"id" : "59ce5de20a8b46599cb72c164a9500d1",
"script" : null,
"groupId" : "6f106ebdee21489db34b956f7770ff03",
"name" : "详情",
"createTime" : null,
"updateTime" : 1646401567689,
"lock" : "0",
"method" : "GET",
"path" : "/get",
"parameters" : [ ],
"option" : "[]",
"requestBody" : "",
"headers" : [ ],
"paths" : [ ],
"responseBody" : "{\n \"code\": 200,\n \"message\": \"success\",\n \"data\": {\n \"id\": \"1\",\n \"name\": \"TestCode\",\n \"code\": \"\\r\\n <template>\\r\\n <div class=\\\"aaa\\\">\\r\\n {{ msg }}\\r\\n <el-button type=\\\"primary\\\" @click=\\\"$emit('xxClick')\\\">阿斯顿发</el-button>\\r\\n {{ props.aaaaaa }}\\r\\n </div>\\r\\n </template>\\r\\n\\r\\n <script setup>\\r\\n const msg = '11111'\\r\\n const props = defineProps({\\r\\n aaaaaa: String\\r\\n })\\r\\n </script>\\r\\n\\r\\n <style scoped>\\r\\n .aaa{\\r\\n font-size: 30px;\\r\\n color: red;\\r\\n }\\r\\n </style>\\r\\n\",\n \"isDel\": 0,\n \"createBy\": null,\n \"createDate\": null,\n \"updateBy\": null,\n \"updateDate\": null\n },\n \"timestamp\": 1646401557066,\n \"executeTime\": 45\n}",
"description" : null,
"requestBodyDefinition" : null,
"responseBodyDefinition" : {
"name" : "",
"value" : "",
"description" : "",
"required" : false,
"dataType" : "Object",
"type" : null,
"defaultValue" : null,
"validateType" : "",
"error" : "",
"expression" : "",
"children" : [ {
"name" : "code",
"value" : "200",
"description" : "",
"required" : false,
"dataType" : "Integer",
"type" : null,
"defaultValue" : null,
"validateType" : "",
"error" : "",
"expression" : "",
"children" : [ ]
}, {
"name" : "message",
"value" : "success",
"description" : "",
"required" : false,
"dataType" : "String",
"type" : null,
"defaultValue" : null,
"validateType" : "",
"error" : "",
"expression" : "",
"children" : [ ]
}, {
"name" : "data",
"value" : "",
"description" : "",
"required" : false,
"dataType" : "Object",
"type" : null,
"defaultValue" : null,
"validateType" : "",
"error" : "",
"expression" : "",
"children" : [ {
"name" : "id",
"value" : "1",
"description" : "",
"required" : false,
"dataType" : "String",
"type" : null,
"defaultValue" : null,
"validateType" : "",
"error" : "",
"expression" : "",
"children" : [ ]
}, {
"name" : "name",
"value" : "TestCode",
"description" : "",
"required" : false,
"dataType" : "String",
"type" : null,
"defaultValue" : null,
"validateType" : "",
"error" : "",
"expression" : "",
"children" : [ ]
}, {
"name" : "code",
"value" : "\\r\\n <template>\\r\\n <div class=\\\"aaa\\\">\\r\\n {{ msg }}\\r\\n <el-button type=\\\"primary\\\" @click=\\\"$emit('xxClick')\\\">阿斯顿发</el-button>\\r\\n {{ props.aaaaaa }}\\r\\n </div>\\r\\n </template>\\r\\n\\r\\n <script setup>\\r\\n const msg = '11111'\\r\\n const props = defineProps({\\r\\n aaaaaa: String\\r\\n })\\r\\n </script>\\r\\n\\r\\n <style scoped>\\r\\n .aaa{\\r\\n font-size: 30px;\\r\\n color: red;\\r\\n }\\r\\n </style>\\r\\n",
"description" : "",
"required" : false,
"dataType" : "String",
"type" : null,
"defaultValue" : null,
"validateType" : "",
"error" : "",
"expression" : "",
"children" : [ ]
}, {
"name" : "isDel",
"value" : "0",
"description" : "",
"required" : false,
"dataType" : "Integer",
"type" : null,
"defaultValue" : null,
"validateType" : "",
"error" : "",
"expression" : "",
"children" : [ ]
}, {
"name" : "createBy",
"value" : "null",
"description" : "",
"required" : false,
"dataType" : "Object",
"type" : null,
"defaultValue" : null,
"validateType" : "",
"error" : "",
"expression" : "",
"children" : [ ]
}, {
"name" : "createDate",
"value" : "null",
"description" : "",
"required" : false,
"dataType" : "Object",
"type" : null,
"defaultValue" : null,
"validateType" : "",
"error" : "",
"expression" : "",
"children" : [ ]
}, {
"name" : "updateBy",
"value" : "null",
"description" : "",
"required" : false,
"dataType" : "Object",
"type" : null,
"defaultValue" : null,
"validateType" : "",
"error" : "",
"expression" : "",
"children" : [ ]
}, {
"name" : "updateDate",
"value" : "null",
"description" : "",
"required" : false,
"dataType" : "Object",
"type" : null,
"defaultValue" : null,
"validateType" : "",
"error" : "",
"expression" : "",
"children" : [ ]
} ]
}, {
"name" : "timestamp",
"value" : "1646401557066",
"description" : "",
"required" : false,
"dataType" : "Long",
"type" : null,
"defaultValue" : null,
"validateType" : "",
"error" : "",
"expression" : "",
"children" : [ ]
}, {
"name" : "executeTime",
"value" : "45",
"description" : "",
"required" : false,
"dataType" : "Integer",
"type" : null,
"defaultValue" : null,
"validateType" : "",
"error" : "",
"expression" : "",
"children" : [ ]
} ]
},
"optionMap" : { }
}
================================
return db.table("sys_component").where().eq("id",id).selectOne()

View File

@ -0,0 +1,98 @@
{
"properties" : { },
"id" : "eb2b08bc7fe74036867e8dc5f2c0e8f8",
"script" : null,
"groupId" : "6f106ebdee21489db34b956f7770ff03",
"name" : "选择组件",
"createTime" : null,
"updateTime" : 1646402724502,
"lock" : "0",
"method" : "GET",
"path" : "/select",
"parameters" : [ ],
"option" : "[]",
"requestBody" : "",
"headers" : [ ],
"paths" : [ ],
"responseBody" : "{\n \"code\": 1,\n \"message\": \"success\",\n \"data\": null,\n \"timestamp\": 1646402708142,\n \"executeTime\": 2\n}",
"description" : null,
"requestBodyDefinition" : null,
"responseBodyDefinition" : {
"name" : "",
"value" : "",
"description" : "",
"required" : false,
"dataType" : "Object",
"type" : null,
"defaultValue" : null,
"validateType" : "",
"error" : "",
"expression" : "",
"children" : [ {
"name" : "code",
"value" : "1",
"description" : "",
"required" : false,
"dataType" : "Integer",
"type" : null,
"defaultValue" : null,
"validateType" : "",
"error" : "",
"expression" : "",
"children" : [ ]
}, {
"name" : "message",
"value" : "success",
"description" : "",
"required" : false,
"dataType" : "String",
"type" : null,
"defaultValue" : null,
"validateType" : "",
"error" : "",
"expression" : "",
"children" : [ ]
}, {
"name" : "data",
"value" : "null",
"description" : "",
"required" : false,
"dataType" : "Object",
"type" : null,
"defaultValue" : null,
"validateType" : "",
"error" : "",
"expression" : "",
"children" : [ ]
}, {
"name" : "timestamp",
"value" : "1646402708142",
"description" : "",
"required" : false,
"dataType" : "Long",
"type" : null,
"defaultValue" : null,
"validateType" : "",
"error" : "",
"expression" : "",
"children" : [ ]
}, {
"name" : "executeTime",
"value" : "2",
"description" : "",
"required" : false,
"dataType" : "Integer",
"type" : null,
"defaultValue" : null,
"validateType" : "",
"error" : "",
"expression" : "",
"children" : [ ]
} ]
},
"optionMap" : { }
}
================================
return db.select("""
select id value,name label from sys_component where is_del = 0
""")