forked from github/dataease
Merge remote-tracking branch 'origin/dev' into dev
This commit is contained in:
commit
dcb1dab5ad
@ -533,7 +533,7 @@ public class DataSetTableService {
|
||||
.checked(Boolean.TRUE).build();
|
||||
List<DatasetTableField> fields = dataSetTableFieldsService.list(datasetTableField);
|
||||
if (CollectionUtils.isNotEmpty(extFields)) {
|
||||
fields.addAll(extFields);
|
||||
fields = extFields;
|
||||
}
|
||||
if (CollectionUtils.isEmpty(fields)) {
|
||||
map.put("fields", fields);
|
||||
@ -749,7 +749,7 @@ public class DataSetTableService {
|
||||
conditionEntities.add(entity2);
|
||||
request.setConditions(conditionEntities);
|
||||
List<DataSetTaskLogDTO> dataSetTaskLogDTOS = dataSetTableTaskLogService.listTaskLog(request, "excel");
|
||||
if(CollectionUtils.isNotEmpty(dataSetTaskLogDTOS)){
|
||||
if (CollectionUtils.isNotEmpty(dataSetTaskLogDTOS)) {
|
||||
dataSetTaskLogDTOS.get(0).getStatus().equalsIgnoreCase(JobStatus.Underway.name());
|
||||
sycnStatus = dataSetTaskLogDTOS.get(0).getStatus();
|
||||
}
|
||||
@ -943,14 +943,15 @@ public class DataSetTableService {
|
||||
List<SqlVariableDetails> sqlVariableDetails = new ArrayList<>();
|
||||
datasetTables.forEach(datasetTable -> {
|
||||
if (StringUtils.isNotEmpty(datasetTable.getSqlVariableDetails())) {
|
||||
sqlVariableDetails.addAll(new Gson().fromJson(datasetTable.getSqlVariableDetails(), new TypeToken<List<SqlVariableDetails>>() {}.getType()));
|
||||
sqlVariableDetails.addAll(new Gson().fromJson(datasetTable.getSqlVariableDetails(), new TypeToken<List<SqlVariableDetails>>() {
|
||||
}.getType()));
|
||||
}
|
||||
|
||||
});
|
||||
return sqlVariableDetails;
|
||||
}
|
||||
|
||||
public String handleVariableDefaultValue(String sql, String sqlVariableDetails){
|
||||
public String handleVariableDefaultValue(String sql, String sqlVariableDetails) {
|
||||
if (StringUtils.isEmpty(sql)) {
|
||||
DataEaseException.throwException(Translator.get("i18n_sql_not_empty"));
|
||||
}
|
||||
@ -958,7 +959,8 @@ public class DataSetTableService {
|
||||
Matcher matcher = pattern.matcher(sql);
|
||||
while (matcher.find()) {
|
||||
SqlVariableDetails defaultsSqlVariableDetail = null;
|
||||
List<SqlVariableDetails> defaultsSqlVariableDetails = new Gson().fromJson(sqlVariableDetails, new TypeToken<List<SqlVariableDetails>>() {}.getType());
|
||||
List<SqlVariableDetails> defaultsSqlVariableDetails = new Gson().fromJson(sqlVariableDetails, new TypeToken<List<SqlVariableDetails>>() {
|
||||
}.getType());
|
||||
for (SqlVariableDetails sqlVariableDetail : defaultsSqlVariableDetails) {
|
||||
if (matcher.group().substring(2, matcher.group().length() - 1).equalsIgnoreCase(sqlVariableDetail.getVariableName())) {
|
||||
defaultsSqlVariableDetail = sqlVariableDetail;
|
||||
@ -969,11 +971,11 @@ public class DataSetTableService {
|
||||
sql = sql.replace(matcher.group(), defaultsSqlVariableDetail.getDefaultValue());
|
||||
}
|
||||
}
|
||||
try {
|
||||
sql = removeVariables(sql);
|
||||
}catch (Exception e){
|
||||
e.printStackTrace();
|
||||
}
|
||||
try {
|
||||
sql = removeVariables(sql);
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
return sql;
|
||||
}
|
||||
|
||||
@ -985,7 +987,7 @@ public class DataSetTableService {
|
||||
hasVariables = true;
|
||||
sql = sql.replace(matcher.group(), SubstitutedParams);
|
||||
}
|
||||
if(!hasVariables){
|
||||
if (!hasVariables) {
|
||||
return sql;
|
||||
}
|
||||
CCJSqlParserUtil.parse(sql, parser -> parser.withSquareBracketQuotation(true));
|
||||
@ -993,15 +995,15 @@ public class DataSetTableService {
|
||||
Select select = (Select) statement;
|
||||
PlainSelect plainSelect = ((PlainSelect) select.getSelectBody());
|
||||
Expression expr = plainSelect.getWhere();
|
||||
if(expr == null){
|
||||
if (expr == null) {
|
||||
return sql;
|
||||
}
|
||||
StringBuilder stringBuilder = new StringBuilder();
|
||||
BinaryExpression binaryExpression = (BinaryExpression)expr;
|
||||
BinaryExpression binaryExpression = (BinaryExpression) expr;
|
||||
|
||||
if(!(binaryExpression.getLeftExpression() instanceof BinaryExpression) && !(binaryExpression.getRightExpression() instanceof BinaryExpression) && hasVarible(binaryExpression.toString())){
|
||||
if (!(binaryExpression.getLeftExpression() instanceof BinaryExpression) && !(binaryExpression.getRightExpression() instanceof BinaryExpression) && hasVarible(binaryExpression.toString())) {
|
||||
stringBuilder.append(SubstitutedSql);
|
||||
}else {
|
||||
} else {
|
||||
expr.accept(getExpressionDeParser(stringBuilder));
|
||||
}
|
||||
plainSelect.setWhere(CCJSqlParserUtil.parseCondExpression(stringBuilder.toString()));
|
||||
@ -2626,6 +2628,7 @@ public class DataSetTableService {
|
||||
};
|
||||
return expressionDeParser;
|
||||
}
|
||||
|
||||
static private boolean hasVarible(String sql) {
|
||||
return sql.contains(SubstitutedParams);
|
||||
}
|
||||
|
@ -1,5 +1,6 @@
|
||||
import { hexColorToRGBA } from '../util.js'
|
||||
import { componentStyle, seniorCfg } from '../common/common'
|
||||
import { DEFAULT_TOOLTIP } from '@/views/chart/chart/chart'
|
||||
|
||||
export function baseBarOption(chart_option, chart) {
|
||||
// 处理shape attr
|
||||
@ -15,6 +16,10 @@ export function baseBarOption(chart_option, chart) {
|
||||
const reg = new RegExp('\n', 'g')
|
||||
tooltip.formatter = tooltip.formatter.replace(reg, '<br/>')
|
||||
chart_option.tooltip = tooltip
|
||||
|
||||
const bgColor = tooltip.backgroundColor ? tooltip.backgroundColor : DEFAULT_TOOLTIP.backgroundColor
|
||||
chart_option.tooltip.backgroundColor = bgColor
|
||||
chart_option.tooltip.borderColor = bgColor
|
||||
}
|
||||
}
|
||||
// 处理data
|
||||
@ -77,6 +82,10 @@ export function horizontalBarOption(chart_option, chart) {
|
||||
const reg = new RegExp('\n', 'g')
|
||||
tooltip.formatter = tooltip.formatter.replace(reg, '<br/>')
|
||||
chart_option.tooltip = tooltip
|
||||
|
||||
const bgColor = tooltip.backgroundColor ? tooltip.backgroundColor : DEFAULT_TOOLTIP.backgroundColor
|
||||
chart_option.tooltip.backgroundColor = bgColor
|
||||
chart_option.tooltip.borderColor = bgColor
|
||||
}
|
||||
}
|
||||
// 处理data
|
||||
|
@ -102,7 +102,8 @@ export const DEFAULT_TOOLTIP = {
|
||||
fontSize: '10',
|
||||
color: '#909399'
|
||||
},
|
||||
formatter: ''
|
||||
formatter: '',
|
||||
backgroundColor: '#ffffff'
|
||||
}
|
||||
export const DEFAULT_TOTAL = {
|
||||
row: {
|
||||
|
@ -11,7 +11,7 @@ export function getPadding(chart) {
|
||||
// color,label,tooltip,axis,legend,background
|
||||
export function getTheme(chart) {
|
||||
const colors = []
|
||||
let bgColor, labelFontsize, labelColor, tooltipColor, tooltipFontsize, legendColor, legendFontsize
|
||||
let bgColor, labelFontsize, labelColor, tooltipColor, tooltipFontsize, tooltipBackgroundColor, legendColor, legendFontsize
|
||||
let customAttr = {}
|
||||
if (chart.customAttr) {
|
||||
customAttr = JSON.parse(chart.customAttr)
|
||||
@ -33,6 +33,7 @@ export function getTheme(chart) {
|
||||
const t = JSON.parse(JSON.stringify(customAttr.tooltip))
|
||||
tooltipColor = t.textStyle.color
|
||||
tooltipFontsize = t.textStyle.fontSize
|
||||
tooltipBackgroundColor = t.backgroundColor
|
||||
}
|
||||
}
|
||||
|
||||
@ -84,7 +85,8 @@ export function getTheme(chart) {
|
||||
domStyles: {
|
||||
'g2-tooltip': {
|
||||
color: tooltipColor,
|
||||
fontSize: tooltipFontsize + 'px'
|
||||
fontSize: tooltipFontsize + 'px',
|
||||
background: tooltipBackgroundColor
|
||||
}
|
||||
}
|
||||
},
|
||||
|
@ -1,5 +1,6 @@
|
||||
import { hexColorToRGBA } from '@/views/chart/chart/util'
|
||||
import { componentStyle } from '../common/common'
|
||||
import { DEFAULT_TOOLTIP } from '@/views/chart/chart/chart'
|
||||
|
||||
export function baseFunnelOption(chart_option, chart) {
|
||||
// 处理shape attr
|
||||
@ -15,6 +16,10 @@ export function baseFunnelOption(chart_option, chart) {
|
||||
const reg = new RegExp('\n', 'g')
|
||||
tooltip.formatter = tooltip.formatter.replace(reg, '<br/>')
|
||||
chart_option.tooltip = tooltip
|
||||
|
||||
const bgColor = tooltip.backgroundColor ? tooltip.backgroundColor : DEFAULT_TOOLTIP.backgroundColor
|
||||
chart_option.tooltip.backgroundColor = bgColor
|
||||
chart_option.tooltip.borderColor = bgColor
|
||||
}
|
||||
}
|
||||
// 处理data
|
||||
|
@ -1,5 +1,6 @@
|
||||
import { hexColorToRGBA } from '@/views/chart/chart/util'
|
||||
import { componentStyle, seniorCfg } from '../common/common'
|
||||
import { DEFAULT_TOOLTIP } from '@/views/chart/chart/chart'
|
||||
|
||||
export function baseLineOption(chart_option, chart) {
|
||||
// 处理shape attr
|
||||
@ -15,6 +16,10 @@ export function baseLineOption(chart_option, chart) {
|
||||
const reg = new RegExp('\n', 'g')
|
||||
tooltip.formatter = tooltip.formatter.replace(reg, '<br/>')
|
||||
chart_option.tooltip = tooltip
|
||||
|
||||
const bgColor = tooltip.backgroundColor ? tooltip.backgroundColor : DEFAULT_TOOLTIP.backgroundColor
|
||||
chart_option.tooltip.backgroundColor = bgColor
|
||||
chart_option.tooltip.borderColor = bgColor
|
||||
}
|
||||
}
|
||||
// 处理data
|
||||
|
@ -1,5 +1,6 @@
|
||||
// import { hexColorToRGBA } from '@/views/chart/chart/util'
|
||||
import { componentStyle } from '../common/common'
|
||||
import { DEFAULT_TOOLTIP } from '@/views/chart/chart/chart'
|
||||
|
||||
export function baseMapOption(chart_option, chart) {
|
||||
// 处理shape attr
|
||||
@ -21,6 +22,10 @@ export function baseMapOption(chart_option, chart) {
|
||||
return text.replace(new RegExp('{a}', 'g'), a).replace(new RegExp('{b}', 'g'), b).replace(new RegExp('{c}', 'g'), c)
|
||||
}
|
||||
chart_option.tooltip = tooltip
|
||||
|
||||
const bgColor = tooltip.backgroundColor ? tooltip.backgroundColor : DEFAULT_TOOLTIP.backgroundColor
|
||||
chart_option.tooltip.backgroundColor = bgColor
|
||||
chart_option.tooltip.borderColor = bgColor
|
||||
}
|
||||
}
|
||||
// 处理data
|
||||
|
@ -1,5 +1,6 @@
|
||||
import { hexColorToRGBA } from '@/views/chart/chart/util'
|
||||
import { componentStyle, seniorCfg } from '../common/common'
|
||||
import { DEFAULT_TOOLTIP } from '@/views/chart/chart/chart'
|
||||
|
||||
export function baseMixOption(chart_option, chart) {
|
||||
// 处理shape attr
|
||||
@ -16,6 +17,10 @@ export function baseMixOption(chart_option, chart) {
|
||||
const reg = new RegExp('\n', 'g')
|
||||
tooltip.formatter = tooltip.formatter.replace(reg, '<br/>')
|
||||
chart_option.tooltip = tooltip
|
||||
|
||||
const bgColor = tooltip.backgroundColor ? tooltip.backgroundColor : DEFAULT_TOOLTIP.backgroundColor
|
||||
chart_option.tooltip.backgroundColor = bgColor
|
||||
chart_option.tooltip.borderColor = bgColor
|
||||
}
|
||||
}
|
||||
// 处理data
|
||||
|
@ -1,5 +1,6 @@
|
||||
import { hexColorToRGBA } from '@/views/chart/chart/util'
|
||||
import { componentStyle } from '../common/common'
|
||||
import { DEFAULT_TOOLTIP } from '@/views/chart/chart/chart'
|
||||
|
||||
export function basePieOption(chart_option, chart) {
|
||||
// 处理shape attr
|
||||
@ -15,6 +16,10 @@ export function basePieOption(chart_option, chart) {
|
||||
const reg = new RegExp('\n', 'g')
|
||||
tooltip.formatter = tooltip.formatter.replace(reg, '<br/>')
|
||||
chart_option.tooltip = tooltip
|
||||
|
||||
const bgColor = tooltip.backgroundColor ? tooltip.backgroundColor : DEFAULT_TOOLTIP.backgroundColor
|
||||
chart_option.tooltip.backgroundColor = bgColor
|
||||
chart_option.tooltip.borderColor = bgColor
|
||||
}
|
||||
}
|
||||
// 处理data
|
||||
@ -63,6 +68,10 @@ export function rosePieOption(chart_option, chart) {
|
||||
const reg = new RegExp('\n', 'g')
|
||||
tooltip.formatter = tooltip.formatter.replace(reg, '<br/>')
|
||||
chart_option.tooltip = tooltip
|
||||
|
||||
const bgColor = tooltip.backgroundColor ? tooltip.backgroundColor : DEFAULT_TOOLTIP.backgroundColor
|
||||
chart_option.tooltip.backgroundColor = bgColor
|
||||
chart_option.tooltip.borderColor = bgColor
|
||||
}
|
||||
}
|
||||
// 处理data
|
||||
|
@ -1,5 +1,6 @@
|
||||
import { hexColorToRGBA } from '@/views/chart/chart/util'
|
||||
import { componentStyle } from '../common/common'
|
||||
import { DEFAULT_TOOLTIP } from '@/views/chart/chart/chart'
|
||||
|
||||
export function baseRadarOption(chart_option, chart) {
|
||||
// 处理shape attr
|
||||
@ -20,6 +21,10 @@ export function baseRadarOption(chart_option, chart) {
|
||||
const reg = new RegExp('\n', 'g')
|
||||
tooltip.formatter = tooltip.formatter.replace(reg, '<br/>')
|
||||
chart_option.tooltip = tooltip
|
||||
|
||||
const bgColor = tooltip.backgroundColor ? tooltip.backgroundColor : DEFAULT_TOOLTIP.backgroundColor
|
||||
chart_option.tooltip.backgroundColor = bgColor
|
||||
chart_option.tooltip.borderColor = bgColor
|
||||
}
|
||||
}
|
||||
// 处理data
|
||||
|
@ -1,5 +1,6 @@
|
||||
import { hexColorToRGBA } from '@/views/chart/chart/util'
|
||||
import { componentStyle, seniorCfg } from '../common/common'
|
||||
import { DEFAULT_TOOLTIP } from '@/views/chart/chart/chart'
|
||||
|
||||
let bubbleArray = []
|
||||
let terminalType = 'pc'
|
||||
@ -19,6 +20,10 @@ export function baseScatterOption(chart_option, chart, terminal = 'pc') {
|
||||
const reg = new RegExp('\n', 'g')
|
||||
tooltip.formatter = tooltip.formatter.replace(reg, '<br/>')
|
||||
chart_option.tooltip = tooltip
|
||||
|
||||
const bgColor = tooltip.backgroundColor ? tooltip.backgroundColor : DEFAULT_TOOLTIP.backgroundColor
|
||||
chart_option.tooltip.backgroundColor = bgColor
|
||||
chart_option.tooltip.borderColor = bgColor
|
||||
}
|
||||
}
|
||||
// 处理data
|
||||
|
@ -1,5 +1,6 @@
|
||||
import { hexColorToRGBA } from '@/views/chart/chart/util'
|
||||
import { componentStyle } from '../common/common'
|
||||
import { DEFAULT_TOOLTIP } from '@/views/chart/chart/chart'
|
||||
|
||||
export function baseTreemapOption(chart_option, chart) {
|
||||
// 处理shape attr
|
||||
@ -15,6 +16,10 @@ export function baseTreemapOption(chart_option, chart) {
|
||||
const reg = new RegExp('\n', 'g')
|
||||
tooltip.formatter = tooltip.formatter.replace(reg, '<br/>')
|
||||
chart_option.tooltip = tooltip
|
||||
|
||||
const bgColor = tooltip.backgroundColor ? tooltip.backgroundColor : DEFAULT_TOOLTIP.backgroundColor
|
||||
chart_option.tooltip.backgroundColor = bgColor
|
||||
chart_option.tooltip.borderColor = bgColor
|
||||
}
|
||||
}
|
||||
// 处理data
|
||||
|
@ -20,6 +20,9 @@
|
||||
<el-form-item v-show="showProperty('textStyle')" :label="$t('chart.text_color')" class="form-item">
|
||||
<el-color-picker v-model="tooltipForm.textStyle.color" class="color-picker-style" :predefine="predefineColors" @change="changeTooltipAttr('textStyle')" />
|
||||
</el-form-item>
|
||||
<el-form-item v-show="showProperty('textStyle')" :label="$t('chart.background')" class="form-item">
|
||||
<el-color-picker v-model="tooltipForm.backgroundColor" class="color-picker-style" :predefine="predefineColors" @change="changeTooltipAttr('textStyle')" />
|
||||
</el-form-item>
|
||||
<el-form-item v-show="showProperty('formatter')" class="form-item">
|
||||
<span slot="label">
|
||||
<span class="span-box">
|
||||
@ -101,6 +104,8 @@ export default {
|
||||
}
|
||||
if (customAttr.tooltip) {
|
||||
this.tooltipForm = customAttr.tooltip
|
||||
|
||||
this.tooltipForm.backgroundColor = this.tooltipForm.backgroundColor ? this.tooltipForm.backgroundColor : DEFAULT_TOOLTIP.backgroundColor
|
||||
}
|
||||
}
|
||||
},
|
||||
|
@ -14,6 +14,9 @@
|
||||
<el-form-item v-show="showProperty('textStyle')" :label="$t('chart.text_color')" class="form-item">
|
||||
<el-color-picker v-model="tooltipForm.textStyle.color" class="color-picker-style" :predefine="predefineColors" @change="changeTooltipAttr('textStyle')" />
|
||||
</el-form-item>
|
||||
<el-form-item v-show="showProperty('textStyle')" :label="$t('chart.background')" class="form-item">
|
||||
<el-color-picker v-model="tooltipForm.backgroundColor" class="color-picker-style" :predefine="predefineColors" @change="changeTooltipAttr('textStyle')" />
|
||||
</el-form-item>
|
||||
</div>
|
||||
</el-form>
|
||||
</el-col>
|
||||
@ -73,6 +76,8 @@ export default {
|
||||
}
|
||||
if (customAttr.tooltip) {
|
||||
this.tooltipForm = customAttr.tooltip
|
||||
|
||||
this.tooltipForm.backgroundColor = this.tooltipForm.backgroundColor ? this.tooltipForm.backgroundColor : DEFAULT_TOOLTIP.backgroundColor
|
||||
}
|
||||
}
|
||||
},
|
||||
|
Loading…
Reference in New Issue
Block a user