Commit 986d20ebac945b6c55b7367ceba93904ce9a3137
1 parent
b7633a89
Revert "feat: 更改出参"
This reverts commit b7633a89.
Showing
2 changed files
with
6 additions
and
28 deletions
| @@ -7,7 +7,6 @@ import { QxAppSelector } from '../qx-app-selector'; | @@ -7,7 +7,6 @@ import { QxAppSelector } from '../qx-app-selector'; | ||
| 7 | import type { InputSelectProps } from '../qx-input-select'; | 7 | import type { InputSelectProps } from '../qx-input-select'; |
| 8 | import { QxInputSelect } from '../qx-input-select'; | 8 | import { QxInputSelect } from '../qx-input-select'; |
| 9 | 9 | ||
| 10 | -import { getFunInfo } from './service'; | ||
| 11 | import './styles.less'; | 10 | import './styles.less'; |
| 12 | 11 | ||
| 13 | const prefix = 'qx-form-select'; | 12 | const prefix = 'qx-form-select'; |
| @@ -26,7 +25,7 @@ export const QxFormSelect: React.FC<FormSelectProps> = (props) => { | @@ -26,7 +25,7 @@ export const QxFormSelect: React.FC<FormSelectProps> = (props) => { | ||
| 26 | request, | 25 | request, |
| 27 | disabled, | 26 | disabled, |
| 28 | placeholder, | 27 | placeholder, |
| 29 | - title, | 28 | + title |
| 30 | } = props; | 29 | } = props; |
| 31 | 30 | ||
| 32 | const [state, setState] = useSetState<FormSelectState>({ | 31 | const [state, setState] = useSetState<FormSelectState>({ |
| @@ -40,25 +39,10 @@ export const QxFormSelect: React.FC<FormSelectProps> = (props) => { | @@ -40,25 +39,10 @@ export const QxFormSelect: React.FC<FormSelectProps> = (props) => { | ||
| 40 | if (!val?.code) return; | 39 | if (!val?.code) return; |
| 41 | function onOk() { | 40 | function onOk() { |
| 42 | if (val?.code) { | 41 | if (val?.code) { |
| 43 | - getFunInfo(request, val.code) | ||
| 44 | - .then((res: any) => { | ||
| 45 | - if (res) { | ||
| 46 | - onChange?.({ | ||
| 47 | - ...res, | ||
| 48 | - appId: res.extract?.appId || val.appId, | ||
| 49 | - isTree: res.extract?.isTree, | ||
| 50 | - funId: res.code, | ||
| 51 | - }); | ||
| 52 | - } | ||
| 53 | - setState({ | ||
| 54 | - visible: false, | ||
| 55 | - }); | ||
| 56 | - }) | ||
| 57 | - .catch(() => { | ||
| 58 | - setState({ | ||
| 59 | - visible: false, | ||
| 60 | - }); | ||
| 61 | - }); | 42 | + onChange?.(val); |
| 43 | + setState({ | ||
| 44 | + visible: false, | ||
| 45 | + }); | ||
| 62 | } | 46 | } |
| 63 | } | 47 | } |
| 64 | onOk(); | 48 | onOk(); |
| @@ -100,7 +84,7 @@ export const QxFormSelect: React.FC<FormSelectProps> = (props) => { | @@ -100,7 +84,7 @@ export const QxFormSelect: React.FC<FormSelectProps> = (props) => { | ||
| 100 | 84 | ||
| 101 | {state.modalVisible ? ( | 85 | {state.modalVisible ? ( |
| 102 | <QxAppSelector | 86 | <QxAppSelector |
| 103 | - title={title || placeholder || '选择数据源'} | 87 | + title={title || placeholder || "选择数据源"} |
| 104 | item={{ | 88 | item={{ |
| 105 | flag: 'SINGLE', | 89 | flag: 'SINGLE', |
| 106 | currentId: '', | 90 | currentId: '', |