From 73b963eaca4d586f739b78f59a141d31537157fc Mon Sep 17 00:00:00 2001 From: yumiguan <41277086+yumiguan@users.noreply.github.com> Date: Wed, 14 Dec 2022 10:27:03 +0800 Subject: [PATCH] fix encoder and decoder error; DataManager folder detail display overflow (#725) --- frontend/src/views/checker/CheckerDetail.vue | 6 +++--- frontend/src/views/datamanager/DataDetailFolder.vue | 13 ++++++++++--- .../src/views/datamanager/DataDetailHttpData.vue | 6 ++++++ .../src/views/datamanager/DataDetailPlainJSON.vue | 6 ++++++ lyrebird/checker/decoder.py | 5 +++-- lyrebird/checker/encoder.py | 5 +++-- lyrebird/version.py | 2 +- 7 files changed, 32 insertions(+), 11 deletions(-) diff --git a/frontend/src/views/checker/CheckerDetail.vue b/frontend/src/views/checker/CheckerDetail.vue index bd4608c88..1c12d03a9 100644 --- a/frontend/src/views/checker/CheckerDetail.vue +++ b/frontend/src/views/checker/CheckerDetail.vue @@ -44,10 +44,10 @@ export default { codeType: 'python' } }, - mounted () { - this.$bus.$on('keydown', this.onKeyDown) + activated () { + this.$bus.$on('keydown', this.onKeyDown) }, - beforeDestroy () { + deactivated () { this.$bus.$off('keydown', this.onKeyDown) }, computed: { diff --git a/frontend/src/views/datamanager/DataDetailFolder.vue b/frontend/src/views/datamanager/DataDetailFolder.vue index 5e84ae23c..cbd500c58 100644 --- a/frontend/src/views/datamanager/DataDetailFolder.vue +++ b/frontend/src/views/datamanager/DataDetailFolder.vue @@ -115,6 +115,12 @@ export default { beforeDestroy () { this.$bus.$off('keydown', this.onKeyDown) }, + activated () { + this.$bus.$on('keydown', this.onKeyDown) + }, + deactivated () { + this.$bus.$off('keydown', this.onKeyDown) + }, computed: { nodeInfo () { return this.$store.state.dataManager.focusNodeInfo @@ -217,15 +223,16 @@ export default { } .data-detail-content { margin: 10px 5px 10px 10px; - height: calc(100vh - 44px - 40px - 30px - 1px - 33px - 12px - 28px); + height: calc(100vh - 44px - 40px - 30px - 1px - 33px - 10px - 10px - 10px - 28px); /* total:100vh header: 44px title: 40px button-bar: 30px border: 1px tab: 33px - tree - margin-bottom: 12px + margin-bottom: 10px + detail + margin-bottom: 10px footer: 28px */ overflow-y: scroll; diff --git a/frontend/src/views/datamanager/DataDetailHttpData.vue b/frontend/src/views/datamanager/DataDetailHttpData.vue index 45b7b0ee8..63e4441db 100644 --- a/frontend/src/views/datamanager/DataDetailHttpData.vue +++ b/frontend/src/views/datamanager/DataDetailHttpData.vue @@ -69,6 +69,12 @@ export default { beforeDestroy () { this.$bus.$off('keydown', this.onKeyDown) }, + activated () { + this.$bus.$on('keydown', this.onKeyDown) + }, + deactivated () { + this.$bus.$off('keydown', this.onKeyDown) + }, computed: { currentTab: { get () { diff --git a/frontend/src/views/datamanager/DataDetailPlainJSON.vue b/frontend/src/views/datamanager/DataDetailPlainJSON.vue index ff1582967..90c42ab13 100644 --- a/frontend/src/views/datamanager/DataDetailPlainJSON.vue +++ b/frontend/src/views/datamanager/DataDetailPlainJSON.vue @@ -63,6 +63,12 @@ export default { beforeDestroy () { this.$bus.$off('keydown', this.onKeyDown) }, + activated () { + this.$bus.$on('keydown', this.onKeyDown) + }, + deactivated () { + this.$bus.$off('keydown', this.onKeyDown) + }, computed: { currentTab: { get () { diff --git a/lyrebird/checker/decoder.py b/lyrebird/checker/decoder.py index 6fbf61125..bfbb229d4 100644 --- a/lyrebird/checker/decoder.py +++ b/lyrebird/checker/decoder.py @@ -4,7 +4,7 @@ class CustomDecoder: - def __call__(self, rules=None, *args, **kw): + def __call__(self, rules=None, rank=0, *args, **kw): def func(origin_func): func_type = checker.TYPE_DECODER if not checker.scripts_tmp_storage.get(func_type): @@ -12,7 +12,8 @@ def func(origin_func): checker.scripts_tmp_storage[func_type].append({ 'name': origin_func.__name__, 'func': origin_func, - 'rules': rules + 'rules': rules, + 'rank': rank }) return origin_func return func diff --git a/lyrebird/checker/encoder.py b/lyrebird/checker/encoder.py index 0898d1cd7..67cd11b25 100644 --- a/lyrebird/checker/encoder.py +++ b/lyrebird/checker/encoder.py @@ -4,7 +4,7 @@ class CustomEncoder: - def __call__(self, rules=None, *args, **kw): + def __call__(self, rules=None, rank=0, *args, **kw): def func(origin_func): func_type = checker.TYPE_ENCODER if not checker.scripts_tmp_storage.get(func_type): @@ -12,7 +12,8 @@ def func(origin_func): checker.scripts_tmp_storage[func_type].append({ 'name': origin_func.__name__, 'func': origin_func, - 'rules': rules + 'rules': rules, + 'rank': rank }) return origin_func return func diff --git a/lyrebird/version.py b/lyrebird/version.py index 9605f9352..32ddb5d59 100644 --- a/lyrebird/version.py +++ b/lyrebird/version.py @@ -1,3 +1,3 @@ -IVERSION = (2, 11, 0) +IVERSION = (2, 11, 1) VERSION = ".".join(str(i) for i in IVERSION) LYREBIRD = "Lyrebird " + VERSION