feat(视图-表格): 明细表、汇总表支持冻结前N列。#6205
This commit is contained in:
parent
3ea84269d0
commit
263ebe6cf9
@ -1385,8 +1385,10 @@ export default {
|
|||||||
filter_type: 'Filter Type',
|
filter_type: 'Filter Type',
|
||||||
filter_value_can_not_str: 'Value type can not input string',
|
filter_value_can_not_str: 'Value type can not input string',
|
||||||
enum_value_can_not_null: 'Enum Value can not empty.',
|
enum_value_can_not_null: 'Enum Value can not empty.',
|
||||||
|
column: 'Column',
|
||||||
table_config: 'Table Config',
|
table_config: 'Table Config',
|
||||||
table_column_width_config: 'Column Width',
|
table_column_width_config: 'Column Width',
|
||||||
|
table_column_freeze: 'Column Freeze',
|
||||||
table_column_adapt: 'Adapt',
|
table_column_adapt: 'Adapt',
|
||||||
table_column_custom: 'Custom',
|
table_column_custom: 'Custom',
|
||||||
chart_table_pivot: 'Pivot Table',
|
chart_table_pivot: 'Pivot Table',
|
||||||
|
|||||||
@ -1383,8 +1383,10 @@ export default {
|
|||||||
filter_type: '過濾方式',
|
filter_type: '過濾方式',
|
||||||
filter_value_can_not_str: '數值類型字段過濾值不能包含文本',
|
filter_value_can_not_str: '數值類型字段過濾值不能包含文本',
|
||||||
enum_value_can_not_null: '字段枚舉值不能為空',
|
enum_value_can_not_null: '字段枚舉值不能為空',
|
||||||
|
column: '列',
|
||||||
table_config: '表格配置',
|
table_config: '表格配置',
|
||||||
table_column_width_config: '列寬調整',
|
table_column_width_config: '列寬調整',
|
||||||
|
table_column_freeze: '列凍結',
|
||||||
table_column_adapt: '自適應',
|
table_column_adapt: '自適應',
|
||||||
table_column_custom: '自定義',
|
table_column_custom: '自定義',
|
||||||
chart_table_pivot: '透視表',
|
chart_table_pivot: '透視表',
|
||||||
|
|||||||
@ -1383,8 +1383,10 @@ export default {
|
|||||||
filter_type: '过滤方式',
|
filter_type: '过滤方式',
|
||||||
filter_value_can_not_str: '数值类型字段过滤值不能包含文本',
|
filter_value_can_not_str: '数值类型字段过滤值不能包含文本',
|
||||||
enum_value_can_not_null: '字段枚举值不能为空',
|
enum_value_can_not_null: '字段枚举值不能为空',
|
||||||
|
column: '列',
|
||||||
table_config: '表格配置',
|
table_config: '表格配置',
|
||||||
table_column_width_config: '列宽调整',
|
table_column_width_config: '列宽调整',
|
||||||
|
table_column_freeze: '列冻结',
|
||||||
table_column_adapt: '自适应',
|
table_column_adapt: '自适应',
|
||||||
table_column_custom: '自定义',
|
table_column_custom: '自定义',
|
||||||
chart_table_pivot: '透视表',
|
chart_table_pivot: '透视表',
|
||||||
|
|||||||
@ -170,7 +170,9 @@ export const DEFAULT_SIZE = {
|
|||||||
quotaSuffixFontIsItalic: false,
|
quotaSuffixFontIsItalic: false,
|
||||||
quotaSuffixFontIsBolder: false,
|
quotaSuffixFontIsBolder: false,
|
||||||
quotaSuffixLetterSpace: '0',
|
quotaSuffixLetterSpace: '0',
|
||||||
quotaSuffixFontShadow: false
|
quotaSuffixFontShadow: false,
|
||||||
|
tableColumnFreezeHead: 0,
|
||||||
|
tableColumnFreezeTail: 0
|
||||||
}
|
}
|
||||||
export const DEFAULT_SUSPENSION = {
|
export const DEFAULT_SUSPENSION = {
|
||||||
show: true
|
show: true
|
||||||
|
|||||||
@ -91,7 +91,8 @@ export function baseTableInfo(s2, container, chart, action, tableData, pageInfo)
|
|||||||
height: containerDom.offsetHeight,
|
height: containerDom.offsetHeight,
|
||||||
showSeriesNumber: customAttr.size.showIndex,
|
showSeriesNumber: customAttr.size.showIndex,
|
||||||
style: getSize(chart),
|
style: getSize(chart),
|
||||||
conditions: getConditions(chart)
|
conditions: getConditions(chart),
|
||||||
|
frozenColCount: customAttr.size.tableColumnFreezeHead ?? 0
|
||||||
}
|
}
|
||||||
// 开启序号之后,第一列就是序号列,修改 label 即可
|
// 开启序号之后,第一列就是序号列,修改 label 即可
|
||||||
if (s2Options.showSeriesNumber) {
|
if (s2Options.showSeriesNumber) {
|
||||||
@ -279,7 +280,8 @@ export function baseTableNormal(s2, container, chart, action, tableData) {
|
|||||||
height: containerDom.offsetHeight,
|
height: containerDom.offsetHeight,
|
||||||
showSeriesNumber: customAttr.size.showIndex,
|
showSeriesNumber: customAttr.size.showIndex,
|
||||||
style: getSize(chart),
|
style: getSize(chart),
|
||||||
conditions: getConditions(chart)
|
conditions: getConditions(chart),
|
||||||
|
frozenColCount: customAttr.size.tableColumnFreezeHead ?? 0
|
||||||
}
|
}
|
||||||
// 开启序号之后,第一列就是序号列,修改 label 即可
|
// 开启序号之后,第一列就是序号列,修改 label 即可
|
||||||
if (s2Options.showSeriesNumber) {
|
if (s2Options.showSeriesNumber) {
|
||||||
@ -291,7 +293,6 @@ export function baseTableNormal(s2, container, chart, action, tableData) {
|
|||||||
node.label = customAttr.size.indexLabel
|
node.label = customAttr.size.indexLabel
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return node.belongsCell
|
|
||||||
}
|
}
|
||||||
s2Options.dataCell = (viewMeta) => {
|
s2Options.dataCell = (viewMeta) => {
|
||||||
return new DataCell(viewMeta, viewMeta?.spreadsheet)
|
return new DataCell(viewMeta, viewMeta?.spreadsheet)
|
||||||
|
|||||||
@ -63,6 +63,7 @@ export const TYPE_CONFIGS = [
|
|||||||
'tableTitleHeight',
|
'tableTitleHeight',
|
||||||
'tableItemHeight',
|
'tableItemHeight',
|
||||||
'tableColumnMode',
|
'tableColumnMode',
|
||||||
|
'tableColumnFreeze',
|
||||||
'showIndex',
|
'showIndex',
|
||||||
'indexLabel',
|
'indexLabel',
|
||||||
'tableColTooltip',
|
'tableColTooltip',
|
||||||
@ -119,7 +120,8 @@ export const TYPE_CONFIGS = [
|
|||||||
'showIndex',
|
'showIndex',
|
||||||
'indexLabel',
|
'indexLabel',
|
||||||
'tableColTooltip',
|
'tableColTooltip',
|
||||||
'showTableHeader'
|
'showTableHeader',
|
||||||
|
'tableColumnFreeze'
|
||||||
],
|
],
|
||||||
'title-selector-ant-v': [
|
'title-selector-ant-v': [
|
||||||
'show',
|
'show',
|
||||||
@ -2081,6 +2083,7 @@ export const TYPE_CONFIGS = [
|
|||||||
'tableTitleHeight',
|
'tableTitleHeight',
|
||||||
'tableItemHeight',
|
'tableItemHeight',
|
||||||
'tableColumnWidth',
|
'tableColumnWidth',
|
||||||
|
'tableColumnFreeze',
|
||||||
'showIndex',
|
'showIndex',
|
||||||
'indexLabel',
|
'indexLabel',
|
||||||
'tableAutoBreakLine',
|
'tableAutoBreakLine',
|
||||||
@ -2130,6 +2133,7 @@ export const TYPE_CONFIGS = [
|
|||||||
'tableColumnWidth',
|
'tableColumnWidth',
|
||||||
'showIndex',
|
'showIndex',
|
||||||
'indexLabel',
|
'indexLabel',
|
||||||
|
'tableColumnFreeze',
|
||||||
'tableAutoBreakLine',
|
'tableAutoBreakLine',
|
||||||
'showTableHeader'
|
'showTableHeader'
|
||||||
],
|
],
|
||||||
|
|||||||
@ -117,7 +117,7 @@
|
|||||||
v-show="!item.term.includes('null') && !item.term.includes('empty') && item.term !== 'between'"
|
v-show="!item.term.includes('null') && !item.term.includes('empty') && item.term !== 'between'"
|
||||||
v-model="item.value"
|
v-model="item.value"
|
||||||
class="value-item"
|
class="value-item"
|
||||||
style="margin-left: 10px; padding-right: 10px"
|
style="padding-left: 10px"
|
||||||
:placeholder="$t('chart.drag_block_label_value')"
|
:placeholder="$t('chart.drag_block_label_value')"
|
||||||
size="mini"
|
size="mini"
|
||||||
clearable
|
clearable
|
||||||
|
|||||||
@ -329,6 +329,21 @@
|
|||||||
@change="changeBarSizeCase('tableColumnWidth')"
|
@change="changeBarSizeCase('tableColumnWidth')"
|
||||||
/>
|
/>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
|
<el-form-item
|
||||||
|
v-if="showProperty('tableColumnFreeze')"
|
||||||
|
:label="$t('chart.table_column_freeze')"
|
||||||
|
class="form-item"
|
||||||
|
>
|
||||||
|
<span>{{ $t('dynamic_time.before') }} </span>
|
||||||
|
<el-input-number
|
||||||
|
v-model="sizeForm.tableColumnFreezeHead"
|
||||||
|
:min="0"
|
||||||
|
:max="100"
|
||||||
|
:step-strictly="true"
|
||||||
|
@change="changeBarSizeCase('tableColumnFreezeHead')"
|
||||||
|
/>
|
||||||
|
<span> {{ $t('chart.column') }}</span>
|
||||||
|
</el-form-item>
|
||||||
<el-form-item
|
<el-form-item
|
||||||
v-if="showProperty('tableAutoBreakLine')"
|
v-if="showProperty('tableAutoBreakLine')"
|
||||||
:label="$t('chart.table_auto_break_line')"
|
:label="$t('chart.table_auto_break_line')"
|
||||||
@ -1236,6 +1251,8 @@ export default {
|
|||||||
this.sizeForm.liquidOutlineDistance = (this.sizeForm.liquidOutlineDistance || this.sizeForm.liquidOutlineDistance === 0) ? this.sizeForm.liquidOutlineDistance : DEFAULT_SIZE.liquidOutlineDistance
|
this.sizeForm.liquidOutlineDistance = (this.sizeForm.liquidOutlineDistance || this.sizeForm.liquidOutlineDistance === 0) ? this.sizeForm.liquidOutlineDistance : DEFAULT_SIZE.liquidOutlineDistance
|
||||||
this.sizeForm.liquidWaveLength = this.sizeForm.liquidWaveLength ? this.sizeForm.liquidWaveLength : DEFAULT_SIZE.liquidWaveLength
|
this.sizeForm.liquidWaveLength = this.sizeForm.liquidWaveLength ? this.sizeForm.liquidWaveLength : DEFAULT_SIZE.liquidWaveLength
|
||||||
this.sizeForm.liquidWaveCount = this.sizeForm.liquidWaveCount ? this.sizeForm.liquidWaveCount : DEFAULT_SIZE.liquidWaveCount
|
this.sizeForm.liquidWaveCount = this.sizeForm.liquidWaveCount ? this.sizeForm.liquidWaveCount : DEFAULT_SIZE.liquidWaveCount
|
||||||
|
this.sizeForm.tableColumnFreezeHead = this.sizeForm.tableColumnFreezeHead ?? DEFAULT_SIZE.tableColumnFreezeHead
|
||||||
|
this.sizeForm.tableColumnFreezeTail = this.sizeForm.tableColumnFreezeTail ?? DEFAULT_SIZE.tableColumnFreezeTail
|
||||||
|
|
||||||
this.sizeForm.tablePageMode = this.sizeForm.tablePageMode ? this.sizeForm.tablePageMode : DEFAULT_SIZE.tablePageMode
|
this.sizeForm.tablePageMode = this.sizeForm.tablePageMode ? this.sizeForm.tablePageMode : DEFAULT_SIZE.tablePageMode
|
||||||
this.sizeForm.tablePageSize = this.sizeForm.tablePageSize ? this.sizeForm.tablePageSize : DEFAULT_SIZE.tablePageSize
|
this.sizeForm.tablePageSize = this.sizeForm.tablePageSize ? this.sizeForm.tablePageSize : DEFAULT_SIZE.tablePageSize
|
||||||
|
|||||||
@ -295,6 +295,21 @@
|
|||||||
@change="changeBarSizeCase('tableColumnWidth')"
|
@change="changeBarSizeCase('tableColumnWidth')"
|
||||||
/>
|
/>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
|
<el-form-item
|
||||||
|
v-if="showProperty('tableColumnFreeze')"
|
||||||
|
:label="$t('chart.table_column_freeze')"
|
||||||
|
class="form-item"
|
||||||
|
>
|
||||||
|
<span>{{ $t('dynamic_time.before') }} </span>
|
||||||
|
<el-input-number
|
||||||
|
v-model="sizeForm.tableColumnFreezeHead"
|
||||||
|
:min="0"
|
||||||
|
:max="100"
|
||||||
|
:step-strictly="true"
|
||||||
|
@change="changeBarSizeCase('tableColumnFreezeHead')"
|
||||||
|
/>
|
||||||
|
<span> {{ $t('chart.column') }}</span>
|
||||||
|
</el-form-item>
|
||||||
<el-form-item
|
<el-form-item
|
||||||
v-if="showProperty('showIndex')"
|
v-if="showProperty('showIndex')"
|
||||||
:label="$t('chart.table_show_index')"
|
:label="$t('chart.table_show_index')"
|
||||||
@ -1680,6 +1695,8 @@ export default {
|
|||||||
this.sizeForm.tableItemAlign = this.sizeForm.tableItemAlign ? this.sizeForm.tableItemAlign : DEFAULT_SIZE.tableItemAlign
|
this.sizeForm.tableItemAlign = this.sizeForm.tableItemAlign ? this.sizeForm.tableItemAlign : DEFAULT_SIZE.tableItemAlign
|
||||||
this.sizeForm.tableRowTooltip = this.sizeForm.tableRowTooltip ?? DEFAULT_SIZE.tableRowTooltip
|
this.sizeForm.tableRowTooltip = this.sizeForm.tableRowTooltip ?? DEFAULT_SIZE.tableRowTooltip
|
||||||
this.sizeForm.tableColTooltip = this.sizeForm.tableColTooltip ?? DEFAULT_SIZE.tableColTooltip
|
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.showIndex = this.sizeForm.showIndex ? this.sizeForm.showIndex : DEFAULT_SIZE.showIndex
|
this.sizeForm.showIndex = this.sizeForm.showIndex ? this.sizeForm.showIndex : DEFAULT_SIZE.showIndex
|
||||||
this.sizeForm.showTableHeader = this.sizeForm.showTableHeader !== false
|
this.sizeForm.showTableHeader = this.sizeForm.showTableHeader !== false
|
||||||
|
|||||||
@ -42,15 +42,18 @@
|
|||||||
type="index"
|
type="index"
|
||||||
:title="indexLabel"
|
:title="indexLabel"
|
||||||
:width="columnWidth"
|
:width="columnWidth"
|
||||||
|
:resizable="true"
|
||||||
|
:fixed="getFixed(-1)"
|
||||||
/>
|
/>
|
||||||
<ux-table-column
|
<ux-table-column
|
||||||
v-for="field in fields"
|
v-for="(field, index) in fields"
|
||||||
:key="field.name"
|
:key="field.name"
|
||||||
:field="field.child ? '' : field.dataeaseName"
|
:field="field.child ? '' : field.dataeaseName"
|
||||||
:resizable="true"
|
:resizable="true"
|
||||||
:sortable="(!mergeCells || !mergeCells.length) && (!field.child || !field.child.length)"
|
:sortable="(!mergeCells || !mergeCells.length) && (!field.child || !field.child.length)"
|
||||||
:title="field.name"
|
:title="field.name"
|
||||||
:width="columnWidth"
|
:width="columnWidth"
|
||||||
|
:fixed="getFixed(index)"
|
||||||
>
|
>
|
||||||
<ux-table-column
|
<ux-table-column
|
||||||
v-for="item in field.child"
|
v-for="item in field.child"
|
||||||
@ -728,6 +731,14 @@ export default {
|
|||||||
default:
|
default:
|
||||||
break
|
break
|
||||||
}
|
}
|
||||||
|
},
|
||||||
|
getFixed(index) {
|
||||||
|
const size = JSON.parse(this.chart.customAttr).size
|
||||||
|
const { showIndex, tableColumnFreezeHead } = size
|
||||||
|
if (showIndex) {
|
||||||
|
return index < tableColumnFreezeHead - 1 ? 'left' : ''
|
||||||
|
}
|
||||||
|
return index < tableColumnFreezeHead ? 'left' : ''
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user