一级列小于14个列宽自适应,字段width只有列大于等于14个才生效,合计行的topborder,隐藏selection
This commit is contained in:
@@ -298,7 +298,7 @@ const initTable = async () => {
|
||||
hideColumns.value=[]
|
||||
tableInfo.value = { ...reportVo, isPage, isHeight, isPermi, isHideExport }
|
||||
tableOption.value = {
|
||||
selection: !isHideExport,
|
||||
selection: false,
|
||||
reserveSelection: true,
|
||||
menu: false,
|
||||
addBtn: false,
|
||||
@@ -445,6 +445,7 @@ const initTable = async () => {
|
||||
}
|
||||
if(item.width){
|
||||
config.width=item.width
|
||||
config.widthOld=item.width
|
||||
}
|
||||
if(item.isDimension=='Y'){
|
||||
dimensionFields.value[config.prop]=config
|
||||
@@ -723,7 +724,6 @@ const getTableData = async (isLoading = true) => {
|
||||
tableData.value = processedData
|
||||
Object.values(tableOption.value.column).forEach( item=>{
|
||||
let oldHide=hideCols.value.indexOf(item.prop)!==-1
|
||||
|
||||
item.hide=tableData.value[0]&&((tableSearch.value['Group by']&&tableData.value[0][item.prop]===undefined&&!item.children)||(item.children?.every(child=>(!['yearplan','yearrate'].includes(child.prop))&&(tableData.value[0][child.prop]===undefined))))||oldHide
|
||||
const prH=hideColumns.value.indexOf(item.prop)
|
||||
item.hide?(prH===-1?hideColumns.value.push(item.prop):''):(prH!==-1&&hideCols.value.indexOf(item.prop)===-1?hideColumns.value.splice(prH,1):'')
|
||||
@@ -750,6 +750,14 @@ const getTableData = async (isLoading = true) => {
|
||||
let item=tableOption.value.column[key]
|
||||
item.hide=hides.includes(item.prop)||hideColumns.value.includes(item.prop)
|
||||
})
|
||||
Object.keys(tableOption.value.column).forEach(key=>{
|
||||
const showCols=Object.values(tableOption.value.column).filter(item=>!item.hide)
|
||||
let item=tableOption.value.column[key]
|
||||
item.children?'':(item.width=showCols.length<14?undefined:item.widthOld)
|
||||
item.children?.forEach(child=>{
|
||||
child.width=showCols.length<14?undefined:child.widthOld
|
||||
})
|
||||
})
|
||||
resolve(data.records)
|
||||
} finally {
|
||||
if (isLoading) loading.value = false
|
||||
@@ -884,6 +892,9 @@ defineExpose({
|
||||
.el-table__body tr.hover-row>td.el-table__cell{
|
||||
background-color: #FFFFD2;
|
||||
}
|
||||
&.el-table--enable-row-hover .el-table__body tr:hover>td.el-table__cell{
|
||||
background-color: #FFFFD2;
|
||||
}
|
||||
td.el-table__cell,th.el-table__cell{
|
||||
border-bottom: 1px solid #000 !important;
|
||||
|
||||
@@ -891,6 +902,9 @@ defineExpose({
|
||||
|
||||
}
|
||||
--el-table-border-color: #000;
|
||||
tfoot .el-table__cell{
|
||||
border-top: 1px solid #000 !important;
|
||||
}
|
||||
}
|
||||
|
||||
.lastAmountRow{
|
||||
|
||||
Reference in New Issue
Block a user