<!-- 斥候有线网关页面 -->
<template>
  <div>
    <div class="gateway" :style="$i18n.locale==='zh'?'height:600px':''" v-show="isShow">
      <div class="title">
        <p class="title_l">{{$t('wiredgatewayip.title')}}</p>
        <p class="title_center" v-if="$i18n.locale==='en'">{{$t('wiredgatewayip.prompt')}}</p>
        <i class="el-icon-close title_r" @click="isShow = false"></i>
      </div>
      <el-divider></el-divider>
      <div :class="$i18n.locale==='zh'?'zhContent content':'content'">
        <div class="lan">
          <p class="zh-pro" v-if="$i18n.locale==='zh'">{{$t('wiredgatewayip.prompt')}}</p>
          <el-form v-loading="loading" :model="formData" :label-position="labelPosition" :rules="rules" ref="formData">
            <el-row>
              <el-col :span="24">
                <el-form-item :label="$t('wiredgatewayip.networkType')" :label-width="formLabelWidth" prop="ippz_wllx">
                  <el-select v-model="formData.ippz_wllx" :placeholder="$t('wiredgatewayip.staticIP')" style="width: 200px">
                    <el-option :label="$t('wiredgatewayip.staticIP')" :value="$t('wiredgatewayip.staticIP')"></el-option>
                  </el-select>
                </el-form-item>
              </el-col>
            </el-row>
            <el-row>
              <el-col :span="24">
                <el-form-item :label="$t('wiredgatewayip.IP')" :label-width="formLabelWidth" prop="ippz_ip">
                  <el-row>
                    <el-col :span="5">
                      <el-input v-model="ippz_ip1"></el-input>
                    </el-col>
                    <el-col :span="1">. </el-col>
                    <el-col :span="5">
                      <el-input v-model="ippz_ip2"></el-input>
                    </el-col>
                    <el-col :span="1">.</el-col>
                    <el-col :span="5">
                      <el-input v-model="ippz_ip3"></el-input>
                    </el-col>
                    <el-col :span="1">.</el-col>
                    <el-col :span="5">
                      <el-input v-model="ippz_ip4"></el-input>
                    </el-col>
                  </el-row>
                </el-form-item>
              </el-col>
            </el-row>
            <el-row>
              <el-col :span="24">
                <el-form-item :label="$t('wiredgatewayip.SubnetMask')" :label-width="formLabelWidth" prop="ippz_zwym">
                  <el-row>
                    <el-col :span="5">
                      <el-input v-model="ippz_zwym1"></el-input>
                    </el-col>
                    <el-col :span="1">.</el-col>
                    <el-col :span="5">
                      <el-input v-model="ippz_zwym2"></el-input>
                    </el-col>
                    <el-col :span="1">.</el-col>
                    <el-col :span="5">
                      <el-input v-model="ippz_zwym3"></el-input>
                    </el-col>
                    <el-col :span="1">.</el-col>
                    <el-col :span="5">
                      <el-input v-model="ippz_zwym4"></el-input>
                    </el-col>
                  </el-row>
                </el-form-item>
              </el-col>
            </el-row>
            <el-row>
              <el-col :span="24">
                <el-form-item :label="$t('wiredgatewayip.gateWay')" :label-width="formLabelWidth">
                  <el-row>
                    <el-col :span="5">
                      <el-input v-model="ippz_wg1"></el-input>
                    </el-col>
                    <el-col :span="1">. </el-col>
                    <el-col :span="5">
                      <el-input v-model="ippz_wg2"></el-input>
                    </el-col>
                    <el-col :span="1">.</el-col>
                    <el-col :span="5">
                      <el-input v-model="ippz_wg3"></el-input>
                    </el-col>
                    <el-col :span="1">.</el-col>
                    <el-col :span="5">
                      <el-input v-model="ippz_wg4"></el-input>
                    </el-col>
                  </el-row>
                </el-form-item>
              </el-col>
            </el-row>
            <el-row>
              <el-col :span="24">
                <el-form-item label="DNS:" :label-width="formLabelWidth">
                  <el-row>
                    <el-col :span="5">
                      <el-input v-model="ippz_dns1"></el-input>
                    </el-col>
                    <el-col :span="1">. </el-col>
                    <el-col :span="5">
                      <el-input v-model="ippz_dns2"></el-input>
                    </el-col>
                    <el-col :span="1">.</el-col>
                    <el-col :span="5">
                      <el-input v-model="ippz_dns3"></el-input>
                    </el-col>
                    <el-col :span="1">.</el-col>
                    <el-col :span="5">
                      <el-input v-model="ippz_dns4"></el-input>
                    </el-col>
                  </el-row>
                </el-form-item>
              </el-col>
            </el-row>
            <el-row>
              <el-col :span="24">
                <el-form-item :label="$t('wiredgatewayip.DNS2')" :label-width="formLabelWidth" prop="ippz_dns_by">
                  <el-row>
                    <el-col :span="5">
                      <el-input v-model="ippz_dns_by1"></el-input>
                    </el-col>
                    <el-col :span="1">. </el-col>
                    <el-col :span="5">
                      <el-input v-model="ippz_dns_by2"></el-input>
                    </el-col>
                    <el-col :span="1">.</el-col>
                    <el-col :span="5">
                      <el-input v-model="ippz_dns_by3"></el-input>
                    </el-col>
                    <el-col :span="1">.</el-col>
                    <el-col :span="5">
                      <el-input v-model="ippz_dns_by4"></el-input>
                    </el-col>
                  </el-row>
                </el-form-item>
              </el-col>
            </el-row>
          </el-form>
        </div>
        <div class="footer" :style="this.$i18n.locale==='zh'?'bottom: 2rem;':''">
          <el-button type="primary" @click="submitForm">{{$t('save')}}</el-button>
          <el-button @click="isShow = false">{{$t('cancel')}}</el-button>
        </div>
      </div>
    </div>
  </div>
