<template>
  <div class="default_content">
    <el-form
      ref="form"
      :rules="rules"
      :model="form"
      label-position="left"
      label-width="200px"
      style="margin-top: 10px"
    >
      <TagCard title="设备基本信息">
        <div class="wrap-content">
          <div class="wrap-content__item">
            <el-form-item label="模板名称" prop="templateName" required>
              <el-input
                v-model="form.templateName"
                placeholder="请输入模板名称"
              />
            </el-form-item>
          </div>
          <div class="wrap-content__item">
            <el-form-item label="应用类型" prop="applicationTypeId">
              <el-select
                v-model="form.applicationTypeId"
                placeholder="请选择应用类型"
                style="width: 100%"
                filterable
              >
                <el-option
                  v-for="(item, index) in applicationList"
                  :key="index"
                  :label="item.applicationType"
                  :value="item.applicationTypeId"
                />
              </el-select>
            </el-form-item>
          </div>
          <div class="wrap-content__item">
            <el-form-item
              label="设备型号（硬件）"
              prop="deviceModelHardwareId"
            >
              <el-select
                v-model="form.deviceModelHardwareId"
                placeholder="请选择设备型号（硬件）"
                style="width: 100%"
                filterable
              >
                <el-option
                  v-for="(item, index) in deviceList"
                  :key="index"
                  :label="item.deviceModel"
                  :value="item.deviceModelId"
                />
              </el-select>
            </el-form-item>
          </div>
        </div>
      </TagCard>
      <TagCard title="使用配置">
        <div class="wrap-content">
          <div class="wrap-content__item">
            <el-form-item label="使用时间期限" prop="expirationDate">
              <el-date-picker
                v-model="form.expirationDate"
                value-format="yyyy-MM-dd"
                type="date"
                style="width: 100%"
                placeholder="请选择使用时间期限"
              />
            </el-form-item>
          </div>
        </div>
      </TagCard>
      <TagCard title="百度人脸激活配置">
        <div class="wrap-content">
          <div class="wrap-content__item">
            <el-form-item label="激活序列号" prop="licenseOnlineKey">
              <el-input
                v-model="form.licenseOnlineKey"
                placeholder="请输入激活序列号"
              />
            </el-form-item>
          </div>
        </div>
      </TagCard>
      <TagCard title="应用配置">
        <div class="wrap-content">
          <div class="wrap-content__item">
            <el-form-item label="应用通信模式" prop="communicationMode">
              <el-select
                v-model="form.communicationMode"
                placeholder="请选择应用通信模式"
                style="width: 100%"
                @input="onSelectChange('communicationMode', $event)"
              >
                <el-option
                  v-for="item in communicationList"
                  :key="item.id"
                  :label="item.name"
                  :value="item.id"
                />
              </el-select>
            </el-form-item>
          </div>
          <div v-if="form.communicationMode == 2" class="wrap-content__item">
            <el-form-item
              label="WEBSOCKET地址"
              prop="wsAddress"
            >
              <el-input
                v-model="form.wsAddress"
                placeholder="请输入WEBSOCKET地址"
                maxlength="300"
                show-word-limit
              />
            </el-form-item>
          </div>
          <div v-else-if="form.communicationMode == 3" class="wrap-content__item">
            <el-form-item
              label="SERIALPORT地址"
              prop="communicationSerialPort"
            >
              <el-input
                v-model="form.communicationSerialPort"
                placeholder="请输入SERIALPORT地址"
                maxlength="300"
                show-word-limit
              />
            </el-form-item>
          </div>
          <div v-else class="wrap-content__item" />
          <div class="wrap-content__item">
            <el-form-item label="校验模式" prop="linkageCheckMode">
              <el-radio-group v-model="form.linkageCheckMode">
                <el-radio :label="1">通用</el-radio>
                <el-radio :label="2">预检查模式</el-radio>
              </el-radio-group>
            </el-form-item>
          </div>
        </div>
      </TagCard>
      <TagCard title="采集配置">
        <div class="wrap-content">
          <div class="wrap-content__item">
            <el-form-item label="启用身份证功能" prop="useIdcard">
              <el-radio-group
                v-model="form.useIdcard"
                @input="onSelectChange('useIdcard', $event)"
              >
                <el-radio :label="true">是</el-radio>
                <el-radio :label="false">否</el-radio>
              </el-radio-group>
            </el-form-item>
          </div>
          <div v-if="form.useIdcard" class="wrap-content-detail" style="background: #dcdfe63d;">
            <div class="wrap-content-detail__item">
              <el-form-item
                label="身份证阅读器品牌"
                prop="idCardReaderBrand"
              >
                <el-select
                  v-model="form.idCardReaderBrand"
                  placeholder="请选择"
                  style="width: 100%"
                  clearable
                >
                  <el-option
                    v-for="(item, index) in brandList"
                    :key="index.code"
                    :label="item.desc"
                    :value="item.code"
                  />
                </el-select>
              </el-form-item>
            </div>
            <div class="wrap-content-detail__item">
              <el-form-item label="是否解析身份证照片" prop="analysisPhoto">
                <el-radio-group v-model="form.analysisPhoto">
                  <el-radio :label="1">是</el-radio>
                  <el-radio :label="0">否</el-radio>
                </el-radio-group>
              </el-form-item>
            </div>
            <div class="wrap-content-detail__item">
              <el-form-item label="是否解析身份证指纹" prop="analysisFingerprint">
                <el-radio-group v-model="form.analysisFingerprint">
                  <el-radio :label="1">是</el-radio>
                  <el-radio :label="0">否</el-radio>
                </el-radio-group>
              </el-form-item>
            </div>
            <div class="wrap-content-detail__item">
              <el-form-item label="是否人证比对" prop="usePersonCard">
                <el-radio-group v-model="form.usePersonCard">
                  <el-radio :label="true">是</el-radio>
                  <el-radio :label="false">否</el-radio>
                </el-radio-group>
              </el-form-item>
            </div>
            <div class="wrap-content-detail__item">
              <el-form-item label="同证间隔时间(s)" prop="idCardInterval">
                <el-input-number
                  v-model="form.idCardInterval"
                  size="mini"
                  :max="20"
                  :min="0"
                />
              </el-form-item>
            </div>
          </div>
          <div v-else class="wrap-content__item" />

          <div class="wrap-content__item">
            <el-form-item label="启用二维码功能" prop="useQrcode">
              <el-radio-group
                v-model="form.useQrcode"
                @input="onSelectChange('useQrcode', $event)"
              >
                <el-radio :label="true">是</el-radio>
                <el-radio :label="false">否</el-radio>
              </el-radio-group>
            </el-form-item>
          </div>
          <div v-if="form.useQrcode" class="wrap-content-detail" style="background: #dcdfe63d;">
            <div class="wrap-content-detail__item">
              <el-form-item
                label="二维码读头品牌"
                prop="qrCodeReaderBrand"
              >
                <el-select
                  v-model="form.qrCodeReaderBrand"
                  placeholder="请选择"
                  style="width: 100%"
                  clearable
                >
                  <el-option
                    v-for="(item, index) in qrBrandList"
                    :key="index.code"
                    :label="item.desc"
                    :value="item.code"
                  />
                </el-select>
              </el-form-item>
            </div>
            <div class="wrap-content-detail__item" />
            <div class="wrap-content-detail__item">
              <el-form-item label="二维码读头通信方式" prop="qrCodeReaderCommunicationMode">
                <el-radio-group
                  v-model="form.qrCodeReaderCommunicationMode"
                  @input="onSelectChange('qrCodeReaderCommunicationMode', $event)"
                >
                  <el-radio :label="1">虚拟串口</el-radio>
                  <el-radio :label="2">串口</el-radio>
                  <el-radio :label="3">虚拟键盘</el-radio>
                </el-radio-group>
              </el-form-item>
            </div>
            <div v-if="form.qrCodeReaderCommunicationMode == '2'" class="wrap-content-detail__item">
              <el-form-item label="二维码读头串口地址" prop="qrCodeReaderSerialPort">
                <el-input
                  v-model="form.qrCodeReaderSerialPort"
                  placeholder="请输入二维码读头串口地址"
                  maxlength="300"
                  show-word-limit
                />
              </el-form-item>
            </div>
            <div v-else class="wrap-content-detail__item" />
            <div class="wrap-content-detail__item">
              <el-form-item label="同码间隔时间(s)" prop="qrCodeInterval">
                <el-input-number
                  v-model="form.qrCodeInterval"
                  size="mini"
                  :max="20"
                  :min="0"
                />
              </el-form-item>
            </div>
            <div class="wrap-content-detail__item">
              <el-form-item label="是否人证比对" prop="qrCodeUsePersonCard">
                <el-radio-group v-model="form.qrCodeUsePersonCard">
                  <el-radio :label="true">是</el-radio>
                  <el-radio :label="false">否</el-radio>
                </el-radio-group>
              </el-form-item>
            </div>
          </div>
          <div v-else class="wrap-content__item" />

          <div class="wrap-content__item">
            <el-form-item label="启用IC卡ISO14443A功能" prop="ic14443IcCardFunction">
              <el-radio-group
                v-model="form.ic14443IcCardFunction"
                @input="onSelectChange('ic14443IcCardFunction', $event)"
              >
                <el-radio :label="true">是</el-radio>
                <el-radio :label="false">否</el-radio>
              </el-radio-group>
            </el-form-item>
          </div>
          <div v-if="form.ic14443IcCardFunction" class="wrap-content-detail" style="background: #dcdfe63d;">
            <div class="wrap-content-detail__item">
              <el-form-item
                label="阅读器品牌"
                prop="ic14443ReaderBrand"
              >
                <el-select
                  v-model="form.ic14443ReaderBrand"
                  placeholder="请选择"
                  style="width: 100%"
                  clearable
                >
                  <el-option
                    v-for="(item, index) in readerBrandList"
                    :key="index.code"
                    :label="item.desc"
                    :value="item.code"
                  />
                </el-select>
              </el-form-item>
            </div>
            <div class="wrap-content-detail__item">
              <el-form-item label="读取扇区(0-99)" prop="ic14443ReaderSectorNumbers">
                <el-input-number
                  v-model="form.ic14443ReaderSectorNumbers"
                  size="mini"
                  :max="99"
                  :min="0"
                />
              </el-form-item>
            </div>
            <div class="wrap-content-detail__item">
              <el-form-item label="读取块" prop="ic14443ReaderBlock">
                <template #label>
                  读取块
                  <el-tooltip class="item" effect="dark" content="数字用英文逗号隔开，如： 0,1,2,3" placement="top">
                    <svg-icon icon-class="question" />
                  </el-tooltip>
                </template>
                <el-input
                  v-model="form.ic14443ReaderBlock"
                  placeholder="请输入读取块"
                  maxlength="100"
                  show-word-limit
                />
              </el-form-item>
            </div>
            <div class="wrap-content-detail__item">
              <el-form-item label="读取密钥" prop="ic14443ReaderKey">
                <el-input
                  v-model="form.ic14443ReaderKey"
                  placeholder="请输入读取密钥"
                  maxlength="100"
                  show-word-limit
                />
              </el-form-item>
            </div>
            <div class="wrap-content-detail__item">
              <el-form-item label="起始偏移量(0-100)" prop="ic14443StartOffset">
                <el-input-number
                  v-model="form.ic14443StartOffset"
                  size="mini"
                  :max="100"
                  :min="0"
                />
              </el-form-item>
            </div>
            <div class="wrap-content-detail__item">
              <el-form-item label="末尾偏移量(0-100)" prop="ic14443EndOffset">
                <el-input-number
                  v-model="form.ic14443EndOffset"
                  size="mini"
                  :max="100"
                  :min="0"
                />
              </el-form-item>
            </div>
            <div class="wrap-content-detail__item">
              <el-form-item label="是否人证比对" prop="ic14443PersonCardComparison">
                <el-radio-group v-model="form.ic14443PersonCardComparison">
                  <el-radio :label="true">是</el-radio>
                  <el-radio :label="false">否</el-radio>
                </el-radio-group>
              </el-form-item>
            </div>
            <div class="wrap-content-detail__item">
              <el-form-item label="同卡间隔时间(s)" prop="ic14443SameCardIntervalTime">
                <el-input-number
                  v-model="form.ic14443SameCardIntervalTime"
                  size="mini"
                  :max="20"
                  :min="0"
                />
              </el-form-item>
            </div>
          </div>
          <div v-else class="wrap-content__item" />

          <div class="wrap-content__item">
            <el-form-item label="启用IC卡ISO15693功能" prop="ic15693IcCardFunction">
              <el-radio-group
                v-model="form.ic15693IcCardFunction"
                @input="onSelectChange('ic15693IcCardFunction', $event)"
              >
                <el-radio :label="true">是</el-radio>
                <el-radio :label="false">否</el-radio>
              </el-radio-group>
            </el-form-item>
          </div>
          <div v-if="form.ic15693IcCardFunction" class="wrap-content-detail" style="background: #dcdfe63d;">
            <div class="wrap-content-detail__item">
              <el-form-item
                label="身份证阅读器品牌"
                prop="ic15693ReaderBrand"
              >
                <el-select
                  v-model="form.ic15693ReaderBrand"
                  placeholder="请选择"
                  style="width: 100%"
                  clearable
                >
                  <el-option
                    v-for="(item, index) in readerBrandList"
                    :key="index.code"
                    :label="item.desc"
                    :value="item.code"
                  />
                </el-select>
              </el-form-item>
            </div>
            <div class="wrap-content-detail__item">
              <el-form-item label="读取块" prop="ic15693ReaderBlock">
                <template #label>
                  读取块
                  <el-tooltip class="item" effect="dark" content="数字用英文逗号隔开，如： 0,1,2,3" placement="top">
                    <svg-icon icon-class="question" />
                  </el-tooltip>
                </template>
                <el-input
                  v-model="form.ic15693ReaderBlock"
                  placeholder="请输入读取块"
                  maxlength="100"
                  show-word-limit
                />
              </el-form-item>
            </div>
            <div class="wrap-content-detail__item">
              <el-form-item label="起始偏移量(0-100)" prop="ic15693StartOffset">
                <el-input-number
                  v-model="form.ic15693StartOffset"
                  size="mini"
                  :max="100"
                  :min="0"
                />
              </el-form-item>
            </div>
            <div class="wrap-content-detail__item">
              <el-form-item label="末尾偏移量(0-100)" prop="ic15693EndOffset">
                <el-input-number
                  v-model="form.ic15693EndOffset"
                  size="mini"
                  :max="100"
                  :min="0"
                />
              </el-form-item>
            </div>
            <div class="wrap-content-detail__item">
              <el-form-item label="是否人证比对" prop="ic15693PersonCardComparison">
                <el-radio-group v-model="form.ic15693PersonCardComparison">
                  <el-radio :label="true">是</el-radio>
                  <el-radio :label="false">否</el-radio>
                </el-radio-group>
              </el-form-item>
            </div>
            <div class="wrap-content-detail__item">
              <el-form-item label="同卡间隔时间(s)" prop="ic15693SameCardIntervalTime">
                <el-input-number
                  v-model="form.ic15693SameCardIntervalTime"
                  size="mini"
                  :max="20"
                  :min="0"
                />
              </el-form-item>
            </div>
          </div>
          <div v-else class="wrap-content__item" />

          <div class="wrap-content__item">
            <el-form-item label="刷证/刷码/刷卡延时(ms)" prop="openDelayTime">
              <el-input-number
                v-model="form.openDelayTime"
                size="mini"
                :min="0"
              />
            </el-form-item>
          </div>
          <div class="wrap-content__item" />
          <div class="wrap-content__item">
            <el-form-item label="启用护照机功能" prop="isOpenPassport">
              <el-radio-group v-model="form.isOpenPassport">
                <el-radio :label="true">是</el-radio>
                <el-radio :label="false">否</el-radio>
              </el-radio-group>
            </el-form-item>
          </div>
          <div v-if="form.isOpenPassport" class="wrap-content-detail__item">
            <el-form-item label="是否人证比对" prop="passportUsePersonCard">
              <el-radio-group v-model="form.passportUsePersonCard">
                <el-radio :label="true">是</el-radio>
                <el-radio :label="false">否</el-radio>
              </el-radio-group>
            </el-form-item>
          </div>
          <div v-else class="wrap-content__item" />
          <template v-if="!suspensionIsNotVerified">
            <div class="wrap-content__item">
              <el-form-item label="是否启用手动输入证件号" prop="manualInIdCard">
                <el-radio-group v-model="form.manualInIdCard">
                  <el-radio :label="true">是</el-radio>
                  <el-radio :label="false">否</el-radio>
                </el-radio-group>
              </el-form-item>
            </div>
            <div v-if="form.manualInIdCard" class="wrap-content__item">
              <el-form-item label="是否人证比对" prop="manualInUsePersonCard">
                <el-radio-group v-model="form.manualInUsePersonCard">
                  <el-radio :label="true">是</el-radio>
                  <el-radio :label="false">否</el-radio>
                </el-radio-group>
              </el-form-item>
            </div>
            <div v-else class="wrap-content__item" />
          </template>
          <div class="wrap-content__item">
            <el-form-item label="是否开启 1:N 刷脸能力" prop="openOneToN">
              <el-radio-group v-model="form.openOneToN">
                <el-radio :label="true">是</el-radio>
                <el-radio :label="false">否</el-radio>
              </el-radio-group>
            </el-form-item>
          </div>
          <div v-if="form.openOneToN" class="wrap-content__item">
            <el-form-item label="同人脸间隔时间(s)" prop="sameFaceInterval">
              <el-input-number
                v-model="form.sameFaceInterval"
                size="mini"
                :min="0"
              />
            </el-form-item>
          </div>
        </div>
      </TagCard>
      <TagCard title="摄像头配置">
        <div class="wrap-content">
          <div class="wrap-content__item">
            <el-form-item label="摄像头类型" prop="cameraType">
              <el-radio-group v-model="form.cameraType">
                <el-radio
                  v-for="(item, index) in cameraTypeList"
                  :key="index.code"
                  :label="item.code"
                >{{ item.desc }}</el-radio>
              </el-radio-group>
            </el-form-item>
          </div>
          <div class="wrap-content__item" />
          <div class="wrap-content__item">
            <el-form-item label="预览画面角度(RGB)" prop="rgbVideoDirection">
              <el-select v-model="form.rgbVideoDirection" style="width: 100%" placeholder="请选择预览画面角度(RGB)">
                <el-option
                  v-for="(item, index) in previewAngleDropDown"
                  :key="index"
                  :label="item.value"
                  :value="item.key"
                />
              </el-select>
            </el-form-item>
          </div>
          <div class="wrap-content__item">
            <el-form-item label="预览画面是否镜像(RGB)" prop="mirrorVideoRGB">
              <el-radio-group
                v-model="form.mirrorVideoRGB"
              >
                <el-radio :label="1">是</el-radio>
                <el-radio :label="0">否</el-radio>
              </el-radio-group>
            </el-form-item>
          </div>
          <div class="wrap-content__item">
            <el-form-item label="人脸识别检测角度(RGB)" prop="rgbDetectDirection">
              <el-select v-model="form.rgbDetectDirection" style="width: 100%" placeholder="请选择人脸识别检测角度(RGB)">
                <el-option
                  v-for="(item, index) in previewAngleDropDown"
                  :key="index"
                  :label="item.value"
                  :value="item.key"
                />
              </el-select>
            </el-form-item>
          </div>
          <div class="wrap-content__item">
            <el-form-item label="人脸识别检测是否镜像(RGB)" prop="mirrorDetectRGB">
              <el-radio-group
                v-model="form.mirrorDetectRGB"
              >
                <el-radio :label="1">是</el-radio>
                <el-radio :label="0">否</el-radio>
              </el-radio-group>
            </el-form-item>
          </div>
          <div class="wrap-content__item">
            <el-form-item label="预览画面角度(NIR)" prop="nirVideoDirection">
              <el-select v-model="form.nirVideoDirection" style="width: 100%" placeholder="请选择预览画面角度(NIR)">
                <el-option
                  v-for="(item, index) in previewAngleDropDown"
                  :key="index"
                  :label="item.value"
                  :value="item.key"
                />
              </el-select>
            </el-form-item>
          </div>
          <div class="wrap-content__item">
            <el-form-item label="预览画面是否镜像(NIR)" prop="mirrorVideoNIR">
              <el-radio-group
                v-model="form.mirrorVideoNIR"
              >
                <el-radio :label="1">是</el-radio>
                <el-radio :label="0">否</el-radio>
              </el-radio-group>
            </el-form-item>
          </div>
          <div class="wrap-content__item">
            <el-form-item label="人脸识别检测角度(NIR)" prop="nirDetectDirection">
              <el-select v-model="form.nirDetectDirection" style="width: 100%" placeholder="请选择人脸识别检测角度(NIR)">
                <el-option
                  v-for="(item, index) in previewAngleDropDown"
                  :key="index"
                  :label="item.value"
                  :value="item.key"
                />
              </el-select>
            </el-form-item>
          </div>
          <div class="wrap-content__item">
            <el-form-item label="人脸识别检测是否镜像(NIR)" prop="mirrorDetectNIR">
              <el-radio-group
                v-model="form.mirrorDetectNIR"
              >
                <el-radio :label="1">是</el-radio>
                <el-radio :label="0">否</el-radio>
              </el-radio-group>
            </el-form-item>
          </div>
        </div>
      </TagCard>
      <TagCard title="识别配置">
        <div class="wrap-content">
          <div class="wrap-content__item">
            <el-form-item
              label="是否显示人脸跟随框"
              prop="faceFollowBoxSwitch"
              class="overlength"
            >
              <el-radio-group v-model="form.faceFollowBoxSwitch">
                <el-radio :label="true">是</el-radio>
                <el-radio :label="false">否</el-radio>
              </el-radio-group>
            </el-form-item>
          </div>
          <div v-if="form.faceFollowBoxSwitch" class="wrap-content__item">
            <el-form-item
              label="人脸跟随框是否镜像"
              prop="rgbRevert"
              class="overlength"
            >
              <el-radio-group v-model="form.rgbRevert">
                <el-radio :label="true">是</el-radio>
                <el-radio :label="false">否</el-radio>
              </el-radio-group>
            </el-form-item>
          </div>
          <div v-else class="wrap-content__item" />
          <div class="wrap-content__item">
            <el-form-item
              label="视频流是否开启最优人脸检测"
              prop="usingBestImage"
              class="overlength"
            >
              <el-radio-group v-model="form.usingBestImage">
                <el-radio :label="true">是</el-radio>
                <el-radio :label="false">否</el-radio>
              </el-radio-group>
            </el-form-item>
          </div>
          <div v-if="form.usingBestImage" class="wrap-content__item">
            <el-form-item label="人脸阈值(0-100)" prop="bestImageScore">
              <el-input-number
                v-model="form.bestImageScore"
                size="mini"
                :min="0"
                :max="100"
              />
            </el-form-item>
          </div>
          <div v-else class="wrap-content__item" />
          <div class="wrap-content__item">
            <el-form-item
              label="视频流是否开启质量检测"
              prop="qualityControl"
              class="overlength"
            >
              <el-radio-group v-model="form.qualityControl">
                <el-radio :label="true">是</el-radio>
                <el-radio :label="false">否</el-radio>
              </el-radio-group>
            </el-form-item>
          </div>
          <div v-if="form.qualityControl" class="wrap-content-detail" style="background: #dcdfe63d;">
            <div class="wrap-content-detail__item">
              <el-form-item label="模糊阈值(0-1)" prop="blur">
                <el-input-number
                  v-model="form.blur"
                  size="mini"
                  :precision="2"
                  :step="0.05"
                  :min="0"
                  :max="1"
                />
              </el-form-item>
            </div>
            <div class="wrap-content-detail__item">
              <el-form-item label="光照阈值(0-1)" prop="illum">
                <el-input-number
                  v-model="form.illum"
                  size="mini"
                  :precision="2"
                  :step="0.05"
                  :min="0"
                  :max="1"
                />
              </el-form-item>
            </div>
          </div>
          <div v-else class="wrap-content__item" />
          <div class="wrap-content__item">
            <el-form-item
              label="视频流是否开启活体检测"
              prop="livingControl"
              class="overlength"
            >
              <el-radio-group v-model="form.livingControl">
                <el-radio :label="true">是</el-radio>
                <el-radio :label="false">否</el-radio>
              </el-radio-group>
            </el-form-item>
          </div>
          <div v-if="form.livingControl" class="wrap-content-detail" style="background: #dcdfe63d;">
            <div class="wrap-content-detail__item">
              <el-form-item label="活体检测模式" prop="liveType">
                <el-select v-model="form.liveType" style="width: 100%" placeholder="请选择活体检测模式">
                  <el-option
                    v-for="(item, index) in liveTypeList"
                    :key="item.code"
                    :label="item.desc"
                    :value="item.code"
                  />
                </el-select>
              </el-form-item>
            </div>
            <div class="wrap-content-detail__item">
              <el-form-item label="RGB可见光活体阈值(0-1)" prop="rgbLiveScore">
                <el-input-number
                  v-model="form.rgbLiveScore"
                  size="mini"
                  :precision="2"
                  :step="0.05"
                  :min="0"
                  :max="1"
                />
              </el-form-item>
            </div>
            <div class="wrap-content-detail__item">
              <el-form-item label="NIR近红外活体阈值(0-1)" prop="nirLiveScore">
                <el-input-number
                  v-model="form.nirLiveScore"
                  size="mini"
                  :precision="2"
                  :step="0.05"
                  :min="0"
                  :max="1"
                />
              </el-form-item>
            </div>
            <div class="wrap-content-detail__item">
              <el-form-item label="Depth深度活体阈值(3D结构光)(0-1)" prop="depthLiveScore">
                <el-input-number
                  v-model="form.depthLiveScore"
                  size="mini"
                  :precision="2"
                  :step="0.05"
                  :min="0"
                  :max="1"
                />
              </el-form-item>
            </div>
          </div>
          <div v-else class="wrap-content__item" />
          <div class="wrap-content__item">
            <el-form-item label="人脸检测最小人脸大小" prop="minFaceSize">
              <el-input-number
                v-model="form.minFaceSize"
                size="mini"
                :min="1"
              />
            </el-form-item>
          </div>
          <div class="wrap-content__item">
            <el-form-item label="1:N比对阈值(0-1)" prop="oneToNScoreThreshold">
              <el-input-number
                v-model="form.oneToNScoreThreshold"
                size="mini"
                :precision="2"
                :step="0.05"
                :min="0"
                :max="1"
              />
            </el-form-item>
          </div>
          <div class="wrap-content__item">
            <el-form-item label="1:1比对阈值(0-1)" prop="oneToOneScoreThreshold">
              <el-input-number
                v-model="form.oneToOneScoreThreshold"
                size="mini"
                :precision="2"
                :step="0.05"
                :min="0"
                :max="1"
              />
            </el-form-item>
          </div>
          <div class="wrap-content__item">
            <el-form-item label="1:1人脸连续未通过秒数(1-50)" prop="oneToOneContinueFailTime">
              <el-input-number
                v-model="form.oneToOneContinueFailTime"
                size="mini"
                :min="1"
                :max="50"
              />
            </el-form-item>
          </div>
          <div class="wrap-content__item">
            <el-form-item label="1:1人脸比对超时时间(1-50)" prop="oneToOneTimeout">
              <el-input-number
                v-model="form.oneToOneTimeout"
                size="mini"
                :min="1"
                :max="50"
              />
            </el-form-item>
          </div>
          <div class="wrap-content__item" />
          <div class="wrap-content__item">
            <el-form-item
              label="1:N未通过是否显示提示语"
              prop="oneToNFailShowTip"
              class="overlength"
            >
              <el-radio-group v-model="form.oneToNFailShowTip">
                <el-radio :label="true">是</el-radio>
                <el-radio :label="false">否</el-radio>
              </el-radio-group>
            </el-form-item>
          </div>
          <div v-if="form.oneToNFailShowTip" class="wrap-content__item">
            <el-form-item label="1:N人脸连续未通过秒数(1-50)" prop="oneToNContinueFailTime">
              <el-input-number
                v-model="form.oneToNContinueFailTime"
                size="mini"
                :min="1"
                :max="50"
              />
            </el-form-item>
          </div>
          <div v-else class="wrap-content__item" />
          <div class="wrap-content__item">
            <el-form-item
              label="是否启用有效时间"
              prop="validTimeSwitch"
              class="overlength"
            >
              <el-radio-group v-model="form.validTimeSwitch">
                <el-radio :label="true">是</el-radio>
                <el-radio :label="false">否</el-radio>
              </el-radio-group>
            </el-form-item>
          </div>
        </div>
      </TagCard>
      <TagCard title="三方接口接入配置">
        <div class="wrap-content">
          <template v-if="!suspensionIsNotVerified">
            <div class="wrap-content__item">
              <el-form-item label="启用核验接口" prop="useLinkage">
                <el-radio-group
                  v-model="form.useLinkage"
                  @input="onSelectChange('useLinkage', $event)"
                >
                  <el-radio :label="true">是</el-radio>
                  <el-radio :label="false">否</el-radio>
                </el-radio-group>
              </el-form-item>
            </div>
            <div v-if="form.useLinkage" class="wrap-content-detail" style="background: #dcdfe63d;">
              <div class="wrap-content-detail__item">
                <el-form-item label="核验接口地址" prop="linkageAds">
                  <el-input
                    v-model="form.linkageAds"
                    placeholder="请输入核验接口地址"
                    maxlength="300"
                  />
                </el-form-item>
              </div>
              <div class="wrap-content-detail__item" />
              <div class="wrap-content-detail__item">
                <el-form-item label="核验接口数据是否加解密" prop="checkVerifyEncryptSwitch">
                  <el-radio-group
                    v-model="form.checkVerifyEncryptSwitch"
                    @input="onSelectChange('checkVerifyEncryptSwitch', $event)"
                  >
                    <el-radio :label="true">是</el-radio>
                    <el-radio :label="false">否</el-radio>
                  </el-radio-group>
                </el-form-item>
              </div>
              <div v-if="form.checkVerifyEncryptSwitch" class="wrap-content-detail">
                <div class="wrap-content-detail__item">
                  <el-form-item label="appKey" prop="checkVerifyEncryptAppKey">
                    <el-input
                      v-model="form.checkVerifyEncryptAppKey"
                      placeholder="请输入appKey"
                    />
                  </el-form-item>
                </div>
                <div class="wrap-content-detail__item">
                  <el-form-item label="appSecret" prop="checkVerifyEncryptAppSecret">
                    <el-input
                      v-model="form.checkVerifyEncryptAppSecret"
                      placeholder="请输入appSecret"
                    />
                  </el-form-item>
                </div>
                <div class="wrap-content-detail__item">
                  <el-form-item label="privateKey" prop="checkVerifyEncryptPrivateKey">
                    <el-input
                      v-model="form.checkVerifyEncryptPrivateKey"
                      placeholder="请输入privateKey"
                    />
                  </el-form-item>
                </div>
              </div>
              <div v-else class="wrap-content-detail__item" />
              <div class="wrap-content-detail__item">
                <el-form-item label="核验接口失败重试次数(check)" prop="checkVerifyRetryTimes">
                  <el-input-number
                    v-model="form.checkVerifyRetryTimes"
                    size="mini"
                    :min="0"
                  />
                </el-form-item>
              </div>
              <div class="wrap-content-detail__item">
                <el-form-item label="核验接口超时时间(check)(s)" prop="linkTimeout">
                  <el-input-number
                    v-model="form.linkTimeout"
                    size="mini"
                    :min="2"
                    :max="15"
                  />
                </el-form-item>
              </div>
              <div v-if="form.linkageCheckMode == 2" class="wrap-content-detail__item">
                <el-form-item label="核验接口失败重试次数(verify)" prop="verifyRetryTimes">
                  <el-input-number
                    v-model="form.verifyRetryTimes"
                    size="mini"
                    :min="0"
                  />
                </el-form-item>
              </div>
              <div v-if="form.linkageCheckMode == 2" class="wrap-content-detail__item">
                <el-form-item label="核验接口超时时间(verify)(s)" prop="verifyLinkTimeout">
                  <el-input-number
                    v-model="form.verifyLinkTimeout"
                    size="mini"
                    :min="2"
                    :max="15"
                  />
                </el-form-item>
              </div>
              <div class="wrap-content-detail__item">
                <el-form-item label="核验接口超时提示语" prop="checkVerifyTimeoutTips">
                  <el-input
                    v-model="form.checkVerifyTimeoutTips"
                    placeholder="请输入核验接口超时提示语"
                    maxlength="100"
                  />
                </el-form-item>
              </div>
              <div class="wrap-content-detail__item">
                <el-form-item label="核验接口失败提示语" prop="checkVerifyFailedTips">
                  <el-input
                    v-model="form.checkVerifyFailedTips"
                    placeholder="请输入核验接口失败提示语"
                    maxlength="100"
                  />
                </el-form-item>
              </div>
            </div>
            <div v-else class="wrap-content__item" />
          </template>
          <div class="wrap-content__item">
            <el-form-item label="启用特殊码换三要素接口" prop="specialCodeSwitch">
              <el-radio-group
                v-model="form.specialCodeSwitch"
              >
                <el-radio :label="true">是</el-radio>
                <el-radio :label="false">否</el-radio>
              </el-radio-group>
            </el-form-item>
          </div>
          <div v-if="form.specialCodeSwitch" class="wrap-content-detail" style="background: #dcdfe63d;">
            <div class="wrap-content-detail__item">
              <el-form-item label="特殊码换三要素接口地址" prop="specialCodeUrl">
                <!--                <el-input
                  v-model="form.specialCodeUrl"
                  placeholder="请输入特殊码换三要素接口地址"
                  maxlength="300"
                />-->
                <el-autocomplete
                  v-model="form.specialCodeUrl"
                  popper-class="my-autocomplete"
                  :fetch-suggestions="(queryString, cb) => querySearch('specialCodeUrlList', queryString, cb)"
                  placeholder="请输入特殊码换三要素接口地址"
                  style="width: 100%"
                >
                  <template slot-scope="{ item }">
                    <div class="name">{{ item.value }}</div>
                    <span class="addr">{{ item.desc }}</span>
                  </template>
                </el-autocomplete>
              </el-form-item>
            </div>
            <div class="wrap-content-detail__item">
              <el-form-item label="特殊码换三要素接口超时时间(s)" prop="specialCodeTimeout">
                <el-input-number
                  v-model="form.specialCodeTimeout"
                  size="mini"
                  :min="2"
                  :max="10"
                />
              </el-form-item>
            </div>
            <div class="wrap-content-detail__item">
              <el-form-item label="特殊码换三要素接口超时提示语" prop="specialCodeTimeoutTips">
                <el-input
                  v-model="form.specialCodeTimeoutTips"
                  placeholder="请输入特殊码换三要素接口超时提示语"
                  maxlength="100"
                />
              </el-form-item>
            </div>
            <div class="wrap-content-detail__item">
              <el-form-item label="特殊码换三要素接口失败提示语" prop="specialCodeFailedTips">
                <el-input
                  v-model="form.specialCodeFailedTips"
                  placeholder="请输入特殊码换三要素接口失败提示语"
                  maxlength="100"
                />
              </el-form-item>
            </div>
            <div class="wrap-content-detail__item">
              <el-form-item label="二维码标识（首位）" prop="specialCodePrefix">
                <!--                <el-input
                  v-model="form.specialCodePrefix"
                  placeholder="请输入二维码标识（首位）"
                  maxlength="100"
                />-->
                <el-autocomplete
                  v-model="form.specialCodePrefix"
                  popper-class="my-autocomplete"
                  :fetch-suggestions="(queryString, cb) => querySearch('specialCodePrefixList', queryString, cb)"
                  placeholder="请输入二维码标识（首位）"
                  style="width: 100%"
                >
                  <template slot-scope="{ item }">
                    <div class="name">{{ item.value }}</div>
                    <span class="addr">{{ item.desc }}</span>
                  </template>
                </el-autocomplete>
              </el-form-item>
            </div>
          </div>
          <div v-else class="wrap-content__item" />
          <div class="wrap-content__item">
            <el-form-item label="开启黑名单" prop="userBlacklistSwitch">
              <el-radio-group
                v-model="form.userBlacklistSwitch"
                @input="onSelectChange('userBlacklistSwitch', $event)"
              >
                <el-radio :label="true">是</el-radio>
                <el-radio :label="false">否</el-radio>
              </el-radio-group>
            </el-form-item>
          </div>
          <div v-if="form.userBlacklistSwitch" class="wrap-content-detail" style="background: #dcdfe63d;">
            <div class="wrap-content-detail__item">
              <el-form-item label="是否阻止通行" prop="forbidPassSwitch">
                <el-radio-group
                  v-model="form.forbidPassSwitch"
                  @input="onSelectChange('forbidPassSwitch', $event)"
                >
                  <el-radio :label="true">是</el-radio>
                  <el-radio :label="false">否</el-radio>
                </el-radio-group>
              </el-form-item>
            </div>
            <div v-if="form.forbidPassSwitch" class="wrap-content-detail">
              <div class="wrap-content-detail__item">
                <el-form-item label="阻止通行提示文本" prop="forbidPassText">
                  <el-input
                    v-model="form.forbidPassText"
                    placeholder="请输入阻止通行提示文本"
                  />
                </el-form-item>
              </div>
              <div class="wrap-content-detail__item">
                <el-form-item label="阻止通行提示语音" prop="forbidPassVoice">
                  <el-input
                    v-model="form.forbidPassVoice"
                    placeholder="请输入阻止通行提示语音"
                  />
                </el-form-item>
              </div>
            </div>
            <div v-else class="wrap-content-detail__item" />

            <div class="wrap-content-detail__item">
              <el-form-item label="命中条件" prop="userBlacklistHitRule">
                <el-checkbox-group v-model="form.userBlacklistHitRule">
                  <el-checkbox label="IDENTITY_CARD">身份证</el-checkbox>
                  <el-checkbox label="PHONE">手机</el-checkbox>
                </el-checkbox-group>
              </el-form-item>
            </div>
            <div class="wrap-content-detail__item" />
            <div class="wrap-content-detail__item">
              <el-form-item label="是否启用接口拉取" prop="userBlacklistInterfFetchSwitch">
                <el-radio-group
                  v-model="form.userBlacklistInterfFetchSwitch"
                  @input="onSelectChange('userBlacklistInterfFetchSwitch', $event)"
                >
                  <el-radio :label="true">是</el-radio>
                  <el-radio :label="false">否</el-radio>
                </el-radio-group>
              </el-form-item>
            </div>
            <div v-if="form.userBlacklistInterfFetchSwitch" class="wrap-content-detail__item">
              <el-form-item label="接口地址" prop="userBlacklistInterfUrl">
                <!--                <el-input
                  v-model="form.userBlacklistInterfUrl"
                  placeholder="请输入接口地址"
                />-->
                <el-autocomplete
                  v-model="form.userBlacklistInterfUrl"
                  popper-class="my-autocomplete"
                  :fetch-suggestions="(queryString, cb) => querySearch('userBlacklistInterfUrlList', queryString, cb)"
                  placeholder="请输入接口地址"
                  style="width: 100%"
                >
                  <template slot-scope="{ item }">
                    <div class="name">{{ item.value }}</div>
                    <span class="addr">{{ item.desc }}</span>
                  </template>
                </el-autocomplete>
              </el-form-item>
            </div>
            <div v-else class="wrap-content-detail__item" />
            <div class="wrap-content-detail__item">
              <el-form-item label="黑名单数据是否加解密" prop="userBlacklistEncryptSwitch">
                <el-radio-group
                  v-model="form.userBlacklistEncryptSwitch"
                  @input="onSelectChange('userBlacklistEncryptSwitch', $event)"
                >
                  <el-radio :label="true">是</el-radio>
                  <el-radio :label="false">否</el-radio>
                </el-radio-group>
              </el-form-item>
            </div>
            <div v-if="form.userBlacklistEncryptSwitch" class="wrap-content-detail">
              <div class="wrap-content-detail__item">
                <el-form-item label="appKey" prop="userBlacklistEncryptAppKey">
                  <el-input
                    v-model="form.userBlacklistEncryptAppKey"
                    placeholder="请输入appKey"
                  />
                </el-form-item>
              </div>
              <div class="wrap-content-detail__item">
                <el-form-item label="appSecret" prop="userBlacklistEncryptAppSecret">
                  <el-input
                    v-model="form.userBlacklistEncryptAppSecret"
                    placeholder="请输入appSecret"
                  />
                </el-form-item>
              </div>
              <div class="wrap-content-detail__item">
                <el-form-item label="privateKey" prop="userBlacklistEncryptPrivateKey">
                  <el-input
                    v-model="form.userBlacklistEncryptPrivateKey"
                    placeholder="请输入privateKey"
                  />
                </el-form-item>
              </div>
            </div>
          </div>
          <div v-else class="wrap-content__item" />
          <div class="wrap-content__item">
            <el-form-item label="启用进出记录推送" prop="transitPushSwitch">
              <el-radio-group
                v-model="form.transitPushSwitch"
                @input="onSelectChange('transitPushSwitch', $event)"
              >
                <el-radio :label="true">是</el-radio>
                <el-radio :label="false">否</el-radio>
              </el-radio-group>
            </el-form-item>
          </div>
          <div v-if="form.transitPushSwitch" class="wrap-content-detail" style="background: #dcdfe63d;">
            <div class="wrap-content-detail__item">
              <el-form-item label="推送接口地址" prop="transitPushUrl">
                <!--              <el-inputx
                  v-model="form.transitPushUrl"
                  placeholder="请输入"
                  maxlength="300"
                />-->
                <el-autocomplete
                  v-model="form.transitPushUrl"
                  popper-class="my-autocomplete"
                  :fetch-suggestions="(queryString, cb) => querySearch('transitPushUrlList', queryString, cb)"
                  placeholder="请输入内容"
                  style="width: 100%"
                >
                  <template slot-scope="{ item }">
                    <div class="name">{{ item.value }}</div>
                    <span class="addr">{{ item.desc }}</span>
                  </template>
                </el-autocomplete>
              </el-form-item>
            </div>
            <div class="wrap-content-detail__item">
              <el-form-item
                label="进出记录滤重时间(0-1200s)"
                prop="inOutFilterRepeatTime"
              >
                <el-input-number
                  v-model="form.inOutFilterRepeatTime"
                  size="mini"
                  :min="0"
                  :max="1200"
                />
              </el-form-item>
            </div>
            <div class="wrap-content-detail__item">
              <el-form-item label="推送接口数据是否加解密" prop="transitPushEncryptSwitch">
                <el-radio-group
                  v-model="form.transitPushEncryptSwitch"
                  @input="onSelectChange('transitPushEncryptSwitch', $event)"
                >
                  <el-radio :label="true">是</el-radio>
                  <el-radio :label="false">否</el-radio>
                </el-radio-group>
              </el-form-item>
            </div>
            <div v-if="form.transitPushEncryptSwitch" class="wrap-content-detail">
              <div class="wrap-content-detail__item">
                <el-form-item label="appKey" prop="transitPushEncryptAppKey">
                  <el-input
                    v-model="form.transitPushEncryptAppKey"
                    placeholder="请输入appKey"
                  />
                </el-form-item>
              </div>
              <div class="wrap-content-detail__item">
                <el-form-item label="appSecret" prop="transitPushEncryptAppSecret">
                  <el-input
                    v-model="form.transitPushEncryptAppSecret"
                    placeholder="请输入appSecret"
                  />
                </el-form-item>
              </div>
              <div class="wrap-content-detail__item">
                <el-form-item label="privateKey" prop="transitPushEncryptPrivateKey">
                  <el-input
                    v-model="form.transitPushEncryptPrivateKey"
                    placeholder="请输入privateKey"
                  />
                </el-form-item>
              </div>
            </div>
          </div>
          <div v-else class="wrap-content__item" />
          <div class="wrap-content__item">
            <el-form-item label="人脸管理平台-ws地址" prop="websocketSubscribeUrl">
              <!--              <el-input
                v-model="form.websocketSubscribeUrl"
                placeholder="请输入地址"
              />-->
              <el-autocomplete
                v-model="form.websocketSubscribeUrl"
                popper-class="my-autocomplete"
                :fetch-suggestions="(queryString, cb) => querySearch('websocketSubscribeUrlList', queryString, cb)"
                placeholder="请输入地址"
                style="width: 100%"
              >
                <template slot-scope="{ item }">
                  <div class="name">{{ item.value }}</div>
                  <span class="addr">{{ item.desc }}</span>
                </template>
              </el-autocomplete>
            </el-form-item>
          </div>
        </div>
      </TagCard>
      <TagCard title="结果页配置">
        <div class="wrap-content">
          <div class="wrap-content__item">
            <el-form-item label="模板类型" prop="resultPageTemplate">
              <el-radio-group v-model="form.resultPageTemplate">
                <el-radio :label="1">通用</el-radio>
                <el-radio :label="2">悬浮</el-radio>
                <el-radio :label="3">悬浮(无核验)</el-radio>
              </el-radio-group>
            </el-form-item>
          </div>
          <div class="wrap-content__item">
            <el-form-item
              class="overlength"
              label="默认成功结果页时长(s)"
              prop="successPageTime"
            >
              <el-input-number
                v-model="form.successPageTime"
                size="mini"
                :min="1"
                :max="100"
              />
            </el-form-item>
          </div>
          <div class="wrap-content__item">
            <el-form-item label="成功默认标题" prop="sucText">
              <el-input
                v-model="form.sucText"
                placeholder="请输入成功默认标题"
                maxlength="50"
              />
            </el-form-item>
          </div>
          <div class="wrap-content__item">
            <el-form-item label="成功默认语音" prop="sucVoice">
              <el-input
                v-model="form.sucVoice"
                placeholder="请输入成功默认语音"
                maxlength="50"
              />
            </el-form-item>
          </div>

          <div class="wrap-content__item">
            <el-form-item label="成功显示人员信息" prop="successShowPersonalInfoList">
              <el-select
                v-model="form.successShowPersonalInfoList"
                style="width: 100%"
                multiple
                placeholder="请选择成功显示人员信息【多选】"
              >
                <el-option
                  v-for="(item, index) in successShowPersonalInfoTypeList"
                  :key="index"
                  :label="item.desc"
                  :value="item.code"
                />
              </el-select>
            </el-form-item>
          </div>
          <div class="wrap-content__item" />

          <template v-if="!suspensionIsNotVerified">
            <div class="wrap-content__item">
              <el-form-item
                label="是否根据开门次数决定显示时长"
                prop="showDisplayTimeByOpenTimesSwitch"
              >
                <el-radio-group
                  v-model="form.showDisplayTimeByOpenTimesSwitch"
                  @input="onSelectChange('showDisplayTimeByOpenTimesSwitch', $event)"
                >
                  <el-radio :label="true">是</el-radio>
                  <el-radio :label="false">否</el-radio>
                </el-radio-group>
              </el-form-item>
            </div>
            <div v-if="form.showDisplayTimeByOpenTimesSwitch" class="wrap-content__item">
              <el-form-item
                class="overlength"
                label="单次开门时间(s)"
                prop="onceOpenDoorTime"
              >
                <el-input-number
                  v-model="form.onceOpenDoorTime"
                  size="mini"
                  :min="1"
                />
              </el-form-item>
            </div>
            <div v-else class="wrap-content__item" />
          </template>
          <div class="wrap-content__item">
            <el-form-item
              class="overlength"
              label="默认失败结果页时长(s)"
              prop="failPageTime"
            >
              <el-input-number
                v-model="form.failPageTime"
                size="mini"
                :min="1"
                :max="100"
              />
            </el-form-item>
          </div>
          <div class="wrap-content__item">
            <el-form-item label="刷脸失败默认标题" prop="failText">
              <el-input
                v-model="form.failText"
                placeholder="请输入刷脸失败默认标题"
                maxlength="50"
              />
            </el-form-item>
          </div>
          <div class="wrap-content__item">
            <el-form-item label="刷脸失败默认语音" prop="failVoice">
              <el-input
                v-model="form.failVoice"
                placeholder="请输入刷脸失败默认语音"
                maxlength="50"
              />
            </el-form-item>
          </div>

          <template v-if="!suspensionIsNotVerified">
            <div class="wrap-content__item">
              <el-form-item
                class="overlength"
                label="默认单选页时长(s)"
                prop="singlePageTime"
              >
                <el-input-number
                  v-model="form.singlePageTime"
                  size="mini"
                  :min="1"
                />
              </el-form-item>
            </div>
            <div class="wrap-content__item">
              <el-form-item
                class="overlength"
                label="默认多选页时长(s)"
                prop="multiPageTime"
              >
                <el-input-number
                  v-model="form.multiPageTime"
                  size="mini"
                  :min="1"
                />
              </el-form-item>
            </div>
            <div class="wrap-content__item">
              <el-form-item
                class="overlength"
                label="默认等待页时长(s)"
                prop="waitPageTime"
              >
                <el-input-number
                  v-model="form.waitPageTime"
                  size="mini"
                  :min="1"
                />
              </el-form-item>
            </div>
          </template>

          <div class="wrap-content__item">
            <el-form-item label="1:1比对是否显示提醒页面" prop="oneToOneTipsSwitch">
              <el-radio-group
                v-model="form.oneToOneTipsSwitch"
                @input="onSelectChange('oneToOneTipsSwitch', $event)"
              >
                <el-radio :label="true">是</el-radio>
                <el-radio :label="false">否</el-radio>
              </el-radio-group>
            </el-form-item>
          </div>
          <div v-if="form.oneToOneTipsSwitch" class="wrap-content-detail" style="background: #dcdfe63d;">
            <div class="wrap-content-detail__item">
              <el-form-item label="1:1比对提醒文字" prop="oneToOneTips">
                <el-input
                  v-model="form.oneToOneTips"
                  placeholder="请输入1:1比对提醒文字"
                />
              </el-form-item>
            </div>
            <div class="wrap-content-detail__item">
              <el-form-item label="1:1比对提醒语音" prop="oneToOneVoice">
                <el-input
                  v-model="form.oneToOneVoice"
                  placeholder="请输入1:1比对提醒语音"
                />
              </el-form-item>
            </div>
          </div>
          <div v-else class="wrap-content__item" />

          <template v-if="!suspensionIsNotVerified">
            <div class="wrap-content__item">
              <el-form-item label="是否显示通行统计" prop="showTopBar">
                <el-radio-group
                  v-model="form.showTopBar"
                  @input="onSelectChange('showTopBar', $event)"
                >
                  <el-radio :label="true">是</el-radio>
                  <el-radio :label="false">否</el-radio>
                </el-radio-group>
              </el-form-item>
            </div>
            <div v-if="form.showTopBar" class="wrap-content-detail" style="background: #dcdfe63d;">
              <div class="wrap-content-detail__item">
                <el-form-item label="左侧文字" prop="leftTopBarText">
                  <el-input
                    v-model="form.leftTopBarText"
                    placeholder="请输入左侧文字"
                    maxlength="50"
                  />
                </el-form-item>
              </div>
              <div class="wrap-content-detail__item">
                <el-form-item label="右侧文字" prop="rightTopBarText">
                  <el-input
                    v-model="form.rightTopBarText"
                    placeholder="请输入右侧文字"
                    maxlength="50"
                  />
                </el-form-item>
              </div>
            </div>
          </template>
        </div>
      </TagCard>
      <TagCard title="硬件模组配置">
        <div class="wrap-content">
          <div class="wrap-content__item">
            <el-form-item label="开门信号" prop="useSerialPort">
              <el-radio-group
                v-model="form.useSerialPort"
                @input="onSelectChange('useSerialPort', $event)"
              >
                <el-radio
                  label="default"
                  style="margin-right: 40px"
                >继电器</el-radio>
                <el-radio v-if="!suspensionIsNotVerified" label="RS232">RS232</el-radio>
              </el-radio-group>
            </el-form-item>
          </div>
          <div
            v-if="form.useSerialPort === 'RS232' && !suspensionIsNotVerified"
            class="wrap-content__item"
          >
            <el-form-item label="RS232开门串口地址" prop="doorSerialPort">
              <el-input
                v-model="form.doorSerialPort"
                placeholder="请输入RS232开门信号串口地址"
                maxlength="300"
                show-word-limit
              />
            </el-form-item>
          </div>
          <div v-else class="wrap-content__item" />
          <div class="wrap-content__item">
            <el-form-item label="继电器开门模式" prop="relayOpenModel">
              <el-radio-group
                v-model="form.relayOpenModel"
                @input="onSelectChange('relayOpenModel', $event)"
              >
                <el-radio
                  :label="1"
                  style="margin-right: 40px"
                >开-闭信号</el-radio>
                <el-radio :label="2">开-门磁-闭信号</el-radio>
              </el-radio-group>
            </el-form-item>
          </div>
          <div v-if="form.relayOpenModel == 1||form.relayOpenModel == 2" class="wrap-content-detail" style="background: #dcdfe63d;">
            <template v-if="form.relayOpenModel == 1">
              <div class="wrap-content-detail__item">
                <el-form-item
                  label="开闭时间间隔（ms）"
                  prop="openCloseInterval"
                >
                  <el-input-number v-model="form.openCloseInterval" size="mini" />
                </el-form-item>
              </div>
              <div class="wrap-content-detail__item">
                <el-form-item
                  label="信号间间隔（ms）"
                  prop="signalInterval"
                >
                  <el-input-number v-model="form.signalInterval" size="mini" />
                </el-form-item>
              </div>
            </template>
            <template v-if="form.relayOpenModel == 2">
              <div class="wrap-content-detail__item">
                <el-form-item label="门磁串口地址" prop="doorSerialPortAddress">
                  <el-input
                    v-model="form.doorSerialPortAddress"
                    placeholder="请输入门磁串口地址"
                    maxlength="300"
                    show-word-limit
                  />
                </el-form-item>
              </div>
              <div class="wrap-content-detail__item">
                <el-form-item
                  label="门磁超时时间（s）"
                  prop="gateTimeOut"
                >
                  <el-input-number v-model="form.gateTimeOut" size="mini" />
                </el-form-item>
              </div>
            </template>
          </div>
          <div class="wrap-content__item">
            <el-form-item label="补光灯" prop="lightMode">
              <el-select v-model="form.lightMode" style="width: 100%" placeholder="请选择补光灯模式">
                <el-option
                  v-for="(item, index) in lightModeLists"
                  :key="index"
                  :label="item.value"
                  :value="item.key"
                />
              </el-select>
            </el-form-item>
          </div>
          <div class="wrap-content__item">
            <el-form-item
              label="补光灯亮度(0~200)"
              prop="ledBrightness"
            >
              <el-input-number
                v-model="form.ledBrightness"
                size="mini"
                :min="0"
                :max="200"
              />
            </el-form-item>
          </div>
        </div>
      </TagCard>
      <TagCard title="推送配置">
        <div class="wrap-content">
          <div class="wrap-content__item">
            <el-form-item label="设备状态推送地址" prop="heartTrackingUrl">
              <!--              <el-input
                v-model="form.heartTrackingUrl"
                placeholder="请输入"
                maxlength="300"
              />-->
              <el-autocomplete
                v-model="form.heartTrackingUrl"
                popper-class="my-autocomplete"
                :fetch-suggestions="(queryString, cb) => querySearch('heartTrackingUrlList', queryString, cb)"
                placeholder="请输入内容"
                style="width: 100%"
              >
                <template slot-scope="{ item }">
                  <div class="name">{{ item.value }}</div>
                  <span class="addr">{{ item.desc }}</span>
                </template>
              </el-autocomplete>
            </el-form-item>
          </div>
          <div class="wrap-content__item">
            <el-form-item label="在线日志推送地址" prop="logPushUrl">
              <!--              <el-input
                v-model="form.logPushUrl"
                placeholder="请输入"
                maxlength="300"
              />-->
              <el-autocomplete
                v-model="form.logPushUrl"
                popper-class="my-autocomplete"
                :fetch-suggestions="(queryString, cb) => querySearch('logPushUrlList', queryString, cb)"
                placeholder="请输入内容"
                style="width: 100%"
              >
                <template slot-scope="{ item }">
                  <div class="name">{{ item.value }}</div>
                  <span class="addr">{{ item.desc }}</span>
                </template>
              </el-autocomplete>
            </el-form-item>
          </div>
        </div>
      </TagCard>
      <TagCard title="功能配置">
        <div class="wrap-content">
          <div class="wrap-content__item">
            <el-form-item label="是否开启年龄限制" prop="isOpenAgeLimit">
              <el-radio-group
                v-model="form.isOpenAgeLimit"
                @input="onSelectChange('isOpenAgeLimit', $event)"
              >
                <el-radio :label="true">是</el-radio>
                <el-radio :label="false">否</el-radio>
              </el-radio-group>
            </el-form-item>
          </div>
          <div class="wrap-content__item" />
          <div v-if="form.isOpenAgeLimit" class="wrap-content-detail" style="background: #dcdfe63d;">
            <div class="wrap-content-detail__item">
              <el-form-item label="限制年龄区间">
                <el-input-number
                  v-model="form.limitSectionStart"
                  size="mini"
                  :min="0"
                  :max="100"
                />
                至
                <el-input-number
                  v-model="form.limitSectionEnd"
                  size="mini"
                  :min="0"
                  :max="100"
                />
              </el-form-item>
            </div>
            <div class="wrap-content-detail__item">
              <el-form-item
                label="限制进入结果页标题"
                prop="ageForbidText"
              >
                <el-input
                  v-model="form.ageForbidText"
                  placeholder="请输入"
                  maxlength="200"
                />
              </el-form-item>
            </div>
          </div>
          <div class="wrap-content__item">
            <el-form-item label="是否推送门磁信号" prop="isPushGM">
              <el-radio-group
                v-model="form.isPushGM"
                @input="onSelectChange('isPushGM', $event)"
              >
                <el-radio :label="true">是</el-radio>
                <el-radio :label="false">否</el-radio>
              </el-radio-group>
            </el-form-item>
          </div>
          <div class="wrap-content__item" />
          <div v-if="form.isPushGM" class="wrap-content-detail" style="background: #dcdfe63d;">
            <div class="wrap-content-detail__item">
              <el-form-item
                label="门磁信号推送地址"
                prop="GMAddress"
              >
                <el-input
                  v-model="form.GMAddress"
                  show-word-limit
                  placeholder="请输入"
                  maxlength="300"
                />
              </el-form-item>
            </div>
            <div class="wrap-content-detail__item">
              <el-form-item
                label="门磁信号推送频率(ms)"
                prop="GMFrequency"
              >
                <el-input-number v-model="form.GMFrequency" size="mini" :min="1" />
              </el-form-item>
            </div>
          </div>
          <div class="wrap-content__item">
            <el-form-item label="是否推送失败记录" prop="pushFailedRecordSwitch">
              <el-radio-group v-model="form.pushFailedRecordSwitch">
                <el-radio :label="true">是</el-radio>
                <el-radio :label="false">否</el-radio>
              </el-radio-group>
            </el-form-item>
          </div>
          <div v-if="form.pushFailedRecordSwitch" class="wrap-content-detail__item">
            <el-form-item label="记录类型" prop="pushFailedRecordType">
              <el-select
                v-model="form.pushFailedRecordType"
                style="width: 100%"
                multiple
                placeholder="请选择记录类型【多选】"
              >
                <el-option
                  v-for="(item, index) in pushFailedRecordTypeList"
                  :key="index"
                  :label="item.desc"
                  :value="item.code"
                />
              </el-select>
            </el-form-item>
          </div>
        </div>
      </TagCard>
      <TagCard title="系统配置">
        <div class="wrap-content">
          <div class="wrap-content__item">
            <el-form-item label="管理员密码" prop="mpassword">
              <el-input
                v-model="form.mpassword"
                placeholder="请输入"
                maxlength="50"
              />
            </el-form-item>
          </div>
          <div class="wrap-content__item">
            <el-form-item label="语音音量（1~100）" prop="volume">
              <el-input-number
                v-model="form.volume"
                size="mini"
                :min="1"
                :max="100"
              />
            </el-form-item>
          </div>
          <div class="wrap-content__item">
            <el-form-item label="隐藏底部导航栏" prop="hideNavigationBar">
              <el-radio-group v-model="form.hideNavigationBar">
                <el-radio :label="true">是</el-radio>
                <el-radio :label="false">否</el-radio>
              </el-radio-group>
            </el-form-item>
          </div>
          <div class="wrap-content__item">
            <el-form-item label="禁止下拉通知栏" prop="forbidPullDown">
              <el-radio-group v-model="form.forbidPullDown">
                <el-radio :label="true">是</el-radio>
                <el-radio :label="false">否</el-radio>
              </el-radio-group>
            </el-form-item>
          </div>
          <div class="wrap-content__item">
            <el-form-item label="应用是否自启动" prop="autoLaunch">
              <el-radio-group v-model="form.autoLaunch">
                <el-radio :label="true">是</el-radio>
                <el-radio :label="false">否</el-radio>
              </el-radio-group>
            </el-form-item>
          </div>
          <div class="wrap-content__item" />
          <div class="wrap-content__item">
            <el-form-item label="是否开启定时重启" prop="scheduledRestart">
              <el-radio-group v-model="form.scheduledRestart">
                <el-radio :label="true">是</el-radio>
                <el-radio :label="false">否</el-radio>
              </el-radio-group>
            </el-form-item>
          </div>
          <div v-if="form.scheduledRestart" class="wrap-content__item">
            <el-form-item label="定时重启时间" prop="scheduledRestartTime">
              <el-time-picker
                v-model="form.scheduledRestartTime"
                placeholder="请选择"
              />
            </el-form-item>
          </div>
          <div v-else class="wrap-content__item" />
          <div class="wrap-content__item">
            <el-form-item label="设置——人员列表" prop="setPersonalList">
              <el-checkbox-group v-model="form.setPersonalList">
                <el-checkbox v-for="item in setPersonalTypeList" :key="item.code" :label="item.code">{{ item.desc }}</el-checkbox>
              </el-checkbox-group>
            </el-form-item>
          </div>
          <div class="wrap-content__item">
            <el-form-item label="预览页是否显示人员数量" prop="showPersonalNumSwitch">
              <el-radio-group v-model="form.showPersonalNumSwitch">
                <el-radio :label="true">是</el-radio>
                <el-radio :label="false">否</el-radio>
              </el-radio-group>
            </el-form-item>
          </div>
          <div class="wrap-content__item">
            <el-form-item label="首页图片配置" prop="homePageUrl">
              <el-upload
                name="file"
                class="avatar-uploader"
                action="#"
                :show-file-list="false"
                :http-request="
                  (event) => {
                    doUploadAvatar(event, 'homePageUrl');
                  }
                "
                :before-upload="beforeAvatarUpload"
                :auto-upload="true"
                accept="image/png,image/gif,image/jpg,image/jpeg"
              >
                <img
                  v-if="!form.homePageUrl"
                  class="upload-img"
                  src="../../../assets/HHLocal-home.jpg"
                  alt=""
                >
                <div v-else class="upload-img">
                  <img :src="form.homePageUrl">
                  <span
                    class="del-img"
                    @click.stop="handleRemove('homePageUrl')"
                  >x</span>
                </div>
              </el-upload>
            </el-form-item>
          </div>
          <div class="wrap-content__item">
            <el-form-item label="过渡图片配置" prop="transitionPageUrl">
              <el-upload
                name="file"
                class="avatar-uploader"
                action="#"
                :show-file-list="false"
                :http-request="
                  (event) => {
                    doUploadAvatar(event, 'transitionPageUrl');
                  }
                "
                :before-upload="beforeAvatarUpload"
                :auto-upload="true"
                accept="image/png,image/gif,image/jpg,image/jpeg"
              >
                <!-- <div v-if="!form.transitionPageUrl" class="upload-default">
                <i class="avatar-uploader-icon el-icon-picture-outline" />
                <div class="el-upload__text">上传图片</div>
              </div> -->
                <img
                  v-if="!form.transitionPageUrl"
                  class="upload-img"
                  src="../../../assets/default-img-home1.png"
                  alt=""
                >
                <!-- <i v-if="!form.transitionPageUrl" class="el-icon-plus avatar-uploader-icon" /> -->
                <div v-else class="upload-img">
                  <img :src="form.transitionPageUrl">
                  <span
                    class="del-img"
                    @click.stop="handleRemove('transitionPageUrl')"
                  >x</span>
                </div>
              </el-upload>
            </el-form-item>
          </div>
          <div class="wrap-content__item">
            <el-form-item label="预览页图片配置" prop="previewPageUrl">
              <el-upload
                name="file"
                class="avatar-uploader"
                action="#"
                :show-file-list="false"
                :http-request="
                  (event) => {
                    doUploadAvatar(event, 'previewPageUrl');
                  }
                "
                :before-upload="beforeAvatarUpload"
                :auto-upload="true"
                accept="image/png,image/gif,image/jpg,image/jpeg"
              >
                <img
                  v-if="!form.previewPageUrl"
                  class="upload-img"
                  src="../../../assets/HHLocal-preview.png"
                  alt=""
                >
                <div v-else class="upload-img">
                  <img :src="form.previewPageUrl">
                  <span
                    class="del-img"
                    @click.stop="handleRemove('previewPageUrl')"
                  >x</span>
                </div>
              </el-upload>
            </el-form-item>
          </div>
          <div class="wrap-content__item">
            <el-form-item label="刷脸失败结果页图片配置" prop="scanFaceFailedPageUrl">
              <el-upload
                name="file"
                class="avatar-uploader"
                action="#"
                :show-file-list="false"
                :http-request="
                  (event) => {
                    doUploadAvatar(event, 'scanFaceFailedPageUrl');
                  }
                "
                :before-upload="beforeAvatarUpload"
                :auto-upload="true"
                accept="image/png,image/gif,image/jpg,image/jpeg"
              >
                <img
                  v-if="!form.scanFaceFailedPageUrl"
                  class="upload-img"
                  src="../../../assets/default-img-home1.png"
                  alt=""
                >
                <div v-else class="upload-img">
                  <img :src="form.scanFaceFailedPageUrl">
                  <span
                    class="del-img"
                    @click.stop="handleRemove('scanFaceFailedPageUrl')"
                  >x</span>
                </div>
              </el-upload>
            </el-form-item>
          </div>
        </div>
      </TagCard>
    </el-form>
    <div class="card-footer">
      <el-button style="width: 120px" @click="back"> 取消 </el-button>
      <el-button type="primary" style="width: 120px" :loading="submitLoading" @click="submit">
        确定
      </el-button>
    </div>
  </div>
