data() {
return {
columns: [],
defColumns: [],
}
},
methods:{
//初始表头、列显示隐藏 根据自己的需要去改
columnsa() {
this.columns = [{
title: '',
children: [{
title: "",
key: 'rowIndex',
scopedSlots: {
customRender: "sort"
},
align: 'center',
width: 80
}, {
title: '费用支付公司',
dataIndex: 'fcompanyName',
align: 'left',
width: 150,
customRender: (text, row, index) => {
return {
children: `${text}`,
attrs: {
rowSpan: row.fcompanyNameRowSpan
}
}
}
}, {
title: '费用支付部门',
dataIndex: 'fcostCenterName',
align: 'left',
width: 120,
customRender: (text, row, index) => {
return {
children: `${text}`,
attrs: {
rowSpan: row.fcostCenterNameRowSpan
}
}
}
},
{
title: '项目',
dataIndex: 'fprojectName',
align: 'left',
width: 120,
}, {
title: '业务类别',
dataIndex: 'foperationTypeName',
align: 'left',
width: 120,
},
{
title: '费用类型',
dataIndex: 'fexpenseTypeName',
align: 'left',
width: 120,
}
]
}];
this.defColumns = [{
title: '',
children: [{
title: "",
key: 'rowIndex',
scopedSlots: {
customRender: "sort"
},
align: 'center',
width: 80
}]
}];
//列显示隐藏
let wdkey = Vue.ls.get('wdkey')
this.columns[0].children.map((item, index) => {
wdkey.map((em, dex) => {
if (em == item.dataIndex) {
this.defColumns[0].children.push(item)
}
})
})
return this.defColumns
},
}
antd vue 初始表头、列显示隐藏
最新推荐文章于 2024-06-05 15:34:38 发布