table表格过滤处理

阅读 47

2022-03-12

HTML
<el-table>
 <el-table-column
  label="名字"
  align="center"
  prop="name"
  :formatter="gatewayTypeFormat"
>
</el-table-column>
</el-table>

JS
字典
this.getDicts('inip_get_type').then((res) => {
  this.getType = res.data;
})

gatewayTypeFormat(row, column) {
  return this.selectDictLabel(this.getType, row.name)
}

字典数据翻译
selectDictLabel(datas, value) {
 let actions = [];
 Object.keys(datas).some((key) => {
  if (datas[key].dictValue == ("" + value)) {
    return true;
   }
 })
 return actions.join('');
}

精彩评论(0)

0 0 举报