let baseFmt = (list, value) => {
  let idx = list.findIndex(v => v.code === value);
  return idx === -1 ? ' X ' : list[idx].label + ' [' + list[idx].code + ']';
}

let respCode = [
  {
    code: "000000",
    label: "请求处理成功"
  },
  {
    code: "000100",
    label: "用户会话超时"
  },
  {
    code: "000200",
    label: "安全服务错误"
  },
  {
    code: "000300",
    label: "校验服务错误"
  },
  {
    code: "000400",
    label: "系统后台错误"
  },
  {
    code: "000500",
    label: "网络服务错误"
  }
];
let respCodeFmt = (row, col, value) => baseFmt(respCode, value);
let respCodeSimpleFmt = (value) => respCodeFmt(null, null, value);

let actType = [
  {
    code: "1",
    label: "HTTP"
  },
  {
    code: "2",
    label: "MQ"
  }
];
let actTypeFmt = (row, col, value) => baseFmt(actType, value);
let actTypeSimpleFmt = (value) => actTypeFmt(null, null, value);


export default {
  respCode, respCodeFmt, respCodeSimpleFmt,
  actType, actTypeFmt, actTypeSimpleFmt
}