import { Input, InputNumber, Switch, Select } from 'element-ui'
export const nameMap = {
  uiConfig: '页面配置',
  cardReaderConfig: '读卡器配置',
  checkerConfig: '检票配置',
  faceConfig: '人脸配置',
  gateConfig: '闸机配置',
  serverConfig: '后台配置',
  terminalUpgrade: '终端升级'
}
export const nameMap_terminal = {
  uiConfig: '页面配置',
  cardReaderConfig: '读卡器配置',
  checkerConfig: '检票配置',
  faceConfig: '人脸配置',
  gateConfig: '闸机配置',
  serverConfig: '后台配置'
}

export const typeMap = {
  // 页面配置 uiConfig
  scene: { type: Select, label: '场景选择', options: [{ label: '横屏闸机', value: 'Gate' }, { label: '竖屏闸机', value: 'VGate' }, { label: '人脸机', value: 'Face' }] },
  backgroundUrl: { type: Input, label: '背景图片地址' },
  showIP: { type: Switch, label: '是否显示IP' },
  showTopBar: { type: Switch, label: '是否显示顶栏' },
  showBottomBar: { type: Switch, label: '是否显示底栏' },
  showInNumber: { type: Switch, label: '是否显示进闸人数' },
  showOutNumber: { type: Switch, label: '是否显示出闸人数' },
  title: { type: Input, label: '主标题' },
  subTitle: { type: Input, label: '副标题' },
  tipInfo: { type: Input, label: '提示信息' },
  // 后台配置 serverConfig
  hostUrl: { type: Input, label: '票务线下服务器地址' },
  configUrl: { type: Input, label: '网络配置文件地址' },
  upgradeUrl: { type: Input, label: '网络升级文件地址' },
  projectCode: { type: Input, label: '项目代码' },
  // 人脸配置 faceConfig
  cameraFacing: { type: Select, label: '摄像头选择', options: [{ label: '前置', value: 0 }, { label: '后置', value: 1 }] },
  faceAreaScale: { type: InputNumber, label: '人脸区域占比 (0-1)', precision: '1' },
  faceDelayTime: { type: InputNumber, label: '人脸识别的间隔 (ms)' },
  mirrorCamera: { type: Switch, label: '摄像头画面是否镜像显示' },
  // 检票配置 checkerConfig
  isVoiceOn: { type: Switch, label: '是否开启语音播报' },
  sameInfoDelayTime: { type: InputNumber, label: '相同信息检票延时 (ms)' },
  successDelayTime: { type: InputNumber, label: '检票成功延时 (ms)' },
  checkMode: { type: Select, label: '检票模式', options: [{ label: '开闸销票', value: 'CancelFirst' }, { label: '过闸销票', value: 'CheckFirst' }, { label: '只验票不销票', value: 'CheckOnly' }] },
  faceCheckMode: { type: Select, label: '人脸检票模式', options: [{ label: '人脸检票', value: 'FaceCheck' }, { label: '出口人脸绑定', value: 'FaceBind' }] },
  isCheckIDFace: { type: Switch, label: '是否开启人证比对' },
  idCardFaceThreshold: { type: InputNumber, label: '人证比对比对阈值（0-1）', precision: '1' },
  checkIDFaceTimeout: { type: InputNumber, label: '人证比对超时时间（ms）' },
  isComboCheck: { type: Switch, label: '是否开启组合检票人脸比对' },
  comboCheckFaceThreshold: { type: InputNumber, label: '组合检票人脸比对阈值（0-1）', precision: '1' },
  comboCheckVerifyTimeout: { type: InputNumber, label: '组合检票人脸比对超时时间（ms）' },
  fingerType: { type: Input, label: '指纹比对类别', disabled: true },
  isFastMode: { type: Switch, label: '是否开启快速模式' },
  qrCodeCheckMode: { type: Input, label: '二维码检票模式', disabled: true },
  // 闸机配置 gateConfig
  gateType: { type: Select, label: '闸机类型', options: [{ label: 'DB485闸机', value: 'DEBAO_485' }, { label: 'DB继电器闸机', value: 'DEBAO_RELAY' }, { label: 'JM闸机', value: 'JIEMAN' }] },
  isGateReverse: { type: Switch, label: '调换出入口' },
  gateOpenOverTime: { type: InputNumber, label: '实际闸机超时时间（ms）' },
  gateSerialPath: { type: Input, label: '闸机的串口地址' },
  isGateHasResponse: { type: Switch, label: '闸机是否有反馈' },
  isThreeRollerGate: { type: Switch, label: '闸机是不是三辊闸' },
  // 读卡器配置 cardReaderConfig
  cardReaderType: { type: Select, label: '读卡器类型', options: [{ label: '中控IDM40', value: 'ZK_IDM40' }, { label: '东信EST100', value: 'EST100' }, { label: '串口读卡器', value: 'SERIAL' }, { label: '远景达读卡器', value: 'YJD' }] },
  cardReaderSerialPath: { type: Input, label: '读卡器的串口地址' },
  // 网络配置 networkConfig
  userStaticIP: { type: Switch, label: '是否使用静态地址' },
  ip: { type: Input, label: '静态地址IP' },
  gateway: { type: Input, label: '静态地址网关' },
  dns1: { type: Input, label: '静态地址DNS1' },
  dns2: { type: Input, label: '静态地址DNS2' },
  netmask: { type: Input, label: '静态地址子网掩码' },
  // 终端升级 terminalUpgrade
  versionCode: { type: Input, label: '版本代码', disabled: true },
  versionName: { type: Input, label: '版本名称', disabled: true },
  packageName: { type: Input, label: '包名称', disabled: true },
  downloadUrl: { type: Input, label: '下载地址' }

}
