From 291b15956b275d84c063d7e93e358d321bbc19b8 Mon Sep 17 00:00:00 2001 From: fit2bot <68588906+fit2bot@users.noreply.github.com> Date: Mon, 6 Feb 2023 16:41:42 +0800 Subject: [PATCH] =?UTF-8?q?perf:=20=E4=BF=AE=E6=94=B9=20tree=20menu=20(#25?= =?UTF-8?q?36)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * perf: 修改 ztree * perf: 修改 tree menu --------- Co-authored-by: ibuler --- src/components/AutoDataTable/index.vue | 5 +- src/components/AutoDataZTree/index.vue | 8 +- .../DataZTree/components/ZTree/index.vue | 113 +++++++++--------- src/components/FormFields/CodeEditor.vue | 36 +++--- src/components/TreeTable/index.vue | 22 ++-- src/i18n/langs/en.json | 1 + src/i18n/langs/ja.json | 1 + src/i18n/langs/zh.json | 1 + src/views/assets/Asset/AssetList/AllList.vue | 31 +---- .../components/NodeAssetsUpdateDialog.vue | 29 ++++- .../Asset/AssetList/components/TreeMenu.vue | 65 ++++++++-- src/views/assets/Domain/DomainList.vue | 6 +- 12 files changed, 180 insertions(+), 138 deletions(-) diff --git a/src/components/AutoDataTable/index.vue b/src/components/AutoDataTable/index.vue index 23580d8bc..ac24b2ce6 100644 --- a/src/components/AutoDataTable/index.vue +++ b/src/components/AutoDataTable/index.vue @@ -235,10 +235,11 @@ export default { setDefaultFormatterIfNeed(col) { if (!col.formatter) { col.formatter = (row, column, cellValue) => { - const value = cellValue || '-' + let value = cellValue let padding = '0' - if (value === '-') { + if (!value && value !== 0) { padding = '6px' + value = '-' } return {value} } diff --git a/src/components/AutoDataZTree/index.vue b/src/components/AutoDataZTree/index.vue index cbe8c672b..7fb5ccd4b 100644 --- a/src/components/AutoDataZTree/index.vue +++ b/src/components/AutoDataZTree/index.vue @@ -169,7 +169,9 @@ export default { treeNode.meta.data = res this.zTree.updateNode(treeNode) this.$message.success(this.$tc('common.updateSuccessMsg')) - }).finally(() => { this.refreshTree() }) + }).finally(() => { + this.refreshTree() + }) }, onBodyMouseDown: function(event) { const rMenuID = this.$refs.dataztree.$refs.ztree.iRMenuID @@ -305,11 +307,13 @@ export default { text-decoration: none; background-color: #f5f5f5; } - .rmenu:hover{ + + .rmenu:hover { background-color: #f5f7fa; } .data-z-tree >>> .fa { width: 10px; + margin-right: 3px; } diff --git a/src/components/DataZTree/components/ZTree/index.vue b/src/components/DataZTree/components/ZTree/index.vue index 7e7886cbc..d261d2438 100644 --- a/src/components/DataZTree/components/ZTree/index.vue +++ b/src/components/DataZTree/components/ZTree/index.vue @@ -19,9 +19,9 @@ @@ -29,10 +29,10 @@ -