From e6d662afcfb640c49f974d751e92634673ae1279 Mon Sep 17 00:00:00 2001 From: junjie Date: Tue, 6 Apr 2021 11:43:29 +0800 Subject: [PATCH 1/3] =?UTF-8?q?feat(frontend):=E5=89=8D=E7=AB=AF=E8=B0=83?= =?UTF-8?q?=E6=95=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../components/shape-attr/TooltipSelector.vue | 25 ++++++++- .../src/views/chart/view/TableSelector.vue | 2 +- .../dataset/common/DatasetGroupSelector.vue | 53 +++++++++++++------ 3 files changed, 63 insertions(+), 17 deletions(-) diff --git a/frontend/src/views/chart/components/shape-attr/TooltipSelector.vue b/frontend/src/views/chart/components/shape-attr/TooltipSelector.vue index e079902e23..01512f4581 100644 --- a/frontend/src/views/chart/components/shape-attr/TooltipSelector.vue +++ b/frontend/src/views/chart/components/shape-attr/TooltipSelector.vue @@ -25,7 +25,30 @@ - + + + + {{ $t('chart.content_formatter') }} + +
+ 模板变量有 {a}, {b},{c},{d},{e},分别表示系列名,数据名,数据值等。 +
+ 在 trigger 为 'axis' 的时候,会有多个系列的数据,此时可以通过 {a0}, {a1}, {a2} 这种后面加索引的方式表示系列的索引。 +
+ 不同图表类型下的 {a},{b},{c},{d} 含义不一样。 其中变量{a}, {b}, {c}, {d}在不同图表类型下代表数据含义为: +

+ 折线(区域)图、柱状(条形)图、K线图 : {a}(系列名称),{b}(类目值),{c}(数值), {d}(无) +
+ 散点图(气泡)图 : {a}(系列名称),{b}(数据名称),{c}(数值数组), {d}(无) +
+ 地图 : {a}(系列名称),{b}(区域名称),{c}(合并数值), {d}(无) +
+ 饼图、仪表盘、漏斗图: {a}(系列名称),{b}(数据项名称),{c}(数值), {d}(百分比) +
+ +
+
+
diff --git a/frontend/src/views/chart/view/TableSelector.vue b/frontend/src/views/chart/view/TableSelector.vue index bfe473a391..07ae57dbbd 100644 --- a/frontend/src/views/chart/view/TableSelector.vue +++ b/frontend/src/views/chart/view/TableSelector.vue @@ -47,7 +47,7 @@ export default { .ms-aside-container { height: 50vh; min-width: 180px; - max-width: 300px; + max-width: 280px; } .ms-main-container { diff --git a/frontend/src/views/dataset/common/DatasetGroupSelector.vue b/frontend/src/views/dataset/common/DatasetGroupSelector.vue index c3cd0c610a..e928a58aac 100644 --- a/frontend/src/views/dataset/common/DatasetGroupSelector.vue +++ b/frontend/src/views/dataset/common/DatasetGroupSelector.vue @@ -9,19 +9,19 @@ - - - - - - - + + + + + + + + + + + + +
@@ -77,9 +77,10 @@ :data="tableData" node-key="id" :expand-on-click-node="true" + class="tree-list" @node-click="sceneClick" > - + ({{ data.type }}) @@ -107,6 +108,7 @@ export default { search: '', data: [], tableData: [], + tables: [], currGroup: null, expandedArray: [], groupForm: { @@ -129,6 +131,13 @@ export default { // this.groupForm.name = val; // this.tree(this.groupForm); // } + search(val) { + if (val && val !== '') { + this.tableData = JSON.parse(JSON.stringify(this.tables.filter(ele => { return ele.name.includes(val) }))) + } else { + this.tableData = JSON.parse(JSON.stringify(this.tables)) + } + } }, mounted() { this.tree(this.groupForm) @@ -171,7 +180,8 @@ export default { sort: 'type asc,create_time desc,name asc', sceneId: this.currGroup.id }).then(response => { - this.tableData = response.data + this.tables = response.data + this.tableData = JSON.parse(JSON.stringify(this.tables)) }) } }, @@ -216,6 +226,10 @@ export default { padding: 12px 0; } + .tree-list>>>.el-tree-node__expand-icon.is-leaf{ + display: none; + } + .custom-tree-node { flex: 1; display: flex; @@ -225,6 +239,15 @@ export default { padding-right: 8px; } + .custom-tree-node-list { + flex: 1; + display: flex; + align-items: center; + justify-content: space-between; + font-size: 14px; + padding:0 8px; + } + .custom-position { flex: 1; display: flex; From 93ce2bbe69e094b53d18c349c828bc4a43855b11 Mon Sep 17 00:00:00 2001 From: junjie Date: Tue, 6 Apr 2021 11:47:26 +0800 Subject: [PATCH 2/3] =?UTF-8?q?feat(frontend):=E5=89=8D=E7=AB=AF=E8=B0=83?= =?UTF-8?q?=E6=95=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- frontend/src/views/dataset/data/TabDataPreview.vue | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/frontend/src/views/dataset/data/TabDataPreview.vue b/frontend/src/views/dataset/data/TabDataPreview.vue index 8f8e8dfd3a..1debb36bf5 100644 --- a/frontend/src/views/dataset/data/TabDataPreview.vue +++ b/frontend/src/views/dataset/data/TabDataPreview.vue @@ -1,7 +1,7 @@