From 3a9a45563b23f0034e938301bfa801f08433d912 Mon Sep 17 00:00:00 2001 From: imp Date: Fri, 22 Oct 2021 11:46:32 +0800 Subject: [PATCH] =?UTF-8?q?=E6=97=A0jira=E4=BB=BB=E5=8A=A1=20=E5=88=A0?= =?UTF-8?q?=E9=99=A4loadingpane?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- demo/js/config/demo.pane.js | 13 ++++++++--- karma.conf.js | 1 - src/case/loading/loading_pane.js | 31 ------------------------- typescript/case/loading/loading_pane.ts | 5 ---- typescript/index.ts | 3 --- 5 files changed, 10 insertions(+), 43 deletions(-) delete mode 100644 src/case/loading/loading_pane.js delete mode 100644 typescript/case/loading/loading_pane.ts diff --git a/demo/js/config/demo.pane.js b/demo/js/config/demo.pane.js index 30b2415a7..e6cb35c62 100644 --- a/demo/js/config/demo.pane.js +++ b/demo/js/config/demo.pane.js @@ -4,11 +4,15 @@ * description: */ !(function () { - var Pane = BI.inherit(BI.LoadingPane, { + var Pane = BI.inherit(BI.Pane, { props: { }, + mounted: function () { + console.log('loading pane mounted'); + }, + render: function () { return { type: "bi.center_adapt", @@ -19,11 +23,14 @@ }; }, - beforeInit: function (callback) { + beforeRender: function (callback) { + var self = this; + this.loading(); setTimeout(function () { + self.loaded(); callback(); }, 3000); } }); BI.shortcut("demo.pane", Pane); -})(); \ No newline at end of file +})(); diff --git a/karma.conf.js b/karma.conf.js index 8b5bca997..1152ccb6a 100644 --- a/karma.conf.js +++ b/karma.conf.js @@ -35,7 +35,6 @@ module.exports = function (config) { exclude: [ "src/base/single/input/file.js", - "src/case/loading/loading_pane.js", "src/case/ztree/**/*.js", "src/widget/multitree/**/*.js", "src/widget/multiselecttree/**/*.js", diff --git a/src/case/loading/loading_pane.js b/src/case/loading/loading_pane.js deleted file mode 100644 index 2218685c5..000000000 --- a/src/case/loading/loading_pane.js +++ /dev/null @@ -1,31 +0,0 @@ -/** - * author: young - * createdDate: 2018/12/18 - * description: - */ -BI.LoadingPane = BI.inherit(BI.Pane, { - _mount: function () { - var isMounted = BI.Pane.superclass._mount.apply(this, arguments); - if (isMounted) { - if (this.beforeInit) { - this.__asking = true; - this.loading(); - this.beforeInit(BI.bind(this.__loaded, this)); - } - } - }, - - _initRender: function () { - if (this.beforeInit) { - this.__async = true; - } else { - this._render(); - } - }, - - __loaded: function () { - this.__asking = false; - this.loaded(); - this._render(); - } -}); \ No newline at end of file diff --git a/typescript/case/loading/loading_pane.ts b/typescript/case/loading/loading_pane.ts deleted file mode 100644 index 362c8f1b4..000000000 --- a/typescript/case/loading/loading_pane.ts +++ /dev/null @@ -1,5 +0,0 @@ -import { Pane } from "../../base/pane"; - -export declare class LoadingPane extends Pane { - __loaded: (...args: any[]) => void; -} diff --git a/typescript/index.ts b/typescript/index.ts index fdbae2aa0..6e6131a7d 100644 --- a/typescript/index.ts +++ b/typescript/index.ts @@ -24,7 +24,6 @@ import { SmallTextValueCombo } from './case/combo/combo.textvaluesmall'; import { SearchTextValueCombo } from "./case/combo/searchtextvaluecombo/combo.searchtextvalue"; import { SignEditor } from "./case/editor/editor.sign"; import { StateEditor } from './case/editor/editor.state'; -import { LoadingPane } from "./case/loading/loading_pane"; import { AllValueMultiTextValueCombo } from "./component/allvaluemultitextvaluecombo/allvalue.multitextvalue.combo"; import { AbstractTreeValueChooser } from "./component/treevaluechooser/abstract.treevaluechooser"; import { AbstractListTreeValueChooser } from "./component/treevaluechooser/abstract.treevaluechooser.list"; @@ -205,7 +204,6 @@ export interface BI extends _func, _i18n, _base, _inject, _var, _web, _utils { HighlightBehavior: typeof HighlightBehavior; RedMarkBehavior: typeof RedMarkBehavior; Pane: typeof Pane; - LoadingPane: typeof LoadingPane; Tab: typeof Tab; ButtonGroup: typeof ButtonGroup; Combo: typeof Combo; @@ -411,7 +409,6 @@ export { BehaviorFactory, RedMarkBehavior, HighlightBehavior, - LoadingPane, Searcher, AbstractLabel, Label,