if (this.batchRule.extendOne === 1) {
this.columns[20].visible = true
}
if (this.batchRule.extendTwo === 1) {
this.columns[21].visible = true
}
if (this.batchRule.extendThree === 1) {
this.columns[22].visible = true
}
if (this.batchRule.extendFour === 1) {
this.columns[20].visible = true
}
if (this.batchRule.extendFive === 1) {
this.columns[21].visible = true
}
if (this.batchRule.extendSix === 1) {
this.columns[22].visible = true
}
this.columns[20].visible = this.batchRule.extendOne === 1 || this.batchRule.extendFour === 1
this.columns[21].visible = this.batchRule.extendTwo === 1 || this.batchRule.extendFive === 1
this.columns[22].visible = this.batchRule.extendThree === 1 || this.batchRule.extendSix === 1
如有帮助,麻烦点个【采纳此答案】 谢谢啦^.^
const batchRule = Object.getOwnPropertyNames(res.data.batchRule)
this.tableConfig.columns.forEach((item) => {
if (batchRule.includes(item.field)) item.visible = true
})