From 8774b5f8269d784b06c114cc742092641a2a2f8e Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?=E5=90=95=E9=87=91=E6=B3=BD?= <1098696801@qq.com>
Date: Wed, 23 Mar 2022 21:00:30 +0800
Subject: [PATCH] =?UTF-8?q?=E4=BB=A3=E7=A0=81=E7=94=9F=E6=88=90=E7=9B=B8?=
=?UTF-8?q?=E5=85=B3=E4=BB=A3=E7=A0=81?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
data/magic-api/api/后台/代码生成/列表.ms | 163 ++++++++++++++++++
.../magic/basic/mb-editor-table.vue | 5 +
.../src/components/magic/form/mb-select.vue | 9 +-
magic-boot-ui/src/scripts/gen/gen-mb-list.js | 91 ++++++++++
.../src/views/examples/editor-table.vue | 1 +
5 files changed, 268 insertions(+), 1 deletion(-)
create mode 100644 data/magic-api/api/后台/代码生成/列表.ms
create mode 100644 magic-boot-ui/src/scripts/gen/gen-mb-list.js
diff --git a/data/magic-api/api/后台/代码生成/列表.ms b/data/magic-api/api/后台/代码生成/列表.ms
new file mode 100644
index 0000000..096487c
--- /dev/null
+++ b/data/magic-api/api/后台/代码生成/列表.ms
@@ -0,0 +1,163 @@
+{
+ "properties" : { },
+ "id" : "1d0adb4921c2443f83ea84c202d0a9b5",
+ "script" : null,
+ "groupId" : "f2538e0f370a4cabab0ae920f5e77ae7",
+ "name" : "列表",
+ "createTime" : null,
+ "updateTime" : 1647563302987,
+ "lock" : null,
+ "createBy" : null,
+ "updateBy" : null,
+ "path" : "/list",
+ "method" : "POST",
+ "parameters" : [ ],
+ "options" : [ ],
+ "requestBody" : "",
+ "headers" : [ ],
+ "paths" : [ ],
+ "responseBody" : "{\n \"code\": 200,\n \"message\": \"success\",\n \"data\": {\n \"list\": [{\n \"tableName\": \"sys_user\",\n \"tableComment\": \"用户表\"\n }],\n \"total\": 1\n },\n \"timestamp\": 1647563302700,\n \"executeTime\": 8\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" : "Array",
+ "type" : null,
+ "defaultValue" : null,
+ "validateType" : "",
+ "error" : "",
+ "expression" : "",
+ "children" : [ {
+ "name" : "list",
+ "value" : "",
+ "description" : "",
+ "required" : false,
+ "dataType" : "Array",
+ "type" : null,
+ "defaultValue" : null,
+ "validateType" : "",
+ "error" : "",
+ "expression" : "",
+ "children" : [ {
+ "name" : "",
+ "value" : "",
+ "description" : "",
+ "required" : false,
+ "dataType" : "Object",
+ "type" : null,
+ "defaultValue" : null,
+ "validateType" : "",
+ "error" : "",
+ "expression" : "",
+ "children" : [ {
+ "name" : "tableName",
+ "value" : "sys_user",
+ "description" : "",
+ "required" : false,
+ "dataType" : "String",
+ "type" : null,
+ "defaultValue" : null,
+ "validateType" : "",
+ "error" : "",
+ "expression" : "",
+ "children" : [ ]
+ }, {
+ "name" : "tableComment",
+ "value" : "用户表",
+ "description" : "",
+ "required" : false,
+ "dataType" : "String",
+ "type" : null,
+ "defaultValue" : null,
+ "validateType" : "",
+ "error" : "",
+ "expression" : "",
+ "children" : [ ]
+ } ]
+ } ]
+ }, {
+ "name" : "total",
+ "value" : "1",
+ "description" : "",
+ "required" : false,
+ "dataType" : "Integer",
+ "type" : null,
+ "defaultValue" : null,
+ "validateType" : "",
+ "error" : "",
+ "expression" : "",
+ "children" : [ ]
+ } ]
+ }, {
+ "name" : "timestamp",
+ "value" : "1647563302700",
+ "description" : "",
+ "required" : false,
+ "dataType" : "Long",
+ "type" : null,
+ "defaultValue" : null,
+ "validateType" : "",
+ "error" : "",
+ "expression" : "",
+ "children" : [ ]
+ }, {
+ "name" : "executeTime",
+ "value" : "8",
+ "description" : "",
+ "required" : false,
+ "dataType" : "Integer",
+ "type" : null,
+ "defaultValue" : null,
+ "validateType" : "",
+ "error" : "",
+ "expression" : "",
+ "children" : [ ]
+ } ]
+ }
+}
+================================
+return {
+ list: [{
+ tableName: 'sys_user',
+ tableComment: '用户表'
+ }],
+ total: 1
+}
\ No newline at end of file
diff --git a/magic-boot-ui/src/components/magic/basic/mb-editor-table.vue b/magic-boot-ui/src/components/magic/basic/mb-editor-table.vue
index bf73ffe..918c037 100644
--- a/magic-boot-ui/src/components/magic/basic/mb-editor-table.vue
+++ b/magic-boot-ui/src/components/magic/basic/mb-editor-table.vue
@@ -43,12 +43,17 @@ const props = defineProps({
operation: {
type: Boolean,
default: true
+ },
+ page: {
+ type: Boolean,
+ default: false
}
})
const tableOptions = reactive({
data: props.modelValue,
cols: [],
+ page: props.page,
showNo: props.showNo
})
diff --git a/magic-boot-ui/src/components/magic/form/mb-select.vue b/magic-boot-ui/src/components/magic/form/mb-select.vue
index af59004..0e7d8fa 100644
--- a/magic-boot-ui/src/components/magic/form/mb-select.vue
+++ b/magic-boot-ui/src/components/magic/form/mb-select.vue
@@ -5,7 +5,10 @@
:key="item.value"
:label="item.label"
:value="item.value"
- />
+ >
+ {{ item.label }}
+ {{ item.value }}
+
@@ -69,6 +72,10 @@ const props = defineProps({
join: {
type: Boolean,
default: true
+ },
+ showValue: {
+ type: Boolean,
+ default: false
}
})
diff --git a/magic-boot-ui/src/scripts/gen/gen-mb-list.js b/magic-boot-ui/src/scripts/gen/gen-mb-list.js
new file mode 100644
index 0000000..9e98f31
--- /dev/null
+++ b/magic-boot-ui/src/scripts/gen/gen-mb-list.js
@@ -0,0 +1,91 @@
+function gen(groupPath, data){
+ var permissionPrefix = groupPath.replace('/', ':')
+ var html = `
+
+
+
+
+
+
+
+
+