<template>
  <div class="app-container" style="overflow: hidden">
    <el-container>
      <el-header style="padding: 0px;height: 24px">
        <span style="float: right">
          <el-button @click="debug = !debug" v-if="true">DEBUG {{ debug }}</el-button>
          <el-button v-if="this.type === 'add' || this.type === 'edit'" type="primary" @click="submitForm"
                     icon="el-icon-circle-check">{{ $t('common.confirm') }}</el-button>
          <el-button @click="cancel" icon="el-icon-remove-outline">{{ $t('common.cancel') }}</el-button>
        </span>
      </el-header>
      <el-container style="margin-top: 16px">
        <el-aside class="container-aside">
          <el-card class="aside-card">
            <div v-for="(item, index) in asideCardList" :key="index"
                 :class="asideCardList[index].value === true ? 'aside-div-checked' : 'aside-div-unchecked'"
                 @click="clickAside(index)">
              {{ item.label }}
            </div>
          </el-card>
        </el-aside>
        <el-main class="container-main">
          <div ref="scrollContainer" style="overflow: auto;height: calc(100vh - 200px);border-radius: 6px"
               @scroll="listenScroll">
            <el-form ref="form" :model="form" :rules="rules" label-width="200px" label-position="top">
              <!--基本信息-->
              <el-card class="main-card">
                <div class="form-div">
                  <!-- 电梯类型-->
                  <el-form-item :label="$t('paraLibrary.elevatorType')" prop="elevatorType">
                    <el-select :disabled="disableFlag" v-model="form.elevatorType" class="w-100"
                               @change="elevatorTypeChange"
                               :placeholder="$t('common.pleaseSelect') + $t('paraLibrary.elevatorType')">
                      <el-option v-for="dict in dict.type.elevator_type" :key="dict.value" :label="dict.label"
                                 :value="dict.value"/>
                    </el-select>
                  </el-form-item>
                </div>
                <div class="form-div">
                  <!-- 电梯型号-->
                  <el-form-item :label="$t('elevatorModel.elevatorModel')" prop="elevatorModelId">
                    <el-select :disabled="disableFlag" v-model="form.elevatorModelId" class="w-100"
                               @change="elevatorModelChange"
                               :placeholder="$t('common.pleaseSelect') + $t('elevatorModel.elevatorModel')">
                      <el-option v-for="dict in elevatorModelList" :key="Number(dict.value)" :label="dict.label"
                                 :value="Number(dict.value)"/>
                    </el-select>
                  </el-form-item>
                </div>
                <div class="form-div">
                  <!-- 电梯编号-->
                  <el-form-item :label="$t('quotation.elevatorNo')" prop="elevatorCode">
                    <el-input :disabled="disableFlag" v-model.trim="form.elevatorCode" :placeholder="$t('common.pleaseInput') + $t('quotation.elevatorNo')"
                              @input="e => form.elevatorCode = replaceGroupCode(e)" maxlength="10" class="w-100"/>
                  </el-form-item>
                </div>
                <div class="form-div">
                  <!-- 偏移量X-->
                  <el-form-item :label="$t('elevator.offsetX')" prop="offsetX">
                    <el-input :disabled="disableFlag" v-model.trim="form.offsetX" :placeholder="$t('common.pleaseInput') + $t('elevator.offsetX')"
                              maxlength="20" class="w-100"/>
                  </el-form-item>
                </div>
                <div class="form-div">
                  <!-- 偏移量Y-->
                  <el-form-item :label="$t('elevator.offsetY')" prop="offsetY">
                    <el-input :disabled="disableFlag" v-model.trim="form.offsetY" :placeholder="$t('common.pleaseInput') + $t('elevator.offsetY')"
                              maxlength="20" class="w-100"/>
                  </el-form-item>
                </div>
                <div class="form-div">
                  <!-- 排列序号-->
                  <el-form-item :label="$t('elevator.sortNum')" prop="sortNumber">
                    <el-input-number :disabled="disableFlag" v-model.trim="form.sortNumber" :placeholder="$t('common.pleaseInput') + $t('elevator.sortNum')"
                                     :min="0" class="w-100" :step="1" :max="999999" :controls="false" :precision="0"/>
                  </el-form-item>
                </div>
              </el-card>

              <!-- 后台获取参数-->
              <el-card class="main-card mt30 ts-form-item" v-for="(card, pIndex) in paramCategoryList" :id="'renderCard' + pIndex"
                       v-if="(card.isShow && card.enabled) || debug">
                <div v-for="(item, index) in card.paramList" :key="'basic' + index" class="form-div"
                     v-if="(item.isShow && item.enabled) || debug">
                  <el-form-item :prop="paramCategoryList[pIndex].paramList[index].paraCode">
                    <template slot="label">
                      <el-tooltip :content="item['label'+localLabelSuffix]" placement="top-start" :tabindex="-1">
                        <span>{{ item['label' + localLabelSuffix] }}</span>
                      </el-tooltip>
                      <span v-if="item.inputType === '04'" style="font-size: 10px;font-weight: normal">({{ $t('quotation.otherOptions') }})</span>
                    </template>
                    <!--                    输入框-->
                    <el-input :disabled="disableFlag||getUnEditable(paramCategoryList[pIndex].paramList[index].paraCode)" v-model="paramCategoryList[pIndex].paramList[index].finalValue"
                              :placeholder="$t('common.pleaseInput') + item['label'+localLabelSuffix]" v-if="item.inputType === '00'" maxlength="60" @change="paramChange(item,true)"/>
                    <!--                    整数输入框-->
                    <el-input-number :disabled="disableFlag||getUnEditable(paramCategoryList[pIndex].paramList[index].paraCode)" :controls="false"
                                     v-model="paramCategoryList[pIndex].paramList[index].finalValue" class="w-100" @change="paramChange(item,true)" :max="999999999999999999" :min="0"
                                     :placeholder="$t('common.pleaseInput') + item['label'+localLabelSuffix]" v-if="item.inputType === '01'"/>
                    <!--                    下拉框-->
                    <el-select :disabled="disableFlag||getUnEditable(paramCategoryList[pIndex].paramList[index].paraCode)" filterable clearable
                               v-model="paramCategoryList[pIndex].paramList[index].finalValue" class="w-100" @change="paramChange(item,true)"
                               :placeholder="$t('common.pleaseSelect') + item['label'+localLabelSuffix]" v-if="item.inputType === '02'">
                      <el-option v-for="(dict,optIndex) in item.paramOptionList" :key="dict.value + optIndex" v-if="dict.isShow"
                                 :value="dict.value" :label="dict['label'+localLabelSuffix]">
                        <span style="float: left">{{ dict['label' + localLabelSuffix] }}</span>
                        <span style="float: right; color: #8492a6; font-size: 13px" v-if="dict.paraSource">
                                                  <el-popover
                                                    placement="top"
                                                    offset="170"
                                                    trigger="hover">
                                                    <span slot="reference">
                                                      <el-image :key="dict.value" :src="baseApi + dict.paraSource" style="width: 34px;height: 34px">
                                                          <div slot="error">
                                                              <div class="err-div" style="width: 34px;height: 34px;font-size: 6px">{{ $t('quotation.noImg') }}</div>
                                                          </div>
                                                          <div slot="placeholder">
                                                             <div class="err-div" style="width: 34px;height: 34px;font-size: 6px">{{ $t('quotation.noImg') }}</div>
                                                          </div>
                                                      </el-image>
                                                    </span>
                                                    <span><el-image :key="dict.value" :src="baseApi + dict.paraSource" style="width: 400px;height: 400px">
                                                          <div slot="error">
                                                              <div class="err-div" style="width: 400px;height: 400px">{{ $t('quotation.noImg') }}</div>
                                                          </div>
                                                          <div slot="placeholder">
                                                             <div class="err-div" style="width: 400px;height: 400px">{{ $t('quotation.noImg') }}</div>
                                                          </div>
                                                    </el-image></span>
                                                    </el-popover>
                                                </span>
                      </el-option>
                    </el-select>
                    <!--                    小数输入框-->
                    <el-input-number :disabled="disableFlag||getUnEditable(paramCategoryList[pIndex].paramList[index].paraCode)" :precision="2" :controls="false"
                                     v-model="paramCategoryList[pIndex].paramList[index].finalValue" class="w-100" @change="paramChange(item,true)" :max="999999999999999999.99" :min="0"
                                     :placeholder="$t('common.pleaseInput') + item['label'+localLabelSuffix]" v-if="item.inputType === '03'"/>
                    <!--                    可输入下拉框-->
                    <el-select :disabled="disableFlag||getUnEditable(paramCategoryList[pIndex].paramList[index].paraCode)" filterable clearable allow-create default-first-option maxlength="60"
                               v-model="paramCategoryList[pIndex].paramList[index].finalValue" class="w-100" @change="paramChange(item,true)"
                               :placeholder="$t('common.pleaseSelect') + item['label'+localLabelSuffix]" v-if="item.inputType === '04'">
                      <el-option v-for="(dict,optIndex) in item.paramOptionList" :key="dict.value + optIndex" v-if="dict.isShow"
                                 :value="dict.value" :label="dict['label'+localLabelSuffix]">
                        <span style="float: left">{{ dict['label' + localLabelSuffix] }}</span>
                        <span style="float: right; color: #8492a6; font-size: 13px" v-if="dict.paraSource">
                                                  <el-popover
                                                    placement="top"
                                                    offset="170"
                                                    trigger="hover">
                                                    <span slot="reference">
                                                        <el-image :key="dict.value" :src="baseApi + dict.paraSource" style="width: 34px;height: 34px">
                                                          <div slot="error">
                                                              <div class="err-div" style="width: 34px;height: 34px;font-size: 6px">{{ $t('quotation.noImg') }}</div>
                                                          </div>
                                                          <div slot="placeholder">
                                                             <div class="err-div" style="width: 34px;height: 34px;font-size: 6px">{{ $t('quotation.noImg') }}</div>
                                                          </div>
                                                      </el-image>
                                                    </span>
                                                    <span><el-image :key="dict.value" :src="baseApi + dict.paraSource" style="width: 400px;height: 400px">
                                                          <div slot="error">
                                                              <div class="err-div" style="width: 400px;height: 400px">{{ $t('quotation.noImg') }}</div>
                                                          </div>
                                                          <div slot="placeholder">
                                                             <div class="err-div" style="width: 400px;height: 400px">{{ $t('quotation.noImg') }}</div>
                                                          </div>
                                                    </el-image></span>
                                                    </el-popover>
                                                </span>
                      </el-option>
                    </el-select>
                    <!--                    复选框-->
                    <el-checkbox :disabled="disableFlag||getUnEditable(paramCategoryList[pIndex].paramList[index].paraCode)"
                                 v-model="paramCategoryList[pIndex].paramList[index].finalValue" v-if="item.inputType === '05'"
                                 :true-label="'Yes'" :false-label="'No'" class="para-checkbox" @change="paramChange(item,true)">
                      <span style="font-weight: 700;line-height: 36px;font-size: 14px;color:#606266">{{ item['label' + localLabelSuffix] }}</span>
                    </el-checkbox>

                  </el-form-item>
                </div>
              </el-card>
              <!--              楼层参数-->
