<template>
  <el-dialog
    class="parameterSetDialog"
    title="参数设置"
    :visible.sync="isShow"
    :close-on-click-modal="false"
    width="1200px"
    @close="handleclose"
  >
    <div class="zzinfo">
      装置编号：{{ rowData.cmdId || rowData.cmdid }}
      <span v-if="roleUser == 0">
        <span v-if="rowData.protocol == '65280'"> 国网I1 </span>
        <span v-if="rowData.protocol == '65296'"> 陕西 </span>
        <span v-if="rowData.protocol == '65281'"> 安徽 </span>
        <span v-if="rowData.protocol == '65282'"> 江苏 </span>
        <span v-if="rowData.protocol == '65283'"> 湖南 </span>
        <span v-if="rowData.protocol == '65284'"> 浙江 </span>
        <span v-if="rowData.protocol == '65285'"> 河南 </span>
        <span v-if="rowData.protocol == '65286'"> 河南郑州 </span>
        <span v-if="rowData.protocol == '65290'"> 河南统一视频v2020 </span>
      </span>
    </div>
    <el-tabs v-model="activeName" type="border-card" @tab-click="handleClick">
      <el-tab-pane label="装置时间" name="1">
        <div class="deviceTime">
          <el-form
            :model="deviceTimeForm"
            label-position="right"
            label-width="84px"
          >
            <el-form-item label="装置时间">
              <el-date-picker
                v-model="devicetime"
                type="datetime"
                placeholder="查询日期时间"
                value-format="timestamp"
                disabled
              >
              </el-date-picker>
              <!-- <el-input
                v-model="deviceTimeForm.zztime"
                disabled="disabled"
              ></el-input> -->
            </el-form-item>
            <el-form-item label="新装置时间">
              <!-- <el-input v-model="deviceTimeForm.newzztime"></el-input> -->
              <el-date-picker
                v-model="devicenewtime"
                type="datetime"
                placeholder="选择日期时间"
                value-format="timestamp"
                @focus="handleFocus"
              >
              </el-date-picker>
            </el-form-item>
            <el-form-item>
              <el-button
                type="primary"
                @click="searchTime"
                :loading="timeLoading"
                >查询</el-button
              >
              <el-button
                type="primary"
                @click="setTime"
                :loading="timesetLoading"
                >设置</el-button
              >
              <p class="looktime" v-if="lookTime && showLookTime">
                {{ $moment(lookTime).format("YYYY-MM-DD HH:mm:ss") }}
              </p>
            </el-form-item>
          </el-form>
        </div>
      </el-tab-pane>
      <el-tab-pane label="采样参数" name="2">
        <div class="tabsBox">
          <el-tabs
            v-model="tabsActive"
            type="card"
            @tab-click="samphandleClick"
          >
            <el-tab-pane label="查询实际参数" name="first">
              <div class="queryParam">
                <el-form
                  :model="samplingForm"
                  label-position="right"
                  label-width="152px"
                >
                  <el-form-item label="采集时间周期（分钟）">
                    <el-input
                      v-model="samplingForm.mainTime"
                      disabled="disabled"
                    ></el-input>
                  </el-form-item>
                  <el-form-item label="高速采样点数">
                    <el-input
                      v-model="samplingForm.sampleCount"
                      disabled="disabled"
                    ></el-input>
                  </el-form-item>
                  <el-form-item label="高速采样频率">
                    <el-input
                      v-model="samplingForm.sampleFrequency"
                      disabled="disabled"
                    ></el-input>
                  </el-form-item>
                  <el-form-item label="心跳上送周期（分钟）">
                    <el-input
                      v-model="samplingForm.heartbeatTime"
                      disabled="disabled"
                    ></el-input>
                  </el-form-item>
                  <el-form-item>
                    <el-button
                      type="primary"
                      @click="samplingSearch"
                      :loading="sampLoading"
                      >查询</el-button
                    >
                    <p class="looktime" v-if="lookTime && showLookTime">
                      {{ $moment(lookTime).format("YYYY-MM-DD HH:mm:ss") }}
                    </p>
                  </el-form-item>
                </el-form>
              </div>
            </el-tab-pane>
            <el-tab-pane label="设置参数" name="second">
              <div class="queryParam">
                <el-form
                  :model="samplingForm"
                  label-position="right"
                  label-width="164px"
                  ref="samplingFormref"
                  :rules="samplingrules"
                >
                  <el-form-item label="采集时间周期（分钟）">
                    <el-input v-model="samplingForm.mainTime"></el-input>
                  </el-form-item>
                  <el-form-item label="高速采样点数">
                    <el-input v-model="samplingForm.sampleCount"></el-input>
                  </el-form-item>
                  <el-form-item label="高速采样频率">
                    <el-input v-model="samplingForm.sampleFrequency"></el-input>
                  </el-form-item>
                  <el-form-item
                    label="心跳上送周期（分钟）"
                    prop="heartbeatTime"
                  >
                    <el-input v-model="samplingForm.heartbeatTime"></el-input>
                  </el-form-item>

                  <el-form-item>
                    <el-button
                      type="primary"
                      @click="samplingSet"
                      :loading="sampSetLoading"
                      >设置</el-button
                    >
                  </el-form-item>
                </el-form>
              </div>
            </el-tab-pane>
          </el-tabs>
        </div>
      </el-tab-pane>
      <el-tab-pane label="上位机信息" name="3">
        <div class="tabsBox">
          <el-tabs v-model="tabsActive" type="card" @tab-click="uphandleClick">
            <el-tab-pane label="查询实际参数" name="first">
              <div class="queryParam">
                <el-form
                  :model="upperComputer"
                  label-position="right"
                  label-width="124px"
                >
                  <el-form-item label="IP地址">
                    <el-input
                      v-model="upperComputer.ipStr"
                      disabled="disabled"
                    ></el-input>
                  </el-form-item>
                  <el-form-item label="端口号">
                    <el-input
                      v-model="upperComputer.port"
                      disabled="disabled"
                    ></el-input>
                  </el-form-item>
                  <el-form-item label="域名">
                    <el-input
                      v-model="upperComputer.domain"
                      disabled="disabled"
                    ></el-input>
                  </el-form-item>
                  <el-form-item>
                    <el-button
                      type="primary"
                      @click="upperSearch"
                      :loading="upperLoading"
                      >查询</el-button
                    >
                    <p class="looktime" v-if="lookTime && showLookTime">
                      {{ $moment(lookTime).format("YYYY-MM-DD HH:mm:ss") }}
                    </p>
                  </el-form-item>
                </el-form>
              </div>
            </el-tab-pane>
            <el-tab-pane label="设置参数" name="second">
              <div class="queryParam">
                <el-form
                  :model="upperComputer"
                  label-position="right"
                  label-width="124px"
                  ref="upperFormref"
                  :rules="upperrulse"
                >
                  <el-form-item label="IP地址" prop="ip">
                    <el-input v-model="upperComputer.ip"></el-input>
                  </el-form-item>
                  <el-form-item label="端口号" prop="port">
                    <el-input v-model="upperComputer.port"></el-input>
                  </el-form-item>
                  <el-form-item label="域名">
                    <el-input v-model="upperComputer.domain"></el-input>
                  </el-form-item>
                  <el-form-item>
                    <el-button
                      type="primary"
                      @click="upperSet"
                      :loading="upperSetLoading"
                      >设置</el-button
                    >
                  </el-form-item>
                </el-form>
              </div>
            </el-tab-pane>
          </el-tabs>
        </div>
      </el-tab-pane>
      <el-tab-pane label="ID参数" name="4">
        <div class="tabsBox">
          <el-tabs v-model="tabsActive" type="card" @tab-click="idhandleClick">
            <el-tab-pane label="查询实际参数" name="first">
              <div class="queryParam" v-if="rowData.protocol == '65284'">
                <el-form
                  :model="zjidParameter"
                  label-position="right"
                  label-width="124px"
                >
                  <el-form-item label="杆塔ID">
                    <el-input
                      v-model="zjidParameter.componentId"
                      disabled="disabled"
                    ></el-input>
                  </el-form-item>
                  <el-form-item>
                    <el-button
                      type="primary"
                      @click="idSearch"
                      :loading="idLoading"
                      >查询</el-button
                    >
                    <p class="looktime" v-if="lookTime && showLookTime">
                      {{ $moment(lookTime).format("YYYY-MM-DD HH:mm:ss") }}
                    </p>
                  </el-form-item>
                </el-form>
              </div>
              <div class="queryParam" v-else>
                <el-form
                  :model="idParameter"
                  label-position="right"
                  label-width="124px"
                >
                  <el-form-item label="CMD_ID">
                    <el-input
                      v-model="idParameter.newCmdId"
                      disabled="disabled"
                    ></el-input>
                  </el-form-item>
                  <el-form-item label="杆塔ID">
                    <el-input
                      v-model="idParameter.componentId"
                      disabled="disabled"
                    ></el-input>
                  </el-form-item>
                  <el-form-item label="原始ID">
                    <el-input
                      v-model="idParameter.originalId"
                      disabled="disabled"
                    ></el-input>
                  </el-form-item>
                  <el-form-item>
                    <el-button
                      type="primary"
                      @click="idSearch"
                      :loading="idLoading"
                      >查询</el-button
                    >
                    <p class="looktime" v-if="lookTime && showLookTime">
                      {{ $moment(lookTime).format("YYYY-MM-DD HH:mm:ss") }}
                    </p>
                  </el-form-item>
                </el-form>
              </div>
            </el-tab-pane>
            <el-tab-pane label="设置参数" name="second">
              <div class="queryParam" v-if="rowData.protocol == '65284'">
                <el-form
                  :model="zjidParameter"
                  label-position="right"
                  label-width="124px"
                  ref="idParameterref"
                  :rules="zjidrules"
                >
                  <el-form-item>
                    <el-select
                      v-model="zjvalue"
                      placeholder="请选择"
                      @change="zjchange"
                    >
                      <el-option
                        v-for="item in zjoptions"
                        :key="item.value"
                        :label="item.label"
                        :value="item.value"
                      >
                      </el-option>
                    </el-select>
                  </el-form-item>
                  <el-form-item label="杆塔ID" prop="componentId" v-if="idFlag">
                    <el-input v-model="zjidParameter.componentId"></el-input>
                  </el-form-item>
                  <el-form-item label="CMD_ID" prop="newCmdId" v-else>
                    <el-input v-model="zjidParameter.newCmdId"></el-input>
                  </el-form-item>

                  <el-form-item>
                    <el-button
                      type="primary"
                      @click="idSet"
                      :loading="idSetLoading"
                      >设置</el-button
                    >
                  </el-form-item>
                </el-form>
              </div>
              <div class="queryParam" v-else>
                <el-form
                  :model="idParameter"
                  label-position="right"
                  label-width="124px"
                  ref="idParameterref"
                  :rules="idrules"
                >
                  <el-form-item label="CMD_ID" prop="newCmdId">
                    <el-input v-model="idParameter.newCmdId"></el-input>
                  </el-form-item>
                  <el-form-item label="杆塔ID" prop="componentId">
                    <el-input v-model="idParameter.componentId"></el-input>
                  </el-form-item>
                  <el-form-item label="原始ID">
                    <el-input
                      v-model="idParameter.originalId"
                      disabled="disabled"
                    ></el-input>
                  </el-form-item>
                  <el-form-item>
                    <el-button
                      type="primary"
                      @click="idSet"
                      :loading="idSetLoading"
                      >设置</el-button
                    >
                  </el-form-item>
                </el-form>
              </div>
            </el-tab-pane>
          </el-tabs>
        </div>
      </el-tab-pane>
      <el-tab-pane label="图像采集参数" name="5">
        <div class="tabsBox">
          <imageCapture ref="imageCaptureref" :rowdata="rowData"></imageCapture>
        </div>
      </el-tab-pane>
      <el-tab-pane label="视频采集参数" name="6">
        <div class="tabsBox">
          <videoCapture ref="videoCaptureref" :rowdata="rowData"></videoCapture>
        </div>
      </el-tab-pane>
      <el-tab-pane
        label="水印（安徽）"
        name="7"
        v-if="rowData.protocol == '65281'"
      >
        <div class="tabsBox">
          <el-tabs
            v-model="tabsActive"
            type="card"
            @tab-click="waterhandleClick"
          >
            <el-tab-pane label="查询水印" name="first">
              <div class="queryParam waterParams">
                <div class="channelBox">
                  <span class="title">通道</span>
                  <el-select
                    v-model="channelId"
                    placeholder="请选择"
                    class="mr20"
                    @change="waterChange"
                  >
                    <el-option
                      v-for="item in accesslist"
                      :key="item.channelid"
                      :label="
                        item.alias !== null && item.alias !== ''
                          ? item.alias
                          : item.channelname
                      "
                      :value="item.channelid"
                    >
                      {{
                        item.alias !== null && item.alias !== ""
                          ? item.alias
                          : item.channelname
                      }}
                    </el-option>
                  </el-select>
                </div>
                <el-form :model="waterForm" label-width="150px">
                  <el-form-item label="左下角水印">
                    <el-input
                      v-model="waterForm.leftBottom"
                      :disabled="true"
                    ></el-input>
                  </el-form-item>
                  <el-form-item label="右下角水印">
                    <el-input
                      v-model="waterForm.rightBottom"
                      :disabled="true"
                    ></el-input>
                  </el-form-item>

                  <el-form-item class="runformbtn">
                    <el-button
                      type="primary"
                      @click="waterSearch"
                      :loading="waterLoading"
                      >查询</el-button
                    >
                    <p class="looktime" v-if="lookTime && showLookTime">
                      {{ $moment(lookTime).format("YYYY-MM-DD HH:mm:ss") }}
                    </p>
                  </el-form-item>
                </el-form>
              </div>
            </el-tab-pane>
            <el-tab-pane label="设置水印" name="second">
              <div class="queryParam waterParams">
                <div class="channelBox">
                  <span class="title">通道</span>
                  <el-select
                    v-model="channelId"
                    placeholder="请选择"
                    class="mr20"
                  >
                    <el-option
                      v-for="item in accesslist"
                      :key="item.channelid"
                      :label="
                        item.alias !== null && item.alias !== ''
                          ? item.alias
                          : item.channelname
                      "
                      :value="item.channelid"
                    >
                      {{
                        item.alias !== null && item.alias !== ""
                          ? item.alias
                          : item.channelname
                      }}
                    </el-option>
                  </el-select>
                </div>
                <el-form :model="waterForm" label-width="150px">
                  <el-form-item label="左下角水印">
                    <el-input v-model="waterForm.leftBottom"></el-input>
                  </el-form-item>
                  <el-form-item label="右下角水印">
                    <el-input v-model="waterForm.rightBottom"></el-input>
                  </el-form-item>

                  <el-form-item class="runformbtn">
                    <el-button
                      type="primary"
                      @click="waterSet"
                      :loading="waterSetLoading"
                      >设置</el-button
                    >
                  </el-form-item>
                </el-form>
              </div>
            </el-tab-pane>
          </el-tabs>
        </div>
      </el-tab-pane>
      <el-tab-pane label="OSD参数" name="11">
        <div class="tabsBox">
          <el-tabs v-model="tabsActive" type="card" @tab-click="osdhandleClick">
            <el-tab-pane label="查询实际参数" name="first">
              <div class="queryParam osdParam">
                <div class="channelBox">
                  <span class="title">通道</span>
                  <el-select
                    v-model="channelId"
                    placeholder="请选择"
                    class="mr20"
                  >
                    <el-option
                      v-for="item in accesslist"
                      :key="item.channelid"
                      :label="
                        item.alias !== null && item.alias !== ''
                          ? item.alias
                          : item.channelname
                      "
                      :value="item.channelid"
                    >
                      {{
                        item.alias !== null && item.alias !== ""
                          ? item.alias
                          : item.channelname
                      }}
                    </el-option>
                  </el-select>
                </div>
                <el-form
                  :model="osdParams"
                  label-position="right"
                  label-width="124px"
                >
                  <el-form-item label="时间标识" prop="showTime">
                    <el-select
                      v-model="osdParams.showTime"
                      class="mr20"
                      :disabled="true"
                    >
                      <el-option
                        v-for="item in timelist"
                        :key="item.id"
                        :label="item.name"
                        :value="item.id"
                      ></el-option>
                    </el-select>
                  </el-form-item>
                  <el-form-item label="文本标识" prop="showText">
                    <el-select
                      v-model="osdParams.showText"
                      class="mr20"
                      :disabled="true"
                    >
                      <el-option
                        v-for="item in timelist"
                        :key="item.id"
                        :label="item.name"
                        :value="item.id"
                      ></el-option>
                    </el-select>
                  </el-form-item>
                  <el-form-item label="文本内容" prop="textContent">
                    <el-input
                      type="textarea"
                      :rows="3"
                      v-model="osdParams.textContent"
                      :disabled="true"
                    >
                    </el-input>
                  </el-form-item>
                  <el-form-item>
                    <el-button
                      type="primary"
                      @click="osdSearch"
                      :loading="osdLoading"
                      >查询</el-button
                    >
                    <p class="looktime" v-if="lookTime && showLookTime">
                      {{ $moment(lookTime).format("YYYY-MM-DD HH:mm:ss") }}
                    </p>
                  </el-form-item>
                </el-form>
              </div>
            </el-tab-pane>
            <el-tab-pane label="设置参数" name="second">
              <div class="queryParam osdParam">
                <div class="channelBox">
                  <span class="title">通道</span>
                  <el-select
                    v-model="channelId"
                    placeholder="请选择"
                    class="mr20"
                  >
                    <el-option
                      v-for="item in accesslist"
                      :key="item.channelid"
                      :label="
                        item.alias !== null && item.alias !== ''
                          ? item.alias
                          : item.channelname
                      "
                      :value="item.channelid"
                    >
                      {{
                        item.alias !== null && item.alias !== ""
                          ? item.alias
                          : item.channelname
                      }}
                    </el-option>
                  </el-select>
                </div>
                <el-form
                  :model="osdParams"
                  label-position="right"
                  label-width="124px"
                  :rules="osdRules"
                  ref="osdFormref"
                >
                  <el-form-item label="时间标识" prop="showTime">
                    <el-select v-model="osdParams.showTime" class="mr20">
                      <el-option
                        v-for="item in timelist"
                        :key="item.id"
                        :label="item.name"
                        :value="item.id"
                      ></el-option>
                    </el-select>
                  </el-form-item>
                  <el-form-item label="文本标识" prop="showText">
                    <el-select v-model="osdParams.showText" class="mr20">
                      <el-option
                        v-for="item in timelist"
                        :key="item.id"
                        :label="item.name"
                        :value="item.id"
                      ></el-option>
                    </el-select>
                  </el-form-item>
                  <el-form-item label="文本内容" prop="textContent">
                    <el-input
                      type="textarea"
                      :rows="3"
                      placeholder="请输入内容"
                      v-model="osdParams.textContent"
                    >
                    </el-input>
                  </el-form-item>
                  <el-form-item>
                    <el-button
                      type="primary"
                      @click="osdSet"
                      :loading="osdSetLoading"
                      >设置</el-button
                    >
                  </el-form-item>
                </el-form>
              </div>
            </el-tab-pane>
          </el-tabs>
        </div>
      </el-tab-pane>
      <el-tab-pane label="装置运行状态报" name="8">
        <div class="runform">
          <el-form :model="runStatusForm" :inline="true" label-width="150px">
            <el-form-item label="4G信号强度">
              <el-input
                v-model="runStatusForm.zztime"
                :disabled="true"
              ></el-input>
            </el-form-item>
            <el-form-item label="2G信号强度">
              <el-input
                v-model="runStatusForm.newzztime"
                :disabled="true"
              ></el-input>
            </el-form-item>
            <el-form-item label="剩余运行内存">
              <el-input
                v-model="runStatusForm.newzztime"
                :disabled="true"
              ></el-input>
            </el-form-item>
            <el-form-item label="剩余存储内存">
              <el-input
                v-model="runStatusForm.newzztime"
                :disabled="true"
              ></el-input>
            </el-form-item>
            <el-form-item label="上次启动时间">
              <el-input
                v-model="runStatusForm.newzztime"
                :disabled="true"
              ></el-input>
            </el-form-item>
            <el-form-item label="查询最新时间">
              <el-input
                v-model="runStatusForm.newzztime"
                :disabled="true"
              ></el-input>
            </el-form-item>
            <el-form-item class="runformbtn">
              <el-button
                type="primary"
                @click="runstatusSearch"
                :loading="statusLoading"
                >查询</el-button
              >
            </el-form-item>
          </el-form>
        </div>
      </el-tab-pane>
      <el-tab-pane label="GPS位置" name="9">
        <div class="runform">
          <el-form :model="gpsForm" :inline="true" label-width="150px">
            <!-- <el-form-item label="坐标类型">
              <el-input v-model="gpsForm.zztime" :disabled="true"></el-input>
            </el-form-item> -->

            <el-form-item label="经度">
              <el-input v-model="gpsForm.longitude" :disabled="true"></el-input>
            </el-form-item>
            <el-form-item label="纬度">
              <el-input v-model="gpsForm.latitude" :disabled="true"></el-input>
            </el-form-item>
            <el-form-item label="半径">
              <el-input v-model="gpsForm.radius" :disabled="true"></el-input>
            </el-form-item>
            <el-form-item label="查询最新时间">
              <!-- <el-input
                v-model="gpsForm.updatetime"
                :disabled="true"
              ></el-input> -->
              <el-date-picker
                :disabled="true"
                v-model="gpsForm.updatetime"
                type="datetime"
                placeholder="选择日期时间"
              >
              </el-date-picker>
            </el-form-item>
            <el-form-item class="runformbtn">
              <el-button type="primary" @click="gpsSearch">查询</el-button>
            </el-form-item>
          </el-form>
        </div>
      </el-tab-pane>
      <el-tab-pane label="基本操作" name="10">
        <div class="resetDevice">
          <h3>装置复位</h3>
          <el-button type="primary" @click.native.stop="handleDeviceReset"
            >复位</el-button
          >
        </div>
      </el-tab-pane>
      <el-tab-pane label="升级" name="12">
        <div class="tabsBox">
          <div class="queryParam upgradBox">
            <el-form
              :model="upgradationform"
              :rules="upgradationRules"
              ref="upgradationRuleForm"
            >
              <el-form-item label="文件名称" prop="upVal">
                <el-select
                  v-model="upgradationform.upVal"
                  placeholder="请选择升级文件"
                  @change="selectChanged"
                >
                  <el-option
                    v-for="item in upOptions"
                    :key="item.id"
                    :label="item.name"
                    :value="item.path"
                    :title="item.title"
                  >
                    {{ item.name }}
                    <i class="title">（{{ item.title }}</i
                    ><i class="time">{{ item.uploadDate }}）</i>
                  </el-option>
                </el-select>
              </el-form-item>
            </el-form>
            <el-button
              type="primary"
              :loading="ugradLoading"
              @click="handleupgradation"
              >确 定</el-button
            >
          </div>
        </div>
      </el-tab-pane>
    </el-tabs>
    <div slot="footer" class="dialog-footer">
      <el-button @click="isShow = false">取 消</el-button>
    </div>
  </el-dialog>
