基本类型数据封装

export const sexList = [
  {
    dictId:0,
    dictName:'男',
    dictValue:'0',
    dictType:'sex',
    dictyDescription:'性别'
  },
  {
    dictId:0,
    dictName:'男',
    dictValue:'0',
    dictType:'sex',
    dictyDescription:'性别'
  },
]
/**
* @method 性别格式化
* @param  {Object} row 表格的一行数据
* @return {String} 名称
*/
function sexFormat(row) {
  if (row.sex === null || row.sex === undefined || row.sex === "") return
  const obj = sexList.find(
    e => e.dictValue === row.sex.toString()
  )
  return obj == null ? '' : obj.dictName
}
posted @ 2021-06-15 16:43  云霄紫潭  阅读(81)  评论(0编辑  收藏  举报