<!--              <el-card class="main-card mt30" id="renderCard1002">
                <el-button type="primary" icon="el-icon-plus" size="mini" @click="addLine" v-if="!disableFlag">
                  {{ $t('elevator.addFloorParam') }}
                </el-button>
                <el-button size="mini" plain icon="el-icon-delete" @click="deleteLine" :disabled="deleteDisabled" v-if="!disableFlag">
                  {{ $t('elevator.delFloorParam') }}
                </el-button>
                <el-table :data="floorParamList" @selection-change="floorParamSelection" :style="disableFlag ? '':'margin-top: 10px'"
                          :header-cell-style="tableHeaderStyle" :border="true">
                  <el-table-column prop="selection" type="selection" width="40" v-if="!disableFlag" key="selection"></el-table-column>
                  &lt;!&ndash;                  序号&ndash;&gt;
                  <el-table-column label="No." type="index" width="50" align="center" key="no" min-width="200px"></el-table-column>
                  &lt;!&ndash;                  楼层显示&ndash;&gt;
                  <el-table-column :label="$t('elevator.floorDisplay')" prop="floorDisplay" min-width="400" key="floorDisplay">
                    <template slot-scope="scope">
                      <el-input v-model="scope.row.floorDisplay" :disabled="disableFlag" maxlength="50"
                                :placeholder="$t('common.pleaseInput') + $t('elevator.floorDisplay')"></el-input>
                    </template>
                  </el-table-column>
                  &lt;!&ndash;                  楼层高度&ndash;&gt;
                  <el-table-column :label="$t('elevator.floorHeight')" prop="floorHeight" min-width="400" key="floorHeight">
                    <template slot-scope="scope">
                      <el-input v-model="scope.row.floorHeight" :disabled="disableFlag" maxlength="50"
                                :placeholder="$t('common.pleaseInput') + $t('elevator.floorHeight')"></el-input>
                    </template>
                  </el-table-column>
                </el-table>
              </el-card>-->
            </el-form>
          </div>
        </el-main>
      </el-container>
    </el-container>
  </div>
