// 紧急程度
export const URGENT_DEGREE = [
  {label: '一般', value: 'usual'},
  {label: '紧急', value: 'urgent'}
]

// 是否定时发布
export const SCHEDULED_RELEASE = [
  {label: '是', value: 1},
  {label: '否', value: 0}
]

// 公告状态
export const NOTICE_STATUS = [
  {label: '已发布', value: 'published'},
  {label: '待发布', value: 'waitPublish'}
]

// 投诉状态
export const COMPLAINT_STATUS = [
  {label: '待处理', value: 'waitPending'},
  {label: '处理中', value: 'pending'},
  {label: '处理完成', value: 'finish'}
]

// 与业主关系
export const RELATION_SHIP = [
  {label: '本人', value: 'self'},
  {label: '租户', value: 'tenant'},
  {label: '亲人', value: 'relative'},
  {label: '朋友', value: 'friend'},
  {label: '其他', value: 'other'}
]

/**
 * 翻译字段值对应的文本
 * @param children
 * @returns string
 */
export function filterDictTextByStatic(dictList, value) {
  if(!dictList || dictList.length === 0){
    return;
  }
  return dictList.find(item=>item.value === value).label
}