export const YYYYMMDDHHmmss = "YYYY-MM-DD HH:mm:ss";
export const PLATFORM = "WEB";

if (!localStorage.getItem("deviceId")) {
  localStorage.setItem("deviceId", Math.random() + "-" + Date.now());
}
export const DEVICE_ID = localStorage.getItem("deviceId");

export const INVIGILATOR_IMPORT_TEMPLATE_DOWNLOAD_URL =
  "http://qmth-test.oss-cn-shenzhen.aliyuncs.com/file/考场监考老师导入.xlsx";
export const EXAM_STUDENT_IMPORT_TEMPLATE_DOWNLOAD_URL =
  "http://qmth-test.oss-cn-shenzhen.aliyuncs.com/file/考生导入_在线考试.xlsx";

// 交卷方式
export const STUDENT_FINISH_EXAM_TYPE = {
  MANUAL: "手动交卷",
  AUTO: "自动交卷",
  BREACH: "违纪交卷",
  INTERRUPT: "监考强制交卷",
};
// 是 / 否
export const BOOLEAN_TYPE = {
  0: "否",
  1: "是",
};
// 审核状态
export const AUDITING_STATUS = {
  0: "通过",
  1: "不通过",
};
// 是 / 否
export const BOOLEAN_INVERSE_TYPE = {
  1: "否",
  0: "是",
};
// 视频流类型
export const VIDEO_SOURCE_TYPE = {
  CLIENT_CAMERA: "电脑摄像头",
  CLIENT_SCREEN: "电脑屏幕",
  MOBILE_FIRST: "手机主机位",
  MOBILE_SECOND: "手机辅机位",
};
// 考生在线状态
export const STUDENT_ONLINE_STATUS = {
  FIRST_PREPARE: "已待考",
  EXAMING: "考试中",
  BREAK_OFF: "通讯故障",
};
// 推流通讯
export const STUDENT_EXAM_STATUS = {
  FIRST_PREPARE: "首次候考",
  ANSWERING: "正在答题",
  BREAK_OFF: "",
  RESUME_PREPARE: "",
  FINISHED: "",
  PERSISTED: "",
};
// 违纪、缺考
export const STUDENT_BEHAVIOR_STATUS = {
  0: "违纪",
  1: "正常",
};
// 违规类型
export const BREACH_REASON_TYPE = {
  PLAGIARIZE: "夹带抄袭",
  LOOK_AROUND: "左顾右盼",
  ILLEGAL_ITEMS: "考中携带违规物品",
  TAKER: "他人替考",
  ASSISTANCE: "他人协助作答",
  BLACK_LIST_SOFTWARE: "考中使用违规（远程协助、直播等）软件",
  OTHER: "其他",
};
// 违规撤销原因
export const BREACH_REPEAL_TYPE = {
  SOFTWARE_MISSING: "软件误操作",
  INCONSISTENT_FACTS: "违规事实不符",
  CANCEL_OTHER: "其他",
};
// 异常状态
export const EXCEPTION_TYPE = {
  NET_TIME_OUT: "软件误操作",
  MACHING_STOP: "机器硬件故障、死机",
  NET_TIME_BREAK: "网络断开",
  SOFTWARE_STOP: "软件故障",
  POWER_CUT: "停电",
  OTHER: "其他",
};
//
export const VERIFY_EXCEPTION_TYPE = {
  FACE_COUNT_ERROR: "人脸数量异常",
  FACE_COMPARE_ERROR: "人脸比对异常",
  EYE_CLOSE_ERROR: "闭眼检测异常",
  LIVENESS_ACTION_ERROR: "活检动作错误",
  NONE: "无异常",
  REALNESS: "真实性检测异常",
};
// 考试状态
export const EXAM_TYPE = {
  FIRST_START: "初次开考",
  RESUME_START: "恢复开考",
  IN_PROCESS: "过程中",
};
// 审阅状态
export const APPROVE_STATUS = {
  0: "未审阅",
  1: "已审阅",
};
// 重考方式
export const REEXAM_TYPE = {
  0: "批次内",
  1: "换批次",
};
// 重考原因
export const REEXAM_REASON = {
  EXCEPTION_TIME_OUT: "异常处理时效过期",
  BREAK_TIME_OUT: "断点续考次数用完",
  INVIGILATE_MISS: "监考人员误操作",
};
// 通讯状态
export const CLIENT_WEBSOCKET_STATUS = {
  ON_LINE: 1,
  OFF_LINE: 0,
};
// 推流通讯
export const MONITOR_STATUS_SOURCE = {
  INIT: 1,
  STOP: 0,
  START: 1,
  FINISH: 0,
};

export const IMPORT_EXPORT_TASKS = [
  { code: "CALCULATE_EXAM_SCORE", name: "考试重新算分" },
  { code: "IMPORT_EXAM_STUDENT", name: "导入考生" },
  { code: "IMPORT_EXAM_PAPER", name: "导入试卷" },
  { code: "IMPORT_INVIGILATE_USER", name: "导入监考员" },
  { code: "EXPORT_INVIGILATE_USER", name: "导出监考员" },
  { code: "EXPORT_EXAM_STUDENT", name: "导出考生" },
  { code: "EXPORT_MARK_RESULT_SIMPLE", name: "导出成绩简版" },
  { code: "EXPORT_MARK_RESULT_STANDARD", name: "导出成绩标准版" },
];

let domain;
if (process.env.VUE_APP_SELF_DEFINE_DOMAIN === "true") {
  domain = window.localStorage.getItem("domain_in_url");
}
if (!domain) domain = window.location.hostname.split(".")[0];
export const ORG_CODE = domain;
