<template>
  <div class="m-container">
    <div class="m-core">
      <el-form :inline="true" :model="form" ref="form">
        <el-alert
          style="margin: 20px 0"
          title="线下课考勤定位范围"
          :closable="false"
          type="info"
        >
        </el-alert>
        <p class="subtitle">线下课考勤定位范围:</p>
        <el-row>
          <el-form-item
            prop="6"
            :rules="[
              {
                required: false,
                pattern: /^[1-9][0-9]*$/,
                message: '请输入正确的距离',
              },
            ]"
          >
            GPS定位距离教学点<el-input
              v-model="form['6']"
              placeholder="请输入距离"
            >
              <template slot="append">米</template>
            </el-input>
            以内。
          </el-form-item>
        </el-row>
        <p class="subtitle">签到签退定位异常:</p>
        <el-row>
          <el-form-item
            prop="138"
            :rules="[
              {
                required: false,
                pattern:
                  /(^[1-9]([0-9]+)?(\.[0-9]{1,2})?$)|(^(0){1}$)|(^[0-9]\.[0-9]([0-9])?$)/,
                message: '请输入正确的金额',
              },
            ]"
          >
            线下课签到地点未在教学点范围内，扣减课酬
            <el-input
              v-model="form['138']"
              placeholder="请输入金额"
              class="chiose"
            >
              <template slot="append">
                <el-select class="append" v-model.trim="form['139']">
                  <el-option label="元" value="1"> </el-option>
                  <el-option label="%" value="2"> </el-option>
                </el-select>
              </template>
            </el-input>。
          </el-form-item>
        </el-row>
        <el-row>
          <el-form-item
            prop="206"
            :rules="[
              {
                required: false,
                pattern:
                  /(^[1-9]([0-9]+)?(\.[0-9]{1,2})?$)|(^(0){1}$)|(^[0-9]\.[0-9]([0-9])?$)/,
                message: '请输入正确的金额',
              },
            ]"
          >
            线下课签退地点未在教学点范围内，扣减课酬
            <el-input
              v-model="form['206']"
              placeholder="请输入金额"
              class="chiose"
            >
              <template slot="append">
                <el-select class="append" v-model.trim="form['207']">
                  <el-option label="元" value="1"> </el-option>
                  <el-option label="%" value="2"> </el-option>
                </el-select>
              </template>
            </el-input>。
          </el-form-item>
        </el-row>
        <el-alert
          style="margin: 20px 0"
          title="签到规则"
          :closable="false"
          type="info"
        >
        </el-alert>
        <p class="subtitle">正常签到:</p>
        <el-row>
          <el-form-item
            prop="80"
            :rules="[
              {
                required: true,
                message: '请输入时间',
                trigger: 'blur',
              },
              {
                pattern: /^[1-9][0-9]*$/,
                message: '请输入正确的时间',
              },
            ]"
          >
            <span style="color: #f56c6c; margin-right: 4px">*</span>
            课程开始前
            <el-input v-model="form['80']" placeholder="请输入时间">
              <template slot="append">分钟</template>
            </el-input>
          </el-form-item>
          <el-form-item
            prop="140"
            :rules="[
              {
                required: false,
                message: '请输入时间',
                trigger: 'blur',
              },
              {
                pattern: /^0|[1-9][0-9]*$/,
                message: '请输入正确的时间',
              },
              { validator: this.validateMin, trigger: 'blur' },
            ]"
          >
            到课程开始前
            <el-input v-model="form['140']" placeholder="请输入时间">
              <template slot="append">分钟</template>
            </el-input>
            。
          </el-form-item>
        </el-row>
        <p class="example" v-if="form['80']">
          例:
          <span style="color: #f56c6c; margin-right: 4px">12:00:00</span>
          开始的课程，正常签到时间为
          <span style="color: #f56c6c; margin-right: 4px">{{
            reduceFormMinute("12:00:00", form["80"])
          }}</span
          >到<span style="color: #f56c6c; margin-right: 4px">{{
            reduceFormMinute("12:00:00", form["140"])
          }}</span>
          且最早
          <span style="color: #f56c6c; margin-right: 4px">{{
            reduceFormMinute("12:00:00", form["80"])
          }}</span
          >可以进行签到。
        </p>
        <p class="subtitle" v-if="form['140']">异常签到:</p>
        <el-row v-if="form['140']">
          <el-form-item
            prop="141"
            :rules="[
              {
                required: false,
                pattern:
                  /(^[1-9]([0-9]+)?(\.[0-9]{1,2})?$)|(^(0){1}$)|(^[0-9]\.[0-9]([0-9])?$)/,
                message: '请输入正确的金额',
              },
            ]"
          >
            未在课程开始
            <el-input disabled v-model="form['140']" placeholder="请输入时间">
              <template slot="append">分钟</template> </el-input
            >前签到，扣减课酬
            <el-input
              v-model="form['141']"
              placeholder="请输入金额"
              class="chiose"
            >
              <template slot="append">
                <el-select class="append" v-model.trim="form['142']">
                  <el-option label="元" value="1"> </el-option>
                  <el-option label="%" value="2"> </el-option>
                </el-select>
              </template>
            </el-input>。
          </el-form-item>
        </el-row>
        <p class="example" v-if="form['140']">
          例:
          <span style="color: #f56c6c; margin-right: 4px">12:00:00</span>
          开始的课程，异常签到时间为
          <span style="color: #f56c6c; margin-right: 4px">{{
            reduceFormMinuteAddS("12:00:00", form["140"])
          }}</span
          >到<span style="color: #f56c6c; margin-right: 4px">{{
            "12:00:00"
          }}</span>。
        </p>
        <p class="subtitle">迟到:</p>
        <el-row>
          <el-form-item
            prop="143"
            :rules="[
              {
                required: false,
                message: '请输入时间',
                trigger: 'blur',
              },
              {
                required: false,
                pattern: /^[1-9][0-9]*$/,
                message: '请输入正确的时间',
              },
            ]"
          >
            <!-- <span style="color: #f56c6c; margin-right: 4px">*</span> -->
            课程开始后到课程开始后
            <el-input v-model="form['143']" placeholder="请输入时间">
              <template slot="append">分钟</template>
            </el-input>
          </el-form-item>

          <el-form-item
            prop="144"
            :rules="[
              {
                required: false,
                pattern:
                  /(^[1-9]([0-9]+)?(\.[0-9]{1,2})?$)|(^(0){1}$)|(^[0-9]\.[0-9]([0-9])?$)/,
                message: '请输入正确的金额',
              },
            ]"
          >
            以内签到，扣减课酬
            <el-input
              v-model="form['144']"
              placeholder="请选择金额"
              class="chiose"
            >
              <template slot="append">
                <el-select class="append" v-model.trim="form['145']">
                  <el-option label="元" value="1"> </el-option>
                  <el-option label="%" value="2"> </el-option>
                </el-select>
              </template>
            </el-input>。
          </el-form-item>
        </el-row>
        <p class="example" v-if="form['143']">
          例:
          <span style="color: #f56c6c; margin-right: 4px">12:00:00</span>
          开始的课程，迟到签到时间为
          <span style="color: #f56c6c; margin-right: 4px">{{ "12:00:01" }}</span
          >到<span style="color: #f56c6c; margin-right: 4px">{{
            addFormMinute("12:00:00", form["143"])
          }}</span>。
        </p>
        <p class="subtitle">旷课:</p>
        <el-row>
          <el-form-item prop="143">
            课程开始
            <el-input
              :disabled="true"
              v-model="form['143']"
              placeholder="请输入时间"
            >
              <template slot="append">分钟</template>
            </el-input>
          </el-form-item>
          <el-form-item
            prop="147"
            :rules="[
              {
                required: false,
                pattern:
                  /(^[1-9]([0-9]+)?(\.[0-9]{1,2})?$)|(^(0){1}$)|(^[0-9]\.[0-9]([0-9])?$)/,
                message: '请输入正确的金额',
              },
            ]"
          >
            后签到，扣减课酬
            <el-input
              v-model="form['147']"
              placeholder="请输入金额"
              class="chiose"
            >
              <template slot="append">
                <el-select class="append" v-model.trim="form['148']">
                  <el-option label="元" value="1"> </el-option>
                  <el-option label="%" value="2"> </el-option>
                </el-select>
              </template>
            </el-input>。
          </el-form-item>
        </el-row>
        <p class="example" v-if="form['143']">
          例:
          <span style="color: #f56c6c; margin-right: 4px">12:00:00</span>
          开始的课程，旷课签到时间为
          <span style="color: #f56c6c; margin-right: 4px">{{
            addFormMinuteAddS("12:00:00", form["143"])
          }}</span>。
        </p>
        <p class="subtitle">未签到：</p>
        <el-row>
          <el-form-item
            prop="149"
            :rules="[
              {
                required: false,
                pattern:
                  /(^[1-9]([0-9]+)?(\.[0-9]{1,2})?$)|(^(0){1}$)|(^[0-9]\.[0-9]([0-9])?$)/,
                message: '请输入正确的金额',
              },
            ]"
          >
            扣减课酬
            <el-input
              v-model="form['149']"
              placeholder="请输入金额"
              class="chiose"
            >
              <template slot="append">
                <el-select class="append" v-model.trim="form['150']">
                  <el-option label="元" value="1"> </el-option>
                  <el-option label="%" value="2"> </el-option>
                </el-select>
              </template>
            </el-input>。
          </el-form-item>
        </el-row>
        <el-alert
          style="margin: 10px 0"
          title="签退规则"
          :closable="false"
          type="info"
        >
        </el-alert>
        <p class="subtitle">正常签退:</p>
        <el-row>
          <el-form-item
            prop="81"
            :rules="[
              {
                required: true,
                message: '请输入时间',
                trigger: 'blur',
              },
              {
                required: false,
                pattern: /^[1-9][0-9]*$/,
                message: '请输入正确的时间',
              },
            ]"
          >
            <span style="color: #f56c6c; margin-right: 4px">*</span>
            课程结束时间以后到课程结束后
            <el-input v-model="form['81']" placeholder="请输入时间">
              <template slot="append">分钟</template> </el-input
            >内签退。
          </el-form-item>
        </el-row>
        <p class="example" v-if="form['81']">
          例:
          <span style="color: #f56c6c; margin-right: 4px">13:00:00</span>
          结束的课程，正常签退时间为
          <span style="color: #f56c6c; margin-right: 4px">{{ "13:00:00" }}</span
          >到
          <span style="color: #f56c6c; margin-right: 4px">{{
            addFormMinute("13:00:00", form["81"])
          }}</span
          >,超过
          <span style="color: #f56c6c; margin-right: 4px">{{
            addFormMinute("13:00:00", form["81"])
          }}</span
          >无法签退。
        </p>

        <p class="subtitle">异常签退:</p>
        <el-row>
          课程结束前
          <el-input v-model="form['151']" placeholder="请输入时间">
            <template slot="append">分钟</template> </el-input
          >以后，到课程结束前签退为异常签退，扣减
          <el-form-item
            prop="152"
            :rules="[
              {
                required: false,
                pattern:
                  /(^[1-9]([0-9]+)?(\.[0-9]{1,2})?$)|(^(0){1}$)|(^[0-9]\.[0-9]([0-9])?$)/,
                message: '请输入正确的金额',
              },
            ]"
          >
            <el-input
              v-model="form['152']"
              placeholder="请输入金额"
              class="chiose"
            >
              <template slot="append">
                <el-select class="append" v-model.trim="form['153']">
                  <el-option label="元" value="1"> </el-option>
                  <el-option label="%" value="2"> </el-option>
                </el-select>
              </template>
            </el-input>。
          </el-form-item>
        </el-row>
        <p class="example" v-if="form['151']">
          例:
          <span style="color: #f56c6c; margin-right: 4px">13:00:00</span>
          结束的课程，异常签退时间为
          <span style="color: #f56c6c; margin-right: 4px">{{
            reduceFormMinute("13:00:00", form["151"])
          }}</span
          >到
          <span style="color: #f56c6c; margin-right: 4px">{{
            "12:59:59"
          }}</span>。
        </p>
        <p class="subtitle">早退:</p>
        <el-row>
          <el-form-item prop="151">
            <!-- <span style="color: #f56c6c; margin-right: 4px">*</span> -->
            课程结束前
            <el-input disabled v-model="form['151']" placeholder="请输入时间">
              <template slot="append">分钟</template>
            </el-input>
          </el-form-item>
          <el-form-item
            prop="155"
            :rules="[
              {
                required: false,
                pattern:
                  /(^[1-9]([0-9]+)?(\.[0-9]{1,2})?$)|(^(0){1}$)|(^[0-9]\.[0-9]([0-9])?$)/,
                message: '请输入正确的金额',
              },
            ]"
          >
            签退为异常签退，扣减
            <el-input
              v-model="form['155']"
              placeholder="请输入金额"
              class="chiose"
            >
              <template slot="append">
                <el-select class="append" v-model.trim="form['156']">
                  <el-option label="元" value="1"> </el-option>
                  <el-option label="%" value="2"> </el-option>
                </el-select>
              </template>
            </el-input>。
          </el-form-item>
        </el-row>
        <p class="example" v-if="form['151']">
          例:
          <span style="color: #f56c6c; margin-right: 4px">13:00:00</span>
          结束的课程，异常签退时间为
          <span style="color: #f56c6c; margin-right: 4px">{{
            reduceFormMinuteMS("13:00:00", form["151"])
          }}</span
          >之前。
        </p>
        <p class="subtitle">未签退:</p>
        <el-row>
          <el-form-item
            prop="157"
            :rules="[
              {
                required: false,
                pattern:
                  /(^[1-9]([0-9]+)?(\.[0-9]{1,2})?$)|(^(0){1}$)|(^[0-9]\.[0-9]([0-9])?$)/,
                message: '请输入正确的金额',
              },
            ]"
          >
            课程未签退扣减课酬
            <el-input
              v-model="form['157']"
              placeholder="请输入金额"
              class="chiose"
            >
              <template slot="append">
                <el-select class="append" v-model.trim="form['158']">
                  <el-option label="元" value="1"> </el-option>
                  <el-option label="%" value="2"> </el-option>
                </el-select>
              </template>
            </el-input>。
          </el-form-item>
        </el-row>
        <p class="subtitle">签退提醒:</p>
        <el-row>
          <el-form-item
            prop="14"
            :rules="[
              {
                required: false,
                pattern: /^[1-9][0-9]*$/,
                message: '请输入正确的时间',
              },
            ]"
          >
            课程结束
            <el-input v-model="form['14']" placeholder="请输入时间">
              <template slot="append">分钟</template>
            </el-input>
            后，对未签退老师发送短信提醒。
          </el-form-item>
        </el-row>
        <el-alert
          style="margin: 10px 0"
          title="乐团线下连堂课"
          :closable="false"
          type="info"
        >
        </el-alert>
        <p class="subtitle">
          乐团线下连堂课：
          <el-tooltip placement="top" popper-class="mTooltip">
            <div slot="content">
              <p style="color: #fff">
                1.同一天同一个老师，同一个教学点，上一节课的结束时间与下一节课的开始时间在N分钟内视为连堂课，老师第一节有签到记录，第二节课只要在考勤范围内，课程结束之前签到就是正常签到，签退按照正常考勤规则签退。
              </p>
              <p style="color: #fff">
                2.同一天同一个老师不同教学点，有两节以上的课程，第一节课有签到记录，后面的课程只要在考勤范围内，课程结束之前签到都是正常签到，退按照正常考勤规则签退。
              </p>
            </div>
            <i
              class="el-icon-question micon el-tooltip"
              style="font-size: 18px; color: #f56c6c"
            ></i>
          </el-tooltip>
        </p>
        <el-row>
          <el-form-item
            prop="178"
            :rules="[
              {
                required: false,
                pattern: /^[1-9][0-9]*$/,
                message: '请输入正确的时间',
              },
            ]"
          >
            乐团线下课程间隔
            <el-input v-model="form['178']" placeholder="请输入时间">
              <template slot="append">分钟</template>
            </el-input>
            以内视为连堂课。
          </el-form-item>
        </el-row>
        <el-alert
          style="margin: 10px 0"
          title="VIP课点名规则"
          :closable="false"
          type="info"
        >
        </el-alert>
        <!-- <p class="subtitle">未点名：</p> -->
        <!-- <el-row>
          未点名扣减课酬
          <el-input v-model="form.num" placeholder="请输入金额"  class="chiose">
            <template slot="append" >
              <el-select class="append" v-model.trim="form.organId" >
                <el-option label="元" value="1"> </el-option>
                <el-option label="%" value="2"> </el-option>
              </el-select>
            </template>
          </el-input>
        </el-row> -->
        <p class="subtitle">点名时间范围：</p>
        <el-row>
          <el-form-item
            prop="39"
            :rules="[
              {
                required: false,
                pattern: /^[1-9][0-9]*$/,
                message: '请输入正确的时间',
              },
            ]"
          >
           VIP线下课可点名时间范围为课程开始前
            <el-input v-model="form['39']" placeholder="请输入时间">
              <template slot="append">分钟</template>
            </el-input>
          </el-form-item>
          <el-form-item
            prop="40"
            :rules="[
              {
                required: false,
                pattern: /^[1-9][0-9]*$/,
                message: '请输入正确的时间',
              },
            ]"
          >
            至课程结束后
            <el-input v-model="form['40']" placeholder="请输入时间">
              <template slot="append">分钟</template>
            </el-input>不填则当天内都能点名。
          </el-form-item>
        </el-row>
        <el-alert
          style="margin: 10px 0"
          title="试用期课酬"
          :closable="false"
          type="info"
        />
        <p class="subtitle">试用期课酬规则：</p>
        <el-row>
          <el-form-item
            prop="180"
            :rules="[
              { pattern: /^([1-9]\d?|100)$/, message: '请输入正确的百分比' },
            ]"
          >
            试用期内的课程按预计课酬
            <el-input v-model="form['180']" placeholder="请输入百分比">
              <template slot="append">%</template>
            </el-input>结算。
          </el-form-item>
        </el-row>
        <el-alert
          style="margin: 10px 0"
          title="考勤申诉规则"
          :closable="false"
          type="info"
        />

        <p class="subtitle">考勤申诉:课程结束后，如果考勤异常，老师可以在APP端进行考勤申诉，但已结算的课程无法再进行申诉，系统常规会在次月6号进行结算。</p>
        <el-row>
          全职老师
          <el-select
            v-model.trim="form['184']"
            placeholder="申述方式"
            @change="
              () => {
                $set(form, '183', null);
              }
            "
          >
            <el-option label="按时间" value="1"> </el-option>
            <el-option label="按日期" value="2"> </el-option>
          </el-select>
          <span v-if="form['184'] == 1">
            <el-form-item
              prop="183"
              :rules="[
                {
                  required: false,
                  pattern: /^[1-9][0-9]*$/,
                  message: '请输入正确的时间',
                },
              ]"
            >
              在课程结束后
              <el-input v-model="form['183']" placeholder="请输入时间">
                <template slot="append">分钟</template> </el-input
              >内可以提交考勤申诉。
            </el-form-item>
          </span>
          <span v-if="form['184'] == 2">
            <el-form-item
              prop="183"
              :rules="[
                {
                  required: false,
                  pattern: /^[1-9][0-9]*$/,
                  message: '请输入正确的时间',
                },
              ]"
            >
              在次月
              <el-input v-model="form['183']" placeholder="请输入时间">
                <template slot="append">号</template> </el-input
              >内可以提交考勤申诉。</el-form-item
            >
          </span>
        </el-row>
        <el-row>
          兼职老师
          <el-select
            v-model.trim="form['182']"
            placeholder="申述方式"
            @change="
              () => {
                $set(form, '181', null);
              }
            "
          >
            <el-option label="按时间" value="1"> </el-option>
            <el-option label="按日期" value="2"> </el-option>
          </el-select>
          <span v-if="form['182'] == 1">
            <el-form-item
              prop="181"
              :rules="[
                {
                  required: false,
                  pattern: /^[1-9][0-9]*$/,
                  message: '请输入正确的时间',
                },
              ]"
            >
              在课程结束后
              <el-input v-model="form['181']" placeholder="请输入时间">
                <template slot="append">分钟</template> </el-input
              >内可以提交考勤申诉。
            </el-form-item>
          </span>
          <span v-if="form['182'] == 2">
            <el-form-item
              prop="181"
              :rules="[
                {
                  required: false,
                  pattern: /^[1-9][0-9]*$/,
                  message: '请输入正确的时间',
                },
              ]"
            >
              在次月
              <el-input v-model="form['181']" placeholder="请输入时间">
                <template slot="append">号</template> </el-input
              >内可以提交考勤申诉。</el-form-item
            >
          </span>
        </el-row>
        <el-row>
          劳务老师
          <el-select
            v-model.trim="form['186']"
            placeholder="申述方式"
            @change="
              () => {
                $set(form, '185', null);
              }
            "
          >
            <el-option label="按时间" value="1"> </el-option>
            <el-option label="按日期" value="2"> </el-option>
          </el-select>
          <span v-if="form['186'] == 1">
            <el-form-item
              prop="185"
              :rules="[
                {
                  required: false,
                  pattern: /^[1-9][0-9]*$/,
                  message: '请输入正确的时间',
                },
              ]"
            >
              在课程结束后
              <el-input v-model="form['185']" placeholder="请输入时间">
                <template slot="append">分钟</template> </el-input
              >内可以提交考勤申诉。
            </el-form-item>
          </span>
          <span span v-if="form['186'] == 2">
            <el-form-item
              prop="185"
              :rules="[
                {
                  required: false,
                  pattern: /^[1-9][0-9]*$/,
                  message: '请输入正确的时间',
                },
              ]"
            >
              在次月
              <el-input v-model="form['185']" placeholder="请输入时间">
                <template slot="append">号</template> </el-input
              >内可以提交考勤申诉。</el-form-item
            >
          </span>
        </el-row>
      </el-form>
      <el-button
        type="primary"
        @click="save"
        class="saveBtn"
        v-if="!isPlatform"
        v-permission="'sysTenantConfig/batchUpSet_offlineTeamRules'"
        >保存</el-button
      >
      <el-button
        type="primary"
        @click="save"
        class="saveBtn"
        v-else
        v-permission="'sysConfig/batchUpdate_offlineTeamRules'"
        >保存</el-button
      >
    </div>
  </div>
