<!-- 采集点收集 -->
<template>
  <div>
    <!-- 设置树形控件 -->
    <!-- <el-button type="info" plain @click="dialogVisible = true">斥候采集点设置</el-button> -->
    <div v-show="dialogVisible" class="tree_menu">
      <el-tree
        :data="trees"
        node-key="id"
        :props="defaultProps"
        default-expand-all
        @node-contextmenu="rightClick"
        @node-click="treeNodeClick"
        ref="tree"
      >
      </el-tree>
      <!-- 树形控件右键组件 -->
      <div v-show="menuShow" class="tree_rightmenu" :style="{ ...rightMenu }">
        <el-menu
          class="el-menu-vertical-demo"
          @select="selectMenuNode"
          default-active="#0078FE"
        >
          <el-menu-item id="menuitem" index="1" style="font-size: 12px">
            <span slot="title">{{ $t('edit') }}</span>
          </el-menu-item>
          <el-menu-item index="2" style="font-size: 12px">
            <span slot="title">{{ $t('cancel') }}</span>
          </el-menu-item>
        </el-menu>
      </div>
    </div>
    <div class="pas_params" v-show="add_passage" v-loading="loading">
      <div>
        <el-button type="primary" plain @click="handleSelect">{{ $t('save') }}</el-button>
        <!-- <el-menu :default-active="activeIndex" class="el-menu-demo" mode="horizontal" @select="handleSelect">
          <el-menu-item index="2">保存</el-menu-item>
        </el-menu> -->
      </div>
      <el-table ref="singleTable" :data="tableData" style="width: 100%">
        <el-table-column type="index"> </el-table-column>
        <el-table-column property="cjdpz_tagid" label="TagID">
          <template slot-scope="scope">
            <el-select v-model="scope.row.cjdpz_tagid" placeholder="">
              <el-option
                v-for="(option, index) in options1"
                :key="index"
                :label="option.label"
                :value="option.value"
              ></el-option>
            </el-select>
          </template>
        </el-table-column>
       <el-table-column property="cjdpz_mc" label="名称">
         <template slot-scope="scope">
           <el-select v-model="scope.row.cjdpz_mc" placeholder="">
             <el-option
               v-for="(option, index) in options2"
               :key="index"
               :label="option.label"
               :value="option.value"
             ></el-option>
           </el-select>
         </template>
       </el-table-column>
        <el-table-column property="cjdpz_sjq" :label="$t('dbcollect.dataArea')">
          <template slot-scope="scope">
            <el-select v-model="scope.row.cjdpz_sjq" placeholder="">
              <el-option
                v-for="(option, index) in options3"
                :key="index"
                :label="option.label"
                :value="option.value"
              ></el-option>
            </el-select>
          </template>
        </el-table-column>
        <el-table-column
          property="cjdpz_jcqdz"
          :label="$t('dbcollect.registerAddress')"
          width="150px"
        >
          <template slot-scope="scope">
            <!-- <el-select v-model="scope.row.cjdpz_jcqdz" placeholder="1">
              <el-option v-for="(option,index) in options4" :key="index" :label="option.label" :value="option.value"></el-option>
            </el-select> -->
            <el-input
              v-model="scope.row.cjdpz_jcqdz"
              placeholder="1-9999"
            ></el-input>
          </template>
        </el-table-column>
        <el-table-column property="cjdpz_cjsjlx" :label="$t('dbcollect.type')">
          <template slot-scope="scope">
            <el-select v-model="scope.row.cjdpz_cjsjlx" placeholder="">
              <el-option
                v-for="(option, index) in options5"
                :key="index"
                :label="option.label"
                :value="option.value"
              ></el-option>
            </el-select>
          </template>
        </el-table-column>

        <el-table-column property="cjdpz_dxsx" :label="$t('dbcollect.readWrite')">
          <template slot-scope="scope">
            <el-select v-model="scope.row.cjdpz_dxsx" placeholder="">
              <el-option
                v-for="(option, index) in options6"
                :key="index"
                :label="option.label"
                :value="option.value"
              ></el-option>
            </el-select>
          </template>
        </el-table-column>
        <el-table-column property="cjdpz_scms" :label="$t('dbcollect.uploadMode')">
          <template slot-scope="scope">
            <el-select v-model="scope.row.cjdpz_scms" placeholder="">
              <el-option
                v-for="(option, index) in options7"
                :key="index"
                :label="option.label"
                :value="option.value"
              ></el-option>
            </el-select>
          </template>
        </el-table-column>
      </el-table>
    </div>
    <!-- 网关信息 -->
    <div class="gateway">
      <el-dialog :title="$t('dbcollectiongate.title')" :visible.sync="outerVisible" width="382px">
        <el-form
          :model="tableData[0]"
          :rules="rulesGate"
          ref="gateWay"
          :label-width="$i18n.locale==='zh'?'130px':'85px'"
          class="demo-ruleForm"
        >
          <el-form-item :label="$t('dbcollectiongate.name')" prop="wgpz_wgmc">
            <el-select
              v-model="tableData[0].wgpz_wgmc"
              :placeholder="$t('select')"
              style="width: 200px"
            >
              <el-option
                v-for="item in opts1"
                :key="item.value"
                :label="item.label"
                :value="item.value"
              >
              </el-option>
            </el-select>
          </el-form-item>
          <el-form-item :label="$t('dbcollectiongate.ID')" prop="wgpz_wgid">
            <el-select
              v-model="tableData[0].wgpz_wgid"
              :placeholder="$t('select')"
              style="width: 200px"
            >
              <el-option
                v-for="item in opts2"
                :key="item.value"
                :label="item.label"
                :value="item.value"
              >
              </el-option>
            </el-select>
          </el-form-item>
        </el-form>
        <div slot="footer" class="dialog-footer-outer">
          <el-button type="primary" @click="submitGate">{{ $t('save') }}</el-button>
          <el-button @click="outerVisible = false">{{ $t('cancel') }}</el-button>
        </div>
      </el-dialog>
    </div>

    <!-- 设备信息 -->
    <div class="deviceinfo"  :class="$i18n.locale==='zh'?'zh_params deviceinfo':'deviceinfo'">
      <!-- <el-tree :data="datas2" :props="defaultProps" @node-click="handleDetailClick" default-expand-all></el-tree> -->
      <el-dialog
          :title="$t('reconnoitreConfiguration.edit')"
        :visible.sync="add_device"
        width="902px"
        v-loading="loading"
      >
        <el-form
          :model="tableData[0]"
          :label-position="labelPosition"
          :rules="rulesDevice"
          ref="formData"
        >
          <el-row>
            <el-col :span="12">
              <el-form-item
                  :label="$t('reconnoitreConfiguration.name')"
                :label-width="formLabelWidth"
                prop="sbpz_sbmc"
              >
                <el-select
                  v-model="tableData[0].sbpz_sbmc"
                  placeholder=""
                  style="width: 200px; height: 30px"
                >
                  <el-option
                    v-for="item in opt1"
                    :key="item.value"
                    :label="item.label"
                    :value="item.value"
                  >
                  </el-option>
                </el-select>
              </el-form-item>
            </el-col>
            <el-col :span="12">
              <el-form-item
                  :label="$t('reconnoitreConfiguration.controllerProtocol')"
                :label-width="formLabelWidth"
                prop="sbpz_kzqxy"
              >
                <el-row>
                  <el-col :span="18">
                    <el-input
                      v-model="tableData[0].sbpz_kzqxy"
                      placeholder=""
                      style="width: 200px; height: 30px"
                      disabled
                    ></el-input>
                  </el-col>
                  <el-col :span="6">
                    <el-button
                      style="width: 50px; height: 30px"
                      @click="getDriveName"
                      >...</el-button
                    >
                  </el-col>
                </el-row>
              </el-form-item>
            </el-col>
          </el-row>
          <el-row>
            <el-col :span="12">
              <el-form-item
                  :label="$t('reconnoitreConfiguration.IPAddress')"
                :label-width="formLabelWidth"
                prop="sbpz_ip"
              >
                <el-row>
                  <el-col :span="5">
                    <el-input
                      v-model="sbpz_ip1"
                      style="width: 43px; height: 30px"
                      maxlength="3"
                    ></el-input>
                  </el-col>
                  <el-col :span="1">. </el-col>
                  <el-col :span="5">
                    <el-input
                      v-model="sbpz_ip2"
                      style="width: 43px; height: 30px"
                      maxlength="3"
                    ></el-input>
                  </el-col>
                  <el-col :span="1">.</el-col>
                  <el-col :span="5">
                    <el-input
                      v-model="sbpz_ip3"
                      style="width: 43px; height: 30px"
                      maxlength="3"
                    ></el-input>
                  </el-col>
                  <el-col :span="1">.</el-col>
                  <el-col :span="5">
                    <el-input
                      v-model="sbpz_ip4"
                      style="width: 43px; height: 30px"
                      maxlength="3"
                    ></el-input>
                  </el-col>
                </el-row>
              </el-form-item>
            </el-col>
            <el-col :span="12">
              <el-form-item
                  :label="$t('reconnoitreConfiguration.portNumber')"
                :label-width="formLabelWidth"
                prop="sbpz_port"
              >
                <el-input
                  v-model="tableData[0].sbpz_port"
                  placeholder=""
                  style="width: 200px; height: 30px"
                ></el-input>
              </el-form-item>
            </el-col>
          </el-row>
          <el-row> </el-row>
          <el-row>
            <el-col :span="12">
              <el-form-item
                  :label="$t('reconnoitreConfiguration.slaveAddress')"
                :label-width="formLabelWidth"
                prop="sbpz_czdz"
              >
                <el-input
                  v-model="tableData[0].sbpz_czdz"
                  placeholder=""
                  style="width: 200px; height: 30px"
                ></el-input>
              </el-form-item>
            </el-col>
            <el-col :span="12">
              <el-form-item
                  :label="$t('reconnoitreConfiguration.pollTime')"
                :label-width="formLabelWidth"
                prop="sbpz_lxzq"
              >
                <el-input
                  v-model="tableData[0].sbpz_lxzq"
                  placeholder=""
                  style="width: 200px; height: 30px"
                ></el-input>
                <div class="infos">1-3600</div>
              </el-form-item>
            </el-col>
          </el-row>
          <!-- </el-form> -->
          <div class="super_parmams">
            <h3>{{ $t('reconnoitreConfiguration.params')}}</h3>
            <div>
              <i class="el-icon-caret-bottom" v-if="is_retract"></i>
              <i class="el-icon-caret-top" v-else="is_retract"></i>
              <el-button
                type="text"
                plain
                @click="getRetract"
                style="
                  color: rgba(16, 16, 16, 1);
                  font-size: 14px;
                  text-align: left;
                  border: none;
                "
              >
                {{$t('put')}}</el-button
              >
            </div>
          </div>
          <el-divider></el-divider>
          <div :class="$i18n.locale==='zh'?'zh_con super_con':'super_con'" v-show="is_retract">
            <!-- <el-form :label-position="labelPosition" :rules="rules" ref="ruleForm"> -->
            <el-row>
              <el-col :span="12">
                <el-form-item
                    :label="$t('reconnoitreConfiguration.millisecond')"
                    :label-width="$i18n.locale==='zh'?labelWidth:formLabelWidth"
                  prop="sbpz_qyhmcj"
                >
                  <el-switch v-model="tableData[0].sbpz_qyhmcj"></el-switch>
                </el-form-item>
              </el-col>
            </el-row>
            <el-row>
              <el-col :span="12">
                <el-form-item
                    :label="$t('reconnoitreConfiguration.batch')"
                    :label-width="$i18n.locale==='zh'?labelWidth:formLabelWidth"
                  prop="sbpz_qyplcj"
                >
                  <el-switch v-model="tableData[0].sbpz_qyplcj"></el-switch>
                </el-form-item>
              </el-col>
              <el-col :span="12">
                <el-form-item
                    :label="$t('reconnoitreConfiguration.maxBatch')"
                    :label-width="labelWidth"
                  prop="sbpz_zdplcjs"
                >
                  <el-input
                    v-model="tableData[0].sbpz_zdplcjs"
                    style="width: 200px; height: 30px"
                  ></el-input>
                  <div class="infos">2-125</div>
                </el-form-item>
              </el-col>
            </el-row>
            <el-row>
              <el-col :span="12">
                <el-form-item
                    :label="$t('reconnoitreConfiguration.overTime')"
                    :label-width="labelWidth"
                  prop="sbpz_cjcgsj"
                >
                  <el-input
                    v-model="tableData[0].sbpz_cjcgsj"
                    style="width: 200px; height: 30px"
                  ></el-input>
                  <div class="infos">2-60000</div>
                </el-form-item>
              </el-col>
              <el-col :span="12">
                <el-form-item
                    :label="$t('reconnoitreConfiguration.onChangData')"
                    :label-width="$i18n.locale==='zh'?labelWidth:'185px'"
                  prop="sbpz_zqsbonchange"
                >
                  <el-switch
                    v-model="tableData[0].sbpz_zqsbonchange"
                  ></el-switch>
                </el-form-item>
              </el-col>
            </el-row>
            <el-row>
              <el-col :span="12">
                <el-form-item
                    :label="$t('reconnoitreConfiguration.intervalTime')"
                    :label-width="labelWidth"
                  prop="sbpz_txsjjg"
                >
                  <el-input
                    v-model="tableData[0].sbpz_txsjjg"
                    style="width: 200px; height: 30px"
                  ></el-input>
                  <div class="infos">0-1000</div>
                </el-form-item>
              </el-col>
            </el-row>
            <div class="footer_con">
              <el-row>
                <el-col :span="12">
                  <el-form-item
                      :label="$t('reconnoitreConfiguration.writeFunction1')"
                      :label-width="labelWidth"
                    style="line-height: 20px"
                    class="cjjcq_code"
                  >
                    <el-select
                      v-model="tableData[0].sbpz_xqjcqxr"
                      placeholder=""
                      style="width: 200px; height: 30px"
                    >
                      <el-option
                        v-for="item in opt2"
                        :key="item.value"
                        :label="item.label"
                        :value="item.value"
                      >
                      </el-option>
                    </el-select>
                  </el-form-item>
                </el-col>
                <el-col :span="12">
                  <el-form-item
                      :label="$t('reconnoitreConfiguration.writeFunction2')"
                      :label-width="labelWidth"
                    class="cjjcq_code"
                  >
                    <el-select
                      v-model="tableData[0].sbpz_bcjcqxr"
                      placeholder=""
                      style="width: 200px; height: 30px"
                    >
                      <el-option
                        v-for="item in opt3"
                        :key="item.value"
                        :label="item.label"
                        :value="item.value"
                      >
                      </el-option>
                    </el-select>
                  </el-form-item>
                </el-col>
              </el-row>
            </div>
          </div>
        </el-form>
        <span slot="footer" class="dialog-footer">
          <el-button type="primary" @click="submitFormDevice">{{ $t('save') }}</el-button>
          <el-button @click="add_device = false">{{ $t('cancel') }}</el-button>
        </span>
      </el-dialog>
    </div>
    <div class="drvieName_All" v-show="diag_drive">
      <div class="title">
        <p class="title_l">{{ $t('reconnoitreConfiguration.agreementName') }}</p>
        <i class="el-icon-close title_r" @click="diag_drive = false"></i>
      </div>
      <el-divider></el-divider>
      <el-tree
        :data="datas2"
        :props="defaultProps"
        @node-click="handleDetailClick"
        default-expand-all
      ></el-tree>
    </div>
  </div>