</template>


<script>
import {listElevatorParam, listModelNewAll, listNewAllParam} from "@/api/business/crm/elevatorModel";
import {getInfoByTpElevatorModelId} from "@/api/business/crm/paraRelatedCase/relatedCase";
import store from '@/store'
import {checkElevatorParam, computeResult} from "@/api/business/crm/paraValidation/paraValidation";
import {getToken} from "@/utils/auth";
import {listSpecification} from "@/api/business/quotation/specification";
import {selectElevator} from "@/api/business/civil/elevator";
import {getCountry} from "@/api/user/country";

const labelSuffix = {
  chinese: '',
  english: 'US',
  russia: 'RU',
  spanish: 'ES',
}

export default {
  name: "Elevator",
  components: {},
  dicts: ['elevator_type'],
  data() {
    return {
      // 国家
      country: null,
      // 国家Id
      countryId: null,
      // 下载文件url前缀
      baseApi: process.env.VUE_APP_BASE_API,
      // 楼层参数多选
      multipleSelection: [],
      // 楼层参数列表
      floorParamList: [],
      // 表头style
      tableHeaderStyle: {'background-color': '#F4F6F8', 'border-right': '1px solid #dfdcdc', 'color': '#92A2B5'},
      // 删除非标描述是否可用
      deleteDisabled: true,
      // 非标列表
      // nonStandardList: [],
      // 调试标记
      debug: false,

      paramCategoryList: [],
      // 侧面卡片
      asideCardList: [
        {'label': this.$t('lead.baseInfo'), 'value': true},
        // {'label': this.$t('elevator.floorParam'), 'value': false}
      ],
      // 每个模块的滚定条值
      mainScrollList: [0],
      scrollTop: 10,
      form: {
        elevatorType: null,
        elevatorModelId: null,
        elevatorCode: null,
        offsetX: '0',
        offsetY: '0',
        sortNumber: 0,
      },
      type: null,
      disableFlag: false,
      // 电梯型号列表（下拉）
      elevatorModelList: [],
      // 电梯型号列表（全部）
      allElevatorModelList: [],
      rules: {
        elevatorType: [
          {required: true, message: this.$t('common.pleaseSelect') + this.$t('paraLibrary.elevatorType'), trigger: 'change'}
        ],
        elevatorModelId: [
          {required: true, message: this.$t('common.pleaseSelect') + this.$t('elevatorModel.elevatorModel'), trigger: 'change'}
        ],
        elevatorCode: [
          {required: true, message: this.$t('common.pleaseInput') + this.$t('quotation.elevatorNo'), trigger: 'blur'}
        ],
        offsetX: [
          {required: true, message: this.$t('common.pleaseInput') + this.$t('elevator.offsetX'), trigger: 'blur'}
        ],
        offsetY: [
          {required: true, message: this.$t('common.pleaseInput') + this.$t('elevator.offsetY'), trigger: 'blur'}
        ],
        sortNumber: [
          {required: true, message: this.$t('common.pleaseInput') + this.$t('elevator.sortNum'), trigger: 'blur'}
        ],
      },
      quotationId: null,
      plotId: null,
      elevatorId: null,
      // 实时参数联动规则
      ruleList: {},
      // 提交时参数联动规则
      onCommitRuleList: [],
      // 非活性Map
      unEditAble: new Set(),
      scrollDisabledFlag: false,
      // 参数联动循环次数
      loopTimes: 0,
      // 已存在的电梯编号
      existedElevatorCodeSet: new Set(),
      // 规格配置参数的特殊符号
      code: '$_$',
      // 联动结果是否改变值
      isChangeResult: false,
    };
  },
  async created() {
    this.$modal.loading()
    this.existedElevatorCodeSet = this.$store.state.elevators.existedElevatorCodeSet
    console.log('已存在的电梯编号', this.existedElevatorCodeSet)
    this.quotationId = this.$route.query && this.$route.query.quotationId;
    this.plotId = this.$route.query && this.$route.query.plotId;
    this.areaId = this.$route.query && this.$route.query.areaId;
    this.countryId = this.$route.query && this.$route.query.countryId;
    this.initType();
    this.getCountryByCountryId()
    await this.initElevatorModel();
    // 新增电梯时初始化电梯排列序号
    if (this.type === 'add') {
      let maxSort = this.$route.query && this.$route.query.maxSort;
      this.form.sortNumber = maxSort ? maxSort : 0
    }
    // 页面回填

    await this.fillData();
    this.isChangeResult = true
    // this.renderAsideCard();
    this.$modal.closeLoading();
  },
  async activated() {
    this.initType();
  },
  computed: {
    localLabelSuffix() {
      return labelSuffix[this.$i18n.locale] || '';
    }
  },
  watch: {
    asideCardList() {
      setTimeout(() => {
        this.initScrollList()
        console.log('滚动条渲染结束')
      }, 1000)
    }
  },
  methods: {
    // 根据  countryId  获取country
    getCountryByCountryId() {
      if (this.countryId) {
        getCountry(this.countryId).then(response => {
          try {
            this.country = response.data.countryName
          } catch (e) {
          }
          console.log('国家详细信息', this.country, response)
        })
      } else {
        console.log('无法获取国家，countryId 为空')
      }
    },
    // 替换电梯组号内的特殊符号
    replaceGroupCode(value) {
      if (value) {
        return value.replaceAll(',', '').replaceAll(':', '').replaceAll(' ', '')
      } else {
        return value
      }
    },
    // 楼层参数增加行
    addLine() {
      this.floorParamList.push({
        'floorDisplay': null,
        'floorHeight': null
      })
      for (let i = 0; i < this.floorParamList.length; i++) {
        this.floorParamList[i].index = i;
      }
    },
    // 楼层参数删除行
    deleteLine() {
      this.multipleSelection.forEach((account) => {
        this.floorParamList = this.floorParamList.filter((item) => {
          return item.index !== account.index;
        });
      });
      for (let i = 0; i < this.floorParamList.length; i++) {
        this.floorParamList[i].index = i;
      }
    },
    // 楼层参数多选
    floorParamSelection(selection) {
      this.multipleSelection = selection;
      this.deleteDisabled = this.multipleSelection.length === 0;
    },
    // 参数变更
    async paramChange(item, isFirst) {
      if (isFirst === true) {
        this.loopTimes = 0
      } else {
        this.loopTimes += 1
      }
      console.log('++++++++++++++++++当前循环次数 [' + this.loopTimes + ']')
      if (this.loopTimes > 10000) {
        console.log('参数联动循环次数大于10000次，循环停止');
        return;
      }
      if (this.type === 'view' || this.type === 'detail') {
        // 查看/详情时参数联动失效
        return
      }
      console.log('参数变更', item)
      let rules = this.ruleList[item.paraCode];
      if (rules && rules.length > 0) {
        if (isFirst === true) {
          this.$modal.loading();
        }
        //判断项目是否存在联动关系中
        for (let i = 0; i < rules.length; i++) {
          let ruleItem = rules[i]
          let ruleItemConditionList = ruleItem.condition
          //判断if条件中 是 and 还是or
          let rule = ruleItem.relationship
          console.log('[ ' + ruleItem.caseName + ' ] 参数联动')
          //判断结果，存多个，后面如果if条件是and,那resultList中，但凡有一个FALSE，就不满足，如果条件是or，但凡有一个True，就满足
          let resultList = []
          for (let j = 0; j < ruleItemConditionList.length; j++) {
            let condition = ruleItemConditionList[j]
            //判断当前修改的控件对应的项目，所选值是否满足联动条件
            if (condition.param == item.paraCode) {
              let formualResult = this.formualCalc(item.finalValue, condition.formula, condition.value)
              resultList.push(formualResult)
            } else {
              //判断联动条件中，非当前修改的控件对应的项目，所选值是否满足联动条件
              for (let a = 0; a < this.paramCategoryList.length; a++) {
                let paramCategory = this.paramCategoryList[a]
                for (let b = 0; b < paramCategory.paramList.length; b++) {
                  let otherItem = paramCategory.paramList[b];
                  if (otherItem.paraCode == condition.paraCode) {
                    // 优先获取装潢包参数值
                    let calcValue = otherItem.decorateValue
                    if (otherItem.enabled) {
                      calcValue = otherItem.finalValue
                    }
                    let conditionValue = condition.value
                    // 如果是参数值，则先获取
                    if (condition.valueType == '1') {
                      conditionValue = this.getParamValue(condition.value);
                      console.log('参数联动条件 参数值获取: 编码 [' + condition.value + '] 获取值 [' + conditionValue + ']')
                    } else {
                      console.log('参数联动条件 普通参数值 [' + condition.value + '] ')
                    }
                    let otherResult = this.formualCalc(calcValue, condition.operation, conditionValue)
                    resultList.push(otherResult)
                  }
                }
              }
            }
          }
          console.log('判断结果计算', resultList)
          //只有一个条件的情况
          if (ruleItemConditionList.length === 1) {
            //满足条件
            if (resultList[0]) {
              console.log('开始满足一个条件，执行联动结果')
              //满足条件，执行联动结果
              await this.executeLinkResult(ruleItem.result, true)
            } else {
              // console.log('开始不满足一个条件，执行联动结果')
              // //   不满足条件，执行联动结果
              // this.restoreLinkResult(ruleItem.result)
            }
          } else {
            //存在多个条件的情况，也要考虑不满足条件，联动结果的选项，退回原来的可选list
            //都要满足 and
            if ('00' == rule) {
              if (resultList.indexOf(false) < 0) {
                //执行联动结果
                console.log('开始满足多个条件 && ，执行联动结果')
                //满足条件，执行联动结果
                await this.executeLinkResult(ruleItem.result, true)
              } else {
                // console.log('开始不满足多个条件 && ，执行联动结果')
                //   不满足条件，执行联动结果
                // this.restoreLinkResult(ruleItem.result)
              }
            } else {
              //满足其一 or

              if (resultList.indexOf(true) > -1) {
                //执行联动结果
                console.log('开始满足多个条件 || ，执行联动结果')
                //满足条件，执行联动结果
                await this.executeLinkResult(ruleItem.result, true)
              } else {
                // console.log('开始不满足多个条件 || ，执行联动结果')
                //   不满足条件，执行联动结果
                // this.restoreLinkResult(ruleItem.result)
              }
            }
          }
        }
      }

      if (isFirst === true) {
        this.renderAsideCard()
        this.$modal.closeLoading();
      }
    },
    async executeLinkResult(ruleResultList, needNext) {
      for (let i = 0; i < ruleResultList.length; i++) {
        let result = ruleResultList[i]
        for (let a = 0; a < this.paramCategoryList.length; a++) {
          let paramCategory = this.paramCategoryList[a]
          for (let b = 0; b < paramCategory.paramList.length; b++) {
            let param = paramCategory.paramList[b];
            if (param.paraCode == result.paraCode) {
              console.log('联动结果', result)

              let resultValue = result.value;
              if (result.computedFlag === '1') {
                console.log('联动结果是公式', result.valueFormulaTxt)
                let form = {
                  formula: result.valueFormulaTxt,
                  paramList: this.getParamList(),
                }
                console.log('参数联动计算请求参数', form)
                let response = await computeResult(form)
                if (response.data.result === true) {
                  resultValue = response.data.calculateValue
                } else {
                  console.log('[' + result.valueFormulaTxt + ']无法计算联动结果')
                  continue
                }
                console.log('联动结果是公式', resultValue)
              }
              console.log('联动结果值', resultValue)
              let originalValue = this.paramCategoryList[a].paramList[b].finalValue
              console.log("isChangeResult:"+ this.isChangeResult)
              // 修改值   输入框直接赋值
              if (param.inputType != '02' && param.inputType != '04' && this.isChangeResult) {
                //this.paramCategoryList[a].paramList[b].finalValue = resultValue

                this.$set(this.paramCategoryList[a].paramList[b],"finalValue",this.getValue(resultValue))
              }

              // 修改下拉的可选项
              if (result.optionList !== null && result.optionList.length > 0) {
                this.paramCategoryList[a].paramList[b].paramOptionList.forEach(dpItem => {
                  dpItem.isShow = result.optionList.some(item => item.value == dpItem.value)
                })

                // 修改选中值  下拉框 如果目前的选中值，在可选范围则不变，否则清空
                // 当前选中值
                let currentValue = this.paramCategoryList[a].paramList[b].finalValue
                console.log('当前值', currentValue)
                console.log('当选下拉可选值', result.optionList)
                if (result.optionList.some(item => item.value == currentValue)) {
                  // 在可选范围，但是设定了默认值
                  if (resultValue && this.isChangeResult) {
                    this.paramCategoryList[a].paramList[b].finalValue = resultValue
                  }
                } else {
                  if (this.isChangeResult) {
                    // 不在可选范围
                    this.paramCategoryList[a].paramList[b].finalValue = resultValue
                  }
                }
              } else {
                console.log(result.paraName + '无下拉选项', result)
              }
              console.log('满足一个条件，执行联动结果', this.paramCategoryList[a].paramList[b])
              if (this.isChangeResult && result.emptyFlag === '1') {
                if (this.paramCategoryList[a].paramList[b].inputType === '05') {
                  console.log('复选框强制清除 ', this.paramCategoryList[a].paramList[b].label)
                  this.paramCategoryList[a].paramList[b].finalValue = 'No'
                } else {
                  console.log('非复选框强制清除 ', this.paramCategoryList[a].paramList[b].label)
                  this.paramCategoryList[a].paramList[b].finalValue = undefined
                }
              }

              // 非活性时禁止编辑  1：非活性  0：活性
              if ('1' === result.editable) {
                this.unEditAble.add(result.paraCode)
              } else {
                this.unEditAble.delete(result.paraCode)
              }
              // 显示不显示  0：显示  1：隐藏
              if ('0' === result.displayFlag) {
                console.log(this.paramCategoryList[a].paramList[b].label + ' 显示')
                this.paramCategoryList[a].paramList[b].isShow = true
              } else {
                console.log(this.paramCategoryList[a].paramList[b].label + ' 隐藏')
                this.paramCategoryList[a].paramList[b].isShow = false
              }
              // 如果参数存在且有变化，继续执行参数联动
              let flag1 = this.paramCategoryList[a].paramList[b].finalValue;
              let flag2 = this.paramCategoryList[a].paramList[b].finalValue != originalValue
              if (flag1 && flag2 && needNext === true) {
                console.log('继续执行参数联动[' + flag1 + '] [' + flag2 + ']', this.paramCategoryList[a].paramList[b])
                await this.paramChange(this.paramCategoryList[a].paramList[b])
              } else {
                console.log('不继续执行参数联动[' + flag1 + '] [' + flag2 + ']', this.paramCategoryList[a].paramList[b])
              }
              //   参数联动结束
            }
          }
        }
      }
    },
    restoreLinkResult(ruleResultList) {
      ruleResultList.forEach(result => {
        for (let a = 0; a < this.paramCategoryList.length; a++) {
          let paramCategory = this.paramCategoryList[a]
          for (let b = 0; b < paramCategory.paramList.length; b++) {
            let param = paramCategory.paramList[b];
            if (param.paraCode == result.paraCode) {
              // 参数包配置参数不修改
              if (param.paramType === '02') {
                console.log('跳过参数包配置参数', param)
                continue
              }
              // 修改下拉的可选项
              console.log('不满足一个条件，执行联动结果选项日志,【' + result.paraCode + '】重置')
              if (this.paramCategoryList[a].paramList[b] !== null) {
                this.paramCategoryList[a].paramList[b].paramOptionList.forEach(dpItem => {
                  dpItem.isShow = true
                })
              }
              this.unEditAble.delete(result.paraCode)
            }

          }
        }
      })
    },
    formualCalc(param, formula, value) {
      console.log('[' + param + ']   [' + formula + ']  [' + value + ']')
      if (!param) {
        if (formula == '不包含') {
          console.log('页面填写参数为空，且不包含 true')
          return true
        } else {
          console.log('页面填写参数为空 false')
          return false
        }
      }
      switch (formula) {
        case '<':
          return Number(param) < Number(value)
        case '>':
          return Number(param) > Number(value)
        case '<=':
          return Number(param) <= Number(value)
        case '>=':
          return Number(param) >= Number(value)
        case '=':
          return param == value
        case '包含':
          return value.indexOf(param) > -1
        case '不包含':
          return value.indexOf(param) === -1
      }
    },
    async fillData() {
      console.log('页面数据回填 [' + this.type + ']', this.type === 'view' || this.type === 'edit' || this.type === 'detail')
      if (this.type === 'view' || this.type === 'edit' || this.type === 'detail') {
        this.elevatorId = this.$route.query && this.$route.query.elevatorId;
        let fillData = this.$store.state.elevators[this.elevatorId]
        console.log('页面回填数据', fillData);
        if (!fillData) {
          // 缓存没找到从后端获取
          if (this.elevatorId) {
            let data = await selectElevator(this.elevatorId)
            fillData = data.data
            if (!fillData) {
              console.log('页面回填数据获取失败');
              return
            }
          }
        }
        // 编辑报价单关联的电梯
        this.form.quotationId = fillData.quotationId
        // 添加方式
        this.form.addType = fillData.addType
        this.form.elevatorType = fillData.elevatorType
        await this.elevatorTypeChange(fillData.elevatorType)
        this.form.elevatorModelId = fillData.elevatorModelId
        await this.elevatorModelChange(fillData.elevatorModelId, false)
        // this.form.count = fillData.elevatorNumber
        this.form.offsetX = fillData.offsetX
        this.form.offsetY = fillData.offsetY
        this.form.elevatorCode = fillData.elevatorCode
        this.form.sortNumber = fillData.sortNumber
        if (fillData.floorParamList) {
          this.floorParamList = fillData.floorParamList
        }

        // 参数值列表 =》 参数值map   key: category_code  value： value
        let fillParamMap = new Map();
        if (fillData.paramList != null && fillData.paramList.length > 0) {
          fillData.paramList.forEach(item => {
            fillParamMap.set(item.paraCategory + '_' + item.paraCode, item.paraValue)
          })
        }

        console.log('回填数据map', fillParamMap)
        for (let j = 0; j < this.paramCategoryList.length; j++) {
          // 参数类别
          let paramCategory = this.paramCategoryList[j]
          for (let k = 0; k < paramCategory.paramList.length; k++) {
            let fillValue = fillParamMap.get(paramCategory.paraCategory + '_' + paramCategory.paramList[k].paraCode)
            this.paramCategoryList[j].paramList[k].finalValue = this.getValue(fillValue);
          }
        }
        // 参数联动
        for (let j = 0; j < this.paramCategoryList.length; j++) {
          // 参数类别
          let paramCategory = this.paramCategoryList[j]
          for (let k = 0; k < paramCategory.paramList.length; k++) {
            if (this.paramCategoryList[j].paramList[k].paramType !== '01') {
              await this.paramChange(this.paramCategoryList[j].paramList[k])
            }
          }
        }
        // 重新渲染对应高度
        this.initScrollList()
      }
    },
    // 电梯型号切换
    async elevatorModelChange(key, needLink) {
      this.$modal.loading();
      if (key) {
        let cases = await getInfoByTpElevatorModelId(key)
        console.log('参数联动规则', cases.data)
        // 实时
        if (cases.data && cases.data.realTime) {
          this.ruleList = cases.data.realTime
        } else {
          this.ruleList = {}
        }
        // 提交时
        if (cases.data && cases.data.onCommit) {
          this.onCommitRuleList = cases.data.onCommit
        } else {
          this.onCommitRuleList = []
        }
        let response = {}
        if (this.type === 'detail') {
          console.log("从电梯参数获取参数")
          response = await listElevatorParam(this.elevatorId, {quotationFlag: false})
        } else {
          console.log("从区域电梯获取参数")
          response = await listNewAllParam(key, {quotationFlag: false})
        }
        let resultList = response.data.categoryList
        for (let j = 0; j < resultList.length; j++) {
          // 参数类别
          let paramCategory = resultList[j]
          for (let k = 0; k < paramCategory.paramList.length; k++) {
            // 将finalValue为null 的参数值变更为 undefined ,防止组件显示异常
            if (resultList[j].paramList[k].finalValue === null) {
              resultList[j].paramList[k].finalValue = undefined
            }
            // 赋值 '国家'参数，从项目获取
            if (resultList[j].paramList[k].paraCode == 'COUNTRY') {
              if (this.country) {
                resultList[j].paramList[k].finalValue = this.country
                resultList[j].paramList[k].paramOptionList = []
                resultList[j].paramList[k].paramOptionList.push(
                  {
                    'isShow': true,
                    'label': this.country,
                    'labelES': this.country,
                    'labelRU': this.country,
                    'labelUS': this.country,
                    'paraSource': null,
                    'paraBarDetailValueList': null,
                    'value': this.country,
                  }
                )
              } else {
                console.log('国家 赋值失败')
              }
            }
          }
        }
        this.paramCategoryList = resultList

        if (needLink !== false) {
          console.log('参数联动start')
          // 参数联动
          for (let j = 0; j < this.paramCategoryList.length; j++) {
            // 参数类别
            let paramCategory = this.paramCategoryList[j]
            for (let k = 0; k < paramCategory.paramList.length; k++) {
              this.paramChange(this.paramCategoryList[j].paramList[k])
            }
          }
          console.log('参数联动end')
        }
        console.log('电梯参数列表', this.paramCategoryList)
        this.renderAsideCard()

      } else {
        this.renderAsideCard()
      }
      this.$modal.closeLoading();
    },
    // 电梯类型切换
    async elevatorTypeChange(key) {
      let checkElevatorModeList = this.allElevatorModelList.filter(item => item.elevatorType === key)
      this.elevatorModelList = []
      checkElevatorModeList.forEach(item => {
        this.elevatorModelList.push(
          {
            'label': item.elevatorModel,
            'value': item.id,
          }
        )
      })
      // 清空电梯型号，选配参数，侧边卡片
      this.form.elevatorModelId = null
      this.paramCategoryList = []
      this.unEditAble = new Set();
      this.renderAsideCard()
    },
    async initElevatorModel() {
      let form = {}
      if (this.type === 'detail') {
        form = {
          needAll: true
        }
      } else {
        form = {
          // areaId: [this.areaId]
          countryId: this.countryId,
        }
      }
      const response = await listModelNewAll(form);
      if (response.rows) {
        this.allElevatorModelList = response.rows
      }
    },
    initScrollList() {
      this.mainScrollList = [0]
      for (let i = 0; i < this.paramCategoryList.length; i++) {
        if (this.paramCategoryList[i].isShow && this.paramCategoryList[i].enabled) {
          // 计算每个卡片的滚动条位置
          let div = document.getElementById('renderCard' + i);
          this.mainScrollList.push(div.offsetTop - 57)
        }
      }
      // let div2 = document.getElementById('renderCard1002');
      // this.mainScrollList.push(div2.offsetTop - 57)
    },
    // 渲染左侧卡片
    renderAsideCard() {
      let index = 0
      for (let i = 0; i < this.asideCardList.length; i++) {
        if (this.asideCardList[i].value) {
          index = i
        }
      }
      let newAsideCardList = []
      newAsideCardList.push({'label': this.$t('lead.baseInfo'), 'value': false})
      let newList = this.paramCategoryList.filter(item => item.isShow && item.enabled)
      for (let i = 0; i < newList.length; i++) {
        newAsideCardList.push({'label': newList[i]['label' + this.localLabelSuffix], 'value': false})
      }
      newAsideCardList.push({'label': this.$t('elevator.floorParam'), 'value': false})
      if (newAsideCardList.length > index) {
        newAsideCardList[index].value = true
      }
      this.asideCardList = newAsideCardList;
    },
    initType() {
      this.type = this.$route.query && this.$route.query.type;
      this.accountTitle = this.$t('elevator.view');
      switch (this.type) {
        case 'add':
          this.accountTitle = this.$t('elevator.add');
          this.disableFlag = false
          break;
        case 'edit':
          this.accountTitle = this.$t('elevator.edit');
          this.disableFlag = false
          break;
        case 'view':
          this.accountTitle = this.$t('elevator.view');
          this.disableFlag = true
          break;
        case 'detail':
          this.accountTitle = this.$t('elevator.view');
          this.disableFlag = true
          break;
      }
      console.log('标题', this.accountTitle)
      const obj = Object.assign({}, this.$route, {title: this.accountTitle})
      this.$tab.updatePage(obj);
    },
    async submitForm() {
      this.$modal.loading()
      console.log(this.floorParamList)
      if (this.floorParamList && this.floorParamList.length > 0) {
        for (let i = 0; i < this.floorParamList.length; i++) {
          if (!this.floorParamList[i].floorDisplay || !this.floorParamList[i].floorHeight) {
            this.$message.error(this.$t('elevator.floorParamEmpty'))
            this.$modal.closeLoading()
            return
          }
        }
      }
      let config = await this.getSpecification('quoatation.specification:' + this.form.elevatorType)
      let configMap = new Map()
      // this.$refs['form'].validate((valid) => {
      let valid = false
      try {
        valid = await this.$refs['form'].validate()
      } catch (e) {

      }
      console.log('表单验证结果', valid)
      if (!valid) {
        this.$modal.closeLoading()
      } else {
        // 判断电梯编号是否重复
        console.log('电梯编号', this.form.elevatorCode)
        console.log('已有电梯编号', this.existedElevatorCodeSet)
        console.log(this.existedElevatorCodeSet.has(this.form.elevatorCode))
        if (this.existedElevatorCodeSet.has(this.form.elevatorCode)) {
          this.$message.error(this.$t('elevator.duplicateElevatorNo'))
          this.$modal.closeLoading()
          return
        }
        // 执行提交时参数联动
        if (this.onCommitRuleList && this.onCommitRuleList.length > 0) {
          console.log('执行提交时参数联动++++++++++++++++START++++++++++++++++++++')
          // 提交时参数联动
          for (let i = 0; i < this.onCommitRuleList.length; i++) {
            let ruleItem = this.onCommitRuleList[i]
            // 参数联动逻辑运算符
            let ruleItemConditionList = ruleItem.condition
            let rule = ruleItem.relationship
            // 条件结果
            let resultList = []
            for (let j = 0; j < ruleItemConditionList.length; j++) {
              let condition = ruleItemConditionList[j]
              //判断联动条件中，非当前修改的控件对应的项目，所选值是否满足联动条件
              for (let a = 0; a < this.paramCategoryList.length; a++) {
                let paramCategory = this.paramCategoryList[a]
                for (let b = 0; b < paramCategory.paramList.length; b++) {
                  let otherItem = paramCategory.paramList[b];
                  if (otherItem.paraCode == condition.paraCode) {
                    // 优先获取装潢包参数值
                    let calcValue = otherItem.finalValue
                    let conditionValue = condition.value
                    // 如果是参数值，则先获取
                    if (condition.valueType == '1') {
                      conditionValue = this.getParamValue(condition.value);
                      console.log('参数联动条件 参数值获取: 编码 [' + condition.value + '] 获取值 [' + conditionValue + ']')
                    } else {
                      console.log('参数联动条件 普通参数值 [' + condition.value + '] ')
                    }
                    let otherResult = this.formualCalc(calcValue, condition.operation, conditionValue)
                    resultList.push(otherResult)
                  }
                }
              }
            }
            console.log('判断结果计算', resultList)
            //只有一个条件的情况
            if (ruleItemConditionList.length === 1) {
              //满足条件
              if (resultList[0]) {
                console.log('开始满足一个条件，执行联动结果')
                //满足条件，执行联动结果
                await this.executeLinkResult(ruleItem.result, false)
              }
            } else {
              //存在多个条件的情况，也要考虑不满足条件，联动结果的选项，退回原来的可选list
              //都要满足 and
              if ('00' == rule) {
                if (resultList.indexOf(false) < 0) {
                  //执行联动结果
                  console.log('开始满足多个条件 && ，执行联动结果')
                  //满足条件，执行联动结果
                  await this.executeLinkResult(ruleItem.result, false)
                }
              } else {
                //满足其一 or

                if (resultList.indexOf(true) > -1) {
                  //执行联动结果
                  console.log('开始满足多个条件 || ，执行联动结果')
                  //满足条件，执行联动结果
                  await this.executeLinkResult(ruleItem.result, false)
                }
              }
            }
          }
          console.log('执行提交时参数联动++++++++++++++++ END ++++++++++++++++++++')
        } else {
          console.log('无提交时参数联动')
        }


        // 组装传递数据
        let elevatorModelName = this.elevatorModelList.filter(item => item.value === this.form.elevatorModelId)[0]?.label
        let storage = {...this.form}
        if (this.elevatorId) {
          storage.id = this.elevatorId
        } else {
          storage.id = Date.now()
        }
        // 获取规则的各项参数，拼接展示
        storage.elevatorModel = elevatorModelName
        //电梯数量固定等于1
        // storage.elevatorNumber = storage.count
        if (!storage.addType) {
          storage.addType = '01'
        }
        storage.floorParamList = this.floorParamList
        let paramListForm = []
        for (let j = 0; j < this.paramCategoryList.length; j++) {
          // 参数类别
          let paramCategory = this.paramCategoryList[j]
          for (let k = 0; k < paramCategory.paramList.length; k++) {
            if (paramCategory.paramList[k].enabled) {
              paramListForm.push({
                paramType: paramCategory.paramList[k].paramType,
                parabarId: paramCategory.paramList[k].parabarId,
                parabarDetailId: paramCategory.paramList[k].parabarDetailId,
                paraValue: paramCategory.paramList[k].finalValue,
                paraCode: paramCategory.paramList[k].paraCode,
                paraCategory: paramCategory.paraCategory
              })
              if (config.indexOf(this.code + paramCategory.paramList[k].paraCode + this.code) !== -1) {
                configMap.set(this.code + paramCategory.paramList[k].paraCode + this.code, paramCategory.paramList[k].finalValue)
              }
            } else {
              console.log('跳过参数', paramCategory.paramList[k])
            }
          }
        }
        // 电梯规格
        configMap.forEach((value, key) => {
          let replaceValue = value ? value : ''
          config = config.replaceAll(key, replaceValue)
        });
        // 异常电梯规格格式化
        if (config.indexOf(this.code) !== -1) {
          let configList = config.split(this.code);
          // 2的倍数
          if (Math.log2(configList.length) % 1 === 0) {
            config = config.replaceAll(this.code, '')
          } else {
            for (let i = 0; i < configList.length; i++) {
              if ((i & 1) === 1) {
                configList[i] = ''
              }
            }
            config = configList.join('');
          }
        }

        storage.specification = config
        console.log('电梯规格', config)
        storage.paramList = paramListForm
        // let quotationIdFlag = this.quotationId != null
        let checkParamForm = {
          elevatorModelId: this.form.elevatorModelId,
          paramList: paramListForm,
          quotationFlag: false
        }
        console.log('电梯参数校验参数', checkParamForm)
        checkElevatorParam(checkParamForm).then(response => {
          if (response.data != null && response.data.length > 0) {
            let message = ''
            for (let i = 0; i < response.data.length; i++) {
              let item = response.data[i]
              message += item['resultFalse' + this.localLabelSuffix]
              if (i !== response.data.length - 1) {
                message += '<br>'
              }
            }
            let up = '<div style="word-break: break-all;">'
            let down = '</div>'
            this.$notify.error({
              title: this.$t('elevator.rulesResult'),
              message: up + message + down,
              // 毫秒
              duration: 1000 * 30,
              dangerouslyUseHTMLString: true,
            });
          } else {
            store.commit('PUT_ELEVATOR', storage)
            console.log('电梯保存 ' + storage.id + '  ,', storage)
            if (this.plotId) {
              this.$tab.closeOpenPage({path: "/civil/plot-view", query: {elevatorId: storage.id}})
            } else {
              this.$tab.closeOpenPage({path: "/civil/plot-add", query: {elevatorId: storage.id}})
            }
            let msg = this.$t('common.addSuccess')
            if (this.type === 'edit') {
              msg = this.$t('common.editSuccess')
            }
            this.$message.success(msg)
          }
        }).finally(() => {
          this.$modal.closeLoading()
        })
      }
      // });
    },
    cancel() {
      if (this.plotId) {
        this.$tab.closeOpenPage({path: "/civil/plot-view", query: {id: this.plotId}})
      } else {
        this.$tab.closeOpenPage({path: "/civil/plot-add"})
      }
    },
    // 监听滚动条
    listenScroll(event) {
      if (this.scrollDisabledFlag) {
        this.scrollDisabledFlag = false
        return;
      }
      let scrollTop = event.target.scrollTop;
      for (let i = 0; i < this.mainScrollList.length; i++) {
        if (this.mainScrollList[i] <= scrollTop && scrollTop < this.mainScrollList[i + 1]) {
          this.checkAside(i)
          return
        } else if (i === this.mainScrollList.length - 1 && scrollTop > this.mainScrollList[i]) {
          // 选中最后一条
          this.checkAside(i)
          return
        }
      }
    }
    ,
    // 左侧导航条点击事件
    clickAside(index) {
      this.checkAside(index)
      this.scrollDisabledFlag = true
      const container = this.$refs.scrollContainer;
      container.scrollTop = this.mainScrollList[index]
    }
    ,
    // 高亮左侧导航条
    checkAside(index) {
      this.asideCardList.forEach(item => item.value = false);
      this.asideCardList[index].value = true
    },
    // 从参数联动设定管理获取（活性 false/非活性 true）
    getUnEditable(item) {
      // 国家不允许修改，默认值
      if (item == 'COUNTRY') {
        return true
      }
      return this.unEditAble.has(item)
    },
    // 根据电梯参数CODE  获取参数值
    getParamValue(code) {
      let paramListForm = []
      for (let j = 0; j < this.paramCategoryList.length; j++) {
        // 参数类别
        let paramCategory = this.paramCategoryList[j]
        for (let k = 0; k < paramCategory.paramList.length; k++) {
          if (paramCategory.paramList[k].enabled) {
            if (paramCategory.paramList[k].paraCode == code) {
              return paramCategory.paramList[k].finalValue
            }
          } else {
            // console.log('跳过参数', paramCategory.paramList[k])
          }
        }
      }
      // 装潢包参数组装
      if (this.decorateSelectionList != null && this.decorateSelectionList.length > 0) {
        for (let i = 0; i < this.decorateSelectionList.length; i++) {
          if (this.decorateSelectionList[i].paraCode == code) {
            return this.decorateSelectionList[i].finalValue
          }
        }
      }
      return paramListForm;
    },
    // 获取所有电梯参数
    getParamList() {
      let paramListForm = []
      for (let j = 0; j < this.paramCategoryList.length; j++) {
        // 参数类别
        let paramCategory = this.paramCategoryList[j]
        for (let k = 0; k < paramCategory.paramList.length; k++) {
          if (paramCategory.paramList[k].enabled) {
            paramListForm.push({
              inputType: paramCategory.paramList[k].inputType,
              paramType: paramCategory.paramList[k].paramType,
              parabarId: paramCategory.paramList[k].parabarId,
              parabarDetailId: paramCategory.paramList[k].parabarDetailId,
              paraValue: paramCategory.paramList[k].finalValue,
              paraCode: paramCategory.paramList[k].paraCode,
              paraCategory: paramCategory.paraCategory
            })
          } else {
            console.log('跳过参数', paramCategory.paramList[k])
          }
        }
      }
      return paramListForm;
    },
    async getSpecification(key) {
      let response = await this.getConfigKey(key)
      if (response.msg) {
        return response.msg;
      }
      return '';
    },
    getValue(value) {
      return value === null ? undefined : value
    }
  }
};
</script>

