import { ref } from '@vue/reactivity'

export const yesOrNo = [
  { code: '', name: '' },
  { code: '1', name: '是' },
  { code: '2', name: '否' },
]
export const haveOrNot = [
  { code: '', name: '' },
  { code: '1', name: '无' },
  { code: '2', name: '有' },
]
export const searchMethods = [
  { code: 'alpha', name: '拼音' },
  { code: 'code', name: '编码' },
  { code: 'name', name: '名称' },
]
export const autopsies = [
  { code: '', name: '' },
  { code: '1', name: '是' },
  { code: '2', name: '否' },
]
export function initShowDel() {
  return ref([
    false,
    false,
    false,
    false,
    false,
    false,
    false,
    false,
    false,
    false,
    false,
    false,
    false,
    false,
    false,
    false,
    false,
    false,
    false,
    false,
    false,
    false,
    false,
    false,
    false,
    false,
    false,
  ])
}
export function filterDismissStatus(val) {
  switch (val) {
    case 1:
    case '1':
      return '治愈'
    case 2:
    case '2':
      return '好转'
    case 3:
    case '3':
      return '未愈'
    case 4:
    case '4':
      return '死亡'
    case 9:
    case '9':
      return '其他'
    default:
      return ''
  }
}
export function clone(obj) {
  const ret = {}
  for (let k in obj) {
    ret[k] = obj[k]
  }
  return ret
}
