提交 a23a7e0a authored 作者: junjie's avatar junjie

feat(视图): 增加明细表

上级 9c883509
...@@ -18,7 +18,7 @@ ...@@ -18,7 +18,7 @@
</div> </div>
<chart-component v-if="httpRequest.status &&chart.type && !chart.type.includes('table') && !chart.type.includes('text')" :ref="element.propValue.id" class="chart-class" :chart="chart" :track-menu="trackMenu" @onChartClick="chartClick" /> <chart-component v-if="httpRequest.status &&chart.type && !chart.type.includes('table') && !chart.type.includes('text')" :ref="element.propValue.id" class="chart-class" :chart="chart" :track-menu="trackMenu" @onChartClick="chartClick" />
<!-- <chart-component :ref="element.propValue.id" class="chart-class" :chart="chart" :track-menu="trackMenu" @onChartClick="chartClick" />--> <!-- <chart-component :ref="element.propValue.id" class="chart-class" :chart="chart" :track-menu="trackMenu" @onChartClick="chartClick" />-->
<table-normal v-if="httpRequest.status &&chart.type && chart.type.includes('table')" :ref="element.propValue.id" :chart="chart" class="table-class" /> <table-normal v-if="httpRequest.status &&chart.type && chart.type.includes('table')" :ref="element.propValue.id" :show-summary="chart.type === 'table-normal'" :chart="chart" class="table-class" />
<label-normal v-if="httpRequest.status && chart.type && chart.type.includes('text')" :ref="element.propValue.id" :chart="chart" class="table-class" /> <label-normal v-if="httpRequest.status && chart.type && chart.type.includes('text')" :ref="element.propValue.id" :chart="chart" class="table-class" />
<div style="position: absolute;left: 20px;bottom:14px;"> <div style="position: absolute;left: 20px;bottom:14px;">
<drill-path :drill-filters="drillFilters" @onDrillJump="drillJump" /> <drill-path :drill-filters="drillFilters" @onDrillJump="drillJump" />
......
...@@ -860,7 +860,9 @@ export default { ...@@ -860,7 +860,9 @@ export default {
drag_block_value_axis_main: 'Main Axis Value', drag_block_value_axis_main: 'Main Axis Value',
drag_block_value_axis_ext: 'Ext Axis Value', drag_block_value_axis_ext: 'Ext Axis Value',
yAxis_main: 'Main Vertical Axis', yAxis_main: 'Main Vertical Axis',
yAxis_ext: 'Ext Vertical Axis' yAxis_ext: 'Ext Vertical Axis',
total: 'Total',
items: 'Items'
}, },
dataset: { dataset: {
sheet_warn: 'There are multiple sheet pages, and the first one is extracted by default', sheet_warn: 'There are multiple sheet pages, and the first one is extracted by default',
......
...@@ -859,7 +859,9 @@ export default { ...@@ -859,7 +859,9 @@ export default {
drag_block_value_axis_main: '主軸值', drag_block_value_axis_main: '主軸值',
drag_block_value_axis_ext: '副軸值', drag_block_value_axis_ext: '副軸值',
yAxis_main: '主縱軸', yAxis_main: '主縱軸',
yAxis_ext: '副縱軸' yAxis_ext: '副縱軸',
total: '共',
items: '條數據'
}, },
dataset: { dataset: {
sheet_warn: '有多個sheet頁面,默認抽取第一個', sheet_warn: '有多個sheet頁面,默認抽取第一個',
......
...@@ -859,7 +859,9 @@ export default { ...@@ -859,7 +859,9 @@ export default {
drag_block_value_axis_main: '主轴值', drag_block_value_axis_main: '主轴值',
drag_block_value_axis_ext: '副轴值', drag_block_value_axis_ext: '副轴值',
yAxis_main: '主纵轴', yAxis_main: '主纵轴',
yAxis_ext: '副纵轴' yAxis_ext: '副纵轴',
total: '共',
items: '条数据'
}, },
dataset: { dataset: {
sheet_warn: '有多个 Sheet 页,默认抽取第一个', sheet_warn: '有多个 Sheet 页,默认抽取第一个',
......
<template> <template>
<div ref="tableContainer" :style="bg_class" style="padding: 8px;width: 100%;height: 100%;overflow: hidden;"> <div ref="tableContainer" :style="bg_class" style="padding: 8px;width: 100%;height: 100%;overflow: hidden;">
<el-row style="height: 100%;">
<p v-show="title_show" ref="title" :style="title_class">{{ chart.title }}</p> <p v-show="title_show" ref="title" :style="title_class">{{ chart.title }}</p>
<ux-grid <ux-grid
ref="plxTable" ref="plxTable"
...@@ -29,16 +30,26 @@ ...@@ -29,16 +30,26 @@
</ux-table-column> </ux-table-column>
</ux-grid> </ux-grid>
<!-- <el-pagination--> <el-row v-show="chart.type === 'table-info'" class="table-page">
<!-- v-show="chart.type === 'table-info'"--> <span class="total-style">
<!-- :current-page="currentPage.page"--> {{ $t('chart.total') }}
<!-- :page-sizes="[100]"--> <span>{{ chart.data.tableRow.length }}</span>
<!-- :page-size="currentPage.pageSize"--> {{ $t('chart.items') }}
<!-- :pager-count="5"--> </span>
<!-- layout="sizes, prev, pager, next"--> <el-pagination
<!-- :total="currentPage.show"--> small
<!-- @current-change="pageChange"--> :current-page="currentPage.page"
<!-- />--> :page-sizes="[10,20,50,100]"
:page-size="currentPage.pageSize"
:pager-count="5"
layout="sizes, prev, pager, next"
:total="currentPage.show"
class="page-style"
@current-change="pageClick"
@size-change="pageChange"
/>
</el-row>
</el-row>
</div> </div>
</template> </template>
...@@ -102,12 +113,12 @@ export default { ...@@ -102,12 +113,12 @@ export default {
height: '36px' height: '36px'
}, },
title_show: true, title_show: true,
borderRadius: '0px' borderRadius: '0px',
// currentPage: { currentPage: {
// page: 1, page: 1,
// pageSize: 10, pageSize: 10,
// show: 0 show: 0
// } }
} }
}, },
computed: { computed: {
...@@ -153,13 +164,17 @@ export default { ...@@ -153,13 +164,17 @@ export default {
if (this.chart.data) { if (this.chart.data) {
this.fields = JSON.parse(JSON.stringify(this.chart.data.fields)) this.fields = JSON.parse(JSON.stringify(this.chart.data.fields))
datas = JSON.parse(JSON.stringify(this.chart.data.tableRow)) datas = JSON.parse(JSON.stringify(this.chart.data.tableRow))
// if (this.chart.data.page) { if (this.chart.type === 'table-info') {
// this.currentPage = JSON.parse(JSON.stringify(this.chart.data.page)) // 计算分页
// } 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 { } else {
this.fields = [] this.fields = []
datas = [] datas = []
// this.resetPage() this.resetPage()
} }
this.$refs.plxTable.reloadData(datas) this.$refs.plxTable.reloadData(datas)
this.$nextTick(() => { this.$nextTick(() => {
...@@ -172,11 +187,19 @@ export default { ...@@ -172,11 +187,19 @@ export default {
calcHeightRightNow() { calcHeightRightNow() {
this.$nextTick(() => { this.$nextTick(() => {
if (this.$refs.tableContainer) { if (this.$refs.tableContainer) {
let pageHeight = 0
if (this.chart.type === 'table-info') {
pageHeight = 36
}
const currentHeight = this.$refs.tableContainer.offsetHeight 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 let tableHeight
if (this.chart.data) { 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 { } else {
tableHeight = 0 tableHeight = 0
} }
...@@ -301,17 +324,23 @@ export default { ...@@ -301,17 +324,23 @@ export default {
this.height = 100 this.height = 100
}, },
pageChange() { pageChange(val) {
this.currentPage.pageSize = val
this.init()
},
} pageClick(val) {
this.currentPage.page = val
this.init()
},
// resetPage() { resetPage() {
// this.currentPage = { this.currentPage = {
// page: 1, page: 1,
// pageSize: 10, pageSize: 10,
// show: 0 show: 0
// } }
// } }
} }
} }
</script> </script>
...@@ -324,4 +353,25 @@ export default { ...@@ -324,4 +353,25 @@ export default {
max-height: none!important; max-height: none!important;
line-height: normal!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;
}
</style> </style>
...@@ -77,7 +77,7 @@ ...@@ -77,7 +77,7 @@
@add="moveToQuota" @add="moveToQuota"
> >
<transition-group> <transition-group>
<span v-for="item in quotaData" :key="item.id" class="item-quota" :title="item.name"> <span v-for="item in quotaData" v-show="chart.type && (chart.type !== 'table-info' || (chart.type === 'table-info' && item.id !=='count'))" :key="item.id" class="item-quota" :title="item.name">
<svg-icon v-if="item.deType === 0" icon-class="field_text" class="field-icon-text" /> <svg-icon v-if="item.deType === 0" icon-class="field_text" class="field-icon-text" />
<svg-icon v-if="item.deType === 1" icon-class="field_time" class="field-icon-time" /> <svg-icon v-if="item.deType === 1" icon-class="field_time" class="field-icon-time" />
<svg-icon v-if="item.deType === 2 || item.deType === 3" icon-class="field_value" class="field-icon-value" /> <svg-icon v-if="item.deType === 2 || item.deType === 3" icon-class="field_value" class="field-icon-value" />
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论