diff --git a/react-ui/src/components/ParameterSelect/index.tsx b/react-ui/src/components/ParameterSelect/index.tsx
index 04e6b87f..182db352 100644
--- a/react-ui/src/components/ParameterSelect/index.tsx
+++ b/react-ui/src/components/ParameterSelect/index.tsx
@@ -10,12 +10,12 @@ import { useEffect, useState } from 'react';
import FormInfo from '../FormInfo';
import { paramSelectConfig } from './config';
-type ParameterSelectObject = {
+export type ParameterSelectObject = {
value: any;
[key: string]: any;
};
-interface ParameterSelectProps extends SelectProps {
+export interface ParameterSelectProps extends SelectProps {
/** 类型 */
dataType: 'dataset' | 'model' | 'service' | 'resource';
/** 是否只是展示信息 */
diff --git a/react-ui/src/stories/CodeSelect.stories.tsx b/react-ui/src/stories/CodeSelect.stories.tsx
index ce4b2c90..415d05da 100644
--- a/react-ui/src/stories/CodeSelect.stories.tsx
+++ b/react-ui/src/stories/CodeSelect.stories.tsx
@@ -1,8 +1,9 @@
import CodeSelect, { type ParameterInputValue } from '@/components/CodeSelect';
+import { action } from '@storybook/addon-actions';
import { useArgs } from '@storybook/preview-api';
import type { Meta, StoryObj } from '@storybook/react';
import { fn } from '@storybook/test';
-import { Col, Form, Row } from 'antd';
+import { Button, Col, Form, Row } from 'antd';
import { http, HttpResponse } from 'msw';
import { codeListData } from './mockData';
@@ -62,6 +63,7 @@ export const InForm: Story = {
labelAlign="left"
size="large"
autoComplete="off"
+ onFinish={action('onFinish')}
>
@@ -75,6 +77,11 @@ export const InForm: Story = {
+
+
+
);
},
diff --git a/react-ui/src/stories/ParameterSelect.stories.tsx b/react-ui/src/stories/ParameterSelect.stories.tsx
index 924ab423..d6399d5d 100644
--- a/react-ui/src/stories/ParameterSelect.stories.tsx
+++ b/react-ui/src/stories/ParameterSelect.stories.tsx
@@ -1,4 +1,5 @@
-import ParameterSelect, { ParameterSelectValue } from '@/components/ParameterSelect';
+import ParameterSelect, { type ParameterSelectObject } from '@/components/ParameterSelect';
+import { action } from '@storybook/addon-actions';
import { useArgs } from '@storybook/preview-api';
import type { Meta, StoryObj } from '@storybook/react';
import { fn } from '@storybook/test';
@@ -33,9 +34,6 @@ const meta = {
// This component will have an automatically generated Autodocs entry: https://storybook.js.org/docs/writing-docs/autodocs
tags: ['autodocs'],
// More on argTypes: https://storybook.js.org/docs/api/argtypes
- argTypes: {
- // backgroundColor: { control: 'color' },
- },
// Use `fn` to spy on the onClick arg, which will appear in the actions panel once invoked: https://storybook.js.org/docs/essentials/actions#action-args
args: { onChange: fn() },
} satisfies Meta;
@@ -53,7 +51,7 @@ export const Primary: Story = {
},
render: function Render(args) {
const [{ value }, updateArgs] = useArgs();
- function handleChange(value?: ParameterSelectValue) {
+ function handleChange(value?: string | ParameterSelectObject) {
updateArgs({ value: value });
args.onChange?.(value);
}
@@ -75,7 +73,7 @@ export const Object: Story = {
},
render: function Render(args) {
const [{ value }, updateArgs] = useArgs();
- function handleChange(value?: ParameterSelectValue) {
+ function handleChange(value?: string | ParameterSelectObject) {
updateArgs({ value: value });
args.onChange?.(value);
}
@@ -95,9 +93,7 @@ export const InForm: Story = {
labelCol={{ flex: '80px' }}
labelAlign="left"
size="large"
- onFinish={(values) => {
- console.log('onFinish', values);
- }}
+ onFinish={action('onFinish')}
autoComplete="off"
initialValues={{
dataset: {
diff --git a/react-ui/src/stories/ResourceSelect.stories.tsx b/react-ui/src/stories/ResourceSelect.stories.tsx
index 93474d7f..8b87f990 100644
--- a/react-ui/src/stories/ResourceSelect.stories.tsx
+++ b/react-ui/src/stories/ResourceSelect.stories.tsx
@@ -3,10 +3,11 @@ import ResourceSelect, {
requiredValidator,
ResourceSelectorType,
} from '@/components/ResourceSelect';
+import { action } from '@storybook/addon-actions';
import { useArgs } from '@storybook/preview-api';
import type { Meta, StoryObj } from '@storybook/react';
import { fn } from '@storybook/test';
-import { Col, Form, Row } from 'antd';
+import { Button, Col, Form, Row } from 'antd';
import { http, HttpResponse } from 'msw';
import {
datasetDetailData,
@@ -100,6 +101,7 @@ export const InForm: Story = {
labelAlign="left"
size="large"
autoComplete="off"
+ onFinish={action('onFinish')}
>
@@ -150,6 +152,11 @@ export const InForm: Story = {
+
+
+
);
},