@nocobase/client 0.7.0-alpha.2 → 0.7.0-alpha.20
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/esm/acl/Configuration/RoleConfigure.js +4 -4
- package/esm/acl/Configuration/RoleConfigure.js.map +1 -1
- package/esm/acl/Configuration/schemas/roles.js +1 -1
- package/esm/acl/Configuration/schemas/roles.js.map +1 -1
- package/esm/locale/index.d.ts +5 -0
- package/esm/locale/zh_CN.d.ts +5 -0
- package/esm/locale/zh_CN.js +5 -0
- package/esm/locale/zh_CN.js.map +1 -1
- package/esm/schema-component/antd/menu/Menu.js +1 -1
- package/esm/schema-component/antd/menu/Menu.js.map +1 -1
- package/esm/schema-initializer/buttons/BlockInitializers.d.ts +2 -11
- package/esm/schema-initializer/buttons/BlockInitializers.js +2 -0
- package/esm/schema-initializer/buttons/BlockInitializers.js.map +1 -1
- package/esm/workflow/calculators.js +2 -4
- package/esm/workflow/calculators.js.map +1 -1
- package/esm/workflow/nodes/calculation.d.ts +1 -1
- package/esm/workflow/nodes/calculation.js +9 -3
- package/esm/workflow/nodes/calculation.js.map +1 -1
- package/esm/workflow/nodes/condition.d.ts +3 -3
- package/esm/workflow/nodes/condition.js +15 -9
- package/esm/workflow/nodes/condition.js.map +1 -1
- package/esm/workflow/nodes/create.d.ts +3 -3
- package/esm/workflow/nodes/create.js +5 -5
- package/esm/workflow/nodes/create.js.map +1 -1
- package/esm/workflow/nodes/destroy.d.ts +2 -2
- package/esm/workflow/nodes/destroy.js +3 -3
- package/esm/workflow/nodes/destroy.js.map +1 -1
- package/esm/workflow/nodes/index.d.ts +1 -1
- package/esm/workflow/nodes/index.js +75 -56
- package/esm/workflow/nodes/index.js.map +1 -1
- package/esm/workflow/nodes/parallel.d.ts +2 -2
- package/esm/workflow/nodes/parallel.js +11 -5
- package/esm/workflow/nodes/parallel.js.map +1 -1
- package/esm/workflow/nodes/query.d.ts +3 -3
- package/esm/workflow/nodes/query.js +5 -5
- package/esm/workflow/nodes/query.js.map +1 -1
- package/esm/workflow/nodes/update.d.ts +2 -2
- package/esm/workflow/nodes/update.js +3 -3
- package/esm/workflow/nodes/update.js.map +1 -1
- package/esm/workflow/schemas/collection.js +10 -6
- package/esm/workflow/schemas/collection.js.map +1 -1
- package/esm/workflow/schemas/workflows.js +20 -12
- package/esm/workflow/schemas/workflows.js.map +1 -1
- package/esm/workflow/triggers/index.js +19 -9
- package/esm/workflow/triggers/index.js.map +1 -1
- package/esm/workflow/triggers/model.d.ts +18 -4
- package/esm/workflow/triggers/model.js +47 -9
- package/esm/workflow/triggers/model.js.map +1 -1
- package/lib/acl/Configuration/RoleConfigure.js +4 -4
- package/lib/acl/Configuration/RoleConfigure.js.map +1 -1
- package/lib/acl/Configuration/schemas/roles.js +1 -1
- package/lib/acl/Configuration/schemas/roles.js.map +1 -1
- package/lib/locale/index.d.ts +5 -0
- package/lib/locale/zh_CN.d.ts +5 -0
- package/lib/locale/zh_CN.js +5 -0
- package/lib/locale/zh_CN.js.map +1 -1
- package/lib/schema-component/antd/menu/Menu.js +1 -1
- package/lib/schema-component/antd/menu/Menu.js.map +1 -1
- package/lib/schema-initializer/buttons/BlockInitializers.d.ts +2 -11
- package/lib/schema-initializer/buttons/BlockInitializers.js +2 -0
- package/lib/schema-initializer/buttons/BlockInitializers.js.map +1 -1
- package/lib/workflow/calculators.js +2 -4
- package/lib/workflow/calculators.js.map +1 -1
- package/lib/workflow/nodes/calculation.d.ts +1 -1
- package/lib/workflow/nodes/calculation.js +9 -3
- package/lib/workflow/nodes/calculation.js.map +1 -1
- package/lib/workflow/nodes/condition.d.ts +3 -3
- package/lib/workflow/nodes/condition.js +13 -7
- package/lib/workflow/nodes/condition.js.map +1 -1
- package/lib/workflow/nodes/create.d.ts +3 -3
- package/lib/workflow/nodes/create.js +5 -5
- package/lib/workflow/nodes/create.js.map +1 -1
- package/lib/workflow/nodes/destroy.d.ts +2 -2
- package/lib/workflow/nodes/destroy.js +3 -3
- package/lib/workflow/nodes/destroy.js.map +1 -1
- package/lib/workflow/nodes/index.d.ts +1 -1
- package/lib/workflow/nodes/index.js +79 -60
- package/lib/workflow/nodes/index.js.map +1 -1
- package/lib/workflow/nodes/parallel.d.ts +2 -2
- package/lib/workflow/nodes/parallel.js +10 -4
- package/lib/workflow/nodes/parallel.js.map +1 -1
- package/lib/workflow/nodes/query.d.ts +3 -3
- package/lib/workflow/nodes/query.js +5 -5
- package/lib/workflow/nodes/query.js.map +1 -1
- package/lib/workflow/nodes/update.d.ts +2 -2
- package/lib/workflow/nodes/update.js +3 -3
- package/lib/workflow/nodes/update.js.map +1 -1
- package/lib/workflow/schemas/collection.js +10 -6
- package/lib/workflow/schemas/collection.js.map +1 -1
- package/lib/workflow/schemas/workflows.js +20 -12
- package/lib/workflow/schemas/workflows.js.map +1 -1
- package/lib/workflow/triggers/index.js +19 -9
- package/lib/workflow/triggers/index.js.map +1 -1
- package/lib/workflow/triggers/model.d.ts +18 -4
- package/lib/workflow/triggers/model.js +47 -9
- package/lib/workflow/triggers/model.js.map +1 -1
- package/package.json +4 -4
- package/src/acl/Configuration/RoleConfigure.tsx +4 -4
- package/src/acl/Configuration/schemas/roles.ts +1 -1
- package/src/locale/zh_CN.ts +5 -1
- package/src/schema-component/antd/menu/Menu.tsx +2 -1
- package/src/schema-initializer/buttons/BlockInitializers.tsx +2 -0
- package/src/workflow/calculators.tsx +2 -4
- package/src/workflow/nodes/calculation.tsx +4 -3
- package/src/workflow/nodes/condition.tsx +35 -12
- package/src/workflow/nodes/create.tsx +10 -7
- package/src/workflow/nodes/destroy.tsx +3 -3
- package/src/workflow/nodes/index.tsx +64 -59
- package/src/workflow/nodes/parallel.tsx +25 -5
- package/src/workflow/nodes/query.tsx +5 -5
- package/src/workflow/nodes/update.tsx +3 -3
- package/src/workflow/schemas/collection.ts +9 -7
- package/src/workflow/schemas/workflows.ts +20 -12
- package/src/workflow/triggers/index.tsx +11 -9
- package/src/workflow/triggers/model.tsx +48 -9
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"workflows.js","sourceRoot":"","sources":["../../../src/workflow/schemas/workflows.ts"],"names":[],"mappings":"AAGA,IAAM,UAAU,GAAG;IACjB,IAAI,EAAE,WAAW;IACjB,MAAM,EAAE;QACN;YACE,IAAI,EAAE,QAAQ;YACd,IAAI,EAAE,OAAO;YACb,SAAS,EAAE,OAAO;YAClB,QAAQ,EAAE;gBACR,KAAK,EAAE,MAAM;gBACb,IAAI,EAAE,QAAQ;gBACd,aAAa,EAAE,OAAO;gBACtB,QAAQ,EAAE,IAAI;aACJ;SACb;QACD,IAAI;QACJ,oBAAoB;QACpB,yBAAyB;QACzB,2BAA2B;QAC3B,gBAAgB;QAChB,mBAAmB;QACnB,sBAAsB;QACtB,iCAAiC;QACjC,kBAAkB;QAClB,KAAK;QACL;YACE,IAAI,EAAE,QAAQ;YACd,IAAI,EAAE,MAAM;YACZ,SAAS,EAAE,QAAQ;YACnB,QAAQ,EAAE;gBACR,KAAK,EAAE,MAAM;gBACb,IAAI,EAAE,QAAQ;gBACd,aAAa,EAAE,QAAQ;gBACvB,aAAa,EAAE,UAAU;gBACzB,IAAI,EAAE;oBACJ,EAAE,KAAK,EAAE,OAAO,EAAE,KAAK,EAAE,MAAM,EAAE;iBAClC;aACS;SACb;QACD;YACE,IAAI,EAAE,SAAS;YACf,IAAI,EAAE,SAAS;YACf,SAAS,EAAE,OAAO;YAClB,QAAQ,EAAE;gBACR,KAAK,EAAE,IAAI;gBACX,IAAI,EAAE,QAAQ;gBACd,IAAI,EAAE;oBACJ,EAAE,KAAK,EAAE,IAAI,EAAE,KAAK,EAAE,IAAI,EAAE;oBAC5B,EAAE,KAAK,EAAE,IAAI,EAAE,KAAK,EAAE,KAAK,EAAE;iBAC9B;gBACD,aAAa,EAAE,aAAa;gBAC5B,aAAa,EAAE,UAAU;aACf;SACb;KACF;CACF,CAAC;AAEF,MAAM,CAAC,IAAM,cAAc,GAAY;IACrC,IAAI,EAA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Aa,EAAE,iBAAiB;4DAChC,aAAa,EAAE,UAAU;yDAC1B;wDACD,MAAM,EAAE;4DACN,IAAI,EAAE,MAAM;4DACZ,aAAa,EAAE,qBAAqB;4DACpC,UAAU,EAAE;gEACV,MAAM,EAAE;oEACN,KAAK,EAAE,mBAAmB;oEAC1B,aAAa,EAAE,QAAQ;oEACvB,mBAAmB,EAAE;wEACnB,SAAS,EAAE,0BAA0B;qEACtC;iEACF;gEACD,MAAM,EAAE;oEACN,KAAK,EAAE,mBAAmB;oEAC1B,aAAa,EAAE,QAAQ;oEACvB,mBAAmB,EAAE;wEACnB,IAAI,EAAE,SAAS;wEACf,SAAS,EAAE,0BAA0B;qEACtC;iEACF;6DACF;yDACF;qDACF;iDACF;6CACF;yCACF;wCACD,YAAY;wCACZ,kBAAkB;wCAClB,gCAAgC;wCAChC,kCAAkC;wCAClC,2BAA2B;wCAC3B,iBAAiB;wCACjB,yCAAyC;wCACzC,iEAAiE;wCACjE,SAAS;wCACT,0DAA0D;wCAC1D,OAAO;wCACP,KAAK;qCACN;iCACF;6BACF;yBACF;qBACF;iBACF;aACF;SACF;KACF;CACF,CAAC","sourcesContent":["import { ISchema } from '@formily/react';\nimport { executionSchema } from './executions';\n\nconst collection = {\n name: 'workflows',\n fields: [\n {\n type: 'string',\n name: 'title',\n interface: 'input',\n uiSchema: {\n title: '流程名称',\n type: 'string',\n 'x-component': 'Input',\n required: true,\n } as ISchema,\n },\n // {\n // type: 'string',\n // name: 'description',\n // interface: 'textarea',\n // uiSchema: {\n // title: '描述',\n // type: 'string',\n // 'x-component': 'TextArea',\n // } as ISchema,\n // },\n {\n type: 'string',\n name: 'type',\n interface: 'select',\n uiSchema: {\n title: '触发方式',\n type: 'string',\n 'x-component': 'Select',\n 'x-decorator': 'FormItem',\n enum: [\n { value: 'model', label: '数据变动' }\n ],\n } as ISchema,\n },\n {\n type: 'boolean',\n name: 'enabled',\n interface: 'radio',\n uiSchema: {\n title: '状态',\n type: 'string',\n enum: [\n { label: '启用', value: true },\n { label: '禁用', value: false },\n ],\n 'x-component': 'Radio.Group',\n 'x-decorator': 'FormItem',\n } as ISchema\n }\n ],\n};\n\nexport const workflowSchema: ISchema = {\n type: 'object',\n properties: {\n provider: {\n type: 'void',\n 'x-decorator': 'ResourceActionProvider',\n 'x-decorator-props': {\n collection,\n resourceName: 'workflows',\n request: {\n resource: 'workflows',\n action: 'list',\n params: {\n pageSize: 50,\n filter: {},\n sort: ['createdAt'],\n except: ['config'],\n },\n },\n },\n 'x-component': 'CollectionProvider',\n 'x-component-props': {\n collection,\n },\n properties: {\n actions: {\n type: 'void',\n 'x-component': 'ActionBar',\n 'x-component-props': {\n style: {\n marginBottom: 16,\n },\n },\n properties: {\n delete: {\n type: 'void',\n title: '删除',\n 'x-component': 'Action',\n },\n create: {\n type: 'void',\n title: '添加工作流',\n 'x-component': 'Action',\n 'x-component-props': {\n type: 'primary',\n },\n properties: {\n drawer: {\n type: 'void',\n 'x-component': 'Action.Drawer',\n 'x-decorator': 'Form',\n title: '添加工作流',\n properties: {\n title: {\n 'x-component': 'CollectionField',\n 'x-decorator': 'FormItem',\n },\n description: {\n 'x-component': 'CollectionField',\n 'x-decorator': 'FormItem',\n },\n type: {\n 'x-component': 'CollectionField',\n 'x-decorator': 'FormItem',\n },\n footer: {\n type: 'void',\n 'x-component': 'Action.Drawer.Footer',\n properties: {\n cancel: {\n title: 'Cancel',\n 'x-component': 'Action',\n 'x-component-props': {\n useAction: '{{ cm.useCancelAction }}',\n },\n },\n submit: {\n title: 'Submit',\n 'x-component': 'Action',\n 'x-component-props': {\n type: 'primary',\n useAction: '{{ cm.useCreateAction }}',\n },\n },\n },\n },\n },\n },\n },\n },\n }\n },\n table: {\n type: 'void',\n 'x-component': 'Table.Void',\n 'x-component-props': {\n rowKey: 'id',\n rowSelection: {\n type: 'checkbox',\n },\n useDataSource: '{{ cm.useDataSourceFromRAC }}',\n },\n properties: {\n title: {\n type: 'void',\n 'x-decorator': 'Table.Column.Decorator',\n 'x-component': 'Table.Column',\n properties: {\n title: {\n type: 'string',\n 'x-component': 'CollectionField',\n 'x-read-pretty': true,\n },\n }\n },\n type: {\n type: 'void',\n 'x-decorator': 'Table.Column.Decorator',\n 'x-component': 'Table.Column',\n properties: {\n type: {\n type: 'string',\n 'x-component': 'CollectionField',\n 'x-read-pretty': true,\n },\n }\n },\n enabled: {\n type: 'void',\n 'x-decorator': 'Table.Column.Decorator',\n 'x-component': 'Table.Column',\n properties: {\n enabled: {\n type: 'boolean',\n 'x-component': 'CollectionField',\n 'x-read-pretty': true,\n default: false\n },\n }\n },\n actions: {\n type: 'void',\n title: '{{ t(\"Actions\") }}',\n 'x-component': 'Table.Column',\n properties: {\n actions: {\n type: 'void',\n 'x-component': 'Space',\n 'x-component-props': {\n split: '|',\n },\n properties: {\n config: {\n type: 'void',\n title: '配置流程',\n 'x-component': 'WorkflowLink'\n },\n // executions: {\n // type: 'void',\n // title: '执行历史',\n // 'x-component': 'Action.Link',\n // 'x-component-props': {\n // type: 'primary',\n // },\n // properties: {\n // drawer: {\n // type: 'void',\n // title: '执行历史',\n // 'x-component': 'Action.Drawer',\n // properties: executionSchema\n // }\n // }\n // },\n update: {\n type: 'void',\n title: '{{ t(\"Edit\") }}',\n 'x-component': 'Action.Link',\n 'x-component-props': {\n type: 'primary',\n },\n properties: {\n modal: {\n type: 'void',\n 'x-component': 'Action.Modal',\n 'x-decorator': 'Form',\n 'x-decorator-props': {\n useValues: '{{ cm.useValuesFromRecord }}',\n },\n title: '编辑工作流',\n properties: {\n title: {\n 'x-component': 'CollectionField',\n 'x-decorator': 'FormItem',\n },\n enabled: {\n 'x-component': 'CollectionField',\n 'x-decorator': 'FormItem',\n },\n footer: {\n type: 'void',\n 'x-component': 'Action.Modal.Footer',\n properties: {\n cancel: {\n title: '{{ t(\"Cancel\") }}',\n 'x-component': 'Action',\n 'x-component-props': {\n useAction: '{{ cm.useCancelAction }}',\n },\n },\n submit: {\n title: '{{ t(\"Submit\") }}',\n 'x-component': 'Action',\n 'x-component-props': {\n type: 'primary',\n useAction: '{{ cm.useUpdateAction }}',\n },\n },\n },\n },\n },\n },\n },\n },\n // delete: {\n // type: 'void',\n // title: '{{ t(\"Delete\") }}',\n // 'x-component': 'Action.Link',\n // 'x-component-props': {\n // confirm: {\n // title: \"{{t('Delete record')}}\",\n // content: \"{{t('Are you sure you want to delete it?')}}\",\n // },\n // useAction: '{{ cm.useDestroyActionAndRefreshCM }}',\n // },\n // },\n }\n }\n }\n }\n }\n }\n }\n }\n }\n};\n"]}
|
|
1
|
+
{"version":3,"file":"workflows.js","sourceRoot":"","sources":["../../../src/workflow/schemas/workflows.ts"],"names":[],"mappings":"AAGA,IAAM,UAAU,GAAG;IACjB,IAAI,EAAE,WAAW;IACjB,MAAM,EAAE;QACN;YACE,IAAI,EAAE,QAAQ;YACd,IAAI,EAAE,OAAO;YACb,SAAS,EAAE,OAAO;YAClB,QAAQ,EAAE;gBACR,KAAK,EAAE,MAAM;gBACb,IAAI,EAAE,QAAQ;gBACd,aAAa,EAAE,OAAO;gBACtB,QAAQ,EAAE,IAAI;aACJ;SACb;QACD;YACE,IAAI,EAAE,QAAQ;YACd,IAAI,EAAE,MAAM;YACZ,SAAS,EAAE,QAAQ;YACnB,QAAQ,EAAE;gBACR,KAAK,EAAE,MAAM;gBACb,IAAI,EAAE,QAAQ;gBACd,aAAa,EAAE,QAAQ;gBACvB,aAAa,EAAE,UAAU;gBACzB,IAAI,EAAE;oBACJ,EAAE,KAAK,EAAE,OAAO,EAAE,KAAK,EAAE,MAAM,EAAE;iBAClC;gBACD,QAAQ,EAAE,IAAI;aACJ;SACb;QACD;YACE,IAAI,EAAE,QAAQ;YACd,IAAI,EAAE,aAAa;YACnB,SAAS,EAAE,UAAU;YACrB,QAAQ,EAAE;gBACR,KAAK,EAAE,IAAI;gBACX,IAAI,EAAE,QAAQ;gBACd,aAAa,EAAE,gBAAgB;aACrB;SACb;QACD;YACE,IAAI,EAAE,SAAS;YACf,IAAI,EA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":["import { ISchema } from '@formily/react';\nimport { executionSchema } from './executions';\n\nconst collection = {\n name: 'workflows',\n fields: [\n {\n type: 'string',\n name: 'title',\n interface: 'input',\n uiSchema: {\n title: '流程名称',\n type: 'string',\n 'x-component': 'Input',\n required: true,\n } as ISchema,\n },\n {\n type: 'string',\n name: 'type',\n interface: 'select',\n uiSchema: {\n title: '触发方式',\n type: 'string',\n 'x-component': 'Select',\n 'x-decorator': 'FormItem',\n enum: [\n { value: 'model', label: '数据变动' }\n ],\n required: true,\n } as ISchema,\n },\n {\n type: 'string',\n name: 'description',\n interface: 'textarea',\n uiSchema: {\n title: '描述',\n type: 'string',\n 'x-component': 'Input.TextArea',\n } as ISchema,\n },\n {\n type: 'boolean',\n name: 'enabled',\n interface: 'radio',\n uiSchema: {\n title: '状态',\n type: 'string',\n enum: [\n { label: '启用', value: true },\n { label: '禁用', value: false },\n ],\n 'x-component': 'Radio.Group',\n 'x-decorator': 'FormItem',\n } as ISchema\n }\n ],\n};\n\nexport const workflowSchema: ISchema = {\n type: 'object',\n properties: {\n provider: {\n type: 'void',\n 'x-decorator': 'ResourceActionProvider',\n 'x-decorator-props': {\n collection,\n resourceName: 'workflows',\n request: {\n resource: 'workflows',\n action: 'list',\n params: {\n pageSize: 50,\n filter: {},\n sort: ['createdAt'],\n except: ['config'],\n },\n },\n },\n 'x-component': 'CollectionProvider',\n 'x-component-props': {\n collection,\n },\n properties: {\n actions: {\n type: 'void',\n 'x-component': 'ActionBar',\n 'x-component-props': {\n style: {\n marginBottom: 16,\n },\n },\n properties: {\n delete: {\n type: 'void',\n title: '删除',\n 'x-component': 'Action',\n 'x-component-props': {\n useAction: '{{ cm.useBulkDestroyAction }}',\n confirm: {\n title: \"{{t('Delete record')}}\",\n content: \"{{t('Are you sure you want to delete it?')}}\",\n },\n },\n },\n create: {\n type: 'void',\n title: '添加工作流',\n 'x-component': 'Action',\n 'x-component-props': {\n type: 'primary',\n },\n properties: {\n drawer: {\n type: 'void',\n 'x-component': 'Action.Drawer',\n 'x-decorator': 'Form',\n title: '添加工作流',\n properties: {\n title: {\n 'x-component': 'CollectionField',\n 'x-decorator': 'FormItem',\n },\n type: {\n 'x-component': 'CollectionField',\n 'x-decorator': 'FormItem',\n },\n description: {\n 'x-component': 'CollectionField',\n 'x-decorator': 'FormItem',\n },\n footer: {\n type: 'void',\n 'x-component': 'Action.Drawer.Footer',\n properties: {\n cancel: {\n title: 'Cancel',\n 'x-component': 'Action',\n 'x-component-props': {\n useAction: '{{ cm.useCancelAction }}',\n },\n },\n submit: {\n title: 'Submit',\n 'x-component': 'Action',\n 'x-component-props': {\n type: 'primary',\n useAction: '{{ cm.useCreateAction }}',\n },\n },\n },\n },\n },\n },\n },\n },\n }\n },\n table: {\n type: 'void',\n 'x-component': 'Table.Void',\n 'x-component-props': {\n rowKey: 'id',\n rowSelection: {\n type: 'checkbox',\n },\n useDataSource: '{{ cm.useDataSourceFromRAC }}',\n },\n properties: {\n title: {\n type: 'void',\n 'x-decorator': 'Table.Column.Decorator',\n 'x-component': 'Table.Column',\n properties: {\n title: {\n type: 'string',\n 'x-component': 'CollectionField',\n 'x-read-pretty': true,\n },\n }\n },\n type: {\n type: 'void',\n 'x-decorator': 'Table.Column.Decorator',\n 'x-component': 'Table.Column',\n properties: {\n type: {\n type: 'string',\n 'x-component': 'CollectionField',\n 'x-read-pretty': true,\n },\n }\n },\n enabled: {\n type: 'void',\n 'x-decorator': 'Table.Column.Decorator',\n 'x-component': 'Table.Column',\n properties: {\n enabled: {\n type: 'boolean',\n 'x-component': 'CollectionField',\n 'x-read-pretty': true,\n default: false\n },\n }\n },\n actions: {\n type: 'void',\n title: '{{ t(\"Actions\") }}',\n 'x-component': 'Table.Column',\n properties: {\n actions: {\n type: 'void',\n 'x-component': 'Space',\n 'x-component-props': {\n split: '|',\n },\n properties: {\n config: {\n type: 'void',\n title: '配置流程',\n 'x-component': 'WorkflowLink'\n },\n // executions: {\n // type: 'void',\n // title: '执行历史',\n // 'x-component': 'Action.Link',\n // 'x-component-props': {\n // type: 'primary',\n // },\n // properties: {\n // drawer: {\n // type: 'void',\n // title: '执行历史',\n // 'x-component': 'Action.Drawer',\n // properties: executionSchema\n // }\n // }\n // },\n update: {\n type: 'void',\n title: '{{ t(\"Edit\") }}',\n 'x-component': 'Action.Link',\n 'x-component-props': {\n type: 'primary',\n },\n properties: {\n modal: {\n type: 'void',\n 'x-component': 'Action.Modal',\n 'x-decorator': 'Form',\n 'x-decorator-props': {\n useValues: '{{ cm.useValuesFromRecord }}',\n },\n title: '编辑工作流',\n properties: {\n title: {\n 'x-component': 'CollectionField',\n 'x-decorator': 'FormItem',\n },\n enabled: {\n 'x-component': 'CollectionField',\n 'x-decorator': 'FormItem',\n },\n footer: {\n type: 'void',\n 'x-component': 'Action.Modal.Footer',\n properties: {\n cancel: {\n title: '{{ t(\"Cancel\") }}',\n 'x-component': 'Action',\n 'x-component-props': {\n useAction: '{{ cm.useCancelAction }}',\n },\n },\n submit: {\n title: '{{ t(\"Submit\") }}',\n 'x-component': 'Action',\n 'x-component-props': {\n type: 'primary',\n useAction: '{{ cm.useUpdateAction }}',\n },\n },\n },\n },\n },\n },\n },\n },\n // delete: {\n // type: 'void',\n // title: '{{ t(\"Delete\") }}',\n // 'x-component': 'Action.Link',\n // 'x-component-props': {\n // confirm: {\n // title: \"{{t('Delete record')}}\",\n // content: \"{{t('Are you sure you want to delete it?')}}\",\n // },\n // useAction: '{{ cm.useDestroyActionAndRefreshCM }}',\n // },\n // },\n }\n }\n }\n }\n }\n }\n }\n }\n }\n};\n"]}
|
|
@@ -63,13 +63,14 @@ function useUpdateConfigAction() {
|
|
|
63
63
|
return __awaiter(this, void 0, void 0, function () {
|
|
64
64
|
return __generator(this, function (_a) {
|
|
65
65
|
switch (_a.label) {
|
|
66
|
-
case 0: return [4 /*yield*/,
|
|
67
|
-
filterByTk: record.id,
|
|
68
|
-
values: {
|
|
69
|
-
config: __assign(__assign({}, record.config), form.values)
|
|
70
|
-
},
|
|
71
|
-
})];
|
|
66
|
+
case 0: return [4 /*yield*/, form.submit()];
|
|
72
67
|
case 1:
|
|
68
|
+
_a.sent();
|
|
69
|
+
return [4 /*yield*/, api.resource('workflows', record.id).update({
|
|
70
|
+
filterByTk: record.id,
|
|
71
|
+
values: form.values
|
|
72
|
+
})];
|
|
73
|
+
case 2:
|
|
73
74
|
_a.sent();
|
|
74
75
|
ctx.setVisible(false);
|
|
75
76
|
refresh();
|
|
@@ -103,9 +104,17 @@ export var TriggerConfig = function () {
|
|
|
103
104
|
'x-component': 'Action.Drawer',
|
|
104
105
|
'x-decorator': 'Form',
|
|
105
106
|
'x-decorator-props': {
|
|
106
|
-
initialValue: config
|
|
107
|
+
initialValue: { config: config }
|
|
107
108
|
},
|
|
108
|
-
properties:
|
|
109
|
+
properties: {
|
|
110
|
+
config: {
|
|
111
|
+
type: 'void',
|
|
112
|
+
name: 'config',
|
|
113
|
+
'x-component': 'fieldset',
|
|
114
|
+
'x-component-props': {},
|
|
115
|
+
properties: fieldset
|
|
116
|
+
},
|
|
117
|
+
actions: {
|
|
109
118
|
type: 'void',
|
|
110
119
|
'x-component': 'Action.Drawer.Footer',
|
|
111
120
|
properties: {
|
|
@@ -125,7 +134,8 @@ export var TriggerConfig = function () {
|
|
|
125
134
|
}
|
|
126
135
|
}
|
|
127
136
|
}
|
|
128
|
-
}
|
|
137
|
+
}
|
|
138
|
+
}
|
|
129
139
|
}
|
|
130
140
|
}
|
|
131
141
|
}, scope: scope }, void 0)] }), void 0));
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/workflow/triggers/index.tsx"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AACA,OAAO,EAAW,OAAO,EAAE,MAAM,gBAAgB,CAAC;AAClD,OAAO,EAAE,EAAE,EAAE,MAAM,cAAc,CAAC;AAClC,OAAO,EAAE,QAAQ,EAAE,MAAM,iBAAiB,C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Q;4CACvB,mBAAmB,EAAE;gDACnB,SAAS,EAAE,0BAA0B;6CACtC;yCACF;wCACD,MAAM,EAAE;4CACN,KAAK,EAAE,iBAAiB;4CACxB,aAAa,EAAE,QAAQ;4CACvB,mBAAmB,EAAE;gDACnB,IAAI,EAAE,SAAS;gDACf,SAAS,EAAE,qBAAqB;6CACjC;yCACF;qCACF;iCACF;6BACF;yBACF;qBACF;iBACF,EACD,KAAK,EAAE,KAAK,WACZ,aACE,CACP,CAAC;AACJ,CAAC,CAAA","sourcesContent":["import React from \"react\";\nimport { ISchema, useForm } from \"@formily/react\";\nimport { cx } from \"@emotion/css\";\nimport { Registry } from \"@nocobase/utils\";\n\nimport { SchemaComponent, useActionContext, useAPIClient, useRecord, useRequest, useResourceActionContext } from '../../';\nimport model from './model';\nimport { nodeCardClass } from \"../style\";\n\n\nfunction useUpdateConfigAction() {\n const form = useForm();\n const api = useAPIClient();\n const record = useRecord();\n const ctx = useActionContext();\n const { refresh } = useResourceActionContext();\n return {\n async run() {\n await form.submit();\n await api.resource('workflows', record.id).update({\n filterByTk: record.id,\n values: form.values\n });\n ctx.setVisible(false);\n refresh();\n },\n };\n};\n\nexport interface Trigger {\n title: string;\n type: string;\n // group: string;\n options?: { label: string; value: any; key: string }[];\n fieldset: { [key: string]: ISchema };\n view?: ISchema;\n scope?: { [key: string]: any };\n components?: { [key: string]: any };\n render?(props): React.ReactElement;\n getter?(node: any): React.ReactElement;\n};\n\nexport const triggers = new Registry<Trigger>();\n\ntriggers.register('model', model);\n\nexport const TriggerConfig = () => {\n const { data } = useResourceActionContext();\n if (!data) {\n return null;\n }\n const { type, config } = data.data;\n const { title, fieldset, scope } = triggers.get(type);\n return (\n <div className={cx(nodeCardClass)}>\n <h4>{title}</h4>\n <SchemaComponent\n schema={{\n type: 'void',\n title: '触发器配置',\n 'x-component': 'Action.Link',\n name: 'drawer',\n properties: {\n drawer: {\n type: 'void',\n title: '触发器配置',\n 'x-component': 'Action.Drawer',\n 'x-decorator': 'Form',\n 'x-decorator-props': {\n initialValue: { config }\n },\n properties: {\n config: {\n type: 'void',\n name: 'config',\n 'x-component': 'fieldset',\n 'x-component-props': {},\n properties: fieldset\n },\n actions: {\n type: 'void',\n 'x-component': 'Action.Drawer.Footer',\n properties: {\n cancel: {\n title: '{{t(\"Cancel\")}}',\n 'x-component': 'Action',\n 'x-component-props': {\n useAction: '{{ cm.useCancelAction }}',\n },\n },\n submit: {\n title: '{{t(\"Submit\")}}',\n 'x-component': 'Action',\n 'x-component-props': {\n type: 'primary',\n useAction: useUpdateConfigAction\n }\n }\n }\n }\n }\n }\n }\n }}\n scope={scope}\n />\n </div>\n );\n}\n"]}
|
|
@@ -1,10 +1,11 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
2
|
import { useCollectionDataSource } from '../../collection-manager';
|
|
3
|
+
declare function useCollectionFieldsDataSource(): (field: any) => void;
|
|
3
4
|
declare const _default: {
|
|
4
5
|
title: string;
|
|
5
6
|
type: string;
|
|
6
7
|
fieldset: {
|
|
7
|
-
collection: {
|
|
8
|
+
'config.collection': {
|
|
8
9
|
type: string;
|
|
9
10
|
title: string;
|
|
10
11
|
name: string;
|
|
@@ -13,7 +14,7 @@ declare const _default: {
|
|
|
13
14
|
'x-decorator': string;
|
|
14
15
|
'x-component': string;
|
|
15
16
|
};
|
|
16
|
-
mode: {
|
|
17
|
+
'config.mode': {
|
|
17
18
|
type: string;
|
|
18
19
|
title: string;
|
|
19
20
|
name: string;
|
|
@@ -26,10 +27,22 @@ declare const _default: {
|
|
|
26
27
|
}[];
|
|
27
28
|
};
|
|
28
29
|
};
|
|
29
|
-
|
|
30
|
-
title: string;
|
|
30
|
+
'config.changed': {
|
|
31
31
|
type: string;
|
|
32
32
|
name: string;
|
|
33
|
+
title: string;
|
|
34
|
+
description: string;
|
|
35
|
+
'x-decorator': string;
|
|
36
|
+
'x-component': string;
|
|
37
|
+
'x-component-props': {
|
|
38
|
+
mode: string;
|
|
39
|
+
};
|
|
40
|
+
'x-reactions': string[];
|
|
41
|
+
};
|
|
42
|
+
'config.condition': {
|
|
43
|
+
name: string;
|
|
44
|
+
title: string;
|
|
45
|
+
type: string;
|
|
33
46
|
'x-decorator': string;
|
|
34
47
|
'x-decorator-props': {
|
|
35
48
|
labelAlign: string;
|
|
@@ -47,6 +60,7 @@ declare const _default: {
|
|
|
47
60
|
};
|
|
48
61
|
scope: {
|
|
49
62
|
useCollectionDataSource: typeof useCollectionDataSource;
|
|
63
|
+
useCollectionFieldsDataSource: typeof useCollectionFieldsDataSource;
|
|
50
64
|
};
|
|
51
65
|
getter({ type, options, onChange }: {
|
|
52
66
|
type: any;
|
|
@@ -11,35 +11,73 @@ var __assign = (this && this.__assign) || function () {
|
|
|
11
11
|
};
|
|
12
12
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
13
13
|
import { Select } from 'antd';
|
|
14
|
+
import { action } from '@formily/reactive';
|
|
15
|
+
import { useForm } from '@formily/react';
|
|
14
16
|
import { useCollectionDataSource, useCollectionManager } from '../../collection-manager';
|
|
15
17
|
import { useCompile } from '../../schema-component';
|
|
16
18
|
import { useFlowContext } from '../WorkflowCanvas';
|
|
17
19
|
import { BaseTypeSet } from '../calculators';
|
|
18
20
|
import { collection, filter } from '../schemas/collection';
|
|
21
|
+
function useCollectionFieldsDataSource() {
|
|
22
|
+
var _a;
|
|
23
|
+
var compile = useCompile();
|
|
24
|
+
var getCollectionFields = useCollectionManager().getCollectionFields;
|
|
25
|
+
var values = useForm().values;
|
|
26
|
+
var fields = getCollectionFields((_a = values === null || values === void 0 ? void 0 : values.config) === null || _a === void 0 ? void 0 : _a.collection);
|
|
27
|
+
return function (field) {
|
|
28
|
+
action.bound(function (data) {
|
|
29
|
+
field.dataSource = data
|
|
30
|
+
.filter(function (field) { return (!field.hidden
|
|
31
|
+
&& (field.uiSchema ? !field.uiSchema['x-read-pretty'] : true)); })
|
|
32
|
+
.map(function (field) {
|
|
33
|
+
var _a;
|
|
34
|
+
return ({
|
|
35
|
+
label: compile((_a = field.uiSchema) === null || _a === void 0 ? void 0 : _a.title),
|
|
36
|
+
value: field.name
|
|
37
|
+
});
|
|
38
|
+
});
|
|
39
|
+
})(fields);
|
|
40
|
+
};
|
|
41
|
+
}
|
|
19
42
|
export default {
|
|
20
43
|
title: '数据表事件',
|
|
21
44
|
type: 'model',
|
|
22
45
|
fieldset: {
|
|
23
|
-
collection: collection,
|
|
24
|
-
mode: {
|
|
46
|
+
'config.collection': collection,
|
|
47
|
+
'config.mode': {
|
|
25
48
|
type: 'number',
|
|
26
49
|
title: '触发时机',
|
|
27
|
-
name: 'mode',
|
|
50
|
+
name: 'config.mode',
|
|
28
51
|
'x-decorator': 'FormItem',
|
|
29
52
|
'x-component': 'Select',
|
|
30
53
|
'x-component-props': {
|
|
31
54
|
options: [
|
|
32
|
-
{ value: 1, label: '
|
|
33
|
-
{ value: 2, label: '
|
|
34
|
-
{ value: 3, label: '
|
|
35
|
-
{ value: 4, label: '
|
|
55
|
+
{ value: 1, label: '新增数据后' },
|
|
56
|
+
{ value: 2, label: '更新数据后' },
|
|
57
|
+
{ value: 3, label: '新增或更新数据后' },
|
|
58
|
+
{ value: 4, label: '删除数据后' }
|
|
36
59
|
]
|
|
37
60
|
}
|
|
38
61
|
},
|
|
39
|
-
|
|
62
|
+
'config.changed': {
|
|
63
|
+
type: 'array',
|
|
64
|
+
name: 'changed',
|
|
65
|
+
title: '发生变动的字段',
|
|
66
|
+
description: '只有被选中的某个字段发生变动时才会触发。如果不选择,则表示任何字段变动时都会触发。新增或删除数据时,任意字段都被认为发生变动。',
|
|
67
|
+
'x-decorator': 'FormItem',
|
|
68
|
+
'x-component': 'Select',
|
|
69
|
+
'x-component-props': {
|
|
70
|
+
mode: 'multiple',
|
|
71
|
+
},
|
|
72
|
+
'x-reactions': [
|
|
73
|
+
'{{useCollectionFieldsDataSource()}}'
|
|
74
|
+
]
|
|
75
|
+
},
|
|
76
|
+
'config.condition': __assign(__assign({}, filter), { name: 'config.condition', title: '满足条件' })
|
|
40
77
|
},
|
|
41
78
|
scope: {
|
|
42
|
-
useCollectionDataSource: useCollectionDataSource
|
|
79
|
+
useCollectionDataSource: useCollectionDataSource,
|
|
80
|
+
useCollectionFieldsDataSource: useCollectionFieldsDataSource
|
|
43
81
|
},
|
|
44
82
|
getter: function (_a) {
|
|
45
83
|
var _b, _c;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"model.js","sourceRoot":"","sources":["../../../src/workflow/triggers/model.tsx"],"names":[],"mappings":";;;;;;;;;;;;AACA,OAAO,EAAE,MAAM,EAAE,MAAM,MAAM,CAAC;
|
|
1
|
+
{"version":3,"file":"model.js","sourceRoot":"","sources":["../../../src/workflow/triggers/model.tsx"],"names":[],"mappings":";;;;;;;;;;;;AACA,OAAO,EAAE,MAAM,EAAE,MAAM,MAAM,CAAC;AAC9B,OAAO,EAAE,MAAM,EAAE,MAAM,mBAAmB,CAAC;AAC3C,OAAO,EAAE,OAAO,EAAE,MAAM,gBAAgB,CAAC;AAEzC,OAAO,EAAE,uBAAuB,EAAE,oBAAoB,EAAE,MAAM,0BAA0B,CAAC;AACzF,OAAO,EAAE,UAAU,EAAE,MAAM,wBAAwB,CAAC;AAEpD,OAAO,EAAE,cAAc,EAAE,MAAM,mBAAmB,CAAC;AACnD,OAAO,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAC;AAC7C,OAAO,EAAE,UAAU,EAAE,MAAM,EAAE,MAAM,uBAAuB,CAAC;AAE3D,SAAS,6BAA6B;;IACpC,IAAM,OAAO,GAAG,UAAU,EAAE,CAAC;IACrB,IAAA,mBAAmB,GAAK,oBAAoB,EAAE,oBAA3B,CAA4B;IAC/C,IAAA,MAAM,GAAK,OAAO,EAAE,OAAd,CAAe;IAC7B,IAAM,MAAM,GAAG,mBAAmB,CAAC,MAAA,MAAM,aAAN,MAAM,uBAAN,MAAM,CAAE,MAAM,0CAAE,UAAU,CAAC,CAAC;IAE/D,OAAO,UAAC,KAAU;QAChB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AA,EAAA,CAAC;iBACvD,GAAG,CAAC,UAAA,KAAK,IAAI,OAAA,CACd,KAAC,MAAM,CAAC,MAAM,aAAkB,KAAK,EAAE,KAAK,CAAC,IAAI,gBAAG,OAAO,CAAC,KAAK,CAAC,QAAQ,CAAC,KAAK,CAAC,KAA7D,KAAK,CAAC,IAAI,CAAoE,CACnG,EAFe,CAEf,CAAC,YACK,CACV,CAAC;IACJ,CAAC;CACF,CAAC","sourcesContent":["import React from 'react';\nimport { Select } from 'antd';\nimport { action } from '@formily/reactive';\nimport { useForm } from '@formily/react';\n\nimport { useCollectionDataSource, useCollectionManager } from '../../collection-manager';\nimport { useCompile } from '../../schema-component';\n\nimport { useFlowContext } from '../WorkflowCanvas';\nimport { BaseTypeSet } from '../calculators';\nimport { collection, filter } from '../schemas/collection';\n\nfunction useCollectionFieldsDataSource() {\n const compile = useCompile();\n const { getCollectionFields } = useCollectionManager();\n const { values } = useForm();\n const fields = getCollectionFields(values?.config?.collection);\n\n return (field: any) => {\n action.bound((data: any) => {\n field.dataSource = data\n .filter(field => (\n !field.hidden\n && (field.uiSchema ? !field.uiSchema['x-read-pretty'] : true)\n ))\n .map(field => ({\n label: compile(field.uiSchema?.title),\n value: field.name\n }));\n })(fields);\n };\n}\n\nexport default {\n title: '数据表事件',\n type: 'model',\n fieldset: {\n 'config.collection': collection,\n 'config.mode': {\n type: 'number',\n title: '触发时机',\n name: 'config.mode',\n 'x-decorator': 'FormItem',\n 'x-component': 'Select',\n 'x-component-props': {\n options: [\n { value: 1, label: '新增数据后' },\n { value: 2, label: '更新数据后' },\n { value: 3, label: '新增或更新数据后' },\n { value: 4, label: '删除数据后' }\n ]\n }\n },\n 'config.changed': {\n type: 'array',\n name: 'changed',\n title: '发生变动的字段',\n description: '只有被选中的某个字段发生变动时才会触发。如果不选择,则表示任何字段变动时都会触发。新增或删除数据时,任意字段都被认为发生变动。',\n 'x-decorator': 'FormItem',\n 'x-component': 'Select',\n 'x-component-props': {\n mode: 'multiple',\n },\n 'x-reactions': [\n '{{useCollectionFieldsDataSource()}}'\n ]\n },\n 'config.condition': {\n ...filter,\n name: 'config.condition',\n title: '满足条件'\n }\n },\n scope: {\n useCollectionDataSource,\n useCollectionFieldsDataSource\n },\n getter({ type, options, onChange }) {\n const compile = useCompile();\n const { collections = [] } = useCollectionManager();\n const { workflow } = useFlowContext();\n const collection = collections.find(item => item.name === workflow.config.collection) ?? { fields: [] };\n\n return (\n <Select\n placeholder=\"选择字段\"\n value={options?.path?.replace(/^data\\./, '')}\n onChange={(path) => {\n onChange({ type, options: { ...options, path: `data.${path}` } });\n }}\n >\n {collection.fields\n .filter(field => BaseTypeSet.has(field?.uiSchema?.type))\n .map(field => (\n <Select.Option key={field.name} value={field.name}>{compile(field.uiSchema.title)}</Select.Option>\n ))}\n </Select>\n );\n }\n};\n"]}
|
|
@@ -89,11 +89,11 @@ var RoleConfigure = function () {
|
|
|
89
89
|
title: t('Configure permissions'),
|
|
90
90
|
'x-decorator': 'FormItem',
|
|
91
91
|
'x-component': 'Checkbox',
|
|
92
|
-
'x-content': '
|
|
92
|
+
'x-content': t('Allows configuration of the whole system, including UI, collections, permissions, etc.'),
|
|
93
93
|
},
|
|
94
94
|
'strategy.actions': {
|
|
95
|
-
title: t('
|
|
96
|
-
description: '
|
|
95
|
+
title: t('Global action permissions'),
|
|
96
|
+
description: t('All collections use general action permissions by default; permission configured individually will override the default one.'),
|
|
97
97
|
'x-component': 'StrategyActions',
|
|
98
98
|
'x-decorator': 'FormItem',
|
|
99
99
|
},
|
|
@@ -101,7 +101,7 @@ var RoleConfigure = function () {
|
|
|
101
101
|
title: t('Menu permissions'),
|
|
102
102
|
'x-decorator': 'FormItem',
|
|
103
103
|
'x-component': 'Checkbox',
|
|
104
|
-
'x-content': '
|
|
104
|
+
'x-content': t('New menu items are allowed to be accessed by default.'),
|
|
105
105
|
},
|
|
106
106
|
},
|
|
107
107
|
} }, void 0));
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"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;oCACH,cAAO,CAAC,OAAO,CAAC,CAAC,CAAC,oBAAoB,CAAC,CAAC,CAAC;;;;yBAC1C,CAAC,CAAC;gBACL,CAAC;aACF;YACD,UAAU,EAAE;gBACV,cAAc,EAAE;oBACd,KAAK,EAAE,CAAC,CAAC,uBAAuB,CAAC;oBACjC,aAAa,EAAE,UAAU;oBACzB,aAAa,EAAE,UAAU;oBACzB,WAAW,EAAE,CAAC,CAAC,wFAAwF,CAAC;iBACzG;gBACD,kBAAkB,EAAE;oBAClB,KAAK,EAAE,CAAC,CAAC,2BAA2B,CAAC;oBACrC,WAAW,EAAE,CAAC,CAAC,8HAA8H,CAAC;oBAC9I,aAAa,EAAE,iBAAiB;oBAChC,aAAa,EAAE,UAAU;iBAC1B;gBACD,YAAY,EAAE;oBACZ,KAAK,EAAE,CAAC,CAAC,kBAAkB,CAAC;oBAC5B,aAAa,EAAE,UAAU;oBACzB,aAAa,EAAE,UAAU;oBACzB,WAAW,EAAE,CAAC,CAAC,uDAAuD,CAAC;iBACxE;aACF;SACF,WACD,CACH,CAAC;AACJ,CAAC,CAAC;AA3DW,QAAA,aAAa,iBA2DxB","sourcesContent":["import { onFieldChange } from '@formily/core';\nimport { message } from 'antd';\nimport React from 'react';\nimport { useTranslation } from 'react-i18next';\nimport { useAPIClient, useRequest } from '../../api-client';\nimport { useRecord } from '../../record-provider';\nimport { SchemaComponent } from '../../schema-component';\n\nexport const RoleConfigure = () => {\n const api = useAPIClient();\n const record = useRecord();\n const { t } = useTranslation();\n return (\n <SchemaComponent\n schema={{\n type: 'void',\n name: 'form',\n 'x-component': 'Form',\n 'x-component-props': {\n useValues: (options) => {\n return useRequest(\n {\n resource: 'roles',\n action: 'get',\n params: {\n filterByTk: record.name,\n },\n },\n options,\n );\n },\n effects() {\n onFieldChange('*', async (field, form) => {\n if (!form.modified) {\n return;\n }\n await api.resource('roles').update({\n filterByTk: record.name,\n values: form.values,\n });\n message.success(t('Saved successfully'));\n });\n },\n },\n properties: {\n allowConfigure: {\n title: t('Configure permissions'),\n 'x-decorator': 'FormItem',\n 'x-component': 'Checkbox',\n 'x-content': t('Allows configuration of the whole system, including UI, collections, permissions, etc.'),\n },\n 'strategy.actions': {\n title: t('Global action permissions'),\n description: t('All collections use general action permissions by default; permission configured individually will override the default one.'),\n 'x-component': 'StrategyActions',\n 'x-decorator': 'FormItem',\n },\n allowNewMenu: {\n title: t('Menu permissions'),\n 'x-decorator': 'FormItem',\n 'x-component': 'Checkbox',\n 'x-content': t('New menu items are allowed to be accessed by default.'),\n },\n },\n }}\n />\n );\n};\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"roles.js","sourceRoot":"","sources":["../../../../src/acl/Configuration/schemas/roles.ts"],"names":[],"mappings":";;;;;;;;;;;;;;AACA,0CAAsC;AACtC,kDAAiD;AACjD,8DAA6D;AAC7D,qDAA0D;AAE1D,IAAM,UAAU,GAAG;IACjB,IAAI,EAAE,OAAO;IACb,eAAe,EAAE,MAAM;IACvB,SAAS,EAAE,MAAM;IACjB,MAAM,EAAE;QACN;YACE,IAAI,EAAE,SAAS;YACf,IAAI,EAAE,OAAO;YACb,SAAS,EAAE,OAAO;YAClB,QAAQ,EAAE;gBACR,KAAK,EAAE,4BAA4B;gBACnC,IAAI,EAAE,QAAQ;gBACd,aAAa,EAAE,OAAO;gBACtB,QAAQ,EAAE,IAAI;aACJ;SACb;QACD;YACE,IAAI,EAAE,QAAQ;YACd,IAAI,EAAE,MAAM;YACZ,SAAS,EAAE,OAAO;YAClB,QAAQ,EAAE;gBACR,KAAK,EAAE,mBAAmB;gBAC1B,IAAI,EAAE,QAAQ;gBACd,aAAa,EAAE,OAAO;aACZ;SACb;QACD;YACE,IAAI,EAAE,SAAS;YACf,IAAI,EAAE,SAAS;YACf,SAAS,EAAE,SAAS;YACpB,QAAQ,EAAE;gBACR,KAAK,EAAE,uBAAuB;gBAC9B,IAAI,EAAE,SAAS;gBACf,aAAa,EAAE,UAAU;aACf;SACb;KACF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AAE;wDACV,KAAK,EAAE;4DACL,aAAa,EAAE,iBAAiB;4DAChC,aAAa,EAAE,UAAU;yDAC1B;wDACD,IAAI,EAAE;4DACJ,aAAa,EAAE,iBAAiB;4DAChC,aAAa,EAAE,UAAU;4DACzB,YAAY,EAAE,IAAI;yDACnB;wDACD,OAAO,EAAE;4DACP,KAAK,EAAE,EAAE;4DACT,aAAa,EAAE,iBAAiB;4DAChC,aAAa,EAAE,UAAU;4DACzB,WAAW,EAAE,uBAAuB;yDACrC;wDACD,MAAM,EAAE;4DACN,IAAI,EAAE,MAAM;4DACZ,aAAa,EAAE,sBAAsB;4DACrC,UAAU,EAAE;gEACV,MAAM,EAAE;oEACN,KAAK,EAAE,iBAAiB;oEACxB,aAAa,EAAE,QAAQ;oEACvB,mBAAmB,EAAE;wEACnB,SAAS,EAAE,0BAA0B;qEACtC;iEACF;gEACD,MAAM,EAAE;oEACN,KAAK,EAAE,iBAAiB;oEACxB,aAAa,EAAE,QAAQ;oEACvB,mBAAmB,EAAE;wEACnB,IAAI,EAAE,SAAS;wEACf,SAAS,EAAE,0BAA0B;qEACtC;iEACF;6DACF;yDACF;qDACF;iDACF;6CACF;yCACF;wCACD,MAAM,EAAE;4CACN,IAAI,EAAE,MAAM;4CACZ,KAAK,EAAE,mBAAmB;4CAC1B,aAAa,EAAE,aAAa;4CAC5B,mBAAmB,EAAE;gDACnB,OAAO,EAAE;oDACP,KAAK,EAAE,sBAAsB;oDAC7B,OAAO,EAAE,8CAA8C;iDACxD;gDACD,SAAS,EAAE,yBAAyB;6CACrC;yCACF;qCACF;iCACF;6BACF;yBACF;qBACF;iBACF;aACF;SACF;KACF;CACF,CAAC","sourcesContent":["import { ISchema } from '@formily/react';\nimport { uid } from '@formily/shared';\nimport { useRequest } from '../../../api-client';\nimport { useActionContext } from '../../../schema-component';\nimport { roleCollectionsSchema } from './roleCollections';\n\nconst collection = {\n name: 'roles',\n filterTargetKey: 'name',\n targetKey: 'name',\n fields: [\n {\n type: 'integer',\n name: 'title',\n interface: 'input',\n uiSchema: {\n title: '{{t(\"Role display name\")}}',\n type: 'number',\n 'x-component': 'Input',\n required: true,\n } as ISchema,\n },\n {\n type: 'string',\n name: 'name',\n interface: 'input',\n uiSchema: {\n title: '{{t(\"Role UID\")}}',\n type: 'string',\n 'x-component': 'Input',\n } as ISchema,\n },\n {\n type: 'boolean',\n name: 'default',\n interface: 'boolean',\n uiSchema: {\n title: '{{t(\"Default role\")}}',\n type: 'boolean',\n 'x-component': 'Checkbox',\n } as ISchema,\n },\n ],\n};\n\nexport const roleSchema: ISchema = {\n type: 'object',\n properties: {\n block1: {\n type: 'void',\n 'x-decorator': 'ResourceActionProvider',\n 'x-decorator-props': {\n collection,\n resourceName: 'roles',\n request: {\n resource: 'roles',\n action: 'list',\n params: {\n pageSize: 50,\n filter: {\n 'name.$ne': 'root',\n },\n showAnonymous: true,\n sort: ['createdAt'],\n appends: [],\n },\n },\n },\n 'x-component': 'CollectionProvider',\n 'x-component-props': {\n collection,\n },\n properties: {\n actions: {\n type: 'void',\n 'x-component': 'ActionBar',\n 'x-component-props': {\n style: {\n marginBottom: 16,\n },\n },\n properties: {\n delete: {\n type: 'void',\n title: '{{ t(\"Delete\") }}',\n 'x-component': 'Action',\n 'x-component-props': {\n useAction: '{{ cm.useBulkDestroyAction }}',\n confirm: {\n title: \"{{t('Delete role')}}\",\n content: \"{{t('Are you sure you want to delete it?')}}\",\n },\n },\n },\n create: {\n type: 'void',\n title: '{{t(\"Add role\")}}',\n 'x-component': 'Action',\n 'x-component-props': {\n type: 'primary',\n },\n properties: {\n drawer: {\n type: 'void',\n 'x-component': 'Action.Drawer',\n 'x-decorator': 'Form',\n 'x-decorator-props': {\n useValues(options) {\n const ctx = useActionContext();\n return useRequest(\n () =>\n Promise.resolve({\n data: {\n name: `r_${uid()}`,\n },\n }),\n { ...options, refreshDeps: [ctx.visible] },\n );\n },\n },\n title: '{{t(\"Add role\")}}',\n properties: {\n title: {\n 'x-component': 'CollectionField',\n 'x-decorator': 'FormItem',\n },\n name: {\n 'x-component': 'CollectionField',\n 'x-decorator': 'FormItem',\n description:\n '{{t(\"Randomly generated and can be modified. Support letters, numbers and underscores, must start with an letter.\")}}',\n },\n default: {\n 'x-component': 'CollectionField',\n 'x-decorator': 'FormItem',\n title: '',\n 'x-content': '{{t(\"Default role\")}}',\n },\n footer: {\n type: 'void',\n 'x-component': 'Action.Drawer.Footer',\n properties: {\n cancel: {\n title: '{{t(\"Cancel\")}}',\n 'x-component': 'Action',\n 'x-component-props': {\n useAction: '{{ cm.useCancelAction }}',\n },\n },\n submit: {\n title: '{{t(\"Submit\")}}',\n 'x-component': 'Action',\n 'x-component-props': {\n type: 'primary',\n useAction: '{{ cm.useCreateAction }}',\n },\n },\n },\n },\n },\n },\n },\n },\n },\n },\n table: {\n type: 'void',\n 'x-uid': 'input',\n 'x-component': 'Table.Void',\n 'x-component-props': {\n rowKey: 'name',\n rowSelection: {\n type: 'checkbox',\n },\n useDataSource: '{{ cm.useDataSourceFromRAC }}',\n },\n properties: {\n column1: {\n type: 'void',\n 'x-decorator': 'Table.Column.Decorator',\n 'x-component': 'Table.Column',\n properties: {\n title: {\n type: 'number',\n 'x-component': 'CollectionField',\n 'x-read-pretty': true,\n },\n },\n },\n column2: {\n type: 'void',\n 'x-decorator': 'Table.Column.Decorator',\n 'x-component': 'Table.Column',\n properties: {\n name: {\n type: 'string',\n 'x-component': 'CollectionField',\n 'x-read-pretty': true,\n },\n },\n },\n column3: {\n type: 'void',\n 'x-decorator': 'Table.Column.Decorator',\n 'x-component': 'Table.Column',\n properties: {\n default: {\n type: 'string',\n 'x-component': 'CollectionField',\n 'x-read-pretty': true,\n },\n },\n },\n column4: {\n type: 'void',\n title: '{{t(\"Actions\")}}',\n 'x-component': 'Table.Column',\n properties: {\n actions: {\n type: 'void',\n 'x-component': 'Space',\n 'x-component-props': {\n split: '|',\n },\n properties: {\n view: {\n type: 'void',\n title: '{{t(\"Configure\")}}',\n 'x-component': 'Action.Link',\n 'x-component-props': {},\n properties: {\n drawer: {\n type: 'void',\n 'x-component': 'Action.Drawer',\n title: '{{t(\"Configure permissions\")}}',\n properties: {\n tabs1: {\n type: 'void',\n 'x-component': 'Tabs',\n 'x-component-props': {},\n properties: {\n tab1: {\n type: 'void',\n title: '{{t(\"Global permissions\")}}',\n 'x-component': 'Tabs.TabPane',\n 'x-component-props': {},\n properties: {\n role: {\n 'x-component': 'RoleConfigure',\n },\n },\n },\n tab2: {\n type: 'void',\n title: '{{t(\"Action permissions\")}}',\n 'x-component': 'Tabs.TabPane',\n 'x-component-props': {},\n properties: {\n roleCollectionsSchema,\n },\n },\n tab3: {\n type: 'void',\n title: '{{t(\"Menu permissions\")}}',\n 'x-component': 'Tabs.TabPane',\n 'x-component-props': {},\n properties: {\n menu: {\n 'x-component': 'MenuConfigure',\n },\n },\n },\n },\n },\n },\n },\n },\n },\n update: {\n type: 'void',\n title: '{{t(\"Edit\")}}',\n 'x-component': 'Action.Link',\n 'x-component-props': {\n type: 'primary',\n },\n properties: {\n drawer: {\n type: 'void',\n 'x-component': 'Action.Drawer',\n 'x-decorator': 'Form',\n 'x-decorator-props': {\n useValues: '{{ cm.useValuesFromRecord }}',\n },\n title: '{{t(\"Edit role\")}}',\n properties: {\n title: {\n 'x-component': 'CollectionField',\n 'x-decorator': 'FormItem',\n },\n name: {\n 'x-component': 'CollectionField',\n 'x-decorator': 'FormItem',\n 'x-disabled': true,\n },\n default: {\n title: '',\n 'x-component': 'CollectionField',\n 'x-decorator': 'FormItem',\n 'x-content': '{{t(\"Default role\")}}',\n },\n footer: {\n type: 'void',\n 'x-component': 'Action.Drawer.Footer',\n properties: {\n cancel: {\n title: '{{t(\"Cancel\")}}',\n 'x-component': 'Action',\n 'x-component-props': {\n useAction: '{{ cm.useCancelAction }}',\n },\n },\n submit: {\n title: '{{t(\"Submit\")}}',\n 'x-component': 'Action',\n 'x-component-props': {\n type: 'primary',\n useAction: '{{ cm.useUpdateAction }}',\n },\n },\n },\n },\n },\n },\n },\n },\n delete: {\n type: 'void',\n title: '{{ t(\"Delete\") }}',\n 'x-component': 'Action.Link',\n 'x-component-props': {\n confirm: {\n title: \"{{t('Delete role')}}\",\n content: \"{{t('Are you sure you want to delete it?')}}\",\n },\n useAction: '{{cm.useDestroyAction}}',\n },\n },\n },\n },\n },\n },\n },\n },\n },\n },\n },\n};\n"]}
|
|
1
|
+
{"version":3,"file":"roles.js","sourceRoot":"","sources":["../../../../src/acl/Configuration/schemas/roles.ts"],"names":[],"mappings":";;;;;;;;;;;;;;AACA,0CAAsC;AACtC,kDAAiD;AACjD,8DAA6D;AAC7D,qDAA0D;AAE1D,IAAM,UAAU,GAAG;IACjB,IAAI,EAAE,OAAO;IACb,eAAe,EAAE,MAAM;IACvB,SAAS,EAAE,MAAM;IACjB,MAAM,EAAE;QACN;YACE,IAAI,EAAE,SAAS;YACf,IAAI,EAAE,OAAO;YACb,SAAS,EAAE,OAAO;YAClB,QAAQ,EAAE;gBACR,KAAK,EAAE,4BAA4B;gBACnC,IAAI,EAAE,QAAQ;gBACd,aAAa,EAAE,OAAO;gBACtB,QAAQ,EAAE,IAAI;aACJ;SACb;QACD;YACE,IAAI,EAAE,QAAQ;YACd,IAAI,EAAE,MAAM;YACZ,SAAS,EAAE,OAAO;YAClB,QAAQ,EAAE;gBACR,KAAK,EAAE,mBAAmB;gBAC1B,IAAI,EAAE,QAAQ;gBACd,aAAa,EAAE,OAAO;aACZ;SACb;QACD;YACE,IAAI,EAAE,SAAS;YACf,IAAI,EAAE,SAAS;YACf,SAAS,EAAE,SAAS;YACpB,QAAQ,EAAE;gBACR,KAAK,EAAE,uBAAuB;gBAC9B,IAAI,EAAE,SAAS;gBACf,aAAa,EAAE,UAAU;aACf;SACb;KACF;CACF,CAAC;AAEW,QAAA,UAAU,GAAY;IACjC,IAAI,EAAE,QAAQ;IACd,UAAU,EAAE;QACV,MAAM,EAAE;YACN,IAAI,EAAE,MAAM;YACZ,aAAa,EAAE,wBAAwB;YACv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UAAU;4DACzB,YAAY,EAAE,IAAI;yDACnB;wDACD,OAAO,EAAE;4DACP,KAAK,EAAE,EAAE;4DACT,aAAa,EAAE,iBAAiB;4DAChC,aAAa,EAAE,UAAU;4DACzB,WAAW,EAAE,uBAAuB;yDACrC;wDACD,MAAM,EAAE;4DACN,IAAI,EAAE,MAAM;4DACZ,aAAa,EAAE,sBAAsB;4DACrC,UAAU,EAAE;gEACV,MAAM,EAAE;oEACN,KAAK,EAAE,iBAAiB;oEACxB,aAAa,EAAE,QAAQ;oEACvB,mBAAmB,EAAE;wEACnB,SAAS,EAAE,0BAA0B;qEACtC;iEACF;gEACD,MAAM,EAAE;oEACN,KAAK,EAAE,iBAAiB;oEACxB,aAAa,EAAE,QAAQ;oEACvB,mBAAmB,EAAE;wEACnB,IAAI,EAAE,SAAS;wEACf,SAAS,EAAE,0BAA0B;qEACtC;iEACF;6DACF;yDACF;qDACF;iDACF;6CACF;yCACF;wCACD,MAAM,EAAE;4CACN,IAAI,EAAE,MAAM;4CACZ,KAAK,EAAE,mBAAmB;4CAC1B,aAAa,EAAE,aAAa;4CAC5B,mBAAmB,EAAE;gDACnB,OAAO,EAAE;oDACP,KAAK,EAAE,sBAAsB;oDAC7B,OAAO,EAAE,8CAA8C;iDACxD;gDACD,SAAS,EAAE,yBAAyB;6CACrC;yCACF;qCACF;iCACF;6BACF;yBACF;qBACF;iBACF;aACF;SACF;KACF;CACF,CAAC","sourcesContent":["import { ISchema } from '@formily/react';\nimport { uid } from '@formily/shared';\nimport { useRequest } from '../../../api-client';\nimport { useActionContext } from '../../../schema-component';\nimport { roleCollectionsSchema } from './roleCollections';\n\nconst collection = {\n name: 'roles',\n filterTargetKey: 'name',\n targetKey: 'name',\n fields: [\n {\n type: 'integer',\n name: 'title',\n interface: 'input',\n uiSchema: {\n title: '{{t(\"Role display name\")}}',\n type: 'number',\n 'x-component': 'Input',\n required: true,\n } as ISchema,\n },\n {\n type: 'string',\n name: 'name',\n interface: 'input',\n uiSchema: {\n title: '{{t(\"Role UID\")}}',\n type: 'string',\n 'x-component': 'Input',\n } as ISchema,\n },\n {\n type: 'boolean',\n name: 'default',\n interface: 'boolean',\n uiSchema: {\n title: '{{t(\"Default role\")}}',\n type: 'boolean',\n 'x-component': 'Checkbox',\n } as ISchema,\n },\n ],\n};\n\nexport const roleSchema: ISchema = {\n type: 'object',\n properties: {\n block1: {\n type: 'void',\n 'x-decorator': 'ResourceActionProvider',\n 'x-decorator-props': {\n collection,\n resourceName: 'roles',\n request: {\n resource: 'roles',\n action: 'list',\n params: {\n pageSize: 50,\n filter: {\n 'name.$ne': 'root',\n },\n showAnonymous: true,\n sort: ['createdAt'],\n appends: [],\n },\n },\n },\n 'x-component': 'CollectionProvider',\n 'x-component-props': {\n collection,\n },\n properties: {\n actions: {\n type: 'void',\n 'x-component': 'ActionBar',\n 'x-component-props': {\n style: {\n marginBottom: 16,\n },\n },\n properties: {\n delete: {\n type: 'void',\n title: '{{ t(\"Delete\") }}',\n 'x-component': 'Action',\n 'x-component-props': {\n useAction: '{{ cm.useBulkDestroyAction }}',\n confirm: {\n title: \"{{t('Delete role')}}\",\n content: \"{{t('Are you sure you want to delete it?')}}\",\n },\n },\n },\n create: {\n type: 'void',\n title: '{{t(\"Add role\")}}',\n 'x-component': 'Action',\n 'x-component-props': {\n type: 'primary',\n },\n properties: {\n drawer: {\n type: 'void',\n 'x-component': 'Action.Drawer',\n 'x-decorator': 'Form',\n 'x-decorator-props': {\n useValues(options) {\n const ctx = useActionContext();\n return useRequest(\n () =>\n Promise.resolve({\n data: {\n name: `r_${uid()}`,\n },\n }),\n { ...options, refreshDeps: [ctx.visible] },\n );\n },\n },\n title: '{{t(\"Add role\")}}',\n properties: {\n title: {\n 'x-component': 'CollectionField',\n 'x-decorator': 'FormItem',\n },\n name: {\n 'x-component': 'CollectionField',\n 'x-decorator': 'FormItem',\n description:\n '{{t(\"Randomly generated and can be modified. Support letters, numbers and underscores, must start with an letter.\")}}',\n },\n default: {\n 'x-component': 'CollectionField',\n 'x-decorator': 'FormItem',\n title: '',\n 'x-content': '{{t(\"Default role\")}}',\n },\n footer: {\n type: 'void',\n 'x-component': 'Action.Drawer.Footer',\n properties: {\n cancel: {\n title: '{{t(\"Cancel\")}}',\n 'x-component': 'Action',\n 'x-component-props': {\n useAction: '{{ cm.useCancelAction }}',\n },\n },\n submit: {\n title: '{{t(\"Submit\")}}',\n 'x-component': 'Action',\n 'x-component-props': {\n type: 'primary',\n useAction: '{{ cm.useCreateAction }}',\n },\n },\n },\n },\n },\n },\n },\n },\n },\n },\n table: {\n type: 'void',\n 'x-uid': 'input',\n 'x-component': 'Table.Void',\n 'x-component-props': {\n rowKey: 'name',\n rowSelection: {\n type: 'checkbox',\n },\n useDataSource: '{{ cm.useDataSourceFromRAC }}',\n },\n properties: {\n column1: {\n type: 'void',\n 'x-decorator': 'Table.Column.Decorator',\n 'x-component': 'Table.Column',\n properties: {\n title: {\n type: 'number',\n 'x-component': 'CollectionField',\n 'x-read-pretty': true,\n },\n },\n },\n column2: {\n type: 'void',\n 'x-decorator': 'Table.Column.Decorator',\n 'x-component': 'Table.Column',\n properties: {\n name: {\n type: 'string',\n 'x-component': 'CollectionField',\n 'x-read-pretty': true,\n },\n },\n },\n column3: {\n type: 'void',\n 'x-decorator': 'Table.Column.Decorator',\n 'x-component': 'Table.Column',\n properties: {\n default: {\n type: 'string',\n 'x-component': 'CollectionField',\n 'x-read-pretty': true,\n },\n },\n },\n column4: {\n type: 'void',\n title: '{{t(\"Actions\")}}',\n 'x-component': 'Table.Column',\n properties: {\n actions: {\n type: 'void',\n 'x-component': 'Space',\n 'x-component-props': {\n split: '|',\n },\n properties: {\n view: {\n type: 'void',\n title: '{{t(\"Configure\")}}',\n 'x-component': 'Action.Link',\n 'x-component-props': {},\n properties: {\n drawer: {\n type: 'void',\n 'x-component': 'Action.Drawer',\n title: '{{t(\"Configure permissions\")}}',\n properties: {\n tabs1: {\n type: 'void',\n 'x-component': 'Tabs',\n 'x-component-props': {},\n properties: {\n tab1: {\n type: 'void',\n title: '{{t(\"General permissions\")}}',\n 'x-component': 'Tabs.TabPane',\n 'x-component-props': {},\n properties: {\n role: {\n 'x-component': 'RoleConfigure',\n },\n },\n },\n tab2: {\n type: 'void',\n title: '{{t(\"Action permissions\")}}',\n 'x-component': 'Tabs.TabPane',\n 'x-component-props': {},\n properties: {\n roleCollectionsSchema,\n },\n },\n tab3: {\n type: 'void',\n title: '{{t(\"Menu permissions\")}}',\n 'x-component': 'Tabs.TabPane',\n 'x-component-props': {},\n properties: {\n menu: {\n 'x-component': 'MenuConfigure',\n },\n },\n },\n },\n },\n },\n },\n },\n },\n update: {\n type: 'void',\n title: '{{t(\"Edit\")}}',\n 'x-component': 'Action.Link',\n 'x-component-props': {\n type: 'primary',\n },\n properties: {\n drawer: {\n type: 'void',\n 'x-component': 'Action.Drawer',\n 'x-decorator': 'Form',\n 'x-decorator-props': {\n useValues: '{{ cm.useValuesFromRecord }}',\n },\n title: '{{t(\"Edit role\")}}',\n properties: {\n title: {\n 'x-component': 'CollectionField',\n 'x-decorator': 'FormItem',\n },\n name: {\n 'x-component': 'CollectionField',\n 'x-decorator': 'FormItem',\n 'x-disabled': true,\n },\n default: {\n title: '',\n 'x-component': 'CollectionField',\n 'x-decorator': 'FormItem',\n 'x-content': '{{t(\"Default role\")}}',\n },\n footer: {\n type: 'void',\n 'x-component': 'Action.Drawer.Footer',\n properties: {\n cancel: {\n title: '{{t(\"Cancel\")}}',\n 'x-component': 'Action',\n 'x-component-props': {\n useAction: '{{ cm.useCancelAction }}',\n },\n },\n submit: {\n title: '{{t(\"Submit\")}}',\n 'x-component': 'Action',\n 'x-component-props': {\n type: 'primary',\n useAction: '{{ cm.useUpdateAction }}',\n },\n },\n },\n },\n },\n },\n },\n },\n delete: {\n type: 'void',\n title: '{{ t(\"Delete\") }}',\n 'x-component': 'Action.Link',\n 'x-component-props': {\n confirm: {\n title: \"{{t('Delete role')}}\",\n content: \"{{t('Are you sure you want to delete it?')}}\",\n },\n useAction: '{{cm.useDestroyAction}}',\n },\n },\n },\n },\n },\n },\n },\n },\n },\n },\n },\n};\n"]}
|
package/lib/locale/index.d.ts
CHANGED
|
@@ -604,7 +604,12 @@ export declare const resources: {
|
|
|
604
604
|
'Delete role': string;
|
|
605
605
|
'Role display name': string;
|
|
606
606
|
'Default role': string;
|
|
607
|
+
'All collections use general action permissions by default; permission configured individually will override the default one.': string;
|
|
608
|
+
'Allows configuration of the whole system, including UI, collections, permissions, etc.': string;
|
|
609
|
+
'New menu items are allowed to be accessed by default.': string;
|
|
607
610
|
'Global permissions': string;
|
|
611
|
+
'General permissions': string;
|
|
612
|
+
'Global action permissions': string;
|
|
608
613
|
'General action permissions': string;
|
|
609
614
|
'Action display name': string;
|
|
610
615
|
Allow: string;
|
package/lib/locale/zh_CN.d.ts
CHANGED
|
@@ -336,7 +336,12 @@ declare const _default: {
|
|
|
336
336
|
'Delete role': string;
|
|
337
337
|
'Role display name': string;
|
|
338
338
|
'Default role': string;
|
|
339
|
+
'All collections use general action permissions by default; permission configured individually will override the default one.': string;
|
|
340
|
+
'Allows configuration of the whole system, including UI, collections, permissions, etc.': string;
|
|
341
|
+
'New menu items are allowed to be accessed by default.': string;
|
|
339
342
|
'Global permissions': string;
|
|
343
|
+
'General permissions': string;
|
|
344
|
+
'Global action permissions': string;
|
|
340
345
|
'General action permissions': string;
|
|
341
346
|
'Action display name': string;
|
|
342
347
|
Allow: string;
|
package/lib/locale/zh_CN.js
CHANGED
|
@@ -338,7 +338,12 @@ exports.default = {
|
|
|
338
338
|
'Delete role': '删除角色',
|
|
339
339
|
'Role display name': '角色名称',
|
|
340
340
|
'Default role': '默认角色',
|
|
341
|
+
'All collections use general action permissions by default; permission configured individually will override the default one.': '所有数据表都默认使用通用数据操作权限;同时,可以针对每个数据表单独配置权限。',
|
|
342
|
+
'Allows configuration of the whole system, including UI, collections, permissions, etc.': '允许配置系统,包括界面配置、数据表配置、权限配置、系统配置等全部配置项',
|
|
343
|
+
'New menu items are allowed to be accessed by default.': '新增菜单项默认允许访问',
|
|
341
344
|
'Global permissions': '全局配置',
|
|
345
|
+
'General permissions': '通用配置',
|
|
346
|
+
'Global action permissions': '全局操作权限',
|
|
342
347
|
'General action permissions': '通用操作权限',
|
|
343
348
|
'Action display name': '操作名称',
|
|
344
349
|
'Allow': '允许',
|