提交 7a503706 authored 作者: junjie's avatar junjie

feat(数据集):自助数据集 优化

上级 7edaa48a
...@@ -354,7 +354,7 @@ public class DataSetTableService { ...@@ -354,7 +354,7 @@ public class DataSetTableService {
DataTableInfoDTO dataTableInfoDTO = new Gson().fromJson(dataSetTableRequest.getInfo(), DataTableInfoDTO.class); DataTableInfoDTO dataTableInfoDTO = new Gson().fromJson(dataSetTableRequest.getInfo(), DataTableInfoDTO.class);
List<DataSetTableUnionDTO> list = dataSetTableUnionService.listByTableId(dataTableInfoDTO.getList().get(0).getTableId()); List<DataSetTableUnionDTO> list = dataSetTableUnionService.listByTableId(dataTableInfoDTO.getList().get(0).getTableId());
datasourceRequest.setQuery(getCustomSQL(dataTableInfoDTO, list)); datasourceRequest.setQuery("SELECT * FROM (" + getCustomSQL(dataTableInfoDTO, list) + ") AS tmp LIMIT 0,1000");
Map<String, List> result = jdbcProvider.fetchResultAndField(datasourceRequest); Map<String, List> result = jdbcProvider.fetchResultAndField(datasourceRequest);
List<String[]> data = result.get("dataList"); List<String[]> data = result.get("dataList");
List<TableFiled> fields = result.get("fieldList"); List<TableFiled> fields = result.get("fieldList");
......
...@@ -28,24 +28,34 @@ ...@@ -28,24 +28,34 @@
<el-col class="panel-height" style="width: 235px;border-top:solid 1px #dcdfe6;padding: 0 15px;overflow-y: auto;"> <el-col class="panel-height" style="width: 235px;border-top:solid 1px #dcdfe6;padding: 0 15px;overflow-y: auto;">
<dataset-custom-field :table="table" :checked-list="checkedList" @getChecked="getChecked" /> <dataset-custom-field :table="table" :checked-list="checkedList" @getChecked="getChecked" />
</el-col> </el-col>
<el-col class="panel-height" style="flex: 1;overflow: scroll;"> <el-col class="panel-height" style="flex: 1;overflow: hidden;">
<ux-grid <el-card class="box-card dataPreview" shadow="never">
ref="plxTable" <div slot="header" class="clearfix">
size="mini" <span>{{ $t('dataset.data_preview') }}</span>
style="width: 100%;" </div>
:height="height" <ux-grid
:checkbox-config="{highlight: true}" ref="plxTable"
:width-resize="true" size="mini"
> style="width: 100%;"
<ux-table-column :height="height"
v-for="field in fields" :checkbox-config="{highlight: true}"
:key="field.fieldName" :width-resize="true"
min-width="200px" >
:field="field.fieldName" <ux-table-column
:title="field.remarks" v-for="field in fields"
:resizable="true" :key="field.fieldName"
/> min-width="200px"
</ux-grid> :field="field.fieldName"
:title="field.remarks"
:resizable="true"
/>
</ux-grid>
<span class="table-count">
{{ $t('dataset.preview_show') }}
<span class="span-number">1000</span>
{{ $t('dataset.preview_item') }}
</span>
</el-card>
</el-col> </el-col>
</el-col> </el-col>
</el-col> </el-col>
...@@ -101,7 +111,7 @@ export default { ...@@ -101,7 +111,7 @@ export default {
const that = this const that = this
setTimeout(function() { setTimeout(function() {
const currentHeight = document.documentElement.clientHeight const currentHeight = document.documentElement.clientHeight
that.height = currentHeight - 56 - 15 - 26 - 25 - 43 - 15 that.height = currentHeight - 56 - 15 - 26 - 25 - 43 - 16 - 37 - 20 - 10
}, 10) }, 10)
}, },
...@@ -207,6 +217,14 @@ export default { ...@@ -207,6 +217,14 @@ export default {
margin-left: 0; margin-left: 0;
} }
.dataPreview>>>.el-card__header{
padding: 6px 8px;
}
.dataPreview>>>.el-card__body{
padding:10px;
}
span{ span{
font-size: 14px; font-size: 14px;
} }
...@@ -214,4 +232,11 @@ export default { ...@@ -214,4 +232,11 @@ export default {
.panel-height{ .panel-height{
height: calc(100vh - 56px - 15px - 26px - 25px - 43px); height: calc(100vh - 56px - 15px - 26px - 25px - 43px);
} }
.span-number{
color: #f18126;
}
.table-count{
color: #606266;
}
</style> </style>
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论