Merge pull request #13254 from dataease/dev

merge v1.18.26
This commit is contained in:
xuwei-fit2cloud 2024-11-11 18:32:54 +08:00 committed by GitHub
commit faa17ce912
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
8 changed files with 34 additions and 43 deletions

View File

@ -1003,11 +1003,7 @@ public class CKQueryProvider extends QueryProvider {
} }
public String getTotalCount(boolean isTable, String sql, Datasource ds) { public String getTotalCount(boolean isTable, String sql, Datasource ds) {
if (isTable) { return null;
return "SELECT COUNT(*) from " + String.format(CKConstants.KEYWORD_TABLE, sql);
} else {
return "SELECT COUNT(*) from ( " + sqlFix(sql) + " ) DE_COUNT_TEMP";
}
} }
@Override @Override

View File

@ -1194,7 +1194,12 @@ public class ChartDataBuild {
if (chartViewFieldDTO.getDeType() == 0 || chartViewFieldDTO.getDeType() == 1 || chartViewFieldDTO.getDeType() == 5) { if (chartViewFieldDTO.getDeType() == 0 || chartViewFieldDTO.getDeType() == 1 || chartViewFieldDTO.getDeType() == 5) {
d.put(fields.get(i).getDataeaseName(), StringUtils.isEmpty(ele[i]) ? "" : ele[i]); d.put(fields.get(i).getDataeaseName(), StringUtils.isEmpty(ele[i]) ? "" : ele[i]);
} else if (chartViewFieldDTO.getDeType() == 2 || chartViewFieldDTO.getDeType() == 3) { } else if (chartViewFieldDTO.getDeType() == 2 || chartViewFieldDTO.getDeType() == 3) {
try {
d.put(fields.get(i).getDataeaseName(), StringUtils.isEmpty(ele[i]) ? null : new BigDecimal(ele[i]).setScale(8, RoundingMode.HALF_UP)); d.put(fields.get(i).getDataeaseName(), StringUtils.isEmpty(ele[i]) ? null : new BigDecimal(ele[i]).setScale(8, RoundingMode.HALF_UP));
} catch (NumberFormatException e) {
d.put(fields.get(i).getDataeaseName(), StringUtils.isEmpty(ele[i]) ? "" : ele[i]);
}
} }
} }
tableRow.add(d); tableRow.add(d);

View File

