From 1bbee5bdfbb891bc43f107997b592814ae57672f Mon Sep 17 00:00:00 2001 From: 2betop <2betop.cn@gmail.com> Date: Fri, 29 May 2020 18:02:03 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BC=98=E5=8C=96=E5=85=B3=E8=81=94=E9=80=89?= =?UTF-8?q?=E6=8B=A9=E7=9A=84=E6=A0=B7=E5=BC=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- scss/components/_spinner.scss | 14 ++++++++++ scss/components/form/_checks.scss | 28 ++++++++++++++++++-- src/components/AssociatedCheckboxes.tsx | 34 ++++++++++++++++++++++--- src/components/icons.tsx | 4 +++ src/icons/reload.svg | 6 +++++ src/renderers/Form/Options.tsx | 16 ++++++++++-- src/store/formItem.ts | 32 ++++++++++++++++------- 7 files changed, 117 insertions(+), 17 deletions(-) create mode 100644 src/icons/reload.svg diff --git a/scss/components/_spinner.scss b/scss/components/_spinner.scss index 0a01c238b..7c098c6f0 100644 --- a/scss/components/_spinner.scss +++ b/scss/components/_spinner.scss @@ -8,6 +8,20 @@ } } +@keyframes spin { + 0% { + transform: rotate(0deg); + } + + to { + transform: rotate(1turn); + } +} + +.is-spin { + animation: spin 2s linear infinite; +} + .#{$ns}Spinner-overlay { position: absolute; z-index: 10; diff --git a/scss/components/form/_checks.scss b/scss/components/form/_checks.scss index 236075150..5c19b3e65 100644 --- a/scss/components/form/_checks.scss +++ b/scss/components/form/_checks.scss @@ -563,7 +563,31 @@ border-right: 1px solid $borderColor; } - &-placeholder { - @include checkboxes-placeholder(); + &-reload { + text-align: center; + color: $info; + margin: 20px 0 0; + + &.is-clickable { + cursor: pointer; + } + } + + &-box { + line-height: $Form-input-lineHeight; + font-size: $fontSizeSm; + color: $text--muted-color; + flex-grow: 1; + display: flex; + flex-direction: column; + align-items: center; + justify-content: center; + height: 100%; + + > p { + text-align: center; + margin: 10px 0 20px; + color: $text--muted-color; + } } } diff --git a/src/components/AssociatedCheckboxes.tsx b/src/components/AssociatedCheckboxes.tsx index 97d050ba3..cfb524efd 100644 --- a/src/components/AssociatedCheckboxes.tsx +++ b/src/components/AssociatedCheckboxes.tsx @@ -18,6 +18,7 @@ import TreeCheckboxes from './TreeCheckboxes'; import ChainedCheckboxes from './ChainedCheckboxes'; import Spinner from './Spinner'; import TreeRadios from './TreeRadios'; +import {Icon} from './icons'; export interface AssociatedCheckboxesProps extends CheckboxesProps { leftOptions: Options; @@ -87,6 +88,11 @@ export class AssociatedCheckboxes extends Checkboxes< } } + handleRetry(option: Option) { + const {onDeferLoad} = this.props; + onDeferLoad?.(option); + } + render() { const { classnames: cx, @@ -132,8 +138,28 @@ export class AssociatedCheckboxes extends Checkboxes<
加载中
+ ) : ( +点击刷新重新加载
+ )} +