Merge remote-tracking branch 'origin/dev' into dev

This commit is contained in:
wangjiahao 2022-06-22 21:38:15 +08:00
commit dcb1dab5ad
14 changed files with 87 additions and 18 deletions

View File

@ -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);
@ -943,7 +943,8 @@ 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()));
}
});
@ -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;
@ -2626,6 +2628,7 @@ public class DataSetTableService {
};
return expressionDeParser;
}
static private boolean hasVarible(String sql) {
return sql.contains(SubstitutedParams);
}

View File

@ -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

View File

@ -102,7 +102,8 @@ export const DEFAULT_TOOLTIP = {
fontSize: '10',
color: '#909399'
},
formatter: ''
formatter: '',
backgroundColor: '#ffffff'
}
export const DEFAULT_TOTAL = {
row: {

View File

@ -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
}
}
},

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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
}
}
},

View File

@ -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
}
}
},