</template>
<script>
import {
  resetTerminalApi,
  getTermLastGPSPosition,
  setTermCamera,
  getTermCameraRequest,
  getChannelListJoggle,
  listApk,
} from "@/utils/api/index";

import imageCapture from "./imageCapture.vue";
import videoCapture from "./videoCapture.vue";
export default {
  props: {
    photoDialog: {
      type: Boolean,
    },
  },
  components: {
    imageCapture,
    videoCapture,
  },
  data() {
    let validCmid = (rule, value, callback) => {
      let reg = /^[0-9A-Za-z_/\\/-]{17}$/;
      if (!reg.test(value)) {
        callback(new Error("装置id为17位编码"));
      } else {
        callback();
      }
    };
    let validateIPAddress = (rule, value, callback) => {
      let regexp =
        /^(?:(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.){3}(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)$/;
      if (value === "") {
        return callback(new Error("请输入IP地址"));
      } else if (!regexp.test(value)) {
        return callback(new Error("请输入正确的IP地址"));
      } else {
        callback();
      }
    };

    return {
      showLookTime: false,
      lookTime: "", //查询时间
      isShow: false,
      activeName: "1",
      timeLoading: false,
      timesetLoading: false,
      devicenewtime: "",
      devicetime: "",
      deviceTimeForm: {
        zztime: "", //装置时间
        newzztime: "", //新装置时间
      },
      //采样参数
      samplingForm: {
        mainTime: "",
        sampleCount: "",
        sampleFrequency: "",
        heartbeatTime: "",
      },
      sampLoading: false,
      sampSetLoading: false,
      samplingrules: {
        heartbeatTime: [
          { required: true, message: "请输入心跳周期", trigger: "blur" },
        ],
      },
      //上位机信息
      upperComputer: {
        ip: "",
        port: "",
        domain: "",
      },
      upperrulse: {
        ip: [{ required: true, validator: validateIPAddress, trigger: "blur" }],
        port: [{ required: true, message: "请输入端口号", trigger: "blur" }],
      },
      upperLoading: false,
      upperSetLoading: false,
      //浙江id参数
      zjvalue: 1,
      zjoptions: [
        {
          value: 1,
          label: "杆塔ID",
        },
        {
          value: 2,
          label: "CMD_ID",
        },
      ],
      idFlag: true,
      zjidParameter: {
        newCmdId: "",
        componentId: "",
      },
      zjidrules: {
        newCmdId: [
          { required: true, message: "请输入CMD_ID", trigger: "blur" },
          { validator: validCmid, trigger: "blur" },
        ],
        componentId: [
          { required: true, message: "请输入杆塔ID", trigger: "blur" },
          { validator: validCmid, trigger: "blur" },
        ],
      },
      //id参数
      idParameter: {
        newCmdId: "",
        componentId: "",
        originalId: "",
      },
      idrules: {
        newCmdId: [
          { required: true, message: "请输入CMD_ID", trigger: "blur" },
          { validator: validCmid, trigger: "blur" },
        ],
        componentId: [
          { required: true, message: "请输入杆塔ID", trigger: "blur" },
          { validator: validCmid, trigger: "blur" },
        ],
      },
      idLoading: false,
      idSetLoading: false,
      //水印（安徽）
      waterForm: {},
      //osd参数
      osdParams: {
        textContent: "",
      },
      textlist: [
        {
          name: "显示",
          id: 1,
        },
        {
          name: "不显示",
          id: 0,
        },
      ],
      timelist: [
        {
          name: "显示",
          id: 1,
        },
        {
          name: "不显示",
          id: 0,
        },
      ],
      osdLoading: false,
      osdSetLoading: false,
      osdRules: {
        showText: [
          { required: true, message: "请选择文本标识", trigger: "change" },
        ],
      },
      accesslist: [], //通道选择器
      channelId: 1,
      waterLoading: false,
      waterSetLoading: false,
      runStatusForm: {},
      statusLoading: false,
      gpsForm: {}, //gps位置
      tabsActive: "first",
      rowData: {},
      requestid: "",
      timer: null,
      i: 0,
      tabName: "装置时间",
      roleUser: "",
      //升级确定阿
      ugradLoading: false,
      upgradationform: {
        upVal: "",
      },
      selectUpObj: {},
      upgradationRules: {
        upVal: [
          { required: true, message: "请选择升级文件", trigger: "change" },
        ],
      },
      upOptions: [],
    };
  },
  mounted() {},
  created() {
    this.roleUser = localStorage.getItem("role");
    console.log(this.roleUser);
  },
  watch: {},
  methods: {
    //tab被触发
    handleClick(tab, event) {
      this.lookTime = "";
      this.showLookTime = false;
      window.clearInterval(this.timer);
      this.timer = null;
      this.i = 0;
      console.log(tab, event);
      this.$refs.imageCaptureref.clearData();
      this.$refs.videoCaptureref.clearData();
      //每次切换重置选项卡
      this.tabsActive = "first";
      if (tab.label == "图像采集参数") {
        console.log("图像采集参数");
        this.$refs.imageCaptureref.getSingleAccess(this.rowData);
        this.$refs.imageCaptureref.getRatio(this.rowData);
      } else if (tab.label == "视频采集参数") {
        console.log("视频采集参数");
        this.$refs.videoCaptureref.getSingleAccess(this.rowData);
        this.$refs.videoCaptureref.getRatio(this.rowData);
      } else if (tab.label == "升级") {
        this.getUpgradeList();
      }
      this.tabName = tab.label;
    },
    //获取设备通道
    getSingleAccess() {
      console.log(this.rowData);
      getChannelListJoggle({ termid: this.rowData.id })
        .then((res) => {
          this.accesslist = res.data.list;
          // this.waterForm.channelId = res.data.list[0].channelid;
        })
        .catch((err) => {});
    },
    handleFocus() {
      if (
        this.devicenewtime == "" ||
        this.devicenewtime == undefined ||
        this.devicenewtime == null
      ) {
        this.devicenewtime = new Date();
        console.log(this.devicenewtime);
      }
    },
    //装置时间查询
    searchTime() {
      if (this.rowData.isonline || this.rowData.onlinestatus === 1) {
        this.timeLoading = true;
        // --act=time --cmdid=XY-SIMULATOR-0015 --flag=1 --time=20230101122322
        let params = [
          {
            name: "act",
            value: "time",
          },
          {
            name: "flag",
            value: 0,
          },
        ];
        this.setTermFn(params);
      } else {
        this.$message({
          duration: 1500,
          showClose: true,
          message: "装置下线，发送指令失败",
          type: "error",
        });
      }
    },
    //装置时间设置
    //设置装置时间： .\bin\xympadmn.exe --server=127.0.0.1 --port=6891 --act=time --cmdid=XY-SIMULATOR-0015 --flag=1 --time=20230101122322
    setTime() {
      if (this.rowData.isonline || this.rowData.onlinestatus === 1) {
        console.log(this.devicenewtime);
        if (
          this.devicenewtime !== "" &&
          this.devicenewtime !== undefined &&
          this.devicenewtime !== null
        ) {
          this.timesetLoading = true;
          let params = [
            {
              name: "act",
              value: "time",
            },
            {
              name: "flag",
              value: 1,
            },
            {
              name: "time",
              value: this.devicenewtime / 1000,
            },
          ];
          this.setTermFn(params);
        } else {
          console.log("error submit!!");
          this.$message({
            duration: 1500,
            showClose: true,
            message: "请填写新装置时间",
            type: "error",
          });
          return false;
        }
      } else {
        this.$message({
          duration: 1500,
          showClose: true,
          message: "装置下线，发送指令失败",
          type: "error",
        });
      }
    },
    //采样参数重置数据
    samphandleClick() {
      this.samplingForm = {};
      this.lookTime = "";
      clearInterval(this.timer);
      this.i = 0;
      this.timer = null;
    },
    //上位机重置数据
    uphandleClick() {
      this.upperComputer = {};
      this.lookTime = "";
      clearInterval(this.timer);
      this.i = 0;
      this.timer = null;
    },
    //id重置数据
    idhandleClick() {
      this.idParameter = {};
      this.zjidParameter = {};
      this.lookTime = "";
      clearInterval(this.timer);
      this.i = 0;
      this.timer = null;
    },
    //osd重置
    osdhandleClick(tab) {
      console.log(tab);
      this.lookTime = "";
      if (tab.label == "设置参数") {
        this.osdParams = {};
        this.$set(this.osdParams, "showTime", this.timelist[0].id);
      } else {
        this.osdParams = {};
      }

      clearInterval(this.timer);
      this.i = 0;
      this.timer = null;
    },
    //采样参数查询
    // -act=sampling [0xA4 ] --flag=[Request Set Flag, default is set=1, 0: request] --rf=[Request Flag] --reqtype=[Request Type] --maintime=[Main Time] --samplecount=[Sample Count] --samplingfreq=[Sample Frequency] --heartbeat=[Heartbeat Time]
    samplingSearch() {
      if (this.rowData.isonline || this.rowData.onlinestatus === 1) {
        this.sampLoading = true;
        let params = [
          {
            name: "act",
            value: "sampling",
          },
          {
            name: "flag",
            value: 0,
          },
          {
            name: "rf",
            value: 255,
          },
          // {
          //   name: "reqtype",
          //   value: "0xA4",
          // },
          {
            name: "maintime",
            value: "",
          },
          {
            name: "samplecount",
            value: "",
          },
          {
            name: "samplingfreq",
            value: "",
          },
          {
            name: "heartbeat",
            value: "",
          },
        ];
        this.setTermFn(params);
      } else {
        this.$message({
          duration: 1500,
          showClose: true,
          message: "装置下线，发送指令失败",
          type: "error",
        });
      }
    },
    //设置采样查询
    samplingSet() {
      if (this.rowData.isonline || this.rowData.onlinestatus === 1) {
        this.$refs.samplingFormref.validate((valid) => {
          if (valid) {
            this.sampSetLoading = true;
            let params = [
              {
                name: "act",
                value: "sampling",
              },
              {
                name: "flag",
                value: 1,
              },
              {
                name: "rf",
                value: 255,
              },
              // {
              //   name: "reqtype",
              //   value: "0xA4",
              // },
              {
                name: "maintime",
                value: this.samplingForm.mainTime,
              },
              {
                name: "samplecount",
                value: this.samplingForm.sampleCount,
              },
              {
                name: "samplingfreq",
                value: this.samplingForm.sampleFrequency,
              },
              {
                name: "heartbeat",
                value: this.samplingForm.heartbeatTime,
              },
            ];
            this.setTermFn(params);
          } else {
            console.log("error submit!!");
            return false;
          }
        });
      } else {
        this.$message({
          duration: 1500,
          showClose: true,
          message: "装置下线，发送指令失败",
          type: "error",
        });
      }
    },
    //上位机查询
    //--act=cma [0xA7] --flag=[Request Set Flag, default is set=1, 0: request] --ip=[IP Address] --cmaport=[CMA Port] --domain=[Domain]
    upperSearch() {
      if (this.rowData.isonline || this.rowData.onlinestatus === 1) {
        this.upperLoading = true;
        let params = [
          {
            name: "act",
            value: "cma",
          },
          {
            name: "flag",
            value: 0,
          },

          {
            name: "ip",
            value: "",
          },
          {
            name: "cmaport",
            value: "",
          },
          {
            name: "domain",
            value: "",
          },
        ];
        this.setTermFn(params);
      } else {
        this.$message({
          duration: 1500,
          showClose: true,
          message: "装置下线，发送指令失败",
          type: "error",
        });
      }
    },
    //上位机设置
    upperSet() {
      if (this.rowData.isonline || this.rowData.onlinestatus === 1) {
        this.$refs.upperFormref.validate((valid) => {
          console.log(valid);
          if (valid) {
            this.upperSetLoading = true;
            let params = [
              {
                name: "act",
                value: "cma",
              },
              {
                name: "flag",
                value: 1,
              },

              {
                name: "ip",
                value: this.upperComputer.ip,
              },
              {
                name: "cmaport",
                value: this.upperComputer.port,
              },
              {
                name: "domain",
                value: this.upperComputer.domain,
              },
            ];
            this.setTermFn(params);
          } else {
            console.log("error submit!!");
            return false;
          }
        });
      } else {
        this.$message({
          duration: 1500,
          showClose: true,
          message: "装置下线，发送指令失败",
          type: "error",
        });
      }
    },
    //浙江change
    zjchange(val) {
      console.log(val);
      if (val == 1) {
        console.log("杆塔id");
        this.idFlag = true;
      } else {
        console.log("cmdid");
        this.idFlag = false;
      }
    },
    //id参数查询
    // --act=termid [0xAC] --flag=[Request Set Flag, default is set=1, 0: request] --newcmdid=[New CMD ID] --compid=[Component Id] --orgid=[Original Id]
    idSearch() {
      if (this.rowData.isonline || this.rowData.onlinestatus === 1) {
        this.idLoading = true;
        console.log(this.rowData);
        if (this.rowData.protocol == 65284) {
          let params = [
            {
              name: "act",
              value: "termid",
            },
            {
              name: "flag",
              value: 0,
            },
            {
              name: "rf",
              value: 1,
            },
            {
              name: "newcmdid",
              value: "",
            },
            {
              name: "compid",
              value: "",
            },
            {
              name: "orgid",
              value: "",
            },
          ];
          this.setTermFn(params);
        } else {
          let params = [
            {
              name: "act",
              value: "termid",
            },
            {
              name: "flag",
              value: 0,
            },
            {
              name: "rf",
              value: 255,
            },
            {
              name: "newcmdid",
              value: "",
            },
            {
              name: "compid",
              value: "",
            },
            {
              name: "orgid",
              value: "",
            },
          ];
          this.setTermFn(params);
        }
      } else {
        this.$message({
          duration: 1500,
          showClose: true,
          message: "装置下线，发送指令失败",
          type: "error",
        });
      }
    },
    //id参数设置
    idSet() {
      if (this.rowData.isonline || this.rowData.onlinestatus === 1) {
        this.$refs.idParameterref.validate((valid) => {
          if (valid) {
            this.idSetLoading = true;
            if (this.rowData.protocol == 65284) {
              if (this.zjvalue == 1) {
                let params = [
                  {
                    name: "act",
                    value: "termid",
                  },
                  {
                    name: "flag",
                    value: 1,
                  },
                  {
                    name: "rf",
                    value: 2,
                  },
                  // {
                  //   name: "newcmdid",
                  //   value: this.idParameter.newCmdId,
                  // },
                  {
                    name: "compid",
                    value: this.zjidParameter.componentId,
                  },
                ];
                this.setTermFn(params);
              } else {
                let params = [
                  {
                    name: "act",
                    value: "termid",
                  },
                  {
                    name: "flag",
                    value: 1,
                  },
                  {
                    name: "rf",
                    value: 1,
                  },
                  {
                    name: "newcmdid",
                    value: this.zjidParameter.newCmdId,
                  },
                  // {
                  //   name: "compid",
                  //   value: this.idParameter.componentId,
                  // },
                ];
                this.setTermFn(params);
              }
            } else {
              let params = [
                {
                  name: "act",
                  value: "termid",
                },
                {
                  name: "flag",
                  value: 1,
                },
                {
                  name: "rf",
                  value: 255,
                },
                {
                  name: "newcmdid",
                  value: this.idParameter.newCmdId,
                },
                {
                  name: "compid",
                  value: this.idParameter.componentId,
                },
                {
                  name: "orgid",
                  value: this.idParameter.originalId,
                },
              ];

              this.setTermFn(params);
            }
          } else {
            console.log("error submit!!");
            return false;
          }
        });
      } else {
        this.$message({
          duration: 1500,
          showClose: true,
          message: "装置下线，发送指令失败",
          type: "error",
        });
      }
    },
    //查询水印
    waterSearch() {
      if (this.rowData.isonline || this.rowData.onlinestatus === 1) {
        this.waterLoading = true;
        let params = [
          {
            name: "act",
            value: "osd",
          },
          {
            name: "flag",
            value: 0,
          },

          {
            name: "channel",
            value: this.channelId,
          },
          {
            name: "leftBottom",
            value: "",
          },
          {
            name: "rightBottom",
            value: "",
          },
        ];
        this.setTermFn(params);
      } else {
        this.$message({
          duration: 1500,
          showClose: true,
          message: "装置下线，发送指令失败",
          type: "error",
        });
      }
    },
    waterSet() {
      if (this.rowData.isonline || this.rowData.onlinestatus === 1) {
        this.waterSetLoading = true;
        let params = [
          {
            name: "act",
            value: "osd",
          },
          {
            name: "flag",
            value: 1,
          },

          {
            name: "channel",
            value: this.channelId,
          },
          {
            name: "leftBottom",
            value: this.waterForm.leftBottom,
          },
          {
            name: "rightBottom",
            value: this.waterForm.rightBottom,
          },
        ];
        this.setTermFn(params);
      } else {
        this.$message({
          duration: 1500,
          showClose: true,
          message: "装置下线，发送指令失败",
          type: "error",
        });
      }
    },
    waterChange() {
      console.log("点击了切换");
      this.waterForm = {};
    },
    waterhandleClick() {
      //this.waterForm = {};
      this.channelId = 1;
      clearInterval(this.timer);
      this.i = 0;
      this.timer = null;
    },
    clearform() {
      console.log("清除其他数据");
      this.waterForm = {};
      this.waterLoading = false;
      this.waterSetLoading = false;
    },
    //查询设置osd
    osdSearch() {
      if (this.rowData.isonline || this.rowData.onlinestatus === 1) {
        this.osdLoading = true;
        let params = [
          {
            name: "act",
            value: "osd",
          },
          {
            name: "flag",
            value: 0,
          },

          {
            name: "channel",
            value: this.channelId,
          },
          {
            name: "showTime",
            value: "",
          },
          {
            name: "showText",
            value: "",
          },
          {
            name: "text",
            value: "",
          },
        ];
        this.setTermFn(params);
      } else {
        this.$message({
          duration: 1500,
          showClose: true,
          message: "装置下线，发送指令失败",
          type: "error",
        });
      }
    },
    osdSet() {
      if (this.rowData.isonline || this.rowData.onlinestatus === 1) {
        this.$refs.osdFormref.validate((valid) => {
          if (valid) {
            this.osdSetLoading = true;
            console.log("我是文本");
            console.log("我是文本", this.osdParams.textContent);
            let params = [
              {
                name: "act",
                value: "osd",
              },
              {
                name: "flag",
                value: 1,
              },

              {
                name: "channel",
                value: this.channelId,
              },
              {
                name: "showTime",
                value: this.osdParams.showTime,
              },
              {
                name: "showText",
                value: this.osdParams.showText,
              },
              {
                name: "text",
                value: this.osdParams.textContent,
              },
            ];
            this.setTermFn(params);
          } else {
            console.log("error submit!!");
            return false;
          }
        });
      } else {
        this.$message({
          duration: 1500,
          showClose: true,
          message: "装置下线，发送指令失败",
          type: "error",
        });
      }
    },
    //装置状态报
    //--act=runningstatus [0xEA] --cmdid=[CMD_ID]
    runstatusSearch() {
      if (this.rowData.isonline || this.rowData.onlinestatus === 1) {
        this.statusLoading = true;
        let params = [
          {
            name: "act",
            value: "runningstatus",
          },
        ];
        this.setTermFn(params);
      } else {
        this.$message({
          duration: 1500,
          showClose: true,
          message: "装置下线，发送指令失败",
          type: "error",
        });
      }
    },
    setTermFn(dataParams) {
      console.log("点击了统一的接口", "runningstatus");
      setTermCamera({
        termId: this.rowData.id,
        list: dataParams,
      })
        .then((res) => {
          console.log(res);
          this.requestid = res.data.requestId;
          //this.getinfo1();
          this.lookTime = res.data.date;
          clearInterval(this.timer);
          this.timer = window.setInterval(() => {
            this.getinfo();
            this.i++;
          }, 1000);
          // this.timer = setInterval(() => {
          //   this.getinfo();
          //   this.i++;
          // }, 1000);
        })
        .catch((err) => {});
    },

    getinfo() {
      getTermCameraRequest({ requestid: this.requestid })
        .then((res) => {
          if (res.data.success == 1) {
            window.clearInterval(this.timer);
            this.timer = null;
            this.i = 0;
            this.timeLoading = false;
            this.timesetLoading = false;
            this.sampLoading = false;
            this.sampSetLoading = false;
            this.upperLoading = false;
            this.upperSetLoading = false;
            this.idLoading = false;
            this.idSetLoading = false;
            this.statusLoading = false;
            this.waterLoading = false;
            this.waterSetLoading = false;
            this.osdLoading = false;
            this.osdSetLoading = false;
            this.ugradLoading = false;
            console.log("终止轮询");
            // && res.data.result == 255
            console.log(JSON.parse(res.data.data));
            //时间
            console.log(this.tabName);
            //this.devicenewtime = JSON.parse(res.data.data).timestamp * 1000;
            if (this.tabName == "装置时间") {
              this.devicetime = JSON.parse(res.data.data).timestamp * 1000;
              console.log(this.devicetime);
            }
            //采集参数
            this.samplingForm = JSON.parse(res.data.data);
            //ip地址解析开始
            this.upperComputer = JSON.parse(res.data.data);
            //修改cmdid
            this.idParameter = JSON.parse(res.data.data);
            this.waterForm = JSON.parse(res.data.data);
            this.osdParams = JSON.parse(res.data.data);
            this.zjidParameter = JSON.parse(res.data.data);
            if (this.osdParams.textContent == "null ") {
              console.log("我是空");
              this.osdParams.textContent = "";
            }

            if (this.tabName == "上位机信息") {
              // let hexArray = this.upperComputer.ip
              //   .toString(16)
              //   .match(/.{1,2}/g)
              //   .reverse();
              // console.log(hexArray);
              // for (let j = 0; j < hexArray.length; j++) {
              //   console.log(hexArray[j]);
              //   console.log(parseInt(hexArray[j], 16));
              //   hexArray[j] = parseInt(hexArray[j], 16);
              // }
              // console.log(hexArray);
              this.upperComputer.ip = this.upperComputer.ipStr;
              //ip地址解析结束
              console.log(this.idParameter);
            }
            this.$message({
              duration: 1500,
              showClose: true,
              message: "信息已更新",
              type: "success",
            });
            this.showLookTime = true;
          } else if (this.i > 9) {
            window.clearInterval(this.timer);
            this.timer = null;
            this.i = 0;
            this.$message({
              duration: 1500,
              showClose: true,
              message: "暂未获取到信息，请稍后再试！！",
              type: "warning",
            });
            this.timeLoading = false;
            this.timesetLoading = false;
            this.sampLoading = false;
            this.sampSetLoading = false;
            this.upperLoading = false;
            this.upperSetLoading = false;
            this.idLoading = false;
            this.idSetLoading = false;
            this.statusLoading = false;
            this.waterLoading = false;
            this.waterSetLoading = false;
            this.osdLoading = false;
            this.osdSetLoading = false;
            this.ugradLoading = false;
          }
        })
        .catch((err) => {});
    },
    //gps位置查询
    gpsSearch() {
      console.log(this.rowData);
      getTermLastGPSPosition({
        termId: this.rowData.id,
      })
        .then((res) => {
          this.gpsForm = res.data;
          console.log(this.gpsForm);
          $moment().format("YYYY-MM-DD HH:mm:ss");
          // this.$message({
          //   duration: 1500,
          //   showClose: true,
          //   message: "gps信息已更新",
          //   type: "success",
          // });
        })
        .catch((err) => {});
    },
    //装置复位
    handleDeviceReset() {
      console.log(this.rowData);
      this.$confirm("此操作将复位装置, 是否继续?", "提示", {
        confirmButtonText: "确定",
        cancelButtonText: "取消",
        type: "warning",
      })
        .then(() => {
          resetTerminalApi({ cmId: this.rowData.cmdId || this.rowData.cmdid })
            .then((res) => {
              if (res.code == 200) {
                this.$message({
                  duration: 1500,
                  showClose: true,
                  message: "装置已复位",
                  type: "success",
                });
              } else {
                this.$message({
                  duration: 1500,
                  showClose: true,
                  message: res.msg,
                  type: "error",
                });
              }
            })
            .catch((err) => {});
        })
        .catch(() => {
          // this.$message({
          //   duration: 1500,
          //   showClose: true,
          //   type: "info",
          //   message: "已取消删除",
          // });
        });
    },
    //获取升级apkList
    getUpgradeList() {
      listApk({
        pageindex: 1,
        pagesize: 2000,
      })
        .then((res) => {
          console.log(res);
          this.upOptions = res.data.list;
        })
        .catch((err) => {});
    },
    selectChanged(val) {
      console.log(val);
      // 找到选中项的整个object对象
      this.selectUpObj = this.upOptions.find((item) => {
        return item["path"] === val;
      });
      console.log(this.selectUpObj);
    },
    //升级确定阿
    handleupgradation() {
      console.log(this.upgradationform.upVal);
      console.log(this.selectUpObj.name);
      this.$refs.upgradationRuleForm.validate((valid) => {
        if (valid) {
          this.ugradLoading = true;
          let params = [
            {
              name: "act",
              value: "upgrade",
            },
            {
              name: "file",
              value: this.upgradationform.upVal,
            },
            {
              name: "name",
              value: this.selectUpObj.name,
            },
          ];
          this.setTermFn(params);
        }
      });
    },
    display(val) {
      this.isShow = true;
      this.rowData = val;
      console.log(this.rowData);
      this.getSingleAccess();
    },
    hide() {
      this.isShow = false;
    },
    handleclose() {
      this.lookTime = "";
      this.showLookTime = false;
      this.isShow = false;
      this.activeName = "1";
      this.tabsActive = "first";
      this.samplingForm = {};
      this.deviceTimeForm = {};
      this.upperComputer = {};
      this.idParameter = {};
      this.zjidParameter = {};
      this.gpsForm = {};
      this.waterForm = {};
      this.osdParams = {};
      this.channelId = 1;
      this.i = 0;
      clearInterval(this.timer);
      this.timer = null;
      this.osdLoading = false;
      this.osdSetLoading = false;
      this.sampLoading = false;
      this.sampSetLoading = false;
      this.upperLoading = false;
      this.upperSetLoading = false;
      this.idLoading = false;
      this.idSetLoading = false;
      this.statusLoading = false;
      this.waterLoading = false;
      this.waterSetLoading = false;
      this.ugradLoading = false;
    },
  },
  destroyed() {
    if (this.timer) {
      console.log(this.timer);
      clearInterval(this.timer);
      this.timer = null;
      this.i = 0;
    } //利用vue的生命周期函数
  },
};
</script>
<style lang="less">
.parameterSetDialog {
  .looktime {
    font-size: 12px;
  }
  .zzinfo {
    position: absolute;
    top: 22px;
    left: 126px;
  }
  .el-tabs__content {
    height: 436px;
    .deviceTime {
      width: 400px;
      margin: 0 auto;
      margin-top: 24px;
      .el-input {
        width: 200px;
      }
    }
    .runform {
      width: 730px;
      margin: 0 auto;
      margin-top: 24px;
      .runformbtn {
        margin-top: 10px;
        width: 100%;
        display: flex;
        .el-form-item__content {
          margin: auto;
        }
      }
      .el-input {
        width: 200px;
      }
    }
    .queryParam {
      width: 400px;
      margin: 0 auto;
      margin-top: 24px;
      .el-input {
        width: 200px;
      }
    }
    .resetDevice {
      h3 {
        margin-bottom: 8px;
        font-size: 16px;
        font-weight: normal;
      }
    }
    .tabsBox {
      .el-tabs__item.is-active {
        color: #fff;
        background-color: #169e8c;
      }
    }
    .upgradBox {
      // display: flex;
      // flex-direction: column;
      // align-items: center;
      .el-select {
        .el-input {
          width: 316px;
        }
      }
      .el-button--primary {
        margin-left: 76px;
      }
    }
    .el-input.is-disabled .el-input__inner {
      color: #666;
    }
    .channelBox {
      margin: 0 auto;
      margin-bottom: 18px;
      text-align: center;

      .title {
        width: 86px;
        display: inline-block;
        padding: 0 12px 0 0;
        text-align: right;
      }
    }
    .waterParams {
      width: 600px;
      .el-input {
        width: 400px;
      }
    }
    .osdParam {
      .channelBox {
        .title {
          width: 38px;
          display: inline-block;
          padding: 0 12px 0 0;
        }
      }
      .el-textarea .el-textarea__inner {
        font-family: none;
      }
      .el-textarea.is-disabled .el-textarea__inner {
        color: #666;
      }
    }
  }
}
.el-select-dropdown__item {
  i {
    margin-left: 8px;
    font-size: 12px;
    font-style: normal;
  }
}
</style>
