diff --git a/frontend/src/components/canvas/custom-component/UserView.vue b/frontend/src/components/canvas/custom-component/UserView.vue
index c31f829010..ce19cc8b54 100644
--- a/frontend/src/components/canvas/custom-component/UserView.vue
+++ b/frontend/src/components/canvas/custom-component/UserView.vue
@@ -18,7 +18,7 @@
-
+
diff --git a/frontend/src/lang/en.js b/frontend/src/lang/en.js
index a9a042fd0a..879e37af21 100644
--- a/frontend/src/lang/en.js
+++ b/frontend/src/lang/en.js
@@ -860,7 +860,9 @@ export default {
drag_block_value_axis_main: 'Main Axis Value',
drag_block_value_axis_ext: 'Ext Axis Value',
yAxis_main: 'Main Vertical Axis',
- yAxis_ext: 'Ext Vertical Axis'
+ yAxis_ext: 'Ext Vertical Axis',
+ total: 'Total',
+ items: 'Items'
},
dataset: {
sheet_warn: 'There are multiple sheet pages, and the first one is extracted by default',
diff --git a/frontend/src/lang/tw.js b/frontend/src/lang/tw.js
index 6f055e79d8..26912bcc32 100644
--- a/frontend/src/lang/tw.js
+++ b/frontend/src/lang/tw.js
@@ -859,7 +859,9 @@ export default {
drag_block_value_axis_main: '主軸值',
drag_block_value_axis_ext: '副軸值',
yAxis_main: '主縱軸',
- yAxis_ext: '副縱軸'
+ yAxis_ext: '副縱軸',
+ total: '共',
+ items: '條數據'
},
dataset: {
sheet_warn: '有多個sheet頁面,默認抽取第一個',
diff --git a/frontend/src/lang/zh.js b/frontend/src/lang/zh.js
index baaf267438..8e18d12236 100644
--- a/frontend/src/lang/zh.js
+++ b/frontend/src/lang/zh.js
@@ -859,7 +859,9 @@ export default {
drag_block_value_axis_main: '主轴值',
drag_block_value_axis_ext: '副轴值',
yAxis_main: '主纵轴',
- yAxis_ext: '副纵轴'
+ yAxis_ext: '副纵轴',
+ total: '共',
+ items: '条数据'
},
dataset: {
sheet_warn: '有多个 Sheet 页,默认抽取第一个',
diff --git a/frontend/src/views/chart/components/table/TableNormal.vue b/frontend/src/views/chart/components/table/TableNormal.vue
index 3dccf80703..06e6f690fa 100644
--- a/frontend/src/views/chart/components/table/TableNormal.vue
+++ b/frontend/src/views/chart/components/table/TableNormal.vue
@@ -1,44 +1,55 @@
-
{{ chart.title }}
-
-
+ {{ chart.title }}
+
-
-
-
-
-
+
+
+
+
+
+
-
-
-
-
-
-
-
-
-
-
+
+
+ {{ $t('chart.total') }}
+ {{ chart.data.tableRow.length }}
+ {{ $t('chart.items') }}
+
+
+
+
@@ -102,12 +113,12 @@ export default {
height: '36px'
},
title_show: true,
- borderRadius: '0px'
- // currentPage: {
- // page: 1,
- // pageSize: 10,
- // show: 0
- // }
+ borderRadius: '0px',
+ currentPage: {
+ page: 1,
+ pageSize: 10,
+ show: 0
+ }
}
},
computed: {
@@ -153,13 +164,17 @@ export default {
if (this.chart.data) {
this.fields = JSON.parse(JSON.stringify(this.chart.data.fields))
datas = JSON.parse(JSON.stringify(this.chart.data.tableRow))
- // if (this.chart.data.page) {
- // this.currentPage = JSON.parse(JSON.stringify(this.chart.data.page))
- // }
+ if (this.chart.type === 'table-info') {
+ // 计算分页
+ 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)
+ }
} else {
this.fields = []
datas = []
- // this.resetPage()
+ this.resetPage()
}
this.$refs.plxTable.reloadData(datas)
this.$nextTick(() => {
@@ -172,11 +187,19 @@ export default {
calcHeightRightNow() {
this.$nextTick(() => {
if (this.$refs.tableContainer) {
+ let pageHeight = 0
+ if (this.chart.type === 'table-info') {
+ pageHeight = 36
+ }
const currentHeight = this.$refs.tableContainer.offsetHeight
- const tableMaxHeight = currentHeight - this.$refs.title.offsetHeight - 16
+ const tableMaxHeight = currentHeight - this.$refs.title.offsetHeight - 16 - pageHeight
let tableHeight
if (this.chart.data) {
- tableHeight = (this.chart.data.tableRow.length + 2) * 36
+ if (this.chart.type === 'table-info') {
+ tableHeight = (this.currentPage.pageSize + 2) * 36 - pageHeight
+ } else {
+ tableHeight = (this.chart.data.tableRow.length + 2) * 36 - pageHeight
+ }
} else {
tableHeight = 0
}
@@ -301,17 +324,23 @@ export default {
this.height = 100
},
- pageChange() {
+ pageChange(val) {
+ this.currentPage.pageSize = val
+ this.init()
+ },
+ pageClick(val) {
+ this.currentPage.page = val
+ this.init()
+ },
+
+ resetPage() {
+ this.currentPage = {
+ page: 1,
+ pageSize: 10,
+ show: 0
+ }
}
-
- // resetPage() {
- // this.currentPage = {
- // page: 1,
- // pageSize: 10,
- // show: 0
- // }
- // }
}
}
@@ -324,4 +353,25 @@ export default {
max-height: none!important;
line-height: normal!important;
}
+ .table-page{
+ position: absolute;
+ bottom: 0;
+ display: flex;
+ align-items: center;
+ justify-content: flex-end;
+ width: 100%;
+ overflow: hidden;
+ }
+ .page-style{
+ margin-right: auto;
+ }
+ .total-style{
+ flex: 1;
+ font-size: 12px;
+ color: #606266;
+ white-space:nowrap;
+ }
+ .page-style >>> .el-input__inner{
+ height: 24px;
+ }
diff --git a/frontend/src/views/chart/view/ChartEdit.vue b/frontend/src/views/chart/view/ChartEdit.vue
index eb4cf6d252..dc050febd8 100644
--- a/frontend/src/views/chart/view/ChartEdit.vue
+++ b/frontend/src/views/chart/view/ChartEdit.vue
@@ -77,7 +77,7 @@
@add="moveToQuota"
>
-
+