mirror of
https://gitee.com/ssssssss-team/magic-boot.git
synced 2025-02-22 02:32:49 +08:00
演示模式,后台权限code控制
This commit is contained in:
parent
0edba9b3cc
commit
d9beca5433
@ -5,13 +5,13 @@
|
|||||||
"groupId" : "1952f25c81084e24b55b11385767dc38",
|
"groupId" : "1952f25c81084e24b55b11385767dc38",
|
||||||
"name" : "获取当前用户权限code",
|
"name" : "获取当前用户权限code",
|
||||||
"createTime" : null,
|
"createTime" : null,
|
||||||
"updateTime" : 1641276424757,
|
"updateTime" : 1644121674755,
|
||||||
"lock" : "0",
|
"lock" : "0",
|
||||||
"method" : "POST",
|
"method" : "POST",
|
||||||
"path" : "/permissions",
|
"path" : "/permissions",
|
||||||
"parameters" : [ ],
|
"parameters" : [ ],
|
||||||
"option" : "[{\"name\":\"\",\"value\":\"\",\"description\":\"\"}]",
|
"option" : "[{\"name\":\"\",\"value\":\"\",\"description\":\"\"}]",
|
||||||
"requestBody" : "{\r\n\t\r\n}",
|
"requestBody" : "{\n\n}",
|
||||||
"headers" : [ ],
|
"headers" : [ ],
|
||||||
"paths" : [ ],
|
"paths" : [ ],
|
||||||
"responseBody" : "{\n \"code\": 200,\n \"message\": \"success\",\n \"data\": [\"sys:test:aaa\", \"menu:save\", \"menu:delete\", \"office:office:list\", \"office:office:save\", \"office:office:delete\", \"role:view\", \"role:save\", \"role:delete\", \"user:save\", \"user:delete\", \"dict:view\", \"dict:save\", \"dict:delete\", \"dict:items\", \"dict:items:save\", \"dict:items:delete\"],\n \"timestamp\": 1641199273283,\n \"executeTime\": 1\n}",
|
"responseBody" : "{\n \"code\": 200,\n \"message\": \"success\",\n \"data\": [\"sys:test:aaa\", \"menu:save\", \"menu:delete\", \"office:office:list\", \"office:office:save\", \"office:office:delete\", \"role:view\", \"role:save\", \"role:delete\", \"user:save\", \"user:delete\", \"dict:view\", \"dict:save\", \"dict:delete\", \"dict:items\", \"dict:items:save\", \"dict:items:delete\"],\n \"timestamp\": 1641199273283,\n \"executeTime\": 1\n}",
|
||||||
@ -115,9 +115,9 @@ return db.cache(`permissions:${userId}`).select("""
|
|||||||
sm.permission
|
sm.permission
|
||||||
FROM
|
FROM
|
||||||
sys_menu sm
|
sys_menu sm
|
||||||
left JOIN sys_role_menu srm ON sm.id = srm.menu_id
|
right JOIN sys_role_menu srm ON sm.id = srm.menu_id
|
||||||
left JOIN sys_user_role sur ON sur.role_id = srm.role_id
|
right JOIN sys_user_role sur ON sur.role_id = srm.role_id
|
||||||
left JOIN sys_user su ON su.id = sur.user_id
|
right JOIN sys_user su ON su.id = sur.user_id
|
||||||
?{userId != '1', AND su.id = #{userId}}
|
?{userId != '1', AND su.id = #{userId}}
|
||||||
AND su.is_del = 0
|
AND su.is_del = 0
|
||||||
WHERE
|
WHERE
|
||||||
|
@ -5,13 +5,13 @@
|
|||||||
"groupId" : "c7ce65f5b3cf4aaa913f6fec7d35d176",
|
"groupId" : "c7ce65f5b3cf4aaa913f6fec7d35d176",
|
||||||
"name" : "保存",
|
"name" : "保存",
|
||||||
"createTime" : null,
|
"createTime" : null,
|
||||||
"updateTime" : 1644046408348,
|
"updateTime" : 1644121671060,
|
||||||
"lock" : "0",
|
"lock" : "0",
|
||||||
"method" : "POST",
|
"method" : "POST",
|
||||||
"path" : "/save",
|
"path" : "/save",
|
||||||
"parameters" : [ ],
|
"parameters" : [ ],
|
||||||
"option" : "[{\"name\":\"wrap_request_parameter\",\"value\":\"data\",\"description\":\"包装请求参数到一个变量中\"}]",
|
"option" : "[{\"name\":\"wrap_request_parameter\",\"value\":\"data\",\"description\":\"包装请求参数到一个变量中\"},{\"name\":\"permission\",\"value\":\"dict:save\",\"description\":\"允许拥有该权限的访问\"}]",
|
||||||
"requestBody" : "",
|
"requestBody" : "{\n\n}",
|
||||||
"headers" : [ ],
|
"headers" : [ ],
|
||||||
"paths" : [ ],
|
"paths" : [ ],
|
||||||
"responseBody" : null,
|
"responseBody" : null,
|
||||||
@ -19,7 +19,8 @@
|
|||||||
"requestBodyDefinition" : null,
|
"requestBodyDefinition" : null,
|
||||||
"responseBodyDefinition" : null,
|
"responseBodyDefinition" : null,
|
||||||
"optionMap" : {
|
"optionMap" : {
|
||||||
"wrap_request_parameter" : "data"
|
"wrap_request_parameter" : "data",
|
||||||
|
"permission" : "dict:save"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
================================
|
================================
|
||||||
|
@ -5,13 +5,13 @@
|
|||||||
"groupId" : "c7ce65f5b3cf4aaa913f6fec7d35d176",
|
"groupId" : "c7ce65f5b3cf4aaa913f6fec7d35d176",
|
||||||
"name" : "列表",
|
"name" : "列表",
|
||||||
"createTime" : null,
|
"createTime" : null,
|
||||||
"updateTime" : 1634736176170,
|
"updateTime" : 1644121689680,
|
||||||
"lock" : "0",
|
"lock" : "0",
|
||||||
"method" : "GET",
|
"method" : "GET",
|
||||||
"path" : "/list",
|
"path" : "/list",
|
||||||
"parameters" : [ ],
|
"parameters" : [ ],
|
||||||
"option" : "[]",
|
"option" : "[{\"name\":\"permission\",\"value\":\"dict:view\",\"description\":\"允许拥有该权限的访问\"}]",
|
||||||
"requestBody" : "",
|
"requestBody" : "{\n\n}",
|
||||||
"headers" : [ ],
|
"headers" : [ ],
|
||||||
"paths" : [ ],
|
"paths" : [ ],
|
||||||
"responseBody" : "{\n \"code\": 402,\n \"message\": \"凭证已过期\",\n \"data\": null,\n \"timestamp\": 1634734488837,\n \"executeTime\": null\n}",
|
"responseBody" : "{\n \"code\": 402,\n \"message\": \"凭证已过期\",\n \"data\": null,\n \"timestamp\": 1634734488837,\n \"executeTime\": null\n}",
|
||||||
@ -90,7 +90,9 @@
|
|||||||
"children" : [ ]
|
"children" : [ ]
|
||||||
} ]
|
} ]
|
||||||
},
|
},
|
||||||
"optionMap" : { }
|
"optionMap" : {
|
||||||
|
"permission" : "dict:view"
|
||||||
|
}
|
||||||
}
|
}
|
||||||
================================
|
================================
|
||||||
return db.page("""
|
return db.page("""
|
||||||
|
@ -5,20 +5,22 @@
|
|||||||
"groupId" : "c7ce65f5b3cf4aaa913f6fec7d35d176",
|
"groupId" : "c7ce65f5b3cf4aaa913f6fec7d35d176",
|
||||||
"name" : "删除",
|
"name" : "删除",
|
||||||
"createTime" : null,
|
"createTime" : null,
|
||||||
"updateTime" : 1634734751223,
|
"updateTime" : 1644121690359,
|
||||||
"lock" : "0",
|
"lock" : "0",
|
||||||
"method" : "POST",
|
"method" : "POST",
|
||||||
"path" : "/delete",
|
"path" : "/delete",
|
||||||
"parameters" : [ ],
|
"parameters" : [ ],
|
||||||
"option" : "[]",
|
"option" : "[{\"name\":\"permission\",\"value\":\"dict:delete\",\"description\":\"允许拥有该权限的访问\"}]",
|
||||||
"requestBody" : "",
|
"requestBody" : "{\n\n}",
|
||||||
"headers" : [ ],
|
"headers" : [ ],
|
||||||
"paths" : [ ],
|
"paths" : [ ],
|
||||||
"responseBody" : null,
|
"responseBody" : null,
|
||||||
"description" : null,
|
"description" : null,
|
||||||
"requestBodyDefinition" : null,
|
"requestBodyDefinition" : null,
|
||||||
"responseBodyDefinition" : null,
|
"responseBodyDefinition" : null,
|
||||||
"optionMap" : { }
|
"optionMap" : {
|
||||||
|
"permission" : "dict:delete"
|
||||||
|
}
|
||||||
}
|
}
|
||||||
================================
|
================================
|
||||||
db.table("sys_dict_items").logic().where().eq("dictId",id).delete()
|
db.table("sys_dict_items").logic().where().eq("dictId",id).delete()
|
||||||
|
@ -5,13 +5,13 @@
|
|||||||
"groupId" : "376f26eb43a44a3daeafd27020a96f48",
|
"groupId" : "376f26eb43a44a3daeafd27020a96f48",
|
||||||
"name" : "保存",
|
"name" : "保存",
|
||||||
"createTime" : null,
|
"createTime" : null,
|
||||||
"updateTime" : 1644046552214,
|
"updateTime" : 1644121691372,
|
||||||
"lock" : "0",
|
"lock" : "0",
|
||||||
"method" : "POST",
|
"method" : "POST",
|
||||||
"path" : "/save",
|
"path" : "/save",
|
||||||
"parameters" : [ ],
|
"parameters" : [ ],
|
||||||
"option" : "[{\"name\":\"wrap_request_parameter\",\"value\":\"data\",\"description\":\"包装请求参数到一个变量中\"}]",
|
"option" : "[{\"name\":\"wrap_request_parameter\",\"value\":\"data\",\"description\":\"包装请求参数到一个变量中\"},{\"name\":\"permission\",\"value\":\"dict:items:save\",\"description\":\"允许拥有该权限的访问\"}]",
|
||||||
"requestBody" : "",
|
"requestBody" : "{\n\n}",
|
||||||
"headers" : [ ],
|
"headers" : [ ],
|
||||||
"paths" : [ ],
|
"paths" : [ ],
|
||||||
"responseBody" : null,
|
"responseBody" : null,
|
||||||
@ -19,7 +19,8 @@
|
|||||||
"requestBodyDefinition" : null,
|
"requestBodyDefinition" : null,
|
||||||
"responseBodyDefinition" : null,
|
"responseBodyDefinition" : null,
|
||||||
"optionMap" : {
|
"optionMap" : {
|
||||||
"wrap_request_parameter" : "data"
|
"wrap_request_parameter" : "data",
|
||||||
|
"permission" : "dict:items:save"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
================================
|
================================
|
||||||
|
@ -5,13 +5,13 @@
|
|||||||
"groupId" : "376f26eb43a44a3daeafd27020a96f48",
|
"groupId" : "376f26eb43a44a3daeafd27020a96f48",
|
||||||
"name" : "列表",
|
"name" : "列表",
|
||||||
"createTime" : null,
|
"createTime" : null,
|
||||||
"updateTime" : 1634736189568,
|
"updateTime" : 1644121692556,
|
||||||
"lock" : "0",
|
"lock" : "0",
|
||||||
"method" : "GET",
|
"method" : "GET",
|
||||||
"path" : "/list",
|
"path" : "/list",
|
||||||
"parameters" : [ ],
|
"parameters" : [ ],
|
||||||
"option" : "[]",
|
"option" : "[{\"name\":\"permission\",\"value\":\"dict:items:view\",\"description\":\"允许拥有该权限的访问\"}]",
|
||||||
"requestBody" : "",
|
"requestBody" : "{\n\n}",
|
||||||
"headers" : [ ],
|
"headers" : [ ],
|
||||||
"paths" : [ ],
|
"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}",
|
"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}",
|
||||||
@ -198,7 +198,9 @@
|
|||||||
"children" : [ ]
|
"children" : [ ]
|
||||||
} ]
|
} ]
|
||||||
},
|
},
|
||||||
"optionMap" : { }
|
"optionMap" : {
|
||||||
|
"permission" : "dict:items:view"
|
||||||
|
}
|
||||||
}
|
}
|
||||||
================================
|
================================
|
||||||
return db.page("""
|
return db.page("""
|
||||||
|
@ -4,21 +4,23 @@
|
|||||||
"script" : null,
|
"script" : null,
|
||||||
"groupId" : "376f26eb43a44a3daeafd27020a96f48",
|
"groupId" : "376f26eb43a44a3daeafd27020a96f48",
|
||||||
"name" : "删除",
|
"name" : "删除",
|
||||||
"createTime" : 1634735543067,
|
"createTime" : null,
|
||||||
"updateTime" : 1634735543067,
|
"updateTime" : 1644121693440,
|
||||||
"lock" : "0",
|
"lock" : "0",
|
||||||
"method" : "POST",
|
"method" : "POST",
|
||||||
"path" : "/delete",
|
"path" : "/delete",
|
||||||
"parameters" : [ ],
|
"parameters" : [ ],
|
||||||
"option" : "[]",
|
"option" : "[{\"name\":\"permission\",\"value\":\"dict:items:delete\",\"description\":\"允许拥有该权限的访问\"}]",
|
||||||
"requestBody" : "",
|
"requestBody" : "{\n\n}",
|
||||||
"headers" : [ ],
|
"headers" : [ ],
|
||||||
"paths" : [ ],
|
"paths" : [ ],
|
||||||
"responseBody" : null,
|
"responseBody" : null,
|
||||||
"description" : null,
|
"description" : null,
|
||||||
"requestBodyDefinition" : null,
|
"requestBodyDefinition" : null,
|
||||||
"responseBodyDefinition" : null,
|
"responseBodyDefinition" : null,
|
||||||
"optionMap" : { }
|
"optionMap" : {
|
||||||
|
"permission" : "dict:items:delete"
|
||||||
|
}
|
||||||
}
|
}
|
||||||
================================
|
================================
|
||||||
return db.table("sys_dict_items").logic().where().eq("id",id).delete();
|
return db.table("sys_dict_items").logic().where().eq("id",id).delete();
|
@ -5,20 +5,22 @@
|
|||||||
"groupId" : "4f0230049d7e4f39b1e0897cc0f46f9a",
|
"groupId" : "4f0230049d7e4f39b1e0897cc0f46f9a",
|
||||||
"name" : "保存",
|
"name" : "保存",
|
||||||
"createTime" : null,
|
"createTime" : null,
|
||||||
"updateTime" : 1644046192172,
|
"updateTime" : 1644121682487,
|
||||||
"lock" : "0",
|
"lock" : "0",
|
||||||
"method" : "POST",
|
"method" : "POST",
|
||||||
"path" : "/save",
|
"path" : "/save",
|
||||||
"parameters" : [ ],
|
"parameters" : [ ],
|
||||||
"option" : "[]",
|
"option" : "[{\"name\":\"permission\",\"value\":\"user:save\",\"description\":\"允许拥有该权限的访问\"}]",
|
||||||
"requestBody" : "",
|
"requestBody" : "{\n\n}",
|
||||||
"headers" : [ ],
|
"headers" : [ ],
|
||||||
"paths" : [ ],
|
"paths" : [ ],
|
||||||
"responseBody" : null,
|
"responseBody" : null,
|
||||||
"description" : null,
|
"description" : null,
|
||||||
"requestBodyDefinition" : null,
|
"requestBodyDefinition" : null,
|
||||||
"responseBodyDefinition" : null,
|
"responseBodyDefinition" : null,
|
||||||
"optionMap" : { }
|
"optionMap" : {
|
||||||
|
"permission" : "user:save"
|
||||||
|
}
|
||||||
}
|
}
|
||||||
================================
|
================================
|
||||||
import cn.dev33.satoken.secure.SaSecureUtil;
|
import cn.dev33.satoken.secure.SaSecureUtil;
|
||||||
|
@ -5,13 +5,13 @@
|
|||||||
"groupId" : "4f0230049d7e4f39b1e0897cc0f46f9a",
|
"groupId" : "4f0230049d7e4f39b1e0897cc0f46f9a",
|
||||||
"name" : "列表",
|
"name" : "列表",
|
||||||
"createTime" : null,
|
"createTime" : null,
|
||||||
"updateTime" : 1643965494984,
|
"updateTime" : 1644121683184,
|
||||||
"lock" : "0",
|
"lock" : "0",
|
||||||
"method" : "GET",
|
"method" : "GET",
|
||||||
"path" : "/list",
|
"path" : "/list",
|
||||||
"parameters" : [ ],
|
"parameters" : [ ],
|
||||||
"option" : "[]",
|
"option" : "[{\"name\":\"permission\",\"value\":\"user:view\",\"description\":\"允许拥有该权限的访问\"}]",
|
||||||
"requestBody" : "",
|
"requestBody" : "{\n\n}",
|
||||||
"headers" : [ ],
|
"headers" : [ ],
|
||||||
"paths" : [ ],
|
"paths" : [ ],
|
||||||
"responseBody" : "{\n \"code\": 402,\n \"message\": \"凭证已过期\",\n \"data\": null,\n \"timestamp\": 1643964929030,\n \"executeTime\": null\n}",
|
"responseBody" : "{\n \"code\": 402,\n \"message\": \"凭证已过期\",\n \"data\": null,\n \"timestamp\": 1643964929030,\n \"executeTime\": null\n}",
|
||||||
@ -90,7 +90,9 @@
|
|||||||
"children" : [ ]
|
"children" : [ ]
|
||||||
} ]
|
} ]
|
||||||
},
|
},
|
||||||
"optionMap" : { }
|
"optionMap" : {
|
||||||
|
"permission" : "user:view"
|
||||||
|
}
|
||||||
}
|
}
|
||||||
================================
|
================================
|
||||||
return db.page("""
|
return db.page("""
|
||||||
|
@ -5,20 +5,22 @@
|
|||||||
"groupId" : "4f0230049d7e4f39b1e0897cc0f46f9a",
|
"groupId" : "4f0230049d7e4f39b1e0897cc0f46f9a",
|
||||||
"name" : "删除",
|
"name" : "删除",
|
||||||
"createTime" : null,
|
"createTime" : null,
|
||||||
"updateTime" : 1641218486141,
|
"updateTime" : 1644121688496,
|
||||||
"lock" : "0",
|
"lock" : "0",
|
||||||
"method" : "POST",
|
"method" : "POST",
|
||||||
"path" : "/delete",
|
"path" : "/delete",
|
||||||
"parameters" : [ ],
|
"parameters" : [ ],
|
||||||
"option" : "[]",
|
"option" : "[{\"name\":\"permission\",\"value\":\"user:delete\",\"description\":\"允许拥有该权限的访问\"}]",
|
||||||
"requestBody" : "",
|
"requestBody" : "{\n\n}",
|
||||||
"headers" : [ ],
|
"headers" : [ ],
|
||||||
"paths" : [ ],
|
"paths" : [ ],
|
||||||
"responseBody" : null,
|
"responseBody" : null,
|
||||||
"description" : null,
|
"description" : null,
|
||||||
"requestBodyDefinition" : null,
|
"requestBodyDefinition" : null,
|
||||||
"responseBodyDefinition" : null,
|
"responseBodyDefinition" : null,
|
||||||
"optionMap" : { }
|
"optionMap" : {
|
||||||
|
"permission" : "user:delete"
|
||||||
|
}
|
||||||
}
|
}
|
||||||
================================
|
================================
|
||||||
import org.ssssssss.magicapi.cache.SqlCache
|
import org.ssssssss.magicapi.cache.SqlCache
|
||||||
|
@ -5,12 +5,12 @@
|
|||||||
"groupId" : "8295fc13678d4144bf7363c465247a50",
|
"groupId" : "8295fc13678d4144bf7363c465247a50",
|
||||||
"name" : "保存",
|
"name" : "保存",
|
||||||
"createTime" : null,
|
"createTime" : null,
|
||||||
"updateTime" : 1644046432007,
|
"updateTime" : 1644121675551,
|
||||||
"lock" : "0",
|
"lock" : "0",
|
||||||
"method" : "POST",
|
"method" : "POST",
|
||||||
"path" : "/save",
|
"path" : "/save",
|
||||||
"parameters" : [ ],
|
"parameters" : [ ],
|
||||||
"option" : "[{\"name\":\"wrap_request_parameter\",\"value\":\"data\",\"description\":\"包装请求参数到一个变量中\"}]",
|
"option" : "[{\"name\":\"wrap_request_parameter\",\"value\":\"data\",\"description\":\"包装请求参数到一个变量中\"},{\"name\":\"permission\",\"value\":\"office:save\",\"description\":\"允许拥有该权限的访问\"}]",
|
||||||
"requestBody" : "{}",
|
"requestBody" : "{}",
|
||||||
"headers" : [ ],
|
"headers" : [ ],
|
||||||
"paths" : [ ],
|
"paths" : [ ],
|
||||||
@ -19,7 +19,8 @@
|
|||||||
"requestBodyDefinition" : null,
|
"requestBodyDefinition" : null,
|
||||||
"responseBodyDefinition" : null,
|
"responseBodyDefinition" : null,
|
||||||
"optionMap" : {
|
"optionMap" : {
|
||||||
"wrap_request_parameter" : "data"
|
"wrap_request_parameter" : "data",
|
||||||
|
"permission" : "office:save"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
================================
|
================================
|
||||||
|
@ -5,13 +5,13 @@
|
|||||||
"groupId" : "8295fc13678d4144bf7363c465247a50",
|
"groupId" : "8295fc13678d4144bf7363c465247a50",
|
||||||
"name" : "列表",
|
"name" : "列表",
|
||||||
"createTime" : null,
|
"createTime" : null,
|
||||||
"updateTime" : 1642134990129,
|
"updateTime" : 1644121676212,
|
||||||
"lock" : "0",
|
"lock" : "0",
|
||||||
"method" : "GET",
|
"method" : "GET",
|
||||||
"path" : "/tree",
|
"path" : "/tree",
|
||||||
"parameters" : [ ],
|
"parameters" : [ ],
|
||||||
"option" : "[]",
|
"option" : "[{\"name\":\"permission\",\"value\":\"office:view\",\"description\":\"允许拥有该权限的访问\"}]",
|
||||||
"requestBody" : "",
|
"requestBody" : "{\n\n}",
|
||||||
"headers" : [ ],
|
"headers" : [ ],
|
||||||
"paths" : [ ],
|
"paths" : [ ],
|
||||||
"responseBody" : "{\n \"code\": 200,\n \"message\": \"success\",\n \"data\": {\n \"list\": [{\n \"id\": \"4c37a80226134bce8bc91c8fc04a7d2f\",\n \"name\": \"<font color=\\\"yellow\\\">马小东公司</font>\",\n \"pid\": \"0\",\n \"type\": \"2\",\n \"sort\": 10,\n \"code\": \"mxd\",\n \"children\": [{\n \"id\": \"81b5493cdb31477f9ceea85b2cd08f15\",\n \"name\": \"<font color=\\\"yellow\\\">马小东子公司</font>\",\n \"pid\": \"4c37a80226134bce8bc91c8fc04a7d2f\",\n \"type\": null,\n \"sort\": 10,\n \"code\": \"mxdz\",\n \"children\": []\n }, {\n \"id\": \"31b365008f994e93850186126fce87cb\",\n \"name\": \"<font color=\\\"yellow\\\">马小东子公司2</font>\",\n \"pid\": \"4c37a80226134bce8bc91c8fc04a7d2f\",\n \"type\": null,\n \"sort\": 20,\n \"code\": \"mxdzz\",\n \"children\": []\n }]\n }, {\n \"id\": \"935126327e2a4f90b3f485f818f61ea5\",\n \"name\": \"<font color=\\\"yellow\\\">吕金泽公司</font>\",\n \"pid\": \"0\",\n \"type\": null,\n \"sort\": 20,\n \"code\": \"ljz\",\n \"children\": [{\n \"id\": \"1ae0299fc79b43c6b0ae2e14756ec41a\",\n \"name\": \"<font color=\\\"yellow\\\">吕金泽子公司</font>\",\n \"pid\": \"935126327e2a4f90b3f485f818f61ea5\",\n \"type\": null,\n \"sort\": 10,\n \"code\": \"ljzz\",\n \"children\": []\n }]\n }],\n \"total\": 2\n },\n \"timestamp\": 1642134812650,\n \"executeTime\": 9\n}",
|
"responseBody" : "{\n \"code\": 200,\n \"message\": \"success\",\n \"data\": {\n \"list\": [{\n \"id\": \"4c37a80226134bce8bc91c8fc04a7d2f\",\n \"name\": \"<font color=\\\"yellow\\\">马小东公司</font>\",\n \"pid\": \"0\",\n \"type\": \"2\",\n \"sort\": 10,\n \"code\": \"mxd\",\n \"children\": [{\n \"id\": \"81b5493cdb31477f9ceea85b2cd08f15\",\n \"name\": \"<font color=\\\"yellow\\\">马小东子公司</font>\",\n \"pid\": \"4c37a80226134bce8bc91c8fc04a7d2f\",\n \"type\": null,\n \"sort\": 10,\n \"code\": \"mxdz\",\n \"children\": []\n }, {\n \"id\": \"31b365008f994e93850186126fce87cb\",\n \"name\": \"<font color=\\\"yellow\\\">马小东子公司2</font>\",\n \"pid\": \"4c37a80226134bce8bc91c8fc04a7d2f\",\n \"type\": null,\n \"sort\": 20,\n \"code\": \"mxdzz\",\n \"children\": []\n }]\n }, {\n \"id\": \"935126327e2a4f90b3f485f818f61ea5\",\n \"name\": \"<font color=\\\"yellow\\\">吕金泽公司</font>\",\n \"pid\": \"0\",\n \"type\": null,\n \"sort\": 20,\n \"code\": \"ljz\",\n \"children\": [{\n \"id\": \"1ae0299fc79b43c6b0ae2e14756ec41a\",\n \"name\": \"<font color=\\\"yellow\\\">吕金泽子公司</font>\",\n \"pid\": \"935126327e2a4f90b3f485f818f61ea5\",\n \"type\": null,\n \"sort\": 10,\n \"code\": \"ljzz\",\n \"children\": []\n }]\n }],\n \"total\": 2\n },\n \"timestamp\": 1642134812650,\n \"executeTime\": 9\n}",
|
||||||
@ -306,7 +306,9 @@
|
|||||||
"children" : [ ]
|
"children" : [ ]
|
||||||
} ]
|
} ]
|
||||||
},
|
},
|
||||||
"optionMap" : { }
|
"optionMap" : {
|
||||||
|
"permission" : "office:view"
|
||||||
|
}
|
||||||
}
|
}
|
||||||
================================
|
================================
|
||||||
var toTree = (list,pid) => select t.*,toTree(list,t.id) children from list t where t.pid = pid
|
var toTree = (list,pid) => select t.*,toTree(list,t.id) children from list t where t.pid = pid
|
||||||
|
@ -5,13 +5,13 @@
|
|||||||
"groupId" : "8295fc13678d4144bf7363c465247a50",
|
"groupId" : "8295fc13678d4144bf7363c465247a50",
|
||||||
"name" : "删除",
|
"name" : "删除",
|
||||||
"createTime" : null,
|
"createTime" : null,
|
||||||
"updateTime" : 1641732068899,
|
"updateTime" : 1644121676877,
|
||||||
"lock" : "0",
|
"lock" : "0",
|
||||||
"method" : "POST",
|
"method" : "POST",
|
||||||
"path" : "/delete",
|
"path" : "/delete",
|
||||||
"parameters" : [ ],
|
"parameters" : [ ],
|
||||||
"option" : "[]",
|
"option" : "[{\"name\":\"permission\",\"value\":\"office:delete\",\"description\":\"允许拥有该权限的访问\"}]",
|
||||||
"requestBody" : "{\r\n\t\r\n}",
|
"requestBody" : "{\n\n}",
|
||||||
"headers" : [ ],
|
"headers" : [ ],
|
||||||
"paths" : [ ],
|
"paths" : [ ],
|
||||||
"responseBody" : "{\n \"code\": 200,\n \"message\": \"success\",\n \"data\": null,\n \"timestamp\": 1641201245421,\n \"executeTime\": 7\n}",
|
"responseBody" : "{\n \"code\": 200,\n \"message\": \"success\",\n \"data\": null,\n \"timestamp\": 1641201245421,\n \"executeTime\": 7\n}",
|
||||||
@ -90,7 +90,9 @@
|
|||||||
"children" : [ ]
|
"children" : [ ]
|
||||||
} ]
|
} ]
|
||||||
},
|
},
|
||||||
"optionMap" : { }
|
"optionMap" : {
|
||||||
|
"permission" : "office:delete"
|
||||||
|
}
|
||||||
}
|
}
|
||||||
================================
|
================================
|
||||||
// db.table('sys_user_office').where().eq("office_id",id).delete();
|
// db.table('sys_user_office').where().eq("office_id",id).delete();
|
||||||
|
@ -5,12 +5,12 @@
|
|||||||
"groupId" : "67b2ce258e24491194b74992958c74aa",
|
"groupId" : "67b2ce258e24491194b74992958c74aa",
|
||||||
"name" : "保存",
|
"name" : "保存",
|
||||||
"createTime" : null,
|
"createTime" : null,
|
||||||
"updateTime" : 1644031443910,
|
"updateTime" : 1644121672548,
|
||||||
"lock" : "0",
|
"lock" : "0",
|
||||||
"method" : "POST",
|
"method" : "POST",
|
||||||
"path" : "/save",
|
"path" : "/save",
|
||||||
"parameters" : [ ],
|
"parameters" : [ ],
|
||||||
"option" : "[{\"name\":\"wrap_request_parameter\",\"value\":\"data\",\"description\":\"包装请求参数到一个变量中\"}]",
|
"option" : "[{\"name\":\"wrap_request_parameter\",\"value\":\"data\",\"description\":\"包装请求参数到一个变量中\"},{\"name\":\"permission\",\"value\":\"menu:save\",\"description\":\"允许拥有该权限的访问\"}]",
|
||||||
"requestBody" : "{}",
|
"requestBody" : "{}",
|
||||||
"headers" : [ ],
|
"headers" : [ ],
|
||||||
"paths" : [ ],
|
"paths" : [ ],
|
||||||
@ -19,7 +19,8 @@
|
|||||||
"requestBodyDefinition" : null,
|
"requestBodyDefinition" : null,
|
||||||
"responseBodyDefinition" : null,
|
"responseBodyDefinition" : null,
|
||||||
"optionMap" : {
|
"optionMap" : {
|
||||||
"wrap_request_parameter" : "data"
|
"wrap_request_parameter" : "data",
|
||||||
|
"permission" : "menu:save"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
================================
|
================================
|
||||||
|
@ -5,7 +5,7 @@
|
|||||||
"groupId" : "67b2ce258e24491194b74992958c74aa",
|
"groupId" : "67b2ce258e24491194b74992958c74aa",
|
||||||
"name" : "删除",
|
"name" : "删除",
|
||||||
"createTime" : null,
|
"createTime" : null,
|
||||||
"updateTime" : 1641276678116,
|
"updateTime" : 1644121673352,
|
||||||
"lock" : "0",
|
"lock" : "0",
|
||||||
"method" : "POST",
|
"method" : "POST",
|
||||||
"path" : "/delete",
|
"path" : "/delete",
|
||||||
@ -22,8 +22,8 @@
|
|||||||
"expression" : null,
|
"expression" : null,
|
||||||
"children" : null
|
"children" : null
|
||||||
} ],
|
} ],
|
||||||
"option" : "[]",
|
"option" : "[{\"name\":\"permission\",\"value\":\"menu:delete\",\"description\":\"允许拥有该权限的访问\"}]",
|
||||||
"requestBody" : "{\r\n\t\r\n}",
|
"requestBody" : "{\n\n}",
|
||||||
"headers" : [ ],
|
"headers" : [ ],
|
||||||
"paths" : [ ],
|
"paths" : [ ],
|
||||||
"responseBody" : "{\n \"code\": 200,\n \"message\": \"success\",\n \"data\": null,\n \"timestamp\": 1641201245421,\n \"executeTime\": 7\n}",
|
"responseBody" : "{\n \"code\": 200,\n \"message\": \"success\",\n \"data\": null,\n \"timestamp\": 1641201245421,\n \"executeTime\": 7\n}",
|
||||||
@ -102,7 +102,9 @@
|
|||||||
"children" : [ ]
|
"children" : [ ]
|
||||||
} ]
|
} ]
|
||||||
},
|
},
|
||||||
"optionMap" : { }
|
"optionMap" : {
|
||||||
|
"permission" : "menu:delete"
|
||||||
|
}
|
||||||
}
|
}
|
||||||
================================
|
================================
|
||||||
import '@get:/menu/cache/delete' as cacheDelete;
|
import '@get:/menu/cache/delete' as cacheDelete;
|
||||||
|
@ -5,13 +5,13 @@
|
|||||||
"groupId" : "67b2ce258e24491194b74992958c74aa",
|
"groupId" : "67b2ce258e24491194b74992958c74aa",
|
||||||
"name" : "获取菜单tree",
|
"name" : "获取菜单tree",
|
||||||
"createTime" : null,
|
"createTime" : null,
|
||||||
"updateTime" : 1641483087321,
|
"updateTime" : 1644121674088,
|
||||||
"lock" : "0",
|
"lock" : "0",
|
||||||
"method" : "GET",
|
"method" : "GET",
|
||||||
"path" : "/tree",
|
"path" : "/tree",
|
||||||
"parameters" : [ ],
|
"parameters" : [ ],
|
||||||
"option" : "[]",
|
"option" : "[{\"name\":\"permission\",\"value\":\"menu:view\",\"description\":\"允许拥有该权限的访问\"}]",
|
||||||
"requestBody" : "{\r\n\t\r\n}",
|
"requestBody" : "{\n\n}",
|
||||||
"headers" : [ ],
|
"headers" : [ ],
|
||||||
"paths" : [ ],
|
"paths" : [ ],
|
||||||
"responseBody" : "{\n \"code\": 402,\n \"message\": \"凭证已过期\",\n \"data\": null,\n \"timestamp\": 1634309660370,\n \"executeTime\": null\n}",
|
"responseBody" : "{\n \"code\": 402,\n \"message\": \"凭证已过期\",\n \"data\": null,\n \"timestamp\": 1634309660370,\n \"executeTime\": null\n}",
|
||||||
@ -90,7 +90,9 @@
|
|||||||
"children" : [ ]
|
"children" : [ ]
|
||||||
} ]
|
} ]
|
||||||
},
|
},
|
||||||
"optionMap" : { }
|
"optionMap" : {
|
||||||
|
"permission" : "menu:view"
|
||||||
|
}
|
||||||
}
|
}
|
||||||
================================
|
================================
|
||||||
var toTree = (list,pid) => select t.*,toTree(list,t.id) children from list t where t.pid = pid
|
var toTree = (list,pid) => select t.*,toTree(list,t.id) children from list t where t.pid = pid
|
||||||
|
@ -5,13 +5,13 @@
|
|||||||
"groupId" : "89130d496f6f467c88b22ae4a7f688eb",
|
"groupId" : "89130d496f6f467c88b22ae4a7f688eb",
|
||||||
"name" : "保存",
|
"name" : "保存",
|
||||||
"createTime" : null,
|
"createTime" : null,
|
||||||
"updateTime" : 1644046445441,
|
"updateTime" : 1644121680268,
|
||||||
"lock" : "0",
|
"lock" : "0",
|
||||||
"method" : "POST",
|
"method" : "POST",
|
||||||
"path" : "/save",
|
"path" : "/save",
|
||||||
"parameters" : [ ],
|
"parameters" : [ ],
|
||||||
"option" : "[{\"name\":\"\",\"value\":\"\",\"description\":\"\"}]",
|
"option" : "[{\"name\":\"permission\",\"value\":\"role:save\",\"description\":\"允许拥有该权限的访问\"}]",
|
||||||
"requestBody" : "",
|
"requestBody" : "{\n\n}",
|
||||||
"headers" : [ ],
|
"headers" : [ ],
|
||||||
"paths" : [ ],
|
"paths" : [ ],
|
||||||
"responseBody" : null,
|
"responseBody" : null,
|
||||||
@ -19,7 +19,7 @@
|
|||||||
"requestBodyDefinition" : null,
|
"requestBodyDefinition" : null,
|
||||||
"responseBodyDefinition" : null,
|
"responseBodyDefinition" : null,
|
||||||
"optionMap" : {
|
"optionMap" : {
|
||||||
"" : ""
|
"permission" : "role:save"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
================================
|
================================
|
||||||
|
@ -5,13 +5,13 @@
|
|||||||
"groupId" : "89130d496f6f467c88b22ae4a7f688eb",
|
"groupId" : "89130d496f6f467c88b22ae4a7f688eb",
|
||||||
"name" : "列表",
|
"name" : "列表",
|
||||||
"createTime" : null,
|
"createTime" : null,
|
||||||
"updateTime" : 1642061119644,
|
"updateTime" : 1644121680976,
|
||||||
"lock" : "0",
|
"lock" : "0",
|
||||||
"method" : "GET",
|
"method" : "GET",
|
||||||
"path" : "/list",
|
"path" : "/list",
|
||||||
"parameters" : [ ],
|
"parameters" : [ ],
|
||||||
"option" : "[{\"name\":\"permission\",\"value\":\"role:view\",\"description\":\"允许拥有该权限的访问\"}]",
|
"option" : "[{\"name\":\"permission\",\"value\":\"role:view\",\"description\":\"允许拥有该权限的访问\"}]",
|
||||||
"requestBody" : "",
|
"requestBody" : "{\n\n}",
|
||||||
"headers" : [ ],
|
"headers" : [ ],
|
||||||
"paths" : [ ],
|
"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}",
|
"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}",
|
||||||
|
@ -5,20 +5,22 @@
|
|||||||
"groupId" : "89130d496f6f467c88b22ae4a7f688eb",
|
"groupId" : "89130d496f6f467c88b22ae4a7f688eb",
|
||||||
"name" : "删除",
|
"name" : "删除",
|
||||||
"createTime" : null,
|
"createTime" : null,
|
||||||
"updateTime" : 1641276685001,
|
"updateTime" : 1644121681716,
|
||||||
"lock" : "0",
|
"lock" : "0",
|
||||||
"method" : "POST",
|
"method" : "POST",
|
||||||
"path" : "/delete",
|
"path" : "/delete",
|
||||||
"parameters" : [ ],
|
"parameters" : [ ],
|
||||||
"option" : "[]",
|
"option" : "[{\"name\":\"permission\",\"value\":\"role:delete\",\"description\":\"允许拥有该权限的访问\"}]",
|
||||||
"requestBody" : "{\r\n\t\r\n}",
|
"requestBody" : "{\n\n}",
|
||||||
"headers" : [ ],
|
"headers" : [ ],
|
||||||
"paths" : [ ],
|
"paths" : [ ],
|
||||||
"responseBody" : null,
|
"responseBody" : null,
|
||||||
"description" : null,
|
"description" : null,
|
||||||
"requestBodyDefinition" : null,
|
"requestBodyDefinition" : null,
|
||||||
"responseBodyDefinition" : null,
|
"responseBodyDefinition" : null,
|
||||||
"optionMap" : { }
|
"optionMap" : {
|
||||||
|
"permission" : "role:delete"
|
||||||
|
}
|
||||||
}
|
}
|
||||||
================================
|
================================
|
||||||
import '@get:/role/cache/delete' as cacheDelete
|
import '@get:/role/cache/delete' as cacheDelete
|
||||||
|
2
magic-boot-ui/.env.preview
Normal file
2
magic-boot-ui/.env.preview
Normal file
@ -0,0 +1,2 @@
|
|||||||
|
NODE_ENV = preview
|
||||||
|
VUE_APP_BASE_API = 'http://localhost:8081/'
|
@ -6,8 +6,9 @@
|
|||||||
"license": "MIT",
|
"license": "MIT",
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"serve": "vue-cli-service serve --open",
|
"serve": "vue-cli-service serve --open",
|
||||||
|
"serve:preview": "vue-cli-service serve --mode preview --open",
|
||||||
"build": "vue-cli-service build",
|
"build": "vue-cli-service build",
|
||||||
"preview": "node build/index.js --preview",
|
"preview": "vue-cli-service build --mode preview",
|
||||||
"lint": "eslint --ext .js,.vue src",
|
"lint": "eslint --ext .js,.vue src",
|
||||||
"test:unit": "jest --clearCache && vue-cli-service test:unit",
|
"test:unit": "jest --clearCache && vue-cli-service test:unit",
|
||||||
"test:ci": "npm run lint && npm run test:unit",
|
"test:ci": "npm run lint && npm run test:unit",
|
||||||
|
@ -9,7 +9,6 @@ const { errorLog: needErrorLog } = settings
|
|||||||
|
|
||||||
function checkNeed() {
|
function checkNeed() {
|
||||||
const env = process.env.NODE_ENV
|
const env = process.env.NODE_ENV
|
||||||
console.log(needErrorLog)
|
|
||||||
if (isString(needErrorLog)) {
|
if (isString(needErrorLog)) {
|
||||||
return env === needErrorLog
|
return env === needErrorLog
|
||||||
}
|
}
|
||||||
|
@ -5,7 +5,7 @@ const hasPermission = {
|
|||||||
bind(el, binding, vnode) {
|
bind(el, binding, vnode) {
|
||||||
if (binding.value) {
|
if (binding.value) {
|
||||||
const permissionList = Vue.prototype.$authorities
|
const permissionList = Vue.prototype.$authorities
|
||||||
if (permissionList && permissionList.length && !permissionList.includes(binding.value)) {
|
if (permissionList && permissionList.length && !permissionList.includes(binding.value) && process.env.NODE_ENV != 'preview') {
|
||||||
el.style.display = 'none'
|
el.style.display = 'none'
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -85,6 +85,9 @@ service.interceptors.response.use(
|
|||||||
if(currentMessage){
|
if(currentMessage){
|
||||||
currentMessage.close()
|
currentMessage.close()
|
||||||
}
|
}
|
||||||
|
if(res.code == 403 && process.env.NODE_ENV == 'preview'){
|
||||||
|
res.message = '演示模式,不允许操作!'
|
||||||
|
}
|
||||||
currentMessage = Message({
|
currentMessage = Message({
|
||||||
message: res.message || 'Error',
|
message: res.message || 'Error',
|
||||||
type: 'error',
|
type: 'error',
|
||||||
|
@ -62,6 +62,7 @@ treeTable.deleteEmptyChildren = (children) => {
|
|||||||
}
|
}
|
||||||
|
|
||||||
treeTable.recursionSearch = (fields, data, text, html) => {
|
treeTable.recursionSearch = (fields, data, text, html) => {
|
||||||
|
html = html != undefined ? html : true
|
||||||
var searchData = []
|
var searchData = []
|
||||||
for(var i in data){
|
for(var i in data){
|
||||||
var treeNode = data[i]
|
var treeNode = data[i]
|
||||||
|
@ -144,7 +144,7 @@ export default {
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
permission: 'dict:items',
|
permission: 'dict:items:view',
|
||||||
title: '字典项',
|
title: '字典项',
|
||||||
type: 'text',
|
type: 'text',
|
||||||
icon: 'el-icon-menu',
|
icon: 'el-icon-menu',
|
||||||
|
@ -1,331 +0,0 @@
|
|||||||
<template>
|
|
||||||
<div class="app-container">
|
|
||||||
|
|
||||||
<el-button class="filter-item" style="margin-bottom:10px;" type="primary" icon="el-icon-edit" @click="addSubMenu('0')">
|
|
||||||
添加菜单
|
|
||||||
</el-button>
|
|
||||||
|
|
||||||
<dragTreeTable
|
|
||||||
:data="treeData"
|
|
||||||
:onDrag="onTreeDataChange"
|
|
||||||
fixed
|
|
||||||
height="100%"
|
|
||||||
border>
|
|
||||||
</dragTreeTable>
|
|
||||||
<!-- <el-tree :data="menuTreeList"-->
|
|
||||||
<!-- :props="defaultProps"-->
|
|
||||||
<!-- node-key="id"-->
|
|
||||||
<!-- :default-expanded-keys="menuTreeExpandedList"-->
|
|
||||||
<!-- draggable>-->
|
|
||||||
<!-- <span class="custom-tree-node" slot-scope="{ node, data }">-->
|
|
||||||
<!-- <span>{{ node.label }}</span>-->
|
|
||||||
<!-- <span>-->
|
|
||||||
<!-- <el-button-->
|
|
||||||
<!-- type="text"-->
|
|
||||||
<!-- size="mini"-->
|
|
||||||
<!-- style="width: 270px;text-align: left;color: #5a5e66;"-->
|
|
||||||
<!-- @click="() => append(data)">-->
|
|
||||||
<!-- {{ data.url }}-->
|
|
||||||
<!-- </el-button>-->
|
|
||||||
<!-- <el-button-->
|
|
||||||
<!-- type="text"-->
|
|
||||||
<!-- size="mini"-->
|
|
||||||
<!-- style="width: 100px;text-align: left;color: #5a5e66;"-->
|
|
||||||
<!-- @click="() => append(data)">-->
|
|
||||||
<!-- {{ data.permission }}-->
|
|
||||||
<!-- </el-button>-->
|
|
||||||
<!-- <el-button-->
|
|
||||||
<!-- type="text"-->
|
|
||||||
<!-- size="mini"-->
|
|
||||||
<!-- style="width: 100px;text-align: left;color: #5a5e66;"-->
|
|
||||||
<!-- @click="() => append(data)">-->
|
|
||||||
<!-- {{ data.sort }}-->
|
|
||||||
<!-- </el-button>-->
|
|
||||||
<!-- <el-button-->
|
|
||||||
<!-- type="text"-->
|
|
||||||
<!-- size="mini"-->
|
|
||||||
<!-- style="width: 100px;text-align: left;color: #5a5e66;"-->
|
|
||||||
<!-- @click="() => append(data)">-->
|
|
||||||
<!-- {{ data.isShow }}-->
|
|
||||||
<!-- </el-button>-->
|
|
||||||
<!-- <el-button-->
|
|
||||||
<!-- type="text"-->
|
|
||||||
<!-- size="mini"-->
|
|
||||||
<!-- @click="() => append(data)">-->
|
|
||||||
<!-- 添加下级菜单-->
|
|
||||||
<!-- </el-button>-->
|
|
||||||
<!-- <el-button-->
|
|
||||||
<!-- type="text"-->
|
|
||||||
<!-- size="mini"-->
|
|
||||||
<!-- @click="() => remove(node, data)">-->
|
|
||||||
<!-- 编辑-->
|
|
||||||
<!-- </el-button>-->
|
|
||||||
<!-- <el-button-->
|
|
||||||
<!-- type="text"-->
|
|
||||||
<!-- size="mini"-->
|
|
||||||
<!-- @click="() => remove(node, data)">-->
|
|
||||||
<!-- 删除-->
|
|
||||||
<!-- </el-button>-->
|
|
||||||
<!-- </span>-->
|
|
||||||
<!-- </span>-->
|
|
||||||
<!-- </el-tree>-->
|
|
||||||
|
|
||||||
<el-dialog :title="textMap[dialogStatus]" :visible.sync="dialogFormVisible" :close-on-click-modal="false">
|
|
||||||
<el-form ref="dataForm" :rules="rules" :model="temp" label-position="left" label-width="100px" style="width: 400px; margin-left:50px;">
|
|
||||||
<el-form-item label="菜单名称" prop="name">
|
|
||||||
<el-input v-model="temp.name" />
|
|
||||||
</el-form-item>
|
|
||||||
<el-form-item label="菜单链接" prop="url">
|
|
||||||
<el-input v-model="temp.url" />
|
|
||||||
</el-form-item>
|
|
||||||
<el-form-item label="权限标识" prop="permission">
|
|
||||||
<el-input v-model="temp.permission" />
|
|
||||||
</el-form-item>
|
|
||||||
<el-form-item label="排序" prop="sort">
|
|
||||||
<el-input v-model="temp.sort" />
|
|
||||||
</el-form-item>
|
|
||||||
<el-form-item label="描述">
|
|
||||||
<el-input v-model="temp.descRibe" :autosize="{ minRows: 4, maxRows: 6}" type="textarea" />
|
|
||||||
</el-form-item>
|
|
||||||
<el-form-item label="是否显示">
|
|
||||||
<el-checkbox v-model="temp.isShow">显示</el-checkbox>
|
|
||||||
</el-form-item>
|
|
||||||
</el-form>
|
|
||||||
<div slot="footer" class="dialog-footer">
|
|
||||||
<el-button @click="dialogFormVisible = false">
|
|
||||||
关闭
|
|
||||||
</el-button>
|
|
||||||
<el-button type="primary" @click="save()">
|
|
||||||
确认
|
|
||||||
</el-button>
|
|
||||||
</div>
|
|
||||||
</el-dialog>
|
|
||||||
|
|
||||||
</div>
|
|
||||||
</template>
|
|
||||||
|
|
||||||
<script>
|
|
||||||
import dragTreeTable from "drag-tree-table";
|
|
||||||
export default {
|
|
||||||
data() {
|
|
||||||
return {
|
|
||||||
treeData: {
|
|
||||||
custom_field: {
|
|
||||||
id: 'id',
|
|
||||||
order: 'sort',
|
|
||||||
lists: 'children',
|
|
||||||
parent_id: 'parent_id'
|
|
||||||
},
|
|
||||||
columns: [
|
|
||||||
{
|
|
||||||
type: 'selection',
|
|
||||||
title: '菜单名称',
|
|
||||||
field: 'name',
|
|
||||||
width: 200,
|
|
||||||
align: 'left',
|
|
||||||
formatter: (item) => {
|
|
||||||
return '<a>'+item.name+'</a>'
|
|
||||||
}
|
|
||||||
},
|
|
||||||
{
|
|
||||||
type: 'selection',
|
|
||||||
title: '路径',
|
|
||||||
field: 'url',
|
|
||||||
width: 200,
|
|
||||||
align: 'left',
|
|
||||||
},
|
|
||||||
{
|
|
||||||
type: 'selection',
|
|
||||||
title: '权限标识',
|
|
||||||
field: 'permission',
|
|
||||||
width: 200,
|
|
||||||
align: 'left',
|
|
||||||
},
|
|
||||||
{
|
|
||||||
type: 'selection',
|
|
||||||
title: '排序',
|
|
||||||
field: 'sort',
|
|
||||||
width: 200,
|
|
||||||
align: 'left',
|
|
||||||
},
|
|
||||||
{
|
|
||||||
type: 'selection',
|
|
||||||
title: '是否显示',
|
|
||||||
field: 'isShow',
|
|
||||||
width: 200,
|
|
||||||
align: 'left',
|
|
||||||
},
|
|
||||||
{
|
|
||||||
title: '操作',
|
|
||||||
type: 'action',
|
|
||||||
width: 350,
|
|
||||||
align: 'center',
|
|
||||||
actions: [
|
|
||||||
{
|
|
||||||
text: '添加下级菜单',
|
|
||||||
onclick: (item) => {
|
|
||||||
// item是当前行的数据
|
|
||||||
console.log(item)
|
|
||||||
},
|
|
||||||
formatter: (item) => {
|
|
||||||
return '<i>查看角色</i>'
|
|
||||||
}
|
|
||||||
},
|
|
||||||
{
|
|
||||||
text: '编辑',
|
|
||||||
onclick: (item) => {
|
|
||||||
// item是当前行的数据
|
|
||||||
console.log(item)
|
|
||||||
},
|
|
||||||
formatter: (item) => {
|
|
||||||
return '<i>编辑</i>'
|
|
||||||
}
|
|
||||||
},
|
|
||||||
{
|
|
||||||
text: '删除',
|
|
||||||
onclick: (item) => {
|
|
||||||
// item是当前行的数据
|
|
||||||
console.log(item)
|
|
||||||
},
|
|
||||||
formatter: (item) => {
|
|
||||||
return '<i>编辑</i>'
|
|
||||||
}
|
|
||||||
}
|
|
||||||
]
|
|
||||||
},
|
|
||||||
],
|
|
||||||
lists: []
|
|
||||||
},
|
|
||||||
menuTreeExpandedList:[],
|
|
||||||
menuTreeList:[],
|
|
||||||
defaultProps: {
|
|
||||||
children: 'children',
|
|
||||||
label: 'name'
|
|
||||||
},
|
|
||||||
dialogFormVisible: false,
|
|
||||||
dialogStatus: '',
|
|
||||||
textMap: {
|
|
||||||
update: '修改',
|
|
||||||
create: '添加'
|
|
||||||
},
|
|
||||||
temp: this.getTemp(),
|
|
||||||
listConfigDialogVisible: false,
|
|
||||||
formConfigDialogVisible: false,
|
|
||||||
rules: {
|
|
||||||
name: [{ required: true, message: '请输入菜单名称', trigger: 'change' }]
|
|
||||||
}
|
|
||||||
}
|
|
||||||
},
|
|
||||||
components: {
|
|
||||||
dragTreeTable
|
|
||||||
},
|
|
||||||
created(){
|
|
||||||
this.getMenuTreeList();
|
|
||||||
},
|
|
||||||
methods: {
|
|
||||||
onTreeDataChange(list) {
|
|
||||||
this.treeData.lists = list;
|
|
||||||
},
|
|
||||||
getMenuTreeList(){
|
|
||||||
this.$get('menu/tree', { pid: this.temp.pid }).then(res => {
|
|
||||||
this.menuTreeList = res.data.list
|
|
||||||
this.menuTreeExpandedList = this.getMenuId(this.menuTreeList);
|
|
||||||
this.treeData.lists = res.data.list
|
|
||||||
console.log(this.menuTreeList)
|
|
||||||
console.log(this.menuTreeExpandedList)
|
|
||||||
})
|
|
||||||
},
|
|
||||||
getMenuId(menuArr){
|
|
||||||
let idArr = [];
|
|
||||||
if (menuArr != null && menuArr.length > 0){
|
|
||||||
for (let i = 0; i < menuArr.length; i++) {
|
|
||||||
idArr.push(menuArr[i].id);
|
|
||||||
idArr.push(...this.getMenuId(menuArr[i].children));
|
|
||||||
}
|
|
||||||
}
|
|
||||||
return idArr;
|
|
||||||
},
|
|
||||||
getTemp() {
|
|
||||||
return {
|
|
||||||
id: '',
|
|
||||||
name: '',
|
|
||||||
url: '',
|
|
||||||
permission: '',
|
|
||||||
sort: 0,
|
|
||||||
descRibe: '',
|
|
||||||
isShow: true,
|
|
||||||
pid: ''
|
|
||||||
}
|
|
||||||
},
|
|
||||||
resetTemp() {
|
|
||||||
this.temp = this.getTemp()
|
|
||||||
},
|
|
||||||
getSort() {
|
|
||||||
this.$get('menu/sort', { pid: this.temp.pid }).then(res => {
|
|
||||||
this.temp.sort = res.data
|
|
||||||
})
|
|
||||||
},
|
|
||||||
addSubMenu(id) {
|
|
||||||
this.resetTemp()
|
|
||||||
this.temp.pid = id
|
|
||||||
this.temp.id = this.$common.uuid()
|
|
||||||
this.getSort()
|
|
||||||
this.dialogStatus = 'create'
|
|
||||||
this.dialogFormVisible = true
|
|
||||||
this.$nextTick(() => {
|
|
||||||
this.$refs['dataForm'].clearValidate()
|
|
||||||
})
|
|
||||||
},
|
|
||||||
save() {
|
|
||||||
this.$refs['dataForm'].validate((valid) => {
|
|
||||||
if (valid) {
|
|
||||||
this.temp.isShow = this.temp.isShow === true ? 1 : 0
|
|
||||||
this.$post('menu/save', this.temp).then(() => {
|
|
||||||
this.reloadTable()
|
|
||||||
this.dialogFormVisible = false
|
|
||||||
this.$notify({
|
|
||||||
title: '成功',
|
|
||||||
message: (this.dialogStatus === 'create' ? '创建' : '修改') + '成功',
|
|
||||||
type: 'success',
|
|
||||||
duration: 2000
|
|
||||||
})
|
|
||||||
})
|
|
||||||
}
|
|
||||||
})
|
|
||||||
},
|
|
||||||
reloadTable() {
|
|
||||||
this.$refs.table.reloadList()
|
|
||||||
},
|
|
||||||
handleUpdate(row) {
|
|
||||||
for (var t in this.temp) {
|
|
||||||
if (t === 'isShow') {
|
|
||||||
if (row[t] === 1) {
|
|
||||||
this.temp[t] = true
|
|
||||||
} else {
|
|
||||||
this.temp[t] = false
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
this.temp[t] = row[t]
|
|
||||||
}
|
|
||||||
}
|
|
||||||
this.dialogStatus = 'update'
|
|
||||||
this.dialogFormVisible = true
|
|
||||||
this.$nextTick(() => {
|
|
||||||
this.$refs['dataForm'].clearValidate()
|
|
||||||
})
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
</script>
|
|
||||||
|
|
||||||
<style>
|
|
||||||
.custom-tree-node {
|
|
||||||
flex: 1;
|
|
||||||
display: flex;
|
|
||||||
align-items: center;
|
|
||||||
justify-content: space-between;
|
|
||||||
font-size: 14px;
|
|
||||||
padding-right: 8px;
|
|
||||||
}
|
|
||||||
</style>
|
|
@ -16,7 +16,7 @@
|
|||||||
</div>
|
</div>
|
||||||
|
|
||||||
<el-row class="toolbar-container">
|
<el-row class="toolbar-container">
|
||||||
<el-button class="filter-item" type="primary" icon="el-icon-edit" @click="addSubMenu('0')">
|
<el-button class="filter-item" type="primary" icon="el-icon-edit" @click="addSubMenu('0')" v-permission="'menu:save'">
|
||||||
添加菜单
|
添加菜单
|
||||||
</el-button>
|
</el-button>
|
||||||
<el-button type="primary" icon="el-icon-sort" plain @click="expand">展开/折叠</el-button>
|
<el-button type="primary" icon="el-icon-sort" plain @click="expand">展开/折叠</el-button>
|
||||||
@ -156,6 +156,7 @@ export default {
|
|||||||
{
|
{
|
||||||
title: '添加下级菜单',
|
title: '添加下级菜单',
|
||||||
type: 'text',
|
type: 'text',
|
||||||
|
permission: 'menu:save',
|
||||||
icon: 'el-icon-plus',
|
icon: 'el-icon-plus',
|
||||||
click: (row) => {
|
click: (row) => {
|
||||||
this.addSubMenu(row.id)
|
this.addSubMenu(row.id)
|
||||||
@ -164,6 +165,7 @@ export default {
|
|||||||
{
|
{
|
||||||
title: '修改',
|
title: '修改',
|
||||||
type: 'text',
|
type: 'text',
|
||||||
|
permission: 'menu:save',
|
||||||
icon: 'el-icon-edit',
|
icon: 'el-icon-edit',
|
||||||
click: (row) => {
|
click: (row) => {
|
||||||
this.handleUpdate(row)
|
this.handleUpdate(row)
|
||||||
@ -172,6 +174,7 @@ export default {
|
|||||||
{
|
{
|
||||||
title: '删除',
|
title: '删除',
|
||||||
type: 'text',
|
type: 'text',
|
||||||
|
permission: 'menu:delete',
|
||||||
icon: 'el-icon-delete',
|
icon: 'el-icon-delete',
|
||||||
click: (row) => {
|
click: (row) => {
|
||||||
this.$common.handleDelete({
|
this.$common.handleDelete({
|
||||||
|
@ -1,230 +0,0 @@
|
|||||||
<template>
|
|
||||||
<div class="app-container">
|
|
||||||
|
|
||||||
<el-button class="filter-item" style="margin-bottom:10px;" type="primary" icon="el-icon-edit" @click="addSubMenu('0')">
|
|
||||||
添加菜单
|
|
||||||
</el-button>
|
|
||||||
|
|
||||||
<el-tree :data="menuTreeList"
|
|
||||||
:props="defaultProps"
|
|
||||||
node-key="id"
|
|
||||||
:default-expanded-keys="menuTreeExpandedList"
|
|
||||||
draggable>
|
|
||||||
<span class="custom-tree-node" slot-scope="{ node, data }">
|
|
||||||
<span>{{ node.label }}</span>
|
|
||||||
<span>
|
|
||||||
<el-button
|
|
||||||
type="text"
|
|
||||||
size="mini"
|
|
||||||
style="width: 270px;text-align: left;color: #5a5e66;"
|
|
||||||
@click="() => append(data)">
|
|
||||||
{{ data.url }}
|
|
||||||
</el-button>
|
|
||||||
<el-button
|
|
||||||
type="text"
|
|
||||||
size="mini"
|
|
||||||
style="width: 100px;text-align: left;color: #5a5e66;"
|
|
||||||
@click="() => append(data)">
|
|
||||||
{{ data.permission }}
|
|
||||||
</el-button>
|
|
||||||
<el-button
|
|
||||||
type="text"
|
|
||||||
size="mini"
|
|
||||||
style="width: 100px;text-align: left;color: #5a5e66;"
|
|
||||||
@click="() => append(data)">
|
|
||||||
{{ data.sort }}
|
|
||||||
</el-button>
|
|
||||||
<el-button
|
|
||||||
type="text"
|
|
||||||
size="mini"
|
|
||||||
style="width: 100px;text-align: left;color: #5a5e66;"
|
|
||||||
@click="() => append(data)">
|
|
||||||
{{ data.isShow }}
|
|
||||||
</el-button>
|
|
||||||
<el-button
|
|
||||||
type="text"
|
|
||||||
size="mini"
|
|
||||||
@click="() => append(data)">
|
|
||||||
添加下级菜单
|
|
||||||
</el-button>
|
|
||||||
<el-button
|
|
||||||
type="text"
|
|
||||||
size="mini"
|
|
||||||
@click="() => remove(node, data)">
|
|
||||||
编辑
|
|
||||||
</el-button>
|
|
||||||
<el-button
|
|
||||||
type="text"
|
|
||||||
size="mini"
|
|
||||||
@click="() => remove(node, data)">
|
|
||||||
删除
|
|
||||||
</el-button>
|
|
||||||
</span>
|
|
||||||
</span>
|
|
||||||
</el-tree>
|
|
||||||
|
|
||||||
<el-dialog :title="textMap[dialogStatus]" :visible.sync="dialogFormVisible" :close-on-click-modal="false">
|
|
||||||
<el-form ref="dataForm" :rules="rules" :model="temp" label-position="left" label-width="100px" style="width: 400px; margin-left:50px;">
|
|
||||||
<el-form-item label="菜单名称" prop="name">
|
|
||||||
<el-input v-model="temp.name" />
|
|
||||||
</el-form-item>
|
|
||||||
<el-form-item label="菜单链接" prop="url">
|
|
||||||
<el-input v-model="temp.url" />
|
|
||||||
</el-form-item>
|
|
||||||
<el-form-item label="权限标识" prop="permission">
|
|
||||||
<el-input v-model="temp.permission" />
|
|
||||||
</el-form-item>
|
|
||||||
<el-form-item label="排序" prop="sort">
|
|
||||||
<el-input v-model="temp.sort" />
|
|
||||||
</el-form-item>
|
|
||||||
<el-form-item label="描述">
|
|
||||||
<el-input v-model="temp.descRibe" :autosize="{ minRows: 4, maxRows: 6}" type="textarea" />
|
|
||||||
</el-form-item>
|
|
||||||
<el-form-item label="是否显示">
|
|
||||||
<el-checkbox v-model="temp.isShow">显示</el-checkbox>
|
|
||||||
</el-form-item>
|
|
||||||
</el-form>
|
|
||||||
<div slot="footer" class="dialog-footer">
|
|
||||||
<el-button @click="dialogFormVisible = false">
|
|
||||||
关闭
|
|
||||||
</el-button>
|
|
||||||
<el-button type="primary" @click="save()">
|
|
||||||
确认
|
|
||||||
</el-button>
|
|
||||||
</div>
|
|
||||||
</el-dialog>
|
|
||||||
|
|
||||||
</div>
|
|
||||||
</template>
|
|
||||||
|
|
||||||
<script>
|
|
||||||
|
|
||||||
export default {
|
|
||||||
data() {
|
|
||||||
return {
|
|
||||||
menuTreeExpandedList:[],
|
|
||||||
menuTreeList:[],
|
|
||||||
defaultProps: {
|
|
||||||
children: 'children',
|
|
||||||
label: 'name'
|
|
||||||
},
|
|
||||||
dialogFormVisible: false,
|
|
||||||
dialogStatus: '',
|
|
||||||
textMap: {
|
|
||||||
update: '修改',
|
|
||||||
create: '添加'
|
|
||||||
},
|
|
||||||
temp: this.getTemp(),
|
|
||||||
listConfigDialogVisible: false,
|
|
||||||
formConfigDialogVisible: false,
|
|
||||||
rules: {
|
|
||||||
name: [{ required: true, message: '请输入菜单名称', trigger: 'change' }]
|
|
||||||
}
|
|
||||||
}
|
|
||||||
},
|
|
||||||
created(){
|
|
||||||
this.getMenuTreeList();
|
|
||||||
},
|
|
||||||
methods: {
|
|
||||||
getMenuTreeList(){
|
|
||||||
this.$get('menu/tree', { pid: this.temp.pid }).then(res => {
|
|
||||||
this.menuTreeList = res.data.list
|
|
||||||
this.menuTreeExpandedList = this.getMenuId(this.menuTreeList);
|
|
||||||
console.log(this.menuTreeList)
|
|
||||||
console.log(this.menuTreeExpandedList)
|
|
||||||
})
|
|
||||||
},
|
|
||||||
getMenuId(menuArr){
|
|
||||||
let idArr = [];
|
|
||||||
if (menuArr != null && menuArr.length > 0){
|
|
||||||
for (let i = 0; i < menuArr.length; i++) {
|
|
||||||
idArr.push(menuArr[i].id);
|
|
||||||
idArr.push(...this.getMenuId(menuArr[i].children));
|
|
||||||
}
|
|
||||||
}
|
|
||||||
return idArr;
|
|
||||||
},
|
|
||||||
getTemp() {
|
|
||||||
return {
|
|
||||||
id: '',
|
|
||||||
name: '',
|
|
||||||
url: '',
|
|
||||||
permission: '',
|
|
||||||
sort: 0,
|
|
||||||
descRibe: '',
|
|
||||||
isShow: true,
|
|
||||||
pid: ''
|
|
||||||
}
|
|
||||||
},
|
|
||||||
resetTemp() {
|
|
||||||
this.temp = this.getTemp()
|
|
||||||
},
|
|
||||||
getSort() {
|
|
||||||
this.$get('menu/sort', { pid: this.temp.pid }).then(res => {
|
|
||||||
this.temp.sort = res.data
|
|
||||||
})
|
|
||||||
},
|
|
||||||
addSubMenu(id) {
|
|
||||||
this.resetTemp()
|
|
||||||
this.temp.pid = id
|
|
||||||
this.temp.id = this.$common.uuid()
|
|
||||||
this.getSort()
|
|
||||||
this.dialogStatus = 'create'
|
|
||||||
this.dialogFormVisible = true
|
|
||||||
this.$nextTick(() => {
|
|
||||||
this.$refs['dataForm'].clearValidate()
|
|
||||||
})
|
|
||||||
},
|
|
||||||
save() {
|
|
||||||
this.$refs['dataForm'].validate((valid) => {
|
|
||||||
if (valid) {
|
|
||||||
this.temp.isShow = this.temp.isShow === true ? 1 : 0
|
|
||||||
this.$post('menu/save', this.temp).then(() => {
|
|
||||||
this.reloadTable()
|
|
||||||
this.dialogFormVisible = false
|
|
||||||
this.$notify({
|
|
||||||
title: '成功',
|
|
||||||
message: (this.dialogStatus === 'create' ? '创建' : '修改') + '成功',
|
|
||||||
type: 'success',
|
|
||||||
duration: 2000
|
|
||||||
})
|
|
||||||
})
|
|
||||||
}
|
|
||||||
})
|
|
||||||
},
|
|
||||||
reloadTable() {
|
|
||||||
this.$refs.table.reloadList()
|
|
||||||
},
|
|
||||||
handleUpdate(row) {
|
|
||||||
for (var t in this.temp) {
|
|
||||||
if (t === 'isShow') {
|
|
||||||
if (row[t] === 1) {
|
|
||||||
this.temp[t] = true
|
|
||||||
} else {
|
|
||||||
this.temp[t] = false
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
this.temp[t] = row[t]
|
|
||||||
}
|
|
||||||
}
|
|
||||||
this.dialogStatus = 'update'
|
|
||||||
this.dialogFormVisible = true
|
|
||||||
this.$nextTick(() => {
|
|
||||||
this.$refs['dataForm'].clearValidate()
|
|
||||||
})
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
</script>
|
|
||||||
|
|
||||||
<style>
|
|
||||||
.custom-tree-node {
|
|
||||||
flex: 1;
|
|
||||||
display: flex;
|
|
||||||
align-items: center;
|
|
||||||
justify-content: space-between;
|
|
||||||
font-size: 14px;
|
|
||||||
padding-right: 8px;
|
|
||||||
}
|
|
||||||
</style>
|
|
@ -1,170 +0,0 @@
|
|||||||
<template>
|
|
||||||
<div class="app-container">
|
|
||||||
|
|
||||||
<el-button class="filter-item" style="margin-bottom:10px;" type="primary" icon="el-icon-edit" @click="addSubMenu('0')">
|
|
||||||
添加菜单
|
|
||||||
</el-button>
|
|
||||||
|
|
||||||
<vxe-grid v-bind="gridOptions" @form-submit="findList"></vxe-grid>
|
|
||||||
|
|
||||||
<el-dialog :title="textMap[dialogStatus]" :visible.sync="dialogFormVisible" :close-on-click-modal="false">
|
|
||||||
<el-form ref="dataForm" :rules="rules" :model="temp" label-position="left" label-width="100px" style="width: 400px; margin-left:50px;">
|
|
||||||
<el-form-item label="菜单名称" prop="name">
|
|
||||||
<el-input v-model="temp.name" />
|
|
||||||
</el-form-item>
|
|
||||||
<el-form-item label="菜单链接" prop="url">
|
|
||||||
<el-input v-model="temp.url" />
|
|
||||||
</el-form-item>
|
|
||||||
<el-form-item label="权限标识" prop="permission">
|
|
||||||
<el-input v-model="temp.permission" />
|
|
||||||
</el-form-item>
|
|
||||||
<el-form-item label="排序" prop="sort">
|
|
||||||
<el-input v-model="temp.sort" />
|
|
||||||
</el-form-item>
|
|
||||||
<el-form-item label="描述">
|
|
||||||
<el-input v-model="temp.descRibe" :autosize="{ minRows: 4, maxRows: 6}" type="textarea" />
|
|
||||||
</el-form-item>
|
|
||||||
<el-form-item label="是否显示">
|
|
||||||
<el-checkbox v-model="temp.isShow">显示</el-checkbox>
|
|
||||||
</el-form-item>
|
|
||||||
</el-form>
|
|
||||||
<div slot="footer" class="dialog-footer">
|
|
||||||
<el-button @click="dialogFormVisible = false">
|
|
||||||
关闭
|
|
||||||
</el-button>
|
|
||||||
<el-button type="primary" @click="save()">
|
|
||||||
确认
|
|
||||||
</el-button>
|
|
||||||
</div>
|
|
||||||
</el-dialog>
|
|
||||||
|
|
||||||
</div>
|
|
||||||
</template>
|
|
||||||
|
|
||||||
<script>
|
|
||||||
|
|
||||||
export default {
|
|
||||||
data() {
|
|
||||||
return {
|
|
||||||
gridOptions: {
|
|
||||||
resizable: true,
|
|
||||||
border: true,
|
|
||||||
showOverflow: true,
|
|
||||||
loading: false,
|
|
||||||
height: 400,
|
|
||||||
exportConfig: {},
|
|
||||||
formConfig: {
|
|
||||||
data: {
|
|
||||||
name: '',
|
|
||||||
sex: ''
|
|
||||||
},
|
|
||||||
items: [
|
|
||||||
{ field: 'name', title: '菜单名称', itemRender: { name: '$input', props: { placeholder: '请输入名称' } } },
|
|
||||||
{ field: 'url', title: '路径', titlePrefix: { message: '输入存在的路径', icon: 'fa fa-info-circle' }, itemRender: { name: '$input', pops: { placeholder: '请输入名称' } } },
|
|
||||||
{ itemRender: { name: '$buttons', children: [{ props: { type: 'submit', content: '查询', status: 'primary' } }, { props: { type: 'reset', content: '重置' } }] } }
|
|
||||||
]
|
|
||||||
},
|
|
||||||
toolbarConfig: {
|
|
||||||
export: true,
|
|
||||||
custom: true
|
|
||||||
},
|
|
||||||
columns: [
|
|
||||||
{ type: 'seq', width: 60 },
|
|
||||||
{ type: 'checkbox', width: 60 },
|
|
||||||
{ field: 'name', title: '菜单名称' , showOverflow: true },
|
|
||||||
{ field: 'url', title: '路径' , showOverflow: true },
|
|
||||||
{ field: 'permission', title: '权限标识' },
|
|
||||||
{ field: 'sort', title: '排序' },
|
|
||||||
{ field: 'isShow', title: '是否显示' },
|
|
||||||
{ title: '操作' }
|
|
||||||
],
|
|
||||||
data: []
|
|
||||||
},
|
|
||||||
dialogFormVisible: false,
|
|
||||||
dialogStatus: '',
|
|
||||||
textMap: {
|
|
||||||
update: '修改',
|
|
||||||
create: '添加'
|
|
||||||
},
|
|
||||||
temp: this.getTemp(),
|
|
||||||
listConfigDialogVisible: false,
|
|
||||||
formConfigDialogVisible: false,
|
|
||||||
rules: {
|
|
||||||
name: [{ required: true, message: '请输入菜单名称', trigger: 'change' }]
|
|
||||||
}
|
|
||||||
}
|
|
||||||
},
|
|
||||||
methods: {
|
|
||||||
getTemp() {
|
|
||||||
return {
|
|
||||||
id: '',
|
|
||||||
name: '',
|
|
||||||
url: '',
|
|
||||||
permission: '',
|
|
||||||
sort: 0,
|
|
||||||
descRibe: '',
|
|
||||||
isShow: true,
|
|
||||||
pid: ''
|
|
||||||
}
|
|
||||||
},
|
|
||||||
resetTemp() {
|
|
||||||
this.temp = this.getTemp()
|
|
||||||
},
|
|
||||||
getSort() {
|
|
||||||
this.$get('menu/sort', { pid: this.temp.pid }).then(res => {
|
|
||||||
this.temp.sort = res.data
|
|
||||||
})
|
|
||||||
},
|
|
||||||
addSubMenu(id) {
|
|
||||||
this.resetTemp()
|
|
||||||
this.temp.pid = id
|
|
||||||
this.temp.id = this.$common.uuid()
|
|
||||||
this.getSort()
|
|
||||||
this.dialogStatus = 'create'
|
|
||||||
this.dialogFormVisible = true
|
|
||||||
this.$nextTick(() => {
|
|
||||||
this.$refs['dataForm'].clearValidate()
|
|
||||||
})
|
|
||||||
},
|
|
||||||
save() {
|
|
||||||
this.$refs['dataForm'].validate((valid) => {
|
|
||||||
if (valid) {
|
|
||||||
this.temp.isShow = this.temp.isShow === true ? 1 : 0
|
|
||||||
this.$post('menu/save', this.temp).then(() => {
|
|
||||||
this.reloadTable()
|
|
||||||
this.dialogFormVisible = false
|
|
||||||
this.$notify({
|
|
||||||
title: '成功',
|
|
||||||
message: (this.dialogStatus === 'create' ? '创建' : '修改') + '成功',
|
|
||||||
type: 'success',
|
|
||||||
duration: 2000
|
|
||||||
})
|
|
||||||
})
|
|
||||||
}
|
|
||||||
})
|
|
||||||
},
|
|
||||||
reloadTable() {
|
|
||||||
this.$refs.table.reloadList()
|
|
||||||
},
|
|
||||||
handleUpdate(row) {
|
|
||||||
for (var t in this.temp) {
|
|
||||||
if (t === 'isShow') {
|
|
||||||
if (row[t] === 1) {
|
|
||||||
this.temp[t] = true
|
|
||||||
} else {
|
|
||||||
this.temp[t] = false
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
this.temp[t] = row[t]
|
|
||||||
}
|
|
||||||
}
|
|
||||||
this.dialogStatus = 'update'
|
|
||||||
this.dialogFormVisible = true
|
|
||||||
this.$nextTick(() => {
|
|
||||||
this.$refs['dataForm'].clearValidate()
|
|
||||||
})
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
</script>
|
|
@ -22,7 +22,7 @@
|
|||||||
</div>
|
</div>
|
||||||
|
|
||||||
<el-row class="toolbar-container">
|
<el-row class="toolbar-container">
|
||||||
<el-button class="filter-item" type="primary" icon="el-icon-edit" @click="addSubOffice('0')">
|
<el-button class="filter-item" type="primary" icon="el-icon-edit" @click="addSubOffice('0')" v-permission="'office:save'">
|
||||||
添加机构
|
添加机构
|
||||||
</el-button>
|
</el-button>
|
||||||
<el-button type="primary" icon="el-icon-sort" plain @click="expand">展开/折叠</el-button>
|
<el-button type="primary" icon="el-icon-sort" plain @click="expand">展开/折叠</el-button>
|
||||||
@ -155,6 +155,7 @@ export default {
|
|||||||
{
|
{
|
||||||
title: '添加下级机构',
|
title: '添加下级机构',
|
||||||
type: 'text',
|
type: 'text',
|
||||||
|
permission: 'office:save',
|
||||||
icon: 'el-icon-plus',
|
icon: 'el-icon-plus',
|
||||||
click: (row) => {
|
click: (row) => {
|
||||||
this.addSubOffice(row.id)
|
this.addSubOffice(row.id)
|
||||||
@ -163,6 +164,7 @@ export default {
|
|||||||
{
|
{
|
||||||
title: '修改',
|
title: '修改',
|
||||||
type: 'text',
|
type: 'text',
|
||||||
|
permission: 'office:save',
|
||||||
icon: 'el-icon-edit',
|
icon: 'el-icon-edit',
|
||||||
click: (row) => {
|
click: (row) => {
|
||||||
this.handleUpdate(row)
|
this.handleUpdate(row)
|
||||||
@ -171,6 +173,7 @@ export default {
|
|||||||
{
|
{
|
||||||
title: '删除',
|
title: '删除',
|
||||||
type: 'text',
|
type: 'text',
|
||||||
|
permission: 'office:delete',
|
||||||
icon: 'el-icon-delete',
|
icon: 'el-icon-delete',
|
||||||
click: (row) => {
|
click: (row) => {
|
||||||
this.$common.handleDelete({
|
this.$common.handleDelete({
|
||||||
|
@ -29,7 +29,7 @@
|
|||||||
<el-button v-permission="'user:save'" class="filter-item" type="primary" icon="el-icon-edit" @click="handleCreate">
|
<el-button v-permission="'user:save'" class="filter-item" type="primary" icon="el-icon-edit" @click="handleCreate">
|
||||||
添加
|
添加
|
||||||
</el-button>
|
</el-button>
|
||||||
<mb-button :el="{ plain: true }" :request-url="'user/delete'" :btn-type="'delete'" :request-data="{ id: ids }" :after-handler="reloadTable" />
|
<mb-button v-permission="'user:delete'" :el="{ plain: true }" :request-url="'user/delete'" :btn-type="'delete'" :request-data="{ id: ids }" :after-handler="reloadTable" />
|
||||||
</el-row>
|
</el-row>
|
||||||
|
|
||||||
<mb-table ref="table" v-bind="tableOptions" @selection-change="selectionChange" />
|
<mb-table ref="table" v-bind="tableOptions" @selection-change="selectionChange" />
|
||||||
|
Loading…
Reference in New Issue
Block a user