diff --git a/packages/amis-editor/src/plugin/Form/InputImage.tsx b/packages/amis-editor/src/plugin/Form/InputImage.tsx index 5e98d828b..2d2d71949 100644 --- a/packages/amis-editor/src/plugin/Form/InputImage.tsx +++ b/packages/amis-editor/src/plugin/Form/InputImage.tsx @@ -372,7 +372,19 @@ export class ImageControlPlugin extends BasePlugin { getSchemaTpl('switch', { name: 'limit', label: '图片限制', - pipeIn: (value: any) => !!value + pipeIn: (value: any) => !!value, + onChange: ( + value: any, + oldValue: boolean, + model: any, + form: any + ) => { + if (!value) { + form.setValues({ + maxSize: undefined + }); + } + } }), { diff --git a/packages/amis-editor/src/plugin/Image.tsx b/packages/amis-editor/src/plugin/Image.tsx index 2815754e5..416c2a920 100644 --- a/packages/amis-editor/src/plugin/Image.tsx +++ b/packages/amis-editor/src/plugin/Image.tsx @@ -190,12 +190,30 @@ export class ImagePlugin extends BasePlugin { { name: 'width', label: '宽度', - type: 'input-number' + type: 'input-number', + onChange: (value: any) => { + const node = context.node; + node.updateState({ + width: value + }); + requestAnimationFrame(() => { + node.calculateHighlightBox(); + }); + } }, { name: 'height', label: '高度', - type: 'input-number' + type: 'input-number', + onChange: (value: any) => { + const node = context.node; + node.updateState({ + height: value + }); + requestAnimationFrame(() => { + node.calculateHighlightBox(); + }); + } }, isUnderField diff --git a/packages/amis-ui/scss/components/_image-gallery.scss b/packages/amis-ui/scss/components/_image-gallery.scss index ad4c2b075..8283fae19 100644 --- a/packages/amis-ui/scss/components/_image-gallery.scss +++ b/packages/amis-ui/scss/components/_image-gallery.scss @@ -17,6 +17,7 @@ border: none; border-radius: 0; max-width: 1010px !important; + padding-top: 0; &-close { position: absolute; @@ -36,12 +37,13 @@ } &-title { - height: px2rem(30px); + height: px2rem(18px); vertical-align: top; - line-height: px2rem(30px); + line-height: px2rem(18px); font-size: px2rem(12px); color: var(--white); text-align: center; + margin-bottom: 18px; } &-main { diff --git a/packages/amis/src/renderers/Form/InputImage.tsx b/packages/amis/src/renderers/Form/InputImage.tsx index afaa5aa3c..7f7e77dbd 100644 --- a/packages/amis/src/renderers/Form/InputImage.tsx +++ b/packages/amis/src/renderers/Form/InputImage.tsx @@ -1671,7 +1671,6 @@ export default class ImageControl extends React.Component< accept={accept} multiple={dropMultiple} disabled={disabled} - maxSize={crop ? undefined : maxSize} > {({ getRootProps,