mb-list mb-form mb-xxx等 统一请求方法 列表(post) 保存(post) 删除(delete) 详情(get) 等

This commit is contained in:
吕金泽 2022-03-08 00:56:23 +08:00
parent 0f4095a564
commit 3114b2c205
58 changed files with 1017 additions and 351 deletions

View File

@ -5,7 +5,7 @@
"groupId" : "1952f25c81084e24b55b11385767dc38",
"name" : "登录",
"createTime" : null,
"updateTime" : 1646493566796,
"updateTime" : 1646544815203,
"lock" : "0",
"createBy" : null,
"updateBy" : null,

View File

@ -4,33 +4,33 @@
"script" : null,
"groupId" : "1952f25c81084e24b55b11385767dc38",
"name" : "获取当前用户权限code",
"createTime" : 1646490239409,
"updateTime" : 1645715502500,
"createTime" : null,
"updateTime" : 1646544829355,
"lock" : "0",
"createBy" : null,
"updateBy" : null,
"path" : "/permissions",
"method" : "POST",
"parameters" : [ ],
"options" : [ {
"name" : "",
"value" : "",
"description" : "",
"required" : false,
"dataType" : "String",
"type" : null,
"defaultValue" : null,
"validateType" : null,
"error" : null,
"expression" : null,
"children" : null
} ],
"options" : [ ],
"requestBody" : "{\n\n}",
"headers" : [ ],
"paths" : [ ],
"responseBody" : "{\n \"code\": 200,\n \"message\": \"success\",\n \"data\": [\"menu:view\", \"menu:save\", \"menu:delete\", \"office:save\", \"office:delete\", \"role:save\", \"role:delete\", \"role:permission\", \"user:save\", \"user:delete\", \"dict:save\", \"dict:delete\", \"dict:items:save\", \"dict:items:delete\", \"office:view\", \"role:view\", \"user:view\", \"dict:view\", \"dict:items:view\"],\n \"timestamp\": 1645715342825,\n \"executeTime\": 2\n}",
"description" : null,
"requestBodyDefinition" : null,
"requestBodyDefinition" : {
"name" : "",
"value" : "",
"description" : "",
"required" : false,
"dataType" : "Object",
"type" : null,
"defaultValue" : null,
"validateType" : "",
"error" : "",
"expression" : "",
"children" : [ ]
},
"responseBodyDefinition" : {
"name" : "",
"value" : "",

View File

@ -4,8 +4,8 @@
"script" : null,
"groupId" : "1952f25c81084e24b55b11385767dc38",
"name" : "退出登录",
"createTime" : 1646490239413,
"updateTime" : 1634724871162,
"createTime" : null,
"updateTime" : 1646544864959,
"lock" : "0",
"createBy" : null,
"updateBy" : null,

View File

@ -4,8 +4,8 @@
"script" : null,
"groupId" : "1952f25c81084e24b55b11385767dc38",
"name" : "验证token",
"createTime" : 1646490239415,
"updateTime" : 1634724871160,
"createTime" : null,
"updateTime" : 1646544867872,
"lock" : "0",
"createBy" : null,
"updateBy" : null,

View File

@ -4,13 +4,13 @@
"script" : null,
"groupId" : "c7ce65f5b3cf4aaa913f6fec7d35d176",
"name" : "列表",
"createTime" : 1646490239432,
"updateTime" : 1644121689680,
"createTime" : null,
"updateTime" : 1646552464246,
"lock" : "0",
"createBy" : null,
"updateBy" : null,
"path" : "/list",
"method" : "GET",
"method" : "POST",
"parameters" : [ ],
"options" : [ {
"name" : "permission",
@ -30,7 +30,19 @@
"paths" : [ ],
"responseBody" : "{\n \"code\": 402,\n \"message\": \"凭证已过期\",\n \"data\": null,\n \"timestamp\": 1634734488837,\n \"executeTime\": null\n}",
"description" : null,
"requestBodyDefinition" : null,
"requestBodyDefinition" : {
"name" : "",
"value" : "",
"description" : "",
"required" : false,
"dataType" : "Object",
"type" : null,
"defaultValue" : null,
"validateType" : "",
"error" : "",
"expression" : "",
"children" : [ ]
},
"responseBodyDefinition" : {
"name" : "",
"value" : "",

View File

@ -4,13 +4,13 @@
"script" : null,
"groupId" : "c7ce65f5b3cf4aaa913f6fec7d35d176",
"name" : "删除",
"createTime" : 1646490239434,
"updateTime" : 1644121690359,
"createTime" : null,
"updateTime" : 1646553112581,
"lock" : "0",
"createBy" : null,
"updateBy" : null,
"path" : "/delete",
"method" : "POST",
"method" : "DELETE",
"parameters" : [ ],
"options" : [ {
"name" : "permission",
@ -30,7 +30,19 @@
"paths" : [ ],
"responseBody" : null,
"description" : null,
"requestBodyDefinition" : null,
"requestBodyDefinition" : {
"name" : "",
"value" : "",
"description" : "",
"required" : false,
"dataType" : "Object",
"type" : null,
"defaultValue" : null,
"validateType" : "",
"error" : "",
"expression" : "",
"children" : [ ]
},
"responseBodyDefinition" : null
}
================================

View File

@ -4,13 +4,13 @@
"script" : null,
"groupId" : "376f26eb43a44a3daeafd27020a96f48",
"name" : "列表",
"createTime" : 1646490239439,
"updateTime" : 1644121692556,
"createTime" : null,
"updateTime" : 1646552463663,
"lock" : "0",
"createBy" : null,
"updateBy" : null,
"path" : "/list",
"method" : "GET",
"method" : "POST",
"parameters" : [ ],
"options" : [ {
"name" : "permission",
@ -30,7 +30,19 @@
"paths" : [ ],
"responseBody" : "{\n \"code\": 200,\n \"message\": \"success\",\n \"data\": {\n \"total\": 17,\n \"list\": [\n {\n \"id\": \"56aee220-cb12-4bb2-8453-84ee49672193\",\n \"value\": \"3\",\n \"label\": \"3\",\n \"dictId\": \"4b9b4a7e-25a1-4efa-ab9a-a004f203f1f4\",\n \"remarks\": \"\",\n \"sort\": 30\n },\n {\n \"id\": \"6a127863-8130-48be-88bf-e5179f5c33e6\",\n \"value\": \"2\",\n \"label\": \"2\",\n \"dictId\": \"4b9b4a7e-25a1-4efa-ab9a-a004f203f1f4\",\n \"remarks\": \"\",\n \"sort\": 20\n },\n {\n \"id\": \"f19152f4-dd72-4509-a350-af70d802dcdf\",\n \"value\": \"1\",\n \"label\": \"1\",\n \"dictId\": \"4b9b4a7e-25a1-4efa-ab9a-a004f203f1f4\",\n \"remarks\": \"\",\n \"sort\": 10\n },\n {\n \"id\": \"ac1ee828-62e1-42fd-9d18-cf37203855b2\",\n \"value\": \"12\",\n \"label\": \"12\",\n \"dictId\": \"3c393981-9ddd-40b2-8c19-85f0a9d9a98f\",\n \"remarks\": \"\",\n \"sort\": 30\n },\n {\n \"id\": \"457517be-5245-4d98-b9fa-8b6753a9cfc6\",\n \"value\": \"2\",\n \"label\": \"公司\",\n \"dictId\": \"3c393981-9ddd-40b2-8c19-85f0a9d9a98f\",\n \"remarks\": \"\",\n \"sort\": 20\n },\n {\n \"id\": \"b928f5b1-07bd-4f09-9142-897c767c5303\",\n \"value\": \"1\",\n \"label\": \"部门\",\n \"dictId\": \"3c393981-9ddd-40b2-8c19-85f0a9d9a98f\",\n \"remarks\": \"\",\n \"sort\": 10\n },\n {\n \"id\": \"0f91de6e8406d59762bebe5d2dfc9d36\",\n \"value\": \"0\",\n \"label\": \"不禁用\",\n \"dictId\": \"ae9a2cd400264ff6bdc2f00b62d6e941\",\n \"remarks\": null,\n \"sort\": 0\n },\n {\n \"id\": \"c5cf8715a74537156ea29c8bbc622b05\",\n \"value\": \"1\",\n \"label\": \"禁用\",\n \"dictId\": \"ae9a2cd400264ff6bdc2f00b62d6e941\",\n \"remarks\": null,\n \"sort\": 0\n },\n {\n \"id\": \"ze9a2cd400264ff6bdc2f00b62d6e911\",\n \"value\": \"0\",\n \"label\": \"系统类\",\n \"dictId\": \"ae9a2cd400264ff6bdc2f00b62d6e911\",\n \"remarks\": null,\n \"sort\": 0\n },\n {\n \"id\": \"ze9a2cd400264ff6bdc2f00b62d6e910\",\n \"value\": \"1\",\n \"label\": \"业务类\",\n \"dictId\": \"ae9a2cd400264ff6bdc2f00b62d6e911\",\n \"remarks\": null,\n \"sort\": 0\n }\n ]\n },\n \"timestamp\": 1634735383948,\n \"executeTime\": 13\n}",
"description" : null,
"requestBodyDefinition" : null,
"requestBodyDefinition" : {
"name" : "",
"value" : "",
"description" : "",
"required" : false,
"dataType" : "Object",
"type" : null,
"defaultValue" : null,
"validateType" : "",
"error" : "",
"expression" : "",
"children" : [ ]
},
"responseBodyDefinition" : {
"name" : "",
"value" : "",

View File

@ -4,13 +4,13 @@
"script" : null,
"groupId" : "376f26eb43a44a3daeafd27020a96f48",
"name" : "删除",
"createTime" : 1646490239443,
"updateTime" : 1644121693440,
"createTime" : null,
"updateTime" : 1646553109828,
"lock" : "0",
"createBy" : null,
"updateBy" : null,
"path" : "/delete",
"method" : "POST",
"method" : "DELETE",
"parameters" : [ ],
"options" : [ {
"name" : "permission",
@ -30,7 +30,19 @@
"paths" : [ ],
"responseBody" : null,
"description" : null,
"requestBodyDefinition" : null,
"requestBodyDefinition" : {
"name" : "",
"value" : "",
"description" : "",
"required" : false,
"dataType" : "Object",
"type" : null,
"defaultValue" : null,
"validateType" : "",
"error" : "",
"expression" : "",
"children" : [ ]
},
"responseBodyDefinition" : null
}
================================

View File

@ -4,13 +4,13 @@
"script" : null,
"groupId" : "fd3d225a1cf141bf9998c4ec4bf4a6ab",
"name" : "删除",
"createTime" : 1646490239453,
"updateTime" : 1643706734133,
"createTime" : null,
"updateTime" : 1646553118780,
"lock" : "0",
"createBy" : null,
"updateBy" : null,
"path" : "/delete",
"method" : "GET",
"method" : "DELETE",
"parameters" : [ ],
"options" : [ ],
"requestBody" : "",

View File

@ -4,13 +4,13 @@
"script" : null,
"groupId" : "9ec6f9ec92d24a369952bb13eddc134f",
"name" : "操作日志",
"createTime" : 1646490239460,
"updateTime" : 1646474005369,
"createTime" : null,
"updateTime" : 1646552462421,
"lock" : "0",
"createBy" : null,
"updateBy" : null,
"path" : "/oper/list",
"method" : "GET",
"method" : "POST",
"parameters" : [ ],
"options" : [ ],
"requestBody" : "",

View File

@ -5,12 +5,12 @@
"groupId" : "9ec6f9ec92d24a369952bb13eddc134f",
"name" : "登录日志",
"createTime" : null,
"updateTime" : 1646490406374,
"updateTime" : 1646552463034,
"lock" : "0",
"createBy" : null,
"updateBy" : null,
"path" : "/login/list",
"method" : "GET",
"method" : "POST",
"parameters" : [ ],
"options" : [ ],
"requestBody" : "",

View File

@ -4,13 +4,13 @@
"script" : null,
"groupId" : "42d241c0bb18476f8dabf92c2e4e2324",
"name" : "列表",
"createTime" : 1646490239464,
"updateTime" : 1642327645651,
"createTime" : null,
"updateTime" : 1646552460608,
"lock" : "0",
"createBy" : null,
"updateBy" : null,
"path" : "/list",
"method" : "GET",
"method" : "POST",
"parameters" : [ ],
"options" : [ ],
"requestBody" : "",

View File

@ -4,13 +4,13 @@
"script" : null,
"groupId" : "4f0230049d7e4f39b1e0897cc0f46f9a",
"name" : "列表",
"createTime" : 1646490239471,
"updateTime" : 1644121683184,
"createTime" : null,
"updateTime" : 1646552467748,
"lock" : "0",
"createBy" : null,
"updateBy" : null,
"path" : "/list",
"method" : "GET",
"method" : "POST",
"parameters" : [ ],
"options" : [ {
"name" : "permission",
@ -30,7 +30,19 @@
"paths" : [ ],
"responseBody" : "{\n \"code\": 402,\n \"message\": \"凭证已过期\",\n \"data\": null,\n \"timestamp\": 1643964929030,\n \"executeTime\": null\n}",
"description" : null,
"requestBodyDefinition" : null,
"requestBodyDefinition" : {
"name" : "",
"value" : "",
"description" : "",
"required" : false,
"dataType" : "Object",
"type" : null,
"defaultValue" : null,
"validateType" : "",
"error" : "",
"expression" : "",
"children" : [ ]
},
"responseBodyDefinition" : {
"name" : "",
"value" : "",

View File

@ -5,12 +5,12 @@
"groupId" : "4f0230049d7e4f39b1e0897cc0f46f9a",
"name" : "删除",
"createTime" : null,
"updateTime" : 1646493558181,
"updateTime" : 1646553121622,
"lock" : "0",
"createBy" : null,
"updateBy" : null,
"path" : "/delete",
"method" : "POST",
"method" : "DELETE",
"parameters" : [ ],
"options" : [ {
"name" : "permission",

View File

@ -4,8 +4,8 @@
"script" : null,
"groupId" : "6f106ebdee21489db34b956f7770ff03",
"name" : "保存",
"createTime" : 1646490239481,
"updateTime" : 1646401456776,
"createTime" : null,
"updateTime" : 1646552458651,
"lock" : "0",
"createBy" : null,
"updateBy" : null,

View File

@ -4,25 +4,98 @@
"script" : null,
"groupId" : "6f106ebdee21489db34b956f7770ff03",
"name" : "列表",
"createTime" : 1646490239482,
"updateTime" : 1646401619732,
"createTime" : null,
"updateTime" : 1646552470091,
"lock" : "0",
"createBy" : null,
"updateBy" : null,
"path" : "/list",
"method" : "GET",
"method" : "POST",
"parameters" : [ ],
"options" : [ ],
"requestBody" : "",
"headers" : [ ],
"paths" : [ ],
"responseBody" : null,
"responseBody" : "{\"code\":402,\"message\":\"凭证已过期\",\"data\":null,\"timestamp\":1646545653430,\"executeTime\":null}",
"description" : null,
"requestBodyDefinition" : null,
"responseBodyDefinition" : null
"responseBodyDefinition" : {
"name" : "",
"value" : "",
"description" : "",
"required" : false,
"dataType" : "Object",
"type" : null,
"defaultValue" : null,
"validateType" : "",
"error" : "",
"expression" : "",
"children" : [ {
"name" : "code",
"value" : "402",
"description" : "",
"required" : false,
"dataType" : "Integer",
"type" : null,
"defaultValue" : null,
"validateType" : "",
"error" : "",
"expression" : "",
"children" : [ ]
}, {
"name" : "message",
"value" : "凭证已过期",
"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" : "1646545653430",
"description" : "",
"required" : false,
"dataType" : "Long",
"type" : null,
"defaultValue" : null,
"validateType" : "",
"error" : "",
"expression" : "",
"children" : [ ]
}, {
"name" : "executeTime",
"value" : "null",
"description" : "",
"required" : false,
"dataType" : "Object",
"type" : null,
"defaultValue" : null,
"validateType" : "",
"error" : "",
"expression" : "",
"children" : [ ]
} ]
}
}
================================
return db.page("""
select * from sys_component where 1=1
?{name, and name like concat('%',#{name},'%')}
?{descRibe, and desc_ribe like concat('%',#{descRibe},'%')}
""")

View File

@ -4,13 +4,13 @@
"script" : null,
"groupId" : "6f106ebdee21489db34b956f7770ff03",
"name" : "删除",
"createTime" : 1646490239484,
"updateTime" : 1646401575406,
"createTime" : null,
"updateTime" : 1646553123792,
"lock" : "0",
"createBy" : null,
"updateBy" : null,
"path" : "/delete",
"method" : "POST",
"method" : "DELETE",
"parameters" : [ ],
"options" : [ ],
"requestBody" : "",

View File

@ -4,8 +4,8 @@
"script" : null,
"groupId" : "6f106ebdee21489db34b956f7770ff03",
"name" : "详情",
"createTime" : 1646490239485,
"updateTime" : 1646401567689,
"createTime" : null,
"updateTime" : 1646552459844,
"lock" : "0",
"createBy" : null,
"updateBy" : null,
@ -16,7 +16,7 @@
"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}",
"responseBody" : "{\"code\":402,\"message\":\"凭证已过期\",\"data\":null,\"timestamp\":1646545664781,\"executeTime\":null}",
"description" : null,
"requestBodyDefinition" : null,
"responseBodyDefinition" : {
@ -32,7 +32,7 @@
"expression" : "",
"children" : [ {
"name" : "code",
"value" : "200",
"value" : "402",
"description" : "",
"required" : false,
"dataType" : "Integer",
@ -44,7 +44,7 @@
"children" : [ ]
}, {
"name" : "message",
"value" : "success",
"value" : "凭证已过期",
"description" : "",
"required" : false,
"dataType" : "String",
@ -56,7 +56,7 @@
"children" : [ ]
}, {
"name" : "data",
"value" : "",
"value" : "null",
"description" : "",
"required" : false,
"dataType" : "Object",
@ -65,106 +65,10 @@
"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" : [ ]
} ]
"children" : [ ]
}, {
"name" : "timestamp",
"value" : "1646401557066",
"value" : "1646545664781",
"description" : "",
"required" : false,
"dataType" : "Long",
@ -176,10 +80,10 @@
"children" : [ ]
}, {
"name" : "executeTime",
"value" : "45",
"value" : "null",
"description" : "",
"required" : false,
"dataType" : "Integer",
"dataType" : "Object",
"type" : null,
"defaultValue" : null,
"validateType" : "",

View File

@ -4,13 +4,13 @@
"script" : null,
"groupId" : "8295fc13678d4144bf7363c465247a50",
"name" : "删除",
"createTime" : 1646490239496,
"updateTime" : 1644121676877,
"createTime" : null,
"updateTime" : 1646553126039,
"lock" : "0",
"createBy" : null,
"updateBy" : null,
"path" : "/delete",
"method" : "POST",
"method" : "DELETE",
"parameters" : [ ],
"options" : [ {
"name" : "permission",
@ -30,7 +30,19 @@
"paths" : [ ],
"responseBody" : "{\n \"code\": 200,\n \"message\": \"success\",\n \"data\": null,\n \"timestamp\": 1641201245421,\n \"executeTime\": 7\n}",
"description" : null,
"requestBodyDefinition" : null,
"requestBodyDefinition" : {
"name" : "",
"value" : "",
"description" : "",
"required" : false,
"dataType" : "Object",
"type" : null,
"defaultValue" : null,
"validateType" : "",
"error" : "",
"expression" : "",
"children" : [ ]
},
"responseBodyDefinition" : {
"name" : "",
"value" : "",

View File

@ -5,7 +5,7 @@
"groupId" : "67b2ce258e24491194b74992958c74aa",
"name" : "保存",
"createTime" : null,
"updateTime" : 1646493564406,
"updateTime" : 1646576146705,
"lock" : "0",
"createBy" : null,
"updateBy" : null,
@ -79,4 +79,4 @@ if(data.id){
var menuId = data.id
cacheDelete();
}
return db.table("sys_menu").primary("id").saveOrUpdate(data);
return db.table("sys_menu").primary("id").withBlank().saveOrUpdate(data);

View File

@ -4,13 +4,13 @@
"script" : null,
"groupId" : "67b2ce258e24491194b74992958c74aa",
"name" : "删除",
"createTime" : 1646490239510,
"updateTime" : 1644121673352,
"createTime" : null,
"updateTime" : 1646553101301,
"lock" : "0",
"createBy" : null,
"updateBy" : null,
"path" : "/delete",
"method" : "POST",
"method" : "DELETE",
"parameters" : [ {
"name" : "id",
"value" : "b1851d1b13594e71840103c11a37a669",
@ -42,7 +42,19 @@
"paths" : [ ],
"responseBody" : "{\n \"code\": 200,\n \"message\": \"success\",\n \"data\": null,\n \"timestamp\": 1641201245421,\n \"executeTime\": 7\n}",
"description" : null,
"requestBodyDefinition" : null,
"requestBodyDefinition" : {
"name" : "",
"value" : "",
"description" : "",
"required" : false,
"dataType" : "Object",
"type" : null,
"defaultValue" : null,
"validateType" : "",
"error" : "",
"expression" : "",
"children" : [ ]
},
"responseBodyDefinition" : {
"name" : "",
"value" : "",

View File

@ -4,8 +4,8 @@
"script" : null,
"groupId" : "67b2ce258e24491194b74992958c74aa",
"name" : "根据角色获取菜单",
"createTime" : 1646490239520,
"updateTime" : 1642080927004,
"createTime" : null,
"updateTime" : 1646552458043,
"lock" : "0",
"createBy" : null,
"updateBy" : null,

View File

@ -0,0 +1,27 @@
{
"properties" : { },
"id" : "9fe8956f3e79479c825e50dc314bb9bd",
"script" : null,
"groupId" : "89130d496f6f467c88b22ae4a7f688eb",
"name" : "全部",
"createTime" : null,
"updateTime" : 1646555166829,
"lock" : null,
"createBy" : null,
"updateBy" : null,
"path" : "/all",
"method" : "GET",
"parameters" : [ ],
"options" : [ ],
"requestBody" : "",
"headers" : [ ],
"paths" : [ ],
"responseBody" : null,
"description" : null,
"requestBodyDefinition" : null,
"responseBodyDefinition" : null
}
================================
return db.select("""
select name label, id value from sys_role where is_del = 0
""")

View File

@ -4,13 +4,13 @@
"script" : null,
"groupId" : "89130d496f6f467c88b22ae4a7f688eb",
"name" : "列表",
"createTime" : 1646490239527,
"updateTime" : 1644121680976,
"createTime" : null,
"updateTime" : 1646552461206,
"lock" : "0",
"createBy" : null,
"updateBy" : null,
"path" : "/list",
"method" : "GET",
"method" : "POST",
"parameters" : [ ],
"options" : [ {
"name" : "permission",
@ -30,7 +30,19 @@
"paths" : [ ],
"responseBody" : "{\n \"code\": 200,\n \"message\": \"success\",\n \"data\": {\n \"total\": 1,\n \"list\": [\n {\n \"id\": \"1\",\n \"name\": \"管理员\"\n }\n ]\n },\n \"timestamp\": 1634309991187,\n \"executeTime\": 5\n}",
"description" : null,
"requestBodyDefinition" : null,
"requestBodyDefinition" : {
"name" : "",
"value" : "",
"description" : "",
"required" : false,
"dataType" : "Object",
"type" : null,
"defaultValue" : null,
"validateType" : "",
"error" : "",
"expression" : "",
"children" : [ ]
},
"responseBodyDefinition" : {
"name" : "",
"value" : "",

View File

@ -4,13 +4,13 @@
"script" : null,
"groupId" : "89130d496f6f467c88b22ae4a7f688eb",
"name" : "删除",
"createTime" : 1646490239530,
"updateTime" : 1644121681716,
"createTime" : null,
"updateTime" : 1646553106085,
"lock" : "0",
"createBy" : null,
"updateBy" : null,
"path" : "/delete",
"method" : "POST",
"method" : "DELETE",
"parameters" : [ ],
"options" : [ {
"name" : "permission",
@ -30,7 +30,19 @@
"paths" : [ ],
"responseBody" : null,
"description" : null,
"requestBodyDefinition" : null,
"requestBodyDefinition" : {
"name" : "",
"value" : "",
"description" : "",
"required" : false,
"dataType" : "Object",
"type" : null,
"defaultValue" : null,
"validateType" : "",
"error" : "",
"expression" : "",
"children" : [ ]
},
"responseBodyDefinition" : null
}
================================

View File

@ -4,8 +4,8 @@
"script" : null,
"groupId" : "5c36bdc1de454d6e9d1a464d87c96091",
"name" : "获取所有配置",
"createTime" : 1646490239534,
"updateTime" : 1646391487051,
"createTime" : null,
"updateTime" : 1646552461778,
"lock" : "0",
"createBy" : null,
"updateBy" : null,

View File

@ -49,6 +49,12 @@ body{
.toolbar-container{
margin-bottom: 10px
}
.toolbar-container > div{
margin-left: 10px;
}
.toolbar-container > div:nth-child(1){
margin-left: 0px;
}
.clear{
clear: both;
}

View File

@ -1,9 +1,9 @@
import { defineAsyncComponent } from 'vue'
const components = import.meta.glob('./*/*.vue')
const components = import.meta.glob('./**/*.vue')
export default function install (app) {
for (const [key, value] of Object.entries(components)) {
const name = key.substring(key.lastIndexOf('/') + 1, key.lastIndexOf('.'))
app.component(name, defineAsyncComponent(value))
}
}
}

View File

@ -0,0 +1,114 @@
<template>
<el-form
ref="dataForm"
:rules="rules"
:model="formData"
v-bind="form.props"
>
<el-row v-for="(row,i) in form.rows" :key="i" :gutter="row.gutter">
<el-col v-for="(col,j) in row.cols" :key="j" :span="col.span" v-bind="col.colProps">
<el-form-item :label="col.label" :label-width="col.labelWidth" :prop="col.name" v-bind="col.formItemProps">
<component
:is="!col.component ? 'mb-input' : col.component.startsWith('el-') ? col.component : 'mb-' + col.component"
v-model="formData[col.name]"
:label="col.label"
v-bind="col.props"
/>
</el-form-item>
</el-col>
</el-row>
</el-form>
</template>
<script setup>
import {ref, reactive, getCurrentInstance, defineExpose } from 'vue'
const { proxy } = getCurrentInstance()
const rules = reactive(getRules())
const formData = ref(getFormData())
const dataForm = ref()
const props = defineProps({
form: {
type: Object,
default: () => {}
},
detail: {
type: Object,
default: () => {}
}
})
const emit = defineEmits(['reload-table'])
props.form.props = props.form.props || {}
proxy.$common.setDefaultValue(props.form.props, 'labelPosition', 'right')
proxy.$common.setDefaultValue(props.form.props, 'labelWidth', '120px')
if(props.detail.formData){
if(props.detail.handlerFormData){
props.detail.handlerFormData(props.detail.formData)
}
formData.value = props.detail.formData
}
if(props.detail.request){
}
function getRules(){
var _rules = {}
props.form.rows.forEach(row => {
row.cols.forEach(col => {
if (col.rules) {
_rules[col.name] = col.rules
}
})
})
return _rules
}
function getFormData() {
var data = {}
props.form.rows.forEach(row => {
row.cols.forEach(col => {
data[col.name] = col.defaultValue === null ? col.defaultValue : col.defaultValue || ''
})
})
return data
}
function save(d) {
dataForm.value.validate((valid) => {
if (valid) {
d.loading()
proxy.$post(props.form.request.url, formData.value).then(res => {
d.hideLoading()
proxy.$notify({
title: '成功',
message: (!formData.value.id ? '创建' : '修改') + '成功',
type: 'success',
duration: 2000
})
if(props.detail.formData){
props.detail.formData = {}
}
d.hide()
emit('reload-table')
}).catch(() => d.hideLoading())
}
})
}
function getDetail(id) {
formData.value.id = id
proxy.$get(props.detail.request.url, { id: id }).then(res => {
const { data } = res
for (var t in formData.value) {
if (data[t] && (!props.detail.excludeAssign || props.detail.excludeAssign.indexOf(t) === -1)) {
formData.value[t] = data[t]
}
}
})
}
defineExpose({ save, getDetail })
</script>

View File

@ -0,0 +1,56 @@
<template>
<div class="app-container">
<mb-search v-if="table.where" :where="table.where" :no-reset="search.noReset" @search="reload" />
<el-row class="toolbar-container">
<div v-for="(it, i) in tools" :key="i">
<el-button v-if="it.type == 'add'" v-permission="it.permission" class="filter-item" type="primary" icon="ElPlus" @click="it.click">
{{ it.label || '添加' }}
</el-button>
<mb-button v-if="it.type == 'delete'" v-permission="it.permission" :el="{ plain: true }" :request-url="it.url" :btn-type="'delete'" :request-data="{ id: ids }" :after-handler="reload" />
</div>
</el-row>
<mb-table ref="tableRef" v-bind="table" @selection-change="selectionChange" />
</div>
</template>
<script setup>
import { ref, defineExpose } from 'vue'
const tableRef = ref()
const ids = ref([])
const props = defineProps({
search: {
type: Object,
default: () => {}
},
tools: {
type: Array,
default: () => []
},
table: {
type: Object,
default: () => {}
}
})
props.tools.forEach(it => {
if(it.type == 'delete'){
props.table.selection = true
}
})
function reload(){
tableRef.value.reloadList()
}
function selectionChange(columns) {
ids.value = columns.map(it => it['id']).join(',')
}
defineExpose({ reload })
</script>

View File

@ -9,6 +9,7 @@
<script>
import { getToken } from '@/scripts/auth'
import {ElNotification} from "element-plus";
export default {
name: 'MbButton',
@ -70,11 +71,11 @@ export default {
created() {
if (this.btnType) {
if (this.btnType === 'delete') {
this.requestMethod_ = 'post'
this.requestMethod_ = 'delete'
this.el_.type = 'danger'
this.el_.text = '删除'
this.el_.icon = 'ElDelete'
this.beforeConfirm_ = '确定删除吗?'
this.beforeConfirm_ = '此操作将永久删除该数据, 是否继续?'
this.successTips_ = '删除成功!'
this.failTips_ = '删除失败!'
}
@ -109,33 +110,25 @@ export default {
})
}
return new Promise((resolve, reject) => {
if (this.requestMethod_ === 'get') {
this.$get(this.requestUrl, this.requestData).then(res => {
const { data } = res
if (data) {
this.$message({
type: 'success',
message: this.successTips_
})
} else {
this.$message.error(this.failTips_)
}
resolve()
})
} else {
this.$post(this.requestUrl, this.requestData).then(res => {
const { data } = res
if (data) {
this.$message({
type: 'success',
message: this.successTips_
})
} else {
this.$message.error(this.failTips_)
}
resolve()
})
}
this.$request({
url: this.requestUrl,
method: this.requestMethod_,
params: this.requestData,
data: this.requestData
}).then(res => {
const { data } = res
if (data) {
ElNotification({
title: '成功',
message: this.successTips_,
type: 'success',
duration: 2000
})
} else {
this.$message.error(this.failTips_)
}
resolve()
})
})
}
}

View File

@ -0,0 +1,45 @@
<template>
<el-date-picker
v-model="modelValue"
:type="type"
:format="format"
:value-format="valueFormat"
:placeholder="placeholder"
:start-placeholder="startPlaceholder"
:end-placeholder="endPlaceholder"
v-bind="props.props"
/>
</template>
<script setup>
import { watch } from 'vue'
const emit = defineEmits(['update:modelValue'])
const props = defineProps({
modelValue: String,
type: String,
placeholder: {
type: String,
default: '请选择时间'
},
format: {
type: String,
default: 'yyyy-MM-dd'
},
valueFormat: {
type: String,
default: 'yyyy-MM-dd'
},
startPlaceholder: {
type: String,
default: '开始时间'
},
endPlaceholder: {
type: String,
default: '结束时间'
},
props: Object
})
watch(() => props.modelValue, (value) => {
emit('update:modelValue', value)
})
</script>

View File

@ -0,0 +1,19 @@
<template>
<el-input v-model="modelValue" :type="type" :value="value" :placeholder="placeholder || (label && '请输入' + label)" v-bind="props.props" />
</template>
<script setup>
import { watch } from 'vue'
const emit = defineEmits(['update:modelValue'])
const props = defineProps({
modelValue: String,
label: String,
placeholder: String,
value: String,
type: String,
props: Object
})
watch(() => props.modelValue, (value) => {
emit('update:modelValue', value)
})
</script>

View File

@ -0,0 +1,17 @@
<template>
<el-radio-group v-model="modelValue" v-bind="props.props">
<el-radio-button v-for="it in options" :label="it.value" :disabled="it.disabled" :name="it.disabled">{{ it.label }}</el-radio-button>
</el-radio-group>
</template>
<script setup>
import { watch } from 'vue'
const emit = defineEmits(['update:modelValue'])
const props = defineProps({
modelValue: String,
options: Array
})
watch(() => props.modelValue, (value) => {
emit('update:modelValue', value)
})
</script>

View File

@ -0,0 +1,3 @@
<template>
</template>

View File

@ -0,0 +1,108 @@
<template>
<div class="filter-container">
<el-form :inline="true" @keyup.enter="search">
<span v-for="(it, i) in where">
<el-form-item v-if="it && it.label" :label="it.label" :key="i">
<el-input v-if="!it.type || it.type == 'input'" @input="input(it.input)" v-model="it.value" :placeholder="it.placeholder || ('请输入' + it.label)" style="width: 200px;" class="filter-item" />
<mb-select v-else-if="it.type == 'select'" v-model="it.value" :placeholder="'请选择' + it.label" v-bind="it.properties" />
<el-date-picker
v-else-if="it.type == 'date' || it.type == 'datetime' || it.type == 'daterange' || it.type == 'datetimerange'"
v-model="it.value"
align="right"
:format="it.type.startsWith('datetime') ? 'YYYY-MM-DD HH:mm:ss' : 'YYYY-MM-DD'"
:value-format="it.type.startsWith('datetime') ? 'YYYY-MM-DD HH:mm:ss' : 'YYYY-MM-DD'"
:type="it.type"
start-placeholder="开始时间"
end-placeholder="结束时间"
:placeholder="it.type.startsWith('datetime') ? 'YYYY-MM-DD HH:mm:ss' : 'YYYY-MM-DD'"
>
</el-date-picker>
<component v-else :is="it.type" v-model="it.value" v-bind="it.properties" />
</el-form-item>
</span>
<el-form-item>
<el-button class="filter-item" type="primary" icon="ElSearch" @click="search">
搜索
</el-button>
<el-button class="filter-item" icon="ElDelete" @click="reset">
清空
</el-button>
</el-form-item>
<el-form-item>
<slot name="btns" />
</el-form-item>
</el-form>
</div>
</template>
<script setup>
import { nextTick, watch } from 'vue'
const props = defineProps({
where: {
type: Object,
default: () => {}
},
notReset: {
type: String,
default: ''
}
})
for(var key in props.where){
if(props.where[key] instanceof Object && props.where[key].value == undefined){
props.where[key].value = null
}
}
watch(() => props.where,() => {
console.log(props.where)
})
const emit = defineEmits(['search'])
function input(input){
if(input){
emit('search')
}
}
function search(){
for(var key in props.where){
if(props.where[key] instanceof Object){
if(props.where[key].type && props.where[key].type.startsWith('date') && props.where[key].value instanceof Array){
props.where[key].value = props.where[key].value.join(',')
}
}
}
nextTick(() => {
emit('search')
for(var key in props.where){
if(props.where[key] instanceof Object){
if(props.where[key].type && props.where[key].type.startsWith('date')){
props.where[key].value = props.where[key].value.split(',')
}
}
}
})
}
function reset() {
for(var key in props.where){
if(props.notReset.indexOf(key) == -1){
if(props.where[key] instanceof Object){
props.where[key].value = null
}else{
props.where[key] = null
}
}
}
nextTick(() => emit('search'))
}
</script>
<style scoped>
</style>

View File

@ -0,0 +1,22 @@
<template>
<el-switch
v-model="modelValue"
:active-value="activeValue"
:inactive-value="inactiveValue"
v-bind="props.props"
/>
</template>
<script setup>
import { watch } from 'vue'
const emit = defineEmits(['update:modelValue'])
const props = defineProps({
modelValue: String,
activeValue: String,
inactiveValue: String,
props: Object
})
watch(() => props.modelValue, (value) => {
emit('update:modelValue', value)
})
</script>

View File

@ -83,7 +83,7 @@ const props = defineProps({
},
method: {
type: String,
default: 'get'
default: 'post'
},
cols: {
type: Array,
@ -121,7 +121,8 @@ function getList() {
request({
url: props.url,
method: props.method,
params: newWhere
params: newWhere,
data: newWhere
}).then(res => {
const { data } = res
total.value = data.total

View File

@ -0,0 +1,30 @@
<template>
<treeselect v-model="modelValue" :options="options" :key="modelValue" :placeholder="placeholder || (label && '请选择' + label)" :show-count="true" v-bind="props.props" />
</template>
<script setup>
import { ref, getCurrentInstance } from "vue";
const { proxy } = getCurrentInstance()
const props = defineProps({
modelValue: {
type: String,
default: null
},
url: {
type: String,
default: '',
required: true
},
label: String,
placeholder: String,
props: Object
})
const options = ref([])
proxy.$get(props.url).then(res => {
options.value = res.data.list
proxy.$treeTable.deleteEmptyChildren(options.value)
})
</script>

View File

@ -137,7 +137,7 @@ export default {
this.$emit('update:modelValue', '')
this.$emit('change', '')
}
this.$get('file/delete', { url: encodeURI(url) })
this.$delete('file/delete', { url: encodeURI(url) })
},
handlePreview(file) {
window.open(this.$global.filePrefix + file.response.data.url)

View File

@ -179,7 +179,7 @@ export default {
this.fileList.splice(i, 1)
}
})
this.$get('file/delete', { url: encodeURI(url) })
this.$delete('file/delete', { url: encodeURI(url) })
if (this.multiple) {
this.$emit('update:modelValue', this.urls)
this.$emit('change', this.urls)

View File

@ -1,100 +0,0 @@
<template>
<div class="filter-container">
<el-form :inline="true" @keyup.enter="search">
<el-form-item :label="it.label" v-for="(it, i) in where" :key="i">
<el-input v-if="it.type == 'input'" @input="input(it.input)" v-model="it.value" :placeholder="it.placeholder || ('请输入' + it.label)" style="width: 200px;" class="filter-item" />
<mb-select v-else-if="it.type == 'select'" v-model="it.value" :placeholder="'请输入' + it.label" v-bind="it.properties" />
<el-date-picker
v-else-if="it.type == 'date' || it.type == 'datetime' || it.type == 'daterange' || it.type == 'datetimerange'"
v-model="it.value"
align="right"
:format="it.type.startsWith('datetime') ? 'YYYY-MM-DD HH:mm:ss' : 'YYYY-MM-DD'"
:value-format="it.type.startsWith('datetime') ? 'YYYY-MM-DD HH:mm:ss' : 'YYYY-MM-DD'"
:type="it.type"
start-placeholder="开始时间"
end-placeholder="结束时间"
:placeholder="it.type.startsWith('datetime') ? 'YYYY-MM-DD HH:mm:ss' : 'YYYY-MM-DD'"
>
</el-date-picker>
<component v-else :is="it.type" v-model="it.value" v-bind="it.properties" />
</el-form-item>
<el-form-item>
<el-button class="filter-item" type="primary" icon="ElSearch" @click="search">
搜索
</el-button>
<el-button class="filter-item" icon="ElDelete" @click="reset">
清空
</el-button>
</el-form-item>
<el-form-item>
<slot name="btns" />
</el-form-item>
</el-form>
</div>
</template>
<script setup>
import { nextTick, watch } from 'vue'
const props = defineProps({
where: {
type: Object,
default: () => {}
},
notReset: {
type: String,
default: ''
}
})
watch(() => props.where,() => {
console.log(props.where)
})
const emit = defineEmits(['search'])
function input(input){
if(input){
emit('search')
}
}
function search(){
for(var key in props.where){
if(props.where[key] instanceof Object){
if(props.where[key].type.startsWith('date') && props.where[key].value instanceof Array){
props.where[key].value = props.where[key].value.join(',')
}
}
}
nextTick(() => {
emit('search')
for(var key in props.where){
if(props.where[key] instanceof Object){
if(props.where[key].type.startsWith('date')){
props.where[key].value = props.where[key].value.split(',')
}
}
}
})
}
function reset() {
for(var key in props.where){
if(props.notReset.indexOf(key) == -1){
if(props.where[key] instanceof Object){
props.where[key].value = null
}else{
props.where[key] = null
}
}
}
nextTick(() => emit('search'))
}
</script>
<style scoped>
</style>

View File

@ -38,7 +38,7 @@ common.handleDelete = (options) => {
}).then(() => {
request({
url: url,
method: 'post',
method: 'delete',
params: {
id: id
}
@ -167,4 +167,8 @@ common.loadConfig = async() => {
})
}
common.setDefaultValue = (obj, attr, value) => {
obj[attr] = obj[attr] === undefined ? value : obj[attr]
}
export default common

View File

@ -27,7 +27,7 @@ function appComponent(app, item){
}
const install = (app) => {
app.config.globalProperties.$get('/component/list', { size: 999999 }).then((res) => {
app.config.globalProperties.$post('/component/list', { size: 999999 }).then((res) => {
res.data.list.forEach(it => {
appComponent(app, it)
})

View File

@ -11,4 +11,4 @@ export default {
filePrefix: '',
visitedViews: reactive([]),
tabValue: ref('')
}
}

View File

@ -1,5 +1,7 @@
import * as PlusIcons from '@element-plus/icons-vue'
import VueUeditorWrap from 'vue-ueditor-wrap'
import Treeselect from 'vue3-treeselect'
import 'vue3-treeselect/dist/vue3-treeselect.css'
import request from './request'
import global from './global'
import common from './common'
@ -19,6 +21,7 @@ const install = (app) => {
}
})
app.config.globalProperties.$get = (url, data) => request({ url, params: data })
app.config.globalProperties.$delete = (url, data) => request({ url, method: 'delete', params: data })
app.config.globalProperties.$global = global
app.config.globalProperties.$common = common
app.config.globalProperties.$treeTable = treeTable
@ -26,5 +29,6 @@ const install = (app) => {
app.component(`El${key}`, PlusIcons[key])
}
app.use(VueUeditorWrap)
app.component('treeselect', Treeselect)
}
export default install

View File

@ -0,0 +1,214 @@
<template>
<mb-list ref="magicList" v-bind="listOptions" />
<mb-dialog ref="formDialog" @confirm-click="magicForm.save($event)" width="50%">
<template #content>
<mb-form ref="magicForm" @reload-table="magicList.reload" :key="magicFormKey" v-bind="formOptions" />
</template>
</mb-dialog>
</template>
<script setup>
import { ref, reactive, getCurrentInstance } from 'vue'
const { proxy } = getCurrentInstance()
const formDialog = ref()
const magicList = ref()
const magicForm = ref()
const magicFormKey = ref()
const listOptions = reactive({
search: {
noReset: 'id'
},
tools: [{
type: 'add',
permission: 'user:save',
click: () => {
magicFormKey.value = Math.random()
formOptions.detail.formData = null
formDialog.value.show()
}
},{
type: 'delete',
permission: 'user:delete',
url: 'user/delete'
}],
table: {
url: 'user/list',
where: {
username: {
label: '登录名称',
},
name: {
label: '姓名/昵称',
},
roleId: {
type: 'select',
label: '角色',
props: {
url: 'role/all',
el: { multiple: true }
}
}
},
cols: [
{
field: 'username',
title: '登录名称',
sortable: 'custom'
}, {
field: 'name',
title: '姓名/昵称',
sortable: 'custom'
}, {
field: 'officeName',
title: '所属机构'
}, {
field: 'roles',
title: '角色'
}, {
field: 'phone',
title: '手机号',
sortable: 'custom'
}, {
field: 'isLogin',
title: '禁止登录',
type: 'switch',
width: 100,
change: (row) => {
proxy.$get('/user/change/login/status', {
id: row.id,
isLogin: row.isLogin
})
}
}, {
field: 'createDate',
title: '创建时间',
width: 180
}, {
title: '操作',
type: 'btns',
width: 140,
fixed: 'right',
btns: [
{
permission: 'user:save',
title: '修改',
type: 'text',
icon: 'ElEdit',
click: (row) => {
// magicForm.value.getDetail(row.id)
magicFormKey.value = Math.random()
formOptions.detail.formData = proxy.$common.copyNew(row)
formDialog.value.show()
}
}, {
permission: 'user:delete',
title: '删除',
type: 'text',
icon: 'ElDelete',
click: (row) => {
proxy.$common.handleDelete({
url: 'user/delete',
id: row.id,
done: () => magicList.value.reload()
})
}
}
]
}
]
}
})
const formOptions = reactive({
detail: {
// request: {
// url: 'user/get'
// },
handlerFormData: (formData) => {
proxy.$get('user/roles', { userId: formData.id }).then((res) => {
formData.roles = res.data.join(',')
})
}
},
form: {
request: {
url: "user/save",
method: "post"
},
rows: [{
gutter: 24,
cols: [{
span: 12,
name: 'username',
label: '登录名称',
rules: [{ required: true, message: '请输入登录名称', trigger: 'change' }],
props: {
autocomplete: 'new-password'
}
}, {
span: 12,
name: 'password',
label: '密码',
rules: [{ required: true, message: '请输入密码', trigger: 'change' }],
props: {
type: 'password',
autocomplete: 'new-password'
}
}]
},{
gutter: 24,
cols: [{
span: 12,
name: 'name',
label: '姓名/昵称'
}, {
span: 12,
name: 'phone',
label: '手机号'
}]
},{
gutter: 24,
cols: [{
component: 'treeselect',
span: 12,
name: 'officeId',
label: '组织机构',
defaultValue: null,
// rules: [{ required: true, message: '', trigger: 'change' }],
props: {
url: 'user/offices'
}
}, {
component: 'select',
span: 12,
name: 'roles',
label: '选择角色',
defaultValue: null,
rules: [{ required: true, message: '请选择角色', trigger: 'change' }],
props: {
url: 'role/all',
placeholder: '请选择角色',
el: { multiple: true }
}
}]
}, {
gutter: 24,
cols: [{
span: 24,
component: 'radio-button',
name: 'isLogin',
label: '登录状态',
defaultValue: '0',
props: {
options: [{
label: '有效',
value: '0'
}, {
label: '锁定',
value: '1'
}]
}
}]
}]
}
})
</script>

View File

@ -4,7 +4,7 @@
<mb-search :where="tableOptions.where" @search="reloadTable" />
<el-row class="toolbar-container">
<el-button v-permission="'role:save'" class="filter-item" type="primary" icon="ElPlus" @click="handleCreate">
<el-button v-permission="'component:save'" class="filter-item" type="primary" icon="ElPlus" @click="handleCreate">
添加
</el-button>
</el-row>
@ -17,6 +17,9 @@
<el-form-item label="组件名称" prop="name">
<el-input v-model="temp.name" />
</el-form-item>
<el-form-item label="组件描述" prop="descRibe">
<el-input v-model="temp.descRibe" />
</el-form-item>
<el-form-item label="组件代码" prop="code">
<el-input v-model="temp.code" :rows="30" type="textarea" />
</el-form-item>
@ -42,6 +45,11 @@ const tableOptions = reactive({
type: 'input',
label: '组件名称',
value: ''
},
descRibe: {
type: 'input',
label: '组件描述',
value: ''
}
},
cols: [
@ -49,6 +57,10 @@ const tableOptions = reactive({
field: 'name',
title: '组件名称'
},
{
field: 'descRibe',
title: '组件描述'
},
{
title: '操作',
type: 'btns',
@ -85,6 +97,7 @@ const dialogTitle = ref('')
const temp = ref(getTemp())
const rules = reactive({
name: [{ required: true, message: '请输入组件名称', trigger: 'change' }],
descRibe: [{ required: true, message: '请输入组件描述', trigger: 'change' }],
code: [{ required: true, message: '请输入组件代码', trigger: 'change' }]
})
const downloadLoading = ref(false)
@ -98,6 +111,7 @@ function getTemp(){
id: '',
name: '',
code: '',
descRibe: ''
}
}
@ -118,7 +132,7 @@ function save(d) {
dataForm.value.validate((valid) => {
if (valid) {
d.loading()
proxy.$post('role/save', temp.value).then(() => {
proxy.$post('component/save', temp.value).then(() => {
d.hideLoading()
reloadTable()
formDialog.value.hide()

View File

@ -32,12 +32,12 @@
</el-col>
<el-col :span="12">
<el-form-item label="选择角色" prop="roles">
<mb-select v-model="temp.roles" url="role/list?size=999999" placeholder="请选择角色" labelField="name" valueField="id" :el="{ multiple: true }" />
<mb-select v-model="temp.roles" url="role/all" placeholder="请选择角色" :el="{ multiple: true }" />
</el-form-item>
</el-col>
</el-row>
<el-form-item label="登录状态" prop="isLogin">
<el-radio-group v-model="temp.isLogin" size="small">
<el-radio-group v-model="temp.isLogin">
<el-radio-button label="0">有效</el-radio-button>
<el-radio-button label="1">锁定</el-radio-button>
</el-radio-group>
@ -46,8 +46,6 @@
</template>
<script setup>
import Treeselect from 'vue3-treeselect'
import 'vue3-treeselect/dist/vue3-treeselect.css'
import { ref, reactive, onBeforeMount, getCurrentInstance, nextTick, defineExpose } from 'vue'
@ -130,6 +128,6 @@ function getInfo(row) {
})
}
defineExpose({ getInfo, resetTemp })
defineExpose({ save, getInfo, resetTemp })
</script>

View File

@ -71,14 +71,13 @@ const tableOptions = reactive({
roleId: {
type: 'select',
label: '角色',
value: '',
value: proxy.$route.query.roleId,
properties: {
url: 'role/list?size=999999',
labelField: 'name',
valueField: 'id',
url: 'role/all',
el: { multiple: true }
}
}
},
officeId: proxy.$route.query.officeId
},
cols: [
{
@ -160,17 +159,20 @@ const userFormDialog = ref()
const table = ref()
const userForm = ref()
onMounted(() => {
// onMounted(() => {
// setTimeout(function(){
console.log(proxy.$route.query.roleId)
if(proxy.$route.query.roleId){
tableOptions.where.roleId.value = proxy.$route.query.roleId
}
if(proxy.$route.query.officeId){
tableOptions.where.officeId = proxy.$route.query.officeId
}
// nextTick(() => {
// console.log(proxy.$route.query.roleId)
// if(proxy.$route.query.roleId){
// tableOptions.where.roleId.value = proxy.$route.query.roleId
// }
// if(proxy.$route.query.officeId){
// tableOptions.where.officeId = proxy.$route.query.officeId
// }
// })
// },1000)
})
// })
function checkChange(values) {
tableOptions.where.officeId = values

View File

@ -80,6 +80,10 @@ magic-api:
sql-column-case: camel
resource:
location: data/magic-api
backup: #备份相关配置
enable: true #是否启用
max-history: -1 #备份保留天数,-1为永久保留
table-name: magic_backup_record_v2 #使用数据库存储备份时的表名
page:
page: current
size: size