</template>

<script>
import {SaveUserAnswer, GetUserAnswer, getQueryAnswer} from "@/api/user";
export default {
  name: "TestChiGate",
  data() {
    return {
      loading: false,
      step: "",
      user_id: "",
      formData: {
        ippz_wllx: "",
        ippz_ip: "",
        ippz_zwym: "",
        ippz_wg: "",
        ippz_dns: "",
        ippz_dns_by: "",
      },

      ippz_ip1: "",
      ippz_ip2: "",
      ippz_ip3: "",
      ippz_ip4: "",
      ippz_zwym1: "",
      ippz_zwym2: "",
      ippz_zwym3: "",
      ippz_zwym4: "",
      ippz_wg1: "",
      ippz_wg2: "",
      ippz_wg3: "",
      ippz_wg4: "",
      ippz_dns1: "",
      ippz_dns2: "",
      ippz_dns3: "",
      ippz_dns4: "",
      ippz_dns_by1: "",
      ippz_dns_by2: "",
      ippz_dns_by3: "",
      ippz_dns_by4: "",
      radio: "1",
      labelPosition: "left",
      formLabelWidth: this.$i18n.locale === 'zh'?'150px':'116px',
      count: 0,
      isShow: true,
      rules: {
        ippz_wllx: [
          { required: true, message: this.$t('wiredgatewayip.rules.ippz_wllx'), trigger: "blur" },
        ],
        ippz_ip: [
          {
            required: true,
            message: "",
            validator: this.validateIp,
            trigger: "blur",
          },
        ],
        ippz_zwym: [
          {
            required: true,
            message: "",
            validator: this.validateZwym,
            trigger: "blur",
          },
        ],
        ippz_dns_by: [
          {
            required: true,
            message: "",
            validator: this.validateDnsBy,
            trigger: "blur",
          },
        ],
      },
      //斥候有线所有答案
      ippz_wllx: "",
      ippz_ip: "",
      ippz_zwym: "",
      ippz_wg: "",
      ippz_dns: "",
      ippz_dns_by: "",

      wgpz_wgmc: "",
      wgpz_wgid: "",

      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: "",
    };
  },
  created() {
    this.user_id = window.location.href.split("?")[1];
    this.getUserAnswer();
  },
  mounted() { },

  methods: {
    //子网掩码验证
    validateZwym(rule, value, callback) {
      if (
        this.ippz_zwym1 +
        "." +
        this.ippz_zwym2 +
        "." +
        this.ippz_zwym3 +
        "." +
        this.ippz_zwym4 ===
        "..."
      ) {
        callback(new Error(this.$t('wiredgatewayip.rules.ippz_zwym')));
      } 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.ippz_zwym1 +
          "." +
          this.ippz_zwym2 +
          "." +
          this.ippz_zwym3 +
          "." +
          this.ippz_zwym4
        )
      ) {
        callback(new Error(this.$t('wiredgatewayip.rules.ippz_zwym1')));
      } else {
        callback();
      }
    },
    //ip地址验证
    validateIp(rule, value, callback) {
      if (
        this.ippz_ip1 +
        "." +
        this.ippz_ip2 +
        "." +
        this.ippz_ip3 +
        "." +
        this.ippz_ip4 ===
        "..."
      ) {
        callback(new Error(this.$t('wiredgatewayip.rules.ippz_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.ippz_ip1 +
          "." +
          this.ippz_ip2 +
          "." +
          this.ippz_ip3 +
          "." +
          this.ippz_ip4
        )
      ) {
        callback(new Error(this.$t('wiredgatewayip.rules.ippz_ip1')));
      } else {
        callback();
      }
    },
    //网关验证
    validateMrwg(rule, value, callback) {
      if (
        this.ippz_wg1 +
        "." +
        this.ippz_wg2 +
        "." +
        this.ippz_wg3 +
        "." +
        this.ippz_wg4 ===
        "..."
      ) {
        callback(new Error("请输入网关地址"));
      } 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.ippz_wg1 +
          "." +
          this.ippz_wg2 +
          "." +
          this.ippz_wg3 +
          "." +
          this.ippz_wg4
        )
      ) {
        callback(new Error("请输入有效的网关地址"));
      } else {
        callback();
      }
    },
    //备选dns服务验证
    validateDnsBy(rule, value, callback) {
      if (
        this.ippz_dns_by1 +
        "." +
        this.ippz_dns_by2 +
        "." +
        this.ippz_dns_by3 +
        "." +
        this.ippz_dns_by4 ===
        "..."
      ) {
        callback(new Error(this.$t('wiredgatewayip.rules.ippz_dns_by')));
      } 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.ippz_dns_by1 +
          "." +
          this.ippz_dns_by2 +
          "." +
          this.ippz_dns_by3 +
          "." +
          this.ippz_dns_by4
        )
      ) {
        callback(new Error(this.$t('wiredgatewayip.rules.ippz_dns_by1')));
      } else {
        callback();
      }
    },
    // 提交时的校验
    submitForm() {
      this.$refs["formData"].validate((valid) => {
        if (valid) {
          this.saveAll();
        } else {
          console.log("error submit!!");
          return false;
        }
      });
    },
    Merge(value, value1, value2, value3, value4) {
      value = value1 + "." + value2 + "." + value3 + "." + value4;
      return value;
    },
    SliceData(value) {
      let res = value.split(".");
      // console.log(res);
      return res;
    },
    // 保存数据,发送请求
    async saveAll() {
      this.isShow = false;
      let obj = {
        ippz_wllx: this.formData.ippz_wllx,
        ippz_ip:
          this.ippz_ip1 +
          "." +
          this.ippz_ip2 +
          "." +
          this.ippz_ip3 +
          "." +
          this.ippz_ip4,
        ippz_zwym:
          this.ippz_zwym1 +
          "." +
          this.ippz_zwym2 +
          "." +
          this.ippz_zwym3 +
          "." +
          this.ippz_zwym4,
        ippz_wg:
          this.ippz_wg1 +
          "." +
          this.ippz_wg2 +
          "." +
          this.ippz_wg3 +
          "." +
          this.ippz_wg4,
        ippz_dns:
          this.ippz_dns1 +
          "." +
          this.ippz_dns2 +
          "." +
          this.ippz_dns3 +
          "." +
          this.ippz_dns4,
        ippz_dns_by:
          this.ippz_dns_by1 +
          "." +
          this.ippz_dns_by2 +
          "." +
          this.ippz_dns_by3 +
          "." +
          this.ippz_dns_by4,
        wgpz_wgmc: this.wgpz_wgmc,
        wgpz_wgid: this.wgpz_wgid,

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

        cjdpz_tagid: this.cjdpz_tagid,
        cjdpz_mc: this.cjdpz_mc,
        cjdpz_sjq: this.cjdpz_sjq,
        cjdpz_jcqdz: this.cjdpz_jcqdz,
        cjdpz_cjsjlx: this.cjdpz_cjsjlx,
        cjdpz_dxsx: this.cjdpz_dxsx,
        cjdpz_scms: this.cjdpz_scms,

        mqtt_ip: this.mqtt_ip,
        mqtt_wgsn: this.mqtt_wgsn,
        mqtt_port: this.mqtt_port,
        mqtt_keepalive: this.mqtt_keepalive,
        mqtt_sssjfbzt: this.mqtt_sssjfbzt,
        mqtt_qos: this.mqtt_qos,

        mqtt_cjd_sbmc: this.mqtt_cjd_sbmc,
        mqtt_cjd_tagid: this.mqtt_cjd_tagid,
      };
      // alert(JSON.stringify(obj), 'chuan');
      let res = await SaveUserAnswer({
        mark: "CHGYWG_yx",
        user_id: this.user_id,
        mark_value: JSON.stringify(obj),
        step: this.step,
      });
      // alert(res);
      // alert(JSON.stringify(res.data.data.mark_value), 'cun');
      if (res.data.state) {
        this.$message({
          message: this.$t('success'),
          type: "success",
        });
      } else {
        this.$message({
          message: `保存失败`,
          type: "error",
        });
      }
    },
    //读取缓存
    async getUserAnswer() {
      this.loading = true;
      let { data } = await GetUserAnswer({
        mark: "CHGYWG_yx",
        user_id: this.user_id,
      });
      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)
          console.log(obj,'默认值')
          this.formData.ippz_wllx = obj.ippz_wllx;
          if (obj.ippz_ip != "") {
            this.ippz_ip1 = obj.ippz_ip.split(".")[0];
            this.ippz_ip2 = obj.ippz_ip.split(".")[1];
            this.ippz_ip3 = obj.ippz_ip.split(".")[2];
            this.ippz_ip4 = obj.ippz_ip.split(".")[3];
            this.ippz_zwym1 = obj.ippz_zwym.split(".")[0];
            this.ippz_zwym2 = obj.ippz_zwym.split(".")[1];
            this.ippz_zwym3 = obj.ippz_zwym.split(".")[2];
            this.ippz_zwym4 = obj.ippz_zwym.split(".")[3];
            this.ippz_wg1 = obj.ippz_wg.split(".")[0];
            this.ippz_wg2 = obj.ippz_wg.split(".")[1];
            this.ippz_wg3 = obj.ippz_wg.split(".")[2];
            this.ippz_wg4 = obj.ippz_wg.split(".")[3];
            this.ippz_dns1 = obj.ippz_dns.split(".")[0];
            this.ippz_dns2 = obj.ippz_dns.split(".")[1];
            this.ippz_dns3 = obj.ippz_dns.split(".")[2];
            this.ippz_dns4 = obj.ippz_dns.split(".")[3];
            this.ippz_dns_by1 = obj.ippz_dns_by.split(".")[0];
            this.ippz_dns_by2 = obj.ippz_dns_by.split(".")[1];
            this.ippz_dns_by3 = obj.ippz_dns_by.split(".")[2];
            this.ippz_dns_by4 = obj.ippz_dns_by.split(".")[3];
          }
          // else {
          //拿到缓存数据保存在本页面
          this.ippz_wllx = obj.ippz_wllx;
          this.ippz_ip = obj.ippz_ip;
          this.ippz_zwym = obj.ippz_zwym;
          this.ippz_wg = obj.ippz_wg;
          this.ippz_dns = obj.ippz_dns;
          this.ippz_dns_by = obj.ippz_dns_by;

          this.wgpz_wgmc = obj.wgpz_wgmc;
          this.wgpz_wgid = obj.wgpz_wgid;

          this.sbpz_sbmc = obj.sbpz_sbmc;
          this.sbpz_kzqxy = obj.sbpz_kzqxy;
          this.sbpz_ip = obj.sbpz_ip;
          this.sbpz_port = obj.sbpz_port;
          this.sbpz_czdz = obj.sbpz_czdz;
          this.sbpz_lxzq = obj.sbpz_lxzq;
          this.sbpz_qyhmcj = obj.sbpz_qyhmcj;
          this.sbpz_qyplcj = obj.sbpz_qyplcj;
          this.sbpz_zdplcjs = obj.sbpz_zdplcjs;
          this.sbpz_cjcgsj = obj.sbpz_cjcgsj;
          this.sbpz_zqsbonchange = obj.sbpz_zqsbonchange;
          this.sbpz_txsjjg = obj.sbpz_txsjjg;
          this.sbpz_xqjcqxr = obj.sbpz_xqjcqxr;
          this.sbpz_bcjcqxr = obj.sbpz_bcjcqxr;

          this.cjdpz_tagid = obj.cjdpz_tagid;
          this.cjdpz_mc = obj.cjdpz_mc;
          this.cjdpz_sjq = obj.cjdpz_sjq;
          this.cjdpz_jcqdz = obj.cjdpz_jcqdz;
          this.cjdpz_cjsjlx = obj.cjdpz_cjsjlx;
          this.cjdpz_dxsx = obj.cjdpz_dxsx;
          this.cjdpz_scms = obj.cjdpz_scms;

          this.mqtt_ip = obj.mqtt_ip;
          this.mqtt_wgsn = obj.mqtt_wgsn;
          this.mqtt_port = obj.mqtt_port;
          this.mqtt_keepalive = obj.mqtt_keepalive;
          this.mqtt_sssjfbzt = obj.mqtt_sssjfbzt;
          this.mqtt_qos = obj.mqtt_qos;
          // this.mqtt_tls = obj.mqtt_tls;
          // this.mqtt_clearsession = obj.mqtt_clearsession;

          this.mqtt_cjd_sbmc = obj.mqtt_cjd_sbmc;
          this.mqtt_cjd_tagid = obj.mqtt_cjd_tagid;
        })
      }
      // console.log(data, "斥候有线保存的答案第一个页面");
      // console.log(JSON.parse(data.data.mark_value));
      if (data.data !== null && data.state) {
        if (data.data.step) {
          this.step = data.data.step;
        }
        var obj = JSON.parse(data.data.mark_value);
        console.log(obj,'xxx');
        this.formData.ippz_wllx = obj.ippz_wllx;
        if (obj.ippz_ip != "") {
          this.ippz_ip1 = obj.ippz_ip.split(".")[0];
          this.ippz_ip2 = obj.ippz_ip.split(".")[1];
          this.ippz_ip3 = obj.ippz_ip.split(".")[2];
          this.ippz_ip4 = obj.ippz_ip.split(".")[3];
          this.ippz_zwym1 = obj.ippz_zwym.split(".")[0];
          this.ippz_zwym2 = obj.ippz_zwym.split(".")[1];
          this.ippz_zwym3 = obj.ippz_zwym.split(".")[2];
          this.ippz_zwym4 = obj.ippz_zwym.split(".")[3];
          this.ippz_wg1 = obj.ippz_wg.split(".")[0];
          this.ippz_wg2 = obj.ippz_wg.split(".")[1];
          this.ippz_wg3 = obj.ippz_wg.split(".")[2];
          this.ippz_wg4 = obj.ippz_wg.split(".")[3];
          this.ippz_dns1 = obj.ippz_dns.split(".")[0];
          this.ippz_dns2 = obj.ippz_dns.split(".")[1];
          this.ippz_dns3 = obj.ippz_dns.split(".")[2];
          this.ippz_dns4 = obj.ippz_dns.split(".")[3];
          this.ippz_dns_by1 = obj.ippz_dns_by.split(".")[0];
          this.ippz_dns_by2 = obj.ippz_dns_by.split(".")[1];
          this.ippz_dns_by3 = obj.ippz_dns_by.split(".")[2];
          this.ippz_dns_by4 = obj.ippz_dns_by.split(".")[3];
        }
        // else {
        //拿到缓存数据保存在本页面
        this.ippz_wllx = obj.ippz_wllx;
        this.ippz_ip = obj.ippz_ip;
        this.ippz_zwym = obj.ippz_zwym;
        this.ippz_wg = obj.ippz_wg;
        this.ippz_dns = obj.ippz_dns;
        this.ippz_dns_by = obj.ippz_dns_by;

        this.wgpz_wgmc = obj.wgpz_wgmc;
        this.wgpz_wgid = obj.wgpz_wgid;

        this.sbpz_sbmc = obj.sbpz_sbmc;
        this.sbpz_kzqxy = obj.sbpz_kzqxy;
        this.sbpz_ip = obj.sbpz_ip;
        this.sbpz_port = obj.sbpz_port;
        this.sbpz_czdz = obj.sbpz_czdz;
        this.sbpz_lxzq = obj.sbpz_lxzq;
        this.sbpz_qyhmcj = obj.sbpz_qyhmcj;
        this.sbpz_qyplcj = obj.sbpz_qyplcj;
        this.sbpz_zdplcjs = obj.sbpz_zdplcjs;
        this.sbpz_cjcgsj = obj.sbpz_cjcgsj;
        this.sbpz_zqsbonchange = obj.sbpz_zqsbonchange;
        this.sbpz_txsjjg = obj.sbpz_txsjjg;
        this.sbpz_xqjcqxr = obj.sbpz_xqjcqxr;
        this.sbpz_bcjcqxr = obj.sbpz_bcjcqxr;

        this.cjdpz_tagid = obj.cjdpz_tagid;
        this.cjdpz_mc = obj.cjdpz_mc;
        this.cjdpz_sjq = obj.cjdpz_sjq;
        this.cjdpz_jcqdz = obj.cjdpz_jcqdz;
        this.cjdpz_cjsjlx = obj.cjdpz_cjsjlx;
        this.cjdpz_dxsx = obj.cjdpz_dxsx;
        this.cjdpz_scms = obj.cjdpz_scms;

        this.mqtt_ip = obj.mqtt_ip;
        this.mqtt_wgsn = obj.mqtt_wgsn;
        this.mqtt_port = obj.mqtt_port;
        this.mqtt_keepalive = obj.mqtt_keepalive;
        this.mqtt_sssjfbzt = obj.mqtt_sssjfbzt;
        this.mqtt_qos = obj.mqtt_qos;
        // this.mqtt_tls = obj.mqtt_tls;
        // this.mqtt_clearsession = obj.mqtt_clearsession;

        this.mqtt_cjd_sbmc = obj.mqtt_cjd_sbmc;
        this.mqtt_cjd_tagid = obj.mqtt_cjd_tagid;
        // }
      }
    },
  },
};
</script>

