|
@@ -45,7 +45,7 @@ const Save = () => {
|
|
|
const [visible, setVisiable] = useState<boolean>(false);
|
|
const [visible, setVisiable] = useState<boolean>(false);
|
|
|
const [detail, setDetail] = useState<any>({});
|
|
const [detail, setDetail] = useState<any>({});
|
|
|
const accessRef = useRef<any>([]);
|
|
const accessRef = useRef<any>([]);
|
|
|
- const [type, setType] = useState<any>('');
|
|
|
|
|
|
|
+ const [type, setType] = useState<any>('internal-standalone');
|
|
|
|
|
|
|
|
const provider1 = require('/public/images/apply/provider1.png');
|
|
const provider1 = require('/public/images/apply/provider1.png');
|
|
|
const provider2 = require('/public/images/apply/provider2.png');
|
|
const provider2 = require('/public/images/apply/provider2.png');
|
|
@@ -168,17 +168,19 @@ const Save = () => {
|
|
|
const integrationModes = resp.result.integrationModes.map((item: any) => item.value);
|
|
const integrationModes = resp.result.integrationModes.map((item: any) => item.value);
|
|
|
// setAccess(integrationModes)
|
|
// setAccess(integrationModes)
|
|
|
accessRef.current = integrationModes;
|
|
accessRef.current = integrationModes;
|
|
|
- formInit.setInitialValues({
|
|
|
|
|
|
|
+
|
|
|
|
|
+ formInit.setValues({
|
|
|
...resp.result,
|
|
...resp.result,
|
|
|
integrationModes,
|
|
integrationModes,
|
|
|
- 'apiServer.appId': id,
|
|
|
|
|
});
|
|
});
|
|
|
|
|
+ formInit.setValuesIn('apiServer.appId', id);
|
|
|
});
|
|
});
|
|
|
onFieldValueChange('provider', (field, form1) => {
|
|
onFieldValueChange('provider', (field, form1) => {
|
|
|
const value = field.value;
|
|
const value = field.value;
|
|
|
- setType(value);
|
|
|
|
|
- // console.log(value);
|
|
|
|
|
|
|
+ setType(field.value);
|
|
|
if (field.modified) {
|
|
if (field.modified) {
|
|
|
|
|
+ form1.setValuesIn('apiServer.secureKey', randomString());
|
|
|
|
|
+ form1.setValuesIn('apiServer.roleIdList', []);
|
|
|
switch (value) {
|
|
switch (value) {
|
|
|
case 'internal-standalone':
|
|
case 'internal-standalone':
|
|
|
form1.setFieldState('integrationModes', (f1) => {
|
|
form1.setFieldState('integrationModes', (f1) => {
|
|
@@ -259,6 +261,10 @@ const Save = () => {
|
|
|
field.selfErrors = '';
|
|
field.selfErrors = '';
|
|
|
}
|
|
}
|
|
|
});
|
|
});
|
|
|
|
|
+ onFieldReact('apiServer.appId', (field: any) => {
|
|
|
|
|
+ const value = (field as Field).value;
|
|
|
|
|
+ console.log(value);
|
|
|
|
|
+ });
|
|
|
},
|
|
},
|
|
|
}),
|
|
}),
|
|
|
[id],
|
|
[id],
|
|
@@ -1957,6 +1963,15 @@ const Save = () => {
|
|
|
setView(location.state.view);
|
|
setView(location.state.view);
|
|
|
}
|
|
}
|
|
|
}, [location]);
|
|
}, [location]);
|
|
|
|
|
+
|
|
|
|
|
+ useEffect(() => {
|
|
|
|
|
+ const item = form.getValuesIn('provider');
|
|
|
|
|
+ // console.log(item, form.getState())
|
|
|
|
|
+ // setType(localStorage.getItem('type'))
|
|
|
|
|
+
|
|
|
|
|
+ console.log(item, form.getState());
|
|
|
|
|
+ }, []);
|
|
|
|
|
+
|
|
|
return (
|
|
return (
|
|
|
<PageContainer>
|
|
<PageContainer>
|
|
|
<Card>
|
|
<Card>
|