diff --git a/scss/components/form/_image.scss b/scss/components/form/_image.scss index 5ea82828..432756ea 100644 --- a/scss/components/form/_image.scss +++ b/scss/components/form/_image.scss @@ -78,6 +78,7 @@ &-itemImageWrap { width: px2rem(108px); height: px2rem(108px); + background-image: url("data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHZlcnNpb249IjEuMSIgd2lkdGg9IjIwMCIgaGVpZ2h0PSI0MDAiPgogICAgPGRlZnM+CiAgICAgICAgPHBhdHRlcm4gaWQ9ImdyaWQiIHdpZHRoPSIyMCIgaGVpZ2h0PSIyMCIgcGF0dGVyblVuaXRzPSJ1c2VyU3BhY2VPblVzZSI+CiAgICAgICAgICAgIDxyZWN0IGZpbGw9ImJsYWNrIiB4PSIwIiB5PSIwIiB3aWR0aD0iMTAiIGhlaWdodD0iMTAiIG9wYWNpdHk9IjAuMSIgLz4KICAgICAgICAgICAgPHJlY3QgZmlsbD0id2hpdGUiIHg9IjEwIiB5PSIwIiB3aWR0aD0iMTAiIGhlaWdodD0iMTAiIC8+CiAgICAgICAgICAgIDxyZWN0IGZpbGw9ImJsYWNrIiB4PSIxMCIgeT0iMTAiIHdpZHRoPSIxMCIgaGVpZ2h0PSIxMCIgb3BhY2l0eT0iMC4xIiAvPgogICAgICAgICAgICA8cmVjdCBmaWxsPSJ3aGl0ZSIgeD0iMCIgeT0iMTAiIHdpZHRoPSIxMCIgaGVpZ2h0PSIxMCIgLz4KICAgICAgICA8L3BhdHRlcm4+CiAgICA8L2RlZnM+CiAgICA8cmVjdCBmaWxsPSJ1cmwoI2dyaWQpIiB4PSIwIiB5PSIwIiB3aWR0aD0iMTAwJSIgaGVpZ2h0PSIxMDAlIiAvPgo8L3N2Zz4="); overflow: hidden; position: relative; diff --git a/src/components/Select.tsx b/src/components/Select.tsx index b1b8e493..22e2a63a 100644 --- a/src/components/Select.tsx +++ b/src/components/Select.tsx @@ -631,7 +631,7 @@ export class Select extends React.Component { return (
{ ) : ( {item.disabled - ? item.label + ? item[labelField] : highlight( item[labelField], inputValue as string, diff --git a/src/components/icons.tsx b/src/components/icons.tsx index 5e9940d7..b1c4466f 100644 --- a/src/components/icons.tsx +++ b/src/components/icons.tsx @@ -51,6 +51,9 @@ import FailIcon from '../icons/fail.svg'; // @ts-ignore import SearchIcon from '../icons/search.svg'; +// @ts-ignore +import BackIcon from '../icons/back.svg'; + // 兼容原来的用法,后续不直接试用。 // @ts-ignore export const closeIcon = ; @@ -107,6 +110,7 @@ registerIcon('file', FileIcon); registerIcon('success', SuccessIcon); registerIcon('fail', FailIcon); registerIcon('search', SearchIcon); +registerIcon('back', BackIcon); export function Icon({ icon, diff --git a/src/icons/back.svg b/src/icons/back.svg new file mode 100644 index 00000000..1c0e7e40 --- /dev/null +++ b/src/icons/back.svg @@ -0,0 +1,11 @@ + + + + + + + + + \ No newline at end of file diff --git a/src/icons/transparent.svg b/src/icons/transparent.svg new file mode 100644 index 00000000..64ce64aa --- /dev/null +++ b/src/icons/transparent.svg @@ -0,0 +1,11 @@ + + + + + + + + + + + \ No newline at end of file diff --git a/src/renderers/Form/index.tsx b/src/renderers/Form/index.tsx index ca72e57c..e6dc064e 100644 --- a/src/renderers/Form/index.tsx +++ b/src/renderers/Form/index.tsx @@ -29,6 +29,7 @@ import {IComboStore} from '../../store/combo'; import qs = require('qs'); import {dataMapping} from '../../utils/tpl-builtin'; import {isApiOutdated, isEffectiveApi} from '../../utils/api'; +import Spinner from '../../components/Spinner'; export type FormGroup = FormSchema & { title?: string; className?: string; @@ -651,7 +652,11 @@ export default class Form extends React.Component { .then(async response => { response && onChange && - onChange(store.data, difference(store.data, store.pristine)); + onChange( + store.data, + difference(store.data, store.pristine), + this.props + ); if (store.validated) { await this.validate(true); } @@ -688,7 +693,12 @@ export default class Form extends React.Component { targets[0].props.type === 'form' ) { store.updateData(values[0]); - onChange && onChange(store.data, difference(store.data, store.pristine)); + onChange && + onChange( + store.data, + difference(store.data, store.pristine), + this.props + ); } store.closeDialog(true); @@ -714,7 +724,12 @@ export default class Form extends React.Component { targets[0].props.type === 'form' ) { store.updateData(values[0]); - onChange && onChange(store.data, difference(store.data, store.pristine)); + onChange && + onChange( + store.data, + difference(store.data, store.pristine), + this.props + ); } store.closeDrawer(true); @@ -972,6 +987,8 @@ export default class Form extends React.Component { ) : null} + + {this.renderBody()} {render(