<style lang="less" scoped>
.zh-pro{
  color: rgba(189, 49, 36, 1);
  margin-bottom: 15px;
}
.gateway {
  position: absolute;
  top: 145px;
  left: 50%;
  transform: translateX(-50%);
  width: 470px;
  // height:358px;
  height: 500px;
  // height: 725px;
  line-height: 20px;
  // background-color: rgba(255, 255, 255, 1);
  // text-align: center;
  background: url(../assets/image/bg.png);
  background-size: 100% 100%;
  border: 1px solid rgba(187, 187, 187, 1);

  .title {
    margin: 13px 6px 0px 25px;
    display: flex;
    justify-content: space-between;

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

    .title_center {
      width: 288px;
      height: 26px;
      line-height: 26px;
      color: rgba(189, 49, 36, 1);
      font-size: 18px;
      text-align: left;
    }

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

  .content {
    margin: 0px 53px 0px 56px;

    /deep/.lan {
      .el-input__inner {
        height: 30px;
        text-align: center;
        padding: 0;
      }

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

        .el-col-1 {
          padding-left: 2px;
          color: black;
          text-align: left;
          line-height: 15px;
          height: 20px;
        }

        .el-col-24 {
          padding-right: 32px;
        }
      }
    }
  }
  .zhContent{
    .el-col-24 {
      padding-right: 0 !important;
    }
  }
  /deep/ .footer {
    position: absolute;
    left: 50%;

    transform: translateX(-50%);

    .el-button {
      width: 80px;
      height: 30px;
      line-height: 0.5;
    }
  }
}
</style>
