Merge branch 'dev' into pr@dev_memory_component

This commit is contained in:
dataeaseShu 2023-04-13 18:49:23 +08:00
commit f01543669d
5 changed files with 36 additions and 15 deletions

View File

@ -8,6 +8,8 @@ import io.dataease.commons.model.excel.ExcelSheetModel;
import java.util.List;
import java.util.concurrent.atomic.AtomicReference;
import java.util.regex.Matcher;
import java.util.regex.Pattern;
import org.apache.commons.collections.CollectionUtils;
import org.apache.commons.lang3.StringUtils;
@ -29,6 +31,9 @@ public class ExcelUtils {
List<List<String>> details = sheet.getData();
details.add(0, sheet.getHeads());
String sheetName = sheet.getSheetName();
Pattern pattern = Pattern.compile("[\\s\\\\/:\\*\\?\\\"<>\\|]");
Matcher matcher = pattern.matcher(sheetName);
sheetName = matcher.replaceAll("-");
Sheet curSheet = wb.createSheet(sheetName);
if (StringUtils.isBlank(fileName)) {
String cName = sheetName + suffix;

View File

@ -63,7 +63,7 @@ public class ViewExportExcel {
String panelStyle = panelDto.getPanelStyle();
Map map = gson.fromJson(panelStyle, Map.class);
Map panelMap = (LinkedTreeMap) map.get("panel");
double resultCount = Double.parseDouble(panelMap.get("resultCount").toString());
double resultCount = ObjectUtils.isEmpty(panelMap.get("resultCount")) ? 1000 : Double.parseDouble(panelMap.get("resultCount").toString());
String resultMode = null;
if (ObjectUtils.isNotEmpty(panelMap.get("resultMode"))) {
resultMode = panelMap.get("resultMode").toString();

View File

@ -364,7 +364,7 @@ export function getTooltip(chart) {
res = valueFormatter(param.value, formatterItem)
}
}
} else if (includesAny(chart.type, 'bar', 'line', 'scatter', 'radar', 'area') && !chart.type.includes('group')) {
} else if (includesAny(chart.type, 'bar', 'scatter', 'radar', 'area') && !chart.type.includes('group')) {
obj = { name: param.category, value: param.value }
for (let i = 0; i < yAxis.length; i++) {
const f = yAxis[i]
@ -377,6 +377,20 @@ export function getTooltip(chart) {
break
}
}
} else if (chart.type === 'line') {
obj = { name: param.category, value: param.value }
const xAxisExt = JSON.parse(chart.xaxisExt)
for (let i = 0; i < yAxis.length; i++) {
const f = yAxis[i]
if (f.name === param.category || (yAxis.length && xAxisExt.length)) {
if (f.formatterCfg) {
res = valueFormatter(param.value, f.formatterCfg)
} else {
res = valueFormatter(param.value, formatterItem)
}
break
}
}
} else if (chart.type.includes('group')) {
if (chart.type === 'bar-group') {
obj = { name: param.category, value: param.value }

View File

@ -3367,19 +3367,21 @@ export function getColors(chart, colors, reset) {
}
} else if (equalsAny(chart.type, 'bar-group', 'line')) {
// 拿到data中的category并去重然后构建seriesColor
const data = chart.data.data
const s = []
data.forEach((cur) => {
if (s.indexOf(cur.category) < 0) {
s.push(cur.category)
}
})
for (let i = 0; i < s.length; i++) {
seriesColors.push({
name: s[i],
color: colors[i % colors.length],
isCustom: false
if (chart.data) {
const data = chart.data.data
const s = []
data.forEach((cur) => {
if (s.indexOf(cur.category) < 0) {
s.push(cur.category)
}
})
for (let i = 0; i < s.length; i++) {
seriesColors.push({
name: s[i],
color: colors[i % colors.length],
isCustom: false
})
}
}
} else {
if (chart.data) {

View File

@ -243,7 +243,7 @@ export default {
fieldOptions() {
const xaxis = this.view.xaxis
const yaxis = this.view.yaxis
const locationIds = this.view.viewFields.filter(item => item.busiType === 'locationXaxis' || item.busiType === 'locationYaxis').map(item => item.id)
const locationIds = this.view.viewFields ? this.view.viewFields.filter(item => item.busiType === 'locationXaxis' || item.busiType === 'locationYaxis').map(item => item.id) : []
const xIds = xaxis ? xaxis.map(item => item.id) : []
const yIds = yaxis ? yaxis.map(item => item.id) : []
const disableIds = [...xIds, ...yIds, ...locationIds]