提交 43ee00d7 authored 作者: taojinlong's avatar taojinlong

Merge branch 'dev' into pr@dev@oracle

...@@ -862,6 +862,7 @@ public class ExtractDataService { ...@@ -862,6 +862,7 @@ public class ExtractDataService {
}catch (Exception e){ }catch (Exception e){
return false; return false;
} }
HttpGet getMethod = new HttpGet("http://" + carte + ":" + port); HttpGet getMethod = new HttpGet("http://" + carte + ":" + port);
HttpClientManager.HttpClientBuilderFacade clientBuilder = HttpClientManager.getInstance().createBuilder(); HttpClientManager.HttpClientBuilderFacade clientBuilder = HttpClientManager.getInstance().createBuilder();
clientBuilder.setConnectionTimeout(1); clientBuilder.setConnectionTimeout(1);
...@@ -871,18 +872,13 @@ public class ExtractDataService { ...@@ -871,18 +872,13 @@ public class ExtractDataService {
HttpResponse httpResponse = httpClient.execute(getMethod); HttpResponse httpResponse = httpClient.execute(getMethod);
int statusCode = httpResponse.getStatusLine().getStatusCode(); int statusCode = httpResponse.getStatusLine().getStatusCode();
if (statusCode != -1 && statusCode < 400) { if (statusCode != -1 && statusCode < 400) {
httpResponse.getEntity().getContent().close();
return true; return true;
} else { } else {
return false; return false;
} }
} catch (Exception e) { } catch (Exception e) {
return false; return false;
}finally {
try {
httpClient.close();
} catch (Exception e) {
LoggerFactory.getLogger(HttpClientUtil.class).error("HttpClient关闭连接失败", e);
}
} }
} }
......
...@@ -88,14 +88,12 @@ export default { ...@@ -88,14 +88,12 @@ export default {
} }
}, },
watch: { watch: {
chart() { chart: function() {
this.init() this.init()
this.calcHeight()
} }
}, },
mounted() { mounted() {
this.init() this.init()
this.calcHeight()
// 监听元素变动事件 // 监听元素变动事件
eventBus.$on('resizing', (componentId) => { eventBus.$on('resizing', (componentId) => {
this.chartResize() this.chartResize()
...@@ -103,6 +101,13 @@ export default { ...@@ -103,6 +101,13 @@ export default {
}, },
methods: { methods: {
init() { init() {
this.resetHeight()
this.$nextTick(() => {
this.initData()
this.calcHeightDelay()
})
},
initData() {
const that = this const that = this
let datas = [] let datas = []
if (this.chart.data) { if (this.chart.data) {
...@@ -117,12 +122,11 @@ export default { ...@@ -117,12 +122,11 @@ export default {
this.initStyle() this.initStyle()
}) })
window.onresize = function() { window.onresize = function() {
that.calcHeight() that.calcHeightDelay()
} }
}, },
calcHeight() { calcHeightRightNow() {
this.$nextTick(() => { this.$nextTick(() => {
setTimeout(() => {
if (this.$refs.tableContainer) { if (this.$refs.tableContainer) {
const currentHeight = this.$refs.tableContainer.offsetHeight const currentHeight = this.$refs.tableContainer.offsetHeight
const tableMaxHeight = currentHeight - this.$refs.title.offsetHeight const tableMaxHeight = currentHeight - this.$refs.title.offsetHeight
...@@ -138,9 +142,13 @@ export default { ...@@ -138,9 +142,13 @@ export default {
this.height = 'auto' this.height = 'auto'
} }
} }
}, 100)
}) })
}, },
calcHeightDelay() {
setTimeout(() => {
this.calcHeightRightNow()
}, 100)
},
initStyle() { initStyle() {
if (this.chart.customAttr) { if (this.chart.customAttr) {
const customAttr = JSON.parse(this.chart.customAttr) const customAttr = JSON.parse(this.chart.customAttr)
...@@ -243,6 +251,10 @@ export default { ...@@ -243,6 +251,10 @@ export default {
initClass() { initClass() {
return this.chart.id return this.chart.id
},
resetHeight() {
this.height = 100
} }
} }
} }
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论