From c0246106a84393f043da1272102578148e7c6f77 Mon Sep 17 00:00:00 2001 From: taojinlong Date: Wed, 30 Jun 2021 11:19:34 +0800 Subject: [PATCH 1/2] =?UTF-8?q?fix:=20=E6=A3=80=E6=B5=8Bkettle=E7=8A=B6?= =?UTF-8?q?=E6=80=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../io/dataease/service/dataset/ExtractDataService.java | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/backend/src/main/java/io/dataease/service/dataset/ExtractDataService.java b/backend/src/main/java/io/dataease/service/dataset/ExtractDataService.java index 49e36b37a8..0f08c76a57 100644 --- a/backend/src/main/java/io/dataease/service/dataset/ExtractDataService.java +++ b/backend/src/main/java/io/dataease/service/dataset/ExtractDataService.java @@ -844,6 +844,7 @@ public class ExtractDataService { }catch (Exception e){ return false; } + HttpGet getMethod = new HttpGet("http://" + carte + ":" + port); HttpClientManager.HttpClientBuilderFacade clientBuilder = HttpClientManager.getInstance().createBuilder(); clientBuilder.setConnectionTimeout(1); @@ -853,18 +854,13 @@ public class ExtractDataService { HttpResponse httpResponse = httpClient.execute(getMethod); int statusCode = httpResponse.getStatusLine().getStatusCode(); if (statusCode != -1 && statusCode < 400) { + httpResponse.getEntity().getContent().close(); return true; } else { return false; } } catch (Exception e) { return false; - }finally { - try { - httpClient.close(); - } catch (Exception e) { - LoggerFactory.getLogger(HttpClientUtil.class).error("HttpClient关闭连接失败", e); - } } } From 2024d88a5e6e0c20d04614721074b76e89d4f845 Mon Sep 17 00:00:00 2001 From: junjie Date: Wed, 30 Jun 2021 12:42:09 +0800 Subject: [PATCH 2/2] =?UTF-8?q?refactor:=20=E8=A7=86=E5=9B=BE=E8=A1=A8?= =?UTF-8?q?=E6=A0=BC=E7=BB=84=E4=BB=B6=EF=BC=8C=E6=B8=B2=E6=9F=93=E9=80=9F?= =?UTF-8?q?=E5=BA=A6=E4=BC=98=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../chart/components/table/TableNormal.vue | 54 +++++++++++-------- 1 file changed, 33 insertions(+), 21 deletions(-) diff --git a/frontend/src/views/chart/components/table/TableNormal.vue b/frontend/src/views/chart/components/table/TableNormal.vue index 41153e1f9d..c75e30a12b 100644 --- a/frontend/src/views/chart/components/table/TableNormal.vue +++ b/frontend/src/views/chart/components/table/TableNormal.vue @@ -88,14 +88,12 @@ export default { } }, watch: { - chart() { + chart: function() { this.init() - this.calcHeight() } }, mounted() { this.init() - this.calcHeight() // 监听元素变动事件 eventBus.$on('resizing', (componentId) => { this.chartResize() @@ -103,6 +101,13 @@ export default { }, methods: { init() { + this.resetHeight() + this.$nextTick(() => { + this.initData() + this.calcHeightDelay() + }) + }, + initData() { const that = this let datas = [] if (this.chart.data) { @@ -117,30 +122,33 @@ export default { this.initStyle() }) window.onresize = function() { - that.calcHeight() + that.calcHeightDelay() } }, - calcHeight() { + calcHeightRightNow() { this.$nextTick(() => { - setTimeout(() => { - if (this.$refs.tableContainer) { - const currentHeight = this.$refs.tableContainer.offsetHeight - const tableMaxHeight = currentHeight - this.$refs.title.offsetHeight - let tableHeight - if (this.chart.data) { - tableHeight = (this.chart.data.tableRow.length + 2) * 36 - } else { - tableHeight = 0 - } - if (tableHeight > tableMaxHeight) { - this.height = tableMaxHeight + 'px' - } else { - this.height = 'auto' - } + if (this.$refs.tableContainer) { + const currentHeight = this.$refs.tableContainer.offsetHeight + const tableMaxHeight = currentHeight - this.$refs.title.offsetHeight + let tableHeight + if (this.chart.data) { + tableHeight = (this.chart.data.tableRow.length + 2) * 36 + } else { + tableHeight = 0 } - }, 100) + if (tableHeight > tableMaxHeight) { + this.height = tableMaxHeight + 'px' + } else { + this.height = 'auto' + } + } }) }, + calcHeightDelay() { + setTimeout(() => { + this.calcHeightRightNow() + }, 100) + }, initStyle() { if (this.chart.customAttr) { const customAttr = JSON.parse(this.chart.customAttr) @@ -243,6 +251,10 @@ export default { initClass() { return this.chart.id + }, + + resetHeight() { + this.height = 100 } } }