</template>

<script>
import TagCard from '@/components/TagCard'
import { templateEdit } from '@/api/HHLocalDevice'
import { pictureLocal } from '@/api/ordinary_user'
import { parseTime } from '@/utils'

export default {
  components: { TagCard },
  props: {
    obj: {
      type: Object,
      default: () => {}
    },
    // 应用类型下拉
    applicationList: {
      type: Array,
      default: () => []
    },
    // 设备型号下拉
    deviceList: {
      type: Array,
      default: () => []
    },
    // 身份证阅读器品牌下拉
    brandList: {
      type: Array,
      default: () => []
    },
    // 阅读器品牌下拉
    readerBrandList: {
      type: Array,
      default: () => []
    },
    // 二维码读头品牌下拉
    qrBrandList: {
      type: Array,
      default: () => []
    },
    // 摄像头类型下拉
    cameraTypeList: {
      type: Array,
      default: () => []
    },
    // 活体检测模式下拉
    liveTypeList: {
      type: Array,
      default: () => []
    },
    // 记录类型下拉
    pushFailedRecordTypeList: {
      type: Array,
      default: () => []
    },
    // 成功显示人员信息下拉
    successShowPersonalInfoTypeList: {
      type: Array,
      default: () => []
    },
    // 设置——人员列表下拉
    setPersonalTypeList: {
      type: Array,
      default: () => []
    },
    isDis: {
      type: Boolean,
      default: false
    }
  },
  data() {
    return {
      form: {
        templateName: null, // 模板名称
        applicationTypeId: null, // 应用类型
        deviceModelHardwareId: null, // 设备型号（硬件）
        expirationDate: null, // 使用时间期限
        licenseOnlineKey: null, // 激活序列号
        communicationMode: 1, // 应用通信模式
        wsAddress: '', // WEBSOCKET地址
        communicationSerialPort: '', // SERIALPORT地址
        linkageCheckMode: 2, // 校验模式

        useIdcard: true, // 是否启用身份证功能 默认值：true
        idCardReaderBrand: 4, // 身份证阅读器品牌 默认值：新中新阅读器
        analysisPhoto: 1, // 是否解析身份证照片 默认值：1
        analysisFingerprint: 0, // 是否解析身份证指纹 默认值：0
        usePersonCard: false, // 	是否人证比对 默认值：false
        idCardInterval: 7, // 	同证间隔时间(s) 0-20 默认值：7
        useQrcode: true, // 是否启用二维码功能 默认值：true
        qrCodeReaderBrand: 5, // 二维码读头品牌 默认值：东信新款二维码读头
        qrCodeReaderCommunicationMode: 1, // 二维码读头通信方式 默认值：虚拟串口
        qrCodeReaderSerialPort: '', // 二维码读头串口地址
        qrCodeInterval: 7, // 	同码间隔时间(s) 0-20 默认值：7
        qrCodeUsePersonCard: false, // 启用二维码功能=> 是否人证比对 默认值：false

        ic14443IcCardFunction: false, // 启用IC卡ISO14443A功能 默认值：false
        ic14443ReaderBrand: 1, // 阅读器品牌 默认值：东信多合一内置
        ic14443ReaderSectorNumbers: 15, // 读取扇区(0-99) 默认值：15
        ic14443ReaderBlock: '0', // 读取块 长度100 默认值：0
        ic14443ReaderKey: 'FFFFFFFFFFFF', // 读取密钥 默认值：FFFFFFFFFFFF
        ic14443StartOffset: 0, // 起始偏移量(0-100) 默认值：0
        ic14443EndOffset: 0, // 末尾偏移量(0-100) 默认值：0
        ic14443PersonCardComparison: false, // 	是否人证比对 默认值：false
        ic14443SameCardIntervalTime: 7, // 	同卡间隔时间(s) 0-20 默认值：7

        ic15693IcCardFunction: false, // 启用IC卡ISO15693功能 默认值：false
        ic15693ReaderBrand: 1, // 阅读器品牌 默认值：东信多合一内置
        ic15693ReaderBlock: '0', // 读取块 长度100 默认值：0
        ic15693StartOffset: 0, // 起始偏移量(0-100) 默认值：0
        ic15693EndOffset: 0, // 末尾偏移量(0-100) 默认值：0
        ic15693PersonCardComparison: false, // 	是否人证比对 默认值：false
        ic15693SameCardIntervalTime: 7, // 	同卡间隔时间(s) 0-20 默认值：7

        openDelayTime: 0, // 刷证/刷码/刷卡延时(ms)
        isOpenPassport: false, // 启用护照机功能
        passportUsePersonCard: false, // 启用护照机功能=> 是否人证比对 默认值：false
        manualInIdCard: false, // 是否启用手动输入证件号
        manualInUsePersonCard: false, // 启用手动输入证件号=> 是否人证比对 默认值：false
        openOneToN: true, // 是否开启 1:N 刷脸能力 默认值：true
        sameFaceInterval: 7, // 是否开启 1:N 刷脸能力=>同人脸间隔时间(s) 默认值：7

        /** 摄像头配置 开始 **/
        cameraType: 'IR', // 摄像头类型 默认：双目
        rgbVideoDirection: 270, // 预览画面角度(RGB) 默认：270
        mirrorVideoRGB: 0, // 预览画面是否镜像(RGB) 默认：否
        rgbDetectDirection: 270, // 人脸识别检测角度(RGB) 默认：270
        mirrorDetectRGB: 0, // 人脸识别检测是否镜像(RGB) 默认：否
        nirVideoDirection: 270, // 预览画面角度(NIR) 默认：270
        mirrorVideoNIR: 0, // 预览画面是否镜像(NIR) 默认：否
        nirDetectDirection: 270, // 人脸识别检测角度(NIR) 默认：270
        mirrorDetectNIR: 0, // 人脸识别检测是否镜像(NIR) 默认：否
        /** 摄像头配置 结束 **/

        /** 识别配置 开始 **/
        faceFollowBoxSwitch: true, // 是否显示人脸跟随框 默认：true
        rgbRevert: false, // 是否显示人脸跟随框 是 的子项 人脸跟随框是否镜像 默认：false
        usingBestImage: false, // 视频流是否开启最优人脸检测 默认：false
        bestImageScore: 90, // 人脸阈值(0-100) 默认：90
        qualityControl: false, // 视频流是否开启质量检测 默认：false
        blur: 0.15, // 模糊阈值(0-1) 默认：0.15
        illum: 0.8, // 光照阈值(0-1) 默认：0.8

        livingControl: false, // 视频流是否开启活体检测 默认：false
        liveType: 1, // 活体检测模式 默认：RGB
        rgbLiveScore: 0.8, // RGB可见光活体阈值(0-1) 默认：0.8
        nirLiveScore: 0.8, // NIR近红外活体阈值(0-1) 默认：0.8
        depthLiveScore: 0.8, // Depth深度活体阈值(3D结构光)(0-1) 默认：0.8

        minFaceSize: 50, // 人脸检测最小人脸大小 默认：50
        oneToNScoreThreshold: 0.83, // 1:N比对阈值(0-1) 默认：0.83
        oneToOneScoreThreshold: 0.5, // 1:1比对阈值(0-1) 默认：0.5
        oneToOneContinueFailTime: 3, // 1:1人脸连续未通过秒数(1-50) 默认：3
        oneToOneTimeout: 10, // 1:1人脸比对超时时间(1-50) 默认：10
        oneToNFailShowTip: false, // 1:N未通过是否显示提示语 默认：false
        oneToNContinueFailTime: 3, // 1:N人脸连续未通过秒数(1-50) 默认：3
        validTimeSwitch: false, // 是否启用有效时间 默认：false
        /** 识别配置 结束 **/

        /** 三方接口接入配置 开始 **/
        useLinkage: false, // 	启用核验接口 默认值：false
        linkageAds: '', // 	核验接口地址

        checkVerifyEncryptSwitch: true, // 核验接口数据是否加解密 默认值：true
        checkVerifyEncryptAppKey: '', //
        checkVerifyEncryptAppSecret: '', //
        checkVerifyEncryptPrivateKey: '', //
        checkVerifyRetryTimes: 1, // 核验接口失败重试次数
        linkTimeout: 5, // 核验接口超时时间(s)
        verifyRetryTimes: 2, // 核验接口失败重试次数(verify)
        verifyLinkTimeout: 15, // 核验接口超时时间(s)(verify)
        checkVerifyTimeoutTips: '核验接口超时', // 核验接口超时提示语
        checkVerifyFailedTips: '核验接口失败', // 核验接口失败提示语

        specialCodeSwitch: false, // 启用特殊码换三要素接口 默认值：false
        specialCodeUrl: '', // 特殊码换三要素接口地址
        specialCodeTimeout: 5, // 特殊码换三要素接口超时时间(s)
        specialCodeTimeoutTips: '特殊码换三要素接口请求超时', // 特殊码换三要素接口超时提示语
        specialCodeFailedTips: '特殊码换三要素接口请求失败', // 特殊码换三要素接口失败提示语
        specialCodePrefix: '', // 二维码标识（首位）

        userBlacklistSwitch: false, // 开启黑名单 默认值：false
        forbidPassSwitch: true, // 是否阻止通行 默认值：true
        forbidPassText: '禁止通行', // 阻止通行提示文本
        forbidPassVoice: '禁止通行，请联系管理员', // 阻止通行提示语音
        userBlacklistHitRule: ['PHONE'], // 命中条件 默认值身份证
        userBlacklistInterfFetchSwitch: true, // 是否启用接口拉取 默认值：true
        userBlacklistInterfUrl: '', // 接口地址
        userBlacklistEncryptSwitch: true, // 黑名单数据是否加解密 默认值：true
        userBlacklistEncryptAppKey: '', //
        userBlacklistEncryptAppSecret: '', //
        userBlacklistEncryptPrivateKey: '', //

        transitPushSwitch: true, // 启用进出记录推送 默认值：true
        transitPushUrl: 'https://tx.hz-hanghui.com:8088/yx-fyzd/EventRecords', // 推送接口地址
        inOutFilterRepeatTime: 0, // 进出记录滤重时间 默认：0 0-1200s
        transitPushEncryptSwitch: false, // 推送接口数据是否加解密 默认值：false TODO ADD_FIELD
        transitPushEncryptAppKey: '', // TODO ADD_FIELD
        transitPushEncryptAppSecret: '', // TODO ADD_FIELD
        transitPushEncryptPrivateKey: '', // TODO ADD_FIELD

        websocketSubscribeUrl: '', // 人脸管理平台-ws地址
        /** 三方接口接入配置 结束 **/

        resultPageTemplate: 1, // 模板类型 默认值：通用

        successPageTime: 2, // 默认成功结果页时长(s) 1-100 默认值：2
        sucText: '请通行', // 成功默认标题 默认: 请通行
        sucVoice: '请通行', // 成功默认语音 默认: 请通行
        successShowPersonalInfoList: [1, 2, 3, 4], // 成功显示人员信息 多选；默认： 照片、姓名、证件号、手机号这四项全部都选上
        showDisplayTimeByOpenTimesSwitch: false, // 是否根据开门次数决定显示时长  默认值：false
        onceOpenDoorTime: 2, // 单次开门时间(s) 默认值：2
        failPageTime: 5, // 默认失败结果页时长 1-100 默认值：5
        failText: '请刷证或刷码', // 刷脸失败默认标题 默认值：请刷证或刷码
        failVoice: '请刷证或刷码', // 刷脸失败默认语音 默认值：请刷证或刷码
        singlePageTime: 120, // 默认单选页时长(s) 默认值：120
        multiPageTime: 120, // 默认多选页时长(s) 默认值：120
        waitPageTime: 120, // 默认等待页时长(s) 默认值：120

        oneToOneTipsSwitch: true, // 1:1比对是否显示提醒页面  默认值：true
        oneToOneTips: '请面向屏幕刷脸', // 1:1比对提醒文字
        oneToOneVoice: '', // 1:1比对提醒语音

        showTopBar: false, // 是否显示通行统计  默认值：false
        leftTopBarText: '已/可通行人数',
        rightTopBarText: '今日刷脸成功人数',

        useSerialPort: 'default', // 	开门信号: 继电器/RS232 default/RS232 默认值：default
        doorSerialPort: '', // RS232开门串口地址
        relayOpenModel: 1, // 继电器开门模式 1-开-闭信号 2-开-门磁-闭信息
        openCloseInterval: 1000, // 开闭时间间隔（ms）
        signalInterval: 1000, // 信号间间隔（ms）
        doorSerialPortAddress: '', // 门磁串口地址
        gateTimeOut: 60, // 门磁超时时间（s）
        lightMode: 'auto', // 补光灯: 自动 auto 默认:auto
        ledBrightness: 200, // 补光灯亮度 0-200
        heartTrackingUrl:
          'https://hhomc.hz-hanghui.com:8096/middle-management/api/v1/device/heart/tracking', // 设备状态推送地址
        logPushUrl:
          'https://hhomc.hz-hanghui.com:8096/middle-management/api/v1/app/log/push', // 在线日志推送地址
        isOpenAgeLimit: false, // 是否开启年龄限制 默认值：false
        limitSectionStart: 0, // 限制年龄区间 开始
        limitSectionEnd: 18, // 限制年龄区间 结束
        ageForbidText: '未满18岁禁止进入', // 限制进入结果页标题
        isPushGM: false, // 是否推送门磁信号 默认值：false
        GMAddress: '', // 门磁信号推送地址
        GMFrequency: 1000, // 门磁信号推送频率(ms)
        pushFailedRecordSwitch: false, // 是否推送失败记录 默认值：false
        pushFailedRecordType: null, // 记录类型
        mpassword: '142536', // 管理员密码 默认值：142536
        volume: 100, // 语音音量 0-100 默认值：100
        hideNavigationBar: false, // 隐藏底部导航栏 默认值: false
        forbidPullDown: false, // 	禁止下拉通知栏 默认值: false
        autoLaunch: false, // 应用是否自启动 默认值: false
        scheduledRestart: false, // 是否开启定时重启 默认值: false
        scheduledRestartTime: null, // 定时重启时间HH:mm:ss 默认值:
        setPersonalList: [], // 设置人员列表
        showPersonalNumSwitch: true, // 预览页是否显示人员数量 默认值: true
        homePageUrl: null, // 首页图片配置
        transitionPageUrl: null, // 过渡图片配置
        previewPageUrl: null, // 预览页图片配置
        scanFaceFailedPageUrl: null// 刷脸失败结果页图片配置
      },
      rules: {
        templateName: [
          {
            required: true,
            whitespace: true,
            message: '不能为空!',
            trigger: ['change', 'blur']
          }
        ],
        ic14443ReaderBlock: [
          {
            // 自定义验证函数，见上说明
            validator: (rule, value, callback) => {
              const regex = /^\d+(?:,\d+)*$/
              if (value && value !== '' && !regex.test(value)) {
                return callback('必须数字用英文逗号隔开')
              }
              return callback()
            },
            trigger: ['change', 'blur']
          }
        ],
        ic15693ReaderBlock: [
          {
            // 自定义验证函数，见上说明
            validator: (rule, value, callback) => {
              const regex = /^\d+(?:,\d+)*$/
              if (value && value !== '' && !regex.test(value)) {
                return callback('必须数字用英文逗号隔开')
              }
              return callback()
            },
            trigger: ['change', 'blur']
          }
        ]
      },
      submitLoading: false,
      transitPushUrlList: [
        {
          value: 'https://tx.hz-hanghui.com:8088/yx-fyzd/EventRecords',
          desc: '塘栖平台'
        },
        {
          value: 'https://face.ldxk.edu.cn:8901/ywjl-fyzd/EventRecords',
          desc: '计量大学'
        },
        {
          value: 'http://172.19.21.131:9100/ywjl-fyzd/EventRecords',
          desc: '计量大学'
        },
        {
          value: 'https://ldb-airport.hz-hanghui.com:9100/ldb-airport/EventRecords',
          desc: '龙洞堡机场'
        },
        {
          value: 'http://192.168.99.11:9200/ldb-airport/EventRecords',
          desc: '龙洞堡机场'
        }
      ], // 推送接口地址输入建议
      heartTrackingUrlList: [
        {
          value: 'https://hhomc.hz-hanghui.com:8096/middle-management/api/v1/device/heart/tracking',
          desc: 'OTA中台'
        }
      ], // 设备状态推送地址输入建议
      logPushUrlList: [
        {
          value: 'https://hhomc.hz-hanghui.com:8096/middle-management/api/v1/app/log/push',
          desc: 'OTA中台'
        }
      ], // 在线日志推送地址输入建议
      specialCodeUrlList: [
        {
          value: 'https://tx.hz-hanghui.com:8088/hanghui-openapi/v1/proof/user/info/query',
          desc: '航汇特殊码换三要素接口地址（非加密）'
        }
      ], // 特殊码换三要素接口地址输入建议
      specialCodePrefixList: [
        {
          value: 'https://tx.hz-hanghui.com:8088',
          desc: '航汇二维码标识（首位）'
        }
      ], // 二维码标识（首位）输入建议
      userBlacklistInterfUrlList: [
        {
          value: 'https://ldb-airport.hz-hanghui.com:9100/ldb-airport/admin/userBlackTask/device/getBlackList',
          desc: '龙洞堡机场黑名单'
        }
      ], // 黑名单接口拉取接口地址输入建议
      websocketSubscribeUrlList: [
        {
          value: 'wss://jlj.hz-hanghui.com:18889/hhfacews',
          desc: '塘栖人脸管理平台'
        },
        {
          value: 'wss://face.ldxk.edu.cn:8901/hhfacews',
          desc: '计量人脸管理平台'
        }
      ], // 人脸管理平台-ws地址输入建议
      // 应用通信模式下拉
      communicationList: [
        { id: 1, name: 'HTTP' },
        { id: 2, name: 'WEBSOCKET' },
        { id: 3, name: 'SERIALPORT' }
      ],
      // 补光灯下拉
      lightModeLists: [
        {
          key: 'auto',
          value: '自动'
        },
        {
          key: 'close',
          value: '常关'
        },
        {
          key: 'open',
          value: '常开'
        }
      ],
      // 记录类型下拉
      // pushFailedRecordTypeList: [
      //   {
      //     key: 1,
      //     value: '年龄不符'
      //   },
      //   {
      //     key: 2,
      //     value: '黑名单'
      //   }
      // ],
      // 预览角度下拉
      previewAngleDropDown: [
        {
          key: 0,
          value: 0
        },
        {
          key: 90,
          value: 90
        },
        {
          key: 180,
          value: 180
        },
        {
          key: 270,
          value: 270
        }
      ]
    }
  },
  computed: {
    suspensionIsNotVerified() {
      return this.form.resultPageTemplate == 3
    }
  },
  mounted() {
    this.initData()
  },
  methods: {
    initData() {
      this.$nextTick(() => {
        if (this.obj) {
          console.log(this.obj)
          this.form = {
            ...this.obj
          }

          if (this.form.scheduledRestartTime) {
            this.form.scheduledRestartTime = parseTime(new Date(), '{y}-{m}-{d}') + ' ' + this.form.scheduledRestartTime
          }
        }
      })
    },
    // 状态切换 数据重置（改成提交时候重置）
    onSelectChange(field, value) {
    },
    querySearch(field, queryString, cb) {
      const restaurants = this[field]
      const results = queryString ? restaurants.filter(this.createFilter(queryString)) : restaurants
      // 调用 callback 返回建议列表的数据
      cb(results)
    },
    createFilter(queryString) {
      return (restaurant) => {
        return (restaurant.value.toLowerCase().indexOf(queryString.toLowerCase()) === 0)
      }
    },
    handleRemove(type) {
      if (type) {
        this.form[type] = null
      }
    },
    // 图片上传前
    beforeAvatarUpload(file) {
      if (
        !(
          file.type === 'image/png' ||
          file.type === 'image/gif' ||
          file.type === 'image/jpg' ||
          file.type === 'image/jpeg'
        )
      ) {
        this.$notify.warning({
          title: '警告',
          message:
            '请上传格式为image/png, image/gif, image/jpg, image/jpeg的图片'
        })
        return
      }
      const isLt2M = file.size / 1024 / 1024 < 2
      if (!isLt2M) {
        this.$notify.warning({
          title: '警告',
          message: '图片大小必须小于2M'
        })
        return
      }
    },
    doUploadAvatar(obj, type) {
      this.listLoading = true
      var avatar = new FormData()
      avatar.append('file', obj.file)
      pictureLocal(avatar).then((res) => {
        this.value = res.data
        this.listLoading = false
        this.$set(this.form, type, res.data)
      })
    },
    back() {
      this.$emit('back')
    },
    submit(e) {
      e.preventDefault()
      this.$refs.form.validate(async(valid) => {
        if (!valid) {
          return false
        }
        if (this.submitLoading) {
          return
        }
        this.submitLoading = true
        try {
          // 以下字段根据切换条件重置为默认值
          const fieldArr = [
            'resultPageTemplate', 'communicationMode', 'useIdcard', 'useQrcode', 'ic14443IcCardFunction', 'ic15693IcCardFunction', 'isOpenPassport', 'manualInIdCard',
            'qrCodeReaderCommunicationMode', 'faceFollowBoxSwitch',
            'usingBestImage', 'qualityControl', 'livingControl', 'oneToNFailShowTip',
            'useLinkage', 'checkVerifyEncryptSwitch', 'specialCodeSwitch',
            'userBlacklistSwitch', 'forbidPassSwitch', 'userBlacklistInterfFetchSwitch', 'userBlacklistEncryptSwitch',
            'transitPushSwitch', 'transitPushEncryptSwitch', 'showDisplayTimeByOpenTimesSwitch', 'oneToOneTipsSwitch',
            'showTopBar', 'useSerialPort', 'relayOpenModel',
            'isOpenAgeLimit', 'isPushGM', 'pushFailedRecordSwitch', 'homePageUrl', 'transitionPageUrl', 'previewPageUrl', 'scanFaceFailedPageUrl',
            'linkageCheckMode', 'scheduledRestart'
          ]
          fieldArr.forEach(field => {
            const fieldValue = this.form[field]
            switch (field) {
              case 'resultPageTemplate':
                // 模板类型：悬浮(无核验)
                if (this.suspensionIsNotVerified) {
                  this.form = {
                    ...this.form,
                    manualInIdCard: false, // 是否启用手动输入证件号
                    manualInUsePersonCard: false, // 启用手动输入证件号=> 是否人证比对 默认值：false

                    useLinkage: false, // 	启用核验接口 默认值：false
                    linkageAds: '', // 	核验接口地址

                    checkVerifyEncryptSwitch: true, // 核验接口数据是否加解密 默认值：true
                    checkVerifyEncryptAppKey: '', //
                    checkVerifyEncryptAppSecret: '', //
                    checkVerifyEncryptPrivateKey: '', //
                    checkVerifyRetryTimes: 1, // 核验接口失败重试次数
                    linkTimeout: 5, // 核验接口超时时间(s)
                    verifyRetryTimes: 2, // 核验接口失败重试次数(verify)
                    verifyLinkTimeout: 15, // 核验接口超时时间(s)(verify)
                    checkVerifyTimeoutTips: '核验接口超时', // 核验接口超时提示语
                    checkVerifyFailedTips: '核验接口失败', // 核验接口失败提示语

                    showDisplayTimeByOpenTimesSwitch: false, // 是否根据开门次数决定显示时长  默认值：false
                    onceOpenDoorTime: 2, // 单次开门时间(s) 默认值：2

                    singlePageTime: 120, // 默认单选页时长(s) 默认值：120
                    multiPageTime: 120, // 默认多选页时长(s) 默认值：120
                    waitPageTime: 120, // 默认等待页时长(s) 默认值：120

                    showTopBar: false, // 是否显示通行统计  默认值：false
                    leftTopBarText: '已/可通行人数',
                    rightTopBarText: '今日刷脸成功人数',

                    useSerialPort: 'default', // 	开门信号: 继电器/RS232 default/RS232 默认值：default
                    doorSerialPort: '' // RS232开门串口地址
                  }
                }
                break
              // 应用通信模式
              case 'communicationMode':
                if (fieldValue == 2) {
                  this.form.communicationSerialPort = '' // SERIALPORT地址
                } else if (fieldValue == 3) {
                  this.form.wsAddress = '' // WEBSOCKET地址
                } else {
                  this.form.wsAddress = '' // WEBSOCKET地址
                  this.form.communicationSerialPort = '' // SERIALPORT地址
                }
                break
              // 启用身份证功能
              case 'useIdcard':
                if (!fieldValue) {
                  this.form = {
                    ...this.form,
                    idCardReaderBrand: 4, // 身份证阅读器品牌 默认值：新中新阅读器
                    analysisPhoto: 1, // 是否解析身份证照片
                    analysisFingerprint: 0, // 是否解析身份证指纹
                    usePersonCard: false, // 	是否人证比对 默认值：false
                    idCardInterval: 7 // 	同证间隔时间(s) 默认值：7
                  }
                }
                break
              // 启用二维码功能
              case 'useQrcode':
                if (!fieldValue) {
                  this.form = {
                    ...this.form,
                    qrCodeReaderBrand: 5, // 二维码读头品牌 默认值：东信新款二维码读头
                    qrCodeReaderCommunicationMode: 1, // 二维码读头通信方式 默认值：虚拟串口
                    qrCodeReaderSerialPort: '', // 二维码读头串口地址
                    qrCodeInterval: 7, // 	同码间隔时间(s) 默认值：7
                    qrCodeUsePersonCard: false // 启用二维码功能=> 是否人证比对 默认值：false
                  }
                }
                break
              // 启用IC卡ISO14443A功能
              case 'ic14443IcCardFunction':
                if (!fieldValue) {
                  this.form = {
                    ...this.form,
                    ic14443ReaderBrand: 1, // 阅读器品牌 默认值：东信多合一内置
                    ic14443ReaderSectorNumbers: 15, // 读取扇区(0-99) 默认值：15
                    ic14443ReaderBlock: '0', // 读取块 长度100 默认值：0
                    ic14443ReaderKey: 'FFFFFFFFFFFF', // 读取密钥 默认值：FFFFFFFFFFFF
                    ic14443StartOffset: 0, // 起始偏移量(0-100) 默认值：0
                    ic14443EndOffset: 0, // 末尾偏移量(0-100) 默认值：0
                    ic14443PersonCardComparison: false, // 	是否人证比对 默认值：false
                    ic14443SameCardIntervalTime: 7 // 	同卡间隔时间(s) 0-20 默认值：7
                  }
                }
                break
              // 启用IC卡ISO15693功能
              case 'ic15693IcCardFunction':
                if (!fieldValue) {
                  this.form = {
                    ...this.form,
                    ic15693ReaderBrand: 1, // 阅读器品牌 默认值：东信多合一内置
                    ic15693ReaderBlock: '0', // 读取块 长度100 默认值：0
                    ic15693StartOffset: 0, // 起始偏移量(0-100) 默认值：0
                    ic15693EndOffset: 0, // 末尾偏移量(0-100) 默认值：0
                    ic15693PersonCardComparison: false, // 	是否人证比对 默认值：false
                    ic15693SameCardIntervalTime: 7 // 	同卡间隔时间(s) 0-20 默认值：7
                  }
                }
                break
              // 启用护照机功能
              case 'isOpenPassport':
                if (!fieldValue) {
                  this.form = {
                    ...this.form,
                    passportUsePersonCard: false // 启用护照机功能=> 是否人证比对 默认值：false
                  }
                }
                break
              // 是否启用手动输入证件号
              case 'manualInIdCard':
                if (!fieldValue) {
                  this.form = {
                    ...this.form,
                    manualInUsePersonCard: false // 启用手动输入证件号=> 是否人证比对 默认值：false
                  }
                }
                break
              // 二维码读头通信方式
              case 'qrCodeReaderCommunicationMode':
                if (fieldValue != '2') {
                  this.form.qrCodeReaderSerialPort = '' // 二维码读头串口地址
                }
                break
              // 是否显示人脸跟随框
              case 'faceFollowBoxSwitch':
                if (!fieldValue) {
                  this.form = {
                    ...this.form,
                    rgbRevert: false // 是否显示人脸跟随框 是 的子项 人脸跟随框是否镜像 默认：false
                  }
                }
                break
              // 视频流是否开启最优人脸检测
              case 'usingBestImage':
                if (!fieldValue) {
                  this.form = {
                    ...this.form,
                    bestImageScore: 90 // 人脸阈值(0-100) 默认：90
                  }
                }
                break
              // 视频流是否开启质量检测
              case 'qualityControl':
                if (!fieldValue) {
                  this.form = {
                    ...this.form,
                    blur: 0.15, // 模糊阈值(0-1) 默认：0.15
                    illum: 0.8 // 光照阈值(0-1) 默认：0.8
                  }
                }
                break
              // 视频流是否开启活体检测
              case 'livingControl':
                if (!fieldValue) {
                  this.form = {
                    ...this.form,
                    liveType: 1, // 活体检测模式 默认：RGB
                    rgbLiveScore: 0.8, // RGB可见光活体阈值(0-1) 默认：0.8
                    nirLiveScore: 0.8, // NIR近红外活体阈值(0-1) 默认：0.8
                    depthLiveScore: 0.8 // Depth深度活体阈值(3D结构光)(0-1) 默认：0.8
                  }
                }
                break
              // 1:N未通过是否显示提示语
              case 'oneToNFailShowTip':
                if (!fieldValue) {
                  this.form = {
                    ...this.form,
                    oneToNContinueFailTime: 3 // 1:N人脸连续未通过秒数(1-50) 默认：3
                  }
                }
                break
              // 启用核验接口
              case 'useLinkage':
                if (!fieldValue) {
                  this.form = {
                    ...this.form,
                    linkageAds: '', // 	核验接口地址
                    checkVerifyEncryptSwitch: true, // 核验接口数据是否加解密 默认值：true
                    checkVerifyEncryptAppKey: '',
                    checkVerifyEncryptAppSecret: '',
                    checkVerifyEncryptPrivateKey: '',
                    checkVerifyRetryTimes: 1, // 	核验接口失败重试次数
                    linkTimeout: 5, // 	核验接口超时时间(s)
                    verifyRetryTimes: 2, // 核验接口失败重试次数(verify)
                    verifyLinkTimeout: 15, // 核验接口超时时间(s)(verify)
                    checkVerifyTimeoutTips: '核验接口超时', // 核验接口超时提示语
                    checkVerifyFailedTips: '核验接口失败' // 核验接口失败提示语
                  }
                }
                break
              // 核验接口数据是否加解密
              case 'checkVerifyEncryptSwitch':
                if (!fieldValue) {
                  this.form = {
                    ...this.form,
                    checkVerifyEncryptAppKey: '',
                    checkVerifyEncryptAppSecret: '',
                    checkVerifyEncryptPrivateKey: ''
                  }
                }
                break
              // 启用特殊码换三要素接口
              case 'specialCodeSwitch':
                if (!fieldValue) {
                  this.form = {
                    ...this.form,
                    specialCodeUrl: '', // 特殊码换三要素接口地址
                    specialCodeTimeout: 5, // 特殊码换三要素接口超时时间(s)
                    specialCodeTimeoutTips: '特殊码换三要素接口请求超时', // 特殊码换三要素接口超时提示语
                    specialCodeFailedTips: '特殊码换三要素接口请求失败', // 特殊码换三要素接口失败提示语
                    specialCodePrefix: '' // 二维码标识（首位）
                  }
                }
                break
              // 开启黑名单
              case 'userBlacklistSwitch':
                if (!fieldValue) {
                  this.form = {
                    ...this.form,
                    forbidPassSwitch: true, // 是否阻止通行 默认值：true
                    forbidPassText: '禁止通行', // 阻止通行提示文本
                    forbidPassVoice: '禁止通行，请联系管理员', // 阻止通行提示语音
                    userBlacklistHitRule: ['PHONE'], // 命中条件 默认值身份证
                    userBlacklistInterfFetchSwitch: true, // 是否启用接口拉取 默认值：true
                    userBlacklistInterfUrl: '', // 接口地址
                    userBlacklistEncryptSwitch: true, // 黑名单数据是否加解密 默认值：true
                    userBlacklistEncryptAppKey: '', //
                    userBlacklistEncryptAppSecret: '', //
                    userBlacklistEncryptPrivateKey: '' //
                  }
                }
                break
              // 是否阻止通行
              case 'forbidPassSwitch':
                if (!fieldValue) {
                  this.form = {
                    ...this.form,
                    forbidPassText: '禁止通行', // 阻止通行提示文本
                    forbidPassVoice: '禁止通行，请联系管理员' // 阻止通行提示语音
                  }
                }
                break
              // 是否启用接口拉取
              case 'userBlacklistInterfFetchSwitch':
                if (!fieldValue) {
                  this.form = {
                    ...this.form,
                    userBlacklistInterfUrl: '' // 接口地址
                  }
                }
                break
              // 黑名单数据是否加解密
              case 'userBlacklistEncryptSwitch':
                if (!fieldValue) {
                  this.form = {
                    ...this.form,
                    userBlacklistEncryptAppKey: '', //
                    userBlacklistEncryptAppSecret: '', //
                    userBlacklistEncryptPrivateKey: '' //
                  }
                }
                break
              //  启用进出记录推送
              case 'transitPushSwitch':
                if (!fieldValue) {
                  this.form = {
                    ...this.form,
                    transitPushUrl: 'https://tx.hz-hanghui.com:8088/yx-fyzd/EventRecords', // 推送接口地址
                    inOutFilterRepeatTime: 0, // 进出记录滤重时间 默认：0 0-1200s
                    transitPushEncryptSwitch: false, // 推送接口数据是否加解密 默认值：false TODO ADD_FIELD
                    transitPushEncryptAppKey: '', // TODO ADD_FIELD
                    transitPushEncryptAppSecret: '', // TODO ADD_FIELD
                    transitPushEncryptPrivateKey: '' // TODO ADD_FIELD
                  }
                }
                break
              //  推送接口数据是否加解密
              case 'transitPushEncryptSwitch':
                if (!fieldValue) {
                  this.form = {
                    ...this.form,
                    transitPushEncryptAppKey: '', // TODO ADD_FIELD
                    transitPushEncryptAppSecret: '', // TODO ADD_FIELD
                    transitPushEncryptPrivateKey: '' // TODO ADD_FIELD
                  }
                }
                break
              // 是否根据开门次数决定显示时长
              case 'showDisplayTimeByOpenTimesSwitch':
                if (!fieldValue) {
                  this.form.onceOpenDoorTime = 2 // 单次开门时间(s) 默认值：2
                }
                break
              // 1:1比对是否显示提醒页面
              case 'oneToOneTipsSwitch':
                if (!fieldValue) {
                  this.form = {
                    ...this.form,
                    oneToOneTips: '请面向屏幕刷脸', // 1:1比对提醒文字
                    oneToOneVoice: '' // 1:1比对提醒语音
                  }
                }
                break
              // 是否显示通行统计
              case 'showTopBar':
                if (!fieldValue) {
                  this.form = {
                    ...this.form,
                    leftTopBarText: '已/可通行人数',
                    rightTopBarText: '今日刷脸成功人数'
                  }
                }
                break
              // 开门信号
              case 'useSerialPort':
                if (fieldValue !== 'RS232') {
                  this.form.doorSerialPort = '' // RS232开门串口地址
                }
                break
              // 继电器开门模式
              case 'relayOpenModel':
                if (fieldValue == 2) {
                  this.form = {
                    ...this.form,
                    openCloseInterval: 1000, // 开闭时间间隔（ms）
                    signalInterval: 1 // 信号间间隔（ms）
                  }
                } else if (fieldValue == 1) {
                  this.form = {
                    ...this.form,
                    doorSerialPortAddress: '', // 门磁串口地址
                    gateTimeOut: 60 // 门磁超时时间（s）
                  }
                }
                break
              // 是否开启年龄限制
              case 'isOpenAgeLimit':
                if (!fieldValue) {
                  this.form = {
                    ...this.form,
                    limitSectionStart: 0, // 限制年龄区间 开始
                    limitSectionEnd: 18, // 限制年龄区间 结束
                    ageForbidText: '未满18岁禁止进入' // 限制进入结果页标题
                  }
                }
                break
              // 是否推送门磁信号
              case 'isPushGM':
                if (!fieldValue) {
                  this.form = {
                    ...this.form,
                    GMAddress: '', // 门磁信号推送地址
                    GMFrequency: 1000 // 门磁信号推送频率(ms)
                  }
                }
                break
              // 是否推送失败记录
              case 'pushFailedRecordSwitch':
                if (!fieldValue) {
                  this.form = {
                    ...this.form,
                    pushFailedRecordType: null // 记录类型
                  }
                }
                break
              // 首页图片配置
              case 'homePageUrl':
                if (!fieldValue) {
                  this.form.homePageUrl =
                    'https://tx.hz-hanghui.com:8088/yx-fyzd/file/img/localHomePageUrl.jpg'
                }
                break
              // 过渡图片配置
              case 'transitionPageUrl':
                if (!fieldValue) {
                  this.form.transitionPageUrl =
                    'https://tx.hz-hanghui.com:8088/yx-fyzd/file/img/transitionPageUrl.jpg'
                }
                break
              // 预览页图片配置
              case 'previewPageUrl':
                if (!fieldValue) {
                  this.form.previewPageUrl =
                    'https://tx.hz-hanghui.com:8088/yx-fyzd/file/img/localPreviewPageUrl.jpg'
                }
                break
              // 刷脸失败结果页图片配置
              case 'scanFaceFailedPageUrl':
                if (!fieldValue) {
                  this.form.scanFaceFailedPageUrl =
                    'https://tx.hz-hanghui.com:8088/yx-fyzd/file/img/transitionPageUrl.jpg'
                }
                break
              // 校验模式
              case 'linkageCheckMode':
                if (fieldValue == 1) { // 通用 重置以下字段
                  this.form = {
                    ...this.form,
                    verifyRetryTimes: 2, // 核验接口失败重试次数(verify)
                    verifyLinkTimeout: 15 // 核验接口超时时间(s)(verify)
                  }
                }
                break
              // 是否开启定时重启
              case 'scheduledRestart':
                if (!fieldValue) {
                  this.form = {
                    ...this.form,
                    scheduledRestartTime: null // 定时重启时间
                  }
                }
                break
            }
          })
          if (this.form.scheduledRestartTime) {
            this.form.scheduledRestartTime = parseTime(this.form.scheduledRestartTime, '{h}:{i}:{s}')
          }
          console.log(this.form)
          await templateEdit(this.form)
          this.$message({
            message: `${this.form.deviceTemplateId ? '修改' : '添加'}配置模板成功!`,
            type: 'success'
          })
          this.$emit('back')
        } catch (e) {
          console.info('add', e)
        } finally {
          this.submitLoading = false
        }
      })
    }
  }
}
</script>

