Skip to content

Commit

Permalink
Merge pull request #42 from hocgin/v4.0.18
Browse files Browse the repository at this point in the history
feat: v4.0.18
  • Loading branch information
hocgin authored Dec 3, 2021
2 parents 296ec66 + 5ac2b2d commit f697cfd
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 18 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@hocgin/ui",
"version": "4.0.17",
"version": "4.0.18",
"sideEffects": [
".less",
".css"
Expand Down
19 changes: 4 additions & 15 deletions src/Promise/components/ArchiveSchemaConfig/index.tsx
Original file line number Diff line number Diff line change
@@ -1,16 +1,11 @@
import React, { useState } from 'react';
import { Button } from 'antd';
import { Promise, Utils } from '@hocgin/ui';
import { Promise } from '@hocgin/ui';
import { PlusOutlined } from '@ant-design/icons';
import { ProFormLayoutType } from '@ant-design/pro-form/lib/components/SchemaForm';
import { UseAction } from '@/Promise/components/ArchiveSchemaConfig/type';
import { useBoolean, useRequest } from 'ahooks';
import { UseAction } from './type';

type ConfigType = {
/**
* 默认参数
*/
defaultParams?: any;
/**
* 是否更新模式
*/
Expand Down Expand Up @@ -50,7 +45,6 @@ const ArchiveSchemaConfig: React.FC<ArchiveSchemaConfigProps> = ({
}) => {
// @formatter: on
let {
defaultParams,
useAction,
title,
layoutType = 'ModalForm',
Expand All @@ -61,11 +55,6 @@ const ArchiveSchemaConfig: React.FC<ArchiveSchemaConfigProps> = ({
} = config;
let [initial, setInitial] = useState(false);

let submitRequest = useRequest(useAction!.submit, {
...defaultParams,
manual: true,
});

let triggerEl = trigger ? (
trigger
) : isUpdate ? (
Expand All @@ -84,8 +73,8 @@ const ArchiveSchemaConfig: React.FC<ArchiveSchemaConfigProps> = ({
params={{ initial }}
title={title}
trigger={triggerEl}
onVisibleChange={(visible) => setInitial(true)}
onFinish={async (values: any) => submitRequest.run(values)}
onVisibleChange={() => setInitial(true)}
onFinish={useAction!.submit}
request={async (params: Record<string, any>, props: any) =>
initial && useAction?.initialValues(params)
}
Expand Down
3 changes: 2 additions & 1 deletion src/Promise/demos/scheme-archive-config.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,8 @@ export const config: any = {
};
},
submit: async (params: Record<string, any>) => {
return {};
console.log('保存', params);
return true;
},
},
layoutType: 'ModalForm',
Expand Down
2 changes: 1 addition & 1 deletion src/Promise/demos/scheme-table-config.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import data from './table-config';

let deleteConfig = {
delete: async (id: any[]) => {
console.log('删除', id);
console.log('删除2', id);
},
};

Expand Down

1 comment on commit f697cfd

@vercel
Copy link

@vercel vercel bot commented on f697cfd Dec 3, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.