autz.ts 650 B

123456789101112131415161718192021222324252627282930313233343536373839
  1. import { model } from '@formily/reactive';
  2. const autzModel = model<{
  3. autzTarget: {
  4. id: string;
  5. name: string;
  6. type: 'user' | 'role';
  7. };
  8. visible: boolean;
  9. }>({
  10. autzTarget: {
  11. id: '',
  12. name: '',
  13. type: 'user',
  14. },
  15. visible: false,
  16. });
  17. export default autzModel;
  18. export const AuthorizationModel = model<{
  19. data: PermissionItem[];
  20. checkedPermission: Map<string, Set<string>>;
  21. filterParam: {
  22. type: string;
  23. name: string;
  24. };
  25. checkAll: boolean;
  26. spinning: boolean;
  27. }>({
  28. data: [],
  29. checkedPermission: new Map(),
  30. filterParam: {
  31. type: 'all',
  32. name: '',
  33. },
  34. checkAll: false,
  35. spinning: true,
  36. });