</template>
<script>
import { getSysTenantConfig, setSysTenantConfig } from "../api";
import { sysConfigList, sysConfigUpdate } from "@/api/generalSettings"; // 平台的修改和查
import {
  addFormMinute,
  addFormMinuteAddS,
  reduceFormMinute,
  reduceFormMinuteAddS,
  addFormMinuteMS,
  reduceFormMinuteMS,
} from "@/utils/date";
export default {
  props: ["isPlatform"],
  data() {
    return {
      form: {},
      questionList: [],
      rulesVisiable: false,
    };
  },
  async mounted() {
    this.getRules();
  },
  methods: {
    getRules() {
      if (this.isPlatform) {
        this.getPlatformRules();
      } else {
        this.getInstitutionRules();
      }
    },
    async getPlatformRules() {
      try {
        const res = await sysConfigList({ group: "OFFLINE" });
        res.data.forEach((item) => {
          // this.form[item.paramName] = item.paranValue
          this.$set(this.form, item.id, item.paranValue);
        });
        // this.$forceUpdate()
        console.log(this.form);
      } catch (e) {
        console.log(e);
      }
    },
    async getInstitutionRules() {
      try {
        const res = await getSysTenantConfig({ group: "OFFLINE" });
        res.data.forEach((item) => {
          // this.form[item.paramName] = item.paranValue
          this.$set(this.form, item.id, item.paranValue);
        });
        // this.$forceUpdate()
        console.log(this.form);
      } catch (e) {
        console.log(e);
      }
    },
    savePlatform() {
      this.$refs.form.validate(async (valid) => {
        if (valid) {
          let param = [];
          for (let i in this.form) {
            param.push({
              id: i,
              paranValue: this.form[i],
            });
          }
          try {
            const res = await sysConfigUpdate(param);
            this.$message.success("保存成功");
            this.getRules();
          } catch (e) {
            console.log(e);
          }
        }
      });
    },
    saveInstitution() {
      this.$refs.form.validate(async (valid) => {
        if (valid) {
          let param = [];
          for (let i in this.form) {
            param.push({
              id: i,
              paranValue: this.form[i],
            });
          }
          try {
            const res = await setSysTenantConfig(param);
            this.$message.success("保存成功");
            this.getRules();
          } catch (e) {
            console.log(e);
          }
        }
      });
    },
    save() {
      if (this.isPlatform) {
        this.savePlatform();
      } else {
        this.saveInstitution();
      }
    },
    addFormMinute(timerStr, time) {
      return addFormMinute(timerStr, time);
    },
    addFormMinuteAddS(timerStr, time) {
      return addFormMinuteAddS(timerStr, time);
    },
    reduceFormMinute(timerStr, time) {
      return reduceFormMinute(timerStr, time);
    },
    reduceFormMinuteAddS(timerStr, time) {
      return reduceFormMinuteAddS(timerStr, time);
    },
    addFormMinuteMS(timerStr, time) {
      return addFormMinuteMS(timerStr, time);
    },
    reduceFormMinuteMS(timerStr, time) {
      return reduceFormMinuteMS(timerStr, time);
    },
    validateMin(rule, value, callback) {
      const one = Number(value);
      const max = Number(this.form[80]);
      if (!max || one < max) {
        return callback();
      }
      return callback(new Error(`最早可提前${this.form[80] - 1}分钟进入教室`));
    },
  },
};
</script>
<style lang="scss" scoped>
@import "../index.scss";
</style>