</template>

<script>
import {SaveUserAnswer, GetUserAnswer, GetTree, SendTree, getQueryAnswer} from "@/api/user";
export default {
  name: "ChiCollection",

  data() {
    return {
      labelWidth:this.$i18n.locale==='zh'?'280px':'156px',
      loading: false,
      flag: false,
      add_device: false,
      diag_drive: false,
      isdisabled: true,
      is_retract: true,
      gateway: "",
      user_id: "",
      trees: [],
      options1: [
        {
          value: "MachinePamHID909",
          label: "MachinePamHID909",
        },
        {
          value: "MachinePamHID910",
          label: "MachinePamHID910",
        },
        {
          value: "MachinePamHID911",
          label: "MachinePamHID911",
        },
        {
          value: "MachinePamHID912",
          label: "MachinePamHID912",
        },
        {
          value: "MachinePamHID913",
          label: "MachinePamHID913",
        },
        {
          value: "MachinePamHID914",
          label: "MachinePamHID914",
        },
        {
          value: "MachinePamHID915",
          label: "MachinePamHID915",
        },
        {
          value: "MachinePamHID916",
          label: "MachinePamHID916",
        },
        {
          value: "MachinePamHID917",
          label: "MachinePamHID917",
        },
        {
          value: "MachinePamHID918",
          label: "MachinePamHID918",
        },
        {
          value: "MachinePamHID919",
          label: "MachinePamHID919",
        },
        {
          value: "MachinePamHID920",
          label: "MachinePamHID920",
        },
        {
          value: "MachinePamHID921",
          label: "MachinePamHID921",
        },
        {
          value: "MachinePamHID922",
          label: "MachinePamHID922",
        },
        {
          value: "MachinePamHID923",
          label: "MachinePamHID923",
        },
        {
          value: "MachinePamHID924",
          label: "MachinePamHID924",
        },
        {
          value: "MachinePamHID925",
          label: "MachinePamHID925",
        },
        {
          value: "MachinePamHID926",
          label: "MachinePamHID926",
        },
        {
          value: "MachinePamHID927",
          label: "MachinePamHID927",
        },
        {
          value: "MachinePamHID928",
          label: "MachinePamHID928",
        },
        {
          value: "MachinePamHID929",
          label: "MachinePamHID929",
        },
        {
          value: "MachinePamHID930",
          label: "MachinePamHID930",
        },
        {
          value: "MachinePamHID931",
          label: "MachinePamHID931",
        },
        {
          value: "MachinePamHID932",
          label: "MachinePamHID932",
        },
        {
          value: "MachinePamHID933",
          label: "MachinePamHID933",
        },
        {
          value: "MachinePamHID934",
          label: "MachinePamHID934",
        },
        {
          value: "MachinePamHID935",
          label: "MachinePamHID935",
        },
        {
          value: "MachinePamHID936",
          label: "MachinePamHID936",
        },
        {
          value: "MachinePamHID937",
          label: "MachinePamHID937",
        },
        {
          value: "MachinePamHID938",
          label: "MachinePamHID938",
        },
      ],
      options2: [
        {
          value: "急停状态",
          label: "急停状态",
        },
        {
          value: "产量",
          label: "产量",
        },
        {
          value: "相对位置X",
          label: "相对位置X",
        },
        {
          value: "相对位置Y",
          label: "相对位置Y",
        },
        {
          value: "相对位置Z",
          label: "相对位置Z",
        },
        {
          value: "实际位置X",
          label: "实际位置X",
        },
        {
          value: "实际位置Y",
          label: "实际位置Y",
        },
        {
          value: "实际位置Z",
          label: "实际位置Z",
        },
        {
          value: "主轴转速",
          label: "主轴转速",
        },
        {
          value: "当前刀具",
          label: "当前刀具",
        },
        {
          value: "预选刀具",
          label: "预选刀具",
        },
        {
          value: "报警信息",
          label: "报警信息",
        },
        {
          value: "驱动单元电流",
          label: "驱动单元电流",
        },
        {
          value: "负载电流",
          label: "负载电流",
        },
        {
          value: "额定电流",
          label: "额定电流",
        },
        {
          value: "运行时间",
          label: "运行时间",
        },
        {
          value: "加工产品用时",
          label: "加工产品用时",
        },
        {
          value: "工作模式",
          label: "工作模式",
        },
        {
          value: "切削速度",
          label: "切削速度",
        },
        {
          value: "任务信息",
          label: "任务信息",
        },
        {
          value: "使能状态",
          label: "使能状态",
        },
        {
          value: "系统状态",
          label: "系统状态",
        },
        {
          value: "执行任务信息",
          label: "执行任务信息",
        },
        {
          value: "进给倍军",
          label: "进给倍军",
        },
        {
          value: "轴速度",
          label: "轴速度",
        },
        {
          value: "轴角度",
          label: "轴角度",
        },
        {
          value: "进给速度",
          label: "进给速度",
        },
      ],
      options3: [
        {
          value: "0X (Coil Status)",
          label: "0X (Coil Status)",
        },
        {
          value: "1X (Input Status)",
          label: "1X (Input Status)",
        },
        {
          value: "3X (Input Registers)",
          label: "3X (Input Registers)",
        },
        {
          value: "4X (Holding Register)",
          label: "4X (Holding Register)",
        },
      ],
      options5: [
        {
          value: " BIT（位0/1）",
          label: " BIT（位0/1）",
        },
        {
          value: "WORD（16位无符号整数）",
          label: "WORD（16位无符号整数）",
        },
        {
          value: "INT（16位有符号整数）",
          label: "INT（16位有符号整数）",
        },
        {
          value: "DWORD（32位无符号整数）",
          label: "DWORD（32位无符号整数）",
        },
        {
          value: "DINT（32位有符号整数）",
          label: "DINT（32位有符号整数）",
        },
        {
          value: "FLOAT（单精度浮点数）",
          label: "FLOAT（单精度浮点数）",
        },
        {
          value: "DOUBLE（64位浮点数）",
          label: "DOUBLE（64位浮点数）",
        },
        {
          value: "STRING（8位字符串）",
          label: "STRING（8位字符串）",
        },
        {
          value: "BCD16（16位BCD码）",
          label: "BCD16（16位BCD码）",
        },
        {
          value: "ULONG（64位无符号整数）",
          label: "ULONG（64位无符号整数）",
        },
        {
          value: "LONG（64位有符号整数）",
          label: "LONG（64位有符号整数）",
        },
      ],
      options6: this.$t('dbcollect.options7'),
      options7: [
        {
          value: "Periodic",
          label: "Periodic",
        },
        {
          value: "Onchange",
          label: "Onchange",
        },
        {
          value: "Never",
          label: "Never",
        },
      ],
      activeIndex: "1",
      checked: "",
      labelPosition: "left",
      formLabelWidth: "116px",
      rightMenu: "",
      dialogVisible: true,
      menuShow: false,
      defaultProps: {
        children: "children",
        label: "label",
      },
      tableData: [
        {
          wgpz_wgmc: "",
          wgpz_wgid: "",

          ippz_wllx: "",
          ippz_ip: "",
          ippz_zwym: "",
          ippz_wg: "",
          ippz_dns: "",
          ippz_dns_by: "",

          sbpz_sbmc: "",
          sbpz_kzqxy: "",
          sbpz_ip: "",
          sbpz_port: "",
          sbpz_czdz: "",
          sbpz_lxzq: "",
          sbpz_qyhmcj: "",
          sbpz_qyplcj: "",
          sbpz_zdplcjs: "",
          sbpz_cjcgsj: "",
          sbpz_zqsbonchange: "",
          sbpz_txsjjg: "",
          sbpz_xqjcqxr: "",
          sbpz_bcjcqxr: "",

          cjdpz_tagid: "",
          cjdpz_mc: "",
          cjdpz_sjq: "",
          cjdpz_jcqdz: "",
          cjdpz_cjsjlx: "",
          cjdpz_dxsx: "",
          cjdpz_scms: "",

          mqtt_ip: "",
          mqtt_wgsn: "",
          mqtt_port: "",
          mqtt_keepalive: "",
          // mqtt_tls: "",
          // mqtt_clearsession: "",
          mqtt_sssjfbzt: "",
          mqtt_qos: "",

          mqtt_cjd_sbmc: "",
          mqtt_cjd_tagid: "",
        },
      ],
      // 网关配置的出现
      outerVisible: false,
      rulesGate: {
        wgpz_wgmc: [
          { required: true, message: "请选择网关名称", trigger: "blur" },
        ],
        wgpz_wgid: [
          { required: true, message: "请选择网关id", trigger: "blur" },
        ],
      },
      opts1: this.$t('dbcollectiongate.options2'),
      opts2: [
        {
          value: "LAN-BOX2",
          label: "LAN-BOX2",
        },
        {
          value: "WLAN-BOX2",
          label: "WLAN-BOX2",
        },
      ],

      // 设备信息
      sbpz_ip1: "",
      sbpz_ip2: "",
      sbpz_ip3: "",
      sbpz_ip4: "",
      opt1: [
        {
          value: "有线区精雕2",
          label: "有线区精雕2",
        },
        {
          value: "无线区精雕2",
          label: "无线区精雕2",
        },
      ],
      opt2: [
        {
          value: "05",
          label: "05",
        },
      ],
      opt3: [
        {
          value: "06",
          label: "06",
        },
      ],
      isdisabled: true,
      radio: "1",
      checked1: false,
      is_retract: true,
      labelPosition: "left",
      formLabelWidth: this.$i18n.locale==='zh'?'155px':"116px",
      add_passage: true,
      dialogVisible: true,
      menuShow: false,
      datas2: [
        {
          label: "Allen-Bradley",
          children: [
            {
              label: "EtherNet/IP(ControlLogix)",
            },
            {
              label: "EtherNet/IP(MicroLogix)",
            },
          ],
        },
        {
          label: "Modbus",
          children: [
            {
              label: "Modbus TCP",
            },
            {
              label: "Modbus RTU",
            },
            {
              label: "Modbus ASCII",
            },
            {
              label: "Modbus RTU Over TCP",
            },
          ],
        },
        {
          label: "MITSUBISHI",
          children: [
            {
              label: "Mitsubishi CPU Port(Serial)",
            },
            {
              label: "Mitsubishi MC 3C",
            },
            {
              label: "Mitsubishi MC 1E",
            },
            {
              label: "Mitsubishi MC 3E",
            },
            {
              label: "Mitsubishi MC 3C Over TCP",
            },
          ],
        },
        {
          label: "OMRON",
          children: [
            {
              label: "FINS TCP",
            },
            {
              label: "FINS UDP",
            },
            {
              label: "HostLink",
            },
          ],
        },
        {
          label: "SIEMENS",
          children: [
            {
              label: "ISO-on-TCP",
            },
            {
              label: "PPI",
            },
          ],
        },
      ],
      defaultProps: {
        children: "children",
        label: "label",
      },
      rulesDevice: {
        sbpz_sbmc: [
          {required: true, message: this.$t('reconnoitreConfiguration.rules.sbpz_sbmc'), trigger: "change"},
        ],
        sbpz_kzqxy: [
          {required: true, message: this.$t('reconnoitreConfiguration.rules.sbpz_kzqxy'), trigger: "blur"},
        ],
        sbpz_ip: [
          {
            required: true,
            message: "",
            validator: this.validateIp,
            trigger: "blur",
          },
        ],
        sbpz_czdz: [
          {required: true, message: this.$t('reconnoitreConfiguration.rules.sbpz_czdz'), trigger: "blur"},
        ],
        sbpz_port: [
          {required: true, message: this.$t('reconnoitreConfiguration.rules.sbpz_port'), trigger: "blur"},
        ],
        sbpz_lxzq: [
          {required: true, message: this.$t('reconnoitreConfiguration.rules.sbpz_lxzq'), trigger: "blur"},
        ],
        sbpz_qyhmcj: [
          {required: true, message: this.$t('reconnoitreConfiguration.rules.sbpz_qyhmcj'), trigger: "change"},
        ],
        sbpz_qyplcj: [
          {required: true, message: this.$t('reconnoitreConfiguration.rules.sbpz_qyplcj'), trigger: "change"},
        ],
        sbpz_zdplcjs: [
          {required: true, message: this.$t('reconnoitreConfiguration.rules.sbpz_zdplcjs'), trigger: "blur"},
        ],
        sbpz_cjcgsj: [
          {required: true, message: this.$t('reconnoitreConfiguration.rules.sbpz_cjcgsj'), trigger: "blur"},
        ],
        sbpz_zqsbonchange: [
          {
            required: true,
            message: "周期上报Onchange数据",
            trigger: "change",
          },
        ],
        sbpz_txsjjg: [
          {required: true, message: this.$t('reconnoitreConfiguration.rules.sbpz_txsjjg'), trigger: "blur"},
        ],
      }
    };
  },
  methods: {
    async rightClick(e, data, node) {
      console.log(node);
      if (data.editing) {
        this.outerVisible = true;
        this.GetUserAnswer();
      }
      if (node.level == 3 && data.label == this.tableData[0].sbpz_sbmc) {
        this.menuShow = false;
        this.menuShow = true;
        this.nodekey = data.id;
        e.preventDefault(); //关闭浏览器右键默认事件
        this.rightMenu = { top: e.pageY + "px", left: e.pageX + "px" };
        document.addEventListener("click", (ev) => {
          ev.stopImmediatePropagation();
          if (ev.target !== document.querySelector(".el-menu-item.is-active")) {
            this.foo();
          }
        });
      }
    },
    // 点击时候的判断,判断是否为编辑设备
    async selectMenuNode(index, indexPath) {
      console.log(index);
      if (index == 1) {
        this.add_device = true;
        this.add_passage = false;
        this.outerVisible = false;
        let { data } = await GetUserAnswer({
          mark: "CHGYWG_yx",
          user_id: this.user_id,
        });
        this.loading = false;
        console.log(data, "22222222");
        // console.log(JSON.parse(data.data.mark_value));
        if (data.data && data.state) {
          let obj = JSON.parse(data.data.mark_value);
          console.log(obj, "编辑按钮的显现");
          if (obj.sbpz_ip) {
            this.sbpz_ip1 = obj.sbpz_ip.split(".")[0];
            this.sbpz_ip2 = obj.sbpz_ip.split(".")[1];
            this.sbpz_ip3 = obj.sbpz_ip.split(".")[2];
            this.sbpz_ip4 = obj.sbpz_ip.split(".")[3];
            this.tableData[0].sbpz_ip = obj.sbpz_ip;
            this.tableData[0].sbpz_zqsbonchange = Boolean(
              Number(obj.sbpz_zqsbonchange)
            );
            this.tableData[0].sbpz_qyhmcj = Boolean(Number(obj.sbpz_qyhmcj));
            this.tableData[0].sbpz_qyplcj = Boolean(Number(obj.sbpz_qyplcj));
          }
          this.tableData[0].sbpz_sbmc = obj.sbpz_sbmc;
          this.tableData[0].sbpz_kzqxy = obj.sbpz_kzqxy;
          this.tableData[0].sbpz_port = obj.sbpz_port;
          this.tableData[0].sbpz_czdz = obj.sbpz_czdz;
          this.tableData[0].sbpz_lxzq = obj.sbpz_lxzq;
          this.tableData[0].sbpz_zdplcjs = obj.sbpz_zdplcjs;
          this.tableData[0].sbpz_cjcgsj = obj.sbpz_cjcgsj;
          // console.log(this.formData.sbpz_zqsbonchange);
          this.tableData[0].sbpz_txsjjg = obj.sbpz_txsjjg;
          this.tableData[0].sbpz_xqjcqxr = obj.sbpz_xqjcqxr;
          this.tableData[0].sbpz_bcjcqxr = obj.sbpz_bcjcqxr;
          this.tableData[0].wgpz_wgid = obj.wgpz_wgid;
          this.tableData[0].wgpz_wgmc = obj.wgpz_wgmc;

          this.tableData[0].ippz_wllx = obj.ippz_wllx;
          this.tableData[0].ippz_ip = obj.ippz_ip;
          this.tableData[0].ippz_zwym = obj.ippz_zwym;
          this.tableData[0].ippz_wg = obj.ippz_wg;
          this.tableData[0].ippz_dns = obj.ippz_dns;
          this.tableData[0].ippz_dns_by = obj.ippz_dns_by;

          this.tableData[0].cjdpz_tagid = obj.cjdpz_tagid;
          this.tableData[0].cjdpz_mc = obj.cjdpz_mc;
          this.tableData[0].cjdpz_sjq = obj.cjdpz_sjq;
          this.tableData[0].cjdpz_jcqdz = obj.cjdpz_jcqdz;
          this.tableData[0].cjdpz_cjsjlx = obj.cjdpz_cjsjlx;
          this.tableData[0].cjdpz_dxsx = obj.cjdpz_dxsx;
          this.tableData[0].cjdpz_scms = obj.cjdpz_scms;

          this.tableData[0].mqtt_ip = obj.mqtt_ip;
          this.tableData[0].mqtt_wgsn = obj.mqtt_wgsn;
          this.tableData[0].mqtt_port = obj.mqtt_port;
          this.tableData[0].mqtt_keepalive = obj.mqtt_keepalive;
          // this.tableData[0].mqtt_tls = obj.mqtt_tls;
          // this.tableData[0].mqtt_clearsession = obj.mqtt_clearsession;
          this.tableData[0].mqtt_sssjfbzt = obj.mqtt_sssjfbzt;
          this.tableData[0].mqtt_qos = obj.mqtt_qos;

          this.tableData[0].mqtt_cjd_sbmc = obj.mqtt_cjd_sbmc;
          this.tableData[0].mqtt_cjd_tagid = obj.mqtt_cjd_tagid;
        }
      } else if (index == 2) {
        this.menuShow = false;
      }
    },
    foo() {
      // 取消鼠标监听事件 菜单栏
      this.menuShow = false;
      document.removeEventListener("click", this.foo); // 关掉监听，
    },
    treeNodeClick() {
      this.add_passage = true;
      this.foo();
    },
    // 保存表格中的数据
    async handleSelect() {
      // let datas = sessionStorage.getItem("CHGYWG_yx");
      // console.log(JSON.parse(datas));
      // datas = { ...JSON.parse(datas), ...this.tableData[0] };
      let res = await SaveUserAnswer({
        mark: "CHGYWG_yx",
        user_id: this.user_id,
        mark_value: JSON.stringify(this.tableData[0]),
        step: "2",
      });
      // alert(this.tableData[0].sbpz_cjcgsj);
      if (res.data.state) {
        this.$message({
          message: "保存成功",
          type: "success",
        });
        // console.log(res);
        // sessionStorage.setItem("CHGYWG_yx", JSON.stringify(this.tableData[0]));
      } else {
        this.$message({
          message: `保存失败`,
          type: "error",
        });
      }
    },
    async GetUserAnswer() {
      this.loading = true;
      let { data } = await GetUserAnswer({
        mark: "CHGYWG_yx",
        user_id: this.user_id,
      });
      // console.log(data, "斥候有线网关的采集点页面");
      this.loading = false;
      if(!data.state){
        getQueryAnswer({
          mark: "CHGYWG_yx",
          user_id: this.user_id
        }).then(res => {
          let obj = JSON.parse(res.data.data.r3);
          // alert(obj.sbpz_qyhmcj);
          // alert(obj.sbpz_qyplcj);
          if (obj.cjdpz_tagid) {
            this.tableData[0].cjdpz_tagid = obj.cjdpz_tagid;
            this.tableData[0].cjdpz_mc = obj.cjdpz_mc;
            this.tableData[0].cjdpz_sjq = obj.cjdpz_sjq;
            this.tableData[0].cjdpz_jcqdz = obj.cjdpz_jcqdz;
            this.tableData[0].cjdpz_cjsjlx = obj.cjdpz_cjsjlx;
            this.tableData[0].cjdpz_dxsx = obj.cjdpz_dxsx;
            this.tableData[0].cjdpz_scms = obj.cjdpz_scms;
          }
          this.tableData[0].sbpz_sbmc = obj.sbpz_sbmc;
          this.tableData[0].sbpz_kzqxy = obj.sbpz_kzqxy;
          this.tableData[0].sbpz_ip = obj.sbpz_ip;
          this.tableData[0].sbpz_port = obj.sbpz_port;
          this.tableData[0].sbpz_czdz = obj.sbpz_czdz;
          this.tableData[0].sbpz_lxzq = obj.sbpz_lxzq;
          this.tableData[0].sbpz_qyhmcj = obj.sbpz_qyhmcj;
          this.tableData[0].sbpz_qyplcj = obj.sbpz_qyplcj;
          this.tableData[0].sbpz_zdplcjs = obj.sbpz_zdplcjs;
          this.tableData[0].sbpz_cjcgsj = obj.sbpz_cjcgsj;
          this.tableData[0].sbpz_zqsbonchange = obj.sbpz_zqsbonchange;
          this.tableData[0].sbpz_txsjjg = obj.sbpz_txsjjg;
          this.tableData[0].sbpz_xqjcqxr = obj.sbpz_xqjcqxr;
          this.tableData[0].sbpz_bcjcqxr = obj.sbpz_bcjcqxr;

          this.tableData[0].wgpz_wgid = obj.wgpz_wgid;
          this.tableData[0].wgpz_wgmc = obj.wgpz_wgmc;

          this.tableData[0].ippz_wllx = obj.ippz_wllx;
          this.tableData[0].ippz_ip = obj.ippz_ip;
          this.tableData[0].ippz_zwym = obj.ippz_zwym;
          this.tableData[0].ippz_wg = obj.ippz_wg;
          this.tableData[0].ippz_dns = obj.ippz_dns;
          this.tableData[0].ippz_dns_by = obj.ippz_dns_by;

          this.tableData[0].mqtt_ip = obj.mqtt_ip;
          this.tableData[0].mqtt_wgsn = obj.mqtt_wgsn;
          this.tableData[0].mqtt_port = obj.mqtt_port;
          this.tableData[0].mqtt_keepalive = obj.mqtt_keepalive;
          // this.tableData[0].mqtt_tls = obj.mqtt_tls;
          // this.tableData[0].mqtt_clearsession = obj.mqtt_clearsession;
          this.tableData[0].mqtt_sssjfbzt = obj.mqtt_sssjfbzt;
          this.tableData[0].mqtt_qos = obj.mqtt_qos;
          this.tableData[0].mqtt_cjd_sbmc = obj.mqtt_cjd_sbmc;
          this.tableData[0].mqtt_cjd_tagid = obj.mqtt_cjd_tagid;
        })
      }
      if (data.data && data.state) {
        // console.log(JSON.parse(data.data.mark_value));
        let obj = JSON.parse(data.data.mark_value);
        // alert(obj.sbpz_qyhmcj);
        // alert(obj.sbpz_qyplcj);
        if (obj.cjdpz_tagid) {
          this.tableData[0].cjdpz_tagid = obj.cjdpz_tagid;
          this.tableData[0].cjdpz_mc = obj.cjdpz_mc;
          this.tableData[0].cjdpz_sjq = obj.cjdpz_sjq;
          this.tableData[0].cjdpz_jcqdz = obj.cjdpz_jcqdz;
          this.tableData[0].cjdpz_cjsjlx = obj.cjdpz_cjsjlx;
          this.tableData[0].cjdpz_dxsx = obj.cjdpz_dxsx;
          this.tableData[0].cjdpz_scms = obj.cjdpz_scms;
        }
        this.tableData[0].sbpz_sbmc = obj.sbpz_sbmc;
        this.tableData[0].sbpz_kzqxy = obj.sbpz_kzqxy;
        this.tableData[0].sbpz_ip = obj.sbpz_ip;
        this.tableData[0].sbpz_port = obj.sbpz_port;
        this.tableData[0].sbpz_czdz = obj.sbpz_czdz;
        this.tableData[0].sbpz_lxzq = obj.sbpz_lxzq;
        this.tableData[0].sbpz_qyhmcj = obj.sbpz_qyhmcj;
        this.tableData[0].sbpz_qyplcj = obj.sbpz_qyplcj;
        this.tableData[0].sbpz_zdplcjs = obj.sbpz_zdplcjs;
        this.tableData[0].sbpz_cjcgsj = obj.sbpz_cjcgsj;
        this.tableData[0].sbpz_zqsbonchange = obj.sbpz_zqsbonchange;
        this.tableData[0].sbpz_txsjjg = obj.sbpz_txsjjg;
        this.tableData[0].sbpz_xqjcqxr = obj.sbpz_xqjcqxr;
        this.tableData[0].sbpz_bcjcqxr = obj.sbpz_bcjcqxr;

        this.tableData[0].wgpz_wgid = obj.wgpz_wgid;
        this.tableData[0].wgpz_wgmc = obj.wgpz_wgmc;

        this.tableData[0].ippz_wllx = obj.ippz_wllx;
        this.tableData[0].ippz_ip = obj.ippz_ip;
        this.tableData[0].ippz_zwym = obj.ippz_zwym;
        this.tableData[0].ippz_wg = obj.ippz_wg;
        this.tableData[0].ippz_dns = obj.ippz_dns;
        this.tableData[0].ippz_dns_by = obj.ippz_dns_by;

        this.tableData[0].mqtt_ip = obj.mqtt_ip;
        this.tableData[0].mqtt_wgsn = obj.mqtt_wgsn;
        this.tableData[0].mqtt_port = obj.mqtt_port;
        this.tableData[0].mqtt_keepalive = obj.mqtt_keepalive;
        // this.tableData[0].mqtt_tls = obj.mqtt_tls;
        // this.tableData[0].mqtt_clearsession = obj.mqtt_clearsession;
        this.tableData[0].mqtt_sssjfbzt = obj.mqtt_sssjfbzt;
        this.tableData[0].mqtt_qos = obj.mqtt_qos;
        this.tableData[0].mqtt_cjd_sbmc = obj.mqtt_cjd_sbmc;
        this.tableData[0].mqtt_cjd_tagid = obj.mqtt_cjd_tagid;
      }
    },
    async sendTree() {
      let result = await SendTree({
        user_id: this.user_id,
        data: JSON.stringify(this.trees),
        type: "3",
      });
      console.log(result);
    },
    //斥候设备的配置信息
    // 收起点击事件的判断
    getRetract() {
      if (this.is_retract == true) {
        this.is_retract = false;
      } else {
        this.is_retract = true;
      }
    },
    getDriveName() {
      this.diag_drive = true;
    },
    closeMenu(ev) {
      console.log({ ev });
      this.dialogVisible = false;
    },
    handleDetailClick(data, node, value) {
      console.log(data.label);
      if (node.childNodes.length == 0) {
        this.tableData[0].sbpz_kzqxy = data.label;
        this.diag_drive = false;
      }
    },
    // 设备修改的校验信息
    //ip地址验证
    validateIp(rule, value, callback) {
      if (
        this.sbpz_ip1 +
          "." +
          this.sbpz_ip2 +
          "." +
          this.sbpz_ip3 +
          "." +
          this.sbpz_ip4 ===
        "..."
      ) {
        callback(new Error("请输入IP地址"));
      } else if (
        !/^(\d{1,2}|1\d\d|2[0-4]\d|25[0-5])\.(\d{1,2}|1\d\d|2[0-4]\d|25[0-5])\.(\d{1,2}|1\d\d|2[0-4]\d|25[0-5])\.(\d{1,2}|1\d\d|2[0-4]\d|25[0-5])$/.test(
          this.sbpz_ip1 +
            "." +
            this.sbpz_ip2 +
            "." +
            this.sbpz_ip3 +
            "." +
            this.sbpz_ip4
        )
      ) {
        callback(new Error("请输入有效的IP地址"));
      } else {
        callback();
      }
    },
    submitFormDevice: _.debounce(function () {
      this.$refs["formData"].validate((valid) => {
        if (valid) {
          this.saveDevice();
        } else {
          console.log("error submit!!");
          return false;
        }
      });
    }, 1000),
    async saveDevice() {
      // alert(String(Number(this.tableData[0].sbpz_qyhmcj)));
      var obj = {
        sbpz_sbmc: this.tableData[0].sbpz_sbmc,
        sbpz_kzqxy: this.tableData[0].sbpz_kzqxy,
        sbpz_ip:
          this.sbpz_ip1 +
          "." +
          this.sbpz_ip2 +
          "." +
          this.sbpz_ip3 +
          "." +
          this.sbpz_ip4,
        sbpz_port: this.tableData[0].sbpz_port,
        sbpz_czdz: this.tableData[0].sbpz_czdz,
        sbpz_lxzq: this.tableData[0].sbpz_lxzq,
        sbpz_qyhmcj: String(Number(this.tableData[0].sbpz_qyhmcj)),
        sbpz_qyplcj: String(Number(this.tableData[0].sbpz_qyplcj)),
        sbpz_zdplcjs: this.tableData[0].sbpz_zdplcjs,
        sbpz_cjcgsj: this.tableData[0].sbpz_cjcgsj,
        sbpz_zqsbonchange: String(Number(this.tableData[0].sbpz_zqsbonchange)),
        sbpz_txsjjg: this.tableData[0].sbpz_txsjjg,
        sbpz_xqjcqxr: this.tableData[0].sbpz_xqjcqxr,
        sbpz_bcjcqxr: this.tableData[0].sbpz_bcjcqxr,

        ippz_wllx: this.tableData[0].ippz_wllx,
        ippz_ip: this.tableData[0].ippz_ip,
        ippz_zwym: this.tableData[0].ippz_zwym,
        ippz_wg: this.tableData[0].ippz_wg,
        ippz_dns: this.tableData[0].ippz_dns,
        ippz_dns_by: this.tableData[0].ippz_dns_by,

        wgpz_wgmc: this.tableData[0].wgpz_wgmc,
        wgpz_wgid: this.tableData[0].wgpz_wgid,

        cjdpz_tagid: this.tableData[0].cjdpz_tagid,
        cjdpz_mc: this.tableData[0].cjdpz_mc,
        cjdpz_sjq: this.tableData[0].cjdpz_sjq,
        cjdpz_jcqdz: this.tableData[0].cjdpz_jcqdz,
        cjdpz_cjsjlx: this.tableData[0].cjdpz_cjsjlx,
        cjdpz_dxsx: this.tableData[0].cjdpz_dxsx,
        cjdpz_scms: this.tableData[0].cjdpz_scms,

        mqtt_ip: this.tableData[0].mqtt_ip,
        mqtt_wgsn: this.tableData[0].mqtt_wgsn,
        mqtt_port: this.tableData[0].mqtt_port,
        mqtt_keepalive: this.tableData[0].mqtt_keepalive,
        // mqtt_tls: this.tableData[0].mqtt_tls,
        // mqtt_clearsession: this.tableData[0].mqtt_clearsession,
        mqtt_sssjfbzt: this.tableData[0].mqtt_sssjfbzt,
        mqtt_qos: this.tableData[0].mqtt_qos,

        mqtt_cjd_sbmc: this.tableData[0].mqtt_cjd_sbmc,
        mqtt_cjd_tagid: this.tableData[0].mqtt_cjd_tagid,
      };
      let res = await SaveUserAnswer({
        mark: "CHGYWG_yx",
        user_id: this.user_id,
        mark_value: JSON.stringify(obj),
        step: "2",
      });
      // alert(JSON.stringify(res.data));
      console.log(res);
      if (res.data.state) {
        this.$message({
          message: "更改成功",
          type: "success",
        });
        this.updateLabelById(this.nodekey, this.tableData[0].sbpz_sbmc);
        this.add_device = false;
        this.sendTree();
      } else {
        this.$message({
          message: `保存失败`,
          type: "error",
        });
      }
    },

    // 修改树形控件的名字
    findNodeById(nodes, targetId) {
      let foundNode = null;
      const findNode = (nodes) => {
        for (const node of nodes) {
          if (node.id === targetId) {
            // 找到节点
            foundNode = node;
            return;
          }
          if (node.children) {
            findNode(node.children);
          }
        }
      };

      findNode(nodes);
      return foundNode;
    },
    updateLabelById(targetId, newLabel) {
      const targetNode = this.findNodeById(this.trees, targetId);
      // console.log(targetId);
      // console.log(targetNode);
      // console.log(newLabel);
      if (targetNode) {
        // 找到节点，更新label值
        // console.log(targetNode);
        // console.log(newLabel);
        this.$set(targetNode, "label", newLabel);
        // 强制更新视图
        this.$forceUpdate();
        // this.getTree();
        // this.getTree();
      }
    },

    //网关配置的信息
    async submitGate() {
      this.$refs["gateWay"].validate((valid) => {
        if (valid) {
          // console.log('submit!');
          this.saveGates();
        } else {
          console.log("error submit!!");
          return false;
        }
      });
    },
    //
    async saveGates() {
      this.outerVisible = false;
      // this.innerVisible = false;
      // datas = sessionStorage.getItem("CHGYWG_yx");
      // console.log(JSON.parse(datas));
      // let datas = { ...this.tableData[0], ...this.gateWay };
      // console.log(datas);
      let res = await SaveUserAnswer({
        mark: "CHGYWG_yx",
        user_id: this.user_id,
        // user_id: "USER202307301114011710",
        mark_value: JSON.stringify(this.tableData[0]),
        step: "2",
      });
      if (res.data.state) {
        this.$message({
          message: "修改成功",
          type: "success",
        });
        this.trees[0].label = this.tableData[0].wgpz_wgid;
        this.sendTree();
        // sessionStorage.setItem("CHGYWG_yx", JSON.stringify(this.tableData[0]));
      } else {
        this.$message({
          message: `保存失败,原因是${res.data.message}`,
          type: "error",
        });
      }
      console.log(res);
    },
  },
  created() {
    this.user_id = this.$route.query.user_id;
    this.GetUserAnswer();
    if (this.user_id != "undefined") {
      GetTree({
        user_id: this.user_id,
        type: "3",
      }).then((res) => {
        console.log(res);
        console.log(JSON.parse(res.data.data.data));
        this.trees = JSON.parse(res.data.data.data);
      });
    }
  },
};
</script>

