def GetMenuToInterface(menu_id): result = MenuModel().GetMenuToInterfaceRequest(menu_id=menu_id) if type(result).__name__ == 'str': return ResultDeal(msg=result, code=-1) return ResultDeal(data=result)
def GetMenuToInterface(): result = MenuModel().GetMenuToInterfaceRequest(request.args.get('menu_id')) if type(result).__name__ == 'str': return ResultDeal(msg=result, code=-1) return ResultDeal(data=result)
def DelMenu(): result = MenuModel().DelMenuRequest(menu_id=request.form.get('menu_id')) if type(result).__name__ == 'str': return ResultDeal(msg=result, code=-1) return ResultDeal(data=result)
def CreateMenu(): result = MenuModel().CreateMenuRequest(request.form) if type(result).__name__ == 'str': return ResultDeal(msg=result, code=-1) return ResultDeal(data=result)
def LockMenu(): result = MenuModel().LockMenuRequest( menu_id=request.form.get('menu_id'), is_disabled=True if request.form.get('is_disabled') == 'true' else False ) if type(result).__name__ == 'str': return ResultDeal(msg=result, code=-1) return ResultDeal(data=result)
def QueryMenuByParam(): params = {} if request.form.get('disable') != None: params['disable'] = request.form.get('disable') if request.form.get('role_id'): params['role_id'] = request.form.get('role_id') result = MenuModel().QueryMenuByParamRequest( params=params, is_interface=request.form.get('is_interface')) if type(result).__name__ == 'str': return ResultDeal(msg=result, code=-1) return ResultDeal(data=result)
def ModifyMenu(): params = { 'pid': request.form.get('pid', '0'), 'title': request.form.get('title'), 'path': request.form.get('path'), 'icon': request.form.get('icon'), 'mark': request.form.get('mark'), 'sort': request.form.get('sort') } result = MenuModel().ModifyMenuRequest(menu_id=request.form.get('menu_id'), params=params) if type(result).__name__ == 'str': return ResultDeal(msg=result, code=-1) return ResultDeal(data=result)
def QueryMenuByParam(): params = {} if request.form.get('is_disabled'): params['is_disabled'] = True if request.form.get('is_disabled') == 'true' else False if request.form.get('role_id'): params['role_id'] = request.form.get('role_id') result = MenuModel().QueryMenuByParamRequest( params=params, is_interface=True if request.form.get('is_interface') == 'true' else False ) if type(result).__name__ == 'str': return ResultDeal(msg=result, code=-1) return ResultDeal(data=result)
def ModifyMenu(): params = { 'pid': request.form.get('pid', '0'), 'title': request.form.get('title'), 'path': request.form.get('path'), 'icon': request.form.get('icon'), 'mark': request.form.get('mark'), 'sort': request.form.get('sort'), 'component': request.form.get('component'), 'componentPath': request.form.get('componentPath'), 'name': request.form.get('name'), 'cache': True if request.form.get('cache') == 'true' else False, 'is_disabled': True if request.form.get('is_disabled') == 'true' else False } result = MenuModel().ModifyMenuRequest(menu_id=request.form.get('menu_id'), params=params) if type(result).__name__ == 'str': return ResultDeal(msg=result, code=-1) return ResultDeal(data=result)