From 6ba971f3f9a5c5b6d2e09c4bdec79656111b4597 Mon Sep 17 00:00:00 2001 From: BillDowney Date: Mon, 12 Jul 2021 23:21:31 +0800 Subject: [PATCH] =?UTF-8?q?=E5=B7=A6=E4=BE=A7=E6=A0=91=E5=9C=A8=E6=97=A0?= =?UTF-8?q?=E6=95=B0=E6=8D=AE=E6=97=B6=E6=8F=90=E7=A4=BA=E4=BF=A1=E6=81=AF?= =?UTF-8?q?=EF=BC=9Ahttps://gitee.com/ssssssss-team/magic-api/issues/I3ZST?= =?UTF-8?q?I=20=E5=B7=A6=E4=BE=A7=E6=A0=91=E5=8A=A0=E4=B8=AALoading?= =?UTF-8?q?=E6=8F=90=E7=A4=BA=EF=BC=9Ahttps://gitee.com/ssssssss-team/magi?= =?UTF-8?q?c-api/issues/I3ZSTE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- magic-editor/src/console/src/assets/index.css | 10 +++ .../src/components/common/magic-tree.vue | 86 +++++++++++++++++-- .../components/resources/magic-api-list.vue | 8 +- .../resources/magic-datasource-list.vue | 42 ++++++++- .../resources/magic-function-list.vue | 8 +- .../resources/magic-resource-choose.vue | 8 +- 6 files changed, 146 insertions(+), 16 deletions(-) diff --git a/magic-editor/src/console/src/assets/index.css b/magic-editor/src/console/src/assets/index.css index 90c320d8..fa56147d 100644 --- a/magic-editor/src/console/src/assets/index.css +++ b/magic-editor/src/console/src/assets/index.css @@ -295,4 +295,14 @@ .ma-table-request-row { display: flex; +} + +/** 旋转特效 **/ +@keyframes rotate { + from { + transform: rotate(0deg); + } + to { + transform: rotate(360deg); + } } \ No newline at end of file diff --git a/magic-editor/src/console/src/components/common/magic-tree.vue b/magic-editor/src/console/src/components/common/magic-tree.vue index 7556cd0b..15d984a8 100644 --- a/magic-editor/src/console/src/components/common/magic-tree.vue +++ b/magic-editor/src/console/src/components/common/magic-tree.vue @@ -2,13 +2,22 @@
- +
+ +
+
+
+ +
+ 加载中... +
+
无数据
@@ -20,11 +29,70 @@ export default { props: { data: Array, // 解决子组件不强制刷新 - forceUpdate: Boolean + forceUpdate: Boolean, + loading: { + type: Boolean, + default: false + }, + loadingTime: { + type: Number, + default: 500 + } }, components: { MagicTreeItem + }, + data() { + return { + showLoading: false + } + }, + watch: { + loading(newVal) { + if (newVal) { + this.showLoading = newVal + } else { + setTimeout(() => { + this.showLoading = newVal + }, this.loadingTime) + } + } + }, + mounted() { + this.showLoading = this.loading } } - + diff --git a/magic-editor/src/console/src/components/resources/magic-api-list.vue b/magic-editor/src/console/src/components/resources/magic-api-list.vue index 60203a62..4dcb3215 100644 --- a/magic-editor/src/console/src/components/resources/magic-api-list.vue +++ b/magic-editor/src/console/src/components/resources/magic-api-list.vue @@ -22,7 +22,7 @@ - +