<style lang="less" scoped>
.zh_con{
  .el-col-12{
    width: 100% !important;
  }
  .el-row{
    display:block !important;
  }
}
.tree_menu {
  position: absolute;
  width: 286px;
  height: 753px;
  left: 64px;
  top: 104px;
  width: 286px;
  height: 753px;
  line-height: 20px;
  border-radius: 3px;
  background-color: rgba(255, 255, 255, 1);
  text-align: center;
  border: 1px solid rgba(220, 220, 220, 1);
}
.zh_params{

  .el-col-12:last-child {
    padding-right: 100px !important;
  }

  .el-col-12:first-child {
    padding-right: 66px !important;
  }
}
.tree_rightmenu {
  position: fixed;
  width: 120px;
  border: 1px solid rgba(0, 0, 0, 0.15);
  box-shadow: 0 6px 12px rgba(0, 0, 0, 0.175);
  z-index: 1000;
}

/deep/ .pas_params {
  position: absolute;
  left: 362px;
  top: 95px;
  width: 1066px;
  height: 752px;
  line-height: 20px;
  border-radius: 3px;
  color: white;
  background-image: url(../assets/image/bg.png);
  background-size: 100% 100%;
  // text-align: center;
  border: 1px solid rgba(220, 220, 220, 1);

  .el-button {
    width: 80px;
    height: 30px;
    line-height: 0.5;
  }

  .el-col-12:last-child {
    padding-right: 150px;
  }

  .el-col-12:first-child {
    padding-right: 54px;
  }

  .el-row {
    height: 40px;
    display: flex;
    align-items: flex-start;

    .el-col-1 {
      text-align: center;
      line-height: 20px;
      height: 20px;
    }

    .el-col-9 {
      padding-left: 30px;
    }
  }

  .el-input__inner {
    height: 30px;
    text-align: left;
    padding: 0px 8px;
  }

  .content {
    position: absolute;
    left: 377px;
    top: 69px;
    width: 1220px;
    height: 836px;
    line-height: 20px;
    padding-left: 36px;
    background-color: rgba(255, 255, 255, 1);
    color: rgba(16, 16, 16, 1);
    font-size: 14px;
    border: 1px solid rgba(187, 187, 187, 1);
    display: flex;
    justify-content: flex-start;
    align-items: flex-start;

    .el-form-item {
      margin-bottom: 0px;
    }

    /deep/ .con_left {
      .el-con-5 {
        width: 43px;
      }
    }

    .con_left {
      width: 709px;
      position: relative;

      .con_left_footer {
        position: absolute;
        left: 499px;
        top: 777px;
      }
    }

    .con_right {
      width: 480px;

      .dialog-footer {
        .el-button {
          width: 80px;
          height: 30px;
          line-height: 0.5;
        }
      }
    }
  }
}

