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