<!--style-->
<style scoped>
.ts-form-item ::v-deep .el-form-item__label {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  width: 100%;
  /*display:inline;*/
}

.aside-div-unchecked {
  height: 50px;
  font-family: Arial, Arial;
  font-weight: normal;
  font-size: 18px;
  color: #3C485B;
  line-height: 23px;
  text-align: left;
  font-style: normal;
  padding-top: 14px;
  padding-left: 24px;
  cursor: pointer;
}

.aside-div-checked {
  height: 50px;
  background: #D31017;
  border-radius: 6px;
  font-family: Arial, Arial;
  font-weight: normal;
  font-size: 18px;
  color: #FFFFFF;
  line-height: 23px;
  text-align: left;
  font-style: normal;
  padding-top: 14px;
  padding-left: 24px;
  cursor: pointer;
}

.container-aside {
  overflow: hidden;
  width: 20% !important;
  background: #f1f5f9 !important;
}

.container-main {
  padding-top: 8px !important;
  padding-right: 0px !important;
}

.aside-card {
  border-radius: 6px;
}

.w-100 {
  width: 100%;
}

.mt30 {
  margin-top: 30px;
}

.check-div {
  position: absolute;
}

.check-img {
  background-color: red;
  width: 1vw;
  position: relative;
  float: right;
}

