新功能: 角色授权页面,获取菜单
This commit is contained in:
@@ -33,8 +33,8 @@ class MenuSerializer(CustomModelSerializer):
|
||||
def get_hasChild(self, instance):
|
||||
hasChild = Menu.objects.filter(parent=instance.id)
|
||||
if hasChild:
|
||||
return True
|
||||
return False
|
||||
return True
|
||||
|
||||
class Meta:
|
||||
model = Menu
|
||||
|
||||
@@ -43,7 +43,7 @@ function createService() {
|
||||
//如果不需要解包
|
||||
return dataAxios;
|
||||
}
|
||||
return dataAxios.data;
|
||||
return dataAxios;
|
||||
default:
|
||||
// 不是正确的 code
|
||||
errorCreate(`${dataAxios.msg}: ${response.config.url}`);
|
||||
|
||||
@@ -1,12 +1,11 @@
|
||||
import {CrudOptions, AddReq, DelReq, EditReq, dict, CrudExpose} from '@fast-crud/fast-crud';
|
||||
import _ from 'lodash-es';
|
||||
|
||||
interface CreateCrudOptionsTypes {
|
||||
crudOptions: CrudOptions;
|
||||
}
|
||||
|
||||
//此处为crudOptions配置
|
||||
export const createCrudOptions = function ({crudExpose}: {crudExpose: CrudExpose}): CreateCrudOptionsTypes {
|
||||
export const createCrudOptions = function ({crudExpose,rolePermission}: {crudExpose: CrudExpose,rolePermission:any}): CreateCrudOptionsTypes {
|
||||
//本地模拟后台crud接口方法 ----开始
|
||||
const records = [
|
||||
{
|
||||
@@ -64,6 +63,8 @@ export const createCrudOptions = function ({crudExpose}: {crudExpose: CrudExpose
|
||||
return req.form;
|
||||
};
|
||||
//本地模拟后台crud接口方法 ----结束
|
||||
|
||||
|
||||
return {
|
||||
crudOptions: {
|
||||
request: {
|
||||
@@ -73,7 +74,20 @@ export const createCrudOptions = function ({crudExpose}: {crudExpose: CrudExpose
|
||||
delRequest,
|
||||
},
|
||||
rowHandle: {
|
||||
buttons: {},
|
||||
buttons: {
|
||||
custom: {
|
||||
text: "权限配置",
|
||||
type:'warning',
|
||||
tooltip: {
|
||||
placement: "top",
|
||||
content: "删除"
|
||||
},
|
||||
click: () => {
|
||||
rolePermission.value.drawer=true
|
||||
rolePermission.value.initGet()
|
||||
}
|
||||
}
|
||||
},
|
||||
},
|
||||
form: {
|
||||
col: {span: 24},
|
||||
|
||||
Reference in New Issue
Block a user