Commit 7b8ca0ac authored by wanli's avatar wanli

:sparkles: feat(view/menu.py): 更新菜单模块view

parent d28a9cda
......@@ -65,6 +65,7 @@ api.add_resource(monitorImage.MonitorImageResourceList, '/monitorImage')
api.add_resource(monitorEvm.MonitorEvmResource, '/monitorEvm/<string:uuid>')
api.add_resource(monitorEvm.MonitorEvmResourceList, '/monitorEvm')
api.add_resource(menu.MenuList, '/menu')
api.add_resource(menu.Batch, '/menu/delete/batch')
api.add_resource(menu.Create, '/menu/create')
api.add_resource(menu.Treelist, '/menu/treeList')
......
......@@ -18,6 +18,185 @@ from application.signal_manager import signalManager
from webcreator.log import logger
from webcreator.response import ResponseCode, response_result
class MenuList(Resource):
def __init__(self):
pass
# 特殊参数,即不是从json获取参数的接口,可以将这个注释打开
self.parser = RequestParser()
def get(self):
# 特殊参数,即不是从json获取参数的接口,可以将这个注释打开
# self.parser.add_argument("page", type=int, location="args", default=1)
# self.parser.add_argument("pageSize", type=int, location="args", default=15)
# args = self.parser.parse_args()
result = [
{
"id": "1044886626813353984",
"parentId": "0",
"name": "dashboard",
"path": "/dashboard",
"icon": "dashboard",
"leaf": False,
"children": [
{
"id": "1044886629921333248",
"parentId": "1044886626813353984",
"name": "analysis",
"path": "/dashboard/analysis",
"leaf": True,
"children": []
},
{
"id": "1044886629921333248",
"parentId": "1044886626813353984",
"name": "workplace",
"path": "/dashboard/workplace",
"leaf": True,
"children": []
}
]
},
{
"id": "1044886626813353984",
"parentId": "0",
"name": "system",
"path": "/system",
"icon": "setting",
"leaf": False,
"children": [
{
"id": "1044886629921333248",
"parentId": "1044886626813353984",
"name": "setting",
"path": "/system/setting",
"leaf": False,
"children": [
{
"id": "1044886630026190848",
"parentId": "1044886629921333248",
"name": "menu",
"path": "/system/setting/menu",
"leaf": True,
"children": []
},
{
"id": "1044886630122659840",
"parentId": "1044886629921333248",
"name": "module",
"path": "/system/setting/module",
"leaf": True,
"children": []
},
{
"id": "1044886630122659841",
"parentId": "1044886629921333248",
"name": "file-manager",
"path": "/system/setting/file-manager",
"leaf": True,
"children": []
}
]
},
{
"id": "1044886629921333248",
"parentId": "1044886626813353984",
"name": "role",
"path": "/system/role",
"leaf": True
},
{
"id": "1044886629921333248",
"parentId": "1044886626813353984",
"name": "admin",
"path": "/system/admin",
"leaf": True
}
]
},
{
"id": "1044886626813353984",
"icon": "shop",
"parentId": "0",
"name": "application",
"path": "/application",
"leaf": False,
"children": [
{
"id": "1044886629921333248",
"parentId": "1044886626813353984",
"name": "index",
"path": "/application/index",
"leaf": True,
"children": []
},
{
"id": "1044886629921333248",
"parentId": "1044886626813353984",
"name": "manager",
"path": "/application/manager",
"leaf": True,
"children": []
}
]
},
{
"id": "1044886626813353984",
"icon": "usb",
"parentId": "0",
"name": "device",
"path": "/device",
"leaf": False,
"children": [
{
"id": "1044886629921333248",
"parentId": "1044886626813353984",
"name": "index",
"path": "/device/index",
"leaf": True,
"children": []
}
]
},
{
"id": "1044886626813353984",
"icon": "tool",
"parentId": "0",
"name": "tools",
"path": "/tools",
"leaf": False,
"children": [
{
"id": "1044886629921333248",
"parentId": "1044886626813353984",
"name": "monitor",
"path": "/tools/monitor",
"leaf": True,
"children": []
},
{
"id": "1044886629921333248",
"parentId": "1044886626813353984",
"name": "index",
"path": "/tools/index",
"leaf": True,
"children": []
}
]
}
]
return response_result(ResponseCode.HTTP_SUCCESS, data=result)
def post(self):
try:
json_payload = request.json
logger.warn(json_payload)
return response_result(ResponseCode.HTTP_INVAILD_REQUEST)
except Exception as e:
current_app.logger.error(e)
return response_result(ResponseCode.HTTP_SERVER_ERROR)
class Batch(Resource):
def __init__(self):
self.parser = RequestParser()
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment