diff --git a/src/views/DataAnalyse/insight/report/components/StyledTable.vue b/src/views/DataAnalyse/insight/report/components/StyledTable.vue index 3daba433..de93a41f 100644 --- a/src/views/DataAnalyse/insight/report/components/StyledTable.vue +++ b/src/views/DataAnalyse/insight/report/components/StyledTable.vue @@ -130,6 +130,17 @@ const columns = computed(() => headers.value.map((column, columnIndex) => { } } + column.customCell = function(record) { + const style = {} + if(columnIndex > 0 && ['概念编码', '样本基数'].some((key) => record[column.dataIndex]?.indexOf?.(key) > -1)) { + style['font-style'] = 'italic' + } + + return { + style + } + } + if(column.children?.length) { column.children.forEach((child) => { child.align = 'center' @@ -257,6 +268,22 @@ function updateSelectionChange(record) { function getPopupContainer(el) { return el.parentNode || document.body } + +function cellClass(record, column, cols) { + const columnIndex = cols.flatMap(i => i.children || [i]).findIndex((col) => col.dataIndex === column.dataIndex) + + const isStaticCell = ['概念编码', '样本基数'].some((key) => record[cols[0]?.dataIndex].indexOf(key) > -1) + + const isStrokeCell = record[cols[0]?.dataIndex].toLowerCase().indexOf('top') > -1 && columnIndex > 0 + + // console.log('====', record[cols[0]?.dataIndex], columnIndex, column) + + + return { + italic: isStaticCell, + stroke: isStrokeCell + } +} @@ -337,6 +369,14 @@ function getPopupContainer(el) { color: #70B936; } + .italic { + font-style: italic; + } + + .stroke { + -webkit-text-stroke-width: 0.5px; + } + .cell-bar { position: relative; min-width: 1px;