.super_parmams {
  display: flex;
  justify-content: space-between;
  align-items: center;
  width: 668px;

  i {
    width: 24px;
    height: 24px;
    display: inline-block;
  }
}

/deep/ .deviceinfo {
  .el-form-item {
    margin-bottom: 20px !important;
  }

  .el-col-12:last-child {
    padding-right: 150px;
  }

  .el-col-12:first-child {
    padding-right: 102px;
  }

  .el-divider--horizontal {
    margin: 8px 0px;
  }

  .el-input__inner {
    height: 30px;
    text-align: left;
    padding: 0px 8px;
  }

  .el-row {
    display: flex;
    align-items: flex-end;

    .el-col-1 {
      text-align: center;
      line-height: 20px;
      height: 20px;
    }

    .el-col-6 {
      height: 40px;
      top: 5px;
      left: 25px;
      position: relative;
      width: 50px;
    }
  }
}

/deep/ .super_con {
  .el-form-item {
    margin-bottom: 7px;
  }

  .el-row {
    display: flex;
    align-items: flex-end;
  }

  .coil {
    display: inline-block;
    width: 98px;
    height: 25px;
    color: rgba(16, 16, 16, 1);
    font-size: 14px;
    text-align: left;
  }
}

.infos {
  width: 60px;
  position: absolute;
  left: 208px;
  top: 0;
}

/deep/ .footer_con {
  .cjjcq_code {
    // margin-left: 140px !important;
    .el-form-item__content {
      margin-left: 140px !important;
    }
  }

  .el-form-item__label {
    line-height: 20px;
  }
}

/deep/ .drvieName_All {
  position: absolute;
  left: 1478px;
  top: 140px;
  width: 435px;
  max-height: 720px;
  z-index: 10000;
  border: 1px solid #f5f5f5;

  .title {
    background-color: #fff;
    padding: 5px 6px 5px 25px;
    display: flex;
    justify-content: space-between;

    .title_l {
      //width: 103px;
      height: 26px;
      color: rgba(16, 16, 16, 1);
      font-size: 18px;
      text-align: left;
    }

    .title_r {
      width: 24px;
      height: 24px;
      line-height: 24px;
      cursor: pointer;
      color: rgba(111, 103, 103, 1);
    }
  }

  .el-divider--horizontal {
    margin: 0px;
  }
}
</style>