.br6 {
  border-radius: 6px;
}

.out-check-div {
  display: inline-block;
  margin-left: 5px;
  width: 31%;
  cursor: pointer;
}

.form-div {
  width: calc(25% - 10px) !important;
  display: inline-block;
  margin-right: 10px
}

.el-input-number ::v-deep .el-input__inner {
  text-align: left;
}

.err-div {
  display: flex;
  justify-content: center; /* 水平居中 */
  align-items: center; /* 垂直居中 */
  text-align: center; /* 文字水平居中 */
  height: 200px; /* 设置容器高度 */
  width: 300px; /* 设置容器宽度 */
  /*border: 1px solid #ccc; !* 边框 *!*/
  user-select: none;
  background-color: rgb(245, 247, 250);
}

.para-checkbox ::v-deep .el-checkbox__inner {
  width: 20px;
  height: 20px;
}

.para-checkbox ::v-deep .el-checkbox__input.is-disabled.is-checked .el-checkbox__inner {
  background-color: #e0e0e3;
  border-color: #DCDFE6;
}

.para-checkbox ::v-deep .el-checkbox__input.is-disabled .el-checkbox__inner {
  background-color: #e0e0e3;
  border-color: #DCDFE6;
}

.para-checkbox ::v-deep .el-checkbox__inner::after {
  width: 6px;
  height: 14px;
  border: 2px solid #FFF !important;
  border-left: 0 !important;
  border-top: 0 !important;
  top: -1px;
  left: 5px;
}
</style>
