From 900e570a22cf49b6993e846a3c789d31b5f3f0b6 Mon Sep 17 00:00:00 2001 From: liaoxuezhi Date: Mon, 10 Jun 2019 14:50:23 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=20Page=20loading=20=E4=B8=8D?= =?UTF-8?q?=E6=98=BE=E7=A4=BA=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- scss/layout/_layout.scss | 1 + src/renderers/Page.tsx | 66 +++++++++++++++++---------------------- src/renderers/Service.tsx | 26 +++++++-------- src/store/service.ts | 4 +-- 4 files changed, 43 insertions(+), 54 deletions(-) diff --git a/scss/layout/_layout.scss b/scss/layout/_layout.scss index 788cb64a..3b1d2c6b 100644 --- a/scss/layout/_layout.scss +++ b/scss/layout/_layout.scss @@ -256,6 +256,7 @@ body { &:before { position: fixed; + z-index: 15; } } diff --git a/src/renderers/Page.tsx b/src/renderers/Page.tsx index 87f41ebf..cfd9d7c8 100644 --- a/src/renderers/Page.tsx +++ b/src/renderers/Page.tsx @@ -43,7 +43,7 @@ export interface PageProps extends RendererProps { } export default class Page extends React.Component { - timer: NodeJS.Timer; + timer: number; mounted: boolean; static defaultProps = { @@ -406,13 +406,11 @@ export default class Page extends React.Component {
{this.renderHeader()}
- {store.loading - ? render('spinner', { - type: 'spinner', - overlay: true, - size: 'lg', - }) - : null} + {store.loading ? render('spinner', { + type: 'spinner', + overlay: true, + size: 'lg', + }) : null} {store.error ? ( @@ -425,37 +423,29 @@ export default class Page extends React.Component {
- {render( - 'dialog', - { - ...((store.action as Action) && ((store.action as Action).dialog as object)), - type: 'dialog', - }, - { - key: 'dialog', - data: store.dialogData, - onConfirm: this.handleDialogConfirm, - onClose: this.handleDialogClose, - show: store.dialogOpen, - onAction: this.handleAction, - } - )} + {render('dialog', { + ...((store.action as Action) && ((store.action as Action).dialog as object)), + type: 'dialog', + }, { + key: 'dialog', + data: store.dialogData, + onConfirm: this.handleDialogConfirm, + onClose: this.handleDialogClose, + show: store.dialogOpen, + onAction: this.handleAction, + })} - {render( - 'drawer', - { - ...((store.action as Action) && ((store.action as Action).drawer as object)), - type: 'drawer', - }, - { - key: 'drawer', - data: store.drawerData, - onConfirm: this.handleDrawerConfirm, - onClose: this.handleDrawerClose, - show: store.drawerOpen, - onAction: this.handleAction, - } - )} + {render('drawer', { + ...((store.action as Action) && ((store.action as Action).drawer as object)), + type: 'drawer', + }, { + key: 'drawer', + data: store.drawerData, + onConfirm: this.handleDrawerConfirm, + onClose: this.handleDrawerClose, + show: store.drawerOpen, + onAction: this.handleAction, + })} ); } diff --git a/src/renderers/Service.tsx b/src/renderers/Service.tsx index 941764b4..c0d3f785 100644 --- a/src/renderers/Service.tsx +++ b/src/renderers/Service.tsx @@ -25,7 +25,7 @@ export interface ServiceProps extends RendererProps { }; } export default class Service extends React.Component { - timer: NodeJS.Timeout; + timer: number; mounted: boolean; static defaultProps: Partial = { @@ -206,19 +206,17 @@ export default class Service extends React.Component { {this.renderBody()} - {store.loading - ? render( - 'info', - { - type: 'spinner', - overlay: true, - }, - { - key: 'info', - size: 'lg', - } - ) - : null} + {store.loading ? render( + 'info', + { + type: 'spinner', + overlay: true, + }, + { + key: 'info', + size: 'lg', + } + ) : null} ); } diff --git a/src/store/service.ts b/src/store/service.ts index 510ce058..ea6723a0 100644 --- a/src/store/service.ts +++ b/src/store/service.ts @@ -124,11 +124,11 @@ export const ServiceStore = iRendererStore return; } - markFetching(false); if (root.isCancel(e)) { return; } + markFetching(false); e.stack && console.error(e.stack); root.notify('error', e.message || e); } @@ -185,11 +185,11 @@ export const ServiceStore = iRendererStore return; } - markFetching(false); if (root.isCancel(e)) { return; } + markFetching(false); e.stack && console.error(e.stack); root.notify('error', e.message || e); }