二级表头隐藏规则添加 报表平铺判断报错阻塞修复
This commit is contained in:
@@ -816,6 +816,13 @@ const getTableData = async (isLoading = true) => {
|
|||||||
Object.values(tableOption.value.column).forEach( item=>{
|
Object.values(tableOption.value.column).forEach( item=>{
|
||||||
let oldHide=hideCols.value.indexOf(item.prop)!==-1
|
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
|
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
|
||||||
|
if(item.children){
|
||||||
|
item.children.forEach(child=>{
|
||||||
|
child.hide=(!['yearplan','yearrate'].includes(child.prop))&&(tableData.value[0][child.prop]===undefined)
|
||||||
|
const prH=hideColumns.value.indexOf(child.prop)
|
||||||
|
child.hide?(prH===-1?hideColumns.value.push(child.prop):''):(prH!==-1&&hideCols.value.indexOf(child.prop)===-1?hideColumns.value.splice(prH,1):'')
|
||||||
|
})
|
||||||
|
}
|
||||||
const prH=hideColumns.value.indexOf(item.prop)
|
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):'')
|
item.hide?(prH===-1?hideColumns.value.push(item.prop):''):(prH!==-1&&hideCols.value.indexOf(item.prop)===-1?hideColumns.value.splice(prH,1):'')
|
||||||
})
|
})
|
||||||
@@ -845,6 +852,11 @@ const getTableData = async (isLoading = true) => {
|
|||||||
}
|
}
|
||||||
Object.keys(tableOption.value.column).forEach(key=>{
|
Object.keys(tableOption.value.column).forEach(key=>{
|
||||||
let item=tableOption.value.column[key]
|
let item=tableOption.value.column[key]
|
||||||
|
if(item.children){
|
||||||
|
item.children.forEach(child=>{
|
||||||
|
child.hide=hides.includes(child.prop)||hideColumns.value.includes(child.prop)
|
||||||
|
})
|
||||||
|
}
|
||||||
item.hide=hides.includes(item.prop)||hideColumns.value.includes(item.prop)
|
item.hide=hides.includes(item.prop)||hideColumns.value.includes(item.prop)
|
||||||
})
|
})
|
||||||
const liveWidthCol={
|
const liveWidthCol={
|
||||||
@@ -856,7 +868,7 @@ const getTableData = async (isLoading = true) => {
|
|||||||
const showCols=Object.values(tableOption.value.column).filter(item=>!item.hide)
|
const showCols=Object.values(tableOption.value.column).filter(item=>!item.hide)
|
||||||
|
|
||||||
let item=tableOption.value.column[key]
|
let item=tableOption.value.column[key]
|
||||||
item.children?'':(item.width=showCols.length<14&&!liveWidthCol[props.reportCode].includes(item.label)?undefined:item.widthOld)
|
item.children?'':(item.width=showCols.length<14&&(!liveWidthCol[props.reportCode]?.includes(item.label))?undefined:item.widthOld)
|
||||||
item.children?.forEach(child=>{
|
item.children?.forEach(child=>{
|
||||||
child.width=showCols.length<14?undefined:child.widthOld
|
child.width=showCols.length<14?undefined:child.widthOld
|
||||||
})
|
})
|
||||||
|
|||||||
Reference in New Issue
Block a user