@ -2,10 +2,8 @@ package io.dataease.service.exportCenter;
import com.google.gson.Gson; import com.google.gson.Gson;
import io.dataease.auth.api.dto.CurrentUserDto; import io.dataease.auth.api.dto.CurrentUserDto;
import io.dataease.auth.service.AuthUserService;
import io.dataease.auth.service.ProxyAuthService; import io.dataease.auth.service.ProxyAuthService;
import io.dataease.commons.constants.ParamConstants; import io.dataease.commons.constants.ParamConstants;
import io.dataease.commons.constants.SysLogConstants;
import io.dataease.commons.utils.*; import io.dataease.commons.utils.*;
import io.dataease.controller.chart.ChartViewController; import io.dataease.controller.chart.ChartViewController;
import io.dataease.controller.request.chart.ChartExtRequest; import io.dataease.controller.request.chart.ChartExtRequest;
@ -356,19 +354,6 @@ public class ExportCenterService {
ExportTask record = new ExportTask(); ExportTask record = new ExportTask();
record.setExportStatus("FAILED"); record.setExportStatus("FAILED");
exportTaskMapper.updateByExampleSelective(record, exportTaskExample); exportTaskMapper.updateByExampleSelective(record, exportTaskExample);
exportTaskExample.clear();
criteria = exportTaskExample.createCriteria();
criteria.andExportMachineNameEqualTo(hostName()).andExportStatusEqualTo("PENDING");
exportTaskMapper.selectByExampleWithBLOBs(exportTaskExample).parallelStream().forEach(exportTask -> {
if (exportTask.getExportFromType().equalsIgnoreCase("dataset")) {
DataSetExportRequest request = new Gson().fromJson(exportTask.getParams(), DataSetExportRequest.class);
startDatasetTask(exportTask, request);
}
if (exportTask.getExportFromType().equalsIgnoreCase("chart")) {
PanelViewDetailsRequest request = new Gson().fromJson(exportTask.getParams(), PanelViewDetailsRequest.class);
startViewTask(exportTask, request);
}
});
} }
private String hostName() { private String hostName() {
@ -403,7 +388,7 @@ public class ExportCenterService {
String dataPath = exportData_path + exportTask.getId(); String dataPath = exportData_path + exportTask.getId();
File directory = new File(dataPath); File directory = new File(dataPath);
boolean isCreated = directory.mkdir(); boolean isCreated = directory.mkdir();
CurrentUserDto user = proxyAuthService.queryCacheUserDto(exportTask.getUserId()); CurrentUserDto user = AuthUtils.getUser();
Future future = scheduledThreadPoolExecutor.submit(() -> { Future future = scheduledThreadPoolExecutor.submit(() -> {
AuthUtils.setUser(user); AuthUtils.setUser(user);
try { try {
@ -558,14 +543,6 @@ public class ExportCenterService {
outputStream.flush(); outputStream.flush();
} }
wb.close(); wb.close();
if (ObjectUtils.isNotEmpty(user)) {
String viewId = request.getViewId();
ChartViewWithBLOBs chartViewWithBLOBs = chartViewService.get(viewId);
String pid = chartViewWithBLOBs.getSceneId();
DeLogUtils.save(SysLogConstants.OPERATE_TYPE.EXPORT, SysLogConstants.SOURCE_TYPE.VIEW, viewId, pid, null, null);
}
exportTask.setExportPogress("100"); exportTask.setExportPogress("100");
exportTask.setExportStatus("SUCCESS"); exportTask.setExportStatus("SUCCESS");
@ -602,8 +579,7 @@ public class ExportCenterService {
String dataPath = exportData_path + exportTask.getId(); String dataPath = exportData_path + exportTask.getId();
File directory = new File(dataPath); File directory = new File(dataPath);
boolean isCreated = directory.mkdir(); boolean isCreated = directory.mkdir();
CurrentUserDto user = proxyAuthService.queryCacheUserDto(exportTask.getUserId()); CurrentUserDto user = AuthUtils.getUser();
Future future = scheduledThreadPoolExecutor.submit(() -> { Future future = scheduledThreadPoolExecutor.submit(() -> {
AuthUtils.setUser(user); AuthUtils.setUser(user);
try { try {

View File

@ -1,6 +1,6 @@
{ {
"name": "dataease", "name": "dataease",
"version": "1.18.25", "version": "1.18.26",
"description": "dataease front", "description": "dataease front",
"private": true, "private": true,
"scripts": { "scripts": {

View File

@ -32,6 +32,7 @@ export function basePieOptionAntV(container, chart, action) {
tooltip: tooltip, tooltip: tooltip,
legend: legend, legend: legend,
animation: false, animation: false,
autoFit: false,
pieStyle: { pieStyle: {
lineWidth: 0 lineWidth: 0
}, },

View File

@ -34,8 +34,8 @@
<div <div
:id="chartId" :id="chartId"
ref="chart" ref="chart"
style="width: 100%;overflow: hidden;" style="overflow: hidden;"
:style="{height:chartHeight}" :style="{height:chartHeight, width: chartWidth}"
/> />
</div> </div>
</template> </template>
@ -118,6 +118,7 @@ export default {
dynamicAreaCode: null, dynamicAreaCode: null,
borderRadius: '0px', borderRadius: '0px',
chartHeight: '100%', chartHeight: '100%',
chartWidth: '100%',
title_class: { title_class: {
margin: '0 0', margin: '0 0',
width: '100%', width: '100%',
@ -170,10 +171,11 @@ export default {
}, },
beforeDestroy() { beforeDestroy() {
if (this.myChart?.container) { if (this.myChart?.container) {
if (typeof this.myChart.container.getAttribute === 'function') { if (this.myChart.container?.getAttribute?.('size-sensor-id')) {
clear(this.myChart.container) clear(this.myChart.container)
} }
} }
this.resizeObserver?.disconnect()
this.myChart?.clear?.() this.myChart?.clear?.()
this.myChart?.unbindSizeSensor?.() this.myChart?.unbindSizeSensor?.()
this.myChart?.unbind?.() this.myChart?.unbind?.()
@ -244,6 +246,7 @@ export default {
this.initTitle() this.initTitle()
this.calcHeightRightNow(this.drawView) this.calcHeightRightNow(this.drawView)
window.addEventListener('resize', this.chartResize) window.addEventListener('resize', this.chartResize)
this.initResizeObserver()
}, },
async drawView() { async drawView() {
const chart = JSON.parse(JSON.stringify(this.chart)) const chart = JSON.parse(JSON.stringify(this.chart))
@ -389,11 +392,11 @@ export default {
} }
} }
}, },
chartResize() { chartResize(callback) {
this.resizeTimer && clearTimeout(this.resizeTimer) this.resizeTimer && clearTimeout(this.resizeTimer)
this.resizeTimer = setTimeout(() => { this.resizeTimer = setTimeout(() => {
this.calcHeightRightNow() this.calcHeightRightNow(callback)
}, 100) }, 300)
}, },
trackClick(trackAction) { trackClick(trackAction) {
const idTypeMap = this.chart.data.fields.reduce((pre, next) => { const idTypeMap = this.chart.data.fields.reduce((pre, next) => {
@ -503,18 +506,28 @@ export default {
calcHeightRightNow(callback) { calcHeightRightNow(callback) {
this.$nextTick(() => { this.$nextTick(() => {
if (this.$refs.chartContainer) { if (this.$refs.chartContainer) {
const { offsetHeight } = this.$refs.chartContainer const { offsetHeight, offsetWidth } = this.$refs.chartContainer
let titleHeight = 0 let titleHeight = 0
if (this.$refs.title) { if (this.$refs.title) {
titleHeight = this.$refs.title.offsetHeight titleHeight = this.$refs.title.offsetHeight
} }
this.chartHeight = (offsetHeight - titleHeight) + 'px' this.chartHeight = (offsetHeight - titleHeight) + 'px'
this.chartWidth = offsetWidth + 'px'
this.$nextTick(() => callback?.()) this.$nextTick(() => callback?.())
} }
}) })
}, },
initRemark() { initRemark() {
this.remarkCfg = getRemark(this.chart) this.remarkCfg = getRemark(this.chart)
},
initResizeObserver() {
const manualResizeCharts = ['pie', 'pie-donut']
if (manualResizeCharts.includes(this.chart.type)) {
this.resizeObserver = new ResizeObserver(() => {
this.chartResize(this.drawView)
})
this.resizeObserver.observe(this.$refs.chart)
}
} }
} }
} }

View File

@ -1,6 +1,6 @@
{ {
"name": "dataease-mobile", "name": "dataease-mobile",
"version": "1.18.25", "version": "1.18.26",
"private": true, "private": true,
"scripts": { "scripts": {
"serve": "npm run dev:h5", "serve": "npm run dev:h5",

View File

@ -9,7 +9,7 @@
<packaging>pom</packaging> <packaging>pom</packaging>
<properties> <properties>
<dataease.version>1.18.25</dataease.version> <dataease.version>1.18.26</dataease.version>
<poi.version>4.1.1</poi.version> <poi.version>4.1.1</poi.version>
<xmlbeans.version>3.1.0</xmlbeans.version> <xmlbeans.version>3.1.0</xmlbeans.version>
<tomcat.version>9.0.64</tomcat.version> <tomcat.version>9.0.64</tomcat.version>