还原代码

This commit is contained in:
2betop 2020-07-24 17:00:06 +08:00
parent 8ff2d1629f
commit 5e397fc017
3 changed files with 8 additions and 4 deletions

View File

@ -304,7 +304,7 @@ export function renderChild(
props.hidden ||
props.visible === false)
) {
return (<></>);
return null;
}
const transform = props.propsTransform;

View File

@ -23,6 +23,7 @@ import {isEffectiveApi} from '../../utils/api';
import {Alert2} from '../../components';
import memoize from 'lodash/memoize';
import {Icon} from '../../components/icons';
import {isAlive} from 'mobx-state-tree';
export interface Condition {
test: string;
controls: Array<Schema>;
@ -382,8 +383,10 @@ export default class ComboControl extends React.Component<ComboProps> {
this.props.onChange(value, submitOnChange, true);
store.forms.forEach(item =>
item.items.forEach(item => item.unique && item.syncOptions())
store.forms.forEach(
item =>
isAlive(item) &&
item.items.forEach(item => item.unique && item.syncOptions())
);
}

View File

@ -7,6 +7,7 @@ import Scoped, {ScopedContext, IScopedContext} from '../../Scoped';
import {observer} from 'mobx-react';
import {ServiceStore, IServiceStore} from '../../store/service';
import {IFormStore} from '../../store/form';
import {isObject} from '../../utils/helper';
@Renderer({
test: /(^|\/)form\/(.*)\/service$/,
@ -59,7 +60,7 @@ export class ServiceRenderer extends BasicService {
// 有可能有很多层 serivce这里需要注意。
if (formStore && this.isFormMode()) {
const keys = Object.keys(payload.data);
const keys = isObject(payload?.data) ? Object.keys(payload.data) : [];
if (keys.length) {
formStore.setValues(payload.data);