fix(approval): change component register (#1399)

Reviewed-on: daoyoucloud/tachybase#1399
This commit is contained in:
bai.zixv 2024-07-29 11:18:23 +08:00
parent 1797292dbc
commit e0812e9fc3
4 changed files with 9 additions and 2 deletions

View File

@ -0,0 +1,4 @@
// NOTE: 声明空组件, 便于配置时不受业务逻辑影响
export const ProviderApprovalUpdateForm = (props) => {
return props.children;
};

View File

@ -9,6 +9,7 @@ import { DetailsBlockProvider, SimpleDesigner } from '../../../../../components'
import { FormBlockProvider } from '../../../common/FormBlock.provider';
import { flatSchemaArray } from '../../../constants';
import { ContextApproverConfig } from '../ApproverConfig.context';
import { ProviderApprovalUpdateForm } from './ApprovalUpdateForm.provider';
import { ActionBarProvider } from './Pd.ActionBarProvider';
import { ApprovalActionProvider } from './Pd.ApprovalActionProvider';
import { ContextApproverBlock } from './Pd.SchemaConfigButtonContext';
@ -87,6 +88,7 @@ export const ApproverBlock = ({ value: srcID, onChange }) => {
ApprovalActionProvider,
DetailsBlockProvider,
SimpleDesigner,
ProviderApprovalUpdateForm,
}}
// @ts-ignore
schema={schemaData}

View File

@ -4,6 +4,7 @@ import { tval } from '../../locale';
import { KitApprovalCommon } from '../approval-common/plugin';
import { ApprovalBlockComponent, SCApprovalBlock } from './ApprovalBlock.schema';
import { ViewActionLaunch } from './launch/VC.ViewActionLaunch';
import { ProviderApprovalUpdateForm } from './todos/ApprovalUpdateForm.provider';
import { ViewActionTodos } from './todos/VC.ViewActionTodos';
export class KitApprovalBlock extends Plugin {
@ -17,6 +18,8 @@ export class KitApprovalBlock extends Plugin {
'ApprovalBlock.BlockInitializer': ApprovalBlockComponent,
'ApprovalBlock.ViewActionLaunch': ViewActionLaunch,
'ApprovalBlock.ViewActionTodos': ViewActionTodos,
// NOTE: 这里注册在全局, 而不是组件内的作用域, 是为了让手机端共享到
ProviderApprovalUpdateForm: ProviderApprovalUpdateForm,
});
this.app.schemaInitializerManager.get('page:addBlock').add('otherBlocks.approval', {

View File

@ -19,7 +19,6 @@ import { ApprovalContext } from '../../approval-common/ApprovalData.provider';
import { ContextWithActionEnabled } from '../../approval-common/WithActionEnabled.provider';
import { ContextApprovalExecution } from '../common/ApprovalExecution.provider';
import { SchemaComponentContextProvider } from '../common/SchemaComponent.provider';
import { ProviderApprovalUpdateForm } from './ApprovalUpdateForm.provider';
import { ApprovalFormBlockDecorator } from './Dt.ApprovalFormBlock';
import { useApprovalDetailBlockProps } from './hooks/useApprovalDetailBlockProps';
import { useApprovalFormBlockProps } from './hooks/useApprovalFormBlockProps';
@ -99,7 +98,6 @@ export const ViewActionTodosContent = () => {
ApprovalActionProvider,
ApprovalFormBlockProvider: ApprovalFormBlockDecorator,
DetailsBlockProvider,
ProviderApprovalUpdateForm,
}}
scope={{
useApprovalDetailBlockProps,