forked from github/dataease
Merge branch 'dev' into pr@dev_one_dot_x
This commit is contained in:
commit
868cfbe28e
@ -781,11 +781,38 @@ public class DorisQueryProvider extends QueryProvider {
|
||||
|
||||
List<SQLObj> yFields = new ArrayList<>(); // 要把两个时间字段放进y里面
|
||||
List<String> yWheres = new ArrayList<>();
|
||||
List<SQLObj> yOrders = new ArrayList<>();
|
||||
|
||||
if (CollectionUtils.isNotEmpty(xAxis)) {
|
||||
for (int i = 0; i < xAxis.size(); i++) {
|
||||
ChartViewFieldDTO x = xAxis.get(i);
|
||||
String originField;
|
||||
|
||||
if (StringUtils.equalsIgnoreCase(x.getGroupType(), "q")) {
|
||||
if (ObjectUtils.isNotEmpty(x.getExtField()) && x.getExtField() == 2) {
|
||||
// 解析origin name中有关联的字段生成sql表达式
|
||||
originField = calcFieldRegex(x.getOriginName(), tableObj);
|
||||
} else if (ObjectUtils.isNotEmpty(x.getExtField()) && x.getExtField() == 1) {
|
||||
originField = String.format(DorisConstants.KEYWORD_FIX, tableObj.getTableAlias(), x.getDataeaseName());
|
||||
} else {
|
||||
originField = String.format(DorisConstants.KEYWORD_FIX, tableObj.getTableAlias(), x.getDataeaseName());
|
||||
}
|
||||
String fieldAlias = String.format(SQLConstants.FIELD_ALIAS_Y_PREFIX, i);
|
||||
// 处理纵轴字段
|
||||
yFields.add(getYFields(x, originField, fieldAlias));
|
||||
// 处理纵轴过滤
|
||||
yWheres.add(getYWheres(x, originField, fieldAlias));
|
||||
// 处理纵轴排序
|
||||
if (StringUtils.isNotEmpty(x.getSort()) && Utils.joinSort(x.getSort())) {
|
||||
yOrders.add(SQLObj.builder()
|
||||
.orderField(originField)
|
||||
.orderAlias(fieldAlias)
|
||||
.orderDirection(x.getSort())
|
||||
.build());
|
||||
}
|
||||
continue;
|
||||
}
|
||||
|
||||
if (ObjectUtils.isNotEmpty(x.getExtField()) && x.getExtField() == 2) {
|
||||
// 解析origin name中有关联的字段生成sql表达式
|
||||
originField = calcFieldRegex(x.getOriginName(), tableObj);
|
||||
@ -824,8 +851,6 @@ public class DorisQueryProvider extends QueryProvider {
|
||||
}
|
||||
}
|
||||
|
||||
List<SQLObj> yOrders = new ArrayList<>();
|
||||
|
||||
// 处理视图中字段过滤
|
||||
String customWheres = transChartFilterTrees(tableObj, fieldCustomFilter);
|
||||
// 处理仪表板字段过滤
|
||||
|
@ -1386,9 +1386,9 @@ export default {
|
||||
filter_value_can_not_str: 'Value type can not input string',
|
||||
enum_value_can_not_null: 'Enum Value can not empty.',
|
||||
column: 'Column',
|
||||
table_freeze: 'Table Freeze',
|
||||
table_config: 'Table Config',
|
||||
table_column_width_config: 'Column Width',
|
||||
table_column_freeze: 'Column Freeze',
|
||||
table_column_adapt: 'Adapt',
|
||||
table_column_custom: 'Custom',
|
||||
chart_table_pivot: 'Pivot Table',
|
||||
|
@ -1386,7 +1386,7 @@ export default {
|
||||
column: '列',
|
||||
table_config: '表格配置',
|
||||
table_column_width_config: '列寬調整',
|
||||
table_column_freeze: '列凍結',
|
||||
table_freeze: '表格凍結',
|
||||
table_column_adapt: '自適應',
|
||||
table_column_custom: '自定義',
|
||||
chart_table_pivot: '透視表',
|
||||
@ -1522,7 +1522,7 @@ export default {
|
||||
ignore_data: '隱藏空值',
|
||||
empty_data_field_ctrl: '字段設置',
|
||||
sub_dimension_tip: '該字段為必填項,且不應使用類別軸中的字段,若無需該字段,請選擇基礎圖表進行展示,否則展示效果不理想',
|
||||
time_bar_tip: '該字段為必填項,且需要兩個指標或者時間類型緯度字段',
|
||||
time_bar_tip: '該字段為必填項,且需要兩個指標或者時間類型維度字段',
|
||||
drill_dimension_tip: '鑽取字段僅支持數據集中的字段',
|
||||
table_scroll_tip: '明細表僅在分頁模式為"下拉"時生效。',
|
||||
table_threshold_tip: '提示:請勿重複選擇字段,若同一字段重複配置,則只有最後的字段配置生效。',
|
||||
|
@ -1384,9 +1384,9 @@ export default {
|
||||
filter_value_can_not_str: '数值类型字段过滤值不能包含文本',
|
||||
enum_value_can_not_null: '字段枚举值不能为空',
|
||||
column: '列',
|
||||
table_freeze: '表格冻结',
|
||||
table_config: '表格配置',
|
||||
table_column_width_config: '列宽调整',
|
||||
table_column_freeze: '列冻结',
|
||||
table_column_adapt: '自适应',
|
||||
table_column_custom: '自定义',
|
||||
chart_table_pivot: '透视表',
|
||||
@ -1522,7 +1522,7 @@ export default {
|
||||
set_zero: '置为0',
|
||||
ignore_data: '隐藏空值',
|
||||
sub_dimension_tip: '该字段为必填项,且不应使用类别轴中的字段,若无需该字段,请选择基础图表进行展示,否则展示效果不理想。',
|
||||
time_bar_tip: '该字段为必填项,且需要两个指标或者时间类型纬度字段',
|
||||
time_bar_tip: '该字段为必填项,且需要两个指标或者时间类型维度字段',
|
||||
drill_dimension_tip: '钻取字段仅支持数据集中的字段',
|
||||
table_scroll_tip: '明细表仅在分页模式为"下拉"时生效。',
|
||||
table_threshold_tip: '提示:请勿重复选择字段,若同一字段重复配置,则只有最后的字段配置生效',
|
||||
|
@ -172,7 +172,8 @@ export const DEFAULT_SIZE = {
|
||||
quotaSuffixLetterSpace: '0',
|
||||
quotaSuffixFontShadow: false,
|
||||
tableColumnFreezeHead: 0,
|
||||
tableColumnFreezeTail: 0
|
||||
tableColumnFreezeTail: 0,
|
||||
tableRowFreezeHead: 0
|
||||
}
|
||||
export const DEFAULT_SUSPENSION = {
|
||||
show: true
|
||||
|
@ -92,7 +92,8 @@ export function baseTableInfo(s2, container, chart, action, tableData, pageInfo)
|
||||
showSeriesNumber: customAttr.size.showIndex,
|
||||
style: getSize(chart),
|
||||
conditions: getConditions(chart),
|
||||
frozenColCount: customAttr.size.tableColumnFreezeHead ?? 0
|
||||
frozenColCount: customAttr.size.tableColumnFreezeHead ?? 0,
|
||||
frozenRowCount: customAttr.size.tableRowFreezeHead ?? 0
|
||||
}
|
||||
// 开启序号之后,第一列就是序号列,修改 label 即可
|
||||
if (s2Options.showSeriesNumber) {
|
||||
@ -285,16 +286,16 @@ export function baseTableNormal(s2, container, chart, action, tableData) {
|
||||
showSeriesNumber: customAttr.size.showIndex,
|
||||
style: getSize(chart),
|
||||
conditions: getConditions(chart),
|
||||
frozenColCount: customAttr.size.tableColumnFreezeHead ?? 0
|
||||
frozenColCount: customAttr.size.tableColumnFreezeHead ?? 0,
|
||||
frozenRowCount: customAttr.size.tableRowFreezeHead ?? 0
|
||||
}
|
||||
// 开启序号之后,第一列就是序号列,修改 label 即可
|
||||
if (s2Options.showSeriesNumber) {
|
||||
s2Options.colCell = (node) => {
|
||||
if (node.colIndex === 0) {
|
||||
if (!customAttr.size.indexLabel) {
|
||||
node.label = customAttr.size.indexLabel
|
||||
if (!customAttr.size.indexLabel || customAttr.size.showTableHeader === false) {
|
||||
node.label = ' '
|
||||
} else {
|
||||
node.label = customAttr.size.indexLabel
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -310,6 +311,11 @@ export function baseTableNormal(s2, container, chart, action, tableData) {
|
||||
colCellVertical: false
|
||||
}
|
||||
}
|
||||
s2Options.colCell = (node) => {
|
||||
if (node.colIndex === 0) {
|
||||
node.label = ' '
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// 开始渲染
|
||||
|
@ -63,7 +63,7 @@ export const TYPE_CONFIGS = [
|
||||
'tableTitleHeight',
|
||||
'tableItemHeight',
|
||||
'tableColumnMode',
|
||||
'tableColumnFreeze',
|
||||
'tableFreeze',
|
||||
'showIndex',
|
||||
'indexLabel',
|
||||
'tableColTooltip',
|
||||
@ -121,7 +121,7 @@ export const TYPE_CONFIGS = [
|
||||
'indexLabel',
|
||||
'tableColTooltip',
|
||||
'showTableHeader',
|
||||
'tableColumnFreeze'
|
||||
'tableFreeze'
|
||||
],
|
||||
'title-selector-ant-v': [
|
||||
'show',
|
||||
@ -2083,7 +2083,7 @@ export const TYPE_CONFIGS = [
|
||||
'tableTitleHeight',
|
||||
'tableItemHeight',
|
||||
'tableColumnWidth',
|
||||
'tableColumnFreeze',
|
||||
'tableFreeze',
|
||||
'showIndex',
|
||||
'indexLabel',
|
||||
'tableAutoBreakLine',
|
||||
@ -2133,7 +2133,7 @@ export const TYPE_CONFIGS = [
|
||||
'tableColumnWidth',
|
||||
'showIndex',
|
||||
'indexLabel',
|
||||
'tableColumnFreeze',
|
||||
'tableFreeze',
|
||||
'tableAutoBreakLine',
|
||||
'showTableHeader'
|
||||
],
|
||||
|
@ -456,6 +456,9 @@ export default {
|
||||
if (!this.axisForm.axisLine) {
|
||||
this.axisForm.axisLine = JSON.parse(JSON.stringify(DEFAULT_XAXIS_STYLE.axisLine))
|
||||
}
|
||||
if (this.axisForm.splitLine.enableDash === undefined) {
|
||||
this.axisForm.splitLine.enableDash = DEFAULT_XAXIS_STYLE.splitLine.enableDash
|
||||
}
|
||||
if (!this.axisForm.splitLine.dashStyle) {
|
||||
this.axisForm.splitLine.dashStyle = JSON.parse(JSON.stringify(DEFAULT_XAXIS_STYLE.splitLine.dashStyle))
|
||||
}
|
||||
|
@ -447,6 +447,9 @@ export default {
|
||||
if (!this.axisForm.axisLine) {
|
||||
this.axisForm.axisLine = JSON.parse(JSON.stringify(DEFAULT_YAXIS_EXT_STYLE.axisLine))
|
||||
}
|
||||
if (this.axisForm.splitLine.enableDash === undefined) {
|
||||
this.axisForm.splitLine.enableDash = DEFAULT_YAXIS_EXT_STYLE.splitLine.enableDash
|
||||
}
|
||||
if (!this.axisForm.splitLine.dashStyle) {
|
||||
this.axisForm.splitLine.dashStyle = JSON.parse(JSON.stringify(DEFAULT_YAXIS_EXT_STYLE.splitLine.dashStyle))
|
||||
}
|
||||
|
@ -451,6 +451,9 @@ export default {
|
||||
if (!this.axisForm.axisLine) {
|
||||
this.axisForm.axisLine = JSON.parse(JSON.stringify(DEFAULT_YAXIS_STYLE.axisLine))
|
||||
}
|
||||
if (this.axisForm.splitLine.enableDash === undefined) {
|
||||
this.axisForm.splitLine.enableDash = DEFAULT_YAXIS_STYLE.splitLine.enableDash
|
||||
}
|
||||
if (!this.axisForm.splitLine.dashStyle) {
|
||||
this.axisForm.splitLine.dashStyle = JSON.parse(JSON.stringify(DEFAULT_YAXIS_STYLE.splitLine.dashStyle))
|
||||
}
|
||||
|
@ -330,8 +330,8 @@
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item
|
||||
v-if="showProperty('tableColumnFreeze')"
|
||||
:label="$t('chart.table_column_freeze')"
|
||||
v-if="showProperty('tableFreeze')"
|
||||
:label="$t('chart.table_freeze')"
|
||||
class="form-item"
|
||||
>
|
||||
<span>{{ $t('dynamic_time.before') }} </span>
|
||||
|
@ -296,8 +296,8 @@
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item
|
||||
v-if="showProperty('tableColumnFreeze')"
|
||||
:label="$t('chart.table_column_freeze')"
|
||||
v-if="showProperty('tableFreeze')"
|
||||
:label="$t('chart.table_freeze')"
|
||||
class="form-item"
|
||||
>
|
||||
<span>{{ $t('dynamic_time.before') }} </span>
|
||||
@ -309,6 +309,16 @@
|
||||
@change="changeBarSizeCase('tableColumnFreezeHead')"
|
||||
/>
|
||||
<span> {{ $t('chart.column') }}</span>
|
||||
<div style="margin: 5px 0" />
|
||||
<span>{{ $t('dynamic_time.before') }} </span>
|
||||
<el-input-number
|
||||
v-model="sizeForm.tableRowFreezeHead"
|
||||
:min="0"
|
||||
:max="1000"
|
||||
:step-strictly="true"
|
||||
@change="changeBarSizeCase('tableRowFreezeHead')"
|
||||
/>
|
||||
<span> {{ $t('deDataset.row') }}</span>
|
||||
</el-form-item>
|
||||
<el-form-item
|
||||
v-if="showProperty('showIndex')"
|
||||
@ -1697,6 +1707,7 @@ export default {
|
||||
this.sizeForm.tableColTooltip = this.sizeForm.tableColTooltip ?? DEFAULT_SIZE.tableColTooltip
|
||||
this.sizeForm.tableColumnFreezeHead = this.sizeForm.tableColumnFreezeHead ?? DEFAULT_SIZE.tableColumnFreezeHead
|
||||
this.sizeForm.tableColumnFreezeTail = this.sizeForm.tableColumnFreezeTail ?? DEFAULT_SIZE.tableColumnFreezeTail
|
||||
this.sizeForm.tableRowFreezeHead = this.sizeForm.tableRowFreezeHead ?? DEFAULT_SIZE.tableRowFreezeHead
|
||||
|
||||
this.sizeForm.showIndex = this.sizeForm.showIndex ? this.sizeForm.showIndex : DEFAULT_SIZE.showIndex
|
||||
this.sizeForm.showTableHeader = this.sizeForm.showTableHeader !== false
|
||||
|
@ -239,7 +239,11 @@ export default {
|
||||
tableStyle() {
|
||||
return {
|
||||
width: '100%',
|
||||
'--scroll-bar-color': this.scrollBarColor
|
||||
'--scroll-bar-color': this.scrollBarColor,
|
||||
'--footer-font-color': this.table_header_class.color,
|
||||
'--footer-bg-color': this.table_header_class.background,
|
||||
'--footer-font-size': this.table_header_class.fontSize,
|
||||
'--footer-height': this.table_header_class.height
|
||||
}
|
||||
},
|
||||
...mapState([
|
||||
@ -441,16 +445,14 @@ export default {
|
||||
this.table_item_class.fontSize = customAttr.size.tableItemFontSize + 'px'
|
||||
this.table_header_class.height = customAttr.size.tableTitleHeight + 'px'
|
||||
this.table_item_class.height = customAttr.size.tableItemHeight + 'px'
|
||||
|
||||
const visibleColumn = this.$refs.plxTable.getTableColumn().fullColumn
|
||||
for (let i = 0, column = visibleColumn[i]; i < visibleColumn.length; i++) {
|
||||
// 有变更才刷新
|
||||
if (column.type === 'index' && column.visible !== customAttr.size.showIndex) {
|
||||
column.visible = customAttr.size.showIndex
|
||||
this.$refs.plxTable.refreshColumn()
|
||||
break
|
||||
}
|
||||
}
|
||||
this.$refs.plxTable.refreshColumn()
|
||||
if (!customAttr.size.indexLabel) {
|
||||
this.indexLabel = ' '
|
||||
} else {
|
||||
@ -506,20 +508,6 @@ export default {
|
||||
this.bg_class.background = hexColorToRGBA(customStyle.background.color, customStyle.background.alpha)
|
||||
}
|
||||
}
|
||||
// 修改footer合计样式
|
||||
const table = document.getElementsByClassName(this.chart.id)
|
||||
this.$refs.plxTable.updateFooter().then(() => {
|
||||
for (let i = 0; i < table.length; i++) {
|
||||
const s_table = table[i].getElementsByClassName('elx-table--footer')
|
||||
let s = ''
|
||||
for (const i in this.table_header_class) {
|
||||
s += (i === 'fontSize' ? 'font-size' : i) + ':' + this.table_header_class[i] + ';'
|
||||
}
|
||||
for (let i = 0; i < s_table.length; i++) {
|
||||
s_table[i].setAttribute('style', s)
|
||||
}
|
||||
}
|
||||
})
|
||||
},
|
||||
getRowStyle({ row, rowIndex }) {
|
||||
if (rowIndex % 2 !== 0) {
|
||||
@ -828,6 +816,12 @@ export default {
|
||||
text-overflow: var(--text-overflow, 'ellipsis');
|
||||
white-space: var(--white-space, 'nowrap');
|
||||
}
|
||||
::v-deep .elx-table--footer {
|
||||
color: var(--footer-font-color);
|
||||
background: var(--footer-bg-color);
|
||||
font-size: var(--footer-font-size);
|
||||
height: var(--footer-height);
|
||||
}
|
||||
}
|
||||
|
||||
</style>
|
||||
|
@ -71,6 +71,7 @@
|
||||
</el-row>
|
||||
|
||||
<el-row class="padding-lr" style="margin-top: 6px;">
|
||||
<span>test</span>
|
||||
<span class="data-area-label">
|
||||
<span>{{ $t('chart.result_filter') }}</span>
|
||||
<span
|
||||
|
@ -367,6 +367,9 @@ export default {
|
||||
if (!this.axisForm.axisLine) {
|
||||
this.axisForm.axisLine = JSON.parse(JSON.stringify(DEFAULT_XAXIS_STYLE.axisLine))
|
||||
}
|
||||
if (this.axisForm.splitLine.enableDash === undefined) {
|
||||
this.axisForm.splitLine.enableDash = DEFAULT_XAXIS_STYLE.splitLine.enableDash
|
||||
}
|
||||
if (!this.axisForm.splitLine.dashStyle) {
|
||||
this.axisForm.splitLine.dashStyle = JSON.parse(JSON.stringify(DEFAULT_XAXIS_STYLE.splitLine.dashStyle))
|
||||
}
|
||||
|
@ -424,6 +424,9 @@ export default {
|
||||
if (!this.axisForm.axisLine) {
|
||||
this.axisForm.axisLine = JSON.parse(JSON.stringify(DEFAULT_YAXIS_EXT_STYLE.axisLine))
|
||||
}
|
||||
if (this.axisForm.splitLine.enableDash === undefined) {
|
||||
this.axisForm.splitLine.enableDash = DEFAULT_YAXIS_EXT_STYLE.splitLine.enableDash
|
||||
}
|
||||
if (!this.axisForm.splitLine.dashStyle) {
|
||||
this.axisForm.splitLine.dashStyle = JSON.parse(JSON.stringify(DEFAULT_YAXIS_EXT_STYLE.splitLine.dashStyle))
|
||||
}
|
||||
|
@ -424,6 +424,9 @@ export default {
|
||||
if (!this.axisForm.axisLine) {
|
||||
this.axisForm.axisLine = JSON.parse(JSON.stringify(DEFAULT_YAXIS_STYLE.axisLine))
|
||||
}
|
||||
if (this.axisForm.splitLine.enableDash === undefined) {
|
||||
this.axisForm.splitLine.enableDash = DEFAULT_YAXIS_STYLE.splitLine.enableDash
|
||||
}
|
||||
if (!this.axisForm.splitLine.dashStyle) {
|
||||
this.axisForm.splitLine.dashStyle = JSON.parse(JSON.stringify(DEFAULT_YAXIS_STYLE.splitLine.dashStyle))
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user