From e2764fb9366fcbc873838100f47e65b2f9c6fcab Mon Sep 17 00:00:00 2001 From: junjun Date: Wed, 20 Apr 2022 13:53:43 +0800 Subject: [PATCH] =?UTF-8?q?feat:=20=E6=98=8E=E7=BB=86=E8=A1=A8=E6=94=AF?= =?UTF-8?q?=E6=8C=81=E4=B8=8B=E6=8B=89=E7=BF=BB=E9=A1=B5=E4=B8=A4=E7=A7=8D?= =?UTF-8?q?=E6=A8=A1=E5=BC=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- frontend/src/views/chart/chart/chart.js | 3 ++- .../chart/components/ChartComponentS2.vue | 23 +++++++++++++++---- .../components/shape-attr/SizeSelector.vue | 9 +++++++- .../shape-attr/SizeSelectorAntV.vue | 9 +++++++- .../chart/components/table/TableNormal.vue | 17 ++++++++++---- 5 files changed, 50 insertions(+), 11 deletions(-) diff --git a/frontend/src/views/chart/chart/chart.js b/frontend/src/views/chart/chart/chart.js index eea7682d64..8786a854ae 100644 --- a/frontend/src/views/chart/chart/chart.js +++ b/frontend/src/views/chart/chart/chart.js @@ -55,7 +55,8 @@ export const DEFAULT_SIZE = { liquidOutlineDistance: 8, liquidWaveLength: 128, liquidWaveCount: 3, - liquidShape: 'circle' + liquidShape: 'circle', + tablePageMode: 'page' } export const DEFAULT_LABEL = { show: false, diff --git a/frontend/src/views/chart/components/ChartComponentS2.vue b/frontend/src/views/chart/components/ChartComponentS2.vue index 2ff39b4179..0fa0b4a97c 100644 --- a/frontend/src/views/chart/components/ChartComponentS2.vue +++ b/frontend/src/views/chart/components/ChartComponentS2.vue @@ -6,9 +6,9 @@
-
+
- + {{ $t('chart.total') }} {{ (chart.data && chart.data.tableRow)?chart.data.tableRow.length:0 }} @@ -99,7 +99,8 @@ export default { pageSize: 20, show: 0 }, - tableData: [] + tableData: [], + showPage: false } }, @@ -135,17 +136,19 @@ export default { methods: { initData() { let datas = [] + this.showPage = false if (this.chart.data && this.chart.data.fields) { this.fields = JSON.parse(JSON.stringify(this.chart.data.fields)) const attr = JSON.parse(this.chart.customAttr) this.currentPage.pageSize = parseInt(attr.size.tablePageSize ? attr.size.tablePageSize : 20) datas = JSON.parse(JSON.stringify(this.chart.data.tableRow)) - if (this.chart.type === 'table-info') { + if (this.chart.type === 'table-info' && attr.size.tablePageMode === 'page' && datas.length > this.currentPage.pageSize) { // 计算分页 this.currentPage.show = datas.length const pageStart = (this.currentPage.page - 1) * this.currentPage.pageSize const pageEnd = pageStart + this.currentPage.pageSize datas = datas.slice(pageStart, pageEnd) + this.showPage = true } } else { this.fields = [] @@ -380,12 +383,18 @@ export default { .table-dom-info{ height:calc(100% - 36px); } +.table-dom-info-pull{ + height:calc(100%); +} .table-dom-normal{ height:100%; } .table-dom-info-drill{ height:calc(100% - 36px - 12px); } +.table-dom-info-drill-pull{ + height:calc(100% - 12px); +} .table-dom-normal-drill{ height:calc(100% - 12px); } @@ -409,4 +418,10 @@ export default { .page-style >>> .el-input__inner{ height: 24px; } +.page-style >>> button{ + background: transparent!important; +} +.page-style >>> li{ + background: transparent!important; +} diff --git a/frontend/src/views/chart/components/shape-attr/SizeSelector.vue b/frontend/src/views/chart/components/shape-attr/SizeSelector.vue index 4634eee7bb..d2bded2179 100644 --- a/frontend/src/views/chart/components/shape-attr/SizeSelector.vue +++ b/frontend/src/views/chart/components/shape-attr/SizeSelector.vue @@ -84,7 +84,13 @@ - + + + + + + + - + + + + + + + - + {{ $t('chart.total') }} {{ (chart.data && chart.data.tableRow)?chart.data.tableRow.length:0 }} @@ -118,7 +118,8 @@ export default { page: 1, pageSize: 20, show: 0 - } + }, + showPage: false } }, computed: { @@ -162,17 +163,19 @@ export default { initData() { const that = this let datas = [] + this.showPage = false if (this.chart.data) { this.fields = JSON.parse(JSON.stringify(this.chart.data.fields)) const attr = JSON.parse(this.chart.customAttr) this.currentPage.pageSize = parseInt(attr.size.tablePageSize ? attr.size.tablePageSize : 20) datas = JSON.parse(JSON.stringify(this.chart.data.tableRow)) - if (this.chart.type === 'table-info') { + if (this.chart.type === 'table-info' && attr.size.tablePageMode === 'page' && datas.length > this.currentPage.pageSize) { // 计算分页 this.currentPage.show = datas.length const pageStart = (this.currentPage.page - 1) * this.currentPage.pageSize const pageEnd = pageStart + this.currentPage.pageSize datas = datas.slice(pageStart, pageEnd) + this.showPage = true } } else { this.fields = [] @@ -191,7 +194,7 @@ export default { this.$nextTick(() => { if (this.$refs.tableContainer) { let pageHeight = 0 - if (this.chart.type === 'table-info') { + if (this.showPage) { pageHeight = 36 } const currentHeight = this.$refs.tableContainer.offsetHeight @@ -378,4 +381,10 @@ export default { .page-style >>> .el-input__inner{ height: 24px; } + .page-style >>> button{ + background: transparent!important; + } + .page-style >>> li{ + background: transparent!important; + }