Showing
2 changed files
with
28 additions
and
6 deletions
@@ -7,6 +7,7 @@ import { QxAppSelector } from '../qx-app-selector'; | @@ -7,6 +7,7 @@ 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'; | ||
10 | import './styles.less'; | 11 | import './styles.less'; |
11 | 12 | ||
12 | const prefix = 'qx-form-select'; | 13 | const prefix = 'qx-form-select'; |
@@ -25,7 +26,7 @@ export const QxFormSelect: React.FC<FormSelectProps> = (props) => { | @@ -25,7 +26,7 @@ export const QxFormSelect: React.FC<FormSelectProps> = (props) => { | ||
25 | request, | 26 | request, |
26 | disabled, | 27 | disabled, |
27 | placeholder, | 28 | placeholder, |
28 | - title | 29 | + title, |
29 | } = props; | 30 | } = props; |
30 | 31 | ||
31 | const [state, setState] = useSetState<FormSelectState>({ | 32 | const [state, setState] = useSetState<FormSelectState>({ |
@@ -39,10 +40,25 @@ export const QxFormSelect: React.FC<FormSelectProps> = (props) => { | @@ -39,10 +40,25 @@ export const QxFormSelect: React.FC<FormSelectProps> = (props) => { | ||
39 | if (!val?.code) return; | 40 | if (!val?.code) return; |
40 | function onOk() { | 41 | function onOk() { |
41 | if (val?.code) { | 42 | if (val?.code) { |
42 | - onChange?.(val); | ||
43 | - setState({ | ||
44 | - visible: false, | ||
45 | - }); | 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 | + }); | ||
46 | } | 62 | } |
47 | } | 63 | } |
48 | onOk(); | 64 | onOk(); |
@@ -84,7 +100,7 @@ export const QxFormSelect: React.FC<FormSelectProps> = (props) => { | @@ -84,7 +100,7 @@ export const QxFormSelect: React.FC<FormSelectProps> = (props) => { | ||
84 | 100 | ||
85 | {state.modalVisible ? ( | 101 | {state.modalVisible ? ( |
86 | <QxAppSelector | 102 | <QxAppSelector |
87 | - title={title || placeholder || "选择数据源"} | 103 | + title={title || placeholder || '选择数据源'} |
88 | item={{ | 104 | item={{ |
89 | flag: 'SINGLE', | 105 | flag: 'SINGLE', |
90 | currentId: '', | 106 | currentId: '', |
-
mentioned in commit 986d20eb