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) {
if (isTable) {
return "SELECT COUNT(*) from " + String.format(CKConstants.KEYWORD_TABLE, sql);
} else {
return "SELECT COUNT(*) from ( " + sqlFix(sql) + " ) DE_COUNT_TEMP";
}
return null;
}
@Override

View File

@ -1194,7 +1194,12 @@ public class ChartDataBuild {
if (chartViewFieldDTO.getDeType() == 0 || chartViewFieldDTO.getDeType() == 1 || chartViewFieldDTO.getDeType() == 5) {
d.put(fields.get(i).getDataeaseName(), StringUtils.isEmpty(ele[i]) ? "" : ele[i]);
} 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));
} catch (NumberFormatException e) {
d.put(fields.get(i).getDataeaseName(), StringUtils.isEmpty(ele[i]) ? "" : ele[i]);
}
}
}
tableRow.add(d);

View File

@ -2,10 +2,8 @@ package io.dataease.service.exportCenter;
import com.google.gson.Gson;
import io.dataease.auth.api.dto.CurrentUserDto;
import io.dataease.auth.service.AuthUserService;
import io.dataease.auth.service.ProxyAuthService;
import io.dataease.commons.constants.ParamConstants;
import io.dataease.commons.constants.SysLogConstants;
import io.dataease.commons.utils.*;
import io.dataease.controller.chart.ChartViewController;
import io.dataease.controller.request.chart.ChartExtRequest;
@ -356,19 +354,6 @@ public class ExportCenterService {
ExportTask record = new ExportTask();
record.setExportStatus("FAILED");
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() {
@ -403,7 +388,7 @@ public class ExportCenterService {
String dataPath = exportData_path + exportTask.getId();
File directory = new File(dataPath);
boolean isCreated = directory.mkdir();
CurrentUserDto user = proxyAuthService.queryCacheUserDto(exportTask.getUserId());
CurrentUserDto user = AuthUtils.getUser();
Future future = scheduledThreadPoolExecutor.submit(() -> {
AuthUtils.setUser(user);
try {
@ -558,14 +543,6 @@ public class ExportCenterService {
outputStream.flush();
}
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.setExportStatus("SUCCESS");
@ -602,8 +579,7 @@ public class ExportCenterService {
String dataPath = exportData_path + exportTask.getId();
File directory = new File(dataPath);
boolean isCreated = directory.mkdir();
CurrentUserDto user = proxyAuthService.queryCacheUserDto(exportTask.getUserId());
CurrentUserDto user = AuthUtils.getUser();
Future future = scheduledThreadPoolExecutor.submit(() -> {
AuthUtils.setUser(user);
try {

View File

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

View File

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

View File

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

View File

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