<style lang="scss" >
.my-autocomplete {
  li {
    padding: 5px 20px !important;

    .name {
      line-height: 20px !important;
      white-space: pre-wrap; /* 保留空白符，如果内容超过容器宽度则换行 */
      overflow-wrap: break-word; /* 在长单词或URL地址内部进行换行 */
    }
    .addr {
      font-size: 12px;
      color: #b4b4b4;
    }

    .highlighted .addr {
      color: #ddd;
    }
  }
}
</style>
<style lang="scss" scoped>
.card-footer {
  margin-top: 20px;
  display: flex;
  width: 100%;
  justify-content: center;
}
.wrap-content {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  &__item {
    width: calc(50% - 10px);
    padding: 10px 10px;
    .el-form-item {
      margin-bottom: 0px !important;
    }
  }
}
.wrap-content-detail {
  width: calc(100%);
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  position: relative;
  border: 1px solid #ebeef5;
  border-radius: 12px;
  padding: 10px;
  box-sizing: border-box;
  overflow: hidden;
  margin-bottom: 10px;
  &__title {
    position: absolute;
    background: white;
    height: 40px;
    line-height: 40px;
    top: -20px;
    z-index: 999;
    padding: 0 10px;
  }
  &__item {
    width: calc(50% - 10px);
    .el-form-item {
      padding: 10px 0px;
      margin-bottom: 0px !important;
    }
  }
}

.avatar-uploader .upload-default {
  border: 1px dashed #d9d9d9;
  border-radius: 0;
  cursor: pointer;
  width: 70px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}
.upload-default .avatar-uploader-icon {
  color: #8c939d;
  width: 22px;
  height: 18px;
  font-size: 20px;
  margin-top: 24px;
}
.upload-default .el-upload__text {
  margin-top: 8px;
  font-size: 14px;
  font-weight: 400;
  color: #ced3e3;
}
.upload-img {
  width: 50px;
  height: 91px;
  position: relative;
  img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    // border-radius: 12px;
  }
  .del-img {
    display: inline-block;
    width: 20px;
    height: 20px;
    background: #83878f;
    color: #fff;
    position: absolute;
    top: -12px;
    right: -10px;
    border-radius: 48%;
    line-height: 18px;
  }
}
</style>
